@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,120 @@
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
+ import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
9
+ import * as coreClient from "@azure/core-client";
10
+ import * as Mappers from "../models/mappers";
11
+ import * as Parameters from "../models/parameters";
12
+ /// <reference lib="esnext.asynciterable" />
13
+ /** Class containing Operations operations. */
14
+ export class OperationsImpl {
15
+ /**
16
+ * Initialize a new instance of the class Operations class.
17
+ * @param client Reference to the service client
18
+ */
19
+ constructor(client) {
20
+ this.client = client;
21
+ }
22
+ /**
23
+ * Lists all of the available Microsoft.Subscription API operations.
24
+ * @param options The options parameters.
25
+ */
26
+ list(options) {
27
+ const iter = this.listPagingAll(options);
28
+ return {
29
+ next() {
30
+ return iter.next();
31
+ },
32
+ [Symbol.asyncIterator]() {
33
+ return this;
34
+ },
35
+ byPage: () => {
36
+ return this.listPagingPage(options);
37
+ }
38
+ };
39
+ }
40
+ listPagingPage(options) {
41
+ return __asyncGenerator(this, arguments, function* listPagingPage_1() {
42
+ let result = yield __await(this._list(options));
43
+ yield yield __await(result.value || []);
44
+ let continuationToken = result.nextLink;
45
+ while (continuationToken) {
46
+ result = yield __await(this._listNext(continuationToken, options));
47
+ continuationToken = result.nextLink;
48
+ yield yield __await(result.value || []);
49
+ }
50
+ });
51
+ }
52
+ listPagingAll(options) {
53
+ return __asyncGenerator(this, arguments, function* listPagingAll_1() {
54
+ var e_1, _a;
55
+ try {
56
+ for (var _b = __asyncValues(this.listPagingPage(options)), _c; _c = yield __await(_b.next()), !_c.done;) {
57
+ const page = _c.value;
58
+ yield __await(yield* __asyncDelegator(__asyncValues(page)));
59
+ }
60
+ }
61
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
62
+ finally {
63
+ try {
64
+ if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b));
65
+ }
66
+ finally { if (e_1) throw e_1.error; }
67
+ }
68
+ });
69
+ }
70
+ /**
71
+ * Lists all of the available Microsoft.Subscription API operations.
72
+ * @param options The options parameters.
73
+ */
74
+ _list(options) {
75
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
76
+ }
77
+ /**
78
+ * ListNext
79
+ * @param nextLink The nextLink from the previous successful call to the List method.
80
+ * @param options The options parameters.
81
+ */
82
+ _listNext(nextLink, options) {
83
+ return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec);
84
+ }
85
+ }
86
+ // Operation Specifications
87
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
88
+ const listOperationSpec = {
89
+ path: "/providers/Microsoft.Subscription/operations",
90
+ httpMethod: "GET",
91
+ responses: {
92
+ 200: {
93
+ bodyMapper: Mappers.OperationListResult
94
+ },
95
+ default: {
96
+ bodyMapper: Mappers.ErrorResponseBody
97
+ }
98
+ },
99
+ queryParameters: [Parameters.apiVersion],
100
+ urlParameters: [Parameters.$host],
101
+ headerParameters: [Parameters.accept],
102
+ serializer
103
+ };
104
+ const listNextOperationSpec = {
105
+ path: "{nextLink}",
106
+ httpMethod: "GET",
107
+ responses: {
108
+ 200: {
109
+ bodyMapper: Mappers.OperationListResult
110
+ },
111
+ default: {
112
+ bodyMapper: Mappers.ErrorResponseBody
113
+ }
114
+ },
115
+ queryParameters: [Parameters.apiVersion],
116
+ urlParameters: [Parameters.$host, Parameters.nextLink],
117
+ headerParameters: [Parameters.accept],
118
+ serializer
119
+ };
120
+ //# sourceMappingURL=operations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../src/operations/operations.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAIH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,mBAAm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AU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC"}
@@ -0,0 +1,53 @@
1
+ import { Subscription } from "../operationsInterfaces";
2
+ import { SubscriptionClient } from "../subscriptionClient";
3
+ import { PollerLike, PollOperationState } from "@azure/core-lro";
4
+ import { SubscriptionCancelOptionalParams, SubscriptionCancelResponse, SubscriptionName, SubscriptionRenameOptionalParams, SubscriptionRenameResponse, SubscriptionEnableOptionalParams, SubscriptionEnableResponse, AcceptOwnershipRequest, SubscriptionAcceptOwnershipOptionalParams, SubscriptionAcceptOwnershipResponse, SubscriptionAcceptOwnershipStatusOptionalParams, SubscriptionAcceptOwnershipStatusResponse } from "../models";
5
+ /** Class containing Subscription operations. */
6
+ export declare class SubscriptionImpl implements Subscription {
7
+ private readonly client;
8
+ /**
9
+ * Initialize a new instance of the class Subscription class.
10
+ * @param client Reference to the service client
11
+ */
12
+ constructor(client: SubscriptionClient);
13
+ /**
14
+ * The operation to cancel a subscription
15
+ * @param subscriptionId Subscription Id.
16
+ * @param options The options parameters.
17
+ */
18
+ cancel(subscriptionId: string, options?: SubscriptionCancelOptionalParams): Promise<SubscriptionCancelResponse>;
19
+ /**
20
+ * The operation to rename a subscription
21
+ * @param subscriptionId Subscription Id.
22
+ * @param body Subscription Name
23
+ * @param options The options parameters.
24
+ */
25
+ rename(subscriptionId: string, body: SubscriptionName, options?: SubscriptionRenameOptionalParams): Promise<SubscriptionRenameResponse>;
26
+ /**
27
+ * The operation to enable a subscription
28
+ * @param subscriptionId Subscription Id.
29
+ * @param options The options parameters.
30
+ */
31
+ enable(subscriptionId: string, options?: SubscriptionEnableOptionalParams): Promise<SubscriptionEnableResponse>;
32
+ /**
33
+ * Accept subscription ownership.
34
+ * @param subscriptionId Subscription Id.
35
+ * @param body The parameters required to accept subscription ownership.
36
+ * @param options The options parameters.
37
+ */
38
+ beginAcceptOwnership(subscriptionId: string, body: AcceptOwnershipRequest, options?: SubscriptionAcceptOwnershipOptionalParams): Promise<PollerLike<PollOperationState<SubscriptionAcceptOwnershipResponse>, SubscriptionAcceptOwnershipResponse>>;
39
+ /**
40
+ * Accept subscription ownership.
41
+ * @param subscriptionId Subscription Id.
42
+ * @param body The parameters required to accept subscription ownership.
43
+ * @param options The options parameters.
44
+ */
45
+ beginAcceptOwnershipAndWait(subscriptionId: string, body: AcceptOwnershipRequest, options?: SubscriptionAcceptOwnershipOptionalParams): Promise<SubscriptionAcceptOwnershipResponse>;
46
+ /**
47
+ * Accept subscription ownership status.
48
+ * @param subscriptionId Subscription Id.
49
+ * @param options The options parameters.
50
+ */
51
+ acceptOwnershipStatus(subscriptionId: string, options?: SubscriptionAcceptOwnershipStatusOptionalParams): Promise<SubscriptionAcceptOwnershipStatusResponse>;
52
+ }
53
+ //# sourceMappingURL=subscription.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../../src/operations/subscription.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAIvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAa,MAAM,iBAAiB,CAAC;AAE5E,OAAO,EACL,gCAAgC,EAChC,0BAA0B,EAC1B,gBAAgB,EAChB,gCAAgC,EAChC,0BAA0B,EAC1B,gCAAgC,EAChC,0BAA0B,EAC1B,sBAAsB,EACtB,yCAAyC,EACzC,mCAAmC,EACnC,+CAA+C,EAC/C,yCAAyC,EAC1C,MAAM,WAAW,CAAC;AAEnB,gDAAgD;AAChD,qBAAa,gBAAiB,YAAW,YAAY;IACnD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;IAE5C;;;OAGG;gBACS,MAAM,EAAE,kBAAkB;IAItC;;;;OAIG;IACH,MAAM,CACJ,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,gCAAgC,GACzC,OAAO,CAAC,0BAA0B,CAAC;IAOtC;;;;;OAKG;IACH,MAAM,CACJ,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,gBAAgB,EACtB,OAAO,CAAC,EAAE,gCAAgC,GACzC,OAAO,CAAC,0BAA0B,CAAC;IAOtC;;;;OAIG;IACH,MAAM,CACJ,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,gCAAgC,GACzC,OAAO,CAAC,0BAA0B,CAAC;IAOtC;;;;;OAKG;IACG,oBAAoB,CACxB,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,sBAAsB,EAC5B,OAAO,CAAC,EAAE,yCAAyC,GAClD,OAAO,CACR,UAAU,CACR,kBAAkB,CAAC,mCAAmC,CAAC,EACvD,mCAAmC,CACpC,CACF;IAmDD;;;;;OAKG;IACG,2BAA2B,CAC/B,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,sBAAsB,EAC5B,OAAO,CAAC,EAAE,yCAAyC,GAClD,OAAO,CAAC,mCAAmC,CAAC;IAS/C;;;;OAIG;IACH,qBAAqB,CACnB,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,+CAA+C,GACxD,OAAO,CAAC,yCAAyC,CAAC;CAMtD"}
@@ -0,0 +1,201 @@
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
+ import { __awaiter } from "tslib";
9
+ import * as coreClient from "@azure/core-client";
10
+ import * as Mappers from "../models/mappers";
11
+ import * as Parameters from "../models/parameters";
12
+ import { LroEngine } from "@azure/core-lro";
13
+ import { LroImpl } from "../lroImpl";
14
+ /** Class containing Subscription operations. */
15
+ export class SubscriptionImpl {
16
+ /**
17
+ * Initialize a new instance of the class Subscription class.
18
+ * @param client Reference to the service client
19
+ */
20
+ constructor(client) {
21
+ this.client = client;
22
+ }
23
+ /**
24
+ * The operation to cancel a subscription
25
+ * @param subscriptionId Subscription Id.
26
+ * @param options The options parameters.
27
+ */
28
+ cancel(subscriptionId, options) {
29
+ return this.client.sendOperationRequest({ subscriptionId, options }, cancelOperationSpec);
30
+ }
31
+ /**
32
+ * The operation to rename a subscription
33
+ * @param subscriptionId Subscription Id.
34
+ * @param body Subscription Name
35
+ * @param options The options parameters.
36
+ */
37
+ rename(subscriptionId, body, options) {
38
+ return this.client.sendOperationRequest({ subscriptionId, body, options }, renameOperationSpec);
39
+ }
40
+ /**
41
+ * The operation to enable a subscription
42
+ * @param subscriptionId Subscription Id.
43
+ * @param options The options parameters.
44
+ */
45
+ enable(subscriptionId, options) {
46
+ return this.client.sendOperationRequest({ subscriptionId, options }, enableOperationSpec);
47
+ }
48
+ /**
49
+ * Accept subscription ownership.
50
+ * @param subscriptionId Subscription Id.
51
+ * @param body The parameters required to accept subscription ownership.
52
+ * @param options The options parameters.
53
+ */
54
+ beginAcceptOwnership(subscriptionId, body, options) {
55
+ return __awaiter(this, void 0, void 0, function* () {
56
+ const directSendOperation = (args, spec) => __awaiter(this, void 0, void 0, function* () {
57
+ return this.client.sendOperationRequest(args, spec);
58
+ });
59
+ const sendOperation = (args, spec) => __awaiter(this, void 0, void 0, function* () {
60
+ var _a;
61
+ let currentRawResponse = undefined;
62
+ const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
63
+ const callback = (rawResponse, flatResponse) => {
64
+ currentRawResponse = rawResponse;
65
+ providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
66
+ };
67
+ const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
68
+ const flatResponse = yield directSendOperation(updatedArgs, spec);
69
+ return {
70
+ flatResponse,
71
+ rawResponse: {
72
+ statusCode: currentRawResponse.status,
73
+ body: currentRawResponse.parsedBody,
74
+ headers: currentRawResponse.headers.toJSON()
75
+ }
76
+ };
77
+ });
78
+ const lro = new LroImpl(sendOperation, { subscriptionId, body, options }, acceptOwnershipOperationSpec);
79
+ return new LroEngine(lro, {
80
+ resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
81
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
82
+ });
83
+ });
84
+ }
85
+ /**
86
+ * Accept subscription ownership.
87
+ * @param subscriptionId Subscription Id.
88
+ * @param body The parameters required to accept subscription ownership.
89
+ * @param options The options parameters.
90
+ */
91
+ beginAcceptOwnershipAndWait(subscriptionId, body, options) {
92
+ return __awaiter(this, void 0, void 0, function* () {
93
+ const poller = yield this.beginAcceptOwnership(subscriptionId, body, options);
94
+ return poller.pollUntilDone();
95
+ });
96
+ }
97
+ /**
98
+ * Accept subscription ownership status.
99
+ * @param subscriptionId Subscription Id.
100
+ * @param options The options parameters.
101
+ */
102
+ acceptOwnershipStatus(subscriptionId, options) {
103
+ return this.client.sendOperationRequest({ subscriptionId, options }, acceptOwnershipStatusOperationSpec);
104
+ }
105
+ }
106
+ // Operation Specifications
107
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
108
+ const cancelOperationSpec = {
109
+ path: "/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/cancel",
110
+ httpMethod: "POST",
111
+ responses: {
112
+ 200: {
113
+ bodyMapper: Mappers.CanceledSubscriptionId
114
+ },
115
+ default: {
116
+ bodyMapper: Mappers.ErrorResponseBody
117
+ }
118
+ },
119
+ queryParameters: [Parameters.apiVersion],
120
+ urlParameters: [Parameters.$host, Parameters.subscriptionId],
121
+ headerParameters: [Parameters.accept],
122
+ serializer
123
+ };
124
+ const renameOperationSpec = {
125
+ path: "/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/rename",
126
+ httpMethod: "POST",
127
+ responses: {
128
+ 200: {
129
+ bodyMapper: Mappers.RenamedSubscriptionId
130
+ },
131
+ default: {
132
+ bodyMapper: Mappers.ErrorResponseBody
133
+ }
134
+ },
135
+ requestBody: Parameters.body,
136
+ queryParameters: [Parameters.apiVersion],
137
+ urlParameters: [Parameters.$host, Parameters.subscriptionId],
138
+ headerParameters: [Parameters.accept, Parameters.contentType],
139
+ mediaType: "json",
140
+ serializer
141
+ };
142
+ const enableOperationSpec = {
143
+ path: "/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/enable",
144
+ httpMethod: "POST",
145
+ responses: {
146
+ 200: {
147
+ bodyMapper: Mappers.EnabledSubscriptionId
148
+ },
149
+ default: {
150
+ bodyMapper: Mappers.ErrorResponseBody
151
+ }
152
+ },
153
+ queryParameters: [Parameters.apiVersion],
154
+ urlParameters: [Parameters.$host, Parameters.subscriptionId],
155
+ headerParameters: [Parameters.accept],
156
+ serializer
157
+ };
158
+ const acceptOwnershipOperationSpec = {
159
+ path: "/providers/Microsoft.Subscription/{subscriptionId}/acceptOwnership",
160
+ httpMethod: "POST",
161
+ responses: {
162
+ 200: {
163
+ headersMapper: Mappers.SubscriptionAcceptOwnershipHeaders
164
+ },
165
+ 201: {
166
+ headersMapper: Mappers.SubscriptionAcceptOwnershipHeaders
167
+ },
168
+ 202: {
169
+ headersMapper: Mappers.SubscriptionAcceptOwnershipHeaders
170
+ },
171
+ 204: {
172
+ headersMapper: Mappers.SubscriptionAcceptOwnershipHeaders
173
+ },
174
+ default: {
175
+ bodyMapper: Mappers.ErrorResponseBody
176
+ }
177
+ },
178
+ requestBody: Parameters.body1,
179
+ queryParameters: [Parameters.apiVersion],
180
+ urlParameters: [Parameters.$host, Parameters.subscriptionId],
181
+ headerParameters: [Parameters.accept, Parameters.contentType],
182
+ mediaType: "json",
183
+ serializer
184
+ };
185
+ const acceptOwnershipStatusOperationSpec = {
186
+ path: "/providers/Microsoft.Subscription/{subscriptionId}/acceptOwnershipStatus",
187
+ httpMethod: "GET",
188
+ responses: {
189
+ 200: {
190
+ bodyMapper: Mappers.AcceptOwnershipStatusResponse
191
+ },
192
+ default: {
193
+ bodyMapper: Mappers.ErrorResponseBody
194
+ }
195
+ },
196
+ queryParameters: [Parameters.apiVersion],
197
+ urlParameters: [Parameters.$host, Parameters.subscriptionId],
198
+ headerParameters: [Parameters.accept],
199
+ serializer
200
+ };
201
+ //# sourceMappingURL=subscription.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscription.js","sourceRoot":"","sources":["../../../src/operations/subscription.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAGH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,UAAU,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAkC,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAgBrC,gDAAgD;AAChD,MAAM,OAAO,gBAAgB;IAG3B;;;OAGG;IACH,YAAY,MAA0B;QACpC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACH,MAAM,CACJ,cAAsB,EACtB,OAA0C;QAE1C,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,cAAc,EAAE,OAAO,EAAE,EAC3B,mBAAmB,CACpB,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,MAAM,CACJ,cAAsB,EACtB,IAAsB,EACtB,OAA0C;QAE1C,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,cAAc,EAAE,IAAI,EAAE,OAAO,EAAE,EACjC,mBAAmB,CACpB,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,MAAM,CACJ,cAAsB,EACtB,OAA0C;QAE1C,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,cAAc,EAAE,OAAO,EAAE,EAC3B,mBAAmB,CACpB,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACG,oBAAoB,CACxB,cAAsB,EACtB,IAA4B,EAC5B,OAAmD;;YAOnD,MAAM,mBAAmB,GAAG,CAC1B,IAAmC,EACnC,IA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AAE,UAAU,CAAC,WAAW,CAAC;IAC7D,SAAS,EAAE,MAAM;IACjB,UAAU;CACX,CAAC;AACF,MAAM,kCAAkC,GAA6B;IACnE,IAAI,EACF,0EAA0E;IAC5E,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,6BAA6B;SAClD;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,iBAAiB;SACtC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,cAAc,CAAC;IAC5D,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { PagedAsyncIterableIterator } from "@azure/core-paging";
2
+ import { SubscriptionPolicy } from "../operationsInterfaces";
3
+ import { SubscriptionClient } from "../subscriptionClient";
4
+ import { GetTenantPolicyResponse, SubscriptionPolicyListPolicyForTenantOptionalParams, PutTenantPolicyRequestProperties, SubscriptionPolicyAddUpdatePolicyForTenantOptionalParams, SubscriptionPolicyAddUpdatePolicyForTenantResponse, SubscriptionPolicyGetPolicyForTenantOptionalParams, SubscriptionPolicyGetPolicyForTenantResponse } from "../models";
5
+ /** Class containing SubscriptionPolicy operations. */
6
+ export declare class SubscriptionPolicyImpl implements SubscriptionPolicy {
7
+ private readonly client;
8
+ /**
9
+ * Initialize a new instance of the class SubscriptionPolicy class.
10
+ * @param client Reference to the service client
11
+ */
12
+ constructor(client: SubscriptionClient);
13
+ /**
14
+ * Get the subscription tenant policy for the user's tenant.
15
+ * @param options The options parameters.
16
+ */
17
+ listPolicyForTenant(options?: SubscriptionPolicyListPolicyForTenantOptionalParams): PagedAsyncIterableIterator<GetTenantPolicyResponse>;
18
+ private listPolicyForTenantPagingPage;
19
+ private listPolicyForTenantPagingAll;
20
+ /**
21
+ * Create or Update Subscription tenant policy for user's tenant.
22
+ * @param body Put tenant policy request properties.
23
+ * @param options The options parameters.
24
+ */
25
+ addUpdatePolicyForTenant(body: PutTenantPolicyRequestProperties, options?: SubscriptionPolicyAddUpdatePolicyForTenantOptionalParams): Promise<SubscriptionPolicyAddUpdatePolicyForTenantResponse>;
26
+ /**
27
+ * Get the subscription tenant policy for the user's tenant.
28
+ * @param options The options parameters.
29
+ */
30
+ getPolicyForTenant(options?: SubscriptionPolicyGetPolicyForTenantOptionalParams): Promise<SubscriptionPolicyGetPolicyForTenantResponse>;
31
+ /**
32
+ * Get the subscription tenant policy for the user's tenant.
33
+ * @param options The options parameters.
34
+ */
35
+ private _listPolicyForTenant;
36
+ /**
37
+ * ListPolicyForTenantNext
38
+ * @param nextLink The nextLink from the previous successful call to the ListPolicyForTenant method.
39
+ * @param options The options parameters.
40
+ */
41
+ private _listPolicyForTenantNext;
42
+ }
43
+ //# sourceMappingURL=subscriptionPolicy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscriptionPolicy.d.ts","sourceRoot":"","sources":["../../../src/operations/subscriptionPolicy.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAI7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,uBAAuB,EAEvB,mDAAmD,EACnD,gCAAgC,EAChC,wDAAwD,EACxD,kDAAkD,EAClD,kDAAkD,EAClD,4CAA4C,EAG7C,MAAM,WAAW,CAAC;AAGnB,sDAAsD;AACtD,qBAAa,sBAAuB,YAAW,kBAAkB;IAC/D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;IAE5C;;;OAGG;gBACS,MAAM,EAAE,kBAAkB;IAItC;;;OAGG;IACI,mBAAmB,CACxB,OAAO,CAAC,EAAE,mDAAmD,GAC5D,0BAA0B,CAAC,uBAAuB,CAAC;YAevC,6BAA6B;YAa7B,4BAA4B;IAQ3C;;;;OAIG;IACH,wBAAwB,CACtB,IAAI,EAAE,gCAAgC,EACtC,OAAO,CAAC,EAAE,wDAAwD,GACjE,OAAO,CAAC,kDAAkD,CAAC;IAO9D;;;OAGG;IACH,kBAAkB,CAChB,OAAO,CAAC,EAAE,kDAAkD,GAC3D,OAAO,CAAC,4CAA4C,CAAC;IAOxD;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAS5B;;;;OAIG;IACH,OAAO,CAAC,wBAAwB;CASjC"}
@@ -0,0 +1,169 @@
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
+ import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
9
+ import * as coreClient from "@azure/core-client";
10
+ import * as Mappers from "../models/mappers";
11
+ import * as Parameters from "../models/parameters";
12
+ /// <reference lib="esnext.asynciterable" />
13
+ /** Class containing SubscriptionPolicy operations. */
14
+ export class SubscriptionPolicyImpl {
15
+ /**
16
+ * Initialize a new instance of the class SubscriptionPolicy class.
17
+ * @param client Reference to the service client
18
+ */
19
+ constructor(client) {
20
+ this.client = client;
21
+ }
22
+ /**
23
+ * Get the subscription tenant policy for the user's tenant.
24
+ * @param options The options parameters.
25
+ */
26
+ listPolicyForTenant(options) {
27
+ const iter = this.listPolicyForTenantPagingAll(options);
28
+ return {
29
+ next() {
30
+ return iter.next();
31
+ },
32
+ [Symbol.asyncIterator]() {
33
+ return this;
34
+ },
35
+ byPage: () => {
36
+ return this.listPolicyForTenantPagingPage(options);
37
+ }
38
+ };
39
+ }
40
+ listPolicyForTenantPagingPage(options) {
41
+ return __asyncGenerator(this, arguments, function* listPolicyForTenantPagingPage_1() {
42
+ let result = yield __await(this._listPolicyForTenant(options));
43
+ yield yield __await(result.value || []);
44
+ let continuationToken = result.nextLink;
45
+ while (continuationToken) {
46
+ result = yield __await(this._listPolicyForTenantNext(continuationToken, options));
47
+ continuationToken = result.nextLink;
48
+ yield yield __await(result.value || []);
49
+ }
50
+ });
51
+ }
52
+ listPolicyForTenantPagingAll(options) {
53
+ return __asyncGenerator(this, arguments, function* listPolicyForTenantPagingAll_1() {
54
+ var e_1, _a;
55
+ try {
56
+ for (var _b = __asyncValues(this.listPolicyForTenantPagingPage(options)), _c; _c = yield __await(_b.next()), !_c.done;) {
57
+ const page = _c.value;
58
+ yield __await(yield* __asyncDelegator(__asyncValues(page)));
59
+ }
60
+ }
61
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
62
+ finally {
63
+ try {
64
+ if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b));
65
+ }
66
+ finally { if (e_1) throw e_1.error; }
67
+ }
68
+ });
69
+ }
70
+ /**
71
+ * Create or Update Subscription tenant policy for user's tenant.
72
+ * @param body Put tenant policy request properties.
73
+ * @param options The options parameters.
74
+ */
75
+ addUpdatePolicyForTenant(body, options) {
76
+ return this.client.sendOperationRequest({ body, options }, addUpdatePolicyForTenantOperationSpec);
77
+ }
78
+ /**
79
+ * Get the subscription tenant policy for the user's tenant.
80
+ * @param options The options parameters.
81
+ */
82
+ getPolicyForTenant(options) {
83
+ return this.client.sendOperationRequest({ options }, getPolicyForTenantOperationSpec);
84
+ }
85
+ /**
86
+ * Get the subscription tenant policy for the user's tenant.
87
+ * @param options The options parameters.
88
+ */
89
+ _listPolicyForTenant(options) {
90
+ return this.client.sendOperationRequest({ options }, listPolicyForTenantOperationSpec);
91
+ }
92
+ /**
93
+ * ListPolicyForTenantNext
94
+ * @param nextLink The nextLink from the previous successful call to the ListPolicyForTenant method.
95
+ * @param options The options parameters.
96
+ */
97
+ _listPolicyForTenantNext(nextLink, options) {
98
+ return this.client.sendOperationRequest({ nextLink, options }, listPolicyForTenantNextOperationSpec);
99
+ }
100
+ }
101
+ // Operation Specifications
102
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
103
+ const addUpdatePolicyForTenantOperationSpec = {
104
+ path: "/providers/Microsoft.Subscription/policies/default",
105
+ httpMethod: "PUT",
106
+ responses: {
107
+ 201: {
108
+ bodyMapper: Mappers.GetTenantPolicyResponse
109
+ },
110
+ default: {
111
+ bodyMapper: Mappers.ErrorResponseBody
112
+ }
113
+ },
114
+ requestBody: Parameters.body3,
115
+ queryParameters: [Parameters.apiVersion],
116
+ urlParameters: [Parameters.$host],
117
+ headerParameters: [Parameters.accept, Parameters.contentType],
118
+ mediaType: "json",
119
+ serializer
120
+ };
121
+ const getPolicyForTenantOperationSpec = {
122
+ path: "/providers/Microsoft.Subscription/policies/default",
123
+ httpMethod: "GET",
124
+ responses: {
125
+ 200: {
126
+ bodyMapper: Mappers.GetTenantPolicyResponse
127
+ },
128
+ default: {
129
+ bodyMapper: Mappers.ErrorResponseBody
130
+ }
131
+ },
132
+ queryParameters: [Parameters.apiVersion],
133
+ urlParameters: [Parameters.$host],
134
+ headerParameters: [Parameters.accept],
135
+ serializer
136
+ };
137
+ const listPolicyForTenantOperationSpec = {
138
+ path: "/providers/Microsoft.Subscription/policies",
139
+ httpMethod: "GET",
140
+ responses: {
141
+ 200: {
142
+ bodyMapper: Mappers.GetTenantPolicyListResponse
143
+ },
144
+ default: {
145
+ bodyMapper: Mappers.ErrorResponseBody
146
+ }
147
+ },
148
+ queryParameters: [Parameters.apiVersion],
149
+ urlParameters: [Parameters.$host],
150
+ headerParameters: [Parameters.accept],
151
+ serializer
152
+ };
153
+ const listPolicyForTenantNextOperationSpec = {
154
+ path: "{nextLink}",
155
+ httpMethod: "GET",
156
+ responses: {
157
+ 200: {
158
+ bodyMapper: Mappers.GetTenantPolicyListResponse
159
+ },
160
+ default: {
161
+ bodyMapper: Mappers.ErrorResponseBody
162
+ }
163
+ },
164
+ queryParameters: [Parameters.apiVersion],
165
+ urlParameters: [Parameters.$host, Parameters.nextLink],
166
+ headerParameters: [Parameters.accept],
167
+ serializer
168
+ };
169
+ //# sourceMappingURL=subscriptionPolicy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscriptionPolicy.js","sourceRoot":"","sources":["../../../src/operations/subscriptionPolicy.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAIH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,UAAU,MAAM,sBAAsB,CAAC;AAenD,4CAA4C;AAC5C,sDAAsD;AACtD,MAAM,OAAO,sBAAsB;IAGjC;;;OAGG;IACH,YAAY,MAA0B;QACpC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACI,mBAAmB,CACxB,OAA6D;QAE7D,MAAM,IAAI,GAAG,IAAI,CAAC,4BAA4B,CAAC,OAAO,CAAC,CAAC;QACxD,OAAO;YACL,IAAI;gBACF,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;YACrB,CAAC;YACD,CAAC,MAAM,CAAC,aAAa,CAAC;gBACpB,OAAO,IAAI,CAAC;YACd,CAAC;YACD,MAAM,EAAE,GAAG,EAAE;gBACX,OAAO,IAAI,CAAC,6BAA6B,CAAC,OAAO,CAAC,CAAC;YACrD,CAAC;SACF,CAAC;IACJ,CAAC;IAEc,6BAA6B,CAC1C,OAA6D;;YAE7D,IAAI,MAAM,GAAG,cAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAA,CAAC;YACtD,oBAAM,MAAM,CAAC,KAAK,IAAI,EAAE,CAAA,CAAC;YACzB,IAAI,iBAAiB,GAAG,MAAM,CAAC,QAAQ,CAAC;YACxC,OAAO,iBAAiB,EAAE;gBACxB,MAAM,GAAG,cAAM,IAAI,CAAC,wBAAwB,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAA,CAAC;gBACzE,iBAAiB,GAAG,MAAM,CAAC,QAAQ,CAAC;gBACpC,oBAA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E,OAAO,CAAC,2BAA2B;SAChD;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,iBAAiB;SACtC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC;IACtD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC"}
@@ -0,0 +1,45 @@
1
+ import { PollerLike, PollOperationState } from "@azure/core-lro";
2
+ import { PutAliasRequest, AliasCreateOptionalParams, AliasCreateResponse, AliasGetOptionalParams, AliasGetResponse, AliasDeleteOptionalParams, AliasListOptionalParams, AliasListResponse } from "../models";
3
+ /** Interface representing a Alias. */
4
+ export interface Alias {
5
+ /**
6
+ * Create Alias Subscription.
7
+ * @param aliasName AliasName is the name for the subscription creation request. Note that this is not
8
+ * the same as subscription name and this doesn’t have any other lifecycle need beyond the request for
9
+ * subscription creation.
10
+ * @param body The parameters required to create a new subscription.
11
+ * @param options The options parameters.
12
+ */
13
+ beginCreate(aliasName: string, body: PutAliasRequest, options?: AliasCreateOptionalParams): Promise<PollerLike<PollOperationState<AliasCreateResponse>, AliasCreateResponse>>;
14
+ /**
15
+ * Create Alias Subscription.
16
+ * @param aliasName AliasName is the name for the subscription creation request. Note that this is not
17
+ * the same as subscription name and this doesn’t have any other lifecycle need beyond the request for
18
+ * subscription creation.
19
+ * @param body The parameters required to create a new subscription.
20
+ * @param options The options parameters.
21
+ */
22
+ beginCreateAndWait(aliasName: string, body: PutAliasRequest, options?: AliasCreateOptionalParams): Promise<AliasCreateResponse>;
23
+ /**
24
+ * Get 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 options The options parameters.
29
+ */
30
+ get(aliasName: string, options?: AliasGetOptionalParams): Promise<AliasGetResponse>;
31
+ /**
32
+ * Delete Alias.
33
+ * @param aliasName AliasName is the name for the subscription creation request. Note that this is not
34
+ * the same as subscription name and this doesn’t have any other lifecycle need beyond the request for
35
+ * subscription creation.
36
+ * @param options The options parameters.
37
+ */
38
+ delete(aliasName: string, options?: AliasDeleteOptionalParams): Promise<void>;
39
+ /**
40
+ * List Alias Subscription.
41
+ * @param options The options parameters.
42
+ */
43
+ list(options?: AliasListOptionalParams): Promise<AliasListResponse>;
44
+ }
45
+ //# sourceMappingURL=alias.d.ts.map