@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
@@ -1,75 +1,130 @@
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";
9
+ import {
10
+ OperationParameter,
11
+ OperationURLParameter,
12
+ OperationQueryParameter
13
+ } from "@azure/core-client";
14
+ import {
15
+ SubscriptionName as SubscriptionNameMapper,
16
+ AcceptOwnershipRequest as AcceptOwnershipRequestMapper,
17
+ PutAliasRequest as PutAliasRequestMapper,
18
+ PutTenantPolicyRequestProperties as PutTenantPolicyRequestPropertiesMapper
19
+ } from "../models/mappers";
12
20
 
13
- export const acceptLanguage: msRest.OperationParameter = {
14
- parameterPath: "acceptLanguage",
21
+ export const accept: OperationParameter = {
22
+ parameterPath: "accept",
15
23
  mapper: {
16
- serializedName: "accept-language",
17
- defaultValue: 'en-US',
24
+ defaultValue: "application/json",
25
+ isConstant: true,
26
+ serializedName: "Accept",
18
27
  type: {
19
28
  name: "String"
20
29
  }
21
30
  }
22
31
  };
23
- export const aliasName: msRest.OperationURLParameter = {
24
- parameterPath: "aliasName",
32
+
33
+ export const $host: OperationURLParameter = {
34
+ parameterPath: "$host",
25
35
  mapper: {
36
+ serializedName: "$host",
37
+ required: true,
38
+ type: {
39
+ name: "String"
40
+ }
41
+ },
42
+ skipEncoding: true
43
+ };
44
+
45
+ export const subscriptionId: OperationURLParameter = {
46
+ parameterPath: "subscriptionId",
47
+ mapper: {
48
+ serializedName: "subscriptionId",
26
49
  required: true,
27
- serializedName: "aliasName",
28
50
  type: {
29
51
  name: "String"
30
52
  }
31
53
  }
32
54
  };
33
- export const apiVersion0: msRest.OperationQueryParameter = {
55
+
56
+ export const apiVersion: OperationQueryParameter = {
34
57
  parameterPath: "apiVersion",
35
58
  mapper: {
36
- required: true,
59
+ defaultValue: "2021-10-01",
37
60
  isConstant: true,
38
61
  serializedName: "api-version",
39
- defaultValue: '2016-06-01',
40
62
  type: {
41
63
  name: "String"
42
64
  }
43
65
  }
44
66
  };
45
- export const apiVersion1: msRest.OperationQueryParameter = {
46
- parameterPath: "apiVersion",
67
+
68
+ export const contentType: OperationParameter = {
69
+ parameterPath: ["options", "contentType"],
47
70
  mapper: {
48
- required: true,
71
+ defaultValue: "application/json",
49
72
  isConstant: true,
50
- serializedName: "api-version",
51
- defaultValue: '2020-09-01',
73
+ serializedName: "Content-Type",
52
74
  type: {
53
75
  name: "String"
54
76
  }
55
77
  }
56
78
  };
57
- export const nextPageLink: msRest.OperationURLParameter = {
58
- parameterPath: "nextPageLink",
79
+
80
+ export const body: OperationParameter = {
81
+ parameterPath: "body",
82
+ mapper: SubscriptionNameMapper
83
+ };
84
+
85
+ export const body1: OperationParameter = {
86
+ parameterPath: "body",
87
+ mapper: AcceptOwnershipRequestMapper
88
+ };
89
+
90
+ export const nextLink: OperationURLParameter = {
91
+ parameterPath: "nextLink",
59
92
  mapper: {
60
- required: true,
61
93
  serializedName: "nextLink",
94
+ required: true,
62
95
  type: {
63
96
  name: "String"
64
97
  }
65
98
  },
66
99
  skipEncoding: true
67
100
  };
68
- export const subscriptionId: msRest.OperationURLParameter = {
69
- parameterPath: "subscriptionId",
101
+
102
+ export const body2: OperationParameter = {
103
+ parameterPath: "body",
104
+ mapper: PutAliasRequestMapper
105
+ };
106
+
107
+ export const aliasName: OperationURLParameter = {
108
+ parameterPath: "aliasName",
109
+ mapper: {
110
+ serializedName: "aliasName",
111
+ required: true,
112
+ type: {
113
+ name: "String"
114
+ }
115
+ }
116
+ };
117
+
118
+ export const body3: OperationParameter = {
119
+ parameterPath: "body",
120
+ mapper: PutTenantPolicyRequestPropertiesMapper
121
+ };
122
+
123
+ export const billingAccountId: OperationURLParameter = {
124
+ parameterPath: "billingAccountId",
70
125
  mapper: {
126
+ serializedName: "billingAccountId",
71
127
  required: true,
72
- serializedName: "subscriptionId",
73
128
  type: {
74
129
  name: "String"
75
130
  }
@@ -1,239 +1,239 @@
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 * as msRestAzure from "@azure/ms-rest-azure-js";
13
- import * as Models from "../models";
14
- import * as Mappers from "../models/aliasMappers";
9
+ import { Alias } from "../operationsInterfaces";
10
+ import * as coreClient from "@azure/core-client";
11
+ import * as Mappers from "../models/mappers";
15
12
  import * as Parameters from "../models/parameters";
16
- import { SubscriptionClientContext } from "../subscriptionClientContext";
13
+ import { SubscriptionClient } from "../subscriptionClient";
14
+ import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
15
+ import { LroImpl } from "../lroImpl";
16
+ import {
17
+ PutAliasRequest,
18
+ AliasCreateOptionalParams,
19
+ AliasCreateResponse,
20
+ AliasGetOptionalParams,
21
+ AliasGetResponse,
22
+ AliasDeleteOptionalParams,
23
+ AliasListOptionalParams,
24
+ AliasListResponse
25
+ } from "../models";
17
26
 
18
- /** Class representing a Alias. */
19
- export class Alias {
20
- private readonly client: SubscriptionClientContext;
27
+ /** Class containing Alias operations. */
28
+ export class AliasImpl implements Alias {
29
+ private readonly client: SubscriptionClient;
21
30
 
22
31
  /**
23
- * Create a Alias.
24
- * @param {SubscriptionClientContext} client Reference to the service client.
32
+ * Initialize a new instance of the class Alias class.
33
+ * @param client Reference to the service client
25
34
  */
26
- constructor(client: SubscriptionClientContext) {
35
+ constructor(client: SubscriptionClient) {
27
36
  this.client = client;
28
37
  }
29
38
 
30
39
  /**
31
40
  * Create Alias Subscription.
32
- * @param aliasName Alias Name
33
- * @param body
34
- * @param [options] The optional parameters
35
- * @returns Promise<Models.AliasCreateResponse>
41
+ * @param aliasName AliasName is the name for the subscription creation request. Note that this is not
42
+ * the same as subscription name and this doesn’t have any other lifecycle need beyond the request for
43
+ * subscription creation.
44
+ * @param body The parameters required to create a new subscription.
45
+ * @param options The options parameters.
36
46
  */
37
- create(aliasName: string, body: Models.PutAliasRequest, options?: msRest.RequestOptionsBase): Promise<Models.AliasCreateResponse> {
38
- return this.beginCreate(aliasName,body,options)
39
- .then(lroPoller => lroPoller.pollUntilFinished()) as Promise<Models.AliasCreateResponse>;
47
+ async beginCreate(
48
+ aliasName: string,
49
+ body: PutAliasRequest,
50
+ options?: AliasCreateOptionalParams
51
+ ): Promise<
52
+ PollerLike<PollOperationState<AliasCreateResponse>, AliasCreateResponse>
53
+ > {
54
+ const directSendOperation = async (
55
+ args: coreClient.OperationArguments,
56
+ spec: coreClient.OperationSpec
57
+ ): Promise<AliasCreateResponse> => {
58
+ return this.client.sendOperationRequest(args, spec);
59
+ };
60
+ const sendOperation = async (
61
+ args: coreClient.OperationArguments,
62
+ spec: coreClient.OperationSpec
63
+ ) => {
64
+ let currentRawResponse:
65
+ | coreClient.FullOperationResponse
66
+ | undefined = undefined;
67
+ const providedCallback = args.options?.onResponse;
68
+ const callback: coreClient.RawResponseCallback = (
69
+ rawResponse: coreClient.FullOperationResponse,
70
+ flatResponse: unknown
71
+ ) => {
72
+ currentRawResponse = rawResponse;
73
+ providedCallback?.(rawResponse, flatResponse);
74
+ };
75
+ const updatedArgs = {
76
+ ...args,
77
+ options: {
78
+ ...args.options,
79
+ onResponse: callback
80
+ }
81
+ };
82
+ const flatResponse = await directSendOperation(updatedArgs, spec);
83
+ return {
84
+ flatResponse,
85
+ rawResponse: {
86
+ statusCode: currentRawResponse!.status,
87
+ body: currentRawResponse!.parsedBody,
88
+ headers: currentRawResponse!.headers.toJSON()
89
+ }
90
+ };
91
+ };
92
+
93
+ const lro = new LroImpl(
94
+ sendOperation,
95
+ { aliasName, body, options },
96
+ createOperationSpec
97
+ );
98
+ return new LroEngine(lro, {
99
+ resumeFrom: options?.resumeFrom,
100
+ intervalInMs: options?.updateIntervalInMs
101
+ });
40
102
  }
41
103
 
42
104
  /**
43
- * Get Alias Subscription.
44
- * @param aliasName Alias Name
45
- * @param [options] The optional parameters
46
- * @returns Promise<Models.AliasGetResponse>
47
- */
48
- get(aliasName: string, options?: msRest.RequestOptionsBase): Promise<Models.AliasGetResponse>;
49
- /**
50
- * @param aliasName Alias Name
51
- * @param callback The callback
52
- */
53
- get(aliasName: string, callback: msRest.ServiceCallback<Models.PutAliasResponse>): void;
54
- /**
55
- * @param aliasName Alias Name
56
- * @param options The optional parameters
57
- * @param callback The callback
105
+ * Create Alias Subscription.
106
+ * @param aliasName AliasName is the name for the subscription creation request. Note that this is not
107
+ * the same as subscription name and this doesn’t have any other lifecycle need beyond the request for
108
+ * subscription creation.
109
+ * @param body The parameters required to create a new subscription.
110
+ * @param options The options parameters.
58
111
  */
59
- get(aliasName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.PutAliasResponse>): void;
60
- get(aliasName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.PutAliasResponse>, callback?: msRest.ServiceCallback<Models.PutAliasResponse>): Promise<Models.AliasGetResponse> {
61
- return this.client.sendOperationRequest(
62
- {
63
- aliasName,
64
- options
65
- },
66
- getOperationSpec,
67
- callback) as Promise<Models.AliasGetResponse>;
112
+ async beginCreateAndWait(
113
+ aliasName: string,
114
+ body: PutAliasRequest,
115
+ options?: AliasCreateOptionalParams
116
+ ): Promise<AliasCreateResponse> {
117
+ const poller = await this.beginCreate(aliasName, body, options);
118
+ return poller.pollUntilDone();
68
119
  }
69
120
 
70
121
  /**
71
- * Delete Alias.
72
- * @param aliasName Alias Name
73
- * @param [options] The optional parameters
74
- * @returns Promise<msRest.RestResponse>
75
- */
76
- deleteMethod(aliasName: string, options?: msRest.RequestOptionsBase): Promise<msRest.RestResponse>;
77
- /**
78
- * @param aliasName Alias Name
79
- * @param callback The callback
80
- */
81
- deleteMethod(aliasName: string, callback: msRest.ServiceCallback<void>): void;
82
- /**
83
- * @param aliasName Alias Name
84
- * @param options The optional parameters
85
- * @param callback The callback
122
+ * Get Alias Subscription.
123
+ * @param aliasName AliasName is the name for the subscription creation request. Note that this is not
124
+ * the same as subscription name and this doesn’t have any other lifecycle need beyond the request for
125
+ * subscription creation.
126
+ * @param options The options parameters.
86
127
  */
87
- deleteMethod(aliasName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<void>): void;
88
- deleteMethod(aliasName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<void>, callback?: msRest.ServiceCallback<void>): Promise<msRest.RestResponse> {
128
+ get(
129
+ aliasName: string,
130
+ options?: AliasGetOptionalParams
131
+ ): Promise<AliasGetResponse> {
89
132
  return this.client.sendOperationRequest(
90
- {
91
- aliasName,
92
- options
93
- },
94
- deleteMethodOperationSpec,
95
- callback);
133
+ { aliasName, options },
134
+ getOperationSpec
135
+ );
96
136
  }
97
137
 
98
138
  /**
99
- * Get Alias Subscription.
100
- * @param [options] The optional parameters
101
- * @returns Promise<Models.AliasListResponse>
102
- */
103
- list(options?: msRest.RequestOptionsBase): Promise<Models.AliasListResponse>;
104
- /**
105
- * @param callback The callback
106
- */
107
- list(callback: msRest.ServiceCallback<Models.PutAliasListResult>): void;
108
- /**
109
- * @param options The optional parameters
110
- * @param callback The callback
139
+ * Delete Alias.
140
+ * @param aliasName AliasName is the name for the subscription creation request. Note that this is not
141
+ * the same as subscription name and this doesn’t have any other lifecycle need beyond the request for
142
+ * subscription creation.
143
+ * @param options The options parameters.
111
144
  */
112
- list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.PutAliasListResult>): void;
113
- list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.PutAliasListResult>, callback?: msRest.ServiceCallback<Models.PutAliasListResult>): Promise<Models.AliasListResponse> {
145
+ delete(
146
+ aliasName: string,
147
+ options?: AliasDeleteOptionalParams
148
+ ): Promise<void> {
114
149
  return this.client.sendOperationRequest(
115
- {
116
- options
117
- },
118
- listOperationSpec,
119
- callback) as Promise<Models.AliasListResponse>;
150
+ { aliasName, options },
151
+ deleteOperationSpec
152
+ );
120
153
  }
121
154
 
122
155
  /**
123
- * Create Alias Subscription.
124
- * @param aliasName Alias Name
125
- * @param body
126
- * @param [options] The optional parameters
127
- * @returns Promise<msRestAzure.LROPoller>
156
+ * List Alias Subscription.
157
+ * @param options The options parameters.
128
158
  */
129
- beginCreate(aliasName: string, body: Models.PutAliasRequest, options?: msRest.RequestOptionsBase): Promise<msRestAzure.LROPoller> {
130
- return this.client.sendLRORequest(
131
- {
132
- aliasName,
133
- body,
134
- options
135
- },
136
- beginCreateOperationSpec,
137
- options);
159
+ list(options?: AliasListOptionalParams): Promise<AliasListResponse> {
160
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
138
161
  }
139
162
  }
140
-
141
163
  // Operation Specifications
142
- const serializer = new msRest.Serializer(Mappers);
143
- const getOperationSpec: msRest.OperationSpec = {
144
- httpMethod: "GET",
145
- path: "providers/Microsoft.Subscription/aliases/{aliasName}",
146
- urlParameters: [
147
- Parameters.aliasName
148
- ],
149
- queryParameters: [
150
- Parameters.apiVersion1
151
- ],
152
- headerParameters: [
153
- Parameters.acceptLanguage
154
- ],
164
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
165
+
166
+ const createOperationSpec: coreClient.OperationSpec = {
167
+ path: "/providers/Microsoft.Subscription/aliases/{aliasName}",
168
+ httpMethod: "PUT",
155
169
  responses: {
156
170
  200: {
157
- bodyMapper: Mappers.PutAliasResponse
171
+ bodyMapper: Mappers.SubscriptionAliasResponse
172
+ },
173
+ 201: {
174
+ bodyMapper: Mappers.SubscriptionAliasResponse
175
+ },
176
+ 202: {
177
+ bodyMapper: Mappers.SubscriptionAliasResponse
178
+ },
179
+ 204: {
180
+ bodyMapper: Mappers.SubscriptionAliasResponse
158
181
  },
159
182
  default: {
160
183
  bodyMapper: Mappers.ErrorResponseBody
161
184
  }
162
185
  },
186
+ requestBody: Parameters.body2,
187
+ queryParameters: [Parameters.apiVersion],
188
+ urlParameters: [Parameters.$host, Parameters.aliasName],
189
+ headerParameters: [Parameters.accept, Parameters.contentType],
190
+ mediaType: "json",
163
191
  serializer
164
192
  };
165
-
166
- const deleteMethodOperationSpec: msRest.OperationSpec = {
167
- httpMethod: "DELETE",
168
- path: "providers/Microsoft.Subscription/aliases/{aliasName}",
169
- urlParameters: [
170
- Parameters.aliasName
171
- ],
172
- queryParameters: [
173
- Parameters.apiVersion1
174
- ],
175
- headerParameters: [
176
- Parameters.acceptLanguage
177
- ],
193
+ const getOperationSpec: coreClient.OperationSpec = {
194
+ path: "/providers/Microsoft.Subscription/aliases/{aliasName}",
195
+ httpMethod: "GET",
178
196
  responses: {
179
- 200: {},
180
- 204: {},
197
+ 200: {
198
+ bodyMapper: Mappers.SubscriptionAliasResponse
199
+ },
181
200
  default: {
182
201
  bodyMapper: Mappers.ErrorResponseBody
183
202
  }
184
203
  },
204
+ queryParameters: [Parameters.apiVersion],
205
+ urlParameters: [Parameters.$host, Parameters.aliasName],
206
+ headerParameters: [Parameters.accept],
185
207
  serializer
186
208
  };
187
-
188
- const listOperationSpec: msRest.OperationSpec = {
189
- httpMethod: "GET",
190
- path: "providers/Microsoft.Subscription/aliases",
191
- queryParameters: [
192
- Parameters.apiVersion1
193
- ],
194
- headerParameters: [
195
- Parameters.acceptLanguage
196
- ],
209
+ const deleteOperationSpec: coreClient.OperationSpec = {
210
+ path: "/providers/Microsoft.Subscription/aliases/{aliasName}",
211
+ httpMethod: "DELETE",
197
212
  responses: {
198
- 200: {
199
- bodyMapper: Mappers.PutAliasListResult
200
- },
213
+ 200: {},
214
+ 204: {},
201
215
  default: {
202
216
  bodyMapper: Mappers.ErrorResponseBody
203
217
  }
204
218
  },
219
+ queryParameters: [Parameters.apiVersion],
220
+ urlParameters: [Parameters.$host, Parameters.aliasName],
221
+ headerParameters: [Parameters.accept],
205
222
  serializer
206
223
  };
207
-
208
- const beginCreateOperationSpec: msRest.OperationSpec = {
209
- httpMethod: "PUT",
210
- path: "providers/Microsoft.Subscription/aliases/{aliasName}",
211
- urlParameters: [
212
- Parameters.aliasName
213
- ],
214
- queryParameters: [
215
- Parameters.apiVersion1
216
- ],
217
- headerParameters: [
218
- Parameters.acceptLanguage
219
- ],
220
- requestBody: {
221
- parameterPath: "body",
222
- mapper: {
223
- ...Mappers.PutAliasRequest,
224
- required: true
225
- }
226
- },
224
+ const listOperationSpec: coreClient.OperationSpec = {
225
+ path: "/providers/Microsoft.Subscription/aliases",
226
+ httpMethod: "GET",
227
227
  responses: {
228
228
  200: {
229
- bodyMapper: Mappers.PutAliasResponse
230
- },
231
- 201: {
232
- bodyMapper: Mappers.PutAliasResponse
229
+ bodyMapper: Mappers.SubscriptionAliasListResult
233
230
  },
234
231
  default: {
235
232
  bodyMapper: Mappers.ErrorResponseBody
236
233
  }
237
234
  },
235
+ queryParameters: [Parameters.apiVersion],
236
+ urlParameters: [Parameters.$host],
237
+ headerParameters: [Parameters.accept],
238
238
  serializer
239
239
  };
@@ -0,0 +1,65 @@
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 { BillingAccount } from "../operationsInterfaces";
10
+ import * as coreClient from "@azure/core-client";
11
+ import * as Mappers from "../models/mappers";
12
+ import * as Parameters from "../models/parameters";
13
+ import { SubscriptionClient } from "../subscriptionClient";
14
+ import {
15
+ BillingAccountGetPolicyOptionalParams,
16
+ BillingAccountGetPolicyResponse
17
+ } from "../models";
18
+
19
+ /** Class containing BillingAccount operations. */
20
+ export class BillingAccountImpl implements BillingAccount {
21
+ private readonly client: SubscriptionClient;
22
+
23
+ /**
24
+ * Initialize a new instance of the class BillingAccount class.
25
+ * @param client Reference to the service client
26
+ */
27
+ constructor(client: SubscriptionClient) {
28
+ this.client = client;
29
+ }
30
+
31
+ /**
32
+ * Get Billing Account Policy.
33
+ * @param billingAccountId Billing Account Id.
34
+ * @param options The options parameters.
35
+ */
36
+ getPolicy(
37
+ billingAccountId: string,
38
+ options?: BillingAccountGetPolicyOptionalParams
39
+ ): Promise<BillingAccountGetPolicyResponse> {
40
+ return this.client.sendOperationRequest(
41
+ { billingAccountId, options },
42
+ getPolicyOperationSpec
43
+ );
44
+ }
45
+ }
46
+ // Operation Specifications
47
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
48
+
49
+ const getPolicyOperationSpec: coreClient.OperationSpec = {
50
+ path:
51
+ "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Subscription/policies/default",
52
+ httpMethod: "GET",
53
+ responses: {
54
+ 200: {
55
+ bodyMapper: Mappers.BillingAccountPoliciesResponse
56
+ },
57
+ default: {
58
+ bodyMapper: Mappers.ErrorResponseBody
59
+ }
60
+ },
61
+ queryParameters: [Parameters.apiVersion],
62
+ urlParameters: [Parameters.$host, Parameters.billingAccountId],
63
+ headerParameters: [Parameters.accept],
64
+ serializer
65
+ };
@@ -1,15 +1,13 @@
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
- export * from "./subscriptions";
12
- export * from "./tenants";
13
- export * from "./subscriptionOperations";
9
+ export * from "./subscription";
14
10
  export * from "./operations";
15
11
  export * from "./alias";
12
+ export * from "./subscriptionPolicy";
13
+ export * from "./billingAccount";