@azure/arm-subscriptions 3.1.2 → 5.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 (199) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/{LICENSE.txt → LICENSE} +2 -2
  3. package/README.md +69 -79
  4. package/dist/index.js +2330 -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 +658 -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 +36 -0
  21. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  22. package/dist-esm/src/models/mappers.js +1057 -0
  23. package/dist-esm/src/models/mappers.js.map +1 -0
  24. package/dist-esm/src/models/parameters.d.ts +15 -0
  25. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  26. package/dist-esm/src/models/parameters.js +121 -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/{esm → dist-esm/src}/operations/index.d.ts +2 -0
  37. package/dist-esm/src/operations/index.d.ts.map +1 -0
  38. package/{esm → dist-esm/src}/operations/index.js +5 -5
  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/subscriptionOperations.d.ts +53 -0
  45. package/dist-esm/src/operations/subscriptionOperations.d.ts.map +1 -0
  46. package/dist-esm/src/operations/subscriptionOperations.js +201 -0
  47. package/dist-esm/src/operations/subscriptionOperations.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/operations/subscriptions.d.ts +54 -0
  53. package/dist-esm/src/operations/subscriptions.d.ts.map +1 -0
  54. package/dist-esm/src/operations/subscriptions.js +201 -0
  55. package/dist-esm/src/operations/subscriptions.js.map +1 -0
  56. package/dist-esm/src/operations/tenants.d.ts +32 -0
  57. package/dist-esm/src/operations/tenants.d.ts.map +1 -0
  58. package/dist-esm/src/operations/tenants.js +114 -0
  59. package/dist-esm/src/operations/tenants.js.map +1 -0
  60. package/dist-esm/src/operationsInterfaces/alias.d.ts +45 -0
  61. package/dist-esm/src/operationsInterfaces/alias.d.ts.map +1 -0
  62. package/dist-esm/src/operationsInterfaces/alias.js +9 -0
  63. package/dist-esm/src/operationsInterfaces/alias.js.map +1 -0
  64. package/dist-esm/src/operationsInterfaces/billingAccount.d.ts +11 -0
  65. package/dist-esm/src/operationsInterfaces/billingAccount.d.ts.map +1 -0
  66. package/dist-esm/src/operationsInterfaces/billingAccount.js +9 -0
  67. package/dist-esm/src/operationsInterfaces/billingAccount.js.map +1 -0
  68. package/dist-esm/src/operationsInterfaces/index.d.ts +8 -0
  69. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  70. package/dist-esm/src/operationsInterfaces/index.js +15 -0
  71. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  72. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  73. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  74. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  75. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  76. package/dist-esm/src/operationsInterfaces/subscriptionOperations.d.ts +45 -0
  77. package/dist-esm/src/operationsInterfaces/subscriptionOperations.d.ts.map +1 -0
  78. package/dist-esm/src/operationsInterfaces/subscriptionOperations.js +9 -0
  79. package/dist-esm/src/operationsInterfaces/subscriptionOperations.js.map +1 -0
  80. package/dist-esm/src/operationsInterfaces/subscriptionPolicy.d.ts +22 -0
  81. package/dist-esm/src/operationsInterfaces/subscriptionPolicy.d.ts.map +1 -0
  82. package/dist-esm/src/operationsInterfaces/subscriptionPolicy.js +9 -0
  83. package/dist-esm/src/operationsInterfaces/subscriptionPolicy.js.map +1 -0
  84. package/dist-esm/src/operationsInterfaces/subscriptions.d.ts +24 -0
  85. package/dist-esm/src/operationsInterfaces/subscriptions.d.ts.map +1 -0
  86. package/dist-esm/src/operationsInterfaces/subscriptions.js +9 -0
  87. package/dist-esm/src/operationsInterfaces/subscriptions.js.map +1 -0
  88. package/dist-esm/src/operationsInterfaces/tenants.d.ts +11 -0
  89. package/dist-esm/src/operationsInterfaces/tenants.d.ts.map +1 -0
  90. package/dist-esm/src/operationsInterfaces/tenants.js +9 -0
  91. package/dist-esm/src/operationsInterfaces/tenants.js.map +1 -0
  92. package/dist-esm/src/subscriptionClient.d.ts +21 -0
  93. package/dist-esm/src/subscriptionClient.d.ts.map +1 -0
  94. package/dist-esm/src/subscriptionClient.js +50 -0
  95. package/dist-esm/src/subscriptionClient.js.map +1 -0
  96. package/dist-esm/test/sampleTest.d.ts +2 -0
  97. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  98. package/dist-esm/test/sampleTest.js +40 -0
  99. package/dist-esm/test/sampleTest.js.map +1 -0
  100. package/package.json +65 -32
  101. package/review/arm-subscriptions.api.md +559 -0
  102. package/rollup.config.js +181 -30
  103. package/src/index.ts +12 -0
  104. package/src/lroImpl.ts +34 -0
  105. package/src/models/index.ts +551 -489
  106. package/src/models/mappers.ts +685 -190
  107. package/src/models/parameters.ts +94 -27
  108. package/src/operations/alias.ts +170 -170
  109. package/src/operations/billingAccount.ts +65 -0
  110. package/src/operations/index.ts +5 -5
  111. package/src/operations/operations.ts +103 -40
  112. package/src/operations/subscriptionOperations.ts +216 -120
  113. package/src/operations/subscriptionPolicy.ts +207 -0
  114. package/src/operations/subscriptions.ts +163 -153
  115. package/src/operations/tenants.ts +87 -79
  116. package/src/operationsInterfaces/alias.ts +75 -0
  117. package/src/operationsInterfaces/billingAccount.ts +25 -0
  118. package/src/operationsInterfaces/index.ts +15 -0
  119. package/src/operationsInterfaces/operations.ts +22 -0
  120. package/src/operationsInterfaces/subscriptionOperations.ts +92 -0
  121. package/src/operationsInterfaces/subscriptionPolicy.ts +46 -0
  122. package/src/operationsInterfaces/subscriptions.ts +48 -0
  123. package/src/operationsInterfaces/tenants.ts +22 -0
  124. package/src/subscriptionClient.ts +81 -43
  125. package/tsconfig.json +3 -3
  126. package/types/arm-subscriptions.d.ts +925 -0
  127. package/types/tsdoc-metadata.json +11 -0
  128. package/dist/arm-subscriptions.js +0 -1442
  129. package/dist/arm-subscriptions.js.map +0 -1
  130. package/dist/arm-subscriptions.min.js +0 -1
  131. package/dist/arm-subscriptions.min.js.map +0 -1
  132. package/esm/models/aliasMappers.d.ts +0 -2
  133. package/esm/models/aliasMappers.d.ts.map +0 -1
  134. package/esm/models/aliasMappers.js +0 -9
  135. package/esm/models/aliasMappers.js.map +0 -1
  136. package/esm/models/index.d.ts +0 -624
  137. package/esm/models/index.d.ts.map +0 -1
  138. package/esm/models/index.js +0 -8
  139. package/esm/models/index.js.map +0 -1
  140. package/esm/models/mappers.d.ts +0 -25
  141. package/esm/models/mappers.d.ts.map +0 -1
  142. package/esm/models/mappers.js +0 -574
  143. package/esm/models/mappers.js.map +0 -1
  144. package/esm/models/operationsMappers.d.ts +0 -2
  145. package/esm/models/operationsMappers.d.ts.map +0 -1
  146. package/esm/models/operationsMappers.js +0 -9
  147. package/esm/models/operationsMappers.js.map +0 -1
  148. package/esm/models/parameters.d.ts +0 -8
  149. package/esm/models/parameters.d.ts.map +0 -1
  150. package/esm/models/parameters.js +0 -75
  151. package/esm/models/parameters.js.map +0 -1
  152. package/esm/models/subscriptionOperationsMappers.d.ts +0 -2
  153. package/esm/models/subscriptionOperationsMappers.d.ts.map +0 -1
  154. package/esm/models/subscriptionOperationsMappers.js +0 -9
  155. package/esm/models/subscriptionOperationsMappers.js.map +0 -1
  156. package/esm/models/subscriptionsMappers.d.ts +0 -2
  157. package/esm/models/subscriptionsMappers.d.ts.map +0 -1
  158. package/esm/models/subscriptionsMappers.js +0 -9
  159. package/esm/models/subscriptionsMappers.js.map +0 -1
  160. package/esm/models/tenantsMappers.d.ts +0 -2
  161. package/esm/models/tenantsMappers.d.ts.map +0 -1
  162. package/esm/models/tenantsMappers.js +0 -9
  163. package/esm/models/tenantsMappers.js.map +0 -1
  164. package/esm/operations/alias.d.ts +0 -81
  165. package/esm/operations/alias.d.ts.map +0 -1
  166. package/esm/operations/alias.js +0 -161
  167. package/esm/operations/alias.js.map +0 -1
  168. package/esm/operations/index.d.ts.map +0 -1
  169. package/esm/operations/index.js.map +0 -1
  170. package/esm/operations/operations.d.ts +0 -28
  171. package/esm/operations/operations.d.ts.map +0 -1
  172. package/esm/operations/operations.js +0 -51
  173. package/esm/operations/operations.js.map +0 -1
  174. package/esm/operations/subscriptionOperations.d.ts +0 -70
  175. package/esm/operations/subscriptionOperations.d.ts.map +0 -1
  176. package/esm/operations/subscriptionOperations.js +0 -117
  177. package/esm/operations/subscriptionOperations.js.map +0 -1
  178. package/esm/operations/subscriptions.d.ts +0 -84
  179. package/esm/operations/subscriptions.d.ts.map +0 -1
  180. package/esm/operations/subscriptions.js +0 -133
  181. package/esm/operations/subscriptions.js.map +0 -1
  182. package/esm/operations/tenants.d.ts +0 -46
  183. package/esm/operations/tenants.d.ts.map +0 -1
  184. package/esm/operations/tenants.js +0 -77
  185. package/esm/operations/tenants.js.map +0 -1
  186. package/esm/subscriptionClient.d.ts +0 -27
  187. package/esm/subscriptionClient.d.ts.map +0 -1
  188. package/esm/subscriptionClient.js +0 -41
  189. package/esm/subscriptionClient.js.map +0 -1
  190. package/esm/subscriptionClientContext.d.ts +0 -19
  191. package/esm/subscriptionClientContext.d.ts.map +0 -1
  192. package/esm/subscriptionClientContext.js +0 -55
  193. package/esm/subscriptionClientContext.js.map +0 -1
  194. package/src/models/aliasMappers.ts +0 -18
  195. package/src/models/operationsMappers.ts +0 -14
  196. package/src/models/subscriptionOperationsMappers.ts +0 -15
  197. package/src/models/subscriptionsMappers.ts +0 -16
  198. package/src/models/tenantsMappers.ts +0 -13
  199. package/src/subscriptionClientContext.ts +0 -60
package/dist/index.js ADDED
@@ -0,0 +1,2330 @@
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 LocationListResult = {
45
+ type: {
46
+ name: "Composite",
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",
225
+ modelProperties: {
226
+ value: {
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",
277
+ readOnly: true,
278
+ type: {
279
+ name: "String"
280
+ }
281
+ }
282
+ }
283
+ }
284
+ };
285
+ const ErrorResponseBody = {
286
+ type: {
287
+ name: "Composite",
288
+ className: "ErrorResponseBody",
289
+ modelProperties: {
290
+ error: {
291
+ serializedName: "error",
292
+ type: {
293
+ name: "Composite",
294
+ className: "ErrorResponse"
295
+ }
296
+ },
297
+ code: {
298
+ serializedName: "code",
299
+ type: {
300
+ name: "String"
301
+ }
302
+ },
303
+ message: {
304
+ serializedName: "message",
305
+ type: {
306
+ name: "String"
307
+ }
308
+ }
309
+ }
310
+ }
311
+ };
312
+ const ErrorResponse = {
313
+ type: {
314
+ name: "Composite",
315
+ className: "ErrorResponse",
316
+ modelProperties: {
317
+ code: {
318
+ serializedName: "code",
319
+ type: {
320
+ name: "String"
321
+ }
322
+ },
323
+ message: {
324
+ serializedName: "message",
325
+ type: {
326
+ name: "String"
327
+ }
328
+ }
329
+ }
330
+ }
331
+ };
332
+ const SubscriptionName = {
333
+ type: {
334
+ name: "Composite",
335
+ className: "SubscriptionName",
336
+ modelProperties: {
337
+ subscriptionName: {
338
+ serializedName: "subscriptionName",
339
+ type: {
340
+ name: "String"
341
+ }
342
+ }
343
+ }
344
+ }
345
+ };
346
+ const RenamedSubscriptionId = {
347
+ type: {
348
+ name: "Composite",
349
+ className: "RenamedSubscriptionId",
350
+ modelProperties: {
351
+ subscriptionId: {
352
+ serializedName: "subscriptionId",
353
+ readOnly: true,
354
+ type: {
355
+ name: "String"
356
+ }
357
+ }
358
+ }
359
+ }
360
+ };
361
+ const EnabledSubscriptionId = {
362
+ type: {
363
+ name: "Composite",
364
+ className: "EnabledSubscriptionId",
365
+ modelProperties: {
366
+ subscriptionId: {
367
+ serializedName: "subscriptionId",
368
+ readOnly: true,
369
+ type: {
370
+ name: "String"
371
+ }
372
+ }
373
+ }
374
+ }
375
+ };
376
+ const OperationListResult = {
377
+ type: {
378
+ name: "Composite",
379
+ className: "OperationListResult",
380
+ modelProperties: {
381
+ value: {
382
+ serializedName: "value",
383
+ type: {
384
+ name: "Sequence",
385
+ element: {
386
+ type: {
387
+ name: "Composite",
388
+ className: "Operation"
389
+ }
390
+ }
391
+ }
392
+ },
393
+ nextLink: {
394
+ serializedName: "nextLink",
395
+ type: {
396
+ name: "String"
397
+ }
398
+ }
399
+ }
400
+ }
401
+ };
402
+ const Operation = {
403
+ type: {
404
+ name: "Composite",
405
+ className: "Operation",
406
+ modelProperties: {
407
+ name: {
408
+ serializedName: "name",
409
+ type: {
410
+ name: "String"
411
+ }
412
+ },
413
+ isDataAction: {
414
+ serializedName: "isDataAction",
415
+ type: {
416
+ name: "Boolean"
417
+ }
418
+ },
419
+ display: {
420
+ serializedName: "display",
421
+ type: {
422
+ name: "Composite",
423
+ className: "OperationDisplay"
424
+ }
425
+ }
426
+ }
427
+ }
428
+ };
429
+ const OperationDisplay = {
430
+ type: {
431
+ name: "Composite",
432
+ className: "OperationDisplay",
433
+ modelProperties: {
434
+ provider: {
435
+ serializedName: "provider",
436
+ type: {
437
+ name: "String"
438
+ }
439
+ },
440
+ resource: {
441
+ serializedName: "resource",
442
+ type: {
443
+ name: "String"
444
+ }
445
+ },
446
+ operation: {
447
+ serializedName: "operation",
448
+ type: {
449
+ name: "String"
450
+ }
451
+ },
452
+ description: {
453
+ serializedName: "description",
454
+ type: {
455
+ name: "String"
456
+ }
457
+ }
458
+ }
459
+ }
460
+ };
461
+ const PutAliasRequest = {
462
+ type: {
463
+ name: "Composite",
464
+ className: "PutAliasRequest",
465
+ modelProperties: {
466
+ properties: {
467
+ serializedName: "properties",
468
+ type: {
469
+ name: "Composite",
470
+ className: "PutAliasRequestProperties"
471
+ }
472
+ }
473
+ }
474
+ }
475
+ };
476
+ const PutAliasRequestProperties = {
477
+ type: {
478
+ name: "Composite",
479
+ className: "PutAliasRequestProperties",
480
+ modelProperties: {
481
+ displayName: {
482
+ serializedName: "displayName",
483
+ type: {
484
+ name: "String"
485
+ }
486
+ },
487
+ workload: {
488
+ serializedName: "workload",
489
+ type: {
490
+ name: "String"
491
+ }
492
+ },
493
+ billingScope: {
494
+ serializedName: "billingScope",
495
+ type: {
496
+ name: "String"
497
+ }
498
+ },
499
+ subscriptionId: {
500
+ serializedName: "subscriptionId",
501
+ type: {
502
+ name: "String"
503
+ }
504
+ },
505
+ resellerId: {
506
+ serializedName: "resellerId",
507
+ type: {
508
+ name: "String"
509
+ }
510
+ },
511
+ additionalProperties: {
512
+ serializedName: "additionalProperties",
513
+ type: {
514
+ name: "Composite",
515
+ className: "PutAliasRequestAdditionalProperties"
516
+ }
517
+ }
518
+ }
519
+ }
520
+ };
521
+ const PutAliasRequestAdditionalProperties = {
522
+ type: {
523
+ name: "Composite",
524
+ className: "PutAliasRequestAdditionalProperties",
525
+ modelProperties: {
526
+ managementGroupId: {
527
+ serializedName: "managementGroupId",
528
+ type: {
529
+ name: "String"
530
+ }
531
+ },
532
+ subscriptionTenantId: {
533
+ serializedName: "subscriptionTenantId",
534
+ type: {
535
+ name: "String"
536
+ }
537
+ },
538
+ subscriptionOwnerId: {
539
+ serializedName: "subscriptionOwnerId",
540
+ type: {
541
+ name: "String"
542
+ }
543
+ },
544
+ tags: {
545
+ serializedName: "tags",
546
+ type: {
547
+ name: "Dictionary",
548
+ value: { type: { name: "String" } }
549
+ }
550
+ }
551
+ }
552
+ }
553
+ };
554
+ const SubscriptionAliasResponse = {
555
+ type: {
556
+ name: "Composite",
557
+ className: "SubscriptionAliasResponse",
558
+ modelProperties: {
559
+ id: {
560
+ serializedName: "id",
561
+ readOnly: true,
562
+ type: {
563
+ name: "String"
564
+ }
565
+ },
566
+ name: {
567
+ serializedName: "name",
568
+ readOnly: true,
569
+ type: {
570
+ name: "String"
571
+ }
572
+ },
573
+ type: {
574
+ serializedName: "type",
575
+ readOnly: true,
576
+ type: {
577
+ name: "String"
578
+ }
579
+ },
580
+ properties: {
581
+ serializedName: "properties",
582
+ type: {
583
+ name: "Composite",
584
+ className: "SubscriptionAliasResponseProperties"
585
+ }
586
+ },
587
+ systemData: {
588
+ serializedName: "systemData",
589
+ type: {
590
+ name: "Composite",
591
+ className: "SystemData"
592
+ }
593
+ }
594
+ }
595
+ }
596
+ };
597
+ const SubscriptionAliasResponseProperties = {
598
+ type: {
599
+ name: "Composite",
600
+ className: "SubscriptionAliasResponseProperties",
601
+ modelProperties: {
602
+ subscriptionId: {
603
+ serializedName: "subscriptionId",
604
+ readOnly: true,
605
+ type: {
606
+ name: "String"
607
+ }
608
+ },
609
+ displayName: {
610
+ serializedName: "displayName",
611
+ type: {
612
+ name: "String"
613
+ }
614
+ },
615
+ provisioningState: {
616
+ serializedName: "provisioningState",
617
+ type: {
618
+ name: "String"
619
+ }
620
+ },
621
+ acceptOwnershipUrl: {
622
+ serializedName: "acceptOwnershipUrl",
623
+ readOnly: true,
624
+ type: {
625
+ name: "String"
626
+ }
627
+ },
628
+ acceptOwnershipState: {
629
+ serializedName: "acceptOwnershipState",
630
+ readOnly: true,
631
+ type: {
632
+ name: "String"
633
+ }
634
+ },
635
+ billingScope: {
636
+ serializedName: "billingScope",
637
+ type: {
638
+ name: "String"
639
+ }
640
+ },
641
+ workload: {
642
+ serializedName: "workload",
643
+ type: {
644
+ name: "String"
645
+ }
646
+ },
647
+ resellerId: {
648
+ serializedName: "resellerId",
649
+ type: {
650
+ name: "String"
651
+ }
652
+ },
653
+ subscriptionOwnerId: {
654
+ serializedName: "subscriptionOwnerId",
655
+ type: {
656
+ name: "String"
657
+ }
658
+ },
659
+ managementGroupId: {
660
+ serializedName: "managementGroupId",
661
+ type: {
662
+ name: "String"
663
+ }
664
+ },
665
+ createdTime: {
666
+ serializedName: "createdTime",
667
+ type: {
668
+ name: "String"
669
+ }
670
+ },
671
+ tags: {
672
+ serializedName: "tags",
673
+ type: {
674
+ name: "Dictionary",
675
+ value: { type: { name: "String" } }
676
+ }
677
+ }
678
+ }
679
+ }
680
+ };
681
+ const SystemData = {
682
+ type: {
683
+ name: "Composite",
684
+ className: "SystemData",
685
+ modelProperties: {
686
+ createdBy: {
687
+ serializedName: "createdBy",
688
+ type: {
689
+ name: "String"
690
+ }
691
+ },
692
+ createdByType: {
693
+ serializedName: "createdByType",
694
+ type: {
695
+ name: "String"
696
+ }
697
+ },
698
+ createdAt: {
699
+ serializedName: "createdAt",
700
+ type: {
701
+ name: "DateTime"
702
+ }
703
+ },
704
+ lastModifiedBy: {
705
+ serializedName: "lastModifiedBy",
706
+ type: {
707
+ name: "String"
708
+ }
709
+ },
710
+ lastModifiedByType: {
711
+ serializedName: "lastModifiedByType",
712
+ type: {
713
+ name: "String"
714
+ }
715
+ },
716
+ lastModifiedAt: {
717
+ serializedName: "lastModifiedAt",
718
+ type: {
719
+ name: "DateTime"
720
+ }
721
+ }
722
+ }
723
+ }
724
+ };
725
+ const SubscriptionAliasListResult = {
726
+ type: {
727
+ name: "Composite",
728
+ className: "SubscriptionAliasListResult",
729
+ modelProperties: {
730
+ value: {
731
+ serializedName: "value",
732
+ readOnly: true,
733
+ type: {
734
+ name: "Sequence",
735
+ element: {
736
+ type: {
737
+ name: "Composite",
738
+ className: "SubscriptionAliasResponse"
739
+ }
740
+ }
741
+ }
742
+ },
743
+ nextLink: {
744
+ serializedName: "nextLink",
745
+ readOnly: true,
746
+ type: {
747
+ name: "String"
748
+ }
749
+ }
750
+ }
751
+ }
752
+ };
753
+ const AcceptOwnershipRequest = {
754
+ type: {
755
+ name: "Composite",
756
+ className: "AcceptOwnershipRequest",
757
+ modelProperties: {
758
+ properties: {
759
+ serializedName: "properties",
760
+ type: {
761
+ name: "Composite",
762
+ className: "AcceptOwnershipRequestProperties"
763
+ }
764
+ }
765
+ }
766
+ }
767
+ };
768
+ const AcceptOwnershipRequestProperties = {
769
+ type: {
770
+ name: "Composite",
771
+ className: "AcceptOwnershipRequestProperties",
772
+ modelProperties: {
773
+ displayName: {
774
+ serializedName: "displayName",
775
+ required: true,
776
+ type: {
777
+ name: "String"
778
+ }
779
+ },
780
+ managementGroupId: {
781
+ serializedName: "managementGroupId",
782
+ type: {
783
+ name: "String"
784
+ }
785
+ },
786
+ tags: {
787
+ serializedName: "tags",
788
+ type: {
789
+ name: "Dictionary",
790
+ value: { type: { name: "String" } }
791
+ }
792
+ }
793
+ }
794
+ }
795
+ };
796
+ const AcceptOwnershipStatusResponse = {
797
+ type: {
798
+ name: "Composite",
799
+ className: "AcceptOwnershipStatusResponse",
800
+ modelProperties: {
801
+ subscriptionId: {
802
+ serializedName: "subscriptionId",
803
+ readOnly: true,
804
+ type: {
805
+ name: "String"
806
+ }
807
+ },
808
+ acceptOwnershipState: {
809
+ serializedName: "acceptOwnershipState",
810
+ readOnly: true,
811
+ type: {
812
+ name: "String"
813
+ }
814
+ },
815
+ billingOwner: {
816
+ serializedName: "billingOwner",
817
+ readOnly: true,
818
+ type: {
819
+ name: "String"
820
+ }
821
+ },
822
+ subscriptionTenantId: {
823
+ serializedName: "subscriptionTenantId",
824
+ type: {
825
+ name: "String"
826
+ }
827
+ },
828
+ displayName: {
829
+ serializedName: "displayName",
830
+ type: {
831
+ name: "String"
832
+ }
833
+ },
834
+ tags: {
835
+ serializedName: "tags",
836
+ type: {
837
+ name: "Dictionary",
838
+ value: { type: { name: "String" } }
839
+ }
840
+ }
841
+ }
842
+ }
843
+ };
844
+ const PutTenantPolicyRequestProperties = {
845
+ type: {
846
+ name: "Composite",
847
+ className: "PutTenantPolicyRequestProperties",
848
+ modelProperties: {
849
+ blockSubscriptionsLeavingTenant: {
850
+ serializedName: "blockSubscriptionsLeavingTenant",
851
+ type: {
852
+ name: "Boolean"
853
+ }
854
+ },
855
+ blockSubscriptionsIntoTenant: {
856
+ serializedName: "blockSubscriptionsIntoTenant",
857
+ type: {
858
+ name: "Boolean"
859
+ }
860
+ },
861
+ exemptedPrincipals: {
862
+ serializedName: "exemptedPrincipals",
863
+ type: {
864
+ name: "Sequence",
865
+ element: {
866
+ type: {
867
+ name: "Uuid"
868
+ }
869
+ }
870
+ }
871
+ }
872
+ }
873
+ }
874
+ };
875
+ const GetTenantPolicyResponse = {
876
+ type: {
877
+ name: "Composite",
878
+ className: "GetTenantPolicyResponse",
879
+ modelProperties: {
880
+ id: {
881
+ serializedName: "id",
882
+ readOnly: true,
883
+ type: {
884
+ name: "String"
885
+ }
886
+ },
887
+ name: {
888
+ serializedName: "name",
889
+ readOnly: true,
890
+ type: {
891
+ name: "String"
892
+ }
893
+ },
894
+ type: {
895
+ serializedName: "type",
896
+ readOnly: true,
897
+ type: {
898
+ name: "String"
899
+ }
900
+ },
901
+ properties: {
902
+ serializedName: "properties",
903
+ type: {
904
+ name: "Composite",
905
+ className: "TenantPolicy"
906
+ }
907
+ },
908
+ systemData: {
909
+ serializedName: "systemData",
910
+ type: {
911
+ name: "Composite",
912
+ className: "SystemData"
913
+ }
914
+ }
915
+ }
916
+ }
917
+ };
918
+ const TenantPolicy = {
919
+ type: {
920
+ name: "Composite",
921
+ className: "TenantPolicy",
922
+ modelProperties: {
923
+ policyId: {
924
+ serializedName: "policyId",
925
+ readOnly: true,
926
+ type: {
927
+ name: "String"
928
+ }
929
+ },
930
+ blockSubscriptionsLeavingTenant: {
931
+ serializedName: "blockSubscriptionsLeavingTenant",
932
+ type: {
933
+ name: "Boolean"
934
+ }
935
+ },
936
+ blockSubscriptionsIntoTenant: {
937
+ serializedName: "blockSubscriptionsIntoTenant",
938
+ type: {
939
+ name: "Boolean"
940
+ }
941
+ },
942
+ exemptedPrincipals: {
943
+ serializedName: "exemptedPrincipals",
944
+ type: {
945
+ name: "Sequence",
946
+ element: {
947
+ type: {
948
+ name: "Uuid"
949
+ }
950
+ }
951
+ }
952
+ }
953
+ }
954
+ }
955
+ };
956
+ const GetTenantPolicyListResponse = {
957
+ type: {
958
+ name: "Composite",
959
+ className: "GetTenantPolicyListResponse",
960
+ modelProperties: {
961
+ value: {
962
+ serializedName: "value",
963
+ readOnly: true,
964
+ type: {
965
+ name: "Sequence",
966
+ element: {
967
+ type: {
968
+ name: "Composite",
969
+ className: "GetTenantPolicyResponse"
970
+ }
971
+ }
972
+ }
973
+ },
974
+ nextLink: {
975
+ serializedName: "nextLink",
976
+ readOnly: true,
977
+ type: {
978
+ name: "String"
979
+ }
980
+ }
981
+ }
982
+ }
983
+ };
984
+ const BillingAccountPoliciesResponse = {
985
+ type: {
986
+ name: "Composite",
987
+ className: "BillingAccountPoliciesResponse",
988
+ modelProperties: {
989
+ id: {
990
+ serializedName: "id",
991
+ readOnly: true,
992
+ type: {
993
+ name: "String"
994
+ }
995
+ },
996
+ name: {
997
+ serializedName: "name",
998
+ readOnly: true,
999
+ type: {
1000
+ name: "String"
1001
+ }
1002
+ },
1003
+ type: {
1004
+ serializedName: "type",
1005
+ readOnly: true,
1006
+ type: {
1007
+ name: "String"
1008
+ }
1009
+ },
1010
+ properties: {
1011
+ serializedName: "properties",
1012
+ type: {
1013
+ name: "Composite",
1014
+ className: "BillingAccountPoliciesResponseProperties"
1015
+ }
1016
+ },
1017
+ systemData: {
1018
+ serializedName: "systemData",
1019
+ type: {
1020
+ name: "Composite",
1021
+ className: "SystemData"
1022
+ }
1023
+ }
1024
+ }
1025
+ }
1026
+ };
1027
+ const BillingAccountPoliciesResponseProperties = {
1028
+ type: {
1029
+ name: "Composite",
1030
+ className: "BillingAccountPoliciesResponseProperties",
1031
+ modelProperties: {
1032
+ serviceTenants: {
1033
+ serializedName: "serviceTenants",
1034
+ type: {
1035
+ name: "Sequence",
1036
+ element: {
1037
+ type: {
1038
+ name: "Composite",
1039
+ className: "ServiceTenantResponse"
1040
+ }
1041
+ }
1042
+ }
1043
+ },
1044
+ allowTransfers: {
1045
+ serializedName: "allowTransfers",
1046
+ type: {
1047
+ name: "Boolean"
1048
+ }
1049
+ }
1050
+ }
1051
+ }
1052
+ };
1053
+ const ServiceTenantResponse = {
1054
+ type: {
1055
+ name: "Composite",
1056
+ className: "ServiceTenantResponse",
1057
+ modelProperties: {
1058
+ tenantId: {
1059
+ serializedName: "tenantId",
1060
+ type: {
1061
+ name: "String"
1062
+ }
1063
+ },
1064
+ tenantName: {
1065
+ serializedName: "tenantName",
1066
+ type: {
1067
+ name: "String"
1068
+ }
1069
+ }
1070
+ }
1071
+ }
1072
+ };
1073
+ const SubscriptionAcceptOwnershipHeaders = {
1074
+ type: {
1075
+ name: "Composite",
1076
+ className: "SubscriptionAcceptOwnershipHeaders",
1077
+ modelProperties: {
1078
+ location: {
1079
+ serializedName: "location",
1080
+ type: {
1081
+ name: "String"
1082
+ }
1083
+ },
1084
+ retryAfter: {
1085
+ serializedName: "retry-after",
1086
+ type: {
1087
+ name: "Number"
1088
+ }
1089
+ }
1090
+ }
1091
+ }
1092
+ };
1093
+
1094
+ var Mappers = /*#__PURE__*/Object.freeze({
1095
+ __proto__: null,
1096
+ LocationListResult: LocationListResult,
1097
+ Location: Location,
1098
+ Subscription: Subscription,
1099
+ SubscriptionPolicies: SubscriptionPolicies,
1100
+ SubscriptionListResult: SubscriptionListResult,
1101
+ TenantListResult: TenantListResult,
1102
+ TenantIdDescription: TenantIdDescription,
1103
+ CanceledSubscriptionId: CanceledSubscriptionId,
1104
+ ErrorResponseBody: ErrorResponseBody,
1105
+ ErrorResponse: ErrorResponse,
1106
+ SubscriptionName: SubscriptionName,
1107
+ RenamedSubscriptionId: RenamedSubscriptionId,
1108
+ EnabledSubscriptionId: EnabledSubscriptionId,
1109
+ OperationListResult: OperationListResult,
1110
+ Operation: Operation,
1111
+ OperationDisplay: OperationDisplay,
1112
+ PutAliasRequest: PutAliasRequest,
1113
+ PutAliasRequestProperties: PutAliasRequestProperties,
1114
+ PutAliasRequestAdditionalProperties: PutAliasRequestAdditionalProperties,
1115
+ SubscriptionAliasResponse: SubscriptionAliasResponse,
1116
+ SubscriptionAliasResponseProperties: SubscriptionAliasResponseProperties,
1117
+ SystemData: SystemData,
1118
+ SubscriptionAliasListResult: SubscriptionAliasListResult,
1119
+ AcceptOwnershipRequest: AcceptOwnershipRequest,
1120
+ AcceptOwnershipRequestProperties: AcceptOwnershipRequestProperties,
1121
+ AcceptOwnershipStatusResponse: AcceptOwnershipStatusResponse,
1122
+ PutTenantPolicyRequestProperties: PutTenantPolicyRequestProperties,
1123
+ GetTenantPolicyResponse: GetTenantPolicyResponse,
1124
+ TenantPolicy: TenantPolicy,
1125
+ GetTenantPolicyListResponse: GetTenantPolicyListResponse,
1126
+ BillingAccountPoliciesResponse: BillingAccountPoliciesResponse,
1127
+ BillingAccountPoliciesResponseProperties: BillingAccountPoliciesResponseProperties,
1128
+ ServiceTenantResponse: ServiceTenantResponse,
1129
+ SubscriptionAcceptOwnershipHeaders: SubscriptionAcceptOwnershipHeaders
1130
+ });
1131
+
1132
+ /*
1133
+ * Copyright (c) Microsoft Corporation.
1134
+ * Licensed under the MIT License.
1135
+ *
1136
+ * Code generated by Microsoft (R) AutoRest Code Generator.
1137
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1138
+ */
1139
+ const accept = {
1140
+ parameterPath: "accept",
1141
+ mapper: {
1142
+ defaultValue: "application/json",
1143
+ isConstant: true,
1144
+ serializedName: "Accept",
1145
+ type: {
1146
+ name: "String"
1147
+ }
1148
+ }
1149
+ };
1150
+ const $host = {
1151
+ parameterPath: "$host",
1152
+ mapper: {
1153
+ serializedName: "$host",
1154
+ required: true,
1155
+ type: {
1156
+ name: "String"
1157
+ }
1158
+ },
1159
+ skipEncoding: true
1160
+ };
1161
+ const subscriptionId = {
1162
+ parameterPath: "subscriptionId",
1163
+ mapper: {
1164
+ serializedName: "subscriptionId",
1165
+ required: true,
1166
+ type: {
1167
+ name: "String"
1168
+ }
1169
+ }
1170
+ };
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 = {
1194
+ parameterPath: "apiVersion",
1195
+ mapper: {
1196
+ defaultValue: "2021-10-01",
1197
+ isConstant: true,
1198
+ serializedName: "api-version",
1199
+ type: {
1200
+ name: "String"
1201
+ }
1202
+ }
1203
+ };
1204
+ const contentType = {
1205
+ parameterPath: ["options", "contentType"],
1206
+ mapper: {
1207
+ defaultValue: "application/json",
1208
+ isConstant: true,
1209
+ serializedName: "Content-Type",
1210
+ type: {
1211
+ name: "String"
1212
+ }
1213
+ }
1214
+ };
1215
+ const body = {
1216
+ parameterPath: "body",
1217
+ mapper: SubscriptionName
1218
+ };
1219
+ const body1 = {
1220
+ parameterPath: "body",
1221
+ mapper: AcceptOwnershipRequest
1222
+ };
1223
+ const body2 = {
1224
+ parameterPath: "body",
1225
+ mapper: PutAliasRequest
1226
+ };
1227
+ const aliasName = {
1228
+ parameterPath: "aliasName",
1229
+ mapper: {
1230
+ serializedName: "aliasName",
1231
+ required: true,
1232
+ type: {
1233
+ name: "String"
1234
+ }
1235
+ }
1236
+ };
1237
+ const body3 = {
1238
+ parameterPath: "body",
1239
+ mapper: PutTenantPolicyRequestProperties
1240
+ };
1241
+ const billingAccountId = {
1242
+ parameterPath: "billingAccountId",
1243
+ mapper: {
1244
+ serializedName: "billingAccountId",
1245
+ required: true,
1246
+ type: {
1247
+ name: "String"
1248
+ }
1249
+ }
1250
+ };
1251
+
1252
+ /*
1253
+ * Copyright (c) Microsoft Corporation.
1254
+ * Licensed under the MIT License.
1255
+ *
1256
+ * Code generated by Microsoft (R) AutoRest Code Generator.
1257
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1258
+ */
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;
1268
+ }
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"]);
1582
+ return this.sendOperationFn(this.args, Object.assign(Object.assign({}, restSpec), { path, httpMethod: "GET" }));
1583
+ });
1584
+ }
1585
+ }
1586
+
1587
+ /*
1588
+ * Copyright (c) Microsoft Corporation.
1589
+ * Licensed under the MIT License.
1590
+ *
1591
+ * Code generated by Microsoft (R) AutoRest Code Generator.
1592
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1593
+ */
1594
+ /** Class containing SubscriptionOperations operations. */
1595
+ class SubscriptionOperationsImpl {
1596
+ /**
1597
+ * Initialize a new instance of the class SubscriptionOperations class.
1598
+ * @param client Reference to the service client
1599
+ */
1600
+ constructor(client) {
1601
+ this.client = client;
1602
+ }
1603
+ /**
1604
+ * The operation to cancel a subscription
1605
+ * @param subscriptionId Subscription Id.
1606
+ * @param options The options parameters.
1607
+ */
1608
+ cancel(subscriptionId, options) {
1609
+ return this.client.sendOperationRequest({ subscriptionId, options }, cancelOperationSpec);
1610
+ }
1611
+ /**
1612
+ * The operation to rename a subscription
1613
+ * @param subscriptionId Subscription Id.
1614
+ * @param body Subscription Name
1615
+ * @param options The options parameters.
1616
+ */
1617
+ rename(subscriptionId, body, options) {
1618
+ return this.client.sendOperationRequest({ subscriptionId, body, options }, renameOperationSpec);
1619
+ }
1620
+ /**
1621
+ * The operation to enable a subscription
1622
+ * @param subscriptionId Subscription Id.
1623
+ * @param options The options parameters.
1624
+ */
1625
+ enable(subscriptionId, options) {
1626
+ return this.client.sendOperationRequest({ subscriptionId, options }, enableOperationSpec);
1627
+ }
1628
+ /**
1629
+ * Accept subscription ownership.
1630
+ * @param subscriptionId Subscription Id.
1631
+ * @param body The parameters required to accept subscription ownership.
1632
+ * @param options The options parameters.
1633
+ */
1634
+ beginAcceptOwnership(subscriptionId, body, options) {
1635
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1636
+ const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1637
+ return this.client.sendOperationRequest(args, spec);
1638
+ });
1639
+ const sendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1640
+ var _a;
1641
+ let currentRawResponse = undefined;
1642
+ const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
1643
+ const callback = (rawResponse, flatResponse) => {
1644
+ currentRawResponse = rawResponse;
1645
+ providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
1646
+ };
1647
+ const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
1648
+ const flatResponse = yield directSendOperation(updatedArgs, spec);
1649
+ return {
1650
+ flatResponse,
1651
+ rawResponse: {
1652
+ statusCode: currentRawResponse.status,
1653
+ body: currentRawResponse.parsedBody,
1654
+ headers: currentRawResponse.headers.toJSON()
1655
+ }
1656
+ };
1657
+ });
1658
+ const lro = new LroImpl(sendOperation, { subscriptionId, body, options }, acceptOwnershipOperationSpec);
1659
+ return new coreLro.LroEngine(lro, {
1660
+ resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
1661
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
1662
+ });
1663
+ });
1664
+ }
1665
+ /**
1666
+ * Accept subscription ownership.
1667
+ * @param subscriptionId Subscription Id.
1668
+ * @param body The parameters required to accept subscription ownership.
1669
+ * @param options The options parameters.
1670
+ */
1671
+ beginAcceptOwnershipAndWait(subscriptionId, body, options) {
1672
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1673
+ const poller = yield this.beginAcceptOwnership(subscriptionId, body, options);
1674
+ return poller.pollUntilDone();
1675
+ });
1676
+ }
1677
+ /**
1678
+ * Accept subscription ownership status.
1679
+ * @param subscriptionId Subscription Id.
1680
+ * @param options The options parameters.
1681
+ */
1682
+ acceptOwnershipStatus(subscriptionId, options) {
1683
+ return this.client.sendOperationRequest({ subscriptionId, options }, acceptOwnershipStatusOperationSpec);
1684
+ }
1685
+ }
1686
+ // Operation Specifications
1687
+ const serializer$2 = coreClient.createSerializer(Mappers, /* isXml */ false);
1688
+ const cancelOperationSpec = {
1689
+ path: "/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/cancel",
1690
+ httpMethod: "POST",
1691
+ responses: {
1692
+ 200: {
1693
+ bodyMapper: CanceledSubscriptionId
1694
+ },
1695
+ default: {
1696
+ bodyMapper: ErrorResponseBody
1697
+ }
1698
+ },
1699
+ queryParameters: [apiVersion1],
1700
+ urlParameters: [$host, subscriptionId],
1701
+ headerParameters: [accept],
1702
+ serializer: serializer$2
1703
+ };
1704
+ const renameOperationSpec = {
1705
+ path: "/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/rename",
1706
+ httpMethod: "POST",
1707
+ responses: {
1708
+ 200: {
1709
+ bodyMapper: RenamedSubscriptionId
1710
+ },
1711
+ default: {
1712
+ bodyMapper: ErrorResponseBody
1713
+ }
1714
+ },
1715
+ requestBody: body,
1716
+ queryParameters: [apiVersion1],
1717
+ urlParameters: [$host, subscriptionId],
1718
+ headerParameters: [accept, contentType],
1719
+ mediaType: "json",
1720
+ serializer: serializer$2
1721
+ };
1722
+ const enableOperationSpec = {
1723
+ path: "/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/enable",
1724
+ httpMethod: "POST",
1725
+ responses: {
1726
+ 200: {
1727
+ bodyMapper: EnabledSubscriptionId
1728
+ },
1729
+ default: {
1730
+ bodyMapper: ErrorResponseBody
1731
+ }
1732
+ },
1733
+ queryParameters: [apiVersion1],
1734
+ urlParameters: [$host, subscriptionId],
1735
+ headerParameters: [accept],
1736
+ serializer: serializer$2
1737
+ };
1738
+ const acceptOwnershipOperationSpec = {
1739
+ path: "/providers/Microsoft.Subscription/subscriptions/{subscriptionId}/acceptOwnership",
1740
+ httpMethod: "POST",
1741
+ responses: {
1742
+ 200: {
1743
+ headersMapper: SubscriptionAcceptOwnershipHeaders
1744
+ },
1745
+ 201: {
1746
+ headersMapper: SubscriptionAcceptOwnershipHeaders
1747
+ },
1748
+ 202: {
1749
+ headersMapper: SubscriptionAcceptOwnershipHeaders
1750
+ },
1751
+ 204: {
1752
+ headersMapper: SubscriptionAcceptOwnershipHeaders
1753
+ },
1754
+ default: {
1755
+ bodyMapper: ErrorResponseBody
1756
+ }
1757
+ },
1758
+ requestBody: body1,
1759
+ queryParameters: [apiVersion1],
1760
+ urlParameters: [$host, subscriptionId],
1761
+ headerParameters: [accept, contentType],
1762
+ mediaType: "json",
1763
+ serializer: serializer$2
1764
+ };
1765
+ const acceptOwnershipStatusOperationSpec = {
1766
+ path: "/providers/Microsoft.Subscription/subscriptions/{subscriptionId}/acceptOwnershipStatus",
1767
+ httpMethod: "GET",
1768
+ responses: {
1769
+ 200: {
1770
+ bodyMapper: AcceptOwnershipStatusResponse
1771
+ },
1772
+ default: {
1773
+ bodyMapper: ErrorResponseBody
1774
+ }
1775
+ },
1776
+ queryParameters: [apiVersion1],
1777
+ urlParameters: [$host, subscriptionId],
1778
+ headerParameters: [accept],
1779
+ serializer: serializer$2
1780
+ };
1781
+
1782
+ /*
1783
+ * Copyright (c) Microsoft Corporation.
1784
+ * Licensed under the MIT License.
1785
+ *
1786
+ * Code generated by Microsoft (R) AutoRest Code Generator.
1787
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1788
+ */
1789
+ /// <reference lib="esnext.asynciterable" />
1790
+ /** Class containing Operations operations. */
1791
+ class OperationsImpl {
1792
+ /**
1793
+ * Initialize a new instance of the class Operations class.
1794
+ * @param client Reference to the service client
1795
+ */
1796
+ constructor(client) {
1797
+ this.client = client;
1798
+ }
1799
+ /**
1800
+ * Lists all of the available Microsoft.Subscription API operations.
1801
+ * @param options The options parameters.
1802
+ */
1803
+ list(options) {
1804
+ const iter = this.listPagingAll(options);
1805
+ return {
1806
+ next() {
1807
+ return iter.next();
1808
+ },
1809
+ [Symbol.asyncIterator]() {
1810
+ return this;
1811
+ },
1812
+ byPage: () => {
1813
+ return this.listPagingPage(options);
1814
+ }
1815
+ };
1816
+ }
1817
+ listPagingPage(options) {
1818
+ return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
1819
+ let result = yield tslib.__await(this._list(options));
1820
+ yield yield tslib.__await(result.value || []);
1821
+ let continuationToken = result.nextLink;
1822
+ while (continuationToken) {
1823
+ result = yield tslib.__await(this._listNext(continuationToken, options));
1824
+ continuationToken = result.nextLink;
1825
+ yield yield tslib.__await(result.value || []);
1826
+ }
1827
+ });
1828
+ }
1829
+ listPagingAll(options) {
1830
+ return tslib.__asyncGenerator(this, arguments, function* listPagingAll_1() {
1831
+ var e_1, _a;
1832
+ try {
1833
+ for (var _b = tslib.__asyncValues(this.listPagingPage(options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
1834
+ const page = _c.value;
1835
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
1836
+ }
1837
+ }
1838
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
1839
+ finally {
1840
+ try {
1841
+ if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
1842
+ }
1843
+ finally { if (e_1) throw e_1.error; }
1844
+ }
1845
+ });
1846
+ }
1847
+ /**
1848
+ * Lists all of the available Microsoft.Subscription API operations.
1849
+ * @param options The options parameters.
1850
+ */
1851
+ _list(options) {
1852
+ return this.client.sendOperationRequest({ options }, listOperationSpec$2);
1853
+ }
1854
+ /**
1855
+ * ListNext
1856
+ * @param nextLink The nextLink from the previous successful call to the List method.
1857
+ * @param options The options parameters.
1858
+ */
1859
+ _listNext(nextLink, options) {
1860
+ return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec$2);
1861
+ }
1862
+ }
1863
+ // Operation Specifications
1864
+ const serializer$3 = coreClient.createSerializer(Mappers, /* isXml */ false);
1865
+ const listOperationSpec$2 = {
1866
+ path: "/providers/Microsoft.Subscription/operations",
1867
+ httpMethod: "GET",
1868
+ responses: {
1869
+ 200: {
1870
+ bodyMapper: OperationListResult
1871
+ },
1872
+ default: {
1873
+ bodyMapper: ErrorResponseBody
1874
+ }
1875
+ },
1876
+ queryParameters: [apiVersion1],
1877
+ urlParameters: [$host],
1878
+ headerParameters: [accept],
1879
+ serializer: serializer$3
1880
+ };
1881
+ const listNextOperationSpec$2 = {
1882
+ path: "{nextLink}",
1883
+ httpMethod: "GET",
1884
+ responses: {
1885
+ 200: {
1886
+ bodyMapper: OperationListResult
1887
+ },
1888
+ default: {
1889
+ bodyMapper: ErrorResponseBody
1890
+ }
1891
+ },
1892
+ queryParameters: [apiVersion1],
1893
+ urlParameters: [$host, nextLink],
1894
+ headerParameters: [accept],
1895
+ serializer: serializer$3
1896
+ };
1897
+
1898
+ /*
1899
+ * Copyright (c) Microsoft Corporation.
1900
+ * Licensed under the MIT License.
1901
+ *
1902
+ * Code generated by Microsoft (R) AutoRest Code Generator.
1903
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1904
+ */
1905
+ /** Class containing Alias operations. */
1906
+ class AliasImpl {
1907
+ /**
1908
+ * Initialize a new instance of the class Alias class.
1909
+ * @param client Reference to the service client
1910
+ */
1911
+ constructor(client) {
1912
+ this.client = client;
1913
+ }
1914
+ /**
1915
+ * Create Alias Subscription.
1916
+ * @param aliasName AliasName is the name for the subscription creation request. Note that this is not
1917
+ * the same as subscription name and this doesn’t have any other lifecycle need beyond the request for
1918
+ * subscription creation.
1919
+ * @param body The parameters required to create a new subscription.
1920
+ * @param options The options parameters.
1921
+ */
1922
+ beginCreate(aliasName, body, options) {
1923
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1924
+ const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1925
+ return this.client.sendOperationRequest(args, spec);
1926
+ });
1927
+ const sendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1928
+ var _a;
1929
+ let currentRawResponse = undefined;
1930
+ const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
1931
+ const callback = (rawResponse, flatResponse) => {
1932
+ currentRawResponse = rawResponse;
1933
+ providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
1934
+ };
1935
+ const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
1936
+ const flatResponse = yield directSendOperation(updatedArgs, spec);
1937
+ return {
1938
+ flatResponse,
1939
+ rawResponse: {
1940
+ statusCode: currentRawResponse.status,
1941
+ body: currentRawResponse.parsedBody,
1942
+ headers: currentRawResponse.headers.toJSON()
1943
+ }
1944
+ };
1945
+ });
1946
+ const lro = new LroImpl(sendOperation, { aliasName, body, options }, createOperationSpec);
1947
+ return new coreLro.LroEngine(lro, {
1948
+ resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
1949
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
1950
+ });
1951
+ });
1952
+ }
1953
+ /**
1954
+ * Create Alias Subscription.
1955
+ * @param aliasName AliasName is the name for the subscription creation request. Note that this is not
1956
+ * the same as subscription name and this doesn’t have any other lifecycle need beyond the request for
1957
+ * subscription creation.
1958
+ * @param body The parameters required to create a new subscription.
1959
+ * @param options The options parameters.
1960
+ */
1961
+ beginCreateAndWait(aliasName, body, options) {
1962
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1963
+ const poller = yield this.beginCreate(aliasName, body, options);
1964
+ return poller.pollUntilDone();
1965
+ });
1966
+ }
1967
+ /**
1968
+ * Get Alias Subscription.
1969
+ * @param aliasName AliasName is the name for the subscription creation request. Note that this is not
1970
+ * the same as subscription name and this doesn’t have any other lifecycle need beyond the request for
1971
+ * subscription creation.
1972
+ * @param options The options parameters.
1973
+ */
1974
+ get(aliasName, options) {
1975
+ return this.client.sendOperationRequest({ aliasName, options }, getOperationSpec$1);
1976
+ }
1977
+ /**
1978
+ * Delete Alias.
1979
+ * @param aliasName AliasName is the name for the subscription creation request. Note that this is not
1980
+ * the same as subscription name and this doesn’t have any other lifecycle need beyond the request for
1981
+ * subscription creation.
1982
+ * @param options The options parameters.
1983
+ */
1984
+ delete(aliasName, options) {
1985
+ return this.client.sendOperationRequest({ aliasName, options }, deleteOperationSpec);
1986
+ }
1987
+ /**
1988
+ * List Alias Subscription.
1989
+ * @param options The options parameters.
1990
+ */
1991
+ list(options) {
1992
+ return this.client.sendOperationRequest({ options }, listOperationSpec$3);
1993
+ }
1994
+ }
1995
+ // Operation Specifications
1996
+ const serializer$4 = coreClient.createSerializer(Mappers, /* isXml */ false);
1997
+ const createOperationSpec = {
1998
+ path: "/providers/Microsoft.Subscription/aliases/{aliasName}",
1999
+ httpMethod: "PUT",
2000
+ responses: {
2001
+ 200: {
2002
+ bodyMapper: SubscriptionAliasResponse
2003
+ },
2004
+ 201: {
2005
+ bodyMapper: SubscriptionAliasResponse
2006
+ },
2007
+ 202: {
2008
+ bodyMapper: SubscriptionAliasResponse
2009
+ },
2010
+ 204: {
2011
+ bodyMapper: SubscriptionAliasResponse
2012
+ },
2013
+ default: {
2014
+ bodyMapper: ErrorResponseBody
2015
+ }
2016
+ },
2017
+ requestBody: body2,
2018
+ queryParameters: [apiVersion1],
2019
+ urlParameters: [$host, aliasName],
2020
+ headerParameters: [accept, contentType],
2021
+ mediaType: "json",
2022
+ serializer: serializer$4
2023
+ };
2024
+ const getOperationSpec$1 = {
2025
+ path: "/providers/Microsoft.Subscription/aliases/{aliasName}",
2026
+ httpMethod: "GET",
2027
+ responses: {
2028
+ 200: {
2029
+ bodyMapper: SubscriptionAliasResponse
2030
+ },
2031
+ default: {
2032
+ bodyMapper: ErrorResponseBody
2033
+ }
2034
+ },
2035
+ queryParameters: [apiVersion1],
2036
+ urlParameters: [$host, aliasName],
2037
+ headerParameters: [accept],
2038
+ serializer: serializer$4
2039
+ };
2040
+ const deleteOperationSpec = {
2041
+ path: "/providers/Microsoft.Subscription/aliases/{aliasName}",
2042
+ httpMethod: "DELETE",
2043
+ responses: {
2044
+ 200: {},
2045
+ 204: {},
2046
+ default: {
2047
+ bodyMapper: ErrorResponseBody
2048
+ }
2049
+ },
2050
+ queryParameters: [apiVersion1],
2051
+ urlParameters: [$host, aliasName],
2052
+ headerParameters: [accept],
2053
+ serializer: serializer$4
2054
+ };
2055
+ const listOperationSpec$3 = {
2056
+ path: "/providers/Microsoft.Subscription/aliases",
2057
+ httpMethod: "GET",
2058
+ responses: {
2059
+ 200: {
2060
+ bodyMapper: SubscriptionAliasListResult
2061
+ },
2062
+ default: {
2063
+ bodyMapper: ErrorResponseBody
2064
+ }
2065
+ },
2066
+ queryParameters: [apiVersion1],
2067
+ urlParameters: [$host],
2068
+ headerParameters: [accept],
2069
+ serializer: serializer$4
2070
+ };
2071
+
2072
+ /*
2073
+ * Copyright (c) Microsoft Corporation.
2074
+ * Licensed under the MIT License.
2075
+ *
2076
+ * Code generated by Microsoft (R) AutoRest Code Generator.
2077
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
2078
+ */
2079
+ /// <reference lib="esnext.asynciterable" />
2080
+ /** Class containing SubscriptionPolicy operations. */
2081
+ class SubscriptionPolicyImpl {
2082
+ /**
2083
+ * Initialize a new instance of the class SubscriptionPolicy class.
2084
+ * @param client Reference to the service client
2085
+ */
2086
+ constructor(client) {
2087
+ this.client = client;
2088
+ }
2089
+ /**
2090
+ * Get the subscription tenant policy for the user's tenant.
2091
+ * @param options The options parameters.
2092
+ */
2093
+ listPolicyForTenant(options) {
2094
+ const iter = this.listPolicyForTenantPagingAll(options);
2095
+ return {
2096
+ next() {
2097
+ return iter.next();
2098
+ },
2099
+ [Symbol.asyncIterator]() {
2100
+ return this;
2101
+ },
2102
+ byPage: () => {
2103
+ return this.listPolicyForTenantPagingPage(options);
2104
+ }
2105
+ };
2106
+ }
2107
+ listPolicyForTenantPagingPage(options) {
2108
+ return tslib.__asyncGenerator(this, arguments, function* listPolicyForTenantPagingPage_1() {
2109
+ let result = yield tslib.__await(this._listPolicyForTenant(options));
2110
+ yield yield tslib.__await(result.value || []);
2111
+ let continuationToken = result.nextLink;
2112
+ while (continuationToken) {
2113
+ result = yield tslib.__await(this._listPolicyForTenantNext(continuationToken, options));
2114
+ continuationToken = result.nextLink;
2115
+ yield yield tslib.__await(result.value || []);
2116
+ }
2117
+ });
2118
+ }
2119
+ listPolicyForTenantPagingAll(options) {
2120
+ return tslib.__asyncGenerator(this, arguments, function* listPolicyForTenantPagingAll_1() {
2121
+ var e_1, _a;
2122
+ try {
2123
+ for (var _b = tslib.__asyncValues(this.listPolicyForTenantPagingPage(options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
2124
+ const page = _c.value;
2125
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
2126
+ }
2127
+ }
2128
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
2129
+ finally {
2130
+ try {
2131
+ if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
2132
+ }
2133
+ finally { if (e_1) throw e_1.error; }
2134
+ }
2135
+ });
2136
+ }
2137
+ /**
2138
+ * Create or Update Subscription tenant policy for user's tenant.
2139
+ * @param body Put tenant policy request properties.
2140
+ * @param options The options parameters.
2141
+ */
2142
+ addUpdatePolicyForTenant(body, options) {
2143
+ return this.client.sendOperationRequest({ body, options }, addUpdatePolicyForTenantOperationSpec);
2144
+ }
2145
+ /**
2146
+ * Get the subscription tenant policy for the user's tenant.
2147
+ * @param options The options parameters.
2148
+ */
2149
+ getPolicyForTenant(options) {
2150
+ return this.client.sendOperationRequest({ options }, getPolicyForTenantOperationSpec);
2151
+ }
2152
+ /**
2153
+ * Get the subscription tenant policy for the user's tenant.
2154
+ * @param options The options parameters.
2155
+ */
2156
+ _listPolicyForTenant(options) {
2157
+ return this.client.sendOperationRequest({ options }, listPolicyForTenantOperationSpec);
2158
+ }
2159
+ /**
2160
+ * ListPolicyForTenantNext
2161
+ * @param nextLink The nextLink from the previous successful call to the ListPolicyForTenant method.
2162
+ * @param options The options parameters.
2163
+ */
2164
+ _listPolicyForTenantNext(nextLink, options) {
2165
+ return this.client.sendOperationRequest({ nextLink, options }, listPolicyForTenantNextOperationSpec);
2166
+ }
2167
+ }
2168
+ // Operation Specifications
2169
+ const serializer$5 = coreClient.createSerializer(Mappers, /* isXml */ false);
2170
+ const addUpdatePolicyForTenantOperationSpec = {
2171
+ path: "/providers/Microsoft.Subscription/policies/default",
2172
+ httpMethod: "PUT",
2173
+ responses: {
2174
+ 200: {
2175
+ bodyMapper: GetTenantPolicyResponse
2176
+ },
2177
+ default: {
2178
+ bodyMapper: ErrorResponseBody
2179
+ }
2180
+ },
2181
+ requestBody: body3,
2182
+ queryParameters: [apiVersion1],
2183
+ urlParameters: [$host],
2184
+ headerParameters: [accept, contentType],
2185
+ mediaType: "json",
2186
+ serializer: serializer$5
2187
+ };
2188
+ const getPolicyForTenantOperationSpec = {
2189
+ path: "/providers/Microsoft.Subscription/policies/default",
2190
+ httpMethod: "GET",
2191
+ responses: {
2192
+ 200: {
2193
+ bodyMapper: GetTenantPolicyResponse
2194
+ },
2195
+ default: {
2196
+ bodyMapper: ErrorResponseBody
2197
+ }
2198
+ },
2199
+ queryParameters: [apiVersion1],
2200
+ urlParameters: [$host],
2201
+ headerParameters: [accept],
2202
+ serializer: serializer$5
2203
+ };
2204
+ const listPolicyForTenantOperationSpec = {
2205
+ path: "/providers/Microsoft.Subscription/policies",
2206
+ httpMethod: "GET",
2207
+ responses: {
2208
+ 200: {
2209
+ bodyMapper: GetTenantPolicyListResponse
2210
+ },
2211
+ default: {
2212
+ bodyMapper: ErrorResponseBody
2213
+ }
2214
+ },
2215
+ queryParameters: [apiVersion1],
2216
+ urlParameters: [$host],
2217
+ headerParameters: [accept],
2218
+ serializer: serializer$5
2219
+ };
2220
+ const listPolicyForTenantNextOperationSpec = {
2221
+ path: "{nextLink}",
2222
+ httpMethod: "GET",
2223
+ responses: {
2224
+ 200: {
2225
+ bodyMapper: GetTenantPolicyListResponse
2226
+ },
2227
+ default: {
2228
+ bodyMapper: ErrorResponseBody
2229
+ }
2230
+ },
2231
+ queryParameters: [apiVersion1],
2232
+ urlParameters: [$host, nextLink],
2233
+ headerParameters: [accept],
2234
+ serializer: serializer$5
2235
+ };
2236
+
2237
+ /*
2238
+ * Copyright (c) Microsoft Corporation.
2239
+ * Licensed under the MIT License.
2240
+ *
2241
+ * Code generated by Microsoft (R) AutoRest Code Generator.
2242
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
2243
+ */
2244
+ /** Class containing BillingAccount operations. */
2245
+ class BillingAccountImpl {
2246
+ /**
2247
+ * Initialize a new instance of the class BillingAccount class.
2248
+ * @param client Reference to the service client
2249
+ */
2250
+ constructor(client) {
2251
+ this.client = client;
2252
+ }
2253
+ /**
2254
+ * Get Billing Account Policy.
2255
+ * @param billingAccountId Billing Account Id.
2256
+ * @param options The options parameters.
2257
+ */
2258
+ getPolicy(billingAccountId, options) {
2259
+ return this.client.sendOperationRequest({ billingAccountId, options }, getPolicyOperationSpec);
2260
+ }
2261
+ }
2262
+ // Operation Specifications
2263
+ const serializer$6 = coreClient.createSerializer(Mappers, /* isXml */ false);
2264
+ const getPolicyOperationSpec = {
2265
+ path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Subscription/policies/default",
2266
+ httpMethod: "GET",
2267
+ responses: {
2268
+ 200: {
2269
+ bodyMapper: BillingAccountPoliciesResponse
2270
+ },
2271
+ default: {
2272
+ bodyMapper: ErrorResponseBody
2273
+ }
2274
+ },
2275
+ queryParameters: [apiVersion1],
2276
+ urlParameters: [$host, billingAccountId],
2277
+ headerParameters: [accept],
2278
+ serializer: serializer$6
2279
+ };
2280
+
2281
+ /*
2282
+ * Copyright (c) Microsoft Corporation.
2283
+ * Licensed under the MIT License.
2284
+ *
2285
+ * Code generated by Microsoft (R) AutoRest Code Generator.
2286
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
2287
+ */
2288
+ class SubscriptionClient extends coreClient.ServiceClient {
2289
+ /**
2290
+ * Initializes a new instance of the SubscriptionClient class.
2291
+ * @param credentials Subscription credentials which uniquely identify client subscription.
2292
+ * @param options The parameter options
2293
+ */
2294
+ constructor(credentials, options) {
2295
+ if (credentials === undefined) {
2296
+ throw new Error("'credentials' cannot be null");
2297
+ }
2298
+ // Initializing default values for options
2299
+ if (!options) {
2300
+ options = {};
2301
+ }
2302
+ const defaults = {
2303
+ requestContentType: "application/json; charset=utf-8",
2304
+ credential: credentials
2305
+ };
2306
+ const packageDetails = `azsdk-js-arm-subscriptions/5.0.0`;
2307
+ const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
2308
+ ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
2309
+ : `${packageDetails}`;
2310
+ if (!options.credentialScopes) {
2311
+ options.credentialScopes = ["https://management.azure.com/.default"];
2312
+ }
2313
+ const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
2314
+ userAgentPrefix
2315
+ }, baseUri: options.endpoint || "https://management.azure.com" });
2316
+ super(optionsWithDefaults);
2317
+ // Assigning values to Constant parameters
2318
+ this.$host = options.$host || "https://management.azure.com";
2319
+ this.subscriptions = new SubscriptionsImpl(this);
2320
+ this.tenants = new TenantsImpl(this);
2321
+ this.subscriptionOperations = new SubscriptionOperationsImpl(this);
2322
+ this.operations = new OperationsImpl(this);
2323
+ this.alias = new AliasImpl(this);
2324
+ this.subscriptionPolicy = new SubscriptionPolicyImpl(this);
2325
+ this.billingAccount = new BillingAccountImpl(this);
2326
+ }
2327
+ }
2328
+
2329
+ exports.SubscriptionClient = SubscriptionClient;
2330
+ //# sourceMappingURL=index.js.map