diff --git a/sdk/maps/arm-maps/LICENSE.txt b/sdk/maps/arm-maps/LICENSE.txt index a70e8cf66038..2d3163745319 100644 --- a/sdk/maps/arm-maps/LICENSE.txt +++ b/sdk/maps/arm-maps/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Microsoft +Copyright (c) 2021 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/maps/arm-maps/README.md b/sdk/maps/arm-maps/README.md index 83ac00dbb066..2d32ae2c254a 100644 --- a/sdk/maps/arm-maps/README.md +++ b/sdk/maps/arm-maps/README.md @@ -1,6 +1,6 @@ -## Azure MapsManagementClient SDK for JavaScript +## Azure AzureMapsManagementClient SDK for JavaScript -This package contains an isomorphic SDK for MapsManagementClient. +This package contains an isomorphic SDK for AzureMapsManagementClient. ### Currently supported environments @@ -9,31 +9,31 @@ This package contains an isomorphic SDK for MapsManagementClient. ### How to Install -``` +```bash npm install @azure/arm-maps ``` ### How to use -#### nodejs - Authentication, client creation and get accounts as an example written in TypeScript. +#### nodejs - client creation and get accounts as an example written in TypeScript. ##### Install @azure/ms-rest-nodeauth -``` -npm install @azure/ms-rest-nodeauth +- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. +```bash +npm install @azure/ms-rest-nodeauth@"^3.0.0" ``` ##### Sample code -```ts -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; -import { MapsManagementClient, MapsManagementModels, MapsManagementMappers } from "@azure/arm-maps"; +While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package +```typescript +const msRestNodeAuth = require("@azure/ms-rest-nodeauth"); +const { AzureMapsManagementClient } = require("@azure/arm-maps"); const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; msRestNodeAuth.interactiveLogin().then((creds) => { - const client = new MapsManagementClient(creds, subscriptionId); + const client = new AzureMapsManagementClient(creds, subscriptionId); const resourceGroupName = "testresourceGroupName"; const accountName = "testaccountName"; client.accounts.get(resourceGroupName, accountName).then((result) => { @@ -49,7 +49,7 @@ msRestNodeAuth.interactiveLogin().then((creds) => { ##### Install @azure/ms-rest-browserauth -``` +```bash npm install @azure/ms-rest-browserauth ``` @@ -78,7 +78,7 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to // may cause redirects authManager.login(); } - const client = new Azure.ArmMaps.MapsManagementClient(res.creds, subscriptionId); + const client = new Azure.ArmMaps.AzureMapsManagementClient(res.creds, subscriptionId); const resourceGroupName = "testresourceGroupName"; const accountName = "testaccountName"; client.accounts.get(resourceGroupName, accountName).then((result) => { @@ -99,5 +99,4 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fmaps%2Farm-maps%2FREADME.png) +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/maps/arm-maps/README.png) diff --git a/sdk/maps/arm-maps/package.json b/sdk/maps/arm-maps/package.json index 5b6c262d9386..f8776f2118f0 100644 --- a/sdk/maps/arm-maps/package.json +++ b/sdk/maps/arm-maps/package.json @@ -1,12 +1,12 @@ { "name": "@azure/arm-maps", "author": "Microsoft Corporation", - "description": "MapsManagementClient Library with typescript type definitions for node.js and browser.", + "description": "AzureMapsManagementClient Library with typescript type definitions for node.js and browser.", "version": "1.1.0", "dependencies": { - "@azure/ms-rest-azure-js": "^1.1.0", - "@azure/ms-rest-js": "^1.1.0", - "tslib": "^1.9.3" + "@azure/ms-rest-azure-js": "^2.0.1", + "@azure/ms-rest-js": "^2.0.4", + "tslib": "^1.10.0" }, "keywords": [ "node", @@ -17,21 +17,22 @@ ], "license": "MIT", "main": "./dist/arm-maps.js", - "module": "./esm/mapsManagementClient.js", - "types": "./esm/mapsManagementClient.d.ts", + "module": "./esm/azureMapsManagementClient.js", + "types": "./esm/azureMapsManagementClient.d.ts", "devDependencies": { - "typescript": "^3.1.1", - "rollup": "^0.66.2", - "rollup-plugin-node-resolve": "^3.4.0", - "uglify-js": "^3.4.9" + "typescript": "^3.5.3", + "rollup": "^1.18.0", + "rollup-plugin-node-resolve": "^5.2.0", + "rollup-plugin-sourcemaps": "^0.4.2", + "uglify-js": "^3.6.0" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/sdk/maps/arm-maps", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/maps/arm-maps", "repository": { "type": "git", - "url": "https://github.com/azure/azure-sdk-for-js.git" + "url": "https://github.com/Azure/azure-sdk-for-js.git" }, "bugs": { - "url": "https://github.com/azure/azure-sdk-for-js/issues" + "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "files": [ "dist/**/*.js", @@ -43,6 +44,7 @@ "esm/**/*.d.ts", "esm/**/*.d.ts.map", "src/**/*.ts", + "README.md", "rollup.config.js", "tsconfig.json" ], diff --git a/sdk/maps/arm-maps/rollup.config.js b/sdk/maps/arm-maps/rollup.config.js index 4ea68c8f828a..81dee1f0400d 100644 --- a/sdk/maps/arm-maps/rollup.config.js +++ b/sdk/maps/arm-maps/rollup.config.js @@ -1,10 +1,16 @@ +import rollup from "rollup"; import nodeResolve from "rollup-plugin-node-resolve"; +import sourcemaps from "rollup-plugin-sourcemaps"; + /** - * @type {import('rollup').RollupFileOptions} + * @type {rollup.RollupFileOptions} */ const config = { - input: './esm/mapsManagementClient.js', - external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"], + input: "./esm/azureMapsManagementClient.js", + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], output: { file: "./dist/arm-maps.js", format: "umd", @@ -15,17 +21,17 @@ const config = { "@azure/ms-rest-azure-js": "msRestAzure" }, banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */` }, plugins: [ - nodeResolve({ module: true }) + nodeResolve({ mainFields: ['module', 'main'] }), + sourcemaps() ] }; + export default config; diff --git a/sdk/maps/arm-maps/src/mapsManagementClient.ts b/sdk/maps/arm-maps/src/azureMapsManagementClient.ts similarity index 50% rename from sdk/maps/arm-maps/src/mapsManagementClient.ts rename to sdk/maps/arm-maps/src/azureMapsManagementClient.ts index 067726ebb38c..827681614f0b 100644 --- a/sdk/maps/arm-maps/src/mapsManagementClient.ts +++ b/sdk/maps/arm-maps/src/azureMapsManagementClient.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -12,32 +11,35 @@ import * as msRest from "@azure/ms-rest-js"; import * as Models from "./models"; import * as Mappers from "./models/mappers"; import * as operations from "./operations"; -import { MapsManagementClientContext } from "./mapsManagementClientContext"; +import { AzureMapsManagementClientContext } from "./azureMapsManagementClientContext"; -class MapsManagementClient extends MapsManagementClientContext { +class AzureMapsManagementClient extends AzureMapsManagementClientContext { // Operation groups accounts: operations.Accounts; + maps: operations.Maps; + creators: operations.Creators; /** - * Initializes a new instance of the MapsManagementClient class. + * Initializes a new instance of the AzureMapsManagementClient class. * @param credentials Credentials needed for the client to connect to Azure. - * @param subscriptionId Subscription credentials which uniquely identify Microsoft Azure - * subscription. The subscription ID forms part of the URI for every service call. + * @param subscriptionId The ID of the target subscription. * @param [options] The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.MapsManagementClientOptions) { + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.AzureMapsManagementClientOptions) { super(credentials, subscriptionId, options); this.accounts = new operations.Accounts(this); + this.maps = new operations.Maps(this); + this.creators = new operations.Creators(this); } } // Operation Specifications export { - MapsManagementClient, - MapsManagementClientContext, - Models as MapsManagementModels, - Mappers as MapsManagementMappers + AzureMapsManagementClient, + AzureMapsManagementClientContext, + Models as AzureMapsManagementModels, + Mappers as AzureMapsManagementMappers }; export * from "./operations"; diff --git a/sdk/maps/arm-maps/src/mapsManagementClientContext.ts b/sdk/maps/arm-maps/src/azureMapsManagementClientContext.ts similarity index 74% rename from sdk/maps/arm-maps/src/mapsManagementClientContext.ts rename to sdk/maps/arm-maps/src/azureMapsManagementClientContext.ts index 3e74ac3f6452..f035bf1c687b 100644 --- a/sdk/maps/arm-maps/src/mapsManagementClientContext.ts +++ b/sdk/maps/arm-maps/src/azureMapsManagementClientContext.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -13,21 +12,20 @@ import * as msRest from "@azure/ms-rest-js"; import * as msRestAzure from "@azure/ms-rest-azure-js"; const packageName = "@azure/arm-maps"; -const packageVersion = "0.1.0"; +const packageVersion = "1.1.0"; -export class MapsManagementClientContext extends msRestAzure.AzureServiceClient { +export class AzureMapsManagementClientContext extends msRestAzure.AzureServiceClient { credentials: msRest.ServiceClientCredentials; subscriptionId: string; apiVersion?: string; /** - * Initializes a new instance of the MapsManagementClient class. + * Initializes a new instance of the AzureMapsManagementClient class. * @param credentials Credentials needed for the client to connect to Azure. - * @param subscriptionId Subscription credentials which uniquely identify Microsoft Azure - * subscription. The subscription ID forms part of the URI for every service call. + * @param subscriptionId The ID of the target subscription. * @param [options] The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.MapsManagementClientOptions) { + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.AzureMapsManagementClientOptions) { if (credentials == undefined) { throw new Error('\'credentials\' cannot be null.'); } @@ -45,7 +43,7 @@ export class MapsManagementClientContext extends msRestAzure.AzureServiceClient super(credentials, options); - this.apiVersion = '2018-05-01'; + this.apiVersion = '2021-02-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; diff --git a/sdk/maps/arm-maps/src/models/accountsMappers.ts b/sdk/maps/arm-maps/src/models/accountsMappers.ts index 13e80f28e397..3fe2d6b37e1c 100644 --- a/sdk/maps/arm-maps/src/models/accountsMappers.ts +++ b/sdk/maps/arm-maps/src/models/accountsMappers.ts @@ -1,28 +1,28 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export { - MapsAccountCreateParameters, - Sku, - MapsAccount, - Resource, + AzureEntityResource, BaseResource, - ErrorModel, - ErrorDetailsItem, - MapsAccountUpdateParameters, - MapsAccounts, - MapsAccountsMoveRequest, + Creator, + CreatorProperties, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + MapsAccount, MapsAccountKeys, + MapsAccountProperties, + MapsAccounts, + MapsAccountUpdateParameters, MapsKeySpecification, - MapsOperations, - MapsOperationsValueItem, - MapsOperationsValueItemDisplay + ProxyResource, + Resource, + Sku, + SystemData, + TrackedResource } from "../models/mappers"; - diff --git a/sdk/maps/arm-maps/src/models/creatorsMappers.ts b/sdk/maps/arm-maps/src/models/creatorsMappers.ts new file mode 100644 index 000000000000..9c48734d5e7d --- /dev/null +++ b/sdk/maps/arm-maps/src/models/creatorsMappers.ts @@ -0,0 +1,26 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + AzureEntityResource, + BaseResource, + Creator, + CreatorList, + CreatorProperties, + CreatorUpdateParameters, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + MapsAccount, + MapsAccountProperties, + ProxyResource, + Resource, + Sku, + SystemData, + TrackedResource +} from "../models/mappers"; diff --git a/sdk/maps/arm-maps/src/models/index.ts b/sdk/maps/arm-maps/src/models/index.ts index 96226ea82da0..31c733820fc9 100644 --- a/sdk/maps/arm-maps/src/models/index.ts +++ b/sdk/maps/arm-maps/src/models/index.ts @@ -1,11 +1,9 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; @@ -13,353 +11,523 @@ import * as msRest from "@azure/ms-rest-js"; export { BaseResource, CloudError }; - /** - * @interface - * An interface representing ErrorDetailsItem. + * Creator resource properties */ -export interface ErrorDetailsItem { - /** - * @member {string} [code] Error code. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly code?: string; +export interface CreatorProperties { /** - * @member {string} [message] If available, a human readable description of - * the error. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The state of the resource provisioning, terminal states: Succeeded, Failed, Canceled + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly message?: string; + readonly provisioningState?: string; /** - * @member {string} [target] If available, the component generating the - * error. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The storage units to be allocated. Integer values from 1 to 100, inclusive. */ - readonly target?: string; + storageUnits: number; } /** - * @interface - * An interface representing ErrorModel. - * This object is returned when an error occurs in the Maps API - * + * An Azure resource which represents Maps Creator product and provides ability to manage private + * location data. */ -export interface ErrorModel { - /** - * @member {string} [code] Error code. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** - */ - readonly code?: string; +export interface Creator extends BaseResource { /** - * @member {string} [message] If available, a human readable description of - * the error. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The Creator resource properties. */ - readonly message?: string; + properties: CreatorProperties; +} + +/** + * The SKU of the Maps Account. + */ +export interface Sku { /** - * @member {string} [target] If available, the component generating the - * error. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The name of the SKU, in standard format (such as S0). Possible values include: 'S0', 'S1', + * 'G2' */ - readonly target?: string; + name: Name; /** - * @member {ErrorDetailsItem[]} [details] If available, a list of additional - * details about the error. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Gets the sku tier. This is based on the SKU name. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly details?: ErrorDetailsItem[]; + readonly tier?: string; } /** - * @interface - * An interface representing Resource. - * An Azure resource - * - * @extends BaseResource + * Metadata pertaining to creation and last modification of the resource. */ -export interface Resource extends BaseResource { +export interface SystemData { /** - * @member {string} [id] The fully qualified Maps Account resource - * identifier. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The identity that created the resource. */ - readonly id?: string; + createdBy?: string; /** - * @member {string} [name] The name of the Maps Account, which is unique - * within a Resource Group. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The type of identity that created the resource. Possible values include: 'User', + * 'Application', 'ManagedIdentity', 'Key' */ - readonly name?: string; + createdByType?: CreatedByType; /** - * @member {string} [type] Azure resource type. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The timestamp of resource creation (UTC). */ - readonly type?: string; -} - -/** - * @interface - * An interface representing Sku. - * The SKU of the Maps Account. - * - */ -export interface Sku { + createdAt?: Date; /** - * @member {string} name The name of the SKU, in standard format (such as - * S0). + * The identity that last modified the resource. */ - name: string; + lastModifiedBy?: string; /** - * @member {string} [tier] Gets the sku tier. This is based on the SKU name. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The type of identity that last modified the resource. Possible values include: 'User', + * 'Application', 'ManagedIdentity', 'Key' */ - readonly tier?: string; + lastModifiedByType?: CreatedByType; + /** + * The timestamp of resource last modification (UTC) + */ + lastModifiedAt?: Date; } /** - * @interface - * An interface representing MapsAccount. - * An Azure resource which represents access to a suite of Maps REST APIs. - * - * @extends Resource + * Additional Map account properties */ -export interface MapsAccount extends Resource { +export interface MapsAccountProperties { /** - * @member {string} [location] The location of the resource. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * A unique identifier for the maps account + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly location?: string; + readonly uniqueId?: string; /** - * @member {{ [propertyName: string]: string }} [tags] Gets a list of key - * value pairs that describe the resource. These tags can be used in viewing - * and grouping this resource (across resource groups). A maximum of 15 tags - * can be provided for a resource. Each tag must have a key no greater than - * 128 characters and value no greater than 256 characters. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Allows toggle functionality on Azure Policy to disable Azure Maps local authentication + * support. This will disable Shared Keys authentication from any usage. Default value: false. */ - readonly tags?: { [propertyName: string]: string }; + disableLocalAuth?: boolean; /** - * @member {Sku} [sku] The SKU of this account. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * the state of the provisioning. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly sku?: Sku; + readonly provisioningState?: string; } /** - * @interface - * An interface representing MapsAccountCreateParameters. - * Parameters used to create a new Maps Account. - * + * An Azure resource which represents access to a suite of Maps REST APIs. */ -export interface MapsAccountCreateParameters { +export interface MapsAccount extends BaseResource { /** - * @member {string} location The location of the resource. + * The SKU of this account. */ - location: string; + sku: Sku; /** - * @member {{ [propertyName: string]: string }} [tags] Gets or sets a list of - * key value pairs that describe the resource. These tags can be used in - * viewing and grouping this resource (across resource groups). A maximum of - * 15 tags can be provided for a resource. Each tag must have a key no - * greater than 128 characters and value no greater than 256 characters. + * Get or Set Kind property. Possible values include: 'Gen1', 'Gen2'. Default value: 'Gen1'. */ - tags?: { [propertyName: string]: string }; + kind?: Kind; /** - * @member {Sku} sku The SKU of this account. + * The system meta data relating to this resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - sku: Sku; + readonly systemData?: SystemData; + /** + * The map account properties. + */ + properties?: MapsAccountProperties; } /** - * @interface - * An interface representing MapsAccountUpdateParameters. * Parameters used to update an existing Maps Account. - * */ export interface MapsAccountUpdateParameters { /** - * @member {{ [propertyName: string]: string }} [tags] Gets or sets a list of - * key value pairs that describe the resource. These tags can be used in - * viewing and grouping this resource (across resource groups). A maximum of - * 15 tags can be provided for a resource. Each tag must have a key no - * greater than 128 characters and value no greater than 256 characters. + * Gets or sets a list of key value pairs that describe the resource. These tags can be used in + * viewing and grouping this resource (across resource groups). A maximum of 15 tags can be + * provided for a resource. Each tag must have a key no greater than 128 characters and value no + * greater than 256 characters. */ tags?: { [propertyName: string]: string }; /** - * @member {Sku} [sku] The SKU of this account. + * Get or Set Kind property. Possible values include: 'Gen1', 'Gen2'. Default value: 'Gen1'. + */ + kind?: Kind; + /** + * The SKU of this account. */ sku?: Sku; + /** + * A unique identifier for the maps account + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly uniqueId?: string; + /** + * Allows toggle functionality on Azure Policy to disable Azure Maps local authentication + * support. This will disable Shared Keys authentication from any usage. Default value: false. + */ + disableLocalAuth?: boolean; + /** + * the state of the provisioning. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provisioningState?: string; } /** - * @interface - * An interface representing MapsAccountsMoveRequest. - * The description of what resources to move between resource groups. - * + * Parameters used to update an existing Creator resource. */ -export interface MapsAccountsMoveRequest { +export interface CreatorUpdateParameters { /** - * @member {string} targetResourceGroup The name of the destination resource - * group. + * Gets or sets a list of key value pairs that describe the resource. These tags can be used in + * viewing and grouping this resource (across resource groups). A maximum of 15 tags can be + * provided for a resource. Each tag must have a key no greater than 128 characters and value no + * greater than 256 characters. */ - targetResourceGroup: string; + tags?: { [propertyName: string]: string }; /** - * @member {string[]} resourceIds A list of resource names to move from the - * source resource group. + * The state of the resource provisioning, terminal states: Succeeded, Failed, Canceled + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - resourceIds: string[]; + readonly provisioningState?: string; + /** + * The storage units to be allocated. Integer values from 1 to 100, inclusive. + */ + storageUnits: number; } /** - * @interface - * An interface representing MapsKeySpecification. * Whether the operation refers to the primary or secondary key. - * */ export interface MapsKeySpecification { /** - * @member {KeyType} keyType Whether the operation refers to the primary or - * secondary key. Possible values include: 'primary', 'secondary' + * Whether the operation refers to the primary or secondary key. Possible values include: + * 'primary', 'secondary' */ keyType: KeyType; } /** - * @interface - * An interface representing MapsAccountKeys. - * The set of keys which can be used to access the Maps REST APIs. Two keys are - * provided for key rotation without interruption. - * + * 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 { /** - * @member {string} [id] The full Azure resource identifier of the Maps - * Account. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The last updated date and time of the primary key. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly id?: string; + readonly primaryKeyLastUpdated?: string; /** - * @member {string} [primaryKey] The primary key for accessing the Maps REST - * APIs. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The primary key for accessing the Maps REST APIs. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly primaryKey?: string; /** - * @member {string} [secondaryKey] The secondary key for accessing the Maps - * REST APIs. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The secondary key for accessing the Maps REST APIs. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly secondaryKey?: string; + /** + * The last updated date and time of the secondary key. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly secondaryKeyLastUpdated?: string; } /** - * @interface - * An interface representing MapsOperationsValueItemDisplay. - * The human-readable description of the operation. - * + * Operation display payload */ -export interface MapsOperationsValueItemDisplay { +export interface OperationDisplay { /** - * @member {string} [provider] Service provider: Microsoft Maps. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Resource provider of the operation */ - readonly provider?: string; + provider?: string; /** - * @member {string} [resource] Resource on which the operation is performed. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Resource of the operation */ - readonly resource?: string; + resource?: string; /** - * @member {string} [operation] The action that users can perform, based on - * their permission level. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Localized friendly name for the operation */ - readonly operation?: string; + operation?: string; /** - * @member {string} [description] The description of the operation. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Localized friendly description for the operation */ - readonly description?: string; + description?: string; } /** - * @interface - * An interface representing MapsOperationsValueItem. + * Dimension of map account, for example API Category, Api Name, Result Type, and Response Code. + */ +export interface Dimension { + /** + * Display name of dimension. + */ + name?: string; + /** + * Display name of dimension. + */ + displayName?: string; +} + +/** + * Metric specification of operation. */ -export interface MapsOperationsValueItem { +export interface MetricSpecification { + /** + * Name of metric specification. + */ + name?: string; /** - * @member {string} [name] Operation name: {provider}/{resource}/{operation}. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Display name of metric specification. + */ + displayName?: string; + /** + * Display description of metric specification. + */ + displayDescription?: string; + /** + * Unit could be Count. + */ + unit?: string; + /** + * Dimensions of map account. + */ + dimensions?: Dimension[]; + /** + * Aggregation type could be Average. + */ + aggregationType?: string; + /** + * The property to decide fill gap with zero or not. + */ + fillGapWithZero?: boolean; + /** + * The category this metric specification belong to, could be Capacity. + */ + category?: string; + /** + * Account Resource Id. + */ + resourceIdDimensionNameOverride?: string; +} + +/** + * One property of operation, include metric specifications. + */ +export interface ServiceSpecification { + /** + * Metric specifications of operation. + */ + metricSpecifications?: MetricSpecification[]; +} + +/** + * Operation detail payload + */ +export interface OperationDetail { + /** + * Name of the operation + */ + name?: string; + /** + * Indicates whether the operation is a data action + */ + isDataAction?: boolean; + /** + * Display of the operation + */ + display?: OperationDisplay; + /** + * Origin of the operation + */ + origin?: string; + /** + * One property of operation, include metric specifications. + */ + serviceSpecification?: ServiceSpecification; +} + +/** + * Common fields that are returned in the response for all Azure Resource Manager resources + * @summary Resource + */ +export interface Resource extends BaseResource { + /** + * Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The name of the resource + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly name?: string; /** - * @member {MapsOperationsValueItemDisplay} [display] The human-readable - * description of the operation. + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + * "Microsoft.Storage/storageAccounts" + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - display?: MapsOperationsValueItemDisplay; + readonly type?: string; +} + +/** + * The resource model definition for a Azure Resource Manager proxy resource. It will not have tags + * and a location + * @summary Proxy Resource + */ +export interface ProxyResource extends Resource { +} + +/** + * The resource model definition for an Azure Resource Manager resource with an etag. + * @summary Entity Resource + */ +export interface AzureEntityResource extends Resource { /** - * @member {string} [origin] The origin of the operation. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * Resource Etag. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly origin?: string; + readonly etag?: string; } /** - * @interface - * An interface representing MapsManagementClientOptions. - * @extends AzureServiceClientOptions + * The resource model definition for an Azure Resource Manager tracked top level resource which has + * 'tags' and a 'location' + * @summary Tracked Resource */ -export interface MapsManagementClientOptions extends AzureServiceClientOptions { +export interface TrackedResource extends Resource { /** - * @member {string} [baseUri] + * Resource tags. */ - baseUri?: string; + tags?: { [propertyName: string]: string }; + /** + * The geo-location where the resource lives + */ + location: string; +} + +/** + * The resource management error additional info. + */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * The additional info. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly info?: any; +} + +/** + * The error detail. + */ +export interface ErrorDetail { + /** + * The error code. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly code?: string; + /** + * The error message. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly message?: string; + /** + * The error target. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly target?: string; + /** + * The error details. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly details?: ErrorDetail[]; + /** + * The error additional info. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; } +/** + * Common error response for all Azure Resource Manager APIs to return error details for failed + * operations. (This also follows the OData error response format.). + * @summary Error response + */ +export interface ErrorResponse { + /** + * The error object. + */ + error?: ErrorDetail; +} + +/** + * An interface representing AzureMapsManagementClientOptions. + */ +export interface AzureMapsManagementClientOptions extends AzureServiceClientOptions { + baseUri?: string; +} /** * @interface - * An interface representing the MapsAccounts. * A list of Maps Accounts. - * * @extends Array */ export interface MapsAccounts extends Array { + /** + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + nextLink?: string; } /** * @interface - * An interface representing the MapsOperations. * The set of operations available for Maps. - * - * @extends Array + * @extends Array */ -export interface MapsOperations extends Array { +export interface MapsOperations extends Array { + /** + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + nextLink?: string; } +/** + * @interface + * A list of Creator resources. + * @extends Array + */ +export interface CreatorList extends Array { + /** + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + nextLink?: string; +} + +/** + * Defines values for Name. + * Possible values include: 'S0', 'S1', 'G2' + * @readonly + * @enum {string} + */ +export type Name = 'S0' | 'S1' | 'G2'; + +/** + * Defines values for Kind. + * Possible values include: 'Gen1', 'Gen2' + * @readonly + * @enum {string} + */ +export type Kind = 'Gen1' | 'Gen2'; + +/** + * Defines values for CreatedByType. + * Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + * @readonly + * @enum {string} + */ +export type CreatedByType = 'User' | 'Application' | 'ManagedIdentity' | 'Key'; + /** * Defines values for KeyType. * Possible values include: 'primary', 'secondary' @@ -380,6 +548,7 @@ export type AccountsCreateOrUpdateResponse = MapsAccount & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -399,6 +568,7 @@ export type AccountsUpdateResponse = MapsAccount & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -418,6 +588,7 @@ export type AccountsGetResponse = MapsAccount & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -437,6 +608,7 @@ export type AccountsListByResourceGroupResponse = MapsAccounts & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -456,6 +628,7 @@ export type AccountsListBySubscriptionResponse = MapsAccounts & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -475,6 +648,7 @@ export type AccountsListKeysResponse = MapsAccountKeys & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -494,6 +668,7 @@ export type AccountsRegenerateKeysResponse = MapsAccountKeys & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -501,10 +676,50 @@ export type AccountsRegenerateKeysResponse = MapsAccountKeys & { }; }; +/** + * Contains response data for the listByResourceGroupNext operation. + */ +export type AccountsListByResourceGroupNextResponse = MapsAccounts & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MapsAccounts; + }; +}; + +/** + * Contains response data for the listBySubscriptionNext operation. + */ +export type AccountsListBySubscriptionNextResponse = MapsAccounts & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MapsAccounts; + }; +}; + /** * Contains response data for the listOperations operation. */ -export type AccountsListOperationsResponse = MapsOperations & { +export type MapsListOperationsResponse = MapsOperations & { /** * The underlying HTTP response. */ @@ -513,9 +728,130 @@ export type AccountsListOperationsResponse = MapsOperations & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ parsedBody: MapsOperations; }; }; + +/** + * Contains response data for the listOperationsNext operation. + */ +export type MapsListOperationsNextResponse = MapsOperations & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: MapsOperations; + }; +}; + +/** + * Contains response data for the listByAccount operation. + */ +export type CreatorsListByAccountResponse = CreatorList & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CreatorList; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type CreatorsCreateOrUpdateResponse = Creator & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Creator; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type CreatorsUpdateResponse = Creator & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Creator; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type CreatorsGetResponse = Creator & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Creator; + }; +}; + +/** + * Contains response data for the listByAccountNext operation. + */ +export type CreatorsListByAccountNextResponse = CreatorList & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CreatorList; + }; +}; diff --git a/sdk/maps/arm-maps/src/models/mappers.ts b/sdk/maps/arm-maps/src/models/mappers.ts index 906aaeab40a3..688866258e71 100644 --- a/sdk/maps/arm-maps/src/models/mappers.ts +++ b/sdk/maps/arm-maps/src/models/mappers.ts @@ -1,11 +1,9 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; @@ -14,128 +12,145 @@ import * as msRest from "@azure/ms-rest-js"; export const CloudError = CloudErrorMapper; export const BaseResource = BaseResourceMapper; -export const ErrorDetailsItem: msRest.CompositeMapper = { - serializedName: "Error_detailsItem", +export const CreatorProperties: msRest.CompositeMapper = { + serializedName: "CreatorProperties", type: { name: "Composite", - className: "ErrorDetailsItem", + className: "CreatorProperties", modelProperties: { - code: { + provisioningState: { readOnly: true, - serializedName: "code", + serializedName: "provisioningState", type: { name: "String" } }, - message: { - readOnly: true, - serializedName: "message", - type: { - name: "String" - } - }, - target: { - readOnly: true, - serializedName: "target", + storageUnits: { + required: true, + serializedName: "storageUnits", + constraints: { + InclusiveMaximum: 100, + InclusiveMinimum: 1 + }, type: { - name: "String" + name: "Number" } } } } }; -export const ErrorModel: msRest.CompositeMapper = { - serializedName: "Error", +export const Creator: msRest.CompositeMapper = { + serializedName: "Creator", type: { name: "Composite", - className: "ErrorModel", + className: "Creator", modelProperties: { - code: { - readOnly: true, - serializedName: "code", + properties: { + required: true, + serializedName: "properties", type: { - name: "String" + name: "Composite", + className: "CreatorProperties" } - }, - message: { - readOnly: true, - serializedName: "message", + } + } + } +}; + +export const Sku: msRest.CompositeMapper = { + serializedName: "Sku", + type: { + name: "Composite", + className: "Sku", + modelProperties: { + name: { + required: true, + serializedName: "name", type: { name: "String" } }, - target: { + tier: { readOnly: true, - serializedName: "target", + serializedName: "tier", type: { name: "String" } - }, - details: { - readOnly: true, - serializedName: "details", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorDetailsItem" - } - } - } } } } }; -export const Resource: msRest.CompositeMapper = { - serializedName: "Resource", +export const SystemData: msRest.CompositeMapper = { + serializedName: "systemData", type: { name: "Composite", - className: "Resource", + className: "SystemData", modelProperties: { - id: { - readOnly: true, - serializedName: "id", + createdBy: { + serializedName: "createdBy", type: { name: "String" } }, - name: { - readOnly: true, - serializedName: "name", + createdByType: { + serializedName: "createdByType", type: { name: "String" } }, - type: { - readOnly: true, - serializedName: "type", + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", type: { name: "String" } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } } } } }; -export const Sku: msRest.CompositeMapper = { - serializedName: "Sku", +export const MapsAccountProperties: msRest.CompositeMapper = { + serializedName: "MapsAccountProperties", type: { name: "Composite", - className: "Sku", + className: "MapsAccountProperties", modelProperties: { - name: { - required: true, - serializedName: "name", + uniqueId: { + readOnly: true, + serializedName: "uniqueId", type: { name: "String" } }, - tier: { + disableLocalAuth: { + serializedName: "disableLocalAuth", + defaultValue: false, + type: { + name: "Boolean" + } + }, + provisioningState: { readOnly: true, - serializedName: "tier", + serializedName: "provisioningState", type: { name: "String" } @@ -150,51 +165,46 @@ export const MapsAccount: msRest.CompositeMapper = { name: "Composite", className: "MapsAccount", modelProperties: { - ...Resource.type.modelProperties, - location: { - readOnly: true, - serializedName: "location", + sku: { + required: true, + serializedName: "sku", + type: { + name: "Composite", + className: "Sku" + } + }, + kind: { + serializedName: "kind", + defaultValue: 'Gen1', type: { name: "String" } }, - tags: { + systemData: { readOnly: true, - serializedName: "tags", + serializedName: "systemData", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "Composite", + className: "SystemData" } }, - sku: { - readOnly: true, - serializedName: "sku", + properties: { + serializedName: "properties", type: { name: "Composite", - className: "Sku" + className: "MapsAccountProperties" } } } } }; -export const MapsAccountCreateParameters: msRest.CompositeMapper = { - serializedName: "MapsAccountCreateParameters", +export const MapsAccountUpdateParameters: msRest.CompositeMapper = { + serializedName: "MapsAccountUpdateParameters", type: { name: "Composite", - className: "MapsAccountCreateParameters", + className: "MapsAccountUpdateParameters", modelProperties: { - location: { - required: true, - serializedName: "location", - type: { - name: "String" - } - }, tags: { serializedName: "tags", type: { @@ -206,23 +216,50 @@ export const MapsAccountCreateParameters: msRest.CompositeMapper = { } } }, + kind: { + serializedName: "kind", + defaultValue: 'Gen1', + type: { + name: "String" + } + }, sku: { - required: true, serializedName: "sku", type: { name: "Composite", className: "Sku" } + }, + uniqueId: { + readOnly: true, + serializedName: "properties.uniqueId", + type: { + name: "String" + } + }, + disableLocalAuth: { + serializedName: "properties.disableLocalAuth", + defaultValue: false, + type: { + name: "Boolean" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "String" + } } } } }; -export const MapsAccountUpdateParameters: msRest.CompositeMapper = { - serializedName: "MapsAccountUpdateParameters", +export const CreatorUpdateParameters: msRest.CompositeMapper = { + serializedName: "CreatorUpdateParameters", type: { name: "Composite", - className: "MapsAccountUpdateParameters", + className: "CreatorUpdateParameters", modelProperties: { tags: { serializedName: "tags", @@ -235,40 +272,22 @@ export const MapsAccountUpdateParameters: msRest.CompositeMapper = { } } }, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "Sku" - } - } - } - } -}; - -export const MapsAccountsMoveRequest: msRest.CompositeMapper = { - serializedName: "MapsAccountsMoveRequest", - type: { - name: "Composite", - className: "MapsAccountsMoveRequest", - modelProperties: { - targetResourceGroup: { - required: true, - serializedName: "targetResourceGroup", + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", type: { name: "String" } }, - resourceIds: { + storageUnits: { required: true, - serializedName: "resourceIds", + serializedName: "properties.storageUnits", + constraints: { + InclusiveMaximum: 100, + InclusiveMinimum: 1 + }, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "Number" } } } @@ -298,9 +317,9 @@ export const MapsAccountKeys: msRest.CompositeMapper = { name: "Composite", className: "MapsAccountKeys", modelProperties: { - id: { + primaryKeyLastUpdated: { readOnly: true, - serializedName: "id", + serializedName: "primaryKeyLastUpdated", type: { name: "String" } @@ -318,40 +337,43 @@ export const MapsAccountKeys: msRest.CompositeMapper = { type: { name: "String" } + }, + secondaryKeyLastUpdated: { + readOnly: true, + serializedName: "secondaryKeyLastUpdated", + type: { + name: "String" + } } } } }; -export const MapsOperationsValueItemDisplay: msRest.CompositeMapper = { - serializedName: "MapsOperations_valueItem_display", +export const OperationDisplay: msRest.CompositeMapper = { + serializedName: "OperationDisplay", type: { name: "Composite", - className: "MapsOperationsValueItemDisplay", + className: "OperationDisplay", modelProperties: { provider: { - readOnly: true, serializedName: "provider", type: { name: "String" } }, resource: { - readOnly: true, serializedName: "resource", type: { name: "String" } }, operation: { - readOnly: true, serializedName: "operation", type: { name: "String" } }, description: { - readOnly: true, serializedName: "description", type: { name: "String" @@ -361,32 +383,344 @@ export const MapsOperationsValueItemDisplay: msRest.CompositeMapper = { } }; -export const MapsOperationsValueItem: msRest.CompositeMapper = { - serializedName: "MapsOperations_valueItem", +export const Dimension: msRest.CompositeMapper = { + serializedName: "Dimension", type: { name: "Composite", - className: "MapsOperationsValueItem", + className: "Dimension", modelProperties: { name: { - readOnly: true, serializedName: "name", type: { name: "String" } }, + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + } + } + } +}; + +export const MetricSpecification: msRest.CompositeMapper = { + serializedName: "MetricSpecification", + type: { + name: "Composite", + className: "MetricSpecification", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + }, + displayDescription: { + serializedName: "displayDescription", + type: { + name: "String" + } + }, + unit: { + serializedName: "unit", + type: { + name: "String" + } + }, + dimensions: { + serializedName: "dimensions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Dimension" + } + } + } + }, + aggregationType: { + serializedName: "aggregationType", + type: { + name: "String" + } + }, + fillGapWithZero: { + serializedName: "fillGapWithZero", + type: { + name: "Boolean" + } + }, + category: { + serializedName: "category", + type: { + name: "String" + } + }, + resourceIdDimensionNameOverride: { + serializedName: "resourceIdDimensionNameOverride", + type: { + name: "String" + } + } + } + } +}; + +export const ServiceSpecification: msRest.CompositeMapper = { + serializedName: "ServiceSpecification", + type: { + name: "Composite", + className: "ServiceSpecification", + modelProperties: { + metricSpecifications: { + serializedName: "metricSpecifications", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricSpecification" + } + } + } + } + } + } +}; + +export const OperationDetail: msRest.CompositeMapper = { + serializedName: "OperationDetail", + type: { + name: "Composite", + className: "OperationDetail", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + isDataAction: { + serializedName: "isDataAction", + type: { + name: "Boolean" + } + }, display: { serializedName: "display", type: { name: "Composite", - className: "MapsOperationsValueItemDisplay" + className: "OperationDisplay" } }, origin: { - readOnly: true, serializedName: "origin", type: { name: "String" } + }, + serviceSpecification: { + serializedName: "properties.serviceSpecification", + type: { + name: "Composite", + className: "ServiceSpecification" + } + } + } + } +}; + +export const Resource: msRest.CompositeMapper = { + serializedName: "Resource", + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const ProxyResource: msRest.CompositeMapper = { + serializedName: "ProxyResource", + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties + } + } +}; + +export const AzureEntityResource: msRest.CompositeMapper = { + serializedName: "AzureEntityResource", + type: { + name: "Composite", + className: "AzureEntityResource", + modelProperties: { + ...Resource.type.modelProperties, + etag: { + readOnly: true, + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const TrackedResource: msRest.CompositeMapper = { + serializedName: "TrackedResource", + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + location: { + required: true, + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ErrorAdditionalInfo: msRest.CompositeMapper = { + serializedName: "ErrorAdditionalInfo", + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + info: { + readOnly: true, + serializedName: "info", + type: { + name: "Object" + } + } + } + } +}; + +export const ErrorDetail: msRest.CompositeMapper = { + serializedName: "ErrorDetail", + type: { + name: "Composite", + className: "ErrorDetail", + modelProperties: { + code: { + readOnly: true, + serializedName: "code", + type: { + name: "String" + } + }, + message: { + readOnly: true, + serializedName: "message", + type: { + name: "String" + } + }, + target: { + readOnly: true, + serializedName: "target", + type: { + name: "String" + } + }, + details: { + readOnly: true, + serializedName: "details", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + }, + additionalInfo: { + readOnly: true, + serializedName: "additionalInfo", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + } + } + } +}; + +export const ErrorResponse: msRest.CompositeMapper = { + serializedName: "ErrorResponse", + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail" + } } } } @@ -410,6 +744,12 @@ export const MapsAccounts: msRest.CompositeMapper = { } } } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } } } } @@ -429,10 +769,45 @@ export const MapsOperations: msRest.CompositeMapper = { element: { type: { name: "Composite", - className: "MapsOperationsValueItem" + className: "OperationDetail" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const CreatorList: msRest.CompositeMapper = { + serializedName: "CreatorList", + type: { + name: "Composite", + className: "CreatorList", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Creator" } } } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } } } } diff --git a/sdk/maps/arm-maps/src/models/mapsMappers.ts b/sdk/maps/arm-maps/src/models/mapsMappers.ts new file mode 100644 index 000000000000..0d8432abb799 --- /dev/null +++ b/sdk/maps/arm-maps/src/models/mapsMappers.ts @@ -0,0 +1,19 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + Dimension, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + MapsOperations, + MetricSpecification, + OperationDetail, + OperationDisplay, + ServiceSpecification +} from "../models/mappers"; diff --git a/sdk/maps/arm-maps/src/models/parameters.ts b/sdk/maps/arm-maps/src/models/parameters.ts index 980bdc0c26ab..0649f5de0208 100644 --- a/sdk/maps/arm-maps/src/models/parameters.ts +++ b/sdk/maps/arm-maps/src/models/parameters.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -35,16 +34,45 @@ export const apiVersion: msRest.OperationQueryParameter = { mapper: { required: true, serializedName: "api-version", + constraints: { + MinLength: 1 + }, type: { name: "String" } } }; +export const creatorName: msRest.OperationURLParameter = { + parameterPath: "creatorName", + mapper: { + required: true, + serializedName: "creatorName", + type: { + name: "String" + } + } +}; +export const nextPageLink: msRest.OperationURLParameter = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true +}; export const resourceGroupName: msRest.OperationURLParameter = { parameterPath: "resourceGroupName", mapper: { required: true, serializedName: "resourceGroupName", + constraints: { + MaxLength: 90, + MinLength: 1, + Pattern: /^[-\w\._\(\)]+$/ + }, type: { name: "String" } @@ -55,6 +83,9 @@ export const subscriptionId: msRest.OperationURLParameter = { mapper: { required: true, serializedName: "subscriptionId", + constraints: { + MinLength: 1 + }, type: { name: "String" } diff --git a/sdk/maps/arm-maps/src/operations/accounts.ts b/sdk/maps/arm-maps/src/operations/accounts.ts index 15614695bbd7..f5344a3b40e3 100644 --- a/sdk/maps/arm-maps/src/operations/accounts.ts +++ b/sdk/maps/arm-maps/src/operations/accounts.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -12,51 +11,51 @@ import * as msRest from "@azure/ms-rest-js"; import * as Models from "../models"; import * as Mappers from "../models/accountsMappers"; import * as Parameters from "../models/parameters"; -import { MapsManagementClientContext } from "../mapsManagementClientContext"; +import { AzureMapsManagementClientContext } from "../azureMapsManagementClientContext"; /** Class representing a Accounts. */ export class Accounts { - private readonly client: MapsManagementClientContext; + private readonly client: AzureMapsManagementClientContext; /** * Create a Accounts. - * @param {MapsManagementClientContext} client Reference to the service client. + * @param {AzureMapsManagementClientContext} client Reference to the service client. */ - constructor(client: MapsManagementClientContext) { + constructor(client: AzureMapsManagementClientContext) { this.client = client; } /** * Create or update a Maps Account. A Maps Account holds the keys which allow access to the Maps * REST APIs. - * @param resourceGroupName The name of the Azure Resource Group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of the Maps Account. - * @param mapsAccountCreateParameters The new or updated parameters for the Maps Account. + * @param mapsAccount The new or updated parameters for the Maps Account. * @param [options] The optional parameters * @returns Promise */ - createOrUpdate(resourceGroupName: string, accountName: string, mapsAccountCreateParameters: Models.MapsAccountCreateParameters, options?: msRest.RequestOptionsBase): Promise; + createOrUpdate(resourceGroupName: string, accountName: string, mapsAccount: Models.MapsAccount, options?: msRest.RequestOptionsBase): Promise; /** - * @param resourceGroupName The name of the Azure Resource Group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of the Maps Account. - * @param mapsAccountCreateParameters The new or updated parameters for the Maps Account. + * @param mapsAccount The new or updated parameters for the Maps Account. * @param callback The callback */ - createOrUpdate(resourceGroupName: string, accountName: string, mapsAccountCreateParameters: Models.MapsAccountCreateParameters, callback: msRest.ServiceCallback): void; + createOrUpdate(resourceGroupName: string, accountName: string, mapsAccount: Models.MapsAccount, callback: msRest.ServiceCallback): void; /** - * @param resourceGroupName The name of the Azure Resource Group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of the Maps Account. - * @param mapsAccountCreateParameters The new or updated parameters for the Maps Account. + * @param mapsAccount The new or updated parameters for the Maps Account. * @param options The optional parameters * @param callback The callback */ - createOrUpdate(resourceGroupName: string, accountName: string, mapsAccountCreateParameters: Models.MapsAccountCreateParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, accountName: string, mapsAccountCreateParameters: Models.MapsAccountCreateParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdate(resourceGroupName: string, accountName: string, mapsAccount: Models.MapsAccount, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(resourceGroupName: string, accountName: string, mapsAccount: Models.MapsAccount, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, accountName, - mapsAccountCreateParameters, + mapsAccount, options }, createOrUpdateOperationSpec, @@ -65,8 +64,8 @@ export class Accounts { /** * Updates a Maps Account. Only a subset of the parameters may be updated after creation, such as - * Sku and Tags. - * @param resourceGroupName The name of the Azure Resource Group. + * Sku, Tags, Properties. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of the Maps Account. * @param mapsAccountUpdateParameters The updated parameters for the Maps Account. * @param [options] The optional parameters @@ -74,14 +73,14 @@ export class Accounts { */ update(resourceGroupName: string, accountName: string, mapsAccountUpdateParameters: Models.MapsAccountUpdateParameters, options?: msRest.RequestOptionsBase): Promise; /** - * @param resourceGroupName The name of the Azure Resource Group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of the Maps Account. * @param mapsAccountUpdateParameters The updated parameters for the Maps Account. * @param callback The callback */ update(resourceGroupName: string, accountName: string, mapsAccountUpdateParameters: Models.MapsAccountUpdateParameters, callback: msRest.ServiceCallback): void; /** - * @param resourceGroupName The name of the Azure Resource Group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of the Maps Account. * @param mapsAccountUpdateParameters The updated parameters for the Maps Account. * @param options The optional parameters @@ -102,20 +101,20 @@ export class Accounts { /** * Delete a Maps Account. - * @param resourceGroupName The name of the Azure Resource Group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of the Maps Account. * @param [options] The optional parameters * @returns Promise */ deleteMethod(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; /** - * @param resourceGroupName The name of the Azure Resource Group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of the Maps Account. * @param callback The callback */ deleteMethod(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; /** - * @param resourceGroupName The name of the Azure Resource Group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of the Maps Account. * @param options The optional parameters * @param callback The callback @@ -134,20 +133,20 @@ export class Accounts { /** * Get a Maps Account. - * @param resourceGroupName The name of the Azure Resource Group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of the Maps Account. * @param [options] The optional parameters * @returns Promise */ get(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; /** - * @param resourceGroupName The name of the Azure Resource Group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of the Maps Account. * @param callback The callback */ get(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; /** - * @param resourceGroupName The name of the Azure Resource Group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of the Maps Account. * @param options The optional parameters * @param callback The callback @@ -166,18 +165,18 @@ export class Accounts { /** * Get all Maps Accounts in a Resource Group - * @param resourceGroupName The name of the Azure Resource Group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param [options] The optional parameters * @returns Promise */ listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; /** - * @param resourceGroupName The name of the Azure Resource Group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param callback The callback */ listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; /** - * @param resourceGroupName The name of the Azure Resource Group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The optional parameters * @param callback The callback */ @@ -216,56 +215,24 @@ export class Accounts { callback) as Promise; } - /** - * Moves Maps Accounts from one ResourceGroup (or Subscription) to another - * @param resourceGroupName The name of the resource group that contains Maps Account to move. - * @param moveRequest The details of the Maps Account move. - * @param [options] The optional parameters - * @returns Promise - */ - move(resourceGroupName: string, moveRequest: Models.MapsAccountsMoveRequest, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group that contains Maps Account to move. - * @param moveRequest The details of the Maps Account move. - * @param callback The callback - */ - move(resourceGroupName: string, moveRequest: Models.MapsAccountsMoveRequest, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group that contains Maps Account to move. - * @param moveRequest The details of the Maps Account move. - * @param options The optional parameters - * @param callback The callback - */ - move(resourceGroupName: string, moveRequest: Models.MapsAccountsMoveRequest, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - move(resourceGroupName: string, moveRequest: Models.MapsAccountsMoveRequest, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - moveRequest, - options - }, - moveOperationSpec, - callback); - } - /** * 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 * regeneration. - * @param resourceGroupName The name of the Azure Resource Group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of the Maps Account. * @param [options] The optional parameters * @returns Promise */ listKeys(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; /** - * @param resourceGroupName The name of the Azure Resource Group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of the Maps Account. * @param callback The callback */ listKeys(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; /** - * @param resourceGroupName The name of the Azure Resource Group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of the Maps Account. * @param options The optional parameters * @param callback The callback @@ -285,7 +252,7 @@ export class Accounts { /** * Regenerate either the primary or secondary key for use with the Maps APIs. The old key will stop * working immediately. - * @param resourceGroupName The name of the Azure Resource Group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of the Maps Account. * @param keySpecification Which key to regenerate: primary or secondary. * @param [options] The optional parameters @@ -293,14 +260,14 @@ export class Accounts { */ regenerateKeys(resourceGroupName: string, accountName: string, keySpecification: Models.MapsKeySpecification, options?: msRest.RequestOptionsBase): Promise; /** - * @param resourceGroupName The name of the Azure Resource Group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of the Maps Account. * @param keySpecification Which key to regenerate: primary or secondary. * @param callback The callback */ regenerateKeys(resourceGroupName: string, accountName: string, keySpecification: Models.MapsKeySpecification, callback: msRest.ServiceCallback): void; /** - * @param resourceGroupName The name of the Azure Resource Group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of the Maps Account. * @param keySpecification Which key to regenerate: primary or secondary. * @param options The optional parameters @@ -320,27 +287,59 @@ export class Accounts { } /** - * List operations available for the Maps Resource Provider + * Get all Maps Accounts in a Resource Group + * @param nextPageLink The NextLink from the previous successful call to List operation. * @param [options] The optional parameters - * @returns Promise + * @returns Promise */ - listOperations(options?: msRest.RequestOptionsBase): Promise; + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; /** + * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback */ - listOperations(callback: msRest.ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; /** + * @param nextPageLink The NextLink from the previous successful call to List operation. * @param options The optional parameters * @param callback The callback */ - listOperations(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listOperations(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { + nextPageLink, options }, - listOperationsOperationSpec, - callback) as Promise; + listByResourceGroupNextOperationSpec, + callback) as Promise; + } + + /** + * Get all Maps Accounts in a Subscription + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listBySubscriptionNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listBySubscriptionNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listBySubscriptionNextOperationSpec, + callback) as Promise; } } @@ -361,9 +360,9 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { Parameters.acceptLanguage ], requestBody: { - parameterPath: "mapsAccountCreateParameters", + parameterPath: "mapsAccount", mapper: { - ...Mappers.MapsAccountCreateParameters, + ...Mappers.MapsAccount, required: true } }, @@ -375,7 +374,7 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.MapsAccount }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -406,9 +405,8 @@ const updateOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.MapsAccount }, - 404: {}, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -432,7 +430,7 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { 200: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -456,9 +454,8 @@ const getOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.MapsAccount }, - 404: {}, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -482,7 +479,7 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.MapsAccounts }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -505,18 +502,19 @@ const listBySubscriptionOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.MapsAccounts }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer }; -const moveOperationSpec: msRest.OperationSpec = { +const listKeysOperationSpec: msRest.OperationSpec = { httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/listKeys", urlParameters: [ Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, + Parameters.accountName ], queryParameters: [ Parameters.apiVersion @@ -524,25 +522,20 @@ const moveOperationSpec: msRest.OperationSpec = { headerParameters: [ Parameters.acceptLanguage ], - requestBody: { - parameterPath: "moveRequest", - mapper: { - ...Mappers.MapsAccountsMoveRequest, - required: true - } - }, responses: { - 200: {}, + 200: { + bodyMapper: Mappers.MapsAccountKeys + }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer }; -const listKeysOperationSpec: msRest.OperationSpec = { +const regenerateKeysOperationSpec: msRest.OperationSpec = { httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/listKeys", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/regenerateKey", urlParameters: [ Parameters.subscriptionId, Parameters.resourceGroupName, @@ -554,25 +547,30 @@ const listKeysOperationSpec: msRest.OperationSpec = { headerParameters: [ Parameters.acceptLanguage ], + requestBody: { + parameterPath: "keySpecification", + mapper: { + ...Mappers.MapsKeySpecification, + required: true + } + }, responses: { 200: { bodyMapper: Mappers.MapsAccountKeys }, - 404: {}, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer }; -const regenerateKeysOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/regenerateKey", +const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.accountName + Parameters.nextPageLink ], queryParameters: [ Parameters.apiVersion @@ -580,28 +578,24 @@ const regenerateKeysOperationSpec: msRest.OperationSpec = { headerParameters: [ Parameters.acceptLanguage ], - requestBody: { - parameterPath: "keySpecification", - mapper: { - ...Mappers.MapsKeySpecification, - required: true - } - }, responses: { 200: { - bodyMapper: Mappers.MapsAccountKeys + bodyMapper: Mappers.MapsAccounts }, - 404: {}, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer }; -const listOperationsOperationSpec: msRest.OperationSpec = { +const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: "providers/Microsoft.Maps/operations", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], queryParameters: [ Parameters.apiVersion ], @@ -610,10 +604,10 @@ const listOperationsOperationSpec: msRest.OperationSpec = { ], responses: { 200: { - bodyMapper: Mappers.MapsOperations + bodyMapper: Mappers.MapsAccounts }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer diff --git a/sdk/maps/arm-maps/src/operations/creators.ts b/sdk/maps/arm-maps/src/operations/creators.ts new file mode 100644 index 000000000000..260e5440fbeb --- /dev/null +++ b/sdk/maps/arm-maps/src/operations/creators.ts @@ -0,0 +1,413 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/creatorsMappers"; +import * as Parameters from "../models/parameters"; +import { AzureMapsManagementClientContext } from "../azureMapsManagementClientContext"; + +/** Class representing a Creators. */ +export class Creators { + private readonly client: AzureMapsManagementClientContext; + + /** + * Create a Creators. + * @param {AzureMapsManagementClientContext} client Reference to the service client. + */ + constructor(client: AzureMapsManagementClientContext) { + this.client = client; + } + + /** + * Get all Creator instances for an Azure Maps Account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Maps Account. + * @param [options] The optional parameters + * @returns Promise + */ + listByAccount(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Maps Account. + * @param callback The callback + */ + listByAccount(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Maps Account. + * @param options The optional parameters + * @param callback The callback + */ + listByAccount(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByAccount(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + options + }, + listByAccountOperationSpec, + callback) as Promise; + } + + /** + * Create or update a Maps Creator resource. Creator resource will manage Azure resources required + * to populate a custom set of mapping data. It requires an account to exist before it can be + * created. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Maps Account. + * @param creatorName The name of the Maps Creator instance. + * @param creatorResource The new or updated parameters for the Creator resource. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, accountName: string, creatorName: string, creatorResource: Models.Creator, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Maps Account. + * @param creatorName The name of the Maps Creator instance. + * @param creatorResource The new or updated parameters for the Creator resource. + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, accountName: string, creatorName: string, creatorResource: Models.Creator, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Maps Account. + * @param creatorName The name of the Maps Creator instance. + * @param creatorResource The new or updated parameters for the Creator resource. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, accountName: string, creatorName: string, creatorResource: Models.Creator, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(resourceGroupName: string, accountName: string, creatorName: string, creatorResource: Models.Creator, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + creatorName, + creatorResource, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * Updates the Maps Creator resource. Only a subset of the parameters may be updated after + * creation, such as Tags. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Maps Account. + * @param creatorName The name of the Maps Creator instance. + * @param creatorUpdateParameters The update parameters for Maps Creator. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, accountName: string, creatorName: string, creatorUpdateParameters: Models.CreatorUpdateParameters, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Maps Account. + * @param creatorName The name of the Maps Creator instance. + * @param creatorUpdateParameters The update parameters for Maps Creator. + * @param callback The callback + */ + update(resourceGroupName: string, accountName: string, creatorName: string, creatorUpdateParameters: Models.CreatorUpdateParameters, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Maps Account. + * @param creatorName The name of the Maps Creator instance. + * @param creatorUpdateParameters The update parameters for Maps Creator. + * @param options The optional parameters + * @param callback The callback + */ + update(resourceGroupName: string, accountName: string, creatorName: string, creatorUpdateParameters: Models.CreatorUpdateParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, accountName: string, creatorName: string, creatorUpdateParameters: Models.CreatorUpdateParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + creatorName, + creatorUpdateParameters, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * Delete a Maps Creator resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Maps Account. + * @param creatorName The name of the Maps Creator instance. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, accountName: string, creatorName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Maps Account. + * @param creatorName The name of the Maps Creator instance. + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, accountName: string, creatorName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Maps Account. + * @param creatorName The name of the Maps Creator instance. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, accountName: string, creatorName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, accountName: string, creatorName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + creatorName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Get a Maps Creator resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Maps Account. + * @param creatorName The name of the Maps Creator instance. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, accountName: string, creatorName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Maps Account. + * @param creatorName The name of the Maps Creator instance. + * @param callback The callback + */ + get(resourceGroupName: string, accountName: string, creatorName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Maps Account. + * @param creatorName The name of the Maps Creator instance. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, accountName: string, creatorName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, accountName: string, creatorName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + creatorName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Get all Creator instances for an Azure Maps Account + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByAccountNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByAccountNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByAccountNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByAccountNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByAccountNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listByAccountOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/creators", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CreatorList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/creators/{creatorName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.creatorName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "creatorResource", + mapper: { + ...Mappers.Creator, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Creator + }, + 201: { + bodyMapper: Mappers.Creator + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/creators/{creatorName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.creatorName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "creatorUpdateParameters", + mapper: { + ...Mappers.CreatorUpdateParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Creator + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/creators/{creatorName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.creatorName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/creators/{creatorName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.creatorName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Creator + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByAccountNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CreatorList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/maps/arm-maps/src/operations/index.ts b/sdk/maps/arm-maps/src/operations/index.ts index 74360bc1853a..fb64e44df8a8 100644 --- a/sdk/maps/arm-maps/src/operations/index.ts +++ b/sdk/maps/arm-maps/src/operations/index.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -9,3 +8,5 @@ */ export * from "./accounts"; +export * from "./maps"; +export * from "./creators"; diff --git a/sdk/maps/arm-maps/src/operations/maps.ts b/sdk/maps/arm-maps/src/operations/maps.ts new file mode 100644 index 000000000000..7b27ab324f74 --- /dev/null +++ b/sdk/maps/arm-maps/src/operations/maps.ts @@ -0,0 +1,125 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/mapsMappers"; +import * as Parameters from "../models/parameters"; +import { AzureMapsManagementClientContext } from "../azureMapsManagementClientContext"; + +/** Class representing a Maps. */ +export class Maps { + private readonly client: AzureMapsManagementClientContext; + + /** + * Create a Maps. + * @param {AzureMapsManagementClientContext} client Reference to the service client. + */ + constructor(client: AzureMapsManagementClientContext) { + this.client = client; + } + + /** + * List operations available for the Maps Resource Provider + * @param [options] The optional parameters + * @returns Promise + */ + listOperations(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + listOperations(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listOperations(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listOperations(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationsOperationSpec, + callback) as Promise; + } + + /** + * List operations available for the Maps Resource Provider + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listOperationsNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listOperationsNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listOperationsNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listOperationsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listOperationsNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Maps/operations", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.MapsOperations + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listOperationsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.MapsOperations + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/maps/arm-maps/tsconfig.json b/sdk/maps/arm-maps/tsconfig.json index 87bbf5b5fa49..422b584abd5e 100644 --- a/sdk/maps/arm-maps/tsconfig.json +++ b/sdk/maps/arm-maps/tsconfig.json @@ -9,7 +9,7 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6"], + "lib": ["es6", "dom"], "declaration": true, "outDir": "./esm", "importHelpers": true