From 9a3d9565438037b5962bf11e252ffe81ae15ca71 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 20 Jun 2018 05:11:07 +0000 Subject: [PATCH] Generated from 098c87d37f661c1aa51916e5dd2026aa1902c806 Fix contract for Error in OperationResultContract --- .../lib/models/errorResponseBody.js | 80 +++++++++++++++++++ .../apimanagement/lib/models/index.d.ts | 20 ++++- .../apimanagement/lib/models/index.js | 1 + .../lib/models/operationResultContract.js | 2 +- 4 files changed, 101 insertions(+), 2 deletions(-) create mode 100644 lib/services/apimanagement/lib/models/errorResponseBody.js diff --git a/lib/services/apimanagement/lib/models/errorResponseBody.js b/lib/services/apimanagement/lib/models/errorResponseBody.js new file mode 100644 index 0000000000..f9a0d6a597 --- /dev/null +++ b/lib/services/apimanagement/lib/models/errorResponseBody.js @@ -0,0 +1,80 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Error Body contract. + * + */ +class ErrorResponseBody { + /** + * Create a ErrorResponseBody. + * @member {string} [code] Service-defined error code. This code serves as a + * sub-status for the HTTP error code specified in the response. + * @member {string} [message] Human-readable representation of the error. + * @member {array} [details] The list of invalid fields send in request, in + * case of validation error. + */ + constructor() { + } + + /** + * Defines the metadata of ErrorResponseBody + * + * @returns {object} metadata of ErrorResponseBody + * + */ + mapper() { + return { + required: false, + serializedName: 'ErrorResponseBody', + type: { + name: 'Composite', + className: 'ErrorResponseBody', + modelProperties: { + code: { + required: false, + serializedName: 'code', + type: { + name: 'String' + } + }, + message: { + required: false, + serializedName: 'message', + type: { + name: 'String' + } + }, + details: { + required: false, + serializedName: 'details', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ErrorFieldContractElementType', + type: { + name: 'Composite', + className: 'ErrorFieldContract' + } + } + } + } + } + } + }; + } +} + +module.exports = ErrorResponseBody; diff --git a/lib/services/apimanagement/lib/models/index.d.ts b/lib/services/apimanagement/lib/models/index.d.ts index 6e87acd473..47e251908e 100644 --- a/lib/services/apimanagement/lib/models/index.d.ts +++ b/lib/services/apimanagement/lib/models/index.d.ts @@ -33,6 +33,24 @@ export interface ErrorFieldContract { target?: string; } +/** + * @class + * Initializes a new instance of the ErrorResponseBody class. + * @constructor + * Error Body contract. + * + * @member {string} [code] Service-defined error code. This code serves as a + * sub-status for the HTTP error code specified in the response. + * @member {string} [message] Human-readable representation of the error. + * @member {array} [details] The list of invalid fields send in request, in + * case of validation error. + */ +export interface ErrorResponseBody { + code?: string; + message?: string; + details?: ErrorFieldContract[]; +} + /** * @class * Initializes a new instance of the ErrorResponse class. @@ -3644,7 +3662,7 @@ export interface OperationResultContract { started?: Date; updated?: Date; resultInfo?: string; - error?: ErrorResponse; + error?: ErrorResponseBody; readonly actionLog?: OperationResultLogItemContract[]; } diff --git a/lib/services/apimanagement/lib/models/index.js b/lib/services/apimanagement/lib/models/index.js index b9fcf111c0..4ff350f27d 100644 --- a/lib/services/apimanagement/lib/models/index.js +++ b/lib/services/apimanagement/lib/models/index.js @@ -19,6 +19,7 @@ var msRestAzure = require('ms-rest-azure'); exports.BaseResource = msRestAzure.BaseResource; exports.CloudError = msRestAzure.CloudError; exports.ErrorFieldContract = require('./errorFieldContract'); +exports.ErrorResponseBody = require('./errorResponseBody'); exports.ErrorResponse = require('./errorResponse'); exports.Resource = require('./resource'); exports.PolicyContract = require('./policyContract'); diff --git a/lib/services/apimanagement/lib/models/operationResultContract.js b/lib/services/apimanagement/lib/models/operationResultContract.js index 180a5244e3..75fbe9f977 100644 --- a/lib/services/apimanagement/lib/models/operationResultContract.js +++ b/lib/services/apimanagement/lib/models/operationResultContract.js @@ -99,7 +99,7 @@ class OperationResultContract { serializedName: 'error', type: { name: 'Composite', - className: 'ErrorResponse' + className: 'ErrorResponseBody' } }, actionLog: {