@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,75 @@
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 { PollerLike, PollOperationState } from "@azure/core-lro";
10
+ import {
11
+ PutAliasRequest,
12
+ AliasCreateOptionalParams,
13
+ AliasCreateResponse,
14
+ AliasGetOptionalParams,
15
+ AliasGetResponse,
16
+ AliasDeleteOptionalParams,
17
+ AliasListOptionalParams,
18
+ AliasListResponse
19
+ } from "../models";
20
+
21
+ /** Interface representing a Alias. */
22
+ export interface Alias {
23
+ /**
24
+ * Create Alias Subscription.
25
+ * @param aliasName AliasName is the name for the subscription creation request. Note that this is not
26
+ * the same as subscription name and this doesn’t have any other lifecycle need beyond the request for
27
+ * subscription creation.
28
+ * @param body The parameters required to create a new subscription.
29
+ * @param options The options parameters.
30
+ */
31
+ beginCreate(
32
+ aliasName: string,
33
+ body: PutAliasRequest,
34
+ options?: AliasCreateOptionalParams
35
+ ): Promise<
36
+ PollerLike<PollOperationState<AliasCreateResponse>, AliasCreateResponse>
37
+ >;
38
+ /**
39
+ * Create Alias Subscription.
40
+ * @param aliasName AliasName is the name for the subscription creation request. Note that this is not
41
+ * the same as subscription name and this doesn’t have any other lifecycle need beyond the request for
42
+ * subscription creation.
43
+ * @param body The parameters required to create a new subscription.
44
+ * @param options The options parameters.
45
+ */
46
+ beginCreateAndWait(
47
+ aliasName: string,
48
+ body: PutAliasRequest,
49
+ options?: AliasCreateOptionalParams
50
+ ): Promise<AliasCreateResponse>;
51
+ /**
52
+ * Get Alias Subscription.
53
+ * @param aliasName AliasName is the name for the subscription creation request. Note that this is not
54
+ * the same as subscription name and this doesn’t have any other lifecycle need beyond the request for
55
+ * subscription creation.
56
+ * @param options The options parameters.
57
+ */
58
+ get(
59
+ aliasName: string,
60
+ options?: AliasGetOptionalParams
61
+ ): Promise<AliasGetResponse>;
62
+ /**
63
+ * Delete Alias.
64
+ * @param aliasName AliasName is the name for the subscription creation request. Note that this is not
65
+ * the same as subscription name and this doesn’t have any other lifecycle need beyond the request for
66
+ * subscription creation.
67
+ * @param options The options parameters.
68
+ */
69
+ delete(aliasName: string, options?: AliasDeleteOptionalParams): Promise<void>;
70
+ /**
71
+ * List Alias Subscription.
72
+ * @param options The options parameters.
73
+ */
74
+ list(options?: AliasListOptionalParams): Promise<AliasListResponse>;
75
+ }
@@ -0,0 +1,25 @@
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 {
10
+ BillingAccountGetPolicyOptionalParams,
11
+ BillingAccountGetPolicyResponse
12
+ } from "../models";
13
+
14
+ /** Interface representing a BillingAccount. */
15
+ export interface BillingAccount {
16
+ /**
17
+ * Get Billing Account Policy.
18
+ * @param billingAccountId Billing Account Id.
19
+ * @param options The options parameters.
20
+ */
21
+ getPolicy(
22
+ billingAccountId: string,
23
+ options?: BillingAccountGetPolicyOptionalParams
24
+ ): Promise<BillingAccountGetPolicyResponse>;
25
+ }
@@ -0,0 +1,13 @@
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
+ export * from "./subscription";
10
+ export * from "./operations";
11
+ export * from "./alias";
12
+ export * from "./subscriptionPolicy";
13
+ export * from "./billingAccount";
@@ -0,0 +1,22 @@
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 { PagedAsyncIterableIterator } from "@azure/core-paging";
10
+ import { Operation, OperationsListOptionalParams } from "../models";
11
+
12
+ /// <reference lib="esnext.asynciterable" />
13
+ /** Interface representing a Operations. */
14
+ export interface Operations {
15
+ /**
16
+ * Lists all of the available Microsoft.Subscription API operations.
17
+ * @param options The options parameters.
18
+ */
19
+ list(
20
+ options?: OperationsListOptionalParams
21
+ ): PagedAsyncIterableIterator<Operation>;
22
+ }
@@ -0,0 +1,92 @@
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 { PollerLike, PollOperationState } from "@azure/core-lro";
10
+ import {
11
+ SubscriptionCancelOptionalParams,
12
+ SubscriptionCancelResponse,
13
+ SubscriptionName,
14
+ SubscriptionRenameOptionalParams,
15
+ SubscriptionRenameResponse,
16
+ SubscriptionEnableOptionalParams,
17
+ SubscriptionEnableResponse,
18
+ AcceptOwnershipRequest,
19
+ SubscriptionAcceptOwnershipOptionalParams,
20
+ SubscriptionAcceptOwnershipResponse,
21
+ SubscriptionAcceptOwnershipStatusOptionalParams,
22
+ SubscriptionAcceptOwnershipStatusResponse
23
+ } from "../models";
24
+
25
+ /** Interface representing a Subscription. */
26
+ export interface Subscription {
27
+ /**
28
+ * The operation to cancel a subscription
29
+ * @param subscriptionId Subscription Id.
30
+ * @param options The options parameters.
31
+ */
32
+ cancel(
33
+ subscriptionId: string,
34
+ options?: SubscriptionCancelOptionalParams
35
+ ): Promise<SubscriptionCancelResponse>;
36
+ /**
37
+ * The operation to rename a subscription
38
+ * @param subscriptionId Subscription Id.
39
+ * @param body Subscription Name
40
+ * @param options The options parameters.
41
+ */
42
+ rename(
43
+ subscriptionId: string,
44
+ body: SubscriptionName,
45
+ options?: SubscriptionRenameOptionalParams
46
+ ): Promise<SubscriptionRenameResponse>;
47
+ /**
48
+ * The operation to enable a subscription
49
+ * @param subscriptionId Subscription Id.
50
+ * @param options The options parameters.
51
+ */
52
+ enable(
53
+ subscriptionId: string,
54
+ options?: SubscriptionEnableOptionalParams
55
+ ): Promise<SubscriptionEnableResponse>;
56
+ /**
57
+ * Accept subscription ownership.
58
+ * @param subscriptionId Subscription Id.
59
+ * @param body The parameters required to accept subscription ownership.
60
+ * @param options The options parameters.
61
+ */
62
+ beginAcceptOwnership(
63
+ subscriptionId: string,
64
+ body: AcceptOwnershipRequest,
65
+ options?: SubscriptionAcceptOwnershipOptionalParams
66
+ ): Promise<
67
+ PollerLike<
68
+ PollOperationState<SubscriptionAcceptOwnershipResponse>,
69
+ SubscriptionAcceptOwnershipResponse
70
+ >
71
+ >;
72
+ /**
73
+ * Accept subscription ownership.
74
+ * @param subscriptionId Subscription Id.
75
+ * @param body The parameters required to accept subscription ownership.
76
+ * @param options The options parameters.
77
+ */
78
+ beginAcceptOwnershipAndWait(
79
+ subscriptionId: string,
80
+ body: AcceptOwnershipRequest,
81
+ options?: SubscriptionAcceptOwnershipOptionalParams
82
+ ): Promise<SubscriptionAcceptOwnershipResponse>;
83
+ /**
84
+ * Accept subscription ownership status.
85
+ * @param subscriptionId Subscription Id.
86
+ * @param options The options parameters.
87
+ */
88
+ acceptOwnershipStatus(
89
+ subscriptionId: string,
90
+ options?: SubscriptionAcceptOwnershipStatusOptionalParams
91
+ ): Promise<SubscriptionAcceptOwnershipStatusResponse>;
92
+ }
@@ -0,0 +1,46 @@
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 { PagedAsyncIterableIterator } from "@azure/core-paging";
10
+ import {
11
+ GetTenantPolicyResponse,
12
+ SubscriptionPolicyListPolicyForTenantOptionalParams,
13
+ PutTenantPolicyRequestProperties,
14
+ SubscriptionPolicyAddUpdatePolicyForTenantOptionalParams,
15
+ SubscriptionPolicyAddUpdatePolicyForTenantResponse,
16
+ SubscriptionPolicyGetPolicyForTenantOptionalParams,
17
+ SubscriptionPolicyGetPolicyForTenantResponse
18
+ } from "../models";
19
+
20
+ /// <reference lib="esnext.asynciterable" />
21
+ /** Interface representing a SubscriptionPolicy. */
22
+ export interface SubscriptionPolicy {
23
+ /**
24
+ * Get the subscription tenant policy for the user's tenant.
25
+ * @param options The options parameters.
26
+ */
27
+ listPolicyForTenant(
28
+ options?: SubscriptionPolicyListPolicyForTenantOptionalParams
29
+ ): PagedAsyncIterableIterator<GetTenantPolicyResponse>;
30
+ /**
31
+ * Create or Update Subscription tenant policy for user's tenant.
32
+ * @param body Put tenant policy request properties.
33
+ * @param options The options parameters.
34
+ */
35
+ addUpdatePolicyForTenant(
36
+ body: PutTenantPolicyRequestProperties,
37
+ options?: SubscriptionPolicyAddUpdatePolicyForTenantOptionalParams
38
+ ): Promise<SubscriptionPolicyAddUpdatePolicyForTenantResponse>;
39
+ /**
40
+ * Get the subscription tenant policy for the user's tenant.
41
+ * @param options The options parameters.
42
+ */
43
+ getPolicyForTenant(
44
+ options?: SubscriptionPolicyGetPolicyForTenantOptionalParams
45
+ ): Promise<SubscriptionPolicyGetPolicyForTenantResponse>;
46
+ }
@@ -1,55 +1,87 @@
1
1
  /*
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for
4
- * license information.
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
5
4
  *
6
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
7
- * Changes may cause incorrect behavior and will be lost if the code is
8
- * regenerated.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
9
7
  */
10
8
 
11
- import * as msRest from "@azure/ms-rest-js";
12
- import { TokenCredential } from "@azure/core-auth";
13
- import * as Models from "./models";
14
- import * as Mappers from "./models/mappers";
15
- import * as operations from "./operations";
16
- import { SubscriptionClientContext } from "./subscriptionClientContext";
9
+ import * as coreClient from "@azure/core-client";
10
+ import * as coreAuth from "@azure/core-auth";
11
+ import {
12
+ SubscriptionImpl,
13
+ OperationsImpl,
14
+ AliasImpl,
15
+ SubscriptionPolicyImpl,
16
+ BillingAccountImpl
17
+ } from "./operations";
18
+ import {
19
+ Subscription,
20
+ Operations,
21
+ Alias,
22
+ SubscriptionPolicy,
23
+ BillingAccount
24
+ } from "./operationsInterfaces";
25
+ import { SubscriptionClientOptionalParams } from "./models";
17
26
 
18
-
19
- class SubscriptionClient extends SubscriptionClientContext {
20
- // Operation groups
21
- subscriptions: operations.Subscriptions;
22
- tenants: operations.Tenants;
23
- subscription: operations.SubscriptionOperations;
24
- operations: operations.Operations;
25
- alias: operations.Alias;
27
+ export class SubscriptionClient extends coreClient.ServiceClient {
28
+ $host: string;
29
+ apiVersion: string;
26
30
 
27
31
  /**
28
32
  * Initializes a new instance of the SubscriptionClient class.
29
- * @param credentials Credentials needed for the client to connect to Azure. Credentials
30
- * implementing the TokenCredential interface from the @azure/identity package are recommended. For
31
- * more information about these credentials, see
32
- * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the
33
- * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and
34
- * @azure/ms-rest-browserauth are also supported.
35
- * @param [options] The parameter options
33
+ * @param credentials Subscription credentials which uniquely identify client subscription.
34
+ * @param options The parameter options
36
35
  */
37
- constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, options?: Models.SubscriptionClientOptions) {
38
- super(credentials, options);
39
- this.subscriptions = new operations.Subscriptions(this);
40
- this.tenants = new operations.Tenants(this);
41
- this.subscription = new operations.SubscriptionOperations(this);
42
- this.operations = new operations.Operations(this);
43
- this.alias = new operations.Alias(this);
44
- }
45
- }
36
+ constructor(
37
+ credentials: coreAuth.TokenCredential,
38
+ options?: SubscriptionClientOptionalParams
39
+ ) {
40
+ if (credentials === undefined) {
41
+ throw new Error("'credentials' cannot be null");
42
+ }
43
+
44
+ // Initializing default values for options
45
+ if (!options) {
46
+ options = {};
47
+ }
48
+ const defaults: SubscriptionClientOptionalParams = {
49
+ requestContentType: "application/json; charset=utf-8",
50
+ credential: credentials
51
+ };
46
52
 
47
- // Operation Specifications
53
+ const packageDetails = `azsdk-js-arm-subscriptions/4.0.0`;
54
+ const userAgentPrefix =
55
+ options.userAgentOptions && options.userAgentOptions.userAgentPrefix
56
+ ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
57
+ : `${packageDetails}`;
48
58
 
49
- export {
50
- SubscriptionClient,
51
- SubscriptionClientContext,
52
- Models as SubscriptionModels,
53
- Mappers as SubscriptionMappers
54
- };
55
- export * from "./operations";
59
+ if (!options.credentialScopes) {
60
+ options.credentialScopes = ["https://management.azure.com/.default"];
61
+ }
62
+ const optionsWithDefaults = {
63
+ ...defaults,
64
+ ...options,
65
+ userAgentOptions: {
66
+ userAgentPrefix
67
+ },
68
+ baseUri: options.endpoint || "https://management.azure.com"
69
+ };
70
+ super(optionsWithDefaults);
71
+
72
+ // Assigning values to Constant parameters
73
+ this.$host = options.$host || "https://management.azure.com";
74
+ this.apiVersion = options.apiVersion || "2021-10-01";
75
+ this.subscription = new SubscriptionImpl(this);
76
+ this.operations = new OperationsImpl(this);
77
+ this.alias = new AliasImpl(this);
78
+ this.subscriptionPolicy = new SubscriptionPolicyImpl(this);
79
+ this.billingAccount = new BillingAccountImpl(this);
80
+ }
81
+
82
+ subscription: Subscription;
83
+ operations: Operations;
84
+ alias: Alias;
85
+ subscriptionPolicy: SubscriptionPolicy;
86
+ billingAccount: BillingAccount;
87
+ }
package/tsconfig.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "module": "es6",
4
4
  "moduleResolution": "node",
5
5
  "strict": true,
6
- "target": "es5",
6
+ "target": "es6",
7
7
  "sourceMap": true,
8
8
  "declarationMap": true,
9
9
  "esModuleInterop": true,
@@ -11,9 +11,9 @@
11
11
  "forceConsistentCasingInFileNames": true,
12
12
  "lib": ["es6", "dom"],
13
13
  "declaration": true,
14
- "outDir": "./esm",
14
+ "outDir": "./dist-esm",
15
15
  "importHelpers": true
16
16
  },
17
- "include": ["./src/**/*.ts"],
17
+ "include": ["./src/**/*.ts", "./test/**/*.ts"],
18
18
  "exclude": ["node_modules"]
19
19
  }