From 73595274140e59220b2b24247774c38519b09aae Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 15 Mar 2022 04:36:51 +0000 Subject: [PATCH] CodeGen from PR 18230 in Azure/azure-rest-api-specs Merge e391ee627007d598e3fff71001858711d6db15f0 into 2abe647120f14bb145968a5543ead8ed51394498 --- sdk/maps/arm-maps/CHANGELOG.md | 28 ++ sdk/maps/arm-maps/README.md | 2 +- sdk/maps/arm-maps/_meta.json | 7 +- sdk/maps/arm-maps/api-extractor.json | 25 +- sdk/maps/arm-maps/package.json | 25 +- sdk/maps/arm-maps/review/arm-maps.api.md | 78 +++++ .../arm-maps/src/azureMapsManagementClient.ts | 4 +- sdk/maps/arm-maps/src/models/index.ts | 132 +++++++- sdk/maps/arm-maps/src/models/mappers.ts | 293 ++++++++++++++++++ sdk/maps/arm-maps/src/models/parameters.ts | 8 +- sdk/maps/arm-maps/src/operations/accounts.ts | 53 ++++ .../src/operationsInterfaces/accounts.ts | 23 ++ sdk/maps/arm-maps/tsconfig.json | 16 +- sdk/maps/ci.mgmt.yml | 7 +- 14 files changed, 669 insertions(+), 32 deletions(-) diff --git a/sdk/maps/arm-maps/CHANGELOG.md b/sdk/maps/arm-maps/CHANGELOG.md index 347a40c1bd1a..898ad8299cf6 100644 --- a/sdk/maps/arm-maps/CHANGELOG.md +++ b/sdk/maps/arm-maps/CHANGELOG.md @@ -1,5 +1,33 @@ # Release History +## 3.1.0-beta.1 (2022-03-15) + +**Features** + + - Added operation Accounts.listSas + - Added Interface AccountSasParameters + - Added Interface AccountsListSasOptionalParams + - Added Interface Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties + - Added Interface CorsRule + - Added Interface CorsRules + - Added Interface LinkedResource + - Added Interface ManagedServiceIdentity + - Added Interface MapsAccountSasToken + - Added Type Alias AccountsListSasResponse + - Added Type Alias ResourceIdentityType + - Added Type Alias SigningKey + - Interface MapsAccountProperties has a new optional parameter cors + - Interface MapsAccountProperties has a new optional parameter linkedResources + - Interface MapsAccountUpdateParameters has a new optional parameter cors + - Interface MapsAccountUpdateParameters has a new optional parameter identity + - Interface MapsAccountUpdateParameters has a new optional parameter linkedResources + - Interface MetricSpecification has a new optional parameter internalMetricName + - Interface MetricSpecification has a new optional parameter sourceMdmAccount + - Type Alias Creator has a new parameter systemData + - Type Alias MapsAccount has a new parameter identity + - Added Enum KnownSigningKey + + ## 3.0.0 (2022-01-19) The package of @azure/arm-maps is using our next generation design principles since version 3.0.0, which contains breaking changes. diff --git a/sdk/maps/arm-maps/README.md b/sdk/maps/arm-maps/README.md index c4e3fcca6f98..5d32e3894055 100644 --- a/sdk/maps/arm-maps/README.md +++ b/sdk/maps/arm-maps/README.md @@ -6,7 +6,7 @@ Azure Maps [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/maps/arm-maps) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-maps) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-maps) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-maps?view=azure-node-preview) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started diff --git a/sdk/maps/arm-maps/_meta.json b/sdk/maps/arm-maps/_meta.json index 8753a63f4217..4fd78e17f338 100644 --- a/sdk/maps/arm-maps/_meta.json +++ b/sdk/maps/arm-maps/_meta.json @@ -1,7 +1,8 @@ { - "commit": "184b23b63ee3a79fb41ca3aa55a31a8d9e636772", + "commit": "85eb3e7dbe23e025b9c838bef309f11a05768f10", "readme": "specification/maps/resource-manager/readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/maps/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220114.1", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/maps/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220105.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "use": "@autorest/typescript@6.0.0-alpha.16.20220114.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.1.1", + "use": "@autorest/typescript@6.0.0-alpha.16.20220105.1" } \ No newline at end of file diff --git a/sdk/maps/arm-maps/api-extractor.json b/sdk/maps/arm-maps/api-extractor.json index 823040788d92..90360c782cf9 100644 --- a/sdk/maps/arm-maps/api-extractor.json +++ b/sdk/maps/arm-maps/api-extractor.json @@ -1,18 +1,31 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", - "docModel": { "enabled": true }, - "apiReport": { "enabled": true, "reportFolder": "./review" }, + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, "dtsRollup": { "enabled": true, "untrimmedFilePath": "", "publicTrimmedFilePath": "./types/arm-maps.d.ts" }, "messages": { - "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, "extractorMessageReporting": { - "ae-missing-release-tag": { "logLevel": "none" }, - "ae-unresolved-link": { "logLevel": "none" } + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } } } -} +} \ No newline at end of file diff --git a/sdk/maps/arm-maps/package.json b/sdk/maps/arm-maps/package.json index 361731f34261..86eed1eba60a 100644 --- a/sdk/maps/arm-maps/package.json +++ b/sdk/maps/arm-maps/package.json @@ -3,8 +3,10 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for AzureMapsManagementClient.", - "version": "3.0.0", - "engines": { "node": ">=12.0.0" }, + "version": "3.1.0-beta.1", + "engines": { + "node": ">=12.0.0" + }, "dependencies": { "@azure/core-paging": "^1.2.0", "@azure/core-client": "^1.0.0", @@ -12,7 +14,13 @@ "@azure/core-rest-pipeline": "^1.1.0", "tslib": "^2.2.0" }, - "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], "license": "MIT", "main": "./dist/index.js", "module": "./dist-esm/src/index.js", @@ -39,7 +47,9 @@ "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" }, - "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, "files": [ "dist/**/*.js", "dist/**/*.js.map", @@ -86,10 +96,5 @@ "docs": "echo skipped" }, "sideEffects": false, - "//metadata": { - "constantPaths": [ - { "path": "src/AzureMapsManagementClient.ts", "prefix": "packageDetails" } - ] - }, "autoPublish": true -} +} \ No newline at end of file diff --git a/sdk/maps/arm-maps/review/arm-maps.api.md b/sdk/maps/arm-maps/review/arm-maps.api.md index 93f360e8d6ae..27ea79d8b6f1 100644 --- a/sdk/maps/arm-maps/review/arm-maps.api.md +++ b/sdk/maps/arm-maps/review/arm-maps.api.md @@ -16,10 +16,21 @@ export interface Accounts { listByResourceGroup(resourceGroupName: string, options?: AccountsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; listBySubscription(options?: AccountsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; listKeys(resourceGroupName: string, accountName: string, options?: AccountsListKeysOptionalParams): Promise; + listSas(resourceGroupName: string, accountName: string, mapsAccountSasParameters: AccountSasParameters, options?: AccountsListSasOptionalParams): Promise; regenerateKeys(resourceGroupName: string, accountName: string, keySpecification: MapsKeySpecification, options?: AccountsRegenerateKeysOptionalParams): Promise; update(resourceGroupName: string, accountName: string, mapsAccountUpdateParameters: MapsAccountUpdateParameters, options?: AccountsUpdateOptionalParams): Promise; } +// @public +export interface AccountSasParameters { + expiry: string; + maxRatePerSecond: number; + principalId: string; + regions?: string[]; + signingKey: SigningKey; + start: string; +} + // @public export interface AccountsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { } @@ -73,6 +84,13 @@ export interface AccountsListKeysOptionalParams extends coreClient.OperationOpti // @public export type AccountsListKeysResponse = MapsAccountKeys; +// @public +export interface AccountsListSasOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccountsListSasResponse = MapsAccountSasToken; + // @public export interface AccountsRegenerateKeysOptionalParams extends coreClient.OperationOptions { } @@ -111,12 +129,29 @@ export interface AzureMapsManagementClientOptionalParams extends coreClient.Serv endpoint?: string; } +// @public (undocumented) +export interface Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties { + readonly clientId?: string; + readonly principalId?: string; +} + +// @public +export interface CorsRule { + allowedOrigins: string[]; +} + +// @public +export interface CorsRules { + corsRules?: CorsRule[]; +} + // @public export type CreatedByType = string; // @public export type Creator = TrackedResource & { properties: CreatorProperties; + readonly systemData?: SystemData; }; // @public @@ -263,6 +298,30 @@ export enum KnownName { S1 = "S1" } +// @public +export enum KnownSigningKey { + // (undocumented) + PrimaryKey = "primaryKey", + // (undocumented) + SecondaryKey = "secondaryKey" +} + +// @public +export interface LinkedResource { + id: string; + uniqueName: string; +} + +// @public +export interface ManagedServiceIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type?: ResourceIdentityType; + userAssignedIdentities?: { + [propertyName: string]: Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties; + }; +} + // @public export interface Maps { listOperations(options?: MapsListOperationsOptionalParams): PagedAsyncIterableIterator; @@ -274,6 +333,7 @@ export type MapsAccount = TrackedResource & { sku: Sku; kind?: Kind; readonly systemData?: SystemData; + identity?: ManagedServiceIdentity; properties?: MapsAccountProperties; }; @@ -287,7 +347,9 @@ export interface MapsAccountKeys { // @public export interface MapsAccountProperties { + cors?: CorsRules; disableLocalAuth?: boolean; + linkedResources?: LinkedResource[]; readonly provisioningState?: string; readonly uniqueId?: string; } @@ -298,10 +360,18 @@ export interface MapsAccounts { readonly value?: MapsAccount[]; } +// @public +export interface MapsAccountSasToken { + readonly accountSasToken?: string; +} + // @public export interface MapsAccountUpdateParameters { + cors?: CorsRules; disableLocalAuth?: boolean; + identity?: ManagedServiceIdentity; kind?: Kind; + linkedResources?: LinkedResource[]; readonly provisioningState?: string; sku?: Sku; tags?: { @@ -357,8 +427,10 @@ export interface MetricSpecification { displayDescription?: string; displayName?: string; fillGapWithZero?: boolean; + internalMetricName?: string; name?: string; resourceIdDimensionNameOverride?: string; + sourceMdmAccount?: string; unit?: string; } @@ -389,11 +461,17 @@ export interface Resource { readonly type?: string; } +// @public +export type ResourceIdentityType = "SystemAssigned" | "UserAssigned" | "SystemAssigned, UserAssigned" | "None"; + // @public export interface ServiceSpecification { metricSpecifications?: MetricSpecification[]; } +// @public +export type SigningKey = string; + // @public export interface Sku { name: Name; diff --git a/sdk/maps/arm-maps/src/azureMapsManagementClient.ts b/sdk/maps/arm-maps/src/azureMapsManagementClient.ts index 0240565f3c4d..40e051c78356 100644 --- a/sdk/maps/arm-maps/src/azureMapsManagementClient.ts +++ b/sdk/maps/arm-maps/src/azureMapsManagementClient.ts @@ -44,7 +44,7 @@ export class AzureMapsManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-maps/3.0.0`; + const packageDetails = `azsdk-js-arm-maps/3.1.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -67,7 +67,7 @@ export class AzureMapsManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-02-01"; + this.apiVersion = options.apiVersion || "2021-12-01-preview"; this.accounts = new AccountsImpl(this); this.maps = new MapsImpl(this); this.creators = new CreatorsImpl(this); diff --git a/sdk/maps/arm-maps/src/models/index.ts b/sdk/maps/arm-maps/src/models/index.ts index 67c0170bff99..2d1cac75b224 100644 --- a/sdk/maps/arm-maps/src/models/index.ts +++ b/sdk/maps/arm-maps/src/models/index.ts @@ -35,6 +35,39 @@ export interface SystemData { lastModifiedAt?: Date; } +/** Identity for the resource. */ +export interface ManagedServiceIdentity { + /** + * The principal ID of resource identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The tenant ID of resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** The identity type. */ + type?: ResourceIdentityType; + /** The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ + userAssignedIdentities?: { + [propertyName: string]: Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties; + }; +} + +export interface Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties { + /** + * The principal id of user assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The client id of user assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clientId?: string; +} + /** Additional Map account properties */ export interface MapsAccountProperties { /** @@ -45,10 +78,34 @@ export interface MapsAccountProperties { /** Allows toggle functionality on Azure Policy to disable Azure Maps local authentication support. This will disable Shared Keys authentication from any usage. */ disableLocalAuth?: boolean; /** - * the state of the provisioning. + * The provisioning state of the Map account resource. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: string; + /** Sets the resources to be used for Managed Identities based operations for the Map account resource. */ + linkedResources?: LinkedResource[]; + /** Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Blob service. */ + cors?: CorsRules; +} + +/** Linked resource is reference to a resource deployed in an Azure subscription, add the linked resource `uniqueName` value as an optional parameter for operations on Azure Maps Geospatial REST APIs. */ +export interface LinkedResource { + /** A provided name which uniquely identifies the linked resource. */ + uniqueName: string; + /** ARM resource id in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/accounts/{storageName}'. */ + id: string; +} + +/** Sets the CORS rules. You can include up to five CorsRule elements in the request. */ +export interface CorsRules { + /** The list of CORS rules. You can include up to five CorsRule elements in the request. */ + corsRules?: CorsRule[]; +} + +/** Specifies a CORS rule for the Map Account. */ +export interface CorsRule { + /** Required if CorsRule element is present. A list of origin domains that will be allowed via CORS, or "*" to allow all domains */ + allowedOrigins: string[]; } /** Common fields that are returned in the response for all Azure Resource Manager resources */ @@ -127,6 +184,8 @@ export interface MapsAccountUpdateParameters { kind?: Kind; /** The SKU of this account. */ sku?: Sku; + /** Sets the identity property for maps account. */ + identity?: ManagedServiceIdentity; /** * A unique identifier for the maps account * NOTE: This property will not be serialized. It can only be populated by the server. @@ -135,10 +194,14 @@ export interface MapsAccountUpdateParameters { /** Allows toggle functionality on Azure Policy to disable Azure Maps local authentication support. This will disable Shared Keys authentication from any usage. */ disableLocalAuth?: boolean; /** - * the state of the provisioning. + * The provisioning state of the Map account resource. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: string; + /** Sets the resources to be used for Managed Identities based operations for the Map account resource. */ + linkedResources?: LinkedResource[]; + /** Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Blob service. */ + cors?: CorsRules; } /** A list of Maps Accounts. */ @@ -155,6 +218,31 @@ export interface MapsAccounts { nextLink?: string; } +/** Parameters used to create an account Shared Access Signature (SAS) token. The REST API access control is provided by Azure Maps Role Based Access (RBAC) identity and access. */ +export interface AccountSasParameters { + /** The Map account key to use for signing. */ + signingKey: SigningKey; + /** The principal Id also known as the object Id of a User Assigned Managed Identity currently assigned to the Map Account. To assign a Managed Identity of the account, use operation Create or Update an assign a User Assigned Identity resource Id. */ + principalId: string; + /** Optional, allows control of which region locations are permitted access to Azure Maps REST APIs with the SAS token. Example: "eastus", "westus2". Omitting this parameter will allow all region locations to be accessible. */ + regions?: string[]; + /** Required parameter which represents the desired maximum request per second to allowed for the given SAS token. This does not guarantee perfect accuracy in measurements but provides application safe guards of abuse with eventual enforcement. */ + maxRatePerSecond: number; + /** The date time offset of when the token validity begins. For example "2017-05-24T10:42:03.1567373Z". */ + start: string; + /** The date time offset of when the token validity expires. For example "2017-05-24T10:42:03.1567373Z" */ + expiry: string; +} + +/** A new Sas token which can be used to access the Maps REST APIs and is controlled by the specified Managed identity permissions on Azure (IAM) Role Based Access Control. */ +export interface MapsAccountSasToken { + /** + * The shared access signature access token. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly accountSasToken?: string; +} + /** The set of keys which can be used to access the Maps REST APIs. Two keys are provided for key rotation without interruption. */ export interface MapsAccountKeys { /** @@ -251,6 +339,10 @@ export interface MetricSpecification { category?: string; /** Account Resource Id. */ resourceIdDimensionNameOverride?: string; + /** Source metrics account. */ + sourceMdmAccount?: string; + /** Internal metric name. */ + internalMetricName?: string; } /** Dimension of map account, for example API Category, Api Name, Result Type, and Response Code. */ @@ -326,6 +418,8 @@ export type MapsAccount = TrackedResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly systemData?: SystemData; + /** Sets the identity property for maps account. */ + identity?: ManagedServiceIdentity; /** The map account properties. */ properties?: MapsAccountProperties; }; @@ -334,6 +428,11 @@ export type MapsAccount = TrackedResource & { export type Creator = TrackedResource & { /** The Creator resource properties. */ properties: CreatorProperties; + /** + * The system meta data relating to this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; }; /** Known values of {@link Name} that the service accepts. */ @@ -390,6 +489,22 @@ export enum KnownCreatedByType { */ export type CreatedByType = string; +/** Known values of {@link SigningKey} that the service accepts. */ +export enum KnownSigningKey { + PrimaryKey = "primaryKey", + SecondaryKey = "secondaryKey" +} + +/** + * Defines values for SigningKey. \ + * {@link KnownSigningKey} can be used interchangeably with SigningKey, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **primaryKey** \ + * **secondaryKey** + */ +export type SigningKey = string; + /** Known values of {@link KeyType} that the service accepts. */ export enum KnownKeyType { Primary = "primary", @@ -405,6 +520,12 @@ export enum KnownKeyType { * **secondary** */ export type KeyType = string; +/** Defines values for ResourceIdentityType. */ +export type ResourceIdentityType = + | "SystemAssigned" + | "UserAssigned" + | "SystemAssigned, UserAssigned" + | "None"; /** Optional parameters. */ export interface AccountsCreateOrUpdateOptionalParams @@ -445,6 +566,13 @@ export interface AccountsListBySubscriptionOptionalParams /** Contains response data for the listBySubscription operation. */ export type AccountsListBySubscriptionResponse = MapsAccounts; +/** Optional parameters. */ +export interface AccountsListSasOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listSas operation. */ +export type AccountsListSasResponse = MapsAccountSasToken; + /** Optional parameters. */ export interface AccountsListKeysOptionalParams extends coreClient.OperationOptions {} diff --git a/sdk/maps/arm-maps/src/models/mappers.ts b/sdk/maps/arm-maps/src/models/mappers.ts index 942aef0f0794..abf7a7302b38 100644 --- a/sdk/maps/arm-maps/src/models/mappers.ts +++ b/sdk/maps/arm-maps/src/models/mappers.ts @@ -76,6 +76,78 @@ export const SystemData: coreClient.CompositeMapper = { } }; +export const ManagedServiceIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedServiceIdentity", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "String" + } + }, + tenantId: { + serializedName: "tenantId", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "Enum", + allowedValues: [ + "SystemAssigned", + "UserAssigned", + "SystemAssigned, UserAssigned", + "None" + ] + } + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { + name: "Composite", + className: + "Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties" + } + } + } + } + } + } +}; + +export const Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: + "Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "String" + } + }, + clientId: { + serializedName: "clientId", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + export const MapsAccountProperties: coreClient.CompositeMapper = { type: { name: "Composite", @@ -101,6 +173,96 @@ export const MapsAccountProperties: coreClient.CompositeMapper = { type: { name: "String" } + }, + linkedResources: { + constraints: { + MaxItems: 10 + }, + serializedName: "linkedResources", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LinkedResource" + } + } + } + }, + cors: { + serializedName: "cors", + type: { + name: "Composite", + className: "CorsRules" + } + } + } + } +}; + +export const LinkedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LinkedResource", + modelProperties: { + uniqueName: { + serializedName: "uniqueName", + required: true, + type: { + name: "String" + } + }, + id: { + serializedName: "id", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const CorsRules: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CorsRules", + modelProperties: { + corsRules: { + constraints: { + MaxItems: 5 + }, + serializedName: "corsRules", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CorsRule" + } + } + } + } + } + } +}; + +export const CorsRule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CorsRule", + modelProperties: { + allowedOrigins: { + serializedName: "allowedOrigins", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } } } } @@ -258,6 +420,13 @@ export const MapsAccountUpdateParameters: coreClient.CompositeMapper = { className: "Sku" } }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedServiceIdentity" + } + }, uniqueId: { serializedName: "properties.uniqueId", readOnly: true, @@ -278,6 +447,28 @@ export const MapsAccountUpdateParameters: coreClient.CompositeMapper = { type: { name: "String" } + }, + linkedResources: { + constraints: { + MaxItems: 10 + }, + serializedName: "properties.linkedResources", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LinkedResource" + } + } + } + }, + cors: { + serializedName: "properties.cors", + type: { + name: "Composite", + className: "CorsRules" + } } } } @@ -311,6 +502,82 @@ export const MapsAccounts: coreClient.CompositeMapper = { } }; +export const AccountSasParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountSasParameters", + modelProperties: { + signingKey: { + serializedName: "signingKey", + required: true, + type: { + name: "String" + } + }, + principalId: { + serializedName: "principalId", + required: true, + type: { + name: "String" + } + }, + regions: { + serializedName: "regions", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + maxRatePerSecond: { + defaultValue: 500, + constraints: { + InclusiveMaximum: 500, + ExclusiveMinimum: 0 + }, + serializedName: "maxRatePerSecond", + required: true, + type: { + name: "Number" + } + }, + start: { + serializedName: "start", + required: true, + type: { + name: "String" + } + }, + expiry: { + serializedName: "expiry", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const MapsAccountSasToken: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MapsAccountSasToken", + modelProperties: { + accountSasToken: { + serializedName: "accountSasToken", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + export const MapsAccountKeys: coreClient.CompositeMapper = { type: { name: "Composite", @@ -551,6 +818,18 @@ export const MetricSpecification: coreClient.CompositeMapper = { type: { name: "String" } + }, + sourceMdmAccount: { + serializedName: "sourceMdmAccount", + type: { + name: "String" + } + }, + internalMetricName: { + serializedName: "internalMetricName", + type: { + name: "String" + } } } } @@ -740,6 +1019,13 @@ export const MapsAccount: coreClient.CompositeMapper = { className: "SystemData" } }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedServiceIdentity" + } + }, properties: { serializedName: "properties", type: { @@ -763,6 +1049,13 @@ export const Creator: coreClient.CompositeMapper = { name: "Composite", className: "CreatorProperties" } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } } } } diff --git a/sdk/maps/arm-maps/src/models/parameters.ts b/sdk/maps/arm-maps/src/models/parameters.ts index b5296eb43c44..4ebb6884234b 100644 --- a/sdk/maps/arm-maps/src/models/parameters.ts +++ b/sdk/maps/arm-maps/src/models/parameters.ts @@ -14,6 +14,7 @@ import { import { MapsAccount as MapsAccountMapper, MapsAccountUpdateParameters as MapsAccountUpdateParametersMapper, + AccountSasParameters as AccountSasParametersMapper, MapsKeySpecification as MapsKeySpecificationMapper, Creator as CreatorMapper, CreatorUpdateParameters as CreatorUpdateParametersMapper @@ -63,7 +64,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-02-01", + defaultValue: "2021-12-01-preview", isConstant: true, serializedName: "api-version", type: { @@ -117,6 +118,11 @@ export const mapsAccountUpdateParameters: OperationParameter = { mapper: MapsAccountUpdateParametersMapper }; +export const mapsAccountSasParameters: OperationParameter = { + parameterPath: "mapsAccountSasParameters", + mapper: AccountSasParametersMapper +}; + export const keySpecification: OperationParameter = { parameterPath: "keySpecification", mapper: MapsKeySpecificationMapper diff --git a/sdk/maps/arm-maps/src/operations/accounts.ts b/sdk/maps/arm-maps/src/operations/accounts.ts index 015b813e530a..f36f7822983a 100644 --- a/sdk/maps/arm-maps/src/operations/accounts.ts +++ b/sdk/maps/arm-maps/src/operations/accounts.ts @@ -28,6 +28,9 @@ import { AccountsGetResponse, AccountsListByResourceGroupResponse, AccountsListBySubscriptionResponse, + AccountSasParameters, + AccountsListSasOptionalParams, + AccountsListSasResponse, AccountsListKeysOptionalParams, AccountsListKeysResponse, MapsKeySpecification, @@ -247,6 +250,32 @@ export class AccountsImpl implements Accounts { ); } + /** + * Create and list an account shared access signature token. Use this SAS token for authentication to + * Azure Maps REST APIs through various Azure Maps SDKs. As prerequisite to create a SAS Token. + * + * Prerequisites: + * 1. Create or have an existing User Assigned Managed Identity in the same Azure region as the + * account. + * 2. Create or update an Azure Map account with the same Azure region as the User Assigned Managed + * Identity is placed. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Maps Account. + * @param mapsAccountSasParameters The updated parameters for the Maps Account. + * @param options The options parameters. + */ + listSas( + resourceGroupName: string, + accountName: string, + mapsAccountSasParameters: AccountSasParameters, + options?: AccountsListSasOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, mapsAccountSasParameters, options }, + listSasOperationSpec + ); + } + /** * Get the keys to use with the Maps APIs. A key is used to authenticate and authorize access to the * Maps REST APIs. Only one key is needed at a time; two are given to provide seamless key @@ -452,6 +481,30 @@ const listBySubscriptionOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const listSasOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/listSas", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.MapsAccountSasToken + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.mapsAccountSasParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; const listKeysOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/listKeys", diff --git a/sdk/maps/arm-maps/src/operationsInterfaces/accounts.ts b/sdk/maps/arm-maps/src/operationsInterfaces/accounts.ts index 1680a064e645..d4eeeb38ec82 100644 --- a/sdk/maps/arm-maps/src/operationsInterfaces/accounts.ts +++ b/sdk/maps/arm-maps/src/operationsInterfaces/accounts.ts @@ -19,6 +19,9 @@ import { AccountsDeleteOptionalParams, AccountsGetOptionalParams, AccountsGetResponse, + AccountSasParameters, + AccountsListSasOptionalParams, + AccountsListSasResponse, AccountsListKeysOptionalParams, AccountsListKeysResponse, MapsKeySpecification, @@ -95,6 +98,26 @@ export interface Accounts { accountName: string, options?: AccountsGetOptionalParams ): Promise; + /** + * Create and list an account shared access signature token. Use this SAS token for authentication to + * Azure Maps REST APIs through various Azure Maps SDKs. As prerequisite to create a SAS Token. + * + * Prerequisites: + * 1. Create or have an existing User Assigned Managed Identity in the same Azure region as the + * account. + * 2. Create or update an Azure Map account with the same Azure region as the User Assigned Managed + * Identity is placed. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Maps Account. + * @param mapsAccountSasParameters The updated parameters for the Maps Account. + * @param options The options parameters. + */ + listSas( + resourceGroupName: string, + accountName: string, + mapsAccountSasParameters: AccountSasParameters, + options?: AccountsListSasOptionalParams + ): Promise; /** * Get the keys to use with the Maps APIs. A key is used to authenticate and authorize access to the * Maps REST APIs. Only one key is needed at a time; two are given to provide seamless key diff --git a/sdk/maps/arm-maps/tsconfig.json b/sdk/maps/arm-maps/tsconfig.json index 6e3251194117..3e6ae96443f3 100644 --- a/sdk/maps/arm-maps/tsconfig.json +++ b/sdk/maps/arm-maps/tsconfig.json @@ -9,11 +9,19 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6", "dom"], + "lib": [ + "es6", + "dom" + ], "declaration": true, "outDir": "./dist-esm", "importHelpers": true }, - "include": ["./src/**/*.ts", "./test/**/*.ts"], - "exclude": ["node_modules"] -} + "include": [ + "./src/**/*.ts", + "./test/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/sdk/maps/ci.mgmt.yml b/sdk/maps/ci.mgmt.yml index da61725c06f8..d7c8bd67184c 100644 --- a/sdk/maps/ci.mgmt.yml +++ b/sdk/maps/ci.mgmt.yml @@ -1,5 +1,5 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - + trigger: branches: include: @@ -10,6 +10,7 @@ trigger: include: - sdk/maps/ci.mgmt.yml - sdk/maps/arm-maps/ + - sdk/maps/arm-maps pr: branches: include: @@ -23,11 +24,11 @@ pr: include: - sdk/maps/ci.mgmt.yml - sdk/maps/arm-maps/ - + - sdk/maps/arm-maps extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: ServiceDirectory: maps Artifacts: - name: azure-arm-maps - safeName: azurearmmaps \ No newline at end of file + safeName: azurearmmaps