Skip to content

Commit

Permalink
Adding new apis (Azure#14910)
Browse files Browse the repository at this point in the history
* Adding new apis:
BulkCollectionsAction
QueryApprovedPlans

* Fix queryApprovedOffers api

* fix prettier check

* Fix queryApprovedPlans API

* Fix queryApprovedPlans response to list instead if disctionary
  • Loading branch information
MiriBerezin authored and mkarmark committed Jul 20, 2021
1 parent 3d6b1f4 commit a0ff3fb
Show file tree
Hide file tree
Showing 3 changed files with 278 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
{
Expand Down Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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
}
]
}
}
}
}

0 comments on commit a0ff3fb

Please sign in to comment.