@azure/arm-subscriptions 3.1.2 → 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 +68 -79
  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 -32
  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 -43
  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 -1442
  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 -27
  169. package/esm/subscriptionClient.d.ts.map +0 -1
  170. package/esm/subscriptionClient.js +0 -41
  171. package/esm/subscriptionClient.js.map +0 -1
  172. package/esm/subscriptionClientContext.d.ts +0 -19
  173. package/esm/subscriptionClientContext.d.ts.map +0 -1
  174. package/esm/subscriptionClientContext.js +0 -55
  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 -60
@@ -0,0 +1,446 @@
1
+ ## API Report File for "@azure/arm-subscriptions"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import * as coreAuth from '@azure/core-auth';
8
+ import * as coreClient from '@azure/core-client';
9
+ import { PagedAsyncIterableIterator } from '@azure/core-paging';
10
+ import { PollerLike } from '@azure/core-lro';
11
+ import { PollOperationState } from '@azure/core-lro';
12
+
13
+ // @public
14
+ export type AcceptOwnership = string;
15
+
16
+ // @public
17
+ export interface AcceptOwnershipRequest {
18
+ properties?: AcceptOwnershipRequestProperties;
19
+ }
20
+
21
+ // @public
22
+ export interface AcceptOwnershipRequestProperties {
23
+ displayName: string;
24
+ managementGroupId?: string;
25
+ tags?: {
26
+ [propertyName: string]: string;
27
+ };
28
+ }
29
+
30
+ // @public
31
+ export interface AcceptOwnershipStatusResponse {
32
+ readonly acceptOwnershipState?: AcceptOwnership;
33
+ readonly billingOwner?: string;
34
+ displayName?: string;
35
+ readonly subscriptionId?: string;
36
+ subscriptionTenantId?: string;
37
+ tags?: {
38
+ [propertyName: string]: string;
39
+ };
40
+ }
41
+
42
+ // @public
43
+ export interface Alias {
44
+ beginCreate(aliasName: string, body: PutAliasRequest, options?: AliasCreateOptionalParams): Promise<PollerLike<PollOperationState<AliasCreateResponse>, AliasCreateResponse>>;
45
+ beginCreateAndWait(aliasName: string, body: PutAliasRequest, options?: AliasCreateOptionalParams): Promise<AliasCreateResponse>;
46
+ delete(aliasName: string, options?: AliasDeleteOptionalParams): Promise<void>;
47
+ get(aliasName: string, options?: AliasGetOptionalParams): Promise<AliasGetResponse>;
48
+ list(options?: AliasListOptionalParams): Promise<AliasListResponse>;
49
+ }
50
+
51
+ // @public
52
+ export interface AliasCreateOptionalParams extends coreClient.OperationOptions {
53
+ resumeFrom?: string;
54
+ updateIntervalInMs?: number;
55
+ }
56
+
57
+ // @public
58
+ export type AliasCreateResponse = SubscriptionAliasResponse;
59
+
60
+ // @public
61
+ export interface AliasDeleteOptionalParams extends coreClient.OperationOptions {
62
+ }
63
+
64
+ // @public
65
+ export interface AliasGetOptionalParams extends coreClient.OperationOptions {
66
+ }
67
+
68
+ // @public
69
+ export type AliasGetResponse = SubscriptionAliasResponse;
70
+
71
+ // @public
72
+ export interface AliasListOptionalParams extends coreClient.OperationOptions {
73
+ }
74
+
75
+ // @public
76
+ export type AliasListResponse = SubscriptionAliasListResult;
77
+
78
+ // @public
79
+ export interface BillingAccount {
80
+ getPolicy(billingAccountId: string, options?: BillingAccountGetPolicyOptionalParams): Promise<BillingAccountGetPolicyResponse>;
81
+ }
82
+
83
+ // @public
84
+ export interface BillingAccountGetPolicyOptionalParams extends coreClient.OperationOptions {
85
+ }
86
+
87
+ // @public
88
+ export type BillingAccountGetPolicyResponse = BillingAccountPoliciesResponse;
89
+
90
+ // @public
91
+ export interface BillingAccountPoliciesResponse {
92
+ readonly id?: string;
93
+ readonly name?: string;
94
+ properties?: BillingAccountPoliciesResponseProperties;
95
+ readonly systemData?: SystemData;
96
+ readonly type?: string;
97
+ }
98
+
99
+ // @public
100
+ export interface BillingAccountPoliciesResponseProperties {
101
+ allowTransfers?: boolean;
102
+ serviceTenants?: ServiceTenantResponse[];
103
+ }
104
+
105
+ // @public
106
+ export interface CanceledSubscriptionId {
107
+ readonly value?: string;
108
+ }
109
+
110
+ // @public
111
+ export type CreatedByType = string;
112
+
113
+ // @public
114
+ export interface EnabledSubscriptionId {
115
+ readonly value?: string;
116
+ }
117
+
118
+ // @public
119
+ export interface ErrorResponse {
120
+ code?: string;
121
+ message?: string;
122
+ }
123
+
124
+ // @public
125
+ export interface ErrorResponseBody {
126
+ code?: string;
127
+ error?: ErrorResponse;
128
+ message?: string;
129
+ }
130
+
131
+ // @public
132
+ export interface GetTenantPolicyListResponse {
133
+ readonly nextLink?: string;
134
+ readonly value?: GetTenantPolicyResponse[];
135
+ }
136
+
137
+ // @public
138
+ export interface GetTenantPolicyResponse {
139
+ readonly id?: string;
140
+ readonly name?: string;
141
+ properties?: TenantPolicy;
142
+ readonly systemData?: SystemData;
143
+ readonly type?: string;
144
+ }
145
+
146
+ // @public
147
+ export enum KnownAcceptOwnership {
148
+ // (undocumented)
149
+ Completed = "Completed",
150
+ // (undocumented)
151
+ Expired = "Expired",
152
+ // (undocumented)
153
+ Pending = "Pending"
154
+ }
155
+
156
+ // @public
157
+ export enum KnownCreatedByType {
158
+ // (undocumented)
159
+ Application = "Application",
160
+ // (undocumented)
161
+ Key = "Key",
162
+ // (undocumented)
163
+ ManagedIdentity = "ManagedIdentity",
164
+ // (undocumented)
165
+ User = "User"
166
+ }
167
+
168
+ // @public
169
+ export enum KnownProvisioningState {
170
+ // (undocumented)
171
+ Accepted = "Accepted",
172
+ // (undocumented)
173
+ Failed = "Failed",
174
+ // (undocumented)
175
+ Succeeded = "Succeeded"
176
+ }
177
+
178
+ // @public
179
+ export enum KnownWorkload {
180
+ // (undocumented)
181
+ DevTest = "DevTest",
182
+ // (undocumented)
183
+ Production = "Production"
184
+ }
185
+
186
+ // @public
187
+ export interface Operation {
188
+ display?: OperationDisplay;
189
+ isDataAction?: boolean;
190
+ name?: string;
191
+ }
192
+
193
+ // @public
194
+ export interface OperationDisplay {
195
+ description?: string;
196
+ operation?: string;
197
+ provider?: string;
198
+ resource?: string;
199
+ }
200
+
201
+ // @public
202
+ export interface OperationListResult {
203
+ nextLink?: string;
204
+ value?: Operation[];
205
+ }
206
+
207
+ // @public
208
+ export interface Operations {
209
+ list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator<Operation>;
210
+ }
211
+
212
+ // @public
213
+ export interface OperationsListNextOptionalParams extends coreClient.OperationOptions {
214
+ }
215
+
216
+ // @public
217
+ export type OperationsListNextResponse = OperationListResult;
218
+
219
+ // @public
220
+ export interface OperationsListOptionalParams extends coreClient.OperationOptions {
221
+ }
222
+
223
+ // @public
224
+ export type OperationsListResponse = OperationListResult;
225
+
226
+ // @public
227
+ export type ProvisioningState = string;
228
+
229
+ // @public
230
+ export interface PutAliasRequest {
231
+ properties?: PutAliasRequestProperties;
232
+ }
233
+
234
+ // @public
235
+ export interface PutAliasRequestAdditionalProperties {
236
+ managementGroupId?: string;
237
+ subscriptionOwnerId?: string;
238
+ subscriptionTenantId?: string;
239
+ tags?: {
240
+ [propertyName: string]: string;
241
+ };
242
+ }
243
+
244
+ // @public
245
+ export interface PutAliasRequestProperties {
246
+ additionalProperties?: PutAliasRequestAdditionalProperties;
247
+ billingScope?: string;
248
+ displayName?: string;
249
+ resellerId?: string;
250
+ subscriptionId?: string;
251
+ workload?: Workload;
252
+ }
253
+
254
+ // @public
255
+ export interface PutTenantPolicyRequestProperties {
256
+ blockSubscriptionsIntoTenant?: boolean;
257
+ blockSubscriptionsLeavingTenant?: boolean;
258
+ exemptedPrincipals?: string[];
259
+ }
260
+
261
+ // @public
262
+ export interface RenamedSubscriptionId {
263
+ readonly value?: string;
264
+ }
265
+
266
+ // @public
267
+ export interface ServiceTenantResponse {
268
+ tenantId?: string;
269
+ tenantName?: string;
270
+ }
271
+
272
+ // @public
273
+ export interface Subscription {
274
+ acceptOwnershipStatus(subscriptionId: string, options?: SubscriptionAcceptOwnershipStatusOptionalParams): Promise<SubscriptionAcceptOwnershipStatusResponse>;
275
+ beginAcceptOwnership(subscriptionId: string, body: AcceptOwnershipRequest, options?: SubscriptionAcceptOwnershipOptionalParams): Promise<PollerLike<PollOperationState<SubscriptionAcceptOwnershipResponse>, SubscriptionAcceptOwnershipResponse>>;
276
+ beginAcceptOwnershipAndWait(subscriptionId: string, body: AcceptOwnershipRequest, options?: SubscriptionAcceptOwnershipOptionalParams): Promise<SubscriptionAcceptOwnershipResponse>;
277
+ cancel(subscriptionId: string, options?: SubscriptionCancelOptionalParams): Promise<SubscriptionCancelResponse>;
278
+ enable(subscriptionId: string, options?: SubscriptionEnableOptionalParams): Promise<SubscriptionEnableResponse>;
279
+ rename(subscriptionId: string, body: SubscriptionName, options?: SubscriptionRenameOptionalParams): Promise<SubscriptionRenameResponse>;
280
+ }
281
+
282
+ // @public
283
+ export interface SubscriptionAcceptOwnershipHeaders {
284
+ location?: string;
285
+ retryAfter?: number;
286
+ }
287
+
288
+ // @public
289
+ export interface SubscriptionAcceptOwnershipOptionalParams extends coreClient.OperationOptions {
290
+ resumeFrom?: string;
291
+ updateIntervalInMs?: number;
292
+ }
293
+
294
+ // @public
295
+ export type SubscriptionAcceptOwnershipResponse = SubscriptionAcceptOwnershipHeaders;
296
+
297
+ // @public
298
+ export interface SubscriptionAcceptOwnershipStatusOptionalParams extends coreClient.OperationOptions {
299
+ }
300
+
301
+ // @public
302
+ export type SubscriptionAcceptOwnershipStatusResponse = AcceptOwnershipStatusResponse;
303
+
304
+ // @public
305
+ export interface SubscriptionAliasListResult {
306
+ readonly nextLink?: string;
307
+ readonly value?: SubscriptionAliasResponse[];
308
+ }
309
+
310
+ // @public
311
+ export interface SubscriptionAliasResponse {
312
+ readonly id?: string;
313
+ readonly name?: string;
314
+ properties?: SubscriptionAliasResponseProperties;
315
+ readonly systemData?: SystemData;
316
+ readonly type?: string;
317
+ }
318
+
319
+ // @public
320
+ export interface SubscriptionAliasResponseProperties {
321
+ readonly acceptOwnershipState?: AcceptOwnership;
322
+ readonly acceptOwnershipUrl?: string;
323
+ billingScope?: string;
324
+ displayName?: string;
325
+ managementGroupId?: string;
326
+ provisioningState?: ProvisioningState;
327
+ resellerId?: string;
328
+ readonly subscriptionId?: string;
329
+ subscriptionOwnerId?: string;
330
+ tags?: {
331
+ [propertyName: string]: string;
332
+ };
333
+ workload?: Workload;
334
+ }
335
+
336
+ // @public
337
+ export interface SubscriptionCancelOptionalParams extends coreClient.OperationOptions {
338
+ }
339
+
340
+ // @public
341
+ export type SubscriptionCancelResponse = CanceledSubscriptionId;
342
+
343
+ // @public (undocumented)
344
+ export class SubscriptionClient extends coreClient.ServiceClient {
345
+ // (undocumented)
346
+ $host: string;
347
+ constructor(credentials: coreAuth.TokenCredential, options?: SubscriptionClientOptionalParams);
348
+ // (undocumented)
349
+ alias: Alias;
350
+ // (undocumented)
351
+ apiVersion: string;
352
+ // (undocumented)
353
+ billingAccount: BillingAccount;
354
+ // (undocumented)
355
+ operations: Operations;
356
+ // (undocumented)
357
+ subscription: Subscription;
358
+ // (undocumented)
359
+ subscriptionPolicy: SubscriptionPolicy;
360
+ }
361
+
362
+ // @public
363
+ export interface SubscriptionClientOptionalParams extends coreClient.ServiceClientOptions {
364
+ $host?: string;
365
+ apiVersion?: string;
366
+ endpoint?: string;
367
+ }
368
+
369
+ // @public
370
+ export interface SubscriptionEnableOptionalParams extends coreClient.OperationOptions {
371
+ }
372
+
373
+ // @public
374
+ export type SubscriptionEnableResponse = EnabledSubscriptionId;
375
+
376
+ // @public
377
+ export interface SubscriptionName {
378
+ subscriptionName?: string;
379
+ }
380
+
381
+ // @public
382
+ export interface SubscriptionPolicy {
383
+ addUpdatePolicyForTenant(body: PutTenantPolicyRequestProperties, options?: SubscriptionPolicyAddUpdatePolicyForTenantOptionalParams): Promise<SubscriptionPolicyAddUpdatePolicyForTenantResponse>;
384
+ getPolicyForTenant(options?: SubscriptionPolicyGetPolicyForTenantOptionalParams): Promise<SubscriptionPolicyGetPolicyForTenantResponse>;
385
+ listPolicyForTenant(options?: SubscriptionPolicyListPolicyForTenantOptionalParams): PagedAsyncIterableIterator<GetTenantPolicyResponse>;
386
+ }
387
+
388
+ // @public
389
+ export interface SubscriptionPolicyAddUpdatePolicyForTenantOptionalParams extends coreClient.OperationOptions {
390
+ }
391
+
392
+ // @public
393
+ export type SubscriptionPolicyAddUpdatePolicyForTenantResponse = GetTenantPolicyResponse;
394
+
395
+ // @public
396
+ export interface SubscriptionPolicyGetPolicyForTenantOptionalParams extends coreClient.OperationOptions {
397
+ }
398
+
399
+ // @public
400
+ export type SubscriptionPolicyGetPolicyForTenantResponse = GetTenantPolicyResponse;
401
+
402
+ // @public
403
+ export interface SubscriptionPolicyListPolicyForTenantNextOptionalParams extends coreClient.OperationOptions {
404
+ }
405
+
406
+ // @public
407
+ export type SubscriptionPolicyListPolicyForTenantNextResponse = GetTenantPolicyListResponse;
408
+
409
+ // @public
410
+ export interface SubscriptionPolicyListPolicyForTenantOptionalParams extends coreClient.OperationOptions {
411
+ }
412
+
413
+ // @public
414
+ export type SubscriptionPolicyListPolicyForTenantResponse = GetTenantPolicyListResponse;
415
+
416
+ // @public
417
+ export interface SubscriptionRenameOptionalParams extends coreClient.OperationOptions {
418
+ }
419
+
420
+ // @public
421
+ export type SubscriptionRenameResponse = RenamedSubscriptionId;
422
+
423
+ // @public
424
+ export interface SystemData {
425
+ createdAt?: Date;
426
+ createdBy?: string;
427
+ createdByType?: CreatedByType;
428
+ lastModifiedAt?: Date;
429
+ lastModifiedBy?: string;
430
+ lastModifiedByType?: CreatedByType;
431
+ }
432
+
433
+ // @public
434
+ export interface TenantPolicy {
435
+ blockSubscriptionsIntoTenant?: boolean;
436
+ blockSubscriptionsLeavingTenant?: boolean;
437
+ exemptedPrincipals?: string[];
438
+ readonly policyId?: string;
439
+ }
440
+
441
+ // @public
442
+ export type Workload = string;
443
+
444
+ // (No @packageDocumentation comment for this package)
445
+
446
+ ```
package/rollup.config.js CHANGED
@@ -1,37 +1,188 @@
1
- import rollup from "rollup";
2
- import nodeResolve from "rollup-plugin-node-resolve";
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ import nodeResolve from "@rollup/plugin-node-resolve";
10
+ import cjs from "@rollup/plugin-commonjs";
3
11
  import sourcemaps from "rollup-plugin-sourcemaps";
12
+ import multiEntry from "@rollup/plugin-multi-entry";
13
+ import json from "@rollup/plugin-json";
14
+
15
+ import nodeBuiltins from "builtin-modules";
16
+
17
+ /**
18
+ * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api.
19
+ *
20
+ * NOTE: this manual configuration is only needed because OpenTelemetry uses an
21
+ * __exportStar downleveled helper function to declare its exports which confuses
22
+ * rollup's automatic discovery mechanism.
23
+ *
24
+ * @returns an object reference that can be `...`'d into your cjs() configuration.
25
+ */
26
+ export function openTelemetryCommonJs() {
27
+ const namedExports = {};
28
+
29
+ for (const key of [
30
+ "@opentelemetry/api",
31
+ "@azure/core-tracing/node_modules/@opentelemetry/api"
32
+ ]) {
33
+ namedExports[key] = [
34
+ "SpanKind",
35
+ "TraceFlags",
36
+ "getSpan",
37
+ "setSpan",
38
+ "SpanStatusCode",
39
+ "getSpanContext",
40
+ "setSpanContext"
41
+ ];
42
+ }
43
+
44
+ const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"];
45
+
46
+ for (const version of releasedOpenTelemetryVersions) {
47
+ namedExports[
48
+ // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path.
49
+ `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js`
50
+ ] = [
51
+ "SpanKind",
52
+ "TraceFlags",
53
+ "getSpan",
54
+ "setSpan",
55
+ "StatusCode",
56
+ "CanonicalCode",
57
+ "getSpanContext",
58
+ "setSpanContext"
59
+ ];
60
+ }
61
+
62
+ return namedExports;
63
+ }
64
+
65
+ // #region Warning Handler
4
66
 
5
67
  /**
6
- * @type {rollup.RollupFileOptions}
68
+ * A function that can determine whether a rollupwarning should be ignored. If
69
+ * the function returns `true`, then the warning will not be displayed.
7
70
  */
8
- const config = {
9
- input: "./esm/subscriptionClient.js",
10
- external: [
11
- "@azure/ms-rest-js",
12
- "@azure/ms-rest-azure-js"
13
- ],
14
- output: {
15
- file: "./dist/arm-subscriptions.js",
16
- format: "umd",
17
- name: "Azure.ArmSubscriptions",
18
- sourcemap: true,
19
- globals: {
20
- "@azure/ms-rest-js": "msRest",
21
- "@azure/ms-rest-azure-js": "msRestAzure"
71
+
72
+ function ignoreNiseSinonEvalWarnings(warning) {
73
+ return (
74
+ warning.code === "EVAL" &&
75
+ warning.id &&
76
+ (warning.id.includes("node_modules/nise") ||
77
+ warning.id.includes("node_modules/sinon")) === true
78
+ );
79
+ }
80
+
81
+ function ignoreChaiCircularDependencyWarnings(warning) {
82
+ return (
83
+ warning.code === "CIRCULAR_DEPENDENCY" &&
84
+ warning.importer && warning.importer.includes("node_modules/chai") === true
85
+ );
86
+ }
87
+
88
+ const warningInhibitors = [
89
+ ignoreChaiCircularDependencyWarnings,
90
+ ignoreNiseSinonEvalWarnings
91
+ ];
92
+
93
+ /**
94
+ * Construct a warning handler for the shared rollup configuration
95
+ * that ignores certain warnings that are not relevant to testing.
96
+ */
97
+ function makeOnWarnForTesting() {
98
+ return (warning, warn) => {
99
+ // If every inhibitor returns false (i.e. no inhibitors), then show the warning
100
+ if (warningInhibitors.every((inhib) => !inhib(warning))) {
101
+ warn(warning);
102
+ }
103
+ };
104
+ }
105
+
106
+ // #endregion
107
+
108
+ function makeBrowserTestConfig() {
109
+ const config = {
110
+ input: {
111
+ include: ["dist-esm/test/**/*.spec.js"],
112
+ exclude: ["dist-esm/test/**/node/**"]
22
113
  },
23
- banner: `/*
24
- * Copyright (c) Microsoft Corporation. All rights reserved.
25
- * Licensed under the MIT License. See License.txt in the project root for license information.
26
- *
27
- * Code generated by Microsoft (R) AutoRest Code Generator.
28
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
29
- */`
30
- },
31
- plugins: [
32
- nodeResolve({ mainFields: ['module', 'main'] }),
33
- sourcemaps()
34
- ]
114
+ output: {
115
+ file: `dist-test/index.browser.js`,
116
+ format: "umd",
117
+ sourcemap: true
118
+ },
119
+ preserveSymlinks: false,
120
+ plugins: [
121
+ multiEntry({ exports: false }),
122
+ nodeResolve({
123
+ mainFields: ["module", "browser"]
124
+ }),
125
+ cjs({
126
+ namedExports: {
127
+ // Chai's strange internal architecture makes it impossible to statically
128
+ // analyze its exports.
129
+ chai: [
130
+ "version",
131
+ "use",
132
+ "util",
133
+ "config",
134
+ "expect",
135
+ "should",
136
+ "assert"
137
+ ],
138
+ ...openTelemetryCommonJs()
139
+ }
140
+ }),
141
+ json(),
142
+ sourcemaps()
143
+ //viz({ filename: "dist-test/browser-stats.html", sourcemap: true })
144
+ ],
145
+ onwarn: makeOnWarnForTesting(),
146
+ // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0,
147
+ // rollup started respecting the "sideEffects" field in package.json. Since
148
+ // our package.json sets "sideEffects=false", this also applies to test
149
+ // code, which causes all tests to be removed by tree-shaking.
150
+ treeshake: false
151
+ };
152
+
153
+ return config;
154
+ }
155
+
156
+ const defaultConfigurationOptions = {
157
+ disableBrowserBundle: false
35
158
  };
36
159
 
37
- export default config;
160
+ export function makeConfig(pkg, options) {
161
+ options = {
162
+ ...defaultConfigurationOptions,
163
+ ...(options || {})
164
+ };
165
+
166
+ const baseConfig = {
167
+ // Use the package's module field if it has one
168
+ input: pkg["module"] || "dist-esm/src/index.js",
169
+ external: [
170
+ ...nodeBuiltins,
171
+ ...Object.keys(pkg.dependencies),
172
+ ...Object.keys(pkg.devDependencies)
173
+ ],
174
+ output: { file: "dist/index.js", format: "cjs", sourcemap: true },
175
+ preserveSymlinks: false,
176
+ plugins: [sourcemaps(), nodeResolve(), cjs()]
177
+ };
178
+
179
+ const config = [baseConfig];
180
+
181
+ if (!options.disableBrowserBundle) {
182
+ config.push(makeBrowserTestConfig());
183
+ }
184
+
185
+ return config;
186
+ }
187
+
188
+ export default makeConfig(require("./package.json"));
package/src/index.ts ADDED
@@ -0,0 +1,12 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ /// <reference lib="esnext.asynciterable" />
10
+ export * from "./models";
11
+ export { SubscriptionClient } from "./subscriptionClient";
12
+ export * from "./operationsInterfaces";
package/src/lroImpl.ts ADDED
@@ -0,0 +1,34 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ import { LongRunningOperation, LroResponse } from "@azure/core-lro";
10
+
11
+ export class LroImpl<T> implements LongRunningOperation<T> {
12
+ constructor(
13
+ private sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>,
14
+ private args: Record<string, unknown>,
15
+ private spec: {
16
+ readonly requestBody?: unknown;
17
+ readonly path?: string;
18
+ readonly httpMethod: string;
19
+ } & Record<string, any>,
20
+ public requestPath: string = spec.path!,
21
+ public requestMethod: string = spec.httpMethod
22
+ ) {}
23
+ public async sendInitialRequest(): Promise<LroResponse<T>> {
24
+ return this.sendOperationFn(this.args, this.spec);
25
+ }
26
+ public async sendPollRequest(path: string): Promise<LroResponse<T>> {
27
+ const { requestBody, ...restSpec } = this.spec;
28
+ return this.sendOperationFn(this.args, {
29
+ ...restSpec,
30
+ path,
31
+ httpMethod: "GET"
32
+ });
33
+ }
34
+ }