diff --git a/sdk/resources/arm-resources/LICENSE.txt b/sdk/resources/arm-resources/LICENSE.txt index b73b4a1293c3..ea8fb1516028 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) 2019 Microsoft +Copyright (c) 2020 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 bcf213c43571..3db118a758f7 100644 --- a/sdk/resources/arm-resources/README.md +++ b/sdk/resources/arm-resources/README.md @@ -96,4 +96,4 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fresources%2Farm-resources%2FREADME.png) +![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/src/models/deploymentsMappers.ts b/sdk/resources/arm-resources/src/models/deploymentsMappers.ts index 24da4cc917df..ab883592b99e 100644 --- a/sdk/resources/arm-resources/src/models/deploymentsMappers.ts +++ b/sdk/resources/arm-resources/src/models/deploymentsMappers.ts @@ -40,9 +40,12 @@ export { Resource, ResourceGroup, ResourceGroupProperties, + ScopedDeployment, Sku, SubResource, TagCount, + Tags, + TagsResource, TagValue, TemplateHashResult, TemplateLink, diff --git a/sdk/resources/arm-resources/src/models/index.ts b/sdk/resources/arm-resources/src/models/index.ts index f5faeb25a2e2..a7bfa3dda521 100644 --- a/sdk/resources/arm-resources/src/models/index.ts +++ b/sdk/resources/arm-resources/src/models/index.ts @@ -171,6 +171,20 @@ export interface Deployment { properties: DeploymentProperties; } +/** + * Deployment operation parameters. + */ +export interface ScopedDeployment { + /** + * The location to store the deployment data. + */ + location: string; + /** + * The deployment properties. + */ + properties: DeploymentProperties; +} + /** * The deployment export result. */ @@ -1110,6 +1124,37 @@ export interface WhatIfOperationResult { error?: ErrorResponse; } +/** + * key and value pairs for tags + */ +export interface Tags { + tags?: { [propertyName: string]: string }; +} + +/** + * Tag Request for Patch operation. + */ +export interface TagPatchRequest { + /** + * The operation type for the patch api. Possible values include: 'Replace', 'Merge', 'Delete' + */ + operation?: OperationEnum; + /** + * tags object passing in the request. + */ + properties?: Tags; +} + +/** + * Tags for the resource. + */ +export interface TagsResource extends Resource { + /** + * tags property. + */ + properties: Tags; +} + /** * Optional Parameters. */ @@ -1253,8 +1298,9 @@ export interface ResourcesListByResourceGroupOptionalParams extends msRest.Reque * 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 + * filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When + * you filter by a tag name and value, the tags for each resource are not returned in the + * results.

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. */ @@ -1284,8 +1330,9 @@ export interface ResourcesListOptionalParams extends msRest.RequestOptionsBase { * 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 + * filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When + * you filter by a tag name and value, the tags for each resource are not returned in the + * results.

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. */ @@ -1542,6 +1589,14 @@ export type PropertyChangeType = 'Create' | 'Delete' | 'Modify' | 'Array'; */ export type ChangeType = 'Create' | 'Delete' | 'Ignore' | 'Deploy' | 'NoChange' | 'Modify'; +/** + * Defines values for OperationEnum. + * Possible values include: 'Replace', 'Merge', 'Delete' + * @readonly + * @enum {string} + */ +export type OperationEnum = 'Replace' | 'Merge' | 'Delete'; + /** * Contains response data for the list operation. */ @@ -3092,6 +3147,26 @@ export type ResourceGroupsListResponse = ResourceGroupListResult & { }; }; +/** + * Contains response data for the beginExportTemplate operation. + */ +export type ResourceGroupsBeginExportTemplateResponse = 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 listNext operation. */ @@ -3172,6 +3247,66 @@ export type TagsListResponse = TagsListResult & { }; }; +/** + * Contains response data for the resourceCreate operation. + */ +export type TagsResourceCreateResponse = TagsResource & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TagsResource; + }; +}; + +/** + * Contains response data for the resourceUpdate operation. + */ +export type TagsResourceUpdateResponse = TagsResource & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TagsResource; + }; +}; + +/** + * Contains response data for the resourceGet operation. + */ +export type TagsResourceGetResponse = TagsResource & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TagsResource; + }; +}; + /** * Contains response data for the listNext operation. */ diff --git a/sdk/resources/arm-resources/src/models/mappers.ts b/sdk/resources/arm-resources/src/models/mappers.ts index e311aa0b456d..d15c6ff808e0 100644 --- a/sdk/resources/arm-resources/src/models/mappers.ts +++ b/sdk/resources/arm-resources/src/models/mappers.ts @@ -251,6 +251,31 @@ export const Deployment: msRest.CompositeMapper = { } }; +export const ScopedDeployment: msRest.CompositeMapper = { + serializedName: "ScopedDeployment", + type: { + name: "Composite", + className: "ScopedDeployment", + modelProperties: { + location: { + required: true, + serializedName: "location", + type: { + name: "String" + } + }, + properties: { + required: true, + serializedName: "properties", + type: { + name: "Composite", + className: "DeploymentProperties" + } + } + } + } +}; + export const DeploymentExportResult: msRest.CompositeMapper = { serializedName: "DeploymentExportResult", type: { @@ -1849,6 +1874,69 @@ export const WhatIfOperationResult: msRest.CompositeMapper = { } }; +export const Tags: msRest.CompositeMapper = { + serializedName: "Tags", + type: { + name: "Composite", + className: "Tags", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const TagPatchRequest: msRest.CompositeMapper = { + serializedName: "TagPatchRequest", + type: { + name: "Composite", + className: "TagPatchRequest", + modelProperties: { + operation: { + serializedName: "operation", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "Tags" + } + } + } + } +}; + +export const TagsResource: msRest.CompositeMapper = { + serializedName: "TagsResource", + type: { + name: "Composite", + className: "TagsResource", + modelProperties: { + ...Resource.type.modelProperties, + properties: { + required: true, + serializedName: "properties", + type: { + name: "Composite", + className: "Tags" + } + } + } + } +}; + export const DeploymentsWhatIfAtSubscriptionScopeHeaders: msRest.CompositeMapper = { serializedName: "deployments-whatifatsubscriptionscope-headers", type: { diff --git a/sdk/resources/arm-resources/src/models/resourceGroupsMappers.ts b/sdk/resources/arm-resources/src/models/resourceGroupsMappers.ts index eb263b58a93a..c5a0fa36db86 100644 --- a/sdk/resources/arm-resources/src/models/resourceGroupsMappers.ts +++ b/sdk/resources/arm-resources/src/models/resourceGroupsMappers.ts @@ -36,6 +36,8 @@ export { Sku, SubResource, TagCount, + Tags, + TagsResource, TagValue, TemplateLink } from "../models/mappers"; diff --git a/sdk/resources/arm-resources/src/models/resourcesMappers.ts b/sdk/resources/arm-resources/src/models/resourcesMappers.ts index e660fb32bcc4..d30ca92f9356 100644 --- a/sdk/resources/arm-resources/src/models/resourcesMappers.ts +++ b/sdk/resources/arm-resources/src/models/resourcesMappers.ts @@ -34,6 +34,8 @@ export { Sku, SubResource, TagCount, + Tags, + TagsResource, TagValue, TemplateLink } from "../models/mappers"; diff --git a/sdk/resources/arm-resources/src/models/tagsMappers.ts b/sdk/resources/arm-resources/src/models/tagsOperationsMappers.ts similarity index 95% rename from sdk/resources/arm-resources/src/models/tagsMappers.ts rename to sdk/resources/arm-resources/src/models/tagsOperationsMappers.ts index ef9dcf708953..4f2579c62beb 100644 --- a/sdk/resources/arm-resources/src/models/tagsMappers.ts +++ b/sdk/resources/arm-resources/src/models/tagsOperationsMappers.ts @@ -33,7 +33,10 @@ export { SubResource, TagCount, TagDetails, + TagPatchRequest, + Tags, TagsListResult, + TagsResource, TagValue, TemplateLink } from "../models/mappers"; diff --git a/sdk/resources/arm-resources/src/operations/deploymentOperations.ts b/sdk/resources/arm-resources/src/operations/deploymentOperations.ts index ddb4d2cb4926..f7c968e55a0b 100644 --- a/sdk/resources/arm-resources/src/operations/deploymentOperations.ts +++ b/sdk/resources/arm-resources/src/operations/deploymentOperations.ts @@ -28,7 +28,7 @@ export class DeploymentOperations { /** * Gets a deployments operation. - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param operationId The ID of the operation to get. * @param [options] The optional parameters @@ -36,14 +36,14 @@ export class DeploymentOperations { */ getAtScope(scope: string, deploymentName: string, operationId: string, options?: msRest.RequestOptionsBase): Promise; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param operationId The ID of the operation to get. * @param callback The callback */ getAtScope(scope: string, deploymentName: string, operationId: string, callback: msRest.ServiceCallback): void; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param operationId The ID of the operation to get. * @param options The optional parameters @@ -64,20 +64,20 @@ export class DeploymentOperations { /** * Gets all deployments operations for a deployment. - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param [options] The optional parameters * @returns Promise */ listAtScope(scope: string, deploymentName: string, options?: Models.DeploymentOperationsListAtScopeOptionalParams): Promise; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param callback The callback */ listAtScope(scope: string, deploymentName: string, callback: msRest.ServiceCallback): void; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param options The optional parameters * @param callback The callback diff --git a/sdk/resources/arm-resources/src/operations/deployments.ts b/sdk/resources/arm-resources/src/operations/deployments.ts index 96afac3143f8..0ba4558707b2 100644 --- a/sdk/resources/arm-resources/src/operations/deployments.ts +++ b/sdk/resources/arm-resources/src/operations/deployments.ts @@ -36,7 +36,7 @@ export class Deployments { * 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 scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param [options] The optional parameters * @returns Promise @@ -48,20 +48,20 @@ export class Deployments { /** * Checks whether the deployment exists. - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param [options] The optional parameters * @returns Promise */ checkExistenceAtScope(scope: string, deploymentName: string, options?: msRest.RequestOptionsBase): Promise; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param callback The callback */ checkExistenceAtScope(scope: string, deploymentName: string, callback: msRest.ServiceCallback): void; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param options The optional parameters * @param callback The callback @@ -81,7 +81,7 @@ export class Deployments { /** * You can provide the template and parameters directly in the request or link to JSON files. * @summary Deploys resources at a given scope. - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. * @param [options] The optional parameters @@ -94,20 +94,20 @@ export class Deployments { /** * Gets a deployment. - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param [options] The optional parameters * @returns Promise */ getAtScope(scope: string, deploymentName: string, options?: msRest.RequestOptionsBase): Promise; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param callback The callback */ getAtScope(scope: string, deploymentName: string, callback: msRest.ServiceCallback): void; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param options The optional parameters * @param callback The callback @@ -130,20 +130,20 @@ export class Deployments { * deployment stops the currently running template deployment and leaves the resources partially * deployed. * @summary Cancels a currently running template deployment. - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param [options] The optional parameters * @returns Promise */ cancelAtScope(scope: string, deploymentName: string, options?: msRest.RequestOptionsBase): Promise; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param callback The callback */ cancelAtScope(scope: string, deploymentName: string, callback: msRest.ServiceCallback): void; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param options The optional parameters * @param callback The callback @@ -163,7 +163,7 @@ export class Deployments { /** * Validates whether the specified template is syntactically correct and will be accepted by Azure * Resource Manager.. - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @param [options] The optional parameters @@ -171,14 +171,14 @@ export class Deployments { */ validateAtScope(scope: string, deploymentName: string, parameters: Models.Deployment, options?: msRest.RequestOptionsBase): Promise; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @param callback The callback */ validateAtScope(scope: string, deploymentName: string, parameters: Models.Deployment, callback: msRest.ServiceCallback): void; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @param options The optional parameters @@ -199,20 +199,20 @@ export class Deployments { /** * Exports the template used for specified deployment. - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param [options] The optional parameters * @returns Promise */ exportTemplateAtScope(scope: string, deploymentName: string, options?: msRest.RequestOptionsBase): Promise; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param callback The callback */ exportTemplateAtScope(scope: string, deploymentName: string, callback: msRest.ServiceCallback): void; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param options The optional parameters * @param callback The callback @@ -231,18 +231,18 @@ export class Deployments { /** * Get all the deployments at the given scope. - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param [options] The optional parameters * @returns Promise */ listAtScope(scope: string, options?: Models.DeploymentsListAtScopeOptionalParams): Promise; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param callback The callback */ listAtScope(scope: string, callback: msRest.ServiceCallback): void; /** - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param options The optional parameters * @param callback The callback */ @@ -311,7 +311,7 @@ export class Deployments { * @param [options] The optional parameters * @returns Promise */ - createOrUpdateAtTenantScope(deploymentName: string, parameters: Models.Deployment, options?: msRest.RequestOptionsBase): Promise { + createOrUpdateAtTenantScope(deploymentName: string, parameters: Models.ScopedDeployment, options?: msRest.RequestOptionsBase): Promise { return this.beginCreateOrUpdateAtTenantScope(deploymentName,parameters,options) .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; } @@ -384,21 +384,21 @@ export class Deployments { * @param [options] The optional parameters * @returns Promise */ - validateAtTenantScope(deploymentName: string, parameters: Models.Deployment, options?: msRest.RequestOptionsBase): Promise; + validateAtTenantScope(deploymentName: string, parameters: Models.ScopedDeployment, options?: msRest.RequestOptionsBase): Promise; /** * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @param callback The callback */ - validateAtTenantScope(deploymentName: string, parameters: Models.Deployment, callback: msRest.ServiceCallback): void; + validateAtTenantScope(deploymentName: string, parameters: Models.ScopedDeployment, 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 */ - validateAtTenantScope(deploymentName: string, parameters: Models.Deployment, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - validateAtTenantScope(deploymentName: string, parameters: Models.Deployment, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + validateAtTenantScope(deploymentName: string, parameters: Models.ScopedDeployment, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + validateAtTenantScope(deploymentName: string, parameters: Models.ScopedDeployment, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { deploymentName, @@ -521,7 +521,7 @@ export class Deployments { * @param [options] The optional parameters * @returns Promise */ - createOrUpdateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: Models.Deployment, options?: msRest.RequestOptionsBase): Promise { + createOrUpdateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: Models.ScopedDeployment, options?: msRest.RequestOptionsBase): Promise { return this.beginCreateOrUpdateAtManagementGroupScope(groupId,deploymentName,parameters,options) .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; } @@ -603,14 +603,14 @@ export class Deployments { * @param [options] The optional parameters * @returns Promise */ - validateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: Models.Deployment, options?: msRest.RequestOptionsBase): Promise; + validateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: Models.ScopedDeployment, options?: msRest.RequestOptionsBase): Promise; /** * @param groupId The management group ID. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @param callback The callback */ - validateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: Models.Deployment, callback: msRest.ServiceCallback): void; + validateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: Models.ScopedDeployment, callback: msRest.ServiceCallback): void; /** * @param groupId The management group ID. * @param deploymentName The name of the deployment. @@ -618,8 +618,8 @@ export class Deployments { * @param options The optional parameters * @param callback The callback */ - validateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: Models.Deployment, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - validateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: Models.Deployment, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + validateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: Models.ScopedDeployment, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + validateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: Models.ScopedDeployment, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { groupId, @@ -1202,7 +1202,7 @@ export class Deployments { * 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 scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param [options] The optional parameters * @returns Promise @@ -1221,7 +1221,7 @@ export class Deployments { /** * You can provide the template and parameters directly in the request or link to JSON files. * @summary Deploys resources at a given scope. - * @param scope The scope of a deployment. + * @param scope The resource scope. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. * @param [options] The optional parameters @@ -1270,7 +1270,7 @@ export class Deployments { * @param [options] The optional parameters * @returns Promise */ - beginCreateOrUpdateAtTenantScope(deploymentName: string, parameters: Models.Deployment, options?: msRest.RequestOptionsBase): Promise { + beginCreateOrUpdateAtTenantScope(deploymentName: string, parameters: Models.ScopedDeployment, options?: msRest.RequestOptionsBase): Promise { return this.client.sendLRORequest( { deploymentName, @@ -1315,7 +1315,7 @@ export class Deployments { * @param [options] The optional parameters * @returns Promise */ - beginCreateOrUpdateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: Models.Deployment, options?: msRest.RequestOptionsBase): Promise { + beginCreateOrUpdateAtManagementGroupScope(groupId: string, deploymentName: string, parameters: Models.ScopedDeployment, options?: msRest.RequestOptionsBase): Promise { return this.client.sendLRORequest( { groupId, @@ -1835,7 +1835,7 @@ const validateAtTenantScopeOperationSpec: msRest.OperationSpec = { requestBody: { parameterPath: "parameters", mapper: { - ...Mappers.Deployment, + ...Mappers.ScopedDeployment, required: true } }, @@ -1983,7 +1983,7 @@ const validateAtManagementGroupScopeOperationSpec: msRest.OperationSpec = { requestBody: { parameterPath: "parameters", mapper: { - ...Mappers.Deployment, + ...Mappers.ScopedDeployment, required: true } }, @@ -2484,7 +2484,7 @@ const beginCreateOrUpdateAtTenantScopeOperationSpec: msRest.OperationSpec = { requestBody: { parameterPath: "parameters", mapper: { - ...Mappers.Deployment, + ...Mappers.ScopedDeployment, required: true } }, @@ -2541,7 +2541,7 @@ const beginCreateOrUpdateAtManagementGroupScopeOperationSpec: msRest.OperationSp requestBody: { parameterPath: "parameters", mapper: { - ...Mappers.Deployment, + ...Mappers.ScopedDeployment, required: true } }, diff --git a/sdk/resources/arm-resources/src/operations/index.ts b/sdk/resources/arm-resources/src/operations/index.ts index 542b40b96c2d..a7cec76246cd 100644 --- a/sdk/resources/arm-resources/src/operations/index.ts +++ b/sdk/resources/arm-resources/src/operations/index.ts @@ -13,5 +13,5 @@ export * from "./deployments"; export * from "./providers"; export * from "./resources"; export * from "./resourceGroups"; -export * from "./tags"; +export * from "./tagsOperations"; export * from "./deploymentOperations"; diff --git a/sdk/resources/arm-resources/src/operations/resourceGroups.ts b/sdk/resources/arm-resources/src/operations/resourceGroups.ts index 6411c09ca1ed..617190a57bc6 100644 --- a/sdk/resources/arm-resources/src/operations/resourceGroups.ts +++ b/sdk/resources/arm-resources/src/operations/resourceGroups.ts @@ -171,34 +171,14 @@ export class ResourceGroups { /** * Captures the specified resource group as a template. - * @param resourceGroupName The name of the resource group to export as a template. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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; + exportTemplate(resourceGroupName: string, parameters: Models.ExportTemplateRequest, options?: msRest.RequestOptionsBase): Promise { + return this.beginExportTemplate(resourceGroupName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; } /** @@ -243,6 +223,24 @@ export class ResourceGroups { options); } + /** + * Captures the specified resource group as a template. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters for exporting the template. + * @param [options] The optional parameters + * @returns Promise + */ + beginExportTemplate(resourceGroupName: string, parameters: Models.ExportTemplateRequest, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + parameters, + options + }, + beginExportTemplateOperationSpec, + options); + } + /** * Gets all the resource groups for a subscription. * @param nextPageLink The NextLink from the previous successful call to List operation. @@ -386,29 +384,23 @@ const updateOperationSpec: msRest.OperationSpec = { serializer }; -const exportTemplateOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/exportTemplate", +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourcegroups", urlParameters: [ - Parameters.resourceGroupName, Parameters.subscriptionId ], queryParameters: [ + Parameters.filter, + Parameters.top, Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.ExportTemplateRequest, - required: true - } - }, responses: { 200: { - bodyMapper: Mappers.ResourceGroupExportResult + bodyMapper: Mappers.ResourceGroupListResult }, default: { bodyMapper: Mappers.CloudError @@ -417,24 +409,22 @@ const exportTemplateOperationSpec: msRest.OperationSpec = { serializer }; -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourcegroups", +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", urlParameters: [ + Parameters.resourceGroupName, Parameters.subscriptionId ], queryParameters: [ - Parameters.filter, - Parameters.top, Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage ], responses: { - 200: { - bodyMapper: Mappers.ResourceGroupListResult - }, + 200: {}, + 202: {}, default: { bodyMapper: Mappers.CloudError } @@ -442,12 +432,12 @@ const listOperationSpec: msRest.OperationSpec = { serializer }; -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", +const beginExportTemplateOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/exportTemplate", urlParameters: [ - Parameters.resourceGroupName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.resourceGroupName ], queryParameters: [ Parameters.apiVersion @@ -455,8 +445,17 @@ const beginDeleteMethodOperationSpec: msRest.OperationSpec = { headerParameters: [ Parameters.acceptLanguage ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.ExportTemplateRequest, + required: true + } + }, responses: { - 200: {}, + 200: { + bodyMapper: Mappers.ResourceGroupExportResult + }, 202: {}, default: { bodyMapper: Mappers.CloudError diff --git a/sdk/resources/arm-resources/src/operations/resources.ts b/sdk/resources/arm-resources/src/operations/resources.ts index be81c76eeb7b..723ee6abe2e5 100644 --- a/sdk/resources/arm-resources/src/operations/resources.ts +++ b/sdk/resources/arm-resources/src/operations/resources.ts @@ -122,11 +122,10 @@ export class Resources { * @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; + checkExistence(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; /** * @param resourceGroupName The name of the resource group containing the resource to check. The * name is case insensitive. @@ -134,10 +133,9 @@ export class Resources { * @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; + checkExistence(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 to check. The * name is case insensitive. @@ -145,12 +143,11 @@ export class Resources { * @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 { + checkExistence(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + checkExistence(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -158,7 +155,6 @@ export class Resources { parentResourcePath, resourceType, resourceName, - apiVersion, options }, checkExistenceOperationSpec, @@ -173,12 +169,11 @@ export class Resources { * @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) + deleteMethod(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,resourceProviderNamespace,parentResourcePath,resourceType,resourceName,options) .then(lroPoller => lroPoller.pollUntilFinished()); } @@ -190,13 +185,12 @@ export class Resources { * @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) + createOrUpdate(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, parameters: Models.GenericResource, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdate(resourceGroupName,resourceProviderNamespace,parentResourcePath,resourceType,resourceName,parameters,options) .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; } @@ -208,13 +202,12 @@ export class Resources { * @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) + update(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, parameters: Models.GenericResource, options?: msRest.RequestOptionsBase): Promise { + return this.beginUpdate(resourceGroupName,resourceProviderNamespace,parentResourcePath,resourceType,resourceName,parameters,options) .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; } @@ -226,11 +219,10 @@ export class Resources { * @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; + get(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; /** * @param resourceGroupName The name of the resource group containing the resource to get. The name * is case insensitive. @@ -238,10 +230,9 @@ export class Resources { * @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; + get(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 to get. The name * is case insensitive. @@ -249,12 +240,11 @@ export class Resources { * @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 { + get(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -262,7 +252,6 @@ export class Resources { parentResourcePath, resourceType, resourceName, - apiVersion, options }, getOperationSpec, @@ -274,33 +263,29 @@ export class Resources { * @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; + checkExistenceById(resourceId: 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; + checkExistenceById(resourceId: 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 { + checkExistenceById(resourceId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + checkExistenceById(resourceId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceId, - apiVersion, options }, checkExistenceByIdOperationSpec, @@ -312,12 +297,11 @@ export class Resources { * @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) + deleteById(resourceId: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteById(resourceId,options) .then(lroPoller => lroPoller.pollUntilFinished()); } @@ -326,13 +310,12 @@ export class Resources { * @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) + createOrUpdateById(resourceId: string, parameters: Models.GenericResource, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdateById(resourceId,parameters,options) .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; } @@ -341,13 +324,12 @@ export class Resources { * @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) + updateById(resourceId: string, parameters: Models.GenericResource, options?: msRest.RequestOptionsBase): Promise { + return this.beginUpdateById(resourceId,parameters,options) .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; } @@ -356,33 +338,29 @@ export class Resources { * @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; + getById(resourceId: 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; + getById(resourceId: 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 { + getById(resourceId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getById(resourceId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceId, - apiVersion, options }, getByIdOperationSpec, @@ -444,11 +422,10 @@ export class Resources { * @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 { + beginDeleteMethod(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise { return this.client.sendLRORequest( { resourceGroupName, @@ -456,7 +433,6 @@ export class Resources { parentResourcePath, resourceType, resourceName, - apiVersion, options }, beginDeleteMethodOperationSpec, @@ -471,12 +447,11 @@ export class Resources { * @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 { + beginCreateOrUpdate(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, parameters: Models.GenericResource, options?: msRest.RequestOptionsBase): Promise { return this.client.sendLRORequest( { resourceGroupName, @@ -484,7 +459,6 @@ export class Resources { parentResourcePath, resourceType, resourceName, - apiVersion, parameters, options }, @@ -500,12 +474,11 @@ export class Resources { * @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 { + beginUpdate(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, parameters: Models.GenericResource, options?: msRest.RequestOptionsBase): Promise { return this.client.sendLRORequest( { resourceGroupName, @@ -513,7 +486,6 @@ export class Resources { parentResourcePath, resourceType, resourceName, - apiVersion, parameters, options }, @@ -526,15 +498,13 @@ export class Resources { * @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 { + beginDeleteById(resourceId: string, options?: msRest.RequestOptionsBase): Promise { return this.client.sendLRORequest( { resourceId, - apiVersion, options }, beginDeleteByIdOperationSpec, @@ -546,16 +516,14 @@ export class Resources { * @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 { + beginCreateOrUpdateById(resourceId: string, parameters: Models.GenericResource, options?: msRest.RequestOptionsBase): Promise { return this.client.sendLRORequest( { resourceId, - apiVersion, parameters, options }, @@ -568,16 +536,14 @@ export class Resources { * @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 { + beginUpdateById(resourceId: string, parameters: Models.GenericResource, options?: msRest.RequestOptionsBase): Promise { return this.client.sendLRORequest( { resourceId, - apiVersion, parameters, options }, diff --git a/sdk/resources/arm-resources/src/operations/tags.ts b/sdk/resources/arm-resources/src/operations/tagsOperations.ts similarity index 60% rename from sdk/resources/arm-resources/src/operations/tags.ts rename to sdk/resources/arm-resources/src/operations/tagsOperations.ts index ca365271243a..23472f79ed66 100644 --- a/sdk/resources/arm-resources/src/operations/tags.ts +++ b/sdk/resources/arm-resources/src/operations/tagsOperations.ts @@ -10,16 +10,16 @@ import * as msRest from "@azure/ms-rest-js"; import * as Models from "../models"; -import * as Mappers from "../models/tagsMappers"; +import * as Mappers from "../models/tagsOperationsMappers"; import * as Parameters from "../models/parameters"; import { ResourceManagementClientContext } from "../resourceManagementClientContext"; -/** Class representing a Tags. */ -export class Tags { +/** Class representing a TagsOperations. */ +export class TagsOperations { private readonly client: ResourceManagementClientContext; /** - * Create a Tags. + * Create a TagsOperations. * @param {ResourceManagementClientContext} client Reference to the service client. */ constructor(client: ResourceManagementClientContext) { @@ -174,6 +174,127 @@ export class Tags { callback) as Promise; } + /** + * Create or Replace existing tags with passing in tags. + * @param scope The resource scope. + * @param parameters Parameters for creating multiple tags. + * @param [options] The optional parameters + * @returns Promise + */ + resourceCreate(scope: string, parameters: Models.TagsResource, options?: msRest.RequestOptionsBase): Promise; + /** + * @param scope The resource scope. + * @param parameters Parameters for creating multiple tags. + * @param callback The callback + */ + resourceCreate(scope: string, parameters: Models.TagsResource, callback: msRest.ServiceCallback): void; + /** + * @param scope The resource scope. + * @param parameters Parameters for creating multiple tags. + * @param options The optional parameters + * @param callback The callback + */ + resourceCreate(scope: string, parameters: Models.TagsResource, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + resourceCreate(scope: string, parameters: Models.TagsResource, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + scope, + parameters, + options + }, + resourceCreateOperationSpec, + callback) as Promise; + } + + /** + * Update multiple tags: if the tagKey exists, update tagValue with the new value; if not, insert + * the new record. + * @param scope The resource scope. + * @param parameters Parameters for updating multiple tags. + * @param [options] The optional parameters + * @returns Promise + */ + resourceUpdate(scope: string, parameters: Models.TagPatchRequest, options?: msRest.RequestOptionsBase): Promise; + /** + * @param scope The resource scope. + * @param parameters Parameters for updating multiple tags. + * @param callback The callback + */ + resourceUpdate(scope: string, parameters: Models.TagPatchRequest, callback: msRest.ServiceCallback): void; + /** + * @param scope The resource scope. + * @param parameters Parameters for updating multiple tags. + * @param options The optional parameters + * @param callback The callback + */ + resourceUpdate(scope: string, parameters: Models.TagPatchRequest, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + resourceUpdate(scope: string, parameters: Models.TagPatchRequest, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + scope, + parameters, + options + }, + resourceUpdateOperationSpec, + callback) as Promise; + } + + /** + * Gets all the tags for the resource. + * @param scope The resource scope. + * @param [options] The optional parameters + * @returns Promise + */ + resourceGet(scope: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param scope The resource scope. + * @param callback The callback + */ + resourceGet(scope: string, callback: msRest.ServiceCallback): void; + /** + * @param scope The resource scope. + * @param options The optional parameters + * @param callback The callback + */ + resourceGet(scope: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + resourceGet(scope: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + scope, + options + }, + resourceGetOperationSpec, + callback) as Promise; + } + + /** + * Deletes all the tags for the resource. + * @param scope The resource scope. + * @param [options] The optional parameters + * @returns Promise + */ + resourceDelete(scope: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param scope The resource scope. + * @param callback The callback + */ + resourceDelete(scope: string, callback: msRest.ServiceCallback): void; + /** + * @param scope The resource scope. + * @param options The optional parameters + * @param callback The callback + */ + resourceDelete(scope: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + resourceDelete(scope: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + scope, + options + }, + resourceDeleteOperationSpec, + callback); + } + /** * 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. @@ -330,6 +451,110 @@ const listOperationSpec: msRest.OperationSpec = { serializer }; +const resourceCreateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "{scope}/providers/Microsoft.Resources/tags/default", + urlParameters: [ + Parameters.scope + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.TagsResource, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.TagsResource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const resourceUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "{scope}/providers/Microsoft.Resources/tags/default", + urlParameters: [ + Parameters.scope + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.TagPatchRequest, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.TagsResource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const resourceGetOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "{scope}/providers/Microsoft.Resources/tags/default", + urlParameters: [ + Parameters.scope + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TagsResource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const resourceDeleteOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "{scope}/providers/Microsoft.Resources/tags/default", + urlParameters: [ + Parameters.scope + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + const listNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", baseUrl: "https://management.azure.com", diff --git a/sdk/resources/arm-resources/src/resourceManagementClient.ts b/sdk/resources/arm-resources/src/resourceManagementClient.ts index b712764c2a93..535cd08e4b20 100644 --- a/sdk/resources/arm-resources/src/resourceManagementClient.ts +++ b/sdk/resources/arm-resources/src/resourceManagementClient.ts @@ -22,7 +22,7 @@ class ResourceManagementClient extends ResourceManagementClientContext { providers: operations.Providers; resources: operations.Resources; resourceGroups: operations.ResourceGroups; - tags: operations.Tags; + tags: operations.TagsOperations; deploymentOperations: operations.DeploymentOperations; /** @@ -38,7 +38,7 @@ class ResourceManagementClient extends ResourceManagementClientContext { 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.tags = new operations.TagsOperations(this); this.deploymentOperations = new operations.DeploymentOperations(this); } } diff --git a/sdk/resources/arm-resources/src/resourceManagementClientContext.ts b/sdk/resources/arm-resources/src/resourceManagementClientContext.ts index 1dc03c3fa11f..8d25af9bb00c 100644 --- a/sdk/resources/arm-resources/src/resourceManagementClientContext.ts +++ b/sdk/resources/arm-resources/src/resourceManagementClientContext.ts @@ -44,7 +44,7 @@ export class ResourceManagementClientContext extends msRestAzure.AzureServiceCli super(credentials, options); - this.apiVersion = '2019-07-01'; + this.apiVersion = '2019-10-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";