@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/src/operations/maps.ts
CHANGED
|
@@ -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 { Maps } from "../operationsInterfaces";
|
|
11
12
|
import * as coreClient from "@azure/core-client";
|
|
12
13
|
import * as Mappers from "../models/mappers";
|
|
@@ -16,9 +17,9 @@ import {
|
|
|
16
17
|
OperationDetail,
|
|
17
18
|
MapsListOperationsNextOptionalParams,
|
|
18
19
|
MapsListOperationsOptionalParams,
|
|
20
|
+
MapsListOperationsResponse,
|
|
19
21
|
MapsListSubscriptionOperationsNextOptionalParams,
|
|
20
22
|
MapsListSubscriptionOperationsOptionalParams,
|
|
21
|
-
MapsListOperationsResponse,
|
|
22
23
|
MapsListSubscriptionOperationsResponse,
|
|
23
24
|
MapsListOperationsNextResponse,
|
|
24
25
|
MapsListSubscriptionOperationsNextResponse
|
|
@@ -52,22 +53,34 @@ export class MapsImpl implements Maps {
|
|
|
52
53
|
[Symbol.asyncIterator]() {
|
|
53
54
|
return this;
|
|
54
55
|
},
|
|
55
|
-
byPage: () => {
|
|
56
|
-
|
|
56
|
+
byPage: (settings?: PageSettings) => {
|
|
57
|
+
if (settings?.maxPageSize) {
|
|
58
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
59
|
+
}
|
|
60
|
+
return this.listOperationsPagingPage(options, settings);
|
|
57
61
|
}
|
|
58
62
|
};
|
|
59
63
|
}
|
|
60
64
|
|
|
61
65
|
private async *listOperationsPagingPage(
|
|
62
|
-
options?: MapsListOperationsOptionalParams
|
|
66
|
+
options?: MapsListOperationsOptionalParams,
|
|
67
|
+
settings?: PageSettings
|
|
63
68
|
): AsyncIterableIterator<OperationDetail[]> {
|
|
64
|
-
let result
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
let result: MapsListOperationsResponse;
|
|
70
|
+
let continuationToken = settings?.continuationToken;
|
|
71
|
+
if (!continuationToken) {
|
|
72
|
+
result = await this._listOperations(options);
|
|
73
|
+
let page = result.value || [];
|
|
74
|
+
continuationToken = result.nextLink;
|
|
75
|
+
setContinuationToken(page, continuationToken);
|
|
76
|
+
yield page;
|
|
77
|
+
}
|
|
67
78
|
while (continuationToken) {
|
|
68
79
|
result = await this._listOperationsNext(continuationToken, options);
|
|
69
80
|
continuationToken = result.nextLink;
|
|
70
|
-
|
|
81
|
+
let page = result.value || [];
|
|
82
|
+
setContinuationToken(page, continuationToken);
|
|
83
|
+
yield page;
|
|
71
84
|
}
|
|
72
85
|
}
|
|
73
86
|
|
|
@@ -94,25 +107,37 @@ export class MapsImpl implements Maps {
|
|
|
94
107
|
[Symbol.asyncIterator]() {
|
|
95
108
|
return this;
|
|
96
109
|
},
|
|
97
|
-
byPage: () => {
|
|
98
|
-
|
|
110
|
+
byPage: (settings?: PageSettings) => {
|
|
111
|
+
if (settings?.maxPageSize) {
|
|
112
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
113
|
+
}
|
|
114
|
+
return this.listSubscriptionOperationsPagingPage(options, settings);
|
|
99
115
|
}
|
|
100
116
|
};
|
|
101
117
|
}
|
|
102
118
|
|
|
103
119
|
private async *listSubscriptionOperationsPagingPage(
|
|
104
|
-
options?: MapsListSubscriptionOperationsOptionalParams
|
|
120
|
+
options?: MapsListSubscriptionOperationsOptionalParams,
|
|
121
|
+
settings?: PageSettings
|
|
105
122
|
): AsyncIterableIterator<OperationDetail[]> {
|
|
106
|
-
let result
|
|
107
|
-
|
|
108
|
-
|
|
123
|
+
let result: MapsListSubscriptionOperationsResponse;
|
|
124
|
+
let continuationToken = settings?.continuationToken;
|
|
125
|
+
if (!continuationToken) {
|
|
126
|
+
result = await this._listSubscriptionOperations(options);
|
|
127
|
+
let page = result.value || [];
|
|
128
|
+
continuationToken = result.nextLink;
|
|
129
|
+
setContinuationToken(page, continuationToken);
|
|
130
|
+
yield page;
|
|
131
|
+
}
|
|
109
132
|
while (continuationToken) {
|
|
110
133
|
result = await this._listSubscriptionOperationsNext(
|
|
111
134
|
continuationToken,
|
|
112
135
|
options
|
|
113
136
|
);
|
|
114
137
|
continuationToken = result.nextLink;
|
|
115
|
-
|
|
138
|
+
let page = result.value || [];
|
|
139
|
+
setContinuationToken(page, continuationToken);
|
|
140
|
+
yield page;
|
|
116
141
|
}
|
|
117
142
|
}
|
|
118
143
|
|
|
@@ -0,0 +1,39 @@
|
|
|
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 interface PageInfo {
|
|
10
|
+
continuationToken?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const pageMap = new WeakMap<object, PageInfo>();
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Given a result page from a pageable operation, returns a
|
|
17
|
+
* continuation token that can be used to begin paging from
|
|
18
|
+
* that point later.
|
|
19
|
+
* @param page A result object from calling .byPage() on a paged operation.
|
|
20
|
+
* @returns The continuation token that can be passed into byPage().
|
|
21
|
+
*/
|
|
22
|
+
export function getContinuationToken(page: unknown): string | undefined {
|
|
23
|
+
if (typeof page !== "object" || page === null) {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
return pageMap.get(page)?.continuationToken;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function setContinuationToken(
|
|
30
|
+
page: unknown,
|
|
31
|
+
continuationToken: string | undefined
|
|
32
|
+
): void {
|
|
33
|
+
if (typeof page !== "object" || page === null || !continuationToken) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const pageInfo = pageMap.get(page) ?? {};
|
|
37
|
+
pageInfo.continuationToken = continuationToken;
|
|
38
|
+
pageMap.set(page, pageInfo);
|
|
39
|
+
}
|
package/types/arm-maps.d.ts
CHANGED
|
@@ -183,6 +183,8 @@ export declare class AzureMapsManagementClient extends coreClient.ServiceClient
|
|
|
183
183
|
* @param options The parameter options
|
|
184
184
|
*/
|
|
185
185
|
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: AzureMapsManagementClientOptionalParams);
|
|
186
|
+
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
|
|
187
|
+
private addCustomApiVersionPolicy;
|
|
186
188
|
accounts: Accounts;
|
|
187
189
|
maps: Maps;
|
|
188
190
|
creators: Creators;
|
|
@@ -236,7 +238,7 @@ export declare interface CorsRules {
|
|
|
236
238
|
export declare type CreatedByType = string;
|
|
237
239
|
|
|
238
240
|
/** An Azure resource which represents Maps Creator product and provides ability to manage private location data. */
|
|
239
|
-
export declare
|
|
241
|
+
export declare interface Creator extends TrackedResource {
|
|
240
242
|
/** The Creator resource properties. */
|
|
241
243
|
properties: CreatorProperties;
|
|
242
244
|
/**
|
|
@@ -244,7 +246,7 @@ export declare type Creator = TrackedResource & {
|
|
|
244
246
|
* NOTE: This property will not be serialized. It can only be populated by the server.
|
|
245
247
|
*/
|
|
246
248
|
readonly systemData?: SystemData;
|
|
247
|
-
}
|
|
249
|
+
}
|
|
248
250
|
|
|
249
251
|
/** A list of Creator resources. */
|
|
250
252
|
export declare interface CreatorList {
|
|
@@ -437,6 +439,15 @@ export declare interface ErrorResponse {
|
|
|
437
439
|
error?: ErrorDetail;
|
|
438
440
|
}
|
|
439
441
|
|
|
442
|
+
/**
|
|
443
|
+
* Given a result page from a pageable operation, returns a
|
|
444
|
+
* continuation token that can be used to begin paging from
|
|
445
|
+
* that point later.
|
|
446
|
+
* @param page A result object from calling .byPage() on a paged operation.
|
|
447
|
+
* @returns The continuation token that can be passed into byPage().
|
|
448
|
+
*/
|
|
449
|
+
export declare function getContinuationToken(page: unknown): string | undefined;
|
|
450
|
+
|
|
440
451
|
/**
|
|
441
452
|
* Defines values for KeyType. \
|
|
442
453
|
* {@link KnownKeyType} can be used interchangeably with KeyType,
|
|
@@ -460,34 +471,47 @@ export declare type Kind = string;
|
|
|
460
471
|
|
|
461
472
|
/** Known values of {@link CreatedByType} that the service accepts. */
|
|
462
473
|
export declare enum KnownCreatedByType {
|
|
474
|
+
/** User */
|
|
463
475
|
User = "User",
|
|
476
|
+
/** Application */
|
|
464
477
|
Application = "Application",
|
|
478
|
+
/** ManagedIdentity */
|
|
465
479
|
ManagedIdentity = "ManagedIdentity",
|
|
480
|
+
/** Key */
|
|
466
481
|
Key = "Key"
|
|
467
482
|
}
|
|
468
483
|
|
|
469
484
|
/** Known values of {@link KeyType} that the service accepts. */
|
|
470
485
|
export declare enum KnownKeyType {
|
|
486
|
+
/** Primary */
|
|
471
487
|
Primary = "primary",
|
|
488
|
+
/** Secondary */
|
|
472
489
|
Secondary = "secondary"
|
|
473
490
|
}
|
|
474
491
|
|
|
475
492
|
/** Known values of {@link Kind} that the service accepts. */
|
|
476
493
|
export declare enum KnownKind {
|
|
494
|
+
/** Gen1 */
|
|
477
495
|
Gen1 = "Gen1",
|
|
496
|
+
/** Gen2 */
|
|
478
497
|
Gen2 = "Gen2"
|
|
479
498
|
}
|
|
480
499
|
|
|
481
500
|
/** Known values of {@link Name} that the service accepts. */
|
|
482
501
|
export declare enum KnownName {
|
|
502
|
+
/** S0 */
|
|
483
503
|
S0 = "S0",
|
|
504
|
+
/** S1 */
|
|
484
505
|
S1 = "S1",
|
|
506
|
+
/** G2 */
|
|
485
507
|
G2 = "G2"
|
|
486
508
|
}
|
|
487
509
|
|
|
488
510
|
/** Known values of {@link SigningKey} that the service accepts. */
|
|
489
511
|
export declare enum KnownSigningKey {
|
|
512
|
+
/** PrimaryKey */
|
|
490
513
|
PrimaryKey = "primaryKey",
|
|
514
|
+
/** SecondaryKey */
|
|
491
515
|
SecondaryKey = "secondaryKey"
|
|
492
516
|
}
|
|
493
517
|
|
|
@@ -534,7 +558,7 @@ export declare interface Maps {
|
|
|
534
558
|
}
|
|
535
559
|
|
|
536
560
|
/** An Azure resource which represents access to a suite of Maps REST APIs. */
|
|
537
|
-
export declare
|
|
561
|
+
export declare interface MapsAccount extends TrackedResource {
|
|
538
562
|
/** The SKU of this account. */
|
|
539
563
|
sku: Sku;
|
|
540
564
|
/** Get or Set Kind property. */
|
|
@@ -548,7 +572,7 @@ export declare type MapsAccount = TrackedResource & {
|
|
|
548
572
|
identity?: ManagedServiceIdentity;
|
|
549
573
|
/** The map account properties. */
|
|
550
574
|
properties?: MapsAccountProperties;
|
|
551
|
-
}
|
|
575
|
+
}
|
|
552
576
|
|
|
553
577
|
/** The set of keys which can be used to access the Maps REST APIs. Two keys are provided for key rotation without interruption. */
|
|
554
578
|
export declare interface MapsAccountKeys {
|
|
@@ -824,13 +848,13 @@ export declare interface SystemData {
|
|
|
824
848
|
}
|
|
825
849
|
|
|
826
850
|
/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */
|
|
827
|
-
export declare
|
|
851
|
+
export declare interface TrackedResource extends Resource {
|
|
828
852
|
/** Resource tags. */
|
|
829
853
|
tags?: {
|
|
830
854
|
[propertyName: string]: string;
|
|
831
855
|
};
|
|
832
856
|
/** The geo-location where the resource lives */
|
|
833
857
|
location: string;
|
|
834
|
-
}
|
|
858
|
+
}
|
|
835
859
|
|
|
836
860
|
export { }
|