Skip to content

Commit

Permalink
Generated from 9578d36ef49d11e323741cf0784cdad772bc51fe
Browse files Browse the repository at this point in the history
[IoTCentral] Change error definition
  • Loading branch information
SDK Automation committed Feb 13, 2020
1 parent 5cd8e0f commit d6b5e0f
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 96 deletions.
2 changes: 1 addition & 1 deletion sdk/iotcentral/arm-iotcentral/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2019 Microsoft
Copyright (c) 2020 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 3 additions & 3 deletions sdk/iotcentral/arm-iotcentral/src/iotCentralClientContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class IotCentralClientContext extends msRestAzure.AzureServiceClient {
if (!options) {
options = {};
}
if (!options.userAgent) {
if(!options.userAgent) {
const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
}
Expand All @@ -52,10 +52,10 @@ export class IotCentralClientContext extends msRestAzure.AzureServiceClient {
this.credentials = credentials;
this.subscriptionId = subscriptionId;

if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
this.acceptLanguage = options.acceptLanguage;
}
if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout;
}
}
Expand Down
4 changes: 2 additions & 2 deletions sdk/iotcentral/arm-iotcentral/src/models/appsMappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export {
AppTemplate,
AppTemplatesResult,
BaseResource,
ErrorDetails,
ErrorResponseBody,
CloudError,
CloudErrorResponseBody,
OperationInputs,
Resource
} from "../models/mappers";
29 changes: 2 additions & 27 deletions sdk/iotcentral/arm-iotcentral/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export interface AppPatch {
/**
* Details of error response.
*/
export interface ErrorResponseBody {
export interface CloudErrorResponseBody {
/**
* The error code.
* **NOTE: This property will not be serialized. It can only be populated by the server.**
Expand All @@ -130,32 +130,7 @@ export interface ErrorResponseBody {
/**
* A list of additional details about the error.
*/
details?: ErrorResponseBody[];
}

/**
* Error details.
*/
export interface ErrorDetails {
/**
* The error code.
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly code?: string;
/**
* The error message.
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly message?: string;
/**
* The target of the particular error.
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly target?: string;
/**
* A list of additional details about the error.
*/
details?: ErrorResponseBody[];
details?: CloudErrorResponseBody[];
}

/**
Expand Down
51 changes: 4 additions & 47 deletions sdk/iotcentral/arm-iotcentral/src/models/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,11 @@ export const AppPatch: msRest.CompositeMapper = {
}
};

export const ErrorResponseBody: msRest.CompositeMapper = {
serializedName: "ErrorResponseBody",
export const CloudErrorResponseBody: msRest.CompositeMapper = {
serializedName: "CloudErrorResponseBody",
type: {
name: "Composite",
className: "ErrorResponseBody",
className: "CloudErrorResponseBody",
modelProperties: {
code: {
readOnly: true,
Expand Down Expand Up @@ -217,50 +217,7 @@ export const ErrorResponseBody: msRest.CompositeMapper = {
element: {
type: {
name: "Composite",
className: "ErrorResponseBody"
}
}
}
}
}
}
};

export const ErrorDetails: msRest.CompositeMapper = {
serializedName: "ErrorDetails",
type: {
name: "Composite",
className: "ErrorDetails",
modelProperties: {
code: {
readOnly: true,
serializedName: "error.code",
type: {
name: "String"
}
},
message: {
readOnly: true,
serializedName: "error.message",
type: {
name: "String"
}
},
target: {
readOnly: true,
serializedName: "error.target",
type: {
name: "String"
}
},
details: {
serializedName: "error.details",
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "ErrorResponseBody"
className: "CloudErrorResponseBody"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions sdk/iotcentral/arm-iotcentral/src/models/operationsMappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*/

export {
ErrorDetails,
ErrorResponseBody,
CloudError,
CloudErrorResponseBody,
Operation,
OperationDisplay,
OperationListResult
Expand Down
24 changes: 12 additions & 12 deletions sdk/iotcentral/arm-iotcentral/src/operations/apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ const getOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.App
},
default: {
bodyMapper: Mappers.ErrorDetails
bodyMapper: Mappers.CloudError
}
},
serializer
Expand All @@ -438,7 +438,7 @@ const listBySubscriptionOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.AppListResult
},
default: {
bodyMapper: Mappers.ErrorDetails
bodyMapper: Mappers.CloudError
}
},
serializer
Expand All @@ -462,7 +462,7 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.AppListResult
},
default: {
bodyMapper: Mappers.ErrorDetails
bodyMapper: Mappers.CloudError
}
},
serializer
Expand Down Expand Up @@ -492,7 +492,7 @@ const checkNameAvailabilityOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.AppAvailabilityInfo
},
default: {
bodyMapper: Mappers.ErrorDetails
bodyMapper: Mappers.CloudError
}
},
serializer
Expand Down Expand Up @@ -522,7 +522,7 @@ const checkSubdomainAvailabilityOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.AppAvailabilityInfo
},
default: {
bodyMapper: Mappers.ErrorDetails
bodyMapper: Mappers.CloudError
}
},
serializer
Expand All @@ -545,7 +545,7 @@ const listTemplatesOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.AppTemplatesResult
},
default: {
bodyMapper: Mappers.ErrorDetails
bodyMapper: Mappers.CloudError
}
},
serializer
Expand Down Expand Up @@ -581,7 +581,7 @@ const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = {
},
202: {},
default: {
bodyMapper: Mappers.ErrorDetails
bodyMapper: Mappers.CloudError
}
},
serializer
Expand Down Expand Up @@ -614,7 +614,7 @@ const beginUpdateOperationSpec: msRest.OperationSpec = {
},
202: {},
default: {
bodyMapper: Mappers.ErrorDetails
bodyMapper: Mappers.CloudError
}
},
serializer
Expand All @@ -639,7 +639,7 @@ const beginDeleteMethodOperationSpec: msRest.OperationSpec = {
202: {},
204: {},
default: {
bodyMapper: Mappers.ErrorDetails
bodyMapper: Mappers.CloudError
}
},
serializer
Expand All @@ -660,7 +660,7 @@ const listBySubscriptionNextOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.AppListResult
},
default: {
bodyMapper: Mappers.ErrorDetails
bodyMapper: Mappers.CloudError
}
},
serializer
Expand All @@ -681,7 +681,7 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.AppListResult
},
default: {
bodyMapper: Mappers.ErrorDetails
bodyMapper: Mappers.CloudError
}
},
serializer
Expand All @@ -702,7 +702,7 @@ const listTemplatesNextOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.AppTemplatesResult
},
default: {
bodyMapper: Mappers.ErrorDetails
bodyMapper: Mappers.CloudError
}
},
serializer
Expand Down
4 changes: 2 additions & 2 deletions sdk/iotcentral/arm-iotcentral/src/operations/operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const listOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.OperationListResult
},
default: {
bodyMapper: Mappers.ErrorDetails
bodyMapper: Mappers.CloudError
}
},
serializer
Expand All @@ -116,7 +116,7 @@ const listNextOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.OperationListResult
},
default: {
bodyMapper: Mappers.ErrorDetails
bodyMapper: Mappers.CloudError
}
},
serializer
Expand Down

0 comments on commit d6b5e0f

Please sign in to comment.