@azure/arm-subscriptions 4.0.0 → 5.0.1-alpha.20220117.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/LICENSE +1 -1
  3. package/README.md +2 -1
  4. package/dist/index.js +644 -86
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.js +1 -1
  7. package/dist/index.min.js.map +1 -1
  8. package/dist-esm/src/models/index.d.ts +149 -5
  9. package/dist-esm/src/models/index.d.ts.map +1 -1
  10. package/dist-esm/src/models/index.js.map +1 -1
  11. package/dist-esm/src/models/mappers.d.ts +7 -0
  12. package/dist-esm/src/models/mappers.d.ts.map +1 -1
  13. package/dist-esm/src/models/mappers.js +238 -6
  14. package/dist-esm/src/models/mappers.js.map +1 -1
  15. package/dist-esm/src/models/parameters.d.ts +2 -1
  16. package/dist-esm/src/models/parameters.d.ts.map +1 -1
  17. package/dist-esm/src/models/parameters.js +22 -11
  18. package/dist-esm/src/models/parameters.js.map +1 -1
  19. package/dist-esm/src/operations/alias.js +4 -4
  20. package/dist-esm/src/operations/alias.js.map +1 -1
  21. package/dist-esm/src/operations/billingAccount.js +1 -1
  22. package/dist-esm/src/operations/billingAccount.js.map +1 -1
  23. package/dist-esm/src/operations/index.d.ts +3 -1
  24. package/dist-esm/src/operations/index.d.ts.map +1 -1
  25. package/dist-esm/src/operations/index.js +3 -1
  26. package/dist-esm/src/operations/index.js.map +1 -1
  27. package/dist-esm/src/operations/operations.js +2 -2
  28. package/dist-esm/src/operations/operations.js.map +1 -1
  29. package/dist-esm/src/operations/{subscription.d.ts → subscriptionOperations.d.ts} +5 -5
  30. package/dist-esm/src/operations/subscriptionOperations.d.ts.map +1 -0
  31. package/dist-esm/src/operations/{subscription.js → subscriptionOperations.js} +11 -11
  32. package/dist-esm/src/operations/subscriptionOperations.js.map +1 -0
  33. package/dist-esm/src/operations/subscriptionPolicy.js +5 -5
  34. package/dist-esm/src/operations/subscriptionPolicy.js.map +1 -1
  35. package/dist-esm/src/operations/subscriptions.d.ts +54 -0
  36. package/dist-esm/src/operations/subscriptions.d.ts.map +1 -0
  37. package/dist-esm/src/operations/subscriptions.js +201 -0
  38. package/dist-esm/src/operations/subscriptions.js.map +1 -0
  39. package/dist-esm/src/operations/tenants.d.ts +32 -0
  40. package/dist-esm/src/operations/tenants.d.ts.map +1 -0
  41. package/dist-esm/src/operations/tenants.js +114 -0
  42. package/dist-esm/src/operations/tenants.js.map +1 -0
  43. package/dist-esm/src/operationsInterfaces/index.d.ts +3 -1
  44. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -1
  45. package/dist-esm/src/operationsInterfaces/index.js +3 -1
  46. package/dist-esm/src/operationsInterfaces/index.js.map +1 -1
  47. package/dist-esm/src/operationsInterfaces/{subscription.d.ts → subscriptionOperations.d.ts} +3 -3
  48. package/dist-esm/src/operationsInterfaces/subscriptionOperations.d.ts.map +1 -0
  49. package/dist-esm/src/operationsInterfaces/subscriptionOperations.js +9 -0
  50. package/dist-esm/src/operationsInterfaces/subscriptionOperations.js.map +1 -0
  51. package/dist-esm/src/operationsInterfaces/subscriptions.d.ts +24 -0
  52. package/dist-esm/src/operationsInterfaces/subscriptions.d.ts.map +1 -0
  53. package/dist-esm/src/operationsInterfaces/subscriptions.js +9 -0
  54. package/dist-esm/src/operationsInterfaces/subscriptions.js.map +1 -0
  55. package/dist-esm/src/operationsInterfaces/tenants.d.ts +11 -0
  56. package/dist-esm/src/operationsInterfaces/tenants.d.ts.map +1 -0
  57. package/dist-esm/src/operationsInterfaces/{subscription.js → tenants.js} +1 -1
  58. package/dist-esm/src/operationsInterfaces/tenants.js.map +1 -0
  59. package/dist-esm/src/subscriptionClient.d.ts +4 -3
  60. package/dist-esm/src/subscriptionClient.d.ts.map +1 -1
  61. package/dist-esm/src/subscriptionClient.js +5 -4
  62. package/dist-esm/src/subscriptionClient.js.map +1 -1
  63. package/package.json +14 -4
  64. package/review/arm-subscriptions.api.md +126 -13
  65. package/src/models/index.ts +173 -5
  66. package/src/models/mappers.ts +245 -6
  67. package/src/models/parameters.ts +24 -12
  68. package/src/operations/alias.ts +4 -4
  69. package/src/operations/billingAccount.ts +1 -1
  70. package/src/operations/index.ts +3 -1
  71. package/src/operations/operations.ts +2 -2
  72. package/src/operations/{subscription.ts → subscriptionOperations.ts} +12 -11
  73. package/src/operations/subscriptionPolicy.ts +5 -5
  74. package/src/operations/subscriptions.ts +237 -0
  75. package/src/operations/tenants.ts +131 -0
  76. package/src/operationsInterfaces/index.ts +3 -1
  77. package/src/operationsInterfaces/{subscription.ts → subscriptionOperations.ts} +2 -2
  78. package/src/operationsInterfaces/subscriptions.ts +48 -0
  79. package/src/operationsInterfaces/tenants.ts +22 -0
  80. package/src/subscriptionClient.ts +13 -7
  81. package/types/arm-subscriptions.d.ts +237 -39
  82. package/dist-esm/src/operations/subscription.d.ts.map +0 -1
  83. package/dist-esm/src/operations/subscription.js.map +0 -1
  84. package/dist-esm/src/operationsInterfaces/subscription.d.ts.map +0 -1
  85. package/dist-esm/src/operationsInterfaces/subscription.js.map +0 -1
package/dist/index.js CHANGED
@@ -41,13 +41,239 @@ var coreLro = require('@azure/core-lro');
41
41
  * Code generated by Microsoft (R) AutoRest Code Generator.
42
42
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
43
43
  */
44
- const CanceledSubscriptionId = {
44
+ const LocationListResult = {
45
45
  type: {
46
46
  name: "Composite",
47
- className: "CanceledSubscriptionId",
47
+ className: "LocationListResult",
48
+ modelProperties: {
49
+ value: {
50
+ serializedName: "value",
51
+ type: {
52
+ name: "Sequence",
53
+ element: {
54
+ type: {
55
+ name: "Composite",
56
+ className: "Location"
57
+ }
58
+ }
59
+ }
60
+ }
61
+ }
62
+ }
63
+ };
64
+ const Location = {
65
+ type: {
66
+ name: "Composite",
67
+ className: "Location",
68
+ modelProperties: {
69
+ id: {
70
+ serializedName: "id",
71
+ readOnly: true,
72
+ type: {
73
+ name: "String"
74
+ }
75
+ },
76
+ subscriptionId: {
77
+ serializedName: "subscriptionId",
78
+ readOnly: true,
79
+ type: {
80
+ name: "String"
81
+ }
82
+ },
83
+ name: {
84
+ serializedName: "name",
85
+ readOnly: true,
86
+ type: {
87
+ name: "String"
88
+ }
89
+ },
90
+ displayName: {
91
+ serializedName: "displayName",
92
+ readOnly: true,
93
+ type: {
94
+ name: "String"
95
+ }
96
+ },
97
+ latitude: {
98
+ serializedName: "latitude",
99
+ readOnly: true,
100
+ type: {
101
+ name: "String"
102
+ }
103
+ },
104
+ longitude: {
105
+ serializedName: "longitude",
106
+ readOnly: true,
107
+ type: {
108
+ name: "String"
109
+ }
110
+ }
111
+ }
112
+ }
113
+ };
114
+ const Subscription = {
115
+ type: {
116
+ name: "Composite",
117
+ className: "Subscription",
118
+ modelProperties: {
119
+ id: {
120
+ serializedName: "id",
121
+ readOnly: true,
122
+ type: {
123
+ name: "String"
124
+ }
125
+ },
126
+ subscriptionId: {
127
+ serializedName: "subscriptionId",
128
+ readOnly: true,
129
+ type: {
130
+ name: "String"
131
+ }
132
+ },
133
+ displayName: {
134
+ serializedName: "displayName",
135
+ readOnly: true,
136
+ type: {
137
+ name: "String"
138
+ }
139
+ },
140
+ state: {
141
+ serializedName: "state",
142
+ readOnly: true,
143
+ type: {
144
+ name: "Enum",
145
+ allowedValues: ["Enabled", "Warned", "PastDue", "Disabled", "Deleted"]
146
+ }
147
+ },
148
+ subscriptionPolicies: {
149
+ serializedName: "subscriptionPolicies",
150
+ type: {
151
+ name: "Composite",
152
+ className: "SubscriptionPolicies"
153
+ }
154
+ },
155
+ authorizationSource: {
156
+ serializedName: "authorizationSource",
157
+ type: {
158
+ name: "String"
159
+ }
160
+ }
161
+ }
162
+ }
163
+ };
164
+ const SubscriptionPolicies = {
165
+ type: {
166
+ name: "Composite",
167
+ className: "SubscriptionPolicies",
168
+ modelProperties: {
169
+ locationPlacementId: {
170
+ serializedName: "locationPlacementId",
171
+ readOnly: true,
172
+ type: {
173
+ name: "String"
174
+ }
175
+ },
176
+ quotaId: {
177
+ serializedName: "quotaId",
178
+ readOnly: true,
179
+ type: {
180
+ name: "String"
181
+ }
182
+ },
183
+ spendingLimit: {
184
+ serializedName: "spendingLimit",
185
+ readOnly: true,
186
+ type: {
187
+ name: "Enum",
188
+ allowedValues: ["On", "Off", "CurrentPeriodOff"]
189
+ }
190
+ }
191
+ }
192
+ }
193
+ };
194
+ const SubscriptionListResult = {
195
+ type: {
196
+ name: "Composite",
197
+ className: "SubscriptionListResult",
198
+ modelProperties: {
199
+ value: {
200
+ serializedName: "value",
201
+ type: {
202
+ name: "Sequence",
203
+ element: {
204
+ type: {
205
+ name: "Composite",
206
+ className: "Subscription"
207
+ }
208
+ }
209
+ }
210
+ },
211
+ nextLink: {
212
+ serializedName: "nextLink",
213
+ required: true,
214
+ type: {
215
+ name: "String"
216
+ }
217
+ }
218
+ }
219
+ }
220
+ };
221
+ const TenantListResult = {
222
+ type: {
223
+ name: "Composite",
224
+ className: "TenantListResult",
48
225
  modelProperties: {
49
226
  value: {
50
227
  serializedName: "value",
228
+ type: {
229
+ name: "Sequence",
230
+ element: {
231
+ type: {
232
+ name: "Composite",
233
+ className: "TenantIdDescription"
234
+ }
235
+ }
236
+ }
237
+ },
238
+ nextLink: {
239
+ serializedName: "nextLink",
240
+ required: true,
241
+ type: {
242
+ name: "String"
243
+ }
244
+ }
245
+ }
246
+ }
247
+ };
248
+ const TenantIdDescription = {
249
+ type: {
250
+ name: "Composite",
251
+ className: "TenantIdDescription",
252
+ modelProperties: {
253
+ id: {
254
+ serializedName: "id",
255
+ readOnly: true,
256
+ type: {
257
+ name: "String"
258
+ }
259
+ },
260
+ tenantId: {
261
+ serializedName: "tenantId",
262
+ readOnly: true,
263
+ type: {
264
+ name: "String"
265
+ }
266
+ }
267
+ }
268
+ }
269
+ };
270
+ const CanceledSubscriptionId = {
271
+ type: {
272
+ name: "Composite",
273
+ className: "CanceledSubscriptionId",
274
+ modelProperties: {
275
+ subscriptionId: {
276
+ serializedName: "subscriptionId",
51
277
  readOnly: true,
52
278
  type: {
53
279
  name: "String"
@@ -122,8 +348,8 @@ const RenamedSubscriptionId = {
122
348
  name: "Composite",
123
349
  className: "RenamedSubscriptionId",
124
350
  modelProperties: {
125
- value: {
126
- serializedName: "value",
351
+ subscriptionId: {
352
+ serializedName: "subscriptionId",
127
353
  readOnly: true,
128
354
  type: {
129
355
  name: "String"
@@ -137,8 +363,8 @@ const EnabledSubscriptionId = {
137
363
  name: "Composite",
138
364
  className: "EnabledSubscriptionId",
139
365
  modelProperties: {
140
- value: {
141
- serializedName: "value",
366
+ subscriptionId: {
367
+ serializedName: "subscriptionId",
142
368
  readOnly: true,
143
369
  type: {
144
370
  name: "String"
@@ -436,6 +662,12 @@ const SubscriptionAliasResponseProperties = {
436
662
  name: "String"
437
663
  }
438
664
  },
665
+ createdTime: {
666
+ serializedName: "createdTime",
667
+ type: {
668
+ name: "String"
669
+ }
670
+ },
439
671
  tags: {
440
672
  serializedName: "tags",
441
673
  type: {
@@ -861,6 +1093,13 @@ const SubscriptionAcceptOwnershipHeaders = {
861
1093
 
862
1094
  var Mappers = /*#__PURE__*/Object.freeze({
863
1095
  __proto__: null,
1096
+ LocationListResult: LocationListResult,
1097
+ Location: Location,
1098
+ Subscription: Subscription,
1099
+ SubscriptionPolicies: SubscriptionPolicies,
1100
+ SubscriptionListResult: SubscriptionListResult,
1101
+ TenantListResult: TenantListResult,
1102
+ TenantIdDescription: TenantIdDescription,
864
1103
  CanceledSubscriptionId: CanceledSubscriptionId,
865
1104
  ErrorResponseBody: ErrorResponseBody,
866
1105
  ErrorResponse: ErrorResponse,
@@ -930,6 +1169,28 @@ const subscriptionId = {
930
1169
  }
931
1170
  };
932
1171
  const apiVersion = {
1172
+ parameterPath: "apiVersion",
1173
+ mapper: {
1174
+ defaultValue: "2016-06-01",
1175
+ isConstant: true,
1176
+ serializedName: "api-version",
1177
+ type: {
1178
+ name: "String"
1179
+ }
1180
+ }
1181
+ };
1182
+ const nextLink = {
1183
+ parameterPath: "nextLink",
1184
+ mapper: {
1185
+ serializedName: "nextLink",
1186
+ required: true,
1187
+ type: {
1188
+ name: "String"
1189
+ }
1190
+ },
1191
+ skipEncoding: true
1192
+ };
1193
+ const apiVersion1 = {
933
1194
  parameterPath: "apiVersion",
934
1195
  mapper: {
935
1196
  defaultValue: "2021-10-01",
@@ -959,17 +1220,6 @@ const body1 = {
959
1220
  parameterPath: "body",
960
1221
  mapper: AcceptOwnershipRequest
961
1222
  };
962
- const nextLink = {
963
- parameterPath: "nextLink",
964
- mapper: {
965
- serializedName: "nextLink",
966
- required: true,
967
- type: {
968
- name: "String"
969
- }
970
- },
971
- skipEncoding: true
972
- };
973
1223
  const body2 = {
974
1224
  parameterPath: "body",
975
1225
  mapper: PutAliasRequest
@@ -1006,22 +1256,329 @@ const billingAccountId = {
1006
1256
  * Code generated by Microsoft (R) AutoRest Code Generator.
1007
1257
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1008
1258
  */
1009
- class LroImpl {
1010
- constructor(sendOperationFn, args, spec, requestPath = spec.path, requestMethod = spec.httpMethod) {
1011
- this.sendOperationFn = sendOperationFn;
1012
- this.args = args;
1013
- this.spec = spec;
1014
- this.requestPath = requestPath;
1015
- this.requestMethod = requestMethod;
1016
- }
1017
- sendInitialRequest() {
1018
- return tslib.__awaiter(this, void 0, void 0, function* () {
1019
- return this.sendOperationFn(this.args, this.spec);
1020
- });
1259
+ /// <reference lib="esnext.asynciterable" />
1260
+ /** Class containing Subscriptions operations. */
1261
+ class SubscriptionsImpl {
1262
+ /**
1263
+ * Initialize a new instance of the class Subscriptions class.
1264
+ * @param client Reference to the service client
1265
+ */
1266
+ constructor(client) {
1267
+ this.client = client;
1021
1268
  }
1022
- sendPollRequest(path) {
1023
- return tslib.__awaiter(this, void 0, void 0, function* () {
1024
- const _a = this.spec, restSpec = tslib.__rest(_a, ["requestBody"]);
1269
+ /**
1270
+ * This operation provides all the locations that are available for resource providers; however, each
1271
+ * resource provider may support a subset of this list.
1272
+ * @param subscriptionId The ID of the target subscription.
1273
+ * @param options The options parameters.
1274
+ */
1275
+ listLocations(subscriptionId, options) {
1276
+ const iter = this.listLocationsPagingAll(subscriptionId, options);
1277
+ return {
1278
+ next() {
1279
+ return iter.next();
1280
+ },
1281
+ [Symbol.asyncIterator]() {
1282
+ return this;
1283
+ },
1284
+ byPage: () => {
1285
+ return this.listLocationsPagingPage(subscriptionId, options);
1286
+ }
1287
+ };
1288
+ }
1289
+ listLocationsPagingPage(subscriptionId, options) {
1290
+ return tslib.__asyncGenerator(this, arguments, function* listLocationsPagingPage_1() {
1291
+ let result = yield tslib.__await(this._listLocations(subscriptionId, options));
1292
+ yield yield tslib.__await(result.value || []);
1293
+ });
1294
+ }
1295
+ listLocationsPagingAll(subscriptionId, options) {
1296
+ return tslib.__asyncGenerator(this, arguments, function* listLocationsPagingAll_1() {
1297
+ var e_1, _a;
1298
+ try {
1299
+ for (var _b = tslib.__asyncValues(this.listLocationsPagingPage(subscriptionId, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
1300
+ const page = _c.value;
1301
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
1302
+ }
1303
+ }
1304
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
1305
+ finally {
1306
+ try {
1307
+ if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
1308
+ }
1309
+ finally { if (e_1) throw e_1.error; }
1310
+ }
1311
+ });
1312
+ }
1313
+ /**
1314
+ * Gets all subscriptions for a tenant.
1315
+ * @param options The options parameters.
1316
+ */
1317
+ list(options) {
1318
+ const iter = this.listPagingAll(options);
1319
+ return {
1320
+ next() {
1321
+ return iter.next();
1322
+ },
1323
+ [Symbol.asyncIterator]() {
1324
+ return this;
1325
+ },
1326
+ byPage: () => {
1327
+ return this.listPagingPage(options);
1328
+ }
1329
+ };
1330
+ }
1331
+ listPagingPage(options) {
1332
+ return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
1333
+ let result = yield tslib.__await(this._list(options));
1334
+ yield yield tslib.__await(result.value || []);
1335
+ let continuationToken = result.nextLink;
1336
+ while (continuationToken) {
1337
+ result = yield tslib.__await(this._listNext(continuationToken, options));
1338
+ continuationToken = result.nextLink;
1339
+ yield yield tslib.__await(result.value || []);
1340
+ }
1341
+ });
1342
+ }
1343
+ listPagingAll(options) {
1344
+ return tslib.__asyncGenerator(this, arguments, function* listPagingAll_1() {
1345
+ var e_2, _a;
1346
+ try {
1347
+ for (var _b = tslib.__asyncValues(this.listPagingPage(options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
1348
+ const page = _c.value;
1349
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
1350
+ }
1351
+ }
1352
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
1353
+ finally {
1354
+ try {
1355
+ if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
1356
+ }
1357
+ finally { if (e_2) throw e_2.error; }
1358
+ }
1359
+ });
1360
+ }
1361
+ /**
1362
+ * This operation provides all the locations that are available for resource providers; however, each
1363
+ * resource provider may support a subset of this list.
1364
+ * @param subscriptionId The ID of the target subscription.
1365
+ * @param options The options parameters.
1366
+ */
1367
+ _listLocations(subscriptionId, options) {
1368
+ return this.client.sendOperationRequest({ subscriptionId, options }, listLocationsOperationSpec);
1369
+ }
1370
+ /**
1371
+ * Gets details about a specified subscription.
1372
+ * @param subscriptionId The ID of the target subscription.
1373
+ * @param options The options parameters.
1374
+ */
1375
+ get(subscriptionId, options) {
1376
+ return this.client.sendOperationRequest({ subscriptionId, options }, getOperationSpec);
1377
+ }
1378
+ /**
1379
+ * Gets all subscriptions for a tenant.
1380
+ * @param options The options parameters.
1381
+ */
1382
+ _list(options) {
1383
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
1384
+ }
1385
+ /**
1386
+ * ListNext
1387
+ * @param nextLink The nextLink from the previous successful call to the List method.
1388
+ * @param options The options parameters.
1389
+ */
1390
+ _listNext(nextLink, options) {
1391
+ return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec);
1392
+ }
1393
+ }
1394
+ // Operation Specifications
1395
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
1396
+ const listLocationsOperationSpec = {
1397
+ path: "/subscriptions/{subscriptionId}/locations",
1398
+ httpMethod: "GET",
1399
+ responses: {
1400
+ 200: {
1401
+ bodyMapper: LocationListResult
1402
+ }
1403
+ },
1404
+ queryParameters: [apiVersion],
1405
+ urlParameters: [$host, subscriptionId],
1406
+ headerParameters: [accept],
1407
+ serializer
1408
+ };
1409
+ const getOperationSpec = {
1410
+ path: "/subscriptions/{subscriptionId}",
1411
+ httpMethod: "GET",
1412
+ responses: {
1413
+ 200: {
1414
+ bodyMapper: Subscription
1415
+ }
1416
+ },
1417
+ queryParameters: [apiVersion],
1418
+ urlParameters: [$host, subscriptionId],
1419
+ headerParameters: [accept],
1420
+ serializer
1421
+ };
1422
+ const listOperationSpec = {
1423
+ path: "/subscriptions",
1424
+ httpMethod: "GET",
1425
+ responses: {
1426
+ 200: {
1427
+ bodyMapper: SubscriptionListResult
1428
+ }
1429
+ },
1430
+ queryParameters: [apiVersion],
1431
+ urlParameters: [$host],
1432
+ headerParameters: [accept],
1433
+ serializer
1434
+ };
1435
+ const listNextOperationSpec = {
1436
+ path: "{nextLink}",
1437
+ httpMethod: "GET",
1438
+ responses: {
1439
+ 200: {
1440
+ bodyMapper: SubscriptionListResult
1441
+ }
1442
+ },
1443
+ queryParameters: [apiVersion],
1444
+ urlParameters: [$host, nextLink],
1445
+ headerParameters: [accept],
1446
+ serializer
1447
+ };
1448
+
1449
+ /*
1450
+ * Copyright (c) Microsoft Corporation.
1451
+ * Licensed under the MIT License.
1452
+ *
1453
+ * Code generated by Microsoft (R) AutoRest Code Generator.
1454
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1455
+ */
1456
+ /// <reference lib="esnext.asynciterable" />
1457
+ /** Class containing Tenants operations. */
1458
+ class TenantsImpl {
1459
+ /**
1460
+ * Initialize a new instance of the class Tenants class.
1461
+ * @param client Reference to the service client
1462
+ */
1463
+ constructor(client) {
1464
+ this.client = client;
1465
+ }
1466
+ /**
1467
+ * Gets the tenants for your account.
1468
+ * @param options The options parameters.
1469
+ */
1470
+ list(options) {
1471
+ const iter = this.listPagingAll(options);
1472
+ return {
1473
+ next() {
1474
+ return iter.next();
1475
+ },
1476
+ [Symbol.asyncIterator]() {
1477
+ return this;
1478
+ },
1479
+ byPage: () => {
1480
+ return this.listPagingPage(options);
1481
+ }
1482
+ };
1483
+ }
1484
+ listPagingPage(options) {
1485
+ return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
1486
+ let result = yield tslib.__await(this._list(options));
1487
+ yield yield tslib.__await(result.value || []);
1488
+ let continuationToken = result.nextLink;
1489
+ while (continuationToken) {
1490
+ result = yield tslib.__await(this._listNext(continuationToken, options));
1491
+ continuationToken = result.nextLink;
1492
+ yield yield tslib.__await(result.value || []);
1493
+ }
1494
+ });
1495
+ }
1496
+ listPagingAll(options) {
1497
+ return tslib.__asyncGenerator(this, arguments, function* listPagingAll_1() {
1498
+ var e_1, _a;
1499
+ try {
1500
+ for (var _b = tslib.__asyncValues(this.listPagingPage(options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
1501
+ const page = _c.value;
1502
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
1503
+ }
1504
+ }
1505
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
1506
+ finally {
1507
+ try {
1508
+ if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
1509
+ }
1510
+ finally { if (e_1) throw e_1.error; }
1511
+ }
1512
+ });
1513
+ }
1514
+ /**
1515
+ * Gets the tenants for your account.
1516
+ * @param options The options parameters.
1517
+ */
1518
+ _list(options) {
1519
+ return this.client.sendOperationRequest({ options }, listOperationSpec$1);
1520
+ }
1521
+ /**
1522
+ * ListNext
1523
+ * @param nextLink The nextLink from the previous successful call to the List method.
1524
+ * @param options The options parameters.
1525
+ */
1526
+ _listNext(nextLink, options) {
1527
+ return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec$1);
1528
+ }
1529
+ }
1530
+ // Operation Specifications
1531
+ const serializer$1 = coreClient.createSerializer(Mappers, /* isXml */ false);
1532
+ const listOperationSpec$1 = {
1533
+ path: "/tenants",
1534
+ httpMethod: "GET",
1535
+ responses: {
1536
+ 200: {
1537
+ bodyMapper: TenantListResult
1538
+ }
1539
+ },
1540
+ queryParameters: [apiVersion],
1541
+ urlParameters: [$host],
1542
+ headerParameters: [accept],
1543
+ serializer: serializer$1
1544
+ };
1545
+ const listNextOperationSpec$1 = {
1546
+ path: "{nextLink}",
1547
+ httpMethod: "GET",
1548
+ responses: {
1549
+ 200: {
1550
+ bodyMapper: TenantListResult
1551
+ }
1552
+ },
1553
+ queryParameters: [apiVersion],
1554
+ urlParameters: [$host, nextLink],
1555
+ headerParameters: [accept],
1556
+ serializer: serializer$1
1557
+ };
1558
+
1559
+ /*
1560
+ * Copyright (c) Microsoft Corporation.
1561
+ * Licensed under the MIT License.
1562
+ *
1563
+ * Code generated by Microsoft (R) AutoRest Code Generator.
1564
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1565
+ */
1566
+ class LroImpl {
1567
+ constructor(sendOperationFn, args, spec, requestPath = spec.path, requestMethod = spec.httpMethod) {
1568
+ this.sendOperationFn = sendOperationFn;
1569
+ this.args = args;
1570
+ this.spec = spec;
1571
+ this.requestPath = requestPath;
1572
+ this.requestMethod = requestMethod;
1573
+ }
1574
+ sendInitialRequest() {
1575
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1576
+ return this.sendOperationFn(this.args, this.spec);
1577
+ });
1578
+ }
1579
+ sendPollRequest(path) {
1580
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1581
+ const _a = this.spec, restSpec = tslib.__rest(_a, ["requestBody"]);
1025
1582
  return this.sendOperationFn(this.args, Object.assign(Object.assign({}, restSpec), { path, httpMethod: "GET" }));
1026
1583
  });
1027
1584
  }
@@ -1034,10 +1591,10 @@ class LroImpl {
1034
1591
  * Code generated by Microsoft (R) AutoRest Code Generator.
1035
1592
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1036
1593
  */
1037
- /** Class containing Subscription operations. */
1038
- class SubscriptionImpl {
1594
+ /** Class containing SubscriptionOperations operations. */
1595
+ class SubscriptionOperationsImpl {
1039
1596
  /**
1040
- * Initialize a new instance of the class Subscription class.
1597
+ * Initialize a new instance of the class SubscriptionOperations class.
1041
1598
  * @param client Reference to the service client
1042
1599
  */
1043
1600
  constructor(client) {
@@ -1127,7 +1684,7 @@ class SubscriptionImpl {
1127
1684
  }
1128
1685
  }
1129
1686
  // Operation Specifications
1130
- const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
1687
+ const serializer$2 = coreClient.createSerializer(Mappers, /* isXml */ false);
1131
1688
  const cancelOperationSpec = {
1132
1689
  path: "/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/cancel",
1133
1690
  httpMethod: "POST",
@@ -1139,10 +1696,10 @@ const cancelOperationSpec = {
1139
1696
  bodyMapper: ErrorResponseBody
1140
1697
  }
1141
1698
  },
1142
- queryParameters: [apiVersion],
1699
+ queryParameters: [apiVersion1],
1143
1700
  urlParameters: [$host, subscriptionId],
1144
1701
  headerParameters: [accept],
1145
- serializer
1702
+ serializer: serializer$2
1146
1703
  };
1147
1704
  const renameOperationSpec = {
1148
1705
  path: "/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/rename",
@@ -1156,11 +1713,11 @@ const renameOperationSpec = {
1156
1713
  }
1157
1714
  },
1158
1715
  requestBody: body,
1159
- queryParameters: [apiVersion],
1716
+ queryParameters: [apiVersion1],
1160
1717
  urlParameters: [$host, subscriptionId],
1161
1718
  headerParameters: [accept, contentType],
1162
1719
  mediaType: "json",
1163
- serializer
1720
+ serializer: serializer$2
1164
1721
  };
1165
1722
  const enableOperationSpec = {
1166
1723
  path: "/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/enable",
@@ -1173,13 +1730,13 @@ const enableOperationSpec = {
1173
1730
  bodyMapper: ErrorResponseBody
1174
1731
  }
1175
1732
  },
1176
- queryParameters: [apiVersion],
1733
+ queryParameters: [apiVersion1],
1177
1734
  urlParameters: [$host, subscriptionId],
1178
1735
  headerParameters: [accept],
1179
- serializer
1736
+ serializer: serializer$2
1180
1737
  };
1181
1738
  const acceptOwnershipOperationSpec = {
1182
- path: "/providers/Microsoft.Subscription/{subscriptionId}/acceptOwnership",
1739
+ path: "/providers/Microsoft.Subscription/subscriptions/{subscriptionId}/acceptOwnership",
1183
1740
  httpMethod: "POST",
1184
1741
  responses: {
1185
1742
  200: {
@@ -1199,14 +1756,14 @@ const acceptOwnershipOperationSpec = {
1199
1756
  }
1200
1757
  },
1201
1758
  requestBody: body1,
1202
- queryParameters: [apiVersion],
1759
+ queryParameters: [apiVersion1],
1203
1760
  urlParameters: [$host, subscriptionId],
1204
1761
  headerParameters: [accept, contentType],
1205
1762
  mediaType: "json",
1206
- serializer
1763
+ serializer: serializer$2
1207
1764
  };
1208
1765
  const acceptOwnershipStatusOperationSpec = {
1209
- path: "/providers/Microsoft.Subscription/{subscriptionId}/acceptOwnershipStatus",
1766
+ path: "/providers/Microsoft.Subscription/subscriptions/{subscriptionId}/acceptOwnershipStatus",
1210
1767
  httpMethod: "GET",
1211
1768
  responses: {
1212
1769
  200: {
@@ -1216,10 +1773,10 @@ const acceptOwnershipStatusOperationSpec = {
1216
1773
  bodyMapper: ErrorResponseBody
1217
1774
  }
1218
1775
  },
1219
- queryParameters: [apiVersion],
1776
+ queryParameters: [apiVersion1],
1220
1777
  urlParameters: [$host, subscriptionId],
1221
1778
  headerParameters: [accept],
1222
- serializer
1779
+ serializer: serializer$2
1223
1780
  };
1224
1781
 
1225
1782
  /*
@@ -1292,7 +1849,7 @@ class OperationsImpl {
1292
1849
  * @param options The options parameters.
1293
1850
  */
1294
1851
  _list(options) {
1295
- return this.client.sendOperationRequest({ options }, listOperationSpec);
1852
+ return this.client.sendOperationRequest({ options }, listOperationSpec$2);
1296
1853
  }
1297
1854
  /**
1298
1855
  * ListNext
@@ -1300,12 +1857,12 @@ class OperationsImpl {
1300
1857
  * @param options The options parameters.
1301
1858
  */
1302
1859
  _listNext(nextLink, options) {
1303
- return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec);
1860
+ return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec$2);
1304
1861
  }
1305
1862
  }
1306
1863
  // Operation Specifications
1307
- const serializer$1 = coreClient.createSerializer(Mappers, /* isXml */ false);
1308
- const listOperationSpec = {
1864
+ const serializer$3 = coreClient.createSerializer(Mappers, /* isXml */ false);
1865
+ const listOperationSpec$2 = {
1309
1866
  path: "/providers/Microsoft.Subscription/operations",
1310
1867
  httpMethod: "GET",
1311
1868
  responses: {
@@ -1316,12 +1873,12 @@ const listOperationSpec = {
1316
1873
  bodyMapper: ErrorResponseBody
1317
1874
  }
1318
1875
  },
1319
- queryParameters: [apiVersion],
1876
+ queryParameters: [apiVersion1],
1320
1877
  urlParameters: [$host],
1321
1878
  headerParameters: [accept],
1322
- serializer: serializer$1
1879
+ serializer: serializer$3
1323
1880
  };
1324
- const listNextOperationSpec = {
1881
+ const listNextOperationSpec$2 = {
1325
1882
  path: "{nextLink}",
1326
1883
  httpMethod: "GET",
1327
1884
  responses: {
@@ -1332,10 +1889,10 @@ const listNextOperationSpec = {
1332
1889
  bodyMapper: ErrorResponseBody
1333
1890
  }
1334
1891
  },
1335
- queryParameters: [apiVersion],
1892
+ queryParameters: [apiVersion1],
1336
1893
  urlParameters: [$host, nextLink],
1337
1894
  headerParameters: [accept],
1338
- serializer: serializer$1
1895
+ serializer: serializer$3
1339
1896
  };
1340
1897
 
1341
1898
  /*
@@ -1415,7 +1972,7 @@ class AliasImpl {
1415
1972
  * @param options The options parameters.
1416
1973
  */
1417
1974
  get(aliasName, options) {
1418
- return this.client.sendOperationRequest({ aliasName, options }, getOperationSpec);
1975
+ return this.client.sendOperationRequest({ aliasName, options }, getOperationSpec$1);
1419
1976
  }
1420
1977
  /**
1421
1978
  * Delete Alias.
@@ -1432,11 +1989,11 @@ class AliasImpl {
1432
1989
  * @param options The options parameters.
1433
1990
  */
1434
1991
  list(options) {
1435
- return this.client.sendOperationRequest({ options }, listOperationSpec$1);
1992
+ return this.client.sendOperationRequest({ options }, listOperationSpec$3);
1436
1993
  }
1437
1994
  }
1438
1995
  // Operation Specifications
1439
- const serializer$2 = coreClient.createSerializer(Mappers, /* isXml */ false);
1996
+ const serializer$4 = coreClient.createSerializer(Mappers, /* isXml */ false);
1440
1997
  const createOperationSpec = {
1441
1998
  path: "/providers/Microsoft.Subscription/aliases/{aliasName}",
1442
1999
  httpMethod: "PUT",
@@ -1458,13 +2015,13 @@ const createOperationSpec = {
1458
2015
  }
1459
2016
  },
1460
2017
  requestBody: body2,
1461
- queryParameters: [apiVersion],
2018
+ queryParameters: [apiVersion1],
1462
2019
  urlParameters: [$host, aliasName],
1463
2020
  headerParameters: [accept, contentType],
1464
2021
  mediaType: "json",
1465
- serializer: serializer$2
2022
+ serializer: serializer$4
1466
2023
  };
1467
- const getOperationSpec = {
2024
+ const getOperationSpec$1 = {
1468
2025
  path: "/providers/Microsoft.Subscription/aliases/{aliasName}",
1469
2026
  httpMethod: "GET",
1470
2027
  responses: {
@@ -1475,10 +2032,10 @@ const getOperationSpec = {
1475
2032
  bodyMapper: ErrorResponseBody
1476
2033
  }
1477
2034
  },
1478
- queryParameters: [apiVersion],
2035
+ queryParameters: [apiVersion1],
1479
2036
  urlParameters: [$host, aliasName],
1480
2037
  headerParameters: [accept],
1481
- serializer: serializer$2
2038
+ serializer: serializer$4
1482
2039
  };
1483
2040
  const deleteOperationSpec = {
1484
2041
  path: "/providers/Microsoft.Subscription/aliases/{aliasName}",
@@ -1490,12 +2047,12 @@ const deleteOperationSpec = {
1490
2047
  bodyMapper: ErrorResponseBody
1491
2048
  }
1492
2049
  },
1493
- queryParameters: [apiVersion],
2050
+ queryParameters: [apiVersion1],
1494
2051
  urlParameters: [$host, aliasName],
1495
2052
  headerParameters: [accept],
1496
- serializer: serializer$2
2053
+ serializer: serializer$4
1497
2054
  };
1498
- const listOperationSpec$1 = {
2055
+ const listOperationSpec$3 = {
1499
2056
  path: "/providers/Microsoft.Subscription/aliases",
1500
2057
  httpMethod: "GET",
1501
2058
  responses: {
@@ -1506,10 +2063,10 @@ const listOperationSpec$1 = {
1506
2063
  bodyMapper: ErrorResponseBody
1507
2064
  }
1508
2065
  },
1509
- queryParameters: [apiVersion],
2066
+ queryParameters: [apiVersion1],
1510
2067
  urlParameters: [$host],
1511
2068
  headerParameters: [accept],
1512
- serializer: serializer$2
2069
+ serializer: serializer$4
1513
2070
  };
1514
2071
 
1515
2072
  /*
@@ -1609,12 +2166,12 @@ class SubscriptionPolicyImpl {
1609
2166
  }
1610
2167
  }
1611
2168
  // Operation Specifications
1612
- const serializer$3 = coreClient.createSerializer(Mappers, /* isXml */ false);
2169
+ const serializer$5 = coreClient.createSerializer(Mappers, /* isXml */ false);
1613
2170
  const addUpdatePolicyForTenantOperationSpec = {
1614
2171
  path: "/providers/Microsoft.Subscription/policies/default",
1615
2172
  httpMethod: "PUT",
1616
2173
  responses: {
1617
- 201: {
2174
+ 200: {
1618
2175
  bodyMapper: GetTenantPolicyResponse
1619
2176
  },
1620
2177
  default: {
@@ -1622,11 +2179,11 @@ const addUpdatePolicyForTenantOperationSpec = {
1622
2179
  }
1623
2180
  },
1624
2181
  requestBody: body3,
1625
- queryParameters: [apiVersion],
2182
+ queryParameters: [apiVersion1],
1626
2183
  urlParameters: [$host],
1627
2184
  headerParameters: [accept, contentType],
1628
2185
  mediaType: "json",
1629
- serializer: serializer$3
2186
+ serializer: serializer$5
1630
2187
  };
1631
2188
  const getPolicyForTenantOperationSpec = {
1632
2189
  path: "/providers/Microsoft.Subscription/policies/default",
@@ -1639,10 +2196,10 @@ const getPolicyForTenantOperationSpec = {
1639
2196
  bodyMapper: ErrorResponseBody
1640
2197
  }
1641
2198
  },
1642
- queryParameters: [apiVersion],
2199
+ queryParameters: [apiVersion1],
1643
2200
  urlParameters: [$host],
1644
2201
  headerParameters: [accept],
1645
- serializer: serializer$3
2202
+ serializer: serializer$5
1646
2203
  };
1647
2204
  const listPolicyForTenantOperationSpec = {
1648
2205
  path: "/providers/Microsoft.Subscription/policies",
@@ -1655,10 +2212,10 @@ const listPolicyForTenantOperationSpec = {
1655
2212
  bodyMapper: ErrorResponseBody
1656
2213
  }
1657
2214
  },
1658
- queryParameters: [apiVersion],
2215
+ queryParameters: [apiVersion1],
1659
2216
  urlParameters: [$host],
1660
2217
  headerParameters: [accept],
1661
- serializer: serializer$3
2218
+ serializer: serializer$5
1662
2219
  };
1663
2220
  const listPolicyForTenantNextOperationSpec = {
1664
2221
  path: "{nextLink}",
@@ -1671,10 +2228,10 @@ const listPolicyForTenantNextOperationSpec = {
1671
2228
  bodyMapper: ErrorResponseBody
1672
2229
  }
1673
2230
  },
1674
- queryParameters: [apiVersion],
2231
+ queryParameters: [apiVersion1],
1675
2232
  urlParameters: [$host, nextLink],
1676
2233
  headerParameters: [accept],
1677
- serializer: serializer$3
2234
+ serializer: serializer$5
1678
2235
  };
1679
2236
 
1680
2237
  /*
@@ -1703,7 +2260,7 @@ class BillingAccountImpl {
1703
2260
  }
1704
2261
  }
1705
2262
  // Operation Specifications
1706
- const serializer$4 = coreClient.createSerializer(Mappers, /* isXml */ false);
2263
+ const serializer$6 = coreClient.createSerializer(Mappers, /* isXml */ false);
1707
2264
  const getPolicyOperationSpec = {
1708
2265
  path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Subscription/policies/default",
1709
2266
  httpMethod: "GET",
@@ -1715,10 +2272,10 @@ const getPolicyOperationSpec = {
1715
2272
  bodyMapper: ErrorResponseBody
1716
2273
  }
1717
2274
  },
1718
- queryParameters: [apiVersion],
2275
+ queryParameters: [apiVersion1],
1719
2276
  urlParameters: [$host, billingAccountId],
1720
2277
  headerParameters: [accept],
1721
- serializer: serializer$4
2278
+ serializer: serializer$6
1722
2279
  };
1723
2280
 
1724
2281
  /*
@@ -1746,7 +2303,7 @@ class SubscriptionClient extends coreClient.ServiceClient {
1746
2303
  requestContentType: "application/json; charset=utf-8",
1747
2304
  credential: credentials
1748
2305
  };
1749
- const packageDetails = `azsdk-js-arm-subscriptions/4.0.0`;
2306
+ const packageDetails = `azsdk-js-arm-subscriptions/5.0.0`;
1750
2307
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
1751
2308
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
1752
2309
  : `${packageDetails}`;
@@ -1759,8 +2316,9 @@ class SubscriptionClient extends coreClient.ServiceClient {
1759
2316
  super(optionsWithDefaults);
1760
2317
  // Assigning values to Constant parameters
1761
2318
  this.$host = options.$host || "https://management.azure.com";
1762
- this.apiVersion = options.apiVersion || "2021-10-01";
1763
- this.subscription = new SubscriptionImpl(this);
2319
+ this.subscriptions = new SubscriptionsImpl(this);
2320
+ this.tenants = new TenantsImpl(this);
2321
+ this.subscriptionOperations = new SubscriptionOperationsImpl(this);
1764
2322
  this.operations = new OperationsImpl(this);
1765
2323
  this.alias = new AliasImpl(this);
1766
2324
  this.subscriptionPolicy = new SubscriptionPolicyImpl(this);