From f8e0f7095c51aefec2690fd3e806ce5157d2c81a Mon Sep 17 00:00:00 2001 From: Miri Berezin Date: Mon, 21 Jun 2021 19:24:33 +0300 Subject: [PATCH 1/5] Adding new apis: BulkCollectionsAction QueryApprovedPlans --- .../stable/2021-06-01/Marketplace.json | 190 ++++++++++++++++++ .../examples/BulkCollectionsAction.json | 33 +++ .../examples/QueryApprovedPlans.json | 25 +++ 3 files changed, 248 insertions(+) create mode 100644 specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/examples/BulkCollectionsAction.json create mode 100644 specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/examples/QueryApprovedPlans.json diff --git a/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/Marketplace.json b/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/Marketplace.json index daaf091ace01..180b38d80f86 100644 --- a/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/Marketplace.json +++ b/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/Marketplace.json @@ -482,6 +482,96 @@ } } }, + "/providers/Microsoft.Marketplace/privateStores/{privateStoreId}/queryApprovedPlans": { + "parameters": [ + { + "$ref": "#/parameters/PrivateStoreIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "post": { + "tags": [ + "PrivateStores" + ], + "operationId": "PrivateStore_QueryApprovedPlans", + "description": "Get the list of approved plans for an offer regarding a specific subscription", + "parameters": [ + { + "in": "body", + "name": "payload", + "schema": { + "$ref": "#/definitions/QueryApprovedPlansPayload" + } + } + ], + "responses": { + "200": { + "description": "List of approved plan ids.", + "schema": { + "$ref": "#/definitions/QueryApprovedPlansResponse" + } + }, + "default": { + "description": "Microsoft.Marketplace error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "QueryApprovedPlans": { + "$ref": "./examples/QueryApprovedPlans.json" + } + } + } + }, + "/providers/Microsoft.Marketplace/privateStores/{privateStoreId}/bulkCollectionsAction": { + "parameters": [ + { + "$ref": "#/parameters/PrivateStoreIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "post": { + "tags": [ + "PrivateStores" + ], + "operationId": "PrivateStore_BulkCollectionsAction", + "description": "Perform an action on bulk collections", + "parameters": [ + { + "in": "body", + "name": "payload", + "schema": { + "$ref": "#/definitions/BulkCollectionsPayload" + } + } + ], + "responses": { + "200": { + "description": "The collections id and name that the action was performed on", + "schema": { + "$ref": "#/definitions/BulkCollectionsResponse" + } + }, + "default": { + "description": "Microsoft.Marketplace error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "BulkCollectionsAction": { + "$ref": "./examples/BulkCollectionsAction.json" + } + } + } + }, "/providers/Microsoft.Marketplace/privateStores/{privateStoreId}/collections/{collectionId}/offers": { "parameters": [ { @@ -2039,6 +2129,106 @@ } } }, + "BulkCollectionsPayload": { + "description": "Bulk collections action properties", + "type": "object", + "properties": { + "properties": { + "$ref": "#/definitions/BulkCollectionsDetails", + "description": "bulk collections properties details", + "x-ms-client-flatten": true + } + } + }, + "BulkCollectionsDetails": { + "description": "Bulk collection details", + "type": "object", + "properties": { + "collectionIds": { + "description": "collection ids list that the action is performed on", + "type": "array", + "items": { + "type": "string" + } + }, + "action": { + "description": "Action to perform (For example: EnableCollections, DisableCollections)", + "type": "string" + } + } + }, + "BulkCollectionsResponse": { + "description": "The bulk collections response. The response contains two lists that indicate for each collection whether the operation succeeded or failed", + "type": "object", + "properties": { + "succeeded": { + "description": "Succeeded collections", + "type": "array", + "items": { + "$ref": "#/definitions/CollectionsDetails" + } + }, + "failed": { + "description": "Failed collections", + "type": "array", + "items": { + "$ref": "#/definitions/CollectionsDetails" + } + } + } + }, + "QueryApprovedPlansPayload": { + "description": "Query approved plans payload", + "type": "object", + "properties": { + "properties": { + "$ref": "#/definitions/QueryApprovedPlans", + "description": "Query approved plans details", + "x-ms-client-flatten": true + } + } + }, + "QueryApprovedPlans": { + "description": "Query approved plans details", + "type": "object", + "properties": { + "offerId": { + "description": "Offer id", + "type": "string" + }, + "subscriptionId": { + "description": "Subscription id", + "type": "string" + } + } + }, + "QueryApprovedPlansResponse": { + "description": "Query approved plans response", + "type": "object", + "properties": { + "details": { + "$ref": "#/definitions/QueryApprovedPlansDetails", + "description": "Query approved plans details" + } + } + }, + "QueryApprovedPlansDetails": { + "description": "Query approved plans response", + "type": "object", + "properties": { + "planIds": { + "description": "Approved plan ids list. In case of all plans are approved, allPlans flag is true and list is empty", + "type": "array", + "items": { + "type": "string" + } + }, + "allPlans": { + "description": "Indicates whether all plans are approved", + "type": "boolean" + } + } + }, "CollectionsDetails": { "description": "Collection name and id.", "type": "object", diff --git a/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/examples/BulkCollectionsAction.json b/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/examples/BulkCollectionsAction.json new file mode 100644 index 000000000000..73ecabd1936a --- /dev/null +++ b/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/examples/BulkCollectionsAction.json @@ -0,0 +1,33 @@ +{ + "parameters": { + "privateStoreId": "a0e28e55-90c4-41d8-8e34-bb7ef7775406", + "api-version": "2021-06-01", + "payload": { + "properties": { + "collectionIds": [ + "c752f021-1c37-4af5-b82f-74c51c27b44a", + "f47ef1c7-e908-4f39-ae29-db181634ad8d" + ], + "action": "EnableCollections" + } + } + }, + "responses": { + "200": { + "body": { + "succeeded": [ + { + "collectionId": "c752f021-1c37-4af5-b82f-74c51c27b44a", + "collectionName": "Test collection" + } + ], + "failed": [ + { + "collectionId": "f47ef1c7-e908-4f39-ae29-db181634ad8d", + "collectionName": "Test collection 2" + } + ] + } + } + } +} diff --git a/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/examples/QueryApprovedPlans.json b/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/examples/QueryApprovedPlans.json new file mode 100644 index 000000000000..f24e7fd54777 --- /dev/null +++ b/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/examples/QueryApprovedPlans.json @@ -0,0 +1,25 @@ +{ + "parameters": { + "privateStoreId": "a0e28e55-90c4-41d8-8e34-bb7ef7775406", + "api-version": "2021-06-01", + "payload": { + "properties": { + "offerId": "marketplacetestthirdparty.md-test-third-party-2", + "subscriptionId": "b340914e-353d-453a-85fb-8f9b65b51f91" + } + } + }, + "responses": { + "200": { + "body": { + "details": { + "planIds": [ + "0001", + "0002" + ], + "allPlans": false + } + } + } + } +} From 0c4a9848b47daafbe493c70a023b3ac0d4783f85 Mon Sep 17 00:00:00 2001 From: Miri Berezin Date: Thu, 24 Jun 2021 17:37:22 +0300 Subject: [PATCH 2/5] Fix queryApprovedOffers api --- .../stable/2021-06-01/Marketplace.json | 40 +++++++++++++------ .../examples/QueryApprovedPlans.json | 22 ++++++---- 2 files changed, 43 insertions(+), 19 deletions(-) diff --git a/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/Marketplace.json b/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/Marketplace.json index 180b38d80f86..7b9ca9517f63 100644 --- a/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/Marketplace.json +++ b/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/Marketplace.json @@ -496,7 +496,7 @@ "PrivateStores" ], "operationId": "PrivateStore_QueryApprovedPlans", - "description": "Get the list of approved plans for an offer regarding a specific subscription", + "description": "Get map of plans and related approved subscriptions.", "parameters": [ { "in": "body", @@ -508,7 +508,7 @@ ], "responses": { "200": { - "description": "List of approved plan ids.", + "description": "Map of plan ids and their related approved subscriptions.", "schema": { "$ref": "#/definitions/QueryApprovedPlansResponse" } @@ -2195,10 +2195,6 @@ "offerId": { "description": "Offer id", "type": "string" - }, - "subscriptionId": { - "description": "Subscription id", - "type": "string" } } }, @@ -2207,24 +2203,44 @@ "type": "object", "properties": { "details": { - "$ref": "#/definitions/QueryApprovedPlansDetails", - "description": "Query approved plans details" + "$ref": "#/definitions/QueryApprovedPlansResponseDetails" } } }, + "QueryApprovedPlansResponseDetails": { + "description": "Query approved plans response details", + "type": "object", + "properties": { + "allPlans": { + "description": "This object indicates the case of all current and future plans are approved", + "$ref": "#/definitions/QueryApprovedPlansDetails" + }, + "partialPlans": { + "$ref": "#/definitions/PartialPlansObject", + "description": "This object indicates the case of partials (or just current) plans are approved" + } + } + }, + "PartialPlansObject": { + "description": "This object indicates the case of partials (or just current) plans are approved", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/QueryApprovedPlansDetails" + } + }, "QueryApprovedPlansDetails": { "description": "Query approved plans response", "type": "object", "properties": { - "planIds": { - "description": "Approved plan ids list. In case of all plans are approved, allPlans flag is true and list is empty", + "subscriptionIds": { + "description": "approved subscription ids list. In case all subscriptions are approved for a plan, allSubscriptions flag is true and list is empty ( else flag is set to false)", "type": "array", "items": { "type": "string" } }, - "allPlans": { - "description": "Indicates whether all plans are approved", + "allSubscriptions": { + "description": "Indicates whether all subscriptions are approved for this plan", "type": "boolean" } } diff --git a/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/examples/QueryApprovedPlans.json b/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/examples/QueryApprovedPlans.json index f24e7fd54777..6f97111a2b08 100644 --- a/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/examples/QueryApprovedPlans.json +++ b/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/examples/QueryApprovedPlans.json @@ -4,8 +4,7 @@ "api-version": "2021-06-01", "payload": { "properties": { - "offerId": "marketplacetestthirdparty.md-test-third-party-2", - "subscriptionId": "b340914e-353d-453a-85fb-8f9b65b51f91" + "offerId": "marketplacetestthirdparty.md-test-third-party-2" } } }, @@ -13,11 +12,20 @@ "200": { "body": { "details": { - "planIds": [ - "0001", - "0002" - ], - "allPlans": false + "allPlans": null, + "partialPlans": { + "0001": { + "subscriptionIds": [ + "85e3e079-c718-4e4c-abbe-f72fceba8305", + "7752d461-4bf1-4185-8b56-8a3f11486ac6" + ], + "allSubscriptions": false + }, + "0002": { + "subscriptionIds": [], + "allSubscriptions": true + } + } } } } From 8d0a5636b6b3f4e0f0715a5798c2ba2be7e5020b Mon Sep 17 00:00:00 2001 From: Miri Berezin Date: Thu, 24 Jun 2021 17:42:40 +0300 Subject: [PATCH 3/5] fix prettier check --- .../Microsoft.Marketplace/stable/2021-06-01/Marketplace.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/Marketplace.json b/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/Marketplace.json index 7b9ca9517f63..5706f3ffa535 100644 --- a/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/Marketplace.json +++ b/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/Marketplace.json @@ -2218,7 +2218,7 @@ "partialPlans": { "$ref": "#/definitions/PartialPlansObject", "description": "This object indicates the case of partials (or just current) plans are approved" - } + } } }, "PartialPlansObject": { From 74c351fd9e3587ec788a067c91ccfd511725562c Mon Sep 17 00:00:00 2001 From: Miri Berezin Date: Sun, 27 Jun 2021 10:52:27 +0300 Subject: [PATCH 4/5] Fix queryApprovedPlans API --- .../stable/2021-06-01/Marketplace.json | 25 +++++--------- .../examples/QueryApprovedPlans.json | 34 +++++++++++-------- 2 files changed, 29 insertions(+), 30 deletions(-) diff --git a/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/Marketplace.json b/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/Marketplace.json index 5706f3ffa535..f2b5661f0a06 100644 --- a/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/Marketplace.json +++ b/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/Marketplace.json @@ -2195,6 +2195,13 @@ "offerId": { "description": "Offer id", "type": "string" + }, + "planIds": { + "description": "Offer plan ids", + "type": "array", + "items": { + "type": "string" + } } } }, @@ -2208,21 +2215,7 @@ } }, "QueryApprovedPlansResponseDetails": { - "description": "Query approved plans response details", - "type": "object", - "properties": { - "allPlans": { - "description": "This object indicates the case of all current and future plans are approved", - "$ref": "#/definitions/QueryApprovedPlansDetails" - }, - "partialPlans": { - "$ref": "#/definitions/PartialPlansObject", - "description": "This object indicates the case of partials (or just current) plans are approved" - } - } - }, - "PartialPlansObject": { - "description": "This object indicates the case of partials (or just current) plans are approved", + "description": "A map indicating for each plan which subscriptions are approved.Map key is plan id.", "type": "object", "additionalProperties": { "$ref": "#/definitions/QueryApprovedPlansDetails" @@ -2233,7 +2226,7 @@ "type": "object", "properties": { "subscriptionIds": { - "description": "approved subscription ids list. In case all subscriptions are approved for a plan, allSubscriptions flag is true and list is empty ( else flag is set to false)", + "description": "Approved subscription ids list. In case all subscriptions are approved for a plan, allSubscriptions flag is true and list is empty ( else flag is set to false). In case both subscriptions list is empty and allSubscriptions flag is false, the plan is not approved for any subscription.", "type": "array", "items": { "type": "string" diff --git a/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/examples/QueryApprovedPlans.json b/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/examples/QueryApprovedPlans.json index 6f97111a2b08..afa8b50f0d42 100644 --- a/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/examples/QueryApprovedPlans.json +++ b/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/examples/QueryApprovedPlans.json @@ -4,7 +4,12 @@ "api-version": "2021-06-01", "payload": { "properties": { - "offerId": "marketplacetestthirdparty.md-test-third-party-2" + "offerId": "marketplacetestthirdparty.md-test-third-party-2", + "planIds": [ + "testPlanA", + "testPlanB", + "testPlanC" + ] } } }, @@ -12,19 +17,20 @@ "200": { "body": { "details": { - "allPlans": null, - "partialPlans": { - "0001": { - "subscriptionIds": [ - "85e3e079-c718-4e4c-abbe-f72fceba8305", - "7752d461-4bf1-4185-8b56-8a3f11486ac6" - ], - "allSubscriptions": false - }, - "0002": { - "subscriptionIds": [], - "allSubscriptions": true - } + "testPlanA": { + "subscriptionIds": [ + "85e3e079-c718-4e4c-abbe-f72fceba8305", + "7752d461-4bf1-4185-8b56-8a3f11486ac6" + ], + "allSubscriptions": false + }, + "testPlanB": { + "subscriptionIds": [], + "allSubscriptions": true + }, + "testPlanC": { + "subscriptionIds": [], + "allSubscriptions": false } } } From e286f0b2680a25ccd5ff792a6a35e34348efaf6e Mon Sep 17 00:00:00 2001 From: Miri Berezin Date: Fri, 2 Jul 2021 09:00:32 +0300 Subject: [PATCH 5/5] Fix queryApprovedPlans response to list instead if disctionary --- .../stable/2021-06-01/Marketplace.json | 10 +++++++--- .../2021-06-01/examples/QueryApprovedPlans.json | 13 ++++++++----- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/Marketplace.json b/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/Marketplace.json index f2b5661f0a06..66059897c269 100644 --- a/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/Marketplace.json +++ b/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/Marketplace.json @@ -2215,9 +2215,9 @@ } }, "QueryApprovedPlansResponseDetails": { - "description": "A map indicating for each plan which subscriptions are approved.Map key is plan id.", - "type": "object", - "additionalProperties": { + "description": "A list indicating for each plan which subscriptions are approved. Plan Id is unique", + "type": "array", + "items": { "$ref": "#/definitions/QueryApprovedPlansDetails" } }, @@ -2225,6 +2225,10 @@ "description": "Query approved plans response", "type": "object", "properties": { + "planId": { + "description": "Plan id", + "type": "string" + }, "subscriptionIds": { "description": "Approved subscription ids list. In case all subscriptions are approved for a plan, allSubscriptions flag is true and list is empty ( else flag is set to false). In case both subscriptions list is empty and allSubscriptions flag is false, the plan is not approved for any subscription.", "type": "array", diff --git a/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/examples/QueryApprovedPlans.json b/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/examples/QueryApprovedPlans.json index afa8b50f0d42..9991d3554dbd 100644 --- a/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/examples/QueryApprovedPlans.json +++ b/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/examples/QueryApprovedPlans.json @@ -16,23 +16,26 @@ "responses": { "200": { "body": { - "details": { - "testPlanA": { + "details": [ + { + "planId": "testPlanA", "subscriptionIds": [ "85e3e079-c718-4e4c-abbe-f72fceba8305", "7752d461-4bf1-4185-8b56-8a3f11486ac6" ], "allSubscriptions": false }, - "testPlanB": { + { + "planId": "testPlanB", "subscriptionIds": [], "allSubscriptions": true }, - "testPlanC": { + { + "planId": "testPlanC", "subscriptionIds": [], "allSubscriptions": false } - } + ] } } }