From f94450c25364b485a83749427bd2d973200afebc Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 28 Dec 2020 08:02:37 +0000 Subject: [PATCH] CodeGen from PR 12162 in Azure/azure-rest-api-specs Swagger Linting Fix (#12162) * Fix Linting Issuing * no message * fix description * add description and object back * test to resolve model validation test (cherry picked from commit ab273dfc0d5897683c128ee15da4babafa7a85ba) --- .../arm-powerbidedicated/README.md | 9 +++---- .../arm-powerbidedicated/rollup.config.js | 4 +-- .../src/models/capacitiesMappers.ts | 7 ++--- .../arm-powerbidedicated/src/models/index.ts | 18 ++++++++++--- .../src/models/mappers.ts | 27 +++++++++++++++---- .../src/models/operationsMappers.ts | 5 ++-- .../src/models/parameters.ts | 5 ++-- .../src/operations/capacities.ts | 27 +++++++++---------- .../src/operations/index.ts | 5 ++-- .../src/operations/operations.ts | 8 +++--- .../src/powerBIDedicatedManagementClient.ts | 5 ++-- ...powerBIDedicatedManagementClientContext.ts | 5 ++-- 12 files changed, 75 insertions(+), 50 deletions(-) diff --git a/sdk/powerbidedicated/arm-powerbidedicated/README.md b/sdk/powerbidedicated/arm-powerbidedicated/README.md index e213b7d8b506..97e11c6ccf2d 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/README.md +++ b/sdk/powerbidedicated/arm-powerbidedicated/README.md @@ -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 @@ -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) => { diff --git a/sdk/powerbidedicated/arm-powerbidedicated/rollup.config.js b/sdk/powerbidedicated/arm-powerbidedicated/rollup.config.js index 0d8f15137d00..441dae3f4882 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/rollup.config.js +++ b/sdk/powerbidedicated/arm-powerbidedicated/rollup.config.js @@ -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. diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/models/capacitiesMappers.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/models/capacitiesMappers.ts index ef2cac8815a4..3601cb29cde3 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/models/capacitiesMappers.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/models/capacitiesMappers.ts @@ -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. @@ -10,11 +10,12 @@ export { BaseResource, CheckCapacityNameAvailabilityParameters, CheckCapacityNameAvailabilityResult, - CloudError, DedicatedCapacities, DedicatedCapacity, DedicatedCapacityAdministrators, DedicatedCapacityUpdateParameters, + ErrorResponse, + ErrorResponseError, Resource, ResourceSku, SkuDetailsForExistingResource, diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/models/index.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/models/index.ts index 3aa64f0a6c40..432f6767916a 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/models/index.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/models/index.ts @@ -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. @@ -180,9 +180,9 @@ export interface SkuEnumerationForExistingResourceResult { } /** - * Describes the format of Error response. + * The error object */ -export interface ErrorResponse { +export interface ErrorResponseError { /** * Error code */ @@ -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. */ diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/models/mappers.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/models/mappers.ts index ca7783976708..a5558d9d5b34 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/models/mappers.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/models/mappers.ts @@ -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. @@ -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", @@ -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: { diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/models/operationsMappers.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/models/operationsMappers.ts index b8de8606cf9d..ba8142bc9cac 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/models/operationsMappers.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/models/operationsMappers.ts @@ -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. @@ -8,6 +8,7 @@ export { ErrorResponse, + ErrorResponseError, Operation, OperationDisplay, OperationListResult diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/models/parameters.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/models/parameters.ts index aab9f450d3c9..15441faac515 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/models/parameters.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/models/parameters.ts @@ -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 diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/operations/capacities.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/operations/capacities.ts index 6ee0c567a035..f54c427377ea 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/operations/capacities.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/operations/capacities.ts @@ -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 @@ -414,7 +413,7 @@ const getDetailsOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.DedicatedCapacity }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -438,7 +437,7 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.DedicatedCapacities }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -461,7 +460,7 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.DedicatedCapacities }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -484,7 +483,7 @@ const listSkusOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.SkuEnumerationForNewResourceResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -509,7 +508,7 @@ const listSkusForCapacityOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.SkuEnumerationForExistingResourceResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -540,7 +539,7 @@ const checkNameAvailabilityOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CheckCapacityNameAvailabilityResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -575,7 +574,7 @@ const beginCreateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.DedicatedCapacity }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -600,7 +599,7 @@ const beginDeleteMethodOperationSpec: msRest.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -635,7 +634,7 @@ const beginUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.DedicatedCapacity }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -659,7 +658,7 @@ const beginSuspendOperationSpec: msRest.OperationSpec = { 200: {}, 202: {}, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -683,7 +682,7 @@ const beginResumeOperationSpec: msRest.OperationSpec = { 200: {}, 202: {}, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorResponse } }, serializer diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/operations/index.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/operations/index.ts index e7087b2e4304..42c3db9da266 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/operations/index.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/operations/index.ts @@ -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 diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/operations/operations.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/operations/operations.ts index 0276fc881dc3..e59ae2b459ae 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/operations/operations.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/operations/operations.ts @@ -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 @@ -108,6 +107,9 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/powerBIDedicatedManagementClient.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/powerBIDedicatedManagementClient.ts index 33c72336bac6..9b28b91cb5f6 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/powerBIDedicatedManagementClient.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/powerBIDedicatedManagementClient.ts @@ -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 diff --git a/sdk/powerbidedicated/arm-powerbidedicated/src/powerBIDedicatedManagementClientContext.ts b/sdk/powerbidedicated/arm-powerbidedicated/src/powerBIDedicatedManagementClientContext.ts index 8c2c324a10d1..f2a2a2fa2d25 100644 --- a/sdk/powerbidedicated/arm-powerbidedicated/src/powerBIDedicatedManagementClientContext.ts +++ b/sdk/powerbidedicated/arm-powerbidedicated/src/powerBIDedicatedManagementClientContext.ts @@ -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