@azure/arm-subscriptions 3.0.0 → 4.0.0

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 (184) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/{LICENSE.txt → LICENSE} +2 -2
  3. package/README.md +71 -75
  4. package/dist/index.js +1772 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.min.js +1 -0
  7. package/dist/index.min.js.map +1 -0
  8. package/dist-esm/src/index.d.ts +5 -0
  9. package/dist-esm/src/index.d.ts.map +1 -0
  10. package/dist-esm/src/index.js +12 -0
  11. package/dist-esm/src/index.js.map +1 -0
  12. package/dist-esm/src/lroImpl.d.ts +16 -0
  13. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  14. package/dist-esm/src/lroImpl.js +29 -0
  15. package/dist-esm/src/lroImpl.js.map +1 -0
  16. package/dist-esm/src/models/index.d.ts +514 -0
  17. package/dist-esm/src/models/index.d.ts.map +1 -0
  18. package/dist-esm/src/models/index.js +36 -0
  19. package/dist-esm/src/models/index.js.map +1 -0
  20. package/dist-esm/src/models/mappers.d.ts +29 -0
  21. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  22. package/dist-esm/src/models/mappers.js +825 -0
  23. package/dist-esm/src/models/mappers.js.map +1 -0
  24. package/dist-esm/src/models/parameters.d.ts +14 -0
  25. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  26. package/dist-esm/src/models/parameters.js +110 -0
  27. package/dist-esm/src/models/parameters.js.map +1 -0
  28. package/dist-esm/src/operations/alias.d.ts +53 -0
  29. package/dist-esm/src/operations/alias.d.ts.map +1 -0
  30. package/dist-esm/src/operations/alias.js +180 -0
  31. package/dist-esm/src/operations/alias.js.map +1 -0
  32. package/dist-esm/src/operations/billingAccount.d.ts +19 -0
  33. package/dist-esm/src/operations/billingAccount.d.ts.map +1 -0
  34. package/dist-esm/src/operations/billingAccount.js +47 -0
  35. package/dist-esm/src/operations/billingAccount.js.map +1 -0
  36. package/dist-esm/src/operations/index.d.ts +6 -0
  37. package/dist-esm/src/operations/index.d.ts.map +1 -0
  38. package/dist-esm/src/operations/index.js +13 -0
  39. package/dist-esm/src/operations/index.js.map +1 -0
  40. package/dist-esm/src/operations/operations.d.ts +32 -0
  41. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  42. package/dist-esm/src/operations/operations.js +120 -0
  43. package/dist-esm/src/operations/operations.js.map +1 -0
  44. package/dist-esm/src/operations/subscription.d.ts +53 -0
  45. package/dist-esm/src/operations/subscription.d.ts.map +1 -0
  46. package/dist-esm/src/operations/subscription.js +201 -0
  47. package/dist-esm/src/operations/subscription.js.map +1 -0
  48. package/dist-esm/src/operations/subscriptionPolicy.d.ts +43 -0
  49. package/dist-esm/src/operations/subscriptionPolicy.d.ts.map +1 -0
  50. package/dist-esm/src/operations/subscriptionPolicy.js +169 -0
  51. package/dist-esm/src/operations/subscriptionPolicy.js.map +1 -0
  52. package/dist-esm/src/operationsInterfaces/alias.d.ts +45 -0
  53. package/dist-esm/src/operationsInterfaces/alias.d.ts.map +1 -0
  54. package/dist-esm/src/operationsInterfaces/alias.js +9 -0
  55. package/dist-esm/src/operationsInterfaces/alias.js.map +1 -0
  56. package/dist-esm/src/operationsInterfaces/billingAccount.d.ts +11 -0
  57. package/dist-esm/src/operationsInterfaces/billingAccount.d.ts.map +1 -0
  58. package/dist-esm/src/operationsInterfaces/billingAccount.js +9 -0
  59. package/dist-esm/src/operationsInterfaces/billingAccount.js.map +1 -0
  60. package/dist-esm/src/operationsInterfaces/index.d.ts +6 -0
  61. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  62. package/dist-esm/src/operationsInterfaces/index.js +13 -0
  63. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  64. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  65. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  66. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  67. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  68. package/dist-esm/src/operationsInterfaces/subscription.d.ts +45 -0
  69. package/dist-esm/src/operationsInterfaces/subscription.d.ts.map +1 -0
  70. package/dist-esm/src/operationsInterfaces/subscription.js +9 -0
  71. package/dist-esm/src/operationsInterfaces/subscription.js.map +1 -0
  72. package/dist-esm/src/operationsInterfaces/subscriptionPolicy.d.ts +22 -0
  73. package/dist-esm/src/operationsInterfaces/subscriptionPolicy.d.ts.map +1 -0
  74. package/dist-esm/src/operationsInterfaces/subscriptionPolicy.js +9 -0
  75. package/dist-esm/src/operationsInterfaces/subscriptionPolicy.js.map +1 -0
  76. package/dist-esm/src/subscriptionClient.d.ts +20 -0
  77. package/dist-esm/src/subscriptionClient.d.ts.map +1 -0
  78. package/dist-esm/src/subscriptionClient.js +49 -0
  79. package/dist-esm/src/subscriptionClient.js.map +1 -0
  80. package/dist-esm/test/sampleTest.d.ts +2 -0
  81. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  82. package/dist-esm/test/sampleTest.js +40 -0
  83. package/dist-esm/test/sampleTest.js.map +1 -0
  84. package/package.json +65 -31
  85. package/review/arm-subscriptions.api.md +446 -0
  86. package/rollup.config.js +181 -30
  87. package/src/index.ts +12 -0
  88. package/src/lroImpl.ts +34 -0
  89. package/src/models/index.ts +449 -555
  90. package/src/models/mappers.ts +506 -250
  91. package/src/models/parameters.ts +82 -27
  92. package/src/operations/alias.ts +170 -170
  93. package/src/operations/billingAccount.ts +65 -0
  94. package/src/operations/index.ts +6 -8
  95. package/src/operations/operations.ts +103 -40
  96. package/src/operations/subscription.ts +289 -0
  97. package/src/operations/subscriptionPolicy.ts +207 -0
  98. package/src/operationsInterfaces/alias.ts +75 -0
  99. package/src/operationsInterfaces/billingAccount.ts +25 -0
  100. package/src/operationsInterfaces/index.ts +13 -0
  101. package/src/operationsInterfaces/operations.ts +22 -0
  102. package/src/operationsInterfaces/subscription.ts +92 -0
  103. package/src/operationsInterfaces/subscriptionPolicy.ts +46 -0
  104. package/src/subscriptionClient.ts +75 -37
  105. package/tsconfig.json +3 -3
  106. package/types/arm-subscriptions.d.ts +727 -0
  107. package/types/tsdoc-metadata.json +11 -0
  108. package/dist/arm-subscriptions.js +0 -1432
  109. package/dist/arm-subscriptions.js.map +0 -1
  110. package/dist/arm-subscriptions.min.js +0 -1
  111. package/dist/arm-subscriptions.min.js.map +0 -1
  112. package/esm/models/aliasMappers.d.ts +0 -2
  113. package/esm/models/aliasMappers.d.ts.map +0 -1
  114. package/esm/models/aliasMappers.js +0 -9
  115. package/esm/models/aliasMappers.js.map +0 -1
  116. package/esm/models/index.d.ts +0 -624
  117. package/esm/models/index.d.ts.map +0 -1
  118. package/esm/models/index.js +0 -8
  119. package/esm/models/index.js.map +0 -1
  120. package/esm/models/mappers.d.ts +0 -25
  121. package/esm/models/mappers.d.ts.map +0 -1
  122. package/esm/models/mappers.js +0 -574
  123. package/esm/models/mappers.js.map +0 -1
  124. package/esm/models/operationsMappers.d.ts +0 -2
  125. package/esm/models/operationsMappers.d.ts.map +0 -1
  126. package/esm/models/operationsMappers.js +0 -9
  127. package/esm/models/operationsMappers.js.map +0 -1
  128. package/esm/models/parameters.d.ts +0 -8
  129. package/esm/models/parameters.d.ts.map +0 -1
  130. package/esm/models/parameters.js +0 -75
  131. package/esm/models/parameters.js.map +0 -1
  132. package/esm/models/subscriptionOperationsMappers.d.ts +0 -2
  133. package/esm/models/subscriptionOperationsMappers.d.ts.map +0 -1
  134. package/esm/models/subscriptionOperationsMappers.js +0 -9
  135. package/esm/models/subscriptionOperationsMappers.js.map +0 -1
  136. package/esm/models/subscriptionsMappers.d.ts +0 -2
  137. package/esm/models/subscriptionsMappers.d.ts.map +0 -1
  138. package/esm/models/subscriptionsMappers.js +0 -9
  139. package/esm/models/subscriptionsMappers.js.map +0 -1
  140. package/esm/models/tenantsMappers.d.ts +0 -2
  141. package/esm/models/tenantsMappers.d.ts.map +0 -1
  142. package/esm/models/tenantsMappers.js +0 -9
  143. package/esm/models/tenantsMappers.js.map +0 -1
  144. package/esm/operations/alias.d.ts +0 -81
  145. package/esm/operations/alias.d.ts.map +0 -1
  146. package/esm/operations/alias.js +0 -161
  147. package/esm/operations/alias.js.map +0 -1
  148. package/esm/operations/index.d.ts +0 -6
  149. package/esm/operations/index.d.ts.map +0 -1
  150. package/esm/operations/index.js +0 -15
  151. package/esm/operations/index.js.map +0 -1
  152. package/esm/operations/operations.d.ts +0 -28
  153. package/esm/operations/operations.d.ts.map +0 -1
  154. package/esm/operations/operations.js +0 -51
  155. package/esm/operations/operations.js.map +0 -1
  156. package/esm/operations/subscriptionOperations.d.ts +0 -70
  157. package/esm/operations/subscriptionOperations.d.ts.map +0 -1
  158. package/esm/operations/subscriptionOperations.js +0 -117
  159. package/esm/operations/subscriptionOperations.js.map +0 -1
  160. package/esm/operations/subscriptions.d.ts +0 -84
  161. package/esm/operations/subscriptions.d.ts.map +0 -1
  162. package/esm/operations/subscriptions.js +0 -133
  163. package/esm/operations/subscriptions.js.map +0 -1
  164. package/esm/operations/tenants.d.ts +0 -46
  165. package/esm/operations/tenants.d.ts.map +0 -1
  166. package/esm/operations/tenants.js +0 -77
  167. package/esm/operations/tenants.js.map +0 -1
  168. package/esm/subscriptionClient.d.ts +0 -21
  169. package/esm/subscriptionClient.d.ts.map +0 -1
  170. package/esm/subscriptionClient.js +0 -36
  171. package/esm/subscriptionClient.js.map +0 -1
  172. package/esm/subscriptionClientContext.d.ts +0 -13
  173. package/esm/subscriptionClientContext.d.ts.map +0 -1
  174. package/esm/subscriptionClientContext.js +0 -50
  175. package/esm/subscriptionClientContext.js.map +0 -1
  176. package/src/models/aliasMappers.ts +0 -18
  177. package/src/models/operationsMappers.ts +0 -14
  178. package/src/models/subscriptionOperationsMappers.ts +0 -15
  179. package/src/models/subscriptionsMappers.ts +0 -16
  180. package/src/models/tenantsMappers.ts +0 -13
  181. package/src/operations/subscriptionOperations.ts +0 -194
  182. package/src/operations/subscriptions.ts +0 -227
  183. package/src/operations/tenants.ts +0 -123
  184. package/src/subscriptionClientContext.ts +0 -54
package/dist/index.js ADDED
@@ -0,0 +1,1772 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var coreClient = require('@azure/core-client');
6
+ var tslib = require('tslib');
7
+ var coreLro = require('@azure/core-lro');
8
+
9
+ /*
10
+ * Copyright (c) Microsoft Corporation.
11
+ * Licensed under the MIT License.
12
+ *
13
+ * Code generated by Microsoft (R) AutoRest Code Generator.
14
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
15
+ */
16
+ (function (KnownWorkload) {
17
+ KnownWorkload["Production"] = "Production";
18
+ KnownWorkload["DevTest"] = "DevTest";
19
+ })(exports.KnownWorkload || (exports.KnownWorkload = {}));
20
+ (function (KnownProvisioningState) {
21
+ KnownProvisioningState["Accepted"] = "Accepted";
22
+ KnownProvisioningState["Succeeded"] = "Succeeded";
23
+ KnownProvisioningState["Failed"] = "Failed";
24
+ })(exports.KnownProvisioningState || (exports.KnownProvisioningState = {}));
25
+ (function (KnownAcceptOwnership) {
26
+ KnownAcceptOwnership["Pending"] = "Pending";
27
+ KnownAcceptOwnership["Completed"] = "Completed";
28
+ KnownAcceptOwnership["Expired"] = "Expired";
29
+ })(exports.KnownAcceptOwnership || (exports.KnownAcceptOwnership = {}));
30
+ (function (KnownCreatedByType) {
31
+ KnownCreatedByType["User"] = "User";
32
+ KnownCreatedByType["Application"] = "Application";
33
+ KnownCreatedByType["ManagedIdentity"] = "ManagedIdentity";
34
+ KnownCreatedByType["Key"] = "Key";
35
+ })(exports.KnownCreatedByType || (exports.KnownCreatedByType = {}));
36
+
37
+ /*
38
+ * Copyright (c) Microsoft Corporation.
39
+ * Licensed under the MIT License.
40
+ *
41
+ * Code generated by Microsoft (R) AutoRest Code Generator.
42
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
43
+ */
44
+ const CanceledSubscriptionId = {
45
+ type: {
46
+ name: "Composite",
47
+ className: "CanceledSubscriptionId",
48
+ modelProperties: {
49
+ value: {
50
+ serializedName: "value",
51
+ readOnly: true,
52
+ type: {
53
+ name: "String"
54
+ }
55
+ }
56
+ }
57
+ }
58
+ };
59
+ const ErrorResponseBody = {
60
+ type: {
61
+ name: "Composite",
62
+ className: "ErrorResponseBody",
63
+ modelProperties: {
64
+ error: {
65
+ serializedName: "error",
66
+ type: {
67
+ name: "Composite",
68
+ className: "ErrorResponse"
69
+ }
70
+ },
71
+ code: {
72
+ serializedName: "code",
73
+ type: {
74
+ name: "String"
75
+ }
76
+ },
77
+ message: {
78
+ serializedName: "message",
79
+ type: {
80
+ name: "String"
81
+ }
82
+ }
83
+ }
84
+ }
85
+ };
86
+ const ErrorResponse = {
87
+ type: {
88
+ name: "Composite",
89
+ className: "ErrorResponse",
90
+ modelProperties: {
91
+ code: {
92
+ serializedName: "code",
93
+ type: {
94
+ name: "String"
95
+ }
96
+ },
97
+ message: {
98
+ serializedName: "message",
99
+ type: {
100
+ name: "String"
101
+ }
102
+ }
103
+ }
104
+ }
105
+ };
106
+ const SubscriptionName = {
107
+ type: {
108
+ name: "Composite",
109
+ className: "SubscriptionName",
110
+ modelProperties: {
111
+ subscriptionName: {
112
+ serializedName: "subscriptionName",
113
+ type: {
114
+ name: "String"
115
+ }
116
+ }
117
+ }
118
+ }
119
+ };
120
+ const RenamedSubscriptionId = {
121
+ type: {
122
+ name: "Composite",
123
+ className: "RenamedSubscriptionId",
124
+ modelProperties: {
125
+ value: {
126
+ serializedName: "value",
127
+ readOnly: true,
128
+ type: {
129
+ name: "String"
130
+ }
131
+ }
132
+ }
133
+ }
134
+ };
135
+ const EnabledSubscriptionId = {
136
+ type: {
137
+ name: "Composite",
138
+ className: "EnabledSubscriptionId",
139
+ modelProperties: {
140
+ value: {
141
+ serializedName: "value",
142
+ readOnly: true,
143
+ type: {
144
+ name: "String"
145
+ }
146
+ }
147
+ }
148
+ }
149
+ };
150
+ const OperationListResult = {
151
+ type: {
152
+ name: "Composite",
153
+ className: "OperationListResult",
154
+ modelProperties: {
155
+ value: {
156
+ serializedName: "value",
157
+ type: {
158
+ name: "Sequence",
159
+ element: {
160
+ type: {
161
+ name: "Composite",
162
+ className: "Operation"
163
+ }
164
+ }
165
+ }
166
+ },
167
+ nextLink: {
168
+ serializedName: "nextLink",
169
+ type: {
170
+ name: "String"
171
+ }
172
+ }
173
+ }
174
+ }
175
+ };
176
+ const Operation = {
177
+ type: {
178
+ name: "Composite",
179
+ className: "Operation",
180
+ modelProperties: {
181
+ name: {
182
+ serializedName: "name",
183
+ type: {
184
+ name: "String"
185
+ }
186
+ },
187
+ isDataAction: {
188
+ serializedName: "isDataAction",
189
+ type: {
190
+ name: "Boolean"
191
+ }
192
+ },
193
+ display: {
194
+ serializedName: "display",
195
+ type: {
196
+ name: "Composite",
197
+ className: "OperationDisplay"
198
+ }
199
+ }
200
+ }
201
+ }
202
+ };
203
+ const OperationDisplay = {
204
+ type: {
205
+ name: "Composite",
206
+ className: "OperationDisplay",
207
+ modelProperties: {
208
+ provider: {
209
+ serializedName: "provider",
210
+ type: {
211
+ name: "String"
212
+ }
213
+ },
214
+ resource: {
215
+ serializedName: "resource",
216
+ type: {
217
+ name: "String"
218
+ }
219
+ },
220
+ operation: {
221
+ serializedName: "operation",
222
+ type: {
223
+ name: "String"
224
+ }
225
+ },
226
+ description: {
227
+ serializedName: "description",
228
+ type: {
229
+ name: "String"
230
+ }
231
+ }
232
+ }
233
+ }
234
+ };
235
+ const PutAliasRequest = {
236
+ type: {
237
+ name: "Composite",
238
+ className: "PutAliasRequest",
239
+ modelProperties: {
240
+ properties: {
241
+ serializedName: "properties",
242
+ type: {
243
+ name: "Composite",
244
+ className: "PutAliasRequestProperties"
245
+ }
246
+ }
247
+ }
248
+ }
249
+ };
250
+ const PutAliasRequestProperties = {
251
+ type: {
252
+ name: "Composite",
253
+ className: "PutAliasRequestProperties",
254
+ modelProperties: {
255
+ displayName: {
256
+ serializedName: "displayName",
257
+ type: {
258
+ name: "String"
259
+ }
260
+ },
261
+ workload: {
262
+ serializedName: "workload",
263
+ type: {
264
+ name: "String"
265
+ }
266
+ },
267
+ billingScope: {
268
+ serializedName: "billingScope",
269
+ type: {
270
+ name: "String"
271
+ }
272
+ },
273
+ subscriptionId: {
274
+ serializedName: "subscriptionId",
275
+ type: {
276
+ name: "String"
277
+ }
278
+ },
279
+ resellerId: {
280
+ serializedName: "resellerId",
281
+ type: {
282
+ name: "String"
283
+ }
284
+ },
285
+ additionalProperties: {
286
+ serializedName: "additionalProperties",
287
+ type: {
288
+ name: "Composite",
289
+ className: "PutAliasRequestAdditionalProperties"
290
+ }
291
+ }
292
+ }
293
+ }
294
+ };
295
+ const PutAliasRequestAdditionalProperties = {
296
+ type: {
297
+ name: "Composite",
298
+ className: "PutAliasRequestAdditionalProperties",
299
+ modelProperties: {
300
+ managementGroupId: {
301
+ serializedName: "managementGroupId",
302
+ type: {
303
+ name: "String"
304
+ }
305
+ },
306
+ subscriptionTenantId: {
307
+ serializedName: "subscriptionTenantId",
308
+ type: {
309
+ name: "String"
310
+ }
311
+ },
312
+ subscriptionOwnerId: {
313
+ serializedName: "subscriptionOwnerId",
314
+ type: {
315
+ name: "String"
316
+ }
317
+ },
318
+ tags: {
319
+ serializedName: "tags",
320
+ type: {
321
+ name: "Dictionary",
322
+ value: { type: { name: "String" } }
323
+ }
324
+ }
325
+ }
326
+ }
327
+ };
328
+ const SubscriptionAliasResponse = {
329
+ type: {
330
+ name: "Composite",
331
+ className: "SubscriptionAliasResponse",
332
+ modelProperties: {
333
+ id: {
334
+ serializedName: "id",
335
+ readOnly: true,
336
+ type: {
337
+ name: "String"
338
+ }
339
+ },
340
+ name: {
341
+ serializedName: "name",
342
+ readOnly: true,
343
+ type: {
344
+ name: "String"
345
+ }
346
+ },
347
+ type: {
348
+ serializedName: "type",
349
+ readOnly: true,
350
+ type: {
351
+ name: "String"
352
+ }
353
+ },
354
+ properties: {
355
+ serializedName: "properties",
356
+ type: {
357
+ name: "Composite",
358
+ className: "SubscriptionAliasResponseProperties"
359
+ }
360
+ },
361
+ systemData: {
362
+ serializedName: "systemData",
363
+ type: {
364
+ name: "Composite",
365
+ className: "SystemData"
366
+ }
367
+ }
368
+ }
369
+ }
370
+ };
371
+ const SubscriptionAliasResponseProperties = {
372
+ type: {
373
+ name: "Composite",
374
+ className: "SubscriptionAliasResponseProperties",
375
+ modelProperties: {
376
+ subscriptionId: {
377
+ serializedName: "subscriptionId",
378
+ readOnly: true,
379
+ type: {
380
+ name: "String"
381
+ }
382
+ },
383
+ displayName: {
384
+ serializedName: "displayName",
385
+ type: {
386
+ name: "String"
387
+ }
388
+ },
389
+ provisioningState: {
390
+ serializedName: "provisioningState",
391
+ type: {
392
+ name: "String"
393
+ }
394
+ },
395
+ acceptOwnershipUrl: {
396
+ serializedName: "acceptOwnershipUrl",
397
+ readOnly: true,
398
+ type: {
399
+ name: "String"
400
+ }
401
+ },
402
+ acceptOwnershipState: {
403
+ serializedName: "acceptOwnershipState",
404
+ readOnly: true,
405
+ type: {
406
+ name: "String"
407
+ }
408
+ },
409
+ billingScope: {
410
+ serializedName: "billingScope",
411
+ type: {
412
+ name: "String"
413
+ }
414
+ },
415
+ workload: {
416
+ serializedName: "workload",
417
+ type: {
418
+ name: "String"
419
+ }
420
+ },
421
+ resellerId: {
422
+ serializedName: "resellerId",
423
+ type: {
424
+ name: "String"
425
+ }
426
+ },
427
+ subscriptionOwnerId: {
428
+ serializedName: "subscriptionOwnerId",
429
+ type: {
430
+ name: "String"
431
+ }
432
+ },
433
+ managementGroupId: {
434
+ serializedName: "managementGroupId",
435
+ type: {
436
+ name: "String"
437
+ }
438
+ },
439
+ tags: {
440
+ serializedName: "tags",
441
+ type: {
442
+ name: "Dictionary",
443
+ value: { type: { name: "String" } }
444
+ }
445
+ }
446
+ }
447
+ }
448
+ };
449
+ const SystemData = {
450
+ type: {
451
+ name: "Composite",
452
+ className: "SystemData",
453
+ modelProperties: {
454
+ createdBy: {
455
+ serializedName: "createdBy",
456
+ type: {
457
+ name: "String"
458
+ }
459
+ },
460
+ createdByType: {
461
+ serializedName: "createdByType",
462
+ type: {
463
+ name: "String"
464
+ }
465
+ },
466
+ createdAt: {
467
+ serializedName: "createdAt",
468
+ type: {
469
+ name: "DateTime"
470
+ }
471
+ },
472
+ lastModifiedBy: {
473
+ serializedName: "lastModifiedBy",
474
+ type: {
475
+ name: "String"
476
+ }
477
+ },
478
+ lastModifiedByType: {
479
+ serializedName: "lastModifiedByType",
480
+ type: {
481
+ name: "String"
482
+ }
483
+ },
484
+ lastModifiedAt: {
485
+ serializedName: "lastModifiedAt",
486
+ type: {
487
+ name: "DateTime"
488
+ }
489
+ }
490
+ }
491
+ }
492
+ };
493
+ const SubscriptionAliasListResult = {
494
+ type: {
495
+ name: "Composite",
496
+ className: "SubscriptionAliasListResult",
497
+ modelProperties: {
498
+ value: {
499
+ serializedName: "value",
500
+ readOnly: true,
501
+ type: {
502
+ name: "Sequence",
503
+ element: {
504
+ type: {
505
+ name: "Composite",
506
+ className: "SubscriptionAliasResponse"
507
+ }
508
+ }
509
+ }
510
+ },
511
+ nextLink: {
512
+ serializedName: "nextLink",
513
+ readOnly: true,
514
+ type: {
515
+ name: "String"
516
+ }
517
+ }
518
+ }
519
+ }
520
+ };
521
+ const AcceptOwnershipRequest = {
522
+ type: {
523
+ name: "Composite",
524
+ className: "AcceptOwnershipRequest",
525
+ modelProperties: {
526
+ properties: {
527
+ serializedName: "properties",
528
+ type: {
529
+ name: "Composite",
530
+ className: "AcceptOwnershipRequestProperties"
531
+ }
532
+ }
533
+ }
534
+ }
535
+ };
536
+ const AcceptOwnershipRequestProperties = {
537
+ type: {
538
+ name: "Composite",
539
+ className: "AcceptOwnershipRequestProperties",
540
+ modelProperties: {
541
+ displayName: {
542
+ serializedName: "displayName",
543
+ required: true,
544
+ type: {
545
+ name: "String"
546
+ }
547
+ },
548
+ managementGroupId: {
549
+ serializedName: "managementGroupId",
550
+ type: {
551
+ name: "String"
552
+ }
553
+ },
554
+ tags: {
555
+ serializedName: "tags",
556
+ type: {
557
+ name: "Dictionary",
558
+ value: { type: { name: "String" } }
559
+ }
560
+ }
561
+ }
562
+ }
563
+ };
564
+ const AcceptOwnershipStatusResponse = {
565
+ type: {
566
+ name: "Composite",
567
+ className: "AcceptOwnershipStatusResponse",
568
+ modelProperties: {
569
+ subscriptionId: {
570
+ serializedName: "subscriptionId",
571
+ readOnly: true,
572
+ type: {
573
+ name: "String"
574
+ }
575
+ },
576
+ acceptOwnershipState: {
577
+ serializedName: "acceptOwnershipState",
578
+ readOnly: true,
579
+ type: {
580
+ name: "String"
581
+ }
582
+ },
583
+ billingOwner: {
584
+ serializedName: "billingOwner",
585
+ readOnly: true,
586
+ type: {
587
+ name: "String"
588
+ }
589
+ },
590
+ subscriptionTenantId: {
591
+ serializedName: "subscriptionTenantId",
592
+ type: {
593
+ name: "String"
594
+ }
595
+ },
596
+ displayName: {
597
+ serializedName: "displayName",
598
+ type: {
599
+ name: "String"
600
+ }
601
+ },
602
+ tags: {
603
+ serializedName: "tags",
604
+ type: {
605
+ name: "Dictionary",
606
+ value: { type: { name: "String" } }
607
+ }
608
+ }
609
+ }
610
+ }
611
+ };
612
+ const PutTenantPolicyRequestProperties = {
613
+ type: {
614
+ name: "Composite",
615
+ className: "PutTenantPolicyRequestProperties",
616
+ modelProperties: {
617
+ blockSubscriptionsLeavingTenant: {
618
+ serializedName: "blockSubscriptionsLeavingTenant",
619
+ type: {
620
+ name: "Boolean"
621
+ }
622
+ },
623
+ blockSubscriptionsIntoTenant: {
624
+ serializedName: "blockSubscriptionsIntoTenant",
625
+ type: {
626
+ name: "Boolean"
627
+ }
628
+ },
629
+ exemptedPrincipals: {
630
+ serializedName: "exemptedPrincipals",
631
+ type: {
632
+ name: "Sequence",
633
+ element: {
634
+ type: {
635
+ name: "Uuid"
636
+ }
637
+ }
638
+ }
639
+ }
640
+ }
641
+ }
642
+ };
643
+ const GetTenantPolicyResponse = {
644
+ type: {
645
+ name: "Composite",
646
+ className: "GetTenantPolicyResponse",
647
+ modelProperties: {
648
+ id: {
649
+ serializedName: "id",
650
+ readOnly: true,
651
+ type: {
652
+ name: "String"
653
+ }
654
+ },
655
+ name: {
656
+ serializedName: "name",
657
+ readOnly: true,
658
+ type: {
659
+ name: "String"
660
+ }
661
+ },
662
+ type: {
663
+ serializedName: "type",
664
+ readOnly: true,
665
+ type: {
666
+ name: "String"
667
+ }
668
+ },
669
+ properties: {
670
+ serializedName: "properties",
671
+ type: {
672
+ name: "Composite",
673
+ className: "TenantPolicy"
674
+ }
675
+ },
676
+ systemData: {
677
+ serializedName: "systemData",
678
+ type: {
679
+ name: "Composite",
680
+ className: "SystemData"
681
+ }
682
+ }
683
+ }
684
+ }
685
+ };
686
+ const TenantPolicy = {
687
+ type: {
688
+ name: "Composite",
689
+ className: "TenantPolicy",
690
+ modelProperties: {
691
+ policyId: {
692
+ serializedName: "policyId",
693
+ readOnly: true,
694
+ type: {
695
+ name: "String"
696
+ }
697
+ },
698
+ blockSubscriptionsLeavingTenant: {
699
+ serializedName: "blockSubscriptionsLeavingTenant",
700
+ type: {
701
+ name: "Boolean"
702
+ }
703
+ },
704
+ blockSubscriptionsIntoTenant: {
705
+ serializedName: "blockSubscriptionsIntoTenant",
706
+ type: {
707
+ name: "Boolean"
708
+ }
709
+ },
710
+ exemptedPrincipals: {
711
+ serializedName: "exemptedPrincipals",
712
+ type: {
713
+ name: "Sequence",
714
+ element: {
715
+ type: {
716
+ name: "Uuid"
717
+ }
718
+ }
719
+ }
720
+ }
721
+ }
722
+ }
723
+ };
724
+ const GetTenantPolicyListResponse = {
725
+ type: {
726
+ name: "Composite",
727
+ className: "GetTenantPolicyListResponse",
728
+ modelProperties: {
729
+ value: {
730
+ serializedName: "value",
731
+ readOnly: true,
732
+ type: {
733
+ name: "Sequence",
734
+ element: {
735
+ type: {
736
+ name: "Composite",
737
+ className: "GetTenantPolicyResponse"
738
+ }
739
+ }
740
+ }
741
+ },
742
+ nextLink: {
743
+ serializedName: "nextLink",
744
+ readOnly: true,
745
+ type: {
746
+ name: "String"
747
+ }
748
+ }
749
+ }
750
+ }
751
+ };
752
+ const BillingAccountPoliciesResponse = {
753
+ type: {
754
+ name: "Composite",
755
+ className: "BillingAccountPoliciesResponse",
756
+ modelProperties: {
757
+ id: {
758
+ serializedName: "id",
759
+ readOnly: true,
760
+ type: {
761
+ name: "String"
762
+ }
763
+ },
764
+ name: {
765
+ serializedName: "name",
766
+ readOnly: true,
767
+ type: {
768
+ name: "String"
769
+ }
770
+ },
771
+ type: {
772
+ serializedName: "type",
773
+ readOnly: true,
774
+ type: {
775
+ name: "String"
776
+ }
777
+ },
778
+ properties: {
779
+ serializedName: "properties",
780
+ type: {
781
+ name: "Composite",
782
+ className: "BillingAccountPoliciesResponseProperties"
783
+ }
784
+ },
785
+ systemData: {
786
+ serializedName: "systemData",
787
+ type: {
788
+ name: "Composite",
789
+ className: "SystemData"
790
+ }
791
+ }
792
+ }
793
+ }
794
+ };
795
+ const BillingAccountPoliciesResponseProperties = {
796
+ type: {
797
+ name: "Composite",
798
+ className: "BillingAccountPoliciesResponseProperties",
799
+ modelProperties: {
800
+ serviceTenants: {
801
+ serializedName: "serviceTenants",
802
+ type: {
803
+ name: "Sequence",
804
+ element: {
805
+ type: {
806
+ name: "Composite",
807
+ className: "ServiceTenantResponse"
808
+ }
809
+ }
810
+ }
811
+ },
812
+ allowTransfers: {
813
+ serializedName: "allowTransfers",
814
+ type: {
815
+ name: "Boolean"
816
+ }
817
+ }
818
+ }
819
+ }
820
+ };
821
+ const ServiceTenantResponse = {
822
+ type: {
823
+ name: "Composite",
824
+ className: "ServiceTenantResponse",
825
+ modelProperties: {
826
+ tenantId: {
827
+ serializedName: "tenantId",
828
+ type: {
829
+ name: "String"
830
+ }
831
+ },
832
+ tenantName: {
833
+ serializedName: "tenantName",
834
+ type: {
835
+ name: "String"
836
+ }
837
+ }
838
+ }
839
+ }
840
+ };
841
+ const SubscriptionAcceptOwnershipHeaders = {
842
+ type: {
843
+ name: "Composite",
844
+ className: "SubscriptionAcceptOwnershipHeaders",
845
+ modelProperties: {
846
+ location: {
847
+ serializedName: "location",
848
+ type: {
849
+ name: "String"
850
+ }
851
+ },
852
+ retryAfter: {
853
+ serializedName: "retry-after",
854
+ type: {
855
+ name: "Number"
856
+ }
857
+ }
858
+ }
859
+ }
860
+ };
861
+
862
+ var Mappers = /*#__PURE__*/Object.freeze({
863
+ __proto__: null,
864
+ CanceledSubscriptionId: CanceledSubscriptionId,
865
+ ErrorResponseBody: ErrorResponseBody,
866
+ ErrorResponse: ErrorResponse,
867
+ SubscriptionName: SubscriptionName,
868
+ RenamedSubscriptionId: RenamedSubscriptionId,
869
+ EnabledSubscriptionId: EnabledSubscriptionId,
870
+ OperationListResult: OperationListResult,
871
+ Operation: Operation,
872
+ OperationDisplay: OperationDisplay,
873
+ PutAliasRequest: PutAliasRequest,
874
+ PutAliasRequestProperties: PutAliasRequestProperties,
875
+ PutAliasRequestAdditionalProperties: PutAliasRequestAdditionalProperties,
876
+ SubscriptionAliasResponse: SubscriptionAliasResponse,
877
+ SubscriptionAliasResponseProperties: SubscriptionAliasResponseProperties,
878
+ SystemData: SystemData,
879
+ SubscriptionAliasListResult: SubscriptionAliasListResult,
880
+ AcceptOwnershipRequest: AcceptOwnershipRequest,
881
+ AcceptOwnershipRequestProperties: AcceptOwnershipRequestProperties,
882
+ AcceptOwnershipStatusResponse: AcceptOwnershipStatusResponse,
883
+ PutTenantPolicyRequestProperties: PutTenantPolicyRequestProperties,
884
+ GetTenantPolicyResponse: GetTenantPolicyResponse,
885
+ TenantPolicy: TenantPolicy,
886
+ GetTenantPolicyListResponse: GetTenantPolicyListResponse,
887
+ BillingAccountPoliciesResponse: BillingAccountPoliciesResponse,
888
+ BillingAccountPoliciesResponseProperties: BillingAccountPoliciesResponseProperties,
889
+ ServiceTenantResponse: ServiceTenantResponse,
890
+ SubscriptionAcceptOwnershipHeaders: SubscriptionAcceptOwnershipHeaders
891
+ });
892
+
893
+ /*
894
+ * Copyright (c) Microsoft Corporation.
895
+ * Licensed under the MIT License.
896
+ *
897
+ * Code generated by Microsoft (R) AutoRest Code Generator.
898
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
899
+ */
900
+ const accept = {
901
+ parameterPath: "accept",
902
+ mapper: {
903
+ defaultValue: "application/json",
904
+ isConstant: true,
905
+ serializedName: "Accept",
906
+ type: {
907
+ name: "String"
908
+ }
909
+ }
910
+ };
911
+ const $host = {
912
+ parameterPath: "$host",
913
+ mapper: {
914
+ serializedName: "$host",
915
+ required: true,
916
+ type: {
917
+ name: "String"
918
+ }
919
+ },
920
+ skipEncoding: true
921
+ };
922
+ const subscriptionId = {
923
+ parameterPath: "subscriptionId",
924
+ mapper: {
925
+ serializedName: "subscriptionId",
926
+ required: true,
927
+ type: {
928
+ name: "String"
929
+ }
930
+ }
931
+ };
932
+ const apiVersion = {
933
+ parameterPath: "apiVersion",
934
+ mapper: {
935
+ defaultValue: "2021-10-01",
936
+ isConstant: true,
937
+ serializedName: "api-version",
938
+ type: {
939
+ name: "String"
940
+ }
941
+ }
942
+ };
943
+ const contentType = {
944
+ parameterPath: ["options", "contentType"],
945
+ mapper: {
946
+ defaultValue: "application/json",
947
+ isConstant: true,
948
+ serializedName: "Content-Type",
949
+ type: {
950
+ name: "String"
951
+ }
952
+ }
953
+ };
954
+ const body = {
955
+ parameterPath: "body",
956
+ mapper: SubscriptionName
957
+ };
958
+ const body1 = {
959
+ parameterPath: "body",
960
+ mapper: AcceptOwnershipRequest
961
+ };
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
+ const body2 = {
974
+ parameterPath: "body",
975
+ mapper: PutAliasRequest
976
+ };
977
+ const aliasName = {
978
+ parameterPath: "aliasName",
979
+ mapper: {
980
+ serializedName: "aliasName",
981
+ required: true,
982
+ type: {
983
+ name: "String"
984
+ }
985
+ }
986
+ };
987
+ const body3 = {
988
+ parameterPath: "body",
989
+ mapper: PutTenantPolicyRequestProperties
990
+ };
991
+ const billingAccountId = {
992
+ parameterPath: "billingAccountId",
993
+ mapper: {
994
+ serializedName: "billingAccountId",
995
+ required: true,
996
+ type: {
997
+ name: "String"
998
+ }
999
+ }
1000
+ };
1001
+
1002
+ /*
1003
+ * Copyright (c) Microsoft Corporation.
1004
+ * Licensed under the MIT License.
1005
+ *
1006
+ * Code generated by Microsoft (R) AutoRest Code Generator.
1007
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1008
+ */
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
+ });
1021
+ }
1022
+ sendPollRequest(path) {
1023
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1024
+ const _a = this.spec, restSpec = tslib.__rest(_a, ["requestBody"]);
1025
+ return this.sendOperationFn(this.args, Object.assign(Object.assign({}, restSpec), { path, httpMethod: "GET" }));
1026
+ });
1027
+ }
1028
+ }
1029
+
1030
+ /*
1031
+ * Copyright (c) Microsoft Corporation.
1032
+ * Licensed under the MIT License.
1033
+ *
1034
+ * Code generated by Microsoft (R) AutoRest Code Generator.
1035
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1036
+ */
1037
+ /** Class containing Subscription operations. */
1038
+ class SubscriptionImpl {
1039
+ /**
1040
+ * Initialize a new instance of the class Subscription class.
1041
+ * @param client Reference to the service client
1042
+ */
1043
+ constructor(client) {
1044
+ this.client = client;
1045
+ }
1046
+ /**
1047
+ * The operation to cancel a subscription
1048
+ * @param subscriptionId Subscription Id.
1049
+ * @param options The options parameters.
1050
+ */
1051
+ cancel(subscriptionId, options) {
1052
+ return this.client.sendOperationRequest({ subscriptionId, options }, cancelOperationSpec);
1053
+ }
1054
+ /**
1055
+ * The operation to rename a subscription
1056
+ * @param subscriptionId Subscription Id.
1057
+ * @param body Subscription Name
1058
+ * @param options The options parameters.
1059
+ */
1060
+ rename(subscriptionId, body, options) {
1061
+ return this.client.sendOperationRequest({ subscriptionId, body, options }, renameOperationSpec);
1062
+ }
1063
+ /**
1064
+ * The operation to enable a subscription
1065
+ * @param subscriptionId Subscription Id.
1066
+ * @param options The options parameters.
1067
+ */
1068
+ enable(subscriptionId, options) {
1069
+ return this.client.sendOperationRequest({ subscriptionId, options }, enableOperationSpec);
1070
+ }
1071
+ /**
1072
+ * Accept subscription ownership.
1073
+ * @param subscriptionId Subscription Id.
1074
+ * @param body The parameters required to accept subscription ownership.
1075
+ * @param options The options parameters.
1076
+ */
1077
+ beginAcceptOwnership(subscriptionId, body, options) {
1078
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1079
+ const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1080
+ return this.client.sendOperationRequest(args, spec);
1081
+ });
1082
+ const sendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1083
+ var _a;
1084
+ let currentRawResponse = undefined;
1085
+ const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
1086
+ const callback = (rawResponse, flatResponse) => {
1087
+ currentRawResponse = rawResponse;
1088
+ providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
1089
+ };
1090
+ const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
1091
+ const flatResponse = yield directSendOperation(updatedArgs, spec);
1092
+ return {
1093
+ flatResponse,
1094
+ rawResponse: {
1095
+ statusCode: currentRawResponse.status,
1096
+ body: currentRawResponse.parsedBody,
1097
+ headers: currentRawResponse.headers.toJSON()
1098
+ }
1099
+ };
1100
+ });
1101
+ const lro = new LroImpl(sendOperation, { subscriptionId, body, options }, acceptOwnershipOperationSpec);
1102
+ return new coreLro.LroEngine(lro, {
1103
+ resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
1104
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
1105
+ });
1106
+ });
1107
+ }
1108
+ /**
1109
+ * Accept subscription ownership.
1110
+ * @param subscriptionId Subscription Id.
1111
+ * @param body The parameters required to accept subscription ownership.
1112
+ * @param options The options parameters.
1113
+ */
1114
+ beginAcceptOwnershipAndWait(subscriptionId, body, options) {
1115
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1116
+ const poller = yield this.beginAcceptOwnership(subscriptionId, body, options);
1117
+ return poller.pollUntilDone();
1118
+ });
1119
+ }
1120
+ /**
1121
+ * Accept subscription ownership status.
1122
+ * @param subscriptionId Subscription Id.
1123
+ * @param options The options parameters.
1124
+ */
1125
+ acceptOwnershipStatus(subscriptionId, options) {
1126
+ return this.client.sendOperationRequest({ subscriptionId, options }, acceptOwnershipStatusOperationSpec);
1127
+ }
1128
+ }
1129
+ // Operation Specifications
1130
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
1131
+ const cancelOperationSpec = {
1132
+ path: "/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/cancel",
1133
+ httpMethod: "POST",
1134
+ responses: {
1135
+ 200: {
1136
+ bodyMapper: CanceledSubscriptionId
1137
+ },
1138
+ default: {
1139
+ bodyMapper: ErrorResponseBody
1140
+ }
1141
+ },
1142
+ queryParameters: [apiVersion],
1143
+ urlParameters: [$host, subscriptionId],
1144
+ headerParameters: [accept],
1145
+ serializer
1146
+ };
1147
+ const renameOperationSpec = {
1148
+ path: "/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/rename",
1149
+ httpMethod: "POST",
1150
+ responses: {
1151
+ 200: {
1152
+ bodyMapper: RenamedSubscriptionId
1153
+ },
1154
+ default: {
1155
+ bodyMapper: ErrorResponseBody
1156
+ }
1157
+ },
1158
+ requestBody: body,
1159
+ queryParameters: [apiVersion],
1160
+ urlParameters: [$host, subscriptionId],
1161
+ headerParameters: [accept, contentType],
1162
+ mediaType: "json",
1163
+ serializer
1164
+ };
1165
+ const enableOperationSpec = {
1166
+ path: "/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/enable",
1167
+ httpMethod: "POST",
1168
+ responses: {
1169
+ 200: {
1170
+ bodyMapper: EnabledSubscriptionId
1171
+ },
1172
+ default: {
1173
+ bodyMapper: ErrorResponseBody
1174
+ }
1175
+ },
1176
+ queryParameters: [apiVersion],
1177
+ urlParameters: [$host, subscriptionId],
1178
+ headerParameters: [accept],
1179
+ serializer
1180
+ };
1181
+ const acceptOwnershipOperationSpec = {
1182
+ path: "/providers/Microsoft.Subscription/{subscriptionId}/acceptOwnership",
1183
+ httpMethod: "POST",
1184
+ responses: {
1185
+ 200: {
1186
+ headersMapper: SubscriptionAcceptOwnershipHeaders
1187
+ },
1188
+ 201: {
1189
+ headersMapper: SubscriptionAcceptOwnershipHeaders
1190
+ },
1191
+ 202: {
1192
+ headersMapper: SubscriptionAcceptOwnershipHeaders
1193
+ },
1194
+ 204: {
1195
+ headersMapper: SubscriptionAcceptOwnershipHeaders
1196
+ },
1197
+ default: {
1198
+ bodyMapper: ErrorResponseBody
1199
+ }
1200
+ },
1201
+ requestBody: body1,
1202
+ queryParameters: [apiVersion],
1203
+ urlParameters: [$host, subscriptionId],
1204
+ headerParameters: [accept, contentType],
1205
+ mediaType: "json",
1206
+ serializer
1207
+ };
1208
+ const acceptOwnershipStatusOperationSpec = {
1209
+ path: "/providers/Microsoft.Subscription/{subscriptionId}/acceptOwnershipStatus",
1210
+ httpMethod: "GET",
1211
+ responses: {
1212
+ 200: {
1213
+ bodyMapper: AcceptOwnershipStatusResponse
1214
+ },
1215
+ default: {
1216
+ bodyMapper: ErrorResponseBody
1217
+ }
1218
+ },
1219
+ queryParameters: [apiVersion],
1220
+ urlParameters: [$host, subscriptionId],
1221
+ headerParameters: [accept],
1222
+ serializer
1223
+ };
1224
+
1225
+ /*
1226
+ * Copyright (c) Microsoft Corporation.
1227
+ * Licensed under the MIT License.
1228
+ *
1229
+ * Code generated by Microsoft (R) AutoRest Code Generator.
1230
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1231
+ */
1232
+ /// <reference lib="esnext.asynciterable" />
1233
+ /** Class containing Operations operations. */
1234
+ class OperationsImpl {
1235
+ /**
1236
+ * Initialize a new instance of the class Operations class.
1237
+ * @param client Reference to the service client
1238
+ */
1239
+ constructor(client) {
1240
+ this.client = client;
1241
+ }
1242
+ /**
1243
+ * Lists all of the available Microsoft.Subscription API operations.
1244
+ * @param options The options parameters.
1245
+ */
1246
+ list(options) {
1247
+ const iter = this.listPagingAll(options);
1248
+ return {
1249
+ next() {
1250
+ return iter.next();
1251
+ },
1252
+ [Symbol.asyncIterator]() {
1253
+ return this;
1254
+ },
1255
+ byPage: () => {
1256
+ return this.listPagingPage(options);
1257
+ }
1258
+ };
1259
+ }
1260
+ listPagingPage(options) {
1261
+ return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
1262
+ let result = yield tslib.__await(this._list(options));
1263
+ yield yield tslib.__await(result.value || []);
1264
+ let continuationToken = result.nextLink;
1265
+ while (continuationToken) {
1266
+ result = yield tslib.__await(this._listNext(continuationToken, options));
1267
+ continuationToken = result.nextLink;
1268
+ yield yield tslib.__await(result.value || []);
1269
+ }
1270
+ });
1271
+ }
1272
+ listPagingAll(options) {
1273
+ return tslib.__asyncGenerator(this, arguments, function* listPagingAll_1() {
1274
+ var e_1, _a;
1275
+ try {
1276
+ for (var _b = tslib.__asyncValues(this.listPagingPage(options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
1277
+ const page = _c.value;
1278
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
1279
+ }
1280
+ }
1281
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
1282
+ finally {
1283
+ try {
1284
+ if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
1285
+ }
1286
+ finally { if (e_1) throw e_1.error; }
1287
+ }
1288
+ });
1289
+ }
1290
+ /**
1291
+ * Lists all of the available Microsoft.Subscription API operations.
1292
+ * @param options The options parameters.
1293
+ */
1294
+ _list(options) {
1295
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
1296
+ }
1297
+ /**
1298
+ * ListNext
1299
+ * @param nextLink The nextLink from the previous successful call to the List method.
1300
+ * @param options The options parameters.
1301
+ */
1302
+ _listNext(nextLink, options) {
1303
+ return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec);
1304
+ }
1305
+ }
1306
+ // Operation Specifications
1307
+ const serializer$1 = coreClient.createSerializer(Mappers, /* isXml */ false);
1308
+ const listOperationSpec = {
1309
+ path: "/providers/Microsoft.Subscription/operations",
1310
+ httpMethod: "GET",
1311
+ responses: {
1312
+ 200: {
1313
+ bodyMapper: OperationListResult
1314
+ },
1315
+ default: {
1316
+ bodyMapper: ErrorResponseBody
1317
+ }
1318
+ },
1319
+ queryParameters: [apiVersion],
1320
+ urlParameters: [$host],
1321
+ headerParameters: [accept],
1322
+ serializer: serializer$1
1323
+ };
1324
+ const listNextOperationSpec = {
1325
+ path: "{nextLink}",
1326
+ httpMethod: "GET",
1327
+ responses: {
1328
+ 200: {
1329
+ bodyMapper: OperationListResult
1330
+ },
1331
+ default: {
1332
+ bodyMapper: ErrorResponseBody
1333
+ }
1334
+ },
1335
+ queryParameters: [apiVersion],
1336
+ urlParameters: [$host, nextLink],
1337
+ headerParameters: [accept],
1338
+ serializer: serializer$1
1339
+ };
1340
+
1341
+ /*
1342
+ * Copyright (c) Microsoft Corporation.
1343
+ * Licensed under the MIT License.
1344
+ *
1345
+ * Code generated by Microsoft (R) AutoRest Code Generator.
1346
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1347
+ */
1348
+ /** Class containing Alias operations. */
1349
+ class AliasImpl {
1350
+ /**
1351
+ * Initialize a new instance of the class Alias class.
1352
+ * @param client Reference to the service client
1353
+ */
1354
+ constructor(client) {
1355
+ this.client = client;
1356
+ }
1357
+ /**
1358
+ * Create Alias Subscription.
1359
+ * @param aliasName AliasName is the name for the subscription creation request. Note that this is not
1360
+ * the same as subscription name and this doesn’t have any other lifecycle need beyond the request for
1361
+ * subscription creation.
1362
+ * @param body The parameters required to create a new subscription.
1363
+ * @param options The options parameters.
1364
+ */
1365
+ beginCreate(aliasName, body, options) {
1366
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1367
+ const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1368
+ return this.client.sendOperationRequest(args, spec);
1369
+ });
1370
+ const sendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1371
+ var _a;
1372
+ let currentRawResponse = undefined;
1373
+ const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
1374
+ const callback = (rawResponse, flatResponse) => {
1375
+ currentRawResponse = rawResponse;
1376
+ providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
1377
+ };
1378
+ const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
1379
+ const flatResponse = yield directSendOperation(updatedArgs, spec);
1380
+ return {
1381
+ flatResponse,
1382
+ rawResponse: {
1383
+ statusCode: currentRawResponse.status,
1384
+ body: currentRawResponse.parsedBody,
1385
+ headers: currentRawResponse.headers.toJSON()
1386
+ }
1387
+ };
1388
+ });
1389
+ const lro = new LroImpl(sendOperation, { aliasName, body, options }, createOperationSpec);
1390
+ return new coreLro.LroEngine(lro, {
1391
+ resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
1392
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
1393
+ });
1394
+ });
1395
+ }
1396
+ /**
1397
+ * Create Alias Subscription.
1398
+ * @param aliasName AliasName is the name for the subscription creation request. Note that this is not
1399
+ * the same as subscription name and this doesn’t have any other lifecycle need beyond the request for
1400
+ * subscription creation.
1401
+ * @param body The parameters required to create a new subscription.
1402
+ * @param options The options parameters.
1403
+ */
1404
+ beginCreateAndWait(aliasName, body, options) {
1405
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1406
+ const poller = yield this.beginCreate(aliasName, body, options);
1407
+ return poller.pollUntilDone();
1408
+ });
1409
+ }
1410
+ /**
1411
+ * Get Alias Subscription.
1412
+ * @param aliasName AliasName is the name for the subscription creation request. Note that this is not
1413
+ * the same as subscription name and this doesn’t have any other lifecycle need beyond the request for
1414
+ * subscription creation.
1415
+ * @param options The options parameters.
1416
+ */
1417
+ get(aliasName, options) {
1418
+ return this.client.sendOperationRequest({ aliasName, options }, getOperationSpec);
1419
+ }
1420
+ /**
1421
+ * Delete Alias.
1422
+ * @param aliasName AliasName is the name for the subscription creation request. Note that this is not
1423
+ * the same as subscription name and this doesn’t have any other lifecycle need beyond the request for
1424
+ * subscription creation.
1425
+ * @param options The options parameters.
1426
+ */
1427
+ delete(aliasName, options) {
1428
+ return this.client.sendOperationRequest({ aliasName, options }, deleteOperationSpec);
1429
+ }
1430
+ /**
1431
+ * List Alias Subscription.
1432
+ * @param options The options parameters.
1433
+ */
1434
+ list(options) {
1435
+ return this.client.sendOperationRequest({ options }, listOperationSpec$1);
1436
+ }
1437
+ }
1438
+ // Operation Specifications
1439
+ const serializer$2 = coreClient.createSerializer(Mappers, /* isXml */ false);
1440
+ const createOperationSpec = {
1441
+ path: "/providers/Microsoft.Subscription/aliases/{aliasName}",
1442
+ httpMethod: "PUT",
1443
+ responses: {
1444
+ 200: {
1445
+ bodyMapper: SubscriptionAliasResponse
1446
+ },
1447
+ 201: {
1448
+ bodyMapper: SubscriptionAliasResponse
1449
+ },
1450
+ 202: {
1451
+ bodyMapper: SubscriptionAliasResponse
1452
+ },
1453
+ 204: {
1454
+ bodyMapper: SubscriptionAliasResponse
1455
+ },
1456
+ default: {
1457
+ bodyMapper: ErrorResponseBody
1458
+ }
1459
+ },
1460
+ requestBody: body2,
1461
+ queryParameters: [apiVersion],
1462
+ urlParameters: [$host, aliasName],
1463
+ headerParameters: [accept, contentType],
1464
+ mediaType: "json",
1465
+ serializer: serializer$2
1466
+ };
1467
+ const getOperationSpec = {
1468
+ path: "/providers/Microsoft.Subscription/aliases/{aliasName}",
1469
+ httpMethod: "GET",
1470
+ responses: {
1471
+ 200: {
1472
+ bodyMapper: SubscriptionAliasResponse
1473
+ },
1474
+ default: {
1475
+ bodyMapper: ErrorResponseBody
1476
+ }
1477
+ },
1478
+ queryParameters: [apiVersion],
1479
+ urlParameters: [$host, aliasName],
1480
+ headerParameters: [accept],
1481
+ serializer: serializer$2
1482
+ };
1483
+ const deleteOperationSpec = {
1484
+ path: "/providers/Microsoft.Subscription/aliases/{aliasName}",
1485
+ httpMethod: "DELETE",
1486
+ responses: {
1487
+ 200: {},
1488
+ 204: {},
1489
+ default: {
1490
+ bodyMapper: ErrorResponseBody
1491
+ }
1492
+ },
1493
+ queryParameters: [apiVersion],
1494
+ urlParameters: [$host, aliasName],
1495
+ headerParameters: [accept],
1496
+ serializer: serializer$2
1497
+ };
1498
+ const listOperationSpec$1 = {
1499
+ path: "/providers/Microsoft.Subscription/aliases",
1500
+ httpMethod: "GET",
1501
+ responses: {
1502
+ 200: {
1503
+ bodyMapper: SubscriptionAliasListResult
1504
+ },
1505
+ default: {
1506
+ bodyMapper: ErrorResponseBody
1507
+ }
1508
+ },
1509
+ queryParameters: [apiVersion],
1510
+ urlParameters: [$host],
1511
+ headerParameters: [accept],
1512
+ serializer: serializer$2
1513
+ };
1514
+
1515
+ /*
1516
+ * Copyright (c) Microsoft Corporation.
1517
+ * Licensed under the MIT License.
1518
+ *
1519
+ * Code generated by Microsoft (R) AutoRest Code Generator.
1520
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1521
+ */
1522
+ /// <reference lib="esnext.asynciterable" />
1523
+ /** Class containing SubscriptionPolicy operations. */
1524
+ class SubscriptionPolicyImpl {
1525
+ /**
1526
+ * Initialize a new instance of the class SubscriptionPolicy class.
1527
+ * @param client Reference to the service client
1528
+ */
1529
+ constructor(client) {
1530
+ this.client = client;
1531
+ }
1532
+ /**
1533
+ * Get the subscription tenant policy for the user's tenant.
1534
+ * @param options The options parameters.
1535
+ */
1536
+ listPolicyForTenant(options) {
1537
+ const iter = this.listPolicyForTenantPagingAll(options);
1538
+ return {
1539
+ next() {
1540
+ return iter.next();
1541
+ },
1542
+ [Symbol.asyncIterator]() {
1543
+ return this;
1544
+ },
1545
+ byPage: () => {
1546
+ return this.listPolicyForTenantPagingPage(options);
1547
+ }
1548
+ };
1549
+ }
1550
+ listPolicyForTenantPagingPage(options) {
1551
+ return tslib.__asyncGenerator(this, arguments, function* listPolicyForTenantPagingPage_1() {
1552
+ let result = yield tslib.__await(this._listPolicyForTenant(options));
1553
+ yield yield tslib.__await(result.value || []);
1554
+ let continuationToken = result.nextLink;
1555
+ while (continuationToken) {
1556
+ result = yield tslib.__await(this._listPolicyForTenantNext(continuationToken, options));
1557
+ continuationToken = result.nextLink;
1558
+ yield yield tslib.__await(result.value || []);
1559
+ }
1560
+ });
1561
+ }
1562
+ listPolicyForTenantPagingAll(options) {
1563
+ return tslib.__asyncGenerator(this, arguments, function* listPolicyForTenantPagingAll_1() {
1564
+ var e_1, _a;
1565
+ try {
1566
+ for (var _b = tslib.__asyncValues(this.listPolicyForTenantPagingPage(options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
1567
+ const page = _c.value;
1568
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
1569
+ }
1570
+ }
1571
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
1572
+ finally {
1573
+ try {
1574
+ if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
1575
+ }
1576
+ finally { if (e_1) throw e_1.error; }
1577
+ }
1578
+ });
1579
+ }
1580
+ /**
1581
+ * Create or Update Subscription tenant policy for user's tenant.
1582
+ * @param body Put tenant policy request properties.
1583
+ * @param options The options parameters.
1584
+ */
1585
+ addUpdatePolicyForTenant(body, options) {
1586
+ return this.client.sendOperationRequest({ body, options }, addUpdatePolicyForTenantOperationSpec);
1587
+ }
1588
+ /**
1589
+ * Get the subscription tenant policy for the user's tenant.
1590
+ * @param options The options parameters.
1591
+ */
1592
+ getPolicyForTenant(options) {
1593
+ return this.client.sendOperationRequest({ options }, getPolicyForTenantOperationSpec);
1594
+ }
1595
+ /**
1596
+ * Get the subscription tenant policy for the user's tenant.
1597
+ * @param options The options parameters.
1598
+ */
1599
+ _listPolicyForTenant(options) {
1600
+ return this.client.sendOperationRequest({ options }, listPolicyForTenantOperationSpec);
1601
+ }
1602
+ /**
1603
+ * ListPolicyForTenantNext
1604
+ * @param nextLink The nextLink from the previous successful call to the ListPolicyForTenant method.
1605
+ * @param options The options parameters.
1606
+ */
1607
+ _listPolicyForTenantNext(nextLink, options) {
1608
+ return this.client.sendOperationRequest({ nextLink, options }, listPolicyForTenantNextOperationSpec);
1609
+ }
1610
+ }
1611
+ // Operation Specifications
1612
+ const serializer$3 = coreClient.createSerializer(Mappers, /* isXml */ false);
1613
+ const addUpdatePolicyForTenantOperationSpec = {
1614
+ path: "/providers/Microsoft.Subscription/policies/default",
1615
+ httpMethod: "PUT",
1616
+ responses: {
1617
+ 201: {
1618
+ bodyMapper: GetTenantPolicyResponse
1619
+ },
1620
+ default: {
1621
+ bodyMapper: ErrorResponseBody
1622
+ }
1623
+ },
1624
+ requestBody: body3,
1625
+ queryParameters: [apiVersion],
1626
+ urlParameters: [$host],
1627
+ headerParameters: [accept, contentType],
1628
+ mediaType: "json",
1629
+ serializer: serializer$3
1630
+ };
1631
+ const getPolicyForTenantOperationSpec = {
1632
+ path: "/providers/Microsoft.Subscription/policies/default",
1633
+ httpMethod: "GET",
1634
+ responses: {
1635
+ 200: {
1636
+ bodyMapper: GetTenantPolicyResponse
1637
+ },
1638
+ default: {
1639
+ bodyMapper: ErrorResponseBody
1640
+ }
1641
+ },
1642
+ queryParameters: [apiVersion],
1643
+ urlParameters: [$host],
1644
+ headerParameters: [accept],
1645
+ serializer: serializer$3
1646
+ };
1647
+ const listPolicyForTenantOperationSpec = {
1648
+ path: "/providers/Microsoft.Subscription/policies",
1649
+ httpMethod: "GET",
1650
+ responses: {
1651
+ 200: {
1652
+ bodyMapper: GetTenantPolicyListResponse
1653
+ },
1654
+ default: {
1655
+ bodyMapper: ErrorResponseBody
1656
+ }
1657
+ },
1658
+ queryParameters: [apiVersion],
1659
+ urlParameters: [$host],
1660
+ headerParameters: [accept],
1661
+ serializer: serializer$3
1662
+ };
1663
+ const listPolicyForTenantNextOperationSpec = {
1664
+ path: "{nextLink}",
1665
+ httpMethod: "GET",
1666
+ responses: {
1667
+ 200: {
1668
+ bodyMapper: GetTenantPolicyListResponse
1669
+ },
1670
+ default: {
1671
+ bodyMapper: ErrorResponseBody
1672
+ }
1673
+ },
1674
+ queryParameters: [apiVersion],
1675
+ urlParameters: [$host, nextLink],
1676
+ headerParameters: [accept],
1677
+ serializer: serializer$3
1678
+ };
1679
+
1680
+ /*
1681
+ * Copyright (c) Microsoft Corporation.
1682
+ * Licensed under the MIT License.
1683
+ *
1684
+ * Code generated by Microsoft (R) AutoRest Code Generator.
1685
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1686
+ */
1687
+ /** Class containing BillingAccount operations. */
1688
+ class BillingAccountImpl {
1689
+ /**
1690
+ * Initialize a new instance of the class BillingAccount class.
1691
+ * @param client Reference to the service client
1692
+ */
1693
+ constructor(client) {
1694
+ this.client = client;
1695
+ }
1696
+ /**
1697
+ * Get Billing Account Policy.
1698
+ * @param billingAccountId Billing Account Id.
1699
+ * @param options The options parameters.
1700
+ */
1701
+ getPolicy(billingAccountId, options) {
1702
+ return this.client.sendOperationRequest({ billingAccountId, options }, getPolicyOperationSpec);
1703
+ }
1704
+ }
1705
+ // Operation Specifications
1706
+ const serializer$4 = coreClient.createSerializer(Mappers, /* isXml */ false);
1707
+ const getPolicyOperationSpec = {
1708
+ path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Subscription/policies/default",
1709
+ httpMethod: "GET",
1710
+ responses: {
1711
+ 200: {
1712
+ bodyMapper: BillingAccountPoliciesResponse
1713
+ },
1714
+ default: {
1715
+ bodyMapper: ErrorResponseBody
1716
+ }
1717
+ },
1718
+ queryParameters: [apiVersion],
1719
+ urlParameters: [$host, billingAccountId],
1720
+ headerParameters: [accept],
1721
+ serializer: serializer$4
1722
+ };
1723
+
1724
+ /*
1725
+ * Copyright (c) Microsoft Corporation.
1726
+ * Licensed under the MIT License.
1727
+ *
1728
+ * Code generated by Microsoft (R) AutoRest Code Generator.
1729
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1730
+ */
1731
+ class SubscriptionClient extends coreClient.ServiceClient {
1732
+ /**
1733
+ * Initializes a new instance of the SubscriptionClient class.
1734
+ * @param credentials Subscription credentials which uniquely identify client subscription.
1735
+ * @param options The parameter options
1736
+ */
1737
+ constructor(credentials, options) {
1738
+ if (credentials === undefined) {
1739
+ throw new Error("'credentials' cannot be null");
1740
+ }
1741
+ // Initializing default values for options
1742
+ if (!options) {
1743
+ options = {};
1744
+ }
1745
+ const defaults = {
1746
+ requestContentType: "application/json; charset=utf-8",
1747
+ credential: credentials
1748
+ };
1749
+ const packageDetails = `azsdk-js-arm-subscriptions/4.0.0`;
1750
+ const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
1751
+ ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
1752
+ : `${packageDetails}`;
1753
+ if (!options.credentialScopes) {
1754
+ options.credentialScopes = ["https://management.azure.com/.default"];
1755
+ }
1756
+ const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
1757
+ userAgentPrefix
1758
+ }, baseUri: options.endpoint || "https://management.azure.com" });
1759
+ super(optionsWithDefaults);
1760
+ // Assigning values to Constant parameters
1761
+ this.$host = options.$host || "https://management.azure.com";
1762
+ this.apiVersion = options.apiVersion || "2021-10-01";
1763
+ this.subscription = new SubscriptionImpl(this);
1764
+ this.operations = new OperationsImpl(this);
1765
+ this.alias = new AliasImpl(this);
1766
+ this.subscriptionPolicy = new SubscriptionPolicyImpl(this);
1767
+ this.billingAccount = new BillingAccountImpl(this);
1768
+ }
1769
+ }
1770
+
1771
+ exports.SubscriptionClient = SubscriptionClient;
1772
+ //# sourceMappingURL=index.js.map