From ed5deda2c3d88bd8d04a51c84fece5993160ebb2 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 5 Jul 2018 23:44:15 +0000 Subject: [PATCH 1/2] Generated from e8a0ed15963c97d38222e26f451052219c790fdc nit fixes: Remove 4xx responses and schema to file --- .../lib/models/index.d.ts | 120 +++++++++--------- .../automationManagement/lib/models/index.js | 8 +- .../operations/connectionTypeOperations.js | 19 +-- .../lib/operations/index.d.ts | 93 +++++++------- .../lib/operations/jobOperations.js | 93 ++++---------- .../lib/operations/runbookDraftOperations.js | 106 +++++----------- .../lib/operations/runbookOperations.js | 44 ++----- .../lib/operations/scheduleOperations.js | 2 +- 8 files changed, 180 insertions(+), 305 deletions(-) diff --git a/lib/services/automationManagement/lib/models/index.d.ts b/lib/services/automationManagement/lib/models/index.d.ts index 09653aae3f..636ac5d545 100644 --- a/lib/services/automationManagement/lib/models/index.d.ts +++ b/lib/services/automationManagement/lib/models/index.d.ts @@ -18,17 +18,19 @@ export { CloudError } from 'ms-rest-azure'; /** * @class - * Initializes a new instance of the ErrorResponse class. + * Initializes a new instance of the Sku class. * @constructor - * Error response of an operation failure + * The account SKU. * - * @member {string} [code] Error code - * @member {string} [message] Error message indicating why the operation - * failed. + * @member {string} name Gets or sets the SKU name of the account. Possible + * values include: 'Free', 'Basic' + * @member {string} [family] Gets or sets the SKU family. + * @member {number} [capacity] Gets or sets the SKU capacity. */ -export interface ErrorResponse { - code?: string; - message?: string; +export interface Sku { + name: string; + family?: string; + capacity?: number; } /** @@ -61,33 +63,6 @@ export interface TrackedResource extends Resource { location?: string; } -/** - * @class - * Initializes a new instance of the ProxyResource class. - * @constructor - * ARM proxy resource. - * - */ -export interface ProxyResource extends Resource { -} - -/** - * @class - * Initializes a new instance of the Sku class. - * @constructor - * The account SKU. - * - * @member {string} name Gets or sets the SKU name of the account. Possible - * values include: 'Free', 'Basic' - * @member {string} [family] Gets or sets the SKU family. - * @member {number} [capacity] Gets or sets the SKU capacity. - */ -export interface Sku { - name: string; - family?: string; - capacity?: number; -} - /** * @class * Initializes a new instance of the AutomationAccount class. @@ -286,6 +261,31 @@ export interface AutomationAccountUpdateParameters { tags?: { [propertyName: string]: string }; } +/** + * @class + * Initializes a new instance of the ProxyResource class. + * @constructor + * ARM proxy resource. + * + */ +export interface ProxyResource extends Resource { +} + +/** + * @class + * Initializes a new instance of the ErrorResponse class. + * @constructor + * Error response of an operation failure + * + * @member {string} [code] Error code + * @member {string} [message] Error message indicating why the operation + * failed. + */ +export interface ErrorResponse { + code?: string; + message?: string; +} + /** * @class * Initializes a new instance of the CertificateCreateOrUpdateParameters class. @@ -1148,31 +1148,6 @@ export interface TypeField { type?: string; } -/** - * @class - * Initializes a new instance of the JobStream class. - * @constructor - * Definition of the job stream. - * - * @member {string} [id] Gets or sets the id of the resource. - * @member {string} [jobStreamId] Gets or sets the id of the job stream. - * @member {date} [time] Gets or sets the creation time of the job. - * @member {string} [streamType] Gets or sets the stream type. Possible values - * include: 'Progress', 'Output', 'Warning', 'Error', 'Debug', 'Verbose', 'Any' - * @member {string} [streamText] Gets or sets the stream text. - * @member {string} [summary] Gets or sets the summary. - * @member {object} [value] Gets or sets the values of the job stream. - */ -export interface JobStream { - id?: string; - jobStreamId?: string; - time?: Date; - streamType?: string; - streamText?: string; - summary?: string; - value?: { [propertyName: string]: any }; -} - /** * @class * Initializes a new instance of the RunbookParameter class. @@ -1525,6 +1500,31 @@ export interface RunbookCreateOrUpdateDraftParameters { runbookContent: string; } +/** + * @class + * Initializes a new instance of the JobStream class. + * @constructor + * Definition of the job stream. + * + * @member {string} [id] Gets or sets the id of the resource. + * @member {string} [jobStreamId] Gets or sets the id of the job stream. + * @member {date} [time] Gets or sets the creation time of the job. + * @member {string} [streamType] Gets or sets the stream type. Possible values + * include: 'Progress', 'Output', 'Warning', 'Error', 'Debug', 'Verbose', 'Any' + * @member {string} [streamText] Gets or sets the stream text. + * @member {string} [summary] Gets or sets the summary. + * @member {object} [value] Gets or sets the values of the job stream. + */ +export interface JobStream { + id?: string; + jobStreamId?: string; + time?: Date; + streamType?: string; + streamText?: string; + summary?: string; + value?: { [propertyName: string]: any }; +} + /** * @class * Initializes a new instance of the AdvancedScheduleMonthlyOccurrence class. diff --git a/lib/services/automationManagement/lib/models/index.js b/lib/services/automationManagement/lib/models/index.js index 8563572b4d..450c7f4b5d 100644 --- a/lib/services/automationManagement/lib/models/index.js +++ b/lib/services/automationManagement/lib/models/index.js @@ -18,11 +18,9 @@ var msRestAzure = require('ms-rest-azure'); exports.BaseResource = msRestAzure.BaseResource; exports.CloudError = msRestAzure.CloudError; -exports.ErrorResponse = require('./errorResponse'); +exports.Sku = require('./sku'); exports.Resource = require('./resource'); exports.TrackedResource = require('./trackedResource'); -exports.ProxyResource = require('./proxyResource'); -exports.Sku = require('./sku'); exports.AutomationAccount = require('./automationAccount'); exports.AutomationAccountCreateOrUpdateParameters = require('./automationAccountCreateOrUpdateParameters'); exports.OperationDisplay = require('./operationDisplay'); @@ -33,6 +31,8 @@ exports.Usage = require('./usage'); exports.Key = require('./key'); exports.KeyListResult = require('./keyListResult'); exports.AutomationAccountUpdateParameters = require('./automationAccountUpdateParameters'); +exports.ProxyResource = require('./proxyResource'); +exports.ErrorResponse = require('./errorResponse'); exports.CertificateCreateOrUpdateParameters = require('./certificateCreateOrUpdateParameters'); exports.Certificate = require('./certificate'); exports.CertificateUpdateParameters = require('./certificateUpdateParameters'); @@ -72,7 +72,6 @@ exports.Module = require('./module'); exports.ModuleCreateOrUpdateParameters = require('./moduleCreateOrUpdateParameters'); exports.ModuleUpdateParameters = require('./moduleUpdateParameters'); exports.TypeField = require('./typeField'); -exports.JobStream = require('./jobStream'); exports.RunbookParameter = require('./runbookParameter'); exports.RunbookDraft = require('./runbookDraft'); exports.Runbook = require('./runbook'); @@ -83,6 +82,7 @@ exports.TestJobCreateParameters = require('./testJobCreateParameters'); exports.TestJob = require('./testJob'); exports.RunbookCreateOrUpdateDraftProperties = require('./runbookCreateOrUpdateDraftProperties'); exports.RunbookCreateOrUpdateDraftParameters = require('./runbookCreateOrUpdateDraftParameters'); +exports.JobStream = require('./jobStream'); exports.AdvancedScheduleMonthlyOccurrence = require('./advancedScheduleMonthlyOccurrence'); exports.AdvancedSchedule = require('./advancedSchedule'); exports.ScheduleCreateOrUpdateParameters = require('./scheduleCreateOrUpdateParameters'); diff --git a/lib/services/automationManagement/lib/operations/connectionTypeOperations.js b/lib/services/automationManagement/lib/operations/connectionTypeOperations.js index 33fa0617b0..1be228235b 100644 --- a/lib/services/automationManagement/lib/operations/connectionTypeOperations.js +++ b/lib/services/automationManagement/lib/operations/connectionTypeOperations.js @@ -467,7 +467,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, connectionTyp return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 409) { + if (statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -513,23 +513,6 @@ function _createOrUpdate(resourceGroupName, automationAccountName, connectionTyp return callback(deserializationError); } } - // Deserialize Response - if (statusCode === 409) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ConnectionType']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } return callback(null, result, httpRequest, response); }); diff --git a/lib/services/automationManagement/lib/operations/index.d.ts b/lib/services/automationManagement/lib/operations/index.d.ts index 42cb8888bd..9b75781638 100644 --- a/lib/services/automationManagement/lib/operations/index.d.ts +++ b/lib/services/automationManagement/lib/operations/index.d.ts @@ -9,6 +9,7 @@ */ import { ServiceClientOptions, RequestOptions, ServiceCallback, HttpOperationResponse } from 'ms-rest'; +import * as stream from 'stream'; import * as models from '../models'; @@ -4784,11 +4785,11 @@ export interface RunbookDraftOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getContentWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getContentWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Retrieve the content of runbook draft identified by runbook name. @@ -4811,7 +4812,7 @@ export interface RunbookDraftOperations { * * {Promise} A promise is returned. * - * @resolve {String} - The deserialized result object. + * @resolve {Object} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4819,15 +4820,15 @@ export interface RunbookDraftOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {String} [result] - The deserialized result object if an error did not occur. + * {Object} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getContent(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getContent(resourceGroupName: string, automationAccountName: string, runbookName: string, callback: ServiceCallback): void; - getContent(resourceGroupName: string, automationAccountName: string, runbookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getContent(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getContent(resourceGroupName: string, automationAccountName: string, runbookName: string, callback: ServiceCallback): void; + getContent(resourceGroupName: string, automationAccountName: string, runbookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -4839,7 +4840,7 @@ export interface RunbookDraftOperations { * * @param {string} runbookName The runbook name. * - * @param {string} runbookContent The runbook draft content. + * @param {string} runbookContent The runbook draft content. * * @param {object} [options] Optional Parameters. * @@ -4848,11 +4849,11 @@ export interface RunbookDraftOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - replaceContentWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, runbookName: string, runbookContent: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + replaceContentWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, runbookName: string, runbookContent: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Replaces the runbook draft content. @@ -4863,7 +4864,7 @@ export interface RunbookDraftOperations { * * @param {string} runbookName The runbook name. * - * @param {string} runbookContent The runbook draft content. + * @param {string} runbookContent The runbook draft content. * * @param {object} [options] Optional Parameters. * @@ -4877,7 +4878,7 @@ export interface RunbookDraftOperations { * * {Promise} A promise is returned. * - * @resolve {String} - The deserialized result object. + * @resolve {Object} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4885,15 +4886,15 @@ export interface RunbookDraftOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {String} [result] - The deserialized result object if an error did not occur. + * {Object} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - replaceContent(resourceGroupName: string, automationAccountName: string, runbookName: string, runbookContent: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - replaceContent(resourceGroupName: string, automationAccountName: string, runbookName: string, runbookContent: string, callback: ServiceCallback): void; - replaceContent(resourceGroupName: string, automationAccountName: string, runbookName: string, runbookContent: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + replaceContent(resourceGroupName: string, automationAccountName: string, runbookName: string, runbookContent: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + replaceContent(resourceGroupName: string, automationAccountName: string, runbookName: string, runbookContent: string, callback: ServiceCallback): void; + replaceContent(resourceGroupName: string, automationAccountName: string, runbookName: string, runbookContent: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -5096,7 +5097,7 @@ export interface RunbookDraftOperations { * * @param {string} runbookName The runbook name. * - * @param {string} runbookContent The runbook draft content. + * @param {string} runbookContent The runbook draft content. * * @param {object} [options] Optional Parameters. * @@ -5105,11 +5106,11 @@ export interface RunbookDraftOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginReplaceContentWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, runbookName: string, runbookContent: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginReplaceContentWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, runbookName: string, runbookContent: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Replaces the runbook draft content. @@ -5120,7 +5121,7 @@ export interface RunbookDraftOperations { * * @param {string} runbookName The runbook name. * - * @param {string} runbookContent The runbook draft content. + * @param {string} runbookContent The runbook draft content. * * @param {object} [options] Optional Parameters. * @@ -5134,7 +5135,7 @@ export interface RunbookDraftOperations { * * {Promise} A promise is returned. * - * @resolve {String} - The deserialized result object. + * @resolve {Object} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5142,15 +5143,15 @@ export interface RunbookDraftOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {String} [result] - The deserialized result object if an error did not occur. + * {Object} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginReplaceContent(resourceGroupName: string, automationAccountName: string, runbookName: string, runbookContent: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginReplaceContent(resourceGroupName: string, automationAccountName: string, runbookName: string, runbookContent: string, callback: ServiceCallback): void; - beginReplaceContent(resourceGroupName: string, automationAccountName: string, runbookName: string, runbookContent: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginReplaceContent(resourceGroupName: string, automationAccountName: string, runbookName: string, runbookContent: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginReplaceContent(resourceGroupName: string, automationAccountName: string, runbookName: string, runbookContent: string, callback: ServiceCallback): void; + beginReplaceContent(resourceGroupName: string, automationAccountName: string, runbookName: string, runbookContent: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -5242,11 +5243,11 @@ export interface RunbookOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getContentWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getContentWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Retrieve the content of runbook identified by runbook name. @@ -5269,7 +5270,7 @@ export interface RunbookOperations { * * {Promise} A promise is returned. * - * @resolve {String} - The deserialized result object. + * @resolve {Object} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5277,15 +5278,15 @@ export interface RunbookOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {String} [result] - The deserialized result object if an error did not occur. + * {Object} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getContent(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getContent(resourceGroupName: string, automationAccountName: string, runbookName: string, callback: ServiceCallback): void; - getContent(resourceGroupName: string, automationAccountName: string, runbookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getContent(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getContent(resourceGroupName: string, automationAccountName: string, runbookName: string, callback: ServiceCallback): void; + getContent(resourceGroupName: string, automationAccountName: string, runbookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -10197,11 +10198,11 @@ export interface JobOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getOutputWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, jobName: string, options?: { clientRequestId? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + getOutputWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, jobName: string, options?: { clientRequestId? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Retrieve the job output identified by job name. @@ -10227,7 +10228,7 @@ export interface JobOperations { * * {Promise} A promise is returned. * - * @resolve {String} - The deserialized result object. + * @resolve {Object} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10235,15 +10236,15 @@ export interface JobOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {String} [result] - The deserialized result object if an error did not occur. + * {Object} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getOutput(resourceGroupName: string, automationAccountName: string, jobName: string, options?: { clientRequestId? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - getOutput(resourceGroupName: string, automationAccountName: string, jobName: string, callback: ServiceCallback): void; - getOutput(resourceGroupName: string, automationAccountName: string, jobName: string, options: { clientRequestId? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getOutput(resourceGroupName: string, automationAccountName: string, jobName: string, options?: { clientRequestId? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + getOutput(resourceGroupName: string, automationAccountName: string, jobName: string, callback: ServiceCallback): void; + getOutput(resourceGroupName: string, automationAccountName: string, jobName: string, options: { clientRequestId? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -10265,11 +10266,11 @@ export interface JobOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getRunbookContentWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, jobName: string, options?: { clientRequestId? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + getRunbookContentWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, jobName: string, options?: { clientRequestId? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Retrieve the runbook content of the job identified by job name. @@ -10295,7 +10296,7 @@ export interface JobOperations { * * {Promise} A promise is returned. * - * @resolve {String} - The deserialized result object. + * @resolve {Object} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10303,15 +10304,15 @@ export interface JobOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {String} [result] - The deserialized result object if an error did not occur. + * {Object} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getRunbookContent(resourceGroupName: string, automationAccountName: string, jobName: string, options?: { clientRequestId? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - getRunbookContent(resourceGroupName: string, automationAccountName: string, jobName: string, callback: ServiceCallback): void; - getRunbookContent(resourceGroupName: string, automationAccountName: string, jobName: string, options: { clientRequestId? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getRunbookContent(resourceGroupName: string, automationAccountName: string, jobName: string, options?: { clientRequestId? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + getRunbookContent(resourceGroupName: string, automationAccountName: string, jobName: string, callback: ServiceCallback): void; + getRunbookContent(resourceGroupName: string, automationAccountName: string, jobName: string, options: { clientRequestId? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** diff --git a/lib/services/automationManagement/lib/operations/jobOperations.js b/lib/services/automationManagement/lib/operations/jobOperations.js index 3960d66031..0058c8681b 100644 --- a/lib/services/automationManagement/lib/operations/jobOperations.js +++ b/lib/services/automationManagement/lib/operations/jobOperations.js @@ -37,7 +37,7 @@ const WebResource = msRest.WebResource; * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -131,20 +131,22 @@ function _getOutput(resourceGroupName, automationAccountName, jobName, options, } httpRequest.body = null; // Send Request + httpRequest.streamedResponse = true; return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } + let statusCode = response.statusCode; if (statusCode !== 200) { - let error = new Error(responseBody); + let error = new Error(`Unexpected status code: ${statusCode}`); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { - parsedErrorResponse = JSON.parse(responseBody); + if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; @@ -161,33 +163,9 @@ function _getOutput(resourceGroupName, automationAccountName, jobName, options, } return callback(error); } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } + // Create Result + let result = response; return callback(null, result, httpRequest, response); }); } @@ -215,7 +193,7 @@ function _getOutput(resourceGroupName, automationAccountName, jobName, options, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -309,27 +287,30 @@ function _getRunbookContent(resourceGroupName, automationAccountName, jobName, o } httpRequest.body = null; // Send Request + httpRequest.streamedResponse = true; return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } + let statusCode = response.statusCode; if (statusCode !== 200) { - let error = new Error(responseBody); + let error = new Error(`Unexpected status code: ${statusCode}`); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { - parsedErrorResponse = JSON.parse(responseBody); + if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -339,33 +320,9 @@ function _getRunbookContent(resourceGroupName, automationAccountName, jobName, o } return callback(error); } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } + // Create Result + let result = response; return callback(null, result, httpRequest, response); }); } @@ -1570,7 +1527,7 @@ class JobOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -1612,7 +1569,7 @@ class JobOperations { * * {Promise} A promise is returned * - * @resolve {String} - The deserialized result object. + * @resolve {Object} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1620,7 +1577,7 @@ class JobOperations { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1665,7 +1622,7 @@ class JobOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -1707,7 +1664,7 @@ class JobOperations { * * {Promise} A promise is returned * - * @resolve {String} - The deserialized result object. + * @resolve {Object} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1715,7 +1672,7 @@ class JobOperations { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * diff --git a/lib/services/automationManagement/lib/operations/runbookDraftOperations.js b/lib/services/automationManagement/lib/operations/runbookDraftOperations.js index 182c2feead..467e9b9337 100644 --- a/lib/services/automationManagement/lib/operations/runbookDraftOperations.js +++ b/lib/services/automationManagement/lib/operations/runbookDraftOperations.js @@ -34,7 +34,7 @@ const WebResource = msRest.WebResource; * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -121,20 +121,22 @@ function _getContent(resourceGroupName, automationAccountName, runbookName, opti } httpRequest.body = null; // Send Request + httpRequest.streamedResponse = true; return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } + let statusCode = response.statusCode; if (statusCode !== 200) { - let error = new Error(responseBody); + let error = new Error(`Unexpected status code: ${statusCode}`); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { - parsedErrorResponse = JSON.parse(responseBody); + if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; @@ -151,33 +153,9 @@ function _getContent(resourceGroupName, automationAccountName, runbookName, opti } return callback(error); } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } + // Create Result + let result = response; return callback(null, result, httpRequest, response); }); } @@ -192,7 +170,7 @@ function _getContent(resourceGroupName, automationAccountName, runbookName, opti * * @param {string} runbookName The runbook name. * - * @param {string} runbookContent The runbook draft content. + * @param {string} runbookContent The runbook draft content. * * @param {object} [options] Optional Parameters. * @@ -205,7 +183,7 @@ function _getContent(resourceGroupName, automationAccountName, runbookName, opti * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -252,7 +230,7 @@ function _replaceContent(resourceGroupName, automationAccountName, runbookName, required: false, serializedName: 'parsedResponse', type: { - name: 'String' + name: 'Stream' } }; result = client.deserialize(resultMapper, parsedResponse, 'result'); @@ -673,7 +651,7 @@ function _undoEdit(resourceGroupName, automationAccountName, runbookName, option * * @param {string} runbookName The runbook name. * - * @param {string} runbookContent The runbook draft content. + * @param {string} runbookContent The runbook draft content. * * @param {object} [options] Optional Parameters. * @@ -686,7 +664,7 @@ function _undoEdit(resourceGroupName, automationAccountName, runbookName, option * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -796,20 +774,22 @@ function _beginReplaceContent(resourceGroupName, automationAccountName, runbookN } httpRequest.body = requestContent; // Send Request + httpRequest.streamedResponse = true; return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } + let statusCode = response.statusCode; if (statusCode !== 200 && statusCode !== 202) { - let error = new Error(responseBody); + let error = new Error(`Unexpected status code: ${statusCode}`); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { - parsedErrorResponse = JSON.parse(responseBody); + if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { let internalError = null; if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; @@ -827,33 +807,9 @@ function _beginReplaceContent(resourceGroupName, automationAccountName, runbookN } return callback(error); } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } + // Create Result + let result = response; return callback(null, result, httpRequest, response); }); } @@ -1038,7 +994,7 @@ class RunbookDraftOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -1077,7 +1033,7 @@ class RunbookDraftOperations { * * {Promise} A promise is returned * - * @resolve {String} - The deserialized result object. + * @resolve {Object} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1085,7 +1041,7 @@ class RunbookDraftOperations { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1120,7 +1076,7 @@ class RunbookDraftOperations { * * @param {string} runbookName The runbook name. * - * @param {string} runbookContent The runbook draft content. + * @param {string} runbookContent The runbook draft content. * * @param {object} [options] Optional Parameters. * @@ -1129,7 +1085,7 @@ class RunbookDraftOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -1156,7 +1112,7 @@ class RunbookDraftOperations { * * @param {string} runbookName The runbook name. * - * @param {string} runbookContent The runbook draft content. + * @param {string} runbookContent The runbook draft content. * * @param {object} [options] Optional Parameters. * @@ -1170,7 +1126,7 @@ class RunbookDraftOperations { * * {Promise} A promise is returned * - * @resolve {String} - The deserialized result object. + * @resolve {Object} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1178,7 +1134,7 @@ class RunbookDraftOperations { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1485,7 +1441,7 @@ class RunbookDraftOperations { * * @param {string} runbookName The runbook name. * - * @param {string} runbookContent The runbook draft content. + * @param {string} runbookContent The runbook draft content. * * @param {object} [options] Optional Parameters. * @@ -1494,7 +1450,7 @@ class RunbookDraftOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -1521,7 +1477,7 @@ class RunbookDraftOperations { * * @param {string} runbookName The runbook name. * - * @param {string} runbookContent The runbook draft content. + * @param {string} runbookContent The runbook draft content. * * @param {object} [options] Optional Parameters. * @@ -1535,7 +1491,7 @@ class RunbookDraftOperations { * * {Promise} A promise is returned * - * @resolve {String} - The deserialized result object. + * @resolve {Object} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1543,7 +1499,7 @@ class RunbookDraftOperations { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * diff --git a/lib/services/automationManagement/lib/operations/runbookOperations.js b/lib/services/automationManagement/lib/operations/runbookOperations.js index 950f0a9d7d..ffa1e1f1ac 100644 --- a/lib/services/automationManagement/lib/operations/runbookOperations.js +++ b/lib/services/automationManagement/lib/operations/runbookOperations.js @@ -34,7 +34,7 @@ const WebResource = msRest.WebResource; * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -121,20 +121,22 @@ function _getContent(resourceGroupName, automationAccountName, runbookName, opti } httpRequest.body = null; // Send Request + httpRequest.streamedResponse = true; return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } + let statusCode = response.statusCode; if (statusCode !== 200) { - let error = new Error(responseBody); + let error = new Error(`Unexpected status code: ${statusCode}`); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { - parsedErrorResponse = JSON.parse(responseBody); + if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; @@ -151,33 +153,9 @@ function _getContent(resourceGroupName, automationAccountName, runbookName, opti } return callback(error); } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } + // Create Result + let result = response; return callback(null, result, httpRequest, response); }); } @@ -540,7 +518,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, runbookName, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201 && statusCode !== 400) { + if (statusCode !== 200 && statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1274,7 +1252,7 @@ class RunbookOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -1313,7 +1291,7 @@ class RunbookOperations { * * {Promise} A promise is returned * - * @resolve {String} - The deserialized result object. + * @resolve {Object} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1321,7 +1299,7 @@ class RunbookOperations { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * diff --git a/lib/services/automationManagement/lib/operations/scheduleOperations.js b/lib/services/automationManagement/lib/operations/scheduleOperations.js index 80d9f81168..ee79faff99 100644 --- a/lib/services/automationManagement/lib/operations/scheduleOperations.js +++ b/lib/services/automationManagement/lib/operations/scheduleOperations.js @@ -179,7 +179,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, scheduleName, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201 && statusCode !== 409) { + if (statusCode !== 200 && statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); From 666254a604a6c9985e6dbdf27c7a3cff58b34028 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 11 Jul 2018 23:55:54 +0000 Subject: [PATCH 2/2] Generated from 8732be5f9bec6cfe96e72f320fb6d0a3bf36ae9d Reverting changes in stable APIs --- .../operations/connectionTypeOperations.js | 19 ++++++++++++++++++- .../lib/operations/runbookOperations.js | 2 +- .../lib/operations/scheduleOperations.js | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/lib/services/automationManagement/lib/operations/connectionTypeOperations.js b/lib/services/automationManagement/lib/operations/connectionTypeOperations.js index 1be228235b..33fa0617b0 100644 --- a/lib/services/automationManagement/lib/operations/connectionTypeOperations.js +++ b/lib/services/automationManagement/lib/operations/connectionTypeOperations.js @@ -467,7 +467,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, connectionTyp return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201) { + if (statusCode !== 201 && statusCode !== 409) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -513,6 +513,23 @@ function _createOrUpdate(resourceGroupName, automationAccountName, connectionTyp return callback(deserializationError); } } + // Deserialize Response + if (statusCode === 409) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ConnectionType']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } return callback(null, result, httpRequest, response); }); diff --git a/lib/services/automationManagement/lib/operations/runbookOperations.js b/lib/services/automationManagement/lib/operations/runbookOperations.js index ffa1e1f1ac..7f15c99528 100644 --- a/lib/services/automationManagement/lib/operations/runbookOperations.js +++ b/lib/services/automationManagement/lib/operations/runbookOperations.js @@ -518,7 +518,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, runbookName, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 400) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); diff --git a/lib/services/automationManagement/lib/operations/scheduleOperations.js b/lib/services/automationManagement/lib/operations/scheduleOperations.js index ee79faff99..80d9f81168 100644 --- a/lib/services/automationManagement/lib/operations/scheduleOperations.js +++ b/lib/services/automationManagement/lib/operations/scheduleOperations.js @@ -179,7 +179,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, scheduleName, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 409) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest);