From bdd6c332eae937a0c8c4ac4a2809816447567a2f Mon Sep 17 00:00:00 2001 From: Phoenix He Date: Thu, 24 Oct 2019 13:28:45 +0800 Subject: [PATCH 1/4] Update swagger_to_sdk_config.json --- swagger_to_sdk_config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swagger_to_sdk_config.json b/swagger_to_sdk_config.json index a4f763911359..399fe6789da5 100644 --- a/swagger_to_sdk_config.json +++ b/swagger_to_sdk_config.json @@ -5,7 +5,7 @@ "typescript": "", "license-header": "MICROSOFT_MIT_NO_VERSION", "sdkrel:typescript-sdks-folder": ".", - "use": "@microsoft.azure/autorest.typescript@4.1.1" + "use": "@microsoft.azure/autorest.typescript@4.2.2" }, "advanced_options": { "clone_dir": "./azure-sdk-for-js", From be583e41b9d1d90a0302d8468afacd475bada73c Mon Sep 17 00:00:00 2001 From: Phoenix He Date: Thu, 24 Oct 2019 14:40:18 +0800 Subject: [PATCH 2/4] Update swagger_to_sdk_config.json --- swagger_to_sdk_config.json | 1 + 1 file changed, 1 insertion(+) diff --git a/swagger_to_sdk_config.json b/swagger_to_sdk_config.json index 399fe6789da5..b8a4c993ce88 100644 --- a/swagger_to_sdk_config.json +++ b/swagger_to_sdk_config.json @@ -5,6 +5,7 @@ "typescript": "", "license-header": "MICROSOFT_MIT_NO_VERSION", "sdkrel:typescript-sdks-folder": ".", + "go.clear-output-folder": "", "use": "@microsoft.azure/autorest.typescript@4.2.2" }, "advanced_options": { From c9511411cee2cb98d6bd53a8deae2c47a3e7c284 Mon Sep 17 00:00:00 2001 From: Phoenix He Date: Thu, 24 Oct 2019 14:49:49 +0800 Subject: [PATCH 3/4] Update swagger_to_sdk_config.json --- swagger_to_sdk_config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swagger_to_sdk_config.json b/swagger_to_sdk_config.json index b8a4c993ce88..0387101043cb 100644 --- a/swagger_to_sdk_config.json +++ b/swagger_to_sdk_config.json @@ -5,7 +5,7 @@ "typescript": "", "license-header": "MICROSOFT_MIT_NO_VERSION", "sdkrel:typescript-sdks-folder": ".", - "go.clear-output-folder": "", + "typescript.clear-output-folder": "", "use": "@microsoft.azure/autorest.typescript@4.2.2" }, "advanced_options": { From 4d3fb6e20047e4035c97e2f0ebae51c59e2ec8bc Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Fri, 25 Oct 2019 10:38:55 +0000 Subject: [PATCH 4/4] Generated from a71df15a587ec060147aaef2dcfc12d19500fdc8 Fix json format by prettier --- .../arm-resources/src/models/index.ts | 20 ++++ .../src/operations/resourceGroups.ts | 99 +++++++++---------- .../src/resourceManagementClientContext.ts | 2 +- 3 files changed, 70 insertions(+), 51 deletions(-) diff --git a/sdk/resources/arm-resources/src/models/index.ts b/sdk/resources/arm-resources/src/models/index.ts index f5faeb25a2e2..48a27dd7e52d 100644 --- a/sdk/resources/arm-resources/src/models/index.ts +++ b/sdk/resources/arm-resources/src/models/index.ts @@ -3092,6 +3092,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. */ 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/resourceManagementClientContext.ts b/sdk/resources/arm-resources/src/resourceManagementClientContext.ts index 1dc03c3fa11f..666af90b31ae 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-08-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";