From aa34fa08bd3142115e694d7ef8024b13a1846519 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 16 Oct 2018 21:36:08 -0700 Subject: [PATCH 1/3] Generated from b6aeed45dd11f9251470f6a2f0b5371a1ee914d5 (#189) added descriptions for filter and expand --- packages/@azure/arm-features/.npmignore | 35 + packages/@azure/arm-features/LICENSE.txt | 21 + packages/@azure/arm-features/README.md | 77 + .../@azure/arm-features/lib/featureClient.ts | 136 + .../arm-features/lib/featureClientContext.ts | 65 + .../lib/models/featuresMappers.ts | 17 + .../@azure/arm-features/lib/models/index.ts | 291 ++ .../@azure/arm-features/lib/models/mappers.ts | 173 ++ .../arm-features/lib/models/parameters.ts | 73 + .../arm-features/lib/operations/features.ts | 343 +++ .../arm-features/lib/operations/index.ts | 11 + packages/@azure/arm-features/package.json | 42 + packages/@azure/arm-features/rollup.config.js | 31 + packages/@azure/arm-features/tsconfig.json | 19 + packages/@azure/arm-links/.npmignore | 35 + packages/@azure/arm-links/LICENSE.txt | 21 + packages/@azure/arm-links/README.md | 77 + .../arm-links/lib/managementLinkClient.ts | 44 + .../lib/managementLinkClientContext.ts | 65 + packages/@azure/arm-links/lib/models/index.ts | 370 +++ .../@azure/arm-links/lib/models/mappers.ts | 215 ++ .../arm-links/lib/models/operationsMappers.ts | 17 + .../@azure/arm-links/lib/models/parameters.ts | 87 + .../lib/models/resourceLinksMappers.ts | 18 + .../@azure/arm-links/lib/operations/index.ts | 12 + .../arm-links/lib/operations/operations.ts | 123 + .../arm-links/lib/operations/resourceLinks.ts | 421 +++ packages/@azure/arm-links/package.json | 42 + packages/@azure/arm-links/rollup.config.js | 31 + packages/@azure/arm-links/tsconfig.json | 19 + packages/@azure/arm-locks/.npmignore | 35 + packages/@azure/arm-locks/LICENSE.txt | 21 + packages/@azure/arm-locks/README.md | 77 + .../arm-locks/lib/managementLockClient.ts | 44 + .../lib/managementLockClientContext.ts | 65 + .../models/authorizationOperationsMappers.ts | 17 + packages/@azure/arm-locks/lib/models/index.ts | 520 ++++ .../lib/models/managementLocksMappers.ts | 18 + .../@azure/arm-locks/lib/models/mappers.ts | 194 ++ .../@azure/arm-locks/lib/models/parameters.ts | 142 + .../lib/operations/authorizationOperations.ts | 123 + .../@azure/arm-locks/lib/operations/index.ts | 12 + .../lib/operations/managementLocks.ts | 1181 ++++++++ packages/@azure/arm-locks/package.json | 42 + packages/@azure/arm-locks/rollup.config.js | 31 + packages/@azure/arm-locks/tsconfig.json | 19 + .../@azure/arm-managedapplications/.npmignore | 35 + .../arm-managedapplications/LICENSE.txt | 21 + .../@azure/arm-managedapplications/README.md | 77 + .../lib/managedApplicationClient.ts | 138 + .../lib/managedApplicationClientContext.ts | 65 + .../lib/models/applianceDefinitionsMappers.ts | 27 + .../lib/models/appliancesMappers.ts | 27 + .../lib/models/index.ts | 1012 +++++++ .../lib/models/mappers.ts | 675 +++++ .../lib/models/parameters.ts | 118 + .../lib/operations/applianceDefinitions.ts | 492 ++++ .../lib/operations/appliances.ts | 716 +++++ .../lib/operations/index.ts | 12 + .../arm-managedapplications/package.json | 42 + .../arm-managedapplications/rollup.config.js | 31 + .../arm-managedapplications/tsconfig.json | 19 + packages/@azure/arm-policy/.npmignore | 35 + packages/@azure/arm-policy/LICENSE.txt | 21 + packages/@azure/arm-policy/README.md | 81 + .../@azure/arm-policy/lib/models/index.ts | 1088 +++++++ .../@azure/arm-policy/lib/models/mappers.ts | 451 +++ .../arm-policy/lib/models/parameters.ts | 197 ++ .../lib/models/policyAssignmentsMappers.ts | 22 + .../lib/models/policyDefinitionsMappers.ts | 22 + .../lib/models/policySetDefinitionsMappers.ts | 22 + .../@azure/arm-policy/lib/operations/index.ts | 13 + .../lib/operations/policyAssignments.ts | 865 ++++++ .../lib/operations/policyDefinitions.ts | 730 +++++ .../lib/operations/policySetDefinitions.ts | 740 +++++ .../@azure/arm-policy/lib/policyClient.ts | 46 + .../arm-policy/lib/policyClientContext.ts | 65 + packages/@azure/arm-policy/package.json | 42 + packages/@azure/arm-policy/rollup.config.js | 31 + packages/@azure/arm-policy/tsconfig.json | 19 + packages/@azure/arm-resources/.npmignore | 35 + packages/@azure/arm-resources/LICENSE.txt | 21 + packages/@azure/arm-resources/README.md | 77 + .../lib/models/deploymentOperationsMappers.ts | 19 + .../lib/models/deploymentsMappers.ts | 45 + .../@azure/arm-resources/lib/models/index.ts | 2610 +++++++++++++++++ .../arm-resources/lib/models/mappers.ts | 1747 +++++++++++ .../lib/models/operationsMappers.ts | 17 + .../arm-resources/lib/models/parameters.ts | 217 ++ .../lib/models/providersMappers.ts | 19 + .../lib/models/resourceGroupsMappers.ts | 43 + .../lib/models/resourcesMappers.ts | 40 + .../arm-resources/lib/models/tagsMappers.ts | 40 + .../lib/operations/deploymentOperations.ts | 358 +++ .../lib/operations/deployments.ts | 1092 +++++++ .../arm-resources/lib/operations/index.ts | 17 + .../lib/operations/operations.ts | 123 + .../arm-resources/lib/operations/providers.ts | 285 ++ .../lib/operations/resourceGroups.ts | 481 +++ .../arm-resources/lib/operations/resources.ts | 1092 +++++++ .../arm-resources/lib/operations/tags.ts | 352 +++ .../lib/resourceManagementClient.ts | 54 + .../lib/resourceManagementClientContext.ts | 65 + packages/@azure/arm-resources/package.json | 42 + .../@azure/arm-resources/rollup.config.js | 31 + packages/@azure/arm-resources/tsconfig.json | 19 + 106 files changed, 22410 insertions(+) create mode 100644 packages/@azure/arm-features/.npmignore create mode 100644 packages/@azure/arm-features/LICENSE.txt create mode 100644 packages/@azure/arm-features/README.md create mode 100644 packages/@azure/arm-features/lib/featureClient.ts create mode 100644 packages/@azure/arm-features/lib/featureClientContext.ts create mode 100644 packages/@azure/arm-features/lib/models/featuresMappers.ts create mode 100644 packages/@azure/arm-features/lib/models/index.ts create mode 100644 packages/@azure/arm-features/lib/models/mappers.ts create mode 100644 packages/@azure/arm-features/lib/models/parameters.ts create mode 100644 packages/@azure/arm-features/lib/operations/features.ts create mode 100644 packages/@azure/arm-features/lib/operations/index.ts create mode 100644 packages/@azure/arm-features/package.json create mode 100644 packages/@azure/arm-features/rollup.config.js create mode 100644 packages/@azure/arm-features/tsconfig.json create mode 100644 packages/@azure/arm-links/.npmignore create mode 100644 packages/@azure/arm-links/LICENSE.txt create mode 100644 packages/@azure/arm-links/README.md create mode 100644 packages/@azure/arm-links/lib/managementLinkClient.ts create mode 100644 packages/@azure/arm-links/lib/managementLinkClientContext.ts create mode 100644 packages/@azure/arm-links/lib/models/index.ts create mode 100644 packages/@azure/arm-links/lib/models/mappers.ts create mode 100644 packages/@azure/arm-links/lib/models/operationsMappers.ts create mode 100644 packages/@azure/arm-links/lib/models/parameters.ts create mode 100644 packages/@azure/arm-links/lib/models/resourceLinksMappers.ts create mode 100644 packages/@azure/arm-links/lib/operations/index.ts create mode 100644 packages/@azure/arm-links/lib/operations/operations.ts create mode 100644 packages/@azure/arm-links/lib/operations/resourceLinks.ts create mode 100644 packages/@azure/arm-links/package.json create mode 100644 packages/@azure/arm-links/rollup.config.js create mode 100644 packages/@azure/arm-links/tsconfig.json create mode 100644 packages/@azure/arm-locks/.npmignore create mode 100644 packages/@azure/arm-locks/LICENSE.txt create mode 100644 packages/@azure/arm-locks/README.md create mode 100644 packages/@azure/arm-locks/lib/managementLockClient.ts create mode 100644 packages/@azure/arm-locks/lib/managementLockClientContext.ts create mode 100644 packages/@azure/arm-locks/lib/models/authorizationOperationsMappers.ts create mode 100644 packages/@azure/arm-locks/lib/models/index.ts create mode 100644 packages/@azure/arm-locks/lib/models/managementLocksMappers.ts create mode 100644 packages/@azure/arm-locks/lib/models/mappers.ts create mode 100644 packages/@azure/arm-locks/lib/models/parameters.ts create mode 100644 packages/@azure/arm-locks/lib/operations/authorizationOperations.ts create mode 100644 packages/@azure/arm-locks/lib/operations/index.ts create mode 100644 packages/@azure/arm-locks/lib/operations/managementLocks.ts create mode 100644 packages/@azure/arm-locks/package.json create mode 100644 packages/@azure/arm-locks/rollup.config.js create mode 100644 packages/@azure/arm-locks/tsconfig.json create mode 100644 packages/@azure/arm-managedapplications/.npmignore create mode 100644 packages/@azure/arm-managedapplications/LICENSE.txt create mode 100644 packages/@azure/arm-managedapplications/README.md create mode 100644 packages/@azure/arm-managedapplications/lib/managedApplicationClient.ts create mode 100644 packages/@azure/arm-managedapplications/lib/managedApplicationClientContext.ts create mode 100644 packages/@azure/arm-managedapplications/lib/models/applianceDefinitionsMappers.ts create mode 100644 packages/@azure/arm-managedapplications/lib/models/appliancesMappers.ts create mode 100644 packages/@azure/arm-managedapplications/lib/models/index.ts create mode 100644 packages/@azure/arm-managedapplications/lib/models/mappers.ts create mode 100644 packages/@azure/arm-managedapplications/lib/models/parameters.ts create mode 100644 packages/@azure/arm-managedapplications/lib/operations/applianceDefinitions.ts create mode 100644 packages/@azure/arm-managedapplications/lib/operations/appliances.ts create mode 100644 packages/@azure/arm-managedapplications/lib/operations/index.ts create mode 100644 packages/@azure/arm-managedapplications/package.json create mode 100644 packages/@azure/arm-managedapplications/rollup.config.js create mode 100644 packages/@azure/arm-managedapplications/tsconfig.json create mode 100644 packages/@azure/arm-policy/.npmignore create mode 100644 packages/@azure/arm-policy/LICENSE.txt create mode 100644 packages/@azure/arm-policy/README.md create mode 100644 packages/@azure/arm-policy/lib/models/index.ts create mode 100644 packages/@azure/arm-policy/lib/models/mappers.ts create mode 100644 packages/@azure/arm-policy/lib/models/parameters.ts create mode 100644 packages/@azure/arm-policy/lib/models/policyAssignmentsMappers.ts create mode 100644 packages/@azure/arm-policy/lib/models/policyDefinitionsMappers.ts create mode 100644 packages/@azure/arm-policy/lib/models/policySetDefinitionsMappers.ts create mode 100644 packages/@azure/arm-policy/lib/operations/index.ts create mode 100644 packages/@azure/arm-policy/lib/operations/policyAssignments.ts create mode 100644 packages/@azure/arm-policy/lib/operations/policyDefinitions.ts create mode 100644 packages/@azure/arm-policy/lib/operations/policySetDefinitions.ts create mode 100644 packages/@azure/arm-policy/lib/policyClient.ts create mode 100644 packages/@azure/arm-policy/lib/policyClientContext.ts create mode 100644 packages/@azure/arm-policy/package.json create mode 100644 packages/@azure/arm-policy/rollup.config.js create mode 100644 packages/@azure/arm-policy/tsconfig.json create mode 100644 packages/@azure/arm-resources/.npmignore create mode 100644 packages/@azure/arm-resources/LICENSE.txt create mode 100644 packages/@azure/arm-resources/README.md create mode 100644 packages/@azure/arm-resources/lib/models/deploymentOperationsMappers.ts create mode 100644 packages/@azure/arm-resources/lib/models/deploymentsMappers.ts create mode 100644 packages/@azure/arm-resources/lib/models/index.ts create mode 100644 packages/@azure/arm-resources/lib/models/mappers.ts create mode 100644 packages/@azure/arm-resources/lib/models/operationsMappers.ts create mode 100644 packages/@azure/arm-resources/lib/models/parameters.ts create mode 100644 packages/@azure/arm-resources/lib/models/providersMappers.ts create mode 100644 packages/@azure/arm-resources/lib/models/resourceGroupsMappers.ts create mode 100644 packages/@azure/arm-resources/lib/models/resourcesMappers.ts create mode 100644 packages/@azure/arm-resources/lib/models/tagsMappers.ts create mode 100644 packages/@azure/arm-resources/lib/operations/deploymentOperations.ts create mode 100644 packages/@azure/arm-resources/lib/operations/deployments.ts create mode 100644 packages/@azure/arm-resources/lib/operations/index.ts create mode 100644 packages/@azure/arm-resources/lib/operations/operations.ts create mode 100644 packages/@azure/arm-resources/lib/operations/providers.ts create mode 100644 packages/@azure/arm-resources/lib/operations/resourceGroups.ts create mode 100644 packages/@azure/arm-resources/lib/operations/resources.ts create mode 100644 packages/@azure/arm-resources/lib/operations/tags.ts create mode 100644 packages/@azure/arm-resources/lib/resourceManagementClient.ts create mode 100644 packages/@azure/arm-resources/lib/resourceManagementClientContext.ts create mode 100644 packages/@azure/arm-resources/package.json create mode 100644 packages/@azure/arm-resources/rollup.config.js create mode 100644 packages/@azure/arm-resources/tsconfig.json diff --git a/packages/@azure/arm-features/.npmignore b/packages/@azure/arm-features/.npmignore new file mode 100644 index 000000000000..a07a455ac10c --- /dev/null +++ b/packages/@azure/arm-features/.npmignore @@ -0,0 +1,35 @@ +#git +.git +.gitignore +#gulp +gulpfile.js +#documentation +doc/ +docs/ +#dependencies +node_modules/ +#samples +sample/ +samples/ +#tests +test/ +tests/ +coverage/ +#tools and scripts +tools/ +scripts/ +#IDE settings +*.sln +.vscode/ +.idea +.editorconfig +.ntvs_analysis.* +#build tools +.travis.yml +.jenkins.yml +.codeclimate.yml +appveyor.yml +# Nuget packages # +.nuget/ +packages/ +packages.config diff --git a/packages/@azure/arm-features/LICENSE.txt b/packages/@azure/arm-features/LICENSE.txt new file mode 100644 index 000000000000..5431ba98b936 --- /dev/null +++ b/packages/@azure/arm-features/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/@azure/arm-features/README.md b/packages/@azure/arm-features/README.md new file mode 100644 index 000000000000..eaff3c18c2a5 --- /dev/null +++ b/packages/@azure/arm-features/README.md @@ -0,0 +1,77 @@ +# Azure FeatureClient SDK for JavaScript +This package contains an isomorphic SDK for FeatureClient. + +## Currently supported environments +- Node.js version 6.x.x or higher +- Browser JavaScript + +## How to Install +``` +npm install @azure/arm-features +``` + + +## How to use + +### nodejs - Authentication, client creation and listOperations as an example written in TypeScript. + +```ts +import * as msRest from "ms-rest-js"; +import * as msRestAzure from "ms-rest-azure-js"; +import * as msRestNodeAuth from "ms-rest-nodeauth"; +import { FeatureClient, FeatureModels, FeatureMappers } from "@azure/arm-features"; +const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; + +msRestNodeAuth.interactiveLogin().then((creds) => { + const client = new FeatureClient(creds, subscriptionId); + client.listOperations().then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.error(err); +}); +``` + +### browser - Authentication, client creation and listOperations as an example written in JavaScript. +See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. + +- index.html +```html + + + + @azure/arm-features sample + + + + + + + + + +``` + +# Related projects + - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) diff --git a/packages/@azure/arm-features/lib/featureClient.ts b/packages/@azure/arm-features/lib/featureClient.ts new file mode 100644 index 000000000000..7cf4c543e808 --- /dev/null +++ b/packages/@azure/arm-features/lib/featureClient.ts @@ -0,0 +1,136 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; +import * as Models from "./models"; +import * as Mappers from "./models/mappers"; +import * as Parameters from "./models/parameters"; +import * as operations from "./operations"; +import { FeatureClientContext } from "./featureClientContext"; + + +class FeatureClient extends FeatureClientContext { + // Operation groups + features: operations.Features; + + /** + * Initializes a new instance of the FeatureClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId The ID of the target subscription. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.FeatureClientOptions) { + super(credentials, subscriptionId, options); + this.features = new operations.Features(this); + } + + /** + * Lists all of the available Microsoft.Features REST API operations. + * @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, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + options + }, + listOperationsOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the available Microsoft.Features REST API operations. + * @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, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + nextPageLink, + options + }, + listOperationsNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Features/operations", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listOperationsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +export { + FeatureClient, + FeatureClientContext, + Models as FeatureModels, + Mappers as FeatureMappers +}; +export * from "./operations"; diff --git a/packages/@azure/arm-features/lib/featureClientContext.ts b/packages/@azure/arm-features/lib/featureClientContext.ts new file mode 100644 index 000000000000..537005bd02f9 --- /dev/null +++ b/packages/@azure/arm-features/lib/featureClientContext.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as Models from "./models"; +import * as msRest from "ms-rest-js"; +import * as msRestAzure from "ms-rest-azure-js"; + +const packageName = "@azure/arm-features"; +const packageVersion = "1.0.0"; + +export class FeatureClientContext extends msRestAzure.AzureServiceClient { + + credentials: msRest.ServiceClientCredentials; + + subscriptionId: string; + + apiVersion: string; + + acceptLanguage: string; + + longRunningOperationRetryTimeout: number; + + /** + * Initializes a new instance of the FeatureClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId The ID of the target subscription. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.FeatureClientOptions) { + if (credentials == undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId == undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) { + options = {}; + } + super(credentials, options); + + this.apiVersion = '2015-12-01'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; + this.requestContentType = "application/json; charset=utf-8"; + this.credentials = credentials; + this.subscriptionId = subscriptionId; + + this.addUserAgentInfo(`${packageName}/${packageVersion}`); + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + } +} diff --git a/packages/@azure/arm-features/lib/models/featuresMappers.ts b/packages/@azure/arm-features/lib/models/featuresMappers.ts new file mode 100644 index 000000000000..f76e186d07a8 --- /dev/null +++ b/packages/@azure/arm-features/lib/models/featuresMappers.ts @@ -0,0 +1,17 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + FeatureOperationsListResult, + FeatureResult, + FeatureProperties, + CloudError +} from "../models/mappers"; + diff --git a/packages/@azure/arm-features/lib/models/index.ts b/packages/@azure/arm-features/lib/models/index.ts new file mode 100644 index 000000000000..3ae9bc4d840d --- /dev/null +++ b/packages/@azure/arm-features/lib/models/index.ts @@ -0,0 +1,291 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import { BaseResource, CloudError, AzureServiceClientOptions } from "ms-rest-azure-js"; +import * as msRest from "ms-rest-js"; + +export { BaseResource, CloudError }; + + +/** + * @interface + * An interface representing FeatureProperties. + * Information about feature. + * + */ +export interface FeatureProperties { + /** + * @member {string} [state] The registration state of the feature for the + * subscription. + */ + state?: string; +} + +/** + * @interface + * An interface representing FeatureResult. + * Previewed feature information. + * + */ +export interface FeatureResult { + /** + * @member {string} [name] The name of the feature. + */ + name?: string; + /** + * @member {FeatureProperties} [properties] Properties of the previewed + * feature. + */ + properties?: FeatureProperties; + /** + * @member {string} [id] The resource ID of the feature. + */ + id?: string; + /** + * @member {string} [type] The resource type of the feature. + */ + type?: string; +} + +/** + * @interface + * An interface representing OperationDisplay. + * The object that represents the operation. + * + */ +export interface OperationDisplay { + /** + * @member {string} [provider] Service provider: Microsoft.Features + */ + provider?: string; + /** + * @member {string} [resource] Resource on which the operation is performed: + * Profile, endpoint, etc. + */ + resource?: string; + /** + * @member {string} [operation] Operation type: Read, write, delete, etc. + */ + operation?: string; +} + +/** + * @interface + * An interface representing Operation. + * Microsoft.Features operation + * + */ +export interface Operation { + /** + * @member {string} [name] Operation name: {provider}/{resource}/{operation} + */ + name?: string; + /** + * @member {OperationDisplay} [display] The object that represents the + * operation. + */ + display?: OperationDisplay; +} + +/** + * @interface + * An interface representing FeatureClientOptions. + * @extends AzureServiceClientOptions + */ +export interface FeatureClientOptions extends AzureServiceClientOptions { + /** + * @member {string} [baseUri] + */ + baseUri?: string; +} + + +/** + * @interface + * An interface representing the OperationListResult. + * Result of the request to list Microsoft.Features operations. It contains a + * list of operations and a URL link to get the next set of results. + * + * @extends Array + */ +export interface OperationListResult extends Array { + /** + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ + nextLink?: string; +} + +/** + * @interface + * An interface representing the FeatureOperationsListResult. + * List of previewed features. + * + * @extends Array + */ +export interface FeatureOperationsListResult extends Array { + /** + * @member {string} [nextLink] The URL to use for getting the next set of + * results. + */ + nextLink?: string; +} + +/** + * Contains response data for the listOperations operation. + */ +export type ListOperationsResponse = OperationListResult & { + /** + * 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: OperationListResult; + }; +}; + +/** + * Contains response data for the listOperationsNext operation. + */ +export type ListOperationsNextResponse = OperationListResult & { + /** + * 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: OperationListResult; + }; +}; + +/** + * Contains response data for the listAll operation. + */ +export type FeaturesListAllResponse = FeatureOperationsListResult & { + /** + * 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: FeatureOperationsListResult; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type FeaturesListResponse = FeatureOperationsListResult & { + /** + * 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: FeatureOperationsListResult; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type FeaturesGetResponse = FeatureResult & { + /** + * 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: FeatureResult; + }; +}; + +/** + * Contains response data for the register operation. + */ +export type FeaturesRegisterResponse = FeatureResult & { + /** + * 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: FeatureResult; + }; +}; + +/** + * Contains response data for the listAllNext operation. + */ +export type FeaturesListAllNextResponse = FeatureOperationsListResult & { + /** + * 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: FeatureOperationsListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type FeaturesListNextResponse = FeatureOperationsListResult & { + /** + * 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: FeatureOperationsListResult; + }; +}; diff --git a/packages/@azure/arm-features/lib/models/mappers.ts b/packages/@azure/arm-features/lib/models/mappers.ts new file mode 100644 index 000000000000..454c334e20cc --- /dev/null +++ b/packages/@azure/arm-features/lib/models/mappers.ts @@ -0,0 +1,173 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import { CloudErrorMapper, BaseResourceMapper } from "ms-rest-azure-js"; +import * as msRest from "ms-rest-js"; + +export const CloudError = CloudErrorMapper; +export const BaseResource = BaseResourceMapper; + +export const FeatureProperties: msRest.CompositeMapper = { + serializedName: "FeatureProperties", + type: { + name: "Composite", + className: "FeatureProperties", + modelProperties: { + state: { + serializedName: "state", + type: { + name: "String" + } + } + } + } +}; + +export const FeatureResult: msRest.CompositeMapper = { + serializedName: "FeatureResult", + type: { + name: "Composite", + className: "FeatureResult", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "FeatureProperties" + } + }, + id: { + serializedName: "id", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const OperationDisplay: msRest.CompositeMapper = { + serializedName: "Operation_display", + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + } + } + } +}; + +export const Operation: msRest.CompositeMapper = { + serializedName: "Operation", + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + } + } + } +}; + +export const OperationListResult: msRest.CompositeMapper = { + serializedName: "OperationListResult", + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const FeatureOperationsListResult: msRest.CompositeMapper = { + serializedName: "FeatureOperationsListResult", + type: { + name: "Composite", + className: "FeatureOperationsListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FeatureResult" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/packages/@azure/arm-features/lib/models/parameters.ts b/packages/@azure/arm-features/lib/models/parameters.ts new file mode 100644 index 000000000000..53cc6570c4e7 --- /dev/null +++ b/packages/@azure/arm-features/lib/models/parameters.ts @@ -0,0 +1,73 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; + +export const acceptLanguage: msRest.OperationParameter = { + parameterPath: "acceptLanguage", + mapper: { + serializedName: "accept-language", + defaultValue: 'en-US', + type: { + name: "String" + } + } +}; +export const apiVersion: msRest.OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + required: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; +export const featureName: msRest.OperationURLParameter = { + parameterPath: "featureName", + mapper: { + required: true, + serializedName: "featureName", + type: { + name: "String" + } + } +}; +export const nextPageLink: msRest.OperationURLParameter = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const resourceProviderNamespace: msRest.OperationURLParameter = { + parameterPath: "resourceProviderNamespace", + mapper: { + required: true, + serializedName: "resourceProviderNamespace", + type: { + name: "String" + } + } +}; +export const subscriptionId: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + type: { + name: "String" + } + } +}; diff --git a/packages/@azure/arm-features/lib/operations/features.ts b/packages/@azure/arm-features/lib/operations/features.ts new file mode 100644 index 000000000000..ab1acfff4fc1 --- /dev/null +++ b/packages/@azure/arm-features/lib/operations/features.ts @@ -0,0 +1,343 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/featuresMappers"; +import * as Parameters from "../models/parameters"; +import { FeatureClientContext } from "../featureClientContext"; + +/** Class representing a Features. */ +export class Features { + private readonly client: FeatureClientContext; + + /** + * Create a Features. + * @param {FeatureClientContext} client Reference to the service client. + */ + constructor(client: FeatureClientContext) { + this.client = client; + } + + /** + * Gets all the preview features that are available through AFEC for the subscription. + * @param [options] The optional parameters + * @returns Promise + */ + listAll(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + listAll(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listAll(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listAll(options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listAllOperationSpec, + callback) as Promise; + } + + /** + * Gets all the preview features in a provider namespace that are available through AFEC for the + * subscription. + * @param resourceProviderNamespace The namespace of the resource provider for getting features. + * @param [options] The optional parameters + * @returns Promise + */ + list(resourceProviderNamespace: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceProviderNamespace The namespace of the resource provider for getting features. + * @param callback The callback + */ + list(resourceProviderNamespace: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceProviderNamespace The namespace of the resource provider for getting features. + * @param options The optional parameters + * @param callback The callback + */ + list(resourceProviderNamespace: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(resourceProviderNamespace: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceProviderNamespace, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Gets the preview feature with the specified name. + * @param resourceProviderNamespace The resource provider namespace for the feature. + * @param featureName The name of the feature to get. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceProviderNamespace: string, featureName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceProviderNamespace The resource provider namespace for the feature. + * @param featureName The name of the feature to get. + * @param callback The callback + */ + get(resourceProviderNamespace: string, featureName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceProviderNamespace The resource provider namespace for the feature. + * @param featureName The name of the feature to get. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceProviderNamespace: string, featureName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceProviderNamespace: string, featureName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceProviderNamespace, + featureName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Registers the preview feature for the subscription. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param featureName The name of the feature to register. + * @param [options] The optional parameters + * @returns Promise + */ + register(resourceProviderNamespace: string, featureName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceProviderNamespace The namespace of the resource provider. + * @param featureName The name of the feature to register. + * @param callback The callback + */ + register(resourceProviderNamespace: string, featureName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceProviderNamespace The namespace of the resource provider. + * @param featureName The name of the feature to register. + * @param options The optional parameters + * @param callback The callback + */ + register(resourceProviderNamespace: string, featureName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + register(resourceProviderNamespace: string, featureName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceProviderNamespace, + featureName, + options + }, + registerOperationSpec, + callback) as Promise; + } + + /** + * Gets all the preview features that are available through AFEC for the subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listAllNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listAllNext(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 + */ + listAllNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listAllNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listAllNextOperationSpec, + callback) as Promise; + } + + /** + * Gets all the preview features in a provider namespace that are available through AFEC for the + * subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(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 + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listAllOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Features/features", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.FeatureOperationsListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features", + urlParameters: [ + Parameters.resourceProviderNamespace, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.FeatureOperationsListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}", + urlParameters: [ + Parameters.resourceProviderNamespace, + Parameters.featureName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.FeatureResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const registerOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}/register", + urlParameters: [ + Parameters.resourceProviderNamespace, + Parameters.featureName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.FeatureResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listAllNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.FeatureOperationsListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.FeatureOperationsListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/@azure/arm-features/lib/operations/index.ts b/packages/@azure/arm-features/lib/operations/index.ts new file mode 100644 index 000000000000..e7a795418c8a --- /dev/null +++ b/packages/@azure/arm-features/lib/operations/index.ts @@ -0,0 +1,11 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export * from "./features"; diff --git a/packages/@azure/arm-features/package.json b/packages/@azure/arm-features/package.json new file mode 100644 index 000000000000..2bdf8e328854 --- /dev/null +++ b/packages/@azure/arm-features/package.json @@ -0,0 +1,42 @@ +{ + "name": "@azure/arm-features", + "author": "Microsoft Corporation", + "description": "FeatureClient Library with typescript type definitions for node.js and browser.", + "version": "1.0.0", + "dependencies": { + "ms-rest-azure-js": "^1.0.166", + "ms-rest-js": "^1.0.439", + "tslib": "^1.9.3" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/arm-features.js", + "module": "./esm/featureClient.js", + "types": "./esm/featureClient.d.ts", + "devDependencies": { + "typescript": "^3.1.1", + "rollup": "^0.66.2", + "rollup-plugin-node-resolve": "^3.4.0", + "uglify-js": "^3.4.9" + }, + "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/packages/@azure/arm-features", + "repository": { + "type": "git", + "url": "https://github.com/azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/azure/azure-sdk-for-js/issues" + }, + "scripts": { + "build": "tsc && rollup -c rollup.config.js && npm run minify", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-features.js.map'\" -o ./dist/arm-features.min.js ./dist/arm-features.js", + "prepare": "npm run build" + }, + "sideEffects": false +} diff --git a/packages/@azure/arm-features/rollup.config.js b/packages/@azure/arm-features/rollup.config.js new file mode 100644 index 000000000000..ea7d5bae5c13 --- /dev/null +++ b/packages/@azure/arm-features/rollup.config.js @@ -0,0 +1,31 @@ +import nodeResolve from "rollup-plugin-node-resolve"; +/** + * @type {import('rollup').RollupFileOptions} + */ +const config = { + input: './esm/featureClient.js', + external: ["ms-rest-js", "ms-rest-azure-js"], + output: { + file: "./dist/arm-features.js", + format: "umd", + name: "Azure.ArmFeatures", + sourcemap: true, + globals: { + "ms-rest-js": "msRest", + "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. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */` + }, + plugins: [ + nodeResolve({ module: true }) + ] +}; +export default config; diff --git a/packages/@azure/arm-features/tsconfig.json b/packages/@azure/arm-features/tsconfig.json new file mode 100644 index 000000000000..f32d1664f320 --- /dev/null +++ b/packages/@azure/arm-features/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es5", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": ["es6"], + "declaration": true, + "outDir": "./esm", + "importHelpers": true + }, + "include": ["./lib/**/*"], + "exclude": ["node_modules"] +} diff --git a/packages/@azure/arm-links/.npmignore b/packages/@azure/arm-links/.npmignore new file mode 100644 index 000000000000..a07a455ac10c --- /dev/null +++ b/packages/@azure/arm-links/.npmignore @@ -0,0 +1,35 @@ +#git +.git +.gitignore +#gulp +gulpfile.js +#documentation +doc/ +docs/ +#dependencies +node_modules/ +#samples +sample/ +samples/ +#tests +test/ +tests/ +coverage/ +#tools and scripts +tools/ +scripts/ +#IDE settings +*.sln +.vscode/ +.idea +.editorconfig +.ntvs_analysis.* +#build tools +.travis.yml +.jenkins.yml +.codeclimate.yml +appveyor.yml +# Nuget packages # +.nuget/ +packages/ +packages.config diff --git a/packages/@azure/arm-links/LICENSE.txt b/packages/@azure/arm-links/LICENSE.txt new file mode 100644 index 000000000000..5431ba98b936 --- /dev/null +++ b/packages/@azure/arm-links/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/@azure/arm-links/README.md b/packages/@azure/arm-links/README.md new file mode 100644 index 000000000000..8f19f384fbab --- /dev/null +++ b/packages/@azure/arm-links/README.md @@ -0,0 +1,77 @@ +# Azure ManagementLinkClient SDK for JavaScript +This package contains an isomorphic SDK for ManagementLinkClient. + +## Currently supported environments +- Node.js version 6.x.x or higher +- Browser JavaScript + +## How to Install +``` +npm install @azure/arm-links +``` + + +## How to use + +### nodejs - Authentication, client creation and list operations as an example written in TypeScript. + +```ts +import * as msRest from "ms-rest-js"; +import * as msRestAzure from "ms-rest-azure-js"; +import * as msRestNodeAuth from "ms-rest-nodeauth"; +import { ManagementLinkClient, ManagementLinkModels, ManagementLinkMappers } from "@azure/arm-links"; +const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; + +msRestNodeAuth.interactiveLogin().then((creds) => { + const client = new ManagementLinkClient(creds, subscriptionId); + client.operations.list().then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.error(err); +}); +``` + +### browser - Authentication, client creation and list operations as an example written in JavaScript. +See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. + +- index.html +```html + + + + @azure/arm-links sample + + + + + + + + + +``` + +# Related projects + - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) diff --git a/packages/@azure/arm-links/lib/managementLinkClient.ts b/packages/@azure/arm-links/lib/managementLinkClient.ts new file mode 100644 index 000000000000..79f1c4abde29 --- /dev/null +++ b/packages/@azure/arm-links/lib/managementLinkClient.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; +import * as Models from "./models"; +import * as Mappers from "./models/mappers"; +import * as operations from "./operations"; +import { ManagementLinkClientContext } from "./managementLinkClientContext"; + + +class ManagementLinkClient extends ManagementLinkClientContext { + // Operation groups + operations: operations.Operations; + resourceLinks: operations.ResourceLinks; + + /** + * Initializes a new instance of the ManagementLinkClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId The ID of the target subscription. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.ManagementLinkClientOptions) { + super(credentials, subscriptionId, options); + this.operations = new operations.Operations(this); + this.resourceLinks = new operations.ResourceLinks(this); + } +} + +// Operation Specifications + +export { + ManagementLinkClient, + ManagementLinkClientContext, + Models as ManagementLinkModels, + Mappers as ManagementLinkMappers +}; +export * from "./operations"; diff --git a/packages/@azure/arm-links/lib/managementLinkClientContext.ts b/packages/@azure/arm-links/lib/managementLinkClientContext.ts new file mode 100644 index 000000000000..9e58ddcb9e10 --- /dev/null +++ b/packages/@azure/arm-links/lib/managementLinkClientContext.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as Models from "./models"; +import * as msRest from "ms-rest-js"; +import * as msRestAzure from "ms-rest-azure-js"; + +const packageName = "@azure/arm-links"; +const packageVersion = "1.0.0"; + +export class ManagementLinkClientContext extends msRestAzure.AzureServiceClient { + + credentials: msRest.ServiceClientCredentials; + + subscriptionId: string; + + apiVersion: string; + + acceptLanguage: string; + + longRunningOperationRetryTimeout: number; + + /** + * Initializes a new instance of the ManagementLinkClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId The ID of the target subscription. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.ManagementLinkClientOptions) { + if (credentials == undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId == undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) { + options = {}; + } + super(credentials, options); + + this.apiVersion = '2016-09-01'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; + this.requestContentType = "application/json; charset=utf-8"; + this.credentials = credentials; + this.subscriptionId = subscriptionId; + + this.addUserAgentInfo(`${packageName}/${packageVersion}`); + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + } +} diff --git a/packages/@azure/arm-links/lib/models/index.ts b/packages/@azure/arm-links/lib/models/index.ts new file mode 100644 index 000000000000..256854911106 --- /dev/null +++ b/packages/@azure/arm-links/lib/models/index.ts @@ -0,0 +1,370 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import { BaseResource, CloudError, AzureServiceClientOptions } from "ms-rest-azure-js"; +import * as msRest from "ms-rest-js"; + +export { BaseResource, CloudError }; + + +/** + * @interface + * An interface representing ResourceLinkFilter. + * Resource link filter. + * + */ +export interface ResourceLinkFilter { + /** + * @member {string} targetId The ID of the target resource. + */ + targetId: string; +} + +/** + * @interface + * An interface representing ResourceLinkProperties. + * The resource link properties. + * + */ +export interface ResourceLinkProperties { + /** + * @member {string} [sourceId] The fully qualified ID of the source resource + * in the link. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly sourceId?: string; + /** + * @member {string} targetId The fully qualified ID of the target resource in + * the link. + */ + targetId: string; + /** + * @member {string} [notes] Notes about the resource link. + */ + notes?: string; +} + +/** + * @interface + * An interface representing ResourceLink. + * The resource link. + * + * @extends BaseResource + */ +export interface ResourceLink extends BaseResource { + /** + * @member {string} [id] The fully qualified ID of the resource link. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [name] The name of the resource link. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {any} [type] The resource link object. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: any; + /** + * @member {ResourceLinkProperties} [properties] Properties for resource + * link. + */ + properties?: ResourceLinkProperties; +} + +/** + * @interface + * An interface representing OperationDisplay. + * The object that represents the operation. + * + */ +export interface OperationDisplay { + /** + * @member {string} [provider] Service provider: Microsoft.Resources + */ + provider?: string; + /** + * @member {string} [resource] Resource on which the operation is performed: + * Profile, endpoint, etc. + */ + resource?: string; + /** + * @member {string} [operation] Operation type: Read, write, delete, etc. + */ + operation?: string; + /** + * @member {string} [description] Description of the operation. + */ + description?: string; +} + +/** + * @interface + * An interface representing Operation. + * Microsoft.Resources operation + * + */ +export interface Operation { + /** + * @member {string} [name] Operation name: {provider}/{resource}/{operation} + */ + name?: string; + /** + * @member {OperationDisplay} [display] The object that represents the + * operation. + */ + display?: OperationDisplay; +} + +/** + * @interface + * An interface representing ResourceLinksListAtSubscriptionOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface ResourceLinksListAtSubscriptionOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [filter] The filter to apply on the list resource links + * operation. The supported filter for list resource links is targetid. For + * example, $filter=targetid eq {value} + */ + filter?: string; +} + +/** + * @interface + * An interface representing ResourceLinksListAtSourceScopeOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface ResourceLinksListAtSourceScopeOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [filter] The filter to apply when getting resource links. + * To get links only at the specified scope (not below the scope), use + * Filter.atScope(). + */ + filter?: string; +} + +/** + * @interface + * An interface representing ManagementLinkClientOptions. + * @extends AzureServiceClientOptions + */ +export interface ManagementLinkClientOptions extends AzureServiceClientOptions { + /** + * @member {string} [baseUri] + */ + baseUri?: string; +} + + +/** + * @interface + * An interface representing the OperationListResult. + * Result of the request to list Microsoft.Resources operations. It contains a + * list of operations and a URL link to get the next set of results. + * + * @extends Array + */ +export interface OperationListResult extends Array { + /** + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ + nextLink?: string; +} + +/** + * @interface + * An interface representing the ResourceLinkResult. + * List of resource links. + * + * @extends Array + */ +export interface ResourceLinkResult extends Array { + /** + * @member {string} [nextLink] The URL to use for getting the next set of + * results. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly nextLink?: string; +} + +/** + * Defines values for Filter. + * Possible values include: 'atScope()' + * @readonly + * @enum {string} + */ +export enum Filter { + AtScope = 'atScope()', +} + +/** + * Contains response data for the list operation. + */ +export type OperationsListResponse = OperationListResult & { + /** + * 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: OperationListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type OperationsListNextResponse = OperationListResult & { + /** + * 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: OperationListResult; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type ResourceLinksCreateOrUpdateResponse = ResourceLink & { + /** + * 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: ResourceLink; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type ResourceLinksGetResponse = ResourceLink & { + /** + * 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: ResourceLink; + }; +}; + +/** + * Contains response data for the listAtSubscription operation. + */ +export type ResourceLinksListAtSubscriptionResponse = ResourceLinkResult & { + /** + * 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: ResourceLinkResult; + }; +}; + +/** + * Contains response data for the listAtSourceScope operation. + */ +export type ResourceLinksListAtSourceScopeResponse = ResourceLinkResult & { + /** + * 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: ResourceLinkResult; + }; +}; + +/** + * Contains response data for the listAtSubscriptionNext operation. + */ +export type ResourceLinksListAtSubscriptionNextResponse = ResourceLinkResult & { + /** + * 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: ResourceLinkResult; + }; +}; + +/** + * Contains response data for the listAtSourceScopeNext operation. + */ +export type ResourceLinksListAtSourceScopeNextResponse = ResourceLinkResult & { + /** + * 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: ResourceLinkResult; + }; +}; diff --git a/packages/@azure/arm-links/lib/models/mappers.ts b/packages/@azure/arm-links/lib/models/mappers.ts new file mode 100644 index 000000000000..4434c87988c8 --- /dev/null +++ b/packages/@azure/arm-links/lib/models/mappers.ts @@ -0,0 +1,215 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import { CloudErrorMapper, BaseResourceMapper } from "ms-rest-azure-js"; +import * as msRest from "ms-rest-js"; + +export const CloudError = CloudErrorMapper; +export const BaseResource = BaseResourceMapper; + +export const ResourceLinkFilter: msRest.CompositeMapper = { + serializedName: "ResourceLinkFilter", + type: { + name: "Composite", + className: "ResourceLinkFilter", + modelProperties: { + targetId: { + required: true, + serializedName: "targetId", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceLinkProperties: msRest.CompositeMapper = { + serializedName: "ResourceLinkProperties", + type: { + name: "Composite", + className: "ResourceLinkProperties", + modelProperties: { + sourceId: { + readOnly: true, + serializedName: "sourceId", + type: { + name: "String" + } + }, + targetId: { + required: true, + serializedName: "targetId", + type: { + name: "String" + } + }, + notes: { + serializedName: "notes", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceLink: msRest.CompositeMapper = { + serializedName: "ResourceLink", + type: { + name: "Composite", + className: "ResourceLink", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "Object" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "ResourceLinkProperties" + } + } + } + } +}; + +export const OperationDisplay: msRest.CompositeMapper = { + serializedName: "Operation_display", + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const Operation: msRest.CompositeMapper = { + serializedName: "Operation", + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + } + } + } +}; + +export const OperationListResult: msRest.CompositeMapper = { + serializedName: "OperationListResult", + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceLinkResult: msRest.CompositeMapper = { + serializedName: "ResourceLinkResult", + type: { + name: "Composite", + className: "ResourceLinkResult", + modelProperties: { + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceLink" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/packages/@azure/arm-links/lib/models/operationsMappers.ts b/packages/@azure/arm-links/lib/models/operationsMappers.ts new file mode 100644 index 000000000000..2edcc577920e --- /dev/null +++ b/packages/@azure/arm-links/lib/models/operationsMappers.ts @@ -0,0 +1,17 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + OperationListResult, + Operation, + OperationDisplay, + CloudError +} from "../models/mappers"; + diff --git a/packages/@azure/arm-links/lib/models/parameters.ts b/packages/@azure/arm-links/lib/models/parameters.ts new file mode 100644 index 000000000000..f58cf3193ad5 --- /dev/null +++ b/packages/@azure/arm-links/lib/models/parameters.ts @@ -0,0 +1,87 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; + +export const acceptLanguage: msRest.OperationParameter = { + parameterPath: "acceptLanguage", + mapper: { + serializedName: "accept-language", + defaultValue: 'en-US', + type: { + name: "String" + } + } +}; +export const apiVersion: msRest.OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + required: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; +export const filter: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "filter" + ], + mapper: { + serializedName: "$filter", + type: { + name: "String" + } + } +}; +export const linkId: msRest.OperationURLParameter = { + parameterPath: "linkId", + mapper: { + required: true, + serializedName: "linkId", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const nextPageLink: msRest.OperationURLParameter = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const scope: msRest.OperationURLParameter = { + parameterPath: "scope", + mapper: { + required: true, + serializedName: "scope", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const subscriptionId: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + type: { + name: "String" + } + } +}; diff --git a/packages/@azure/arm-links/lib/models/resourceLinksMappers.ts b/packages/@azure/arm-links/lib/models/resourceLinksMappers.ts new file mode 100644 index 000000000000..aac3c16eb59c --- /dev/null +++ b/packages/@azure/arm-links/lib/models/resourceLinksMappers.ts @@ -0,0 +1,18 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + CloudError, + ResourceLink, + BaseResource, + ResourceLinkProperties, + ResourceLinkResult +} from "../models/mappers"; + diff --git a/packages/@azure/arm-links/lib/operations/index.ts b/packages/@azure/arm-links/lib/operations/index.ts new file mode 100644 index 000000000000..13eac92de120 --- /dev/null +++ b/packages/@azure/arm-links/lib/operations/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export * from "./operations"; +export * from "./resourceLinks"; diff --git a/packages/@azure/arm-links/lib/operations/operations.ts b/packages/@azure/arm-links/lib/operations/operations.ts new file mode 100644 index 000000000000..a258f28eef8d --- /dev/null +++ b/packages/@azure/arm-links/lib/operations/operations.ts @@ -0,0 +1,123 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/operationsMappers"; +import * as Parameters from "../models/parameters"; +import { ManagementLinkClientContext } from "../managementLinkClientContext"; + +/** Class representing a Operations. */ +export class Operations { + private readonly client: ManagementLinkClientContext; + + /** + * Create a Operations. + * @param {ManagementLinkClientContext} client Reference to the service client. + */ + constructor(client: ManagementLinkClientContext) { + this.client = client; + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(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 + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Resources/operations", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/@azure/arm-links/lib/operations/resourceLinks.ts b/packages/@azure/arm-links/lib/operations/resourceLinks.ts new file mode 100644 index 000000000000..1755e3ea269c --- /dev/null +++ b/packages/@azure/arm-links/lib/operations/resourceLinks.ts @@ -0,0 +1,421 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/resourceLinksMappers"; +import * as Parameters from "../models/parameters"; +import { ManagementLinkClientContext } from "../managementLinkClientContext"; + +/** Class representing a ResourceLinks. */ +export class ResourceLinks { + private readonly client: ManagementLinkClientContext; + + /** + * Create a ResourceLinks. + * @param {ManagementLinkClientContext} client Reference to the service client. + */ + constructor(client: ManagementLinkClientContext) { + this.client = client; + } + + /** + * Deletes a resource link with the specified ID. + * @param linkId The fully qualified ID of the resource link. Use the format, + * /subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/{provider-namespace}/{resource-type}/{resource-name}/Microsoft.Resources/links/{link-name}. + * For example, + * /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup/Microsoft.Web/sites/mySite/Microsoft.Resources/links/myLink + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(linkId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param linkId The fully qualified ID of the resource link. Use the format, + * /subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/{provider-namespace}/{resource-type}/{resource-name}/Microsoft.Resources/links/{link-name}. + * For example, + * /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup/Microsoft.Web/sites/mySite/Microsoft.Resources/links/myLink + * @param callback The callback + */ + deleteMethod(linkId: string, callback: msRest.ServiceCallback): void; + /** + * @param linkId The fully qualified ID of the resource link. Use the format, + * /subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/{provider-namespace}/{resource-type}/{resource-name}/Microsoft.Resources/links/{link-name}. + * For example, + * /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup/Microsoft.Web/sites/mySite/Microsoft.Resources/links/myLink + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(linkId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(linkId: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + linkId, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Creates or updates a resource link between the specified resources. + * @param linkId The fully qualified ID of the resource link. Use the format, + * /subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/{provider-namespace}/{resource-type}/{resource-name}/Microsoft.Resources/links/{link-name}. + * For example, + * /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup/Microsoft.Web/sites/mySite/Microsoft.Resources/links/myLink + * @param parameters Parameters for creating or updating a resource link. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(linkId: string, parameters: Models.ResourceLink, options?: msRest.RequestOptionsBase): Promise; + /** + * @param linkId The fully qualified ID of the resource link. Use the format, + * /subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/{provider-namespace}/{resource-type}/{resource-name}/Microsoft.Resources/links/{link-name}. + * For example, + * /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup/Microsoft.Web/sites/mySite/Microsoft.Resources/links/myLink + * @param parameters Parameters for creating or updating a resource link. + * @param callback The callback + */ + createOrUpdate(linkId: string, parameters: Models.ResourceLink, callback: msRest.ServiceCallback): void; + /** + * @param linkId The fully qualified ID of the resource link. Use the format, + * /subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/{provider-namespace}/{resource-type}/{resource-name}/Microsoft.Resources/links/{link-name}. + * For example, + * /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup/Microsoft.Web/sites/mySite/Microsoft.Resources/links/myLink + * @param parameters Parameters for creating or updating a resource link. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(linkId: string, parameters: Models.ResourceLink, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(linkId: string, parameters: Models.ResourceLink, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + linkId, + parameters, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * Gets a resource link with the specified ID. + * @param linkId The fully qualified Id of the resource link. For example, + * /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup/Microsoft.Web/sites/mySite/Microsoft.Resources/links/myLink + * @param [options] The optional parameters + * @returns Promise + */ + get(linkId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param linkId The fully qualified Id of the resource link. For example, + * /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup/Microsoft.Web/sites/mySite/Microsoft.Resources/links/myLink + * @param callback The callback + */ + get(linkId: string, callback: msRest.ServiceCallback): void; + /** + * @param linkId The fully qualified Id of the resource link. For example, + * /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup/Microsoft.Web/sites/mySite/Microsoft.Resources/links/myLink + * @param options The optional parameters + * @param callback The callback + */ + get(linkId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(linkId: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + linkId, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Gets all the linked resources for the subscription. + * @param [options] The optional parameters + * @returns Promise + */ + listAtSubscription(options?: Models.ResourceLinksListAtSubscriptionOptionalParams): Promise; + /** + * @param callback The callback + */ + listAtSubscription(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listAtSubscription(options: Models.ResourceLinksListAtSubscriptionOptionalParams, callback: msRest.ServiceCallback): void; + listAtSubscription(options?: Models.ResourceLinksListAtSubscriptionOptionalParams, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listAtSubscriptionOperationSpec, + callback) as Promise; + } + + /** + * Gets a list of resource links at and below the specified source scope. + * @param scope The fully qualified ID of the scope for getting the resource links. For example, to + * list resource links at and under a resource group, set the scope to + * /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup. + * @param [options] The optional parameters + * @returns Promise + */ + listAtSourceScope(scope: string, options?: Models.ResourceLinksListAtSourceScopeOptionalParams): Promise; + /** + * @param scope The fully qualified ID of the scope for getting the resource links. For example, to + * list resource links at and under a resource group, set the scope to + * /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup. + * @param callback The callback + */ + listAtSourceScope(scope: string, callback: msRest.ServiceCallback): void; + /** + * @param scope The fully qualified ID of the scope for getting the resource links. For example, to + * list resource links at and under a resource group, set the scope to + * /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup. + * @param options The optional parameters + * @param callback The callback + */ + listAtSourceScope(scope: string, options: Models.ResourceLinksListAtSourceScopeOptionalParams, callback: msRest.ServiceCallback): void; + listAtSourceScope(scope: string, options?: Models.ResourceLinksListAtSourceScopeOptionalParams, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + scope, + options + }, + listAtSourceScopeOperationSpec, + callback) as Promise; + } + + /** + * Gets all the linked resources for the subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listAtSubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listAtSubscriptionNext(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 + */ + listAtSubscriptionNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listAtSubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listAtSubscriptionNextOperationSpec, + callback) as Promise; + } + + /** + * Gets a list of resource links at and below the specified source scope. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listAtSourceScopeNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listAtSourceScopeNext(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 + */ + listAtSourceScopeNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listAtSourceScopeNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listAtSourceScopeNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "{linkId}", + urlParameters: [ + Parameters.linkId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "{linkId}", + urlParameters: [ + Parameters.linkId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.ResourceLink, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ResourceLink + }, + 201: { + bodyMapper: Mappers.ResourceLink + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "{linkId}", + urlParameters: [ + Parameters.linkId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceLink + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listAtSubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Resources/links", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceLinkResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listAtSourceScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "{scope}/providers/Microsoft.Resources/links", + urlParameters: [ + Parameters.scope + ], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceLinkResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listAtSubscriptionNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceLinkResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listAtSourceScopeNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceLinkResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/@azure/arm-links/package.json b/packages/@azure/arm-links/package.json new file mode 100644 index 000000000000..d74ff650e7ed --- /dev/null +++ b/packages/@azure/arm-links/package.json @@ -0,0 +1,42 @@ +{ + "name": "@azure/arm-links", + "author": "Microsoft Corporation", + "description": "ManagementLinkClient Library with typescript type definitions for node.js and browser.", + "version": "1.0.0", + "dependencies": { + "ms-rest-azure-js": "^1.0.166", + "ms-rest-js": "^1.0.439", + "tslib": "^1.9.3" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/arm-links.js", + "module": "./esm/managementLinkClient.js", + "types": "./esm/managementLinkClient.d.ts", + "devDependencies": { + "typescript": "^3.1.1", + "rollup": "^0.66.2", + "rollup-plugin-node-resolve": "^3.4.0", + "uglify-js": "^3.4.9" + }, + "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/packages/@azure/arm-links", + "repository": { + "type": "git", + "url": "https://github.com/azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/azure/azure-sdk-for-js/issues" + }, + "scripts": { + "build": "tsc && rollup -c rollup.config.js && npm run minify", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-links.js.map'\" -o ./dist/arm-links.min.js ./dist/arm-links.js", + "prepare": "npm run build" + }, + "sideEffects": false +} diff --git a/packages/@azure/arm-links/rollup.config.js b/packages/@azure/arm-links/rollup.config.js new file mode 100644 index 000000000000..541e424ae6a8 --- /dev/null +++ b/packages/@azure/arm-links/rollup.config.js @@ -0,0 +1,31 @@ +import nodeResolve from "rollup-plugin-node-resolve"; +/** + * @type {import('rollup').RollupFileOptions} + */ +const config = { + input: './esm/managementLinkClient.js', + external: ["ms-rest-js", "ms-rest-azure-js"], + output: { + file: "./dist/arm-links.js", + format: "umd", + name: "Azure.ArmLinks", + sourcemap: true, + globals: { + "ms-rest-js": "msRest", + "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. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */` + }, + plugins: [ + nodeResolve({ module: true }) + ] +}; +export default config; diff --git a/packages/@azure/arm-links/tsconfig.json b/packages/@azure/arm-links/tsconfig.json new file mode 100644 index 000000000000..f32d1664f320 --- /dev/null +++ b/packages/@azure/arm-links/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es5", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": ["es6"], + "declaration": true, + "outDir": "./esm", + "importHelpers": true + }, + "include": ["./lib/**/*"], + "exclude": ["node_modules"] +} diff --git a/packages/@azure/arm-locks/.npmignore b/packages/@azure/arm-locks/.npmignore new file mode 100644 index 000000000000..a07a455ac10c --- /dev/null +++ b/packages/@azure/arm-locks/.npmignore @@ -0,0 +1,35 @@ +#git +.git +.gitignore +#gulp +gulpfile.js +#documentation +doc/ +docs/ +#dependencies +node_modules/ +#samples +sample/ +samples/ +#tests +test/ +tests/ +coverage/ +#tools and scripts +tools/ +scripts/ +#IDE settings +*.sln +.vscode/ +.idea +.editorconfig +.ntvs_analysis.* +#build tools +.travis.yml +.jenkins.yml +.codeclimate.yml +appveyor.yml +# Nuget packages # +.nuget/ +packages/ +packages.config diff --git a/packages/@azure/arm-locks/LICENSE.txt b/packages/@azure/arm-locks/LICENSE.txt new file mode 100644 index 000000000000..5431ba98b936 --- /dev/null +++ b/packages/@azure/arm-locks/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/@azure/arm-locks/README.md b/packages/@azure/arm-locks/README.md new file mode 100644 index 000000000000..7c900f40f340 --- /dev/null +++ b/packages/@azure/arm-locks/README.md @@ -0,0 +1,77 @@ +# Azure ManagementLockClient SDK for JavaScript +This package contains an isomorphic SDK for ManagementLockClient. + +## Currently supported environments +- Node.js version 6.x.x or higher +- Browser JavaScript + +## How to Install +``` +npm install @azure/arm-locks +``` + + +## How to use + +### nodejs - Authentication, client creation and list authorizationOperations as an example written in TypeScript. + +```ts +import * as msRest from "ms-rest-js"; +import * as msRestAzure from "ms-rest-azure-js"; +import * as msRestNodeAuth from "ms-rest-nodeauth"; +import { ManagementLockClient, ManagementLockModels, ManagementLockMappers } from "@azure/arm-locks"; +const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; + +msRestNodeAuth.interactiveLogin().then((creds) => { + const client = new ManagementLockClient(creds, subscriptionId); + client.authorizationOperations.list().then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.error(err); +}); +``` + +### browser - Authentication, client creation and list authorizationOperations as an example written in JavaScript. +See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. + +- index.html +```html + + + + @azure/arm-locks sample + + + + + + + + + +``` + +# Related projects + - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) diff --git a/packages/@azure/arm-locks/lib/managementLockClient.ts b/packages/@azure/arm-locks/lib/managementLockClient.ts new file mode 100644 index 000000000000..8b59d85a51c6 --- /dev/null +++ b/packages/@azure/arm-locks/lib/managementLockClient.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; +import * as Models from "./models"; +import * as Mappers from "./models/mappers"; +import * as operations from "./operations"; +import { ManagementLockClientContext } from "./managementLockClientContext"; + + +class ManagementLockClient extends ManagementLockClientContext { + // Operation groups + authorizationOperations: operations.AuthorizationOperations; + managementLocks: operations.ManagementLocks; + + /** + * Initializes a new instance of the ManagementLockClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId The ID of the target subscription. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.ManagementLockClientOptions) { + super(credentials, subscriptionId, options); + this.authorizationOperations = new operations.AuthorizationOperations(this); + this.managementLocks = new operations.ManagementLocks(this); + } +} + +// Operation Specifications + +export { + ManagementLockClient, + ManagementLockClientContext, + Models as ManagementLockModels, + Mappers as ManagementLockMappers +}; +export * from "./operations"; diff --git a/packages/@azure/arm-locks/lib/managementLockClientContext.ts b/packages/@azure/arm-locks/lib/managementLockClientContext.ts new file mode 100644 index 000000000000..ffad4f345abb --- /dev/null +++ b/packages/@azure/arm-locks/lib/managementLockClientContext.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as Models from "./models"; +import * as msRest from "ms-rest-js"; +import * as msRestAzure from "ms-rest-azure-js"; + +const packageName = "@azure/arm-locks"; +const packageVersion = "1.0.0"; + +export class ManagementLockClientContext extends msRestAzure.AzureServiceClient { + + credentials: msRest.ServiceClientCredentials; + + subscriptionId: string; + + apiVersion: string; + + acceptLanguage: string; + + longRunningOperationRetryTimeout: number; + + /** + * Initializes a new instance of the ManagementLockClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId The ID of the target subscription. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.ManagementLockClientOptions) { + if (credentials == undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId == undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) { + options = {}; + } + super(credentials, options); + + this.apiVersion = '2016-09-01'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; + this.requestContentType = "application/json; charset=utf-8"; + this.credentials = credentials; + this.subscriptionId = subscriptionId; + + this.addUserAgentInfo(`${packageName}/${packageVersion}`); + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + } +} diff --git a/packages/@azure/arm-locks/lib/models/authorizationOperationsMappers.ts b/packages/@azure/arm-locks/lib/models/authorizationOperationsMappers.ts new file mode 100644 index 000000000000..2edcc577920e --- /dev/null +++ b/packages/@azure/arm-locks/lib/models/authorizationOperationsMappers.ts @@ -0,0 +1,17 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + OperationListResult, + Operation, + OperationDisplay, + CloudError +} from "../models/mappers"; + diff --git a/packages/@azure/arm-locks/lib/models/index.ts b/packages/@azure/arm-locks/lib/models/index.ts new file mode 100644 index 000000000000..017c2d2d38c1 --- /dev/null +++ b/packages/@azure/arm-locks/lib/models/index.ts @@ -0,0 +1,520 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import { BaseResource, CloudError, AzureServiceClientOptions } from "ms-rest-azure-js"; +import * as msRest from "ms-rest-js"; + +export { BaseResource, CloudError }; + + +/** + * @interface + * An interface representing ManagementLockOwner. + * Lock owner properties. + * + */ +export interface ManagementLockOwner { + /** + * @member {string} [applicationId] The application ID of the lock owner. + */ + applicationId?: string; +} + +/** + * @interface + * An interface representing ManagementLockObject. + * The lock information. + * + * @extends BaseResource + */ +export interface ManagementLockObject extends BaseResource { + /** + * @member {LockLevel} level The level of the lock. Possible values are: + * NotSpecified, CanNotDelete, ReadOnly. CanNotDelete means authorized users + * are able to read and modify the resources, but not delete. ReadOnly means + * authorized users can only read from a resource, but they can't modify or + * delete it. Possible values include: 'NotSpecified', 'CanNotDelete', + * 'ReadOnly' + */ + level: LockLevel; + /** + * @member {string} [notes] Notes about the lock. Maximum of 512 characters. + */ + notes?: string; + /** + * @member {ManagementLockOwner[]} [owners] The owners of the lock. + */ + owners?: ManagementLockOwner[]; + /** + * @member {string} [id] The resource ID of the lock. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [type] The resource type of the lock - + * Microsoft.Authorization/locks. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {string} [name] The name of the lock. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; +} + +/** + * @interface + * An interface representing OperationDisplay. + * The object that represents the operation. + * + */ +export interface OperationDisplay { + /** + * @member {string} [provider] Service provider: Microsoft.Authorization + */ + provider?: string; + /** + * @member {string} [resource] Resource on which the operation is performed: + * Profile, endpoint, etc. + */ + resource?: string; + /** + * @member {string} [operation] Operation type: Read, write, delete, etc. + */ + operation?: string; +} + +/** + * @interface + * An interface representing Operation. + * Microsoft.Authorization operation + * + */ +export interface Operation { + /** + * @member {string} [name] Operation name: {provider}/{resource}/{operation} + */ + name?: string; + /** + * @member {OperationDisplay} [display] The object that represents the + * operation. + */ + display?: OperationDisplay; +} + +/** + * @interface + * An interface representing ManagementLocksListAtResourceGroupLevelOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface ManagementLocksListAtResourceGroupLevelOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [filter] The filter to apply on the operation. + */ + filter?: string; +} + +/** + * @interface + * An interface representing ManagementLocksListAtResourceLevelOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface ManagementLocksListAtResourceLevelOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [filter] The filter to apply on the operation. + */ + filter?: string; +} + +/** + * @interface + * An interface representing ManagementLocksListAtSubscriptionLevelOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface ManagementLocksListAtSubscriptionLevelOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [filter] The filter to apply on the operation. + */ + filter?: string; +} + +/** + * @interface + * An interface representing ManagementLockClientOptions. + * @extends AzureServiceClientOptions + */ +export interface ManagementLockClientOptions extends AzureServiceClientOptions { + /** + * @member {string} [baseUri] + */ + baseUri?: string; +} + + +/** + * @interface + * An interface representing the OperationListResult. + * Result of the request to list Microsoft.Authorization operations. It + * contains a list of operations and a URL link to get the next set of results. + * + * @extends Array + */ +export interface OperationListResult extends Array { + /** + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ + nextLink?: string; +} + +/** + * @interface + * An interface representing the ManagementLockListResult. + * The list of locks. + * + * @extends Array + */ +export interface ManagementLockListResult extends Array { + /** + * @member {string} [nextLink] The URL to use for getting the next set of + * results. + */ + nextLink?: string; +} + +/** + * Defines values for LockLevel. + * Possible values include: 'NotSpecified', 'CanNotDelete', 'ReadOnly' + * There could be more values for this enum apart from the ones defined here.If + * you want to set a value that is not from the known values then you can do + * the following: + * let param: LockLevel = "someUnknownValueThatWillStillBeValid"; + * @readonly + * @enum {string} + */ +export enum LockLevel { + NotSpecified = 'NotSpecified', + CanNotDelete = 'CanNotDelete', + ReadOnly = 'ReadOnly', +} + +/** + * Contains response data for the list operation. + */ +export type AuthorizationOperationsListResponse = OperationListResult & { + /** + * 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: OperationListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type AuthorizationOperationsListNextResponse = OperationListResult & { + /** + * 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: OperationListResult; + }; +}; + +/** + * Contains response data for the createOrUpdateAtResourceGroupLevel operation. + */ +export type ManagementLocksCreateOrUpdateAtResourceGroupLevelResponse = ManagementLockObject & { + /** + * 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: ManagementLockObject; + }; +}; + +/** + * Contains response data for the getAtResourceGroupLevel operation. + */ +export type ManagementLocksGetAtResourceGroupLevelResponse = ManagementLockObject & { + /** + * 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: ManagementLockObject; + }; +}; + +/** + * Contains response data for the createOrUpdateByScope operation. + */ +export type ManagementLocksCreateOrUpdateByScopeResponse = ManagementLockObject & { + /** + * 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: ManagementLockObject; + }; +}; + +/** + * Contains response data for the getByScope operation. + */ +export type ManagementLocksGetByScopeResponse = ManagementLockObject & { + /** + * 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: ManagementLockObject; + }; +}; + +/** + * Contains response data for the createOrUpdateAtResourceLevel operation. + */ +export type ManagementLocksCreateOrUpdateAtResourceLevelResponse = ManagementLockObject & { + /** + * 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: ManagementLockObject; + }; +}; + +/** + * Contains response data for the getAtResourceLevel operation. + */ +export type ManagementLocksGetAtResourceLevelResponse = ManagementLockObject & { + /** + * 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: ManagementLockObject; + }; +}; + +/** + * Contains response data for the createOrUpdateAtSubscriptionLevel operation. + */ +export type ManagementLocksCreateOrUpdateAtSubscriptionLevelResponse = ManagementLockObject & { + /** + * 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: ManagementLockObject; + }; +}; + +/** + * Contains response data for the getAtSubscriptionLevel operation. + */ +export type ManagementLocksGetAtSubscriptionLevelResponse = ManagementLockObject & { + /** + * 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: ManagementLockObject; + }; +}; + +/** + * Contains response data for the listAtResourceGroupLevel operation. + */ +export type ManagementLocksListAtResourceGroupLevelResponse = ManagementLockListResult & { + /** + * 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: ManagementLockListResult; + }; +}; + +/** + * Contains response data for the listAtResourceLevel operation. + */ +export type ManagementLocksListAtResourceLevelResponse = ManagementLockListResult & { + /** + * 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: ManagementLockListResult; + }; +}; + +/** + * Contains response data for the listAtSubscriptionLevel operation. + */ +export type ManagementLocksListAtSubscriptionLevelResponse = ManagementLockListResult & { + /** + * 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: ManagementLockListResult; + }; +}; + +/** + * Contains response data for the listAtResourceGroupLevelNext operation. + */ +export type ManagementLocksListAtResourceGroupLevelNextResponse = ManagementLockListResult & { + /** + * 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: ManagementLockListResult; + }; +}; + +/** + * Contains response data for the listAtResourceLevelNext operation. + */ +export type ManagementLocksListAtResourceLevelNextResponse = ManagementLockListResult & { + /** + * 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: ManagementLockListResult; + }; +}; + +/** + * Contains response data for the listAtSubscriptionLevelNext operation. + */ +export type ManagementLocksListAtSubscriptionLevelNextResponse = ManagementLockListResult & { + /** + * 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: ManagementLockListResult; + }; +}; diff --git a/packages/@azure/arm-locks/lib/models/managementLocksMappers.ts b/packages/@azure/arm-locks/lib/models/managementLocksMappers.ts new file mode 100644 index 000000000000..0eca319827a3 --- /dev/null +++ b/packages/@azure/arm-locks/lib/models/managementLocksMappers.ts @@ -0,0 +1,18 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + ManagementLockObject, + BaseResource, + ManagementLockOwner, + CloudError, + ManagementLockListResult +} from "../models/mappers"; + diff --git a/packages/@azure/arm-locks/lib/models/mappers.ts b/packages/@azure/arm-locks/lib/models/mappers.ts new file mode 100644 index 000000000000..de34243190f2 --- /dev/null +++ b/packages/@azure/arm-locks/lib/models/mappers.ts @@ -0,0 +1,194 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import { CloudErrorMapper, BaseResourceMapper } from "ms-rest-azure-js"; +import * as msRest from "ms-rest-js"; + +export const CloudError = CloudErrorMapper; +export const BaseResource = BaseResourceMapper; + +export const ManagementLockOwner: msRest.CompositeMapper = { + serializedName: "ManagementLockOwner", + type: { + name: "Composite", + className: "ManagementLockOwner", + modelProperties: { + applicationId: { + serializedName: "applicationId", + type: { + name: "String" + } + } + } + } +}; + +export const ManagementLockObject: msRest.CompositeMapper = { + serializedName: "ManagementLockObject", + type: { + name: "Composite", + className: "ManagementLockObject", + modelProperties: { + level: { + required: true, + serializedName: "properties.level", + type: { + name: "String" + } + }, + notes: { + serializedName: "properties.notes", + type: { + name: "String" + } + }, + owners: { + serializedName: "properties.owners", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ManagementLockOwner" + } + } + } + }, + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const OperationDisplay: msRest.CompositeMapper = { + serializedName: "Operation_display", + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + } + } + } +}; + +export const Operation: msRest.CompositeMapper = { + serializedName: "Operation", + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + } + } + } +}; + +export const OperationListResult: msRest.CompositeMapper = { + serializedName: "OperationListResult", + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ManagementLockListResult: msRest.CompositeMapper = { + serializedName: "ManagementLockListResult", + type: { + name: "Composite", + className: "ManagementLockListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ManagementLockObject" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/packages/@azure/arm-locks/lib/models/parameters.ts b/packages/@azure/arm-locks/lib/models/parameters.ts new file mode 100644 index 000000000000..9ae25e1fa997 --- /dev/null +++ b/packages/@azure/arm-locks/lib/models/parameters.ts @@ -0,0 +1,142 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; + +export const acceptLanguage: msRest.OperationParameter = { + parameterPath: "acceptLanguage", + mapper: { + serializedName: "accept-language", + defaultValue: 'en-US', + type: { + name: "String" + } + } +}; +export const apiVersion: msRest.OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + required: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; +export const filter: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "filter" + ], + mapper: { + serializedName: "$filter", + type: { + name: "String" + } + } +}; +export const lockName: msRest.OperationURLParameter = { + parameterPath: "lockName", + mapper: { + required: true, + serializedName: "lockName", + type: { + name: "String" + } + } +}; +export const nextPageLink: msRest.OperationURLParameter = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const parentResourcePath: msRest.OperationURLParameter = { + parameterPath: "parentResourcePath", + mapper: { + required: true, + serializedName: "parentResourcePath", + 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" + } + } +}; +export const resourceName: msRest.OperationURLParameter = { + parameterPath: "resourceName", + mapper: { + required: true, + serializedName: "resourceName", + type: { + name: "String" + } + } +}; +export const resourceProviderNamespace: msRest.OperationURLParameter = { + parameterPath: "resourceProviderNamespace", + mapper: { + required: true, + serializedName: "resourceProviderNamespace", + type: { + name: "String" + } + } +}; +export const resourceType: msRest.OperationURLParameter = { + parameterPath: "resourceType", + mapper: { + required: true, + serializedName: "resourceType", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const scope: msRest.OperationURLParameter = { + parameterPath: "scope", + mapper: { + required: true, + serializedName: "scope", + type: { + name: "String" + } + } +}; +export const subscriptionId: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + type: { + name: "String" + } + } +}; diff --git a/packages/@azure/arm-locks/lib/operations/authorizationOperations.ts b/packages/@azure/arm-locks/lib/operations/authorizationOperations.ts new file mode 100644 index 000000000000..c4fc505fc4fc --- /dev/null +++ b/packages/@azure/arm-locks/lib/operations/authorizationOperations.ts @@ -0,0 +1,123 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/authorizationOperationsMappers"; +import * as Parameters from "../models/parameters"; +import { ManagementLockClientContext } from "../managementLockClientContext"; + +/** Class representing a AuthorizationOperations. */ +export class AuthorizationOperations { + private readonly client: ManagementLockClientContext; + + /** + * Create a AuthorizationOperations. + * @param {ManagementLockClientContext} client Reference to the service client. + */ + constructor(client: ManagementLockClientContext) { + this.client = client; + } + + /** + * Lists all of the available Microsoft.Authorization REST API operations. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the available Microsoft.Authorization REST API operations. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(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 + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Authorization/operations", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/@azure/arm-locks/lib/operations/index.ts b/packages/@azure/arm-locks/lib/operations/index.ts new file mode 100644 index 000000000000..83933898775f --- /dev/null +++ b/packages/@azure/arm-locks/lib/operations/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export * from "./authorizationOperations"; +export * from "./managementLocks"; diff --git a/packages/@azure/arm-locks/lib/operations/managementLocks.ts b/packages/@azure/arm-locks/lib/operations/managementLocks.ts new file mode 100644 index 000000000000..f2839cb517a9 --- /dev/null +++ b/packages/@azure/arm-locks/lib/operations/managementLocks.ts @@ -0,0 +1,1181 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/managementLocksMappers"; +import * as Parameters from "../models/parameters"; +import { ManagementLockClientContext } from "../managementLockClientContext"; + +/** Class representing a ManagementLocks. */ +export class ManagementLocks { + private readonly client: ManagementLockClientContext; + + /** + * Create a ManagementLocks. + * @param {ManagementLockClientContext} client Reference to the service client. + */ + constructor(client: ManagementLockClientContext) { + this.client = client; + } + + /** + * When you apply a lock at a parent scope, all child resources inherit the same lock. To create + * management locks, you must have access to Microsoft.Authorization/* or + * Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access + * Administrator are granted those actions. + * @summary Creates or updates a management lock at the resource group level. + * @param resourceGroupName The name of the resource group to lock. + * @param lockName The lock name. The lock name can be a maximum of 260 characters. It cannot + * contain <, > %, &, :, \, ?, /, or any control characters. + * @param parameters The management lock parameters. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateAtResourceGroupLevel(resourceGroupName: string, lockName: string, parameters: Models.ManagementLockObject, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group to lock. + * @param lockName The lock name. The lock name can be a maximum of 260 characters. It cannot + * contain <, > %, &, :, \, ?, /, or any control characters. + * @param parameters The management lock parameters. + * @param callback The callback + */ + createOrUpdateAtResourceGroupLevel(resourceGroupName: string, lockName: string, parameters: Models.ManagementLockObject, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group to lock. + * @param lockName The lock name. The lock name can be a maximum of 260 characters. It cannot + * contain <, > %, &, :, \, ?, /, or any control characters. + * @param parameters The management lock parameters. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdateAtResourceGroupLevel(resourceGroupName: string, lockName: string, parameters: Models.ManagementLockObject, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateAtResourceGroupLevel(resourceGroupName: string, lockName: string, parameters: Models.ManagementLockObject, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + lockName, + parameters, + options + }, + createOrUpdateAtResourceGroupLevelOperationSpec, + callback) as Promise; + } + + /** + * To delete management locks, you must have access to Microsoft.Authorization/* or + * Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access + * Administrator are granted those actions. + * @summary Deletes a management lock at the resource group level. + * @param resourceGroupName The name of the resource group containing the lock. + * @param lockName The name of lock to delete. + * @param [options] The optional parameters + * @returns Promise + */ + deleteAtResourceGroupLevel(resourceGroupName: string, lockName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group containing the lock. + * @param lockName The name of lock to delete. + * @param callback The callback + */ + deleteAtResourceGroupLevel(resourceGroupName: string, lockName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group containing the lock. + * @param lockName The name of lock to delete. + * @param options The optional parameters + * @param callback The callback + */ + deleteAtResourceGroupLevel(resourceGroupName: string, lockName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteAtResourceGroupLevel(resourceGroupName: string, lockName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + lockName, + options + }, + deleteAtResourceGroupLevelOperationSpec, + callback); + } + + /** + * Gets a management lock at the resource group level. + * @param resourceGroupName The name of the locked resource group. + * @param lockName The name of the lock to get. + * @param [options] The optional parameters + * @returns Promise + */ + getAtResourceGroupLevel(resourceGroupName: string, lockName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the locked resource group. + * @param lockName The name of the lock to get. + * @param callback The callback + */ + getAtResourceGroupLevel(resourceGroupName: string, lockName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the locked resource group. + * @param lockName The name of the lock to get. + * @param options The optional parameters + * @param callback The callback + */ + getAtResourceGroupLevel(resourceGroupName: string, lockName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getAtResourceGroupLevel(resourceGroupName: string, lockName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + lockName, + options + }, + getAtResourceGroupLevelOperationSpec, + callback) as Promise; + } + + /** + * Create or update a management lock by scope. + * @param scope The scope for the lock. When providing a scope for the assignment, use + * '/subscriptions/{subscriptionId}' for subscriptions, + * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and + * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' + * for resources. + * @param lockName The name of lock. + * @param parameters Create or update management lock parameters. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateByScope(scope: string, lockName: string, parameters: Models.ManagementLockObject, options?: msRest.RequestOptionsBase): Promise; + /** + * @param scope The scope for the lock. When providing a scope for the assignment, use + * '/subscriptions/{subscriptionId}' for subscriptions, + * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and + * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' + * for resources. + * @param lockName The name of lock. + * @param parameters Create or update management lock parameters. + * @param callback The callback + */ + createOrUpdateByScope(scope: string, lockName: string, parameters: Models.ManagementLockObject, callback: msRest.ServiceCallback): void; + /** + * @param scope The scope for the lock. When providing a scope for the assignment, use + * '/subscriptions/{subscriptionId}' for subscriptions, + * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and + * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' + * for resources. + * @param lockName The name of lock. + * @param parameters Create or update management lock parameters. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdateByScope(scope: string, lockName: string, parameters: Models.ManagementLockObject, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateByScope(scope: string, lockName: string, parameters: Models.ManagementLockObject, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + scope, + lockName, + parameters, + options + }, + createOrUpdateByScopeOperationSpec, + callback) as Promise; + } + + /** + * Delete a management lock by scope. + * @param scope The scope for the lock. + * @param lockName The name of lock. + * @param [options] The optional parameters + * @returns Promise + */ + deleteByScope(scope: string, lockName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param scope The scope for the lock. + * @param lockName The name of lock. + * @param callback The callback + */ + deleteByScope(scope: string, lockName: string, callback: msRest.ServiceCallback): void; + /** + * @param scope The scope for the lock. + * @param lockName The name of lock. + * @param options The optional parameters + * @param callback The callback + */ + deleteByScope(scope: string, lockName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteByScope(scope: string, lockName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + scope, + lockName, + options + }, + deleteByScopeOperationSpec, + callback); + } + + /** + * Get a management lock by scope. + * @param scope The scope for the lock. + * @param lockName The name of lock. + * @param [options] The optional parameters + * @returns Promise + */ + getByScope(scope: string, lockName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param scope The scope for the lock. + * @param lockName The name of lock. + * @param callback The callback + */ + getByScope(scope: string, lockName: string, callback: msRest.ServiceCallback): void; + /** + * @param scope The scope for the lock. + * @param lockName The name of lock. + * @param options The optional parameters + * @param callback The callback + */ + getByScope(scope: string, lockName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getByScope(scope: string, lockName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + scope, + lockName, + options + }, + getByScopeOperationSpec, + callback) as Promise; + } + + /** + * When you apply a lock at a parent scope, all child resources inherit the same lock. To create + * management locks, you must have access to Microsoft.Authorization/* or + * Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access + * Administrator are granted those actions. + * @summary Creates or updates a management lock at the resource level or any level below the + * resource. + * @param resourceGroupName The name of the resource group containing the resource to lock. + * @param resourceProviderNamespace The resource provider namespace of the resource to lock. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to lock. + * @param resourceName The name of the resource to lock. + * @param lockName The name of lock. The lock name can be a maximum of 260 characters. It cannot + * contain <, > %, &, :, \, ?, /, or any control characters. + * @param parameters Parameters for creating or updating a management lock. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, lockName: string, parameters: Models.ManagementLockObject, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group containing the resource to lock. + * @param resourceProviderNamespace The resource provider namespace of the resource to lock. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to lock. + * @param resourceName The name of the resource to lock. + * @param lockName The name of lock. The lock name can be a maximum of 260 characters. It cannot + * contain <, > %, &, :, \, ?, /, or any control characters. + * @param parameters Parameters for creating or updating a management lock. + * @param callback The callback + */ + createOrUpdateAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, lockName: string, parameters: Models.ManagementLockObject, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group containing the resource to lock. + * @param resourceProviderNamespace The resource provider namespace of the resource to lock. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to lock. + * @param resourceName The name of the resource to lock. + * @param lockName The name of lock. The lock name can be a maximum of 260 characters. It cannot + * contain <, > %, &, :, \, ?, /, or any control characters. + * @param parameters Parameters for creating or updating a management lock. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdateAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, lockName: string, parameters: Models.ManagementLockObject, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, lockName: string, parameters: Models.ManagementLockObject, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + lockName, + parameters, + options + }, + createOrUpdateAtResourceLevelOperationSpec, + callback) as Promise; + } + + /** + * To delete management locks, you must have access to Microsoft.Authorization/* or + * Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access + * Administrator are granted those actions. + * @summary Deletes the management lock of a resource or any level below the resource. + * @param resourceGroupName The name of the resource group containing the resource with the lock to + * delete. + * @param resourceProviderNamespace The resource provider namespace of the resource with the lock + * to delete. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource with the lock to delete. + * @param resourceName The name of the resource with the lock to delete. + * @param lockName The name of the lock to delete. + * @param [options] The optional parameters + * @returns Promise + */ + deleteAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, lockName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group containing the resource with the lock to + * delete. + * @param resourceProviderNamespace The resource provider namespace of the resource with the lock + * to delete. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource with the lock to delete. + * @param resourceName The name of the resource with the lock to delete. + * @param lockName The name of the lock to delete. + * @param callback The callback + */ + deleteAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, lockName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group containing the resource with the lock to + * delete. + * @param resourceProviderNamespace The resource provider namespace of the resource with the lock + * to delete. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource with the lock to delete. + * @param resourceName The name of the resource with the lock to delete. + * @param lockName The name of the lock to delete. + * @param options The optional parameters + * @param callback The callback + */ + deleteAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, lockName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, lockName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + lockName, + options + }, + deleteAtResourceLevelOperationSpec, + callback); + } + + /** + * Get the management lock of a resource or any level below resource. + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath An extra path parameter needed in some services, like SQL Databases. + * @param resourceType The type of the resource. + * @param resourceName The name of the resource. + * @param lockName The name of lock. + * @param [options] The optional parameters + * @returns Promise + */ + getAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, lockName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath An extra path parameter needed in some services, like SQL Databases. + * @param resourceType The type of the resource. + * @param resourceName The name of the resource. + * @param lockName The name of lock. + * @param callback The callback + */ + getAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, lockName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath An extra path parameter needed in some services, like SQL Databases. + * @param resourceType The type of the resource. + * @param resourceName The name of the resource. + * @param lockName The name of lock. + * @param options The optional parameters + * @param callback The callback + */ + getAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, lockName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, lockName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + lockName, + options + }, + getAtResourceLevelOperationSpec, + callback) as Promise; + } + + /** + * When you apply a lock at a parent scope, all child resources inherit the same lock. To create + * management locks, you must have access to Microsoft.Authorization/* or + * Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access + * Administrator are granted those actions. + * @summary Creates or updates a management lock at the subscription level. + * @param lockName The name of lock. The lock name can be a maximum of 260 characters. It cannot + * contain <, > %, &, :, \, ?, /, or any control characters. + * @param parameters The management lock parameters. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateAtSubscriptionLevel(lockName: string, parameters: Models.ManagementLockObject, options?: msRest.RequestOptionsBase): Promise; + /** + * @param lockName The name of lock. The lock name can be a maximum of 260 characters. It cannot + * contain <, > %, &, :, \, ?, /, or any control characters. + * @param parameters The management lock parameters. + * @param callback The callback + */ + createOrUpdateAtSubscriptionLevel(lockName: string, parameters: Models.ManagementLockObject, callback: msRest.ServiceCallback): void; + /** + * @param lockName The name of lock. The lock name can be a maximum of 260 characters. It cannot + * contain <, > %, &, :, \, ?, /, or any control characters. + * @param parameters The management lock parameters. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdateAtSubscriptionLevel(lockName: string, parameters: Models.ManagementLockObject, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateAtSubscriptionLevel(lockName: string, parameters: Models.ManagementLockObject, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + lockName, + parameters, + options + }, + createOrUpdateAtSubscriptionLevelOperationSpec, + callback) as Promise; + } + + /** + * To delete management locks, you must have access to Microsoft.Authorization/* or + * Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access + * Administrator are granted those actions. + * @summary Deletes the management lock at the subscription level. + * @param lockName The name of lock to delete. + * @param [options] The optional parameters + * @returns Promise + */ + deleteAtSubscriptionLevel(lockName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param lockName The name of lock to delete. + * @param callback The callback + */ + deleteAtSubscriptionLevel(lockName: string, callback: msRest.ServiceCallback): void; + /** + * @param lockName The name of lock to delete. + * @param options The optional parameters + * @param callback The callback + */ + deleteAtSubscriptionLevel(lockName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteAtSubscriptionLevel(lockName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + lockName, + options + }, + deleteAtSubscriptionLevelOperationSpec, + callback); + } + + /** + * Gets a management lock at the subscription level. + * @param lockName The name of the lock to get. + * @param [options] The optional parameters + * @returns Promise + */ + getAtSubscriptionLevel(lockName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param lockName The name of the lock to get. + * @param callback The callback + */ + getAtSubscriptionLevel(lockName: string, callback: msRest.ServiceCallback): void; + /** + * @param lockName The name of the lock to get. + * @param options The optional parameters + * @param callback The callback + */ + getAtSubscriptionLevel(lockName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getAtSubscriptionLevel(lockName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + lockName, + options + }, + getAtSubscriptionLevelOperationSpec, + callback) as Promise; + } + + /** + * Gets all the management locks for a resource group. + * @param resourceGroupName The name of the resource group containing the locks to get. + * @param [options] The optional parameters + * @returns Promise + */ + listAtResourceGroupLevel(resourceGroupName: string, options?: Models.ManagementLocksListAtResourceGroupLevelOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group containing the locks to get. + * @param callback The callback + */ + listAtResourceGroupLevel(resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group containing the locks to get. + * @param options The optional parameters + * @param callback The callback + */ + listAtResourceGroupLevel(resourceGroupName: string, options: Models.ManagementLocksListAtResourceGroupLevelOptionalParams, callback: msRest.ServiceCallback): void; + listAtResourceGroupLevel(resourceGroupName: string, options?: Models.ManagementLocksListAtResourceGroupLevelOptionalParams, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + options + }, + listAtResourceGroupLevelOperationSpec, + callback) as Promise; + } + + /** + * Gets all the management locks for a resource or any level below resource. + * @param resourceGroupName The name of the resource group containing the locked resource. The name + * is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the locked resource. + * @param resourceName The name of the locked resource. + * @param [options] The optional parameters + * @returns Promise + */ + listAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: Models.ManagementLocksListAtResourceLevelOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group containing the locked resource. The name + * is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the locked resource. + * @param resourceName The name of the locked resource. + * @param callback The callback + */ + listAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group containing the locked resource. The name + * is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the locked resource. + * @param resourceName The name of the locked resource. + * @param options The optional parameters + * @param callback The callback + */ + listAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options: Models.ManagementLocksListAtResourceLevelOptionalParams, callback: msRest.ServiceCallback): void; + listAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: Models.ManagementLocksListAtResourceLevelOptionalParams, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + options + }, + listAtResourceLevelOperationSpec, + callback) as Promise; + } + + /** + * Gets all the management locks for a subscription. + * @param [options] The optional parameters + * @returns Promise + */ + listAtSubscriptionLevel(options?: Models.ManagementLocksListAtSubscriptionLevelOptionalParams): Promise; + /** + * @param callback The callback + */ + listAtSubscriptionLevel(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listAtSubscriptionLevel(options: Models.ManagementLocksListAtSubscriptionLevelOptionalParams, callback: msRest.ServiceCallback): void; + listAtSubscriptionLevel(options?: Models.ManagementLocksListAtSubscriptionLevelOptionalParams, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listAtSubscriptionLevelOperationSpec, + callback) as Promise; + } + + /** + * Gets all the management locks for a resource group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listAtResourceGroupLevelNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listAtResourceGroupLevelNext(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 + */ + listAtResourceGroupLevelNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listAtResourceGroupLevelNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listAtResourceGroupLevelNextOperationSpec, + callback) as Promise; + } + + /** + * Gets all the management locks for a resource or any level below resource. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listAtResourceLevelNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listAtResourceLevelNext(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 + */ + listAtResourceLevelNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listAtResourceLevelNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listAtResourceLevelNextOperationSpec, + callback) as Promise; + } + + /** + * Gets all the management locks for a subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listAtSubscriptionLevelNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listAtSubscriptionLevelNext(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 + */ + listAtSubscriptionLevelNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listAtSubscriptionLevelNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listAtSubscriptionLevelNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const createOrUpdateAtResourceGroupLevelOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.lockName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.ManagementLockObject, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ManagementLockObject + }, + 201: { + bodyMapper: Mappers.ManagementLockObject + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteAtResourceGroupLevelOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.lockName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getAtResourceGroupLevelOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.lockName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ManagementLockObject + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const createOrUpdateByScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "{scope}/providers/Microsoft.Authorization/locks/{lockName}", + urlParameters: [ + Parameters.scope, + Parameters.lockName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.ManagementLockObject, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ManagementLockObject + }, + 201: { + bodyMapper: Mappers.ManagementLockObject + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteByScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "{scope}/providers/Microsoft.Authorization/locks/{lockName}", + urlParameters: [ + Parameters.scope, + Parameters.lockName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getByScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "{scope}/providers/Microsoft.Authorization/locks/{lockName}", + urlParameters: [ + Parameters.scope, + Parameters.lockName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ManagementLockObject + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const createOrUpdateAtResourceLevelOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.resourceProviderNamespace, + Parameters.parentResourcePath, + Parameters.resourceType, + Parameters.resourceName, + Parameters.lockName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.ManagementLockObject, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ManagementLockObject + }, + 201: { + bodyMapper: Mappers.ManagementLockObject + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteAtResourceLevelOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.resourceProviderNamespace, + Parameters.parentResourcePath, + Parameters.resourceType, + Parameters.resourceName, + Parameters.lockName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getAtResourceLevelOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.resourceProviderNamespace, + Parameters.parentResourcePath, + Parameters.resourceType, + Parameters.resourceName, + Parameters.lockName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ManagementLockObject + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const createOrUpdateAtSubscriptionLevelOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}", + urlParameters: [ + Parameters.lockName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.ManagementLockObject, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ManagementLockObject + }, + 201: { + bodyMapper: Mappers.ManagementLockObject + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteAtSubscriptionLevelOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}", + urlParameters: [ + Parameters.lockName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getAtSubscriptionLevelOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}", + urlParameters: [ + Parameters.lockName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ManagementLockObject + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listAtResourceGroupLevelOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ManagementLockListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listAtResourceLevelOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.resourceProviderNamespace, + Parameters.parentResourcePath, + Parameters.resourceType, + Parameters.resourceName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ManagementLockListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listAtSubscriptionLevelOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ManagementLockListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listAtResourceGroupLevelNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ManagementLockListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listAtResourceLevelNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ManagementLockListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listAtSubscriptionLevelNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ManagementLockListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/@azure/arm-locks/package.json b/packages/@azure/arm-locks/package.json new file mode 100644 index 000000000000..7997ac59263a --- /dev/null +++ b/packages/@azure/arm-locks/package.json @@ -0,0 +1,42 @@ +{ + "name": "@azure/arm-locks", + "author": "Microsoft Corporation", + "description": "ManagementLockClient Library with typescript type definitions for node.js and browser.", + "version": "1.0.0", + "dependencies": { + "ms-rest-azure-js": "^1.0.166", + "ms-rest-js": "^1.0.439", + "tslib": "^1.9.3" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/arm-locks.js", + "module": "./esm/managementLockClient.js", + "types": "./esm/managementLockClient.d.ts", + "devDependencies": { + "typescript": "^3.1.1", + "rollup": "^0.66.2", + "rollup-plugin-node-resolve": "^3.4.0", + "uglify-js": "^3.4.9" + }, + "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/packages/@azure/arm-locks", + "repository": { + "type": "git", + "url": "https://github.com/azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/azure/azure-sdk-for-js/issues" + }, + "scripts": { + "build": "tsc && rollup -c rollup.config.js && npm run minify", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-locks.js.map'\" -o ./dist/arm-locks.min.js ./dist/arm-locks.js", + "prepare": "npm run build" + }, + "sideEffects": false +} diff --git a/packages/@azure/arm-locks/rollup.config.js b/packages/@azure/arm-locks/rollup.config.js new file mode 100644 index 000000000000..4d6a1316d83e --- /dev/null +++ b/packages/@azure/arm-locks/rollup.config.js @@ -0,0 +1,31 @@ +import nodeResolve from "rollup-plugin-node-resolve"; +/** + * @type {import('rollup').RollupFileOptions} + */ +const config = { + input: './esm/managementLockClient.js', + external: ["ms-rest-js", "ms-rest-azure-js"], + output: { + file: "./dist/arm-locks.js", + format: "umd", + name: "Azure.ArmLocks", + sourcemap: true, + globals: { + "ms-rest-js": "msRest", + "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. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */` + }, + plugins: [ + nodeResolve({ module: true }) + ] +}; +export default config; diff --git a/packages/@azure/arm-locks/tsconfig.json b/packages/@azure/arm-locks/tsconfig.json new file mode 100644 index 000000000000..f32d1664f320 --- /dev/null +++ b/packages/@azure/arm-locks/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es5", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": ["es6"], + "declaration": true, + "outDir": "./esm", + "importHelpers": true + }, + "include": ["./lib/**/*"], + "exclude": ["node_modules"] +} diff --git a/packages/@azure/arm-managedapplications/.npmignore b/packages/@azure/arm-managedapplications/.npmignore new file mode 100644 index 000000000000..a07a455ac10c --- /dev/null +++ b/packages/@azure/arm-managedapplications/.npmignore @@ -0,0 +1,35 @@ +#git +.git +.gitignore +#gulp +gulpfile.js +#documentation +doc/ +docs/ +#dependencies +node_modules/ +#samples +sample/ +samples/ +#tests +test/ +tests/ +coverage/ +#tools and scripts +tools/ +scripts/ +#IDE settings +*.sln +.vscode/ +.idea +.editorconfig +.ntvs_analysis.* +#build tools +.travis.yml +.jenkins.yml +.codeclimate.yml +appveyor.yml +# Nuget packages # +.nuget/ +packages/ +packages.config diff --git a/packages/@azure/arm-managedapplications/LICENSE.txt b/packages/@azure/arm-managedapplications/LICENSE.txt new file mode 100644 index 000000000000..5431ba98b936 --- /dev/null +++ b/packages/@azure/arm-managedapplications/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/@azure/arm-managedapplications/README.md b/packages/@azure/arm-managedapplications/README.md new file mode 100644 index 000000000000..2bb1093df9ed --- /dev/null +++ b/packages/@azure/arm-managedapplications/README.md @@ -0,0 +1,77 @@ +# Azure ManagedApplicationClient SDK for JavaScript +This package contains an isomorphic SDK for ManagedApplicationClient. + +## Currently supported environments +- Node.js version 6.x.x or higher +- Browser JavaScript + +## How to Install +``` +npm install @azure/arm-managedapplications +``` + + +## How to use + +### nodejs - Authentication, client creation and listOperations as an example written in TypeScript. + +```ts +import * as msRest from "ms-rest-js"; +import * as msRestAzure from "ms-rest-azure-js"; +import * as msRestNodeAuth from "ms-rest-nodeauth"; +import { ManagedApplicationClient, ManagedApplicationModels, ManagedApplicationMappers } from "@azure/arm-managedapplications"; +const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; + +msRestNodeAuth.interactiveLogin().then((creds) => { + const client = new ManagedApplicationClient(creds, subscriptionId); + client.listOperations().then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.error(err); +}); +``` + +### browser - Authentication, client creation and listOperations as an example written in JavaScript. +See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. + +- index.html +```html + + + + @azure/arm-managedapplications sample + + + + + + + + + +``` + +# Related projects + - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) diff --git a/packages/@azure/arm-managedapplications/lib/managedApplicationClient.ts b/packages/@azure/arm-managedapplications/lib/managedApplicationClient.ts new file mode 100644 index 000000000000..e803ffd8a89c --- /dev/null +++ b/packages/@azure/arm-managedapplications/lib/managedApplicationClient.ts @@ -0,0 +1,138 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; +import * as Models from "./models"; +import * as Mappers from "./models/mappers"; +import * as Parameters from "./models/parameters"; +import * as operations from "./operations"; +import { ManagedApplicationClientContext } from "./managedApplicationClientContext"; + + +class ManagedApplicationClient extends ManagedApplicationClientContext { + // Operation groups + appliances: operations.Appliances; + applianceDefinitions: operations.ApplianceDefinitions; + + /** + * Initializes a new instance of the ManagedApplicationClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId The ID of the target subscription. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.ManagedApplicationClientOptions) { + super(credentials, subscriptionId, options); + this.appliances = new operations.Appliances(this); + this.applianceDefinitions = new operations.ApplianceDefinitions(this); + } + + /** + * Lists all of the available Microsoft.Solutions REST API operations. + * @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, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + options + }, + listOperationsOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the available Microsoft.Solutions REST API operations. + * @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, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + nextPageLink, + options + }, + listOperationsNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Solutions/operations", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listOperationsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +export { + ManagedApplicationClient, + ManagedApplicationClientContext, + Models as ManagedApplicationModels, + Mappers as ManagedApplicationMappers +}; +export * from "./operations"; diff --git a/packages/@azure/arm-managedapplications/lib/managedApplicationClientContext.ts b/packages/@azure/arm-managedapplications/lib/managedApplicationClientContext.ts new file mode 100644 index 000000000000..e5a07f051f8d --- /dev/null +++ b/packages/@azure/arm-managedapplications/lib/managedApplicationClientContext.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as Models from "./models"; +import * as msRest from "ms-rest-js"; +import * as msRestAzure from "ms-rest-azure-js"; + +const packageName = "@azure/arm-managedapplications"; +const packageVersion = "1.0.0-preview"; + +export class ManagedApplicationClientContext extends msRestAzure.AzureServiceClient { + + credentials: msRest.ServiceClientCredentials; + + subscriptionId: string; + + apiVersion: string; + + acceptLanguage: string; + + longRunningOperationRetryTimeout: number; + + /** + * Initializes a new instance of the ManagedApplicationClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId The ID of the target subscription. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.ManagedApplicationClientOptions) { + if (credentials == undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId == undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) { + options = {}; + } + super(credentials, options); + + this.apiVersion = '2016-09-01-preview'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; + this.requestContentType = "application/json; charset=utf-8"; + this.credentials = credentials; + this.subscriptionId = subscriptionId; + + this.addUserAgentInfo(`${packageName}/${packageVersion}`); + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + } +} diff --git a/packages/@azure/arm-managedapplications/lib/models/applianceDefinitionsMappers.ts b/packages/@azure/arm-managedapplications/lib/models/applianceDefinitionsMappers.ts new file mode 100644 index 000000000000..b4ed010e811d --- /dev/null +++ b/packages/@azure/arm-managedapplications/lib/models/applianceDefinitionsMappers.ts @@ -0,0 +1,27 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + ApplianceDefinition, + GenericResource, + Resource, + BaseResource, + Sku, + Identity, + ApplianceProviderAuthorization, + ApplianceArtifact, + ErrorResponse, + ApplianceDefinitionListResult, + Appliance, + Plan, + AppliancePatchable, + PlanPatchable +} from "../models/mappers"; + diff --git a/packages/@azure/arm-managedapplications/lib/models/appliancesMappers.ts b/packages/@azure/arm-managedapplications/lib/models/appliancesMappers.ts new file mode 100644 index 000000000000..7d476792ff5b --- /dev/null +++ b/packages/@azure/arm-managedapplications/lib/models/appliancesMappers.ts @@ -0,0 +1,27 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + Appliance, + GenericResource, + Resource, + BaseResource, + Sku, + Identity, + Plan, + ErrorResponse, + ApplianceListResult, + AppliancePatchable, + PlanPatchable, + ApplianceDefinition, + ApplianceProviderAuthorization, + ApplianceArtifact +} from "../models/mappers"; + diff --git a/packages/@azure/arm-managedapplications/lib/models/index.ts b/packages/@azure/arm-managedapplications/lib/models/index.ts new file mode 100644 index 000000000000..63986cba835f --- /dev/null +++ b/packages/@azure/arm-managedapplications/lib/models/index.ts @@ -0,0 +1,1012 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import { BaseResource, CloudError, AzureServiceClientOptions } from "ms-rest-azure-js"; +import * as msRest from "ms-rest-js"; + +export { BaseResource, CloudError }; + + +/** + * @interface + * An interface representing Plan. + * Plan for the appliance. + * + */ +export interface Plan { + /** + * @member {string} name The plan name. + */ + name: string; + /** + * @member {string} publisher The publisher ID. + */ + publisher: string; + /** + * @member {string} product The product code. + */ + product: string; + /** + * @member {string} [promotionCode] The promotion code. + */ + promotionCode?: string; + /** + * @member {string} version The plan's version. + */ + version: string; +} + +/** + * @interface + * An interface representing Resource. + * Resource information. + * + * @extends BaseResource + */ +export interface Resource extends BaseResource { + /** + * @member {string} [id] Resource ID + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [name] Resource name + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [type] Resource type + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {string} [location] Resource location + */ + location?: string; + /** + * @member {{ [propertyName: string]: string }} [tags] Resource tags + */ + tags?: { [propertyName: string]: string }; +} + +/** + * @interface + * An interface representing GenericResource. + * Resource information. + * + * @extends Resource + */ +export interface GenericResource extends Resource { + /** + * @member {string} [managedBy] ID of the resource that manages this + * resource. + */ + managedBy?: string; + /** + * @member {Sku} [sku] The SKU of the resource. + */ + sku?: Sku; + /** + * @member {Identity} [identity] The identity of the resource. + */ + identity?: Identity; +} + +/** + * @interface + * An interface representing Appliance. + * Information about appliance. + * + * @extends GenericResource + */ +export interface Appliance extends GenericResource { + /** + * @member {string} managedResourceGroupId The managed resource group Id. + */ + managedResourceGroupId: string; + /** + * @member {string} [applianceDefinitionId] The fully qualified path of + * appliance definition Id. + */ + applianceDefinitionId?: string; + /** + * @member {any} [parameters] Name and value pairs that define the appliance + * parameters. It can be a JObject or a well formed JSON string. + */ + parameters?: any; + /** + * @member {any} [outputs] Name and value pairs that define the appliance + * outputs. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly outputs?: any; + /** + * @member {ProvisioningState} [provisioningState] The appliance provisioning + * state. Possible values include: 'Accepted', 'Running', 'Ready', + * 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', + * 'Succeeded', 'Updating' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provisioningState?: ProvisioningState; + /** + * @member {string} [uiDefinitionUri] The blob URI where the UI definition + * file is located. + */ + uiDefinitionUri?: string; + /** + * @member {Plan} [plan] The plan information. + */ + plan?: Plan; + /** + * @member {string} [kind] The kind of the appliance. Allowed values are + * MarketPlace and ServiceCatalog. + */ + kind?: string; +} + +/** + * @interface + * An interface representing PlanPatchable. + * Plan for the appliance. + * + */ +export interface PlanPatchable { + /** + * @member {string} [name] The plan name. + */ + name?: string; + /** + * @member {string} [publisher] The publisher ID. + */ + publisher?: string; + /** + * @member {string} [product] The product code. + */ + product?: string; + /** + * @member {string} [promotionCode] The promotion code. + */ + promotionCode?: string; + /** + * @member {string} [version] The plan's version. + */ + version?: string; +} + +/** + * @interface + * An interface representing AppliancePatchable. + * Information about appliance. + * + * @extends GenericResource + */ +export interface AppliancePatchable extends GenericResource { + /** + * @member {string} [managedResourceGroupId] The managed resource group Id. + */ + managedResourceGroupId?: string; + /** + * @member {string} [applianceDefinitionId] The fully qualified path of + * appliance definition Id. + */ + applianceDefinitionId?: string; + /** + * @member {any} [parameters] Name and value pairs that define the appliance + * parameters. It can be a JObject or a well formed JSON string. + */ + parameters?: any; + /** + * @member {any} [outputs] Name and value pairs that define the appliance + * outputs. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly outputs?: any; + /** + * @member {ProvisioningState} [provisioningState] The appliance provisioning + * state. Possible values include: 'Accepted', 'Running', 'Ready', + * 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', + * 'Succeeded', 'Updating' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provisioningState?: ProvisioningState; + /** + * @member {string} [uiDefinitionUri] The blob URI where the UI definition + * file is located. + */ + uiDefinitionUri?: string; + /** + * @member {PlanPatchable} [plan] The plan information. + */ + plan?: PlanPatchable; + /** + * @member {string} [kind] The kind of the appliance. Allowed values are + * MarketPlace and ServiceCatalog. + */ + kind?: string; +} + +/** + * @interface + * An interface representing ApplianceProviderAuthorization. + * The appliance provider authorization. + * + */ +export interface ApplianceProviderAuthorization { + /** + * @member {string} principalId The provider's principal identifier. This is + * the identity that the provider will use to call ARM to manage the + * appliance resources. + */ + principalId: string; + /** + * @member {string} roleDefinitionId The provider's role definition + * identifier. This role will define all the permissions that the provider + * must have on the appliance's container resource group. This role + * definition cannot have permission to delete the resource group. + */ + roleDefinitionId: string; +} + +/** + * @interface + * An interface representing ApplianceArtifact. + * Appliance artifact. + * + */ +export interface ApplianceArtifact { + /** + * @member {string} [name] The appliance artifact name. + */ + name?: string; + /** + * @member {string} [uri] The appliance artifact blob uri. + */ + uri?: string; + /** + * @member {ApplianceArtifactType} [type] The the appliance artifact type. + * Possible values include: 'Template', 'Custom' + */ + type?: ApplianceArtifactType; +} + +/** + * @interface + * An interface representing ApplianceDefinition. + * Information about appliance definition. + * + * @extends GenericResource + */ +export interface ApplianceDefinition extends GenericResource { + /** + * @member {ApplianceLockLevel} lockLevel The appliance lock level. Possible + * values include: 'CanNotDelete', 'ReadOnly', 'None' + */ + lockLevel: ApplianceLockLevel; + /** + * @member {string} [displayName] The appliance definition display name. + */ + displayName?: string; + /** + * @member {ApplianceProviderAuthorization[]} authorizations The appliance + * provider authorizations. + */ + authorizations: ApplianceProviderAuthorization[]; + /** + * @member {ApplianceArtifact[]} [artifacts] The collection of appliance + * artifacts. The portal will use the files specified as artifacts to + * construct the user experience of creating an appliance from an appliance + * definition. + */ + artifacts?: ApplianceArtifact[]; + /** + * @member {string} [description] The appliance definition description. + */ + description?: string; + /** + * @member {string} packageFileUri The appliance definition package file Uri. + */ + packageFileUri: string; +} + +/** + * @interface + * An interface representing Sku. + * SKU for the resource. + * + */ +export interface Sku { + /** + * @member {string} name The SKU name. + */ + name: string; + /** + * @member {string} [tier] The SKU tier. + */ + tier?: string; + /** + * @member {string} [size] The SKU size. + */ + size?: string; + /** + * @member {string} [family] The SKU family. + */ + family?: string; + /** + * @member {string} [model] The SKU model. + */ + model?: string; + /** + * @member {number} [capacity] The SKU capacity. + */ + capacity?: number; +} + +/** + * @interface + * An interface representing Identity. + * Identity for the resource. + * + */ +export interface Identity { + /** + * @member {string} [principalId] The principal ID of resource identity. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly principalId?: string; + /** + * @member {string} [tenantId] The tenant ID of resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly tenantId?: string; + /** + * @member {ResourceIdentityType} [type] The identity type. Possible values + * include: 'SystemAssigned' + */ + type?: ResourceIdentityType; +} + +/** + * @interface + * An interface representing ErrorResponse. + * Error reponse indicates ARM appliance is not able to process the incoming + * request. The reason is provided in the error message. + * + */ +export interface ErrorResponse { + /** + * @member {string} [httpStatus] Http status code. + */ + httpStatus?: string; + /** + * @member {string} [errorCode] Error code. + */ + errorCode?: string; + /** + * @member {string} [errorMessage] Error message indicating why the operation + * failed. + */ + errorMessage?: string; +} + +/** + * @interface + * An interface representing OperationDisplay. + * The object that represents the operation. + * + */ +export interface OperationDisplay { + /** + * @member {string} [provider] Service provider: Microsoft.Solutions + */ + provider?: string; + /** + * @member {string} [resource] Resource on which the operation is performed: + * Profile, endpoint, etc. + */ + resource?: string; + /** + * @member {string} [operation] Operation type: Read, write, delete, etc. + */ + operation?: string; +} + +/** + * @interface + * An interface representing Operation. + * Microsoft.Solutions operation + * + */ +export interface Operation { + /** + * @member {string} [name] Operation name: {provider}/{resource}/{operation} + */ + name?: string; + /** + * @member {OperationDisplay} [display] The object that represents the + * operation. + */ + display?: OperationDisplay; +} + +/** + * @interface + * An interface representing AppliancesUpdateOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface AppliancesUpdateOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {Appliance} [parameters] Parameters supplied to update an existing + * appliance. + */ + parameters?: Appliance; +} + +/** + * @interface + * An interface representing AppliancesUpdateByIdOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface AppliancesUpdateByIdOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {Appliance} [parameters] Parameters supplied to update an existing + * appliance. + */ + parameters?: Appliance; +} + +/** + * @interface + * An interface representing ManagedApplicationClientOptions. + * @extends AzureServiceClientOptions + */ +export interface ManagedApplicationClientOptions extends AzureServiceClientOptions { + /** + * @member {string} [baseUri] + */ + baseUri?: string; +} + + +/** + * @interface + * An interface representing the OperationListResult. + * Result of the request to list Microsoft.Solutions operations. It contains a + * list of operations and a URL link to get the next set of results. + * + * @extends Array + */ +export interface OperationListResult extends Array { + /** + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ + nextLink?: string; +} + +/** + * @interface + * An interface representing the ApplianceListResult. + * List of appliances. + * + * @extends Array + */ +export interface ApplianceListResult extends Array { + /** + * @member {string} [nextLink] The URL to use for getting the next set of + * results. + */ + nextLink?: string; +} + +/** + * @interface + * An interface representing the ApplianceDefinitionListResult. + * List of appliance definitions. + * + * @extends Array + */ +export interface ApplianceDefinitionListResult extends Array { + /** + * @member {string} [nextLink] The URL to use for getting the next set of + * results. + */ + nextLink?: string; +} + +/** + * Defines values for ProvisioningState. + * Possible values include: 'Accepted', 'Running', 'Ready', 'Creating', + * 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', 'Succeeded', + * 'Updating' + * There could be more values for this enum apart from the ones defined here.If + * you want to set a value that is not from the known values then you can do + * the following: + * let param: ProvisioningState = + * "someUnknownValueThatWillStillBeValid"; + * @readonly + * @enum {string} + */ +export enum ProvisioningState { + Accepted = 'Accepted', + Running = 'Running', + Ready = 'Ready', + Creating = 'Creating', + Created = 'Created', + Deleting = 'Deleting', + Deleted = 'Deleted', + Canceled = 'Canceled', + Failed = 'Failed', + Succeeded = 'Succeeded', + Updating = 'Updating', +} + +/** + * Defines values for ApplianceLockLevel. + * Possible values include: 'CanNotDelete', 'ReadOnly', 'None' + * @readonly + * @enum {string} + */ +export enum ApplianceLockLevel { + CanNotDelete = 'CanNotDelete', + ReadOnly = 'ReadOnly', + None = 'None', +} + +/** + * Defines values for ApplianceArtifactType. + * Possible values include: 'Template', 'Custom' + * @readonly + * @enum {string} + */ +export enum ApplianceArtifactType { + Template = 'Template', + Custom = 'Custom', +} + +/** + * Defines values for ResourceIdentityType. + * Possible values include: 'SystemAssigned' + * @readonly + * @enum {string} + */ +export enum ResourceIdentityType { + SystemAssigned = 'SystemAssigned', +} + +/** + * Contains response data for the listOperations operation. + */ +export type ListOperationsResponse = OperationListResult & { + /** + * 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: OperationListResult; + }; +}; + +/** + * Contains response data for the listOperationsNext operation. + */ +export type ListOperationsNextResponse = OperationListResult & { + /** + * 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: OperationListResult; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type AppliancesGetResponse = Appliance & { + /** + * 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: Appliance; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type AppliancesCreateOrUpdateResponse = Appliance & { + /** + * 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: Appliance; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type AppliancesUpdateResponse = Appliance & { + /** + * 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: Appliance; + }; +}; + +/** + * Contains response data for the listByResourceGroup operation. + */ +export type AppliancesListByResourceGroupResponse = ApplianceListResult & { + /** + * 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: ApplianceListResult; + }; +}; + +/** + * Contains response data for the listBySubscription operation. + */ +export type AppliancesListBySubscriptionResponse = ApplianceListResult & { + /** + * 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: ApplianceListResult; + }; +}; + +/** + * Contains response data for the getById operation. + */ +export type AppliancesGetByIdResponse = Appliance & { + /** + * 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: Appliance; + }; +}; + +/** + * Contains response data for the createOrUpdateById operation. + */ +export type AppliancesCreateOrUpdateByIdResponse = Appliance & { + /** + * 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: Appliance; + }; +}; + +/** + * Contains response data for the updateById operation. + */ +export type AppliancesUpdateByIdResponse = Appliance & { + /** + * 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: Appliance; + }; +}; + +/** + * Contains response data for the beginCreateOrUpdate operation. + */ +export type AppliancesBeginCreateOrUpdateResponse = Appliance & { + /** + * 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: Appliance; + }; +}; + +/** + * Contains response data for the beginCreateOrUpdateById operation. + */ +export type AppliancesBeginCreateOrUpdateByIdResponse = Appliance & { + /** + * 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: Appliance; + }; +}; + +/** + * Contains response data for the listByResourceGroupNext operation. + */ +export type AppliancesListByResourceGroupNextResponse = ApplianceListResult & { + /** + * 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: ApplianceListResult; + }; +}; + +/** + * Contains response data for the listBySubscriptionNext operation. + */ +export type AppliancesListBySubscriptionNextResponse = ApplianceListResult & { + /** + * 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: ApplianceListResult; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type ApplianceDefinitionsGetResponse = ApplianceDefinition & { + /** + * 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: ApplianceDefinition; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type ApplianceDefinitionsCreateOrUpdateResponse = ApplianceDefinition & { + /** + * 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: ApplianceDefinition; + }; +}; + +/** + * Contains response data for the listByResourceGroup operation. + */ +export type ApplianceDefinitionsListByResourceGroupResponse = ApplianceDefinitionListResult & { + /** + * 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: ApplianceDefinitionListResult; + }; +}; + +/** + * Contains response data for the getById operation. + */ +export type ApplianceDefinitionsGetByIdResponse = ApplianceDefinition & { + /** + * 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: ApplianceDefinition; + }; +}; + +/** + * Contains response data for the createOrUpdateById operation. + */ +export type ApplianceDefinitionsCreateOrUpdateByIdResponse = ApplianceDefinition & { + /** + * 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: ApplianceDefinition; + }; +}; + +/** + * Contains response data for the beginCreateOrUpdate operation. + */ +export type ApplianceDefinitionsBeginCreateOrUpdateResponse = ApplianceDefinition & { + /** + * 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: ApplianceDefinition; + }; +}; + +/** + * Contains response data for the beginCreateOrUpdateById operation. + */ +export type ApplianceDefinitionsBeginCreateOrUpdateByIdResponse = ApplianceDefinition & { + /** + * 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: ApplianceDefinition; + }; +}; + +/** + * Contains response data for the listByResourceGroupNext operation. + */ +export type ApplianceDefinitionsListByResourceGroupNextResponse = ApplianceDefinitionListResult & { + /** + * 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: ApplianceDefinitionListResult; + }; +}; diff --git a/packages/@azure/arm-managedapplications/lib/models/mappers.ts b/packages/@azure/arm-managedapplications/lib/models/mappers.ts new file mode 100644 index 000000000000..4ff607848751 --- /dev/null +++ b/packages/@azure/arm-managedapplications/lib/models/mappers.ts @@ -0,0 +1,675 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import { CloudErrorMapper, BaseResourceMapper } from "ms-rest-azure-js"; +import * as msRest from "ms-rest-js"; + +export const CloudError = CloudErrorMapper; +export const BaseResource = BaseResourceMapper; + +export const Plan: msRest.CompositeMapper = { + serializedName: "Plan", + type: { + name: "Composite", + className: "Plan", + modelProperties: { + name: { + required: true, + serializedName: "name", + type: { + name: "String" + } + }, + publisher: { + required: true, + serializedName: "publisher", + type: { + name: "String" + } + }, + product: { + required: true, + serializedName: "product", + type: { + name: "String" + } + }, + promotionCode: { + serializedName: "promotionCode", + type: { + name: "String" + } + }, + version: { + required: true, + serializedName: "version", + type: { + name: "String" + } + } + } + } +}; + +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" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const GenericResource: msRest.CompositeMapper = { + serializedName: "GenericResource", + type: { + name: "Composite", + className: "GenericResource", + modelProperties: { + ...Resource.type.modelProperties, + managedBy: { + serializedName: "managedBy", + type: { + name: "String" + } + }, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku" + } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity" + } + } + } + } +}; + +export const Appliance: msRest.CompositeMapper = { + serializedName: "Appliance", + type: { + name: "Composite", + className: "Appliance", + modelProperties: { + ...GenericResource.type.modelProperties, + managedResourceGroupId: { + required: true, + serializedName: "properties.managedResourceGroupId", + type: { + name: "String" + } + }, + applianceDefinitionId: { + serializedName: "properties.applianceDefinitionId", + type: { + name: "String" + } + }, + parameters: { + serializedName: "properties.parameters", + type: { + name: "Object" + } + }, + outputs: { + readOnly: true, + serializedName: "properties.outputs", + type: { + name: "Object" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + uiDefinitionUri: { + serializedName: "properties.uiDefinitionUri", + type: { + name: "String" + } + }, + plan: { + serializedName: "plan", + type: { + name: "Composite", + className: "Plan" + } + }, + kind: { + serializedName: "kind", + constraints: { + Pattern: /^[-\w\._,\(\)]+$/ + }, + type: { + name: "String" + } + } + } + } +}; + +export const PlanPatchable: msRest.CompositeMapper = { + serializedName: "PlanPatchable", + type: { + name: "Composite", + className: "PlanPatchable", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + publisher: { + serializedName: "publisher", + type: { + name: "String" + } + }, + product: { + serializedName: "product", + type: { + name: "String" + } + }, + promotionCode: { + serializedName: "promotionCode", + type: { + name: "String" + } + }, + version: { + serializedName: "version", + type: { + name: "String" + } + } + } + } +}; + +export const AppliancePatchable: msRest.CompositeMapper = { + serializedName: "AppliancePatchable", + type: { + name: "Composite", + className: "AppliancePatchable", + modelProperties: { + ...GenericResource.type.modelProperties, + managedResourceGroupId: { + serializedName: "properties.managedResourceGroupId", + type: { + name: "String" + } + }, + applianceDefinitionId: { + serializedName: "properties.applianceDefinitionId", + type: { + name: "String" + } + }, + parameters: { + serializedName: "properties.parameters", + type: { + name: "Object" + } + }, + outputs: { + readOnly: true, + serializedName: "properties.outputs", + type: { + name: "Object" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + uiDefinitionUri: { + serializedName: "properties.uiDefinitionUri", + type: { + name: "String" + } + }, + plan: { + serializedName: "plan", + type: { + name: "Composite", + className: "PlanPatchable" + } + }, + kind: { + serializedName: "kind", + constraints: { + Pattern: /^[-\w\._,\(\)]+$/ + }, + type: { + name: "String" + } + } + } + } +}; + +export const ApplianceProviderAuthorization: msRest.CompositeMapper = { + serializedName: "ApplianceProviderAuthorization", + type: { + name: "Composite", + className: "ApplianceProviderAuthorization", + modelProperties: { + principalId: { + required: true, + serializedName: "principalId", + type: { + name: "String" + } + }, + roleDefinitionId: { + required: true, + serializedName: "roleDefinitionId", + type: { + name: "String" + } + } + } + } +}; + +export const ApplianceArtifact: msRest.CompositeMapper = { + serializedName: "ApplianceArtifact", + type: { + name: "Composite", + className: "ApplianceArtifact", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + uri: { + serializedName: "uri", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "Enum", + allowedValues: [ + "Template", + "Custom" + ] + } + } + } + } +}; + +export const ApplianceDefinition: msRest.CompositeMapper = { + serializedName: "ApplianceDefinition", + type: { + name: "Composite", + className: "ApplianceDefinition", + modelProperties: { + ...GenericResource.type.modelProperties, + lockLevel: { + required: true, + serializedName: "properties.lockLevel", + type: { + name: "Enum", + allowedValues: [ + "CanNotDelete", + "ReadOnly", + "None" + ] + } + }, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String" + } + }, + authorizations: { + required: true, + serializedName: "properties.authorizations", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ApplianceProviderAuthorization" + } + } + } + }, + artifacts: { + serializedName: "properties.artifacts", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ApplianceArtifact" + } + } + } + }, + description: { + serializedName: "properties.description", + type: { + name: "String" + } + }, + packageFileUri: { + required: true, + serializedName: "properties.packageFileUri", + type: { + name: "String" + } + } + } + } +}; + +export const Sku: msRest.CompositeMapper = { + serializedName: "Sku", + type: { + name: "Composite", + className: "Sku", + modelProperties: { + name: { + required: true, + serializedName: "name", + type: { + name: "String" + } + }, + tier: { + serializedName: "tier", + type: { + name: "String" + } + }, + size: { + serializedName: "size", + type: { + name: "String" + } + }, + family: { + serializedName: "family", + type: { + name: "String" + } + }, + model: { + serializedName: "model", + type: { + name: "String" + } + }, + capacity: { + serializedName: "capacity", + type: { + name: "Number" + } + } + } + } +}; + +export const Identity: msRest.CompositeMapper = { + serializedName: "Identity", + type: { + name: "Composite", + className: "Identity", + modelProperties: { + principalId: { + readOnly: true, + serializedName: "principalId", + type: { + name: "String" + } + }, + tenantId: { + readOnly: true, + serializedName: "tenantId", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "Enum", + allowedValues: [ + "SystemAssigned" + ] + } + } + } + } +}; + +export const ErrorResponse: msRest.CompositeMapper = { + serializedName: "ErrorResponse", + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + httpStatus: { + serializedName: "httpStatus", + type: { + name: "String" + } + }, + errorCode: { + serializedName: "errorCode", + type: { + name: "String" + } + }, + errorMessage: { + serializedName: "errorMessage", + type: { + name: "String" + } + } + } + } +}; + +export const OperationDisplay: msRest.CompositeMapper = { + serializedName: "Operation_display", + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + } + } + } +}; + +export const Operation: msRest.CompositeMapper = { + serializedName: "Operation", + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + } + } + } +}; + +export const OperationListResult: msRest.CompositeMapper = { + serializedName: "OperationListResult", + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ApplianceListResult: msRest.CompositeMapper = { + serializedName: "ApplianceListResult", + type: { + name: "Composite", + className: "ApplianceListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Appliance" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ApplianceDefinitionListResult: msRest.CompositeMapper = { + serializedName: "ApplianceDefinitionListResult", + type: { + name: "Composite", + className: "ApplianceDefinitionListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ApplianceDefinition" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/packages/@azure/arm-managedapplications/lib/models/parameters.ts b/packages/@azure/arm-managedapplications/lib/models/parameters.ts new file mode 100644 index 000000000000..c5f44fd8c28e --- /dev/null +++ b/packages/@azure/arm-managedapplications/lib/models/parameters.ts @@ -0,0 +1,118 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; + +export const acceptLanguage: msRest.OperationParameter = { + parameterPath: "acceptLanguage", + mapper: { + serializedName: "accept-language", + defaultValue: 'en-US', + type: { + name: "String" + } + } +}; +export const apiVersion: msRest.OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + required: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; +export const applianceDefinitionId: msRest.OperationURLParameter = { + parameterPath: "applianceDefinitionId", + mapper: { + required: true, + serializedName: "applianceDefinitionId", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const applianceDefinitionName: msRest.OperationURLParameter = { + parameterPath: "applianceDefinitionName", + mapper: { + required: true, + serializedName: "applianceDefinitionName", + constraints: { + MaxLength: 64, + MinLength: 3 + }, + type: { + name: "String" + } + } +}; +export const applianceId: msRest.OperationURLParameter = { + parameterPath: "applianceId", + mapper: { + required: true, + serializedName: "applianceId", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const applianceName: msRest.OperationURLParameter = { + parameterPath: "applianceName", + mapper: { + required: true, + serializedName: "applianceName", + constraints: { + MaxLength: 64, + MinLength: 3 + }, + 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" + } + } +}; +export const subscriptionId: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + type: { + name: "String" + } + } +}; diff --git a/packages/@azure/arm-managedapplications/lib/operations/applianceDefinitions.ts b/packages/@azure/arm-managedapplications/lib/operations/applianceDefinitions.ts new file mode 100644 index 000000000000..bf994fef1344 --- /dev/null +++ b/packages/@azure/arm-managedapplications/lib/operations/applianceDefinitions.ts @@ -0,0 +1,492 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; +import * as msRestAzure from "ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/applianceDefinitionsMappers"; +import * as Parameters from "../models/parameters"; +import { ManagedApplicationClientContext } from "../managedApplicationClientContext"; + +/** Class representing a ApplianceDefinitions. */ +export class ApplianceDefinitions { + private readonly client: ManagedApplicationClientContext; + + /** + * Create a ApplianceDefinitions. + * @param {ManagedApplicationClientContext} client Reference to the service client. + */ + constructor(client: ManagedApplicationClientContext) { + this.client = client; + } + + /** + * Gets the appliance definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applianceDefinitionName The name of the appliance definition. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, applianceDefinitionName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applianceDefinitionName The name of the appliance definition. + * @param callback The callback + */ + get(resourceGroupName: string, applianceDefinitionName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applianceDefinitionName The name of the appliance definition. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, applianceDefinitionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, applianceDefinitionName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + applianceDefinitionName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Deletes the appliance definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applianceDefinitionName The name of the appliance definition to delete. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, applianceDefinitionName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,applianceDefinitionName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Creates a new appliance definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applianceDefinitionName The name of the appliance definition. + * @param parameters Parameters supplied to the create or update an appliance definition. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, applianceDefinitionName: string, parameters: Models.ApplianceDefinition, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdate(resourceGroupName,applianceDefinitionName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Lists the appliance definitions in a 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 resource group. The name is case insensitive. + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + options + }, + listByResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Gets the appliance definition. + * @param applianceDefinitionId The fully qualified ID of the appliance definition, including the + * appliance name and the appliance definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name} + * @param [options] The optional parameters + * @returns Promise + */ + getById(applianceDefinitionId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param applianceDefinitionId The fully qualified ID of the appliance definition, including the + * appliance name and the appliance definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name} + * @param callback The callback + */ + getById(applianceDefinitionId: string, callback: msRest.ServiceCallback): void; + /** + * @param applianceDefinitionId The fully qualified ID of the appliance definition, including the + * appliance name and the appliance definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name} + * @param options The optional parameters + * @param callback The callback + */ + getById(applianceDefinitionId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getById(applianceDefinitionId: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + applianceDefinitionId, + options + }, + getByIdOperationSpec, + callback) as Promise; + } + + /** + * Deletes the appliance definition. + * @param applianceDefinitionId The fully qualified ID of the appliance definition, including the + * appliance name and the appliance definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name} + * @param [options] The optional parameters + * @returns Promise + */ + deleteById(applianceDefinitionId: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteById(applianceDefinitionId,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Creates a new appliance definition. + * @param applianceDefinitionId The fully qualified ID of the appliance definition, including the + * appliance name and the appliance definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name} + * @param parameters Parameters supplied to the create or update an appliance definition. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateById(applianceDefinitionId: string, parameters: Models.ApplianceDefinition, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdateById(applianceDefinitionId,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes the appliance definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applianceDefinitionName The name of the appliance definition to delete. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, applianceDefinitionName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + applianceDefinitionName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * Creates a new appliance definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applianceDefinitionName The name of the appliance definition. + * @param parameters Parameters supplied to the create or update an appliance definition. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdate(resourceGroupName: string, applianceDefinitionName: string, parameters: Models.ApplianceDefinition, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + applianceDefinitionName, + parameters, + options + }, + beginCreateOrUpdateOperationSpec, + options); + } + + /** + * Deletes the appliance definition. + * @param applianceDefinitionId The fully qualified ID of the appliance definition, including the + * appliance name and the appliance definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name} + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteById(applianceDefinitionId: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + applianceDefinitionId, + options + }, + beginDeleteByIdOperationSpec, + options); + } + + /** + * Creates a new appliance definition. + * @param applianceDefinitionId The fully qualified ID of the appliance definition, including the + * appliance name and the appliance definition resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name} + * @param parameters Parameters supplied to the create or update an appliance definition. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdateById(applianceDefinitionId: string, parameters: Models.ApplianceDefinition, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + applianceDefinitionId, + parameters, + options + }, + beginCreateOrUpdateByIdOperationSpec, + options); + } + + /** + * Lists the appliance definitions in a resource group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + 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 + */ + listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByResourceGroupNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applianceDefinitions/{applianceDefinitionName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.applianceDefinitionName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ApplianceDefinition + }, + 404: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applianceDefinitions", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ApplianceDefinitionListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getByIdOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "{applianceDefinitionId}", + urlParameters: [ + Parameters.applianceDefinitionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ApplianceDefinition + }, + 404: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applianceDefinitions/{applianceDefinitionName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.applianceDefinitionName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applianceDefinitions/{applianceDefinitionName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.applianceDefinitionName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.ApplianceDefinition, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ApplianceDefinition + }, + 201: { + bodyMapper: Mappers.ApplianceDefinition + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginDeleteByIdOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "{applianceDefinitionId}", + urlParameters: [ + Parameters.applianceDefinitionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginCreateOrUpdateByIdOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "{applianceDefinitionId}", + urlParameters: [ + Parameters.applianceDefinitionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.ApplianceDefinition, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ApplianceDefinition + }, + 201: { + bodyMapper: Mappers.ApplianceDefinition + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ApplianceDefinitionListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/packages/@azure/arm-managedapplications/lib/operations/appliances.ts b/packages/@azure/arm-managedapplications/lib/operations/appliances.ts new file mode 100644 index 000000000000..911d1f1b8ed8 --- /dev/null +++ b/packages/@azure/arm-managedapplications/lib/operations/appliances.ts @@ -0,0 +1,716 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; +import * as msRestAzure from "ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/appliancesMappers"; +import * as Parameters from "../models/parameters"; +import { ManagedApplicationClientContext } from "../managedApplicationClientContext"; + +/** Class representing a Appliances. */ +export class Appliances { + private readonly client: ManagedApplicationClientContext; + + /** + * Create a Appliances. + * @param {ManagedApplicationClientContext} client Reference to the service client. + */ + constructor(client: ManagedApplicationClientContext) { + this.client = client; + } + + /** + * Gets the appliance. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applianceName The name of the appliance. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, applianceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applianceName The name of the appliance. + * @param callback The callback + */ + get(resourceGroupName: string, applianceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applianceName The name of the appliance. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, applianceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, applianceName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + applianceName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Deletes the appliance. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applianceName The name of the appliance. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, applianceName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,applianceName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Creates a new appliance. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applianceName The name of the appliance. + * @param parameters Parameters supplied to the create or update an appliance. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, applianceName: string, parameters: Models.Appliance, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdate(resourceGroupName,applianceName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Updates an existing appliance. The only value that can be updated via PATCH currently is the + * tags. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applianceName The name of the appliance. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, applianceName: string, options?: Models.AppliancesUpdateOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applianceName The name of the appliance. + * @param callback The callback + */ + update(resourceGroupName: string, applianceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applianceName The name of the appliance. + * @param options The optional parameters + * @param callback The callback + */ + update(resourceGroupName: string, applianceName: string, options: Models.AppliancesUpdateOptionalParams, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, applianceName: string, options?: Models.AppliancesUpdateOptionalParams, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + applianceName, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * Gets all the appliances within a 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 resource group. The name is case insensitive. + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + options + }, + listByResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Gets all the appliances within a subscription. + * @param [options] The optional parameters + * @returns Promise + */ + listBySubscription(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + listBySubscription(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listBySubscription(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBySubscription(options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listBySubscriptionOperationSpec, + callback) as Promise; + } + + /** + * Gets the appliance. + * @param applianceId The fully qualified ID of the appliance, including the appliance name and the + * appliance resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-name} + * @param [options] The optional parameters + * @returns Promise + */ + getById(applianceId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param applianceId The fully qualified ID of the appliance, including the appliance name and the + * appliance resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-name} + * @param callback The callback + */ + getById(applianceId: string, callback: msRest.ServiceCallback): void; + /** + * @param applianceId The fully qualified ID of the appliance, including the appliance name and the + * appliance resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-name} + * @param options The optional parameters + * @param callback The callback + */ + getById(applianceId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getById(applianceId: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + applianceId, + options + }, + getByIdOperationSpec, + callback) as Promise; + } + + /** + * Deletes the appliance. + * @param applianceId The fully qualified ID of the appliance, including the appliance name and the + * appliance resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-name} + * @param [options] The optional parameters + * @returns Promise + */ + deleteById(applianceId: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteById(applianceId,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Creates a new appliance. + * @param applianceId The fully qualified ID of the appliance, including the appliance name and the + * appliance resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-name} + * @param parameters Parameters supplied to the create or update an appliance. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateById(applianceId: string, parameters: Models.Appliance, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdateById(applianceId,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Updates an existing appliance. The only value that can be updated via PATCH currently is the + * tags. + * @param applianceId The fully qualified ID of the appliance, including the appliance name and the + * appliance resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-name} + * @param [options] The optional parameters + * @returns Promise + */ + updateById(applianceId: string, options?: Models.AppliancesUpdateByIdOptionalParams): Promise; + /** + * @param applianceId The fully qualified ID of the appliance, including the appliance name and the + * appliance resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-name} + * @param callback The callback + */ + updateById(applianceId: string, callback: msRest.ServiceCallback): void; + /** + * @param applianceId The fully qualified ID of the appliance, including the appliance name and the + * appliance resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-name} + * @param options The optional parameters + * @param callback The callback + */ + updateById(applianceId: string, options: Models.AppliancesUpdateByIdOptionalParams, callback: msRest.ServiceCallback): void; + updateById(applianceId: string, options?: Models.AppliancesUpdateByIdOptionalParams, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + applianceId, + options + }, + updateByIdOperationSpec, + callback) as Promise; + } + + /** + * Deletes the appliance. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applianceName The name of the appliance. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, applianceName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + applianceName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * Creates a new appliance. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applianceName The name of the appliance. + * @param parameters Parameters supplied to the create or update an appliance. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdate(resourceGroupName: string, applianceName: string, parameters: Models.Appliance, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + applianceName, + parameters, + options + }, + beginCreateOrUpdateOperationSpec, + options); + } + + /** + * Deletes the appliance. + * @param applianceId The fully qualified ID of the appliance, including the appliance name and the + * appliance resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-name} + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteById(applianceId: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + applianceId, + options + }, + beginDeleteByIdOperationSpec, + options); + } + + /** + * Creates a new appliance. + * @param applianceId The fully qualified ID of the appliance, including the appliance name and the + * appliance resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/appliances/{appliance-name} + * @param parameters Parameters supplied to the create or update an appliance. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdateById(applianceId: string, parameters: Models.Appliance, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + applianceId, + parameters, + options + }, + beginCreateOrUpdateByIdOperationSpec, + options); + } + + /** + * Gets all the appliances within a resource group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + 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 + */ + listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByResourceGroupNextOperationSpec, + callback) as Promise; + } + + /** + * Gets all the appliances within 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, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listBySubscriptionNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/appliances/{applianceName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.applianceName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Appliance + }, + 404: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/appliances/{applianceName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.applianceName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: [ + "options", + "parameters" + ], + mapper: Mappers.Appliance + }, + responses: { + 200: { + bodyMapper: Mappers.Appliance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/appliances", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ApplianceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listBySubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Solutions/appliances", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ApplianceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getByIdOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "{applianceId}", + urlParameters: [ + Parameters.applianceId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Appliance + }, + 404: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const updateByIdOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "{applianceId}", + urlParameters: [ + Parameters.applianceId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: [ + "options", + "parameters" + ], + mapper: Mappers.Appliance + }, + responses: { + 200: { + bodyMapper: Mappers.Appliance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/appliances/{applianceName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.applianceName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/appliances/{applianceName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.applianceName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.Appliance, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Appliance + }, + 201: { + bodyMapper: Mappers.Appliance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginDeleteByIdOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "{applianceId}", + urlParameters: [ + Parameters.applianceId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginCreateOrUpdateByIdOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "{applianceId}", + urlParameters: [ + Parameters.applianceId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.Appliance, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Appliance + }, + 201: { + bodyMapper: Mappers.Appliance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ApplianceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ApplianceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/packages/@azure/arm-managedapplications/lib/operations/index.ts b/packages/@azure/arm-managedapplications/lib/operations/index.ts new file mode 100644 index 000000000000..50be9cad72d1 --- /dev/null +++ b/packages/@azure/arm-managedapplications/lib/operations/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export * from "./appliances"; +export * from "./applianceDefinitions"; diff --git a/packages/@azure/arm-managedapplications/package.json b/packages/@azure/arm-managedapplications/package.json new file mode 100644 index 000000000000..6363d9a90478 --- /dev/null +++ b/packages/@azure/arm-managedapplications/package.json @@ -0,0 +1,42 @@ +{ + "name": "@azure/arm-managedapplications", + "author": "Microsoft Corporation", + "description": "ManagedApplicationClient Library with typescript type definitions for node.js and browser.", + "version": "1.0.0-preview", + "dependencies": { + "ms-rest-azure-js": "^1.0.166", + "ms-rest-js": "^1.0.439", + "tslib": "^1.9.3" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/arm-managedapplications.js", + "module": "./esm/managedApplicationClient.js", + "types": "./esm/managedApplicationClient.d.ts", + "devDependencies": { + "typescript": "^3.1.1", + "rollup": "^0.66.2", + "rollup-plugin-node-resolve": "^3.4.0", + "uglify-js": "^3.4.9" + }, + "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/packages/@azure/arm-managedapplications", + "repository": { + "type": "git", + "url": "https://github.com/azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/azure/azure-sdk-for-js/issues" + }, + "scripts": { + "build": "tsc && rollup -c rollup.config.js && npm run minify", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-managedapplications.js.map'\" -o ./dist/arm-managedapplications.min.js ./dist/arm-managedapplications.js", + "prepare": "npm run build" + }, + "sideEffects": false +} diff --git a/packages/@azure/arm-managedapplications/rollup.config.js b/packages/@azure/arm-managedapplications/rollup.config.js new file mode 100644 index 000000000000..d2598f4dde7e --- /dev/null +++ b/packages/@azure/arm-managedapplications/rollup.config.js @@ -0,0 +1,31 @@ +import nodeResolve from "rollup-plugin-node-resolve"; +/** + * @type {import('rollup').RollupFileOptions} + */ +const config = { + input: './esm/managedApplicationClient.js', + external: ["ms-rest-js", "ms-rest-azure-js"], + output: { + file: "./dist/arm-managedapplications.js", + format: "umd", + name: "Azure.ArmManagedapplications", + sourcemap: true, + globals: { + "ms-rest-js": "msRest", + "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. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */` + }, + plugins: [ + nodeResolve({ module: true }) + ] +}; +export default config; diff --git a/packages/@azure/arm-managedapplications/tsconfig.json b/packages/@azure/arm-managedapplications/tsconfig.json new file mode 100644 index 000000000000..f32d1664f320 --- /dev/null +++ b/packages/@azure/arm-managedapplications/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es5", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": ["es6"], + "declaration": true, + "outDir": "./esm", + "importHelpers": true + }, + "include": ["./lib/**/*"], + "exclude": ["node_modules"] +} diff --git a/packages/@azure/arm-policy/.npmignore b/packages/@azure/arm-policy/.npmignore new file mode 100644 index 000000000000..a07a455ac10c --- /dev/null +++ b/packages/@azure/arm-policy/.npmignore @@ -0,0 +1,35 @@ +#git +.git +.gitignore +#gulp +gulpfile.js +#documentation +doc/ +docs/ +#dependencies +node_modules/ +#samples +sample/ +samples/ +#tests +test/ +tests/ +coverage/ +#tools and scripts +tools/ +scripts/ +#IDE settings +*.sln +.vscode/ +.idea +.editorconfig +.ntvs_analysis.* +#build tools +.travis.yml +.jenkins.yml +.codeclimate.yml +appveyor.yml +# Nuget packages # +.nuget/ +packages/ +packages.config diff --git a/packages/@azure/arm-policy/LICENSE.txt b/packages/@azure/arm-policy/LICENSE.txt new file mode 100644 index 000000000000..5431ba98b936 --- /dev/null +++ b/packages/@azure/arm-policy/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/@azure/arm-policy/README.md b/packages/@azure/arm-policy/README.md new file mode 100644 index 000000000000..e2cbc85d26c0 --- /dev/null +++ b/packages/@azure/arm-policy/README.md @@ -0,0 +1,81 @@ +# Azure PolicyClient SDK for JavaScript +This package contains an isomorphic SDK for PolicyClient. + +## Currently supported environments +- Node.js version 6.x.x or higher +- Browser JavaScript + +## How to Install +``` +npm install @azure/arm-policy +``` + + +## How to use + +### nodejs - Authentication, client creation and get policyAssignments as an example written in TypeScript. + +```ts +import * as msRest from "ms-rest-js"; +import * as msRestAzure from "ms-rest-azure-js"; +import * as msRestNodeAuth from "ms-rest-nodeauth"; +import { PolicyClient, PolicyModels, PolicyMappers } from "@azure/arm-policy"; +const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; + +msRestNodeAuth.interactiveLogin().then((creds) => { + const client = new PolicyClient(creds, subscriptionId); + const scope = "testscope"; + const policyAssignmentName = "testpolicyAssignmentName"; + client.policyAssignments.get(scope, policyAssignmentName).then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.error(err); +}); +``` + +### browser - Authentication, client creation and get policyAssignments as an example written in JavaScript. +See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. + +- index.html +```html + + + + @azure/arm-policy sample + + + + + + + + + +``` + +# Related projects + - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) diff --git a/packages/@azure/arm-policy/lib/models/index.ts b/packages/@azure/arm-policy/lib/models/index.ts new file mode 100644 index 000000000000..4c2226f092b8 --- /dev/null +++ b/packages/@azure/arm-policy/lib/models/index.ts @@ -0,0 +1,1088 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import { BaseResource, CloudError, AzureServiceClientOptions } from "ms-rest-azure-js"; +import * as msRest from "ms-rest-js"; + +export { BaseResource, CloudError }; + + +/** + * @interface + * An interface representing PolicySku. + * The policy sku. This property is optional, obsolete, and will be ignored. + * + */ +export interface PolicySku { + /** + * @member {string} name The name of the policy sku. Possible values are A0 + * and A1. + */ + name: string; + /** + * @member {string} [tier] The policy sku tier. Possible values are Free and + * Standard. + */ + tier?: string; +} + +/** + * @interface + * An interface representing Identity. + * Identity for the resource. + * + */ +export interface Identity { + /** + * @member {string} [principalId] The principal ID of the resource identity. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly principalId?: string; + /** + * @member {string} [tenantId] The tenant ID of the resource identity. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly tenantId?: string; + /** + * @member {ResourceIdentityType} [type] The identity type. Possible values + * include: 'SystemAssigned', 'None' + */ + type?: ResourceIdentityType; +} + +/** + * @interface + * An interface representing PolicyAssignment. + * The policy assignment. + * + * @extends BaseResource + */ +export interface PolicyAssignment extends BaseResource { + /** + * @member {string} [displayName] The display name of the policy assignment. + */ + displayName?: string; + /** + * @member {string} [policyDefinitionId] The ID of the policy definition or + * policy set definition being assigned. + */ + policyDefinitionId?: string; + /** + * @member {string} [scope] The scope for the policy assignment. + */ + scope?: string; + /** + * @member {string[]} [notScopes] The policy's excluded scopes. + */ + notScopes?: string[]; + /** + * @member {any} [parameters] Required if a parameter is used in policy rule. + */ + parameters?: any; + /** + * @member {string} [description] This message will be part of response in + * case of policy violation. + */ + description?: string; + /** + * @member {any} [metadata] The policy assignment metadata. + */ + metadata?: any; + /** + * @member {string} [id] The ID of the policy assignment. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [type] The type of the policy assignment. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {string} [name] The name of the policy assignment. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {PolicySku} [sku] The policy sku. This property is optional, + * obsolete, and will be ignored. + */ + sku?: PolicySku; + /** + * @member {string} [location] The location of the policy assignment. Only + * required when utilizing managed identity. + */ + location?: string; + /** + * @member {Identity} [identity] The managed identity associated with the + * policy assignment. + */ + identity?: Identity; +} + +/** + * @interface + * An interface representing ErrorResponse. + * Error reponse indicates Azure Resource Manager is not able to process the + * incoming request. The reason is provided in the error message. + * + */ +export interface ErrorResponse { + /** + * @member {string} [httpStatus] Http status code. + */ + httpStatus?: string; + /** + * @member {string} [errorCode] Error code. + */ + errorCode?: string; + /** + * @member {string} [errorMessage] Error message indicating why the operation + * failed. + */ + errorMessage?: string; +} + +/** + * @interface + * An interface representing PolicyDefinition. + * The policy definition. + * + * @extends BaseResource + */ +export interface PolicyDefinition extends BaseResource { + /** + * @member {PolicyType} [policyType] The type of policy definition. Possible + * values are NotSpecified, BuiltIn, and Custom. Possible values include: + * 'NotSpecified', 'BuiltIn', 'Custom' + */ + policyType?: PolicyType; + /** + * @member {PolicyMode} [mode] The policy definition mode. Possible values + * are NotSpecified, Indexed, and All. Possible values include: + * 'NotSpecified', 'Indexed', 'All' + */ + mode?: PolicyMode; + /** + * @member {string} [displayName] The display name of the policy definition. + */ + displayName?: string; + /** + * @member {string} [description] The policy definition description. + */ + description?: string; + /** + * @member {any} [policyRule] The policy rule. + */ + policyRule?: any; + /** + * @member {any} [metadata] The policy definition metadata. + */ + metadata?: any; + /** + * @member {any} [parameters] Required if a parameter is used in policy rule. + */ + parameters?: any; + /** + * @member {string} [id] The ID of the policy definition. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [name] The name of the policy definition. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [type] The type of the resource + * (Microsoft.Authorization/policyDefinitions). + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; +} + +/** + * @interface + * An interface representing PolicyDefinitionReference. + * The policy definition reference. + * + */ +export interface PolicyDefinitionReference { + /** + * @member {string} [policyDefinitionId] The ID of the policy definition or + * policy set definition. + */ + policyDefinitionId?: string; + /** + * @member {any} [parameters] Required if a parameter is used in policy rule. + */ + parameters?: any; +} + +/** + * @interface + * An interface representing PolicySetDefinition. + * The policy set definition. + * + * @extends BaseResource + */ +export interface PolicySetDefinition extends BaseResource { + /** + * @member {PolicyType} [policyType] The type of policy definition. Possible + * values are NotSpecified, BuiltIn, and Custom. Possible values include: + * 'NotSpecified', 'BuiltIn', 'Custom' + */ + policyType?: PolicyType; + /** + * @member {string} [displayName] The display name of the policy set + * definition. + */ + displayName?: string; + /** + * @member {string} [description] The policy set definition description. + */ + description?: string; + /** + * @member {any} [metadata] The policy set definition metadata. + */ + metadata?: any; + /** + * @member {any} [parameters] The policy set definition parameters that can + * be used in policy definition references. + */ + parameters?: any; + /** + * @member {PolicyDefinitionReference[]} policyDefinitions An array of policy + * definition references. + */ + policyDefinitions: PolicyDefinitionReference[]; + /** + * @member {string} [id] The ID of the policy set definition. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [name] The name of the policy set definition. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [type] The type of the resource + * (Microsoft.Authorization/policySetDefinitions). + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; +} + +/** + * @interface + * An interface representing PolicyAssignmentsListForResourceGroupOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyAssignmentsListForResourceGroupOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [filter] The filter to apply on the operation. Valid + * values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. + * If $filter is not provided, no filtering is performed. + */ + filter?: string; +} + +/** + * @interface + * An interface representing PolicyAssignmentsListForResourceOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyAssignmentsListForResourceOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [filter] The filter to apply on the operation. Valid + * values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. + * If $filter is not provided, no filtering is performed. + */ + filter?: string; +} + +/** + * @interface + * An interface representing PolicyAssignmentsListOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PolicyAssignmentsListOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [filter] The filter to apply on the operation. Valid + * values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. + * If $filter is not provided, no filtering is performed. + */ + filter?: string; +} + +/** + * @interface + * An interface representing PolicyClientOptions. + * @extends AzureServiceClientOptions + */ +export interface PolicyClientOptions extends AzureServiceClientOptions { + /** + * @member {string} [baseUri] + */ + baseUri?: string; +} + + +/** + * @interface + * An interface representing the PolicyAssignmentListResult. + * List of policy assignments. + * + * @extends Array + */ +export interface PolicyAssignmentListResult extends Array { + /** + * @member {string} [nextLink] The URL to use for getting the next set of + * results. + */ + nextLink?: string; +} + +/** + * @interface + * An interface representing the PolicyDefinitionListResult. + * List of policy definitions. + * + * @extends Array + */ +export interface PolicyDefinitionListResult extends Array { + /** + * @member {string} [nextLink] The URL to use for getting the next set of + * results. + */ + nextLink?: string; +} + +/** + * @interface + * An interface representing the PolicySetDefinitionListResult. + * List of policy set definitions. + * + * @extends Array + */ +export interface PolicySetDefinitionListResult extends Array { + /** + * @member {string} [nextLink] The URL to use for getting the next set of + * results. + */ + nextLink?: string; +} + +/** + * Defines values for ResourceIdentityType. + * Possible values include: 'SystemAssigned', 'None' + * @readonly + * @enum {string} + */ +export enum ResourceIdentityType { + SystemAssigned = 'SystemAssigned', + None = 'None', +} + +/** + * Defines values for PolicyType. + * Possible values include: 'NotSpecified', 'BuiltIn', 'Custom' + * There could be more values for this enum apart from the ones defined here.If + * you want to set a value that is not from the known values then you can do + * the following: + * let param: PolicyType = "someUnknownValueThatWillStillBeValid"; + * @readonly + * @enum {string} + */ +export enum PolicyType { + NotSpecified = 'NotSpecified', + BuiltIn = 'BuiltIn', + Custom = 'Custom', +} + +/** + * Defines values for PolicyMode. + * Possible values include: 'NotSpecified', 'Indexed', 'All' + * There could be more values for this enum apart from the ones defined here.If + * you want to set a value that is not from the known values then you can do + * the following: + * let param: PolicyMode = "someUnknownValueThatWillStillBeValid"; + * @readonly + * @enum {string} + */ +export enum PolicyMode { + NotSpecified = 'NotSpecified', + Indexed = 'Indexed', + All = 'All', +} + +/** + * Contains response data for the deleteMethod operation. + */ +export type PolicyAssignmentsDeleteMethodResponse = PolicyAssignment & { + /** + * 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: PolicyAssignment; + }; +}; + +/** + * Contains response data for the create operation. + */ +export type PolicyAssignmentsCreateResponse = PolicyAssignment & { + /** + * 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: PolicyAssignment; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type PolicyAssignmentsGetResponse = PolicyAssignment & { + /** + * 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: PolicyAssignment; + }; +}; + +/** + * Contains response data for the listForResourceGroup operation. + */ +export type PolicyAssignmentsListForResourceGroupResponse = PolicyAssignmentListResult & { + /** + * 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: PolicyAssignmentListResult; + }; +}; + +/** + * Contains response data for the listForResource operation. + */ +export type PolicyAssignmentsListForResourceResponse = PolicyAssignmentListResult & { + /** + * 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: PolicyAssignmentListResult; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type PolicyAssignmentsListResponse = PolicyAssignmentListResult & { + /** + * 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: PolicyAssignmentListResult; + }; +}; + +/** + * Contains response data for the deleteById operation. + */ +export type PolicyAssignmentsDeleteByIdResponse = PolicyAssignment & { + /** + * 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: PolicyAssignment; + }; +}; + +/** + * Contains response data for the createById operation. + */ +export type PolicyAssignmentsCreateByIdResponse = PolicyAssignment & { + /** + * 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: PolicyAssignment; + }; +}; + +/** + * Contains response data for the getById operation. + */ +export type PolicyAssignmentsGetByIdResponse = PolicyAssignment & { + /** + * 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: PolicyAssignment; + }; +}; + +/** + * Contains response data for the listForResourceGroupNext operation. + */ +export type PolicyAssignmentsListForResourceGroupNextResponse = PolicyAssignmentListResult & { + /** + * 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: PolicyAssignmentListResult; + }; +}; + +/** + * Contains response data for the listForResourceNext operation. + */ +export type PolicyAssignmentsListForResourceNextResponse = PolicyAssignmentListResult & { + /** + * 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: PolicyAssignmentListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type PolicyAssignmentsListNextResponse = PolicyAssignmentListResult & { + /** + * 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: PolicyAssignmentListResult; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type PolicyDefinitionsCreateOrUpdateResponse = PolicyDefinition & { + /** + * 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: PolicyDefinition; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type PolicyDefinitionsGetResponse = PolicyDefinition & { + /** + * 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: PolicyDefinition; + }; +}; + +/** + * Contains response data for the getBuiltIn operation. + */ +export type PolicyDefinitionsGetBuiltInResponse = PolicyDefinition & { + /** + * 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: PolicyDefinition; + }; +}; + +/** + * Contains response data for the createOrUpdateAtManagementGroup operation. + */ +export type PolicyDefinitionsCreateOrUpdateAtManagementGroupResponse = PolicyDefinition & { + /** + * 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: PolicyDefinition; + }; +}; + +/** + * Contains response data for the getAtManagementGroup operation. + */ +export type PolicyDefinitionsGetAtManagementGroupResponse = PolicyDefinition & { + /** + * 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: PolicyDefinition; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type PolicyDefinitionsListResponse = PolicyDefinitionListResult & { + /** + * 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: PolicyDefinitionListResult; + }; +}; + +/** + * Contains response data for the listBuiltIn operation. + */ +export type PolicyDefinitionsListBuiltInResponse = PolicyDefinitionListResult & { + /** + * 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: PolicyDefinitionListResult; + }; +}; + +/** + * Contains response data for the listByManagementGroup operation. + */ +export type PolicyDefinitionsListByManagementGroupResponse = PolicyDefinitionListResult & { + /** + * 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: PolicyDefinitionListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type PolicyDefinitionsListNextResponse = PolicyDefinitionListResult & { + /** + * 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: PolicyDefinitionListResult; + }; +}; + +/** + * Contains response data for the listBuiltInNext operation. + */ +export type PolicyDefinitionsListBuiltInNextResponse = PolicyDefinitionListResult & { + /** + * 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: PolicyDefinitionListResult; + }; +}; + +/** + * Contains response data for the listByManagementGroupNext operation. + */ +export type PolicyDefinitionsListByManagementGroupNextResponse = PolicyDefinitionListResult & { + /** + * 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: PolicyDefinitionListResult; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type PolicySetDefinitionsCreateOrUpdateResponse = PolicySetDefinition & { + /** + * 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: PolicySetDefinition; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type PolicySetDefinitionsGetResponse = PolicySetDefinition & { + /** + * 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: PolicySetDefinition; + }; +}; + +/** + * Contains response data for the getBuiltIn operation. + */ +export type PolicySetDefinitionsGetBuiltInResponse = PolicySetDefinition & { + /** + * 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: PolicySetDefinition; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type PolicySetDefinitionsListResponse = PolicySetDefinitionListResult & { + /** + * 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: PolicySetDefinitionListResult; + }; +}; + +/** + * Contains response data for the listBuiltIn operation. + */ +export type PolicySetDefinitionsListBuiltInResponse = PolicySetDefinitionListResult & { + /** + * 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: PolicySetDefinitionListResult; + }; +}; + +/** + * Contains response data for the createOrUpdateAtManagementGroup operation. + */ +export type PolicySetDefinitionsCreateOrUpdateAtManagementGroupResponse = PolicySetDefinition & { + /** + * 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: PolicySetDefinition; + }; +}; + +/** + * Contains response data for the getAtManagementGroup operation. + */ +export type PolicySetDefinitionsGetAtManagementGroupResponse = PolicySetDefinition & { + /** + * 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: PolicySetDefinition; + }; +}; + +/** + * Contains response data for the listByManagementGroup operation. + */ +export type PolicySetDefinitionsListByManagementGroupResponse = PolicySetDefinitionListResult & { + /** + * 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: PolicySetDefinitionListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type PolicySetDefinitionsListNextResponse = PolicySetDefinitionListResult & { + /** + * 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: PolicySetDefinitionListResult; + }; +}; + +/** + * Contains response data for the listBuiltInNext operation. + */ +export type PolicySetDefinitionsListBuiltInNextResponse = PolicySetDefinitionListResult & { + /** + * 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: PolicySetDefinitionListResult; + }; +}; + +/** + * Contains response data for the listByManagementGroupNext operation. + */ +export type PolicySetDefinitionsListByManagementGroupNextResponse = PolicySetDefinitionListResult & { + /** + * 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: PolicySetDefinitionListResult; + }; +}; diff --git a/packages/@azure/arm-policy/lib/models/mappers.ts b/packages/@azure/arm-policy/lib/models/mappers.ts new file mode 100644 index 000000000000..74678668c433 --- /dev/null +++ b/packages/@azure/arm-policy/lib/models/mappers.ts @@ -0,0 +1,451 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import { CloudErrorMapper, BaseResourceMapper } from "ms-rest-azure-js"; +import * as msRest from "ms-rest-js"; + +export const CloudError = CloudErrorMapper; +export const BaseResource = BaseResourceMapper; + +export const PolicySku: msRest.CompositeMapper = { + serializedName: "PolicySku", + type: { + name: "Composite", + className: "PolicySku", + modelProperties: { + name: { + required: true, + serializedName: "name", + type: { + name: "String" + } + }, + tier: { + serializedName: "tier", + type: { + name: "String" + } + } + } + } +}; + +export const Identity: msRest.CompositeMapper = { + serializedName: "Identity", + type: { + name: "Composite", + className: "Identity", + modelProperties: { + principalId: { + readOnly: true, + serializedName: "principalId", + type: { + name: "String" + } + }, + tenantId: { + readOnly: true, + serializedName: "tenantId", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "Enum", + allowedValues: [ + "SystemAssigned", + "None" + ] + } + } + } + } +}; + +export const PolicyAssignment: msRest.CompositeMapper = { + serializedName: "PolicyAssignment", + type: { + name: "Composite", + className: "PolicyAssignment", + modelProperties: { + displayName: { + serializedName: "properties.displayName", + type: { + name: "String" + } + }, + policyDefinitionId: { + serializedName: "properties.policyDefinitionId", + type: { + name: "String" + } + }, + scope: { + serializedName: "properties.scope", + type: { + name: "String" + } + }, + notScopes: { + serializedName: "properties.notScopes", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + parameters: { + serializedName: "properties.parameters", + type: { + name: "Object" + } + }, + description: { + serializedName: "properties.description", + type: { + name: "String" + } + }, + metadata: { + serializedName: "properties.metadata", + type: { + name: "Object" + } + }, + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "PolicySku" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity" + } + } + } + } +}; + +export const ErrorResponse: msRest.CompositeMapper = { + serializedName: "ErrorResponse", + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + httpStatus: { + serializedName: "httpStatus", + type: { + name: "String" + } + }, + errorCode: { + serializedName: "errorCode", + type: { + name: "String" + } + }, + errorMessage: { + serializedName: "errorMessage", + type: { + name: "String" + } + } + } + } +}; + +export const PolicyDefinition: msRest.CompositeMapper = { + serializedName: "PolicyDefinition", + type: { + name: "Composite", + className: "PolicyDefinition", + modelProperties: { + policyType: { + serializedName: "properties.policyType", + type: { + name: "String" + } + }, + mode: { + serializedName: "properties.mode", + type: { + name: "String" + } + }, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String" + } + }, + description: { + serializedName: "properties.description", + type: { + name: "String" + } + }, + policyRule: { + serializedName: "properties.policyRule", + type: { + name: "Object" + } + }, + metadata: { + serializedName: "properties.metadata", + type: { + name: "Object" + } + }, + parameters: { + serializedName: "properties.parameters", + type: { + name: "Object" + } + }, + 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 PolicyDefinitionReference: msRest.CompositeMapper = { + serializedName: "PolicyDefinitionReference", + type: { + name: "Composite", + className: "PolicyDefinitionReference", + modelProperties: { + policyDefinitionId: { + serializedName: "policyDefinitionId", + type: { + name: "String" + } + }, + parameters: { + serializedName: "parameters", + type: { + name: "Object" + } + } + } + } +}; + +export const PolicySetDefinition: msRest.CompositeMapper = { + serializedName: "PolicySetDefinition", + type: { + name: "Composite", + className: "PolicySetDefinition", + modelProperties: { + policyType: { + serializedName: "properties.policyType", + type: { + name: "String" + } + }, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String" + } + }, + description: { + serializedName: "properties.description", + type: { + name: "String" + } + }, + metadata: { + serializedName: "properties.metadata", + type: { + name: "Object" + } + }, + parameters: { + serializedName: "properties.parameters", + type: { + name: "Object" + } + }, + policyDefinitions: { + required: true, + serializedName: "properties.policyDefinitions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicyDefinitionReference" + } + } + } + }, + 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 PolicyAssignmentListResult: msRest.CompositeMapper = { + serializedName: "PolicyAssignmentListResult", + type: { + name: "Composite", + className: "PolicyAssignmentListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicyAssignment" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const PolicyDefinitionListResult: msRest.CompositeMapper = { + serializedName: "PolicyDefinitionListResult", + type: { + name: "Composite", + className: "PolicyDefinitionListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicyDefinition" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const PolicySetDefinitionListResult: msRest.CompositeMapper = { + serializedName: "PolicySetDefinitionListResult", + type: { + name: "Composite", + className: "PolicySetDefinitionListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicySetDefinition" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/packages/@azure/arm-policy/lib/models/parameters.ts b/packages/@azure/arm-policy/lib/models/parameters.ts new file mode 100644 index 000000000000..7ee58c29062a --- /dev/null +++ b/packages/@azure/arm-policy/lib/models/parameters.ts @@ -0,0 +1,197 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; + +export const acceptLanguage: msRest.OperationParameter = { + parameterPath: "acceptLanguage", + mapper: { + serializedName: "accept-language", + defaultValue: 'en-US', + type: { + name: "String" + } + } +}; +export const apiVersion: msRest.OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + required: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; +export const filter0: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "filter" + ], + mapper: { + serializedName: "$filter", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const filter1: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "filter" + ], + mapper: { + serializedName: "$filter", + type: { + name: "String" + } + } +}; +export const managementGroupId: msRest.OperationURLParameter = { + parameterPath: "managementGroupId", + mapper: { + required: true, + serializedName: "managementGroupId", + type: { + name: "String" + } + } +}; +export const nextPageLink: msRest.OperationURLParameter = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const parentResourcePath: msRest.OperationURLParameter = { + parameterPath: "parentResourcePath", + mapper: { + required: true, + serializedName: "parentResourcePath", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const policyAssignmentId: msRest.OperationURLParameter = { + parameterPath: "policyAssignmentId", + mapper: { + required: true, + serializedName: "policyAssignmentId", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const policyAssignmentName: msRest.OperationURLParameter = { + parameterPath: "policyAssignmentName", + mapper: { + required: true, + serializedName: "policyAssignmentName", + type: { + name: "String" + } + } +}; +export const policyDefinitionName: msRest.OperationURLParameter = { + parameterPath: "policyDefinitionName", + mapper: { + required: true, + serializedName: "policyDefinitionName", + type: { + name: "String" + } + } +}; +export const policySetDefinitionName: msRest.OperationURLParameter = { + parameterPath: "policySetDefinitionName", + mapper: { + required: true, + serializedName: "policySetDefinitionName", + type: { + name: "String" + } + } +}; +export const resourceGroupName: msRest.OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + required: true, + serializedName: "resourceGroupName", + constraints: { + MaxLength: 90, + MinLength: 1, + Pattern: /^[-\w\._\(\)]+$/ + }, + type: { + name: "String" + } + } +}; +export const resourceName: msRest.OperationURLParameter = { + parameterPath: "resourceName", + mapper: { + required: true, + serializedName: "resourceName", + type: { + name: "String" + } + } +}; +export const resourceProviderNamespace: msRest.OperationURLParameter = { + parameterPath: "resourceProviderNamespace", + mapper: { + required: true, + serializedName: "resourceProviderNamespace", + type: { + name: "String" + } + } +}; +export const resourceType: msRest.OperationURLParameter = { + parameterPath: "resourceType", + mapper: { + required: true, + serializedName: "resourceType", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const scope: msRest.OperationURLParameter = { + parameterPath: "scope", + mapper: { + required: true, + serializedName: "scope", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const subscriptionId: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + type: { + name: "String" + } + } +}; diff --git a/packages/@azure/arm-policy/lib/models/policyAssignmentsMappers.ts b/packages/@azure/arm-policy/lib/models/policyAssignmentsMappers.ts new file mode 100644 index 000000000000..f07616534449 --- /dev/null +++ b/packages/@azure/arm-policy/lib/models/policyAssignmentsMappers.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + PolicyAssignment, + BaseResource, + PolicySku, + Identity, + ErrorResponse, + PolicyAssignmentListResult, + PolicyDefinition, + PolicySetDefinition, + PolicyDefinitionReference +} from "../models/mappers"; + diff --git a/packages/@azure/arm-policy/lib/models/policyDefinitionsMappers.ts b/packages/@azure/arm-policy/lib/models/policyDefinitionsMappers.ts new file mode 100644 index 000000000000..0c55039e555a --- /dev/null +++ b/packages/@azure/arm-policy/lib/models/policyDefinitionsMappers.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + PolicyDefinition, + BaseResource, + CloudError, + PolicyDefinitionListResult, + PolicyAssignment, + PolicySku, + Identity, + PolicySetDefinition, + PolicyDefinitionReference +} from "../models/mappers"; + diff --git a/packages/@azure/arm-policy/lib/models/policySetDefinitionsMappers.ts b/packages/@azure/arm-policy/lib/models/policySetDefinitionsMappers.ts new file mode 100644 index 000000000000..aae40e44bd82 --- /dev/null +++ b/packages/@azure/arm-policy/lib/models/policySetDefinitionsMappers.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + PolicySetDefinition, + BaseResource, + PolicyDefinitionReference, + ErrorResponse, + PolicySetDefinitionListResult, + PolicyAssignment, + PolicySku, + Identity, + PolicyDefinition +} from "../models/mappers"; + diff --git a/packages/@azure/arm-policy/lib/operations/index.ts b/packages/@azure/arm-policy/lib/operations/index.ts new file mode 100644 index 000000000000..8fab2c121e51 --- /dev/null +++ b/packages/@azure/arm-policy/lib/operations/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export * from "./policyAssignments"; +export * from "./policyDefinitions"; +export * from "./policySetDefinitions"; diff --git a/packages/@azure/arm-policy/lib/operations/policyAssignments.ts b/packages/@azure/arm-policy/lib/operations/policyAssignments.ts new file mode 100644 index 000000000000..a0c02b06ba20 --- /dev/null +++ b/packages/@azure/arm-policy/lib/operations/policyAssignments.ts @@ -0,0 +1,865 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/policyAssignmentsMappers"; +import * as Parameters from "../models/parameters"; +import { PolicyClientContext } from "../policyClientContext"; + +/** Class representing a PolicyAssignments. */ +export class PolicyAssignments { + private readonly client: PolicyClientContext; + + /** + * Create a PolicyAssignments. + * @param {PolicyClientContext} client Reference to the service client. + */ + constructor(client: PolicyClientContext) { + this.client = client; + } + + /** + * This operation deletes a policy assignment, given its name and the scope it was created in. The + * scope of a policy assignment is the part of its ID preceding + * '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @summary Deletes a policy assignment. + * @param scope The scope of the policy assignment. Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * @param policyAssignmentName The name of the policy assignment to delete. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(scope: string, policyAssignmentName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param scope The scope of the policy assignment. Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * @param policyAssignmentName The name of the policy assignment to delete. + * @param callback The callback + */ + deleteMethod(scope: string, policyAssignmentName: string, callback: msRest.ServiceCallback): void; + /** + * @param scope The scope of the policy assignment. Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * @param policyAssignmentName The name of the policy assignment to delete. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(scope: string, policyAssignmentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(scope: string, policyAssignmentName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + scope, + policyAssignmentName, + options + }, + deleteMethodOperationSpec, + callback) as Promise; + } + + /** + * This operation creates or updates a policy assignment with the given scope and name. Policy + * assignments apply to all resources contained within their scope. For example, when you assign a + * policy at resource group scope, that policy applies to all resources in the group. + * @summary Creates or updates a policy assignment. + * @param scope The scope of the policy assignment. Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * @param policyAssignmentName The name of the policy assignment. + * @param parameters Parameters for the policy assignment. + * @param [options] The optional parameters + * @returns Promise + */ + create(scope: string, policyAssignmentName: string, parameters: Models.PolicyAssignment, options?: msRest.RequestOptionsBase): Promise; + /** + * @param scope The scope of the policy assignment. Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * @param policyAssignmentName The name of the policy assignment. + * @param parameters Parameters for the policy assignment. + * @param callback The callback + */ + create(scope: string, policyAssignmentName: string, parameters: Models.PolicyAssignment, callback: msRest.ServiceCallback): void; + /** + * @param scope The scope of the policy assignment. Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * @param policyAssignmentName The name of the policy assignment. + * @param parameters Parameters for the policy assignment. + * @param options The optional parameters + * @param callback The callback + */ + create(scope: string, policyAssignmentName: string, parameters: Models.PolicyAssignment, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + create(scope: string, policyAssignmentName: string, parameters: Models.PolicyAssignment, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + scope, + policyAssignmentName, + parameters, + options + }, + createOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves a single policy assignment, given its name and the scope it was created + * at. + * @summary Retrieves a policy assignment. + * @param scope The scope of the policy assignment. Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * @param policyAssignmentName The name of the policy assignment to get. + * @param [options] The optional parameters + * @returns Promise + */ + get(scope: string, policyAssignmentName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param scope The scope of the policy assignment. Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * @param policyAssignmentName The name of the policy assignment to get. + * @param callback The callback + */ + get(scope: string, policyAssignmentName: string, callback: msRest.ServiceCallback): void; + /** + * @param scope The scope of the policy assignment. Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * @param policyAssignmentName The name of the policy assignment to get. + * @param options The optional parameters + * @param callback The callback + */ + get(scope: string, policyAssignmentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(scope: string, policyAssignmentName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + scope, + policyAssignmentName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves the list of all policy assignments associated with the given resource + * group in the given subscription that match the optional given $filter. Valid values for $filter + * are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the + * unfiltered list includes all policy assignments associated with the resource group, including + * those that apply directly or apply from containing scopes, as well as any applied to resources + * contained within the resource group. If $filter=atScope() is provided, the returned list + * includes all policy assignments that apply to the resource group, which is everything in the + * unfiltered list except those applied to resources contained within the resource group. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy + * assignments that apply to the resource group and assign the policy definition whose id is + * {value}. + * @summary Retrieves all policy assignments that apply to a resource group. + * @param resourceGroupName The name of the resource group that contains policy assignments. + * @param [options] The optional parameters + * @returns Promise + */ + listForResourceGroup(resourceGroupName: string, options?: Models.PolicyAssignmentsListForResourceGroupOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group that contains policy assignments. + * @param callback The callback + */ + listForResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains policy assignments. + * @param options The optional parameters + * @param callback The callback + */ + listForResourceGroup(resourceGroupName: string, options: Models.PolicyAssignmentsListForResourceGroupOptionalParams, callback: msRest.ServiceCallback): void; + listForResourceGroup(resourceGroupName: string, options?: Models.PolicyAssignmentsListForResourceGroupOptionalParams, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + options + }, + listForResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves the list of all policy assignments associated with the specified + * resource in the given resource group and subscription that match the optional given $filter. + * Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is + * not provided, the unfiltered list includes all policy assignments associated with the resource, + * including those that apply directly or from all containing scopes, as well as any applied to + * resources contained within the resource. If $filter=atScope() is provided, the returned list + * includes all policy assignments that apply to the resource, which is everything in the + * unfiltered list except those applied to resources contained within the resource. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy + * assignments that apply to the resource and assign the policy definition whose id is {value}. + * Three parameters plus the resource name are used to identify a specific resource. If the + * resource is not part of a parent resource (the more common case), the parent resource path + * should not be provided (or provided as ''). For example a web app could be specified as + * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == + * 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all + * parameters should be provided. For example a virtual machine DNS name could be specified as + * ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == + * 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', {resourceName} == + * 'MyComputerName'). A convenient alternative to providing the namespace and type name separately + * is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', + * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == + * 'MyWebApp'). + * @summary Retrieves all policy assignments that apply to a resource. + * @param resourceGroupName The name of the resource group containing the resource. + * @param resourceProviderNamespace The namespace of the resource provider. For example, the + * namespace of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) + * @param parentResourcePath The parent resource path. Use empty string if there is none. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' + * (from Microsoft.Web/sites). + * @param resourceName The name of the resource. + * @param [options] The optional parameters + * @returns Promise + */ + listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: Models.PolicyAssignmentsListForResourceOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group containing the resource. + * @param resourceProviderNamespace The namespace of the resource provider. For example, the + * namespace of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) + * @param parentResourcePath The parent resource path. Use empty string if there is none. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' + * (from Microsoft.Web/sites). + * @param resourceName The name of the resource. + * @param callback The callback + */ + listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group containing the resource. + * @param resourceProviderNamespace The namespace of the resource provider. For example, the + * namespace of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) + * @param parentResourcePath The parent resource path. Use empty string if there is none. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' + * (from Microsoft.Web/sites). + * @param resourceName The name of the resource. + * @param options The optional parameters + * @param callback The callback + */ + listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options: Models.PolicyAssignmentsListForResourceOptionalParams, callback: msRest.ServiceCallback): void; + listForResource(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: Models.PolicyAssignmentsListForResourceOptionalParams, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + options + }, + listForResourceOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves the list of all policy assignments associated with the given + * subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or + * 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all + * policy assignments associated with the subscription, including those that apply directly or from + * management groups that contain the given subscription, as well as any applied to objects + * contained within the subscription. If $filter=atScope() is provided, the returned list includes + * all policy assignments that apply to the subscription, which is everything in the unfiltered + * list except those applied to objects contained within the subscription. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy + * assignments that apply to the subscription and assign the policy definition whose id is {value}. + * @summary Retrieves all policy assignments that apply to a subscription. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: Models.PolicyAssignmentsListOptionalParams): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: Models.PolicyAssignmentsListOptionalParams, callback: msRest.ServiceCallback): void; + list(options?: Models.PolicyAssignmentsListOptionalParams, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * This operation deletes the policy with the given ID. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid + * formats for {scope} are: '/providers/Microsoft.Management/managementGroups/{managementGroup}' + * (management group), '/subscriptions/{subscriptionId}' (subscription), + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' (resource group), or + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * (resource). + * @summary Deletes a policy assignment. + * @param policyAssignmentId The ID of the policy assignment to delete. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param [options] The optional parameters + * @returns Promise + */ + deleteById(policyAssignmentId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param policyAssignmentId The ID of the policy assignment to delete. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param callback The callback + */ + deleteById(policyAssignmentId: string, callback: msRest.ServiceCallback): void; + /** + * @param policyAssignmentId The ID of the policy assignment to delete. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param options The optional parameters + * @param callback The callback + */ + deleteById(policyAssignmentId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteById(policyAssignmentId: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + policyAssignmentId, + options + }, + deleteByIdOperationSpec, + callback) as Promise; + } + + /** + * This operation creates or updates the policy assignment with the given ID. Policy assignments + * made on a scope apply to all resources contained in that scope. For example, when you assign a + * policy to a resource group that policy applies to all resources in the group. Policy assignment + * IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid + * scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @summary Creates or updates a policy assignment. + * @param policyAssignmentId The ID of the policy assignment to create. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param parameters Parameters for policy assignment. + * @param [options] The optional parameters + * @returns Promise + */ + createById(policyAssignmentId: string, parameters: Models.PolicyAssignment, options?: msRest.RequestOptionsBase): Promise; + /** + * @param policyAssignmentId The ID of the policy assignment to create. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param parameters Parameters for policy assignment. + * @param callback The callback + */ + createById(policyAssignmentId: string, parameters: Models.PolicyAssignment, callback: msRest.ServiceCallback): void; + /** + * @param policyAssignmentId The ID of the policy assignment to create. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param parameters Parameters for policy assignment. + * @param options The optional parameters + * @param callback The callback + */ + createById(policyAssignmentId: string, parameters: Models.PolicyAssignment, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createById(policyAssignmentId: string, parameters: Models.PolicyAssignment, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + policyAssignmentId, + parameters, + options + }, + createByIdOperationSpec, + callback) as Promise; + } + + /** + * The operation retrieves the policy assignment with the given ID. Policy assignment IDs have this + * format: '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * Valid scopes are: management group (format: + * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @summary Retrieves the policy assignment with the given ID. + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param [options] The optional parameters + * @returns Promise + */ + getById(policyAssignmentId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param callback The callback + */ + getById(policyAssignmentId: string, callback: msRest.ServiceCallback): void; + /** + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param options The optional parameters + * @param callback The callback + */ + getById(policyAssignmentId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getById(policyAssignmentId: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + policyAssignmentId, + options + }, + getByIdOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves the list of all policy assignments associated with the given resource + * group in the given subscription that match the optional given $filter. Valid values for $filter + * are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the + * unfiltered list includes all policy assignments associated with the resource group, including + * those that apply directly or apply from containing scopes, as well as any applied to resources + * contained within the resource group. If $filter=atScope() is provided, the returned list + * includes all policy assignments that apply to the resource group, which is everything in the + * unfiltered list except those applied to resources contained within the resource group. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy + * assignments that apply to the resource group and assign the policy definition whose id is + * {value}. + * @summary Retrieves all policy assignments that apply to a resource group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listForResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listForResourceGroupNext(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 + */ + listForResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listForResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listForResourceGroupNextOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves the list of all policy assignments associated with the specified + * resource in the given resource group and subscription that match the optional given $filter. + * Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is + * not provided, the unfiltered list includes all policy assignments associated with the resource, + * including those that apply directly or from all containing scopes, as well as any applied to + * resources contained within the resource. If $filter=atScope() is provided, the returned list + * includes all policy assignments that apply to the resource, which is everything in the + * unfiltered list except those applied to resources contained within the resource. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy + * assignments that apply to the resource and assign the policy definition whose id is {value}. + * Three parameters plus the resource name are used to identify a specific resource. If the + * resource is not part of a parent resource (the more common case), the parent resource path + * should not be provided (or provided as ''). For example a web app could be specified as + * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == + * 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all + * parameters should be provided. For example a virtual machine DNS name could be specified as + * ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == + * 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', {resourceName} == + * 'MyComputerName'). A convenient alternative to providing the namespace and type name separately + * is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', + * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == + * 'MyWebApp'). + * @summary Retrieves all policy assignments that apply to a resource. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listForResourceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listForResourceNext(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 + */ + listForResourceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listForResourceNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listForResourceNextOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves the list of all policy assignments associated with the given + * subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or + * 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all + * policy assignments associated with the subscription, including those that apply directly or from + * management groups that contain the given subscription, as well as any applied to objects + * contained within the subscription. If $filter=atScope() is provided, the returned list includes + * all policy assignments that apply to the subscription, which is everything in the unfiltered + * list except those applied to objects contained within the subscription. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy + * assignments that apply to the subscription and assign the policy definition whose id is {value}. + * @summary Retrieves all policy assignments that apply to a subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(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 + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", + urlParameters: [ + Parameters.scope, + Parameters.policyAssignmentName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyAssignment + }, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const createOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", + urlParameters: [ + Parameters.scope, + Parameters.policyAssignmentName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.PolicyAssignment, + required: true + } + }, + responses: { + 201: { + bodyMapper: Mappers.PolicyAssignment + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", + urlParameters: [ + Parameters.scope, + Parameters.policyAssignmentName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyAssignment + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listForResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/policyAssignments", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.filter0, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyAssignmentListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listForResourceOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/policyAssignments", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.resourceProviderNamespace, + Parameters.parentResourcePath, + Parameters.resourceType, + Parameters.resourceName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.filter1, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyAssignmentListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyAssignments", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.filter1, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyAssignmentListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const deleteByIdOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "{policyAssignmentId}", + urlParameters: [ + Parameters.policyAssignmentId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyAssignment + }, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const createByIdOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "{policyAssignmentId}", + urlParameters: [ + Parameters.policyAssignmentId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.PolicyAssignment, + required: true + } + }, + responses: { + 201: { + bodyMapper: Mappers.PolicyAssignment + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getByIdOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "{policyAssignmentId}", + urlParameters: [ + Parameters.policyAssignmentId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyAssignment + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listForResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyAssignmentListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listForResourceNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyAssignmentListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyAssignmentListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/packages/@azure/arm-policy/lib/operations/policyDefinitions.ts b/packages/@azure/arm-policy/lib/operations/policyDefinitions.ts new file mode 100644 index 000000000000..bf56971cd31f --- /dev/null +++ b/packages/@azure/arm-policy/lib/operations/policyDefinitions.ts @@ -0,0 +1,730 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/policyDefinitionsMappers"; +import * as Parameters from "../models/parameters"; +import { PolicyClientContext } from "../policyClientContext"; + +/** Class representing a PolicyDefinitions. */ +export class PolicyDefinitions { + private readonly client: PolicyClientContext; + + /** + * Create a PolicyDefinitions. + * @param {PolicyClientContext} client Reference to the service client. + */ + constructor(client: PolicyClientContext) { + this.client = client; + } + + /** + * This operation creates or updates a policy definition in the given subscription with the given + * name. + * @summary Creates or updates a policy definition in a subscription. + * @param policyDefinitionName The name of the policy definition to create. + * @param parameters The policy definition properties. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(policyDefinitionName: string, parameters: Models.PolicyDefinition, options?: msRest.RequestOptionsBase): Promise; + /** + * @param policyDefinitionName The name of the policy definition to create. + * @param parameters The policy definition properties. + * @param callback The callback + */ + createOrUpdate(policyDefinitionName: string, parameters: Models.PolicyDefinition, callback: msRest.ServiceCallback): void; + /** + * @param policyDefinitionName The name of the policy definition to create. + * @param parameters The policy definition properties. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(policyDefinitionName: string, parameters: Models.PolicyDefinition, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(policyDefinitionName: string, parameters: Models.PolicyDefinition, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + policyDefinitionName, + parameters, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * This operation deletes the policy definition in the given subscription with the given name. + * @summary Deletes a policy definition in a subscription. + * @param policyDefinitionName The name of the policy definition to delete. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(policyDefinitionName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param policyDefinitionName The name of the policy definition to delete. + * @param callback The callback + */ + deleteMethod(policyDefinitionName: string, callback: msRest.ServiceCallback): void; + /** + * @param policyDefinitionName The name of the policy definition to delete. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(policyDefinitionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(policyDefinitionName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + policyDefinitionName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * This operation retrieves the policy definition in the given subscription with the given name. + * @summary Retrieves a policy definition in a subscription. + * @param policyDefinitionName The name of the policy definition to get. + * @param [options] The optional parameters + * @returns Promise + */ + get(policyDefinitionName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param policyDefinitionName The name of the policy definition to get. + * @param callback The callback + */ + get(policyDefinitionName: string, callback: msRest.ServiceCallback): void; + /** + * @param policyDefinitionName The name of the policy definition to get. + * @param options The optional parameters + * @param callback The callback + */ + get(policyDefinitionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(policyDefinitionName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + policyDefinitionName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves the built-in policy definition with the given name. + * @summary Retrieves a built-in policy definition. + * @param policyDefinitionName The name of the built-in policy definition to get. + * @param [options] The optional parameters + * @returns Promise + */ + getBuiltIn(policyDefinitionName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param policyDefinitionName The name of the built-in policy definition to get. + * @param callback The callback + */ + getBuiltIn(policyDefinitionName: string, callback: msRest.ServiceCallback): void; + /** + * @param policyDefinitionName The name of the built-in policy definition to get. + * @param options The optional parameters + * @param callback The callback + */ + getBuiltIn(policyDefinitionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getBuiltIn(policyDefinitionName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + policyDefinitionName, + options + }, + getBuiltInOperationSpec, + callback) as Promise; + } + + /** + * This operation creates or updates a policy definition in the given management group with the + * given name. + * @summary Creates or updates a policy definition in a management group. + * @param policyDefinitionName The name of the policy definition to create. + * @param parameters The policy definition properties. + * @param managementGroupId The ID of the management group. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateAtManagementGroup(policyDefinitionName: string, parameters: Models.PolicyDefinition, managementGroupId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param policyDefinitionName The name of the policy definition to create. + * @param parameters The policy definition properties. + * @param managementGroupId The ID of the management group. + * @param callback The callback + */ + createOrUpdateAtManagementGroup(policyDefinitionName: string, parameters: Models.PolicyDefinition, managementGroupId: string, callback: msRest.ServiceCallback): void; + /** + * @param policyDefinitionName The name of the policy definition to create. + * @param parameters The policy definition properties. + * @param managementGroupId The ID of the management group. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdateAtManagementGroup(policyDefinitionName: string, parameters: Models.PolicyDefinition, managementGroupId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateAtManagementGroup(policyDefinitionName: string, parameters: Models.PolicyDefinition, managementGroupId: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + policyDefinitionName, + parameters, + managementGroupId, + options + }, + createOrUpdateAtManagementGroupOperationSpec, + callback) as Promise; + } + + /** + * This operation deletes the policy definition in the given management group with the given name. + * @summary Deletes a policy definition in a management group. + * @param policyDefinitionName The name of the policy definition to delete. + * @param managementGroupId The ID of the management group. + * @param [options] The optional parameters + * @returns Promise + */ + deleteAtManagementGroup(policyDefinitionName: string, managementGroupId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param policyDefinitionName The name of the policy definition to delete. + * @param managementGroupId The ID of the management group. + * @param callback The callback + */ + deleteAtManagementGroup(policyDefinitionName: string, managementGroupId: string, callback: msRest.ServiceCallback): void; + /** + * @param policyDefinitionName The name of the policy definition to delete. + * @param managementGroupId The ID of the management group. + * @param options The optional parameters + * @param callback The callback + */ + deleteAtManagementGroup(policyDefinitionName: string, managementGroupId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteAtManagementGroup(policyDefinitionName: string, managementGroupId: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + policyDefinitionName, + managementGroupId, + options + }, + deleteAtManagementGroupOperationSpec, + callback); + } + + /** + * This operation retrieves the policy definition in the given management group with the given + * name. + * @summary Retrieve a policy definition in a management group. + * @param policyDefinitionName The name of the policy definition to get. + * @param managementGroupId The ID of the management group. + * @param [options] The optional parameters + * @returns Promise + */ + getAtManagementGroup(policyDefinitionName: string, managementGroupId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param policyDefinitionName The name of the policy definition to get. + * @param managementGroupId The ID of the management group. + * @param callback The callback + */ + getAtManagementGroup(policyDefinitionName: string, managementGroupId: string, callback: msRest.ServiceCallback): void; + /** + * @param policyDefinitionName The name of the policy definition to get. + * @param managementGroupId The ID of the management group. + * @param options The optional parameters + * @param callback The callback + */ + getAtManagementGroup(policyDefinitionName: string, managementGroupId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getAtManagementGroup(policyDefinitionName: string, managementGroupId: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + policyDefinitionName, + managementGroupId, + options + }, + getAtManagementGroupOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves a list of all the policy definitions in a given subscription. + * @summary Retrieves policy definitions in a subscription + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves a list of all the built-in policy definitions. + * @summary Retrieve built-in policy definitions + * @param [options] The optional parameters + * @returns Promise + */ + listBuiltIn(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + listBuiltIn(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listBuiltIn(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBuiltIn(options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listBuiltInOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves a list of all the policy definitions in a given management group. + * @summary Retrieve policy definitions in a management group + * @param managementGroupId The ID of the management group. + * @param [options] The optional parameters + * @returns Promise + */ + listByManagementGroup(managementGroupId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param managementGroupId The ID of the management group. + * @param callback The callback + */ + listByManagementGroup(managementGroupId: string, callback: msRest.ServiceCallback): void; + /** + * @param managementGroupId The ID of the management group. + * @param options The optional parameters + * @param callback The callback + */ + listByManagementGroup(managementGroupId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByManagementGroup(managementGroupId: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + managementGroupId, + options + }, + listByManagementGroupOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves a list of all the policy definitions in a given subscription. + * @summary Retrieves policy definitions in a subscription + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(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 + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves a list of all the built-in policy definitions. + * @summary Retrieve built-in policy definitions + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listBuiltInNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listBuiltInNext(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 + */ + listBuiltInNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBuiltInNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listBuiltInNextOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves a list of all the policy definitions in a given management group. + * @summary Retrieve policy definitions in a management group + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByManagementGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByManagementGroupNext(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 + */ + listByManagementGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByManagementGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByManagementGroupNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + urlParameters: [ + Parameters.policyDefinitionName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.PolicyDefinition, + required: true + } + }, + responses: { + 201: { + bodyMapper: Mappers.PolicyDefinition + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + urlParameters: [ + Parameters.policyDefinitionName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + urlParameters: [ + Parameters.policyDefinitionName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinition + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getBuiltInOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + urlParameters: [ + Parameters.policyDefinitionName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinition + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const createOrUpdateAtManagementGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + urlParameters: [ + Parameters.policyDefinitionName, + Parameters.managementGroupId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.PolicyDefinition, + required: true + } + }, + responses: { + 201: { + bodyMapper: Mappers.PolicyDefinition + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteAtManagementGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + urlParameters: [ + Parameters.policyDefinitionName, + Parameters.managementGroupId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getAtManagementGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", + urlParameters: [ + Parameters.policyDefinitionName, + Parameters.managementGroupId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinition + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listBuiltInOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Authorization/policyDefinitions", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByManagementGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions", + urlParameters: [ + Parameters.managementGroupId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listBuiltInNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByManagementGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicyDefinitionListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/@azure/arm-policy/lib/operations/policySetDefinitions.ts b/packages/@azure/arm-policy/lib/operations/policySetDefinitions.ts new file mode 100644 index 000000000000..31ed021986e4 --- /dev/null +++ b/packages/@azure/arm-policy/lib/operations/policySetDefinitions.ts @@ -0,0 +1,740 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/policySetDefinitionsMappers"; +import * as Parameters from "../models/parameters"; +import { PolicyClientContext } from "../policyClientContext"; + +/** Class representing a PolicySetDefinitions. */ +export class PolicySetDefinitions { + private readonly client: PolicyClientContext; + + /** + * Create a PolicySetDefinitions. + * @param {PolicyClientContext} client Reference to the service client. + */ + constructor(client: PolicyClientContext) { + this.client = client; + } + + /** + * This operation creates or updates a policy set definition in the given subscription with the + * given name. + * @summary Creates or updates a policy set definition. + * @param policySetDefinitionName The name of the policy set definition to create. + * @param parameters The policy set definition properties. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(policySetDefinitionName: string, parameters: Models.PolicySetDefinition, options?: msRest.RequestOptionsBase): Promise; + /** + * @param policySetDefinitionName The name of the policy set definition to create. + * @param parameters The policy set definition properties. + * @param callback The callback + */ + createOrUpdate(policySetDefinitionName: string, parameters: Models.PolicySetDefinition, callback: msRest.ServiceCallback): void; + /** + * @param policySetDefinitionName The name of the policy set definition to create. + * @param parameters The policy set definition properties. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(policySetDefinitionName: string, parameters: Models.PolicySetDefinition, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(policySetDefinitionName: string, parameters: Models.PolicySetDefinition, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + policySetDefinitionName, + parameters, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * This operation deletes the policy set definition in the given subscription with the given name. + * @summary Deletes a policy set definition. + * @param policySetDefinitionName The name of the policy set definition to delete. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(policySetDefinitionName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param policySetDefinitionName The name of the policy set definition to delete. + * @param callback The callback + */ + deleteMethod(policySetDefinitionName: string, callback: msRest.ServiceCallback): void; + /** + * @param policySetDefinitionName The name of the policy set definition to delete. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(policySetDefinitionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(policySetDefinitionName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + policySetDefinitionName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * This operation retrieves the policy set definition in the given subscription with the given + * name. + * @summary Retrieves a policy set definition. + * @param policySetDefinitionName The name of the policy set definition to get. + * @param [options] The optional parameters + * @returns Promise + */ + get(policySetDefinitionName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param policySetDefinitionName The name of the policy set definition to get. + * @param callback The callback + */ + get(policySetDefinitionName: string, callback: msRest.ServiceCallback): void; + /** + * @param policySetDefinitionName The name of the policy set definition to get. + * @param options The optional parameters + * @param callback The callback + */ + get(policySetDefinitionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(policySetDefinitionName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + policySetDefinitionName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves the built-in policy set definition with the given name. + * @summary Retrieves a built in policy set definition. + * @param policySetDefinitionName The name of the policy set definition to get. + * @param [options] The optional parameters + * @returns Promise + */ + getBuiltIn(policySetDefinitionName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param policySetDefinitionName The name of the policy set definition to get. + * @param callback The callback + */ + getBuiltIn(policySetDefinitionName: string, callback: msRest.ServiceCallback): void; + /** + * @param policySetDefinitionName The name of the policy set definition to get. + * @param options The optional parameters + * @param callback The callback + */ + getBuiltIn(policySetDefinitionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getBuiltIn(policySetDefinitionName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + policySetDefinitionName, + options + }, + getBuiltInOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves a list of all the policy set definitions in the given subscription. + * @summary Retrieves the policy set definitions for a subscription. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves a list of all the built-in policy set definitions. + * @summary Retrieves built-in policy set definitions. + * @param [options] The optional parameters + * @returns Promise + */ + listBuiltIn(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + listBuiltIn(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listBuiltIn(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBuiltIn(options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listBuiltInOperationSpec, + callback) as Promise; + } + + /** + * This operation creates or updates a policy set definition in the given management group with the + * given name. + * @summary Creates or updates a policy set definition. + * @param policySetDefinitionName The name of the policy set definition to create. + * @param parameters The policy set definition properties. + * @param managementGroupId The ID of the management group. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateAtManagementGroup(policySetDefinitionName: string, parameters: Models.PolicySetDefinition, managementGroupId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param policySetDefinitionName The name of the policy set definition to create. + * @param parameters The policy set definition properties. + * @param managementGroupId The ID of the management group. + * @param callback The callback + */ + createOrUpdateAtManagementGroup(policySetDefinitionName: string, parameters: Models.PolicySetDefinition, managementGroupId: string, callback: msRest.ServiceCallback): void; + /** + * @param policySetDefinitionName The name of the policy set definition to create. + * @param parameters The policy set definition properties. + * @param managementGroupId The ID of the management group. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdateAtManagementGroup(policySetDefinitionName: string, parameters: Models.PolicySetDefinition, managementGroupId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateAtManagementGroup(policySetDefinitionName: string, parameters: Models.PolicySetDefinition, managementGroupId: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + policySetDefinitionName, + parameters, + managementGroupId, + options + }, + createOrUpdateAtManagementGroupOperationSpec, + callback) as Promise; + } + + /** + * This operation deletes the policy set definition in the given management group with the given + * name. + * @summary Deletes a policy set definition. + * @param policySetDefinitionName The name of the policy set definition to delete. + * @param managementGroupId The ID of the management group. + * @param [options] The optional parameters + * @returns Promise + */ + deleteAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param policySetDefinitionName The name of the policy set definition to delete. + * @param managementGroupId The ID of the management group. + * @param callback The callback + */ + deleteAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, callback: msRest.ServiceCallback): void; + /** + * @param policySetDefinitionName The name of the policy set definition to delete. + * @param managementGroupId The ID of the management group. + * @param options The optional parameters + * @param callback The callback + */ + deleteAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + policySetDefinitionName, + managementGroupId, + options + }, + deleteAtManagementGroupOperationSpec, + callback); + } + + /** + * This operation retrieves the policy set definition in the given management group with the given + * name. + * @summary Retrieves a policy set definition. + * @param policySetDefinitionName The name of the policy set definition to get. + * @param managementGroupId The ID of the management group. + * @param [options] The optional parameters + * @returns Promise + */ + getAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param policySetDefinitionName The name of the policy set definition to get. + * @param managementGroupId The ID of the management group. + * @param callback The callback + */ + getAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, callback: msRest.ServiceCallback): void; + /** + * @param policySetDefinitionName The name of the policy set definition to get. + * @param managementGroupId The ID of the management group. + * @param options The optional parameters + * @param callback The callback + */ + getAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getAtManagementGroup(policySetDefinitionName: string, managementGroupId: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + policySetDefinitionName, + managementGroupId, + options + }, + getAtManagementGroupOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves a list of all the a policy set definition in the given management + * group. + * @summary Retrieves all policy set definitions in management group. + * @param managementGroupId The ID of the management group. + * @param [options] The optional parameters + * @returns Promise + */ + listByManagementGroup(managementGroupId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param managementGroupId The ID of the management group. + * @param callback The callback + */ + listByManagementGroup(managementGroupId: string, callback: msRest.ServiceCallback): void; + /** + * @param managementGroupId The ID of the management group. + * @param options The optional parameters + * @param callback The callback + */ + listByManagementGroup(managementGroupId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByManagementGroup(managementGroupId: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + managementGroupId, + options + }, + listByManagementGroupOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves a list of all the policy set definitions in the given subscription. + * @summary Retrieves the policy set definitions for a subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(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 + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves a list of all the built-in policy set definitions. + * @summary Retrieves built-in policy set definitions. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listBuiltInNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listBuiltInNext(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 + */ + listBuiltInNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBuiltInNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listBuiltInNextOperationSpec, + callback) as Promise; + } + + /** + * This operation retrieves a list of all the a policy set definition in the given management + * group. + * @summary Retrieves all policy set definitions in management group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByManagementGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByManagementGroupNext(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 + */ + listByManagementGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByManagementGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByManagementGroupNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + urlParameters: [ + Parameters.policySetDefinitionName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.PolicySetDefinition, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinition + }, + 201: { + bodyMapper: Mappers.PolicySetDefinition + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + urlParameters: [ + Parameters.policySetDefinitionName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + urlParameters: [ + Parameters.policySetDefinitionName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinition + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getBuiltInOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + urlParameters: [ + Parameters.policySetDefinitionName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinition + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listBuiltInOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Authorization/policySetDefinitions", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const createOrUpdateAtManagementGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + urlParameters: [ + Parameters.policySetDefinitionName, + Parameters.managementGroupId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.PolicySetDefinition, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinition + }, + 201: { + bodyMapper: Mappers.PolicySetDefinition + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const deleteAtManagementGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + urlParameters: [ + Parameters.policySetDefinitionName, + Parameters.managementGroupId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getAtManagementGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", + urlParameters: [ + Parameters.policySetDefinitionName, + Parameters.managementGroupId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinition + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByManagementGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions", + urlParameters: [ + Parameters.managementGroupId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listBuiltInNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByManagementGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PolicySetDefinitionListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/packages/@azure/arm-policy/lib/policyClient.ts b/packages/@azure/arm-policy/lib/policyClient.ts new file mode 100644 index 000000000000..f3c5f29b68c0 --- /dev/null +++ b/packages/@azure/arm-policy/lib/policyClient.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; +import * as Models from "./models"; +import * as Mappers from "./models/mappers"; +import * as operations from "./operations"; +import { PolicyClientContext } from "./policyClientContext"; + + +class PolicyClient extends PolicyClientContext { + // Operation groups + policyAssignments: operations.PolicyAssignments; + policyDefinitions: operations.PolicyDefinitions; + policySetDefinitions: operations.PolicySetDefinitions; + + /** + * Initializes a new instance of the PolicyClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId The ID of the target subscription. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.PolicyClientOptions) { + super(credentials, subscriptionId, options); + this.policyAssignments = new operations.PolicyAssignments(this); + this.policyDefinitions = new operations.PolicyDefinitions(this); + this.policySetDefinitions = new operations.PolicySetDefinitions(this); + } +} + +// Operation Specifications + +export { + PolicyClient, + PolicyClientContext, + Models as PolicyModels, + Mappers as PolicyMappers +}; +export * from "./operations"; diff --git a/packages/@azure/arm-policy/lib/policyClientContext.ts b/packages/@azure/arm-policy/lib/policyClientContext.ts new file mode 100644 index 000000000000..52d48f0b933c --- /dev/null +++ b/packages/@azure/arm-policy/lib/policyClientContext.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as Models from "./models"; +import * as msRest from "ms-rest-js"; +import * as msRestAzure from "ms-rest-azure-js"; + +const packageName = "@azure/arm-policy"; +const packageVersion = "1.0.0"; + +export class PolicyClientContext extends msRestAzure.AzureServiceClient { + + credentials: msRest.ServiceClientCredentials; + + subscriptionId: string; + + apiVersion: string; + + acceptLanguage: string; + + longRunningOperationRetryTimeout: number; + + /** + * Initializes a new instance of the PolicyClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId The ID of the target subscription. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.PolicyClientOptions) { + if (credentials == undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId == undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) { + options = {}; + } + super(credentials, options); + + this.apiVersion = '2018-05-01'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; + this.requestContentType = "application/json; charset=utf-8"; + this.credentials = credentials; + this.subscriptionId = subscriptionId; + + this.addUserAgentInfo(`${packageName}/${packageVersion}`); + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + } +} diff --git a/packages/@azure/arm-policy/package.json b/packages/@azure/arm-policy/package.json new file mode 100644 index 000000000000..0845ce7ad89b --- /dev/null +++ b/packages/@azure/arm-policy/package.json @@ -0,0 +1,42 @@ +{ + "name": "@azure/arm-policy", + "author": "Microsoft Corporation", + "description": "PolicyClient Library with typescript type definitions for node.js and browser.", + "version": "1.0.0", + "dependencies": { + "ms-rest-azure-js": "^1.0.166", + "ms-rest-js": "^1.0.439", + "tslib": "^1.9.3" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/arm-policy.js", + "module": "./esm/policyClient.js", + "types": "./esm/policyClient.d.ts", + "devDependencies": { + "typescript": "^3.1.1", + "rollup": "^0.66.2", + "rollup-plugin-node-resolve": "^3.4.0", + "uglify-js": "^3.4.9" + }, + "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/packages/@azure/arm-policy", + "repository": { + "type": "git", + "url": "https://github.com/azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/azure/azure-sdk-for-js/issues" + }, + "scripts": { + "build": "tsc && rollup -c rollup.config.js && npm run minify", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-policy.js.map'\" -o ./dist/arm-policy.min.js ./dist/arm-policy.js", + "prepare": "npm run build" + }, + "sideEffects": false +} diff --git a/packages/@azure/arm-policy/rollup.config.js b/packages/@azure/arm-policy/rollup.config.js new file mode 100644 index 000000000000..467cd2ad4d08 --- /dev/null +++ b/packages/@azure/arm-policy/rollup.config.js @@ -0,0 +1,31 @@ +import nodeResolve from "rollup-plugin-node-resolve"; +/** + * @type {import('rollup').RollupFileOptions} + */ +const config = { + input: './esm/policyClient.js', + external: ["ms-rest-js", "ms-rest-azure-js"], + output: { + file: "./dist/arm-policy.js", + format: "umd", + name: "Azure.ArmPolicy", + sourcemap: true, + globals: { + "ms-rest-js": "msRest", + "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. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */` + }, + plugins: [ + nodeResolve({ module: true }) + ] +}; +export default config; diff --git a/packages/@azure/arm-policy/tsconfig.json b/packages/@azure/arm-policy/tsconfig.json new file mode 100644 index 000000000000..f32d1664f320 --- /dev/null +++ b/packages/@azure/arm-policy/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es5", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": ["es6"], + "declaration": true, + "outDir": "./esm", + "importHelpers": true + }, + "include": ["./lib/**/*"], + "exclude": ["node_modules"] +} diff --git a/packages/@azure/arm-resources/.npmignore b/packages/@azure/arm-resources/.npmignore new file mode 100644 index 000000000000..a07a455ac10c --- /dev/null +++ b/packages/@azure/arm-resources/.npmignore @@ -0,0 +1,35 @@ +#git +.git +.gitignore +#gulp +gulpfile.js +#documentation +doc/ +docs/ +#dependencies +node_modules/ +#samples +sample/ +samples/ +#tests +test/ +tests/ +coverage/ +#tools and scripts +tools/ +scripts/ +#IDE settings +*.sln +.vscode/ +.idea +.editorconfig +.ntvs_analysis.* +#build tools +.travis.yml +.jenkins.yml +.codeclimate.yml +appveyor.yml +# Nuget packages # +.nuget/ +packages/ +packages.config diff --git a/packages/@azure/arm-resources/LICENSE.txt b/packages/@azure/arm-resources/LICENSE.txt new file mode 100644 index 000000000000..5431ba98b936 --- /dev/null +++ b/packages/@azure/arm-resources/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/@azure/arm-resources/README.md b/packages/@azure/arm-resources/README.md new file mode 100644 index 000000000000..4ba8ba72aa05 --- /dev/null +++ b/packages/@azure/arm-resources/README.md @@ -0,0 +1,77 @@ +# Azure ResourceManagementClient SDK for JavaScript +This package contains an isomorphic SDK for ResourceManagementClient. + +## Currently supported environments +- Node.js version 6.x.x or higher +- Browser JavaScript + +## How to Install +``` +npm install @azure/arm-resources +``` + + +## How to use + +### nodejs - Authentication, client creation and list operations as an example written in TypeScript. + +```ts +import * as msRest from "ms-rest-js"; +import * as msRestAzure from "ms-rest-azure-js"; +import * as msRestNodeAuth from "ms-rest-nodeauth"; +import { ResourceManagementClient, ResourceManagementModels, ResourceManagementMappers } from "@azure/arm-resources"; +const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; + +msRestNodeAuth.interactiveLogin().then((creds) => { + const client = new ResourceManagementClient(creds, subscriptionId); + client.operations.list().then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.error(err); +}); +``` + +### browser - Authentication, client creation and list operations as an example written in JavaScript. +See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. + +- index.html +```html + + + + @azure/arm-resources sample + + + + + + + + + +``` + +# Related projects + - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) diff --git a/packages/@azure/arm-resources/lib/models/deploymentOperationsMappers.ts b/packages/@azure/arm-resources/lib/models/deploymentOperationsMappers.ts new file mode 100644 index 000000000000..bfa149a16bef --- /dev/null +++ b/packages/@azure/arm-resources/lib/models/deploymentOperationsMappers.ts @@ -0,0 +1,19 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + DeploymentOperation, + DeploymentOperationProperties, + TargetResource, + HttpMessage, + CloudError, + DeploymentOperationsListResult +} from "../models/mappers"; + diff --git a/packages/@azure/arm-resources/lib/models/deploymentsMappers.ts b/packages/@azure/arm-resources/lib/models/deploymentsMappers.ts new file mode 100644 index 000000000000..5865f67f1c27 --- /dev/null +++ b/packages/@azure/arm-resources/lib/models/deploymentsMappers.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + CloudError, + Deployment, + DeploymentProperties, + TemplateLink, + ParametersLink, + DebugSetting, + OnErrorDeployment, + DeploymentExtended, + BaseResource, + DeploymentPropertiesExtended, + Provider, + ProviderResourceType, + AliasType, + AliasPathType, + Dependency, + BasicDependency, + OnErrorDeploymentExtended, + DeploymentValidateResult, + ResourceManagementErrorWithDetails, + DeploymentExportResult, + DeploymentListResult, + ResourceGroup, + ResourceGroupProperties, + TagValue, + TagCount, + Resource, + SubResource, + GenericResource, + Plan, + Sku, + Identity, + IdentityUserAssignedIdentitiesValue +} from "../models/mappers"; + diff --git a/packages/@azure/arm-resources/lib/models/index.ts b/packages/@azure/arm-resources/lib/models/index.ts new file mode 100644 index 000000000000..125cc7ba03a4 --- /dev/null +++ b/packages/@azure/arm-resources/lib/models/index.ts @@ -0,0 +1,2610 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import { BaseResource, CloudError, AzureServiceClientOptions } from "ms-rest-azure-js"; +import * as msRest from "ms-rest-js"; + +export { BaseResource, CloudError }; + + +/** + * @interface + * An interface representing DeploymentExtendedFilter. + * Deployment filter. + * + */ +export interface DeploymentExtendedFilter { + /** + * @member {string} [provisioningState] The provisioning state. + */ + provisioningState?: string; +} + +/** + * @interface + * An interface representing GenericResourceFilter. + * Resource filter. + * + */ +export interface GenericResourceFilter { + /** + * @member {string} [resourceType] The resource type. + */ + resourceType?: string; + /** + * @member {string} [tagname] The tag name. + */ + tagname?: string; + /** + * @member {string} [tagvalue] The tag value. + */ + tagvalue?: string; +} + +/** + * @interface + * An interface representing ResourceGroupFilter. + * Resource group filter. + * + */ +export interface ResourceGroupFilter { + /** + * @member {string} [tagName] The tag name. + */ + tagName?: string; + /** + * @member {string} [tagValue] The tag value. + */ + tagValue?: string; +} + +/** + * @interface + * An interface representing TemplateLink. + * Entity representing the reference to the template. + * + */ +export interface TemplateLink { + /** + * @member {string} uri The URI of the template to deploy. + */ + uri: string; + /** + * @member {string} [contentVersion] If included, must match the + * ContentVersion in the template. + */ + contentVersion?: string; +} + +/** + * @interface + * An interface representing ParametersLink. + * Entity representing the reference to the deployment paramaters. + * + */ +export interface ParametersLink { + /** + * @member {string} uri The URI of the parameters file. + */ + uri: string; + /** + * @member {string} [contentVersion] If included, must match the + * ContentVersion in the template. + */ + contentVersion?: string; +} + +/** + * @interface + * An interface representing DebugSetting. + */ +export interface DebugSetting { + /** + * @member {string} [detailLevel] Specifies the type of information to log + * for debugging. The permitted values are none, requestContent, + * responseContent, or both requestContent and responseContent separated by a + * comma. The default is none. When setting this value, carefully consider + * the type of information you are passing in during deployment. By logging + * information about the request or response, you could potentially expose + * sensitive data that is retrieved through the deployment operations. + */ + detailLevel?: string; +} + +/** + * @interface + * An interface representing OnErrorDeployment. + * Deployment on error behavior. + * + */ +export interface OnErrorDeployment { + /** + * @member {OnErrorDeploymentType} [type] The deployment on error behavior + * type. Possible values are LastSuccessful and SpecificDeployment. Possible + * values include: 'LastSuccessful', 'SpecificDeployment' + */ + type?: OnErrorDeploymentType; + /** + * @member {string} [deploymentName] The deployment to be used on error case. + */ + deploymentName?: string; +} + +/** + * @interface + * An interface representing DeploymentProperties. + * Deployment properties. + * + */ +export interface DeploymentProperties { + /** + * @member {any} [template] The template content. You use this element when + * you want to pass the template syntax directly in the request rather than + * link to an existing template. It can be a JObject or well-formed JSON + * string. Use either the templateLink property or the template property, but + * not both. + */ + template?: any; + /** + * @member {TemplateLink} [templateLink] The URI of the template. Use either + * the templateLink property or the template property, but not both. + */ + templateLink?: TemplateLink; + /** + * @member {any} [parameters] Name and value pairs that define the deployment + * parameters for the template. You use this element when you want to provide + * the parameter values directly in the request rather than link to an + * existing parameter file. Use either the parametersLink property or the + * parameters property, but not both. It can be a JObject or a well formed + * JSON string. + */ + parameters?: any; + /** + * @member {ParametersLink} [parametersLink] The URI of parameters file. You + * use this element to link to an existing parameters file. Use either the + * parametersLink property or the parameters property, but not both. + */ + parametersLink?: ParametersLink; + /** + * @member {DeploymentMode} mode The mode that is used to deploy resources. + * This value can be either Incremental or Complete. In Incremental mode, + * resources are deployed without deleting existing resources that are not + * included in the template. In Complete mode, resources are deployed and + * existing resources in the resource group that are not included in the + * template are deleted. Be careful when using Complete mode as you may + * unintentionally delete resources. Possible values include: 'Incremental', + * 'Complete' + */ + mode: DeploymentMode; + /** + * @member {DebugSetting} [debugSetting] The debug setting of the deployment. + */ + debugSetting?: DebugSetting; + /** + * @member {OnErrorDeployment} [onErrorDeployment] The deployment on error + * behavior. + */ + onErrorDeployment?: OnErrorDeployment; +} + +/** + * @interface + * An interface representing Deployment. + * Deployment operation parameters. + * + */ +export interface Deployment { + /** + * @member {string} [location] The location to store the deployment data. + */ + location?: string; + /** + * @member {DeploymentProperties} properties The deployment properties. + */ + properties: DeploymentProperties; +} + +/** + * @interface + * An interface representing DeploymentExportResult. + * The deployment export result. + * + */ +export interface DeploymentExportResult { + /** + * @member {any} [template] The template content. + */ + template?: any; +} + +/** + * @interface + * An interface representing ResourceManagementErrorWithDetails. + * The detailed error message of resource management. + * + */ +export interface ResourceManagementErrorWithDetails { + /** + * @member {string} [code] The error code returned when exporting the + * template. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly code?: string; + /** + * @member {string} [message] The error message describing the export error. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly message?: string; + /** + * @member {string} [target] The target of the error. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly target?: string; + /** + * @member {ResourceManagementErrorWithDetails[]} [details] Validation error. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly details?: ResourceManagementErrorWithDetails[]; +} + +/** + * @interface + * An interface representing AliasPathType. + * The type of the paths for alias. + * + */ +export interface AliasPathType { + /** + * @member {string} [path] The path of an alias. + */ + path?: string; + /** + * @member {string[]} [apiVersions] The API versions. + */ + apiVersions?: string[]; +} + +/** + * @interface + * An interface representing AliasType. + * The alias type. + * + */ +export interface AliasType { + /** + * @member {string} [name] The alias name. + */ + name?: string; + /** + * @member {AliasPathType[]} [paths] The paths for an alias. + */ + paths?: AliasPathType[]; +} + +/** + * @interface + * An interface representing ProviderResourceType. + * Resource type managed by the resource provider. + * + */ +export interface ProviderResourceType { + /** + * @member {string} [resourceType] The resource type. + */ + resourceType?: string; + /** + * @member {string[]} [locations] The collection of locations where this + * resource type can be created. + */ + locations?: string[]; + /** + * @member {AliasType[]} [aliases] The aliases that are supported by this + * resource type. + */ + aliases?: AliasType[]; + /** + * @member {string[]} [apiVersions] The API version. + */ + apiVersions?: string[]; + /** + * @member {{ [propertyName: string]: string }} [properties] The properties. + */ + properties?: { [propertyName: string]: string }; +} + +/** + * @interface + * An interface representing Provider. + * Resource provider information. + * + */ +export interface Provider { + /** + * @member {string} [id] The provider ID. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [namespace] The namespace of the resource provider. + */ + namespace?: string; + /** + * @member {string} [registrationState] The registration state of the + * provider. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly registrationState?: string; + /** + * @member {ProviderResourceType[]} [resourceTypes] The collection of + * provider resource types. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly resourceTypes?: ProviderResourceType[]; +} + +/** + * @interface + * An interface representing BasicDependency. + * Deployment dependency information. + * + */ +export interface BasicDependency { + /** + * @member {string} [id] The ID of the dependency. + */ + id?: string; + /** + * @member {string} [resourceType] The dependency resource type. + */ + resourceType?: string; + /** + * @member {string} [resourceName] The dependency resource name. + */ + resourceName?: string; +} + +/** + * @interface + * An interface representing Dependency. + * Deployment dependency information. + * + */ +export interface Dependency { + /** + * @member {BasicDependency[]} [dependsOn] The list of dependencies. + */ + dependsOn?: BasicDependency[]; + /** + * @member {string} [id] The ID of the dependency. + */ + id?: string; + /** + * @member {string} [resourceType] The dependency resource type. + */ + resourceType?: string; + /** + * @member {string} [resourceName] The dependency resource name. + */ + resourceName?: string; +} + +/** + * @interface + * An interface representing OnErrorDeploymentExtended. + * Deployment on error behavior with additional details. + * + */ +export interface OnErrorDeploymentExtended { + /** + * @member {string} [provisioningState] The state of the provisioning for the + * on error deployment. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provisioningState?: string; + /** + * @member {OnErrorDeploymentType} [type] The deployment on error behavior + * type. Possible values are LastSuccessful and SpecificDeployment. Possible + * values include: 'LastSuccessful', 'SpecificDeployment' + */ + type?: OnErrorDeploymentType; + /** + * @member {string} [deploymentName] The deployment to be used on error case. + */ + deploymentName?: string; +} + +/** + * @interface + * An interface representing DeploymentPropertiesExtended. + * Deployment properties with additional details. + * + */ +export interface DeploymentPropertiesExtended { + /** + * @member {string} [provisioningState] The state of the provisioning. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provisioningState?: string; + /** + * @member {string} [correlationId] The correlation ID of the deployment. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly correlationId?: string; + /** + * @member {Date} [timestamp] The timestamp of the template deployment. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly timestamp?: Date; + /** + * @member {any} [outputs] Key/value pairs that represent deploymentoutput. + */ + outputs?: any; + /** + * @member {Provider[]} [providers] The list of resource providers needed for + * the deployment. + */ + providers?: Provider[]; + /** + * @member {Dependency[]} [dependencies] The list of deployment dependencies. + */ + dependencies?: Dependency[]; + /** + * @member {any} [template] The template content. Use only one of Template or + * TemplateLink. + */ + template?: any; + /** + * @member {TemplateLink} [templateLink] The URI referencing the template. + * Use only one of Template or TemplateLink. + */ + templateLink?: TemplateLink; + /** + * @member {any} [parameters] Deployment parameters. Use only one of + * Parameters or ParametersLink. + */ + parameters?: any; + /** + * @member {ParametersLink} [parametersLink] The URI referencing the + * parameters. Use only one of Parameters or ParametersLink. + */ + parametersLink?: ParametersLink; + /** + * @member {DeploymentMode} [mode] The deployment mode. Possible values are + * Incremental and Complete. Possible values include: 'Incremental', + * 'Complete' + */ + mode?: DeploymentMode; + /** + * @member {DebugSetting} [debugSetting] The debug setting of the deployment. + */ + debugSetting?: DebugSetting; + /** + * @member {OnErrorDeploymentExtended} [onErrorDeployment] The deployment on + * error behavior. + */ + onErrorDeployment?: OnErrorDeploymentExtended; +} + +/** + * @interface + * An interface representing DeploymentValidateResult. + * Information from validate template deployment response. + * + */ +export interface DeploymentValidateResult { + /** + * @member {ResourceManagementErrorWithDetails} [error] Validation error. + */ + error?: ResourceManagementErrorWithDetails; + /** + * @member {DeploymentPropertiesExtended} [properties] The template + * deployment properties. + */ + properties?: DeploymentPropertiesExtended; +} + +/** + * @interface + * An interface representing DeploymentExtended. + * Deployment information. + * + * @extends BaseResource + */ +export interface DeploymentExtended extends BaseResource { + /** + * @member {string} [id] The ID of the deployment. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [name] The name of the deployment. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [location] the location of the deployment. + */ + location?: string; + /** + * @member {DeploymentPropertiesExtended} [properties] Deployment properties. + */ + properties?: DeploymentPropertiesExtended; +} + +/** + * @interface + * An interface representing Plan. + * Plan for the resource. + * + */ +export interface Plan { + /** + * @member {string} [name] The plan ID. + */ + name?: string; + /** + * @member {string} [publisher] The publisher ID. + */ + publisher?: string; + /** + * @member {string} [product] The offer ID. + */ + product?: string; + /** + * @member {string} [promotionCode] The promotion code. + */ + promotionCode?: string; + /** + * @member {string} [version] The plan's version. + */ + version?: string; +} + +/** + * @interface + * An interface representing Sku. + * SKU for the resource. + * + */ +export interface Sku { + /** + * @member {string} [name] The SKU name. + */ + name?: string; + /** + * @member {string} [tier] The SKU tier. + */ + tier?: string; + /** + * @member {string} [size] The SKU size. + */ + size?: string; + /** + * @member {string} [family] The SKU family. + */ + family?: string; + /** + * @member {string} [model] The SKU model. + */ + model?: string; + /** + * @member {number} [capacity] The SKU capacity. + */ + capacity?: number; +} + +/** + * @interface + * An interface representing IdentityUserAssignedIdentitiesValue. + */ +export interface IdentityUserAssignedIdentitiesValue { + /** + * @member {string} [principalId] The principal id of user assigned identity. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly principalId?: string; + /** + * @member {string} [clientId] The client id of user assigned identity. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly clientId?: string; +} + +/** + * @interface + * An interface representing Identity. + * Identity for the resource. + * + */ +export interface Identity { + /** + * @member {string} [principalId] The principal ID of resource identity. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly principalId?: string; + /** + * @member {string} [tenantId] The tenant ID of resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly tenantId?: string; + /** + * @member {ResourceIdentityType} [type] The identity type. Possible values + * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + */ + type?: ResourceIdentityType; + /** + * @member {{ [propertyName: string]: IdentityUserAssignedIdentitiesValue }} + * [userAssignedIdentities] The list of user identities associated with the + * resource. The user identity dictionary key references will be ARM resource + * ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ + userAssignedIdentities?: { [propertyName: string]: IdentityUserAssignedIdentitiesValue }; +} + +/** + * @interface + * An interface representing Resource. + * Specified resource. + * + * @extends BaseResource + */ +export interface Resource extends BaseResource { + /** + * @member {string} [id] Resource ID + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [name] Resource name + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [type] Resource type + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {string} [location] Resource location + */ + location?: string; + /** + * @member {{ [propertyName: string]: string }} [tags] Resource tags + */ + tags?: { [propertyName: string]: string }; +} + +/** + * @interface + * An interface representing GenericResource. + * Resource information. + * + * @extends Resource + */ +export interface GenericResource extends Resource { + /** + * @member {Plan} [plan] The plan of the resource. + */ + plan?: Plan; + /** + * @member {any} [properties] The resource properties. + */ + properties?: any; + /** + * @member {string} [kind] The kind of the resource. + */ + kind?: string; + /** + * @member {string} [managedBy] ID of the resource that manages this + * resource. + */ + managedBy?: string; + /** + * @member {Sku} [sku] The SKU of the resource. + */ + sku?: Sku; + /** + * @member {Identity} [identity] The identity of the resource. + */ + identity?: Identity; +} + +/** + * @interface + * An interface representing ResourceGroupProperties. + * The resource group properties. + * + */ +export interface ResourceGroupProperties { + /** + * @member {string} [provisioningState] The provisioning state. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provisioningState?: string; +} + +/** + * @interface + * An interface representing ResourceGroup. + * Resource group information. + * + * @extends BaseResource + */ +export interface ResourceGroup extends BaseResource { + /** + * @member {string} [id] The ID of the resource group. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [name] The name of the resource group. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {ResourceGroupProperties} [properties] + */ + properties?: ResourceGroupProperties; + /** + * @member {string} location The location of the resource group. It cannot be + * changed after the resource group has been created. It must be one of the + * supported Azure locations. + */ + location: string; + /** + * @member {string} [managedBy] The ID of the resource that manages this + * resource group. + */ + managedBy?: string; + /** + * @member {{ [propertyName: string]: string }} [tags] The tags attached to + * the resource group. + */ + tags?: { [propertyName: string]: string }; +} + +/** + * @interface + * An interface representing ResourceGroupPatchable. + * Resource group information. + * + */ +export interface ResourceGroupPatchable { + /** + * @member {string} [name] The name of the resource group. + */ + name?: string; + /** + * @member {ResourceGroupProperties} [properties] + */ + properties?: ResourceGroupProperties; + /** + * @member {string} [managedBy] The ID of the resource that manages this + * resource group. + */ + managedBy?: string; + /** + * @member {{ [propertyName: string]: string }} [tags] The tags attached to + * the resource group. + */ + tags?: { [propertyName: string]: string }; +} + +/** + * @interface + * An interface representing ResourcesMoveInfo. + * Parameters of move resources. + * + */ +export interface ResourcesMoveInfo { + /** + * @member {string[]} [resources] The IDs of the resources. + */ + resources?: string[]; + /** + * @member {string} [targetResourceGroup] The target resource group. + */ + targetResourceGroup?: string; +} + +/** + * @interface + * An interface representing ExportTemplateRequest. + * Export resource group template request parameters. + * + */ +export interface ExportTemplateRequest { + /** + * @member {string[]} [resources] The IDs of the resources. The only + * supported string currently is '*' (all resources). Future updates will + * support exporting specific resources. + */ + resources?: string[]; + /** + * @member {string} [options] The export template options. Supported values + * include 'IncludeParameterDefaultValue', 'IncludeComments' or + * 'IncludeParameterDefaultValue, IncludeComments + */ + options?: string; +} + +/** + * @interface + * An interface representing TagCount. + * Tag count. + * + */ +export interface TagCount { + /** + * @member {string} [type] Type of count. + */ + type?: string; + /** + * @member {number} [value] Value of count. + */ + value?: number; +} + +/** + * @interface + * An interface representing TagValue. + * Tag information. + * + * @extends BaseResource + */ +export interface TagValue extends BaseResource { + /** + * @member {string} [id] The tag ID. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [tagValue] The tag value. + */ + tagValue?: string; + /** + * @member {TagCount} [count] The tag value count. + */ + count?: TagCount; +} + +/** + * @interface + * An interface representing TagDetails. + * Tag details. + * + */ +export interface TagDetails { + /** + * @member {string} [id] The tag ID. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [tagName] The tag name. + */ + tagName?: string; + /** + * @member {TagCount} [count] The total number of resources that use the + * resource tag. When a tag is initially created and has no associated + * resources, the value is 0. + */ + count?: TagCount; + /** + * @member {TagValue[]} [values] The list of tag values. + */ + values?: TagValue[]; +} + +/** + * @interface + * An interface representing TargetResource. + * Target resource. + * + */ +export interface TargetResource { + /** + * @member {string} [id] The ID of the resource. + */ + id?: string; + /** + * @member {string} [resourceName] The name of the resource. + */ + resourceName?: string; + /** + * @member {string} [resourceType] The type of the resource. + */ + resourceType?: string; +} + +/** + * @interface + * An interface representing HttpMessage. + * HTTP message. + * + */ +export interface HttpMessage { + /** + * @member {any} [content] HTTP message content. + */ + content?: any; +} + +/** + * @interface + * An interface representing DeploymentOperationProperties. + * Deployment operation properties. + * + */ +export interface DeploymentOperationProperties { + /** + * @member {string} [provisioningState] The state of the provisioning. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provisioningState?: string; + /** + * @member {Date} [timestamp] The date and time of the operation. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly timestamp?: Date; + /** + * @member {string} [serviceRequestId] Deployment operation service request + * id. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly serviceRequestId?: string; + /** + * @member {string} [statusCode] Operation status code. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly statusCode?: string; + /** + * @member {any} [statusMessage] Operation status message. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly statusMessage?: any; + /** + * @member {TargetResource} [targetResource] The target resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly targetResource?: TargetResource; + /** + * @member {HttpMessage} [request] The HTTP request message. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly request?: HttpMessage; + /** + * @member {HttpMessage} [response] The HTTP response message. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly response?: HttpMessage; +} + +/** + * @interface + * An interface representing DeploymentOperation. + * Deployment operation information. + * + */ +export interface DeploymentOperation { + /** + * @member {string} [id] Full deployment operation ID. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [operationId] Deployment operation ID. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly operationId?: string; + /** + * @member {DeploymentOperationProperties} [properties] Deployment + * properties. + */ + properties?: DeploymentOperationProperties; +} + +/** + * @interface + * An interface representing ResourceProviderOperationDisplayProperties. + * Resource provider operation's display properties. + * + */ +export interface ResourceProviderOperationDisplayProperties { + /** + * @member {string} [publisher] Operation description. + */ + publisher?: string; + /** + * @member {string} [provider] Operation provider. + */ + provider?: string; + /** + * @member {string} [resource] Operation resource. + */ + resource?: string; + /** + * @member {string} [operation] Resource provider operation. + */ + operation?: string; + /** + * @member {string} [description] Operation description. + */ + description?: string; +} + +/** + * @interface + * An interface representing SubResource. + * Sub-resource. + * + * @extends BaseResource + */ +export interface SubResource extends BaseResource { + /** + * @member {string} [id] Resource ID + */ + id?: string; +} + +/** + * @interface + * An interface representing ResourceGroupExportResult. + * Resource group export result. + * + */ +export interface ResourceGroupExportResult { + /** + * @member {any} [template] The template content. + */ + template?: any; + /** + * @member {ResourceManagementErrorWithDetails} [error] The error. + */ + error?: ResourceManagementErrorWithDetails; +} + +/** + * @interface + * An interface representing OperationDisplay. + * The object that represents the operation. + * + */ +export interface OperationDisplay { + /** + * @member {string} [provider] Service provider: Microsoft.Resources + */ + provider?: string; + /** + * @member {string} [resource] Resource on which the operation is performed: + * Profile, endpoint, etc. + */ + resource?: string; + /** + * @member {string} [operation] Operation type: Read, write, delete, etc. + */ + operation?: string; + /** + * @member {string} [description] Description of the operation. + */ + description?: string; +} + +/** + * @interface + * An interface representing Operation. + * Microsoft.Resources operation + * + */ +export interface Operation { + /** + * @member {string} [name] Operation name: {provider}/{resource}/{operation} + */ + name?: string; + /** + * @member {OperationDisplay} [display] The object that represents the + * operation. + */ + display?: OperationDisplay; +} + +/** + * @interface + * An interface representing DeploymentsListAtSubscriptionScopeOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface DeploymentsListAtSubscriptionScopeOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [filter] The filter to apply on the operation. For + * example, you can use $filter=provisioningState eq '{state}'. + */ + filter?: string; + /** + * @member {number} [top] The number of results to get. If null is passed, + * returns all deployments. + */ + top?: number; +} + +/** + * @interface + * An interface representing DeploymentsListByResourceGroupOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface DeploymentsListByResourceGroupOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [filter] The filter to apply on the operation. For + * example, you can use $filter=provisioningState eq '{state}'. + */ + filter?: string; + /** + * @member {number} [top] The number of results to get. If null is passed, + * returns all deployments. + */ + top?: number; +} + +/** + * @interface + * An interface representing ProvidersListOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface ProvidersListOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {number} [top] The number of results to return. If null is passed + * returns all deployments. + */ + top?: number; + /** + * @member {string} [expand] The properties to include in the results. For + * example, use &$expand=metadata in the query string to retrieve resource + * provider metadata. To include property aliases in response, use + * $expand=resourceTypes/aliases. + */ + expand?: string; +} + +/** + * @interface + * An interface representing ProvidersGetOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface ProvidersGetOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [expand] The $expand query parameter. For example, to + * include property aliases in response, use $expand=resourceTypes/aliases. + */ + expand?: string; +} + +/** + * @interface + * An interface representing ResourcesListByResourceGroupOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface ResourcesListByResourceGroupOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [filter] The filter to apply on the operation.

The + * properties you can use for eq (equals) or ne (not equals) are: location, + * resourceType, name, resourceGroup, identity, identity/principalId, plan, + * plan/publisher, plan/product, plan/name, plan/version, and + * plan/promotionCode.

For example, to filter by a resource type, use: + * $filter=resourceType eq 'Microsoft.Network/virtualNetworks'

You can + * use substringof(value, property) in the filter. The properties you can use + * for substring are: name and resourceGroup.

For example, to get all + * resources with 'demo' anywhere in the name, use: + * $filter=substringof('demo', name)

You can link more than one + * substringof together by adding and/or operators.

You can filter by + * tag names and values. For example, to filter for a tag name and value, use + * $filter=tagName eq 'tag1' and tagValue eq 'Value1'

You can use some + * properties together when filtering. The combinations you can use are: + * substringof and/or resourceType, plan and plan/publisher and plan/name, + * identity and identity/principalId. + */ + filter?: string; + /** + * @member {string} [expand] The $expand query parameter. You can expand + * createdTime and changedTime. For example, to expand both properties, use + * $expand=changedTime,createdTime + */ + expand?: string; + /** + * @member {number} [top] The number of results to return. If null is passed, + * returns all resources. + */ + top?: number; +} + +/** + * @interface + * An interface representing ResourcesListOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface ResourcesListOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [filter] The filter to apply on the operation.

The + * properties you can use for eq (equals) or ne (not equals) are: location, + * resourceType, name, resourceGroup, identity, identity/principalId, plan, + * plan/publisher, plan/product, plan/name, plan/version, and + * plan/promotionCode.

For example, to filter by a resource type, use: + * $filter=resourceType eq 'Microsoft.Network/virtualNetworks'

You can + * use substringof(value, property) in the filter. The properties you can use + * for substring are: name and resourceGroup.

For example, to get all + * resources with 'demo' anywhere in the name, use: + * $filter=substringof('demo', name)

You can link more than one + * substringof together by adding and/or operators.

You can filter by + * tag names and values. For example, to filter for a tag name and value, use + * $filter=tagName eq 'tag1' and tagValue eq 'Value1'

You can use some + * properties together when filtering. The combinations you can use are: + * substringof and/or resourceType, plan and plan/publisher and plan/name, + * identity and identity/principalId. + */ + filter?: string; + /** + * @member {string} [expand] The $expand query parameter. You can expand + * createdTime and changedTime. For example, to expand both properties, use + * $expand=changedTime,createdTime + */ + expand?: string; + /** + * @member {number} [top] The number of results to return. If null is passed, + * returns all resource groups. + */ + top?: number; +} + +/** + * @interface + * An interface representing ResourceGroupsListOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface ResourceGroupsListOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [filter] The filter to apply on the operation.

You + * can filter by tag names and values. For example, to filter for a tag name + * and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1' + */ + filter?: string; + /** + * @member {number} [top] The number of results to return. If null is passed, + * returns all resource groups. + */ + top?: number; +} + +/** + * @interface + * An interface representing DeploymentOperationsListAtSubscriptionScopeOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface DeploymentOperationsListAtSubscriptionScopeOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {number} [top] The number of results to return. + */ + top?: number; +} + +/** + * @interface + * An interface representing DeploymentOperationsListOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface DeploymentOperationsListOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {number} [top] The number of results to return. + */ + top?: number; +} + +/** + * @interface + * An interface representing ResourceManagementClientOptions. + * @extends AzureServiceClientOptions + */ +export interface ResourceManagementClientOptions extends AzureServiceClientOptions { + /** + * @member {string} [baseUri] + */ + baseUri?: string; +} + + +/** + * @interface + * An interface representing the OperationListResult. + * Result of the request to list Microsoft.Resources operations. It contains a + * list of operations and a URL link to get the next set of results. + * + * @extends Array + */ +export interface OperationListResult extends Array { + /** + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ + nextLink?: string; +} + +/** + * @interface + * An interface representing the DeploymentListResult. + * List of deployments. + * + * @extends Array + */ +export interface DeploymentListResult extends Array { + /** + * @member {string} [nextLink] The URL to use for getting the next set of + * results. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * An interface representing the ProviderListResult. + * List of resource providers. + * + * @extends Array + */ +export interface ProviderListResult extends Array { + /** + * @member {string} [nextLink] The URL to use for getting the next set of + * results. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * An interface representing the ResourceListResult. + * List of resource groups. + * + * @extends Array + */ +export interface ResourceListResult extends Array { + /** + * @member {string} [nextLink] The URL to use for getting the next set of + * results. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * An interface representing the ResourceGroupListResult. + * List of resource groups. + * + * @extends Array + */ +export interface ResourceGroupListResult extends Array { + /** + * @member {string} [nextLink] The URL to use for getting the next set of + * results. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * An interface representing the TagsListResult. + * List of subscription tags. + * + * @extends Array + */ +export interface TagsListResult extends Array { + /** + * @member {string} [nextLink] The URL to use for getting the next set of + * results. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * An interface representing the DeploymentOperationsListResult. + * List of deployment operations. + * + * @extends Array + */ +export interface DeploymentOperationsListResult extends Array { + /** + * @member {string} [nextLink] The URL to use for getting the next set of + * results. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly nextLink?: string; +} + +/** + * Defines values for DeploymentMode. + * Possible values include: 'Incremental', 'Complete' + * @readonly + * @enum {string} + */ +export enum DeploymentMode { + Incremental = 'Incremental', + Complete = 'Complete', +} + +/** + * Defines values for OnErrorDeploymentType. + * Possible values include: 'LastSuccessful', 'SpecificDeployment' + * @readonly + * @enum {string} + */ +export enum OnErrorDeploymentType { + LastSuccessful = 'LastSuccessful', + SpecificDeployment = 'SpecificDeployment', +} + +/** + * Defines values for ResourceIdentityType. + * Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + * @readonly + * @enum {string} + */ +export enum ResourceIdentityType { + SystemAssigned = 'SystemAssigned', + UserAssigned = 'UserAssigned', + SystemAssignedUserAssigned = 'SystemAssigned, UserAssigned', + None = 'None', +} + +/** + * Contains response data for the list operation. + */ +export type OperationsListResponse = OperationListResult & { + /** + * 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: OperationListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type OperationsListNextResponse = OperationListResult & { + /** + * 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: OperationListResult; + }; +}; + +/** + * Contains response data for the checkExistenceAtSubscriptionScope operation. + */ +export type DeploymentsCheckExistenceAtSubscriptionScopeResponse = { + /** + * The parsed response body. + */ + body: boolean; + /** + * 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: boolean; + }; +}; + +/** + * Contains response data for the createOrUpdateAtSubscriptionScope operation. + */ +export type DeploymentsCreateOrUpdateAtSubscriptionScopeResponse = DeploymentExtended & { + /** + * 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: DeploymentExtended; + }; +}; + +/** + * Contains response data for the getAtSubscriptionScope operation. + */ +export type DeploymentsGetAtSubscriptionScopeResponse = DeploymentExtended & { + /** + * 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: DeploymentExtended; + }; +}; + +/** + * Contains response data for the validateAtSubscriptionScope operation. + */ +export type DeploymentsValidateAtSubscriptionScopeResponse = DeploymentValidateResult & { + /** + * 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: DeploymentValidateResult; + }; +}; + +/** + * Contains response data for the exportTemplateAtSubscriptionScope operation. + */ +export type DeploymentsExportTemplateAtSubscriptionScopeResponse = DeploymentExportResult & { + /** + * 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: DeploymentExportResult; + }; +}; + +/** + * Contains response data for the listAtSubscriptionScope operation. + */ +export type DeploymentsListAtSubscriptionScopeResponse = DeploymentListResult & { + /** + * 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: DeploymentListResult; + }; +}; + +/** + * Contains response data for the checkExistence operation. + */ +export type DeploymentsCheckExistenceResponse = { + /** + * The parsed response body. + */ + body: boolean; + /** + * 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: boolean; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type DeploymentsCreateOrUpdateResponse = DeploymentExtended & { + /** + * 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: DeploymentExtended; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type DeploymentsGetResponse = DeploymentExtended & { + /** + * 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: DeploymentExtended; + }; +}; + +/** + * Contains response data for the validate operation. + */ +export type DeploymentsValidateResponse = DeploymentValidateResult & { + /** + * 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: DeploymentValidateResult; + }; +}; + +/** + * Contains response data for the exportTemplate operation. + */ +export type DeploymentsExportTemplateResponse = DeploymentExportResult & { + /** + * 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: DeploymentExportResult; + }; +}; + +/** + * Contains response data for the listByResourceGroup operation. + */ +export type DeploymentsListByResourceGroupResponse = DeploymentListResult & { + /** + * 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: DeploymentListResult; + }; +}; + +/** + * Contains response data for the beginCreateOrUpdateAtSubscriptionScope operation. + */ +export type DeploymentsBeginCreateOrUpdateAtSubscriptionScopeResponse = DeploymentExtended & { + /** + * 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: DeploymentExtended; + }; +}; + +/** + * Contains response data for the beginCreateOrUpdate operation. + */ +export type DeploymentsBeginCreateOrUpdateResponse = DeploymentExtended & { + /** + * 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: DeploymentExtended; + }; +}; + +/** + * Contains response data for the listAtSubscriptionScopeNext operation. + */ +export type DeploymentsListAtSubscriptionScopeNextResponse = DeploymentListResult & { + /** + * 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: DeploymentListResult; + }; +}; + +/** + * Contains response data for the listByResourceGroupNext operation. + */ +export type DeploymentsListByResourceGroupNextResponse = DeploymentListResult & { + /** + * 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: DeploymentListResult; + }; +}; + +/** + * Contains response data for the unregister operation. + */ +export type ProvidersUnregisterResponse = Provider & { + /** + * 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: Provider; + }; +}; + +/** + * Contains response data for the register operation. + */ +export type ProvidersRegisterResponse = Provider & { + /** + * 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: Provider; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type ProvidersListResponse = ProviderListResult & { + /** + * 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: ProviderListResult; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type ProvidersGetResponse = Provider & { + /** + * 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: Provider; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type ProvidersListNextResponse = ProviderListResult & { + /** + * 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: ProviderListResult; + }; +}; + +/** + * Contains response data for the listByResourceGroup operation. + */ +export type ResourcesListByResourceGroupResponse = ResourceListResult & { + /** + * 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: ResourceListResult; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type ResourcesListResponse = ResourceListResult & { + /** + * 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: ResourceListResult; + }; +}; + +/** + * Contains response data for the checkExistence operation. + */ +export type ResourcesCheckExistenceResponse = { + /** + * The parsed response body. + */ + body: boolean; + /** + * 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: boolean; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type ResourcesCreateOrUpdateResponse = GenericResource & { + /** + * 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: GenericResource; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type ResourcesUpdateResponse = GenericResource & { + /** + * 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: GenericResource; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type ResourcesGetResponse = GenericResource & { + /** + * 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: GenericResource; + }; +}; + +/** + * Contains response data for the checkExistenceById operation. + */ +export type ResourcesCheckExistenceByIdResponse = { + /** + * The parsed response body. + */ + body: boolean; + /** + * 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: boolean; + }; +}; + +/** + * Contains response data for the createOrUpdateById operation. + */ +export type ResourcesCreateOrUpdateByIdResponse = GenericResource & { + /** + * 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: GenericResource; + }; +}; + +/** + * Contains response data for the updateById operation. + */ +export type ResourcesUpdateByIdResponse = GenericResource & { + /** + * 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: GenericResource; + }; +}; + +/** + * Contains response data for the getById operation. + */ +export type ResourcesGetByIdResponse = GenericResource & { + /** + * 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: GenericResource; + }; +}; + +/** + * Contains response data for the beginCreateOrUpdate operation. + */ +export type ResourcesBeginCreateOrUpdateResponse = GenericResource & { + /** + * 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: GenericResource; + }; +}; + +/** + * Contains response data for the beginUpdate operation. + */ +export type ResourcesBeginUpdateResponse = GenericResource & { + /** + * 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: GenericResource; + }; +}; + +/** + * Contains response data for the beginCreateOrUpdateById operation. + */ +export type ResourcesBeginCreateOrUpdateByIdResponse = GenericResource & { + /** + * 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: GenericResource; + }; +}; + +/** + * Contains response data for the beginUpdateById operation. + */ +export type ResourcesBeginUpdateByIdResponse = GenericResource & { + /** + * 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: GenericResource; + }; +}; + +/** + * Contains response data for the listByResourceGroupNext operation. + */ +export type ResourcesListByResourceGroupNextResponse = ResourceListResult & { + /** + * 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: ResourceListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type ResourcesListNextResponse = ResourceListResult & { + /** + * 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: ResourceListResult; + }; +}; + +/** + * Contains response data for the checkExistence operation. + */ +export type ResourceGroupsCheckExistenceResponse = { + /** + * The parsed response body. + */ + body: boolean; + /** + * 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: boolean; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type ResourceGroupsCreateOrUpdateResponse = ResourceGroup & { + /** + * 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: ResourceGroup; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type ResourceGroupsGetResponse = ResourceGroup & { + /** + * 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: ResourceGroup; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type ResourceGroupsUpdateResponse = ResourceGroup & { + /** + * 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: ResourceGroup; + }; +}; + +/** + * Contains response data for the exportTemplate operation. + */ +export type ResourceGroupsExportTemplateResponse = ResourceGroupExportResult & { + /** + * 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: ResourceGroupExportResult; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type ResourceGroupsListResponse = ResourceGroupListResult & { + /** + * 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: ResourceGroupListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type ResourceGroupsListNextResponse = ResourceGroupListResult & { + /** + * 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: ResourceGroupListResult; + }; +}; + +/** + * Contains response data for the createOrUpdateValue operation. + */ +export type TagsCreateOrUpdateValueResponse = TagValue & { + /** + * 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: TagValue; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type TagsCreateOrUpdateResponse = TagDetails & { + /** + * 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: TagDetails; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type TagsListResponse = TagsListResult & { + /** + * 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: TagsListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type TagsListNextResponse = TagsListResult & { + /** + * 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: TagsListResult; + }; +}; + +/** + * Contains response data for the getAtSubscriptionScope operation. + */ +export type DeploymentOperationsGetAtSubscriptionScopeResponse = DeploymentOperation & { + /** + * 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: DeploymentOperation; + }; +}; + +/** + * Contains response data for the listAtSubscriptionScope operation. + */ +export type DeploymentOperationsListAtSubscriptionScopeResponse = DeploymentOperationsListResult & { + /** + * 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: DeploymentOperationsListResult; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type DeploymentOperationsGetResponse = DeploymentOperation & { + /** + * 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: DeploymentOperation; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type DeploymentOperationsListResponse = DeploymentOperationsListResult & { + /** + * 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: DeploymentOperationsListResult; + }; +}; + +/** + * Contains response data for the listAtSubscriptionScopeNext operation. + */ +export type DeploymentOperationsListAtSubscriptionScopeNextResponse = DeploymentOperationsListResult & { + /** + * 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: DeploymentOperationsListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type DeploymentOperationsListNextResponse = DeploymentOperationsListResult & { + /** + * 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: DeploymentOperationsListResult; + }; +}; diff --git a/packages/@azure/arm-resources/lib/models/mappers.ts b/packages/@azure/arm-resources/lib/models/mappers.ts new file mode 100644 index 000000000000..9f6451b37ca5 --- /dev/null +++ b/packages/@azure/arm-resources/lib/models/mappers.ts @@ -0,0 +1,1747 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import { CloudErrorMapper, BaseResourceMapper } from "ms-rest-azure-js"; +import * as msRest from "ms-rest-js"; + +export const CloudError = CloudErrorMapper; +export const BaseResource = BaseResourceMapper; + +export const DeploymentExtendedFilter: msRest.CompositeMapper = { + serializedName: "DeploymentExtendedFilter", + type: { + name: "Composite", + className: "DeploymentExtendedFilter", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + type: { + name: "String" + } + } + } + } +}; + +export const GenericResourceFilter: msRest.CompositeMapper = { + serializedName: "GenericResourceFilter", + type: { + name: "Composite", + className: "GenericResourceFilter", + modelProperties: { + resourceType: { + serializedName: "resourceType", + type: { + name: "String" + } + }, + tagname: { + serializedName: "tagname", + type: { + name: "String" + } + }, + tagvalue: { + serializedName: "tagvalue", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceGroupFilter: msRest.CompositeMapper = { + serializedName: "ResourceGroupFilter", + type: { + name: "Composite", + className: "ResourceGroupFilter", + modelProperties: { + tagName: { + serializedName: "tagName", + type: { + name: "String" + } + }, + tagValue: { + serializedName: "tagValue", + type: { + name: "String" + } + } + } + } +}; + +export const TemplateLink: msRest.CompositeMapper = { + serializedName: "TemplateLink", + type: { + name: "Composite", + className: "TemplateLink", + modelProperties: { + uri: { + required: true, + serializedName: "uri", + type: { + name: "String" + } + }, + contentVersion: { + serializedName: "contentVersion", + type: { + name: "String" + } + } + } + } +}; + +export const ParametersLink: msRest.CompositeMapper = { + serializedName: "ParametersLink", + type: { + name: "Composite", + className: "ParametersLink", + modelProperties: { + uri: { + required: true, + serializedName: "uri", + type: { + name: "String" + } + }, + contentVersion: { + serializedName: "contentVersion", + type: { + name: "String" + } + } + } + } +}; + +export const DebugSetting: msRest.CompositeMapper = { + serializedName: "DebugSetting", + type: { + name: "Composite", + className: "DebugSetting", + modelProperties: { + detailLevel: { + serializedName: "detailLevel", + type: { + name: "String" + } + } + } + } +}; + +export const OnErrorDeployment: msRest.CompositeMapper = { + serializedName: "OnErrorDeployment", + type: { + name: "Composite", + className: "OnErrorDeployment", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "Enum", + allowedValues: [ + "LastSuccessful", + "SpecificDeployment" + ] + } + }, + deploymentName: { + serializedName: "deploymentName", + type: { + name: "String" + } + } + } + } +}; + +export const DeploymentProperties: msRest.CompositeMapper = { + serializedName: "DeploymentProperties", + type: { + name: "Composite", + className: "DeploymentProperties", + modelProperties: { + template: { + serializedName: "template", + type: { + name: "Object" + } + }, + templateLink: { + serializedName: "templateLink", + type: { + name: "Composite", + className: "TemplateLink" + } + }, + parameters: { + serializedName: "parameters", + type: { + name: "Object" + } + }, + parametersLink: { + serializedName: "parametersLink", + type: { + name: "Composite", + className: "ParametersLink" + } + }, + mode: { + required: true, + serializedName: "mode", + type: { + name: "Enum", + allowedValues: [ + "Incremental", + "Complete" + ] + } + }, + debugSetting: { + serializedName: "debugSetting", + type: { + name: "Composite", + className: "DebugSetting" + } + }, + onErrorDeployment: { + serializedName: "onErrorDeployment", + type: { + name: "Composite", + className: "OnErrorDeployment" + } + } + } + } +}; + +export const Deployment: msRest.CompositeMapper = { + serializedName: "Deployment", + type: { + name: "Composite", + className: "Deployment", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + properties: { + required: true, + serializedName: "properties", + type: { + name: "Composite", + className: "DeploymentProperties" + } + } + } + } +}; + +export const DeploymentExportResult: msRest.CompositeMapper = { + serializedName: "DeploymentExportResult", + type: { + name: "Composite", + className: "DeploymentExportResult", + modelProperties: { + template: { + serializedName: "template", + type: { + name: "Object" + } + } + } + } +}; + +export const ResourceManagementErrorWithDetails: msRest.CompositeMapper = { + serializedName: "ResourceManagementErrorWithDetails", + type: { + name: "Composite", + className: "ResourceManagementErrorWithDetails", + 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: "ResourceManagementErrorWithDetails" + } + } + } + } + } + } +}; + +export const AliasPathType: msRest.CompositeMapper = { + serializedName: "AliasPathType", + type: { + name: "Composite", + className: "AliasPathType", + modelProperties: { + path: { + serializedName: "path", + type: { + name: "String" + } + }, + apiVersions: { + serializedName: "apiVersions", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const AliasType: msRest.CompositeMapper = { + serializedName: "AliasType", + type: { + name: "Composite", + className: "AliasType", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + paths: { + serializedName: "paths", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AliasPathType" + } + } + } + } + } + } +}; + +export const ProviderResourceType: msRest.CompositeMapper = { + serializedName: "ProviderResourceType", + type: { + name: "Composite", + className: "ProviderResourceType", + modelProperties: { + resourceType: { + serializedName: "resourceType", + type: { + name: "String" + } + }, + locations: { + serializedName: "locations", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + aliases: { + serializedName: "aliases", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AliasType" + } + } + } + }, + apiVersions: { + serializedName: "apiVersions", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const Provider: msRest.CompositeMapper = { + serializedName: "Provider", + type: { + name: "Composite", + className: "Provider", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + namespace: { + serializedName: "namespace", + type: { + name: "String" + } + }, + registrationState: { + readOnly: true, + serializedName: "registrationState", + type: { + name: "String" + } + }, + resourceTypes: { + readOnly: true, + serializedName: "resourceTypes", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ProviderResourceType" + } + } + } + } + } + } +}; + +export const BasicDependency: msRest.CompositeMapper = { + serializedName: "BasicDependency", + type: { + name: "Composite", + className: "BasicDependency", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + resourceType: { + serializedName: "resourceType", + type: { + name: "String" + } + }, + resourceName: { + serializedName: "resourceName", + type: { + name: "String" + } + } + } + } +}; + +export const Dependency: msRest.CompositeMapper = { + serializedName: "Dependency", + type: { + name: "Composite", + className: "Dependency", + modelProperties: { + dependsOn: { + serializedName: "dependsOn", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BasicDependency" + } + } + } + }, + id: { + serializedName: "id", + type: { + name: "String" + } + }, + resourceType: { + serializedName: "resourceType", + type: { + name: "String" + } + }, + resourceName: { + serializedName: "resourceName", + type: { + name: "String" + } + } + } + } +}; + +export const OnErrorDeploymentExtended: msRest.CompositeMapper = { + serializedName: "OnErrorDeploymentExtended", + type: { + name: "Composite", + className: "OnErrorDeploymentExtended", + modelProperties: { + provisioningState: { + readOnly: true, + serializedName: "provisioningState", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "Enum", + allowedValues: [ + "LastSuccessful", + "SpecificDeployment" + ] + } + }, + deploymentName: { + serializedName: "deploymentName", + type: { + name: "String" + } + } + } + } +}; + +export const DeploymentPropertiesExtended: msRest.CompositeMapper = { + serializedName: "DeploymentPropertiesExtended", + type: { + name: "Composite", + className: "DeploymentPropertiesExtended", + modelProperties: { + provisioningState: { + readOnly: true, + serializedName: "provisioningState", + type: { + name: "String" + } + }, + correlationId: { + readOnly: true, + serializedName: "correlationId", + type: { + name: "String" + } + }, + timestamp: { + readOnly: true, + serializedName: "timestamp", + type: { + name: "DateTime" + } + }, + outputs: { + serializedName: "outputs", + type: { + name: "Object" + } + }, + providers: { + serializedName: "providers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Provider" + } + } + } + }, + dependencies: { + serializedName: "dependencies", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Dependency" + } + } + } + }, + template: { + serializedName: "template", + type: { + name: "Object" + } + }, + templateLink: { + serializedName: "templateLink", + type: { + name: "Composite", + className: "TemplateLink" + } + }, + parameters: { + serializedName: "parameters", + type: { + name: "Object" + } + }, + parametersLink: { + serializedName: "parametersLink", + type: { + name: "Composite", + className: "ParametersLink" + } + }, + mode: { + serializedName: "mode", + type: { + name: "Enum", + allowedValues: [ + "Incremental", + "Complete" + ] + } + }, + debugSetting: { + serializedName: "debugSetting", + type: { + name: "Composite", + className: "DebugSetting" + } + }, + onErrorDeployment: { + serializedName: "onErrorDeployment", + type: { + name: "Composite", + className: "OnErrorDeploymentExtended" + } + } + } + } +}; + +export const DeploymentValidateResult: msRest.CompositeMapper = { + serializedName: "DeploymentValidateResult", + type: { + name: "Composite", + className: "DeploymentValidateResult", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ResourceManagementErrorWithDetails" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "DeploymentPropertiesExtended" + } + } + } + } +}; + +export const DeploymentExtended: msRest.CompositeMapper = { + serializedName: "DeploymentExtended", + type: { + name: "Composite", + className: "DeploymentExtended", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "DeploymentPropertiesExtended" + } + } + } + } +}; + +export const Plan: msRest.CompositeMapper = { + serializedName: "Plan", + type: { + name: "Composite", + className: "Plan", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + publisher: { + serializedName: "publisher", + type: { + name: "String" + } + }, + product: { + serializedName: "product", + type: { + name: "String" + } + }, + promotionCode: { + serializedName: "promotionCode", + type: { + name: "String" + } + }, + version: { + serializedName: "version", + type: { + name: "String" + } + } + } + } +}; + +export const Sku: msRest.CompositeMapper = { + serializedName: "Sku", + type: { + name: "Composite", + className: "Sku", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + tier: { + serializedName: "tier", + type: { + name: "String" + } + }, + size: { + serializedName: "size", + type: { + name: "String" + } + }, + family: { + serializedName: "family", + type: { + name: "String" + } + }, + model: { + serializedName: "model", + type: { + name: "String" + } + }, + capacity: { + serializedName: "capacity", + type: { + name: "Number" + } + } + } + } +}; + +export const IdentityUserAssignedIdentitiesValue: msRest.CompositeMapper = { + serializedName: "Identity_userAssignedIdentitiesValue", + type: { + name: "Composite", + className: "IdentityUserAssignedIdentitiesValue", + modelProperties: { + principalId: { + readOnly: true, + serializedName: "principalId", + type: { + name: "String" + } + }, + clientId: { + readOnly: true, + serializedName: "clientId", + type: { + name: "String" + } + } + } + } +}; + +export const Identity: msRest.CompositeMapper = { + serializedName: "Identity", + type: { + name: "Composite", + className: "Identity", + modelProperties: { + principalId: { + readOnly: true, + serializedName: "principalId", + type: { + name: "String" + } + }, + tenantId: { + readOnly: true, + serializedName: "tenantId", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "Enum", + allowedValues: [ + "SystemAssigned", + "UserAssigned", + "SystemAssigned, UserAssigned", + "None" + ] + } + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { + name: "Composite", + className: "IdentityUserAssignedIdentitiesValue" + } + } + } + } + } + } +}; + +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" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const GenericResource: msRest.CompositeMapper = { + serializedName: "GenericResource", + type: { + name: "Composite", + className: "GenericResource", + modelProperties: { + ...Resource.type.modelProperties, + plan: { + serializedName: "plan", + type: { + name: "Composite", + className: "Plan" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Object" + } + }, + kind: { + serializedName: "kind", + constraints: { + Pattern: /^[-\w\._,\(\)]+$/ + }, + type: { + name: "String" + } + }, + managedBy: { + serializedName: "managedBy", + type: { + name: "String" + } + }, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku" + } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity" + } + } + } + } +}; + +export const ResourceGroupProperties: msRest.CompositeMapper = { + serializedName: "ResourceGroupProperties", + type: { + name: "Composite", + className: "ResourceGroupProperties", + modelProperties: { + provisioningState: { + readOnly: true, + serializedName: "provisioningState", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceGroup: msRest.CompositeMapper = { + serializedName: "ResourceGroup", + type: { + name: "Composite", + className: "ResourceGroup", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "ResourceGroupProperties" + } + }, + location: { + required: true, + serializedName: "location", + type: { + name: "String" + } + }, + managedBy: { + serializedName: "managedBy", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const ResourceGroupPatchable: msRest.CompositeMapper = { + serializedName: "ResourceGroupPatchable", + type: { + name: "Composite", + className: "ResourceGroupPatchable", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "ResourceGroupProperties" + } + }, + managedBy: { + serializedName: "managedBy", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const ResourcesMoveInfo: msRest.CompositeMapper = { + serializedName: "ResourcesMoveInfo", + type: { + name: "Composite", + className: "ResourcesMoveInfo", + modelProperties: { + resources: { + serializedName: "resources", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + targetResourceGroup: { + serializedName: "targetResourceGroup", + type: { + name: "String" + } + } + } + } +}; + +export const ExportTemplateRequest: msRest.CompositeMapper = { + serializedName: "ExportTemplateRequest", + type: { + name: "Composite", + className: "ExportTemplateRequest", + modelProperties: { + resources: { + serializedName: "resources", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + options: { + serializedName: "options", + type: { + name: "String" + } + } + } + } +}; + +export const TagCount: msRest.CompositeMapper = { + serializedName: "TagCount", + type: { + name: "Composite", + className: "TagCount", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Number" + } + } + } + } +}; + +export const TagValue: msRest.CompositeMapper = { + serializedName: "TagValue", + type: { + name: "Composite", + className: "TagValue", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + tagValue: { + serializedName: "tagValue", + type: { + name: "String" + } + }, + count: { + serializedName: "count", + type: { + name: "Composite", + className: "TagCount" + } + } + } + } +}; + +export const TagDetails: msRest.CompositeMapper = { + serializedName: "TagDetails", + type: { + name: "Composite", + className: "TagDetails", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + tagName: { + serializedName: "tagName", + type: { + name: "String" + } + }, + count: { + serializedName: "count", + type: { + name: "Composite", + className: "TagCount" + } + }, + values: { + serializedName: "values", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TagValue" + } + } + } + } + } + } +}; + +export const TargetResource: msRest.CompositeMapper = { + serializedName: "TargetResource", + type: { + name: "Composite", + className: "TargetResource", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + resourceName: { + serializedName: "resourceName", + type: { + name: "String" + } + }, + resourceType: { + serializedName: "resourceType", + type: { + name: "String" + } + } + } + } +}; + +export const HttpMessage: msRest.CompositeMapper = { + serializedName: "HttpMessage", + type: { + name: "Composite", + className: "HttpMessage", + modelProperties: { + content: { + serializedName: "content", + type: { + name: "Object" + } + } + } + } +}; + +export const DeploymentOperationProperties: msRest.CompositeMapper = { + serializedName: "DeploymentOperationProperties", + type: { + name: "Composite", + className: "DeploymentOperationProperties", + modelProperties: { + provisioningState: { + readOnly: true, + serializedName: "provisioningState", + type: { + name: "String" + } + }, + timestamp: { + readOnly: true, + serializedName: "timestamp", + type: { + name: "DateTime" + } + }, + serviceRequestId: { + readOnly: true, + serializedName: "serviceRequestId", + type: { + name: "String" + } + }, + statusCode: { + readOnly: true, + serializedName: "statusCode", + type: { + name: "String" + } + }, + statusMessage: { + readOnly: true, + serializedName: "statusMessage", + type: { + name: "Object" + } + }, + targetResource: { + readOnly: true, + serializedName: "targetResource", + type: { + name: "Composite", + className: "TargetResource" + } + }, + request: { + readOnly: true, + serializedName: "request", + type: { + name: "Composite", + className: "HttpMessage" + } + }, + response: { + readOnly: true, + serializedName: "response", + type: { + name: "Composite", + className: "HttpMessage" + } + } + } + } +}; + +export const DeploymentOperation: msRest.CompositeMapper = { + serializedName: "DeploymentOperation", + type: { + name: "Composite", + className: "DeploymentOperation", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + operationId: { + readOnly: true, + serializedName: "operationId", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "DeploymentOperationProperties" + } + } + } + } +}; + +export const ResourceProviderOperationDisplayProperties: msRest.CompositeMapper = { + serializedName: "ResourceProviderOperationDisplayProperties", + type: { + name: "Composite", + className: "ResourceProviderOperationDisplayProperties", + modelProperties: { + publisher: { + serializedName: "publisher", + type: { + name: "String" + } + }, + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const SubResource: msRest.CompositeMapper = { + serializedName: "SubResource", + type: { + name: "Composite", + className: "SubResource", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceGroupExportResult: msRest.CompositeMapper = { + serializedName: "ResourceGroupExportResult", + type: { + name: "Composite", + className: "ResourceGroupExportResult", + modelProperties: { + template: { + serializedName: "template", + type: { + name: "Object" + } + }, + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ResourceManagementErrorWithDetails" + } + } + } + } +}; + +export const OperationDisplay: msRest.CompositeMapper = { + serializedName: "Operation_display", + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const Operation: msRest.CompositeMapper = { + serializedName: "Operation", + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + } + } + } +}; + +export const OperationListResult: msRest.CompositeMapper = { + serializedName: "OperationListResult", + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const DeploymentListResult: msRest.CompositeMapper = { + serializedName: "DeploymentListResult", + type: { + name: "Composite", + className: "DeploymentListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DeploymentExtended" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ProviderListResult: msRest.CompositeMapper = { + serializedName: "ProviderListResult", + type: { + name: "Composite", + className: "ProviderListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Provider" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceListResult: msRest.CompositeMapper = { + serializedName: "ResourceListResult", + type: { + name: "Composite", + className: "ResourceListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "GenericResource" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceGroupListResult: msRest.CompositeMapper = { + serializedName: "ResourceGroupListResult", + type: { + name: "Composite", + className: "ResourceGroupListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceGroup" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const TagsListResult: msRest.CompositeMapper = { + serializedName: "TagsListResult", + type: { + name: "Composite", + className: "TagsListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TagDetails" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const DeploymentOperationsListResult: msRest.CompositeMapper = { + serializedName: "DeploymentOperationsListResult", + type: { + name: "Composite", + className: "DeploymentOperationsListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DeploymentOperation" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/packages/@azure/arm-resources/lib/models/operationsMappers.ts b/packages/@azure/arm-resources/lib/models/operationsMappers.ts new file mode 100644 index 000000000000..2edcc577920e --- /dev/null +++ b/packages/@azure/arm-resources/lib/models/operationsMappers.ts @@ -0,0 +1,17 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + OperationListResult, + Operation, + OperationDisplay, + CloudError +} from "../models/mappers"; + diff --git a/packages/@azure/arm-resources/lib/models/parameters.ts b/packages/@azure/arm-resources/lib/models/parameters.ts new file mode 100644 index 000000000000..1c5c483d292c --- /dev/null +++ b/packages/@azure/arm-resources/lib/models/parameters.ts @@ -0,0 +1,217 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; + +export const acceptLanguage: msRest.OperationParameter = { + parameterPath: "acceptLanguage", + mapper: { + serializedName: "accept-language", + defaultValue: 'en-US', + type: { + name: "String" + } + } +}; +export const apiVersion: msRest.OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + required: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; +export const deploymentName: msRest.OperationURLParameter = { + parameterPath: "deploymentName", + mapper: { + required: true, + serializedName: "deploymentName", + constraints: { + MaxLength: 64, + MinLength: 1, + Pattern: /^[-\w\._\(\)]+$/ + }, + type: { + name: "String" + } + } +}; +export const expand: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "expand" + ], + mapper: { + serializedName: "$expand", + type: { + name: "String" + } + } +}; +export const filter: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "filter" + ], + mapper: { + serializedName: "$filter", + type: { + name: "String" + } + } +}; +export const nextPageLink: msRest.OperationURLParameter = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const operationId: msRest.OperationURLParameter = { + parameterPath: "operationId", + mapper: { + required: true, + serializedName: "operationId", + type: { + name: "String" + } + } +}; +export const parentResourcePath: msRest.OperationURLParameter = { + parameterPath: "parentResourcePath", + mapper: { + required: true, + serializedName: "parentResourcePath", + 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" + } + } +}; +export const resourceId: msRest.OperationURLParameter = { + parameterPath: "resourceId", + mapper: { + required: true, + serializedName: "resourceId", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const resourceName: msRest.OperationURLParameter = { + parameterPath: "resourceName", + mapper: { + required: true, + serializedName: "resourceName", + type: { + name: "String" + } + } +}; +export const resourceProviderNamespace: msRest.OperationURLParameter = { + parameterPath: "resourceProviderNamespace", + mapper: { + required: true, + serializedName: "resourceProviderNamespace", + type: { + name: "String" + } + } +}; +export const resourceType: msRest.OperationURLParameter = { + parameterPath: "resourceType", + mapper: { + required: true, + serializedName: "resourceType", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const sourceResourceGroupName: msRest.OperationURLParameter = { + parameterPath: "sourceResourceGroupName", + mapper: { + required: true, + serializedName: "sourceResourceGroupName", + constraints: { + MaxLength: 90, + MinLength: 1, + Pattern: /^[-\w\._\(\)]+$/ + }, + type: { + name: "String" + } + } +}; +export const subscriptionId: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + type: { + name: "String" + } + } +}; +export const tagName: msRest.OperationURLParameter = { + parameterPath: "tagName", + mapper: { + required: true, + serializedName: "tagName", + type: { + name: "String" + } + } +}; +export const tagValue: msRest.OperationURLParameter = { + parameterPath: "tagValue", + mapper: { + required: true, + serializedName: "tagValue", + type: { + name: "String" + } + } +}; +export const top: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "top" + ], + mapper: { + serializedName: "$top", + type: { + name: "Number" + } + } +}; diff --git a/packages/@azure/arm-resources/lib/models/providersMappers.ts b/packages/@azure/arm-resources/lib/models/providersMappers.ts new file mode 100644 index 000000000000..98f3b160d8f5 --- /dev/null +++ b/packages/@azure/arm-resources/lib/models/providersMappers.ts @@ -0,0 +1,19 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + Provider, + ProviderResourceType, + AliasType, + AliasPathType, + CloudError, + ProviderListResult +} from "../models/mappers"; + diff --git a/packages/@azure/arm-resources/lib/models/resourceGroupsMappers.ts b/packages/@azure/arm-resources/lib/models/resourceGroupsMappers.ts new file mode 100644 index 000000000000..4806ec8af2df --- /dev/null +++ b/packages/@azure/arm-resources/lib/models/resourceGroupsMappers.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + CloudError, + ResourceGroup, + BaseResource, + ResourceGroupProperties, + ResourceGroupPatchable, + ExportTemplateRequest, + ResourceGroupExportResult, + ResourceManagementErrorWithDetails, + ResourceGroupListResult, + DeploymentExtended, + DeploymentPropertiesExtended, + Provider, + ProviderResourceType, + AliasType, + AliasPathType, + Dependency, + BasicDependency, + TemplateLink, + ParametersLink, + DebugSetting, + OnErrorDeploymentExtended, + TagValue, + TagCount, + Resource, + SubResource, + GenericResource, + Plan, + Sku, + Identity, + IdentityUserAssignedIdentitiesValue +} from "../models/mappers"; + diff --git a/packages/@azure/arm-resources/lib/models/resourcesMappers.ts b/packages/@azure/arm-resources/lib/models/resourcesMappers.ts new file mode 100644 index 000000000000..ab25fa0e3fca --- /dev/null +++ b/packages/@azure/arm-resources/lib/models/resourcesMappers.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + ResourceListResult, + GenericResource, + Resource, + BaseResource, + Plan, + Sku, + Identity, + IdentityUserAssignedIdentitiesValue, + CloudError, + ResourcesMoveInfo, + DeploymentExtended, + DeploymentPropertiesExtended, + Provider, + ProviderResourceType, + AliasType, + AliasPathType, + Dependency, + BasicDependency, + TemplateLink, + ParametersLink, + DebugSetting, + OnErrorDeploymentExtended, + ResourceGroup, + ResourceGroupProperties, + TagValue, + TagCount, + SubResource +} from "../models/mappers"; + diff --git a/packages/@azure/arm-resources/lib/models/tagsMappers.ts b/packages/@azure/arm-resources/lib/models/tagsMappers.ts new file mode 100644 index 000000000000..01caec9196c7 --- /dev/null +++ b/packages/@azure/arm-resources/lib/models/tagsMappers.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + CloudError, + TagValue, + BaseResource, + TagCount, + TagDetails, + TagsListResult, + DeploymentExtended, + DeploymentPropertiesExtended, + Provider, + ProviderResourceType, + AliasType, + AliasPathType, + Dependency, + BasicDependency, + TemplateLink, + ParametersLink, + DebugSetting, + OnErrorDeploymentExtended, + ResourceGroup, + ResourceGroupProperties, + Resource, + SubResource, + GenericResource, + Plan, + Sku, + Identity, + IdentityUserAssignedIdentitiesValue +} from "../models/mappers"; + diff --git a/packages/@azure/arm-resources/lib/operations/deploymentOperations.ts b/packages/@azure/arm-resources/lib/operations/deploymentOperations.ts new file mode 100644 index 000000000000..25cc8fd13607 --- /dev/null +++ b/packages/@azure/arm-resources/lib/operations/deploymentOperations.ts @@ -0,0 +1,358 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/deploymentOperationsMappers"; +import * as Parameters from "../models/parameters"; +import { ResourceManagementClientContext } from "../resourceManagementClientContext"; + +/** Class representing a DeploymentOperations. */ +export class DeploymentOperations { + private readonly client: ResourceManagementClientContext; + + /** + * Create a DeploymentOperations. + * @param {ResourceManagementClientContext} client Reference to the service client. + */ + constructor(client: ResourceManagementClientContext) { + this.client = client; + } + + /** + * Gets a deployments operation. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param [options] The optional parameters + * @returns Promise + */ + getAtSubscriptionScope(deploymentName: string, operationId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param callback The callback + */ + getAtSubscriptionScope(deploymentName: string, operationId: string, callback: msRest.ServiceCallback): void; + /** + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param options The optional parameters + * @param callback The callback + */ + getAtSubscriptionScope(deploymentName: string, operationId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getAtSubscriptionScope(deploymentName: string, operationId: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + deploymentName, + operationId, + options + }, + getAtSubscriptionScopeOperationSpec, + callback) as Promise; + } + + /** + * Gets all deployments operations for a deployment. + * @param deploymentName The name of the deployment with the operation to get. + * @param [options] The optional parameters + * @returns Promise + */ + listAtSubscriptionScope(deploymentName: string, options?: Models.DeploymentOperationsListAtSubscriptionScopeOptionalParams): Promise; + /** + * @param deploymentName The name of the deployment with the operation to get. + * @param callback The callback + */ + listAtSubscriptionScope(deploymentName: string, callback: msRest.ServiceCallback): void; + /** + * @param deploymentName The name of the deployment with the operation to get. + * @param options The optional parameters + * @param callback The callback + */ + listAtSubscriptionScope(deploymentName: string, options: Models.DeploymentOperationsListAtSubscriptionScopeOptionalParams, callback: msRest.ServiceCallback): void; + listAtSubscriptionScope(deploymentName: string, options?: Models.DeploymentOperationsListAtSubscriptionScopeOptionalParams, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + deploymentName, + options + }, + listAtSubscriptionScopeOperationSpec, + callback) as Promise; + } + + /** + * Gets a deployments operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, deploymentName: string, operationId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param callback The callback + */ + get(resourceGroupName: string, deploymentName: string, operationId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, deploymentName: string, operationId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, deploymentName: string, operationId: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + deploymentName, + operationId, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Gets all deployments operations for a deployment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment with the operation to get. + * @param [options] The optional parameters + * @returns Promise + */ + list(resourceGroupName: string, deploymentName: string, options?: Models.DeploymentOperationsListOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment with the operation to get. + * @param callback The callback + */ + list(resourceGroupName: string, deploymentName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment with the operation to get. + * @param options The optional parameters + * @param callback The callback + */ + list(resourceGroupName: string, deploymentName: string, options: Models.DeploymentOperationsListOptionalParams, callback: msRest.ServiceCallback): void; + list(resourceGroupName: string, deploymentName: string, options?: Models.DeploymentOperationsListOptionalParams, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + deploymentName, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Gets all deployments operations for a deployment. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listAtSubscriptionScopeNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listAtSubscriptionScopeNext(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 + */ + listAtSubscriptionScopeNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listAtSubscriptionScopeNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listAtSubscriptionScopeNextOperationSpec, + callback) as Promise; + } + + /** + * Gets all deployments operations for a deployment. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(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 + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}", + urlParameters: [ + Parameters.deploymentName, + Parameters.operationId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DeploymentOperation + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations", + urlParameters: [ + Parameters.deploymentName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.top, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DeploymentOperationsListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations/{operationId}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.deploymentName, + Parameters.operationId, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DeploymentOperation + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.deploymentName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.top, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DeploymentOperationsListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listAtSubscriptionScopeNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DeploymentOperationsListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DeploymentOperationsListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/@azure/arm-resources/lib/operations/deployments.ts b/packages/@azure/arm-resources/lib/operations/deployments.ts new file mode 100644 index 000000000000..bb0199508c48 --- /dev/null +++ b/packages/@azure/arm-resources/lib/operations/deployments.ts @@ -0,0 +1,1092 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; +import * as msRestAzure from "ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/deploymentsMappers"; +import * as Parameters from "../models/parameters"; +import { ResourceManagementClientContext } from "../resourceManagementClientContext"; + +/** Class representing a Deployments. */ +export class Deployments { + private readonly client: ResourceManagementClientContext; + + /** + * Create a Deployments. + * @param {ResourceManagementClientContext} client Reference to the service client. + */ + constructor(client: ResourceManagementClientContext) { + this.client = client; + } + + /** + * A template deployment that is currently running cannot be deleted. Deleting a template + * deployment removes the associated deployment operations. This is an asynchronous operation that + * returns a status of 202 until the template deployment is successfully deleted. The Location + * response header contains the URI that is used to obtain the status of the process. While the + * process is running, a call to the URI in the Location header returns a status of 202. When the + * process finishes, the URI in the Location header returns a status of 204 on success. If the + * asynchronous request failed, the URI in the Location header returns an error-level status code. + * @summary Deletes a deployment from the deployment history. + * @param deploymentName The name of the deployment to delete. + * @param [options] The optional parameters + * @returns Promise + */ + deleteAtSubscriptionScope(deploymentName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteAtSubscriptionScope(deploymentName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Checks whether the deployment exists. + * @param deploymentName The name of the deployment to check. + * @param [options] The optional parameters + * @returns Promise + */ + checkExistenceAtSubscriptionScope(deploymentName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param deploymentName The name of the deployment to check. + * @param callback The callback + */ + checkExistenceAtSubscriptionScope(deploymentName: string, callback: msRest.ServiceCallback): void; + /** + * @param deploymentName The name of the deployment to check. + * @param options The optional parameters + * @param callback The callback + */ + checkExistenceAtSubscriptionScope(deploymentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + checkExistenceAtSubscriptionScope(deploymentName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + deploymentName, + options + }, + checkExistenceAtSubscriptionScopeOperationSpec, + callback) as Promise; + } + + /** + * You can provide the template and parameters directly in the request or link to JSON files. + * @summary Deploys resources at subscription scope. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateAtSubscriptionScope(deploymentName: string, parameters: Models.Deployment, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdateAtSubscriptionScope(deploymentName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Gets a deployment. + * @param deploymentName The name of the deployment to get. + * @param [options] The optional parameters + * @returns Promise + */ + getAtSubscriptionScope(deploymentName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param deploymentName The name of the deployment to get. + * @param callback The callback + */ + getAtSubscriptionScope(deploymentName: string, callback: msRest.ServiceCallback): void; + /** + * @param deploymentName The name of the deployment to get. + * @param options The optional parameters + * @param callback The callback + */ + getAtSubscriptionScope(deploymentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getAtSubscriptionScope(deploymentName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + deploymentName, + options + }, + getAtSubscriptionScopeOperationSpec, + callback) as Promise; + } + + /** + * You can cancel a deployment only if the provisioningState is Accepted or Running. After the + * deployment is canceled, the provisioningState is set to Canceled. Canceling a template + * deployment stops the currently running template deployment and leaves the resources partially + * deployed. + * @summary Cancels a currently running template deployment. + * @param deploymentName The name of the deployment to cancel. + * @param [options] The optional parameters + * @returns Promise + */ + cancelAtSubscriptionScope(deploymentName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param deploymentName The name of the deployment to cancel. + * @param callback The callback + */ + cancelAtSubscriptionScope(deploymentName: string, callback: msRest.ServiceCallback): void; + /** + * @param deploymentName The name of the deployment to cancel. + * @param options The optional parameters + * @param callback The callback + */ + cancelAtSubscriptionScope(deploymentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + cancelAtSubscriptionScope(deploymentName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + deploymentName, + options + }, + cancelAtSubscriptionScopeOperationSpec, + callback); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure + * Resource Manager.. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param [options] The optional parameters + * @returns Promise + */ + validateAtSubscriptionScope(deploymentName: string, parameters: Models.Deployment, options?: msRest.RequestOptionsBase): Promise; + /** + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param callback The callback + */ + validateAtSubscriptionScope(deploymentName: string, parameters: Models.Deployment, callback: msRest.ServiceCallback): void; + /** + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param options The optional parameters + * @param callback The callback + */ + validateAtSubscriptionScope(deploymentName: string, parameters: Models.Deployment, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + validateAtSubscriptionScope(deploymentName: string, parameters: Models.Deployment, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + deploymentName, + parameters, + options + }, + validateAtSubscriptionScopeOperationSpec, + callback) as Promise; + } + + /** + * Exports the template used for specified deployment. + * @param deploymentName The name of the deployment from which to get the template. + * @param [options] The optional parameters + * @returns Promise + */ + exportTemplateAtSubscriptionScope(deploymentName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param deploymentName The name of the deployment from which to get the template. + * @param callback The callback + */ + exportTemplateAtSubscriptionScope(deploymentName: string, callback: msRest.ServiceCallback): void; + /** + * @param deploymentName The name of the deployment from which to get the template. + * @param options The optional parameters + * @param callback The callback + */ + exportTemplateAtSubscriptionScope(deploymentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + exportTemplateAtSubscriptionScope(deploymentName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + deploymentName, + options + }, + exportTemplateAtSubscriptionScopeOperationSpec, + callback) as Promise; + } + + /** + * Get all the deployments for a subscription. + * @param [options] The optional parameters + * @returns Promise + */ + listAtSubscriptionScope(options?: Models.DeploymentsListAtSubscriptionScopeOptionalParams): Promise; + /** + * @param callback The callback + */ + listAtSubscriptionScope(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listAtSubscriptionScope(options: Models.DeploymentsListAtSubscriptionScopeOptionalParams, callback: msRest.ServiceCallback): void; + listAtSubscriptionScope(options?: Models.DeploymentsListAtSubscriptionScopeOptionalParams, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listAtSubscriptionScopeOperationSpec, + callback) as Promise; + } + + /** + * A template deployment that is currently running cannot be deleted. Deleting a template + * deployment removes the associated deployment operations. Deleting a template deployment does not + * affect the state of the resource group. This is an asynchronous operation that returns a status + * of 202 until the template deployment is successfully deleted. The Location response header + * contains the URI that is used to obtain the status of the process. While the process is running, + * a call to the URI in the Location header returns a status of 202. When the process finishes, the + * URI in the Location header returns a status of 204 on success. If the asynchronous request + * failed, the URI in the Location header returns an error-level status code. + * @summary Deletes a deployment from the deployment history. + * @param resourceGroupName The name of the resource group with the deployment to delete. The name + * is case insensitive. + * @param deploymentName The name of the deployment to delete. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, deploymentName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,deploymentName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Checks whether the deployment exists. + * @param resourceGroupName The name of the resource group with the deployment to check. The name + * is case insensitive. + * @param deploymentName The name of the deployment to check. + * @param [options] The optional parameters + * @returns Promise + */ + checkExistence(resourceGroupName: string, deploymentName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group with the deployment to check. The name + * is case insensitive. + * @param deploymentName The name of the deployment to check. + * @param callback The callback + */ + checkExistence(resourceGroupName: string, deploymentName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group with the deployment to check. The name + * is case insensitive. + * @param deploymentName The name of the deployment to check. + * @param options The optional parameters + * @param callback The callback + */ + checkExistence(resourceGroupName: string, deploymentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + checkExistence(resourceGroupName: string, deploymentName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + deploymentName, + options + }, + checkExistenceOperationSpec, + callback) as Promise; + } + + /** + * You can provide the template and parameters directly in the request or link to JSON files. + * @summary Deploys resources to a resource group. + * @param resourceGroupName The name of the resource group to deploy the resources to. The name is + * case insensitive. The resource group must already exist. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, deploymentName: string, parameters: Models.Deployment, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdate(resourceGroupName,deploymentName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Gets a deployment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment to get. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, deploymentName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment to get. + * @param callback The callback + */ + get(resourceGroupName: string, deploymentName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment to get. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, deploymentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, deploymentName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + deploymentName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * You can cancel a deployment only if the provisioningState is Accepted or Running. After the + * deployment is canceled, the provisioningState is set to Canceled. Canceling a template + * deployment stops the currently running template deployment and leaves the resource group + * partially deployed. + * @summary Cancels a currently running template deployment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment to cancel. + * @param [options] The optional parameters + * @returns Promise + */ + cancel(resourceGroupName: string, deploymentName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment to cancel. + * @param callback The callback + */ + cancel(resourceGroupName: string, deploymentName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment to cancel. + * @param options The optional parameters + * @param callback The callback + */ + cancel(resourceGroupName: string, deploymentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + cancel(resourceGroupName: string, deploymentName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + deploymentName, + options + }, + cancelOperationSpec, + callback); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure + * Resource Manager.. + * @param resourceGroupName The name of the resource group the template will be deployed to. The + * name is case insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param [options] The optional parameters + * @returns Promise + */ + validate(resourceGroupName: string, deploymentName: string, parameters: Models.Deployment, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group the template will be deployed to. The + * name is case insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param callback The callback + */ + validate(resourceGroupName: string, deploymentName: string, parameters: Models.Deployment, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group the template will be deployed to. The + * name is case insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param options The optional parameters + * @param callback The callback + */ + validate(resourceGroupName: string, deploymentName: string, parameters: Models.Deployment, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + validate(resourceGroupName: string, deploymentName: string, parameters: Models.Deployment, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + deploymentName, + parameters, + options + }, + validateOperationSpec, + callback) as Promise; + } + + /** + * Exports the template used for specified deployment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment from which to get the template. + * @param [options] The optional parameters + * @returns Promise + */ + exportTemplate(resourceGroupName: string, deploymentName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment from which to get the template. + * @param callback The callback + */ + exportTemplate(resourceGroupName: string, deploymentName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment from which to get the template. + * @param options The optional parameters + * @param callback The callback + */ + exportTemplate(resourceGroupName: string, deploymentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + exportTemplate(resourceGroupName: string, deploymentName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + deploymentName, + options + }, + exportTemplateOperationSpec, + callback) as Promise; + } + + /** + * Get all the deployments for a resource group. + * @param resourceGroupName The name of the resource group with the deployments to get. The name is + * case insensitive. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroup(resourceGroupName: string, options?: Models.DeploymentsListByResourceGroupOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group with the deployments to get. The name is + * case insensitive. + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group with the deployments to get. The name is + * case insensitive. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, options: Models.DeploymentsListByResourceGroupOptionalParams, callback: msRest.ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: Models.DeploymentsListByResourceGroupOptionalParams, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + options + }, + listByResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * A template deployment that is currently running cannot be deleted. Deleting a template + * deployment removes the associated deployment operations. This is an asynchronous operation that + * returns a status of 202 until the template deployment is successfully deleted. The Location + * response header contains the URI that is used to obtain the status of the process. While the + * process is running, a call to the URI in the Location header returns a status of 202. When the + * process finishes, the URI in the Location header returns a status of 204 on success. If the + * asynchronous request failed, the URI in the Location header returns an error-level status code. + * @summary Deletes a deployment from the deployment history. + * @param deploymentName The name of the deployment to delete. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteAtSubscriptionScope(deploymentName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + deploymentName, + options + }, + beginDeleteAtSubscriptionScopeOperationSpec, + options); + } + + /** + * You can provide the template and parameters directly in the request or link to JSON files. + * @summary Deploys resources at subscription scope. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdateAtSubscriptionScope(deploymentName: string, parameters: Models.Deployment, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + deploymentName, + parameters, + options + }, + beginCreateOrUpdateAtSubscriptionScopeOperationSpec, + options); + } + + /** + * A template deployment that is currently running cannot be deleted. Deleting a template + * deployment removes the associated deployment operations. Deleting a template deployment does not + * affect the state of the resource group. This is an asynchronous operation that returns a status + * of 202 until the template deployment is successfully deleted. The Location response header + * contains the URI that is used to obtain the status of the process. While the process is running, + * a call to the URI in the Location header returns a status of 202. When the process finishes, the + * URI in the Location header returns a status of 204 on success. If the asynchronous request + * failed, the URI in the Location header returns an error-level status code. + * @summary Deletes a deployment from the deployment history. + * @param resourceGroupName The name of the resource group with the deployment to delete. The name + * is case insensitive. + * @param deploymentName The name of the deployment to delete. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, deploymentName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + deploymentName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * You can provide the template and parameters directly in the request or link to JSON files. + * @summary Deploys resources to a resource group. + * @param resourceGroupName The name of the resource group to deploy the resources to. The name is + * case insensitive. The resource group must already exist. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdate(resourceGroupName: string, deploymentName: string, parameters: Models.Deployment, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + deploymentName, + parameters, + options + }, + beginCreateOrUpdateOperationSpec, + options); + } + + /** + * Get all the deployments for a subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listAtSubscriptionScopeNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listAtSubscriptionScopeNext(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 + */ + listAtSubscriptionScopeNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listAtSubscriptionScopeNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listAtSubscriptionScopeNextOperationSpec, + callback) as Promise; + } + + /** + * Get all the deployments for a resource group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + 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 + */ + listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByResourceGroupNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const checkExistenceAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "HEAD", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", + urlParameters: [ + Parameters.deploymentName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", + urlParameters: [ + Parameters.deploymentName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DeploymentExtended + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const cancelAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", + urlParameters: [ + Parameters.deploymentName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const validateAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", + urlParameters: [ + Parameters.deploymentName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.Deployment, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.DeploymentValidateResult + }, + 400: { + bodyMapper: Mappers.DeploymentValidateResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const exportTemplateAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", + urlParameters: [ + Parameters.deploymentName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DeploymentExportResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.filter, + Parameters.top, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DeploymentListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const checkExistenceOperationSpec: msRest.OperationSpec = { + httpMethod: "HEAD", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.deploymentName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.deploymentName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DeploymentExtended + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const cancelOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.deploymentName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const validateOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.deploymentName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.Deployment, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.DeploymentValidateResult + }, + 400: { + bodyMapper: Mappers.DeploymentValidateResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const exportTemplateOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.deploymentName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DeploymentExportResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.filter, + Parameters.top, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DeploymentListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginDeleteAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", + urlParameters: [ + Parameters.deploymentName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginCreateOrUpdateAtSubscriptionScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", + urlParameters: [ + Parameters.deploymentName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.Deployment, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.DeploymentExtended + }, + 201: { + bodyMapper: Mappers.DeploymentExtended + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.deploymentName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.deploymentName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.Deployment, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.DeploymentExtended + }, + 201: { + bodyMapper: Mappers.DeploymentExtended + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listAtSubscriptionScopeNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DeploymentListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DeploymentListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/@azure/arm-resources/lib/operations/index.ts b/packages/@azure/arm-resources/lib/operations/index.ts new file mode 100644 index 000000000000..542b40b96c2d --- /dev/null +++ b/packages/@azure/arm-resources/lib/operations/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export * from "./operations"; +export * from "./deployments"; +export * from "./providers"; +export * from "./resources"; +export * from "./resourceGroups"; +export * from "./tags"; +export * from "./deploymentOperations"; diff --git a/packages/@azure/arm-resources/lib/operations/operations.ts b/packages/@azure/arm-resources/lib/operations/operations.ts new file mode 100644 index 000000000000..9b2b25a60d6e --- /dev/null +++ b/packages/@azure/arm-resources/lib/operations/operations.ts @@ -0,0 +1,123 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/operationsMappers"; +import * as Parameters from "../models/parameters"; +import { ResourceManagementClientContext } from "../resourceManagementClientContext"; + +/** Class representing a Operations. */ +export class Operations { + private readonly client: ResourceManagementClientContext; + + /** + * Create a Operations. + * @param {ResourceManagementClientContext} client Reference to the service client. + */ + constructor(client: ResourceManagementClientContext) { + this.client = client; + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(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 + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Resources/operations", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/@azure/arm-resources/lib/operations/providers.ts b/packages/@azure/arm-resources/lib/operations/providers.ts new file mode 100644 index 000000000000..30d8ef348c26 --- /dev/null +++ b/packages/@azure/arm-resources/lib/operations/providers.ts @@ -0,0 +1,285 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/providersMappers"; +import * as Parameters from "../models/parameters"; +import { ResourceManagementClientContext } from "../resourceManagementClientContext"; + +/** Class representing a Providers. */ +export class Providers { + private readonly client: ResourceManagementClientContext; + + /** + * Create a Providers. + * @param {ResourceManagementClientContext} client Reference to the service client. + */ + constructor(client: ResourceManagementClientContext) { + this.client = client; + } + + /** + * Unregisters a subscription from a resource provider. + * @param resourceProviderNamespace The namespace of the resource provider to unregister. + * @param [options] The optional parameters + * @returns Promise + */ + unregister(resourceProviderNamespace: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceProviderNamespace The namespace of the resource provider to unregister. + * @param callback The callback + */ + unregister(resourceProviderNamespace: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceProviderNamespace The namespace of the resource provider to unregister. + * @param options The optional parameters + * @param callback The callback + */ + unregister(resourceProviderNamespace: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + unregister(resourceProviderNamespace: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceProviderNamespace, + options + }, + unregisterOperationSpec, + callback) as Promise; + } + + /** + * Registers a subscription with a resource provider. + * @param resourceProviderNamespace The namespace of the resource provider to register. + * @param [options] The optional parameters + * @returns Promise + */ + register(resourceProviderNamespace: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceProviderNamespace The namespace of the resource provider to register. + * @param callback The callback + */ + register(resourceProviderNamespace: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceProviderNamespace The namespace of the resource provider to register. + * @param options The optional parameters + * @param callback The callback + */ + register(resourceProviderNamespace: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + register(resourceProviderNamespace: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceProviderNamespace, + options + }, + registerOperationSpec, + callback) as Promise; + } + + /** + * Gets all resource providers for a subscription. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: Models.ProvidersListOptionalParams): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: Models.ProvidersListOptionalParams, callback: msRest.ServiceCallback): void; + list(options?: Models.ProvidersListOptionalParams, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Gets the specified resource provider. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceProviderNamespace: string, options?: Models.ProvidersGetOptionalParams): Promise; + /** + * @param resourceProviderNamespace The namespace of the resource provider. + * @param callback The callback + */ + get(resourceProviderNamespace: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceProviderNamespace The namespace of the resource provider. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceProviderNamespace: string, options: Models.ProvidersGetOptionalParams, callback: msRest.ServiceCallback): void; + get(resourceProviderNamespace: string, options?: Models.ProvidersGetOptionalParams, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceProviderNamespace, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Gets all resource providers for a subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(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 + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const unregisterOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/unregister", + urlParameters: [ + Parameters.resourceProviderNamespace, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Provider + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const registerOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register", + urlParameters: [ + Parameters.resourceProviderNamespace, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Provider + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.top, + Parameters.expand, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProviderListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}", + urlParameters: [ + Parameters.resourceProviderNamespace, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.expand, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Provider + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ProviderListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/@azure/arm-resources/lib/operations/resourceGroups.ts b/packages/@azure/arm-resources/lib/operations/resourceGroups.ts new file mode 100644 index 000000000000..3ab444c08dc8 --- /dev/null +++ b/packages/@azure/arm-resources/lib/operations/resourceGroups.ts @@ -0,0 +1,481 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; +import * as msRestAzure from "ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/resourceGroupsMappers"; +import * as Parameters from "../models/parameters"; +import { ResourceManagementClientContext } from "../resourceManagementClientContext"; + +/** Class representing a ResourceGroups. */ +export class ResourceGroups { + private readonly client: ResourceManagementClientContext; + + /** + * Create a ResourceGroups. + * @param {ResourceManagementClientContext} client Reference to the service client. + */ + constructor(client: ResourceManagementClientContext) { + this.client = client; + } + + /** + * Checks whether a resource group exists. + * @param resourceGroupName The name of the resource group to check. The name is case insensitive. + * @param [options] The optional parameters + * @returns Promise + */ + checkExistence(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group to check. The name is case insensitive. + * @param callback The callback + */ + checkExistence(resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group to check. The name is case insensitive. + * @param options The optional parameters + * @param callback The callback + */ + checkExistence(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + checkExistence(resourceGroupName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + options + }, + checkExistenceOperationSpec, + callback) as Promise; + } + + /** + * Creates or updates a resource group. + * @param resourceGroupName The name of the resource group to create or update. + * @param parameters Parameters supplied to the create or update a resource group. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, parameters: Models.ResourceGroup, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group to create or update. + * @param parameters Parameters supplied to the create or update a resource group. + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, parameters: Models.ResourceGroup, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group to create or update. + * @param parameters Parameters supplied to the create or update a resource group. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, parameters: Models.ResourceGroup, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(resourceGroupName: string, parameters: Models.ResourceGroup, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + parameters, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * When you delete a resource group, all of its resources are also deleted. Deleting a resource + * group deletes all of its template deployments and currently stored operations. + * @summary Deletes a resource group. + * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Gets a resource group. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param callback The callback + */ + get(resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Resource groups can be updated through a simple PATCH operation to a group address. The format + * of the request is the same as that for creating a resource group. If a field is unspecified, the + * current value is retained. + * @summary Updates a resource group. + * @param resourceGroupName The name of the resource group to update. The name is case insensitive. + * @param parameters Parameters supplied to update a resource group. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, parameters: Models.ResourceGroupPatchable, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group to update. The name is case insensitive. + * @param parameters Parameters supplied to update a resource group. + * @param callback The callback + */ + update(resourceGroupName: string, parameters: Models.ResourceGroupPatchable, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group to update. The name is case insensitive. + * @param parameters Parameters supplied to update a resource group. + * @param options The optional parameters + * @param callback The callback + */ + update(resourceGroupName: string, parameters: Models.ResourceGroupPatchable, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, parameters: Models.ResourceGroupPatchable, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + parameters, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * Captures the specified resource group as a template. + * @param resourceGroupName The name of the resource group to export as a template. + * @param parameters Parameters for exporting the template. + * @param [options] The optional parameters + * @returns Promise + */ + exportTemplate(resourceGroupName: string, parameters: Models.ExportTemplateRequest, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group to export as a template. + * @param parameters Parameters for exporting the template. + * @param callback The callback + */ + exportTemplate(resourceGroupName: string, parameters: Models.ExportTemplateRequest, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group to export as a template. + * @param parameters Parameters for exporting the template. + * @param options The optional parameters + * @param callback The callback + */ + exportTemplate(resourceGroupName: string, parameters: Models.ExportTemplateRequest, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + exportTemplate(resourceGroupName: string, parameters: Models.ExportTemplateRequest, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + parameters, + options + }, + exportTemplateOperationSpec, + callback) as Promise; + } + + /** + * Gets all the resource groups for a subscription. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: Models.ResourceGroupsListOptionalParams): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: Models.ResourceGroupsListOptionalParams, callback: msRest.ServiceCallback): void; + list(options?: Models.ResourceGroupsListOptionalParams, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * When you delete a resource group, all of its resources are also deleted. Deleting a resource + * group deletes all of its template deployments and currently stored operations. + * @summary Deletes a resource group. + * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * Gets all the resource groups for a subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(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 + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const checkExistenceOperationSpec: msRest.OperationSpec = { + httpMethod: "HEAD", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.ResourceGroup, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ResourceGroup + }, + 201: { + bodyMapper: Mappers.ResourceGroup + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceGroup + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.ResourceGroupPatchable, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ResourceGroup + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const exportTemplateOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/exportTemplate", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.ExportTemplateRequest, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ResourceGroupExportResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourcegroups", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.filter, + Parameters.top, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceGroupListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceGroupListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/@azure/arm-resources/lib/operations/resources.ts b/packages/@azure/arm-resources/lib/operations/resources.ts new file mode 100644 index 000000000000..6a9a55db712d --- /dev/null +++ b/packages/@azure/arm-resources/lib/operations/resources.ts @@ -0,0 +1,1092 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; +import * as msRestAzure from "ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/resourcesMappers"; +import * as Parameters from "../models/parameters"; +import { ResourceManagementClientContext } from "../resourceManagementClientContext"; + +/** Class representing a Resources. */ +export class Resources { + private readonly client: ResourceManagementClientContext; + + /** + * Create a Resources. + * @param {ResourceManagementClientContext} client Reference to the service client. + */ + constructor(client: ResourceManagementClientContext) { + this.client = client; + } + + /** + * Get all the resources for a resource group. + * @param resourceGroupName The resource group with the resources to get. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroup(resourceGroupName: string, options?: Models.ResourcesListByResourceGroupOptionalParams): Promise; + /** + * @param resourceGroupName The resource group with the resources to get. + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The resource group with the resources to get. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, options: Models.ResourcesListByResourceGroupOptionalParams, callback: msRest.ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: Models.ResourcesListByResourceGroupOptionalParams, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + options + }, + listByResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * The resources to move must be in the same source resource group. The target resource group may + * be in a different subscription. When moving resources, both the source group and the target + * group are locked for the duration of the operation. Write and delete operations are blocked on + * the groups until the move completes. + * @summary Moves resources from one resource group to another resource group. + * @param sourceResourceGroupName The name of the resource group containing the resources to move. + * @param parameters Parameters for moving resources. + * @param [options] The optional parameters + * @returns Promise + */ + moveResources(sourceResourceGroupName: string, parameters: Models.ResourcesMoveInfo, options?: msRest.RequestOptionsBase): Promise { + return this.beginMoveResources(sourceResourceGroupName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * This operation checks whether the specified resources can be moved to the target. The resources + * to move must be in the same source resource group. The target resource group may be in a + * different subscription. If validation succeeds, it returns HTTP response code 204 (no content). + * If validation fails, it returns HTTP response code 409 (Conflict) with an error message. + * Retrieve the URL in the Location header value to check the result of the long-running operation. + * @summary Validates whether resources can be moved from one resource group to another resource + * group. + * @param sourceResourceGroupName The name of the resource group containing the resources to + * validate for move. + * @param parameters Parameters for moving resources. + * @param [options] The optional parameters + * @returns Promise + */ + validateMoveResources(sourceResourceGroupName: string, parameters: Models.ResourcesMoveInfo, options?: msRest.RequestOptionsBase): Promise { + return this.beginValidateMoveResources(sourceResourceGroupName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Get all the resources in a subscription. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: Models.ResourcesListOptionalParams): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: Models.ResourcesListOptionalParams, callback: msRest.ServiceCallback): void; + list(options?: Models.ResourcesListOptionalParams, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Checks whether a resource exists. + * @param resourceGroupName The name of the resource group containing the resource to check. The + * name is case insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for the operation. + * @param [options] The optional parameters + * @returns Promise + */ + checkExistence(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group containing the resource to check. The + * name is case insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for the operation. + * @param callback The callback + */ + checkExistence(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group containing the resource to check. The + * name is case insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for the operation. + * @param options The optional parameters + * @param callback The callback + */ + checkExistence(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + checkExistence(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + options + }, + checkExistenceOperationSpec, + callback) as Promise; + } + + /** + * Deletes a resource. + * @param resourceGroupName The name of the resource group that contains the resource to delete. + * The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to delete. + * @param apiVersion The API version to use for the operation. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,resourceProviderNamespace,parentResourcePath,resourceType,resourceName,apiVersion,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Creates a resource. + * @param resourceGroupName The name of the resource group for the resource. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to create. + * @param resourceName The name of the resource to create. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for creating or updating the resource. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, parameters: Models.GenericResource, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdate(resourceGroupName,resourceProviderNamespace,parentResourcePath,resourceType,resourceName,apiVersion,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Updates a resource. + * @param resourceGroupName The name of the resource group for the resource. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to update. + * @param resourceName The name of the resource to update. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for updating the resource. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, parameters: Models.GenericResource, options?: msRest.RequestOptionsBase): Promise { + return this.beginUpdate(resourceGroupName,resourceProviderNamespace,parentResourcePath,resourceType,resourceName,apiVersion,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Gets a resource. + * @param resourceGroupName The name of the resource group containing the resource to get. The name + * is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get. + * @param apiVersion The API version to use for the operation. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group containing the resource to get. The name + * is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get. + * @param apiVersion The API version to use for the operation. + * @param callback The callback + */ + get(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group containing the resource to get. The name + * is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get. + * @param apiVersion The API version to use for the operation. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Checks by ID whether a resource exists. + * @param resourceId The fully qualified ID of the resource, including the resource name and + * resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + * @param apiVersion The API version to use for the operation. + * @param [options] The optional parameters + * @returns Promise + */ + checkExistenceById(resourceId: string, apiVersion: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceId The fully qualified ID of the resource, including the resource name and + * resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + * @param apiVersion The API version to use for the operation. + * @param callback The callback + */ + checkExistenceById(resourceId: string, apiVersion: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceId The fully qualified ID of the resource, including the resource name and + * resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + * @param apiVersion The API version to use for the operation. + * @param options The optional parameters + * @param callback The callback + */ + checkExistenceById(resourceId: string, apiVersion: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + checkExistenceById(resourceId: string, apiVersion: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceId, + apiVersion, + options + }, + checkExistenceByIdOperationSpec, + callback) as Promise; + } + + /** + * Deletes a resource by ID. + * @param resourceId The fully qualified ID of the resource, including the resource name and + * resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + * @param apiVersion The API version to use for the operation. + * @param [options] The optional parameters + * @returns Promise + */ + deleteById(resourceId: string, apiVersion: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteById(resourceId,apiVersion,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Create a resource by ID. + * @param resourceId The fully qualified ID of the resource, including the resource name and + * resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + * @param apiVersion The API version to use for the operation. + * @param parameters Create or update resource parameters. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateById(resourceId: string, apiVersion: string, parameters: Models.GenericResource, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdateById(resourceId,apiVersion,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Updates a resource by ID. + * @param resourceId The fully qualified ID of the resource, including the resource name and + * resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + * @param apiVersion The API version to use for the operation. + * @param parameters Update resource parameters. + * @param [options] The optional parameters + * @returns Promise + */ + updateById(resourceId: string, apiVersion: string, parameters: Models.GenericResource, options?: msRest.RequestOptionsBase): Promise { + return this.beginUpdateById(resourceId,apiVersion,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Gets a resource by ID. + * @param resourceId The fully qualified ID of the resource, including the resource name and + * resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + * @param apiVersion The API version to use for the operation. + * @param [options] The optional parameters + * @returns Promise + */ + getById(resourceId: string, apiVersion: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceId The fully qualified ID of the resource, including the resource name and + * resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + * @param apiVersion The API version to use for the operation. + * @param callback The callback + */ + getById(resourceId: string, apiVersion: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceId The fully qualified ID of the resource, including the resource name and + * resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + * @param apiVersion The API version to use for the operation. + * @param options The optional parameters + * @param callback The callback + */ + getById(resourceId: string, apiVersion: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getById(resourceId: string, apiVersion: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceId, + apiVersion, + options + }, + getByIdOperationSpec, + callback) as Promise; + } + + /** + * The resources to move must be in the same source resource group. The target resource group may + * be in a different subscription. When moving resources, both the source group and the target + * group are locked for the duration of the operation. Write and delete operations are blocked on + * the groups until the move completes. + * @summary Moves resources from one resource group to another resource group. + * @param sourceResourceGroupName The name of the resource group containing the resources to move. + * @param parameters Parameters for moving resources. + * @param [options] The optional parameters + * @returns Promise + */ + beginMoveResources(sourceResourceGroupName: string, parameters: Models.ResourcesMoveInfo, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + sourceResourceGroupName, + parameters, + options + }, + beginMoveResourcesOperationSpec, + options); + } + + /** + * This operation checks whether the specified resources can be moved to the target. The resources + * to move must be in the same source resource group. The target resource group may be in a + * different subscription. If validation succeeds, it returns HTTP response code 204 (no content). + * If validation fails, it returns HTTP response code 409 (Conflict) with an error message. + * Retrieve the URL in the Location header value to check the result of the long-running operation. + * @summary Validates whether resources can be moved from one resource group to another resource + * group. + * @param sourceResourceGroupName The name of the resource group containing the resources to + * validate for move. + * @param parameters Parameters for moving resources. + * @param [options] The optional parameters + * @returns Promise + */ + beginValidateMoveResources(sourceResourceGroupName: string, parameters: Models.ResourcesMoveInfo, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + sourceResourceGroupName, + parameters, + options + }, + beginValidateMoveResourcesOperationSpec, + options); + } + + /** + * Deletes a resource. + * @param resourceGroupName The name of the resource group that contains the resource to delete. + * The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to delete. + * @param apiVersion The API version to use for the operation. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * Creates a resource. + * @param resourceGroupName The name of the resource group for the resource. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to create. + * @param resourceName The name of the resource to create. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for creating or updating the resource. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdate(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, parameters: Models.GenericResource, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + parameters, + options + }, + beginCreateOrUpdateOperationSpec, + options); + } + + /** + * Updates a resource. + * @param resourceGroupName The name of the resource group for the resource. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to update. + * @param resourceName The name of the resource to update. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for updating the resource. + * @param [options] The optional parameters + * @returns Promise + */ + beginUpdate(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, parameters: Models.GenericResource, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + parameters, + options + }, + beginUpdateOperationSpec, + options); + } + + /** + * Deletes a resource by ID. + * @param resourceId The fully qualified ID of the resource, including the resource name and + * resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + * @param apiVersion The API version to use for the operation. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteById(resourceId: string, apiVersion: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceId, + apiVersion, + options + }, + beginDeleteByIdOperationSpec, + options); + } + + /** + * Create a resource by ID. + * @param resourceId The fully qualified ID of the resource, including the resource name and + * resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + * @param apiVersion The API version to use for the operation. + * @param parameters Create or update resource parameters. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdateById(resourceId: string, apiVersion: string, parameters: Models.GenericResource, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceId, + apiVersion, + parameters, + options + }, + beginCreateOrUpdateByIdOperationSpec, + options); + } + + /** + * Updates a resource by ID. + * @param resourceId The fully qualified ID of the resource, including the resource name and + * resource type. Use the format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} + * @param apiVersion The API version to use for the operation. + * @param parameters Update resource parameters. + * @param [options] The optional parameters + * @returns Promise + */ + beginUpdateById(resourceId: string, apiVersion: string, parameters: Models.GenericResource, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceId, + apiVersion, + parameters, + options + }, + beginUpdateByIdOperationSpec, + options); + } + + /** + * Get all the resources for a resource group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + 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 + */ + listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByResourceGroupNextOperationSpec, + callback) as Promise; + } + + /** + * Get all the resources in a subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(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 + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.filter, + Parameters.expand, + Parameters.top, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resources", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.filter, + Parameters.expand, + Parameters.top, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const checkExistenceOperationSpec: msRest.OperationSpec = { + httpMethod: "HEAD", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.resourceProviderNamespace, + Parameters.parentResourcePath, + Parameters.resourceType, + Parameters.resourceName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.resourceProviderNamespace, + Parameters.parentResourcePath, + Parameters.resourceType, + Parameters.resourceName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.GenericResource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const checkExistenceByIdOperationSpec: msRest.OperationSpec = { + httpMethod: "HEAD", + path: "{resourceId}", + urlParameters: [ + Parameters.resourceId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + 404: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getByIdOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "{resourceId}", + urlParameters: [ + Parameters.resourceId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.GenericResource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginMoveResourcesOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources", + urlParameters: [ + Parameters.sourceResourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.ResourcesMoveInfo, + required: true + } + }, + responses: { + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginValidateMoveResourcesOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/validateMoveResources", + urlParameters: [ + Parameters.sourceResourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.ResourcesMoveInfo, + required: true + } + }, + responses: { + 202: {}, + 204: {}, + 409: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.resourceProviderNamespace, + Parameters.parentResourcePath, + Parameters.resourceType, + Parameters.resourceName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.resourceProviderNamespace, + Parameters.parentResourcePath, + Parameters.resourceType, + Parameters.resourceName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.GenericResource, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.GenericResource + }, + 201: { + bodyMapper: Mappers.GenericResource + }, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.resourceProviderNamespace, + Parameters.parentResourcePath, + Parameters.resourceType, + Parameters.resourceName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.GenericResource, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.GenericResource + }, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginDeleteByIdOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "{resourceId}", + urlParameters: [ + Parameters.resourceId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginCreateOrUpdateByIdOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "{resourceId}", + urlParameters: [ + Parameters.resourceId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.GenericResource, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.GenericResource + }, + 201: { + bodyMapper: Mappers.GenericResource + }, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginUpdateByIdOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "{resourceId}", + urlParameters: [ + Parameters.resourceId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.GenericResource, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.GenericResource + }, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/@azure/arm-resources/lib/operations/tags.ts b/packages/@azure/arm-resources/lib/operations/tags.ts new file mode 100644 index 000000000000..474085a84f23 --- /dev/null +++ b/packages/@azure/arm-resources/lib/operations/tags.ts @@ -0,0 +1,352 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/tagsMappers"; +import * as Parameters from "../models/parameters"; +import { ResourceManagementClientContext } from "../resourceManagementClientContext"; + +/** Class representing a Tags. */ +export class Tags { + private readonly client: ResourceManagementClientContext; + + /** + * Create a Tags. + * @param {ResourceManagementClientContext} client Reference to the service client. + */ + constructor(client: ResourceManagementClientContext) { + this.client = client; + } + + /** + * Deletes a tag value. + * @param tagName The name of the tag. + * @param tagValue The value of the tag to delete. + * @param [options] The optional parameters + * @returns Promise + */ + deleteValue(tagName: string, tagValue: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param tagName The name of the tag. + * @param tagValue The value of the tag to delete. + * @param callback The callback + */ + deleteValue(tagName: string, tagValue: string, callback: msRest.ServiceCallback): void; + /** + * @param tagName The name of the tag. + * @param tagValue The value of the tag to delete. + * @param options The optional parameters + * @param callback The callback + */ + deleteValue(tagName: string, tagValue: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteValue(tagName: string, tagValue: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + tagName, + tagValue, + options + }, + deleteValueOperationSpec, + callback); + } + + /** + * Creates a tag value. The name of the tag must already exist. + * @param tagName The name of the tag. + * @param tagValue The value of the tag to create. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateValue(tagName: string, tagValue: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param tagName The name of the tag. + * @param tagValue The value of the tag to create. + * @param callback The callback + */ + createOrUpdateValue(tagName: string, tagValue: string, callback: msRest.ServiceCallback): void; + /** + * @param tagName The name of the tag. + * @param tagValue The value of the tag to create. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdateValue(tagName: string, tagValue: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdateValue(tagName: string, tagValue: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + tagName, + tagValue, + options + }, + createOrUpdateValueOperationSpec, + callback) as Promise; + } + + /** + * The tag name can have a maximum of 512 characters and is case insensitive. Tag names created by + * Azure have prefixes of microsoft, azure, or windows. You cannot create tags with one of these + * prefixes. + * @summary Creates a tag in the subscription. + * @param tagName The name of the tag to create. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(tagName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param tagName The name of the tag to create. + * @param callback The callback + */ + createOrUpdate(tagName: string, callback: msRest.ServiceCallback): void; + /** + * @param tagName The name of the tag to create. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(tagName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(tagName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + tagName, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * You must remove all values from a resource tag before you can delete it. + * @summary Deletes a tag from the subscription. + * @param tagName The name of the tag. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(tagName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param tagName The name of the tag. + * @param callback The callback + */ + deleteMethod(tagName: string, callback: msRest.ServiceCallback): void; + /** + * @param tagName The name of the tag. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(tagName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(tagName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + tagName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Gets the names and values of all resource tags that are defined in a subscription. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Gets the names and values of all resource tags that are defined in a subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(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 + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const deleteValueOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}", + urlParameters: [ + Parameters.tagName, + Parameters.tagValue, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const createOrUpdateValueOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}", + urlParameters: [ + Parameters.tagName, + Parameters.tagValue, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TagValue + }, + 201: { + bodyMapper: Mappers.TagValue + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/tagNames/{tagName}", + urlParameters: [ + Parameters.tagName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TagDetails + }, + 201: { + bodyMapper: Mappers.TagDetails + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/tagNames/{tagName}", + urlParameters: [ + Parameters.tagName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/tagNames", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TagsListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TagsListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/@azure/arm-resources/lib/resourceManagementClient.ts b/packages/@azure/arm-resources/lib/resourceManagementClient.ts new file mode 100644 index 000000000000..4bce810e3c6d --- /dev/null +++ b/packages/@azure/arm-resources/lib/resourceManagementClient.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 "ms-rest-js"; +import * as Models from "./models"; +import * as Mappers from "./models/mappers"; +import * as operations from "./operations"; +import { ResourceManagementClientContext } from "./resourceManagementClientContext"; + + +class ResourceManagementClient extends ResourceManagementClientContext { + // Operation groups + operations: operations.Operations; + deployments: operations.Deployments; + providers: operations.Providers; + resources: operations.Resources; + resourceGroups: operations.ResourceGroups; + tags: operations.Tags; + deploymentOperations: operations.DeploymentOperations; + + /** + * Initializes a new instance of the ResourceManagementClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId The ID of the target subscription. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.ResourceManagementClientOptions) { + super(credentials, subscriptionId, options); + this.operations = new operations.Operations(this); + this.deployments = new operations.Deployments(this); + this.providers = new operations.Providers(this); + this.resources = new operations.Resources(this); + this.resourceGroups = new operations.ResourceGroups(this); + this.tags = new operations.Tags(this); + this.deploymentOperations = new operations.DeploymentOperations(this); + } +} + +// Operation Specifications + +export { + ResourceManagementClient, + ResourceManagementClientContext, + Models as ResourceManagementModels, + Mappers as ResourceManagementMappers +}; +export * from "./operations"; diff --git a/packages/@azure/arm-resources/lib/resourceManagementClientContext.ts b/packages/@azure/arm-resources/lib/resourceManagementClientContext.ts new file mode 100644 index 000000000000..014c50f6b546 --- /dev/null +++ b/packages/@azure/arm-resources/lib/resourceManagementClientContext.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as Models from "./models"; +import * as msRest from "ms-rest-js"; +import * as msRestAzure from "ms-rest-azure-js"; + +const packageName = "@azure/arm-resources"; +const packageVersion = "1.0.0"; + +export class ResourceManagementClientContext extends msRestAzure.AzureServiceClient { + + credentials: msRest.ServiceClientCredentials; + + subscriptionId: string; + + apiVersion: string; + + acceptLanguage: string; + + longRunningOperationRetryTimeout: number; + + /** + * Initializes a new instance of the ResourceManagementClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId The ID of the target subscription. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.ResourceManagementClientOptions) { + if (credentials == undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId == undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) { + options = {}; + } + super(credentials, options); + + this.apiVersion = '2018-05-01'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; + this.requestContentType = "application/json; charset=utf-8"; + this.credentials = credentials; + this.subscriptionId = subscriptionId; + + this.addUserAgentInfo(`${packageName}/${packageVersion}`); + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + } +} diff --git a/packages/@azure/arm-resources/package.json b/packages/@azure/arm-resources/package.json new file mode 100644 index 000000000000..987f1a7338a9 --- /dev/null +++ b/packages/@azure/arm-resources/package.json @@ -0,0 +1,42 @@ +{ + "name": "@azure/arm-resources", + "author": "Microsoft Corporation", + "description": "ResourceManagementClient Library with typescript type definitions for node.js and browser.", + "version": "1.0.0", + "dependencies": { + "ms-rest-azure-js": "^1.0.166", + "ms-rest-js": "^1.0.439", + "tslib": "^1.9.3" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/arm-resources.js", + "module": "./esm/resourceManagementClient.js", + "types": "./esm/resourceManagementClient.d.ts", + "devDependencies": { + "typescript": "^3.1.1", + "rollup": "^0.66.2", + "rollup-plugin-node-resolve": "^3.4.0", + "uglify-js": "^3.4.9" + }, + "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/packages/@azure/arm-resources", + "repository": { + "type": "git", + "url": "https://github.com/azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/azure/azure-sdk-for-js/issues" + }, + "scripts": { + "build": "tsc && rollup -c rollup.config.js && npm run minify", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-resources.js.map'\" -o ./dist/arm-resources.min.js ./dist/arm-resources.js", + "prepare": "npm run build" + }, + "sideEffects": false +} diff --git a/packages/@azure/arm-resources/rollup.config.js b/packages/@azure/arm-resources/rollup.config.js new file mode 100644 index 000000000000..e6ceb895d59b --- /dev/null +++ b/packages/@azure/arm-resources/rollup.config.js @@ -0,0 +1,31 @@ +import nodeResolve from "rollup-plugin-node-resolve"; +/** + * @type {import('rollup').RollupFileOptions} + */ +const config = { + input: './esm/resourceManagementClient.js', + external: ["ms-rest-js", "ms-rest-azure-js"], + output: { + file: "./dist/arm-resources.js", + format: "umd", + name: "Azure.ArmResources", + sourcemap: true, + globals: { + "ms-rest-js": "msRest", + "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. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */` + }, + plugins: [ + nodeResolve({ module: true }) + ] +}; +export default config; diff --git a/packages/@azure/arm-resources/tsconfig.json b/packages/@azure/arm-resources/tsconfig.json new file mode 100644 index 000000000000..f32d1664f320 --- /dev/null +++ b/packages/@azure/arm-resources/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es5", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": ["es6"], + "declaration": true, + "outDir": "./esm", + "importHelpers": true + }, + "include": ["./lib/**/*"], + "exclude": ["node_modules"] +} From 9481773a39de0059d6f137d54c091a10687dac6b Mon Sep 17 00:00:00 2001 From: Kamil Pajdzik Date: Fri, 19 Oct 2018 09:55:32 -0700 Subject: [PATCH 2/3] Regenerate @azure/arm-features package --- .../@azure/arm-features/dist/arm-features.js | 661 ++++++++++++++++++ .../arm-features/dist/arm-features.js.map | 1 + .../arm-features/dist/arm-features.min.js | 1 + .../arm-features/dist/arm-features.min.js.map | 1 + packages/@azure/arm-features/package.json | 6 +- packages/@azure/arm-links/package.json | 6 +- packages/@azure/arm-locks/lib/models/index.ts | 26 + .../@azure/arm-locks/lib/models/mappers.ts | 35 + packages/@azure/arm-locks/package.json | 6 +- .../lib/models/index.ts | 126 ++++ .../lib/models/mappers.ts | 163 +++++ .../arm-managedapplications/package.json | 6 +- .../@azure/arm-policy/lib/models/index.ts | 118 ++++ .../@azure/arm-policy/lib/models/mappers.ts | 162 +++++ packages/@azure/arm-policy/package.json | 6 +- packages/@azure/arm-resources/package.json | 6 +- 16 files changed, 1312 insertions(+), 18 deletions(-) create mode 100644 packages/@azure/arm-features/dist/arm-features.js create mode 100644 packages/@azure/arm-features/dist/arm-features.js.map create mode 100644 packages/@azure/arm-features/dist/arm-features.min.js create mode 100644 packages/@azure/arm-features/dist/arm-features.min.js.map diff --git a/packages/@azure/arm-features/dist/arm-features.js b/packages/@azure/arm-features/dist/arm-features.js new file mode 100644 index 000000000000..35e23acef6d2 --- /dev/null +++ b/packages/@azure/arm-features/dist/arm-features.js @@ -0,0 +1,661 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('ms-rest-azure-js'), require('ms-rest-js')) : + typeof define === 'function' && define.amd ? define(['exports', 'ms-rest-azure-js', 'ms-rest-js'], factory) : + (factory((global.Azure = global.Azure || {}, global.Azure.ArmFeatures = {}),global.msRestAzure,global.msRest)); +}(this, (function (exports,msRestAzure,msRest) { 'use strict'; + + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */ + /* global Reflect, Promise */ + + var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + + function __extends(d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + } + + /* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + + var index = /*#__PURE__*/Object.freeze({ + + }); + + /* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + var CloudError = msRestAzure.CloudErrorMapper; + var BaseResource = msRestAzure.BaseResourceMapper; + var FeatureProperties = { + serializedName: "FeatureProperties", + type: { + name: "Composite", + className: "FeatureProperties", + modelProperties: { + state: { + serializedName: "state", + type: { + name: "String" + } + } + } + } + }; + var FeatureResult = { + serializedName: "FeatureResult", + type: { + name: "Composite", + className: "FeatureResult", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "FeatureProperties" + } + }, + id: { + serializedName: "id", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "String" + } + } + } + } + }; + var OperationDisplay = { + serializedName: "Operation_display", + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + } + } + } + }; + var Operation = { + serializedName: "Operation", + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + } + } + } + }; + var OperationListResult = { + serializedName: "OperationListResult", + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } + }; + var FeatureOperationsListResult = { + serializedName: "FeatureOperationsListResult", + type: { + name: "Composite", + className: "FeatureOperationsListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FeatureResult" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } + }; + + var Mappers = /*#__PURE__*/Object.freeze({ + CloudError: CloudError, + BaseResource: BaseResource, + FeatureProperties: FeatureProperties, + FeatureResult: FeatureResult, + OperationDisplay: OperationDisplay, + Operation: Operation, + OperationListResult: OperationListResult, + FeatureOperationsListResult: FeatureOperationsListResult + }); + + /* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + var acceptLanguage = { + parameterPath: "acceptLanguage", + mapper: { + serializedName: "accept-language", + defaultValue: 'en-US', + type: { + name: "String" + } + } + }; + var apiVersion = { + parameterPath: "apiVersion", + mapper: { + required: true, + serializedName: "api-version", + type: { + name: "String" + } + } + }; + var featureName = { + parameterPath: "featureName", + mapper: { + required: true, + serializedName: "featureName", + type: { + name: "String" + } + } + }; + var nextPageLink = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true + }; + var resourceProviderNamespace = { + parameterPath: "resourceProviderNamespace", + mapper: { + required: true, + serializedName: "resourceProviderNamespace", + type: { + name: "String" + } + } + }; + var subscriptionId = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + type: { + name: "String" + } + } + }; + + /* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + + var Mappers$1 = /*#__PURE__*/Object.freeze({ + FeatureOperationsListResult: FeatureOperationsListResult, + FeatureResult: FeatureResult, + FeatureProperties: FeatureProperties, + CloudError: CloudError + }); + + /* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + /** Class representing a Features. */ + var Features = /** @class */ (function () { + /** + * Create a Features. + * @param {FeatureClientContext} client Reference to the service client. + */ + function Features(client) { + this.client = client; + } + Features.prototype.listAll = function (options, callback) { + return this.client.sendOperationRequest({ + options: options + }, listAllOperationSpec, callback); + }; + Features.prototype.list = function (resourceProviderNamespace$$1, options, callback) { + return this.client.sendOperationRequest({ + resourceProviderNamespace: resourceProviderNamespace$$1, + options: options + }, listOperationSpec, callback); + }; + Features.prototype.get = function (resourceProviderNamespace$$1, featureName$$1, options, callback) { + return this.client.sendOperationRequest({ + resourceProviderNamespace: resourceProviderNamespace$$1, + featureName: featureName$$1, + options: options + }, getOperationSpec, callback); + }; + Features.prototype.register = function (resourceProviderNamespace$$1, featureName$$1, options, callback) { + return this.client.sendOperationRequest({ + resourceProviderNamespace: resourceProviderNamespace$$1, + featureName: featureName$$1, + options: options + }, registerOperationSpec, callback); + }; + Features.prototype.listAllNext = function (nextPageLink$$1, options, callback) { + return this.client.sendOperationRequest({ + nextPageLink: nextPageLink$$1, + options: options + }, listAllNextOperationSpec, callback); + }; + Features.prototype.listNext = function (nextPageLink$$1, options, callback) { + return this.client.sendOperationRequest({ + nextPageLink: nextPageLink$$1, + options: options + }, listNextOperationSpec, callback); + }; + return Features; + }()); + // Operation Specifications + var serializer = new msRest.Serializer(Mappers$1); + var listAllOperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Features/features", + urlParameters: [ + subscriptionId + ], + queryParameters: [ + apiVersion + ], + headerParameters: [ + acceptLanguage + ], + responses: { + 200: { + bodyMapper: FeatureOperationsListResult + }, + default: { + bodyMapper: CloudError + } + }, + serializer: serializer + }; + var listOperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features", + urlParameters: [ + resourceProviderNamespace, + subscriptionId + ], + queryParameters: [ + apiVersion + ], + headerParameters: [ + acceptLanguage + ], + responses: { + 200: { + bodyMapper: FeatureOperationsListResult + }, + default: { + bodyMapper: CloudError + } + }, + serializer: serializer + }; + var getOperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}", + urlParameters: [ + resourceProviderNamespace, + featureName, + subscriptionId + ], + queryParameters: [ + apiVersion + ], + headerParameters: [ + acceptLanguage + ], + responses: { + 200: { + bodyMapper: FeatureResult + }, + default: { + bodyMapper: CloudError + } + }, + serializer: serializer + }; + var registerOperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}/register", + urlParameters: [ + resourceProviderNamespace, + featureName, + subscriptionId + ], + queryParameters: [ + apiVersion + ], + headerParameters: [ + acceptLanguage + ], + responses: { + 200: { + bodyMapper: FeatureResult + }, + default: { + bodyMapper: CloudError + } + }, + serializer: serializer + }; + var listAllNextOperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + nextPageLink + ], + headerParameters: [ + acceptLanguage + ], + responses: { + 200: { + bodyMapper: FeatureOperationsListResult + }, + default: { + bodyMapper: CloudError + } + }, + serializer: serializer + }; + var listNextOperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + nextPageLink + ], + headerParameters: [ + acceptLanguage + ], + responses: { + 200: { + bodyMapper: FeatureOperationsListResult + }, + default: { + bodyMapper: CloudError + } + }, + serializer: serializer + }; + + /* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + + /* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + var packageName = "@azure/arm-features"; + var packageVersion = "1.0.0"; + var FeatureClientContext = /** @class */ (function (_super) { + __extends(FeatureClientContext, _super); + /** + * Initializes a new instance of the FeatureClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId The ID of the target subscription. + * @param [options] The parameter options + */ + function FeatureClientContext(credentials, subscriptionId, options) { + var _this = this; + if (credentials == undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId == undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + if (!options) { + options = {}; + } + _this = _super.call(this, credentials, options) || this; + _this.apiVersion = '2015-12-01'; + _this.acceptLanguage = 'en-US'; + _this.longRunningOperationRetryTimeout = 30; + _this.baseUri = options.baseUri || _this.baseUri || "https://management.azure.com"; + _this.requestContentType = "application/json; charset=utf-8"; + _this.credentials = credentials; + _this.subscriptionId = subscriptionId; + _this.addUserAgentInfo(packageName + "/" + packageVersion); + if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + _this.acceptLanguage = options.acceptLanguage; + } + if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + _this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + return _this; + } + return FeatureClientContext; + }(msRestAzure.AzureServiceClient)); + + /* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + var FeatureClient = /** @class */ (function (_super) { + __extends(FeatureClient, _super); + /** + * Initializes a new instance of the FeatureClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId The ID of the target subscription. + * @param [options] The parameter options + */ + function FeatureClient(credentials, subscriptionId$$1, options) { + var _this = _super.call(this, credentials, subscriptionId$$1, options) || this; + _this.features = new Features(_this); + return _this; + } + FeatureClient.prototype.listOperations = function (options, callback) { + return this.sendOperationRequest({ + options: options + }, listOperationsOperationSpec, callback); + }; + FeatureClient.prototype.listOperationsNext = function (nextPageLink$$1, options, callback) { + return this.sendOperationRequest({ + nextPageLink: nextPageLink$$1, + options: options + }, listOperationsNextOperationSpec, callback); + }; + return FeatureClient; + }(FeatureClientContext)); + // Operation Specifications + var serializer$1 = new msRest.Serializer(Mappers); + var listOperationsOperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Features/operations", + queryParameters: [ + apiVersion + ], + headerParameters: [ + acceptLanguage + ], + responses: { + 200: { + bodyMapper: OperationListResult + }, + default: { + bodyMapper: CloudError + } + }, + serializer: serializer$1 + }; + var listOperationsNextOperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + nextPageLink + ], + headerParameters: [ + acceptLanguage + ], + responses: { + 200: { + bodyMapper: OperationListResult + }, + default: { + bodyMapper: CloudError + } + }, + serializer: serializer$1 + }; + + exports.FeatureClient = FeatureClient; + exports.FeatureClientContext = FeatureClientContext; + exports.FeatureModels = index; + exports.FeatureMappers = Mappers; + exports.Features = Features; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=arm-features.js.map diff --git a/packages/@azure/arm-features/dist/arm-features.js.map b/packages/@azure/arm-features/dist/arm-features.js.map new file mode 100644 index 000000000000..c33febfa8458 --- /dev/null +++ b/packages/@azure/arm-features/dist/arm-features.js.map @@ -0,0 +1 @@ +{"version":3,"file":"arm-features.js","sources":["../node_modules/tslib/tslib.es6.js","../esm/models/index.js","../esm/models/mappers.js","../esm/models/parameters.js","../esm/models/featuresMappers.js","../esm/operations/features.js","../esm/operations/index.js","../esm/featureClientContext.js","../esm/featureClient.js"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for\r\n * license information.\r\n *\r\n * Code generated by Microsoft (R) AutoRest Code Generator.\r\n * Changes may cause incorrect behavior and will be lost if the code is\r\n * regenerated.\r\n */\r\n//# sourceMappingURL=index.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for\r\n * license information.\r\n *\r\n * Code generated by Microsoft (R) AutoRest Code Generator.\r\n * Changes may cause incorrect behavior and will be lost if the code is\r\n * regenerated.\r\n */\r\nimport { CloudErrorMapper, BaseResourceMapper } from \"ms-rest-azure-js\";\r\nexport var CloudError = CloudErrorMapper;\r\nexport var BaseResource = BaseResourceMapper;\r\nexport var FeatureProperties = {\r\n serializedName: \"FeatureProperties\",\r\n type: {\r\n name: \"Composite\",\r\n className: \"FeatureProperties\",\r\n modelProperties: {\r\n state: {\r\n serializedName: \"state\",\r\n type: {\r\n name: \"String\"\r\n }\r\n }\r\n }\r\n }\r\n};\r\nexport var FeatureResult = {\r\n serializedName: \"FeatureResult\",\r\n type: {\r\n name: \"Composite\",\r\n className: \"FeatureResult\",\r\n modelProperties: {\r\n name: {\r\n serializedName: \"name\",\r\n type: {\r\n name: \"String\"\r\n }\r\n },\r\n properties: {\r\n serializedName: \"properties\",\r\n type: {\r\n name: \"Composite\",\r\n className: \"FeatureProperties\"\r\n }\r\n },\r\n id: {\r\n serializedName: \"id\",\r\n type: {\r\n name: \"String\"\r\n }\r\n },\r\n type: {\r\n serializedName: \"type\",\r\n type: {\r\n name: \"String\"\r\n }\r\n }\r\n }\r\n }\r\n};\r\nexport var OperationDisplay = {\r\n serializedName: \"Operation_display\",\r\n type: {\r\n name: \"Composite\",\r\n className: \"OperationDisplay\",\r\n modelProperties: {\r\n provider: {\r\n serializedName: \"provider\",\r\n type: {\r\n name: \"String\"\r\n }\r\n },\r\n resource: {\r\n serializedName: \"resource\",\r\n type: {\r\n name: \"String\"\r\n }\r\n },\r\n operation: {\r\n serializedName: \"operation\",\r\n type: {\r\n name: \"String\"\r\n }\r\n }\r\n }\r\n }\r\n};\r\nexport var Operation = {\r\n serializedName: \"Operation\",\r\n type: {\r\n name: \"Composite\",\r\n className: \"Operation\",\r\n modelProperties: {\r\n name: {\r\n serializedName: \"name\",\r\n type: {\r\n name: \"String\"\r\n }\r\n },\r\n display: {\r\n serializedName: \"display\",\r\n type: {\r\n name: \"Composite\",\r\n className: \"OperationDisplay\"\r\n }\r\n }\r\n }\r\n }\r\n};\r\nexport var OperationListResult = {\r\n serializedName: \"OperationListResult\",\r\n type: {\r\n name: \"Composite\",\r\n className: \"OperationListResult\",\r\n modelProperties: {\r\n value: {\r\n serializedName: \"\",\r\n type: {\r\n name: \"Sequence\",\r\n element: {\r\n type: {\r\n name: \"Composite\",\r\n className: \"Operation\"\r\n }\r\n }\r\n }\r\n },\r\n nextLink: {\r\n serializedName: \"nextLink\",\r\n type: {\r\n name: \"String\"\r\n }\r\n }\r\n }\r\n }\r\n};\r\nexport var FeatureOperationsListResult = {\r\n serializedName: \"FeatureOperationsListResult\",\r\n type: {\r\n name: \"Composite\",\r\n className: \"FeatureOperationsListResult\",\r\n modelProperties: {\r\n value: {\r\n serializedName: \"\",\r\n type: {\r\n name: \"Sequence\",\r\n element: {\r\n type: {\r\n name: \"Composite\",\r\n className: \"FeatureResult\"\r\n }\r\n }\r\n }\r\n },\r\n nextLink: {\r\n serializedName: \"nextLink\",\r\n type: {\r\n name: \"String\"\r\n }\r\n }\r\n }\r\n }\r\n};\r\n//# sourceMappingURL=mappers.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for\r\n * license information.\r\n *\r\n * Code generated by Microsoft (R) AutoRest Code Generator.\r\n * Changes may cause incorrect behavior and will be lost if the code is\r\n * regenerated.\r\n */\r\nexport var acceptLanguage = {\r\n parameterPath: \"acceptLanguage\",\r\n mapper: {\r\n serializedName: \"accept-language\",\r\n defaultValue: 'en-US',\r\n type: {\r\n name: \"String\"\r\n }\r\n }\r\n};\r\nexport var apiVersion = {\r\n parameterPath: \"apiVersion\",\r\n mapper: {\r\n required: true,\r\n serializedName: \"api-version\",\r\n type: {\r\n name: \"String\"\r\n }\r\n }\r\n};\r\nexport var featureName = {\r\n parameterPath: \"featureName\",\r\n mapper: {\r\n required: true,\r\n serializedName: \"featureName\",\r\n type: {\r\n name: \"String\"\r\n }\r\n }\r\n};\r\nexport var nextPageLink = {\r\n parameterPath: \"nextPageLink\",\r\n mapper: {\r\n required: true,\r\n serializedName: \"nextLink\",\r\n type: {\r\n name: \"String\"\r\n }\r\n },\r\n skipEncoding: true\r\n};\r\nexport var resourceProviderNamespace = {\r\n parameterPath: \"resourceProviderNamespace\",\r\n mapper: {\r\n required: true,\r\n serializedName: \"resourceProviderNamespace\",\r\n type: {\r\n name: \"String\"\r\n }\r\n }\r\n};\r\nexport var subscriptionId = {\r\n parameterPath: \"subscriptionId\",\r\n mapper: {\r\n required: true,\r\n serializedName: \"subscriptionId\",\r\n type: {\r\n name: \"String\"\r\n }\r\n }\r\n};\r\n//# sourceMappingURL=parameters.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for\r\n * license information.\r\n *\r\n * Code generated by Microsoft (R) AutoRest Code Generator.\r\n * Changes may cause incorrect behavior and will be lost if the code is\r\n * regenerated.\r\n */\r\nexport { FeatureOperationsListResult, FeatureResult, FeatureProperties, CloudError } from \"../models/mappers\";\r\n//# sourceMappingURL=featuresMappers.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for\r\n * license information.\r\n *\r\n * Code generated by Microsoft (R) AutoRest Code Generator.\r\n * Changes may cause incorrect behavior and will be lost if the code is\r\n * regenerated.\r\n */\r\nimport * as msRest from \"ms-rest-js\";\r\nimport * as Mappers from \"../models/featuresMappers\";\r\nimport * as Parameters from \"../models/parameters\";\r\n/** Class representing a Features. */\r\nvar Features = /** @class */ (function () {\r\n /**\r\n * Create a Features.\r\n * @param {FeatureClientContext} client Reference to the service client.\r\n */\r\n function Features(client) {\r\n this.client = client;\r\n }\r\n Features.prototype.listAll = function (options, callback) {\r\n return this.client.sendOperationRequest({\r\n options: options\r\n }, listAllOperationSpec, callback);\r\n };\r\n Features.prototype.list = function (resourceProviderNamespace, options, callback) {\r\n return this.client.sendOperationRequest({\r\n resourceProviderNamespace: resourceProviderNamespace,\r\n options: options\r\n }, listOperationSpec, callback);\r\n };\r\n Features.prototype.get = function (resourceProviderNamespace, featureName, options, callback) {\r\n return this.client.sendOperationRequest({\r\n resourceProviderNamespace: resourceProviderNamespace,\r\n featureName: featureName,\r\n options: options\r\n }, getOperationSpec, callback);\r\n };\r\n Features.prototype.register = function (resourceProviderNamespace, featureName, options, callback) {\r\n return this.client.sendOperationRequest({\r\n resourceProviderNamespace: resourceProviderNamespace,\r\n featureName: featureName,\r\n options: options\r\n }, registerOperationSpec, callback);\r\n };\r\n Features.prototype.listAllNext = function (nextPageLink, options, callback) {\r\n return this.client.sendOperationRequest({\r\n nextPageLink: nextPageLink,\r\n options: options\r\n }, listAllNextOperationSpec, callback);\r\n };\r\n Features.prototype.listNext = function (nextPageLink, options, callback) {\r\n return this.client.sendOperationRequest({\r\n nextPageLink: nextPageLink,\r\n options: options\r\n }, listNextOperationSpec, callback);\r\n };\r\n return Features;\r\n}());\r\nexport { Features };\r\n// Operation Specifications\r\nvar serializer = new msRest.Serializer(Mappers);\r\nvar listAllOperationSpec = {\r\n httpMethod: \"GET\",\r\n path: \"subscriptions/{subscriptionId}/providers/Microsoft.Features/features\",\r\n urlParameters: [\r\n Parameters.subscriptionId\r\n ],\r\n queryParameters: [\r\n Parameters.apiVersion\r\n ],\r\n headerParameters: [\r\n Parameters.acceptLanguage\r\n ],\r\n responses: {\r\n 200: {\r\n bodyMapper: Mappers.FeatureOperationsListResult\r\n },\r\n default: {\r\n bodyMapper: Mappers.CloudError\r\n }\r\n },\r\n serializer: serializer\r\n};\r\nvar listOperationSpec = {\r\n httpMethod: \"GET\",\r\n path: \"subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features\",\r\n urlParameters: [\r\n Parameters.resourceProviderNamespace,\r\n Parameters.subscriptionId\r\n ],\r\n queryParameters: [\r\n Parameters.apiVersion\r\n ],\r\n headerParameters: [\r\n Parameters.acceptLanguage\r\n ],\r\n responses: {\r\n 200: {\r\n bodyMapper: Mappers.FeatureOperationsListResult\r\n },\r\n default: {\r\n bodyMapper: Mappers.CloudError\r\n }\r\n },\r\n serializer: serializer\r\n};\r\nvar getOperationSpec = {\r\n httpMethod: \"GET\",\r\n path: \"subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}\",\r\n urlParameters: [\r\n Parameters.resourceProviderNamespace,\r\n Parameters.featureName,\r\n Parameters.subscriptionId\r\n ],\r\n queryParameters: [\r\n Parameters.apiVersion\r\n ],\r\n headerParameters: [\r\n Parameters.acceptLanguage\r\n ],\r\n responses: {\r\n 200: {\r\n bodyMapper: Mappers.FeatureResult\r\n },\r\n default: {\r\n bodyMapper: Mappers.CloudError\r\n }\r\n },\r\n serializer: serializer\r\n};\r\nvar registerOperationSpec = {\r\n httpMethod: \"POST\",\r\n path: \"subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}/register\",\r\n urlParameters: [\r\n Parameters.resourceProviderNamespace,\r\n Parameters.featureName,\r\n Parameters.subscriptionId\r\n ],\r\n queryParameters: [\r\n Parameters.apiVersion\r\n ],\r\n headerParameters: [\r\n Parameters.acceptLanguage\r\n ],\r\n responses: {\r\n 200: {\r\n bodyMapper: Mappers.FeatureResult\r\n },\r\n default: {\r\n bodyMapper: Mappers.CloudError\r\n }\r\n },\r\n serializer: serializer\r\n};\r\nvar listAllNextOperationSpec = {\r\n httpMethod: \"GET\",\r\n baseUrl: \"https://management.azure.com\",\r\n path: \"{nextLink}\",\r\n urlParameters: [\r\n Parameters.nextPageLink\r\n ],\r\n headerParameters: [\r\n Parameters.acceptLanguage\r\n ],\r\n responses: {\r\n 200: {\r\n bodyMapper: Mappers.FeatureOperationsListResult\r\n },\r\n default: {\r\n bodyMapper: Mappers.CloudError\r\n }\r\n },\r\n serializer: serializer\r\n};\r\nvar listNextOperationSpec = {\r\n httpMethod: \"GET\",\r\n baseUrl: \"https://management.azure.com\",\r\n path: \"{nextLink}\",\r\n urlParameters: [\r\n Parameters.nextPageLink\r\n ],\r\n headerParameters: [\r\n Parameters.acceptLanguage\r\n ],\r\n responses: {\r\n 200: {\r\n bodyMapper: Mappers.FeatureOperationsListResult\r\n },\r\n default: {\r\n bodyMapper: Mappers.CloudError\r\n }\r\n },\r\n serializer: serializer\r\n};\r\n//# sourceMappingURL=features.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for\r\n * license information.\r\n *\r\n * Code generated by Microsoft (R) AutoRest Code Generator.\r\n * Changes may cause incorrect behavior and will be lost if the code is\r\n * regenerated.\r\n */\r\nexport * from \"./features\";\r\n//# sourceMappingURL=index.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for\r\n * license information.\r\n *\r\n * Code generated by Microsoft (R) AutoRest Code Generator.\r\n * Changes may cause incorrect behavior and will be lost if the code is\r\n * regenerated.\r\n */\r\nimport * as tslib_1 from \"tslib\";\r\nimport * as msRestAzure from \"ms-rest-azure-js\";\r\nvar packageName = \"@azure/arm-features\";\r\nvar packageVersion = \"1.0.0\";\r\nvar FeatureClientContext = /** @class */ (function (_super) {\r\n tslib_1.__extends(FeatureClientContext, _super);\r\n /**\r\n * Initializes a new instance of the FeatureClient class.\r\n * @param credentials Credentials needed for the client to connect to Azure.\r\n * @param subscriptionId The ID of the target subscription.\r\n * @param [options] The parameter options\r\n */\r\n function FeatureClientContext(credentials, subscriptionId, options) {\r\n var _this = this;\r\n if (credentials == undefined) {\r\n throw new Error('\\'credentials\\' cannot be null.');\r\n }\r\n if (subscriptionId == undefined) {\r\n throw new Error('\\'subscriptionId\\' cannot be null.');\r\n }\r\n if (!options) {\r\n options = {};\r\n }\r\n _this = _super.call(this, credentials, options) || this;\r\n _this.apiVersion = '2015-12-01';\r\n _this.acceptLanguage = 'en-US';\r\n _this.longRunningOperationRetryTimeout = 30;\r\n _this.baseUri = options.baseUri || _this.baseUri || \"https://management.azure.com\";\r\n _this.requestContentType = \"application/json; charset=utf-8\";\r\n _this.credentials = credentials;\r\n _this.subscriptionId = subscriptionId;\r\n _this.addUserAgentInfo(packageName + \"/\" + packageVersion);\r\n if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) {\r\n _this.acceptLanguage = options.acceptLanguage;\r\n }\r\n if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {\r\n _this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout;\r\n }\r\n return _this;\r\n }\r\n return FeatureClientContext;\r\n}(msRestAzure.AzureServiceClient));\r\nexport { FeatureClientContext };\r\n//# sourceMappingURL=featureClientContext.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for\r\n * license information.\r\n *\r\n * Code generated by Microsoft (R) AutoRest Code Generator.\r\n * Changes may cause incorrect behavior and will be lost if the code is\r\n * regenerated.\r\n */\r\nimport * as tslib_1 from \"tslib\";\r\nimport * as msRest from \"ms-rest-js\";\r\nimport * as Models from \"./models\";\r\nimport * as Mappers from \"./models/mappers\";\r\nimport * as Parameters from \"./models/parameters\";\r\nimport * as operations from \"./operations\";\r\nimport { FeatureClientContext } from \"./featureClientContext\";\r\nvar FeatureClient = /** @class */ (function (_super) {\r\n tslib_1.__extends(FeatureClient, _super);\r\n /**\r\n * Initializes a new instance of the FeatureClient class.\r\n * @param credentials Credentials needed for the client to connect to Azure.\r\n * @param subscriptionId The ID of the target subscription.\r\n * @param [options] The parameter options\r\n */\r\n function FeatureClient(credentials, subscriptionId, options) {\r\n var _this = _super.call(this, credentials, subscriptionId, options) || this;\r\n _this.features = new operations.Features(_this);\r\n return _this;\r\n }\r\n FeatureClient.prototype.listOperations = function (options, callback) {\r\n return this.sendOperationRequest({\r\n options: options\r\n }, listOperationsOperationSpec, callback);\r\n };\r\n FeatureClient.prototype.listOperationsNext = function (nextPageLink, options, callback) {\r\n return this.sendOperationRequest({\r\n nextPageLink: nextPageLink,\r\n options: options\r\n }, listOperationsNextOperationSpec, callback);\r\n };\r\n return FeatureClient;\r\n}(FeatureClientContext));\r\n// Operation Specifications\r\nvar serializer = new msRest.Serializer(Mappers);\r\nvar listOperationsOperationSpec = {\r\n httpMethod: \"GET\",\r\n path: \"providers/Microsoft.Features/operations\",\r\n queryParameters: [\r\n Parameters.apiVersion\r\n ],\r\n headerParameters: [\r\n Parameters.acceptLanguage\r\n ],\r\n responses: {\r\n 200: {\r\n bodyMapper: Mappers.OperationListResult\r\n },\r\n default: {\r\n bodyMapper: Mappers.CloudError\r\n }\r\n },\r\n serializer: serializer\r\n};\r\nvar listOperationsNextOperationSpec = {\r\n httpMethod: \"GET\",\r\n baseUrl: \"https://management.azure.com\",\r\n path: \"{nextLink}\",\r\n urlParameters: [\r\n Parameters.nextPageLink\r\n ],\r\n headerParameters: [\r\n Parameters.acceptLanguage\r\n ],\r\n responses: {\r\n 200: {\r\n bodyMapper: Mappers.OperationListResult\r\n },\r\n default: {\r\n bodyMapper: Mappers.CloudError\r\n }\r\n },\r\n serializer: serializer\r\n};\r\nexport { FeatureClient, FeatureClientContext, Models as FeatureModels, Mappers as FeatureMappers };\r\nexport * from \"./operations\";\r\n//# sourceMappingURL=featureClient.js.map"],"names":["CloudErrorMapper","BaseResourceMapper","resourceProviderNamespace","featureName","nextPageLink","msRest.Serializer","Mappers","Parameters.subscriptionId","Parameters.apiVersion","Parameters.acceptLanguage","Mappers.FeatureOperationsListResult","Mappers.CloudError","Parameters.resourceProviderNamespace","Parameters.featureName","Mappers.FeatureResult","Parameters.nextPageLink","tslib_1.__extends","msRestAzure.AzureServiceClient","subscriptionId","operations.Features","serializer","Mappers.OperationListResult"],"mappings":";;;;;;;;;;;;;;;IAAA;IACA;IACA;IACA;IACA;;IAEA;IACA;IACA;IACA;;IAEA;IACA;IACA;IACA;;IAEA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;IACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;IACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;IACpF,QAAQ,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACnF,IAAI,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC;;AAEF,IAAO,SAAS,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE;IAChC,IAAI,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACxB,IAAI,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE;IAC3C,IAAI,CAAC,CAAC,SAAS,GAAG,CAAC,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IACzF,CAAC;;IC3BD;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;;;;;ICRH;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;AACA,IACO,IAAI,UAAU,GAAGA,4BAAgB,CAAC;AACzC,IAAO,IAAI,YAAY,GAAGC,8BAAkB,CAAC;AAC7C,IAAO,IAAI,iBAAiB,GAAG;IAC/B,IAAI,cAAc,EAAE,mBAAmB;IACvC,IAAI,IAAI,EAAE;IACV,QAAQ,IAAI,EAAE,WAAW;IACzB,QAAQ,SAAS,EAAE,mBAAmB;IACtC,QAAQ,eAAe,EAAE;IACzB,YAAY,KAAK,EAAE;IACnB,gBAAgB,cAAc,EAAE,OAAO;IACvC,gBAAgB,IAAI,EAAE;IACtB,oBAAoB,IAAI,EAAE,QAAQ;IAClC,iBAAiB;IACjB,aAAa;IACb,SAAS;IACT,KAAK;IACL,CAAC,CAAC;AACF,IAAO,IAAI,aAAa,GAAG;IAC3B,IAAI,cAAc,EAAE,eAAe;IACnC,IAAI,IAAI,EAAE;IACV,QAAQ,IAAI,EAAE,WAAW;IACzB,QAAQ,SAAS,EAAE,eAAe;IAClC,QAAQ,eAAe,EAAE;IACzB,YAAY,IAAI,EAAE;IAClB,gBAAgB,cAAc,EAAE,MAAM;IACtC,gBAAgB,IAAI,EAAE;IACtB,oBAAoB,IAAI,EAAE,QAAQ;IAClC,iBAAiB;IACjB,aAAa;IACb,YAAY,UAAU,EAAE;IACxB,gBAAgB,cAAc,EAAE,YAAY;IAC5C,gBAAgB,IAAI,EAAE;IACtB,oBAAoB,IAAI,EAAE,WAAW;IACrC,oBAAoB,SAAS,EAAE,mBAAmB;IAClD,iBAAiB;IACjB,aAAa;IACb,YAAY,EAAE,EAAE;IAChB,gBAAgB,cAAc,EAAE,IAAI;IACpC,gBAAgB,IAAI,EAAE;IACtB,oBAAoB,IAAI,EAAE,QAAQ;IAClC,iBAAiB;IACjB,aAAa;IACb,YAAY,IAAI,EAAE;IAClB,gBAAgB,cAAc,EAAE,MAAM;IACtC,gBAAgB,IAAI,EAAE;IACtB,oBAAoB,IAAI,EAAE,QAAQ;IAClC,iBAAiB;IACjB,aAAa;IACb,SAAS;IACT,KAAK;IACL,CAAC,CAAC;AACF,IAAO,IAAI,gBAAgB,GAAG;IAC9B,IAAI,cAAc,EAAE,mBAAmB;IACvC,IAAI,IAAI,EAAE;IACV,QAAQ,IAAI,EAAE,WAAW;IACzB,QAAQ,SAAS,EAAE,kBAAkB;IACrC,QAAQ,eAAe,EAAE;IACzB,YAAY,QAAQ,EAAE;IACtB,gBAAgB,cAAc,EAAE,UAAU;IAC1C,gBAAgB,IAAI,EAAE;IACtB,oBAAoB,IAAI,EAAE,QAAQ;IAClC,iBAAiB;IACjB,aAAa;IACb,YAAY,QAAQ,EAAE;IACtB,gBAAgB,cAAc,EAAE,UAAU;IAC1C,gBAAgB,IAAI,EAAE;IACtB,oBAAoB,IAAI,EAAE,QAAQ;IAClC,iBAAiB;IACjB,aAAa;IACb,YAAY,SAAS,EAAE;IACvB,gBAAgB,cAAc,EAAE,WAAW;IAC3C,gBAAgB,IAAI,EAAE;IACtB,oBAAoB,IAAI,EAAE,QAAQ;IAClC,iBAAiB;IACjB,aAAa;IACb,SAAS;IACT,KAAK;IACL,CAAC,CAAC;AACF,IAAO,IAAI,SAAS,GAAG;IACvB,IAAI,cAAc,EAAE,WAAW;IAC/B,IAAI,IAAI,EAAE;IACV,QAAQ,IAAI,EAAE,WAAW;IACzB,QAAQ,SAAS,EAAE,WAAW;IAC9B,QAAQ,eAAe,EAAE;IACzB,YAAY,IAAI,EAAE;IAClB,gBAAgB,cAAc,EAAE,MAAM;IACtC,gBAAgB,IAAI,EAAE;IACtB,oBAAoB,IAAI,EAAE,QAAQ;IAClC,iBAAiB;IACjB,aAAa;IACb,YAAY,OAAO,EAAE;IACrB,gBAAgB,cAAc,EAAE,SAAS;IACzC,gBAAgB,IAAI,EAAE;IACtB,oBAAoB,IAAI,EAAE,WAAW;IACrC,oBAAoB,SAAS,EAAE,kBAAkB;IACjD,iBAAiB;IACjB,aAAa;IACb,SAAS;IACT,KAAK;IACL,CAAC,CAAC;AACF,IAAO,IAAI,mBAAmB,GAAG;IACjC,IAAI,cAAc,EAAE,qBAAqB;IACzC,IAAI,IAAI,EAAE;IACV,QAAQ,IAAI,EAAE,WAAW;IACzB,QAAQ,SAAS,EAAE,qBAAqB;IACxC,QAAQ,eAAe,EAAE;IACzB,YAAY,KAAK,EAAE;IACnB,gBAAgB,cAAc,EAAE,EAAE;IAClC,gBAAgB,IAAI,EAAE;IACtB,oBAAoB,IAAI,EAAE,UAAU;IACpC,oBAAoB,OAAO,EAAE;IAC7B,wBAAwB,IAAI,EAAE;IAC9B,4BAA4B,IAAI,EAAE,WAAW;IAC7C,4BAA4B,SAAS,EAAE,WAAW;IAClD,yBAAyB;IACzB,qBAAqB;IACrB,iBAAiB;IACjB,aAAa;IACb,YAAY,QAAQ,EAAE;IACtB,gBAAgB,cAAc,EAAE,UAAU;IAC1C,gBAAgB,IAAI,EAAE;IACtB,oBAAoB,IAAI,EAAE,QAAQ;IAClC,iBAAiB;IACjB,aAAa;IACb,SAAS;IACT,KAAK;IACL,CAAC,CAAC;AACF,IAAO,IAAI,2BAA2B,GAAG;IACzC,IAAI,cAAc,EAAE,6BAA6B;IACjD,IAAI,IAAI,EAAE;IACV,QAAQ,IAAI,EAAE,WAAW;IACzB,QAAQ,SAAS,EAAE,6BAA6B;IAChD,QAAQ,eAAe,EAAE;IACzB,YAAY,KAAK,EAAE;IACnB,gBAAgB,cAAc,EAAE,EAAE;IAClC,gBAAgB,IAAI,EAAE;IACtB,oBAAoB,IAAI,EAAE,UAAU;IACpC,oBAAoB,OAAO,EAAE;IAC7B,wBAAwB,IAAI,EAAE;IAC9B,4BAA4B,IAAI,EAAE,WAAW;IAC7C,4BAA4B,SAAS,EAAE,eAAe;IACtD,yBAAyB;IACzB,qBAAqB;IACrB,iBAAiB;IACjB,aAAa;IACb,YAAY,QAAQ,EAAE;IACtB,gBAAgB,cAAc,EAAE,UAAU;IAC1C,gBAAgB,IAAI,EAAE;IACtB,oBAAoB,IAAI,EAAE,QAAQ;IAClC,iBAAiB;IACjB,aAAa;IACb,SAAS;IACT,KAAK;IACL,CAAC,CAAC;;;;;;;;;;;;;ICnKF;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;AACA,IAAO,IAAI,cAAc,GAAG;IAC5B,IAAI,aAAa,EAAE,gBAAgB;IACnC,IAAI,MAAM,EAAE;IACZ,QAAQ,cAAc,EAAE,iBAAiB;IACzC,QAAQ,YAAY,EAAE,OAAO;IAC7B,QAAQ,IAAI,EAAE;IACd,YAAY,IAAI,EAAE,QAAQ;IAC1B,SAAS;IACT,KAAK;IACL,CAAC,CAAC;AACF,IAAO,IAAI,UAAU,GAAG;IACxB,IAAI,aAAa,EAAE,YAAY;IAC/B,IAAI,MAAM,EAAE;IACZ,QAAQ,QAAQ,EAAE,IAAI;IACtB,QAAQ,cAAc,EAAE,aAAa;IACrC,QAAQ,IAAI,EAAE;IACd,YAAY,IAAI,EAAE,QAAQ;IAC1B,SAAS;IACT,KAAK;IACL,CAAC,CAAC;AACF,IAAO,IAAI,WAAW,GAAG;IACzB,IAAI,aAAa,EAAE,aAAa;IAChC,IAAI,MAAM,EAAE;IACZ,QAAQ,QAAQ,EAAE,IAAI;IACtB,QAAQ,cAAc,EAAE,aAAa;IACrC,QAAQ,IAAI,EAAE;IACd,YAAY,IAAI,EAAE,QAAQ;IAC1B,SAAS;IACT,KAAK;IACL,CAAC,CAAC;AACF,IAAO,IAAI,YAAY,GAAG;IAC1B,IAAI,aAAa,EAAE,cAAc;IACjC,IAAI,MAAM,EAAE;IACZ,QAAQ,QAAQ,EAAE,IAAI;IACtB,QAAQ,cAAc,EAAE,UAAU;IAClC,QAAQ,IAAI,EAAE;IACd,YAAY,IAAI,EAAE,QAAQ;IAC1B,SAAS;IACT,KAAK;IACL,IAAI,YAAY,EAAE,IAAI;IACtB,CAAC,CAAC;AACF,IAAO,IAAI,yBAAyB,GAAG;IACvC,IAAI,aAAa,EAAE,2BAA2B;IAC9C,IAAI,MAAM,EAAE;IACZ,QAAQ,QAAQ,EAAE,IAAI;IACtB,QAAQ,cAAc,EAAE,2BAA2B;IACnD,QAAQ,IAAI,EAAE;IACd,YAAY,IAAI,EAAE,QAAQ;IAC1B,SAAS;IACT,KAAK;IACL,CAAC,CAAC;AACF,IAAO,IAAI,cAAc,GAAG;IAC5B,IAAI,aAAa,EAAE,gBAAgB;IACnC,IAAI,MAAM,EAAE;IACZ,QAAQ,QAAQ,EAAE,IAAI;IACtB,QAAQ,cAAc,EAAE,gBAAgB;IACxC,QAAQ,IAAI,EAAE;IACd,YAAY,IAAI,EAAE,QAAQ;IAC1B,SAAS;IACT,KAAK;IACL,CAAC,CAAC;;ICrEF;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;;;;;;;;ICRH;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;AACA,IAGA;AACA,AAAG,QAAC,QAAQ,kBAAkB,YAAY;IAC1C;IACA;IACA;IACA;IACA,IAAI,SAAS,QAAQ,CAAC,MAAM,EAAE;IAC9B,QAAQ,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IAC7B,KAAK;IACL,IAAI,QAAQ,CAAC,SAAS,CAAC,OAAO,GAAG,UAAU,OAAO,EAAE,QAAQ,EAAE;IAC9D,QAAQ,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC;IAChD,YAAY,OAAO,EAAE,OAAO;IAC5B,SAAS,EAAE,oBAAoB,EAAE,QAAQ,CAAC,CAAC;IAC3C,KAAK,CAAC;IACN,IAAI,QAAQ,CAAC,SAAS,CAAC,IAAI,GAAG,UAAUC,4BAAyB,EAAE,OAAO,EAAE,QAAQ,EAAE;IACtF,QAAQ,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC;IAChD,YAAY,yBAAyB,EAAEA,4BAAyB;IAChE,YAAY,OAAO,EAAE,OAAO;IAC5B,SAAS,EAAE,iBAAiB,EAAE,QAAQ,CAAC,CAAC;IACxC,KAAK,CAAC;IACN,IAAI,QAAQ,CAAC,SAAS,CAAC,GAAG,GAAG,UAAUA,4BAAyB,EAAEC,cAAW,EAAE,OAAO,EAAE,QAAQ,EAAE;IAClG,QAAQ,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC;IAChD,YAAY,yBAAyB,EAAED,4BAAyB;IAChE,YAAY,WAAW,EAAEC,cAAW;IACpC,YAAY,OAAO,EAAE,OAAO;IAC5B,SAAS,EAAE,gBAAgB,EAAE,QAAQ,CAAC,CAAC;IACvC,KAAK,CAAC;IACN,IAAI,QAAQ,CAAC,SAAS,CAAC,QAAQ,GAAG,UAAUD,4BAAyB,EAAEC,cAAW,EAAE,OAAO,EAAE,QAAQ,EAAE;IACvG,QAAQ,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC;IAChD,YAAY,yBAAyB,EAAED,4BAAyB;IAChE,YAAY,WAAW,EAAEC,cAAW;IACpC,YAAY,OAAO,EAAE,OAAO;IAC5B,SAAS,EAAE,qBAAqB,EAAE,QAAQ,CAAC,CAAC;IAC5C,KAAK,CAAC;IACN,IAAI,QAAQ,CAAC,SAAS,CAAC,WAAW,GAAG,UAAUC,eAAY,EAAE,OAAO,EAAE,QAAQ,EAAE;IAChF,QAAQ,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC;IAChD,YAAY,YAAY,EAAEA,eAAY;IACtC,YAAY,OAAO,EAAE,OAAO;IAC5B,SAAS,EAAE,wBAAwB,EAAE,QAAQ,CAAC,CAAC;IAC/C,KAAK,CAAC;IACN,IAAI,QAAQ,CAAC,SAAS,CAAC,QAAQ,GAAG,UAAUA,eAAY,EAAE,OAAO,EAAE,QAAQ,EAAE;IAC7E,QAAQ,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC;IAChD,YAAY,YAAY,EAAEA,eAAY;IACtC,YAAY,OAAO,EAAE,OAAO;IAC5B,SAAS,EAAE,qBAAqB,EAAE,QAAQ,CAAC,CAAC;IAC5C,KAAK,CAAC;IACN,IAAI,OAAO,QAAQ,CAAC;IACpB,CAAC,EAAE,CAAC,CAAC;AACL,IACA;IACA,IAAI,UAAU,GAAG,IAAIC,iBAAiB,CAACC,SAAO,CAAC,CAAC;IAChD,IAAI,oBAAoB,GAAG;IAC3B,IAAI,UAAU,EAAE,KAAK;IACrB,IAAI,IAAI,EAAE,sEAAsE;IAChF,IAAI,aAAa,EAAE;IACnB,QAAQC,cAAyB;IACjC,KAAK;IACL,IAAI,eAAe,EAAE;IACrB,QAAQC,UAAqB;IAC7B,KAAK;IACL,IAAI,gBAAgB,EAAE;IACtB,QAAQC,cAAyB;IACjC,KAAK;IACL,IAAI,SAAS,EAAE;IACf,QAAQ,GAAG,EAAE;IACb,YAAY,UAAU,EAAEC,2BAAmC;IAC3D,SAAS;IACT,QAAQ,OAAO,EAAE;IACjB,YAAY,UAAU,EAAEC,UAAkB;IAC1C,SAAS;IACT,KAAK;IACL,IAAI,UAAU,EAAE,UAAU;IAC1B,CAAC,CAAC;IACF,IAAI,iBAAiB,GAAG;IACxB,IAAI,UAAU,EAAE,KAAK;IACrB,IAAI,IAAI,EAAE,4GAA4G;IACtH,IAAI,aAAa,EAAE;IACnB,QAAQC,yBAAoC;IAC5C,QAAQL,cAAyB;IACjC,KAAK;IACL,IAAI,eAAe,EAAE;IACrB,QAAQC,UAAqB;IAC7B,KAAK;IACL,IAAI,gBAAgB,EAAE;IACtB,QAAQC,cAAyB;IACjC,KAAK;IACL,IAAI,SAAS,EAAE;IACf,QAAQ,GAAG,EAAE;IACb,YAAY,UAAU,EAAEC,2BAAmC;IAC3D,SAAS;IACT,QAAQ,OAAO,EAAE;IACjB,YAAY,UAAU,EAAEC,UAAkB;IAC1C,SAAS;IACT,KAAK;IACL,IAAI,UAAU,EAAE,UAAU;IAC1B,CAAC,CAAC;IACF,IAAI,gBAAgB,GAAG;IACvB,IAAI,UAAU,EAAE,KAAK;IACrB,IAAI,IAAI,EAAE,0HAA0H;IACpI,IAAI,aAAa,EAAE;IACnB,QAAQC,yBAAoC;IAC5C,QAAQC,WAAsB;IAC9B,QAAQN,cAAyB;IACjC,KAAK;IACL,IAAI,eAAe,EAAE;IACrB,QAAQC,UAAqB;IAC7B,KAAK;IACL,IAAI,gBAAgB,EAAE;IACtB,QAAQC,cAAyB;IACjC,KAAK;IACL,IAAI,SAAS,EAAE;IACf,QAAQ,GAAG,EAAE;IACb,YAAY,UAAU,EAAEK,aAAqB;IAC7C,SAAS;IACT,QAAQ,OAAO,EAAE;IACjB,YAAY,UAAU,EAAEH,UAAkB;IAC1C,SAAS;IACT,KAAK;IACL,IAAI,UAAU,EAAE,UAAU;IAC1B,CAAC,CAAC;IACF,IAAI,qBAAqB,GAAG;IAC5B,IAAI,UAAU,EAAE,MAAM;IACtB,IAAI,IAAI,EAAE,mIAAmI;IAC7I,IAAI,aAAa,EAAE;IACnB,QAAQC,yBAAoC;IAC5C,QAAQC,WAAsB;IAC9B,QAAQN,cAAyB;IACjC,KAAK;IACL,IAAI,eAAe,EAAE;IACrB,QAAQC,UAAqB;IAC7B,KAAK;IACL,IAAI,gBAAgB,EAAE;IACtB,QAAQC,cAAyB;IACjC,KAAK;IACL,IAAI,SAAS,EAAE;IACf,QAAQ,GAAG,EAAE;IACb,YAAY,UAAU,EAAEK,aAAqB;IAC7C,SAAS;IACT,QAAQ,OAAO,EAAE;IACjB,YAAY,UAAU,EAAEH,UAAkB;IAC1C,SAAS;IACT,KAAK;IACL,IAAI,UAAU,EAAE,UAAU;IAC1B,CAAC,CAAC;IACF,IAAI,wBAAwB,GAAG;IAC/B,IAAI,UAAU,EAAE,KAAK;IACrB,IAAI,OAAO,EAAE,8BAA8B;IAC3C,IAAI,IAAI,EAAE,YAAY;IACtB,IAAI,aAAa,EAAE;IACnB,QAAQI,YAAuB;IAC/B,KAAK;IACL,IAAI,gBAAgB,EAAE;IACtB,QAAQN,cAAyB;IACjC,KAAK;IACL,IAAI,SAAS,EAAE;IACf,QAAQ,GAAG,EAAE;IACb,YAAY,UAAU,EAAEC,2BAAmC;IAC3D,SAAS;IACT,QAAQ,OAAO,EAAE;IACjB,YAAY,UAAU,EAAEC,UAAkB;IAC1C,SAAS;IACT,KAAK;IACL,IAAI,UAAU,EAAE,UAAU;IAC1B,CAAC,CAAC;IACF,IAAI,qBAAqB,GAAG;IAC5B,IAAI,UAAU,EAAE,KAAK;IACrB,IAAI,OAAO,EAAE,8BAA8B;IAC3C,IAAI,IAAI,EAAE,YAAY;IACtB,IAAI,aAAa,EAAE;IACnB,QAAQI,YAAuB;IAC/B,KAAK;IACL,IAAI,gBAAgB,EAAE;IACtB,QAAQN,cAAyB;IACjC,KAAK;IACL,IAAI,SAAS,EAAE;IACf,QAAQ,GAAG,EAAE;IACb,YAAY,UAAU,EAAEC,2BAAmC;IAC3D,SAAS;IACT,QAAQ,OAAO,EAAE;IACjB,YAAY,UAAU,EAAEC,UAAkB;IAC1C,SAAS;IACT,KAAK;IACL,IAAI,UAAU,EAAE,UAAU;IAC1B,CAAC,CAAC;;ICnMF;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICRH;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;AACA,IAEA,IAAI,WAAW,GAAG,qBAAqB,CAAC;IACxC,IAAI,cAAc,GAAG,OAAO,CAAC;AAC7B,AAAG,QAAC,oBAAoB,kBAAkB,UAAU,MAAM,EAAE;IAC5D,IAAIK,SAAiB,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;IACpD;IACA;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,oBAAoB,CAAC,WAAW,EAAE,cAAc,EAAE,OAAO,EAAE;IACxE,QAAQ,IAAI,KAAK,GAAG,IAAI,CAAC;IACzB,QAAQ,IAAI,WAAW,IAAI,SAAS,EAAE;IACtC,YAAY,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IAC/D,SAAS;IACT,QAAQ,IAAI,cAAc,IAAI,SAAS,EAAE;IACzC,YAAY,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IAClE,SAAS;IACT,QAAQ,IAAI,CAAC,OAAO,EAAE;IACtB,YAAY,OAAO,GAAG,EAAE,CAAC;IACzB,SAAS;IACT,QAAQ,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC;IAChE,QAAQ,KAAK,CAAC,UAAU,GAAG,YAAY,CAAC;IACxC,QAAQ,KAAK,CAAC,cAAc,GAAG,OAAO,CAAC;IACvC,QAAQ,KAAK,CAAC,gCAAgC,GAAG,EAAE,CAAC;IACpD,QAAQ,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,IAAI,8BAA8B,CAAC;IAC3F,QAAQ,KAAK,CAAC,kBAAkB,GAAG,iCAAiC,CAAC;IACrE,QAAQ,KAAK,CAAC,WAAW,GAAG,WAAW,CAAC;IACxC,QAAQ,KAAK,CAAC,cAAc,GAAG,cAAc,CAAC;IAC9C,QAAQ,KAAK,CAAC,gBAAgB,CAAC,WAAW,GAAG,GAAG,GAAG,cAAc,CAAC,CAAC;IACnE,QAAQ,IAAI,OAAO,CAAC,cAAc,KAAK,IAAI,IAAI,OAAO,CAAC,cAAc,KAAK,SAAS,EAAE;IACrF,YAAY,KAAK,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;IAC1D,SAAS;IACT,QAAQ,IAAI,OAAO,CAAC,gCAAgC,KAAK,IAAI,IAAI,OAAO,CAAC,gCAAgC,KAAK,SAAS,EAAE;IACzH,YAAY,KAAK,CAAC,gCAAgC,GAAG,OAAO,CAAC,gCAAgC,CAAC;IAC9F,SAAS;IACT,QAAQ,OAAO,KAAK,CAAC;IACrB,KAAK;IACL,IAAI,OAAO,oBAAoB,CAAC;IAChC,CAAC,CAACC,8BAA8B,CAAC,CAAC;;IClDlC;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;AACA,AAOG,QAAC,aAAa,kBAAkB,UAAU,MAAM,EAAE;IACrD,IAAID,SAAiB,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IAC7C;IACA;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,aAAa,CAAC,WAAW,EAAEE,iBAAc,EAAE,OAAO,EAAE;IACjE,QAAQ,IAAI,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,EAAEA,iBAAc,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC;IACpF,QAAQ,KAAK,CAAC,QAAQ,GAAG,IAAIC,QAAmB,CAAC,KAAK,CAAC,CAAC;IACxD,QAAQ,OAAO,KAAK,CAAC;IACrB,KAAK;IACL,IAAI,aAAa,CAAC,SAAS,CAAC,cAAc,GAAG,UAAU,OAAO,EAAE,QAAQ,EAAE;IAC1E,QAAQ,OAAO,IAAI,CAAC,oBAAoB,CAAC;IACzC,YAAY,OAAO,EAAE,OAAO;IAC5B,SAAS,EAAE,2BAA2B,EAAE,QAAQ,CAAC,CAAC;IAClD,KAAK,CAAC;IACN,IAAI,aAAa,CAAC,SAAS,CAAC,kBAAkB,GAAG,UAAUf,eAAY,EAAE,OAAO,EAAE,QAAQ,EAAE;IAC5F,QAAQ,OAAO,IAAI,CAAC,oBAAoB,CAAC;IACzC,YAAY,YAAY,EAAEA,eAAY;IACtC,YAAY,OAAO,EAAE,OAAO;IAC5B,SAAS,EAAE,+BAA+B,EAAE,QAAQ,CAAC,CAAC;IACtD,KAAK,CAAC;IACN,IAAI,OAAO,aAAa,CAAC;IACzB,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC;IACzB;IACA,IAAIgB,YAAU,GAAG,IAAIf,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAChD,IAAI,2BAA2B,GAAG;IAClC,IAAI,UAAU,EAAE,KAAK;IACrB,IAAI,IAAI,EAAE,yCAAyC;IACnD,IAAI,eAAe,EAAE;IACrB,QAAQG,UAAqB;IAC7B,KAAK;IACL,IAAI,gBAAgB,EAAE;IACtB,QAAQC,cAAyB;IACjC,KAAK;IACL,IAAI,SAAS,EAAE;IACf,QAAQ,GAAG,EAAE;IACb,YAAY,UAAU,EAAEY,mBAA2B;IACnD,SAAS;IACT,QAAQ,OAAO,EAAE;IACjB,YAAY,UAAU,EAAEV,UAAkB;IAC1C,SAAS;IACT,KAAK;IACL,IAAI,UAAU,EAAES,YAAU;IAC1B,CAAC,CAAC;IACF,IAAI,+BAA+B,GAAG;IACtC,IAAI,UAAU,EAAE,KAAK;IACrB,IAAI,OAAO,EAAE,8BAA8B;IAC3C,IAAI,IAAI,EAAE,YAAY;IACtB,IAAI,aAAa,EAAE;IACnB,QAAQL,YAAuB;IAC/B,KAAK;IACL,IAAI,gBAAgB,EAAE;IACtB,QAAQN,cAAyB;IACjC,KAAK;IACL,IAAI,SAAS,EAAE;IACf,QAAQ,GAAG,EAAE;IACb,YAAY,UAAU,EAAEY,mBAA2B;IACnD,SAAS;IACT,QAAQ,OAAO,EAAE;IACjB,YAAY,UAAU,EAAEV,UAAkB;IAC1C,SAAS;IACT,KAAK;IACL,IAAI,UAAU,EAAES,YAAU;IAC1B,CAAC,CAAC;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/packages/@azure/arm-features/dist/arm-features.min.js b/packages/@azure/arm-features/dist/arm-features.min.js new file mode 100644 index 000000000000..4bc8971e7566 --- /dev/null +++ b/packages/@azure/arm-features/dist/arm-features.min.js @@ -0,0 +1 @@ +!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("ms-rest-azure-js"),require("ms-rest-js")):"function"==typeof define&&define.amd?define(["exports","ms-rest-azure-js","ms-rest-js"],r):r((e.Azure=e.Azure||{},e.Azure.ArmFeatures={}),e.msRestAzure,e.msRest)}(this,function(e,r,t){"use strict";var a=function(e,r){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])})(e,r)};function s(e,r){function t(){this.constructor=e}a(e,r),e.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t)}var i=Object.freeze({}),n=r.CloudErrorMapper,o=r.BaseResourceMapper,p={serializedName:"FeatureProperties",type:{name:"Composite",className:"FeatureProperties",modelProperties:{state:{serializedName:"state",type:{name:"String"}}}}},u={serializedName:"FeatureResult",type:{name:"Composite",className:"FeatureResult",modelProperties:{name:{serializedName:"name",type:{name:"String"}},properties:{serializedName:"properties",type:{name:"Composite",className:"FeatureProperties"}},id:{serializedName:"id",type:{name:"String"}},type:{serializedName:"type",type:{name:"String"}}}}},m={serializedName:"OperationListResult",type:{name:"Composite",className:"OperationListResult",modelProperties:{value:{serializedName:"",type:{name:"Sequence",element:{type:{name:"Composite",className:"Operation"}}}},nextLink:{serializedName:"nextLink",type:{name:"String"}}}}},l={serializedName:"FeatureOperationsListResult",type:{name:"Composite",className:"FeatureOperationsListResult",modelProperties:{value:{serializedName:"",type:{name:"Sequence",element:{type:{name:"Composite",className:"FeatureResult"}}}},nextLink:{serializedName:"nextLink",type:{name:"String"}}}}},d=Object.freeze({CloudError:n,BaseResource:o,FeatureProperties:p,FeatureResult:u,OperationDisplay:{serializedName:"Operation_display",type:{name:"Composite",className:"OperationDisplay",modelProperties:{provider:{serializedName:"provider",type:{name:"String"}},resource:{serializedName:"resource",type:{name:"String"}},operation:{serializedName:"operation",type:{name:"String"}}}}},Operation:{serializedName:"Operation",type:{name:"Composite",className:"Operation",modelProperties:{name:{serializedName:"name",type:{name:"String"}},display:{serializedName:"display",type:{name:"Composite",className:"OperationDisplay"}}}}},OperationListResult:m,FeatureOperationsListResult:l}),c={parameterPath:"acceptLanguage",mapper:{serializedName:"accept-language",defaultValue:"en-US",type:{name:"String"}}},y={parameterPath:"apiVersion",mapper:{required:!0,serializedName:"api-version",type:{name:"String"}}},f={parameterPath:"featureName",mapper:{required:!0,serializedName:"featureName",type:{name:"String"}}},h={parameterPath:"nextPageLink",mapper:{required:!0,serializedName:"nextLink",type:{name:"String"}},skipEncoding:!0},g={parameterPath:"resourceProviderNamespace",mapper:{required:!0,serializedName:"resourceProviderNamespace",type:{name:"String"}}},N={parameterPath:"subscriptionId",mapper:{required:!0,serializedName:"subscriptionId",type:{name:"String"}}},P=Object.freeze({FeatureOperationsListResult:l,FeatureResult:u,FeatureProperties:p,CloudError:n}),z=function(){function e(e){this.client=e}return e.prototype.listAll=function(e,r){return this.client.sendOperationRequest({options:e},O,r)},e.prototype.list=function(e,r,t){return this.client.sendOperationRequest({resourceProviderNamespace:e,options:r},M,t)},e.prototype.get=function(e,r,t,a){return this.client.sendOperationRequest({resourceProviderNamespace:e,featureName:r,options:t},R,a)},e.prototype.register=function(e,r,t,a){return this.client.sendOperationRequest({resourceProviderNamespace:e,featureName:r,options:t},v,a)},e.prototype.listAllNext=function(e,r,t){return this.client.sendOperationRequest({nextPageLink:e,options:r},F,t)},e.prototype.listNext=function(e,r,t){return this.client.sendOperationRequest({nextPageLink:e,options:r},L,t)},e}(),b=new t.Serializer(P),O={httpMethod:"GET",path:"subscriptions/{subscriptionId}/providers/Microsoft.Features/features",urlParameters:[N],queryParameters:[y],headerParameters:[c],responses:{200:{bodyMapper:l},default:{bodyMapper:n}},serializer:b},M={httpMethod:"GET",path:"subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features",urlParameters:[g,N],queryParameters:[y],headerParameters:[c],responses:{200:{bodyMapper:l},default:{bodyMapper:n}},serializer:b},R={httpMethod:"GET",path:"subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}",urlParameters:[g,f,N],queryParameters:[y],headerParameters:[c],responses:{200:{bodyMapper:u},default:{bodyMapper:n}},serializer:b},v={httpMethod:"POST",path:"subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}/register",urlParameters:[g,f,N],queryParameters:[y],headerParameters:[c],responses:{200:{bodyMapper:u},default:{bodyMapper:n}},serializer:b},F={httpMethod:"GET",baseUrl:"https://management.azure.com",path:"{nextLink}",urlParameters:[h],headerParameters:[c],responses:{200:{bodyMapper:l},default:{bodyMapper:n}},serializer:b},L={httpMethod:"GET",baseUrl:"https://management.azure.com",path:"{nextLink}",urlParameters:[h],headerParameters:[c],responses:{200:{bodyMapper:l},default:{bodyMapper:n}},serializer:b},S=function(i){function e(e,r,t){var a=this;if(null==e)throw new Error("'credentials' cannot be null.");if(null==r)throw new Error("'subscriptionId' cannot be null.");return t||(t={}),(a=i.call(this,e,t)||this).apiVersion="2015-12-01",a.acceptLanguage="en-US",a.longRunningOperationRetryTimeout=30,a.baseUri=t.baseUri||a.baseUri||"https://management.azure.com",a.requestContentType="application/json; charset=utf-8",a.credentials=e,a.subscriptionId=r,a.addUserAgentInfo("@azure/arm-features/1.0.0"),null!==t.acceptLanguage&&void 0!==t.acceptLanguage&&(a.acceptLanguage=t.acceptLanguage),null!==t.longRunningOperationRetryTimeout&&void 0!==t.longRunningOperationRetryTimeout&&(a.longRunningOperationRetryTimeout=t.longRunningOperationRetryTimeout),a}return s(e,i),e}(r.AzureServiceClient),q=function(i){function e(e,r,t){var a=i.call(this,e,r,t)||this;return a.features=new z(a),a}return s(e,i),e.prototype.listOperations=function(e,r){return this.sendOperationRequest({options:e},C,r)},e.prototype.listOperationsNext=function(e,r,t){return this.sendOperationRequest({nextPageLink:e,options:r},T,t)},e}(S),x=new t.Serializer(d),C={httpMethod:"GET",path:"providers/Microsoft.Features/operations",queryParameters:[y],headerParameters:[c],responses:{200:{bodyMapper:m},default:{bodyMapper:n}},serializer:x},T={httpMethod:"GET",baseUrl:"https://management.azure.com",path:"{nextLink}",urlParameters:[h],headerParameters:[c],responses:{200:{bodyMapper:m},default:{bodyMapper:n}},serializer:x};e.FeatureClient=q,e.FeatureClientContext=S,e.FeatureModels=i,e.FeatureMappers=d,e.Features=z,Object.defineProperty(e,"__esModule",{value:!0})}); \ No newline at end of file diff --git a/packages/@azure/arm-features/dist/arm-features.min.js.map b/packages/@azure/arm-features/dist/arm-features.min.js.map new file mode 100644 index 000000000000..bbb4f7dfea2b --- /dev/null +++ b/packages/@azure/arm-features/dist/arm-features.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../node_modules/tslib/tslib.es6.js","../esm/models/mappers.js","../esm/models/parameters.js","../esm/operations/features.js","../esm/featureClientContext.js","../esm/featureClient.js"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__extends","__","this","constructor","prototype","create","CloudError","CloudErrorMapper","BaseResource","BaseResourceMapper","FeatureProperties","serializedName","type","name","className","modelProperties","state","FeatureResult","properties","id","OperationListResult","value","element","nextLink","FeatureOperationsListResult","provider","resource","operation","display","acceptLanguage","parameterPath","mapper","defaultValue","apiVersion","required","featureName","nextPageLink","skipEncoding","resourceProviderNamespace","subscriptionId","Features","client","listAll","options","callback","sendOperationRequest","listAllOperationSpec","list","listOperationSpec","get","getOperationSpec","register","registerOperationSpec","listAllNext","listAllNextOperationSpec","listNext","listNextOperationSpec","serializer","msRest.Serializer","Mappers","httpMethod","path","urlParameters","Parameters.subscriptionId","queryParameters","Parameters.apiVersion","headerParameters","Parameters.acceptLanguage","responses","200","bodyMapper","Mappers.FeatureOperationsListResult","default","Mappers.CloudError","Parameters.resourceProviderNamespace","Parameters.featureName","Mappers.FeatureResult","baseUrl","Parameters.nextPageLink","FeatureClientContext","_super","credentials","_this","undefined","Error","call","longRunningOperationRetryTimeout","baseUri","requestContentType","addUserAgentInfo","packageName","tslib_1.__extends","msRestAzure.AzureServiceClient","FeatureClient","features","operations.Features","listOperations","listOperationsOperationSpec","listOperationsNext","listOperationsNextOperationSpec","Mappers.OperationListResult"],"mappings":"uUAgBA,IAAIA,EAAgB,SAASC,EAAGC,GAI5B,OAHAF,EAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,IACvE,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EAAOA,EAAEM,eAAeD,KAAIN,EAAEM,GAAKL,EAAEK,MACpDN,EAAGC,IAGrB,SAASO,EAAUR,EAAGC,GAEzB,SAASQ,IAAOC,KAAKC,YAAcX,EADnCD,EAAcC,EAAGC,GAEjBD,EAAEY,UAAkB,OAANX,EAAaC,OAAOW,OAAOZ,IAAMQ,EAAGG,UAAYX,EAAEW,UAAW,IAAIH,2BChBxEK,EAAaC,EAAAA,iBACbC,EAAeC,EAAAA,mBACfC,EAAoB,CAC3BC,eAAgB,oBAChBC,KAAM,CACFC,KAAM,YACNC,UAAW,oBACXC,gBAAiB,CACbC,MAAO,CACHL,eAAgB,QAChBC,KAAM,CACFC,KAAM,cAMfI,EAAgB,CACvBN,eAAgB,gBAChBC,KAAM,CACFC,KAAM,YACNC,UAAW,gBACXC,gBAAiB,CACbF,KAAM,CACFF,eAAgB,OAChBC,KAAM,CACFC,KAAM,WAGdK,WAAY,CACRP,eAAgB,aAChBC,KAAM,CACFC,KAAM,YACNC,UAAW,sBAGnBK,GAAI,CACAR,eAAgB,KAChBC,KAAM,CACFC,KAAM,WAGdD,KAAM,CACFD,eAAgB,OAChBC,KAAM,CACFC,KAAM,cAuDfO,EAAsB,CAC7BT,eAAgB,sBAChBC,KAAM,CACFC,KAAM,YACNC,UAAW,sBACXC,gBAAiB,CACbM,MAAO,CACHV,eAAgB,GAChBC,KAAM,CACFC,KAAM,WACNS,QAAS,CACLV,KAAM,CACFC,KAAM,YACNC,UAAW,gBAK3BS,SAAU,CACNZ,eAAgB,WAChBC,KAAM,CACFC,KAAM,cAMfW,EAA8B,CACrCb,eAAgB,8BAChBC,KAAM,CACFC,KAAM,YACNC,UAAW,8BACXC,gBAAiB,CACbM,MAAO,CACHV,eAAgB,GAChBC,KAAM,CACFC,KAAM,WACNS,QAAS,CACLV,KAAM,CACFC,KAAM,YACNC,UAAW,oBAK3BS,SAAU,CACNZ,eAAgB,WAChBC,KAAM,CACFC,KAAM,gHAjGI,CAC1BF,eAAgB,oBAChBC,KAAM,CACFC,KAAM,YACNC,UAAW,mBACXC,gBAAiB,CACbU,SAAU,CACNd,eAAgB,WAChBC,KAAM,CACFC,KAAM,WAGda,SAAU,CACNf,eAAgB,WAChBC,KAAM,CACFC,KAAM,WAGdc,UAAW,CACPhB,eAAgB,YAChBC,KAAM,CACFC,KAAM,wBAMH,CACnBF,eAAgB,YAChBC,KAAM,CACFC,KAAM,YACNC,UAAW,YACXC,gBAAiB,CACbF,KAAM,CACFF,eAAgB,OAChBC,KAAM,CACFC,KAAM,WAGde,QAAS,CACLjB,eAAgB,UAChBC,KAAM,CACFC,KAAM,YACNC,UAAW,8EC/FpBe,EAAiB,CACxBC,cAAe,iBACfC,OAAQ,CACJpB,eAAgB,kBAChBqB,aAAc,QACdpB,KAAM,CACFC,KAAM,YAIPoB,EAAa,CACpBH,cAAe,aACfC,OAAQ,CACJG,UAAU,EACVvB,eAAgB,cAChBC,KAAM,CACFC,KAAM,YAIPsB,EAAc,CACrBL,cAAe,cACfC,OAAQ,CACJG,UAAU,EACVvB,eAAgB,cAChBC,KAAM,CACFC,KAAM,YAIPuB,EAAe,CACtBN,cAAe,eACfC,OAAQ,CACJG,UAAU,EACVvB,eAAgB,WAChBC,KAAM,CACFC,KAAM,WAGdwB,cAAc,GAEPC,EAA4B,CACnCR,cAAe,4BACfC,OAAQ,CACJG,UAAU,EACVvB,eAAgB,4BAChBC,KAAM,CACFC,KAAM,YAIP0B,EAAiB,CACxBT,cAAe,iBACfC,OAAQ,CACJG,UAAU,EACVvB,eAAgB,iBAChBC,KAAM,CACFC,KAAM,8GCrDd2B,EAA0B,WAK1B,SAASA,EAASC,GACdvC,KAAKuC,OAASA,EAuClB,OArCAD,EAASpC,UAAUsC,QAAU,SAAUC,EAASC,GAC5C,OAAO1C,KAAKuC,OAAOI,qBAAqB,CACpCF,QAASA,GACVG,EAAsBF,IAE7BJ,EAASpC,UAAU2C,KAAO,SAAUT,EAA2BK,EAASC,GACpE,OAAO1C,KAAKuC,OAAOI,qBAAqB,CACpCP,0BAA2BA,EAC3BK,QAASA,GACVK,EAAmBJ,IAE1BJ,EAASpC,UAAU6C,IAAM,SAAUX,EAA2BH,EAAaQ,EAASC,GAChF,OAAO1C,KAAKuC,OAAOI,qBAAqB,CACpCP,0BAA2BA,EAC3BH,YAAaA,EACbQ,QAASA,GACVO,EAAkBN,IAEzBJ,EAASpC,UAAU+C,SAAW,SAAUb,EAA2BH,EAAaQ,EAASC,GACrF,OAAO1C,KAAKuC,OAAOI,qBAAqB,CACpCP,0BAA2BA,EAC3BH,YAAaA,EACbQ,QAASA,GACVS,EAAuBR,IAE9BJ,EAASpC,UAAUiD,YAAc,SAAUjB,EAAcO,EAASC,GAC9D,OAAO1C,KAAKuC,OAAOI,qBAAqB,CACpCT,aAAcA,EACdO,QAASA,GACVW,EAA0BV,IAEjCJ,EAASpC,UAAUmD,SAAW,SAAUnB,EAAcO,EAASC,GAC3D,OAAO1C,KAAKuC,OAAOI,qBAAqB,CACpCT,aAAcA,EACdO,QAASA,GACVa,EAAuBZ,IAEvBJ,EA7CC,GAiDRiB,EAAa,IAAIC,EAAAA,WAAkBC,GACnCb,EAAuB,CACvBc,WAAY,MACZC,KAAM,uEACNC,cAAe,CACXC,GAEJC,gBAAiB,CACbC,GAEJC,iBAAkB,CACdC,GAEJC,UAAW,CACPC,IAAK,CACDC,WAAYC,GAEhBC,QAAS,CACLF,WAAYG,IAGpBhB,WAAYA,GAEZT,EAAoB,CACpBY,WAAY,MACZC,KAAM,6GACNC,cAAe,CACXY,EACAX,GAEJC,gBAAiB,CACbC,GAEJC,iBAAkB,CACdC,GAEJC,UAAW,CACPC,IAAK,CACDC,WAAYC,GAEhBC,QAAS,CACLF,WAAYG,IAGpBhB,WAAYA,GAEZP,EAAmB,CACnBU,WAAY,MACZC,KAAM,2HACNC,cAAe,CACXY,EACAC,EACAZ,GAEJC,gBAAiB,CACbC,GAEJC,iBAAkB,CACdC,GAEJC,UAAW,CACPC,IAAK,CACDC,WAAYM,GAEhBJ,QAAS,CACLF,WAAYG,IAGpBhB,WAAYA,GAEZL,EAAwB,CACxBQ,WAAY,OACZC,KAAM,oIACNC,cAAe,CACXY,EACAC,EACAZ,GAEJC,gBAAiB,CACbC,GAEJC,iBAAkB,CACdC,GAEJC,UAAW,CACPC,IAAK,CACDC,WAAYM,GAEhBJ,QAAS,CACLF,WAAYG,IAGpBhB,WAAYA,GAEZH,EAA2B,CAC3BM,WAAY,MACZiB,QAAS,+BACThB,KAAM,aACNC,cAAe,CACXgB,GAEJZ,iBAAkB,CACdC,GAEJC,UAAW,CACPC,IAAK,CACDC,WAAYC,GAEhBC,QAAS,CACLF,WAAYG,IAGpBhB,WAAYA,GAEZD,EAAwB,CACxBI,WAAY,MACZiB,QAAS,+BACThB,KAAM,aACNC,cAAe,CACXgB,GAEJZ,iBAAkB,CACdC,GAEJC,UAAW,CACPC,IAAK,CACDC,WAAYC,GAEhBC,QAAS,CACLF,WAAYG,IAGpBhB,WAAYA,GCrLZsB,EAAsC,SAAUC,GAQhD,SAASD,EAAqBE,EAAa1C,EAAgBI,GACvD,IAAIuC,EAAQhF,KACZ,GAAmBiF,MAAfF,EACA,MAAM,IAAIG,MAAM,iCAEpB,GAAsBD,MAAlB5C,EACA,MAAM,IAAI6C,MAAM,oCAoBpB,OAlBKzC,IACDA,EAAU,KAEduC,EAAQF,EAAOK,KAAKnF,KAAM+E,EAAatC,IAAYzC,MAC7C+B,WAAa,aACnBiD,EAAMrD,eAAiB,QACvBqD,EAAMI,iCAAmC,GACzCJ,EAAMK,QAAU5C,EAAQ4C,SAAWL,EAAMK,SAAW,+BACpDL,EAAMM,mBAAqB,kCAC3BN,EAAMD,YAAcA,EACpBC,EAAM3C,eAAiBA,EACvB2C,EAAMO,iBAAiBC,6BACQ,OAA3B/C,EAAQd,qBAAsDsD,IAA3BxC,EAAQd,iBAC3CqD,EAAMrD,eAAiBc,EAAQd,gBAEc,OAA7Cc,EAAQ2C,uCAA0FH,IAA7CxC,EAAQ2C,mCAC7DJ,EAAMI,iCAAmC3C,EAAQ2C,kCAE9CJ,EAEX,OAnCAS,EAAkBZ,EAAsBC,GAmCjCD,EApCa,CAqCtBa,EAAAA,oBClCEC,EAA+B,SAAUb,GAQzC,SAASa,EAAcZ,EAAa1C,EAAgBI,GAChD,IAAIuC,EAAQF,EAAOK,KAAKnF,KAAM+E,EAAa1C,EAAgBI,IAAYzC,KAEvE,OADAgF,EAAMY,SAAW,IAAIC,EAAoBb,GAClCA,EAaX,OAvBAS,EAAkBE,EAAeb,GAYjCa,EAAczF,UAAU4F,eAAiB,SAAUrD,EAASC,GACxD,OAAO1C,KAAK2C,qBAAqB,CAC7BF,QAASA,GACVsD,EAA6BrD,IAEpCiD,EAAczF,UAAU8F,mBAAqB,SAAU9D,EAAcO,EAASC,GAC1E,OAAO1C,KAAK2C,qBAAqB,CAC7BT,aAAcA,EACdO,QAASA,GACVwD,EAAiCvD,IAEjCiD,EAxBM,CAyBfd,GAEEtB,EAAa,IAAIC,EAAAA,WAAkBC,GACnCsC,EAA8B,CAC9BrC,WAAY,MACZC,KAAM,0CACNG,gBAAiB,CACbC,GAEJC,iBAAkB,CACdC,GAEJC,UAAW,CACPC,IAAK,CACDC,WAAY8B,GAEhB5B,QAAS,CACLF,WAAYG,IAGpBhB,WAAYA,GAEZ0C,EAAkC,CAClCvC,WAAY,MACZiB,QAAS,+BACThB,KAAM,aACNC,cAAe,CACXgB,GAEJZ,iBAAkB,CACdC,GAEJC,UAAW,CACPC,IAAK,CACDC,WAAY8B,GAEhB5B,QAAS,CACLF,WAAYG,IAGpBhB,WAAYA"} \ No newline at end of file diff --git a/packages/@azure/arm-features/package.json b/packages/@azure/arm-features/package.json index 2bdf8e328854..ab7b763bf6f4 100644 --- a/packages/@azure/arm-features/package.json +++ b/packages/@azure/arm-features/package.json @@ -4,8 +4,8 @@ "description": "FeatureClient Library with typescript type definitions for node.js and browser.", "version": "1.0.0", "dependencies": { - "ms-rest-azure-js": "^1.0.166", - "ms-rest-js": "^1.0.439", + "ms-rest-azure-js": "^1.0.172", + "ms-rest-js": "^1.0.443", "tslib": "^1.9.3" }, "keywords": [ @@ -25,7 +25,7 @@ "rollup-plugin-node-resolve": "^3.4.0", "uglify-js": "^3.4.9" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/packages/@azure/arm-features", + "homepage": "https://github.com/azure/azure-sdk-for-js", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-js.git" diff --git a/packages/@azure/arm-links/package.json b/packages/@azure/arm-links/package.json index d74ff650e7ed..38b9a2f527ad 100644 --- a/packages/@azure/arm-links/package.json +++ b/packages/@azure/arm-links/package.json @@ -4,8 +4,8 @@ "description": "ManagementLinkClient Library with typescript type definitions for node.js and browser.", "version": "1.0.0", "dependencies": { - "ms-rest-azure-js": "^1.0.166", - "ms-rest-js": "^1.0.439", + "ms-rest-azure-js": "^1.0.172", + "ms-rest-js": "^1.0.443", "tslib": "^1.9.3" }, "keywords": [ @@ -25,7 +25,7 @@ "rollup-plugin-node-resolve": "^3.4.0", "uglify-js": "^3.4.9" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/packages/@azure/arm-links", + "homepage": "https://github.com/azure/azure-sdk-for-js", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-js.git" diff --git a/packages/@azure/arm-locks/lib/models/index.ts b/packages/@azure/arm-locks/lib/models/index.ts index 017c2d2d38c1..83eb02bbe7d9 100644 --- a/packages/@azure/arm-locks/lib/models/index.ts +++ b/packages/@azure/arm-locks/lib/models/index.ts @@ -27,6 +27,32 @@ export interface ManagementLockOwner { applicationId?: string; } +/** + * @interface + * An interface representing ManagementLockProperties. + * The lock properties. + * + */ +export interface ManagementLockProperties { + /** + * @member {LockLevel} level The level of the lock. Possible values are: + * NotSpecified, CanNotDelete, ReadOnly. CanNotDelete means authorized users + * are able to read and modify the resources, but not delete. ReadOnly means + * authorized users can only read from a resource, but they can't modify or + * delete it. Possible values include: 'NotSpecified', 'CanNotDelete', + * 'ReadOnly' + */ + level: LockLevel; + /** + * @member {string} [notes] Notes about the lock. Maximum of 512 characters. + */ + notes?: string; + /** + * @member {ManagementLockOwner[]} [owners] The owners of the lock. + */ + owners?: ManagementLockOwner[]; +} + /** * @interface * An interface representing ManagementLockObject. diff --git a/packages/@azure/arm-locks/lib/models/mappers.ts b/packages/@azure/arm-locks/lib/models/mappers.ts index de34243190f2..867608a44dc7 100644 --- a/packages/@azure/arm-locks/lib/models/mappers.ts +++ b/packages/@azure/arm-locks/lib/models/mappers.ts @@ -30,6 +30,41 @@ export const ManagementLockOwner: msRest.CompositeMapper = { } }; +export const ManagementLockProperties: msRest.CompositeMapper = { + serializedName: "ManagementLockProperties", + type: { + name: "Composite", + className: "ManagementLockProperties", + modelProperties: { + level: { + required: true, + serializedName: "level", + type: { + name: "String" + } + }, + notes: { + serializedName: "notes", + type: { + name: "String" + } + }, + owners: { + serializedName: "owners", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ManagementLockOwner" + } + } + } + } + } + } +}; + export const ManagementLockObject: msRest.CompositeMapper = { serializedName: "ManagementLockObject", type: { diff --git a/packages/@azure/arm-locks/package.json b/packages/@azure/arm-locks/package.json index 7997ac59263a..d4db3fc57faa 100644 --- a/packages/@azure/arm-locks/package.json +++ b/packages/@azure/arm-locks/package.json @@ -4,8 +4,8 @@ "description": "ManagementLockClient Library with typescript type definitions for node.js and browser.", "version": "1.0.0", "dependencies": { - "ms-rest-azure-js": "^1.0.166", - "ms-rest-js": "^1.0.439", + "ms-rest-azure-js": "^1.0.172", + "ms-rest-js": "^1.0.443", "tslib": "^1.9.3" }, "keywords": [ @@ -25,7 +25,7 @@ "rollup-plugin-node-resolve": "^3.4.0", "uglify-js": "^3.4.9" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/packages/@azure/arm-locks", + "homepage": "https://github.com/azure/azure-sdk-for-js", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-js.git" diff --git a/packages/@azure/arm-managedapplications/lib/models/index.ts b/packages/@azure/arm-managedapplications/lib/models/index.ts index 63986cba835f..dbe6127502e5 100644 --- a/packages/@azure/arm-managedapplications/lib/models/index.ts +++ b/packages/@azure/arm-managedapplications/lib/models/index.ts @@ -14,6 +14,50 @@ import * as msRest from "ms-rest-js"; export { BaseResource, CloudError }; +/** + * @interface + * An interface representing ApplianceProperties. + * The appliance properties. + * + */ +export interface ApplianceProperties { + /** + * @member {string} managedResourceGroupId The managed resource group Id. + */ + managedResourceGroupId: string; + /** + * @member {string} [applianceDefinitionId] The fully qualified path of + * appliance definition Id. + */ + applianceDefinitionId?: string; + /** + * @member {any} [parameters] Name and value pairs that define the appliance + * parameters. It can be a JObject or a well formed JSON string. + */ + parameters?: any; + /** + * @member {any} [outputs] Name and value pairs that define the appliance + * outputs. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly outputs?: any; + /** + * @member {ProvisioningState} [provisioningState] The appliance provisioning + * state. Possible values include: 'Accepted', 'Running', 'Ready', + * 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', + * 'Succeeded', 'Updating' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provisioningState?: ProvisioningState; + /** + * @member {string} [uiDefinitionUri] The blob URI where the UI definition + * file is located. + */ + uiDefinitionUri?: string; +} + /** * @interface * An interface representing Plan. @@ -156,6 +200,50 @@ export interface Appliance extends GenericResource { kind?: string; } +/** + * @interface + * An interface representing AppliancePropertiesPatchable. + * The appliance properties. + * + */ +export interface AppliancePropertiesPatchable { + /** + * @member {string} [managedResourceGroupId] The managed resource group Id. + */ + managedResourceGroupId?: string; + /** + * @member {string} [applianceDefinitionId] The fully qualified path of + * appliance definition Id. + */ + applianceDefinitionId?: string; + /** + * @member {any} [parameters] Name and value pairs that define the appliance + * parameters. It can be a JObject or a well formed JSON string. + */ + parameters?: any; + /** + * @member {any} [outputs] Name and value pairs that define the appliance + * outputs. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly outputs?: any; + /** + * @member {ProvisioningState} [provisioningState] The appliance provisioning + * state. Possible values include: 'Accepted', 'Running', 'Ready', + * 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', + * 'Succeeded', 'Updating' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provisioningState?: ProvisioningState; + /** + * @member {string} [uiDefinitionUri] The blob URI where the UI definition + * file is located. + */ + uiDefinitionUri?: string; +} + /** * @interface * An interface representing PlanPatchable. @@ -283,6 +371,44 @@ export interface ApplianceArtifact { type?: ApplianceArtifactType; } +/** + * @interface + * An interface representing ApplianceDefinitionProperties. + * The appliance definition properties. + * + */ +export interface ApplianceDefinitionProperties { + /** + * @member {ApplianceLockLevel} lockLevel The appliance lock level. Possible + * values include: 'CanNotDelete', 'ReadOnly', 'None' + */ + lockLevel: ApplianceLockLevel; + /** + * @member {string} [displayName] The appliance definition display name. + */ + displayName?: string; + /** + * @member {ApplianceProviderAuthorization[]} authorizations The appliance + * provider authorizations. + */ + authorizations: ApplianceProviderAuthorization[]; + /** + * @member {ApplianceArtifact[]} [artifacts] The collection of appliance + * artifacts. The portal will use the files specified as artifacts to + * construct the user experience of creating an appliance from an appliance + * definition. + */ + artifacts?: ApplianceArtifact[]; + /** + * @member {string} [description] The appliance definition description. + */ + description?: string; + /** + * @member {string} packageFileUri The appliance definition package file Uri. + */ + packageFileUri: string; +} + /** * @interface * An interface representing ApplianceDefinition. diff --git a/packages/@azure/arm-managedapplications/lib/models/mappers.ts b/packages/@azure/arm-managedapplications/lib/models/mappers.ts index 4ff607848751..f194537a7c38 100644 --- a/packages/@azure/arm-managedapplications/lib/models/mappers.ts +++ b/packages/@azure/arm-managedapplications/lib/models/mappers.ts @@ -14,6 +14,55 @@ import * as msRest from "ms-rest-js"; export const CloudError = CloudErrorMapper; export const BaseResource = BaseResourceMapper; +export const ApplianceProperties: msRest.CompositeMapper = { + serializedName: "ApplianceProperties", + type: { + name: "Composite", + className: "ApplianceProperties", + modelProperties: { + managedResourceGroupId: { + required: true, + serializedName: "managedResourceGroupId", + type: { + name: "String" + } + }, + applianceDefinitionId: { + serializedName: "applianceDefinitionId", + type: { + name: "String" + } + }, + parameters: { + serializedName: "parameters", + type: { + name: "Object" + } + }, + outputs: { + readOnly: true, + serializedName: "outputs", + type: { + name: "Object" + } + }, + provisioningState: { + readOnly: true, + serializedName: "provisioningState", + type: { + name: "String" + } + }, + uiDefinitionUri: { + serializedName: "uiDefinitionUri", + type: { + name: "String" + } + } + } + } +}; + export const Plan: msRest.CompositeMapper = { serializedName: "Plan", type: { @@ -203,6 +252,54 @@ export const Appliance: msRest.CompositeMapper = { } }; +export const AppliancePropertiesPatchable: msRest.CompositeMapper = { + serializedName: "AppliancePropertiesPatchable", + type: { + name: "Composite", + className: "AppliancePropertiesPatchable", + modelProperties: { + managedResourceGroupId: { + serializedName: "managedResourceGroupId", + type: { + name: "String" + } + }, + applianceDefinitionId: { + serializedName: "applianceDefinitionId", + type: { + name: "String" + } + }, + parameters: { + serializedName: "parameters", + type: { + name: "Object" + } + }, + outputs: { + readOnly: true, + serializedName: "outputs", + type: { + name: "Object" + } + }, + provisioningState: { + readOnly: true, + serializedName: "provisioningState", + type: { + name: "String" + } + }, + uiDefinitionUri: { + serializedName: "uiDefinitionUri", + type: { + name: "String" + } + } + } + } +}; + export const PlanPatchable: msRest.CompositeMapper = { serializedName: "PlanPatchable", type: { @@ -364,6 +461,72 @@ export const ApplianceArtifact: msRest.CompositeMapper = { } }; +export const ApplianceDefinitionProperties: msRest.CompositeMapper = { + serializedName: "ApplianceDefinitionProperties", + type: { + name: "Composite", + className: "ApplianceDefinitionProperties", + modelProperties: { + lockLevel: { + required: true, + serializedName: "lockLevel", + type: { + name: "Enum", + allowedValues: [ + "CanNotDelete", + "ReadOnly", + "None" + ] + } + }, + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + }, + authorizations: { + required: true, + serializedName: "authorizations", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ApplianceProviderAuthorization" + } + } + } + }, + artifacts: { + serializedName: "artifacts", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ApplianceArtifact" + } + } + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + }, + packageFileUri: { + required: true, + serializedName: "packageFileUri", + type: { + name: "String" + } + } + } + } +}; + export const ApplianceDefinition: msRest.CompositeMapper = { serializedName: "ApplianceDefinition", type: { diff --git a/packages/@azure/arm-managedapplications/package.json b/packages/@azure/arm-managedapplications/package.json index 6363d9a90478..ee14f6c7101d 100644 --- a/packages/@azure/arm-managedapplications/package.json +++ b/packages/@azure/arm-managedapplications/package.json @@ -4,8 +4,8 @@ "description": "ManagedApplicationClient Library with typescript type definitions for node.js and browser.", "version": "1.0.0-preview", "dependencies": { - "ms-rest-azure-js": "^1.0.166", - "ms-rest-js": "^1.0.439", + "ms-rest-azure-js": "^1.0.172", + "ms-rest-js": "^1.0.443", "tslib": "^1.9.3" }, "keywords": [ @@ -25,7 +25,7 @@ "rollup-plugin-node-resolve": "^3.4.0", "uglify-js": "^3.4.9" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/packages/@azure/arm-managedapplications", + "homepage": "https://github.com/azure/azure-sdk-for-js", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-js.git" diff --git a/packages/@azure/arm-policy/lib/models/index.ts b/packages/@azure/arm-policy/lib/models/index.ts index 4c2226f092b8..22761eba9bf4 100644 --- a/packages/@azure/arm-policy/lib/models/index.ts +++ b/packages/@azure/arm-policy/lib/models/index.ts @@ -14,6 +14,45 @@ import * as msRest from "ms-rest-js"; export { BaseResource, CloudError }; +/** + * @interface + * An interface representing PolicyAssignmentProperties. + * The policy assignment properties. + * + */ +export interface PolicyAssignmentProperties { + /** + * @member {string} [displayName] The display name of the policy assignment. + */ + displayName?: string; + /** + * @member {string} [policyDefinitionId] The ID of the policy definition or + * policy set definition being assigned. + */ + policyDefinitionId?: string; + /** + * @member {string} [scope] The scope for the policy assignment. + */ + scope?: string; + /** + * @member {string[]} [notScopes] The policy's excluded scopes. + */ + notScopes?: string[]; + /** + * @member {any} [parameters] Required if a parameter is used in policy rule. + */ + parameters?: any; + /** + * @member {string} [description] This message will be part of response in + * case of policy violation. + */ + description?: string; + /** + * @member {any} [metadata] The policy assignment metadata. + */ + metadata?: any; +} + /** * @interface * An interface representing PolicySku. @@ -155,6 +194,47 @@ export interface ErrorResponse { errorMessage?: string; } +/** + * @interface + * An interface representing PolicyDefinitionProperties. + * The policy definition properties. + * + */ +export interface PolicyDefinitionProperties { + /** + * @member {PolicyType} [policyType] The type of policy definition. Possible + * values are NotSpecified, BuiltIn, and Custom. Possible values include: + * 'NotSpecified', 'BuiltIn', 'Custom' + */ + policyType?: PolicyType; + /** + * @member {PolicyMode} [mode] The policy definition mode. Possible values + * are NotSpecified, Indexed, and All. Possible values include: + * 'NotSpecified', 'Indexed', 'All' + */ + mode?: PolicyMode; + /** + * @member {string} [displayName] The display name of the policy definition. + */ + displayName?: string; + /** + * @member {string} [description] The policy definition description. + */ + description?: string; + /** + * @member {any} [policyRule] The policy rule. + */ + policyRule?: any; + /** + * @member {any} [metadata] The policy definition metadata. + */ + metadata?: any; + /** + * @member {any} [parameters] Required if a parameter is used in policy rule. + */ + parameters?: any; +} + /** * @interface * An interface representing PolicyDefinition. @@ -234,6 +314,44 @@ export interface PolicyDefinitionReference { parameters?: any; } +/** + * @interface + * An interface representing PolicySetDefinitionProperties. + * The policy set definition properties. + * + */ +export interface PolicySetDefinitionProperties { + /** + * @member {PolicyType} [policyType] The type of policy definition. Possible + * values are NotSpecified, BuiltIn, and Custom. Possible values include: + * 'NotSpecified', 'BuiltIn', 'Custom' + */ + policyType?: PolicyType; + /** + * @member {string} [displayName] The display name of the policy set + * definition. + */ + displayName?: string; + /** + * @member {string} [description] The policy set definition description. + */ + description?: string; + /** + * @member {any} [metadata] The policy set definition metadata. + */ + metadata?: any; + /** + * @member {any} [parameters] The policy set definition parameters that can + * be used in policy definition references. + */ + parameters?: any; + /** + * @member {PolicyDefinitionReference[]} policyDefinitions An array of policy + * definition references. + */ + policyDefinitions: PolicyDefinitionReference[]; +} + /** * @interface * An interface representing PolicySetDefinition. diff --git a/packages/@azure/arm-policy/lib/models/mappers.ts b/packages/@azure/arm-policy/lib/models/mappers.ts index 74678668c433..593bbff1f4d6 100644 --- a/packages/@azure/arm-policy/lib/models/mappers.ts +++ b/packages/@azure/arm-policy/lib/models/mappers.ts @@ -14,6 +14,63 @@ import * as msRest from "ms-rest-js"; export const CloudError = CloudErrorMapper; export const BaseResource = BaseResourceMapper; +export const PolicyAssignmentProperties: msRest.CompositeMapper = { + serializedName: "PolicyAssignmentProperties", + type: { + name: "Composite", + className: "PolicyAssignmentProperties", + modelProperties: { + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + }, + policyDefinitionId: { + serializedName: "policyDefinitionId", + type: { + name: "String" + } + }, + scope: { + serializedName: "scope", + type: { + name: "String" + } + }, + notScopes: { + serializedName: "notScopes", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + parameters: { + serializedName: "parameters", + type: { + name: "Object" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + }, + metadata: { + serializedName: "metadata", + type: { + name: "Object" + } + } + } + } +}; + export const PolicySku: msRest.CompositeMapper = { serializedName: "PolicySku", type: { @@ -197,6 +254,58 @@ export const ErrorResponse: msRest.CompositeMapper = { } }; +export const PolicyDefinitionProperties: msRest.CompositeMapper = { + serializedName: "PolicyDefinitionProperties", + type: { + name: "Composite", + className: "PolicyDefinitionProperties", + modelProperties: { + policyType: { + serializedName: "policyType", + type: { + name: "String" + } + }, + mode: { + serializedName: "mode", + type: { + name: "String" + } + }, + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + }, + policyRule: { + serializedName: "policyRule", + type: { + name: "Object" + } + }, + metadata: { + serializedName: "metadata", + type: { + name: "Object" + } + }, + parameters: { + serializedName: "parameters", + type: { + name: "Object" + } + } + } + } +}; + export const PolicyDefinition: msRest.CompositeMapper = { serializedName: "PolicyDefinition", type: { @@ -292,6 +401,59 @@ export const PolicyDefinitionReference: msRest.CompositeMapper = { } }; +export const PolicySetDefinitionProperties: msRest.CompositeMapper = { + serializedName: "PolicySetDefinitionProperties", + type: { + name: "Composite", + className: "PolicySetDefinitionProperties", + modelProperties: { + policyType: { + serializedName: "policyType", + type: { + name: "String" + } + }, + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + }, + metadata: { + serializedName: "metadata", + type: { + name: "Object" + } + }, + parameters: { + serializedName: "parameters", + type: { + name: "Object" + } + }, + policyDefinitions: { + required: true, + serializedName: "policyDefinitions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicyDefinitionReference" + } + } + } + } + } + } +}; + export const PolicySetDefinition: msRest.CompositeMapper = { serializedName: "PolicySetDefinition", type: { diff --git a/packages/@azure/arm-policy/package.json b/packages/@azure/arm-policy/package.json index 0845ce7ad89b..2b7ada2898c9 100644 --- a/packages/@azure/arm-policy/package.json +++ b/packages/@azure/arm-policy/package.json @@ -4,8 +4,8 @@ "description": "PolicyClient Library with typescript type definitions for node.js and browser.", "version": "1.0.0", "dependencies": { - "ms-rest-azure-js": "^1.0.166", - "ms-rest-js": "^1.0.439", + "ms-rest-azure-js": "^1.0.172", + "ms-rest-js": "^1.0.443", "tslib": "^1.9.3" }, "keywords": [ @@ -25,7 +25,7 @@ "rollup-plugin-node-resolve": "^3.4.0", "uglify-js": "^3.4.9" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/packages/@azure/arm-policy", + "homepage": "https://github.com/azure/azure-sdk-for-js", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-js.git" diff --git a/packages/@azure/arm-resources/package.json b/packages/@azure/arm-resources/package.json index 987f1a7338a9..8e4adbeb6581 100644 --- a/packages/@azure/arm-resources/package.json +++ b/packages/@azure/arm-resources/package.json @@ -4,8 +4,8 @@ "description": "ResourceManagementClient Library with typescript type definitions for node.js and browser.", "version": "1.0.0", "dependencies": { - "ms-rest-azure-js": "^1.0.166", - "ms-rest-js": "^1.0.439", + "ms-rest-azure-js": "^1.0.172", + "ms-rest-js": "^1.0.443", "tslib": "^1.9.3" }, "keywords": [ @@ -25,7 +25,7 @@ "rollup-plugin-node-resolve": "^3.4.0", "uglify-js": "^3.4.9" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/packages/@azure/arm-resources", + "homepage": "https://github.com/azure/azure-sdk-for-js", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-js.git" From 44a763176f54cf9ea34e1e97decea382c7e0cc11 Mon Sep 17 00:00:00 2001 From: Kamil Pajdzik Date: Fri, 19 Oct 2018 14:37:31 -0700 Subject: [PATCH 3/3] Regenerated "@azure" SDK.