Skip to content

Commit

Permalink
CodeGen from PR 12162 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Swagger Linting Fix (Azure#12162)

* Fix Linting Issuing

* no message

* fix description

* add description and object back

* test to resolve model validation test

(cherry picked from commit ab273dfc0d5897683c128ee15da4babafa7a85ba)
  • Loading branch information
SDKAuto committed Dec 28, 2020
1 parent 1a9d083 commit f94450c
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 50 deletions.
9 changes: 4 additions & 5 deletions sdk/powerbidedicated/arm-powerbidedicated/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ npm install @azure/arm-powerbidedicated

### How to use

#### nodejs - Authentication, client creation and getDetails capacities as an example written in TypeScript.
#### nodejs - client creation and getDetails capacities as an example written in TypeScript.

##### Install @azure/ms-rest-nodeauth

Expand All @@ -26,11 +26,10 @@ npm install @azure/ms-rest-nodeauth@"^3.0.0"

##### Sample code

While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package
```typescript
import * as msRest from "@azure/ms-rest-js";
import * as msRestAzure from "@azure/ms-rest-azure-js";
import * as msRestNodeAuth from "@azure/ms-rest-nodeauth";
import { PowerBIDedicatedManagementClient, PowerBIDedicatedManagementModels, PowerBIDedicatedManagementMappers } from "@azure/arm-powerbidedicated";
const msRestNodeAuth = require("@azure/ms-rest-nodeauth");
const { PowerBIDedicatedManagementClient } = require("@azure/arm-powerbidedicated");
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];

msRestNodeAuth.interactiveLogin().then((creds) => {
Expand Down
4 changes: 2 additions & 2 deletions sdk/powerbidedicated/arm-powerbidedicated/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const config = {
"@azure/ms-rest-azure-js": "msRestAzure"
},
banner: `/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand All @@ -10,11 +10,12 @@ export {
BaseResource,
CheckCapacityNameAvailabilityParameters,
CheckCapacityNameAvailabilityResult,
CloudError,
DedicatedCapacities,
DedicatedCapacity,
DedicatedCapacityAdministrators,
DedicatedCapacityUpdateParameters,
ErrorResponse,
ErrorResponseError,
Resource,
ResourceSku,
SkuDetailsForExistingResource,
Expand Down
18 changes: 14 additions & 4 deletions sdk/powerbidedicated/arm-powerbidedicated/src/models/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down Expand Up @@ -180,9 +180,9 @@ export interface SkuEnumerationForExistingResourceResult {
}

/**
* Describes the format of Error response.
* The error object
*/
export interface ErrorResponse {
export interface ErrorResponseError {
/**
* Error code
*/
Expand All @@ -193,6 +193,16 @@ export interface ErrorResponse {
message?: string;
}

/**
* Describes the format of Error response.
*/
export interface ErrorResponse {
/**
* The error object
*/
error?: ErrorResponseError;
}

/**
* Details of capacity name request body.
*/
Expand Down
27 changes: 22 additions & 5 deletions sdk/powerbidedicated/arm-powerbidedicated/src/models/mappers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down Expand Up @@ -296,11 +296,11 @@ export const SkuEnumerationForExistingResourceResult: msRest.CompositeMapper = {
}
};

export const ErrorResponse: msRest.CompositeMapper = {
serializedName: "ErrorResponse",
export const ErrorResponseError: msRest.CompositeMapper = {
serializedName: "ErrorResponse_error",
type: {
name: "Composite",
className: "ErrorResponse",
className: "ErrorResponseError",
modelProperties: {
code: {
serializedName: "code",
Expand All @@ -318,6 +318,23 @@ export const ErrorResponse: msRest.CompositeMapper = {
}
};

export const ErrorResponse: msRest.CompositeMapper = {
serializedName: "ErrorResponse",
type: {
name: "Composite",
className: "ErrorResponse",
modelProperties: {
error: {
serializedName: "error",
type: {
name: "Composite",
className: "ErrorResponseError"
}
}
}
}
};

export const CheckCapacityNameAvailabilityParameters: msRest.CompositeMapper = {
serializedName: "CheckCapacityNameAvailabilityParameters",
type: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/

export {
ErrorResponse,
ErrorResponseError,
Operation,
OperationDisplay,
OperationListResult
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
Expand Down Expand Up @@ -414,7 +413,7 @@ const getDetailsOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.DedicatedCapacity
},
default: {
bodyMapper: Mappers.CloudError
bodyMapper: Mappers.ErrorResponse
}
},
serializer
Expand All @@ -438,7 +437,7 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.DedicatedCapacities
},
default: {
bodyMapper: Mappers.CloudError
bodyMapper: Mappers.ErrorResponse
}
},
serializer
Expand All @@ -461,7 +460,7 @@ const listOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.DedicatedCapacities
},
default: {
bodyMapper: Mappers.CloudError
bodyMapper: Mappers.ErrorResponse
}
},
serializer
Expand All @@ -484,7 +483,7 @@ const listSkusOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.SkuEnumerationForNewResourceResult
},
default: {
bodyMapper: Mappers.CloudError
bodyMapper: Mappers.ErrorResponse
}
},
serializer
Expand All @@ -509,7 +508,7 @@ const listSkusForCapacityOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.SkuEnumerationForExistingResourceResult
},
default: {
bodyMapper: Mappers.CloudError
bodyMapper: Mappers.ErrorResponse
}
},
serializer
Expand Down Expand Up @@ -540,7 +539,7 @@ const checkNameAvailabilityOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.CheckCapacityNameAvailabilityResult
},
default: {
bodyMapper: Mappers.CloudError
bodyMapper: Mappers.ErrorResponse
}
},
serializer
Expand Down Expand Up @@ -575,7 +574,7 @@ const beginCreateOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.DedicatedCapacity
},
default: {
bodyMapper: Mappers.CloudError
bodyMapper: Mappers.ErrorResponse
}
},
serializer
Expand All @@ -600,7 +599,7 @@ const beginDeleteMethodOperationSpec: msRest.OperationSpec = {
202: {},
204: {},
default: {
bodyMapper: Mappers.CloudError
bodyMapper: Mappers.ErrorResponse
}
},
serializer
Expand Down Expand Up @@ -635,7 +634,7 @@ const beginUpdateOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.DedicatedCapacity
},
default: {
bodyMapper: Mappers.CloudError
bodyMapper: Mappers.ErrorResponse
}
},
serializer
Expand All @@ -659,7 +658,7 @@ const beginSuspendOperationSpec: msRest.OperationSpec = {
200: {},
202: {},
default: {
bodyMapper: Mappers.CloudError
bodyMapper: Mappers.ErrorResponse
}
},
serializer
Expand All @@ -683,7 +682,7 @@ const beginResumeOperationSpec: msRest.OperationSpec = {
200: {},
202: {},
default: {
bodyMapper: Mappers.CloudError
bodyMapper: Mappers.ErrorResponse
}
},
serializer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
Expand Down Expand Up @@ -108,6 +107,9 @@ const listNextOperationSpec: msRest.OperationSpec = {
urlParameters: [
Parameters.nextPageLink
],
queryParameters: [
Parameters.apiVersion
],
headerParameters: [
Parameters.acceptLanguage
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
Expand Down

0 comments on commit f94450c

Please sign in to comment.