From 4a01c99274381c71dab320fddff32a6cb4803ec5 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 30 Apr 2019 20:25:48 -0700 Subject: [PATCH] Generated from a64ca9d77fbcafb89507e2c1284cfd0050a0f1ae (#2620) Add filter --- sdk/features/arm-features/LICENSE.txt | 2 +- sdk/features/arm-features/README.md | 3 - .../arm-features/lib/featureClient.ts | 136 + .../arm-features/lib/featureClientContext.ts | 62 + .../lib/models/featuresMappers.ts | 17 + sdk/features/arm-features/lib/models/index.ts | 291 ++ .../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 + sdk/features/arm-features/package.json | 8 +- sdk/features/arm-features/tsconfig.json | 2 +- sdk/links/arm-links/LICENSE.txt | 2 +- sdk/links/arm-links/README.md | 3 - .../arm-links/lib/managementLinkClient.ts | 44 + .../lib/managementLinkClientContext.ts | 62 + sdk/links/arm-links/lib/models/index.ts | 368 +++ sdk/links/arm-links/lib/models/mappers.ts | 215 ++ .../arm-links/lib/models/operationsMappers.ts | 17 + sdk/links/arm-links/lib/models/parameters.ts | 87 + .../lib/models/resourceLinksMappers.ts | 18 + sdk/links/arm-links/lib/operations/index.ts | 12 + .../arm-links/lib/operations/operations.ts | 123 + .../arm-links/lib/operations/resourceLinks.ts | 421 +++ sdk/links/arm-links/package.json | 8 +- sdk/links/arm-links/tsconfig.json | 2 +- sdk/locks/arm-locks/LICENSE.txt | 2 +- sdk/locks/arm-locks/README.md | 3 - .../arm-locks/lib/managementLockClient.ts | 44 + .../lib/managementLockClientContext.ts | 62 + .../models/authorizationOperationsMappers.ts | 17 + sdk/locks/arm-locks/lib/models/index.ts | 564 ++++ .../lib/models/managementLocksMappers.ts | 18 + sdk/locks/arm-locks/lib/models/mappers.ts | 194 ++ sdk/locks/arm-locks/lib/models/parameters.ts | 142 + .../lib/operations/authorizationOperations.ts | 123 + sdk/locks/arm-locks/lib/operations/index.ts | 12 + .../lib/operations/managementLocks.ts | 1294 ++++++++ sdk/locks/arm-locks/package.json | 8 +- sdk/locks/arm-locks/tsconfig.json | 2 +- .../arm-managedapplications/LICENSE.txt | 2 +- .../arm-managedapplications/README.md | 3 - .../lib/managedApplicationClient.ts | 138 + .../lib/managedApplicationClientContext.ts | 62 + .../lib/models/applianceDefinitionsMappers.ts | 27 + .../lib/models/appliancesMappers.ts | 27 + .../lib/models/index.ts | 985 +++++++ .../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 | 8 +- .../arm-managedapplications/tsconfig.json | 2 +- sdk/policy/arm-policy/LICENSE.txt | 2 +- sdk/policy/arm-policy/README.md | 3 - sdk/policy/arm-policy/lib/models/index.ts | 1069 +++++++ sdk/policy/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 + sdk/policy/arm-policy/lib/operations/index.ts | 13 + .../lib/operations/policyAssignments.ts | 865 ++++++ .../lib/operations/policyDefinitions.ts | 730 +++++ .../lib/operations/policySetDefinitions.ts | 740 +++++ sdk/policy/arm-policy/lib/policyClient.ts | 46 + .../arm-policy/lib/policyClientContext.ts | 62 + sdk/policy/arm-policy/package.json | 8 +- sdk/policy/arm-policy/tsconfig.json | 2 +- sdk/resources/arm-resources/LICENSE.txt | 2 +- sdk/resources/arm-resources/README.md | 3 - .../lib/models/deploymentOperationsMappers.ts | 19 + .../lib/models/deploymentsMappers.ts | 45 + .../arm-resources/lib/models/index.ts | 2623 +++++++++++++++++ .../arm-resources/lib/models/mappers.ts | 1774 +++++++++++ .../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 | 487 +++ .../arm-resources/lib/operations/resources.ts | 1092 +++++++ .../arm-resources/lib/operations/tags.ts | 352 +++ .../lib/resourceManagementClient.ts | 54 + .../lib/resourceManagementClientContext.ts | 62 + sdk/resources/arm-resources/package.json | 8 +- sdk/resources/arm-resources/tsconfig.json | 2 +- 94 files changed, 21223 insertions(+), 60 deletions(-) create mode 100644 sdk/features/arm-features/lib/featureClient.ts create mode 100644 sdk/features/arm-features/lib/featureClientContext.ts create mode 100644 sdk/features/arm-features/lib/models/featuresMappers.ts create mode 100644 sdk/features/arm-features/lib/models/index.ts create mode 100644 sdk/features/arm-features/lib/models/mappers.ts create mode 100644 sdk/features/arm-features/lib/models/parameters.ts create mode 100644 sdk/features/arm-features/lib/operations/features.ts create mode 100644 sdk/features/arm-features/lib/operations/index.ts create mode 100644 sdk/links/arm-links/lib/managementLinkClient.ts create mode 100644 sdk/links/arm-links/lib/managementLinkClientContext.ts create mode 100644 sdk/links/arm-links/lib/models/index.ts create mode 100644 sdk/links/arm-links/lib/models/mappers.ts create mode 100644 sdk/links/arm-links/lib/models/operationsMappers.ts create mode 100644 sdk/links/arm-links/lib/models/parameters.ts create mode 100644 sdk/links/arm-links/lib/models/resourceLinksMappers.ts create mode 100644 sdk/links/arm-links/lib/operations/index.ts create mode 100644 sdk/links/arm-links/lib/operations/operations.ts create mode 100644 sdk/links/arm-links/lib/operations/resourceLinks.ts create mode 100644 sdk/locks/arm-locks/lib/managementLockClient.ts create mode 100644 sdk/locks/arm-locks/lib/managementLockClientContext.ts create mode 100644 sdk/locks/arm-locks/lib/models/authorizationOperationsMappers.ts create mode 100644 sdk/locks/arm-locks/lib/models/index.ts create mode 100644 sdk/locks/arm-locks/lib/models/managementLocksMappers.ts create mode 100644 sdk/locks/arm-locks/lib/models/mappers.ts create mode 100644 sdk/locks/arm-locks/lib/models/parameters.ts create mode 100644 sdk/locks/arm-locks/lib/operations/authorizationOperations.ts create mode 100644 sdk/locks/arm-locks/lib/operations/index.ts create mode 100644 sdk/locks/arm-locks/lib/operations/managementLocks.ts create mode 100644 sdk/managedapplications/arm-managedapplications/lib/managedApplicationClient.ts create mode 100644 sdk/managedapplications/arm-managedapplications/lib/managedApplicationClientContext.ts create mode 100644 sdk/managedapplications/arm-managedapplications/lib/models/applianceDefinitionsMappers.ts create mode 100644 sdk/managedapplications/arm-managedapplications/lib/models/appliancesMappers.ts create mode 100644 sdk/managedapplications/arm-managedapplications/lib/models/index.ts create mode 100644 sdk/managedapplications/arm-managedapplications/lib/models/mappers.ts create mode 100644 sdk/managedapplications/arm-managedapplications/lib/models/parameters.ts create mode 100644 sdk/managedapplications/arm-managedapplications/lib/operations/applianceDefinitions.ts create mode 100644 sdk/managedapplications/arm-managedapplications/lib/operations/appliances.ts create mode 100644 sdk/managedapplications/arm-managedapplications/lib/operations/index.ts create mode 100644 sdk/policy/arm-policy/lib/models/index.ts create mode 100644 sdk/policy/arm-policy/lib/models/mappers.ts create mode 100644 sdk/policy/arm-policy/lib/models/parameters.ts create mode 100644 sdk/policy/arm-policy/lib/models/policyAssignmentsMappers.ts create mode 100644 sdk/policy/arm-policy/lib/models/policyDefinitionsMappers.ts create mode 100644 sdk/policy/arm-policy/lib/models/policySetDefinitionsMappers.ts create mode 100644 sdk/policy/arm-policy/lib/operations/index.ts create mode 100644 sdk/policy/arm-policy/lib/operations/policyAssignments.ts create mode 100644 sdk/policy/arm-policy/lib/operations/policyDefinitions.ts create mode 100644 sdk/policy/arm-policy/lib/operations/policySetDefinitions.ts create mode 100644 sdk/policy/arm-policy/lib/policyClient.ts create mode 100644 sdk/policy/arm-policy/lib/policyClientContext.ts create mode 100644 sdk/resources/arm-resources/lib/models/deploymentOperationsMappers.ts create mode 100644 sdk/resources/arm-resources/lib/models/deploymentsMappers.ts create mode 100644 sdk/resources/arm-resources/lib/models/index.ts create mode 100644 sdk/resources/arm-resources/lib/models/mappers.ts create mode 100644 sdk/resources/arm-resources/lib/models/operationsMappers.ts create mode 100644 sdk/resources/arm-resources/lib/models/parameters.ts create mode 100644 sdk/resources/arm-resources/lib/models/providersMappers.ts create mode 100644 sdk/resources/arm-resources/lib/models/resourceGroupsMappers.ts create mode 100644 sdk/resources/arm-resources/lib/models/resourcesMappers.ts create mode 100644 sdk/resources/arm-resources/lib/models/tagsMappers.ts create mode 100644 sdk/resources/arm-resources/lib/operations/deploymentOperations.ts create mode 100644 sdk/resources/arm-resources/lib/operations/deployments.ts create mode 100644 sdk/resources/arm-resources/lib/operations/index.ts create mode 100644 sdk/resources/arm-resources/lib/operations/operations.ts create mode 100644 sdk/resources/arm-resources/lib/operations/providers.ts create mode 100644 sdk/resources/arm-resources/lib/operations/resourceGroups.ts create mode 100644 sdk/resources/arm-resources/lib/operations/resources.ts create mode 100644 sdk/resources/arm-resources/lib/operations/tags.ts create mode 100644 sdk/resources/arm-resources/lib/resourceManagementClient.ts create mode 100644 sdk/resources/arm-resources/lib/resourceManagementClientContext.ts diff --git a/sdk/features/arm-features/LICENSE.txt b/sdk/features/arm-features/LICENSE.txt index a70e8cf66038..b73b4a1293c3 100644 --- a/sdk/features/arm-features/LICENSE.txt +++ b/sdk/features/arm-features/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Microsoft +Copyright (c) 2019 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/features/arm-features/README.md b/sdk/features/arm-features/README.md index 09771d8792b5..1fe7592c8455 100644 --- a/sdk/features/arm-features/README.md +++ b/sdk/features/arm-features/README.md @@ -94,6 +94,3 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to ## Related projects - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) - - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/features/arm-features/README.png) diff --git a/sdk/features/arm-features/lib/featureClient.ts b/sdk/features/arm-features/lib/featureClient.ts new file mode 100644 index 000000000000..0274b01bb026 --- /dev/null +++ b/sdk/features/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 "@azure/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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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/sdk/features/arm-features/lib/featureClientContext.ts b/sdk/features/arm-features/lib/featureClientContext.ts new file mode 100644 index 000000000000..184e29d963ca --- /dev/null +++ b/sdk/features/arm-features/lib/featureClientContext.ts @@ -0,0 +1,62 @@ +/* + * 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 "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; + +const packageName = "@azure/arm-features"; +const packageVersion = "1.0.2"; + +export class FeatureClientContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials; + subscriptionId: string; + apiVersion?: string; + + /** + * 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 = {}; + } + if(!options.userAgent) { + const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); + options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; + } + + 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; + + 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/sdk/features/arm-features/lib/models/featuresMappers.ts b/sdk/features/arm-features/lib/models/featuresMappers.ts new file mode 100644 index 000000000000..f76e186d07a8 --- /dev/null +++ b/sdk/features/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/sdk/features/arm-features/lib/models/index.ts b/sdk/features/arm-features/lib/models/index.ts new file mode 100644 index 000000000000..04d449028a0f --- /dev/null +++ b/sdk/features/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 "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/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/sdk/features/arm-features/lib/models/mappers.ts b/sdk/features/arm-features/lib/models/mappers.ts new file mode 100644 index 000000000000..35dbbfa8e87d --- /dev/null +++ b/sdk/features/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 "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/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/sdk/features/arm-features/lib/models/parameters.ts b/sdk/features/arm-features/lib/models/parameters.ts new file mode 100644 index 000000000000..439bb9ed6b84 --- /dev/null +++ b/sdk/features/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 "@azure/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/sdk/features/arm-features/lib/operations/features.ts b/sdk/features/arm-features/lib/operations/features.ts new file mode 100644 index 000000000000..33c754666843 --- /dev/null +++ b/sdk/features/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 "@azure/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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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/sdk/features/arm-features/lib/operations/index.ts b/sdk/features/arm-features/lib/operations/index.ts new file mode 100644 index 000000000000..e7a795418c8a --- /dev/null +++ b/sdk/features/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/sdk/features/arm-features/package.json b/sdk/features/arm-features/package.json index bfef921551a3..453f7df2d233 100644 --- a/sdk/features/arm-features/package.json +++ b/sdk/features/arm-features/package.json @@ -26,7 +26,7 @@ "rollup-plugin-sourcemaps": "^0.4.2", "uglify-js": "^3.4.9" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/sdk/features/arm-features", + "homepage": "https://github.com/azure/azure-sdk-for-js", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-js.git" @@ -43,8 +43,7 @@ "esm/**/*.js.map", "esm/**/*.d.ts", "esm/**/*.d.ts.map", - "src/**/*.ts", - "README.md", + "lib/**/*.ts", "rollup.config.js", "tsconfig.json" ], @@ -53,6 +52,5 @@ "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-features.js.map'\" -o ./dist/arm-features.min.js ./dist/arm-features.js", "prepack": "npm install && npm run build" }, - "sideEffects": false, - "authPublish": true + "sideEffects": false } diff --git a/sdk/features/arm-features/tsconfig.json b/sdk/features/arm-features/tsconfig.json index 87bbf5b5fa49..51ea90961ce5 100644 --- a/sdk/features/arm-features/tsconfig.json +++ b/sdk/features/arm-features/tsconfig.json @@ -14,6 +14,6 @@ "outDir": "./esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], + "include": ["./lib/**/*.ts"], "exclude": ["node_modules"] } diff --git a/sdk/links/arm-links/LICENSE.txt b/sdk/links/arm-links/LICENSE.txt index a70e8cf66038..b73b4a1293c3 100644 --- a/sdk/links/arm-links/LICENSE.txt +++ b/sdk/links/arm-links/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Microsoft +Copyright (c) 2019 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/links/arm-links/README.md b/sdk/links/arm-links/README.md index 24f09f9ef99e..682c0831ae0a 100644 --- a/sdk/links/arm-links/README.md +++ b/sdk/links/arm-links/README.md @@ -94,6 +94,3 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to ## Related projects - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) - - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/links/arm-links/README.png) diff --git a/sdk/links/arm-links/lib/managementLinkClient.ts b/sdk/links/arm-links/lib/managementLinkClient.ts new file mode 100644 index 000000000000..e501aa9f38a6 --- /dev/null +++ b/sdk/links/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 "@azure/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/sdk/links/arm-links/lib/managementLinkClientContext.ts b/sdk/links/arm-links/lib/managementLinkClientContext.ts new file mode 100644 index 000000000000..50305821f862 --- /dev/null +++ b/sdk/links/arm-links/lib/managementLinkClientContext.ts @@ -0,0 +1,62 @@ +/* + * 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 "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; + +const packageName = "@azure/arm-links"; +const packageVersion = "1.0.1"; + +export class ManagementLinkClientContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials; + subscriptionId: string; + apiVersion?: string; + + /** + * 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 = {}; + } + if(!options.userAgent) { + const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); + options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; + } + + 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; + + 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/sdk/links/arm-links/lib/models/index.ts b/sdk/links/arm-links/lib/models/index.ts new file mode 100644 index 000000000000..33b29d83ae8a --- /dev/null +++ b/sdk/links/arm-links/lib/models/index.ts @@ -0,0 +1,368 @@ +/* + * 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 "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/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 type Filter = '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/sdk/links/arm-links/lib/models/mappers.ts b/sdk/links/arm-links/lib/models/mappers.ts new file mode 100644 index 000000000000..9a0f575dbc9c --- /dev/null +++ b/sdk/links/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 "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/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/sdk/links/arm-links/lib/models/operationsMappers.ts b/sdk/links/arm-links/lib/models/operationsMappers.ts new file mode 100644 index 000000000000..2edcc577920e --- /dev/null +++ b/sdk/links/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/sdk/links/arm-links/lib/models/parameters.ts b/sdk/links/arm-links/lib/models/parameters.ts new file mode 100644 index 000000000000..22fba7f0c925 --- /dev/null +++ b/sdk/links/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 "@azure/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/sdk/links/arm-links/lib/models/resourceLinksMappers.ts b/sdk/links/arm-links/lib/models/resourceLinksMappers.ts new file mode 100644 index 000000000000..aac3c16eb59c --- /dev/null +++ b/sdk/links/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/sdk/links/arm-links/lib/operations/index.ts b/sdk/links/arm-links/lib/operations/index.ts new file mode 100644 index 000000000000..13eac92de120 --- /dev/null +++ b/sdk/links/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/sdk/links/arm-links/lib/operations/operations.ts b/sdk/links/arm-links/lib/operations/operations.ts new file mode 100644 index 000000000000..7085709950df --- /dev/null +++ b/sdk/links/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 "@azure/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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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/sdk/links/arm-links/lib/operations/resourceLinks.ts b/sdk/links/arm-links/lib/operations/resourceLinks.ts new file mode 100644 index 000000000000..3cb445cba348 --- /dev/null +++ b/sdk/links/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 "@azure/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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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/sdk/links/arm-links/package.json b/sdk/links/arm-links/package.json index 5ba0129a0ff8..d0dcfb86f002 100644 --- a/sdk/links/arm-links/package.json +++ b/sdk/links/arm-links/package.json @@ -26,7 +26,7 @@ "rollup-plugin-sourcemaps": "^0.4.2", "uglify-js": "^3.4.9" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/sdk/links/arm-links", + "homepage": "https://github.com/azure/azure-sdk-for-js", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-js.git" @@ -43,8 +43,7 @@ "esm/**/*.js.map", "esm/**/*.d.ts", "esm/**/*.d.ts.map", - "src/**/*.ts", - "README.md", + "lib/**/*.ts", "rollup.config.js", "tsconfig.json" ], @@ -53,6 +52,5 @@ "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-links.js.map'\" -o ./dist/arm-links.min.js ./dist/arm-links.js", "prepack": "npm install && npm run build" }, - "sideEffects": false, - "authPublish": true + "sideEffects": false } diff --git a/sdk/links/arm-links/tsconfig.json b/sdk/links/arm-links/tsconfig.json index 87bbf5b5fa49..51ea90961ce5 100644 --- a/sdk/links/arm-links/tsconfig.json +++ b/sdk/links/arm-links/tsconfig.json @@ -14,6 +14,6 @@ "outDir": "./esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], + "include": ["./lib/**/*.ts"], "exclude": ["node_modules"] } diff --git a/sdk/locks/arm-locks/LICENSE.txt b/sdk/locks/arm-locks/LICENSE.txt index a70e8cf66038..b73b4a1293c3 100644 --- a/sdk/locks/arm-locks/LICENSE.txt +++ b/sdk/locks/arm-locks/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Microsoft +Copyright (c) 2019 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/locks/arm-locks/README.md b/sdk/locks/arm-locks/README.md index 82ce52dc51a9..9b89dc369484 100644 --- a/sdk/locks/arm-locks/README.md +++ b/sdk/locks/arm-locks/README.md @@ -94,6 +94,3 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to ## Related projects - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) - - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/locks/arm-locks/README.png) diff --git a/sdk/locks/arm-locks/lib/managementLockClient.ts b/sdk/locks/arm-locks/lib/managementLockClient.ts new file mode 100644 index 000000000000..8f3ee196f5d8 --- /dev/null +++ b/sdk/locks/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 "@azure/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/sdk/locks/arm-locks/lib/managementLockClientContext.ts b/sdk/locks/arm-locks/lib/managementLockClientContext.ts new file mode 100644 index 000000000000..ac75a31bf9d7 --- /dev/null +++ b/sdk/locks/arm-locks/lib/managementLockClientContext.ts @@ -0,0 +1,62 @@ +/* + * 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 "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; + +const packageName = "@azure/arm-locks"; +const packageVersion = "1.0.1"; + +export class ManagementLockClientContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials; + subscriptionId: string; + apiVersion?: string; + + /** + * 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 = {}; + } + if(!options.userAgent) { + const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); + options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; + } + + 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; + + 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/sdk/locks/arm-locks/lib/models/authorizationOperationsMappers.ts b/sdk/locks/arm-locks/lib/models/authorizationOperationsMappers.ts new file mode 100644 index 000000000000..2edcc577920e --- /dev/null +++ b/sdk/locks/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/sdk/locks/arm-locks/lib/models/index.ts b/sdk/locks/arm-locks/lib/models/index.ts new file mode 100644 index 000000000000..d087b533455d --- /dev/null +++ b/sdk/locks/arm-locks/lib/models/index.ts @@ -0,0 +1,564 @@ +/* + * 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 "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/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 ManagementLocksListByScopeOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface ManagementLocksListByScopeOptionalParams 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' + * @readonly + * @enum {string} + */ +export type LockLevel = 'NotSpecified' | 'CanNotDelete' | '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 listByScope operation. + */ +export type ManagementLocksListByScopeResponse = 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; + }; +}; + +/** + * Contains response data for the listByScopeNext operation. + */ +export type ManagementLocksListByScopeNextResponse = 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/sdk/locks/arm-locks/lib/models/managementLocksMappers.ts b/sdk/locks/arm-locks/lib/models/managementLocksMappers.ts new file mode 100644 index 000000000000..0eca319827a3 --- /dev/null +++ b/sdk/locks/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/sdk/locks/arm-locks/lib/models/mappers.ts b/sdk/locks/arm-locks/lib/models/mappers.ts new file mode 100644 index 000000000000..3ddcaac9c22a --- /dev/null +++ b/sdk/locks/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 "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/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/sdk/locks/arm-locks/lib/models/parameters.ts b/sdk/locks/arm-locks/lib/models/parameters.ts new file mode 100644 index 000000000000..fe8e8e08a3b1 --- /dev/null +++ b/sdk/locks/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 "@azure/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/sdk/locks/arm-locks/lib/operations/authorizationOperations.ts b/sdk/locks/arm-locks/lib/operations/authorizationOperations.ts new file mode 100644 index 000000000000..29d0a0621e3b --- /dev/null +++ b/sdk/locks/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 "@azure/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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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/sdk/locks/arm-locks/lib/operations/index.ts b/sdk/locks/arm-locks/lib/operations/index.ts new file mode 100644 index 000000000000..83933898775f --- /dev/null +++ b/sdk/locks/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/sdk/locks/arm-locks/lib/operations/managementLocks.ts b/sdk/locks/arm-locks/lib/operations/managementLocks.ts new file mode 100644 index 000000000000..d6f3a7b68d01 --- /dev/null +++ b/sdk/locks/arm-locks/lib/operations/managementLocks.ts @@ -0,0 +1,1294 @@ +/* + * 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 "@azure/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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listAtSubscriptionLevelOperationSpec, + callback) as Promise; + } + + /** + * Gets all the management locks for a 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 [options] The optional parameters + * @returns Promise + */ + listByScope(scope: string, options?: Models.ManagementLocksListByScopeOptionalParams): 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 callback The callback + */ + listByScope(scope: string, 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 options The optional parameters + * @param callback The callback + */ + listByScope(scope: string, options: Models.ManagementLocksListByScopeOptionalParams, callback: msRest.ServiceCallback): void; + listByScope(scope: string, options?: Models.ManagementLocksListByScopeOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + scope, + options + }, + listByScopeOperationSpec, + 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listAtSubscriptionLevelNextOperationSpec, + callback) as Promise; + } + + /** + * Gets all the management locks for a scope. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByScopeNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByScopeNext(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 + */ + listByScopeNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByScopeNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByScopeNextOperationSpec, + 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 listByScopeOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "{scope}/providers/Microsoft.Authorization/locks", + urlParameters: [ + Parameters.scope + ], + 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 +}; + +const listByScopeNextOperationSpec: 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/sdk/locks/arm-locks/package.json b/sdk/locks/arm-locks/package.json index 4773c1f419ee..2a8674cfadaf 100644 --- a/sdk/locks/arm-locks/package.json +++ b/sdk/locks/arm-locks/package.json @@ -26,7 +26,7 @@ "rollup-plugin-sourcemaps": "^0.4.2", "uglify-js": "^3.4.9" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/sdk/locks/arm-locks", + "homepage": "https://github.com/azure/azure-sdk-for-js", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-js.git" @@ -43,8 +43,7 @@ "esm/**/*.js.map", "esm/**/*.d.ts", "esm/**/*.d.ts.map", - "src/**/*.ts", - "README.md", + "lib/**/*.ts", "rollup.config.js", "tsconfig.json" ], @@ -53,6 +52,5 @@ "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-locks.js.map'\" -o ./dist/arm-locks.min.js ./dist/arm-locks.js", "prepack": "npm install && npm run build" }, - "sideEffects": false, - "authPublish": true + "sideEffects": false } diff --git a/sdk/locks/arm-locks/tsconfig.json b/sdk/locks/arm-locks/tsconfig.json index 87bbf5b5fa49..51ea90961ce5 100644 --- a/sdk/locks/arm-locks/tsconfig.json +++ b/sdk/locks/arm-locks/tsconfig.json @@ -14,6 +14,6 @@ "outDir": "./esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], + "include": ["./lib/**/*.ts"], "exclude": ["node_modules"] } diff --git a/sdk/managedapplications/arm-managedapplications/LICENSE.txt b/sdk/managedapplications/arm-managedapplications/LICENSE.txt index a70e8cf66038..b73b4a1293c3 100644 --- a/sdk/managedapplications/arm-managedapplications/LICENSE.txt +++ b/sdk/managedapplications/arm-managedapplications/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Microsoft +Copyright (c) 2019 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/managedapplications/arm-managedapplications/README.md b/sdk/managedapplications/arm-managedapplications/README.md index fd9f4fca6a14..51902ef95b93 100644 --- a/sdk/managedapplications/arm-managedapplications/README.md +++ b/sdk/managedapplications/arm-managedapplications/README.md @@ -94,6 +94,3 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to ## Related projects - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) - - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/managedapplications/arm-managedapplications/README.png) diff --git a/sdk/managedapplications/arm-managedapplications/lib/managedApplicationClient.ts b/sdk/managedapplications/arm-managedapplications/lib/managedApplicationClient.ts new file mode 100644 index 000000000000..2897a8be4c98 --- /dev/null +++ b/sdk/managedapplications/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 "@azure/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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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/sdk/managedapplications/arm-managedapplications/lib/managedApplicationClientContext.ts b/sdk/managedapplications/arm-managedapplications/lib/managedApplicationClientContext.ts new file mode 100644 index 000000000000..927dbdadeed3 --- /dev/null +++ b/sdk/managedapplications/arm-managedapplications/lib/managedApplicationClientContext.ts @@ -0,0 +1,62 @@ +/* + * 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 "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; + +const packageName = "@azure/arm-managedapplications"; +const packageVersion = "1.0.1"; + +export class ManagedApplicationClientContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials; + subscriptionId: string; + apiVersion?: string; + + /** + * 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 = {}; + } + if(!options.userAgent) { + const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); + options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; + } + + 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; + + 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/sdk/managedapplications/arm-managedapplications/lib/models/applianceDefinitionsMappers.ts b/sdk/managedapplications/arm-managedapplications/lib/models/applianceDefinitionsMappers.ts new file mode 100644 index 000000000000..b4ed010e811d --- /dev/null +++ b/sdk/managedapplications/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/sdk/managedapplications/arm-managedapplications/lib/models/appliancesMappers.ts b/sdk/managedapplications/arm-managedapplications/lib/models/appliancesMappers.ts new file mode 100644 index 000000000000..7d476792ff5b --- /dev/null +++ b/sdk/managedapplications/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/sdk/managedapplications/arm-managedapplications/lib/models/index.ts b/sdk/managedapplications/arm-managedapplications/lib/models/index.ts new file mode 100644 index 000000000000..7b379365d48a --- /dev/null +++ b/sdk/managedapplications/arm-managedapplications/lib/models/index.ts @@ -0,0 +1,985 @@ +/* + * 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 "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/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 response 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' + * @readonly + * @enum {string} + */ +export type ProvisioningState = 'Accepted' | 'Running' | 'Ready' | 'Creating' | 'Created' | 'Deleting' | 'Deleted' | 'Canceled' | 'Failed' | 'Succeeded' | 'Updating'; + +/** + * Defines values for ApplianceLockLevel. + * Possible values include: 'CanNotDelete', 'ReadOnly', 'None' + * @readonly + * @enum {string} + */ +export type ApplianceLockLevel = 'CanNotDelete' | 'ReadOnly' | 'None'; + +/** + * Defines values for ApplianceArtifactType. + * Possible values include: 'Template', 'Custom' + * @readonly + * @enum {string} + */ +export type ApplianceArtifactType = 'Template' | 'Custom'; + +/** + * Defines values for ResourceIdentityType. + * Possible values include: 'SystemAssigned' + * @readonly + * @enum {string} + */ +export type ResourceIdentityType = '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/sdk/managedapplications/arm-managedapplications/lib/models/mappers.ts b/sdk/managedapplications/arm-managedapplications/lib/models/mappers.ts new file mode 100644 index 000000000000..9a6f25a55512 --- /dev/null +++ b/sdk/managedapplications/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 "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/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/sdk/managedapplications/arm-managedapplications/lib/models/parameters.ts b/sdk/managedapplications/arm-managedapplications/lib/models/parameters.ts new file mode 100644 index 000000000000..571c4b265cc8 --- /dev/null +++ b/sdk/managedapplications/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 "@azure/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/sdk/managedapplications/arm-managedapplications/lib/operations/applianceDefinitions.ts b/sdk/managedapplications/arm-managedapplications/lib/operations/applianceDefinitions.ts new file mode 100644 index 000000000000..c8143c9644b7 --- /dev/null +++ b/sdk/managedapplications/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 "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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/sdk/managedapplications/arm-managedapplications/lib/operations/appliances.ts b/sdk/managedapplications/arm-managedapplications/lib/operations/appliances.ts new file mode 100644 index 000000000000..0064b4426553 --- /dev/null +++ b/sdk/managedapplications/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 "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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/sdk/managedapplications/arm-managedapplications/lib/operations/index.ts b/sdk/managedapplications/arm-managedapplications/lib/operations/index.ts new file mode 100644 index 000000000000..50be9cad72d1 --- /dev/null +++ b/sdk/managedapplications/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/sdk/managedapplications/arm-managedapplications/package.json b/sdk/managedapplications/arm-managedapplications/package.json index a9328e006c4f..6103120d8a9b 100644 --- a/sdk/managedapplications/arm-managedapplications/package.json +++ b/sdk/managedapplications/arm-managedapplications/package.json @@ -26,7 +26,7 @@ "rollup-plugin-sourcemaps": "^0.4.2", "uglify-js": "^3.4.9" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/sdk/managedapplications/arm-managedapplications", + "homepage": "https://github.com/azure/azure-sdk-for-js", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-js.git" @@ -43,8 +43,7 @@ "esm/**/*.js.map", "esm/**/*.d.ts", "esm/**/*.d.ts.map", - "src/**/*.ts", - "README.md", + "lib/**/*.ts", "rollup.config.js", "tsconfig.json" ], @@ -53,6 +52,5 @@ "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-managedapplications.js.map'\" -o ./dist/arm-managedapplications.min.js ./dist/arm-managedapplications.js", "prepack": "npm install && npm run build" }, - "sideEffects": false, - "authPublish": true + "sideEffects": false } diff --git a/sdk/managedapplications/arm-managedapplications/tsconfig.json b/sdk/managedapplications/arm-managedapplications/tsconfig.json index 87bbf5b5fa49..51ea90961ce5 100644 --- a/sdk/managedapplications/arm-managedapplications/tsconfig.json +++ b/sdk/managedapplications/arm-managedapplications/tsconfig.json @@ -14,6 +14,6 @@ "outDir": "./esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], + "include": ["./lib/**/*.ts"], "exclude": ["node_modules"] } diff --git a/sdk/policy/arm-policy/LICENSE.txt b/sdk/policy/arm-policy/LICENSE.txt index a70e8cf66038..b73b4a1293c3 100644 --- a/sdk/policy/arm-policy/LICENSE.txt +++ b/sdk/policy/arm-policy/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Microsoft +Copyright (c) 2019 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/policy/arm-policy/README.md b/sdk/policy/arm-policy/README.md index 5f3c29ef6a96..15388fa8ecd5 100644 --- a/sdk/policy/arm-policy/README.md +++ b/sdk/policy/arm-policy/README.md @@ -98,6 +98,3 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to ## Related projects - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) - - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/policy/arm-policy/README.png) diff --git a/sdk/policy/arm-policy/lib/models/index.ts b/sdk/policy/arm-policy/lib/models/index.ts new file mode 100644 index 000000000000..006d8d0dbefb --- /dev/null +++ b/sdk/policy/arm-policy/lib/models/index.ts @@ -0,0 +1,1069 @@ +/* + * 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 "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/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 response 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 type ResourceIdentityType = 'SystemAssigned' | 'None'; + +/** + * Defines values for PolicyType. + * Possible values include: 'NotSpecified', 'BuiltIn', 'Custom' + * @readonly + * @enum {string} + */ +export type PolicyType = 'NotSpecified' | 'BuiltIn' | 'Custom'; + +/** + * Defines values for PolicyMode. + * Possible values include: 'NotSpecified', 'Indexed', 'All' + * @readonly + * @enum {string} + */ +export type PolicyMode = 'NotSpecified' | 'Indexed' | '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/sdk/policy/arm-policy/lib/models/mappers.ts b/sdk/policy/arm-policy/lib/models/mappers.ts new file mode 100644 index 000000000000..221c2d0281f5 --- /dev/null +++ b/sdk/policy/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 "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/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/sdk/policy/arm-policy/lib/models/parameters.ts b/sdk/policy/arm-policy/lib/models/parameters.ts new file mode 100644 index 000000000000..ac112355dc69 --- /dev/null +++ b/sdk/policy/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 "@azure/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/sdk/policy/arm-policy/lib/models/policyAssignmentsMappers.ts b/sdk/policy/arm-policy/lib/models/policyAssignmentsMappers.ts new file mode 100644 index 000000000000..f07616534449 --- /dev/null +++ b/sdk/policy/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/sdk/policy/arm-policy/lib/models/policyDefinitionsMappers.ts b/sdk/policy/arm-policy/lib/models/policyDefinitionsMappers.ts new file mode 100644 index 000000000000..0c55039e555a --- /dev/null +++ b/sdk/policy/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/sdk/policy/arm-policy/lib/models/policySetDefinitionsMappers.ts b/sdk/policy/arm-policy/lib/models/policySetDefinitionsMappers.ts new file mode 100644 index 000000000000..aae40e44bd82 --- /dev/null +++ b/sdk/policy/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/sdk/policy/arm-policy/lib/operations/index.ts b/sdk/policy/arm-policy/lib/operations/index.ts new file mode 100644 index 000000000000..8fab2c121e51 --- /dev/null +++ b/sdk/policy/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/sdk/policy/arm-policy/lib/operations/policyAssignments.ts b/sdk/policy/arm-policy/lib/operations/policyAssignments.ts new file mode 100644 index 000000000000..d3423fcd6259 --- /dev/null +++ b/sdk/policy/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 "@azure/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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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/sdk/policy/arm-policy/lib/operations/policyDefinitions.ts b/sdk/policy/arm-policy/lib/operations/policyDefinitions.ts new file mode 100644 index 000000000000..b2d5d0e40635 --- /dev/null +++ b/sdk/policy/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 "@azure/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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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/sdk/policy/arm-policy/lib/operations/policySetDefinitions.ts b/sdk/policy/arm-policy/lib/operations/policySetDefinitions.ts new file mode 100644 index 000000000000..ee871611884f --- /dev/null +++ b/sdk/policy/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 "@azure/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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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/sdk/policy/arm-policy/lib/policyClient.ts b/sdk/policy/arm-policy/lib/policyClient.ts new file mode 100644 index 000000000000..dc8f8dbde966 --- /dev/null +++ b/sdk/policy/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 "@azure/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/sdk/policy/arm-policy/lib/policyClientContext.ts b/sdk/policy/arm-policy/lib/policyClientContext.ts new file mode 100644 index 000000000000..8f97922d2ee4 --- /dev/null +++ b/sdk/policy/arm-policy/lib/policyClientContext.ts @@ -0,0 +1,62 @@ +/* + * 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 "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; + +const packageName = "@azure/arm-policy"; +const packageVersion = "1.0.1"; + +export class PolicyClientContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials; + subscriptionId: string; + apiVersion?: string; + + /** + * 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 = {}; + } + if(!options.userAgent) { + const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); + options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; + } + + 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; + + 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/sdk/policy/arm-policy/package.json b/sdk/policy/arm-policy/package.json index 5fbc40ab6504..7c21b377f0b2 100644 --- a/sdk/policy/arm-policy/package.json +++ b/sdk/policy/arm-policy/package.json @@ -26,7 +26,7 @@ "rollup-plugin-sourcemaps": "^0.4.2", "uglify-js": "^3.4.9" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/sdk/policy/arm-policy", + "homepage": "https://github.com/azure/azure-sdk-for-js", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-js.git" @@ -43,8 +43,7 @@ "esm/**/*.js.map", "esm/**/*.d.ts", "esm/**/*.d.ts.map", - "src/**/*.ts", - "README.md", + "lib/**/*.ts", "rollup.config.js", "tsconfig.json" ], @@ -53,6 +52,5 @@ "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-policy.js.map'\" -o ./dist/arm-policy.min.js ./dist/arm-policy.js", "prepack": "npm install && npm run build" }, - "sideEffects": false, - "authPublish": true + "sideEffects": false } diff --git a/sdk/policy/arm-policy/tsconfig.json b/sdk/policy/arm-policy/tsconfig.json index 87bbf5b5fa49..51ea90961ce5 100644 --- a/sdk/policy/arm-policy/tsconfig.json +++ b/sdk/policy/arm-policy/tsconfig.json @@ -14,6 +14,6 @@ "outDir": "./esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], + "include": ["./lib/**/*.ts"], "exclude": ["node_modules"] } diff --git a/sdk/resources/arm-resources/LICENSE.txt b/sdk/resources/arm-resources/LICENSE.txt index a70e8cf66038..b73b4a1293c3 100644 --- a/sdk/resources/arm-resources/LICENSE.txt +++ b/sdk/resources/arm-resources/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Microsoft +Copyright (c) 2019 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/resources/arm-resources/README.md b/sdk/resources/arm-resources/README.md index 71483213cec0..3a5196cc11bb 100644 --- a/sdk/resources/arm-resources/README.md +++ b/sdk/resources/arm-resources/README.md @@ -94,6 +94,3 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to ## Related projects - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) - - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/resources/arm-resources/README.png) diff --git a/sdk/resources/arm-resources/lib/models/deploymentOperationsMappers.ts b/sdk/resources/arm-resources/lib/models/deploymentOperationsMappers.ts new file mode 100644 index 000000000000..bfa149a16bef --- /dev/null +++ b/sdk/resources/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/sdk/resources/arm-resources/lib/models/deploymentsMappers.ts b/sdk/resources/arm-resources/lib/models/deploymentsMappers.ts new file mode 100644 index 000000000000..5865f67f1c27 --- /dev/null +++ b/sdk/resources/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/sdk/resources/arm-resources/lib/models/index.ts b/sdk/resources/arm-resources/lib/models/index.ts new file mode 100644 index 000000000000..dfeff72cd820 --- /dev/null +++ b/sdk/resources/arm-resources/lib/models/index.ts @@ -0,0 +1,2623 @@ +/* + * 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 "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/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 parameters. + * + */ +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 {string} [capabilities] The additional capabilities offered by + * this resource type. + */ + capabilities?: 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 + * resource provider. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly registrationState?: string; + /** + * @member {string} [registrationPolicy] The registration policy of the + * resource provider. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly registrationPolicy?: 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 deployment output. + */ + 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} [type] The type of the deployment. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: 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 {string} [type] The type of the resource group. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: 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 type DeploymentMode = 'Incremental' | 'Complete'; + +/** + * Defines values for OnErrorDeploymentType. + * Possible values include: 'LastSuccessful', 'SpecificDeployment' + * @readonly + * @enum {string} + */ +export type OnErrorDeploymentType = 'LastSuccessful' | 'SpecificDeployment'; + +/** + * Defines values for ResourceIdentityType. + * Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + * @readonly + * @enum {string} + */ +export type ResourceIdentityType = 'SystemAssigned' | 'UserAssigned' | 'SystemAssigned, UserAssigned' | '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/sdk/resources/arm-resources/lib/models/mappers.ts b/sdk/resources/arm-resources/lib/models/mappers.ts new file mode 100644 index 000000000000..e905511d0f18 --- /dev/null +++ b/sdk/resources/arm-resources/lib/models/mappers.ts @@ -0,0 +1,1774 @@ +/* + * 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 "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/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" + } + } + } + }, + capabilities: { + serializedName: "capabilities", + 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" + } + }, + registrationPolicy: { + readOnly: true, + serializedName: "registrationPolicy", + 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" + } + }, + type: { + readOnly: true, + serializedName: "type", + 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" + } + }, + type: { + readOnly: true, + serializedName: "type", + 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/sdk/resources/arm-resources/lib/models/operationsMappers.ts b/sdk/resources/arm-resources/lib/models/operationsMappers.ts new file mode 100644 index 000000000000..2edcc577920e --- /dev/null +++ b/sdk/resources/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/sdk/resources/arm-resources/lib/models/parameters.ts b/sdk/resources/arm-resources/lib/models/parameters.ts new file mode 100644 index 000000000000..6cdb760d5157 --- /dev/null +++ b/sdk/resources/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 "@azure/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/sdk/resources/arm-resources/lib/models/providersMappers.ts b/sdk/resources/arm-resources/lib/models/providersMappers.ts new file mode 100644 index 000000000000..98f3b160d8f5 --- /dev/null +++ b/sdk/resources/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/sdk/resources/arm-resources/lib/models/resourceGroupsMappers.ts b/sdk/resources/arm-resources/lib/models/resourceGroupsMappers.ts new file mode 100644 index 000000000000..4806ec8af2df --- /dev/null +++ b/sdk/resources/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/sdk/resources/arm-resources/lib/models/resourcesMappers.ts b/sdk/resources/arm-resources/lib/models/resourcesMappers.ts new file mode 100644 index 000000000000..ab25fa0e3fca --- /dev/null +++ b/sdk/resources/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/sdk/resources/arm-resources/lib/models/tagsMappers.ts b/sdk/resources/arm-resources/lib/models/tagsMappers.ts new file mode 100644 index 000000000000..01caec9196c7 --- /dev/null +++ b/sdk/resources/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/sdk/resources/arm-resources/lib/operations/deploymentOperations.ts b/sdk/resources/arm-resources/lib/operations/deploymentOperations.ts new file mode 100644 index 000000000000..bd1b8fd5d95c --- /dev/null +++ b/sdk/resources/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 "@azure/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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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/sdk/resources/arm-resources/lib/operations/deployments.ts b/sdk/resources/arm-resources/lib/operations/deployments.ts new file mode 100644 index 000000000000..054bcaec8ae4 --- /dev/null +++ b/sdk/resources/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 "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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/sdk/resources/arm-resources/lib/operations/index.ts b/sdk/resources/arm-resources/lib/operations/index.ts new file mode 100644 index 000000000000..542b40b96c2d --- /dev/null +++ b/sdk/resources/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/sdk/resources/arm-resources/lib/operations/operations.ts b/sdk/resources/arm-resources/lib/operations/operations.ts new file mode 100644 index 000000000000..dafc3946fb7d --- /dev/null +++ b/sdk/resources/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 "@azure/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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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/sdk/resources/arm-resources/lib/operations/providers.ts b/sdk/resources/arm-resources/lib/operations/providers.ts new file mode 100644 index 000000000000..6e30d6e2cee1 --- /dev/null +++ b/sdk/resources/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 "@azure/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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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/sdk/resources/arm-resources/lib/operations/resourceGroups.ts b/sdk/resources/arm-resources/lib/operations/resourceGroups.ts new file mode 100644 index 000000000000..6411c09ca1ed --- /dev/null +++ b/sdk/resources/arm-resources/lib/operations/resourceGroups.ts @@ -0,0 +1,487 @@ +/* + * 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 "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/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 | msRest.ServiceCallback, 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. Can include + * alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters + * that match the allowed characters. + * @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. Can include + * alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters + * that match the allowed characters. + * @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. Can include + * alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters + * that match the allowed characters. + * @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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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/sdk/resources/arm-resources/lib/operations/resources.ts b/sdk/resources/arm-resources/lib/operations/resources.ts new file mode 100644 index 000000000000..884c2606c8ff --- /dev/null +++ b/sdk/resources/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 "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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/sdk/resources/arm-resources/lib/operations/tags.ts b/sdk/resources/arm-resources/lib/operations/tags.ts new file mode 100644 index 000000000000..ca365271243a --- /dev/null +++ b/sdk/resources/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 "@azure/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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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 | msRest.ServiceCallback, 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/sdk/resources/arm-resources/lib/resourceManagementClient.ts b/sdk/resources/arm-resources/lib/resourceManagementClient.ts new file mode 100644 index 000000000000..b712764c2a93 --- /dev/null +++ b/sdk/resources/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 "@azure/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/sdk/resources/arm-resources/lib/resourceManagementClientContext.ts b/sdk/resources/arm-resources/lib/resourceManagementClientContext.ts new file mode 100644 index 000000000000..121eb9e6e1c8 --- /dev/null +++ b/sdk/resources/arm-resources/lib/resourceManagementClientContext.ts @@ -0,0 +1,62 @@ +/* + * 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 "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; + +const packageName = "@azure/arm-resources"; +const packageVersion = "1.0.1"; + +export class ResourceManagementClientContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials; + subscriptionId: string; + apiVersion?: string; + + /** + * 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 = {}; + } + if(!options.userAgent) { + const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); + options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; + } + + 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; + + 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/sdk/resources/arm-resources/package.json b/sdk/resources/arm-resources/package.json index 8fbb0a7241b1..e4cfad81a032 100644 --- a/sdk/resources/arm-resources/package.json +++ b/sdk/resources/arm-resources/package.json @@ -26,7 +26,7 @@ "rollup-plugin-sourcemaps": "^0.4.2", "uglify-js": "^3.4.9" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/sdk/resources/arm-resources", + "homepage": "https://github.com/azure/azure-sdk-for-js", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-js.git" @@ -43,8 +43,7 @@ "esm/**/*.js.map", "esm/**/*.d.ts", "esm/**/*.d.ts.map", - "src/**/*.ts", - "README.md", + "lib/**/*.ts", "rollup.config.js", "tsconfig.json" ], @@ -53,6 +52,5 @@ "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-resources.js.map'\" -o ./dist/arm-resources.min.js ./dist/arm-resources.js", "prepack": "npm install && npm run build" }, - "sideEffects": false, - "authPublish": true + "sideEffects": false } diff --git a/sdk/resources/arm-resources/tsconfig.json b/sdk/resources/arm-resources/tsconfig.json index 87bbf5b5fa49..51ea90961ce5 100644 --- a/sdk/resources/arm-resources/tsconfig.json +++ b/sdk/resources/arm-resources/tsconfig.json @@ -14,6 +14,6 @@ "outDir": "./esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], + "include": ["./lib/**/*.ts"], "exclude": ["node_modules"] }