@azure/arm-maps 3.1.0-beta.1 → 3.1.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 (91) hide show
  1. package/CHANGELOG.md +42 -27
  2. package/LICENSE +1 -1
  3. package/README.md +2 -2
  4. package/dist/index.js +399 -113
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.js +1 -1
  7. package/dist/index.min.js.map +1 -1
  8. package/dist-esm/samples-dev/accountsCreateOrUpdateSample.js +63 -12
  9. package/dist-esm/samples-dev/accountsCreateOrUpdateSample.js.map +1 -1
  10. package/dist-esm/samples-dev/accountsDeleteSample.js +12 -4
  11. package/dist-esm/samples-dev/accountsDeleteSample.js.map +1 -1
  12. package/dist-esm/samples-dev/accountsGetSample.js +12 -4
  13. package/dist-esm/samples-dev/accountsGetSample.js.map +1 -1
  14. package/dist-esm/samples-dev/accountsListByResourceGroupSample.js +24 -9
  15. package/dist-esm/samples-dev/accountsListByResourceGroupSample.js.map +1 -1
  16. package/dist-esm/samples-dev/accountsListBySubscriptionSample.js +23 -8
  17. package/dist-esm/samples-dev/accountsListBySubscriptionSample.js.map +1 -1
  18. package/dist-esm/samples-dev/accountsListKeysSample.js +12 -4
  19. package/dist-esm/samples-dev/accountsListKeysSample.js.map +1 -1
  20. package/dist-esm/samples-dev/accountsListSasSample.js +12 -4
  21. package/dist-esm/samples-dev/accountsListSasSample.js.map +1 -1
  22. package/dist-esm/samples-dev/accountsRegenerateKeysSample.js +12 -4
  23. package/dist-esm/samples-dev/accountsRegenerateKeysSample.js.map +1 -1
  24. package/dist-esm/samples-dev/accountsUpdateSample.js +63 -16
  25. package/dist-esm/samples-dev/accountsUpdateSample.js.map +1 -1
  26. package/dist-esm/samples-dev/creatorsCreateOrUpdateSample.js +12 -4
  27. package/dist-esm/samples-dev/creatorsCreateOrUpdateSample.js.map +1 -1
  28. package/dist-esm/samples-dev/creatorsDeleteSample.js +12 -4
  29. package/dist-esm/samples-dev/creatorsDeleteSample.js.map +1 -1
  30. package/dist-esm/samples-dev/creatorsGetSample.js +12 -4
  31. package/dist-esm/samples-dev/creatorsGetSample.js.map +1 -1
  32. package/dist-esm/samples-dev/creatorsListByAccountSample.js +24 -9
  33. package/dist-esm/samples-dev/creatorsListByAccountSample.js.map +1 -1
  34. package/dist-esm/samples-dev/creatorsUpdateSample.js +12 -4
  35. package/dist-esm/samples-dev/creatorsUpdateSample.js.map +1 -1
  36. package/dist-esm/samples-dev/mapsListOperationsSample.js +22 -9
  37. package/dist-esm/samples-dev/mapsListOperationsSample.js.map +1 -1
  38. package/dist-esm/samples-dev/mapsListSubscriptionOperationsSample.js +23 -8
  39. package/dist-esm/samples-dev/mapsListSubscriptionOperationsSample.js.map +1 -1
  40. package/dist-esm/src/azureMapsManagementClient.d.ts +4 -1
  41. package/dist-esm/src/azureMapsManagementClient.d.ts.map +1 -1
  42. package/dist-esm/src/azureMapsManagementClient.js +57 -28
  43. package/dist-esm/src/azureMapsManagementClient.js.map +1 -1
  44. package/dist-esm/src/index.d.ts +1 -0
  45. package/dist-esm/src/index.d.ts.map +1 -1
  46. package/dist-esm/src/index.js +1 -0
  47. package/dist-esm/src/index.js.map +1 -1
  48. package/dist-esm/src/models/index.d.ts +161 -56
  49. package/dist-esm/src/models/index.d.ts.map +1 -1
  50. package/dist-esm/src/models/index.js +45 -0
  51. package/dist-esm/src/models/index.js.map +1 -1
  52. package/dist-esm/src/models/mappers.d.ts +4 -1
  53. package/dist-esm/src/models/mappers.d.ts.map +1 -1
  54. package/dist-esm/src/models/mappers.js +109 -17
  55. package/dist-esm/src/models/mappers.js.map +1 -1
  56. package/dist-esm/src/models/parameters.js +1 -1
  57. package/dist-esm/src/models/parameters.js.map +1 -1
  58. package/dist-esm/src/operations/accounts.d.ts.map +1 -1
  59. package/dist-esm/src/operations/accounts.js +61 -26
  60. package/dist-esm/src/operations/accounts.js.map +1 -1
  61. package/dist-esm/src/operations/creators.d.ts.map +1 -1
  62. package/dist-esm/src/operations/creators.js +31 -13
  63. package/dist-esm/src/operations/creators.js.map +1 -1
  64. package/dist-esm/src/operations/maps.d.ts.map +1 -1
  65. package/dist-esm/src/operations/maps.js +61 -26
  66. package/dist-esm/src/operations/maps.js.map +1 -1
  67. package/dist-esm/src/pagingHelper.d.ts +13 -0
  68. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  69. package/dist-esm/src/pagingHelper.js +32 -0
  70. package/dist-esm/src/pagingHelper.js.map +1 -0
  71. package/dist-esm/test/maps_operations_test.spec.d.ts +4 -0
  72. package/dist-esm/test/maps_operations_test.spec.d.ts.map +1 -0
  73. package/dist-esm/test/maps_operations_test.spec.js +140 -0
  74. package/dist-esm/test/maps_operations_test.spec.js.map +1 -0
  75. package/package.json +20 -15
  76. package/review/arm-maps.api.md +78 -35
  77. package/src/azureMapsManagementClient.ts +78 -24
  78. package/src/index.ts +1 -0
  79. package/src/models/index.ts +146 -38
  80. package/src/models/mappers.ts +112 -19
  81. package/src/models/parameters.ts +1 -1
  82. package/src/operations/accounts.ts +46 -19
  83. package/src/operations/creators.ts +26 -13
  84. package/src/operations/maps.ts +41 -18
  85. package/src/pagingHelper.ts +39 -0
  86. package/types/arm-maps.d.ts +169 -44
  87. package/types/tsdoc-metadata.json +1 -1
  88. package/dist-esm/test/sampleTest.d.ts +0 -2
  89. package/dist-esm/test/sampleTest.d.ts.map +0 -1
  90. package/dist-esm/test/sampleTest.js +0 -40
  91. package/dist-esm/test/sampleTest.js.map +0 -1
package/dist/index.js CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var tslib = require('tslib');
5
6
  var coreClient = require('@azure/core-client');
6
7
  var coreRestPipeline = require('@azure/core-rest-pipeline');
7
- var tslib = require('tslib');
8
8
 
9
9
  function _interopNamespace(e) {
10
10
  if (e && e.__esModule) return e;
@@ -27,6 +27,38 @@ function _interopNamespace(e) {
27
27
  var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
28
28
  var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipeline);
29
29
 
30
+ /*
31
+ * Copyright (c) Microsoft Corporation.
32
+ * Licensed under the MIT License.
33
+ *
34
+ * Code generated by Microsoft (R) AutoRest Code Generator.
35
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
36
+ */
37
+ const pageMap = new WeakMap();
38
+ /**
39
+ * Given the last `.value` produced by the `byPage` iterator,
40
+ * returns a continuation token that can be used to begin paging from
41
+ * that point later.
42
+ * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
43
+ * @returns The continuation token that can be passed into byPage() during future calls.
44
+ */
45
+ function getContinuationToken(page) {
46
+ var _a;
47
+ if (typeof page !== "object" || page === null) {
48
+ return undefined;
49
+ }
50
+ return (_a = pageMap.get(page)) === null || _a === void 0 ? void 0 : _a.continuationToken;
51
+ }
52
+ function setContinuationToken(page, continuationToken) {
53
+ var _a;
54
+ if (typeof page !== "object" || page === null || !continuationToken) {
55
+ return;
56
+ }
57
+ const pageInfo = (_a = pageMap.get(page)) !== null && _a !== void 0 ? _a : {};
58
+ pageInfo.continuationToken = continuationToken;
59
+ pageMap.set(page, pageInfo);
60
+ }
61
+
30
62
  /*
31
63
  * Copyright (c) Microsoft Corporation.
32
64
  * Licensed under the MIT License.
@@ -37,34 +69,79 @@ var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipelin
37
69
  /** Known values of {@link Name} that the service accepts. */
38
70
  exports.KnownName = void 0;
39
71
  (function (KnownName) {
72
+ /** S0 */
40
73
  KnownName["S0"] = "S0";
74
+ /** S1 */
41
75
  KnownName["S1"] = "S1";
76
+ /** G2 */
42
77
  KnownName["G2"] = "G2";
43
78
  })(exports.KnownName || (exports.KnownName = {}));
44
79
  /** Known values of {@link Kind} that the service accepts. */
45
80
  exports.KnownKind = void 0;
46
81
  (function (KnownKind) {
82
+ /** Gen1 */
47
83
  KnownKind["Gen1"] = "Gen1";
84
+ /** Gen2 */
48
85
  KnownKind["Gen2"] = "Gen2";
49
86
  })(exports.KnownKind || (exports.KnownKind = {}));
50
87
  /** Known values of {@link CreatedByType} that the service accepts. */
51
88
  exports.KnownCreatedByType = void 0;
52
89
  (function (KnownCreatedByType) {
90
+ /** User */
53
91
  KnownCreatedByType["User"] = "User";
92
+ /** Application */
54
93
  KnownCreatedByType["Application"] = "Application";
94
+ /** ManagedIdentity */
55
95
  KnownCreatedByType["ManagedIdentity"] = "ManagedIdentity";
96
+ /** Key */
56
97
  KnownCreatedByType["Key"] = "Key";
57
98
  })(exports.KnownCreatedByType || (exports.KnownCreatedByType = {}));
99
+ /** Known values of {@link ManagedServiceIdentityType} that the service accepts. */
100
+ exports.KnownManagedServiceIdentityType = void 0;
101
+ (function (KnownManagedServiceIdentityType) {
102
+ /** None */
103
+ KnownManagedServiceIdentityType["None"] = "None";
104
+ /** SystemAssigned */
105
+ KnownManagedServiceIdentityType["SystemAssigned"] = "SystemAssigned";
106
+ /** UserAssigned */
107
+ KnownManagedServiceIdentityType["UserAssigned"] = "UserAssigned";
108
+ /** SystemAssignedUserAssigned */
109
+ KnownManagedServiceIdentityType["SystemAssignedUserAssigned"] = "SystemAssigned, UserAssigned";
110
+ })(exports.KnownManagedServiceIdentityType || (exports.KnownManagedServiceIdentityType = {}));
111
+ /** Known values of {@link InfrastructureEncryption} that the service accepts. */
112
+ exports.KnownInfrastructureEncryption = void 0;
113
+ (function (KnownInfrastructureEncryption) {
114
+ /** Enabled */
115
+ KnownInfrastructureEncryption["Enabled"] = "enabled";
116
+ /** Disabled */
117
+ KnownInfrastructureEncryption["Disabled"] = "disabled";
118
+ })(exports.KnownInfrastructureEncryption || (exports.KnownInfrastructureEncryption = {}));
119
+ /** Known values of {@link IdentityType} that the service accepts. */
120
+ exports.KnownIdentityType = void 0;
121
+ (function (KnownIdentityType) {
122
+ /** SystemAssignedIdentity */
123
+ KnownIdentityType["SystemAssignedIdentity"] = "systemAssignedIdentity";
124
+ /** UserAssignedIdentity */
125
+ KnownIdentityType["UserAssignedIdentity"] = "userAssignedIdentity";
126
+ /** DelegatedResourceIdentity */
127
+ KnownIdentityType["DelegatedResourceIdentity"] = "delegatedResourceIdentity";
128
+ })(exports.KnownIdentityType || (exports.KnownIdentityType = {}));
58
129
  /** Known values of {@link SigningKey} that the service accepts. */
59
130
  exports.KnownSigningKey = void 0;
60
131
  (function (KnownSigningKey) {
132
+ /** PrimaryKey */
61
133
  KnownSigningKey["PrimaryKey"] = "primaryKey";
134
+ /** SecondaryKey */
62
135
  KnownSigningKey["SecondaryKey"] = "secondaryKey";
136
+ /** ManagedIdentity */
137
+ KnownSigningKey["ManagedIdentity"] = "managedIdentity";
63
138
  })(exports.KnownSigningKey || (exports.KnownSigningKey = {}));
64
139
  /** Known values of {@link KeyType} that the service accepts. */
65
140
  exports.KnownKeyType = void 0;
66
141
  (function (KnownKeyType) {
142
+ /** Primary */
67
143
  KnownKeyType["Primary"] = "primary";
144
+ /** Secondary */
68
145
  KnownKeyType["Secondary"] = "secondary";
69
146
  })(exports.KnownKeyType || (exports.KnownKeyType = {}));
70
147
 
@@ -150,26 +227,21 @@ const ManagedServiceIdentity = {
150
227
  serializedName: "principalId",
151
228
  readOnly: true,
152
229
  type: {
153
- name: "String"
230
+ name: "Uuid"
154
231
  }
155
232
  },
156
233
  tenantId: {
157
234
  serializedName: "tenantId",
158
235
  readOnly: true,
159
236
  type: {
160
- name: "String"
237
+ name: "Uuid"
161
238
  }
162
239
  },
163
240
  type: {
164
241
  serializedName: "type",
242
+ required: true,
165
243
  type: {
166
- name: "Enum",
167
- allowedValues: [
168
- "SystemAssigned",
169
- "UserAssigned",
170
- "SystemAssigned, UserAssigned",
171
- "None"
172
- ]
244
+ name: "String"
173
245
  }
174
246
  },
175
247
  userAssignedIdentities: {
@@ -177,33 +249,30 @@ const ManagedServiceIdentity = {
177
249
  type: {
178
250
  name: "Dictionary",
179
251
  value: {
180
- type: {
181
- name: "Composite",
182
- className: "Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties"
183
- }
252
+ type: { name: "Composite", className: "UserAssignedIdentity" }
184
253
  }
185
254
  }
186
255
  }
187
256
  }
188
257
  }
189
258
  };
190
- const Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties = {
259
+ const UserAssignedIdentity = {
191
260
  type: {
192
261
  name: "Composite",
193
- className: "Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties",
262
+ className: "UserAssignedIdentity",
194
263
  modelProperties: {
195
264
  principalId: {
196
265
  serializedName: "principalId",
197
266
  readOnly: true,
198
267
  type: {
199
- name: "String"
268
+ name: "Uuid"
200
269
  }
201
270
  },
202
271
  clientId: {
203
272
  serializedName: "clientId",
204
273
  readOnly: true,
205
274
  type: {
206
- name: "String"
275
+ name: "Uuid"
207
276
  }
208
277
  }
209
278
  }
@@ -256,6 +325,13 @@ const MapsAccountProperties = {
256
325
  name: "Composite",
257
326
  className: "CorsRules"
258
327
  }
328
+ },
329
+ encryption: {
330
+ serializedName: "encryption",
331
+ type: {
332
+ name: "Composite",
333
+ className: "Encryption"
334
+ }
259
335
  }
260
336
  }
261
337
  }
@@ -325,6 +401,74 @@ const CorsRule = {
325
401
  }
326
402
  }
327
403
  };
404
+ const Encryption = {
405
+ type: {
406
+ name: "Composite",
407
+ className: "Encryption",
408
+ modelProperties: {
409
+ infrastructureEncryption: {
410
+ serializedName: "infrastructureEncryption",
411
+ type: {
412
+ name: "String"
413
+ }
414
+ },
415
+ customerManagedKeyEncryption: {
416
+ serializedName: "customerManagedKeyEncryption",
417
+ type: {
418
+ name: "Composite",
419
+ className: "CustomerManagedKeyEncryption"
420
+ }
421
+ }
422
+ }
423
+ }
424
+ };
425
+ const CustomerManagedKeyEncryption = {
426
+ type: {
427
+ name: "Composite",
428
+ className: "CustomerManagedKeyEncryption",
429
+ modelProperties: {
430
+ keyEncryptionKeyIdentity: {
431
+ serializedName: "keyEncryptionKeyIdentity",
432
+ type: {
433
+ name: "Composite",
434
+ className: "CustomerManagedKeyEncryptionKeyIdentity"
435
+ }
436
+ },
437
+ keyEncryptionKeyUrl: {
438
+ serializedName: "keyEncryptionKeyUrl",
439
+ type: {
440
+ name: "String"
441
+ }
442
+ }
443
+ }
444
+ }
445
+ };
446
+ const CustomerManagedKeyEncryptionKeyIdentity = {
447
+ type: {
448
+ name: "Composite",
449
+ className: "CustomerManagedKeyEncryptionKeyIdentity",
450
+ modelProperties: {
451
+ identityType: {
452
+ serializedName: "identityType",
453
+ type: {
454
+ name: "String"
455
+ }
456
+ },
457
+ userAssignedIdentityResourceId: {
458
+ serializedName: "userAssignedIdentityResourceId",
459
+ type: {
460
+ name: "String"
461
+ }
462
+ },
463
+ delegatedIdentityClientId: {
464
+ serializedName: "delegatedIdentityClientId",
465
+ type: {
466
+ name: "Uuid"
467
+ }
468
+ }
469
+ }
470
+ }
471
+ };
328
472
  const Resource = {
329
473
  type: {
330
474
  name: "Composite",
@@ -522,6 +666,13 @@ const MapsAccountUpdateParameters = {
522
666
  name: "Composite",
523
667
  className: "CorsRules"
524
668
  }
669
+ },
670
+ encryption: {
671
+ serializedName: "properties.encryption",
672
+ type: {
673
+ name: "Composite",
674
+ className: "Encryption"
675
+ }
525
676
  }
526
677
  }
527
678
  }
@@ -873,6 +1024,24 @@ const MetricSpecification = {
873
1024
  type: {
874
1025
  name: "String"
875
1026
  }
1027
+ },
1028
+ lockAggregationType: {
1029
+ serializedName: "lockAggregationType",
1030
+ type: {
1031
+ name: "String"
1032
+ }
1033
+ },
1034
+ sourceMdmNamespace: {
1035
+ serializedName: "sourceMdmNamespace",
1036
+ type: {
1037
+ name: "String"
1038
+ }
1039
+ },
1040
+ supportedAggregationTypes: {
1041
+ serializedName: "supportedAggregationTypes",
1042
+ type: {
1043
+ name: "String"
1044
+ }
876
1045
  }
877
1046
  }
878
1047
  }
@@ -1087,11 +1256,14 @@ var Mappers = /*#__PURE__*/Object.freeze({
1087
1256
  Sku: Sku,
1088
1257
  SystemData: SystemData,
1089
1258
  ManagedServiceIdentity: ManagedServiceIdentity,
1090
- Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties: Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties,
1259
+ UserAssignedIdentity: UserAssignedIdentity,
1091
1260
  MapsAccountProperties: MapsAccountProperties,
1092
1261
  LinkedResource: LinkedResource,
1093
1262
  CorsRules: CorsRules,
1094
1263
  CorsRule: CorsRule,
1264
+ Encryption: Encryption,
1265
+ CustomerManagedKeyEncryption: CustomerManagedKeyEncryption,
1266
+ CustomerManagedKeyEncryptionKeyIdentity: CustomerManagedKeyEncryptionKeyIdentity,
1095
1267
  Resource: Resource,
1096
1268
  ErrorResponse: ErrorResponse,
1097
1269
  ErrorDetail: ErrorDetail,
@@ -1163,7 +1335,7 @@ const $host = {
1163
1335
  const apiVersion = {
1164
1336
  parameterPath: "apiVersion",
1165
1337
  mapper: {
1166
- defaultValue: "2021-12-01-preview",
1338
+ defaultValue: "2023-06-01",
1167
1339
  isConstant: true,
1168
1340
  serializedName: "api-version",
1169
1341
  type: {
@@ -1281,36 +1453,54 @@ class AccountsImpl {
1281
1453
  [Symbol.asyncIterator]() {
1282
1454
  return this;
1283
1455
  },
1284
- byPage: () => {
1285
- return this.listByResourceGroupPagingPage(resourceGroupName, options);
1456
+ byPage: (settings) => {
1457
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1458
+ throw new Error("maxPageSize is not supported by this operation.");
1459
+ }
1460
+ return this.listByResourceGroupPagingPage(resourceGroupName, options, settings);
1286
1461
  }
1287
1462
  };
1288
1463
  }
1289
- listByResourceGroupPagingPage(resourceGroupName, options) {
1464
+ listByResourceGroupPagingPage(resourceGroupName, options, settings) {
1290
1465
  return tslib.__asyncGenerator(this, arguments, function* listByResourceGroupPagingPage_1() {
1291
- let result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
1292
- yield yield tslib.__await(result.value || []);
1293
- let continuationToken = result.nextLink;
1466
+ let result;
1467
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1468
+ if (!continuationToken) {
1469
+ result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
1470
+ let page = result.value || [];
1471
+ continuationToken = result.nextLink;
1472
+ setContinuationToken(page, continuationToken);
1473
+ yield yield tslib.__await(page);
1474
+ }
1294
1475
  while (continuationToken) {
1295
1476
  result = yield tslib.__await(this._listByResourceGroupNext(resourceGroupName, continuationToken, options));
1296
1477
  continuationToken = result.nextLink;
1297
- yield yield tslib.__await(result.value || []);
1478
+ let page = result.value || [];
1479
+ setContinuationToken(page, continuationToken);
1480
+ yield yield tslib.__await(page);
1298
1481
  }
1299
1482
  });
1300
1483
  }
1301
1484
  listByResourceGroupPagingAll(resourceGroupName, options) {
1302
1485
  return tslib.__asyncGenerator(this, arguments, function* listByResourceGroupPagingAll_1() {
1303
- var e_1, _a;
1486
+ var _a, e_1, _b, _c;
1304
1487
  try {
1305
- for (var _b = tslib.__asyncValues(this.listByResourceGroupPagingPage(resourceGroupName, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
1306
- const page = _c.value;
1307
- yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
1488
+ for (var _d = true, _e = tslib.__asyncValues(this.listByResourceGroupPagingPage(resourceGroupName, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
1489
+ _c = _f.value;
1490
+ _d = false;
1491
+ try {
1492
+ const page = _c;
1493
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
1494
+ }
1495
+ finally {
1496
+ _d = true;
1497
+ }
1308
1498
  }
1309
1499
  }
1310
1500
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
1311
1501
  finally {
1312
1502
  try {
1313
- if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
1503
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
1314
1504
  }
1315
1505
  finally { if (e_1) throw e_1.error; }
1316
1506
  }
@@ -1329,36 +1519,54 @@ class AccountsImpl {
1329
1519
  [Symbol.asyncIterator]() {
1330
1520
  return this;
1331
1521
  },
1332
- byPage: () => {
1333
- return this.listBySubscriptionPagingPage(options);
1522
+ byPage: (settings) => {
1523
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1524
+ throw new Error("maxPageSize is not supported by this operation.");
1525
+ }
1526
+ return this.listBySubscriptionPagingPage(options, settings);
1334
1527
  }
1335
1528
  };
1336
1529
  }
1337
- listBySubscriptionPagingPage(options) {
1530
+ listBySubscriptionPagingPage(options, settings) {
1338
1531
  return tslib.__asyncGenerator(this, arguments, function* listBySubscriptionPagingPage_1() {
1339
- let result = yield tslib.__await(this._listBySubscription(options));
1340
- yield yield tslib.__await(result.value || []);
1341
- let continuationToken = result.nextLink;
1532
+ let result;
1533
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1534
+ if (!continuationToken) {
1535
+ result = yield tslib.__await(this._listBySubscription(options));
1536
+ let page = result.value || [];
1537
+ continuationToken = result.nextLink;
1538
+ setContinuationToken(page, continuationToken);
1539
+ yield yield tslib.__await(page);
1540
+ }
1342
1541
  while (continuationToken) {
1343
1542
  result = yield tslib.__await(this._listBySubscriptionNext(continuationToken, options));
1344
1543
  continuationToken = result.nextLink;
1345
- yield yield tslib.__await(result.value || []);
1544
+ let page = result.value || [];
1545
+ setContinuationToken(page, continuationToken);
1546
+ yield yield tslib.__await(page);
1346
1547
  }
1347
1548
  });
1348
1549
  }
1349
1550
  listBySubscriptionPagingAll(options) {
1350
1551
  return tslib.__asyncGenerator(this, arguments, function* listBySubscriptionPagingAll_1() {
1351
- var e_2, _a;
1552
+ var _a, e_2, _b, _c;
1352
1553
  try {
1353
- for (var _b = tslib.__asyncValues(this.listBySubscriptionPagingPage(options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
1354
- const page = _c.value;
1355
- yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
1554
+ for (var _d = true, _e = tslib.__asyncValues(this.listBySubscriptionPagingPage(options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
1555
+ _c = _f.value;
1556
+ _d = false;
1557
+ try {
1558
+ const page = _c;
1559
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
1560
+ }
1561
+ finally {
1562
+ _d = true;
1563
+ }
1356
1564
  }
1357
1565
  }
1358
1566
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
1359
1567
  finally {
1360
1568
  try {
1361
- if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
1569
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
1362
1570
  }
1363
1571
  finally { if (e_2) throw e_2.error; }
1364
1572
  }
@@ -1682,7 +1890,6 @@ const listByResourceGroupNextOperationSpec = {
1682
1890
  bodyMapper: ErrorResponse
1683
1891
  }
1684
1892
  },
1685
- queryParameters: [apiVersion],
1686
1893
  urlParameters: [
1687
1894
  $host,
1688
1895
  subscriptionId,
@@ -1703,7 +1910,6 @@ const listBySubscriptionNextOperationSpec = {
1703
1910
  bodyMapper: ErrorResponse
1704
1911
  }
1705
1912
  },
1706
- queryParameters: [apiVersion],
1707
1913
  urlParameters: [
1708
1914
  $host,
1709
1915
  subscriptionId,
@@ -1743,36 +1949,54 @@ class MapsImpl {
1743
1949
  [Symbol.asyncIterator]() {
1744
1950
  return this;
1745
1951
  },
1746
- byPage: () => {
1747
- return this.listOperationsPagingPage(options);
1952
+ byPage: (settings) => {
1953
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1954
+ throw new Error("maxPageSize is not supported by this operation.");
1955
+ }
1956
+ return this.listOperationsPagingPage(options, settings);
1748
1957
  }
1749
1958
  };
1750
1959
  }
1751
- listOperationsPagingPage(options) {
1960
+ listOperationsPagingPage(options, settings) {
1752
1961
  return tslib.__asyncGenerator(this, arguments, function* listOperationsPagingPage_1() {
1753
- let result = yield tslib.__await(this._listOperations(options));
1754
- yield yield tslib.__await(result.value || []);
1755
- let continuationToken = result.nextLink;
1962
+ let result;
1963
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1964
+ if (!continuationToken) {
1965
+ result = yield tslib.__await(this._listOperations(options));
1966
+ let page = result.value || [];
1967
+ continuationToken = result.nextLink;
1968
+ setContinuationToken(page, continuationToken);
1969
+ yield yield tslib.__await(page);
1970
+ }
1756
1971
  while (continuationToken) {
1757
1972
  result = yield tslib.__await(this._listOperationsNext(continuationToken, options));
1758
1973
  continuationToken = result.nextLink;
1759
- yield yield tslib.__await(result.value || []);
1974
+ let page = result.value || [];
1975
+ setContinuationToken(page, continuationToken);
1976
+ yield yield tslib.__await(page);
1760
1977
  }
1761
1978
  });
1762
1979
  }
1763
1980
  listOperationsPagingAll(options) {
1764
1981
  return tslib.__asyncGenerator(this, arguments, function* listOperationsPagingAll_1() {
1765
- var e_1, _a;
1982
+ var _a, e_1, _b, _c;
1766
1983
  try {
1767
- for (var _b = tslib.__asyncValues(this.listOperationsPagingPage(options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
1768
- const page = _c.value;
1769
- yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
1984
+ for (var _d = true, _e = tslib.__asyncValues(this.listOperationsPagingPage(options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
1985
+ _c = _f.value;
1986
+ _d = false;
1987
+ try {
1988
+ const page = _c;
1989
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
1990
+ }
1991
+ finally {
1992
+ _d = true;
1993
+ }
1770
1994
  }
1771
1995
  }
1772
1996
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
1773
1997
  finally {
1774
1998
  try {
1775
- if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
1999
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
1776
2000
  }
1777
2001
  finally { if (e_1) throw e_1.error; }
1778
2002
  }
@@ -1791,36 +2015,54 @@ class MapsImpl {
1791
2015
  [Symbol.asyncIterator]() {
1792
2016
  return this;
1793
2017
  },
1794
- byPage: () => {
1795
- return this.listSubscriptionOperationsPagingPage(options);
2018
+ byPage: (settings) => {
2019
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
2020
+ throw new Error("maxPageSize is not supported by this operation.");
2021
+ }
2022
+ return this.listSubscriptionOperationsPagingPage(options, settings);
1796
2023
  }
1797
2024
  };
1798
2025
  }
1799
- listSubscriptionOperationsPagingPage(options) {
2026
+ listSubscriptionOperationsPagingPage(options, settings) {
1800
2027
  return tslib.__asyncGenerator(this, arguments, function* listSubscriptionOperationsPagingPage_1() {
1801
- let result = yield tslib.__await(this._listSubscriptionOperations(options));
1802
- yield yield tslib.__await(result.value || []);
1803
- let continuationToken = result.nextLink;
2028
+ let result;
2029
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
2030
+ if (!continuationToken) {
2031
+ result = yield tslib.__await(this._listSubscriptionOperations(options));
2032
+ let page = result.value || [];
2033
+ continuationToken = result.nextLink;
2034
+ setContinuationToken(page, continuationToken);
2035
+ yield yield tslib.__await(page);
2036
+ }
1804
2037
  while (continuationToken) {
1805
2038
  result = yield tslib.__await(this._listSubscriptionOperationsNext(continuationToken, options));
1806
2039
  continuationToken = result.nextLink;
1807
- yield yield tslib.__await(result.value || []);
2040
+ let page = result.value || [];
2041
+ setContinuationToken(page, continuationToken);
2042
+ yield yield tslib.__await(page);
1808
2043
  }
1809
2044
  });
1810
2045
  }
1811
2046
  listSubscriptionOperationsPagingAll(options) {
1812
2047
  return tslib.__asyncGenerator(this, arguments, function* listSubscriptionOperationsPagingAll_1() {
1813
- var e_2, _a;
2048
+ var _a, e_2, _b, _c;
1814
2049
  try {
1815
- for (var _b = tslib.__asyncValues(this.listSubscriptionOperationsPagingPage(options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
1816
- const page = _c.value;
1817
- yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
2050
+ for (var _d = true, _e = tslib.__asyncValues(this.listSubscriptionOperationsPagingPage(options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
2051
+ _c = _f.value;
2052
+ _d = false;
2053
+ try {
2054
+ const page = _c;
2055
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
2056
+ }
2057
+ finally {
2058
+ _d = true;
2059
+ }
1818
2060
  }
1819
2061
  }
1820
2062
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
1821
2063
  finally {
1822
2064
  try {
1823
- if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
2065
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
1824
2066
  }
1825
2067
  finally { if (e_2) throw e_2.error; }
1826
2068
  }
@@ -1903,7 +2145,6 @@ const listOperationsNextOperationSpec = {
1903
2145
  bodyMapper: ErrorResponse
1904
2146
  }
1905
2147
  },
1906
- queryParameters: [apiVersion],
1907
2148
  urlParameters: [$host, nextLink],
1908
2149
  headerParameters: [accept],
1909
2150
  serializer: serializer$1
@@ -1919,7 +2160,6 @@ const listSubscriptionOperationsNextOperationSpec = {
1919
2160
  bodyMapper: ErrorResponse
1920
2161
  }
1921
2162
  },
1922
- queryParameters: [apiVersion],
1923
2163
  urlParameters: [
1924
2164
  $host,
1925
2165
  subscriptionId,
@@ -1961,36 +2201,54 @@ class CreatorsImpl {
1961
2201
  [Symbol.asyncIterator]() {
1962
2202
  return this;
1963
2203
  },
1964
- byPage: () => {
1965
- return this.listByAccountPagingPage(resourceGroupName, accountName, options);
2204
+ byPage: (settings) => {
2205
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
2206
+ throw new Error("maxPageSize is not supported by this operation.");
2207
+ }
2208
+ return this.listByAccountPagingPage(resourceGroupName, accountName, options, settings);
1966
2209
  }
1967
2210
  };
1968
2211
  }
1969
- listByAccountPagingPage(resourceGroupName, accountName, options) {
2212
+ listByAccountPagingPage(resourceGroupName, accountName, options, settings) {
1970
2213
  return tslib.__asyncGenerator(this, arguments, function* listByAccountPagingPage_1() {
1971
- let result = yield tslib.__await(this._listByAccount(resourceGroupName, accountName, options));
1972
- yield yield tslib.__await(result.value || []);
1973
- let continuationToken = result.nextLink;
2214
+ let result;
2215
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
2216
+ if (!continuationToken) {
2217
+ result = yield tslib.__await(this._listByAccount(resourceGroupName, accountName, options));
2218
+ let page = result.value || [];
2219
+ continuationToken = result.nextLink;
2220
+ setContinuationToken(page, continuationToken);
2221
+ yield yield tslib.__await(page);
2222
+ }
1974
2223
  while (continuationToken) {
1975
2224
  result = yield tslib.__await(this._listByAccountNext(resourceGroupName, accountName, continuationToken, options));
1976
2225
  continuationToken = result.nextLink;
1977
- yield yield tslib.__await(result.value || []);
2226
+ let page = result.value || [];
2227
+ setContinuationToken(page, continuationToken);
2228
+ yield yield tslib.__await(page);
1978
2229
  }
1979
2230
  });
1980
2231
  }
1981
2232
  listByAccountPagingAll(resourceGroupName, accountName, options) {
1982
2233
  return tslib.__asyncGenerator(this, arguments, function* listByAccountPagingAll_1() {
1983
- var e_1, _a;
2234
+ var _a, e_1, _b, _c;
1984
2235
  try {
1985
- for (var _b = tslib.__asyncValues(this.listByAccountPagingPage(resourceGroupName, accountName, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
1986
- const page = _c.value;
1987
- yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
2236
+ for (var _d = true, _e = tslib.__asyncValues(this.listByAccountPagingPage(resourceGroupName, accountName, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
2237
+ _c = _f.value;
2238
+ _d = false;
2239
+ try {
2240
+ const page = _c;
2241
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
2242
+ }
2243
+ finally {
2244
+ _d = true;
2245
+ }
1988
2246
  }
1989
2247
  }
1990
2248
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
1991
2249
  finally {
1992
2250
  try {
1993
- if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
2251
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
1994
2252
  }
1995
2253
  finally { if (e_1) throw e_1.error; }
1996
2254
  }
@@ -2194,7 +2452,6 @@ const listByAccountNextOperationSpec = {
2194
2452
  bodyMapper: ErrorResponse
2195
2453
  }
2196
2454
  },
2197
- queryParameters: [apiVersion],
2198
2455
  urlParameters: [
2199
2456
  $host,
2200
2457
  subscriptionId,
@@ -2214,19 +2471,17 @@ const listByAccountNextOperationSpec = {
2214
2471
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
2215
2472
  */
2216
2473
  class AzureMapsManagementClient extends coreClient__namespace.ServiceClient {
2217
- /**
2218
- * Initializes a new instance of the AzureMapsManagementClient class.
2219
- * @param credentials Subscription credentials which uniquely identify client subscription.
2220
- * @param subscriptionId The ID of the target subscription.
2221
- * @param options The parameter options
2222
- */
2223
- constructor(credentials, subscriptionId, options) {
2224
- var _a, _b;
2474
+ constructor(credentials, subscriptionIdOrOptions, options) {
2475
+ var _a, _b, _c;
2225
2476
  if (credentials === undefined) {
2226
2477
  throw new Error("'credentials' cannot be null");
2227
2478
  }
2228
- if (subscriptionId === undefined) {
2229
- throw new Error("'subscriptionId' cannot be null");
2479
+ let subscriptionId;
2480
+ if (typeof subscriptionIdOrOptions === "string") {
2481
+ subscriptionId = subscriptionIdOrOptions;
2482
+ }
2483
+ else if (typeof subscriptionIdOrOptions === "object") {
2484
+ options = subscriptionIdOrOptions;
2230
2485
  }
2231
2486
  // Initializing default values for options
2232
2487
  if (!options) {
@@ -2236,43 +2491,74 @@ class AzureMapsManagementClient extends coreClient__namespace.ServiceClient {
2236
2491
  requestContentType: "application/json; charset=utf-8",
2237
2492
  credential: credentials
2238
2493
  };
2239
- const packageDetails = `azsdk-js-arm-maps/3.1.0-beta.1`;
2494
+ const packageDetails = `azsdk-js-arm-maps/3.1.0`;
2240
2495
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
2241
2496
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
2242
2497
  : `${packageDetails}`;
2243
- if (!options.credentialScopes) {
2244
- options.credentialScopes = ["https://management.azure.com/.default"];
2245
- }
2246
2498
  const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
2247
2499
  userAgentPrefix
2248
- }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
2500
+ }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
2249
2501
  super(optionsWithDefaults);
2502
+ let bearerTokenAuthenticationPolicyFound = false;
2250
2503
  if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
2251
2504
  const pipelinePolicies = options.pipeline.getOrderedPolicies();
2252
- const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
2505
+ bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
2253
2506
  coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
2254
- if (!bearerTokenAuthenticationPolicyFound) {
2255
- this.pipeline.removePolicy({
2256
- name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
2257
- });
2258
- this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
2259
- scopes: `${optionsWithDefaults.baseUri}/.default`,
2260
- challengeCallbacks: {
2261
- authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
2262
- }
2263
- }));
2264
- }
2507
+ }
2508
+ if (!options ||
2509
+ !options.pipeline ||
2510
+ options.pipeline.getOrderedPolicies().length == 0 ||
2511
+ !bearerTokenAuthenticationPolicyFound) {
2512
+ this.pipeline.removePolicy({
2513
+ name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
2514
+ });
2515
+ this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
2516
+ credential: credentials,
2517
+ scopes: (_c = optionsWithDefaults.credentialScopes) !== null && _c !== void 0 ? _c : `${optionsWithDefaults.endpoint}/.default`,
2518
+ challengeCallbacks: {
2519
+ authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
2520
+ }
2521
+ }));
2265
2522
  }
2266
2523
  // Parameter assignments
2267
2524
  this.subscriptionId = subscriptionId;
2268
2525
  // Assigning values to Constant parameters
2269
2526
  this.$host = options.$host || "https://management.azure.com";
2270
- this.apiVersion = options.apiVersion || "2021-12-01-preview";
2527
+ this.apiVersion = options.apiVersion || "2023-06-01";
2271
2528
  this.accounts = new AccountsImpl(this);
2272
2529
  this.maps = new MapsImpl(this);
2273
2530
  this.creators = new CreatorsImpl(this);
2531
+ this.addCustomApiVersionPolicy(options.apiVersion);
2532
+ }
2533
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
2534
+ addCustomApiVersionPolicy(apiVersion) {
2535
+ if (!apiVersion) {
2536
+ return;
2537
+ }
2538
+ const apiVersionPolicy = {
2539
+ name: "CustomApiVersionPolicy",
2540
+ sendRequest(request, next) {
2541
+ return tslib.__awaiter(this, void 0, void 0, function* () {
2542
+ const param = request.url.split("?");
2543
+ if (param.length > 1) {
2544
+ const newParams = param[1].split("&").map((item) => {
2545
+ if (item.indexOf("api-version") > -1) {
2546
+ return "api-version=" + apiVersion;
2547
+ }
2548
+ else {
2549
+ return item;
2550
+ }
2551
+ });
2552
+ request.url = param[0] + "?" + newParams.join("&");
2553
+ }
2554
+ return next(request);
2555
+ });
2556
+ }
2557
+ };
2558
+ this.pipeline.addPolicy(apiVersionPolicy);
2274
2559
  }
2275
2560
  }
2276
2561
 
2277
2562
  exports.AzureMapsManagementClient = AzureMapsManagementClient;
2563
+ exports.getContinuationToken = getContinuationToken;
2278
2564
  //# sourceMappingURL=index.js.map