Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR @azure/arm-resources] Fix json format by prettier #61

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions sdk/resources/arm-resources/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
99 changes: 49 additions & 50 deletions sdk/resources/arm-resources/src/operations/resourceGroups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Models.ResourceGroupsExportTemplateResponse>
*/
exportTemplate(resourceGroupName: string, parameters: Models.ExportTemplateRequest, options?: msRest.RequestOptionsBase): Promise<Models.ResourceGroupsExportTemplateResponse>;
/**
* @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<Models.ResourceGroupExportResult>): 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<Models.ResourceGroupExportResult>): void;
exportTemplate(resourceGroupName: string, parameters: Models.ExportTemplateRequest, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.ResourceGroupExportResult>, callback?: msRest.ServiceCallback<Models.ResourceGroupExportResult>): Promise<Models.ResourceGroupsExportTemplateResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
parameters,
options
},
exportTemplateOperationSpec,
callback) as Promise<Models.ResourceGroupsExportTemplateResponse>;
exportTemplate(resourceGroupName: string, parameters: Models.ExportTemplateRequest, options?: msRest.RequestOptionsBase): Promise<Models.ResourceGroupsExportTemplateResponse> {
return this.beginExportTemplate(resourceGroupName,parameters,options)
.then(lroPoller => lroPoller.pollUntilFinished()) as Promise<Models.ResourceGroupsExportTemplateResponse>;
}

/**
Expand Down Expand Up @@ -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<msRestAzure.LROPoller>
*/
beginExportTemplate(resourceGroupName: string, parameters: Models.ExportTemplateRequest, options?: msRest.RequestOptionsBase): Promise<msRestAzure.LROPoller> {
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.
Expand Down Expand Up @@ -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
Expand All @@ -417,46 +409,53 @@ 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
}
},
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
],
headerParameters: [
Parameters.acceptLanguage
],
requestBody: {
parameterPath: "parameters",
mapper: {
...Mappers.ExportTemplateRequest,
required: true
}
},
responses: {
200: {},
200: {
bodyMapper: Mappers.ResourceGroupExportResult
},
202: {},
default: {
bodyMapper: Mappers.CloudError
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
3 changes: 2 additions & 1 deletion swagger_to_sdk_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"typescript": "",
"license-header": "MICROSOFT_MIT_NO_VERSION",
"sdkrel:typescript-sdks-folder": ".",
"use": "@microsoft.azure/autorest.typescript@4.1.1"
"typescript.clear-output-folder": "",
"use": "@microsoft.azure/autorest.typescript@4.2.2"
},
"advanced_options": {
"clone_dir": "./azure-sdk-for-js",
Expand Down