Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

[AutoPR apimanagement/resource-manager] Fix contract for Error in OperationResultContract #3033

Merged
Merged
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
80 changes: 80 additions & 0 deletions lib/services/apimanagement/lib/models/errorResponseBody.js
Original file line number Diff line number Diff line change
@@ -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;
20 changes: 19 additions & 1 deletion lib/services/apimanagement/lib/models/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -3644,7 +3662,7 @@ export interface OperationResultContract {
started?: Date;
updated?: Date;
resultInfo?: string;
error?: ErrorResponse;
error?: ErrorResponseBody;
readonly actionLog?: OperationResultLogItemContract[];
}

Expand Down
1 change: 1 addition & 0 deletions lib/services/apimanagement/lib/models/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class OperationResultContract {
serializedName: 'error',
type: {
name: 'Composite',
className: 'ErrorResponse'
className: 'ErrorResponseBody'
}
},
actionLog: {
Expand Down