@azure/arm-maps 1.1.0 → 3.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 (127) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE +21 -0
  3. package/LICENSE.txt +1 -1
  4. package/README.md +75 -77
  5. package/dist/index.js +1892 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/index.min.js +1 -0
  8. package/dist/index.min.js.map +1 -0
  9. package/dist-esm/src/azureMapsManagementClient.d.ts +20 -0
  10. package/dist-esm/src/azureMapsManagementClient.d.ts.map +1 -0
  11. package/dist-esm/src/azureMapsManagementClient.js +53 -0
  12. package/dist-esm/src/azureMapsManagementClient.js.map +1 -0
  13. package/dist-esm/src/index.d.ts +5 -0
  14. package/dist-esm/src/index.d.ts.map +1 -0
  15. package/dist-esm/src/index.js +12 -0
  16. package/dist-esm/src/index.js.map +1 -0
  17. package/dist-esm/src/models/index.d.ts +480 -0
  18. package/dist-esm/src/models/index.d.ts.map +1 -0
  19. package/dist-esm/src/models/index.js +35 -0
  20. package/dist-esm/src/models/index.js.map +1 -0
  21. package/dist-esm/src/models/mappers.d.ts +25 -0
  22. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  23. package/dist-esm/src/models/mappers.js +732 -0
  24. package/dist-esm/src/models/mappers.js.map +1 -0
  25. package/dist-esm/src/models/parameters.d.ts +16 -0
  26. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  27. package/dist-esm/src/models/parameters.js +131 -0
  28. package/dist-esm/src/models/parameters.js.map +1 -0
  29. package/dist-esm/src/operations/accounts.d.ts +103 -0
  30. package/dist-esm/src/operations/accounts.d.ts.map +1 -0
  31. package/dist-esm/src/operations/accounts.js +427 -0
  32. package/dist-esm/src/operations/accounts.js.map +1 -0
  33. package/dist-esm/src/operations/creators.d.ts +74 -0
  34. package/dist-esm/src/operations/creators.d.ts.map +1 -0
  35. package/dist-esm/src/operations/creators.js +281 -0
  36. package/dist-esm/src/operations/creators.js.map +1 -0
  37. package/dist-esm/src/operations/index.d.ts +4 -0
  38. package/dist-esm/src/operations/index.d.ts.map +1 -0
  39. package/dist-esm/src/operations/index.js +11 -0
  40. package/dist-esm/src/operations/index.js.map +1 -0
  41. package/dist-esm/src/operations/maps.d.ts +51 -0
  42. package/dist-esm/src/operations/maps.d.ts.map +1 -0
  43. package/dist-esm/src/operations/maps.js +220 -0
  44. package/dist-esm/src/operations/maps.js.map +1 -0
  45. package/dist-esm/src/operationsInterfaces/accounts.d.ts +67 -0
  46. package/dist-esm/src/operationsInterfaces/accounts.d.ts.map +1 -0
  47. package/dist-esm/src/operationsInterfaces/accounts.js +9 -0
  48. package/dist-esm/src/operationsInterfaces/accounts.js.map +1 -0
  49. package/dist-esm/src/operationsInterfaces/creators.d.ts +49 -0
  50. package/dist-esm/src/operationsInterfaces/creators.d.ts.map +1 -0
  51. package/dist-esm/src/operationsInterfaces/creators.js +9 -0
  52. package/dist-esm/src/operationsInterfaces/creators.js.map +1 -0
  53. package/dist-esm/src/operationsInterfaces/index.d.ts +4 -0
  54. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  55. package/dist-esm/src/operationsInterfaces/index.js +11 -0
  56. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  57. package/dist-esm/src/operationsInterfaces/maps.d.ts +16 -0
  58. package/dist-esm/src/operationsInterfaces/maps.d.ts.map +1 -0
  59. package/dist-esm/src/operationsInterfaces/maps.js +9 -0
  60. package/dist-esm/src/operationsInterfaces/maps.js.map +1 -0
  61. package/dist-esm/test/sampleTest.d.ts +2 -0
  62. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  63. package/dist-esm/test/sampleTest.js +40 -0
  64. package/dist-esm/test/sampleTest.js.map +1 -0
  65. package/package.json +73 -34
  66. package/review/arm-maps.api.md +423 -0
  67. package/rollup.config.js +184 -27
  68. package/src/azureMapsManagementClient.ts +79 -0
  69. package/src/index.ts +12 -0
  70. package/src/models/index.ts +552 -0
  71. package/src/models/mappers.ts +769 -0
  72. package/src/models/parameters.ts +156 -0
  73. package/src/operations/accounts.ts +541 -0
  74. package/src/operations/creators.ts +383 -0
  75. package/src/operations/index.ts +11 -0
  76. package/src/operations/maps.ts +256 -0
  77. package/src/operationsInterfaces/accounts.ts +125 -0
  78. package/src/operationsInterfaces/creators.ts +95 -0
  79. package/src/operationsInterfaces/index.ts +11 -0
  80. package/src/operationsInterfaces/maps.ts +33 -0
  81. package/tsconfig.json +4 -4
  82. package/types/arm-maps.d.ts +696 -0
  83. package/types/tsdoc-metadata.json +11 -0
  84. package/dist/arm-maps.js +0 -1035
  85. package/dist/arm-maps.js.map +0 -1
  86. package/dist/arm-maps.min.js +0 -1
  87. package/dist/arm-maps.min.js.map +0 -1
  88. package/esm/mapsManagementClient.d.ts +0 -19
  89. package/esm/mapsManagementClient.d.ts.map +0 -1
  90. package/esm/mapsManagementClient.js +0 -34
  91. package/esm/mapsManagementClient.js.map +0 -1
  92. package/esm/mapsManagementClientContext.d.ts +0 -17
  93. package/esm/mapsManagementClientContext.d.ts.map +0 -1
  94. package/esm/mapsManagementClientContext.js +0 -57
  95. package/esm/mapsManagementClientContext.js.map +0 -1
  96. package/esm/models/accountsMappers.d.ts +0 -2
  97. package/esm/models/accountsMappers.d.ts.map +0 -1
  98. package/esm/models/accountsMappers.js +0 -11
  99. package/esm/models/accountsMappers.js.map +0 -1
  100. package/esm/models/index.d.ts +0 -491
  101. package/esm/models/index.d.ts.map +0 -1
  102. package/esm/models/index.js +0 -10
  103. package/esm/models/index.js.map +0 -1
  104. package/esm/models/mappers.d.ts +0 -18
  105. package/esm/models/mappers.d.ts.map +0 -1
  106. package/esm/models/mappers.js +0 -419
  107. package/esm/models/mappers.js.map +0 -1
  108. package/esm/models/parameters.d.ts +0 -7
  109. package/esm/models/parameters.d.ts.map +0 -1
  110. package/esm/models/parameters.js +0 -60
  111. package/esm/models/parameters.js.map +0 -1
  112. package/esm/operations/accounts.d.ts +0 -222
  113. package/esm/operations/accounts.d.ts.map +0 -1
  114. package/esm/operations/accounts.js +0 -347
  115. package/esm/operations/accounts.js.map +0 -1
  116. package/esm/operations/index.d.ts +0 -2
  117. package/esm/operations/index.d.ts.map +0 -1
  118. package/esm/operations/index.js +0 -11
  119. package/esm/operations/index.js.map +0 -1
  120. package/lib/mapsManagementClient.ts +0 -43
  121. package/lib/mapsManagementClientContext.ts +0 -63
  122. package/lib/models/accountsMappers.ts +0 -28
  123. package/lib/models/index.ts +0 -521
  124. package/lib/models/mappers.ts +0 -439
  125. package/lib/models/parameters.ts +0 -62
  126. package/lib/operations/accounts.ts +0 -620
  127. package/lib/operations/index.ts +0 -11
@@ -0,0 +1,383 @@
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 { Creators } 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 { AzureMapsManagementClient } from "../azureMapsManagementClient";
15
+ import {
16
+ Creator,
17
+ CreatorsListByAccountNextOptionalParams,
18
+ CreatorsListByAccountOptionalParams,
19
+ CreatorsListByAccountResponse,
20
+ CreatorsCreateOrUpdateOptionalParams,
21
+ CreatorsCreateOrUpdateResponse,
22
+ CreatorUpdateParameters,
23
+ CreatorsUpdateOptionalParams,
24
+ CreatorsUpdateResponse,
25
+ CreatorsDeleteOptionalParams,
26
+ CreatorsGetOptionalParams,
27
+ CreatorsGetResponse,
28
+ CreatorsListByAccountNextResponse
29
+ } from "../models";
30
+
31
+ /// <reference lib="esnext.asynciterable" />
32
+ /** Class containing Creators operations. */
33
+ export class CreatorsImpl implements Creators {
34
+ private readonly client: AzureMapsManagementClient;
35
+
36
+ /**
37
+ * Initialize a new instance of the class Creators class.
38
+ * @param client Reference to the service client
39
+ */
40
+ constructor(client: AzureMapsManagementClient) {
41
+ this.client = client;
42
+ }
43
+
44
+ /**
45
+ * Get all Creator instances for an Azure Maps Account
46
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
47
+ * @param accountName The name of the Maps Account.
48
+ * @param options The options parameters.
49
+ */
50
+ public listByAccount(
51
+ resourceGroupName: string,
52
+ accountName: string,
53
+ options?: CreatorsListByAccountOptionalParams
54
+ ): PagedAsyncIterableIterator<Creator> {
55
+ const iter = this.listByAccountPagingAll(
56
+ resourceGroupName,
57
+ accountName,
58
+ options
59
+ );
60
+ return {
61
+ next() {
62
+ return iter.next();
63
+ },
64
+ [Symbol.asyncIterator]() {
65
+ return this;
66
+ },
67
+ byPage: () => {
68
+ return this.listByAccountPagingPage(
69
+ resourceGroupName,
70
+ accountName,
71
+ options
72
+ );
73
+ }
74
+ };
75
+ }
76
+
77
+ private async *listByAccountPagingPage(
78
+ resourceGroupName: string,
79
+ accountName: string,
80
+ options?: CreatorsListByAccountOptionalParams
81
+ ): AsyncIterableIterator<Creator[]> {
82
+ let result = await this._listByAccount(
83
+ resourceGroupName,
84
+ accountName,
85
+ options
86
+ );
87
+ yield result.value || [];
88
+ let continuationToken = result.nextLink;
89
+ while (continuationToken) {
90
+ result = await this._listByAccountNext(
91
+ resourceGroupName,
92
+ accountName,
93
+ continuationToken,
94
+ options
95
+ );
96
+ continuationToken = result.nextLink;
97
+ yield result.value || [];
98
+ }
99
+ }
100
+
101
+ private async *listByAccountPagingAll(
102
+ resourceGroupName: string,
103
+ accountName: string,
104
+ options?: CreatorsListByAccountOptionalParams
105
+ ): AsyncIterableIterator<Creator> {
106
+ for await (const page of this.listByAccountPagingPage(
107
+ resourceGroupName,
108
+ accountName,
109
+ options
110
+ )) {
111
+ yield* page;
112
+ }
113
+ }
114
+
115
+ /**
116
+ * Get all Creator instances for an Azure Maps Account
117
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
118
+ * @param accountName The name of the Maps Account.
119
+ * @param options The options parameters.
120
+ */
121
+ private _listByAccount(
122
+ resourceGroupName: string,
123
+ accountName: string,
124
+ options?: CreatorsListByAccountOptionalParams
125
+ ): Promise<CreatorsListByAccountResponse> {
126
+ return this.client.sendOperationRequest(
127
+ { resourceGroupName, accountName, options },
128
+ listByAccountOperationSpec
129
+ );
130
+ }
131
+
132
+ /**
133
+ * Create or update a Maps Creator resource. Creator resource will manage Azure resources required to
134
+ * populate a custom set of mapping data. It requires an account to exist before it can be created.
135
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
136
+ * @param accountName The name of the Maps Account.
137
+ * @param creatorName The name of the Maps Creator instance.
138
+ * @param creatorResource The new or updated parameters for the Creator resource.
139
+ * @param options The options parameters.
140
+ */
141
+ createOrUpdate(
142
+ resourceGroupName: string,
143
+ accountName: string,
144
+ creatorName: string,
145
+ creatorResource: Creator,
146
+ options?: CreatorsCreateOrUpdateOptionalParams
147
+ ): Promise<CreatorsCreateOrUpdateResponse> {
148
+ return this.client.sendOperationRequest(
149
+ { resourceGroupName, accountName, creatorName, creatorResource, options },
150
+ createOrUpdateOperationSpec
151
+ );
152
+ }
153
+
154
+ /**
155
+ * Updates the Maps Creator resource. Only a subset of the parameters may be updated after creation,
156
+ * such as Tags.
157
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
158
+ * @param accountName The name of the Maps Account.
159
+ * @param creatorName The name of the Maps Creator instance.
160
+ * @param creatorUpdateParameters The update parameters for Maps Creator.
161
+ * @param options The options parameters.
162
+ */
163
+ update(
164
+ resourceGroupName: string,
165
+ accountName: string,
166
+ creatorName: string,
167
+ creatorUpdateParameters: CreatorUpdateParameters,
168
+ options?: CreatorsUpdateOptionalParams
169
+ ): Promise<CreatorsUpdateResponse> {
170
+ return this.client.sendOperationRequest(
171
+ {
172
+ resourceGroupName,
173
+ accountName,
174
+ creatorName,
175
+ creatorUpdateParameters,
176
+ options
177
+ },
178
+ updateOperationSpec
179
+ );
180
+ }
181
+
182
+ /**
183
+ * Delete a Maps Creator resource.
184
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
185
+ * @param accountName The name of the Maps Account.
186
+ * @param creatorName The name of the Maps Creator instance.
187
+ * @param options The options parameters.
188
+ */
189
+ delete(
190
+ resourceGroupName: string,
191
+ accountName: string,
192
+ creatorName: string,
193
+ options?: CreatorsDeleteOptionalParams
194
+ ): Promise<void> {
195
+ return this.client.sendOperationRequest(
196
+ { resourceGroupName, accountName, creatorName, options },
197
+ deleteOperationSpec
198
+ );
199
+ }
200
+
201
+ /**
202
+ * Get a Maps Creator resource.
203
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
204
+ * @param accountName The name of the Maps Account.
205
+ * @param creatorName The name of the Maps Creator instance.
206
+ * @param options The options parameters.
207
+ */
208
+ get(
209
+ resourceGroupName: string,
210
+ accountName: string,
211
+ creatorName: string,
212
+ options?: CreatorsGetOptionalParams
213
+ ): Promise<CreatorsGetResponse> {
214
+ return this.client.sendOperationRequest(
215
+ { resourceGroupName, accountName, creatorName, options },
216
+ getOperationSpec
217
+ );
218
+ }
219
+
220
+ /**
221
+ * ListByAccountNext
222
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
223
+ * @param accountName The name of the Maps Account.
224
+ * @param nextLink The nextLink from the previous successful call to the ListByAccount method.
225
+ * @param options The options parameters.
226
+ */
227
+ private _listByAccountNext(
228
+ resourceGroupName: string,
229
+ accountName: string,
230
+ nextLink: string,
231
+ options?: CreatorsListByAccountNextOptionalParams
232
+ ): Promise<CreatorsListByAccountNextResponse> {
233
+ return this.client.sendOperationRequest(
234
+ { resourceGroupName, accountName, nextLink, options },
235
+ listByAccountNextOperationSpec
236
+ );
237
+ }
238
+ }
239
+ // Operation Specifications
240
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
241
+
242
+ const listByAccountOperationSpec: coreClient.OperationSpec = {
243
+ path:
244
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/creators",
245
+ httpMethod: "GET",
246
+ responses: {
247
+ 200: {
248
+ bodyMapper: Mappers.CreatorList
249
+ },
250
+ default: {
251
+ bodyMapper: Mappers.ErrorResponse
252
+ }
253
+ },
254
+ queryParameters: [Parameters.apiVersion],
255
+ urlParameters: [
256
+ Parameters.$host,
257
+ Parameters.subscriptionId,
258
+ Parameters.resourceGroupName,
259
+ Parameters.accountName
260
+ ],
261
+ headerParameters: [Parameters.accept],
262
+ serializer
263
+ };
264
+ const createOrUpdateOperationSpec: coreClient.OperationSpec = {
265
+ path:
266
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/creators/{creatorName}",
267
+ httpMethod: "PUT",
268
+ responses: {
269
+ 200: {
270
+ bodyMapper: Mappers.Creator
271
+ },
272
+ 201: {
273
+ bodyMapper: Mappers.Creator
274
+ },
275
+ default: {
276
+ bodyMapper: Mappers.ErrorResponse
277
+ }
278
+ },
279
+ requestBody: Parameters.creatorResource,
280
+ queryParameters: [Parameters.apiVersion],
281
+ urlParameters: [
282
+ Parameters.$host,
283
+ Parameters.subscriptionId,
284
+ Parameters.resourceGroupName,
285
+ Parameters.accountName,
286
+ Parameters.creatorName
287
+ ],
288
+ headerParameters: [Parameters.contentType, Parameters.accept],
289
+ mediaType: "json",
290
+ serializer
291
+ };
292
+ const updateOperationSpec: coreClient.OperationSpec = {
293
+ path:
294
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/creators/{creatorName}",
295
+ httpMethod: "PATCH",
296
+ responses: {
297
+ 200: {
298
+ bodyMapper: Mappers.Creator
299
+ },
300
+ default: {
301
+ bodyMapper: Mappers.ErrorResponse
302
+ }
303
+ },
304
+ requestBody: Parameters.creatorUpdateParameters,
305
+ queryParameters: [Parameters.apiVersion],
306
+ urlParameters: [
307
+ Parameters.$host,
308
+ Parameters.subscriptionId,
309
+ Parameters.resourceGroupName,
310
+ Parameters.accountName,
311
+ Parameters.creatorName
312
+ ],
313
+ headerParameters: [Parameters.contentType, Parameters.accept],
314
+ mediaType: "json",
315
+ serializer
316
+ };
317
+ const deleteOperationSpec: coreClient.OperationSpec = {
318
+ path:
319
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/creators/{creatorName}",
320
+ httpMethod: "DELETE",
321
+ responses: {
322
+ 200: {},
323
+ 204: {},
324
+ default: {
325
+ bodyMapper: Mappers.ErrorResponse
326
+ }
327
+ },
328
+ queryParameters: [Parameters.apiVersion],
329
+ urlParameters: [
330
+ Parameters.$host,
331
+ Parameters.subscriptionId,
332
+ Parameters.resourceGroupName,
333
+ Parameters.accountName,
334
+ Parameters.creatorName
335
+ ],
336
+ headerParameters: [Parameters.accept],
337
+ serializer
338
+ };
339
+ const getOperationSpec: coreClient.OperationSpec = {
340
+ path:
341
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/creators/{creatorName}",
342
+ httpMethod: "GET",
343
+ responses: {
344
+ 200: {
345
+ bodyMapper: Mappers.Creator
346
+ },
347
+ default: {
348
+ bodyMapper: Mappers.ErrorResponse
349
+ }
350
+ },
351
+ queryParameters: [Parameters.apiVersion],
352
+ urlParameters: [
353
+ Parameters.$host,
354
+ Parameters.subscriptionId,
355
+ Parameters.resourceGroupName,
356
+ Parameters.accountName,
357
+ Parameters.creatorName
358
+ ],
359
+ headerParameters: [Parameters.accept],
360
+ serializer
361
+ };
362
+ const listByAccountNextOperationSpec: coreClient.OperationSpec = {
363
+ path: "{nextLink}",
364
+ httpMethod: "GET",
365
+ responses: {
366
+ 200: {
367
+ bodyMapper: Mappers.CreatorList
368
+ },
369
+ default: {
370
+ bodyMapper: Mappers.ErrorResponse
371
+ }
372
+ },
373
+ queryParameters: [Parameters.apiVersion],
374
+ urlParameters: [
375
+ Parameters.$host,
376
+ Parameters.subscriptionId,
377
+ Parameters.resourceGroupName,
378
+ Parameters.accountName,
379
+ Parameters.nextLink
380
+ ],
381
+ headerParameters: [Parameters.accept],
382
+ serializer
383
+ };
@@ -0,0 +1,11 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ export * from "./accounts";
10
+ export * from "./maps";
11
+ export * from "./creators";
@@ -0,0 +1,256 @@
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 { Maps } 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 { AzureMapsManagementClient } from "../azureMapsManagementClient";
15
+ import {
16
+ OperationDetail,
17
+ MapsListOperationsNextOptionalParams,
18
+ MapsListOperationsOptionalParams,
19
+ MapsListSubscriptionOperationsNextOptionalParams,
20
+ MapsListSubscriptionOperationsOptionalParams,
21
+ MapsListOperationsResponse,
22
+ MapsListSubscriptionOperationsResponse,
23
+ MapsListOperationsNextResponse,
24
+ MapsListSubscriptionOperationsNextResponse
25
+ } from "../models";
26
+
27
+ /// <reference lib="esnext.asynciterable" />
28
+ /** Class containing Maps operations. */
29
+ export class MapsImpl implements Maps {
30
+ private readonly client: AzureMapsManagementClient;
31
+
32
+ /**
33
+ * Initialize a new instance of the class Maps class.
34
+ * @param client Reference to the service client
35
+ */
36
+ constructor(client: AzureMapsManagementClient) {
37
+ this.client = client;
38
+ }
39
+
40
+ /**
41
+ * List operations available for the Maps Resource Provider
42
+ * @param options The options parameters.
43
+ */
44
+ public listOperations(
45
+ options?: MapsListOperationsOptionalParams
46
+ ): PagedAsyncIterableIterator<OperationDetail> {
47
+ const iter = this.listOperationsPagingAll(options);
48
+ return {
49
+ next() {
50
+ return iter.next();
51
+ },
52
+ [Symbol.asyncIterator]() {
53
+ return this;
54
+ },
55
+ byPage: () => {
56
+ return this.listOperationsPagingPage(options);
57
+ }
58
+ };
59
+ }
60
+
61
+ private async *listOperationsPagingPage(
62
+ options?: MapsListOperationsOptionalParams
63
+ ): AsyncIterableIterator<OperationDetail[]> {
64
+ let result = await this._listOperations(options);
65
+ yield result.value || [];
66
+ let continuationToken = result.nextLink;
67
+ while (continuationToken) {
68
+ result = await this._listOperationsNext(continuationToken, options);
69
+ continuationToken = result.nextLink;
70
+ yield result.value || [];
71
+ }
72
+ }
73
+
74
+ private async *listOperationsPagingAll(
75
+ options?: MapsListOperationsOptionalParams
76
+ ): AsyncIterableIterator<OperationDetail> {
77
+ for await (const page of this.listOperationsPagingPage(options)) {
78
+ yield* page;
79
+ }
80
+ }
81
+
82
+ /**
83
+ * List operations available for the Maps Resource Provider
84
+ * @param options The options parameters.
85
+ */
86
+ public listSubscriptionOperations(
87
+ options?: MapsListSubscriptionOperationsOptionalParams
88
+ ): PagedAsyncIterableIterator<OperationDetail> {
89
+ const iter = this.listSubscriptionOperationsPagingAll(options);
90
+ return {
91
+ next() {
92
+ return iter.next();
93
+ },
94
+ [Symbol.asyncIterator]() {
95
+ return this;
96
+ },
97
+ byPage: () => {
98
+ return this.listSubscriptionOperationsPagingPage(options);
99
+ }
100
+ };
101
+ }
102
+
103
+ private async *listSubscriptionOperationsPagingPage(
104
+ options?: MapsListSubscriptionOperationsOptionalParams
105
+ ): AsyncIterableIterator<OperationDetail[]> {
106
+ let result = await this._listSubscriptionOperations(options);
107
+ yield result.value || [];
108
+ let continuationToken = result.nextLink;
109
+ while (continuationToken) {
110
+ result = await this._listSubscriptionOperationsNext(
111
+ continuationToken,
112
+ options
113
+ );
114
+ continuationToken = result.nextLink;
115
+ yield result.value || [];
116
+ }
117
+ }
118
+
119
+ private async *listSubscriptionOperationsPagingAll(
120
+ options?: MapsListSubscriptionOperationsOptionalParams
121
+ ): AsyncIterableIterator<OperationDetail> {
122
+ for await (const page of this.listSubscriptionOperationsPagingPage(
123
+ options
124
+ )) {
125
+ yield* page;
126
+ }
127
+ }
128
+
129
+ /**
130
+ * List operations available for the Maps Resource Provider
131
+ * @param options The options parameters.
132
+ */
133
+ private _listOperations(
134
+ options?: MapsListOperationsOptionalParams
135
+ ): Promise<MapsListOperationsResponse> {
136
+ return this.client.sendOperationRequest(
137
+ { options },
138
+ listOperationsOperationSpec
139
+ );
140
+ }
141
+
142
+ /**
143
+ * List operations available for the Maps Resource Provider
144
+ * @param options The options parameters.
145
+ */
146
+ private _listSubscriptionOperations(
147
+ options?: MapsListSubscriptionOperationsOptionalParams
148
+ ): Promise<MapsListSubscriptionOperationsResponse> {
149
+ return this.client.sendOperationRequest(
150
+ { options },
151
+ listSubscriptionOperationsOperationSpec
152
+ );
153
+ }
154
+
155
+ /**
156
+ * ListOperationsNext
157
+ * @param nextLink The nextLink from the previous successful call to the ListOperations method.
158
+ * @param options The options parameters.
159
+ */
160
+ private _listOperationsNext(
161
+ nextLink: string,
162
+ options?: MapsListOperationsNextOptionalParams
163
+ ): Promise<MapsListOperationsNextResponse> {
164
+ return this.client.sendOperationRequest(
165
+ { nextLink, options },
166
+ listOperationsNextOperationSpec
167
+ );
168
+ }
169
+
170
+ /**
171
+ * ListSubscriptionOperationsNext
172
+ * @param nextLink The nextLink from the previous successful call to the ListSubscriptionOperations
173
+ * method.
174
+ * @param options The options parameters.
175
+ */
176
+ private _listSubscriptionOperationsNext(
177
+ nextLink: string,
178
+ options?: MapsListSubscriptionOperationsNextOptionalParams
179
+ ): Promise<MapsListSubscriptionOperationsNextResponse> {
180
+ return this.client.sendOperationRequest(
181
+ { nextLink, options },
182
+ listSubscriptionOperationsNextOperationSpec
183
+ );
184
+ }
185
+ }
186
+ // Operation Specifications
187
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
188
+
189
+ const listOperationsOperationSpec: coreClient.OperationSpec = {
190
+ path: "/providers/Microsoft.Maps/operations",
191
+ httpMethod: "GET",
192
+ responses: {
193
+ 200: {
194
+ bodyMapper: Mappers.MapsOperations
195
+ },
196
+ default: {
197
+ bodyMapper: Mappers.ErrorResponse
198
+ }
199
+ },
200
+ queryParameters: [Parameters.apiVersion],
201
+ urlParameters: [Parameters.$host],
202
+ headerParameters: [Parameters.accept],
203
+ serializer
204
+ };
205
+ const listSubscriptionOperationsOperationSpec: coreClient.OperationSpec = {
206
+ path: "/subscriptions/{subscriptionId}/providers/Microsoft.Maps/operations",
207
+ httpMethod: "GET",
208
+ responses: {
209
+ 200: {
210
+ bodyMapper: Mappers.MapsOperations
211
+ },
212
+ default: {
213
+ bodyMapper: Mappers.ErrorResponse
214
+ }
215
+ },
216
+ queryParameters: [Parameters.apiVersion],
217
+ urlParameters: [Parameters.$host, Parameters.subscriptionId],
218
+ headerParameters: [Parameters.accept],
219
+ serializer
220
+ };
221
+ const listOperationsNextOperationSpec: coreClient.OperationSpec = {
222
+ path: "{nextLink}",
223
+ httpMethod: "GET",
224
+ responses: {
225
+ 200: {
226
+ bodyMapper: Mappers.MapsOperations
227
+ },
228
+ default: {
229
+ bodyMapper: Mappers.ErrorResponse
230
+ }
231
+ },
232
+ queryParameters: [Parameters.apiVersion],
233
+ urlParameters: [Parameters.$host, Parameters.nextLink],
234
+ headerParameters: [Parameters.accept],
235
+ serializer
236
+ };
237
+ const listSubscriptionOperationsNextOperationSpec: coreClient.OperationSpec = {
238
+ path: "{nextLink}",
239
+ httpMethod: "GET",
240
+ responses: {
241
+ 200: {
242
+ bodyMapper: Mappers.MapsOperations
243
+ },
244
+ default: {
245
+ bodyMapper: Mappers.ErrorResponse
246
+ }
247
+ },
248
+ queryParameters: [Parameters.apiVersion],
249
+ urlParameters: [
250
+ Parameters.$host,
251
+ Parameters.subscriptionId,
252
+ Parameters.nextLink
253
+ ],
254
+ headerParameters: [Parameters.accept],
255
+ serializer
256
+ };