Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR @azure/arm-iotcentral] [IoTCentral] change error details definition #437

Closed
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
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
3 changes: 1 addition & 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,7 @@ export {
AppTemplate,
AppTemplatesResult,
BaseResource,
ErrorDetails,
ErrorResponseBody,
CloudError,
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 CloudErrorBody {
/**
* 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?: CloudErrorBody[];
}

/**
Expand Down
66 changes: 4 additions & 62 deletions sdk/iotcentral/arm-iotcentral/src/models/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,12 @@ export const App: msRest.CompositeMapper = {
},
displayName: {
serializedName: "properties.displayName",
constraints: {
Pattern: /^.{1,200}$/
},
type: {
name: "String"
}
},
subdomain: {
serializedName: "properties.subdomain",
constraints: {
Pattern: /^[a-z0-9-]{1,63}$/
},
type: {
name: "String"
}
Expand Down Expand Up @@ -157,18 +151,12 @@ export const AppPatch: msRest.CompositeMapper = {
},
displayName: {
serializedName: "properties.displayName",
constraints: {
Pattern: /^.{1,200}$/
},
type: {
name: "String"
}
},
subdomain: {
serializedName: "properties.subdomain",
constraints: {
Pattern: /^[a-z0-9-]{1,63}$/
},
type: {
name: "String"
}
Expand All @@ -183,11 +171,11 @@ export const AppPatch: msRest.CompositeMapper = {
}
};

export const ErrorResponseBody: msRest.CompositeMapper = {
serializedName: "ErrorResponseBody",
export const CloudErrorBody: msRest.CompositeMapper = {
serializedName: "CloudErrorBody",
type: {
name: "Composite",
className: "ErrorResponseBody",
className: "CloudErrorBody",
modelProperties: {
code: {
readOnly: true,
Expand Down Expand Up @@ -217,50 +205,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: "CloudErrorBody"
}
}
}
Expand Down Expand Up @@ -340,9 +285,6 @@ export const OperationInputs: msRest.CompositeMapper = {
name: {
required: true,
serializedName: "name",
constraints: {
Pattern: /^[a-z0-9-]{1,63}$/
},
type: {
name: "String"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
*/

export {
ErrorDetails,
ErrorResponseBody,
CloudError,
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