From a0ff3fb870fb2c45a23174878c19f2d8fd34d089 Mon Sep 17 00:00:00 2001 From: MiriBerezin <73054714+MiriBerezin@users.noreply.github.com> Date: Mon, 12 Jul 2021 12:01:56 +0300 Subject: [PATCH] Adding new apis (#14910) * Adding new apis: BulkCollectionsAction QueryApprovedPlans * Fix queryApprovedOffers api * fix prettier check * Fix queryApprovedPlans API * Fix queryApprovedPlans response to list instead if disctionary --- .../stable/2021-06-01/Marketplace.json | 203 ++++++++++++++++++ .../examples/BulkCollectionsAction.json | 33 +++ .../examples/QueryApprovedPlans.json | 42 ++++ 3 files changed, 278 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..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 @@ -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 map of plans and related approved subscriptions.", + "parameters": [ + { + "in": "body", + "name": "payload", + "schema": { + "$ref": "#/definitions/QueryApprovedPlansPayload" + } + } + ], + "responses": { + "200": { + "description": "Map of plan ids and their related approved subscriptions.", + "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,119 @@ } } }, + "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" + }, + "planIds": { + "description": "Offer plan ids", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "QueryApprovedPlansResponse": { + "description": "Query approved plans response", + "type": "object", + "properties": { + "details": { + "$ref": "#/definitions/QueryApprovedPlansResponseDetails" + } + } + }, + "QueryApprovedPlansResponseDetails": { + "description": "A list indicating for each plan which subscriptions are approved. Plan Id is unique", + "type": "array", + "items": { + "$ref": "#/definitions/QueryApprovedPlansDetails" + } + }, + "QueryApprovedPlansDetails": { + "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", + "items": { + "type": "string" + } + }, + "allSubscriptions": { + "description": "Indicates whether all subscriptions are approved for this plan", + "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..9991d3554dbd --- /dev/null +++ b/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-06-01/examples/QueryApprovedPlans.json @@ -0,0 +1,42 @@ +{ + "parameters": { + "privateStoreId": "a0e28e55-90c4-41d8-8e34-bb7ef7775406", + "api-version": "2021-06-01", + "payload": { + "properties": { + "offerId": "marketplacetestthirdparty.md-test-third-party-2", + "planIds": [ + "testPlanA", + "testPlanB", + "testPlanC" + ] + } + } + }, + "responses": { + "200": { + "body": { + "details": [ + { + "planId": "testPlanA", + "subscriptionIds": [ + "85e3e079-c718-4e4c-abbe-f72fceba8305", + "7752d461-4bf1-4185-8b56-8a3f11486ac6" + ], + "allSubscriptions": false + }, + { + "planId": "testPlanB", + "subscriptionIds": [], + "allSubscriptions": true + }, + { + "planId": "testPlanC", + "subscriptionIds": [], + "allSubscriptions": false + } + ] + } + } + } +}