@azure/arm-maps 3.1.0-beta.1 → 3.1.0-beta.2
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.
- package/CHANGELOG.md +5 -4
- package/README.md +1 -1
- package/dist/index.js +185 -54
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist-esm/src/azureMapsManagementClient.d.ts +2 -0
- package/dist-esm/src/azureMapsManagementClient.d.ts.map +1 -1
- package/dist-esm/src/azureMapsManagementClient.js +49 -18
- package/dist-esm/src/azureMapsManagementClient.js.map +1 -1
- package/dist-esm/src/index.d.ts +1 -0
- package/dist-esm/src/index.d.ts.map +1 -1
- package/dist-esm/src/index.js +1 -0
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/models/index.d.ts +19 -6
- package/dist-esm/src/models/index.d.ts.map +1 -1
- package/dist-esm/src/models/index.js +13 -0
- package/dist-esm/src/models/index.js.map +1 -1
- package/dist-esm/src/operations/accounts.d.ts.map +1 -1
- package/dist-esm/src/operations/accounts.js +37 -14
- package/dist-esm/src/operations/accounts.js.map +1 -1
- package/dist-esm/src/operations/creators.d.ts.map +1 -1
- package/dist-esm/src/operations/creators.js +19 -7
- package/dist-esm/src/operations/creators.js.map +1 -1
- package/dist-esm/src/operations/maps.d.ts.map +1 -1
- package/dist-esm/src/operations/maps.js +37 -14
- package/dist-esm/src/operations/maps.js.map +1 -1
- package/dist-esm/src/pagingHelper.d.ts +13 -0
- package/dist-esm/src/pagingHelper.d.ts.map +1 -0
- package/dist-esm/src/pagingHelper.js +32 -0
- package/dist-esm/src/pagingHelper.js.map +1 -0
- package/dist-esm/test/sampleTest.js +11 -13
- package/dist-esm/test/sampleTest.js.map +1 -1
- package/package.json +15 -11
- package/review/arm-maps.api.md +13 -23
- package/src/azureMapsManagementClient.ts +60 -20
- package/src/index.ts +1 -0
- package/src/models/index.ts +19 -6
- package/src/operations/accounts.ts +46 -17
- package/src/operations/creators.ts +26 -12
- package/src/operations/maps.ts +41 -16
- package/src/pagingHelper.ts +39 -0
- package/types/arm-maps.d.ts +30 -6
- package/types/tsdoc-metadata.json +1 -1
package/package.json
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
"sdk-type": "mgmt",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "A generated SDK for AzureMapsManagementClient.",
|
|
6
|
-
"version": "3.1.0-beta.
|
|
6
|
+
"version": "3.1.0-beta.2",
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": ">=
|
|
8
|
+
"node": ">=14.0.0"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@azure/core-paging": "^1.2.0",
|
|
12
|
-
"@azure/core-client": "^1.
|
|
12
|
+
"@azure/core-client": "^1.6.1",
|
|
13
13
|
"@azure/core-auth": "^1.3.0",
|
|
14
14
|
"@azure/core-rest-pipeline": "^1.8.0",
|
|
15
15
|
"tslib": "^2.2.0"
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"module": "./dist-esm/src/index.js",
|
|
27
27
|
"types": "./types/arm-maps.d.ts",
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@microsoft/api-extractor": "7.
|
|
29
|
+
"@microsoft/api-extractor": "^7.31.1",
|
|
30
30
|
"@rollup/plugin-commonjs": "^21.0.1",
|
|
31
31
|
"@rollup/plugin-json": "^4.1.0",
|
|
32
32
|
"@rollup/plugin-multi-entry": "^4.1.0",
|
|
@@ -34,13 +34,18 @@
|
|
|
34
34
|
"mkdirp": "^1.0.4",
|
|
35
35
|
"rollup": "^2.66.1",
|
|
36
36
|
"rollup-plugin-sourcemaps": "^0.6.3",
|
|
37
|
-
"typescript": "~4.
|
|
37
|
+
"typescript": "~4.8.0",
|
|
38
38
|
"uglify-js": "^3.4.9",
|
|
39
39
|
"rimraf": "^3.0.0",
|
|
40
40
|
"@azure/identity": "^2.0.1",
|
|
41
|
-
"@azure-tools/test-recorder": "^
|
|
41
|
+
"@azure-tools/test-recorder": "^2.0.0",
|
|
42
|
+
"@azure-tools/test-credential": "^1.0.0",
|
|
42
43
|
"mocha": "^7.1.1",
|
|
43
|
-
"
|
|
44
|
+
"@types/chai": "^4.2.8",
|
|
45
|
+
"chai": "^4.2.0",
|
|
46
|
+
"cross-env": "^7.0.2",
|
|
47
|
+
"@types/node": "^14.0.0",
|
|
48
|
+
"@azure/dev-tool": "^1.0.0"
|
|
44
49
|
},
|
|
45
50
|
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/maps/arm-maps",
|
|
46
51
|
"repository": {
|
|
@@ -91,9 +96,8 @@
|
|
|
91
96
|
"unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node",
|
|
92
97
|
"unit-test:browser": "echo skipped",
|
|
93
98
|
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
|
|
94
|
-
"integration-test:node": "
|
|
95
|
-
"integration-test:browser": "echo skipped"
|
|
96
|
-
"docs": "echo skipped"
|
|
99
|
+
"integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'",
|
|
100
|
+
"integration-test:browser": "echo skipped"
|
|
97
101
|
},
|
|
98
102
|
"sideEffects": false,
|
|
99
103
|
"//metadata": {
|
|
@@ -113,4 +117,4 @@
|
|
|
113
117
|
"disableDocsMs": true,
|
|
114
118
|
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-maps?view=azure-node-preview"
|
|
115
119
|
}
|
|
116
|
-
}
|
|
120
|
+
}
|
package/review/arm-maps.api.md
CHANGED
|
@@ -149,10 +149,10 @@ export interface CorsRules {
|
|
|
149
149
|
export type CreatedByType = string;
|
|
150
150
|
|
|
151
151
|
// @public
|
|
152
|
-
export
|
|
152
|
+
export interface Creator extends TrackedResource {
|
|
153
153
|
properties: CreatorProperties;
|
|
154
154
|
readonly systemData?: SystemData;
|
|
155
|
-
}
|
|
155
|
+
}
|
|
156
156
|
|
|
157
157
|
// @public
|
|
158
158
|
export interface CreatorList {
|
|
@@ -253,6 +253,9 @@ export interface ErrorResponse {
|
|
|
253
253
|
error?: ErrorDetail;
|
|
254
254
|
}
|
|
255
255
|
|
|
256
|
+
// @public
|
|
257
|
+
export function getContinuationToken(page: unknown): string | undefined;
|
|
258
|
+
|
|
256
259
|
// @public
|
|
257
260
|
type KeyType_2 = string;
|
|
258
261
|
export { KeyType_2 as KeyType }
|
|
@@ -262,47 +265,34 @@ export type Kind = string;
|
|
|
262
265
|
|
|
263
266
|
// @public
|
|
264
267
|
export enum KnownCreatedByType {
|
|
265
|
-
// (undocumented)
|
|
266
268
|
Application = "Application",
|
|
267
|
-
// (undocumented)
|
|
268
269
|
Key = "Key",
|
|
269
|
-
// (undocumented)
|
|
270
270
|
ManagedIdentity = "ManagedIdentity",
|
|
271
|
-
// (undocumented)
|
|
272
271
|
User = "User"
|
|
273
272
|
}
|
|
274
273
|
|
|
275
274
|
// @public
|
|
276
275
|
export enum KnownKeyType {
|
|
277
|
-
// (undocumented)
|
|
278
276
|
Primary = "primary",
|
|
279
|
-
// (undocumented)
|
|
280
277
|
Secondary = "secondary"
|
|
281
278
|
}
|
|
282
279
|
|
|
283
280
|
// @public
|
|
284
281
|
export enum KnownKind {
|
|
285
|
-
// (undocumented)
|
|
286
282
|
Gen1 = "Gen1",
|
|
287
|
-
// (undocumented)
|
|
288
283
|
Gen2 = "Gen2"
|
|
289
284
|
}
|
|
290
285
|
|
|
291
286
|
// @public
|
|
292
287
|
export enum KnownName {
|
|
293
|
-
// (undocumented)
|
|
294
288
|
G2 = "G2",
|
|
295
|
-
// (undocumented)
|
|
296
289
|
S0 = "S0",
|
|
297
|
-
// (undocumented)
|
|
298
290
|
S1 = "S1"
|
|
299
291
|
}
|
|
300
292
|
|
|
301
293
|
// @public
|
|
302
294
|
export enum KnownSigningKey {
|
|
303
|
-
// (undocumented)
|
|
304
295
|
PrimaryKey = "primaryKey",
|
|
305
|
-
// (undocumented)
|
|
306
296
|
SecondaryKey = "secondaryKey"
|
|
307
297
|
}
|
|
308
298
|
|
|
@@ -329,13 +319,13 @@ export interface Maps {
|
|
|
329
319
|
}
|
|
330
320
|
|
|
331
321
|
// @public
|
|
332
|
-
export
|
|
333
|
-
sku: Sku;
|
|
334
|
-
kind?: Kind;
|
|
335
|
-
readonly systemData?: SystemData;
|
|
322
|
+
export interface MapsAccount extends TrackedResource {
|
|
336
323
|
identity?: ManagedServiceIdentity;
|
|
324
|
+
kind?: Kind;
|
|
337
325
|
properties?: MapsAccountProperties;
|
|
338
|
-
|
|
326
|
+
sku: Sku;
|
|
327
|
+
readonly systemData?: SystemData;
|
|
328
|
+
}
|
|
339
329
|
|
|
340
330
|
// @public
|
|
341
331
|
export interface MapsAccountKeys {
|
|
@@ -489,12 +479,12 @@ export interface SystemData {
|
|
|
489
479
|
}
|
|
490
480
|
|
|
491
481
|
// @public
|
|
492
|
-
export
|
|
482
|
+
export interface TrackedResource extends Resource {
|
|
483
|
+
location: string;
|
|
493
484
|
tags?: {
|
|
494
485
|
[propertyName: string]: string;
|
|
495
486
|
};
|
|
496
|
-
|
|
497
|
-
};
|
|
487
|
+
}
|
|
498
488
|
|
|
499
489
|
// (No @packageDocumentation comment for this package)
|
|
500
490
|
|
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
|
|
9
9
|
import * as coreClient from "@azure/core-client";
|
|
10
10
|
import * as coreRestPipeline from "@azure/core-rest-pipeline";
|
|
11
|
+
import {
|
|
12
|
+
PipelineRequest,
|
|
13
|
+
PipelineResponse,
|
|
14
|
+
SendRequest
|
|
15
|
+
} from "@azure/core-rest-pipeline";
|
|
11
16
|
import * as coreAuth from "@azure/core-auth";
|
|
12
17
|
import { AccountsImpl, MapsImpl, CreatorsImpl } from "./operations";
|
|
13
18
|
import { Accounts, Maps, Creators } from "./operationsInterfaces";
|
|
@@ -45,47 +50,53 @@ export class AzureMapsManagementClient extends coreClient.ServiceClient {
|
|
|
45
50
|
credential: credentials
|
|
46
51
|
};
|
|
47
52
|
|
|
48
|
-
const packageDetails = `azsdk-js-arm-maps/3.1.0-beta.
|
|
53
|
+
const packageDetails = `azsdk-js-arm-maps/3.1.0-beta.2`;
|
|
49
54
|
const userAgentPrefix =
|
|
50
55
|
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
51
56
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
52
57
|
: `${packageDetails}`;
|
|
53
58
|
|
|
54
|
-
if (!options.credentialScopes) {
|
|
55
|
-
options.credentialScopes = ["https://management.azure.com/.default"];
|
|
56
|
-
}
|
|
57
59
|
const optionsWithDefaults = {
|
|
58
60
|
...defaults,
|
|
59
61
|
...options,
|
|
60
62
|
userAgentOptions: {
|
|
61
63
|
userAgentPrefix
|
|
62
64
|
},
|
|
63
|
-
|
|
65
|
+
endpoint:
|
|
64
66
|
options.endpoint ?? options.baseUri ?? "https://management.azure.com"
|
|
65
67
|
};
|
|
66
68
|
super(optionsWithDefaults);
|
|
67
69
|
|
|
70
|
+
let bearerTokenAuthenticationPolicyFound: boolean = false;
|
|
68
71
|
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
|
|
69
72
|
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
|
|
70
|
-
|
|
73
|
+
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
|
|
71
74
|
(pipelinePolicy) =>
|
|
72
75
|
pipelinePolicy.name ===
|
|
73
76
|
coreRestPipeline.bearerTokenAuthenticationPolicyName
|
|
74
77
|
);
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
78
|
+
}
|
|
79
|
+
if (
|
|
80
|
+
!options ||
|
|
81
|
+
!options.pipeline ||
|
|
82
|
+
options.pipeline.getOrderedPolicies().length == 0 ||
|
|
83
|
+
!bearerTokenAuthenticationPolicyFound
|
|
84
|
+
) {
|
|
85
|
+
this.pipeline.removePolicy({
|
|
86
|
+
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
|
|
87
|
+
});
|
|
88
|
+
this.pipeline.addPolicy(
|
|
89
|
+
coreRestPipeline.bearerTokenAuthenticationPolicy({
|
|
90
|
+
credential: credentials,
|
|
91
|
+
scopes:
|
|
92
|
+
optionsWithDefaults.credentialScopes ??
|
|
93
|
+
`${optionsWithDefaults.endpoint}/.default`,
|
|
94
|
+
challengeCallbacks: {
|
|
95
|
+
authorizeRequestOnChallenge:
|
|
96
|
+
coreClient.authorizeRequestOnClaimChallenge
|
|
97
|
+
}
|
|
98
|
+
})
|
|
99
|
+
);
|
|
89
100
|
}
|
|
90
101
|
// Parameter assignments
|
|
91
102
|
this.subscriptionId = subscriptionId;
|
|
@@ -96,6 +107,35 @@ export class AzureMapsManagementClient extends coreClient.ServiceClient {
|
|
|
96
107
|
this.accounts = new AccountsImpl(this);
|
|
97
108
|
this.maps = new MapsImpl(this);
|
|
98
109
|
this.creators = new CreatorsImpl(this);
|
|
110
|
+
this.addCustomApiVersionPolicy(options.apiVersion);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
|
|
114
|
+
private addCustomApiVersionPolicy(apiVersion?: string) {
|
|
115
|
+
if (!apiVersion) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
const apiVersionPolicy = {
|
|
119
|
+
name: "CustomApiVersionPolicy",
|
|
120
|
+
async sendRequest(
|
|
121
|
+
request: PipelineRequest,
|
|
122
|
+
next: SendRequest
|
|
123
|
+
): Promise<PipelineResponse> {
|
|
124
|
+
const param = request.url.split("?");
|
|
125
|
+
if (param.length > 1) {
|
|
126
|
+
const newParams = param[1].split("&").map((item) => {
|
|
127
|
+
if (item.indexOf("api-version") > -1) {
|
|
128
|
+
return "api-version=" + apiVersion;
|
|
129
|
+
} else {
|
|
130
|
+
return item;
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
request.url = param[0] + "?" + newParams.join("&");
|
|
134
|
+
}
|
|
135
|
+
return next(request);
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
this.pipeline.addPolicy(apiVersionPolicy);
|
|
99
139
|
}
|
|
100
140
|
|
|
101
141
|
accounts: Accounts;
|
package/src/index.ts
CHANGED
package/src/models/index.ts
CHANGED
|
@@ -400,15 +400,15 @@ export interface CreatorUpdateParameters {
|
|
|
400
400
|
}
|
|
401
401
|
|
|
402
402
|
/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */
|
|
403
|
-
export
|
|
403
|
+
export interface TrackedResource extends Resource {
|
|
404
404
|
/** Resource tags. */
|
|
405
405
|
tags?: { [propertyName: string]: string };
|
|
406
406
|
/** The geo-location where the resource lives */
|
|
407
407
|
location: string;
|
|
408
|
-
}
|
|
408
|
+
}
|
|
409
409
|
|
|
410
410
|
/** An Azure resource which represents access to a suite of Maps REST APIs. */
|
|
411
|
-
export
|
|
411
|
+
export interface MapsAccount extends TrackedResource {
|
|
412
412
|
/** The SKU of this account. */
|
|
413
413
|
sku: Sku;
|
|
414
414
|
/** Get or Set Kind property. */
|
|
@@ -422,10 +422,10 @@ export type MapsAccount = TrackedResource & {
|
|
|
422
422
|
identity?: ManagedServiceIdentity;
|
|
423
423
|
/** The map account properties. */
|
|
424
424
|
properties?: MapsAccountProperties;
|
|
425
|
-
}
|
|
425
|
+
}
|
|
426
426
|
|
|
427
427
|
/** An Azure resource which represents Maps Creator product and provides ability to manage private location data. */
|
|
428
|
-
export
|
|
428
|
+
export interface Creator extends TrackedResource {
|
|
429
429
|
/** The Creator resource properties. */
|
|
430
430
|
properties: CreatorProperties;
|
|
431
431
|
/**
|
|
@@ -433,12 +433,15 @@ export type Creator = TrackedResource & {
|
|
|
433
433
|
* NOTE: This property will not be serialized. It can only be populated by the server.
|
|
434
434
|
*/
|
|
435
435
|
readonly systemData?: SystemData;
|
|
436
|
-
}
|
|
436
|
+
}
|
|
437
437
|
|
|
438
438
|
/** Known values of {@link Name} that the service accepts. */
|
|
439
439
|
export enum KnownName {
|
|
440
|
+
/** S0 */
|
|
440
441
|
S0 = "S0",
|
|
442
|
+
/** S1 */
|
|
441
443
|
S1 = "S1",
|
|
444
|
+
/** G2 */
|
|
442
445
|
G2 = "G2"
|
|
443
446
|
}
|
|
444
447
|
|
|
@@ -455,7 +458,9 @@ export type Name = string;
|
|
|
455
458
|
|
|
456
459
|
/** Known values of {@link Kind} that the service accepts. */
|
|
457
460
|
export enum KnownKind {
|
|
461
|
+
/** Gen1 */
|
|
458
462
|
Gen1 = "Gen1",
|
|
463
|
+
/** Gen2 */
|
|
459
464
|
Gen2 = "Gen2"
|
|
460
465
|
}
|
|
461
466
|
|
|
@@ -471,9 +476,13 @@ export type Kind = string;
|
|
|
471
476
|
|
|
472
477
|
/** Known values of {@link CreatedByType} that the service accepts. */
|
|
473
478
|
export enum KnownCreatedByType {
|
|
479
|
+
/** User */
|
|
474
480
|
User = "User",
|
|
481
|
+
/** Application */
|
|
475
482
|
Application = "Application",
|
|
483
|
+
/** ManagedIdentity */
|
|
476
484
|
ManagedIdentity = "ManagedIdentity",
|
|
485
|
+
/** Key */
|
|
477
486
|
Key = "Key"
|
|
478
487
|
}
|
|
479
488
|
|
|
@@ -491,7 +500,9 @@ export type CreatedByType = string;
|
|
|
491
500
|
|
|
492
501
|
/** Known values of {@link SigningKey} that the service accepts. */
|
|
493
502
|
export enum KnownSigningKey {
|
|
503
|
+
/** PrimaryKey */
|
|
494
504
|
PrimaryKey = "primaryKey",
|
|
505
|
+
/** SecondaryKey */
|
|
495
506
|
SecondaryKey = "secondaryKey"
|
|
496
507
|
}
|
|
497
508
|
|
|
@@ -507,7 +518,9 @@ export type SigningKey = string;
|
|
|
507
518
|
|
|
508
519
|
/** Known values of {@link KeyType} that the service accepts. */
|
|
509
520
|
export enum KnownKeyType {
|
|
521
|
+
/** Primary */
|
|
510
522
|
Primary = "primary",
|
|
523
|
+
/** Secondary */
|
|
511
524
|
Secondary = "secondary"
|
|
512
525
|
}
|
|
513
526
|
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { PagedAsyncIterableIterator } from "@azure/core-paging";
|
|
9
|
+
import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
|
|
10
|
+
import { setContinuationToken } from "../pagingHelper";
|
|
10
11
|
import { Accounts } from "../operationsInterfaces";
|
|
11
12
|
import * as coreClient from "@azure/core-client";
|
|
12
13
|
import * as Mappers from "../models/mappers";
|
|
@@ -16,8 +17,10 @@ import {
|
|
|
16
17
|
MapsAccount,
|
|
17
18
|
AccountsListByResourceGroupNextOptionalParams,
|
|
18
19
|
AccountsListByResourceGroupOptionalParams,
|
|
20
|
+
AccountsListByResourceGroupResponse,
|
|
19
21
|
AccountsListBySubscriptionNextOptionalParams,
|
|
20
22
|
AccountsListBySubscriptionOptionalParams,
|
|
23
|
+
AccountsListBySubscriptionResponse,
|
|
21
24
|
AccountsCreateOrUpdateOptionalParams,
|
|
22
25
|
AccountsCreateOrUpdateResponse,
|
|
23
26
|
MapsAccountUpdateParameters,
|
|
@@ -26,8 +29,6 @@ import {
|
|
|
26
29
|
AccountsDeleteOptionalParams,
|
|
27
30
|
AccountsGetOptionalParams,
|
|
28
31
|
AccountsGetResponse,
|
|
29
|
-
AccountsListByResourceGroupResponse,
|
|
30
|
-
AccountsListBySubscriptionResponse,
|
|
31
32
|
AccountSasParameters,
|
|
32
33
|
AccountsListSasOptionalParams,
|
|
33
34
|
AccountsListSasResponse,
|
|
@@ -70,19 +71,33 @@ export class AccountsImpl implements Accounts {
|
|
|
70
71
|
[Symbol.asyncIterator]() {
|
|
71
72
|
return this;
|
|
72
73
|
},
|
|
73
|
-
byPage: () => {
|
|
74
|
-
|
|
74
|
+
byPage: (settings?: PageSettings) => {
|
|
75
|
+
if (settings?.maxPageSize) {
|
|
76
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
77
|
+
}
|
|
78
|
+
return this.listByResourceGroupPagingPage(
|
|
79
|
+
resourceGroupName,
|
|
80
|
+
options,
|
|
81
|
+
settings
|
|
82
|
+
);
|
|
75
83
|
}
|
|
76
84
|
};
|
|
77
85
|
}
|
|
78
86
|
|
|
79
87
|
private async *listByResourceGroupPagingPage(
|
|
80
88
|
resourceGroupName: string,
|
|
81
|
-
options?: AccountsListByResourceGroupOptionalParams
|
|
89
|
+
options?: AccountsListByResourceGroupOptionalParams,
|
|
90
|
+
settings?: PageSettings
|
|
82
91
|
): AsyncIterableIterator<MapsAccount[]> {
|
|
83
|
-
let result
|
|
84
|
-
|
|
85
|
-
|
|
92
|
+
let result: AccountsListByResourceGroupResponse;
|
|
93
|
+
let continuationToken = settings?.continuationToken;
|
|
94
|
+
if (!continuationToken) {
|
|
95
|
+
result = await this._listByResourceGroup(resourceGroupName, options);
|
|
96
|
+
let page = result.value || [];
|
|
97
|
+
continuationToken = result.nextLink;
|
|
98
|
+
setContinuationToken(page, continuationToken);
|
|
99
|
+
yield page;
|
|
100
|
+
}
|
|
86
101
|
while (continuationToken) {
|
|
87
102
|
result = await this._listByResourceGroupNext(
|
|
88
103
|
resourceGroupName,
|
|
@@ -90,7 +105,9 @@ export class AccountsImpl implements Accounts {
|
|
|
90
105
|
options
|
|
91
106
|
);
|
|
92
107
|
continuationToken = result.nextLink;
|
|
93
|
-
|
|
108
|
+
let page = result.value || [];
|
|
109
|
+
setContinuationToken(page, continuationToken);
|
|
110
|
+
yield page;
|
|
94
111
|
}
|
|
95
112
|
}
|
|
96
113
|
|
|
@@ -121,22 +138,34 @@ export class AccountsImpl implements Accounts {
|
|
|
121
138
|
[Symbol.asyncIterator]() {
|
|
122
139
|
return this;
|
|
123
140
|
},
|
|
124
|
-
byPage: () => {
|
|
125
|
-
|
|
141
|
+
byPage: (settings?: PageSettings) => {
|
|
142
|
+
if (settings?.maxPageSize) {
|
|
143
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
144
|
+
}
|
|
145
|
+
return this.listBySubscriptionPagingPage(options, settings);
|
|
126
146
|
}
|
|
127
147
|
};
|
|
128
148
|
}
|
|
129
149
|
|
|
130
150
|
private async *listBySubscriptionPagingPage(
|
|
131
|
-
options?: AccountsListBySubscriptionOptionalParams
|
|
151
|
+
options?: AccountsListBySubscriptionOptionalParams,
|
|
152
|
+
settings?: PageSettings
|
|
132
153
|
): AsyncIterableIterator<MapsAccount[]> {
|
|
133
|
-
let result
|
|
134
|
-
|
|
135
|
-
|
|
154
|
+
let result: AccountsListBySubscriptionResponse;
|
|
155
|
+
let continuationToken = settings?.continuationToken;
|
|
156
|
+
if (!continuationToken) {
|
|
157
|
+
result = await this._listBySubscription(options);
|
|
158
|
+
let page = result.value || [];
|
|
159
|
+
continuationToken = result.nextLink;
|
|
160
|
+
setContinuationToken(page, continuationToken);
|
|
161
|
+
yield page;
|
|
162
|
+
}
|
|
136
163
|
while (continuationToken) {
|
|
137
164
|
result = await this._listBySubscriptionNext(continuationToken, options);
|
|
138
165
|
continuationToken = result.nextLink;
|
|
139
|
-
|
|
166
|
+
let page = result.value || [];
|
|
167
|
+
setContinuationToken(page, continuationToken);
|
|
168
|
+
yield page;
|
|
140
169
|
}
|
|
141
170
|
}
|
|
142
171
|
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { PagedAsyncIterableIterator } from "@azure/core-paging";
|
|
9
|
+
import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
|
|
10
|
+
import { setContinuationToken } from "../pagingHelper";
|
|
10
11
|
import { Creators } from "../operationsInterfaces";
|
|
11
12
|
import * as coreClient from "@azure/core-client";
|
|
12
13
|
import * as Mappers from "../models/mappers";
|
|
@@ -64,11 +65,15 @@ export class CreatorsImpl implements Creators {
|
|
|
64
65
|
[Symbol.asyncIterator]() {
|
|
65
66
|
return this;
|
|
66
67
|
},
|
|
67
|
-
byPage: () => {
|
|
68
|
+
byPage: (settings?: PageSettings) => {
|
|
69
|
+
if (settings?.maxPageSize) {
|
|
70
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
71
|
+
}
|
|
68
72
|
return this.listByAccountPagingPage(
|
|
69
73
|
resourceGroupName,
|
|
70
74
|
accountName,
|
|
71
|
-
options
|
|
75
|
+
options,
|
|
76
|
+
settings
|
|
72
77
|
);
|
|
73
78
|
}
|
|
74
79
|
};
|
|
@@ -77,15 +82,22 @@ export class CreatorsImpl implements Creators {
|
|
|
77
82
|
private async *listByAccountPagingPage(
|
|
78
83
|
resourceGroupName: string,
|
|
79
84
|
accountName: string,
|
|
80
|
-
options?: CreatorsListByAccountOptionalParams
|
|
85
|
+
options?: CreatorsListByAccountOptionalParams,
|
|
86
|
+
settings?: PageSettings
|
|
81
87
|
): AsyncIterableIterator<Creator[]> {
|
|
82
|
-
let result
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
let result: CreatorsListByAccountResponse;
|
|
89
|
+
let continuationToken = settings?.continuationToken;
|
|
90
|
+
if (!continuationToken) {
|
|
91
|
+
result = await this._listByAccount(
|
|
92
|
+
resourceGroupName,
|
|
93
|
+
accountName,
|
|
94
|
+
options
|
|
95
|
+
);
|
|
96
|
+
let page = result.value || [];
|
|
97
|
+
continuationToken = result.nextLink;
|
|
98
|
+
setContinuationToken(page, continuationToken);
|
|
99
|
+
yield page;
|
|
100
|
+
}
|
|
89
101
|
while (continuationToken) {
|
|
90
102
|
result = await this._listByAccountNext(
|
|
91
103
|
resourceGroupName,
|
|
@@ -94,7 +106,9 @@ export class CreatorsImpl implements Creators {
|
|
|
94
106
|
options
|
|
95
107
|
);
|
|
96
108
|
continuationToken = result.nextLink;
|
|
97
|
-
|
|
109
|
+
let page = result.value || [];
|
|
110
|
+
setContinuationToken(page, continuationToken);
|
|
111
|
+
yield page;
|
|
98
112
|
}
|
|
99
113
|
}
|
|
100
114
|
|