@azure/arm-azurestack 2.1.1 → 3.0.0-beta.1

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 (174) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/{LICENSE.txt → LICENSE} +2 -2
  3. package/README.md +69 -80
  4. package/dist/index.js +3000 -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/azureStackManagementClient.d.ts +24 -0
  9. package/dist-esm/src/azureStackManagementClient.d.ts.map +1 -0
  10. package/dist-esm/src/azureStackManagementClient.js +57 -0
  11. package/dist-esm/src/azureStackManagementClient.js.map +1 -0
  12. package/dist-esm/src/index.d.ts +5 -0
  13. package/dist-esm/src/index.d.ts.map +1 -0
  14. package/dist-esm/src/index.js +12 -0
  15. package/dist-esm/src/index.js.map +1 -0
  16. package/dist-esm/src/models/index.d.ts +854 -0
  17. package/dist-esm/src/models/index.d.ts.map +1 -0
  18. package/dist-esm/src/models/index.js +55 -0
  19. package/dist-esm/src/models/index.js.map +1 -0
  20. package/dist-esm/src/models/mappers.d.ts +37 -0
  21. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  22. package/{esm → dist-esm/src}/models/mappers.js +608 -394
  23. package/dist-esm/src/models/mappers.js.map +1 -0
  24. package/dist-esm/src/models/parameters.d.ts +20 -0
  25. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  26. package/dist-esm/src/models/parameters.js +163 -0
  27. package/dist-esm/src/models/parameters.js.map +1 -0
  28. package/dist-esm/src/operations/cloudManifestFile.d.ts +24 -0
  29. package/dist-esm/src/operations/cloudManifestFile.d.ts.map +1 -0
  30. package/dist-esm/src/operations/cloudManifestFile.js +70 -0
  31. package/dist-esm/src/operations/cloudManifestFile.js.map +1 -0
  32. package/dist-esm/src/operations/customerSubscriptions.d.ts +63 -0
  33. package/dist-esm/src/operations/customerSubscriptions.d.ts.map +1 -0
  34. package/dist-esm/src/operations/customerSubscriptions.js +241 -0
  35. package/dist-esm/src/operations/customerSubscriptions.js.map +1 -0
  36. package/{esm → dist-esm/src}/operations/index.d.ts +3 -1
  37. package/dist-esm/src/operations/index.d.ts.map +1 -0
  38. package/{esm → dist-esm/src}/operations/index.js +6 -6
  39. package/dist-esm/src/operations/index.js.map +1 -0
  40. package/dist-esm/src/operations/linkedSubscriptions.d.ts +83 -0
  41. package/dist-esm/src/operations/linkedSubscriptions.d.ts.map +1 -0
  42. package/dist-esm/src/operations/linkedSubscriptions.js +359 -0
  43. package/dist-esm/src/operations/linkedSubscriptions.js.map +1 -0
  44. package/dist-esm/src/operations/operations.d.ts +32 -0
  45. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  46. package/dist-esm/src/operations/operations.js +120 -0
  47. package/dist-esm/src/operations/operations.js.map +1 -0
  48. package/dist-esm/src/operations/products.d.ts +78 -0
  49. package/dist-esm/src/operations/products.d.ts.map +1 -0
  50. package/dist-esm/src/operations/products.js +303 -0
  51. package/dist-esm/src/operations/products.js.map +1 -0
  52. package/dist-esm/src/operations/registrations.d.ts +97 -0
  53. package/dist-esm/src/operations/registrations.d.ts.map +1 -0
  54. package/dist-esm/src/operations/registrations.js +416 -0
  55. package/dist-esm/src/operations/registrations.js.map +1 -0
  56. package/dist-esm/src/operationsInterfaces/cloudManifestFile.d.ts +16 -0
  57. package/dist-esm/src/operationsInterfaces/cloudManifestFile.d.ts.map +1 -0
  58. package/dist-esm/src/operationsInterfaces/cloudManifestFile.js +9 -0
  59. package/dist-esm/src/operationsInterfaces/cloudManifestFile.js.map +1 -0
  60. package/dist-esm/src/operationsInterfaces/customerSubscriptions.d.ts +38 -0
  61. package/dist-esm/src/operationsInterfaces/customerSubscriptions.d.ts.map +1 -0
  62. package/dist-esm/src/operationsInterfaces/customerSubscriptions.js +9 -0
  63. package/dist-esm/src/operationsInterfaces/customerSubscriptions.js.map +1 -0
  64. package/dist-esm/src/operationsInterfaces/index.d.ts +7 -0
  65. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  66. package/dist-esm/src/operationsInterfaces/index.js +14 -0
  67. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  68. package/dist-esm/src/operationsInterfaces/linkedSubscriptions.d.ts +47 -0
  69. package/dist-esm/src/operationsInterfaces/linkedSubscriptions.d.ts.map +1 -0
  70. package/dist-esm/src/operationsInterfaces/linkedSubscriptions.js +9 -0
  71. package/dist-esm/src/operationsInterfaces/linkedSubscriptions.js.map +1 -0
  72. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  73. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  74. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  75. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  76. package/dist-esm/src/operationsInterfaces/products.d.ts +53 -0
  77. package/dist-esm/src/operationsInterfaces/products.d.ts.map +1 -0
  78. package/dist-esm/src/operationsInterfaces/products.js +9 -0
  79. package/dist-esm/src/operationsInterfaces/products.js.map +1 -0
  80. package/dist-esm/src/operationsInterfaces/registrations.d.ts +61 -0
  81. package/dist-esm/src/operationsInterfaces/registrations.d.ts.map +1 -0
  82. package/dist-esm/src/operationsInterfaces/registrations.js +9 -0
  83. package/dist-esm/src/operationsInterfaces/registrations.js.map +1 -0
  84. package/dist-esm/test/sampleTest.d.ts +4 -0
  85. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  86. package/dist-esm/test/sampleTest.js +43 -0
  87. package/dist-esm/test/sampleTest.js.map +1 -0
  88. package/package.json +63 -32
  89. package/review/arm-azurestack.api.md +695 -0
  90. package/rollup.config.js +181 -30
  91. package/src/azureStackManagementClient.ts +88 -43
  92. package/src/index.ts +12 -0
  93. package/src/models/index.ts +725 -836
  94. package/src/models/mappers.ts +623 -384
  95. package/src/models/parameters.ts +130 -32
  96. package/src/operations/cloudManifestFile.ts +93 -0
  97. package/src/operations/customerSubscriptions.ts +191 -206
  98. package/src/operations/index.ts +6 -6
  99. package/src/operations/linkedSubscriptions.ts +450 -0
  100. package/src/operations/operations.ts +89 -75
  101. package/src/operations/products.ts +240 -299
  102. package/src/operations/registrations.ts +347 -266
  103. package/src/operationsInterfaces/cloudManifestFile.ts +34 -0
  104. package/src/operationsInterfaces/customerSubscriptions.ts +75 -0
  105. package/src/operationsInterfaces/index.ts +14 -0
  106. package/src/operationsInterfaces/linkedSubscriptions.ts +91 -0
  107. package/src/operationsInterfaces/operations.ts +22 -0
  108. package/src/operationsInterfaces/products.ts +104 -0
  109. package/src/operationsInterfaces/registrations.ts +116 -0
  110. package/tsconfig.json +3 -3
  111. package/types/arm-azurestack.d.ts +1206 -0
  112. package/types/tsdoc-metadata.json +11 -0
  113. package/dist/arm-azurestack.js +0 -2153
  114. package/dist/arm-azurestack.js.map +0 -1
  115. package/dist/arm-azurestack.min.js +0 -1
  116. package/dist/arm-azurestack.min.js.map +0 -1
  117. package/esm/azureStackManagementClient.d.ts +0 -28
  118. package/esm/azureStackManagementClient.d.ts.map +0 -1
  119. package/esm/azureStackManagementClient.js +0 -42
  120. package/esm/azureStackManagementClient.js.map +0 -1
  121. package/esm/azureStackManagementClientContext.d.ts +0 -23
  122. package/esm/azureStackManagementClientContext.d.ts.map +0 -1
  123. package/esm/azureStackManagementClientContext.js +0 -62
  124. package/esm/azureStackManagementClientContext.js.map +0 -1
  125. package/esm/models/customerSubscriptionsMappers.d.ts +0 -2
  126. package/esm/models/customerSubscriptionsMappers.d.ts.map +0 -1
  127. package/esm/models/customerSubscriptionsMappers.js +0 -9
  128. package/esm/models/customerSubscriptionsMappers.js.map +0 -1
  129. package/esm/models/index.d.ts +0 -1014
  130. package/esm/models/index.d.ts.map +0 -1
  131. package/esm/models/index.js +0 -8
  132. package/esm/models/index.js.map +0 -1
  133. package/esm/models/mappers.d.ts +0 -31
  134. package/esm/models/mappers.d.ts.map +0 -1
  135. package/esm/models/mappers.js.map +0 -1
  136. package/esm/models/operationsMappers.d.ts +0 -2
  137. package/esm/models/operationsMappers.d.ts.map +0 -1
  138. package/esm/models/operationsMappers.js +0 -9
  139. package/esm/models/operationsMappers.js.map +0 -1
  140. package/esm/models/parameters.d.ts +0 -10
  141. package/esm/models/parameters.d.ts.map +0 -1
  142. package/esm/models/parameters.js +0 -92
  143. package/esm/models/parameters.js.map +0 -1
  144. package/esm/models/productsMappers.d.ts +0 -2
  145. package/esm/models/productsMappers.d.ts.map +0 -1
  146. package/esm/models/productsMappers.js +0 -9
  147. package/esm/models/productsMappers.js.map +0 -1
  148. package/esm/models/registrationsMappers.d.ts +0 -2
  149. package/esm/models/registrationsMappers.d.ts.map +0 -1
  150. package/esm/models/registrationsMappers.js +0 -9
  151. package/esm/models/registrationsMappers.js.map +0 -1
  152. package/esm/operations/customerSubscriptions.d.ts +0 -127
  153. package/esm/operations/customerSubscriptions.d.ts.map +0 -1
  154. package/esm/operations/customerSubscriptions.js +0 -188
  155. package/esm/operations/customerSubscriptions.js.map +0 -1
  156. package/esm/operations/index.d.ts.map +0 -1
  157. package/esm/operations/index.js.map +0 -1
  158. package/esm/operations/operations.d.ts +0 -46
  159. package/esm/operations/operations.d.ts.map +0 -1
  160. package/esm/operations/operations.js +0 -77
  161. package/esm/operations/operations.js.map +0 -1
  162. package/esm/operations/products.d.ts +0 -169
  163. package/esm/operations/products.d.ts.map +0 -1
  164. package/esm/operations/products.js +0 -268
  165. package/esm/operations/products.js.map +0 -1
  166. package/esm/operations/registrations.d.ts +0 -160
  167. package/esm/operations/registrations.d.ts.map +0 -1
  168. package/esm/operations/registrations.js +0 -250
  169. package/esm/operations/registrations.js.map +0 -1
  170. package/src/azureStackManagementClientContext.ts +0 -69
  171. package/src/models/customerSubscriptionsMappers.ts +0 -24
  172. package/src/models/operationsMappers.ts +0 -14
  173. package/src/models/productsMappers.ts +0 -30
  174. package/src/models/registrationsMappers.ts +0 -26
@@ -0,0 +1,450 @@
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 { LinkedSubscriptions } from "../operationsInterfaces";
11
+ import * as coreClient from "@azure/core-client";
12
+ import * as Mappers from "../models/mappers";
13
+ import * as Parameters from "../models/parameters";
14
+ import { AzureStackManagementClient } from "../azureStackManagementClient";
15
+ import {
16
+ LinkedSubscription,
17
+ LinkedSubscriptionsListByResourceGroupNextOptionalParams,
18
+ LinkedSubscriptionsListByResourceGroupOptionalParams,
19
+ LinkedSubscriptionsListBySubscriptionNextOptionalParams,
20
+ LinkedSubscriptionsListBySubscriptionOptionalParams,
21
+ LinkedSubscriptionsListByResourceGroupResponse,
22
+ LinkedSubscriptionsListBySubscriptionResponse,
23
+ LinkedSubscriptionsGetOptionalParams,
24
+ LinkedSubscriptionsGetResponse,
25
+ LinkedSubscriptionsDeleteOptionalParams,
26
+ LinkedSubscriptionParameter,
27
+ LinkedSubscriptionsCreateOrUpdateOptionalParams,
28
+ LinkedSubscriptionsCreateOrUpdateResponse,
29
+ LinkedSubscriptionsUpdateOptionalParams,
30
+ LinkedSubscriptionsUpdateResponse,
31
+ LinkedSubscriptionsListByResourceGroupNextResponse,
32
+ LinkedSubscriptionsListBySubscriptionNextResponse
33
+ } from "../models";
34
+
35
+ /// <reference lib="esnext.asynciterable" />
36
+ /** Class containing LinkedSubscriptions operations. */
37
+ export class LinkedSubscriptionsImpl implements LinkedSubscriptions {
38
+ private readonly client: AzureStackManagementClient;
39
+
40
+ /**
41
+ * Initialize a new instance of the class LinkedSubscriptions class.
42
+ * @param client Reference to the service client
43
+ */
44
+ constructor(client: AzureStackManagementClient) {
45
+ this.client = client;
46
+ }
47
+
48
+ /**
49
+ * Returns a list of all linked subscriptions under current resource group.
50
+ * @param resourceGroup Name of the resource group.
51
+ * @param options The options parameters.
52
+ */
53
+ public listByResourceGroup(
54
+ resourceGroup: string,
55
+ options?: LinkedSubscriptionsListByResourceGroupOptionalParams
56
+ ): PagedAsyncIterableIterator<LinkedSubscription> {
57
+ const iter = this.listByResourceGroupPagingAll(resourceGroup, options);
58
+ return {
59
+ next() {
60
+ return iter.next();
61
+ },
62
+ [Symbol.asyncIterator]() {
63
+ return this;
64
+ },
65
+ byPage: () => {
66
+ return this.listByResourceGroupPagingPage(resourceGroup, options);
67
+ }
68
+ };
69
+ }
70
+
71
+ private async *listByResourceGroupPagingPage(
72
+ resourceGroup: string,
73
+ options?: LinkedSubscriptionsListByResourceGroupOptionalParams
74
+ ): AsyncIterableIterator<LinkedSubscription[]> {
75
+ let result = await this._listByResourceGroup(resourceGroup, options);
76
+ yield result.value || [];
77
+ let continuationToken = result.nextLink;
78
+ while (continuationToken) {
79
+ result = await this._listByResourceGroupNext(
80
+ resourceGroup,
81
+ continuationToken,
82
+ options
83
+ );
84
+ continuationToken = result.nextLink;
85
+ yield result.value || [];
86
+ }
87
+ }
88
+
89
+ private async *listByResourceGroupPagingAll(
90
+ resourceGroup: string,
91
+ options?: LinkedSubscriptionsListByResourceGroupOptionalParams
92
+ ): AsyncIterableIterator<LinkedSubscription> {
93
+ for await (const page of this.listByResourceGroupPagingPage(
94
+ resourceGroup,
95
+ options
96
+ )) {
97
+ yield* page;
98
+ }
99
+ }
100
+
101
+ /**
102
+ * Returns a list of all linked subscriptions under current subscription.
103
+ * @param options The options parameters.
104
+ */
105
+ public listBySubscription(
106
+ options?: LinkedSubscriptionsListBySubscriptionOptionalParams
107
+ ): PagedAsyncIterableIterator<LinkedSubscription> {
108
+ const iter = this.listBySubscriptionPagingAll(options);
109
+ return {
110
+ next() {
111
+ return iter.next();
112
+ },
113
+ [Symbol.asyncIterator]() {
114
+ return this;
115
+ },
116
+ byPage: () => {
117
+ return this.listBySubscriptionPagingPage(options);
118
+ }
119
+ };
120
+ }
121
+
122
+ private async *listBySubscriptionPagingPage(
123
+ options?: LinkedSubscriptionsListBySubscriptionOptionalParams
124
+ ): AsyncIterableIterator<LinkedSubscription[]> {
125
+ let result = await this._listBySubscription(options);
126
+ yield result.value || [];
127
+ let continuationToken = result.nextLink;
128
+ while (continuationToken) {
129
+ result = await this._listBySubscriptionNext(continuationToken, options);
130
+ continuationToken = result.nextLink;
131
+ yield result.value || [];
132
+ }
133
+ }
134
+
135
+ private async *listBySubscriptionPagingAll(
136
+ options?: LinkedSubscriptionsListBySubscriptionOptionalParams
137
+ ): AsyncIterableIterator<LinkedSubscription> {
138
+ for await (const page of this.listBySubscriptionPagingPage(options)) {
139
+ yield* page;
140
+ }
141
+ }
142
+
143
+ /**
144
+ * Returns a list of all linked subscriptions under current resource group.
145
+ * @param resourceGroup Name of the resource group.
146
+ * @param options The options parameters.
147
+ */
148
+ private _listByResourceGroup(
149
+ resourceGroup: string,
150
+ options?: LinkedSubscriptionsListByResourceGroupOptionalParams
151
+ ): Promise<LinkedSubscriptionsListByResourceGroupResponse> {
152
+ return this.client.sendOperationRequest(
153
+ { resourceGroup, options },
154
+ listByResourceGroupOperationSpec
155
+ );
156
+ }
157
+
158
+ /**
159
+ * Returns a list of all linked subscriptions under current subscription.
160
+ * @param options The options parameters.
161
+ */
162
+ private _listBySubscription(
163
+ options?: LinkedSubscriptionsListBySubscriptionOptionalParams
164
+ ): Promise<LinkedSubscriptionsListBySubscriptionResponse> {
165
+ return this.client.sendOperationRequest(
166
+ { options },
167
+ listBySubscriptionOperationSpec
168
+ );
169
+ }
170
+
171
+ /**
172
+ * Returns the properties of a Linked Subscription resource.
173
+ * @param resourceGroup Name of the resource group.
174
+ * @param linkedSubscriptionName Name of the Linked Subscription resource.
175
+ * @param options The options parameters.
176
+ */
177
+ get(
178
+ resourceGroup: string,
179
+ linkedSubscriptionName: string,
180
+ options?: LinkedSubscriptionsGetOptionalParams
181
+ ): Promise<LinkedSubscriptionsGetResponse> {
182
+ return this.client.sendOperationRequest(
183
+ { resourceGroup, linkedSubscriptionName, options },
184
+ getOperationSpec
185
+ );
186
+ }
187
+
188
+ /**
189
+ * Delete the requested Linked Subscription resource.
190
+ * @param resourceGroup Name of the resource group.
191
+ * @param linkedSubscriptionName Name of the Linked Subscription resource.
192
+ * @param options The options parameters.
193
+ */
194
+ delete(
195
+ resourceGroup: string,
196
+ linkedSubscriptionName: string,
197
+ options?: LinkedSubscriptionsDeleteOptionalParams
198
+ ): Promise<void> {
199
+ return this.client.sendOperationRequest(
200
+ { resourceGroup, linkedSubscriptionName, options },
201
+ deleteOperationSpec
202
+ );
203
+ }
204
+
205
+ /**
206
+ * Create or update a linked subscription resource.
207
+ * @param resourceGroup Name of the resource group.
208
+ * @param linkedSubscriptionName Name of the Linked Subscription resource.
209
+ * @param resource Linked subscription resource parameter.
210
+ * @param options The options parameters.
211
+ */
212
+ createOrUpdate(
213
+ resourceGroup: string,
214
+ linkedSubscriptionName: string,
215
+ resource: LinkedSubscriptionParameter,
216
+ options?: LinkedSubscriptionsCreateOrUpdateOptionalParams
217
+ ): Promise<LinkedSubscriptionsCreateOrUpdateResponse> {
218
+ return this.client.sendOperationRequest(
219
+ { resourceGroup, linkedSubscriptionName, resource, options },
220
+ createOrUpdateOperationSpec
221
+ );
222
+ }
223
+
224
+ /**
225
+ * Patch a Linked Subscription resource.
226
+ * @param resourceGroup Name of the resource group.
227
+ * @param linkedSubscriptionName Name of the Linked Subscription resource.
228
+ * @param resource Linked subscription resource parameter.
229
+ * @param options The options parameters.
230
+ */
231
+ update(
232
+ resourceGroup: string,
233
+ linkedSubscriptionName: string,
234
+ resource: LinkedSubscriptionParameter,
235
+ options?: LinkedSubscriptionsUpdateOptionalParams
236
+ ): Promise<LinkedSubscriptionsUpdateResponse> {
237
+ return this.client.sendOperationRequest(
238
+ { resourceGroup, linkedSubscriptionName, resource, options },
239
+ updateOperationSpec
240
+ );
241
+ }
242
+
243
+ /**
244
+ * ListByResourceGroupNext
245
+ * @param resourceGroup Name of the resource group.
246
+ * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method.
247
+ * @param options The options parameters.
248
+ */
249
+ private _listByResourceGroupNext(
250
+ resourceGroup: string,
251
+ nextLink: string,
252
+ options?: LinkedSubscriptionsListByResourceGroupNextOptionalParams
253
+ ): Promise<LinkedSubscriptionsListByResourceGroupNextResponse> {
254
+ return this.client.sendOperationRequest(
255
+ { resourceGroup, nextLink, options },
256
+ listByResourceGroupNextOperationSpec
257
+ );
258
+ }
259
+
260
+ /**
261
+ * ListBySubscriptionNext
262
+ * @param nextLink The nextLink from the previous successful call to the ListBySubscription method.
263
+ * @param options The options parameters.
264
+ */
265
+ private _listBySubscriptionNext(
266
+ nextLink: string,
267
+ options?: LinkedSubscriptionsListBySubscriptionNextOptionalParams
268
+ ): Promise<LinkedSubscriptionsListBySubscriptionNextResponse> {
269
+ return this.client.sendOperationRequest(
270
+ { nextLink, options },
271
+ listBySubscriptionNextOperationSpec
272
+ );
273
+ }
274
+ }
275
+ // Operation Specifications
276
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
277
+
278
+ const listByResourceGroupOperationSpec: coreClient.OperationSpec = {
279
+ path:
280
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/linkedSubscriptions",
281
+ httpMethod: "GET",
282
+ responses: {
283
+ 200: {
284
+ bodyMapper: Mappers.LinkedSubscriptionsList
285
+ },
286
+ default: {
287
+ bodyMapper: Mappers.ErrorResponse
288
+ }
289
+ },
290
+ queryParameters: [Parameters.apiVersion],
291
+ urlParameters: [
292
+ Parameters.$host,
293
+ Parameters.subscriptionId,
294
+ Parameters.resourceGroup
295
+ ],
296
+ headerParameters: [Parameters.accept],
297
+ serializer
298
+ };
299
+ const listBySubscriptionOperationSpec: coreClient.OperationSpec = {
300
+ path:
301
+ "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStack/linkedSubscriptions",
302
+ httpMethod: "GET",
303
+ responses: {
304
+ 200: {
305
+ bodyMapper: Mappers.LinkedSubscriptionsList
306
+ },
307
+ default: {
308
+ bodyMapper: Mappers.ErrorResponse
309
+ }
310
+ },
311
+ queryParameters: [Parameters.apiVersion],
312
+ urlParameters: [Parameters.$host, Parameters.subscriptionId],
313
+ headerParameters: [Parameters.accept],
314
+ serializer
315
+ };
316
+ const getOperationSpec: coreClient.OperationSpec = {
317
+ path:
318
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/linkedSubscriptions/{linkedSubscriptionName}",
319
+ httpMethod: "GET",
320
+ responses: {
321
+ 200: {
322
+ bodyMapper: Mappers.LinkedSubscription
323
+ },
324
+ default: {
325
+ bodyMapper: Mappers.ErrorResponse
326
+ }
327
+ },
328
+ queryParameters: [Parameters.apiVersion],
329
+ urlParameters: [
330
+ Parameters.$host,
331
+ Parameters.subscriptionId,
332
+ Parameters.resourceGroup,
333
+ Parameters.linkedSubscriptionName
334
+ ],
335
+ headerParameters: [Parameters.accept],
336
+ serializer
337
+ };
338
+ const deleteOperationSpec: coreClient.OperationSpec = {
339
+ path:
340
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/linkedSubscriptions/{linkedSubscriptionName}",
341
+ httpMethod: "DELETE",
342
+ responses: {
343
+ 200: {},
344
+ 204: {},
345
+ default: {
346
+ bodyMapper: Mappers.ErrorResponse
347
+ }
348
+ },
349
+ queryParameters: [Parameters.apiVersion],
350
+ urlParameters: [
351
+ Parameters.$host,
352
+ Parameters.subscriptionId,
353
+ Parameters.resourceGroup,
354
+ Parameters.linkedSubscriptionName
355
+ ],
356
+ headerParameters: [Parameters.accept],
357
+ serializer
358
+ };
359
+ const createOrUpdateOperationSpec: coreClient.OperationSpec = {
360
+ path:
361
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/linkedSubscriptions/{linkedSubscriptionName}",
362
+ httpMethod: "PUT",
363
+ responses: {
364
+ 200: {
365
+ bodyMapper: Mappers.LinkedSubscription
366
+ },
367
+ 201: {
368
+ bodyMapper: Mappers.LinkedSubscription
369
+ },
370
+ default: {
371
+ bodyMapper: Mappers.ErrorResponse
372
+ }
373
+ },
374
+ requestBody: Parameters.resource,
375
+ queryParameters: [Parameters.apiVersion],
376
+ urlParameters: [
377
+ Parameters.$host,
378
+ Parameters.subscriptionId,
379
+ Parameters.resourceGroup,
380
+ Parameters.linkedSubscriptionName
381
+ ],
382
+ headerParameters: [Parameters.accept, Parameters.contentType],
383
+ mediaType: "json",
384
+ serializer
385
+ };
386
+ const updateOperationSpec: coreClient.OperationSpec = {
387
+ path:
388
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/linkedSubscriptions/{linkedSubscriptionName}",
389
+ httpMethod: "PATCH",
390
+ responses: {
391
+ 200: {
392
+ bodyMapper: Mappers.LinkedSubscription
393
+ },
394
+ default: {
395
+ bodyMapper: Mappers.ErrorResponse
396
+ }
397
+ },
398
+ requestBody: Parameters.resource,
399
+ queryParameters: [Parameters.apiVersion],
400
+ urlParameters: [
401
+ Parameters.$host,
402
+ Parameters.subscriptionId,
403
+ Parameters.resourceGroup,
404
+ Parameters.linkedSubscriptionName
405
+ ],
406
+ headerParameters: [Parameters.accept, Parameters.contentType],
407
+ mediaType: "json",
408
+ serializer
409
+ };
410
+ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
411
+ path: "{nextLink}",
412
+ httpMethod: "GET",
413
+ responses: {
414
+ 200: {
415
+ bodyMapper: Mappers.LinkedSubscriptionsList
416
+ },
417
+ default: {
418
+ bodyMapper: Mappers.ErrorResponse
419
+ }
420
+ },
421
+ queryParameters: [Parameters.apiVersion],
422
+ urlParameters: [
423
+ Parameters.$host,
424
+ Parameters.nextLink,
425
+ Parameters.subscriptionId,
426
+ Parameters.resourceGroup
427
+ ],
428
+ headerParameters: [Parameters.accept],
429
+ serializer
430
+ };
431
+ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = {
432
+ path: "{nextLink}",
433
+ httpMethod: "GET",
434
+ responses: {
435
+ 200: {
436
+ bodyMapper: Mappers.LinkedSubscriptionsList
437
+ },
438
+ default: {
439
+ bodyMapper: Mappers.ErrorResponse
440
+ }
441
+ },
442
+ queryParameters: [Parameters.apiVersion],
443
+ urlParameters: [
444
+ Parameters.$host,
445
+ Parameters.nextLink,
446
+ Parameters.subscriptionId
447
+ ],
448
+ headerParameters: [Parameters.accept],
449
+ serializer
450
+ };
@@ -1,123 +1,137 @@
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 Models from "../models";
13
- import * as Mappers from "../models/operationsMappers";
9
+ import { PagedAsyncIterableIterator } from "@azure/core-paging";
10
+ import { Operations } from "../operationsInterfaces";
11
+ import * as coreClient from "@azure/core-client";
12
+ import * as Mappers from "../models/mappers";
14
13
  import * as Parameters from "../models/parameters";
15
- import { AzureStackManagementClientContext } from "../azureStackManagementClientContext";
14
+ import { AzureStackManagementClient } from "../azureStackManagementClient";
15
+ import {
16
+ Operation,
17
+ OperationsListNextOptionalParams,
18
+ OperationsListOptionalParams,
19
+ OperationsListResponse,
20
+ OperationsListNextResponse
21
+ } from "../models";
16
22
 
17
- /** Class representing a Operations. */
18
- export class Operations {
19
- private readonly client: AzureStackManagementClientContext;
23
+ /// <reference lib="esnext.asynciterable" />
24
+ /** Class containing Operations operations. */
25
+ export class OperationsImpl implements Operations {
26
+ private readonly client: AzureStackManagementClient;
20
27
 
21
28
  /**
22
- * Create a Operations.
23
- * @param {AzureStackManagementClientContext} client Reference to the service client.
29
+ * Initialize a new instance of the class Operations class.
30
+ * @param client Reference to the service client
24
31
  */
25
- constructor(client: AzureStackManagementClientContext) {
32
+ constructor(client: AzureStackManagementClient) {
26
33
  this.client = client;
27
34
  }
28
35
 
29
36
  /**
30
37
  * Returns the list of supported REST operations.
31
- * @param [options] The optional parameters
32
- * @returns Promise<Models.OperationsListResponse>
38
+ * @param options The options parameters.
33
39
  */
34
- list(options?: msRest.RequestOptionsBase): Promise<Models.OperationsListResponse>;
35
- /**
36
- * @param callback The callback
37
- */
38
- list(callback: msRest.ServiceCallback<Models.OperationList>): void;
39
- /**
40
- * @param options The optional parameters
41
- * @param callback The callback
42
- */
43
- list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.OperationList>): void;
44
- list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.OperationList>, callback?: msRest.ServiceCallback<Models.OperationList>): Promise<Models.OperationsListResponse> {
45
- return this.client.sendOperationRequest(
46
- {
47
- options
40
+ public list(
41
+ options?: OperationsListOptionalParams
42
+ ): PagedAsyncIterableIterator<Operation> {
43
+ const iter = this.listPagingAll(options);
44
+ return {
45
+ next() {
46
+ return iter.next();
47
+ },
48
+ [Symbol.asyncIterator]() {
49
+ return this;
48
50
  },
49
- listOperationSpec,
50
- callback) as Promise<Models.OperationsListResponse>;
51
+ byPage: () => {
52
+ return this.listPagingPage(options);
53
+ }
54
+ };
55
+ }
56
+
57
+ private async *listPagingPage(
58
+ options?: OperationsListOptionalParams
59
+ ): AsyncIterableIterator<Operation[]> {
60
+ let result = await this._list(options);
61
+ yield result.value || [];
62
+ let continuationToken = result.nextLink;
63
+ while (continuationToken) {
64
+ result = await this._listNext(continuationToken, options);
65
+ continuationToken = result.nextLink;
66
+ yield result.value || [];
67
+ }
68
+ }
69
+
70
+ private async *listPagingAll(
71
+ options?: OperationsListOptionalParams
72
+ ): AsyncIterableIterator<Operation> {
73
+ for await (const page of this.listPagingPage(options)) {
74
+ yield* page;
75
+ }
51
76
  }
52
77
 
53
78
  /**
54
79
  * Returns the list of supported REST operations.
55
- * @param nextPageLink The NextLink from the previous successful call to List operation.
56
- * @param [options] The optional parameters
57
- * @returns Promise<Models.OperationsListNextResponse>
58
- */
59
- listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.OperationsListNextResponse>;
60
- /**
61
- * @param nextPageLink The NextLink from the previous successful call to List operation.
62
- * @param callback The callback
80
+ * @param options The options parameters.
63
81
  */
64
- listNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.OperationList>): void;
82
+ private _list(
83
+ options?: OperationsListOptionalParams
84
+ ): Promise<OperationsListResponse> {
85
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
86
+ }
87
+
65
88
  /**
66
- * @param nextPageLink The NextLink from the previous successful call to List operation.
67
- * @param options The optional parameters
68
- * @param callback The callback
89
+ * ListNext
90
+ * @param nextLink The nextLink from the previous successful call to the List method.
91
+ * @param options The options parameters.
69
92
  */
70
- listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.OperationList>): void;
71
- listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.OperationList>, callback?: msRest.ServiceCallback<Models.OperationList>): Promise<Models.OperationsListNextResponse> {
93
+ private _listNext(
94
+ nextLink: string,
95
+ options?: OperationsListNextOptionalParams
96
+ ): Promise<OperationsListNextResponse> {
72
97
  return this.client.sendOperationRequest(
73
- {
74
- nextPageLink,
75
- options
76
- },
77
- listNextOperationSpec,
78
- callback) as Promise<Models.OperationsListNextResponse>;
98
+ { nextLink, options },
99
+ listNextOperationSpec
100
+ );
79
101
  }
80
102
  }
81
-
82
103
  // Operation Specifications
83
- const serializer = new msRest.Serializer(Mappers);
84
- const listOperationSpec: msRest.OperationSpec = {
104
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
105
+
106
+ const listOperationSpec: coreClient.OperationSpec = {
107
+ path: "/providers/Microsoft.AzureStack/operations",
85
108
  httpMethod: "GET",
86
- path: "providers/Microsoft.AzureStack/operations",
87
- queryParameters: [
88
- Parameters.apiVersion
89
- ],
90
- headerParameters: [
91
- Parameters.acceptLanguage
92
- ],
93
109
  responses: {
94
110
  200: {
95
111
  bodyMapper: Mappers.OperationList
96
112
  },
97
113
  default: {
98
- bodyMapper: Mappers.CloudError
114
+ bodyMapper: Mappers.ErrorResponse
99
115
  }
100
116
  },
117
+ queryParameters: [Parameters.apiVersion],
118
+ urlParameters: [Parameters.$host],
119
+ headerParameters: [Parameters.accept],
101
120
  serializer
102
121
  };
103
-
104
- const listNextOperationSpec: msRest.OperationSpec = {
105
- httpMethod: "GET",
106
- baseUrl: "https://management.azure.com",
122
+ const listNextOperationSpec: coreClient.OperationSpec = {
107
123
  path: "{nextLink}",
108
- urlParameters: [
109
- Parameters.nextPageLink
110
- ],
111
- headerParameters: [
112
- Parameters.acceptLanguage
113
- ],
124
+ httpMethod: "GET",
114
125
  responses: {
115
126
  200: {
116
127
  bodyMapper: Mappers.OperationList
117
128
  },
118
129
  default: {
119
- bodyMapper: Mappers.CloudError
130
+ bodyMapper: Mappers.ErrorResponse
120
131
  }
121
132
  },
133
+ queryParameters: [Parameters.apiVersion],
134
+ urlParameters: [Parameters.$host, Parameters.nextLink],
135
+ headerParameters: [Parameters.accept],
122
136
  serializer
123
137
  };