Skip to content

Commit cdc8706

Browse files
authored
Fixing billing RP promotions S360 swagger issues (#17451)
* Adding 2020-09-Preview same as 11-preview * fixing lint issue * fixing model * fixing model * fixing model * pretify fix * fixing linting * more linting fix * fixing swagger correctness * Fixing swagger * fixing swagger * Adding operations API * fixing validation error * fixing version param * Fixing the operations API * fixing missing reference * fixing swagger model * fixing object type * fixing more swagge validations * removing operations * removing operations * fixing model * fixing path * fxing swagger
1 parent ee9fe98 commit cdc8706

File tree

7 files changed

+545
-93
lines changed

7 files changed

+545
-93
lines changed
Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
{
2+
"swagger": "2.0",
3+
"info": {
4+
"version": "2020-09-01-preview",
5+
"title": "BillingManagementClient",
6+
"description": "Billing client provides access to billing resources for Azure subscriptions."
7+
},
8+
"host": "management.azure.com",
9+
"schemes": [
10+
"https"
11+
],
12+
"consumes": [
13+
"application/json"
14+
],
15+
"produces": [
16+
"application/json"
17+
],
18+
"paths": {
19+
"/providers/Microsoft.Billing/operations": {
20+
"get": {
21+
"tags": [
22+
"Operations"
23+
],
24+
"operationId": "Operations_List",
25+
"description": "Lists the available billing REST API operations.",
26+
"externalDocs": {
27+
"url": "https://docs.microsoft.com/en-us/rest/api/billing/"
28+
},
29+
"parameters": [
30+
{
31+
"$ref": "#/parameters/apiVersionParameter"
32+
}
33+
],
34+
"responses": {
35+
"200": {
36+
"description": "OK. The request has succeeded.",
37+
"schema": {
38+
"$ref": "#/definitions/OperationListResult"
39+
}
40+
},
41+
"default": {
42+
"description": "Error response describing why the operation failed.",
43+
"schema": {
44+
"$ref": "#/definitions/OperationsErrorResponse"
45+
}
46+
}
47+
},
48+
"x-ms-pageable": {
49+
"nextLinkName": "nextLink"
50+
}
51+
}
52+
}
53+
},
54+
"definitions": {
55+
"OperationListResult": {
56+
"description": "The list of billing operations and a URL link to get the next set of results.",
57+
"type": "object",
58+
"properties": {
59+
"value": {
60+
"description": "The list of billing operations supported by the Microsoft.Billing resource provider.",
61+
"type": "array",
62+
"readOnly": true,
63+
"items": {
64+
"$ref": "#/definitions/Operation"
65+
}
66+
},
67+
"nextLink": {
68+
"description": "URL to get the next set of operation list results if there are any.",
69+
"type": "string",
70+
"readOnly": true
71+
}
72+
}
73+
},
74+
"Operation": {
75+
"description": "A Billing REST API operation.",
76+
"type": "object",
77+
"properties": {
78+
"name": {
79+
"description": "Operation name: {provider}/{resource}/{operation}.",
80+
"type": "string",
81+
"readOnly": true
82+
},
83+
"isDataAction": {
84+
"description": "Identifies if the operation is a data operation.",
85+
"type": "boolean",
86+
"readOnly": true
87+
},
88+
"display": {
89+
"description": "The object that represents the operation.",
90+
"type": "object",
91+
"properties": {
92+
"provider": {
93+
"description": "Service provider: Microsoft.Billing.",
94+
"type": "string",
95+
"readOnly": true
96+
},
97+
"resource": {
98+
"description": "Resource on which the operation is performed such as invoice and billing subscription.",
99+
"type": "string",
100+
"readOnly": true
101+
},
102+
"operation": {
103+
"description": "Operation type such as read, write and delete.",
104+
"type": "string",
105+
"readOnly": true
106+
},
107+
"description": {
108+
"description": "Description of operation.",
109+
"type": "string",
110+
"readOnly": true
111+
}
112+
}
113+
}
114+
}
115+
},
116+
"OperationsErrorResponse": {
117+
"description": "Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.",
118+
"type": "object",
119+
"properties": {
120+
"error": {
121+
"description": "The details of the error.",
122+
"$ref": "#/definitions/OperationsErrorDetails"
123+
}
124+
}
125+
},
126+
"OperationsErrorDetails": {
127+
"description": "The details of the error.",
128+
"type": "object",
129+
"properties": {
130+
"code": {
131+
"description": "Error code.",
132+
"type": "string",
133+
"readOnly": true
134+
},
135+
"message": {
136+
"description": "Error message indicating why the operation failed.",
137+
"type": "string",
138+
"readOnly": true
139+
},
140+
"target": {
141+
"description": "The target of the particular error.",
142+
"type": "string",
143+
"readOnly": true
144+
}
145+
}
146+
}
147+
},
148+
"parameters": {
149+
"apiVersionParameter": {
150+
"name": "api-version",
151+
"in": "query",
152+
"required": true,
153+
"type": "string",
154+
"description": "The version of the API to be used with the client request. The current version is 2020-05-01."
155+
}
156+
},
157+
"security": [
158+
{
159+
"azure_auth": [
160+
"user_impersonation"
161+
]
162+
}
163+
],
164+
"securityDefinitions": {
165+
"azure_auth": {
166+
"type": "oauth2",
167+
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
168+
"flow": "implicit",
169+
"description": "Azure Active Directory OAuth2 Flow.",
170+
"scopes": {
171+
"user_impersonation": "impersonate your user account"
172+
}
173+
}
174+
}
175+
}

specification/billing/resource-manager/Microsoft.Billing/preview/2020-09-01-preview/billingPromotions.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@
367367
},
368368
"ErrorDetails": {
369369
"description": "The details of the error.",
370+
"type": "object",
370371
"properties": {
371372
"code": {
372373
"description": "Error code.",
@@ -415,6 +416,13 @@
415416
}
416417
},
417418
"parameters": {
419+
"versionParameter": {
420+
"name": "api-version",
421+
"in": "query",
422+
"required": true,
423+
"type": "string",
424+
"description": "The version of the API to be used with the client request. The current version is 2020-05-01."
425+
},
418426
"apiVersionParameter": {
419427
"name": "api-version",
420428
"in": "query",
Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
{
2+
"swagger": "2.0",
3+
"info": {
4+
"version": "2020-11-01-preview",
5+
"title": "BillingManagementClient",
6+
"description": "Billing client provides access to billing resources for Azure subscriptions."
7+
},
8+
"host": "management.azure.com",
9+
"schemes": [
10+
"https"
11+
],
12+
"consumes": [
13+
"application/json"
14+
],
15+
"produces": [
16+
"application/json"
17+
],
18+
"paths": {
19+
"/providers/Microsoft.Billing/operations": {
20+
"get": {
21+
"tags": [
22+
"Operations"
23+
],
24+
"operationId": "Operations_List",
25+
"description": "Lists the available billing REST API operations.",
26+
"externalDocs": {
27+
"url": "https://docs.microsoft.com/en-us/rest/api/billing/"
28+
},
29+
"parameters": [
30+
{
31+
"$ref": "#/parameters/apiVersionParameter"
32+
}
33+
],
34+
"responses": {
35+
"200": {
36+
"description": "OK. The request has succeeded.",
37+
"schema": {
38+
"$ref": "#/definitions/OperationListResult"
39+
}
40+
},
41+
"default": {
42+
"description": "Error response describing why the operation failed.",
43+
"schema": {
44+
"$ref": "#/definitions/OperationsErrorResponse"
45+
}
46+
}
47+
},
48+
"x-ms-pageable": {
49+
"nextLinkName": "nextLink"
50+
}
51+
}
52+
}
53+
},
54+
"definitions": {
55+
"OperationListResult": {
56+
"description": "The list of billing operations and a URL link to get the next set of results.",
57+
"type": "object",
58+
"properties": {
59+
"value": {
60+
"description": "The list of billing operations supported by the Microsoft.Billing resource provider.",
61+
"type": "array",
62+
"readOnly": true,
63+
"items": {
64+
"$ref": "#/definitions/Operation"
65+
}
66+
},
67+
"nextLink": {
68+
"description": "URL to get the next set of operation list results if there are any.",
69+
"type": "string",
70+
"readOnly": true
71+
}
72+
}
73+
},
74+
"Operation": {
75+
"description": "A Billing REST API operation.",
76+
"type": "object",
77+
"properties": {
78+
"name": {
79+
"description": "Operation name: {provider}/{resource}/{operation}.",
80+
"type": "string",
81+
"readOnly": true
82+
},
83+
"isDataAction": {
84+
"description": "Identifies if the operation is a data operation.",
85+
"type": "boolean",
86+
"readOnly": true
87+
},
88+
"display": {
89+
"description": "The object that represents the operation.",
90+
"type": "object",
91+
"properties": {
92+
"provider": {
93+
"description": "Service provider: Microsoft.Billing.",
94+
"type": "string",
95+
"readOnly": true
96+
},
97+
"resource": {
98+
"description": "Resource on which the operation is performed such as invoice and billing subscription.",
99+
"type": "string",
100+
"readOnly": true
101+
},
102+
"operation": {
103+
"description": "Operation type such as read, write and delete.",
104+
"type": "string",
105+
"readOnly": true
106+
},
107+
"description": {
108+
"description": "Description of operation.",
109+
"type": "string",
110+
"readOnly": true
111+
}
112+
}
113+
}
114+
}
115+
},
116+
"OperationsErrorResponse": {
117+
"description": "Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.",
118+
"type": "object",
119+
"properties": {
120+
"error": {
121+
"description": "The details of the error.",
122+
"$ref": "#/definitions/OperationsErrorDetails"
123+
}
124+
}
125+
},
126+
"OperationsErrorDetails": {
127+
"description": "The details of the error.",
128+
"type": "object",
129+
"properties": {
130+
"code": {
131+
"description": "Error code.",
132+
"type": "string",
133+
"readOnly": true
134+
},
135+
"message": {
136+
"description": "Error message indicating why the operation failed.",
137+
"type": "string",
138+
"readOnly": true
139+
},
140+
"target": {
141+
"description": "The target of the particular error.",
142+
"type": "string",
143+
"readOnly": true
144+
}
145+
}
146+
}
147+
},
148+
"parameters": {
149+
"apiVersionParameter": {
150+
"name": "api-version",
151+
"in": "query",
152+
"required": true,
153+
"type": "string",
154+
"description": "The version of the API to be used with the client request. The current version is 2020-05-01."
155+
}
156+
},
157+
"security": [
158+
{
159+
"azure_auth": [
160+
"user_impersonation"
161+
]
162+
}
163+
],
164+
"securityDefinitions": {
165+
"azure_auth": {
166+
"type": "oauth2",
167+
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
168+
"flow": "implicit",
169+
"description": "Azure Active Directory OAuth2 Flow.",
170+
"scopes": {
171+
"user_impersonation": "impersonate your user account"
172+
}
173+
}
174+
}
175+
}

0 commit comments

Comments
 (0)