@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.
- package/CHANGELOG.md +42 -27
- package/LICENSE +1 -1
- package/README.md +2 -2
- package/dist/index.js +399 -113
- 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/samples-dev/accountsCreateOrUpdateSample.js +63 -12
- package/dist-esm/samples-dev/accountsCreateOrUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/accountsDeleteSample.js +12 -4
- package/dist-esm/samples-dev/accountsDeleteSample.js.map +1 -1
- package/dist-esm/samples-dev/accountsGetSample.js +12 -4
- package/dist-esm/samples-dev/accountsGetSample.js.map +1 -1
- package/dist-esm/samples-dev/accountsListByResourceGroupSample.js +24 -9
- package/dist-esm/samples-dev/accountsListByResourceGroupSample.js.map +1 -1
- package/dist-esm/samples-dev/accountsListBySubscriptionSample.js +23 -8
- package/dist-esm/samples-dev/accountsListBySubscriptionSample.js.map +1 -1
- package/dist-esm/samples-dev/accountsListKeysSample.js +12 -4
- package/dist-esm/samples-dev/accountsListKeysSample.js.map +1 -1
- package/dist-esm/samples-dev/accountsListSasSample.js +12 -4
- package/dist-esm/samples-dev/accountsListSasSample.js.map +1 -1
- package/dist-esm/samples-dev/accountsRegenerateKeysSample.js +12 -4
- package/dist-esm/samples-dev/accountsRegenerateKeysSample.js.map +1 -1
- package/dist-esm/samples-dev/accountsUpdateSample.js +63 -16
- package/dist-esm/samples-dev/accountsUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/creatorsCreateOrUpdateSample.js +12 -4
- package/dist-esm/samples-dev/creatorsCreateOrUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/creatorsDeleteSample.js +12 -4
- package/dist-esm/samples-dev/creatorsDeleteSample.js.map +1 -1
- package/dist-esm/samples-dev/creatorsGetSample.js +12 -4
- package/dist-esm/samples-dev/creatorsGetSample.js.map +1 -1
- package/dist-esm/samples-dev/creatorsListByAccountSample.js +24 -9
- package/dist-esm/samples-dev/creatorsListByAccountSample.js.map +1 -1
- package/dist-esm/samples-dev/creatorsUpdateSample.js +12 -4
- package/dist-esm/samples-dev/creatorsUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/mapsListOperationsSample.js +22 -9
- package/dist-esm/samples-dev/mapsListOperationsSample.js.map +1 -1
- package/dist-esm/samples-dev/mapsListSubscriptionOperationsSample.js +23 -8
- package/dist-esm/samples-dev/mapsListSubscriptionOperationsSample.js.map +1 -1
- package/dist-esm/src/azureMapsManagementClient.d.ts +4 -1
- package/dist-esm/src/azureMapsManagementClient.d.ts.map +1 -1
- package/dist-esm/src/azureMapsManagementClient.js +57 -28
- 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 +161 -56
- package/dist-esm/src/models/index.d.ts.map +1 -1
- package/dist-esm/src/models/index.js +45 -0
- package/dist-esm/src/models/index.js.map +1 -1
- package/dist-esm/src/models/mappers.d.ts +4 -1
- package/dist-esm/src/models/mappers.d.ts.map +1 -1
- package/dist-esm/src/models/mappers.js +109 -17
- package/dist-esm/src/models/mappers.js.map +1 -1
- package/dist-esm/src/models/parameters.js +1 -1
- package/dist-esm/src/models/parameters.js.map +1 -1
- package/dist-esm/src/operations/accounts.d.ts.map +1 -1
- package/dist-esm/src/operations/accounts.js +61 -26
- 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 +31 -13
- 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 +61 -26
- 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/maps_operations_test.spec.d.ts +4 -0
- package/dist-esm/test/maps_operations_test.spec.d.ts.map +1 -0
- package/dist-esm/test/maps_operations_test.spec.js +140 -0
- package/dist-esm/test/maps_operations_test.spec.js.map +1 -0
- package/package.json +20 -15
- package/review/arm-maps.api.md +78 -35
- package/src/azureMapsManagementClient.ts +78 -24
- package/src/index.ts +1 -0
- package/src/models/index.ts +146 -38
- package/src/models/mappers.ts +112 -19
- package/src/models/parameters.ts +1 -1
- package/src/operations/accounts.ts +46 -19
- package/src/operations/creators.ts +26 -13
- package/src/operations/maps.ts +41 -18
- package/src/pagingHelper.ts +39 -0
- package/types/arm-maps.d.ts +169 -44
- package/types/tsdoc-metadata.json +1 -1
- package/dist-esm/test/sampleTest.d.ts +0 -2
- package/dist-esm/test/sampleTest.d.ts.map +0 -1
- package/dist-esm/test/sampleTest.js +0 -40
- package/dist-esm/test/sampleTest.js.map +0 -1
package/review/arm-maps.api.md
CHANGED
|
@@ -110,6 +110,7 @@ export class AzureMapsManagementClient extends coreClient.ServiceClient {
|
|
|
110
110
|
// (undocumented)
|
|
111
111
|
$host: string;
|
|
112
112
|
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: AzureMapsManagementClientOptionalParams);
|
|
113
|
+
constructor(credentials: coreAuth.TokenCredential, options?: AzureMapsManagementClientOptionalParams);
|
|
113
114
|
// (undocumented)
|
|
114
115
|
accounts: Accounts;
|
|
115
116
|
// (undocumented)
|
|
@@ -119,7 +120,7 @@ export class AzureMapsManagementClient extends coreClient.ServiceClient {
|
|
|
119
120
|
// (undocumented)
|
|
120
121
|
maps: Maps;
|
|
121
122
|
// (undocumented)
|
|
122
|
-
subscriptionId
|
|
123
|
+
subscriptionId?: string;
|
|
123
124
|
}
|
|
124
125
|
|
|
125
126
|
// @public
|
|
@@ -129,12 +130,6 @@ export interface AzureMapsManagementClientOptionalParams extends coreClient.Serv
|
|
|
129
130
|
endpoint?: string;
|
|
130
131
|
}
|
|
131
132
|
|
|
132
|
-
// @public (undocumented)
|
|
133
|
-
export interface Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties {
|
|
134
|
-
readonly clientId?: string;
|
|
135
|
-
readonly principalId?: string;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
133
|
// @public
|
|
139
134
|
export interface CorsRule {
|
|
140
135
|
allowedOrigins: string[];
|
|
@@ -149,10 +144,10 @@ export interface CorsRules {
|
|
|
149
144
|
export type CreatedByType = string;
|
|
150
145
|
|
|
151
146
|
// @public
|
|
152
|
-
export
|
|
147
|
+
export interface Creator extends TrackedResource {
|
|
153
148
|
properties: CreatorProperties;
|
|
154
149
|
readonly systemData?: SystemData;
|
|
155
|
-
}
|
|
150
|
+
}
|
|
156
151
|
|
|
157
152
|
// @public
|
|
158
153
|
export interface CreatorList {
|
|
@@ -223,6 +218,19 @@ export interface CreatorUpdateParameters {
|
|
|
223
218
|
};
|
|
224
219
|
}
|
|
225
220
|
|
|
221
|
+
// @public
|
|
222
|
+
export interface CustomerManagedKeyEncryption {
|
|
223
|
+
keyEncryptionKeyIdentity?: CustomerManagedKeyEncryptionKeyIdentity;
|
|
224
|
+
keyEncryptionKeyUrl?: string;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// @public
|
|
228
|
+
export interface CustomerManagedKeyEncryptionKeyIdentity {
|
|
229
|
+
delegatedIdentityClientId?: string;
|
|
230
|
+
identityType?: IdentityType;
|
|
231
|
+
userAssignedIdentityResourceId?: string;
|
|
232
|
+
}
|
|
233
|
+
|
|
226
234
|
// @public
|
|
227
235
|
export interface Dimension {
|
|
228
236
|
displayName?: string;
|
|
@@ -233,6 +241,12 @@ export interface Dimension {
|
|
|
233
241
|
toBeExportedToShoebox?: boolean;
|
|
234
242
|
}
|
|
235
243
|
|
|
244
|
+
// @public
|
|
245
|
+
export interface Encryption {
|
|
246
|
+
customerManagedKeyEncryption?: CustomerManagedKeyEncryption;
|
|
247
|
+
infrastructureEncryption?: InfrastructureEncryption;
|
|
248
|
+
}
|
|
249
|
+
|
|
236
250
|
// @public
|
|
237
251
|
export interface ErrorAdditionalInfo {
|
|
238
252
|
readonly info?: Record<string, unknown>;
|
|
@@ -253,6 +267,15 @@ export interface ErrorResponse {
|
|
|
253
267
|
error?: ErrorDetail;
|
|
254
268
|
}
|
|
255
269
|
|
|
270
|
+
// @public
|
|
271
|
+
export function getContinuationToken(page: unknown): string | undefined;
|
|
272
|
+
|
|
273
|
+
// @public
|
|
274
|
+
export type IdentityType = string;
|
|
275
|
+
|
|
276
|
+
// @public
|
|
277
|
+
export type InfrastructureEncryption = string;
|
|
278
|
+
|
|
256
279
|
// @public
|
|
257
280
|
type KeyType_2 = string;
|
|
258
281
|
export { KeyType_2 as KeyType }
|
|
@@ -262,47 +285,56 @@ export type Kind = string;
|
|
|
262
285
|
|
|
263
286
|
// @public
|
|
264
287
|
export enum KnownCreatedByType {
|
|
265
|
-
// (undocumented)
|
|
266
288
|
Application = "Application",
|
|
267
|
-
// (undocumented)
|
|
268
289
|
Key = "Key",
|
|
269
|
-
// (undocumented)
|
|
270
290
|
ManagedIdentity = "ManagedIdentity",
|
|
271
|
-
// (undocumented)
|
|
272
291
|
User = "User"
|
|
273
292
|
}
|
|
274
293
|
|
|
294
|
+
// @public
|
|
295
|
+
export enum KnownIdentityType {
|
|
296
|
+
DelegatedResourceIdentity = "delegatedResourceIdentity",
|
|
297
|
+
SystemAssignedIdentity = "systemAssignedIdentity",
|
|
298
|
+
UserAssignedIdentity = "userAssignedIdentity"
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// @public
|
|
302
|
+
export enum KnownInfrastructureEncryption {
|
|
303
|
+
Disabled = "disabled",
|
|
304
|
+
Enabled = "enabled"
|
|
305
|
+
}
|
|
306
|
+
|
|
275
307
|
// @public
|
|
276
308
|
export enum KnownKeyType {
|
|
277
|
-
// (undocumented)
|
|
278
309
|
Primary = "primary",
|
|
279
|
-
// (undocumented)
|
|
280
310
|
Secondary = "secondary"
|
|
281
311
|
}
|
|
282
312
|
|
|
283
313
|
// @public
|
|
284
314
|
export enum KnownKind {
|
|
285
|
-
// (undocumented)
|
|
286
315
|
Gen1 = "Gen1",
|
|
287
|
-
// (undocumented)
|
|
288
316
|
Gen2 = "Gen2"
|
|
289
317
|
}
|
|
290
318
|
|
|
319
|
+
// @public
|
|
320
|
+
export enum KnownManagedServiceIdentityType {
|
|
321
|
+
None = "None",
|
|
322
|
+
SystemAssigned = "SystemAssigned",
|
|
323
|
+
SystemAssignedUserAssigned = "SystemAssigned, UserAssigned",
|
|
324
|
+
UserAssigned = "UserAssigned"
|
|
325
|
+
}
|
|
326
|
+
|
|
291
327
|
// @public
|
|
292
328
|
export enum KnownName {
|
|
293
|
-
// (undocumented)
|
|
294
329
|
G2 = "G2",
|
|
295
|
-
// (undocumented)
|
|
296
330
|
S0 = "S0",
|
|
297
|
-
// (undocumented)
|
|
298
331
|
S1 = "S1"
|
|
299
332
|
}
|
|
300
333
|
|
|
301
334
|
// @public
|
|
302
335
|
export enum KnownSigningKey {
|
|
303
|
-
|
|
336
|
+
ManagedIdentity = "managedIdentity",
|
|
304
337
|
PrimaryKey = "primaryKey",
|
|
305
|
-
// (undocumented)
|
|
306
338
|
SecondaryKey = "secondaryKey"
|
|
307
339
|
}
|
|
308
340
|
|
|
@@ -316,12 +348,15 @@ export interface LinkedResource {
|
|
|
316
348
|
export interface ManagedServiceIdentity {
|
|
317
349
|
readonly principalId?: string;
|
|
318
350
|
readonly tenantId?: string;
|
|
319
|
-
type
|
|
351
|
+
type: ManagedServiceIdentityType;
|
|
320
352
|
userAssignedIdentities?: {
|
|
321
|
-
[propertyName: string]:
|
|
353
|
+
[propertyName: string]: UserAssignedIdentity;
|
|
322
354
|
};
|
|
323
355
|
}
|
|
324
356
|
|
|
357
|
+
// @public
|
|
358
|
+
export type ManagedServiceIdentityType = string;
|
|
359
|
+
|
|
325
360
|
// @public
|
|
326
361
|
export interface Maps {
|
|
327
362
|
listOperations(options?: MapsListOperationsOptionalParams): PagedAsyncIterableIterator<OperationDetail>;
|
|
@@ -329,13 +364,13 @@ export interface Maps {
|
|
|
329
364
|
}
|
|
330
365
|
|
|
331
366
|
// @public
|
|
332
|
-
export
|
|
333
|
-
sku: Sku;
|
|
334
|
-
kind?: Kind;
|
|
335
|
-
readonly systemData?: SystemData;
|
|
367
|
+
export interface MapsAccount extends TrackedResource {
|
|
336
368
|
identity?: ManagedServiceIdentity;
|
|
369
|
+
kind?: Kind;
|
|
337
370
|
properties?: MapsAccountProperties;
|
|
338
|
-
|
|
371
|
+
sku: Sku;
|
|
372
|
+
readonly systemData?: SystemData;
|
|
373
|
+
}
|
|
339
374
|
|
|
340
375
|
// @public
|
|
341
376
|
export interface MapsAccountKeys {
|
|
@@ -349,6 +384,7 @@ export interface MapsAccountKeys {
|
|
|
349
384
|
export interface MapsAccountProperties {
|
|
350
385
|
cors?: CorsRules;
|
|
351
386
|
disableLocalAuth?: boolean;
|
|
387
|
+
encryption?: Encryption;
|
|
352
388
|
linkedResources?: LinkedResource[];
|
|
353
389
|
readonly provisioningState?: string;
|
|
354
390
|
readonly uniqueId?: string;
|
|
@@ -369,6 +405,7 @@ export interface MapsAccountSasToken {
|
|
|
369
405
|
export interface MapsAccountUpdateParameters {
|
|
370
406
|
cors?: CorsRules;
|
|
371
407
|
disableLocalAuth?: boolean;
|
|
408
|
+
encryption?: Encryption;
|
|
372
409
|
identity?: ManagedServiceIdentity;
|
|
373
410
|
kind?: Kind;
|
|
374
411
|
linkedResources?: LinkedResource[];
|
|
@@ -428,9 +465,12 @@ export interface MetricSpecification {
|
|
|
428
465
|
displayName?: string;
|
|
429
466
|
fillGapWithZero?: boolean;
|
|
430
467
|
internalMetricName?: string;
|
|
468
|
+
lockAggregationType?: string;
|
|
431
469
|
name?: string;
|
|
432
470
|
resourceIdDimensionNameOverride?: string;
|
|
433
471
|
sourceMdmAccount?: string;
|
|
472
|
+
sourceMdmNamespace?: string;
|
|
473
|
+
supportedAggregationTypes?: string;
|
|
434
474
|
unit?: string;
|
|
435
475
|
}
|
|
436
476
|
|
|
@@ -461,9 +501,6 @@ export interface Resource {
|
|
|
461
501
|
readonly type?: string;
|
|
462
502
|
}
|
|
463
503
|
|
|
464
|
-
// @public
|
|
465
|
-
export type ResourceIdentityType = "SystemAssigned" | "UserAssigned" | "SystemAssigned, UserAssigned" | "None";
|
|
466
|
-
|
|
467
504
|
// @public
|
|
468
505
|
export interface ServiceSpecification {
|
|
469
506
|
metricSpecifications?: MetricSpecification[];
|
|
@@ -489,12 +526,18 @@ export interface SystemData {
|
|
|
489
526
|
}
|
|
490
527
|
|
|
491
528
|
// @public
|
|
492
|
-
export
|
|
529
|
+
export interface TrackedResource extends Resource {
|
|
530
|
+
location: string;
|
|
493
531
|
tags?: {
|
|
494
532
|
[propertyName: string]: string;
|
|
495
533
|
};
|
|
496
|
-
|
|
497
|
-
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
// @public
|
|
537
|
+
export interface UserAssignedIdentity {
|
|
538
|
+
readonly clientId?: string;
|
|
539
|
+
readonly principalId?: string;
|
|
540
|
+
}
|
|
498
541
|
|
|
499
542
|
// (No @packageDocumentation comment for this package)
|
|
500
543
|
|
|
@@ -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";
|
|
@@ -16,7 +21,7 @@ import { AzureMapsManagementClientOptionalParams } from "./models";
|
|
|
16
21
|
export class AzureMapsManagementClient extends coreClient.ServiceClient {
|
|
17
22
|
$host: string;
|
|
18
23
|
apiVersion: string;
|
|
19
|
-
subscriptionId
|
|
24
|
+
subscriptionId?: string;
|
|
20
25
|
|
|
21
26
|
/**
|
|
22
27
|
* Initializes a new instance of the AzureMapsManagementClient class.
|
|
@@ -28,12 +33,26 @@ export class AzureMapsManagementClient extends coreClient.ServiceClient {
|
|
|
28
33
|
credentials: coreAuth.TokenCredential,
|
|
29
34
|
subscriptionId: string,
|
|
30
35
|
options?: AzureMapsManagementClientOptionalParams
|
|
36
|
+
);
|
|
37
|
+
constructor(
|
|
38
|
+
credentials: coreAuth.TokenCredential,
|
|
39
|
+
options?: AzureMapsManagementClientOptionalParams
|
|
40
|
+
);
|
|
41
|
+
constructor(
|
|
42
|
+
credentials: coreAuth.TokenCredential,
|
|
43
|
+
subscriptionIdOrOptions?: AzureMapsManagementClientOptionalParams | string,
|
|
44
|
+
options?: AzureMapsManagementClientOptionalParams
|
|
31
45
|
) {
|
|
32
46
|
if (credentials === undefined) {
|
|
33
47
|
throw new Error("'credentials' cannot be null");
|
|
34
48
|
}
|
|
35
|
-
|
|
36
|
-
|
|
49
|
+
|
|
50
|
+
let subscriptionId: string | undefined;
|
|
51
|
+
|
|
52
|
+
if (typeof subscriptionIdOrOptions === "string") {
|
|
53
|
+
subscriptionId = subscriptionIdOrOptions;
|
|
54
|
+
} else if (typeof subscriptionIdOrOptions === "object") {
|
|
55
|
+
options = subscriptionIdOrOptions;
|
|
37
56
|
}
|
|
38
57
|
|
|
39
58
|
// Initializing default values for options
|
|
@@ -45,57 +64,92 @@ export class AzureMapsManagementClient extends coreClient.ServiceClient {
|
|
|
45
64
|
credential: credentials
|
|
46
65
|
};
|
|
47
66
|
|
|
48
|
-
const packageDetails = `azsdk-js-arm-maps/3.1.0
|
|
67
|
+
const packageDetails = `azsdk-js-arm-maps/3.1.0`;
|
|
49
68
|
const userAgentPrefix =
|
|
50
69
|
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
51
70
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
52
71
|
: `${packageDetails}`;
|
|
53
72
|
|
|
54
|
-
if (!options.credentialScopes) {
|
|
55
|
-
options.credentialScopes = ["https://management.azure.com/.default"];
|
|
56
|
-
}
|
|
57
73
|
const optionsWithDefaults = {
|
|
58
74
|
...defaults,
|
|
59
75
|
...options,
|
|
60
76
|
userAgentOptions: {
|
|
61
77
|
userAgentPrefix
|
|
62
78
|
},
|
|
63
|
-
|
|
79
|
+
endpoint:
|
|
64
80
|
options.endpoint ?? options.baseUri ?? "https://management.azure.com"
|
|
65
81
|
};
|
|
66
82
|
super(optionsWithDefaults);
|
|
67
83
|
|
|
84
|
+
let bearerTokenAuthenticationPolicyFound: boolean = false;
|
|
68
85
|
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
|
|
69
86
|
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
|
|
70
|
-
|
|
87
|
+
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
|
|
71
88
|
(pipelinePolicy) =>
|
|
72
89
|
pipelinePolicy.name ===
|
|
73
90
|
coreRestPipeline.bearerTokenAuthenticationPolicyName
|
|
74
91
|
);
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
92
|
+
}
|
|
93
|
+
if (
|
|
94
|
+
!options ||
|
|
95
|
+
!options.pipeline ||
|
|
96
|
+
options.pipeline.getOrderedPolicies().length == 0 ||
|
|
97
|
+
!bearerTokenAuthenticationPolicyFound
|
|
98
|
+
) {
|
|
99
|
+
this.pipeline.removePolicy({
|
|
100
|
+
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
|
|
101
|
+
});
|
|
102
|
+
this.pipeline.addPolicy(
|
|
103
|
+
coreRestPipeline.bearerTokenAuthenticationPolicy({
|
|
104
|
+
credential: credentials,
|
|
105
|
+
scopes:
|
|
106
|
+
optionsWithDefaults.credentialScopes ??
|
|
107
|
+
`${optionsWithDefaults.endpoint}/.default`,
|
|
108
|
+
challengeCallbacks: {
|
|
109
|
+
authorizeRequestOnChallenge:
|
|
110
|
+
coreClient.authorizeRequestOnClaimChallenge
|
|
111
|
+
}
|
|
112
|
+
})
|
|
113
|
+
);
|
|
89
114
|
}
|
|
90
115
|
// Parameter assignments
|
|
91
116
|
this.subscriptionId = subscriptionId;
|
|
92
117
|
|
|
93
118
|
// Assigning values to Constant parameters
|
|
94
119
|
this.$host = options.$host || "https://management.azure.com";
|
|
95
|
-
this.apiVersion = options.apiVersion || "
|
|
120
|
+
this.apiVersion = options.apiVersion || "2023-06-01";
|
|
96
121
|
this.accounts = new AccountsImpl(this);
|
|
97
122
|
this.maps = new MapsImpl(this);
|
|
98
123
|
this.creators = new CreatorsImpl(this);
|
|
124
|
+
this.addCustomApiVersionPolicy(options.apiVersion);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
|
|
128
|
+
private addCustomApiVersionPolicy(apiVersion?: string) {
|
|
129
|
+
if (!apiVersion) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
const apiVersionPolicy = {
|
|
133
|
+
name: "CustomApiVersionPolicy",
|
|
134
|
+
async sendRequest(
|
|
135
|
+
request: PipelineRequest,
|
|
136
|
+
next: SendRequest
|
|
137
|
+
): Promise<PipelineResponse> {
|
|
138
|
+
const param = request.url.split("?");
|
|
139
|
+
if (param.length > 1) {
|
|
140
|
+
const newParams = param[1].split("&").map((item) => {
|
|
141
|
+
if (item.indexOf("api-version") > -1) {
|
|
142
|
+
return "api-version=" + apiVersion;
|
|
143
|
+
} else {
|
|
144
|
+
return item;
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
request.url = param[0] + "?" + newParams.join("&");
|
|
148
|
+
}
|
|
149
|
+
return next(request);
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
this.pipeline.addPolicy(apiVersionPolicy);
|
|
99
153
|
}
|
|
100
154
|
|
|
101
155
|
accounts: Accounts;
|
package/src/index.ts
CHANGED