@aws-sdk/client-iottwinmaker 3.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/LICENSE +201 -0
- package/README.md +212 -0
- package/dist-cjs/IoTTwinMaker.js +397 -0
- package/dist-cjs/IoTTwinMakerClient.js +35 -0
- package/dist-cjs/commands/BatchPutPropertyValuesCommand.js +36 -0
- package/dist-cjs/commands/CreateComponentTypeCommand.js +36 -0
- package/dist-cjs/commands/CreateEntityCommand.js +36 -0
- package/dist-cjs/commands/CreateSceneCommand.js +36 -0
- package/dist-cjs/commands/CreateWorkspaceCommand.js +36 -0
- package/dist-cjs/commands/DeleteComponentTypeCommand.js +36 -0
- package/dist-cjs/commands/DeleteEntityCommand.js +36 -0
- package/dist-cjs/commands/DeleteSceneCommand.js +36 -0
- package/dist-cjs/commands/DeleteWorkspaceCommand.js +36 -0
- package/dist-cjs/commands/GetComponentTypeCommand.js +36 -0
- package/dist-cjs/commands/GetEntityCommand.js +36 -0
- package/dist-cjs/commands/GetPropertyValueCommand.js +36 -0
- package/dist-cjs/commands/GetPropertyValueHistoryCommand.js +36 -0
- package/dist-cjs/commands/GetSceneCommand.js +36 -0
- package/dist-cjs/commands/GetWorkspaceCommand.js +36 -0
- package/dist-cjs/commands/ListComponentTypesCommand.js +36 -0
- package/dist-cjs/commands/ListEntitiesCommand.js +36 -0
- package/dist-cjs/commands/ListScenesCommand.js +36 -0
- package/dist-cjs/commands/ListTagsForResourceCommand.js +36 -0
- package/dist-cjs/commands/ListWorkspacesCommand.js +36 -0
- package/dist-cjs/commands/TagResourceCommand.js +36 -0
- package/dist-cjs/commands/UntagResourceCommand.js +36 -0
- package/dist-cjs/commands/UpdateComponentTypeCommand.js +36 -0
- package/dist-cjs/commands/UpdateEntityCommand.js +36 -0
- package/dist-cjs/commands/UpdateSceneCommand.js +36 -0
- package/dist-cjs/commands/UpdateWorkspaceCommand.js +36 -0
- package/dist-cjs/commands/index.js +29 -0
- package/dist-cjs/endpoints.js +130 -0
- package/dist-cjs/index.js +8 -0
- package/dist-cjs/models/index.js +4 -0
- package/dist-cjs/models/models_0.js +659 -0
- package/dist-cjs/pagination/GetPropertyValueHistoryPaginator.js +35 -0
- package/dist-cjs/pagination/Interfaces.js +2 -0
- package/dist-cjs/pagination/ListComponentTypesPaginator.js +35 -0
- package/dist-cjs/pagination/ListEntitiesPaginator.js +35 -0
- package/dist-cjs/pagination/ListScenesPaginator.js +35 -0
- package/dist-cjs/pagination/ListWorkspacesPaginator.js +35 -0
- package/dist-cjs/pagination/index.js +9 -0
- package/dist-cjs/protocols/Aws_restJson1.js +4460 -0
- package/dist-cjs/runtimeConfig.browser.js +40 -0
- package/dist-cjs/runtimeConfig.js +44 -0
- package/dist-cjs/runtimeConfig.native.js +16 -0
- package/dist-cjs/runtimeConfig.shared.js +17 -0
- package/dist-es/IoTTwinMaker.js +400 -0
- package/dist-es/IoTTwinMakerClient.js +37 -0
- package/dist-es/commands/BatchPutPropertyValuesCommand.js +39 -0
- package/dist-es/commands/CreateComponentTypeCommand.js +39 -0
- package/dist-es/commands/CreateEntityCommand.js +39 -0
- package/dist-es/commands/CreateSceneCommand.js +39 -0
- package/dist-es/commands/CreateWorkspaceCommand.js +39 -0
- package/dist-es/commands/DeleteComponentTypeCommand.js +39 -0
- package/dist-es/commands/DeleteEntityCommand.js +39 -0
- package/dist-es/commands/DeleteSceneCommand.js +39 -0
- package/dist-es/commands/DeleteWorkspaceCommand.js +39 -0
- package/dist-es/commands/GetComponentTypeCommand.js +39 -0
- package/dist-es/commands/GetEntityCommand.js +39 -0
- package/dist-es/commands/GetPropertyValueCommand.js +39 -0
- package/dist-es/commands/GetPropertyValueHistoryCommand.js +39 -0
- package/dist-es/commands/GetSceneCommand.js +39 -0
- package/dist-es/commands/GetWorkspaceCommand.js +39 -0
- package/dist-es/commands/ListComponentTypesCommand.js +39 -0
- package/dist-es/commands/ListEntitiesCommand.js +39 -0
- package/dist-es/commands/ListScenesCommand.js +39 -0
- package/dist-es/commands/ListTagsForResourceCommand.js +39 -0
- package/dist-es/commands/ListWorkspacesCommand.js +39 -0
- package/dist-es/commands/TagResourceCommand.js +39 -0
- package/dist-es/commands/UntagResourceCommand.js +39 -0
- package/dist-es/commands/UpdateComponentTypeCommand.js +39 -0
- package/dist-es/commands/UpdateEntityCommand.js +39 -0
- package/dist-es/commands/UpdateSceneCommand.js +39 -0
- package/dist-es/commands/UpdateWorkspaceCommand.js +39 -0
- package/dist-es/commands/index.js +26 -0
- package/dist-es/endpoints.js +126 -0
- package/dist-es/index.js +5 -0
- package/dist-es/models/index.js +1 -0
- package/dist-es/models/models_0.js +469 -0
- package/dist-es/pagination/GetPropertyValueHistoryPaginator.js +74 -0
- package/dist-es/pagination/Interfaces.js +1 -0
- package/dist-es/pagination/ListComponentTypesPaginator.js +74 -0
- package/dist-es/pagination/ListEntitiesPaginator.js +74 -0
- package/dist-es/pagination/ListScenesPaginator.js +74 -0
- package/dist-es/pagination/ListWorkspacesPaginator.js +74 -0
- package/dist-es/pagination/index.js +6 -0
- package/dist-es/protocols/Aws_restJson1.js +4853 -0
- package/dist-es/runtimeConfig.browser.js +17 -0
- package/dist-es/runtimeConfig.js +21 -0
- package/dist-es/runtimeConfig.native.js +8 -0
- package/dist-es/runtimeConfig.shared.js +13 -0
- package/dist-types/IoTTwinMaker.d.ts +206 -0
- package/dist-types/IoTTwinMakerClient.d.ts +175 -0
- package/dist-types/commands/BatchPutPropertyValuesCommand.d.ts +35 -0
- package/dist-types/commands/CreateComponentTypeCommand.d.ts +40 -0
- package/dist-types/commands/CreateEntityCommand.d.ts +35 -0
- package/dist-types/commands/CreateSceneCommand.d.ts +35 -0
- package/dist-types/commands/CreateWorkspaceCommand.d.ts +35 -0
- package/dist-types/commands/DeleteComponentTypeCommand.d.ts +35 -0
- package/dist-types/commands/DeleteEntityCommand.d.ts +35 -0
- package/dist-types/commands/DeleteSceneCommand.d.ts +35 -0
- package/dist-types/commands/DeleteWorkspaceCommand.d.ts +35 -0
- package/dist-types/commands/GetComponentTypeCommand.d.ts +35 -0
- package/dist-types/commands/GetEntityCommand.d.ts +35 -0
- package/dist-types/commands/GetPropertyValueCommand.d.ts +36 -0
- package/dist-types/commands/GetPropertyValueHistoryCommand.d.ts +37 -0
- package/dist-types/commands/GetSceneCommand.d.ts +35 -0
- package/dist-types/commands/GetWorkspaceCommand.d.ts +35 -0
- package/dist-types/commands/ListComponentTypesCommand.d.ts +35 -0
- package/dist-types/commands/ListEntitiesCommand.d.ts +35 -0
- package/dist-types/commands/ListScenesCommand.d.ts +35 -0
- package/dist-types/commands/ListTagsForResourceCommand.d.ts +35 -0
- package/dist-types/commands/ListWorkspacesCommand.d.ts +35 -0
- package/dist-types/commands/TagResourceCommand.d.ts +35 -0
- package/dist-types/commands/UntagResourceCommand.d.ts +35 -0
- package/dist-types/commands/UpdateComponentTypeCommand.d.ts +35 -0
- package/dist-types/commands/UpdateEntityCommand.d.ts +35 -0
- package/dist-types/commands/UpdateSceneCommand.d.ts +35 -0
- package/dist-types/commands/UpdateWorkspaceCommand.d.ts +35 -0
- package/dist-types/commands/index.d.ts +26 -0
- package/dist-types/endpoints.d.ts +2 -0
- package/dist-types/index.d.ts +5 -0
- package/dist-types/models/index.d.ts +1 -0
- package/dist-types/models/models_0.d.ts +2269 -0
- package/dist-types/pagination/GetPropertyValueHistoryPaginator.d.ts +4 -0
- package/dist-types/pagination/Interfaces.d.ts +6 -0
- package/dist-types/pagination/ListComponentTypesPaginator.d.ts +4 -0
- package/dist-types/pagination/ListEntitiesPaginator.d.ts +4 -0
- package/dist-types/pagination/ListScenesPaginator.d.ts +4 -0
- package/dist-types/pagination/ListWorkspacesPaginator.d.ts +4 -0
- package/dist-types/pagination/index.d.ts +6 -0
- package/dist-types/protocols/Aws_restJson1.d.ts +80 -0
- package/dist-types/runtimeConfig.browser.d.ts +39 -0
- package/dist-types/runtimeConfig.d.ts +39 -0
- package/dist-types/runtimeConfig.native.d.ts +38 -0
- package/dist-types/runtimeConfig.shared.d.ts +13 -0
- package/dist-types/ts3.4/IoTTwinMaker.d.ts +135 -0
- package/dist-types/ts3.4/IoTTwinMakerClient.d.ts +97 -0
- package/dist-types/ts3.4/commands/BatchPutPropertyValuesCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/CreateComponentTypeCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/CreateEntityCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/CreateSceneCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/CreateWorkspaceCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/DeleteComponentTypeCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/DeleteEntityCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/DeleteSceneCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/DeleteWorkspaceCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/GetComponentTypeCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/GetEntityCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/GetPropertyValueCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/GetPropertyValueHistoryCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/GetSceneCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/GetWorkspaceCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/ListComponentTypesCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/ListEntitiesCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/ListScenesCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/ListWorkspacesCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/UpdateComponentTypeCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/UpdateEntityCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/UpdateSceneCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/UpdateWorkspaceCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/index.d.ts +26 -0
- package/dist-types/ts3.4/endpoints.d.ts +2 -0
- package/dist-types/ts3.4/index.d.ts +5 -0
- package/dist-types/ts3.4/models/index.d.ts +1 -0
- package/dist-types/ts3.4/models/models_0.d.ts +1382 -0
- package/dist-types/ts3.4/pagination/GetPropertyValueHistoryPaginator.d.ts +4 -0
- package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
- package/dist-types/ts3.4/pagination/ListComponentTypesPaginator.d.ts +4 -0
- package/dist-types/ts3.4/pagination/ListEntitiesPaginator.d.ts +4 -0
- package/dist-types/ts3.4/pagination/ListScenesPaginator.d.ts +4 -0
- package/dist-types/ts3.4/pagination/ListWorkspacesPaginator.d.ts +4 -0
- package/dist-types/ts3.4/pagination/index.d.ts +6 -0
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +80 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +37 -0
- package/dist-types/ts3.4/runtimeConfig.d.ts +37 -0
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +36 -0
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +11 -0
- package/package.json +94 -0
|
@@ -0,0 +1,4460 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deserializeAws_restJson1UpdateEntityCommand = exports.deserializeAws_restJson1UpdateComponentTypeCommand = exports.deserializeAws_restJson1UntagResourceCommand = exports.deserializeAws_restJson1TagResourceCommand = exports.deserializeAws_restJson1ListWorkspacesCommand = exports.deserializeAws_restJson1ListTagsForResourceCommand = exports.deserializeAws_restJson1ListScenesCommand = exports.deserializeAws_restJson1ListEntitiesCommand = exports.deserializeAws_restJson1ListComponentTypesCommand = exports.deserializeAws_restJson1GetWorkspaceCommand = exports.deserializeAws_restJson1GetSceneCommand = exports.deserializeAws_restJson1GetPropertyValueHistoryCommand = exports.deserializeAws_restJson1GetPropertyValueCommand = exports.deserializeAws_restJson1GetEntityCommand = exports.deserializeAws_restJson1GetComponentTypeCommand = exports.deserializeAws_restJson1DeleteWorkspaceCommand = exports.deserializeAws_restJson1DeleteSceneCommand = exports.deserializeAws_restJson1DeleteEntityCommand = exports.deserializeAws_restJson1DeleteComponentTypeCommand = exports.deserializeAws_restJson1CreateWorkspaceCommand = exports.deserializeAws_restJson1CreateSceneCommand = exports.deserializeAws_restJson1CreateEntityCommand = exports.deserializeAws_restJson1CreateComponentTypeCommand = exports.deserializeAws_restJson1BatchPutPropertyValuesCommand = exports.serializeAws_restJson1UpdateWorkspaceCommand = exports.serializeAws_restJson1UpdateSceneCommand = exports.serializeAws_restJson1UpdateEntityCommand = exports.serializeAws_restJson1UpdateComponentTypeCommand = exports.serializeAws_restJson1UntagResourceCommand = exports.serializeAws_restJson1TagResourceCommand = exports.serializeAws_restJson1ListWorkspacesCommand = exports.serializeAws_restJson1ListTagsForResourceCommand = exports.serializeAws_restJson1ListScenesCommand = exports.serializeAws_restJson1ListEntitiesCommand = exports.serializeAws_restJson1ListComponentTypesCommand = exports.serializeAws_restJson1GetWorkspaceCommand = exports.serializeAws_restJson1GetSceneCommand = exports.serializeAws_restJson1GetPropertyValueHistoryCommand = exports.serializeAws_restJson1GetPropertyValueCommand = exports.serializeAws_restJson1GetEntityCommand = exports.serializeAws_restJson1GetComponentTypeCommand = exports.serializeAws_restJson1DeleteWorkspaceCommand = exports.serializeAws_restJson1DeleteSceneCommand = exports.serializeAws_restJson1DeleteEntityCommand = exports.serializeAws_restJson1DeleteComponentTypeCommand = exports.serializeAws_restJson1CreateWorkspaceCommand = exports.serializeAws_restJson1CreateSceneCommand = exports.serializeAws_restJson1CreateEntityCommand = exports.serializeAws_restJson1CreateComponentTypeCommand = exports.serializeAws_restJson1BatchPutPropertyValuesCommand = void 0;
|
|
4
|
+
exports.deserializeAws_restJson1UpdateWorkspaceCommand = exports.deserializeAws_restJson1UpdateSceneCommand = void 0;
|
|
5
|
+
const protocol_http_1 = require("@aws-sdk/protocol-http");
|
|
6
|
+
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
7
|
+
const models_0_1 = require("../models/models_0");
|
|
8
|
+
const serializeAws_restJson1BatchPutPropertyValuesCommand = async (input, context) => {
|
|
9
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
10
|
+
const headers = {
|
|
11
|
+
"content-type": "application/json",
|
|
12
|
+
};
|
|
13
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
14
|
+
"/workspaces/{workspaceId}/entity-properties";
|
|
15
|
+
if (input.workspaceId !== undefined) {
|
|
16
|
+
const labelValue = input.workspaceId;
|
|
17
|
+
if (labelValue.length <= 0) {
|
|
18
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
19
|
+
}
|
|
20
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
24
|
+
}
|
|
25
|
+
let body;
|
|
26
|
+
body = JSON.stringify({
|
|
27
|
+
...(input.entries !== undefined &&
|
|
28
|
+
input.entries !== null && { entries: serializeAws_restJson1Entries(input.entries, context) }),
|
|
29
|
+
});
|
|
30
|
+
let { hostname: resolvedHostname } = await context.endpoint();
|
|
31
|
+
if (context.disableHostPrefix !== true) {
|
|
32
|
+
resolvedHostname = "data." + resolvedHostname;
|
|
33
|
+
if (!protocol_http_1.isValidHostname(resolvedHostname)) {
|
|
34
|
+
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return new protocol_http_1.HttpRequest({
|
|
38
|
+
protocol,
|
|
39
|
+
hostname: resolvedHostname,
|
|
40
|
+
port,
|
|
41
|
+
method: "POST",
|
|
42
|
+
headers,
|
|
43
|
+
path: resolvedPath,
|
|
44
|
+
body,
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
exports.serializeAws_restJson1BatchPutPropertyValuesCommand = serializeAws_restJson1BatchPutPropertyValuesCommand;
|
|
48
|
+
const serializeAws_restJson1CreateComponentTypeCommand = async (input, context) => {
|
|
49
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
50
|
+
const headers = {
|
|
51
|
+
"content-type": "application/json",
|
|
52
|
+
};
|
|
53
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
54
|
+
"/workspaces/{workspaceId}/component-types/{componentTypeId}";
|
|
55
|
+
if (input.workspaceId !== undefined) {
|
|
56
|
+
const labelValue = input.workspaceId;
|
|
57
|
+
if (labelValue.length <= 0) {
|
|
58
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
59
|
+
}
|
|
60
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
64
|
+
}
|
|
65
|
+
if (input.componentTypeId !== undefined) {
|
|
66
|
+
const labelValue = input.componentTypeId;
|
|
67
|
+
if (labelValue.length <= 0) {
|
|
68
|
+
throw new Error("Empty value provided for input HTTP label: componentTypeId.");
|
|
69
|
+
}
|
|
70
|
+
resolvedPath = resolvedPath.replace("{componentTypeId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
throw new Error("No value provided for input HTTP label: componentTypeId.");
|
|
74
|
+
}
|
|
75
|
+
let body;
|
|
76
|
+
body = JSON.stringify({
|
|
77
|
+
...(input.description !== undefined && input.description !== null && { description: input.description }),
|
|
78
|
+
...(input.extendsFrom !== undefined &&
|
|
79
|
+
input.extendsFrom !== null && { extendsFrom: serializeAws_restJson1ExtendsFrom(input.extendsFrom, context) }),
|
|
80
|
+
...(input.functions !== undefined &&
|
|
81
|
+
input.functions !== null && { functions: serializeAws_restJson1FunctionsRequest(input.functions, context) }),
|
|
82
|
+
...(input.isSingleton !== undefined && input.isSingleton !== null && { isSingleton: input.isSingleton }),
|
|
83
|
+
...(input.propertyDefinitions !== undefined &&
|
|
84
|
+
input.propertyDefinitions !== null && {
|
|
85
|
+
propertyDefinitions: serializeAws_restJson1PropertyDefinitionsRequest(input.propertyDefinitions, context),
|
|
86
|
+
}),
|
|
87
|
+
...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
|
|
88
|
+
});
|
|
89
|
+
let { hostname: resolvedHostname } = await context.endpoint();
|
|
90
|
+
if (context.disableHostPrefix !== true) {
|
|
91
|
+
resolvedHostname = "api." + resolvedHostname;
|
|
92
|
+
if (!protocol_http_1.isValidHostname(resolvedHostname)) {
|
|
93
|
+
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return new protocol_http_1.HttpRequest({
|
|
97
|
+
protocol,
|
|
98
|
+
hostname: resolvedHostname,
|
|
99
|
+
port,
|
|
100
|
+
method: "POST",
|
|
101
|
+
headers,
|
|
102
|
+
path: resolvedPath,
|
|
103
|
+
body,
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
exports.serializeAws_restJson1CreateComponentTypeCommand = serializeAws_restJson1CreateComponentTypeCommand;
|
|
107
|
+
const serializeAws_restJson1CreateEntityCommand = async (input, context) => {
|
|
108
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
109
|
+
const headers = {
|
|
110
|
+
"content-type": "application/json",
|
|
111
|
+
};
|
|
112
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces/{workspaceId}/entities";
|
|
113
|
+
if (input.workspaceId !== undefined) {
|
|
114
|
+
const labelValue = input.workspaceId;
|
|
115
|
+
if (labelValue.length <= 0) {
|
|
116
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
117
|
+
}
|
|
118
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
122
|
+
}
|
|
123
|
+
let body;
|
|
124
|
+
body = JSON.stringify({
|
|
125
|
+
...(input.components !== undefined &&
|
|
126
|
+
input.components !== null && {
|
|
127
|
+
components: serializeAws_restJson1ComponentsMapRequest(input.components, context),
|
|
128
|
+
}),
|
|
129
|
+
...(input.description !== undefined && input.description !== null && { description: input.description }),
|
|
130
|
+
...(input.entityId !== undefined && input.entityId !== null && { entityId: input.entityId }),
|
|
131
|
+
...(input.entityName !== undefined && input.entityName !== null && { entityName: input.entityName }),
|
|
132
|
+
...(input.parentEntityId !== undefined &&
|
|
133
|
+
input.parentEntityId !== null && { parentEntityId: input.parentEntityId }),
|
|
134
|
+
...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
|
|
135
|
+
});
|
|
136
|
+
let { hostname: resolvedHostname } = await context.endpoint();
|
|
137
|
+
if (context.disableHostPrefix !== true) {
|
|
138
|
+
resolvedHostname = "api." + resolvedHostname;
|
|
139
|
+
if (!protocol_http_1.isValidHostname(resolvedHostname)) {
|
|
140
|
+
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return new protocol_http_1.HttpRequest({
|
|
144
|
+
protocol,
|
|
145
|
+
hostname: resolvedHostname,
|
|
146
|
+
port,
|
|
147
|
+
method: "POST",
|
|
148
|
+
headers,
|
|
149
|
+
path: resolvedPath,
|
|
150
|
+
body,
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
exports.serializeAws_restJson1CreateEntityCommand = serializeAws_restJson1CreateEntityCommand;
|
|
154
|
+
const serializeAws_restJson1CreateSceneCommand = async (input, context) => {
|
|
155
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
156
|
+
const headers = {
|
|
157
|
+
"content-type": "application/json",
|
|
158
|
+
};
|
|
159
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces/{workspaceId}/scenes";
|
|
160
|
+
if (input.workspaceId !== undefined) {
|
|
161
|
+
const labelValue = input.workspaceId;
|
|
162
|
+
if (labelValue.length <= 0) {
|
|
163
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
164
|
+
}
|
|
165
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
169
|
+
}
|
|
170
|
+
let body;
|
|
171
|
+
body = JSON.stringify({
|
|
172
|
+
...(input.capabilities !== undefined &&
|
|
173
|
+
input.capabilities !== null && {
|
|
174
|
+
capabilities: serializeAws_restJson1SceneCapabilities(input.capabilities, context),
|
|
175
|
+
}),
|
|
176
|
+
...(input.contentLocation !== undefined &&
|
|
177
|
+
input.contentLocation !== null && { contentLocation: input.contentLocation }),
|
|
178
|
+
...(input.description !== undefined && input.description !== null && { description: input.description }),
|
|
179
|
+
...(input.sceneId !== undefined && input.sceneId !== null && { sceneId: input.sceneId }),
|
|
180
|
+
...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
|
|
181
|
+
});
|
|
182
|
+
let { hostname: resolvedHostname } = await context.endpoint();
|
|
183
|
+
if (context.disableHostPrefix !== true) {
|
|
184
|
+
resolvedHostname = "api." + resolvedHostname;
|
|
185
|
+
if (!protocol_http_1.isValidHostname(resolvedHostname)) {
|
|
186
|
+
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return new protocol_http_1.HttpRequest({
|
|
190
|
+
protocol,
|
|
191
|
+
hostname: resolvedHostname,
|
|
192
|
+
port,
|
|
193
|
+
method: "POST",
|
|
194
|
+
headers,
|
|
195
|
+
path: resolvedPath,
|
|
196
|
+
body,
|
|
197
|
+
});
|
|
198
|
+
};
|
|
199
|
+
exports.serializeAws_restJson1CreateSceneCommand = serializeAws_restJson1CreateSceneCommand;
|
|
200
|
+
const serializeAws_restJson1CreateWorkspaceCommand = async (input, context) => {
|
|
201
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
202
|
+
const headers = {
|
|
203
|
+
"content-type": "application/json",
|
|
204
|
+
};
|
|
205
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces/{workspaceId}";
|
|
206
|
+
if (input.workspaceId !== undefined) {
|
|
207
|
+
const labelValue = input.workspaceId;
|
|
208
|
+
if (labelValue.length <= 0) {
|
|
209
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
210
|
+
}
|
|
211
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
215
|
+
}
|
|
216
|
+
let body;
|
|
217
|
+
body = JSON.stringify({
|
|
218
|
+
...(input.description !== undefined && input.description !== null && { description: input.description }),
|
|
219
|
+
...(input.role !== undefined && input.role !== null && { role: input.role }),
|
|
220
|
+
...(input.s3Location !== undefined && input.s3Location !== null && { s3Location: input.s3Location }),
|
|
221
|
+
...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
|
|
222
|
+
});
|
|
223
|
+
let { hostname: resolvedHostname } = await context.endpoint();
|
|
224
|
+
if (context.disableHostPrefix !== true) {
|
|
225
|
+
resolvedHostname = "api." + resolvedHostname;
|
|
226
|
+
if (!protocol_http_1.isValidHostname(resolvedHostname)) {
|
|
227
|
+
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return new protocol_http_1.HttpRequest({
|
|
231
|
+
protocol,
|
|
232
|
+
hostname: resolvedHostname,
|
|
233
|
+
port,
|
|
234
|
+
method: "POST",
|
|
235
|
+
headers,
|
|
236
|
+
path: resolvedPath,
|
|
237
|
+
body,
|
|
238
|
+
});
|
|
239
|
+
};
|
|
240
|
+
exports.serializeAws_restJson1CreateWorkspaceCommand = serializeAws_restJson1CreateWorkspaceCommand;
|
|
241
|
+
const serializeAws_restJson1DeleteComponentTypeCommand = async (input, context) => {
|
|
242
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
243
|
+
const headers = {};
|
|
244
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
245
|
+
"/workspaces/{workspaceId}/component-types/{componentTypeId}";
|
|
246
|
+
if (input.workspaceId !== undefined) {
|
|
247
|
+
const labelValue = input.workspaceId;
|
|
248
|
+
if (labelValue.length <= 0) {
|
|
249
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
250
|
+
}
|
|
251
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
255
|
+
}
|
|
256
|
+
if (input.componentTypeId !== undefined) {
|
|
257
|
+
const labelValue = input.componentTypeId;
|
|
258
|
+
if (labelValue.length <= 0) {
|
|
259
|
+
throw new Error("Empty value provided for input HTTP label: componentTypeId.");
|
|
260
|
+
}
|
|
261
|
+
resolvedPath = resolvedPath.replace("{componentTypeId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
throw new Error("No value provided for input HTTP label: componentTypeId.");
|
|
265
|
+
}
|
|
266
|
+
let body;
|
|
267
|
+
let { hostname: resolvedHostname } = await context.endpoint();
|
|
268
|
+
if (context.disableHostPrefix !== true) {
|
|
269
|
+
resolvedHostname = "api." + resolvedHostname;
|
|
270
|
+
if (!protocol_http_1.isValidHostname(resolvedHostname)) {
|
|
271
|
+
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
return new protocol_http_1.HttpRequest({
|
|
275
|
+
protocol,
|
|
276
|
+
hostname: resolvedHostname,
|
|
277
|
+
port,
|
|
278
|
+
method: "DELETE",
|
|
279
|
+
headers,
|
|
280
|
+
path: resolvedPath,
|
|
281
|
+
body,
|
|
282
|
+
});
|
|
283
|
+
};
|
|
284
|
+
exports.serializeAws_restJson1DeleteComponentTypeCommand = serializeAws_restJson1DeleteComponentTypeCommand;
|
|
285
|
+
const serializeAws_restJson1DeleteEntityCommand = async (input, context) => {
|
|
286
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
287
|
+
const headers = {};
|
|
288
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
289
|
+
"/workspaces/{workspaceId}/entities/{entityId}";
|
|
290
|
+
if (input.workspaceId !== undefined) {
|
|
291
|
+
const labelValue = input.workspaceId;
|
|
292
|
+
if (labelValue.length <= 0) {
|
|
293
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
294
|
+
}
|
|
295
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
296
|
+
}
|
|
297
|
+
else {
|
|
298
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
299
|
+
}
|
|
300
|
+
if (input.entityId !== undefined) {
|
|
301
|
+
const labelValue = input.entityId;
|
|
302
|
+
if (labelValue.length <= 0) {
|
|
303
|
+
throw new Error("Empty value provided for input HTTP label: entityId.");
|
|
304
|
+
}
|
|
305
|
+
resolvedPath = resolvedPath.replace("{entityId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
throw new Error("No value provided for input HTTP label: entityId.");
|
|
309
|
+
}
|
|
310
|
+
const query = {
|
|
311
|
+
...(input.isRecursive !== undefined && { isRecursive: input.isRecursive.toString() }),
|
|
312
|
+
};
|
|
313
|
+
let body;
|
|
314
|
+
let { hostname: resolvedHostname } = await context.endpoint();
|
|
315
|
+
if (context.disableHostPrefix !== true) {
|
|
316
|
+
resolvedHostname = "api." + resolvedHostname;
|
|
317
|
+
if (!protocol_http_1.isValidHostname(resolvedHostname)) {
|
|
318
|
+
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
return new protocol_http_1.HttpRequest({
|
|
322
|
+
protocol,
|
|
323
|
+
hostname: resolvedHostname,
|
|
324
|
+
port,
|
|
325
|
+
method: "DELETE",
|
|
326
|
+
headers,
|
|
327
|
+
path: resolvedPath,
|
|
328
|
+
query,
|
|
329
|
+
body,
|
|
330
|
+
});
|
|
331
|
+
};
|
|
332
|
+
exports.serializeAws_restJson1DeleteEntityCommand = serializeAws_restJson1DeleteEntityCommand;
|
|
333
|
+
const serializeAws_restJson1DeleteSceneCommand = async (input, context) => {
|
|
334
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
335
|
+
const headers = {};
|
|
336
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
337
|
+
"/workspaces/{workspaceId}/scenes/{sceneId}";
|
|
338
|
+
if (input.workspaceId !== undefined) {
|
|
339
|
+
const labelValue = input.workspaceId;
|
|
340
|
+
if (labelValue.length <= 0) {
|
|
341
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
342
|
+
}
|
|
343
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
344
|
+
}
|
|
345
|
+
else {
|
|
346
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
347
|
+
}
|
|
348
|
+
if (input.sceneId !== undefined) {
|
|
349
|
+
const labelValue = input.sceneId;
|
|
350
|
+
if (labelValue.length <= 0) {
|
|
351
|
+
throw new Error("Empty value provided for input HTTP label: sceneId.");
|
|
352
|
+
}
|
|
353
|
+
resolvedPath = resolvedPath.replace("{sceneId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
354
|
+
}
|
|
355
|
+
else {
|
|
356
|
+
throw new Error("No value provided for input HTTP label: sceneId.");
|
|
357
|
+
}
|
|
358
|
+
let body;
|
|
359
|
+
let { hostname: resolvedHostname } = await context.endpoint();
|
|
360
|
+
if (context.disableHostPrefix !== true) {
|
|
361
|
+
resolvedHostname = "api." + resolvedHostname;
|
|
362
|
+
if (!protocol_http_1.isValidHostname(resolvedHostname)) {
|
|
363
|
+
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
return new protocol_http_1.HttpRequest({
|
|
367
|
+
protocol,
|
|
368
|
+
hostname: resolvedHostname,
|
|
369
|
+
port,
|
|
370
|
+
method: "DELETE",
|
|
371
|
+
headers,
|
|
372
|
+
path: resolvedPath,
|
|
373
|
+
body,
|
|
374
|
+
});
|
|
375
|
+
};
|
|
376
|
+
exports.serializeAws_restJson1DeleteSceneCommand = serializeAws_restJson1DeleteSceneCommand;
|
|
377
|
+
const serializeAws_restJson1DeleteWorkspaceCommand = async (input, context) => {
|
|
378
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
379
|
+
const headers = {};
|
|
380
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces/{workspaceId}";
|
|
381
|
+
if (input.workspaceId !== undefined) {
|
|
382
|
+
const labelValue = input.workspaceId;
|
|
383
|
+
if (labelValue.length <= 0) {
|
|
384
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
385
|
+
}
|
|
386
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
387
|
+
}
|
|
388
|
+
else {
|
|
389
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
390
|
+
}
|
|
391
|
+
let body;
|
|
392
|
+
let { hostname: resolvedHostname } = await context.endpoint();
|
|
393
|
+
if (context.disableHostPrefix !== true) {
|
|
394
|
+
resolvedHostname = "api." + resolvedHostname;
|
|
395
|
+
if (!protocol_http_1.isValidHostname(resolvedHostname)) {
|
|
396
|
+
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
return new protocol_http_1.HttpRequest({
|
|
400
|
+
protocol,
|
|
401
|
+
hostname: resolvedHostname,
|
|
402
|
+
port,
|
|
403
|
+
method: "DELETE",
|
|
404
|
+
headers,
|
|
405
|
+
path: resolvedPath,
|
|
406
|
+
body,
|
|
407
|
+
});
|
|
408
|
+
};
|
|
409
|
+
exports.serializeAws_restJson1DeleteWorkspaceCommand = serializeAws_restJson1DeleteWorkspaceCommand;
|
|
410
|
+
const serializeAws_restJson1GetComponentTypeCommand = async (input, context) => {
|
|
411
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
412
|
+
const headers = {};
|
|
413
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
414
|
+
"/workspaces/{workspaceId}/component-types/{componentTypeId}";
|
|
415
|
+
if (input.workspaceId !== undefined) {
|
|
416
|
+
const labelValue = input.workspaceId;
|
|
417
|
+
if (labelValue.length <= 0) {
|
|
418
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
419
|
+
}
|
|
420
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
421
|
+
}
|
|
422
|
+
else {
|
|
423
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
424
|
+
}
|
|
425
|
+
if (input.componentTypeId !== undefined) {
|
|
426
|
+
const labelValue = input.componentTypeId;
|
|
427
|
+
if (labelValue.length <= 0) {
|
|
428
|
+
throw new Error("Empty value provided for input HTTP label: componentTypeId.");
|
|
429
|
+
}
|
|
430
|
+
resolvedPath = resolvedPath.replace("{componentTypeId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
431
|
+
}
|
|
432
|
+
else {
|
|
433
|
+
throw new Error("No value provided for input HTTP label: componentTypeId.");
|
|
434
|
+
}
|
|
435
|
+
let body;
|
|
436
|
+
let { hostname: resolvedHostname } = await context.endpoint();
|
|
437
|
+
if (context.disableHostPrefix !== true) {
|
|
438
|
+
resolvedHostname = "api." + resolvedHostname;
|
|
439
|
+
if (!protocol_http_1.isValidHostname(resolvedHostname)) {
|
|
440
|
+
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
return new protocol_http_1.HttpRequest({
|
|
444
|
+
protocol,
|
|
445
|
+
hostname: resolvedHostname,
|
|
446
|
+
port,
|
|
447
|
+
method: "GET",
|
|
448
|
+
headers,
|
|
449
|
+
path: resolvedPath,
|
|
450
|
+
body,
|
|
451
|
+
});
|
|
452
|
+
};
|
|
453
|
+
exports.serializeAws_restJson1GetComponentTypeCommand = serializeAws_restJson1GetComponentTypeCommand;
|
|
454
|
+
const serializeAws_restJson1GetEntityCommand = async (input, context) => {
|
|
455
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
456
|
+
const headers = {};
|
|
457
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
458
|
+
"/workspaces/{workspaceId}/entities/{entityId}";
|
|
459
|
+
if (input.workspaceId !== undefined) {
|
|
460
|
+
const labelValue = input.workspaceId;
|
|
461
|
+
if (labelValue.length <= 0) {
|
|
462
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
463
|
+
}
|
|
464
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
465
|
+
}
|
|
466
|
+
else {
|
|
467
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
468
|
+
}
|
|
469
|
+
if (input.entityId !== undefined) {
|
|
470
|
+
const labelValue = input.entityId;
|
|
471
|
+
if (labelValue.length <= 0) {
|
|
472
|
+
throw new Error("Empty value provided for input HTTP label: entityId.");
|
|
473
|
+
}
|
|
474
|
+
resolvedPath = resolvedPath.replace("{entityId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
475
|
+
}
|
|
476
|
+
else {
|
|
477
|
+
throw new Error("No value provided for input HTTP label: entityId.");
|
|
478
|
+
}
|
|
479
|
+
let body;
|
|
480
|
+
let { hostname: resolvedHostname } = await context.endpoint();
|
|
481
|
+
if (context.disableHostPrefix !== true) {
|
|
482
|
+
resolvedHostname = "api." + resolvedHostname;
|
|
483
|
+
if (!protocol_http_1.isValidHostname(resolvedHostname)) {
|
|
484
|
+
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
return new protocol_http_1.HttpRequest({
|
|
488
|
+
protocol,
|
|
489
|
+
hostname: resolvedHostname,
|
|
490
|
+
port,
|
|
491
|
+
method: "GET",
|
|
492
|
+
headers,
|
|
493
|
+
path: resolvedPath,
|
|
494
|
+
body,
|
|
495
|
+
});
|
|
496
|
+
};
|
|
497
|
+
exports.serializeAws_restJson1GetEntityCommand = serializeAws_restJson1GetEntityCommand;
|
|
498
|
+
const serializeAws_restJson1GetPropertyValueCommand = async (input, context) => {
|
|
499
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
500
|
+
const headers = {
|
|
501
|
+
"content-type": "application/json",
|
|
502
|
+
};
|
|
503
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
504
|
+
"/workspaces/{workspaceId}/entity-properties/value";
|
|
505
|
+
if (input.workspaceId !== undefined) {
|
|
506
|
+
const labelValue = input.workspaceId;
|
|
507
|
+
if (labelValue.length <= 0) {
|
|
508
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
509
|
+
}
|
|
510
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
511
|
+
}
|
|
512
|
+
else {
|
|
513
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
514
|
+
}
|
|
515
|
+
let body;
|
|
516
|
+
body = JSON.stringify({
|
|
517
|
+
...(input.componentName !== undefined && input.componentName !== null && { componentName: input.componentName }),
|
|
518
|
+
...(input.componentTypeId !== undefined &&
|
|
519
|
+
input.componentTypeId !== null && { componentTypeId: input.componentTypeId }),
|
|
520
|
+
...(input.entityId !== undefined && input.entityId !== null && { entityId: input.entityId }),
|
|
521
|
+
...(input.selectedProperties !== undefined &&
|
|
522
|
+
input.selectedProperties !== null && {
|
|
523
|
+
selectedProperties: serializeAws_restJson1SelectedPropertyList(input.selectedProperties, context),
|
|
524
|
+
}),
|
|
525
|
+
});
|
|
526
|
+
let { hostname: resolvedHostname } = await context.endpoint();
|
|
527
|
+
if (context.disableHostPrefix !== true) {
|
|
528
|
+
resolvedHostname = "data." + resolvedHostname;
|
|
529
|
+
if (!protocol_http_1.isValidHostname(resolvedHostname)) {
|
|
530
|
+
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
return new protocol_http_1.HttpRequest({
|
|
534
|
+
protocol,
|
|
535
|
+
hostname: resolvedHostname,
|
|
536
|
+
port,
|
|
537
|
+
method: "POST",
|
|
538
|
+
headers,
|
|
539
|
+
path: resolvedPath,
|
|
540
|
+
body,
|
|
541
|
+
});
|
|
542
|
+
};
|
|
543
|
+
exports.serializeAws_restJson1GetPropertyValueCommand = serializeAws_restJson1GetPropertyValueCommand;
|
|
544
|
+
const serializeAws_restJson1GetPropertyValueHistoryCommand = async (input, context) => {
|
|
545
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
546
|
+
const headers = {
|
|
547
|
+
"content-type": "application/json",
|
|
548
|
+
};
|
|
549
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
550
|
+
"/workspaces/{workspaceId}/entity-properties/history";
|
|
551
|
+
if (input.workspaceId !== undefined) {
|
|
552
|
+
const labelValue = input.workspaceId;
|
|
553
|
+
if (labelValue.length <= 0) {
|
|
554
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
555
|
+
}
|
|
556
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
557
|
+
}
|
|
558
|
+
else {
|
|
559
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
560
|
+
}
|
|
561
|
+
let body;
|
|
562
|
+
body = JSON.stringify({
|
|
563
|
+
...(input.componentName !== undefined && input.componentName !== null && { componentName: input.componentName }),
|
|
564
|
+
...(input.componentTypeId !== undefined &&
|
|
565
|
+
input.componentTypeId !== null && { componentTypeId: input.componentTypeId }),
|
|
566
|
+
...(input.endDateTime !== undefined &&
|
|
567
|
+
input.endDateTime !== null && { endDateTime: Math.round(input.endDateTime.getTime() / 1000) }),
|
|
568
|
+
...(input.entityId !== undefined && input.entityId !== null && { entityId: input.entityId }),
|
|
569
|
+
...(input.interpolation !== undefined &&
|
|
570
|
+
input.interpolation !== null && {
|
|
571
|
+
interpolation: serializeAws_restJson1InterpolationParameters(input.interpolation, context),
|
|
572
|
+
}),
|
|
573
|
+
...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }),
|
|
574
|
+
...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }),
|
|
575
|
+
...(input.orderByTime !== undefined && input.orderByTime !== null && { orderByTime: input.orderByTime }),
|
|
576
|
+
...(input.propertyFilters !== undefined &&
|
|
577
|
+
input.propertyFilters !== null && {
|
|
578
|
+
propertyFilters: serializeAws_restJson1PropertyFilters(input.propertyFilters, context),
|
|
579
|
+
}),
|
|
580
|
+
...(input.selectedProperties !== undefined &&
|
|
581
|
+
input.selectedProperties !== null && {
|
|
582
|
+
selectedProperties: serializeAws_restJson1SelectedPropertyList(input.selectedProperties, context),
|
|
583
|
+
}),
|
|
584
|
+
...(input.startDateTime !== undefined &&
|
|
585
|
+
input.startDateTime !== null && { startDateTime: Math.round(input.startDateTime.getTime() / 1000) }),
|
|
586
|
+
});
|
|
587
|
+
let { hostname: resolvedHostname } = await context.endpoint();
|
|
588
|
+
if (context.disableHostPrefix !== true) {
|
|
589
|
+
resolvedHostname = "data." + resolvedHostname;
|
|
590
|
+
if (!protocol_http_1.isValidHostname(resolvedHostname)) {
|
|
591
|
+
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
return new protocol_http_1.HttpRequest({
|
|
595
|
+
protocol,
|
|
596
|
+
hostname: resolvedHostname,
|
|
597
|
+
port,
|
|
598
|
+
method: "POST",
|
|
599
|
+
headers,
|
|
600
|
+
path: resolvedPath,
|
|
601
|
+
body,
|
|
602
|
+
});
|
|
603
|
+
};
|
|
604
|
+
exports.serializeAws_restJson1GetPropertyValueHistoryCommand = serializeAws_restJson1GetPropertyValueHistoryCommand;
|
|
605
|
+
const serializeAws_restJson1GetSceneCommand = async (input, context) => {
|
|
606
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
607
|
+
const headers = {};
|
|
608
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
609
|
+
"/workspaces/{workspaceId}/scenes/{sceneId}";
|
|
610
|
+
if (input.workspaceId !== undefined) {
|
|
611
|
+
const labelValue = input.workspaceId;
|
|
612
|
+
if (labelValue.length <= 0) {
|
|
613
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
614
|
+
}
|
|
615
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
616
|
+
}
|
|
617
|
+
else {
|
|
618
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
619
|
+
}
|
|
620
|
+
if (input.sceneId !== undefined) {
|
|
621
|
+
const labelValue = input.sceneId;
|
|
622
|
+
if (labelValue.length <= 0) {
|
|
623
|
+
throw new Error("Empty value provided for input HTTP label: sceneId.");
|
|
624
|
+
}
|
|
625
|
+
resolvedPath = resolvedPath.replace("{sceneId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
626
|
+
}
|
|
627
|
+
else {
|
|
628
|
+
throw new Error("No value provided for input HTTP label: sceneId.");
|
|
629
|
+
}
|
|
630
|
+
let body;
|
|
631
|
+
let { hostname: resolvedHostname } = await context.endpoint();
|
|
632
|
+
if (context.disableHostPrefix !== true) {
|
|
633
|
+
resolvedHostname = "api." + resolvedHostname;
|
|
634
|
+
if (!protocol_http_1.isValidHostname(resolvedHostname)) {
|
|
635
|
+
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
return new protocol_http_1.HttpRequest({
|
|
639
|
+
protocol,
|
|
640
|
+
hostname: resolvedHostname,
|
|
641
|
+
port,
|
|
642
|
+
method: "GET",
|
|
643
|
+
headers,
|
|
644
|
+
path: resolvedPath,
|
|
645
|
+
body,
|
|
646
|
+
});
|
|
647
|
+
};
|
|
648
|
+
exports.serializeAws_restJson1GetSceneCommand = serializeAws_restJson1GetSceneCommand;
|
|
649
|
+
const serializeAws_restJson1GetWorkspaceCommand = async (input, context) => {
|
|
650
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
651
|
+
const headers = {};
|
|
652
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces/{workspaceId}";
|
|
653
|
+
if (input.workspaceId !== undefined) {
|
|
654
|
+
const labelValue = input.workspaceId;
|
|
655
|
+
if (labelValue.length <= 0) {
|
|
656
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
657
|
+
}
|
|
658
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
659
|
+
}
|
|
660
|
+
else {
|
|
661
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
662
|
+
}
|
|
663
|
+
let body;
|
|
664
|
+
let { hostname: resolvedHostname } = await context.endpoint();
|
|
665
|
+
if (context.disableHostPrefix !== true) {
|
|
666
|
+
resolvedHostname = "api." + resolvedHostname;
|
|
667
|
+
if (!protocol_http_1.isValidHostname(resolvedHostname)) {
|
|
668
|
+
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
return new protocol_http_1.HttpRequest({
|
|
672
|
+
protocol,
|
|
673
|
+
hostname: resolvedHostname,
|
|
674
|
+
port,
|
|
675
|
+
method: "GET",
|
|
676
|
+
headers,
|
|
677
|
+
path: resolvedPath,
|
|
678
|
+
body,
|
|
679
|
+
});
|
|
680
|
+
};
|
|
681
|
+
exports.serializeAws_restJson1GetWorkspaceCommand = serializeAws_restJson1GetWorkspaceCommand;
|
|
682
|
+
const serializeAws_restJson1ListComponentTypesCommand = async (input, context) => {
|
|
683
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
684
|
+
const headers = {
|
|
685
|
+
"content-type": "application/json",
|
|
686
|
+
};
|
|
687
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
688
|
+
"/workspaces/{workspaceId}/component-types-list";
|
|
689
|
+
if (input.workspaceId !== undefined) {
|
|
690
|
+
const labelValue = input.workspaceId;
|
|
691
|
+
if (labelValue.length <= 0) {
|
|
692
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
693
|
+
}
|
|
694
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
695
|
+
}
|
|
696
|
+
else {
|
|
697
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
698
|
+
}
|
|
699
|
+
let body;
|
|
700
|
+
body = JSON.stringify({
|
|
701
|
+
...(input.filters !== undefined &&
|
|
702
|
+
input.filters !== null && { filters: serializeAws_restJson1ListComponentTypesFilters(input.filters, context) }),
|
|
703
|
+
...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }),
|
|
704
|
+
...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }),
|
|
705
|
+
});
|
|
706
|
+
let { hostname: resolvedHostname } = await context.endpoint();
|
|
707
|
+
if (context.disableHostPrefix !== true) {
|
|
708
|
+
resolvedHostname = "api." + resolvedHostname;
|
|
709
|
+
if (!protocol_http_1.isValidHostname(resolvedHostname)) {
|
|
710
|
+
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
return new protocol_http_1.HttpRequest({
|
|
714
|
+
protocol,
|
|
715
|
+
hostname: resolvedHostname,
|
|
716
|
+
port,
|
|
717
|
+
method: "POST",
|
|
718
|
+
headers,
|
|
719
|
+
path: resolvedPath,
|
|
720
|
+
body,
|
|
721
|
+
});
|
|
722
|
+
};
|
|
723
|
+
exports.serializeAws_restJson1ListComponentTypesCommand = serializeAws_restJson1ListComponentTypesCommand;
|
|
724
|
+
const serializeAws_restJson1ListEntitiesCommand = async (input, context) => {
|
|
725
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
726
|
+
const headers = {
|
|
727
|
+
"content-type": "application/json",
|
|
728
|
+
};
|
|
729
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces/{workspaceId}/entities-list";
|
|
730
|
+
if (input.workspaceId !== undefined) {
|
|
731
|
+
const labelValue = input.workspaceId;
|
|
732
|
+
if (labelValue.length <= 0) {
|
|
733
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
734
|
+
}
|
|
735
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
736
|
+
}
|
|
737
|
+
else {
|
|
738
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
739
|
+
}
|
|
740
|
+
let body;
|
|
741
|
+
body = JSON.stringify({
|
|
742
|
+
...(input.filters !== undefined &&
|
|
743
|
+
input.filters !== null && { filters: serializeAws_restJson1ListEntitiesFilters(input.filters, context) }),
|
|
744
|
+
...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }),
|
|
745
|
+
...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }),
|
|
746
|
+
});
|
|
747
|
+
let { hostname: resolvedHostname } = await context.endpoint();
|
|
748
|
+
if (context.disableHostPrefix !== true) {
|
|
749
|
+
resolvedHostname = "api." + resolvedHostname;
|
|
750
|
+
if (!protocol_http_1.isValidHostname(resolvedHostname)) {
|
|
751
|
+
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
return new protocol_http_1.HttpRequest({
|
|
755
|
+
protocol,
|
|
756
|
+
hostname: resolvedHostname,
|
|
757
|
+
port,
|
|
758
|
+
method: "POST",
|
|
759
|
+
headers,
|
|
760
|
+
path: resolvedPath,
|
|
761
|
+
body,
|
|
762
|
+
});
|
|
763
|
+
};
|
|
764
|
+
exports.serializeAws_restJson1ListEntitiesCommand = serializeAws_restJson1ListEntitiesCommand;
|
|
765
|
+
const serializeAws_restJson1ListScenesCommand = async (input, context) => {
|
|
766
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
767
|
+
const headers = {
|
|
768
|
+
"content-type": "application/json",
|
|
769
|
+
};
|
|
770
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces/{workspaceId}/scenes-list";
|
|
771
|
+
if (input.workspaceId !== undefined) {
|
|
772
|
+
const labelValue = input.workspaceId;
|
|
773
|
+
if (labelValue.length <= 0) {
|
|
774
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
775
|
+
}
|
|
776
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
777
|
+
}
|
|
778
|
+
else {
|
|
779
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
780
|
+
}
|
|
781
|
+
let body;
|
|
782
|
+
body = JSON.stringify({
|
|
783
|
+
...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }),
|
|
784
|
+
...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }),
|
|
785
|
+
});
|
|
786
|
+
let { hostname: resolvedHostname } = await context.endpoint();
|
|
787
|
+
if (context.disableHostPrefix !== true) {
|
|
788
|
+
resolvedHostname = "api." + resolvedHostname;
|
|
789
|
+
if (!protocol_http_1.isValidHostname(resolvedHostname)) {
|
|
790
|
+
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
return new protocol_http_1.HttpRequest({
|
|
794
|
+
protocol,
|
|
795
|
+
hostname: resolvedHostname,
|
|
796
|
+
port,
|
|
797
|
+
method: "POST",
|
|
798
|
+
headers,
|
|
799
|
+
path: resolvedPath,
|
|
800
|
+
body,
|
|
801
|
+
});
|
|
802
|
+
};
|
|
803
|
+
exports.serializeAws_restJson1ListScenesCommand = serializeAws_restJson1ListScenesCommand;
|
|
804
|
+
const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
|
|
805
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
806
|
+
const headers = {
|
|
807
|
+
"content-type": "application/json",
|
|
808
|
+
};
|
|
809
|
+
const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags-list";
|
|
810
|
+
let body;
|
|
811
|
+
body = JSON.stringify({
|
|
812
|
+
...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }),
|
|
813
|
+
...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }),
|
|
814
|
+
...(input.resourceARN !== undefined && input.resourceARN !== null && { resourceARN: input.resourceARN }),
|
|
815
|
+
});
|
|
816
|
+
let { hostname: resolvedHostname } = await context.endpoint();
|
|
817
|
+
if (context.disableHostPrefix !== true) {
|
|
818
|
+
resolvedHostname = "api." + resolvedHostname;
|
|
819
|
+
if (!protocol_http_1.isValidHostname(resolvedHostname)) {
|
|
820
|
+
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
return new protocol_http_1.HttpRequest({
|
|
824
|
+
protocol,
|
|
825
|
+
hostname: resolvedHostname,
|
|
826
|
+
port,
|
|
827
|
+
method: "POST",
|
|
828
|
+
headers,
|
|
829
|
+
path: resolvedPath,
|
|
830
|
+
body,
|
|
831
|
+
});
|
|
832
|
+
};
|
|
833
|
+
exports.serializeAws_restJson1ListTagsForResourceCommand = serializeAws_restJson1ListTagsForResourceCommand;
|
|
834
|
+
const serializeAws_restJson1ListWorkspacesCommand = async (input, context) => {
|
|
835
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
836
|
+
const headers = {
|
|
837
|
+
"content-type": "application/json",
|
|
838
|
+
};
|
|
839
|
+
const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces-list";
|
|
840
|
+
let body;
|
|
841
|
+
body = JSON.stringify({
|
|
842
|
+
...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }),
|
|
843
|
+
...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }),
|
|
844
|
+
});
|
|
845
|
+
let { hostname: resolvedHostname } = await context.endpoint();
|
|
846
|
+
if (context.disableHostPrefix !== true) {
|
|
847
|
+
resolvedHostname = "api." + resolvedHostname;
|
|
848
|
+
if (!protocol_http_1.isValidHostname(resolvedHostname)) {
|
|
849
|
+
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
return new protocol_http_1.HttpRequest({
|
|
853
|
+
protocol,
|
|
854
|
+
hostname: resolvedHostname,
|
|
855
|
+
port,
|
|
856
|
+
method: "POST",
|
|
857
|
+
headers,
|
|
858
|
+
path: resolvedPath,
|
|
859
|
+
body,
|
|
860
|
+
});
|
|
861
|
+
};
|
|
862
|
+
exports.serializeAws_restJson1ListWorkspacesCommand = serializeAws_restJson1ListWorkspacesCommand;
|
|
863
|
+
const serializeAws_restJson1TagResourceCommand = async (input, context) => {
|
|
864
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
865
|
+
const headers = {
|
|
866
|
+
"content-type": "application/json",
|
|
867
|
+
};
|
|
868
|
+
const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags";
|
|
869
|
+
let body;
|
|
870
|
+
body = JSON.stringify({
|
|
871
|
+
...(input.resourceARN !== undefined && input.resourceARN !== null && { resourceARN: input.resourceARN }),
|
|
872
|
+
...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
|
|
873
|
+
});
|
|
874
|
+
let { hostname: resolvedHostname } = await context.endpoint();
|
|
875
|
+
if (context.disableHostPrefix !== true) {
|
|
876
|
+
resolvedHostname = "api." + resolvedHostname;
|
|
877
|
+
if (!protocol_http_1.isValidHostname(resolvedHostname)) {
|
|
878
|
+
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
return new protocol_http_1.HttpRequest({
|
|
882
|
+
protocol,
|
|
883
|
+
hostname: resolvedHostname,
|
|
884
|
+
port,
|
|
885
|
+
method: "POST",
|
|
886
|
+
headers,
|
|
887
|
+
path: resolvedPath,
|
|
888
|
+
body,
|
|
889
|
+
});
|
|
890
|
+
};
|
|
891
|
+
exports.serializeAws_restJson1TagResourceCommand = serializeAws_restJson1TagResourceCommand;
|
|
892
|
+
const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
|
|
893
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
894
|
+
const headers = {};
|
|
895
|
+
const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags";
|
|
896
|
+
const query = {
|
|
897
|
+
...(input.resourceARN !== undefined && { resourceARN: input.resourceARN }),
|
|
898
|
+
...(input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map((_entry) => _entry) }),
|
|
899
|
+
};
|
|
900
|
+
let body;
|
|
901
|
+
let { hostname: resolvedHostname } = await context.endpoint();
|
|
902
|
+
if (context.disableHostPrefix !== true) {
|
|
903
|
+
resolvedHostname = "api." + resolvedHostname;
|
|
904
|
+
if (!protocol_http_1.isValidHostname(resolvedHostname)) {
|
|
905
|
+
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
return new protocol_http_1.HttpRequest({
|
|
909
|
+
protocol,
|
|
910
|
+
hostname: resolvedHostname,
|
|
911
|
+
port,
|
|
912
|
+
method: "DELETE",
|
|
913
|
+
headers,
|
|
914
|
+
path: resolvedPath,
|
|
915
|
+
query,
|
|
916
|
+
body,
|
|
917
|
+
});
|
|
918
|
+
};
|
|
919
|
+
exports.serializeAws_restJson1UntagResourceCommand = serializeAws_restJson1UntagResourceCommand;
|
|
920
|
+
const serializeAws_restJson1UpdateComponentTypeCommand = async (input, context) => {
|
|
921
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
922
|
+
const headers = {
|
|
923
|
+
"content-type": "application/json",
|
|
924
|
+
};
|
|
925
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
926
|
+
"/workspaces/{workspaceId}/component-types/{componentTypeId}";
|
|
927
|
+
if (input.workspaceId !== undefined) {
|
|
928
|
+
const labelValue = input.workspaceId;
|
|
929
|
+
if (labelValue.length <= 0) {
|
|
930
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
931
|
+
}
|
|
932
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
933
|
+
}
|
|
934
|
+
else {
|
|
935
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
936
|
+
}
|
|
937
|
+
if (input.componentTypeId !== undefined) {
|
|
938
|
+
const labelValue = input.componentTypeId;
|
|
939
|
+
if (labelValue.length <= 0) {
|
|
940
|
+
throw new Error("Empty value provided for input HTTP label: componentTypeId.");
|
|
941
|
+
}
|
|
942
|
+
resolvedPath = resolvedPath.replace("{componentTypeId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
943
|
+
}
|
|
944
|
+
else {
|
|
945
|
+
throw new Error("No value provided for input HTTP label: componentTypeId.");
|
|
946
|
+
}
|
|
947
|
+
let body;
|
|
948
|
+
body = JSON.stringify({
|
|
949
|
+
...(input.description !== undefined && input.description !== null && { description: input.description }),
|
|
950
|
+
...(input.extendsFrom !== undefined &&
|
|
951
|
+
input.extendsFrom !== null && { extendsFrom: serializeAws_restJson1ExtendsFrom(input.extendsFrom, context) }),
|
|
952
|
+
...(input.functions !== undefined &&
|
|
953
|
+
input.functions !== null && { functions: serializeAws_restJson1FunctionsRequest(input.functions, context) }),
|
|
954
|
+
...(input.isSingleton !== undefined && input.isSingleton !== null && { isSingleton: input.isSingleton }),
|
|
955
|
+
...(input.propertyDefinitions !== undefined &&
|
|
956
|
+
input.propertyDefinitions !== null && {
|
|
957
|
+
propertyDefinitions: serializeAws_restJson1PropertyDefinitionsRequest(input.propertyDefinitions, context),
|
|
958
|
+
}),
|
|
959
|
+
});
|
|
960
|
+
let { hostname: resolvedHostname } = await context.endpoint();
|
|
961
|
+
if (context.disableHostPrefix !== true) {
|
|
962
|
+
resolvedHostname = "api." + resolvedHostname;
|
|
963
|
+
if (!protocol_http_1.isValidHostname(resolvedHostname)) {
|
|
964
|
+
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
return new protocol_http_1.HttpRequest({
|
|
968
|
+
protocol,
|
|
969
|
+
hostname: resolvedHostname,
|
|
970
|
+
port,
|
|
971
|
+
method: "PUT",
|
|
972
|
+
headers,
|
|
973
|
+
path: resolvedPath,
|
|
974
|
+
body,
|
|
975
|
+
});
|
|
976
|
+
};
|
|
977
|
+
exports.serializeAws_restJson1UpdateComponentTypeCommand = serializeAws_restJson1UpdateComponentTypeCommand;
|
|
978
|
+
const serializeAws_restJson1UpdateEntityCommand = async (input, context) => {
|
|
979
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
980
|
+
const headers = {
|
|
981
|
+
"content-type": "application/json",
|
|
982
|
+
};
|
|
983
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
984
|
+
"/workspaces/{workspaceId}/entities/{entityId}";
|
|
985
|
+
if (input.workspaceId !== undefined) {
|
|
986
|
+
const labelValue = input.workspaceId;
|
|
987
|
+
if (labelValue.length <= 0) {
|
|
988
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
989
|
+
}
|
|
990
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
991
|
+
}
|
|
992
|
+
else {
|
|
993
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
994
|
+
}
|
|
995
|
+
if (input.entityId !== undefined) {
|
|
996
|
+
const labelValue = input.entityId;
|
|
997
|
+
if (labelValue.length <= 0) {
|
|
998
|
+
throw new Error("Empty value provided for input HTTP label: entityId.");
|
|
999
|
+
}
|
|
1000
|
+
resolvedPath = resolvedPath.replace("{entityId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
1001
|
+
}
|
|
1002
|
+
else {
|
|
1003
|
+
throw new Error("No value provided for input HTTP label: entityId.");
|
|
1004
|
+
}
|
|
1005
|
+
let body;
|
|
1006
|
+
body = JSON.stringify({
|
|
1007
|
+
...(input.componentUpdates !== undefined &&
|
|
1008
|
+
input.componentUpdates !== null && {
|
|
1009
|
+
componentUpdates: serializeAws_restJson1ComponentUpdatesMapRequest(input.componentUpdates, context),
|
|
1010
|
+
}),
|
|
1011
|
+
...(input.description !== undefined && input.description !== null && { description: input.description }),
|
|
1012
|
+
...(input.entityName !== undefined && input.entityName !== null && { entityName: input.entityName }),
|
|
1013
|
+
...(input.parentEntityUpdate !== undefined &&
|
|
1014
|
+
input.parentEntityUpdate !== null && {
|
|
1015
|
+
parentEntityUpdate: serializeAws_restJson1ParentEntityUpdateRequest(input.parentEntityUpdate, context),
|
|
1016
|
+
}),
|
|
1017
|
+
});
|
|
1018
|
+
let { hostname: resolvedHostname } = await context.endpoint();
|
|
1019
|
+
if (context.disableHostPrefix !== true) {
|
|
1020
|
+
resolvedHostname = "api." + resolvedHostname;
|
|
1021
|
+
if (!protocol_http_1.isValidHostname(resolvedHostname)) {
|
|
1022
|
+
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
return new protocol_http_1.HttpRequest({
|
|
1026
|
+
protocol,
|
|
1027
|
+
hostname: resolvedHostname,
|
|
1028
|
+
port,
|
|
1029
|
+
method: "PUT",
|
|
1030
|
+
headers,
|
|
1031
|
+
path: resolvedPath,
|
|
1032
|
+
body,
|
|
1033
|
+
});
|
|
1034
|
+
};
|
|
1035
|
+
exports.serializeAws_restJson1UpdateEntityCommand = serializeAws_restJson1UpdateEntityCommand;
|
|
1036
|
+
const serializeAws_restJson1UpdateSceneCommand = async (input, context) => {
|
|
1037
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
1038
|
+
const headers = {
|
|
1039
|
+
"content-type": "application/json",
|
|
1040
|
+
};
|
|
1041
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
|
|
1042
|
+
"/workspaces/{workspaceId}/scenes/{sceneId}";
|
|
1043
|
+
if (input.workspaceId !== undefined) {
|
|
1044
|
+
const labelValue = input.workspaceId;
|
|
1045
|
+
if (labelValue.length <= 0) {
|
|
1046
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
1047
|
+
}
|
|
1048
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
1049
|
+
}
|
|
1050
|
+
else {
|
|
1051
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
1052
|
+
}
|
|
1053
|
+
if (input.sceneId !== undefined) {
|
|
1054
|
+
const labelValue = input.sceneId;
|
|
1055
|
+
if (labelValue.length <= 0) {
|
|
1056
|
+
throw new Error("Empty value provided for input HTTP label: sceneId.");
|
|
1057
|
+
}
|
|
1058
|
+
resolvedPath = resolvedPath.replace("{sceneId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
1059
|
+
}
|
|
1060
|
+
else {
|
|
1061
|
+
throw new Error("No value provided for input HTTP label: sceneId.");
|
|
1062
|
+
}
|
|
1063
|
+
let body;
|
|
1064
|
+
body = JSON.stringify({
|
|
1065
|
+
...(input.capabilities !== undefined &&
|
|
1066
|
+
input.capabilities !== null && {
|
|
1067
|
+
capabilities: serializeAws_restJson1SceneCapabilities(input.capabilities, context),
|
|
1068
|
+
}),
|
|
1069
|
+
...(input.contentLocation !== undefined &&
|
|
1070
|
+
input.contentLocation !== null && { contentLocation: input.contentLocation }),
|
|
1071
|
+
...(input.description !== undefined && input.description !== null && { description: input.description }),
|
|
1072
|
+
});
|
|
1073
|
+
let { hostname: resolvedHostname } = await context.endpoint();
|
|
1074
|
+
if (context.disableHostPrefix !== true) {
|
|
1075
|
+
resolvedHostname = "api." + resolvedHostname;
|
|
1076
|
+
if (!protocol_http_1.isValidHostname(resolvedHostname)) {
|
|
1077
|
+
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
return new protocol_http_1.HttpRequest({
|
|
1081
|
+
protocol,
|
|
1082
|
+
hostname: resolvedHostname,
|
|
1083
|
+
port,
|
|
1084
|
+
method: "PUT",
|
|
1085
|
+
headers,
|
|
1086
|
+
path: resolvedPath,
|
|
1087
|
+
body,
|
|
1088
|
+
});
|
|
1089
|
+
};
|
|
1090
|
+
exports.serializeAws_restJson1UpdateSceneCommand = serializeAws_restJson1UpdateSceneCommand;
|
|
1091
|
+
const serializeAws_restJson1UpdateWorkspaceCommand = async (input, context) => {
|
|
1092
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
1093
|
+
const headers = {
|
|
1094
|
+
"content-type": "application/json",
|
|
1095
|
+
};
|
|
1096
|
+
let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces/{workspaceId}";
|
|
1097
|
+
if (input.workspaceId !== undefined) {
|
|
1098
|
+
const labelValue = input.workspaceId;
|
|
1099
|
+
if (labelValue.length <= 0) {
|
|
1100
|
+
throw new Error("Empty value provided for input HTTP label: workspaceId.");
|
|
1101
|
+
}
|
|
1102
|
+
resolvedPath = resolvedPath.replace("{workspaceId}", smithy_client_1.extendedEncodeURIComponent(labelValue));
|
|
1103
|
+
}
|
|
1104
|
+
else {
|
|
1105
|
+
throw new Error("No value provided for input HTTP label: workspaceId.");
|
|
1106
|
+
}
|
|
1107
|
+
let body;
|
|
1108
|
+
body = JSON.stringify({
|
|
1109
|
+
...(input.description !== undefined && input.description !== null && { description: input.description }),
|
|
1110
|
+
...(input.role !== undefined && input.role !== null && { role: input.role }),
|
|
1111
|
+
});
|
|
1112
|
+
let { hostname: resolvedHostname } = await context.endpoint();
|
|
1113
|
+
if (context.disableHostPrefix !== true) {
|
|
1114
|
+
resolvedHostname = "api." + resolvedHostname;
|
|
1115
|
+
if (!protocol_http_1.isValidHostname(resolvedHostname)) {
|
|
1116
|
+
throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
return new protocol_http_1.HttpRequest({
|
|
1120
|
+
protocol,
|
|
1121
|
+
hostname: resolvedHostname,
|
|
1122
|
+
port,
|
|
1123
|
+
method: "PUT",
|
|
1124
|
+
headers,
|
|
1125
|
+
path: resolvedPath,
|
|
1126
|
+
body,
|
|
1127
|
+
});
|
|
1128
|
+
};
|
|
1129
|
+
exports.serializeAws_restJson1UpdateWorkspaceCommand = serializeAws_restJson1UpdateWorkspaceCommand;
|
|
1130
|
+
const deserializeAws_restJson1BatchPutPropertyValuesCommand = async (output, context) => {
|
|
1131
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1132
|
+
return deserializeAws_restJson1BatchPutPropertyValuesCommandError(output, context);
|
|
1133
|
+
}
|
|
1134
|
+
const contents = {
|
|
1135
|
+
$metadata: deserializeMetadata(output),
|
|
1136
|
+
errorEntries: undefined,
|
|
1137
|
+
};
|
|
1138
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
1139
|
+
if (data.errorEntries !== undefined && data.errorEntries !== null) {
|
|
1140
|
+
contents.errorEntries = deserializeAws_restJson1ErrorEntries(data.errorEntries, context);
|
|
1141
|
+
}
|
|
1142
|
+
return Promise.resolve(contents);
|
|
1143
|
+
};
|
|
1144
|
+
exports.deserializeAws_restJson1BatchPutPropertyValuesCommand = deserializeAws_restJson1BatchPutPropertyValuesCommand;
|
|
1145
|
+
const deserializeAws_restJson1BatchPutPropertyValuesCommandError = async (output, context) => {
|
|
1146
|
+
const parsedOutput = {
|
|
1147
|
+
...output,
|
|
1148
|
+
body: await parseBody(output.body, context),
|
|
1149
|
+
};
|
|
1150
|
+
let response;
|
|
1151
|
+
let errorCode = "UnknownError";
|
|
1152
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1153
|
+
switch (errorCode) {
|
|
1154
|
+
case "InternalServerException":
|
|
1155
|
+
case "com.amazonaws.iottwinmaker#InternalServerException":
|
|
1156
|
+
response = {
|
|
1157
|
+
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
1158
|
+
name: errorCode,
|
|
1159
|
+
$metadata: deserializeMetadata(output),
|
|
1160
|
+
};
|
|
1161
|
+
break;
|
|
1162
|
+
case "ResourceNotFoundException":
|
|
1163
|
+
case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
|
|
1164
|
+
response = {
|
|
1165
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
1166
|
+
name: errorCode,
|
|
1167
|
+
$metadata: deserializeMetadata(output),
|
|
1168
|
+
};
|
|
1169
|
+
break;
|
|
1170
|
+
case "ThrottlingException":
|
|
1171
|
+
case "com.amazonaws.iottwinmaker#ThrottlingException":
|
|
1172
|
+
response = {
|
|
1173
|
+
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
1174
|
+
name: errorCode,
|
|
1175
|
+
$metadata: deserializeMetadata(output),
|
|
1176
|
+
};
|
|
1177
|
+
break;
|
|
1178
|
+
case "ValidationException":
|
|
1179
|
+
case "com.amazonaws.iottwinmaker#ValidationException":
|
|
1180
|
+
response = {
|
|
1181
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
1182
|
+
name: errorCode,
|
|
1183
|
+
$metadata: deserializeMetadata(output),
|
|
1184
|
+
};
|
|
1185
|
+
break;
|
|
1186
|
+
default:
|
|
1187
|
+
const parsedBody = parsedOutput.body;
|
|
1188
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1189
|
+
response = {
|
|
1190
|
+
...parsedBody,
|
|
1191
|
+
name: `${errorCode}`,
|
|
1192
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1193
|
+
$fault: "client",
|
|
1194
|
+
$metadata: deserializeMetadata(output),
|
|
1195
|
+
};
|
|
1196
|
+
}
|
|
1197
|
+
const message = response.message || response.Message || errorCode;
|
|
1198
|
+
response.message = message;
|
|
1199
|
+
delete response.Message;
|
|
1200
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
1201
|
+
};
|
|
1202
|
+
const deserializeAws_restJson1CreateComponentTypeCommand = async (output, context) => {
|
|
1203
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1204
|
+
return deserializeAws_restJson1CreateComponentTypeCommandError(output, context);
|
|
1205
|
+
}
|
|
1206
|
+
const contents = {
|
|
1207
|
+
$metadata: deserializeMetadata(output),
|
|
1208
|
+
arn: undefined,
|
|
1209
|
+
creationDateTime: undefined,
|
|
1210
|
+
state: undefined,
|
|
1211
|
+
};
|
|
1212
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
1213
|
+
if (data.arn !== undefined && data.arn !== null) {
|
|
1214
|
+
contents.arn = smithy_client_1.expectString(data.arn);
|
|
1215
|
+
}
|
|
1216
|
+
if (data.creationDateTime !== undefined && data.creationDateTime !== null) {
|
|
1217
|
+
contents.creationDateTime = smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(data.creationDateTime)));
|
|
1218
|
+
}
|
|
1219
|
+
if (data.state !== undefined && data.state !== null) {
|
|
1220
|
+
contents.state = smithy_client_1.expectString(data.state);
|
|
1221
|
+
}
|
|
1222
|
+
return Promise.resolve(contents);
|
|
1223
|
+
};
|
|
1224
|
+
exports.deserializeAws_restJson1CreateComponentTypeCommand = deserializeAws_restJson1CreateComponentTypeCommand;
|
|
1225
|
+
const deserializeAws_restJson1CreateComponentTypeCommandError = async (output, context) => {
|
|
1226
|
+
const parsedOutput = {
|
|
1227
|
+
...output,
|
|
1228
|
+
body: await parseBody(output.body, context),
|
|
1229
|
+
};
|
|
1230
|
+
let response;
|
|
1231
|
+
let errorCode = "UnknownError";
|
|
1232
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1233
|
+
switch (errorCode) {
|
|
1234
|
+
case "AccessDeniedException":
|
|
1235
|
+
case "com.amazonaws.iottwinmaker#AccessDeniedException":
|
|
1236
|
+
response = {
|
|
1237
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
1238
|
+
name: errorCode,
|
|
1239
|
+
$metadata: deserializeMetadata(output),
|
|
1240
|
+
};
|
|
1241
|
+
break;
|
|
1242
|
+
case "ConflictException":
|
|
1243
|
+
case "com.amazonaws.iottwinmaker#ConflictException":
|
|
1244
|
+
response = {
|
|
1245
|
+
...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
|
|
1246
|
+
name: errorCode,
|
|
1247
|
+
$metadata: deserializeMetadata(output),
|
|
1248
|
+
};
|
|
1249
|
+
break;
|
|
1250
|
+
case "InternalServerException":
|
|
1251
|
+
case "com.amazonaws.iottwinmaker#InternalServerException":
|
|
1252
|
+
response = {
|
|
1253
|
+
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
1254
|
+
name: errorCode,
|
|
1255
|
+
$metadata: deserializeMetadata(output),
|
|
1256
|
+
};
|
|
1257
|
+
break;
|
|
1258
|
+
case "ServiceQuotaExceededException":
|
|
1259
|
+
case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException":
|
|
1260
|
+
response = {
|
|
1261
|
+
...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
|
|
1262
|
+
name: errorCode,
|
|
1263
|
+
$metadata: deserializeMetadata(output),
|
|
1264
|
+
};
|
|
1265
|
+
break;
|
|
1266
|
+
case "ThrottlingException":
|
|
1267
|
+
case "com.amazonaws.iottwinmaker#ThrottlingException":
|
|
1268
|
+
response = {
|
|
1269
|
+
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
1270
|
+
name: errorCode,
|
|
1271
|
+
$metadata: deserializeMetadata(output),
|
|
1272
|
+
};
|
|
1273
|
+
break;
|
|
1274
|
+
case "ValidationException":
|
|
1275
|
+
case "com.amazonaws.iottwinmaker#ValidationException":
|
|
1276
|
+
response = {
|
|
1277
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
1278
|
+
name: errorCode,
|
|
1279
|
+
$metadata: deserializeMetadata(output),
|
|
1280
|
+
};
|
|
1281
|
+
break;
|
|
1282
|
+
default:
|
|
1283
|
+
const parsedBody = parsedOutput.body;
|
|
1284
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1285
|
+
response = {
|
|
1286
|
+
...parsedBody,
|
|
1287
|
+
name: `${errorCode}`,
|
|
1288
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1289
|
+
$fault: "client",
|
|
1290
|
+
$metadata: deserializeMetadata(output),
|
|
1291
|
+
};
|
|
1292
|
+
}
|
|
1293
|
+
const message = response.message || response.Message || errorCode;
|
|
1294
|
+
response.message = message;
|
|
1295
|
+
delete response.Message;
|
|
1296
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
1297
|
+
};
|
|
1298
|
+
const deserializeAws_restJson1CreateEntityCommand = async (output, context) => {
|
|
1299
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1300
|
+
return deserializeAws_restJson1CreateEntityCommandError(output, context);
|
|
1301
|
+
}
|
|
1302
|
+
const contents = {
|
|
1303
|
+
$metadata: deserializeMetadata(output),
|
|
1304
|
+
arn: undefined,
|
|
1305
|
+
creationDateTime: undefined,
|
|
1306
|
+
entityId: undefined,
|
|
1307
|
+
state: undefined,
|
|
1308
|
+
};
|
|
1309
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
1310
|
+
if (data.arn !== undefined && data.arn !== null) {
|
|
1311
|
+
contents.arn = smithy_client_1.expectString(data.arn);
|
|
1312
|
+
}
|
|
1313
|
+
if (data.creationDateTime !== undefined && data.creationDateTime !== null) {
|
|
1314
|
+
contents.creationDateTime = smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(data.creationDateTime)));
|
|
1315
|
+
}
|
|
1316
|
+
if (data.entityId !== undefined && data.entityId !== null) {
|
|
1317
|
+
contents.entityId = smithy_client_1.expectString(data.entityId);
|
|
1318
|
+
}
|
|
1319
|
+
if (data.state !== undefined && data.state !== null) {
|
|
1320
|
+
contents.state = smithy_client_1.expectString(data.state);
|
|
1321
|
+
}
|
|
1322
|
+
return Promise.resolve(contents);
|
|
1323
|
+
};
|
|
1324
|
+
exports.deserializeAws_restJson1CreateEntityCommand = deserializeAws_restJson1CreateEntityCommand;
|
|
1325
|
+
const deserializeAws_restJson1CreateEntityCommandError = async (output, context) => {
|
|
1326
|
+
const parsedOutput = {
|
|
1327
|
+
...output,
|
|
1328
|
+
body: await parseBody(output.body, context),
|
|
1329
|
+
};
|
|
1330
|
+
let response;
|
|
1331
|
+
let errorCode = "UnknownError";
|
|
1332
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1333
|
+
switch (errorCode) {
|
|
1334
|
+
case "AccessDeniedException":
|
|
1335
|
+
case "com.amazonaws.iottwinmaker#AccessDeniedException":
|
|
1336
|
+
response = {
|
|
1337
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
1338
|
+
name: errorCode,
|
|
1339
|
+
$metadata: deserializeMetadata(output),
|
|
1340
|
+
};
|
|
1341
|
+
break;
|
|
1342
|
+
case "ConflictException":
|
|
1343
|
+
case "com.amazonaws.iottwinmaker#ConflictException":
|
|
1344
|
+
response = {
|
|
1345
|
+
...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
|
|
1346
|
+
name: errorCode,
|
|
1347
|
+
$metadata: deserializeMetadata(output),
|
|
1348
|
+
};
|
|
1349
|
+
break;
|
|
1350
|
+
case "InternalServerException":
|
|
1351
|
+
case "com.amazonaws.iottwinmaker#InternalServerException":
|
|
1352
|
+
response = {
|
|
1353
|
+
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
1354
|
+
name: errorCode,
|
|
1355
|
+
$metadata: deserializeMetadata(output),
|
|
1356
|
+
};
|
|
1357
|
+
break;
|
|
1358
|
+
case "ServiceQuotaExceededException":
|
|
1359
|
+
case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException":
|
|
1360
|
+
response = {
|
|
1361
|
+
...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
|
|
1362
|
+
name: errorCode,
|
|
1363
|
+
$metadata: deserializeMetadata(output),
|
|
1364
|
+
};
|
|
1365
|
+
break;
|
|
1366
|
+
case "ThrottlingException":
|
|
1367
|
+
case "com.amazonaws.iottwinmaker#ThrottlingException":
|
|
1368
|
+
response = {
|
|
1369
|
+
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
1370
|
+
name: errorCode,
|
|
1371
|
+
$metadata: deserializeMetadata(output),
|
|
1372
|
+
};
|
|
1373
|
+
break;
|
|
1374
|
+
case "ValidationException":
|
|
1375
|
+
case "com.amazonaws.iottwinmaker#ValidationException":
|
|
1376
|
+
response = {
|
|
1377
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
1378
|
+
name: errorCode,
|
|
1379
|
+
$metadata: deserializeMetadata(output),
|
|
1380
|
+
};
|
|
1381
|
+
break;
|
|
1382
|
+
default:
|
|
1383
|
+
const parsedBody = parsedOutput.body;
|
|
1384
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1385
|
+
response = {
|
|
1386
|
+
...parsedBody,
|
|
1387
|
+
name: `${errorCode}`,
|
|
1388
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1389
|
+
$fault: "client",
|
|
1390
|
+
$metadata: deserializeMetadata(output),
|
|
1391
|
+
};
|
|
1392
|
+
}
|
|
1393
|
+
const message = response.message || response.Message || errorCode;
|
|
1394
|
+
response.message = message;
|
|
1395
|
+
delete response.Message;
|
|
1396
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
1397
|
+
};
|
|
1398
|
+
const deserializeAws_restJson1CreateSceneCommand = async (output, context) => {
|
|
1399
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1400
|
+
return deserializeAws_restJson1CreateSceneCommandError(output, context);
|
|
1401
|
+
}
|
|
1402
|
+
const contents = {
|
|
1403
|
+
$metadata: deserializeMetadata(output),
|
|
1404
|
+
arn: undefined,
|
|
1405
|
+
creationDateTime: undefined,
|
|
1406
|
+
};
|
|
1407
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
1408
|
+
if (data.arn !== undefined && data.arn !== null) {
|
|
1409
|
+
contents.arn = smithy_client_1.expectString(data.arn);
|
|
1410
|
+
}
|
|
1411
|
+
if (data.creationDateTime !== undefined && data.creationDateTime !== null) {
|
|
1412
|
+
contents.creationDateTime = smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(data.creationDateTime)));
|
|
1413
|
+
}
|
|
1414
|
+
return Promise.resolve(contents);
|
|
1415
|
+
};
|
|
1416
|
+
exports.deserializeAws_restJson1CreateSceneCommand = deserializeAws_restJson1CreateSceneCommand;
|
|
1417
|
+
const deserializeAws_restJson1CreateSceneCommandError = async (output, context) => {
|
|
1418
|
+
const parsedOutput = {
|
|
1419
|
+
...output,
|
|
1420
|
+
body: await parseBody(output.body, context),
|
|
1421
|
+
};
|
|
1422
|
+
let response;
|
|
1423
|
+
let errorCode = "UnknownError";
|
|
1424
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1425
|
+
switch (errorCode) {
|
|
1426
|
+
case "AccessDeniedException":
|
|
1427
|
+
case "com.amazonaws.iottwinmaker#AccessDeniedException":
|
|
1428
|
+
response = {
|
|
1429
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
1430
|
+
name: errorCode,
|
|
1431
|
+
$metadata: deserializeMetadata(output),
|
|
1432
|
+
};
|
|
1433
|
+
break;
|
|
1434
|
+
case "ConflictException":
|
|
1435
|
+
case "com.amazonaws.iottwinmaker#ConflictException":
|
|
1436
|
+
response = {
|
|
1437
|
+
...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
|
|
1438
|
+
name: errorCode,
|
|
1439
|
+
$metadata: deserializeMetadata(output),
|
|
1440
|
+
};
|
|
1441
|
+
break;
|
|
1442
|
+
case "InternalServerException":
|
|
1443
|
+
case "com.amazonaws.iottwinmaker#InternalServerException":
|
|
1444
|
+
response = {
|
|
1445
|
+
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
1446
|
+
name: errorCode,
|
|
1447
|
+
$metadata: deserializeMetadata(output),
|
|
1448
|
+
};
|
|
1449
|
+
break;
|
|
1450
|
+
case "ServiceQuotaExceededException":
|
|
1451
|
+
case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException":
|
|
1452
|
+
response = {
|
|
1453
|
+
...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
|
|
1454
|
+
name: errorCode,
|
|
1455
|
+
$metadata: deserializeMetadata(output),
|
|
1456
|
+
};
|
|
1457
|
+
break;
|
|
1458
|
+
case "ThrottlingException":
|
|
1459
|
+
case "com.amazonaws.iottwinmaker#ThrottlingException":
|
|
1460
|
+
response = {
|
|
1461
|
+
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
1462
|
+
name: errorCode,
|
|
1463
|
+
$metadata: deserializeMetadata(output),
|
|
1464
|
+
};
|
|
1465
|
+
break;
|
|
1466
|
+
case "ValidationException":
|
|
1467
|
+
case "com.amazonaws.iottwinmaker#ValidationException":
|
|
1468
|
+
response = {
|
|
1469
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
1470
|
+
name: errorCode,
|
|
1471
|
+
$metadata: deserializeMetadata(output),
|
|
1472
|
+
};
|
|
1473
|
+
break;
|
|
1474
|
+
default:
|
|
1475
|
+
const parsedBody = parsedOutput.body;
|
|
1476
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1477
|
+
response = {
|
|
1478
|
+
...parsedBody,
|
|
1479
|
+
name: `${errorCode}`,
|
|
1480
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1481
|
+
$fault: "client",
|
|
1482
|
+
$metadata: deserializeMetadata(output),
|
|
1483
|
+
};
|
|
1484
|
+
}
|
|
1485
|
+
const message = response.message || response.Message || errorCode;
|
|
1486
|
+
response.message = message;
|
|
1487
|
+
delete response.Message;
|
|
1488
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
1489
|
+
};
|
|
1490
|
+
const deserializeAws_restJson1CreateWorkspaceCommand = async (output, context) => {
|
|
1491
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1492
|
+
return deserializeAws_restJson1CreateWorkspaceCommandError(output, context);
|
|
1493
|
+
}
|
|
1494
|
+
const contents = {
|
|
1495
|
+
$metadata: deserializeMetadata(output),
|
|
1496
|
+
arn: undefined,
|
|
1497
|
+
creationDateTime: undefined,
|
|
1498
|
+
};
|
|
1499
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
1500
|
+
if (data.arn !== undefined && data.arn !== null) {
|
|
1501
|
+
contents.arn = smithy_client_1.expectString(data.arn);
|
|
1502
|
+
}
|
|
1503
|
+
if (data.creationDateTime !== undefined && data.creationDateTime !== null) {
|
|
1504
|
+
contents.creationDateTime = smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(data.creationDateTime)));
|
|
1505
|
+
}
|
|
1506
|
+
return Promise.resolve(contents);
|
|
1507
|
+
};
|
|
1508
|
+
exports.deserializeAws_restJson1CreateWorkspaceCommand = deserializeAws_restJson1CreateWorkspaceCommand;
|
|
1509
|
+
const deserializeAws_restJson1CreateWorkspaceCommandError = async (output, context) => {
|
|
1510
|
+
const parsedOutput = {
|
|
1511
|
+
...output,
|
|
1512
|
+
body: await parseBody(output.body, context),
|
|
1513
|
+
};
|
|
1514
|
+
let response;
|
|
1515
|
+
let errorCode = "UnknownError";
|
|
1516
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1517
|
+
switch (errorCode) {
|
|
1518
|
+
case "AccessDeniedException":
|
|
1519
|
+
case "com.amazonaws.iottwinmaker#AccessDeniedException":
|
|
1520
|
+
response = {
|
|
1521
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
1522
|
+
name: errorCode,
|
|
1523
|
+
$metadata: deserializeMetadata(output),
|
|
1524
|
+
};
|
|
1525
|
+
break;
|
|
1526
|
+
case "ConflictException":
|
|
1527
|
+
case "com.amazonaws.iottwinmaker#ConflictException":
|
|
1528
|
+
response = {
|
|
1529
|
+
...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
|
|
1530
|
+
name: errorCode,
|
|
1531
|
+
$metadata: deserializeMetadata(output),
|
|
1532
|
+
};
|
|
1533
|
+
break;
|
|
1534
|
+
case "InternalServerException":
|
|
1535
|
+
case "com.amazonaws.iottwinmaker#InternalServerException":
|
|
1536
|
+
response = {
|
|
1537
|
+
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
1538
|
+
name: errorCode,
|
|
1539
|
+
$metadata: deserializeMetadata(output),
|
|
1540
|
+
};
|
|
1541
|
+
break;
|
|
1542
|
+
case "ServiceQuotaExceededException":
|
|
1543
|
+
case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException":
|
|
1544
|
+
response = {
|
|
1545
|
+
...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
|
|
1546
|
+
name: errorCode,
|
|
1547
|
+
$metadata: deserializeMetadata(output),
|
|
1548
|
+
};
|
|
1549
|
+
break;
|
|
1550
|
+
case "ThrottlingException":
|
|
1551
|
+
case "com.amazonaws.iottwinmaker#ThrottlingException":
|
|
1552
|
+
response = {
|
|
1553
|
+
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
1554
|
+
name: errorCode,
|
|
1555
|
+
$metadata: deserializeMetadata(output),
|
|
1556
|
+
};
|
|
1557
|
+
break;
|
|
1558
|
+
case "ValidationException":
|
|
1559
|
+
case "com.amazonaws.iottwinmaker#ValidationException":
|
|
1560
|
+
response = {
|
|
1561
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
1562
|
+
name: errorCode,
|
|
1563
|
+
$metadata: deserializeMetadata(output),
|
|
1564
|
+
};
|
|
1565
|
+
break;
|
|
1566
|
+
default:
|
|
1567
|
+
const parsedBody = parsedOutput.body;
|
|
1568
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1569
|
+
response = {
|
|
1570
|
+
...parsedBody,
|
|
1571
|
+
name: `${errorCode}`,
|
|
1572
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1573
|
+
$fault: "client",
|
|
1574
|
+
$metadata: deserializeMetadata(output),
|
|
1575
|
+
};
|
|
1576
|
+
}
|
|
1577
|
+
const message = response.message || response.Message || errorCode;
|
|
1578
|
+
response.message = message;
|
|
1579
|
+
delete response.Message;
|
|
1580
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
1581
|
+
};
|
|
1582
|
+
const deserializeAws_restJson1DeleteComponentTypeCommand = async (output, context) => {
|
|
1583
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1584
|
+
return deserializeAws_restJson1DeleteComponentTypeCommandError(output, context);
|
|
1585
|
+
}
|
|
1586
|
+
const contents = {
|
|
1587
|
+
$metadata: deserializeMetadata(output),
|
|
1588
|
+
state: undefined,
|
|
1589
|
+
};
|
|
1590
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
1591
|
+
if (data.state !== undefined && data.state !== null) {
|
|
1592
|
+
contents.state = smithy_client_1.expectString(data.state);
|
|
1593
|
+
}
|
|
1594
|
+
return Promise.resolve(contents);
|
|
1595
|
+
};
|
|
1596
|
+
exports.deserializeAws_restJson1DeleteComponentTypeCommand = deserializeAws_restJson1DeleteComponentTypeCommand;
|
|
1597
|
+
const deserializeAws_restJson1DeleteComponentTypeCommandError = async (output, context) => {
|
|
1598
|
+
const parsedOutput = {
|
|
1599
|
+
...output,
|
|
1600
|
+
body: await parseBody(output.body, context),
|
|
1601
|
+
};
|
|
1602
|
+
let response;
|
|
1603
|
+
let errorCode = "UnknownError";
|
|
1604
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1605
|
+
switch (errorCode) {
|
|
1606
|
+
case "AccessDeniedException":
|
|
1607
|
+
case "com.amazonaws.iottwinmaker#AccessDeniedException":
|
|
1608
|
+
response = {
|
|
1609
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
1610
|
+
name: errorCode,
|
|
1611
|
+
$metadata: deserializeMetadata(output),
|
|
1612
|
+
};
|
|
1613
|
+
break;
|
|
1614
|
+
case "InternalServerException":
|
|
1615
|
+
case "com.amazonaws.iottwinmaker#InternalServerException":
|
|
1616
|
+
response = {
|
|
1617
|
+
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
1618
|
+
name: errorCode,
|
|
1619
|
+
$metadata: deserializeMetadata(output),
|
|
1620
|
+
};
|
|
1621
|
+
break;
|
|
1622
|
+
case "ResourceNotFoundException":
|
|
1623
|
+
case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
|
|
1624
|
+
response = {
|
|
1625
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
1626
|
+
name: errorCode,
|
|
1627
|
+
$metadata: deserializeMetadata(output),
|
|
1628
|
+
};
|
|
1629
|
+
break;
|
|
1630
|
+
case "ThrottlingException":
|
|
1631
|
+
case "com.amazonaws.iottwinmaker#ThrottlingException":
|
|
1632
|
+
response = {
|
|
1633
|
+
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
1634
|
+
name: errorCode,
|
|
1635
|
+
$metadata: deserializeMetadata(output),
|
|
1636
|
+
};
|
|
1637
|
+
break;
|
|
1638
|
+
case "ValidationException":
|
|
1639
|
+
case "com.amazonaws.iottwinmaker#ValidationException":
|
|
1640
|
+
response = {
|
|
1641
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
1642
|
+
name: errorCode,
|
|
1643
|
+
$metadata: deserializeMetadata(output),
|
|
1644
|
+
};
|
|
1645
|
+
break;
|
|
1646
|
+
default:
|
|
1647
|
+
const parsedBody = parsedOutput.body;
|
|
1648
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1649
|
+
response = {
|
|
1650
|
+
...parsedBody,
|
|
1651
|
+
name: `${errorCode}`,
|
|
1652
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1653
|
+
$fault: "client",
|
|
1654
|
+
$metadata: deserializeMetadata(output),
|
|
1655
|
+
};
|
|
1656
|
+
}
|
|
1657
|
+
const message = response.message || response.Message || errorCode;
|
|
1658
|
+
response.message = message;
|
|
1659
|
+
delete response.Message;
|
|
1660
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
1661
|
+
};
|
|
1662
|
+
const deserializeAws_restJson1DeleteEntityCommand = async (output, context) => {
|
|
1663
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1664
|
+
return deserializeAws_restJson1DeleteEntityCommandError(output, context);
|
|
1665
|
+
}
|
|
1666
|
+
const contents = {
|
|
1667
|
+
$metadata: deserializeMetadata(output),
|
|
1668
|
+
state: undefined,
|
|
1669
|
+
};
|
|
1670
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
1671
|
+
if (data.state !== undefined && data.state !== null) {
|
|
1672
|
+
contents.state = smithy_client_1.expectString(data.state);
|
|
1673
|
+
}
|
|
1674
|
+
return Promise.resolve(contents);
|
|
1675
|
+
};
|
|
1676
|
+
exports.deserializeAws_restJson1DeleteEntityCommand = deserializeAws_restJson1DeleteEntityCommand;
|
|
1677
|
+
const deserializeAws_restJson1DeleteEntityCommandError = async (output, context) => {
|
|
1678
|
+
const parsedOutput = {
|
|
1679
|
+
...output,
|
|
1680
|
+
body: await parseBody(output.body, context),
|
|
1681
|
+
};
|
|
1682
|
+
let response;
|
|
1683
|
+
let errorCode = "UnknownError";
|
|
1684
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1685
|
+
switch (errorCode) {
|
|
1686
|
+
case "InternalServerException":
|
|
1687
|
+
case "com.amazonaws.iottwinmaker#InternalServerException":
|
|
1688
|
+
response = {
|
|
1689
|
+
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
1690
|
+
name: errorCode,
|
|
1691
|
+
$metadata: deserializeMetadata(output),
|
|
1692
|
+
};
|
|
1693
|
+
break;
|
|
1694
|
+
case "ResourceNotFoundException":
|
|
1695
|
+
case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
|
|
1696
|
+
response = {
|
|
1697
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
1698
|
+
name: errorCode,
|
|
1699
|
+
$metadata: deserializeMetadata(output),
|
|
1700
|
+
};
|
|
1701
|
+
break;
|
|
1702
|
+
case "ServiceQuotaExceededException":
|
|
1703
|
+
case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException":
|
|
1704
|
+
response = {
|
|
1705
|
+
...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
|
|
1706
|
+
name: errorCode,
|
|
1707
|
+
$metadata: deserializeMetadata(output),
|
|
1708
|
+
};
|
|
1709
|
+
break;
|
|
1710
|
+
case "ThrottlingException":
|
|
1711
|
+
case "com.amazonaws.iottwinmaker#ThrottlingException":
|
|
1712
|
+
response = {
|
|
1713
|
+
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
1714
|
+
name: errorCode,
|
|
1715
|
+
$metadata: deserializeMetadata(output),
|
|
1716
|
+
};
|
|
1717
|
+
break;
|
|
1718
|
+
case "ValidationException":
|
|
1719
|
+
case "com.amazonaws.iottwinmaker#ValidationException":
|
|
1720
|
+
response = {
|
|
1721
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
1722
|
+
name: errorCode,
|
|
1723
|
+
$metadata: deserializeMetadata(output),
|
|
1724
|
+
};
|
|
1725
|
+
break;
|
|
1726
|
+
default:
|
|
1727
|
+
const parsedBody = parsedOutput.body;
|
|
1728
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1729
|
+
response = {
|
|
1730
|
+
...parsedBody,
|
|
1731
|
+
name: `${errorCode}`,
|
|
1732
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1733
|
+
$fault: "client",
|
|
1734
|
+
$metadata: deserializeMetadata(output),
|
|
1735
|
+
};
|
|
1736
|
+
}
|
|
1737
|
+
const message = response.message || response.Message || errorCode;
|
|
1738
|
+
response.message = message;
|
|
1739
|
+
delete response.Message;
|
|
1740
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
1741
|
+
};
|
|
1742
|
+
const deserializeAws_restJson1DeleteSceneCommand = async (output, context) => {
|
|
1743
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1744
|
+
return deserializeAws_restJson1DeleteSceneCommandError(output, context);
|
|
1745
|
+
}
|
|
1746
|
+
const contents = {
|
|
1747
|
+
$metadata: deserializeMetadata(output),
|
|
1748
|
+
};
|
|
1749
|
+
await collectBody(output.body, context);
|
|
1750
|
+
return Promise.resolve(contents);
|
|
1751
|
+
};
|
|
1752
|
+
exports.deserializeAws_restJson1DeleteSceneCommand = deserializeAws_restJson1DeleteSceneCommand;
|
|
1753
|
+
const deserializeAws_restJson1DeleteSceneCommandError = async (output, context) => {
|
|
1754
|
+
const parsedOutput = {
|
|
1755
|
+
...output,
|
|
1756
|
+
body: await parseBody(output.body, context),
|
|
1757
|
+
};
|
|
1758
|
+
let response;
|
|
1759
|
+
let errorCode = "UnknownError";
|
|
1760
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1761
|
+
switch (errorCode) {
|
|
1762
|
+
case "AccessDeniedException":
|
|
1763
|
+
case "com.amazonaws.iottwinmaker#AccessDeniedException":
|
|
1764
|
+
response = {
|
|
1765
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
1766
|
+
name: errorCode,
|
|
1767
|
+
$metadata: deserializeMetadata(output),
|
|
1768
|
+
};
|
|
1769
|
+
break;
|
|
1770
|
+
case "InternalServerException":
|
|
1771
|
+
case "com.amazonaws.iottwinmaker#InternalServerException":
|
|
1772
|
+
response = {
|
|
1773
|
+
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
1774
|
+
name: errorCode,
|
|
1775
|
+
$metadata: deserializeMetadata(output),
|
|
1776
|
+
};
|
|
1777
|
+
break;
|
|
1778
|
+
case "ResourceNotFoundException":
|
|
1779
|
+
case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
|
|
1780
|
+
response = {
|
|
1781
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
1782
|
+
name: errorCode,
|
|
1783
|
+
$metadata: deserializeMetadata(output),
|
|
1784
|
+
};
|
|
1785
|
+
break;
|
|
1786
|
+
case "ThrottlingException":
|
|
1787
|
+
case "com.amazonaws.iottwinmaker#ThrottlingException":
|
|
1788
|
+
response = {
|
|
1789
|
+
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
1790
|
+
name: errorCode,
|
|
1791
|
+
$metadata: deserializeMetadata(output),
|
|
1792
|
+
};
|
|
1793
|
+
break;
|
|
1794
|
+
case "ValidationException":
|
|
1795
|
+
case "com.amazonaws.iottwinmaker#ValidationException":
|
|
1796
|
+
response = {
|
|
1797
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
1798
|
+
name: errorCode,
|
|
1799
|
+
$metadata: deserializeMetadata(output),
|
|
1800
|
+
};
|
|
1801
|
+
break;
|
|
1802
|
+
default:
|
|
1803
|
+
const parsedBody = parsedOutput.body;
|
|
1804
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1805
|
+
response = {
|
|
1806
|
+
...parsedBody,
|
|
1807
|
+
name: `${errorCode}`,
|
|
1808
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1809
|
+
$fault: "client",
|
|
1810
|
+
$metadata: deserializeMetadata(output),
|
|
1811
|
+
};
|
|
1812
|
+
}
|
|
1813
|
+
const message = response.message || response.Message || errorCode;
|
|
1814
|
+
response.message = message;
|
|
1815
|
+
delete response.Message;
|
|
1816
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
1817
|
+
};
|
|
1818
|
+
const deserializeAws_restJson1DeleteWorkspaceCommand = async (output, context) => {
|
|
1819
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1820
|
+
return deserializeAws_restJson1DeleteWorkspaceCommandError(output, context);
|
|
1821
|
+
}
|
|
1822
|
+
const contents = {
|
|
1823
|
+
$metadata: deserializeMetadata(output),
|
|
1824
|
+
};
|
|
1825
|
+
await collectBody(output.body, context);
|
|
1826
|
+
return Promise.resolve(contents);
|
|
1827
|
+
};
|
|
1828
|
+
exports.deserializeAws_restJson1DeleteWorkspaceCommand = deserializeAws_restJson1DeleteWorkspaceCommand;
|
|
1829
|
+
const deserializeAws_restJson1DeleteWorkspaceCommandError = async (output, context) => {
|
|
1830
|
+
const parsedOutput = {
|
|
1831
|
+
...output,
|
|
1832
|
+
body: await parseBody(output.body, context),
|
|
1833
|
+
};
|
|
1834
|
+
let response;
|
|
1835
|
+
let errorCode = "UnknownError";
|
|
1836
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1837
|
+
switch (errorCode) {
|
|
1838
|
+
case "AccessDeniedException":
|
|
1839
|
+
case "com.amazonaws.iottwinmaker#AccessDeniedException":
|
|
1840
|
+
response = {
|
|
1841
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
1842
|
+
name: errorCode,
|
|
1843
|
+
$metadata: deserializeMetadata(output),
|
|
1844
|
+
};
|
|
1845
|
+
break;
|
|
1846
|
+
case "InternalServerException":
|
|
1847
|
+
case "com.amazonaws.iottwinmaker#InternalServerException":
|
|
1848
|
+
response = {
|
|
1849
|
+
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
1850
|
+
name: errorCode,
|
|
1851
|
+
$metadata: deserializeMetadata(output),
|
|
1852
|
+
};
|
|
1853
|
+
break;
|
|
1854
|
+
case "ResourceNotFoundException":
|
|
1855
|
+
case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
|
|
1856
|
+
response = {
|
|
1857
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
1858
|
+
name: errorCode,
|
|
1859
|
+
$metadata: deserializeMetadata(output),
|
|
1860
|
+
};
|
|
1861
|
+
break;
|
|
1862
|
+
case "ThrottlingException":
|
|
1863
|
+
case "com.amazonaws.iottwinmaker#ThrottlingException":
|
|
1864
|
+
response = {
|
|
1865
|
+
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
1866
|
+
name: errorCode,
|
|
1867
|
+
$metadata: deserializeMetadata(output),
|
|
1868
|
+
};
|
|
1869
|
+
break;
|
|
1870
|
+
case "ValidationException":
|
|
1871
|
+
case "com.amazonaws.iottwinmaker#ValidationException":
|
|
1872
|
+
response = {
|
|
1873
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
1874
|
+
name: errorCode,
|
|
1875
|
+
$metadata: deserializeMetadata(output),
|
|
1876
|
+
};
|
|
1877
|
+
break;
|
|
1878
|
+
default:
|
|
1879
|
+
const parsedBody = parsedOutput.body;
|
|
1880
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1881
|
+
response = {
|
|
1882
|
+
...parsedBody,
|
|
1883
|
+
name: `${errorCode}`,
|
|
1884
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1885
|
+
$fault: "client",
|
|
1886
|
+
$metadata: deserializeMetadata(output),
|
|
1887
|
+
};
|
|
1888
|
+
}
|
|
1889
|
+
const message = response.message || response.Message || errorCode;
|
|
1890
|
+
response.message = message;
|
|
1891
|
+
delete response.Message;
|
|
1892
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
1893
|
+
};
|
|
1894
|
+
const deserializeAws_restJson1GetComponentTypeCommand = async (output, context) => {
|
|
1895
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1896
|
+
return deserializeAws_restJson1GetComponentTypeCommandError(output, context);
|
|
1897
|
+
}
|
|
1898
|
+
const contents = {
|
|
1899
|
+
$metadata: deserializeMetadata(output),
|
|
1900
|
+
arn: undefined,
|
|
1901
|
+
componentTypeId: undefined,
|
|
1902
|
+
creationDateTime: undefined,
|
|
1903
|
+
description: undefined,
|
|
1904
|
+
extendsFrom: undefined,
|
|
1905
|
+
functions: undefined,
|
|
1906
|
+
isAbstract: undefined,
|
|
1907
|
+
isSchemaInitialized: undefined,
|
|
1908
|
+
isSingleton: undefined,
|
|
1909
|
+
propertyDefinitions: undefined,
|
|
1910
|
+
status: undefined,
|
|
1911
|
+
updateDateTime: undefined,
|
|
1912
|
+
workspaceId: undefined,
|
|
1913
|
+
};
|
|
1914
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
1915
|
+
if (data.arn !== undefined && data.arn !== null) {
|
|
1916
|
+
contents.arn = smithy_client_1.expectString(data.arn);
|
|
1917
|
+
}
|
|
1918
|
+
if (data.componentTypeId !== undefined && data.componentTypeId !== null) {
|
|
1919
|
+
contents.componentTypeId = smithy_client_1.expectString(data.componentTypeId);
|
|
1920
|
+
}
|
|
1921
|
+
if (data.creationDateTime !== undefined && data.creationDateTime !== null) {
|
|
1922
|
+
contents.creationDateTime = smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(data.creationDateTime)));
|
|
1923
|
+
}
|
|
1924
|
+
if (data.description !== undefined && data.description !== null) {
|
|
1925
|
+
contents.description = smithy_client_1.expectString(data.description);
|
|
1926
|
+
}
|
|
1927
|
+
if (data.extendsFrom !== undefined && data.extendsFrom !== null) {
|
|
1928
|
+
contents.extendsFrom = deserializeAws_restJson1ExtendsFrom(data.extendsFrom, context);
|
|
1929
|
+
}
|
|
1930
|
+
if (data.functions !== undefined && data.functions !== null) {
|
|
1931
|
+
contents.functions = deserializeAws_restJson1FunctionsResponse(data.functions, context);
|
|
1932
|
+
}
|
|
1933
|
+
if (data.isAbstract !== undefined && data.isAbstract !== null) {
|
|
1934
|
+
contents.isAbstract = smithy_client_1.expectBoolean(data.isAbstract);
|
|
1935
|
+
}
|
|
1936
|
+
if (data.isSchemaInitialized !== undefined && data.isSchemaInitialized !== null) {
|
|
1937
|
+
contents.isSchemaInitialized = smithy_client_1.expectBoolean(data.isSchemaInitialized);
|
|
1938
|
+
}
|
|
1939
|
+
if (data.isSingleton !== undefined && data.isSingleton !== null) {
|
|
1940
|
+
contents.isSingleton = smithy_client_1.expectBoolean(data.isSingleton);
|
|
1941
|
+
}
|
|
1942
|
+
if (data.propertyDefinitions !== undefined && data.propertyDefinitions !== null) {
|
|
1943
|
+
contents.propertyDefinitions = deserializeAws_restJson1PropertyDefinitionsResponse(data.propertyDefinitions, context);
|
|
1944
|
+
}
|
|
1945
|
+
if (data.status !== undefined && data.status !== null) {
|
|
1946
|
+
contents.status = deserializeAws_restJson1Status(data.status, context);
|
|
1947
|
+
}
|
|
1948
|
+
if (data.updateDateTime !== undefined && data.updateDateTime !== null) {
|
|
1949
|
+
contents.updateDateTime = smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(data.updateDateTime)));
|
|
1950
|
+
}
|
|
1951
|
+
if (data.workspaceId !== undefined && data.workspaceId !== null) {
|
|
1952
|
+
contents.workspaceId = smithy_client_1.expectString(data.workspaceId);
|
|
1953
|
+
}
|
|
1954
|
+
return Promise.resolve(contents);
|
|
1955
|
+
};
|
|
1956
|
+
exports.deserializeAws_restJson1GetComponentTypeCommand = deserializeAws_restJson1GetComponentTypeCommand;
|
|
1957
|
+
const deserializeAws_restJson1GetComponentTypeCommandError = async (output, context) => {
|
|
1958
|
+
const parsedOutput = {
|
|
1959
|
+
...output,
|
|
1960
|
+
body: await parseBody(output.body, context),
|
|
1961
|
+
};
|
|
1962
|
+
let response;
|
|
1963
|
+
let errorCode = "UnknownError";
|
|
1964
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1965
|
+
switch (errorCode) {
|
|
1966
|
+
case "AccessDeniedException":
|
|
1967
|
+
case "com.amazonaws.iottwinmaker#AccessDeniedException":
|
|
1968
|
+
response = {
|
|
1969
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
1970
|
+
name: errorCode,
|
|
1971
|
+
$metadata: deserializeMetadata(output),
|
|
1972
|
+
};
|
|
1973
|
+
break;
|
|
1974
|
+
case "InternalServerException":
|
|
1975
|
+
case "com.amazonaws.iottwinmaker#InternalServerException":
|
|
1976
|
+
response = {
|
|
1977
|
+
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
1978
|
+
name: errorCode,
|
|
1979
|
+
$metadata: deserializeMetadata(output),
|
|
1980
|
+
};
|
|
1981
|
+
break;
|
|
1982
|
+
case "ResourceNotFoundException":
|
|
1983
|
+
case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
|
|
1984
|
+
response = {
|
|
1985
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
1986
|
+
name: errorCode,
|
|
1987
|
+
$metadata: deserializeMetadata(output),
|
|
1988
|
+
};
|
|
1989
|
+
break;
|
|
1990
|
+
case "ThrottlingException":
|
|
1991
|
+
case "com.amazonaws.iottwinmaker#ThrottlingException":
|
|
1992
|
+
response = {
|
|
1993
|
+
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
1994
|
+
name: errorCode,
|
|
1995
|
+
$metadata: deserializeMetadata(output),
|
|
1996
|
+
};
|
|
1997
|
+
break;
|
|
1998
|
+
default:
|
|
1999
|
+
const parsedBody = parsedOutput.body;
|
|
2000
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2001
|
+
response = {
|
|
2002
|
+
...parsedBody,
|
|
2003
|
+
name: `${errorCode}`,
|
|
2004
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2005
|
+
$fault: "client",
|
|
2006
|
+
$metadata: deserializeMetadata(output),
|
|
2007
|
+
};
|
|
2008
|
+
}
|
|
2009
|
+
const message = response.message || response.Message || errorCode;
|
|
2010
|
+
response.message = message;
|
|
2011
|
+
delete response.Message;
|
|
2012
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2013
|
+
};
|
|
2014
|
+
const deserializeAws_restJson1GetEntityCommand = async (output, context) => {
|
|
2015
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2016
|
+
return deserializeAws_restJson1GetEntityCommandError(output, context);
|
|
2017
|
+
}
|
|
2018
|
+
const contents = {
|
|
2019
|
+
$metadata: deserializeMetadata(output),
|
|
2020
|
+
arn: undefined,
|
|
2021
|
+
components: undefined,
|
|
2022
|
+
creationDateTime: undefined,
|
|
2023
|
+
description: undefined,
|
|
2024
|
+
entityId: undefined,
|
|
2025
|
+
entityName: undefined,
|
|
2026
|
+
hasChildEntities: undefined,
|
|
2027
|
+
parentEntityId: undefined,
|
|
2028
|
+
status: undefined,
|
|
2029
|
+
updateDateTime: undefined,
|
|
2030
|
+
workspaceId: undefined,
|
|
2031
|
+
};
|
|
2032
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2033
|
+
if (data.arn !== undefined && data.arn !== null) {
|
|
2034
|
+
contents.arn = smithy_client_1.expectString(data.arn);
|
|
2035
|
+
}
|
|
2036
|
+
if (data.components !== undefined && data.components !== null) {
|
|
2037
|
+
contents.components = deserializeAws_restJson1ComponentsMap(data.components, context);
|
|
2038
|
+
}
|
|
2039
|
+
if (data.creationDateTime !== undefined && data.creationDateTime !== null) {
|
|
2040
|
+
contents.creationDateTime = smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(data.creationDateTime)));
|
|
2041
|
+
}
|
|
2042
|
+
if (data.description !== undefined && data.description !== null) {
|
|
2043
|
+
contents.description = smithy_client_1.expectString(data.description);
|
|
2044
|
+
}
|
|
2045
|
+
if (data.entityId !== undefined && data.entityId !== null) {
|
|
2046
|
+
contents.entityId = smithy_client_1.expectString(data.entityId);
|
|
2047
|
+
}
|
|
2048
|
+
if (data.entityName !== undefined && data.entityName !== null) {
|
|
2049
|
+
contents.entityName = smithy_client_1.expectString(data.entityName);
|
|
2050
|
+
}
|
|
2051
|
+
if (data.hasChildEntities !== undefined && data.hasChildEntities !== null) {
|
|
2052
|
+
contents.hasChildEntities = smithy_client_1.expectBoolean(data.hasChildEntities);
|
|
2053
|
+
}
|
|
2054
|
+
if (data.parentEntityId !== undefined && data.parentEntityId !== null) {
|
|
2055
|
+
contents.parentEntityId = smithy_client_1.expectString(data.parentEntityId);
|
|
2056
|
+
}
|
|
2057
|
+
if (data.status !== undefined && data.status !== null) {
|
|
2058
|
+
contents.status = deserializeAws_restJson1Status(data.status, context);
|
|
2059
|
+
}
|
|
2060
|
+
if (data.updateDateTime !== undefined && data.updateDateTime !== null) {
|
|
2061
|
+
contents.updateDateTime = smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(data.updateDateTime)));
|
|
2062
|
+
}
|
|
2063
|
+
if (data.workspaceId !== undefined && data.workspaceId !== null) {
|
|
2064
|
+
contents.workspaceId = smithy_client_1.expectString(data.workspaceId);
|
|
2065
|
+
}
|
|
2066
|
+
return Promise.resolve(contents);
|
|
2067
|
+
};
|
|
2068
|
+
exports.deserializeAws_restJson1GetEntityCommand = deserializeAws_restJson1GetEntityCommand;
|
|
2069
|
+
const deserializeAws_restJson1GetEntityCommandError = async (output, context) => {
|
|
2070
|
+
const parsedOutput = {
|
|
2071
|
+
...output,
|
|
2072
|
+
body: await parseBody(output.body, context),
|
|
2073
|
+
};
|
|
2074
|
+
let response;
|
|
2075
|
+
let errorCode = "UnknownError";
|
|
2076
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2077
|
+
switch (errorCode) {
|
|
2078
|
+
case "InternalServerException":
|
|
2079
|
+
case "com.amazonaws.iottwinmaker#InternalServerException":
|
|
2080
|
+
response = {
|
|
2081
|
+
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
2082
|
+
name: errorCode,
|
|
2083
|
+
$metadata: deserializeMetadata(output),
|
|
2084
|
+
};
|
|
2085
|
+
break;
|
|
2086
|
+
case "ResourceNotFoundException":
|
|
2087
|
+
case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
|
|
2088
|
+
response = {
|
|
2089
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
2090
|
+
name: errorCode,
|
|
2091
|
+
$metadata: deserializeMetadata(output),
|
|
2092
|
+
};
|
|
2093
|
+
break;
|
|
2094
|
+
case "ServiceQuotaExceededException":
|
|
2095
|
+
case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException":
|
|
2096
|
+
response = {
|
|
2097
|
+
...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
|
|
2098
|
+
name: errorCode,
|
|
2099
|
+
$metadata: deserializeMetadata(output),
|
|
2100
|
+
};
|
|
2101
|
+
break;
|
|
2102
|
+
case "ThrottlingException":
|
|
2103
|
+
case "com.amazonaws.iottwinmaker#ThrottlingException":
|
|
2104
|
+
response = {
|
|
2105
|
+
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
2106
|
+
name: errorCode,
|
|
2107
|
+
$metadata: deserializeMetadata(output),
|
|
2108
|
+
};
|
|
2109
|
+
break;
|
|
2110
|
+
case "ValidationException":
|
|
2111
|
+
case "com.amazonaws.iottwinmaker#ValidationException":
|
|
2112
|
+
response = {
|
|
2113
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
2114
|
+
name: errorCode,
|
|
2115
|
+
$metadata: deserializeMetadata(output),
|
|
2116
|
+
};
|
|
2117
|
+
break;
|
|
2118
|
+
default:
|
|
2119
|
+
const parsedBody = parsedOutput.body;
|
|
2120
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2121
|
+
response = {
|
|
2122
|
+
...parsedBody,
|
|
2123
|
+
name: `${errorCode}`,
|
|
2124
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2125
|
+
$fault: "client",
|
|
2126
|
+
$metadata: deserializeMetadata(output),
|
|
2127
|
+
};
|
|
2128
|
+
}
|
|
2129
|
+
const message = response.message || response.Message || errorCode;
|
|
2130
|
+
response.message = message;
|
|
2131
|
+
delete response.Message;
|
|
2132
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2133
|
+
};
|
|
2134
|
+
const deserializeAws_restJson1GetPropertyValueCommand = async (output, context) => {
|
|
2135
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2136
|
+
return deserializeAws_restJson1GetPropertyValueCommandError(output, context);
|
|
2137
|
+
}
|
|
2138
|
+
const contents = {
|
|
2139
|
+
$metadata: deserializeMetadata(output),
|
|
2140
|
+
propertyValues: undefined,
|
|
2141
|
+
};
|
|
2142
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2143
|
+
if (data.propertyValues !== undefined && data.propertyValues !== null) {
|
|
2144
|
+
contents.propertyValues = deserializeAws_restJson1PropertyLatestValueMap(data.propertyValues, context);
|
|
2145
|
+
}
|
|
2146
|
+
return Promise.resolve(contents);
|
|
2147
|
+
};
|
|
2148
|
+
exports.deserializeAws_restJson1GetPropertyValueCommand = deserializeAws_restJson1GetPropertyValueCommand;
|
|
2149
|
+
const deserializeAws_restJson1GetPropertyValueCommandError = async (output, context) => {
|
|
2150
|
+
const parsedOutput = {
|
|
2151
|
+
...output,
|
|
2152
|
+
body: await parseBody(output.body, context),
|
|
2153
|
+
};
|
|
2154
|
+
let response;
|
|
2155
|
+
let errorCode = "UnknownError";
|
|
2156
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2157
|
+
switch (errorCode) {
|
|
2158
|
+
case "AccessDeniedException":
|
|
2159
|
+
case "com.amazonaws.iottwinmaker#AccessDeniedException":
|
|
2160
|
+
response = {
|
|
2161
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
2162
|
+
name: errorCode,
|
|
2163
|
+
$metadata: deserializeMetadata(output),
|
|
2164
|
+
};
|
|
2165
|
+
break;
|
|
2166
|
+
case "ConnectorFailureException":
|
|
2167
|
+
case "com.amazonaws.iottwinmaker#ConnectorFailureException":
|
|
2168
|
+
response = {
|
|
2169
|
+
...(await deserializeAws_restJson1ConnectorFailureExceptionResponse(parsedOutput, context)),
|
|
2170
|
+
name: errorCode,
|
|
2171
|
+
$metadata: deserializeMetadata(output),
|
|
2172
|
+
};
|
|
2173
|
+
break;
|
|
2174
|
+
case "ConnectorTimeoutException":
|
|
2175
|
+
case "com.amazonaws.iottwinmaker#ConnectorTimeoutException":
|
|
2176
|
+
response = {
|
|
2177
|
+
...(await deserializeAws_restJson1ConnectorTimeoutExceptionResponse(parsedOutput, context)),
|
|
2178
|
+
name: errorCode,
|
|
2179
|
+
$metadata: deserializeMetadata(output),
|
|
2180
|
+
};
|
|
2181
|
+
break;
|
|
2182
|
+
case "InternalServerException":
|
|
2183
|
+
case "com.amazonaws.iottwinmaker#InternalServerException":
|
|
2184
|
+
response = {
|
|
2185
|
+
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
2186
|
+
name: errorCode,
|
|
2187
|
+
$metadata: deserializeMetadata(output),
|
|
2188
|
+
};
|
|
2189
|
+
break;
|
|
2190
|
+
case "ResourceNotFoundException":
|
|
2191
|
+
case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
|
|
2192
|
+
response = {
|
|
2193
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
2194
|
+
name: errorCode,
|
|
2195
|
+
$metadata: deserializeMetadata(output),
|
|
2196
|
+
};
|
|
2197
|
+
break;
|
|
2198
|
+
case "ThrottlingException":
|
|
2199
|
+
case "com.amazonaws.iottwinmaker#ThrottlingException":
|
|
2200
|
+
response = {
|
|
2201
|
+
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
2202
|
+
name: errorCode,
|
|
2203
|
+
$metadata: deserializeMetadata(output),
|
|
2204
|
+
};
|
|
2205
|
+
break;
|
|
2206
|
+
case "ValidationException":
|
|
2207
|
+
case "com.amazonaws.iottwinmaker#ValidationException":
|
|
2208
|
+
response = {
|
|
2209
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
2210
|
+
name: errorCode,
|
|
2211
|
+
$metadata: deserializeMetadata(output),
|
|
2212
|
+
};
|
|
2213
|
+
break;
|
|
2214
|
+
default:
|
|
2215
|
+
const parsedBody = parsedOutput.body;
|
|
2216
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2217
|
+
response = {
|
|
2218
|
+
...parsedBody,
|
|
2219
|
+
name: `${errorCode}`,
|
|
2220
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2221
|
+
$fault: "client",
|
|
2222
|
+
$metadata: deserializeMetadata(output),
|
|
2223
|
+
};
|
|
2224
|
+
}
|
|
2225
|
+
const message = response.message || response.Message || errorCode;
|
|
2226
|
+
response.message = message;
|
|
2227
|
+
delete response.Message;
|
|
2228
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2229
|
+
};
|
|
2230
|
+
const deserializeAws_restJson1GetPropertyValueHistoryCommand = async (output, context) => {
|
|
2231
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2232
|
+
return deserializeAws_restJson1GetPropertyValueHistoryCommandError(output, context);
|
|
2233
|
+
}
|
|
2234
|
+
const contents = {
|
|
2235
|
+
$metadata: deserializeMetadata(output),
|
|
2236
|
+
nextToken: undefined,
|
|
2237
|
+
propertyValues: undefined,
|
|
2238
|
+
};
|
|
2239
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2240
|
+
if (data.nextToken !== undefined && data.nextToken !== null) {
|
|
2241
|
+
contents.nextToken = smithy_client_1.expectString(data.nextToken);
|
|
2242
|
+
}
|
|
2243
|
+
if (data.propertyValues !== undefined && data.propertyValues !== null) {
|
|
2244
|
+
contents.propertyValues = deserializeAws_restJson1PropertyValueList(data.propertyValues, context);
|
|
2245
|
+
}
|
|
2246
|
+
return Promise.resolve(contents);
|
|
2247
|
+
};
|
|
2248
|
+
exports.deserializeAws_restJson1GetPropertyValueHistoryCommand = deserializeAws_restJson1GetPropertyValueHistoryCommand;
|
|
2249
|
+
const deserializeAws_restJson1GetPropertyValueHistoryCommandError = async (output, context) => {
|
|
2250
|
+
const parsedOutput = {
|
|
2251
|
+
...output,
|
|
2252
|
+
body: await parseBody(output.body, context),
|
|
2253
|
+
};
|
|
2254
|
+
let response;
|
|
2255
|
+
let errorCode = "UnknownError";
|
|
2256
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2257
|
+
switch (errorCode) {
|
|
2258
|
+
case "AccessDeniedException":
|
|
2259
|
+
case "com.amazonaws.iottwinmaker#AccessDeniedException":
|
|
2260
|
+
response = {
|
|
2261
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
2262
|
+
name: errorCode,
|
|
2263
|
+
$metadata: deserializeMetadata(output),
|
|
2264
|
+
};
|
|
2265
|
+
break;
|
|
2266
|
+
case "ConnectorFailureException":
|
|
2267
|
+
case "com.amazonaws.iottwinmaker#ConnectorFailureException":
|
|
2268
|
+
response = {
|
|
2269
|
+
...(await deserializeAws_restJson1ConnectorFailureExceptionResponse(parsedOutput, context)),
|
|
2270
|
+
name: errorCode,
|
|
2271
|
+
$metadata: deserializeMetadata(output),
|
|
2272
|
+
};
|
|
2273
|
+
break;
|
|
2274
|
+
case "ConnectorTimeoutException":
|
|
2275
|
+
case "com.amazonaws.iottwinmaker#ConnectorTimeoutException":
|
|
2276
|
+
response = {
|
|
2277
|
+
...(await deserializeAws_restJson1ConnectorTimeoutExceptionResponse(parsedOutput, context)),
|
|
2278
|
+
name: errorCode,
|
|
2279
|
+
$metadata: deserializeMetadata(output),
|
|
2280
|
+
};
|
|
2281
|
+
break;
|
|
2282
|
+
case "InternalServerException":
|
|
2283
|
+
case "com.amazonaws.iottwinmaker#InternalServerException":
|
|
2284
|
+
response = {
|
|
2285
|
+
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
2286
|
+
name: errorCode,
|
|
2287
|
+
$metadata: deserializeMetadata(output),
|
|
2288
|
+
};
|
|
2289
|
+
break;
|
|
2290
|
+
case "ResourceNotFoundException":
|
|
2291
|
+
case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
|
|
2292
|
+
response = {
|
|
2293
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
2294
|
+
name: errorCode,
|
|
2295
|
+
$metadata: deserializeMetadata(output),
|
|
2296
|
+
};
|
|
2297
|
+
break;
|
|
2298
|
+
case "ThrottlingException":
|
|
2299
|
+
case "com.amazonaws.iottwinmaker#ThrottlingException":
|
|
2300
|
+
response = {
|
|
2301
|
+
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
2302
|
+
name: errorCode,
|
|
2303
|
+
$metadata: deserializeMetadata(output),
|
|
2304
|
+
};
|
|
2305
|
+
break;
|
|
2306
|
+
case "ValidationException":
|
|
2307
|
+
case "com.amazonaws.iottwinmaker#ValidationException":
|
|
2308
|
+
response = {
|
|
2309
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
2310
|
+
name: errorCode,
|
|
2311
|
+
$metadata: deserializeMetadata(output),
|
|
2312
|
+
};
|
|
2313
|
+
break;
|
|
2314
|
+
default:
|
|
2315
|
+
const parsedBody = parsedOutput.body;
|
|
2316
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2317
|
+
response = {
|
|
2318
|
+
...parsedBody,
|
|
2319
|
+
name: `${errorCode}`,
|
|
2320
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2321
|
+
$fault: "client",
|
|
2322
|
+
$metadata: deserializeMetadata(output),
|
|
2323
|
+
};
|
|
2324
|
+
}
|
|
2325
|
+
const message = response.message || response.Message || errorCode;
|
|
2326
|
+
response.message = message;
|
|
2327
|
+
delete response.Message;
|
|
2328
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2329
|
+
};
|
|
2330
|
+
const deserializeAws_restJson1GetSceneCommand = async (output, context) => {
|
|
2331
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2332
|
+
return deserializeAws_restJson1GetSceneCommandError(output, context);
|
|
2333
|
+
}
|
|
2334
|
+
const contents = {
|
|
2335
|
+
$metadata: deserializeMetadata(output),
|
|
2336
|
+
arn: undefined,
|
|
2337
|
+
capabilities: undefined,
|
|
2338
|
+
contentLocation: undefined,
|
|
2339
|
+
creationDateTime: undefined,
|
|
2340
|
+
description: undefined,
|
|
2341
|
+
sceneId: undefined,
|
|
2342
|
+
updateDateTime: undefined,
|
|
2343
|
+
workspaceId: undefined,
|
|
2344
|
+
};
|
|
2345
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2346
|
+
if (data.arn !== undefined && data.arn !== null) {
|
|
2347
|
+
contents.arn = smithy_client_1.expectString(data.arn);
|
|
2348
|
+
}
|
|
2349
|
+
if (data.capabilities !== undefined && data.capabilities !== null) {
|
|
2350
|
+
contents.capabilities = deserializeAws_restJson1SceneCapabilities(data.capabilities, context);
|
|
2351
|
+
}
|
|
2352
|
+
if (data.contentLocation !== undefined && data.contentLocation !== null) {
|
|
2353
|
+
contents.contentLocation = smithy_client_1.expectString(data.contentLocation);
|
|
2354
|
+
}
|
|
2355
|
+
if (data.creationDateTime !== undefined && data.creationDateTime !== null) {
|
|
2356
|
+
contents.creationDateTime = smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(data.creationDateTime)));
|
|
2357
|
+
}
|
|
2358
|
+
if (data.description !== undefined && data.description !== null) {
|
|
2359
|
+
contents.description = smithy_client_1.expectString(data.description);
|
|
2360
|
+
}
|
|
2361
|
+
if (data.sceneId !== undefined && data.sceneId !== null) {
|
|
2362
|
+
contents.sceneId = smithy_client_1.expectString(data.sceneId);
|
|
2363
|
+
}
|
|
2364
|
+
if (data.updateDateTime !== undefined && data.updateDateTime !== null) {
|
|
2365
|
+
contents.updateDateTime = smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(data.updateDateTime)));
|
|
2366
|
+
}
|
|
2367
|
+
if (data.workspaceId !== undefined && data.workspaceId !== null) {
|
|
2368
|
+
contents.workspaceId = smithy_client_1.expectString(data.workspaceId);
|
|
2369
|
+
}
|
|
2370
|
+
return Promise.resolve(contents);
|
|
2371
|
+
};
|
|
2372
|
+
exports.deserializeAws_restJson1GetSceneCommand = deserializeAws_restJson1GetSceneCommand;
|
|
2373
|
+
const deserializeAws_restJson1GetSceneCommandError = async (output, context) => {
|
|
2374
|
+
const parsedOutput = {
|
|
2375
|
+
...output,
|
|
2376
|
+
body: await parseBody(output.body, context),
|
|
2377
|
+
};
|
|
2378
|
+
let response;
|
|
2379
|
+
let errorCode = "UnknownError";
|
|
2380
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2381
|
+
switch (errorCode) {
|
|
2382
|
+
case "AccessDeniedException":
|
|
2383
|
+
case "com.amazonaws.iottwinmaker#AccessDeniedException":
|
|
2384
|
+
response = {
|
|
2385
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
2386
|
+
name: errorCode,
|
|
2387
|
+
$metadata: deserializeMetadata(output),
|
|
2388
|
+
};
|
|
2389
|
+
break;
|
|
2390
|
+
case "InternalServerException":
|
|
2391
|
+
case "com.amazonaws.iottwinmaker#InternalServerException":
|
|
2392
|
+
response = {
|
|
2393
|
+
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
2394
|
+
name: errorCode,
|
|
2395
|
+
$metadata: deserializeMetadata(output),
|
|
2396
|
+
};
|
|
2397
|
+
break;
|
|
2398
|
+
case "ResourceNotFoundException":
|
|
2399
|
+
case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
|
|
2400
|
+
response = {
|
|
2401
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
2402
|
+
name: errorCode,
|
|
2403
|
+
$metadata: deserializeMetadata(output),
|
|
2404
|
+
};
|
|
2405
|
+
break;
|
|
2406
|
+
case "ThrottlingException":
|
|
2407
|
+
case "com.amazonaws.iottwinmaker#ThrottlingException":
|
|
2408
|
+
response = {
|
|
2409
|
+
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
2410
|
+
name: errorCode,
|
|
2411
|
+
$metadata: deserializeMetadata(output),
|
|
2412
|
+
};
|
|
2413
|
+
break;
|
|
2414
|
+
case "ValidationException":
|
|
2415
|
+
case "com.amazonaws.iottwinmaker#ValidationException":
|
|
2416
|
+
response = {
|
|
2417
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
2418
|
+
name: errorCode,
|
|
2419
|
+
$metadata: deserializeMetadata(output),
|
|
2420
|
+
};
|
|
2421
|
+
break;
|
|
2422
|
+
default:
|
|
2423
|
+
const parsedBody = parsedOutput.body;
|
|
2424
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2425
|
+
response = {
|
|
2426
|
+
...parsedBody,
|
|
2427
|
+
name: `${errorCode}`,
|
|
2428
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2429
|
+
$fault: "client",
|
|
2430
|
+
$metadata: deserializeMetadata(output),
|
|
2431
|
+
};
|
|
2432
|
+
}
|
|
2433
|
+
const message = response.message || response.Message || errorCode;
|
|
2434
|
+
response.message = message;
|
|
2435
|
+
delete response.Message;
|
|
2436
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2437
|
+
};
|
|
2438
|
+
const deserializeAws_restJson1GetWorkspaceCommand = async (output, context) => {
|
|
2439
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2440
|
+
return deserializeAws_restJson1GetWorkspaceCommandError(output, context);
|
|
2441
|
+
}
|
|
2442
|
+
const contents = {
|
|
2443
|
+
$metadata: deserializeMetadata(output),
|
|
2444
|
+
arn: undefined,
|
|
2445
|
+
creationDateTime: undefined,
|
|
2446
|
+
description: undefined,
|
|
2447
|
+
role: undefined,
|
|
2448
|
+
s3Location: undefined,
|
|
2449
|
+
updateDateTime: undefined,
|
|
2450
|
+
workspaceId: undefined,
|
|
2451
|
+
};
|
|
2452
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2453
|
+
if (data.arn !== undefined && data.arn !== null) {
|
|
2454
|
+
contents.arn = smithy_client_1.expectString(data.arn);
|
|
2455
|
+
}
|
|
2456
|
+
if (data.creationDateTime !== undefined && data.creationDateTime !== null) {
|
|
2457
|
+
contents.creationDateTime = smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(data.creationDateTime)));
|
|
2458
|
+
}
|
|
2459
|
+
if (data.description !== undefined && data.description !== null) {
|
|
2460
|
+
contents.description = smithy_client_1.expectString(data.description);
|
|
2461
|
+
}
|
|
2462
|
+
if (data.role !== undefined && data.role !== null) {
|
|
2463
|
+
contents.role = smithy_client_1.expectString(data.role);
|
|
2464
|
+
}
|
|
2465
|
+
if (data.s3Location !== undefined && data.s3Location !== null) {
|
|
2466
|
+
contents.s3Location = smithy_client_1.expectString(data.s3Location);
|
|
2467
|
+
}
|
|
2468
|
+
if (data.updateDateTime !== undefined && data.updateDateTime !== null) {
|
|
2469
|
+
contents.updateDateTime = smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(data.updateDateTime)));
|
|
2470
|
+
}
|
|
2471
|
+
if (data.workspaceId !== undefined && data.workspaceId !== null) {
|
|
2472
|
+
contents.workspaceId = smithy_client_1.expectString(data.workspaceId);
|
|
2473
|
+
}
|
|
2474
|
+
return Promise.resolve(contents);
|
|
2475
|
+
};
|
|
2476
|
+
exports.deserializeAws_restJson1GetWorkspaceCommand = deserializeAws_restJson1GetWorkspaceCommand;
|
|
2477
|
+
const deserializeAws_restJson1GetWorkspaceCommandError = async (output, context) => {
|
|
2478
|
+
const parsedOutput = {
|
|
2479
|
+
...output,
|
|
2480
|
+
body: await parseBody(output.body, context),
|
|
2481
|
+
};
|
|
2482
|
+
let response;
|
|
2483
|
+
let errorCode = "UnknownError";
|
|
2484
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2485
|
+
switch (errorCode) {
|
|
2486
|
+
case "InternalServerException":
|
|
2487
|
+
case "com.amazonaws.iottwinmaker#InternalServerException":
|
|
2488
|
+
response = {
|
|
2489
|
+
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
2490
|
+
name: errorCode,
|
|
2491
|
+
$metadata: deserializeMetadata(output),
|
|
2492
|
+
};
|
|
2493
|
+
break;
|
|
2494
|
+
case "ResourceNotFoundException":
|
|
2495
|
+
case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
|
|
2496
|
+
response = {
|
|
2497
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
2498
|
+
name: errorCode,
|
|
2499
|
+
$metadata: deserializeMetadata(output),
|
|
2500
|
+
};
|
|
2501
|
+
break;
|
|
2502
|
+
case "ServiceQuotaExceededException":
|
|
2503
|
+
case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException":
|
|
2504
|
+
response = {
|
|
2505
|
+
...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
|
|
2506
|
+
name: errorCode,
|
|
2507
|
+
$metadata: deserializeMetadata(output),
|
|
2508
|
+
};
|
|
2509
|
+
break;
|
|
2510
|
+
case "ThrottlingException":
|
|
2511
|
+
case "com.amazonaws.iottwinmaker#ThrottlingException":
|
|
2512
|
+
response = {
|
|
2513
|
+
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
2514
|
+
name: errorCode,
|
|
2515
|
+
$metadata: deserializeMetadata(output),
|
|
2516
|
+
};
|
|
2517
|
+
break;
|
|
2518
|
+
case "ValidationException":
|
|
2519
|
+
case "com.amazonaws.iottwinmaker#ValidationException":
|
|
2520
|
+
response = {
|
|
2521
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
2522
|
+
name: errorCode,
|
|
2523
|
+
$metadata: deserializeMetadata(output),
|
|
2524
|
+
};
|
|
2525
|
+
break;
|
|
2526
|
+
default:
|
|
2527
|
+
const parsedBody = parsedOutput.body;
|
|
2528
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2529
|
+
response = {
|
|
2530
|
+
...parsedBody,
|
|
2531
|
+
name: `${errorCode}`,
|
|
2532
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2533
|
+
$fault: "client",
|
|
2534
|
+
$metadata: deserializeMetadata(output),
|
|
2535
|
+
};
|
|
2536
|
+
}
|
|
2537
|
+
const message = response.message || response.Message || errorCode;
|
|
2538
|
+
response.message = message;
|
|
2539
|
+
delete response.Message;
|
|
2540
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2541
|
+
};
|
|
2542
|
+
const deserializeAws_restJson1ListComponentTypesCommand = async (output, context) => {
|
|
2543
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2544
|
+
return deserializeAws_restJson1ListComponentTypesCommandError(output, context);
|
|
2545
|
+
}
|
|
2546
|
+
const contents = {
|
|
2547
|
+
$metadata: deserializeMetadata(output),
|
|
2548
|
+
componentTypeSummaries: undefined,
|
|
2549
|
+
maxResults: undefined,
|
|
2550
|
+
nextToken: undefined,
|
|
2551
|
+
workspaceId: undefined,
|
|
2552
|
+
};
|
|
2553
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2554
|
+
if (data.componentTypeSummaries !== undefined && data.componentTypeSummaries !== null) {
|
|
2555
|
+
contents.componentTypeSummaries = deserializeAws_restJson1ComponentTypeSummaries(data.componentTypeSummaries, context);
|
|
2556
|
+
}
|
|
2557
|
+
if (data.maxResults !== undefined && data.maxResults !== null) {
|
|
2558
|
+
contents.maxResults = smithy_client_1.expectInt32(data.maxResults);
|
|
2559
|
+
}
|
|
2560
|
+
if (data.nextToken !== undefined && data.nextToken !== null) {
|
|
2561
|
+
contents.nextToken = smithy_client_1.expectString(data.nextToken);
|
|
2562
|
+
}
|
|
2563
|
+
if (data.workspaceId !== undefined && data.workspaceId !== null) {
|
|
2564
|
+
contents.workspaceId = smithy_client_1.expectString(data.workspaceId);
|
|
2565
|
+
}
|
|
2566
|
+
return Promise.resolve(contents);
|
|
2567
|
+
};
|
|
2568
|
+
exports.deserializeAws_restJson1ListComponentTypesCommand = deserializeAws_restJson1ListComponentTypesCommand;
|
|
2569
|
+
const deserializeAws_restJson1ListComponentTypesCommandError = async (output, context) => {
|
|
2570
|
+
const parsedOutput = {
|
|
2571
|
+
...output,
|
|
2572
|
+
body: await parseBody(output.body, context),
|
|
2573
|
+
};
|
|
2574
|
+
let response;
|
|
2575
|
+
let errorCode = "UnknownError";
|
|
2576
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2577
|
+
switch (errorCode) {
|
|
2578
|
+
case "AccessDeniedException":
|
|
2579
|
+
case "com.amazonaws.iottwinmaker#AccessDeniedException":
|
|
2580
|
+
response = {
|
|
2581
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
2582
|
+
name: errorCode,
|
|
2583
|
+
$metadata: deserializeMetadata(output),
|
|
2584
|
+
};
|
|
2585
|
+
break;
|
|
2586
|
+
case "InternalServerException":
|
|
2587
|
+
case "com.amazonaws.iottwinmaker#InternalServerException":
|
|
2588
|
+
response = {
|
|
2589
|
+
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
2590
|
+
name: errorCode,
|
|
2591
|
+
$metadata: deserializeMetadata(output),
|
|
2592
|
+
};
|
|
2593
|
+
break;
|
|
2594
|
+
case "ThrottlingException":
|
|
2595
|
+
case "com.amazonaws.iottwinmaker#ThrottlingException":
|
|
2596
|
+
response = {
|
|
2597
|
+
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
2598
|
+
name: errorCode,
|
|
2599
|
+
$metadata: deserializeMetadata(output),
|
|
2600
|
+
};
|
|
2601
|
+
break;
|
|
2602
|
+
case "ValidationException":
|
|
2603
|
+
case "com.amazonaws.iottwinmaker#ValidationException":
|
|
2604
|
+
response = {
|
|
2605
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
2606
|
+
name: errorCode,
|
|
2607
|
+
$metadata: deserializeMetadata(output),
|
|
2608
|
+
};
|
|
2609
|
+
break;
|
|
2610
|
+
default:
|
|
2611
|
+
const parsedBody = parsedOutput.body;
|
|
2612
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2613
|
+
response = {
|
|
2614
|
+
...parsedBody,
|
|
2615
|
+
name: `${errorCode}`,
|
|
2616
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2617
|
+
$fault: "client",
|
|
2618
|
+
$metadata: deserializeMetadata(output),
|
|
2619
|
+
};
|
|
2620
|
+
}
|
|
2621
|
+
const message = response.message || response.Message || errorCode;
|
|
2622
|
+
response.message = message;
|
|
2623
|
+
delete response.Message;
|
|
2624
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2625
|
+
};
|
|
2626
|
+
const deserializeAws_restJson1ListEntitiesCommand = async (output, context) => {
|
|
2627
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2628
|
+
return deserializeAws_restJson1ListEntitiesCommandError(output, context);
|
|
2629
|
+
}
|
|
2630
|
+
const contents = {
|
|
2631
|
+
$metadata: deserializeMetadata(output),
|
|
2632
|
+
entitySummaries: undefined,
|
|
2633
|
+
nextToken: undefined,
|
|
2634
|
+
};
|
|
2635
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2636
|
+
if (data.entitySummaries !== undefined && data.entitySummaries !== null) {
|
|
2637
|
+
contents.entitySummaries = deserializeAws_restJson1EntitySummaries(data.entitySummaries, context);
|
|
2638
|
+
}
|
|
2639
|
+
if (data.nextToken !== undefined && data.nextToken !== null) {
|
|
2640
|
+
contents.nextToken = smithy_client_1.expectString(data.nextToken);
|
|
2641
|
+
}
|
|
2642
|
+
return Promise.resolve(contents);
|
|
2643
|
+
};
|
|
2644
|
+
exports.deserializeAws_restJson1ListEntitiesCommand = deserializeAws_restJson1ListEntitiesCommand;
|
|
2645
|
+
const deserializeAws_restJson1ListEntitiesCommandError = async (output, context) => {
|
|
2646
|
+
const parsedOutput = {
|
|
2647
|
+
...output,
|
|
2648
|
+
body: await parseBody(output.body, context),
|
|
2649
|
+
};
|
|
2650
|
+
let response;
|
|
2651
|
+
let errorCode = "UnknownError";
|
|
2652
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2653
|
+
switch (errorCode) {
|
|
2654
|
+
case "InternalServerException":
|
|
2655
|
+
case "com.amazonaws.iottwinmaker#InternalServerException":
|
|
2656
|
+
response = {
|
|
2657
|
+
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
2658
|
+
name: errorCode,
|
|
2659
|
+
$metadata: deserializeMetadata(output),
|
|
2660
|
+
};
|
|
2661
|
+
break;
|
|
2662
|
+
case "ServiceQuotaExceededException":
|
|
2663
|
+
case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException":
|
|
2664
|
+
response = {
|
|
2665
|
+
...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
|
|
2666
|
+
name: errorCode,
|
|
2667
|
+
$metadata: deserializeMetadata(output),
|
|
2668
|
+
};
|
|
2669
|
+
break;
|
|
2670
|
+
case "ThrottlingException":
|
|
2671
|
+
case "com.amazonaws.iottwinmaker#ThrottlingException":
|
|
2672
|
+
response = {
|
|
2673
|
+
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
2674
|
+
name: errorCode,
|
|
2675
|
+
$metadata: deserializeMetadata(output),
|
|
2676
|
+
};
|
|
2677
|
+
break;
|
|
2678
|
+
case "ValidationException":
|
|
2679
|
+
case "com.amazonaws.iottwinmaker#ValidationException":
|
|
2680
|
+
response = {
|
|
2681
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
2682
|
+
name: errorCode,
|
|
2683
|
+
$metadata: deserializeMetadata(output),
|
|
2684
|
+
};
|
|
2685
|
+
break;
|
|
2686
|
+
default:
|
|
2687
|
+
const parsedBody = parsedOutput.body;
|
|
2688
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2689
|
+
response = {
|
|
2690
|
+
...parsedBody,
|
|
2691
|
+
name: `${errorCode}`,
|
|
2692
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2693
|
+
$fault: "client",
|
|
2694
|
+
$metadata: deserializeMetadata(output),
|
|
2695
|
+
};
|
|
2696
|
+
}
|
|
2697
|
+
const message = response.message || response.Message || errorCode;
|
|
2698
|
+
response.message = message;
|
|
2699
|
+
delete response.Message;
|
|
2700
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2701
|
+
};
|
|
2702
|
+
const deserializeAws_restJson1ListScenesCommand = async (output, context) => {
|
|
2703
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2704
|
+
return deserializeAws_restJson1ListScenesCommandError(output, context);
|
|
2705
|
+
}
|
|
2706
|
+
const contents = {
|
|
2707
|
+
$metadata: deserializeMetadata(output),
|
|
2708
|
+
nextToken: undefined,
|
|
2709
|
+
sceneSummaries: undefined,
|
|
2710
|
+
};
|
|
2711
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2712
|
+
if (data.nextToken !== undefined && data.nextToken !== null) {
|
|
2713
|
+
contents.nextToken = smithy_client_1.expectString(data.nextToken);
|
|
2714
|
+
}
|
|
2715
|
+
if (data.sceneSummaries !== undefined && data.sceneSummaries !== null) {
|
|
2716
|
+
contents.sceneSummaries = deserializeAws_restJson1SceneSummaries(data.sceneSummaries, context);
|
|
2717
|
+
}
|
|
2718
|
+
return Promise.resolve(contents);
|
|
2719
|
+
};
|
|
2720
|
+
exports.deserializeAws_restJson1ListScenesCommand = deserializeAws_restJson1ListScenesCommand;
|
|
2721
|
+
const deserializeAws_restJson1ListScenesCommandError = async (output, context) => {
|
|
2722
|
+
const parsedOutput = {
|
|
2723
|
+
...output,
|
|
2724
|
+
body: await parseBody(output.body, context),
|
|
2725
|
+
};
|
|
2726
|
+
let response;
|
|
2727
|
+
let errorCode = "UnknownError";
|
|
2728
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2729
|
+
switch (errorCode) {
|
|
2730
|
+
case "AccessDeniedException":
|
|
2731
|
+
case "com.amazonaws.iottwinmaker#AccessDeniedException":
|
|
2732
|
+
response = {
|
|
2733
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
2734
|
+
name: errorCode,
|
|
2735
|
+
$metadata: deserializeMetadata(output),
|
|
2736
|
+
};
|
|
2737
|
+
break;
|
|
2738
|
+
case "InternalServerException":
|
|
2739
|
+
case "com.amazonaws.iottwinmaker#InternalServerException":
|
|
2740
|
+
response = {
|
|
2741
|
+
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
2742
|
+
name: errorCode,
|
|
2743
|
+
$metadata: deserializeMetadata(output),
|
|
2744
|
+
};
|
|
2745
|
+
break;
|
|
2746
|
+
case "ThrottlingException":
|
|
2747
|
+
case "com.amazonaws.iottwinmaker#ThrottlingException":
|
|
2748
|
+
response = {
|
|
2749
|
+
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
2750
|
+
name: errorCode,
|
|
2751
|
+
$metadata: deserializeMetadata(output),
|
|
2752
|
+
};
|
|
2753
|
+
break;
|
|
2754
|
+
case "ValidationException":
|
|
2755
|
+
case "com.amazonaws.iottwinmaker#ValidationException":
|
|
2756
|
+
response = {
|
|
2757
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
2758
|
+
name: errorCode,
|
|
2759
|
+
$metadata: deserializeMetadata(output),
|
|
2760
|
+
};
|
|
2761
|
+
break;
|
|
2762
|
+
default:
|
|
2763
|
+
const parsedBody = parsedOutput.body;
|
|
2764
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2765
|
+
response = {
|
|
2766
|
+
...parsedBody,
|
|
2767
|
+
name: `${errorCode}`,
|
|
2768
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2769
|
+
$fault: "client",
|
|
2770
|
+
$metadata: deserializeMetadata(output),
|
|
2771
|
+
};
|
|
2772
|
+
}
|
|
2773
|
+
const message = response.message || response.Message || errorCode;
|
|
2774
|
+
response.message = message;
|
|
2775
|
+
delete response.Message;
|
|
2776
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2777
|
+
};
|
|
2778
|
+
const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
|
|
2779
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2780
|
+
return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
|
|
2781
|
+
}
|
|
2782
|
+
const contents = {
|
|
2783
|
+
$metadata: deserializeMetadata(output),
|
|
2784
|
+
nextToken: undefined,
|
|
2785
|
+
tags: undefined,
|
|
2786
|
+
};
|
|
2787
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2788
|
+
if (data.nextToken !== undefined && data.nextToken !== null) {
|
|
2789
|
+
contents.nextToken = smithy_client_1.expectString(data.nextToken);
|
|
2790
|
+
}
|
|
2791
|
+
if (data.tags !== undefined && data.tags !== null) {
|
|
2792
|
+
contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
|
|
2793
|
+
}
|
|
2794
|
+
return Promise.resolve(contents);
|
|
2795
|
+
};
|
|
2796
|
+
exports.deserializeAws_restJson1ListTagsForResourceCommand = deserializeAws_restJson1ListTagsForResourceCommand;
|
|
2797
|
+
const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
|
|
2798
|
+
const parsedOutput = {
|
|
2799
|
+
...output,
|
|
2800
|
+
body: await parseBody(output.body, context),
|
|
2801
|
+
};
|
|
2802
|
+
let response;
|
|
2803
|
+
let errorCode = "UnknownError";
|
|
2804
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2805
|
+
switch (errorCode) {
|
|
2806
|
+
case "AccessDeniedException":
|
|
2807
|
+
case "com.amazonaws.iottwinmaker#AccessDeniedException":
|
|
2808
|
+
response = {
|
|
2809
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
2810
|
+
name: errorCode,
|
|
2811
|
+
$metadata: deserializeMetadata(output),
|
|
2812
|
+
};
|
|
2813
|
+
break;
|
|
2814
|
+
case "ResourceNotFoundException":
|
|
2815
|
+
case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
|
|
2816
|
+
response = {
|
|
2817
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
2818
|
+
name: errorCode,
|
|
2819
|
+
$metadata: deserializeMetadata(output),
|
|
2820
|
+
};
|
|
2821
|
+
break;
|
|
2822
|
+
default:
|
|
2823
|
+
const parsedBody = parsedOutput.body;
|
|
2824
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2825
|
+
response = {
|
|
2826
|
+
...parsedBody,
|
|
2827
|
+
name: `${errorCode}`,
|
|
2828
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2829
|
+
$fault: "client",
|
|
2830
|
+
$metadata: deserializeMetadata(output),
|
|
2831
|
+
};
|
|
2832
|
+
}
|
|
2833
|
+
const message = response.message || response.Message || errorCode;
|
|
2834
|
+
response.message = message;
|
|
2835
|
+
delete response.Message;
|
|
2836
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2837
|
+
};
|
|
2838
|
+
const deserializeAws_restJson1ListWorkspacesCommand = async (output, context) => {
|
|
2839
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2840
|
+
return deserializeAws_restJson1ListWorkspacesCommandError(output, context);
|
|
2841
|
+
}
|
|
2842
|
+
const contents = {
|
|
2843
|
+
$metadata: deserializeMetadata(output),
|
|
2844
|
+
nextToken: undefined,
|
|
2845
|
+
workspaceSummaries: undefined,
|
|
2846
|
+
};
|
|
2847
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
2848
|
+
if (data.nextToken !== undefined && data.nextToken !== null) {
|
|
2849
|
+
contents.nextToken = smithy_client_1.expectString(data.nextToken);
|
|
2850
|
+
}
|
|
2851
|
+
if (data.workspaceSummaries !== undefined && data.workspaceSummaries !== null) {
|
|
2852
|
+
contents.workspaceSummaries = deserializeAws_restJson1WorkspaceSummaries(data.workspaceSummaries, context);
|
|
2853
|
+
}
|
|
2854
|
+
return Promise.resolve(contents);
|
|
2855
|
+
};
|
|
2856
|
+
exports.deserializeAws_restJson1ListWorkspacesCommand = deserializeAws_restJson1ListWorkspacesCommand;
|
|
2857
|
+
const deserializeAws_restJson1ListWorkspacesCommandError = async (output, context) => {
|
|
2858
|
+
const parsedOutput = {
|
|
2859
|
+
...output,
|
|
2860
|
+
body: await parseBody(output.body, context),
|
|
2861
|
+
};
|
|
2862
|
+
let response;
|
|
2863
|
+
let errorCode = "UnknownError";
|
|
2864
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2865
|
+
switch (errorCode) {
|
|
2866
|
+
case "InternalServerException":
|
|
2867
|
+
case "com.amazonaws.iottwinmaker#InternalServerException":
|
|
2868
|
+
response = {
|
|
2869
|
+
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
2870
|
+
name: errorCode,
|
|
2871
|
+
$metadata: deserializeMetadata(output),
|
|
2872
|
+
};
|
|
2873
|
+
break;
|
|
2874
|
+
case "ServiceQuotaExceededException":
|
|
2875
|
+
case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException":
|
|
2876
|
+
response = {
|
|
2877
|
+
...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
|
|
2878
|
+
name: errorCode,
|
|
2879
|
+
$metadata: deserializeMetadata(output),
|
|
2880
|
+
};
|
|
2881
|
+
break;
|
|
2882
|
+
case "ThrottlingException":
|
|
2883
|
+
case "com.amazonaws.iottwinmaker#ThrottlingException":
|
|
2884
|
+
response = {
|
|
2885
|
+
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
2886
|
+
name: errorCode,
|
|
2887
|
+
$metadata: deserializeMetadata(output),
|
|
2888
|
+
};
|
|
2889
|
+
break;
|
|
2890
|
+
case "ValidationException":
|
|
2891
|
+
case "com.amazonaws.iottwinmaker#ValidationException":
|
|
2892
|
+
response = {
|
|
2893
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
2894
|
+
name: errorCode,
|
|
2895
|
+
$metadata: deserializeMetadata(output),
|
|
2896
|
+
};
|
|
2897
|
+
break;
|
|
2898
|
+
default:
|
|
2899
|
+
const parsedBody = parsedOutput.body;
|
|
2900
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2901
|
+
response = {
|
|
2902
|
+
...parsedBody,
|
|
2903
|
+
name: `${errorCode}`,
|
|
2904
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2905
|
+
$fault: "client",
|
|
2906
|
+
$metadata: deserializeMetadata(output),
|
|
2907
|
+
};
|
|
2908
|
+
}
|
|
2909
|
+
const message = response.message || response.Message || errorCode;
|
|
2910
|
+
response.message = message;
|
|
2911
|
+
delete response.Message;
|
|
2912
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2913
|
+
};
|
|
2914
|
+
const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
|
|
2915
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2916
|
+
return deserializeAws_restJson1TagResourceCommandError(output, context);
|
|
2917
|
+
}
|
|
2918
|
+
const contents = {
|
|
2919
|
+
$metadata: deserializeMetadata(output),
|
|
2920
|
+
};
|
|
2921
|
+
await collectBody(output.body, context);
|
|
2922
|
+
return Promise.resolve(contents);
|
|
2923
|
+
};
|
|
2924
|
+
exports.deserializeAws_restJson1TagResourceCommand = deserializeAws_restJson1TagResourceCommand;
|
|
2925
|
+
const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
|
|
2926
|
+
const parsedOutput = {
|
|
2927
|
+
...output,
|
|
2928
|
+
body: await parseBody(output.body, context),
|
|
2929
|
+
};
|
|
2930
|
+
let response;
|
|
2931
|
+
let errorCode = "UnknownError";
|
|
2932
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2933
|
+
switch (errorCode) {
|
|
2934
|
+
case "AccessDeniedException":
|
|
2935
|
+
case "com.amazonaws.iottwinmaker#AccessDeniedException":
|
|
2936
|
+
response = {
|
|
2937
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
2938
|
+
name: errorCode,
|
|
2939
|
+
$metadata: deserializeMetadata(output),
|
|
2940
|
+
};
|
|
2941
|
+
break;
|
|
2942
|
+
case "ResourceNotFoundException":
|
|
2943
|
+
case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
|
|
2944
|
+
response = {
|
|
2945
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
2946
|
+
name: errorCode,
|
|
2947
|
+
$metadata: deserializeMetadata(output),
|
|
2948
|
+
};
|
|
2949
|
+
break;
|
|
2950
|
+
case "TooManyTagsException":
|
|
2951
|
+
case "com.amazonaws.iottwinmaker#TooManyTagsException":
|
|
2952
|
+
response = {
|
|
2953
|
+
...(await deserializeAws_restJson1TooManyTagsExceptionResponse(parsedOutput, context)),
|
|
2954
|
+
name: errorCode,
|
|
2955
|
+
$metadata: deserializeMetadata(output),
|
|
2956
|
+
};
|
|
2957
|
+
break;
|
|
2958
|
+
default:
|
|
2959
|
+
const parsedBody = parsedOutput.body;
|
|
2960
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2961
|
+
response = {
|
|
2962
|
+
...parsedBody,
|
|
2963
|
+
name: `${errorCode}`,
|
|
2964
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2965
|
+
$fault: "client",
|
|
2966
|
+
$metadata: deserializeMetadata(output),
|
|
2967
|
+
};
|
|
2968
|
+
}
|
|
2969
|
+
const message = response.message || response.Message || errorCode;
|
|
2970
|
+
response.message = message;
|
|
2971
|
+
delete response.Message;
|
|
2972
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
2973
|
+
};
|
|
2974
|
+
const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
|
|
2975
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2976
|
+
return deserializeAws_restJson1UntagResourceCommandError(output, context);
|
|
2977
|
+
}
|
|
2978
|
+
const contents = {
|
|
2979
|
+
$metadata: deserializeMetadata(output),
|
|
2980
|
+
};
|
|
2981
|
+
await collectBody(output.body, context);
|
|
2982
|
+
return Promise.resolve(contents);
|
|
2983
|
+
};
|
|
2984
|
+
exports.deserializeAws_restJson1UntagResourceCommand = deserializeAws_restJson1UntagResourceCommand;
|
|
2985
|
+
const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
|
|
2986
|
+
const parsedOutput = {
|
|
2987
|
+
...output,
|
|
2988
|
+
body: await parseBody(output.body, context),
|
|
2989
|
+
};
|
|
2990
|
+
let response;
|
|
2991
|
+
let errorCode = "UnknownError";
|
|
2992
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2993
|
+
switch (errorCode) {
|
|
2994
|
+
case "AccessDeniedException":
|
|
2995
|
+
case "com.amazonaws.iottwinmaker#AccessDeniedException":
|
|
2996
|
+
response = {
|
|
2997
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
2998
|
+
name: errorCode,
|
|
2999
|
+
$metadata: deserializeMetadata(output),
|
|
3000
|
+
};
|
|
3001
|
+
break;
|
|
3002
|
+
case "ResourceNotFoundException":
|
|
3003
|
+
case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
|
|
3004
|
+
response = {
|
|
3005
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
3006
|
+
name: errorCode,
|
|
3007
|
+
$metadata: deserializeMetadata(output),
|
|
3008
|
+
};
|
|
3009
|
+
break;
|
|
3010
|
+
default:
|
|
3011
|
+
const parsedBody = parsedOutput.body;
|
|
3012
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
3013
|
+
response = {
|
|
3014
|
+
...parsedBody,
|
|
3015
|
+
name: `${errorCode}`,
|
|
3016
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
3017
|
+
$fault: "client",
|
|
3018
|
+
$metadata: deserializeMetadata(output),
|
|
3019
|
+
};
|
|
3020
|
+
}
|
|
3021
|
+
const message = response.message || response.Message || errorCode;
|
|
3022
|
+
response.message = message;
|
|
3023
|
+
delete response.Message;
|
|
3024
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
3025
|
+
};
|
|
3026
|
+
const deserializeAws_restJson1UpdateComponentTypeCommand = async (output, context) => {
|
|
3027
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
3028
|
+
return deserializeAws_restJson1UpdateComponentTypeCommandError(output, context);
|
|
3029
|
+
}
|
|
3030
|
+
const contents = {
|
|
3031
|
+
$metadata: deserializeMetadata(output),
|
|
3032
|
+
arn: undefined,
|
|
3033
|
+
componentTypeId: undefined,
|
|
3034
|
+
state: undefined,
|
|
3035
|
+
workspaceId: undefined,
|
|
3036
|
+
};
|
|
3037
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
3038
|
+
if (data.arn !== undefined && data.arn !== null) {
|
|
3039
|
+
contents.arn = smithy_client_1.expectString(data.arn);
|
|
3040
|
+
}
|
|
3041
|
+
if (data.componentTypeId !== undefined && data.componentTypeId !== null) {
|
|
3042
|
+
contents.componentTypeId = smithy_client_1.expectString(data.componentTypeId);
|
|
3043
|
+
}
|
|
3044
|
+
if (data.state !== undefined && data.state !== null) {
|
|
3045
|
+
contents.state = smithy_client_1.expectString(data.state);
|
|
3046
|
+
}
|
|
3047
|
+
if (data.workspaceId !== undefined && data.workspaceId !== null) {
|
|
3048
|
+
contents.workspaceId = smithy_client_1.expectString(data.workspaceId);
|
|
3049
|
+
}
|
|
3050
|
+
return Promise.resolve(contents);
|
|
3051
|
+
};
|
|
3052
|
+
exports.deserializeAws_restJson1UpdateComponentTypeCommand = deserializeAws_restJson1UpdateComponentTypeCommand;
|
|
3053
|
+
const deserializeAws_restJson1UpdateComponentTypeCommandError = async (output, context) => {
|
|
3054
|
+
const parsedOutput = {
|
|
3055
|
+
...output,
|
|
3056
|
+
body: await parseBody(output.body, context),
|
|
3057
|
+
};
|
|
3058
|
+
let response;
|
|
3059
|
+
let errorCode = "UnknownError";
|
|
3060
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
3061
|
+
switch (errorCode) {
|
|
3062
|
+
case "AccessDeniedException":
|
|
3063
|
+
case "com.amazonaws.iottwinmaker#AccessDeniedException":
|
|
3064
|
+
response = {
|
|
3065
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
3066
|
+
name: errorCode,
|
|
3067
|
+
$metadata: deserializeMetadata(output),
|
|
3068
|
+
};
|
|
3069
|
+
break;
|
|
3070
|
+
case "InternalServerException":
|
|
3071
|
+
case "com.amazonaws.iottwinmaker#InternalServerException":
|
|
3072
|
+
response = {
|
|
3073
|
+
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
3074
|
+
name: errorCode,
|
|
3075
|
+
$metadata: deserializeMetadata(output),
|
|
3076
|
+
};
|
|
3077
|
+
break;
|
|
3078
|
+
case "ResourceNotFoundException":
|
|
3079
|
+
case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
|
|
3080
|
+
response = {
|
|
3081
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
3082
|
+
name: errorCode,
|
|
3083
|
+
$metadata: deserializeMetadata(output),
|
|
3084
|
+
};
|
|
3085
|
+
break;
|
|
3086
|
+
case "ServiceQuotaExceededException":
|
|
3087
|
+
case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException":
|
|
3088
|
+
response = {
|
|
3089
|
+
...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
|
|
3090
|
+
name: errorCode,
|
|
3091
|
+
$metadata: deserializeMetadata(output),
|
|
3092
|
+
};
|
|
3093
|
+
break;
|
|
3094
|
+
case "ThrottlingException":
|
|
3095
|
+
case "com.amazonaws.iottwinmaker#ThrottlingException":
|
|
3096
|
+
response = {
|
|
3097
|
+
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
3098
|
+
name: errorCode,
|
|
3099
|
+
$metadata: deserializeMetadata(output),
|
|
3100
|
+
};
|
|
3101
|
+
break;
|
|
3102
|
+
case "ValidationException":
|
|
3103
|
+
case "com.amazonaws.iottwinmaker#ValidationException":
|
|
3104
|
+
response = {
|
|
3105
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
3106
|
+
name: errorCode,
|
|
3107
|
+
$metadata: deserializeMetadata(output),
|
|
3108
|
+
};
|
|
3109
|
+
break;
|
|
3110
|
+
default:
|
|
3111
|
+
const parsedBody = parsedOutput.body;
|
|
3112
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
3113
|
+
response = {
|
|
3114
|
+
...parsedBody,
|
|
3115
|
+
name: `${errorCode}`,
|
|
3116
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
3117
|
+
$fault: "client",
|
|
3118
|
+
$metadata: deserializeMetadata(output),
|
|
3119
|
+
};
|
|
3120
|
+
}
|
|
3121
|
+
const message = response.message || response.Message || errorCode;
|
|
3122
|
+
response.message = message;
|
|
3123
|
+
delete response.Message;
|
|
3124
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
3125
|
+
};
|
|
3126
|
+
const deserializeAws_restJson1UpdateEntityCommand = async (output, context) => {
|
|
3127
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
3128
|
+
return deserializeAws_restJson1UpdateEntityCommandError(output, context);
|
|
3129
|
+
}
|
|
3130
|
+
const contents = {
|
|
3131
|
+
$metadata: deserializeMetadata(output),
|
|
3132
|
+
state: undefined,
|
|
3133
|
+
updateDateTime: undefined,
|
|
3134
|
+
};
|
|
3135
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
3136
|
+
if (data.state !== undefined && data.state !== null) {
|
|
3137
|
+
contents.state = smithy_client_1.expectString(data.state);
|
|
3138
|
+
}
|
|
3139
|
+
if (data.updateDateTime !== undefined && data.updateDateTime !== null) {
|
|
3140
|
+
contents.updateDateTime = smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(data.updateDateTime)));
|
|
3141
|
+
}
|
|
3142
|
+
return Promise.resolve(contents);
|
|
3143
|
+
};
|
|
3144
|
+
exports.deserializeAws_restJson1UpdateEntityCommand = deserializeAws_restJson1UpdateEntityCommand;
|
|
3145
|
+
const deserializeAws_restJson1UpdateEntityCommandError = async (output, context) => {
|
|
3146
|
+
const parsedOutput = {
|
|
3147
|
+
...output,
|
|
3148
|
+
body: await parseBody(output.body, context),
|
|
3149
|
+
};
|
|
3150
|
+
let response;
|
|
3151
|
+
let errorCode = "UnknownError";
|
|
3152
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
3153
|
+
switch (errorCode) {
|
|
3154
|
+
case "AccessDeniedException":
|
|
3155
|
+
case "com.amazonaws.iottwinmaker#AccessDeniedException":
|
|
3156
|
+
response = {
|
|
3157
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
3158
|
+
name: errorCode,
|
|
3159
|
+
$metadata: deserializeMetadata(output),
|
|
3160
|
+
};
|
|
3161
|
+
break;
|
|
3162
|
+
case "ConflictException":
|
|
3163
|
+
case "com.amazonaws.iottwinmaker#ConflictException":
|
|
3164
|
+
response = {
|
|
3165
|
+
...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
|
|
3166
|
+
name: errorCode,
|
|
3167
|
+
$metadata: deserializeMetadata(output),
|
|
3168
|
+
};
|
|
3169
|
+
break;
|
|
3170
|
+
case "InternalServerException":
|
|
3171
|
+
case "com.amazonaws.iottwinmaker#InternalServerException":
|
|
3172
|
+
response = {
|
|
3173
|
+
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
3174
|
+
name: errorCode,
|
|
3175
|
+
$metadata: deserializeMetadata(output),
|
|
3176
|
+
};
|
|
3177
|
+
break;
|
|
3178
|
+
case "ResourceNotFoundException":
|
|
3179
|
+
case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
|
|
3180
|
+
response = {
|
|
3181
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
3182
|
+
name: errorCode,
|
|
3183
|
+
$metadata: deserializeMetadata(output),
|
|
3184
|
+
};
|
|
3185
|
+
break;
|
|
3186
|
+
case "ServiceQuotaExceededException":
|
|
3187
|
+
case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException":
|
|
3188
|
+
response = {
|
|
3189
|
+
...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
|
|
3190
|
+
name: errorCode,
|
|
3191
|
+
$metadata: deserializeMetadata(output),
|
|
3192
|
+
};
|
|
3193
|
+
break;
|
|
3194
|
+
case "ThrottlingException":
|
|
3195
|
+
case "com.amazonaws.iottwinmaker#ThrottlingException":
|
|
3196
|
+
response = {
|
|
3197
|
+
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
3198
|
+
name: errorCode,
|
|
3199
|
+
$metadata: deserializeMetadata(output),
|
|
3200
|
+
};
|
|
3201
|
+
break;
|
|
3202
|
+
case "ValidationException":
|
|
3203
|
+
case "com.amazonaws.iottwinmaker#ValidationException":
|
|
3204
|
+
response = {
|
|
3205
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
3206
|
+
name: errorCode,
|
|
3207
|
+
$metadata: deserializeMetadata(output),
|
|
3208
|
+
};
|
|
3209
|
+
break;
|
|
3210
|
+
default:
|
|
3211
|
+
const parsedBody = parsedOutput.body;
|
|
3212
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
3213
|
+
response = {
|
|
3214
|
+
...parsedBody,
|
|
3215
|
+
name: `${errorCode}`,
|
|
3216
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
3217
|
+
$fault: "client",
|
|
3218
|
+
$metadata: deserializeMetadata(output),
|
|
3219
|
+
};
|
|
3220
|
+
}
|
|
3221
|
+
const message = response.message || response.Message || errorCode;
|
|
3222
|
+
response.message = message;
|
|
3223
|
+
delete response.Message;
|
|
3224
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
3225
|
+
};
|
|
3226
|
+
const deserializeAws_restJson1UpdateSceneCommand = async (output, context) => {
|
|
3227
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
3228
|
+
return deserializeAws_restJson1UpdateSceneCommandError(output, context);
|
|
3229
|
+
}
|
|
3230
|
+
const contents = {
|
|
3231
|
+
$metadata: deserializeMetadata(output),
|
|
3232
|
+
updateDateTime: undefined,
|
|
3233
|
+
};
|
|
3234
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
3235
|
+
if (data.updateDateTime !== undefined && data.updateDateTime !== null) {
|
|
3236
|
+
contents.updateDateTime = smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(data.updateDateTime)));
|
|
3237
|
+
}
|
|
3238
|
+
return Promise.resolve(contents);
|
|
3239
|
+
};
|
|
3240
|
+
exports.deserializeAws_restJson1UpdateSceneCommand = deserializeAws_restJson1UpdateSceneCommand;
|
|
3241
|
+
const deserializeAws_restJson1UpdateSceneCommandError = async (output, context) => {
|
|
3242
|
+
const parsedOutput = {
|
|
3243
|
+
...output,
|
|
3244
|
+
body: await parseBody(output.body, context),
|
|
3245
|
+
};
|
|
3246
|
+
let response;
|
|
3247
|
+
let errorCode = "UnknownError";
|
|
3248
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
3249
|
+
switch (errorCode) {
|
|
3250
|
+
case "AccessDeniedException":
|
|
3251
|
+
case "com.amazonaws.iottwinmaker#AccessDeniedException":
|
|
3252
|
+
response = {
|
|
3253
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
3254
|
+
name: errorCode,
|
|
3255
|
+
$metadata: deserializeMetadata(output),
|
|
3256
|
+
};
|
|
3257
|
+
break;
|
|
3258
|
+
case "InternalServerException":
|
|
3259
|
+
case "com.amazonaws.iottwinmaker#InternalServerException":
|
|
3260
|
+
response = {
|
|
3261
|
+
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
3262
|
+
name: errorCode,
|
|
3263
|
+
$metadata: deserializeMetadata(output),
|
|
3264
|
+
};
|
|
3265
|
+
break;
|
|
3266
|
+
case "ResourceNotFoundException":
|
|
3267
|
+
case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
|
|
3268
|
+
response = {
|
|
3269
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
3270
|
+
name: errorCode,
|
|
3271
|
+
$metadata: deserializeMetadata(output),
|
|
3272
|
+
};
|
|
3273
|
+
break;
|
|
3274
|
+
case "ThrottlingException":
|
|
3275
|
+
case "com.amazonaws.iottwinmaker#ThrottlingException":
|
|
3276
|
+
response = {
|
|
3277
|
+
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
3278
|
+
name: errorCode,
|
|
3279
|
+
$metadata: deserializeMetadata(output),
|
|
3280
|
+
};
|
|
3281
|
+
break;
|
|
3282
|
+
case "ValidationException":
|
|
3283
|
+
case "com.amazonaws.iottwinmaker#ValidationException":
|
|
3284
|
+
response = {
|
|
3285
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
3286
|
+
name: errorCode,
|
|
3287
|
+
$metadata: deserializeMetadata(output),
|
|
3288
|
+
};
|
|
3289
|
+
break;
|
|
3290
|
+
default:
|
|
3291
|
+
const parsedBody = parsedOutput.body;
|
|
3292
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
3293
|
+
response = {
|
|
3294
|
+
...parsedBody,
|
|
3295
|
+
name: `${errorCode}`,
|
|
3296
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
3297
|
+
$fault: "client",
|
|
3298
|
+
$metadata: deserializeMetadata(output),
|
|
3299
|
+
};
|
|
3300
|
+
}
|
|
3301
|
+
const message = response.message || response.Message || errorCode;
|
|
3302
|
+
response.message = message;
|
|
3303
|
+
delete response.Message;
|
|
3304
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
3305
|
+
};
|
|
3306
|
+
const deserializeAws_restJson1UpdateWorkspaceCommand = async (output, context) => {
|
|
3307
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
3308
|
+
return deserializeAws_restJson1UpdateWorkspaceCommandError(output, context);
|
|
3309
|
+
}
|
|
3310
|
+
const contents = {
|
|
3311
|
+
$metadata: deserializeMetadata(output),
|
|
3312
|
+
updateDateTime: undefined,
|
|
3313
|
+
};
|
|
3314
|
+
const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
|
|
3315
|
+
if (data.updateDateTime !== undefined && data.updateDateTime !== null) {
|
|
3316
|
+
contents.updateDateTime = smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(data.updateDateTime)));
|
|
3317
|
+
}
|
|
3318
|
+
return Promise.resolve(contents);
|
|
3319
|
+
};
|
|
3320
|
+
exports.deserializeAws_restJson1UpdateWorkspaceCommand = deserializeAws_restJson1UpdateWorkspaceCommand;
|
|
3321
|
+
const deserializeAws_restJson1UpdateWorkspaceCommandError = async (output, context) => {
|
|
3322
|
+
const parsedOutput = {
|
|
3323
|
+
...output,
|
|
3324
|
+
body: await parseBody(output.body, context),
|
|
3325
|
+
};
|
|
3326
|
+
let response;
|
|
3327
|
+
let errorCode = "UnknownError";
|
|
3328
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
3329
|
+
switch (errorCode) {
|
|
3330
|
+
case "AccessDeniedException":
|
|
3331
|
+
case "com.amazonaws.iottwinmaker#AccessDeniedException":
|
|
3332
|
+
response = {
|
|
3333
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
3334
|
+
name: errorCode,
|
|
3335
|
+
$metadata: deserializeMetadata(output),
|
|
3336
|
+
};
|
|
3337
|
+
break;
|
|
3338
|
+
case "InternalServerException":
|
|
3339
|
+
case "com.amazonaws.iottwinmaker#InternalServerException":
|
|
3340
|
+
response = {
|
|
3341
|
+
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
3342
|
+
name: errorCode,
|
|
3343
|
+
$metadata: deserializeMetadata(output),
|
|
3344
|
+
};
|
|
3345
|
+
break;
|
|
3346
|
+
case "ResourceNotFoundException":
|
|
3347
|
+
case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
|
|
3348
|
+
response = {
|
|
3349
|
+
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
3350
|
+
name: errorCode,
|
|
3351
|
+
$metadata: deserializeMetadata(output),
|
|
3352
|
+
};
|
|
3353
|
+
break;
|
|
3354
|
+
case "ServiceQuotaExceededException":
|
|
3355
|
+
case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException":
|
|
3356
|
+
response = {
|
|
3357
|
+
...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
|
|
3358
|
+
name: errorCode,
|
|
3359
|
+
$metadata: deserializeMetadata(output),
|
|
3360
|
+
};
|
|
3361
|
+
break;
|
|
3362
|
+
case "ThrottlingException":
|
|
3363
|
+
case "com.amazonaws.iottwinmaker#ThrottlingException":
|
|
3364
|
+
response = {
|
|
3365
|
+
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
3366
|
+
name: errorCode,
|
|
3367
|
+
$metadata: deserializeMetadata(output),
|
|
3368
|
+
};
|
|
3369
|
+
break;
|
|
3370
|
+
case "ValidationException":
|
|
3371
|
+
case "com.amazonaws.iottwinmaker#ValidationException":
|
|
3372
|
+
response = {
|
|
3373
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
3374
|
+
name: errorCode,
|
|
3375
|
+
$metadata: deserializeMetadata(output),
|
|
3376
|
+
};
|
|
3377
|
+
break;
|
|
3378
|
+
default:
|
|
3379
|
+
const parsedBody = parsedOutput.body;
|
|
3380
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
3381
|
+
response = {
|
|
3382
|
+
...parsedBody,
|
|
3383
|
+
name: `${errorCode}`,
|
|
3384
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
3385
|
+
$fault: "client",
|
|
3386
|
+
$metadata: deserializeMetadata(output),
|
|
3387
|
+
};
|
|
3388
|
+
}
|
|
3389
|
+
const message = response.message || response.Message || errorCode;
|
|
3390
|
+
response.message = message;
|
|
3391
|
+
delete response.Message;
|
|
3392
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
3393
|
+
};
|
|
3394
|
+
const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
|
|
3395
|
+
const contents = {
|
|
3396
|
+
name: "AccessDeniedException",
|
|
3397
|
+
$fault: "client",
|
|
3398
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
3399
|
+
message: undefined,
|
|
3400
|
+
};
|
|
3401
|
+
const data = parsedOutput.body;
|
|
3402
|
+
if (data.message !== undefined && data.message !== null) {
|
|
3403
|
+
contents.message = smithy_client_1.expectString(data.message);
|
|
3404
|
+
}
|
|
3405
|
+
return contents;
|
|
3406
|
+
};
|
|
3407
|
+
const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
|
|
3408
|
+
const contents = {
|
|
3409
|
+
name: "ConflictException",
|
|
3410
|
+
$fault: "client",
|
|
3411
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
3412
|
+
message: undefined,
|
|
3413
|
+
};
|
|
3414
|
+
const data = parsedOutput.body;
|
|
3415
|
+
if (data.message !== undefined && data.message !== null) {
|
|
3416
|
+
contents.message = smithy_client_1.expectString(data.message);
|
|
3417
|
+
}
|
|
3418
|
+
return contents;
|
|
3419
|
+
};
|
|
3420
|
+
const deserializeAws_restJson1ConnectorFailureExceptionResponse = async (parsedOutput, context) => {
|
|
3421
|
+
const contents = {
|
|
3422
|
+
name: "ConnectorFailureException",
|
|
3423
|
+
$fault: "client",
|
|
3424
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
3425
|
+
message: undefined,
|
|
3426
|
+
};
|
|
3427
|
+
const data = parsedOutput.body;
|
|
3428
|
+
if (data.message !== undefined && data.message !== null) {
|
|
3429
|
+
contents.message = smithy_client_1.expectString(data.message);
|
|
3430
|
+
}
|
|
3431
|
+
return contents;
|
|
3432
|
+
};
|
|
3433
|
+
const deserializeAws_restJson1ConnectorTimeoutExceptionResponse = async (parsedOutput, context) => {
|
|
3434
|
+
const contents = {
|
|
3435
|
+
name: "ConnectorTimeoutException",
|
|
3436
|
+
$fault: "client",
|
|
3437
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
3438
|
+
message: undefined,
|
|
3439
|
+
};
|
|
3440
|
+
const data = parsedOutput.body;
|
|
3441
|
+
if (data.message !== undefined && data.message !== null) {
|
|
3442
|
+
contents.message = smithy_client_1.expectString(data.message);
|
|
3443
|
+
}
|
|
3444
|
+
return contents;
|
|
3445
|
+
};
|
|
3446
|
+
const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
|
|
3447
|
+
const contents = {
|
|
3448
|
+
name: "InternalServerException",
|
|
3449
|
+
$fault: "server",
|
|
3450
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
3451
|
+
message: undefined,
|
|
3452
|
+
};
|
|
3453
|
+
const data = parsedOutput.body;
|
|
3454
|
+
if (data.message !== undefined && data.message !== null) {
|
|
3455
|
+
contents.message = smithy_client_1.expectString(data.message);
|
|
3456
|
+
}
|
|
3457
|
+
return contents;
|
|
3458
|
+
};
|
|
3459
|
+
const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
|
|
3460
|
+
const contents = {
|
|
3461
|
+
name: "ResourceNotFoundException",
|
|
3462
|
+
$fault: "client",
|
|
3463
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
3464
|
+
message: undefined,
|
|
3465
|
+
};
|
|
3466
|
+
const data = parsedOutput.body;
|
|
3467
|
+
if (data.message !== undefined && data.message !== null) {
|
|
3468
|
+
contents.message = smithy_client_1.expectString(data.message);
|
|
3469
|
+
}
|
|
3470
|
+
return contents;
|
|
3471
|
+
};
|
|
3472
|
+
const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
|
|
3473
|
+
const contents = {
|
|
3474
|
+
name: "ServiceQuotaExceededException",
|
|
3475
|
+
$fault: "client",
|
|
3476
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
3477
|
+
message: undefined,
|
|
3478
|
+
};
|
|
3479
|
+
const data = parsedOutput.body;
|
|
3480
|
+
if (data.message !== undefined && data.message !== null) {
|
|
3481
|
+
contents.message = smithy_client_1.expectString(data.message);
|
|
3482
|
+
}
|
|
3483
|
+
return contents;
|
|
3484
|
+
};
|
|
3485
|
+
const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
|
|
3486
|
+
const contents = {
|
|
3487
|
+
name: "ThrottlingException",
|
|
3488
|
+
$fault: "client",
|
|
3489
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
3490
|
+
message: undefined,
|
|
3491
|
+
};
|
|
3492
|
+
const data = parsedOutput.body;
|
|
3493
|
+
if (data.message !== undefined && data.message !== null) {
|
|
3494
|
+
contents.message = smithy_client_1.expectString(data.message);
|
|
3495
|
+
}
|
|
3496
|
+
return contents;
|
|
3497
|
+
};
|
|
3498
|
+
const deserializeAws_restJson1TooManyTagsExceptionResponse = async (parsedOutput, context) => {
|
|
3499
|
+
const contents = {
|
|
3500
|
+
name: "TooManyTagsException",
|
|
3501
|
+
$fault: "client",
|
|
3502
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
3503
|
+
message: undefined,
|
|
3504
|
+
};
|
|
3505
|
+
const data = parsedOutput.body;
|
|
3506
|
+
if (data.message !== undefined && data.message !== null) {
|
|
3507
|
+
contents.message = smithy_client_1.expectString(data.message);
|
|
3508
|
+
}
|
|
3509
|
+
return contents;
|
|
3510
|
+
};
|
|
3511
|
+
const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
|
|
3512
|
+
const contents = {
|
|
3513
|
+
name: "ValidationException",
|
|
3514
|
+
$fault: "client",
|
|
3515
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
3516
|
+
message: undefined,
|
|
3517
|
+
};
|
|
3518
|
+
const data = parsedOutput.body;
|
|
3519
|
+
if (data.message !== undefined && data.message !== null) {
|
|
3520
|
+
contents.message = smithy_client_1.expectString(data.message);
|
|
3521
|
+
}
|
|
3522
|
+
return contents;
|
|
3523
|
+
};
|
|
3524
|
+
const serializeAws_restJson1ComponentRequest = (input, context) => {
|
|
3525
|
+
return {
|
|
3526
|
+
...(input.componentTypeId !== undefined &&
|
|
3527
|
+
input.componentTypeId !== null && { componentTypeId: input.componentTypeId }),
|
|
3528
|
+
...(input.description !== undefined && input.description !== null && { description: input.description }),
|
|
3529
|
+
...(input.properties !== undefined &&
|
|
3530
|
+
input.properties !== null && { properties: serializeAws_restJson1PropertyRequests(input.properties, context) }),
|
|
3531
|
+
};
|
|
3532
|
+
};
|
|
3533
|
+
const serializeAws_restJson1ComponentsMapRequest = (input, context) => {
|
|
3534
|
+
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
3535
|
+
if (value === null) {
|
|
3536
|
+
return acc;
|
|
3537
|
+
}
|
|
3538
|
+
return {
|
|
3539
|
+
...acc,
|
|
3540
|
+
[key]: serializeAws_restJson1ComponentRequest(value, context),
|
|
3541
|
+
};
|
|
3542
|
+
}, {});
|
|
3543
|
+
};
|
|
3544
|
+
const serializeAws_restJson1ComponentUpdateRequest = (input, context) => {
|
|
3545
|
+
return {
|
|
3546
|
+
...(input.componentTypeId !== undefined &&
|
|
3547
|
+
input.componentTypeId !== null && { componentTypeId: input.componentTypeId }),
|
|
3548
|
+
...(input.description !== undefined && input.description !== null && { description: input.description }),
|
|
3549
|
+
...(input.propertyUpdates !== undefined &&
|
|
3550
|
+
input.propertyUpdates !== null && {
|
|
3551
|
+
propertyUpdates: serializeAws_restJson1PropertyRequests(input.propertyUpdates, context),
|
|
3552
|
+
}),
|
|
3553
|
+
...(input.updateType !== undefined && input.updateType !== null && { updateType: input.updateType }),
|
|
3554
|
+
};
|
|
3555
|
+
};
|
|
3556
|
+
const serializeAws_restJson1ComponentUpdatesMapRequest = (input, context) => {
|
|
3557
|
+
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
3558
|
+
if (value === null) {
|
|
3559
|
+
return acc;
|
|
3560
|
+
}
|
|
3561
|
+
return {
|
|
3562
|
+
...acc,
|
|
3563
|
+
[key]: serializeAws_restJson1ComponentUpdateRequest(value, context),
|
|
3564
|
+
};
|
|
3565
|
+
}, {});
|
|
3566
|
+
};
|
|
3567
|
+
const serializeAws_restJson1Configuration = (input, context) => {
|
|
3568
|
+
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
3569
|
+
if (value === null) {
|
|
3570
|
+
return acc;
|
|
3571
|
+
}
|
|
3572
|
+
return {
|
|
3573
|
+
...acc,
|
|
3574
|
+
[key]: value,
|
|
3575
|
+
};
|
|
3576
|
+
}, {});
|
|
3577
|
+
};
|
|
3578
|
+
const serializeAws_restJson1DataConnector = (input, context) => {
|
|
3579
|
+
return {
|
|
3580
|
+
...(input.isNative !== undefined && input.isNative !== null && { isNative: input.isNative }),
|
|
3581
|
+
...(input.lambda !== undefined &&
|
|
3582
|
+
input.lambda !== null && { lambda: serializeAws_restJson1LambdaFunction(input.lambda, context) }),
|
|
3583
|
+
};
|
|
3584
|
+
};
|
|
3585
|
+
const serializeAws_restJson1DataType = (input, context) => {
|
|
3586
|
+
return {
|
|
3587
|
+
...(input.allowedValues !== undefined &&
|
|
3588
|
+
input.allowedValues !== null && {
|
|
3589
|
+
allowedValues: serializeAws_restJson1DataValueList(input.allowedValues, context),
|
|
3590
|
+
}),
|
|
3591
|
+
...(input.nestedType !== undefined &&
|
|
3592
|
+
input.nestedType !== null && { nestedType: serializeAws_restJson1DataType(input.nestedType, context) }),
|
|
3593
|
+
...(input.relationship !== undefined &&
|
|
3594
|
+
input.relationship !== null && { relationship: serializeAws_restJson1Relationship(input.relationship, context) }),
|
|
3595
|
+
...(input.type !== undefined && input.type !== null && { type: input.type }),
|
|
3596
|
+
...(input.unitOfMeasure !== undefined && input.unitOfMeasure !== null && { unitOfMeasure: input.unitOfMeasure }),
|
|
3597
|
+
};
|
|
3598
|
+
};
|
|
3599
|
+
const serializeAws_restJson1DataValue = (input, context) => {
|
|
3600
|
+
return {
|
|
3601
|
+
...(input.booleanValue !== undefined && input.booleanValue !== null && { booleanValue: input.booleanValue }),
|
|
3602
|
+
...(input.doubleValue !== undefined &&
|
|
3603
|
+
input.doubleValue !== null && { doubleValue: smithy_client_1.serializeFloat(input.doubleValue) }),
|
|
3604
|
+
...(input.expression !== undefined && input.expression !== null && { expression: input.expression }),
|
|
3605
|
+
...(input.integerValue !== undefined && input.integerValue !== null && { integerValue: input.integerValue }),
|
|
3606
|
+
...(input.listValue !== undefined &&
|
|
3607
|
+
input.listValue !== null && { listValue: serializeAws_restJson1DataValueList(input.listValue, context) }),
|
|
3608
|
+
...(input.longValue !== undefined && input.longValue !== null && { longValue: input.longValue }),
|
|
3609
|
+
...(input.mapValue !== undefined &&
|
|
3610
|
+
input.mapValue !== null && { mapValue: serializeAws_restJson1DataValueMap(input.mapValue, context) }),
|
|
3611
|
+
...(input.relationshipValue !== undefined &&
|
|
3612
|
+
input.relationshipValue !== null && {
|
|
3613
|
+
relationshipValue: serializeAws_restJson1RelationshipValue(input.relationshipValue, context),
|
|
3614
|
+
}),
|
|
3615
|
+
...(input.stringValue !== undefined && input.stringValue !== null && { stringValue: input.stringValue }),
|
|
3616
|
+
};
|
|
3617
|
+
};
|
|
3618
|
+
const serializeAws_restJson1DataValueList = (input, context) => {
|
|
3619
|
+
return input
|
|
3620
|
+
.filter((e) => e != null)
|
|
3621
|
+
.map((entry) => {
|
|
3622
|
+
if (entry === null) {
|
|
3623
|
+
return null;
|
|
3624
|
+
}
|
|
3625
|
+
return serializeAws_restJson1DataValue(entry, context);
|
|
3626
|
+
});
|
|
3627
|
+
};
|
|
3628
|
+
const serializeAws_restJson1DataValueMap = (input, context) => {
|
|
3629
|
+
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
3630
|
+
if (value === null) {
|
|
3631
|
+
return acc;
|
|
3632
|
+
}
|
|
3633
|
+
return {
|
|
3634
|
+
...acc,
|
|
3635
|
+
[key]: serializeAws_restJson1DataValue(value, context),
|
|
3636
|
+
};
|
|
3637
|
+
}, {});
|
|
3638
|
+
};
|
|
3639
|
+
const serializeAws_restJson1EntityPropertyReference = (input, context) => {
|
|
3640
|
+
return {
|
|
3641
|
+
...(input.componentName !== undefined && input.componentName !== null && { componentName: input.componentName }),
|
|
3642
|
+
...(input.entityId !== undefined && input.entityId !== null && { entityId: input.entityId }),
|
|
3643
|
+
...(input.externalIdProperty !== undefined &&
|
|
3644
|
+
input.externalIdProperty !== null && {
|
|
3645
|
+
externalIdProperty: serializeAws_restJson1ExternalIdProperty(input.externalIdProperty, context),
|
|
3646
|
+
}),
|
|
3647
|
+
...(input.propertyName !== undefined && input.propertyName !== null && { propertyName: input.propertyName }),
|
|
3648
|
+
};
|
|
3649
|
+
};
|
|
3650
|
+
const serializeAws_restJson1Entries = (input, context) => {
|
|
3651
|
+
return input
|
|
3652
|
+
.filter((e) => e != null)
|
|
3653
|
+
.map((entry) => {
|
|
3654
|
+
if (entry === null) {
|
|
3655
|
+
return null;
|
|
3656
|
+
}
|
|
3657
|
+
return serializeAws_restJson1PropertyValueEntry(entry, context);
|
|
3658
|
+
});
|
|
3659
|
+
};
|
|
3660
|
+
const serializeAws_restJson1ExtendsFrom = (input, context) => {
|
|
3661
|
+
return input
|
|
3662
|
+
.filter((e) => e != null)
|
|
3663
|
+
.map((entry) => {
|
|
3664
|
+
if (entry === null) {
|
|
3665
|
+
return null;
|
|
3666
|
+
}
|
|
3667
|
+
return entry;
|
|
3668
|
+
});
|
|
3669
|
+
};
|
|
3670
|
+
const serializeAws_restJson1ExternalIdProperty = (input, context) => {
|
|
3671
|
+
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
3672
|
+
if (value === null) {
|
|
3673
|
+
return acc;
|
|
3674
|
+
}
|
|
3675
|
+
return {
|
|
3676
|
+
...acc,
|
|
3677
|
+
[key]: value,
|
|
3678
|
+
};
|
|
3679
|
+
}, {});
|
|
3680
|
+
};
|
|
3681
|
+
const serializeAws_restJson1FunctionRequest = (input, context) => {
|
|
3682
|
+
return {
|
|
3683
|
+
...(input.implementedBy !== undefined &&
|
|
3684
|
+
input.implementedBy !== null && {
|
|
3685
|
+
implementedBy: serializeAws_restJson1DataConnector(input.implementedBy, context),
|
|
3686
|
+
}),
|
|
3687
|
+
...(input.requiredProperties !== undefined &&
|
|
3688
|
+
input.requiredProperties !== null && {
|
|
3689
|
+
requiredProperties: serializeAws_restJson1RequiredProperties(input.requiredProperties, context),
|
|
3690
|
+
}),
|
|
3691
|
+
...(input.scope !== undefined && input.scope !== null && { scope: input.scope }),
|
|
3692
|
+
};
|
|
3693
|
+
};
|
|
3694
|
+
const serializeAws_restJson1FunctionsRequest = (input, context) => {
|
|
3695
|
+
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
3696
|
+
if (value === null) {
|
|
3697
|
+
return acc;
|
|
3698
|
+
}
|
|
3699
|
+
return {
|
|
3700
|
+
...acc,
|
|
3701
|
+
[key]: serializeAws_restJson1FunctionRequest(value, context),
|
|
3702
|
+
};
|
|
3703
|
+
}, {});
|
|
3704
|
+
};
|
|
3705
|
+
const serializeAws_restJson1InterpolationParameters = (input, context) => {
|
|
3706
|
+
return {
|
|
3707
|
+
...(input.interpolationType !== undefined &&
|
|
3708
|
+
input.interpolationType !== null && { interpolationType: input.interpolationType }),
|
|
3709
|
+
...(input.intervalInSeconds !== undefined &&
|
|
3710
|
+
input.intervalInSeconds !== null && { intervalInSeconds: input.intervalInSeconds }),
|
|
3711
|
+
};
|
|
3712
|
+
};
|
|
3713
|
+
const serializeAws_restJson1LambdaFunction = (input, context) => {
|
|
3714
|
+
return {
|
|
3715
|
+
...(input.arn !== undefined && input.arn !== null && { arn: input.arn }),
|
|
3716
|
+
};
|
|
3717
|
+
};
|
|
3718
|
+
const serializeAws_restJson1ListComponentTypesFilter = (input, context) => {
|
|
3719
|
+
return models_0_1.ListComponentTypesFilter.visit(input, {
|
|
3720
|
+
extendsFrom: (value) => ({ extendsFrom: value }),
|
|
3721
|
+
isAbstract: (value) => ({ isAbstract: value }),
|
|
3722
|
+
namespace: (value) => ({ namespace: value }),
|
|
3723
|
+
_: (name, value) => ({ name: value }),
|
|
3724
|
+
});
|
|
3725
|
+
};
|
|
3726
|
+
const serializeAws_restJson1ListComponentTypesFilters = (input, context) => {
|
|
3727
|
+
return input
|
|
3728
|
+
.filter((e) => e != null)
|
|
3729
|
+
.map((entry) => {
|
|
3730
|
+
if (entry === null) {
|
|
3731
|
+
return null;
|
|
3732
|
+
}
|
|
3733
|
+
return serializeAws_restJson1ListComponentTypesFilter(entry, context);
|
|
3734
|
+
});
|
|
3735
|
+
};
|
|
3736
|
+
const serializeAws_restJson1ListEntitiesFilter = (input, context) => {
|
|
3737
|
+
return models_0_1.ListEntitiesFilter.visit(input, {
|
|
3738
|
+
componentTypeId: (value) => ({ componentTypeId: value }),
|
|
3739
|
+
parentEntityId: (value) => ({ parentEntityId: value }),
|
|
3740
|
+
_: (name, value) => ({ name: value }),
|
|
3741
|
+
});
|
|
3742
|
+
};
|
|
3743
|
+
const serializeAws_restJson1ListEntitiesFilters = (input, context) => {
|
|
3744
|
+
return input
|
|
3745
|
+
.filter((e) => e != null)
|
|
3746
|
+
.map((entry) => {
|
|
3747
|
+
if (entry === null) {
|
|
3748
|
+
return null;
|
|
3749
|
+
}
|
|
3750
|
+
return serializeAws_restJson1ListEntitiesFilter(entry, context);
|
|
3751
|
+
});
|
|
3752
|
+
};
|
|
3753
|
+
const serializeAws_restJson1ParentEntityUpdateRequest = (input, context) => {
|
|
3754
|
+
return {
|
|
3755
|
+
...(input.parentEntityId !== undefined &&
|
|
3756
|
+
input.parentEntityId !== null && { parentEntityId: input.parentEntityId }),
|
|
3757
|
+
...(input.updateType !== undefined && input.updateType !== null && { updateType: input.updateType }),
|
|
3758
|
+
};
|
|
3759
|
+
};
|
|
3760
|
+
const serializeAws_restJson1PropertyDefinitionRequest = (input, context) => {
|
|
3761
|
+
return {
|
|
3762
|
+
...(input.configuration !== undefined &&
|
|
3763
|
+
input.configuration !== null && {
|
|
3764
|
+
configuration: serializeAws_restJson1Configuration(input.configuration, context),
|
|
3765
|
+
}),
|
|
3766
|
+
...(input.dataType !== undefined &&
|
|
3767
|
+
input.dataType !== null && { dataType: serializeAws_restJson1DataType(input.dataType, context) }),
|
|
3768
|
+
...(input.defaultValue !== undefined &&
|
|
3769
|
+
input.defaultValue !== null && { defaultValue: serializeAws_restJson1DataValue(input.defaultValue, context) }),
|
|
3770
|
+
...(input.isExternalId !== undefined && input.isExternalId !== null && { isExternalId: input.isExternalId }),
|
|
3771
|
+
...(input.isRequiredInEntity !== undefined &&
|
|
3772
|
+
input.isRequiredInEntity !== null && { isRequiredInEntity: input.isRequiredInEntity }),
|
|
3773
|
+
...(input.isStoredExternally !== undefined &&
|
|
3774
|
+
input.isStoredExternally !== null && { isStoredExternally: input.isStoredExternally }),
|
|
3775
|
+
...(input.isTimeSeries !== undefined && input.isTimeSeries !== null && { isTimeSeries: input.isTimeSeries }),
|
|
3776
|
+
};
|
|
3777
|
+
};
|
|
3778
|
+
const serializeAws_restJson1PropertyDefinitionsRequest = (input, context) => {
|
|
3779
|
+
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
3780
|
+
if (value === null) {
|
|
3781
|
+
return acc;
|
|
3782
|
+
}
|
|
3783
|
+
return {
|
|
3784
|
+
...acc,
|
|
3785
|
+
[key]: serializeAws_restJson1PropertyDefinitionRequest(value, context),
|
|
3786
|
+
};
|
|
3787
|
+
}, {});
|
|
3788
|
+
};
|
|
3789
|
+
const serializeAws_restJson1PropertyFilter = (input, context) => {
|
|
3790
|
+
return {
|
|
3791
|
+
...(input.operator !== undefined && input.operator !== null && { operator: input.operator }),
|
|
3792
|
+
...(input.propertyName !== undefined && input.propertyName !== null && { propertyName: input.propertyName }),
|
|
3793
|
+
...(input.value !== undefined &&
|
|
3794
|
+
input.value !== null && { value: serializeAws_restJson1DataValue(input.value, context) }),
|
|
3795
|
+
};
|
|
3796
|
+
};
|
|
3797
|
+
const serializeAws_restJson1PropertyFilters = (input, context) => {
|
|
3798
|
+
return input
|
|
3799
|
+
.filter((e) => e != null)
|
|
3800
|
+
.map((entry) => {
|
|
3801
|
+
if (entry === null) {
|
|
3802
|
+
return null;
|
|
3803
|
+
}
|
|
3804
|
+
return serializeAws_restJson1PropertyFilter(entry, context);
|
|
3805
|
+
});
|
|
3806
|
+
};
|
|
3807
|
+
const serializeAws_restJson1PropertyRequest = (input, context) => {
|
|
3808
|
+
return {
|
|
3809
|
+
...(input.definition !== undefined &&
|
|
3810
|
+
input.definition !== null && {
|
|
3811
|
+
definition: serializeAws_restJson1PropertyDefinitionRequest(input.definition, context),
|
|
3812
|
+
}),
|
|
3813
|
+
...(input.updateType !== undefined && input.updateType !== null && { updateType: input.updateType }),
|
|
3814
|
+
...(input.value !== undefined &&
|
|
3815
|
+
input.value !== null && { value: serializeAws_restJson1DataValue(input.value, context) }),
|
|
3816
|
+
};
|
|
3817
|
+
};
|
|
3818
|
+
const serializeAws_restJson1PropertyRequests = (input, context) => {
|
|
3819
|
+
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
3820
|
+
if (value === null) {
|
|
3821
|
+
return acc;
|
|
3822
|
+
}
|
|
3823
|
+
return {
|
|
3824
|
+
...acc,
|
|
3825
|
+
[key]: serializeAws_restJson1PropertyRequest(value, context),
|
|
3826
|
+
};
|
|
3827
|
+
}, {});
|
|
3828
|
+
};
|
|
3829
|
+
const serializeAws_restJson1PropertyValue = (input, context) => {
|
|
3830
|
+
return {
|
|
3831
|
+
...(input.timestamp !== undefined &&
|
|
3832
|
+
input.timestamp !== null && { timestamp: Math.round(input.timestamp.getTime() / 1000) }),
|
|
3833
|
+
...(input.value !== undefined &&
|
|
3834
|
+
input.value !== null && { value: serializeAws_restJson1DataValue(input.value, context) }),
|
|
3835
|
+
};
|
|
3836
|
+
};
|
|
3837
|
+
const serializeAws_restJson1PropertyValueEntry = (input, context) => {
|
|
3838
|
+
return {
|
|
3839
|
+
...(input.entityPropertyReference !== undefined &&
|
|
3840
|
+
input.entityPropertyReference !== null && {
|
|
3841
|
+
entityPropertyReference: serializeAws_restJson1EntityPropertyReference(input.entityPropertyReference, context),
|
|
3842
|
+
}),
|
|
3843
|
+
...(input.propertyValues !== undefined &&
|
|
3844
|
+
input.propertyValues !== null && {
|
|
3845
|
+
propertyValues: serializeAws_restJson1PropertyValues(input.propertyValues, context),
|
|
3846
|
+
}),
|
|
3847
|
+
};
|
|
3848
|
+
};
|
|
3849
|
+
const serializeAws_restJson1PropertyValues = (input, context) => {
|
|
3850
|
+
return input
|
|
3851
|
+
.filter((e) => e != null)
|
|
3852
|
+
.map((entry) => {
|
|
3853
|
+
if (entry === null) {
|
|
3854
|
+
return null;
|
|
3855
|
+
}
|
|
3856
|
+
return serializeAws_restJson1PropertyValue(entry, context);
|
|
3857
|
+
});
|
|
3858
|
+
};
|
|
3859
|
+
const serializeAws_restJson1Relationship = (input, context) => {
|
|
3860
|
+
return {
|
|
3861
|
+
...(input.relationshipType !== undefined &&
|
|
3862
|
+
input.relationshipType !== null && { relationshipType: input.relationshipType }),
|
|
3863
|
+
...(input.targetComponentTypeId !== undefined &&
|
|
3864
|
+
input.targetComponentTypeId !== null && { targetComponentTypeId: input.targetComponentTypeId }),
|
|
3865
|
+
};
|
|
3866
|
+
};
|
|
3867
|
+
const serializeAws_restJson1RelationshipValue = (input, context) => {
|
|
3868
|
+
return {
|
|
3869
|
+
...(input.targetComponentName !== undefined &&
|
|
3870
|
+
input.targetComponentName !== null && { targetComponentName: input.targetComponentName }),
|
|
3871
|
+
...(input.targetEntityId !== undefined &&
|
|
3872
|
+
input.targetEntityId !== null && { targetEntityId: input.targetEntityId }),
|
|
3873
|
+
};
|
|
3874
|
+
};
|
|
3875
|
+
const serializeAws_restJson1RequiredProperties = (input, context) => {
|
|
3876
|
+
return input
|
|
3877
|
+
.filter((e) => e != null)
|
|
3878
|
+
.map((entry) => {
|
|
3879
|
+
if (entry === null) {
|
|
3880
|
+
return null;
|
|
3881
|
+
}
|
|
3882
|
+
return entry;
|
|
3883
|
+
});
|
|
3884
|
+
};
|
|
3885
|
+
const serializeAws_restJson1SceneCapabilities = (input, context) => {
|
|
3886
|
+
return input
|
|
3887
|
+
.filter((e) => e != null)
|
|
3888
|
+
.map((entry) => {
|
|
3889
|
+
if (entry === null) {
|
|
3890
|
+
return null;
|
|
3891
|
+
}
|
|
3892
|
+
return entry;
|
|
3893
|
+
});
|
|
3894
|
+
};
|
|
3895
|
+
const serializeAws_restJson1SelectedPropertyList = (input, context) => {
|
|
3896
|
+
return input
|
|
3897
|
+
.filter((e) => e != null)
|
|
3898
|
+
.map((entry) => {
|
|
3899
|
+
if (entry === null) {
|
|
3900
|
+
return null;
|
|
3901
|
+
}
|
|
3902
|
+
return entry;
|
|
3903
|
+
});
|
|
3904
|
+
};
|
|
3905
|
+
const serializeAws_restJson1TagMap = (input, context) => {
|
|
3906
|
+
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
3907
|
+
if (value === null) {
|
|
3908
|
+
return acc;
|
|
3909
|
+
}
|
|
3910
|
+
return {
|
|
3911
|
+
...acc,
|
|
3912
|
+
[key]: value,
|
|
3913
|
+
};
|
|
3914
|
+
}, {});
|
|
3915
|
+
};
|
|
3916
|
+
const deserializeAws_restJson1BatchPutPropertyError = (output, context) => {
|
|
3917
|
+
return {
|
|
3918
|
+
entry: output.entry !== undefined && output.entry !== null
|
|
3919
|
+
? deserializeAws_restJson1PropertyValueEntry(output.entry, context)
|
|
3920
|
+
: undefined,
|
|
3921
|
+
errorCode: smithy_client_1.expectString(output.errorCode),
|
|
3922
|
+
errorMessage: smithy_client_1.expectString(output.errorMessage),
|
|
3923
|
+
};
|
|
3924
|
+
};
|
|
3925
|
+
const deserializeAws_restJson1BatchPutPropertyErrorEntry = (output, context) => {
|
|
3926
|
+
return {
|
|
3927
|
+
errors: output.errors !== undefined && output.errors !== null
|
|
3928
|
+
? deserializeAws_restJson1Errors(output.errors, context)
|
|
3929
|
+
: undefined,
|
|
3930
|
+
};
|
|
3931
|
+
};
|
|
3932
|
+
const deserializeAws_restJson1ComponentResponse = (output, context) => {
|
|
3933
|
+
return {
|
|
3934
|
+
componentName: smithy_client_1.expectString(output.componentName),
|
|
3935
|
+
componentTypeId: smithy_client_1.expectString(output.componentTypeId),
|
|
3936
|
+
definedIn: smithy_client_1.expectString(output.definedIn),
|
|
3937
|
+
description: smithy_client_1.expectString(output.description),
|
|
3938
|
+
properties: output.properties !== undefined && output.properties !== null
|
|
3939
|
+
? deserializeAws_restJson1PropertyResponses(output.properties, context)
|
|
3940
|
+
: undefined,
|
|
3941
|
+
status: output.status !== undefined && output.status !== null
|
|
3942
|
+
? deserializeAws_restJson1Status(output.status, context)
|
|
3943
|
+
: undefined,
|
|
3944
|
+
};
|
|
3945
|
+
};
|
|
3946
|
+
const deserializeAws_restJson1ComponentsMap = (output, context) => {
|
|
3947
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
3948
|
+
if (value === null) {
|
|
3949
|
+
return acc;
|
|
3950
|
+
}
|
|
3951
|
+
return {
|
|
3952
|
+
...acc,
|
|
3953
|
+
[key]: deserializeAws_restJson1ComponentResponse(value, context),
|
|
3954
|
+
};
|
|
3955
|
+
}, {});
|
|
3956
|
+
};
|
|
3957
|
+
const deserializeAws_restJson1ComponentTypeSummaries = (output, context) => {
|
|
3958
|
+
return (output || [])
|
|
3959
|
+
.filter((e) => e != null)
|
|
3960
|
+
.map((entry) => {
|
|
3961
|
+
if (entry === null) {
|
|
3962
|
+
return null;
|
|
3963
|
+
}
|
|
3964
|
+
return deserializeAws_restJson1ComponentTypeSummary(entry, context);
|
|
3965
|
+
});
|
|
3966
|
+
};
|
|
3967
|
+
const deserializeAws_restJson1ComponentTypeSummary = (output, context) => {
|
|
3968
|
+
return {
|
|
3969
|
+
arn: smithy_client_1.expectString(output.arn),
|
|
3970
|
+
componentTypeId: smithy_client_1.expectString(output.componentTypeId),
|
|
3971
|
+
creationDateTime: output.creationDateTime !== undefined && output.creationDateTime !== null
|
|
3972
|
+
? smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(output.creationDateTime)))
|
|
3973
|
+
: undefined,
|
|
3974
|
+
description: smithy_client_1.expectString(output.description),
|
|
3975
|
+
status: output.status !== undefined && output.status !== null
|
|
3976
|
+
? deserializeAws_restJson1Status(output.status, context)
|
|
3977
|
+
: undefined,
|
|
3978
|
+
updateDateTime: output.updateDateTime !== undefined && output.updateDateTime !== null
|
|
3979
|
+
? smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(output.updateDateTime)))
|
|
3980
|
+
: undefined,
|
|
3981
|
+
};
|
|
3982
|
+
};
|
|
3983
|
+
const deserializeAws_restJson1Configuration = (output, context) => {
|
|
3984
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
3985
|
+
if (value === null) {
|
|
3986
|
+
return acc;
|
|
3987
|
+
}
|
|
3988
|
+
return {
|
|
3989
|
+
...acc,
|
|
3990
|
+
[key]: smithy_client_1.expectString(value),
|
|
3991
|
+
};
|
|
3992
|
+
}, {});
|
|
3993
|
+
};
|
|
3994
|
+
const deserializeAws_restJson1DataConnector = (output, context) => {
|
|
3995
|
+
return {
|
|
3996
|
+
isNative: smithy_client_1.expectBoolean(output.isNative),
|
|
3997
|
+
lambda: output.lambda !== undefined && output.lambda !== null
|
|
3998
|
+
? deserializeAws_restJson1LambdaFunction(output.lambda, context)
|
|
3999
|
+
: undefined,
|
|
4000
|
+
};
|
|
4001
|
+
};
|
|
4002
|
+
const deserializeAws_restJson1DataType = (output, context) => {
|
|
4003
|
+
return {
|
|
4004
|
+
allowedValues: output.allowedValues !== undefined && output.allowedValues !== null
|
|
4005
|
+
? deserializeAws_restJson1DataValueList(output.allowedValues, context)
|
|
4006
|
+
: undefined,
|
|
4007
|
+
nestedType: output.nestedType !== undefined && output.nestedType !== null
|
|
4008
|
+
? deserializeAws_restJson1DataType(output.nestedType, context)
|
|
4009
|
+
: undefined,
|
|
4010
|
+
relationship: output.relationship !== undefined && output.relationship !== null
|
|
4011
|
+
? deserializeAws_restJson1Relationship(output.relationship, context)
|
|
4012
|
+
: undefined,
|
|
4013
|
+
type: smithy_client_1.expectString(output.type),
|
|
4014
|
+
unitOfMeasure: smithy_client_1.expectString(output.unitOfMeasure),
|
|
4015
|
+
};
|
|
4016
|
+
};
|
|
4017
|
+
const deserializeAws_restJson1DataValue = (output, context) => {
|
|
4018
|
+
return {
|
|
4019
|
+
booleanValue: smithy_client_1.expectBoolean(output.booleanValue),
|
|
4020
|
+
doubleValue: smithy_client_1.limitedParseDouble(output.doubleValue),
|
|
4021
|
+
expression: smithy_client_1.expectString(output.expression),
|
|
4022
|
+
integerValue: smithy_client_1.expectInt32(output.integerValue),
|
|
4023
|
+
listValue: output.listValue !== undefined && output.listValue !== null
|
|
4024
|
+
? deserializeAws_restJson1DataValueList(output.listValue, context)
|
|
4025
|
+
: undefined,
|
|
4026
|
+
longValue: smithy_client_1.expectLong(output.longValue),
|
|
4027
|
+
mapValue: output.mapValue !== undefined && output.mapValue !== null
|
|
4028
|
+
? deserializeAws_restJson1DataValueMap(output.mapValue, context)
|
|
4029
|
+
: undefined,
|
|
4030
|
+
relationshipValue: output.relationshipValue !== undefined && output.relationshipValue !== null
|
|
4031
|
+
? deserializeAws_restJson1RelationshipValue(output.relationshipValue, context)
|
|
4032
|
+
: undefined,
|
|
4033
|
+
stringValue: smithy_client_1.expectString(output.stringValue),
|
|
4034
|
+
};
|
|
4035
|
+
};
|
|
4036
|
+
const deserializeAws_restJson1DataValueList = (output, context) => {
|
|
4037
|
+
return (output || [])
|
|
4038
|
+
.filter((e) => e != null)
|
|
4039
|
+
.map((entry) => {
|
|
4040
|
+
if (entry === null) {
|
|
4041
|
+
return null;
|
|
4042
|
+
}
|
|
4043
|
+
return deserializeAws_restJson1DataValue(entry, context);
|
|
4044
|
+
});
|
|
4045
|
+
};
|
|
4046
|
+
const deserializeAws_restJson1DataValueMap = (output, context) => {
|
|
4047
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
4048
|
+
if (value === null) {
|
|
4049
|
+
return acc;
|
|
4050
|
+
}
|
|
4051
|
+
return {
|
|
4052
|
+
...acc,
|
|
4053
|
+
[key]: deserializeAws_restJson1DataValue(value, context),
|
|
4054
|
+
};
|
|
4055
|
+
}, {});
|
|
4056
|
+
};
|
|
4057
|
+
const deserializeAws_restJson1EntityPropertyReference = (output, context) => {
|
|
4058
|
+
return {
|
|
4059
|
+
componentName: smithy_client_1.expectString(output.componentName),
|
|
4060
|
+
entityId: smithy_client_1.expectString(output.entityId),
|
|
4061
|
+
externalIdProperty: output.externalIdProperty !== undefined && output.externalIdProperty !== null
|
|
4062
|
+
? deserializeAws_restJson1ExternalIdProperty(output.externalIdProperty, context)
|
|
4063
|
+
: undefined,
|
|
4064
|
+
propertyName: smithy_client_1.expectString(output.propertyName),
|
|
4065
|
+
};
|
|
4066
|
+
};
|
|
4067
|
+
const deserializeAws_restJson1EntitySummaries = (output, context) => {
|
|
4068
|
+
return (output || [])
|
|
4069
|
+
.filter((e) => e != null)
|
|
4070
|
+
.map((entry) => {
|
|
4071
|
+
if (entry === null) {
|
|
4072
|
+
return null;
|
|
4073
|
+
}
|
|
4074
|
+
return deserializeAws_restJson1EntitySummary(entry, context);
|
|
4075
|
+
});
|
|
4076
|
+
};
|
|
4077
|
+
const deserializeAws_restJson1EntitySummary = (output, context) => {
|
|
4078
|
+
return {
|
|
4079
|
+
arn: smithy_client_1.expectString(output.arn),
|
|
4080
|
+
creationDateTime: output.creationDateTime !== undefined && output.creationDateTime !== null
|
|
4081
|
+
? smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(output.creationDateTime)))
|
|
4082
|
+
: undefined,
|
|
4083
|
+
description: smithy_client_1.expectString(output.description),
|
|
4084
|
+
entityId: smithy_client_1.expectString(output.entityId),
|
|
4085
|
+
entityName: smithy_client_1.expectString(output.entityName),
|
|
4086
|
+
hasChildEntities: smithy_client_1.expectBoolean(output.hasChildEntities),
|
|
4087
|
+
parentEntityId: smithy_client_1.expectString(output.parentEntityId),
|
|
4088
|
+
status: output.status !== undefined && output.status !== null
|
|
4089
|
+
? deserializeAws_restJson1Status(output.status, context)
|
|
4090
|
+
: undefined,
|
|
4091
|
+
updateDateTime: output.updateDateTime !== undefined && output.updateDateTime !== null
|
|
4092
|
+
? smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(output.updateDateTime)))
|
|
4093
|
+
: undefined,
|
|
4094
|
+
};
|
|
4095
|
+
};
|
|
4096
|
+
const deserializeAws_restJson1ErrorDetails = (output, context) => {
|
|
4097
|
+
return {
|
|
4098
|
+
code: smithy_client_1.expectString(output.code),
|
|
4099
|
+
message: smithy_client_1.expectString(output.message),
|
|
4100
|
+
};
|
|
4101
|
+
};
|
|
4102
|
+
const deserializeAws_restJson1ErrorEntries = (output, context) => {
|
|
4103
|
+
return (output || [])
|
|
4104
|
+
.filter((e) => e != null)
|
|
4105
|
+
.map((entry) => {
|
|
4106
|
+
if (entry === null) {
|
|
4107
|
+
return null;
|
|
4108
|
+
}
|
|
4109
|
+
return deserializeAws_restJson1BatchPutPropertyErrorEntry(entry, context);
|
|
4110
|
+
});
|
|
4111
|
+
};
|
|
4112
|
+
const deserializeAws_restJson1Errors = (output, context) => {
|
|
4113
|
+
return (output || [])
|
|
4114
|
+
.filter((e) => e != null)
|
|
4115
|
+
.map((entry) => {
|
|
4116
|
+
if (entry === null) {
|
|
4117
|
+
return null;
|
|
4118
|
+
}
|
|
4119
|
+
return deserializeAws_restJson1BatchPutPropertyError(entry, context);
|
|
4120
|
+
});
|
|
4121
|
+
};
|
|
4122
|
+
const deserializeAws_restJson1ExtendsFrom = (output, context) => {
|
|
4123
|
+
return (output || [])
|
|
4124
|
+
.filter((e) => e != null)
|
|
4125
|
+
.map((entry) => {
|
|
4126
|
+
if (entry === null) {
|
|
4127
|
+
return null;
|
|
4128
|
+
}
|
|
4129
|
+
return smithy_client_1.expectString(entry);
|
|
4130
|
+
});
|
|
4131
|
+
};
|
|
4132
|
+
const deserializeAws_restJson1ExternalIdProperty = (output, context) => {
|
|
4133
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
4134
|
+
if (value === null) {
|
|
4135
|
+
return acc;
|
|
4136
|
+
}
|
|
4137
|
+
return {
|
|
4138
|
+
...acc,
|
|
4139
|
+
[key]: smithy_client_1.expectString(value),
|
|
4140
|
+
};
|
|
4141
|
+
}, {});
|
|
4142
|
+
};
|
|
4143
|
+
const deserializeAws_restJson1FunctionResponse = (output, context) => {
|
|
4144
|
+
return {
|
|
4145
|
+
implementedBy: output.implementedBy !== undefined && output.implementedBy !== null
|
|
4146
|
+
? deserializeAws_restJson1DataConnector(output.implementedBy, context)
|
|
4147
|
+
: undefined,
|
|
4148
|
+
isInherited: smithy_client_1.expectBoolean(output.isInherited),
|
|
4149
|
+
requiredProperties: output.requiredProperties !== undefined && output.requiredProperties !== null
|
|
4150
|
+
? deserializeAws_restJson1RequiredProperties(output.requiredProperties, context)
|
|
4151
|
+
: undefined,
|
|
4152
|
+
scope: smithy_client_1.expectString(output.scope),
|
|
4153
|
+
};
|
|
4154
|
+
};
|
|
4155
|
+
const deserializeAws_restJson1FunctionsResponse = (output, context) => {
|
|
4156
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
4157
|
+
if (value === null) {
|
|
4158
|
+
return acc;
|
|
4159
|
+
}
|
|
4160
|
+
return {
|
|
4161
|
+
...acc,
|
|
4162
|
+
[key]: deserializeAws_restJson1FunctionResponse(value, context),
|
|
4163
|
+
};
|
|
4164
|
+
}, {});
|
|
4165
|
+
};
|
|
4166
|
+
const deserializeAws_restJson1LambdaFunction = (output, context) => {
|
|
4167
|
+
return {
|
|
4168
|
+
arn: smithy_client_1.expectString(output.arn),
|
|
4169
|
+
};
|
|
4170
|
+
};
|
|
4171
|
+
const deserializeAws_restJson1PropertyDefinitionResponse = (output, context) => {
|
|
4172
|
+
return {
|
|
4173
|
+
configuration: output.configuration !== undefined && output.configuration !== null
|
|
4174
|
+
? deserializeAws_restJson1Configuration(output.configuration, context)
|
|
4175
|
+
: undefined,
|
|
4176
|
+
dataType: output.dataType !== undefined && output.dataType !== null
|
|
4177
|
+
? deserializeAws_restJson1DataType(output.dataType, context)
|
|
4178
|
+
: undefined,
|
|
4179
|
+
defaultValue: output.defaultValue !== undefined && output.defaultValue !== null
|
|
4180
|
+
? deserializeAws_restJson1DataValue(output.defaultValue, context)
|
|
4181
|
+
: undefined,
|
|
4182
|
+
isExternalId: smithy_client_1.expectBoolean(output.isExternalId),
|
|
4183
|
+
isFinal: smithy_client_1.expectBoolean(output.isFinal),
|
|
4184
|
+
isImported: smithy_client_1.expectBoolean(output.isImported),
|
|
4185
|
+
isInherited: smithy_client_1.expectBoolean(output.isInherited),
|
|
4186
|
+
isRequiredInEntity: smithy_client_1.expectBoolean(output.isRequiredInEntity),
|
|
4187
|
+
isStoredExternally: smithy_client_1.expectBoolean(output.isStoredExternally),
|
|
4188
|
+
isTimeSeries: smithy_client_1.expectBoolean(output.isTimeSeries),
|
|
4189
|
+
};
|
|
4190
|
+
};
|
|
4191
|
+
const deserializeAws_restJson1PropertyDefinitionsResponse = (output, context) => {
|
|
4192
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
4193
|
+
if (value === null) {
|
|
4194
|
+
return acc;
|
|
4195
|
+
}
|
|
4196
|
+
return {
|
|
4197
|
+
...acc,
|
|
4198
|
+
[key]: deserializeAws_restJson1PropertyDefinitionResponse(value, context),
|
|
4199
|
+
};
|
|
4200
|
+
}, {});
|
|
4201
|
+
};
|
|
4202
|
+
const deserializeAws_restJson1PropertyLatestValue = (output, context) => {
|
|
4203
|
+
return {
|
|
4204
|
+
propertyReference: output.propertyReference !== undefined && output.propertyReference !== null
|
|
4205
|
+
? deserializeAws_restJson1EntityPropertyReference(output.propertyReference, context)
|
|
4206
|
+
: undefined,
|
|
4207
|
+
propertyValue: output.propertyValue !== undefined && output.propertyValue !== null
|
|
4208
|
+
? deserializeAws_restJson1DataValue(output.propertyValue, context)
|
|
4209
|
+
: undefined,
|
|
4210
|
+
};
|
|
4211
|
+
};
|
|
4212
|
+
const deserializeAws_restJson1PropertyLatestValueMap = (output, context) => {
|
|
4213
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
4214
|
+
if (value === null) {
|
|
4215
|
+
return acc;
|
|
4216
|
+
}
|
|
4217
|
+
return {
|
|
4218
|
+
...acc,
|
|
4219
|
+
[key]: deserializeAws_restJson1PropertyLatestValue(value, context),
|
|
4220
|
+
};
|
|
4221
|
+
}, {});
|
|
4222
|
+
};
|
|
4223
|
+
const deserializeAws_restJson1PropertyResponse = (output, context) => {
|
|
4224
|
+
return {
|
|
4225
|
+
definition: output.definition !== undefined && output.definition !== null
|
|
4226
|
+
? deserializeAws_restJson1PropertyDefinitionResponse(output.definition, context)
|
|
4227
|
+
: undefined,
|
|
4228
|
+
value: output.value !== undefined && output.value !== null
|
|
4229
|
+
? deserializeAws_restJson1DataValue(output.value, context)
|
|
4230
|
+
: undefined,
|
|
4231
|
+
};
|
|
4232
|
+
};
|
|
4233
|
+
const deserializeAws_restJson1PropertyResponses = (output, context) => {
|
|
4234
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
4235
|
+
if (value === null) {
|
|
4236
|
+
return acc;
|
|
4237
|
+
}
|
|
4238
|
+
return {
|
|
4239
|
+
...acc,
|
|
4240
|
+
[key]: deserializeAws_restJson1PropertyResponse(value, context),
|
|
4241
|
+
};
|
|
4242
|
+
}, {});
|
|
4243
|
+
};
|
|
4244
|
+
const deserializeAws_restJson1PropertyValue = (output, context) => {
|
|
4245
|
+
return {
|
|
4246
|
+
timestamp: output.timestamp !== undefined && output.timestamp !== null
|
|
4247
|
+
? smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(output.timestamp)))
|
|
4248
|
+
: undefined,
|
|
4249
|
+
value: output.value !== undefined && output.value !== null
|
|
4250
|
+
? deserializeAws_restJson1DataValue(output.value, context)
|
|
4251
|
+
: undefined,
|
|
4252
|
+
};
|
|
4253
|
+
};
|
|
4254
|
+
const deserializeAws_restJson1PropertyValueEntry = (output, context) => {
|
|
4255
|
+
return {
|
|
4256
|
+
entityPropertyReference: output.entityPropertyReference !== undefined && output.entityPropertyReference !== null
|
|
4257
|
+
? deserializeAws_restJson1EntityPropertyReference(output.entityPropertyReference, context)
|
|
4258
|
+
: undefined,
|
|
4259
|
+
propertyValues: output.propertyValues !== undefined && output.propertyValues !== null
|
|
4260
|
+
? deserializeAws_restJson1PropertyValues(output.propertyValues, context)
|
|
4261
|
+
: undefined,
|
|
4262
|
+
};
|
|
4263
|
+
};
|
|
4264
|
+
const deserializeAws_restJson1PropertyValueHistory = (output, context) => {
|
|
4265
|
+
return {
|
|
4266
|
+
entityPropertyReference: output.entityPropertyReference !== undefined && output.entityPropertyReference !== null
|
|
4267
|
+
? deserializeAws_restJson1EntityPropertyReference(output.entityPropertyReference, context)
|
|
4268
|
+
: undefined,
|
|
4269
|
+
values: output.values !== undefined && output.values !== null
|
|
4270
|
+
? deserializeAws_restJson1Values(output.values, context)
|
|
4271
|
+
: undefined,
|
|
4272
|
+
};
|
|
4273
|
+
};
|
|
4274
|
+
const deserializeAws_restJson1PropertyValueList = (output, context) => {
|
|
4275
|
+
return (output || [])
|
|
4276
|
+
.filter((e) => e != null)
|
|
4277
|
+
.map((entry) => {
|
|
4278
|
+
if (entry === null) {
|
|
4279
|
+
return null;
|
|
4280
|
+
}
|
|
4281
|
+
return deserializeAws_restJson1PropertyValueHistory(entry, context);
|
|
4282
|
+
});
|
|
4283
|
+
};
|
|
4284
|
+
const deserializeAws_restJson1PropertyValues = (output, context) => {
|
|
4285
|
+
return (output || [])
|
|
4286
|
+
.filter((e) => e != null)
|
|
4287
|
+
.map((entry) => {
|
|
4288
|
+
if (entry === null) {
|
|
4289
|
+
return null;
|
|
4290
|
+
}
|
|
4291
|
+
return deserializeAws_restJson1PropertyValue(entry, context);
|
|
4292
|
+
});
|
|
4293
|
+
};
|
|
4294
|
+
const deserializeAws_restJson1Relationship = (output, context) => {
|
|
4295
|
+
return {
|
|
4296
|
+
relationshipType: smithy_client_1.expectString(output.relationshipType),
|
|
4297
|
+
targetComponentTypeId: smithy_client_1.expectString(output.targetComponentTypeId),
|
|
4298
|
+
};
|
|
4299
|
+
};
|
|
4300
|
+
const deserializeAws_restJson1RelationshipValue = (output, context) => {
|
|
4301
|
+
return {
|
|
4302
|
+
targetComponentName: smithy_client_1.expectString(output.targetComponentName),
|
|
4303
|
+
targetEntityId: smithy_client_1.expectString(output.targetEntityId),
|
|
4304
|
+
};
|
|
4305
|
+
};
|
|
4306
|
+
const deserializeAws_restJson1RequiredProperties = (output, context) => {
|
|
4307
|
+
const uniqueValues = new Set();
|
|
4308
|
+
return (output || [])
|
|
4309
|
+
.filter((e) => e != null)
|
|
4310
|
+
.map((entry) => {
|
|
4311
|
+
if (entry === null) {
|
|
4312
|
+
return null;
|
|
4313
|
+
}
|
|
4314
|
+
const parsedEntry = smithy_client_1.expectString(entry);
|
|
4315
|
+
if (uniqueValues.has(parsedEntry)) {
|
|
4316
|
+
throw new TypeError('All elements of the set "com.amazonaws.iottwinmaker#RequiredProperties" must be unique.');
|
|
4317
|
+
}
|
|
4318
|
+
else {
|
|
4319
|
+
uniqueValues.add(parsedEntry);
|
|
4320
|
+
return parsedEntry;
|
|
4321
|
+
}
|
|
4322
|
+
});
|
|
4323
|
+
};
|
|
4324
|
+
const deserializeAws_restJson1SceneCapabilities = (output, context) => {
|
|
4325
|
+
return (output || [])
|
|
4326
|
+
.filter((e) => e != null)
|
|
4327
|
+
.map((entry) => {
|
|
4328
|
+
if (entry === null) {
|
|
4329
|
+
return null;
|
|
4330
|
+
}
|
|
4331
|
+
return smithy_client_1.expectString(entry);
|
|
4332
|
+
});
|
|
4333
|
+
};
|
|
4334
|
+
const deserializeAws_restJson1SceneSummaries = (output, context) => {
|
|
4335
|
+
return (output || [])
|
|
4336
|
+
.filter((e) => e != null)
|
|
4337
|
+
.map((entry) => {
|
|
4338
|
+
if (entry === null) {
|
|
4339
|
+
return null;
|
|
4340
|
+
}
|
|
4341
|
+
return deserializeAws_restJson1SceneSummary(entry, context);
|
|
4342
|
+
});
|
|
4343
|
+
};
|
|
4344
|
+
const deserializeAws_restJson1SceneSummary = (output, context) => {
|
|
4345
|
+
return {
|
|
4346
|
+
arn: smithy_client_1.expectString(output.arn),
|
|
4347
|
+
contentLocation: smithy_client_1.expectString(output.contentLocation),
|
|
4348
|
+
creationDateTime: output.creationDateTime !== undefined && output.creationDateTime !== null
|
|
4349
|
+
? smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(output.creationDateTime)))
|
|
4350
|
+
: undefined,
|
|
4351
|
+
description: smithy_client_1.expectString(output.description),
|
|
4352
|
+
sceneId: smithy_client_1.expectString(output.sceneId),
|
|
4353
|
+
updateDateTime: output.updateDateTime !== undefined && output.updateDateTime !== null
|
|
4354
|
+
? smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(output.updateDateTime)))
|
|
4355
|
+
: undefined,
|
|
4356
|
+
};
|
|
4357
|
+
};
|
|
4358
|
+
const deserializeAws_restJson1Status = (output, context) => {
|
|
4359
|
+
return {
|
|
4360
|
+
error: output.error !== undefined && output.error !== null
|
|
4361
|
+
? deserializeAws_restJson1ErrorDetails(output.error, context)
|
|
4362
|
+
: undefined,
|
|
4363
|
+
state: smithy_client_1.expectString(output.state),
|
|
4364
|
+
};
|
|
4365
|
+
};
|
|
4366
|
+
const deserializeAws_restJson1TagMap = (output, context) => {
|
|
4367
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
4368
|
+
if (value === null) {
|
|
4369
|
+
return acc;
|
|
4370
|
+
}
|
|
4371
|
+
return {
|
|
4372
|
+
...acc,
|
|
4373
|
+
[key]: smithy_client_1.expectString(value),
|
|
4374
|
+
};
|
|
4375
|
+
}, {});
|
|
4376
|
+
};
|
|
4377
|
+
const deserializeAws_restJson1Values = (output, context) => {
|
|
4378
|
+
return (output || [])
|
|
4379
|
+
.filter((e) => e != null)
|
|
4380
|
+
.map((entry) => {
|
|
4381
|
+
if (entry === null) {
|
|
4382
|
+
return null;
|
|
4383
|
+
}
|
|
4384
|
+
return deserializeAws_restJson1PropertyValue(entry, context);
|
|
4385
|
+
});
|
|
4386
|
+
};
|
|
4387
|
+
const deserializeAws_restJson1WorkspaceSummaries = (output, context) => {
|
|
4388
|
+
return (output || [])
|
|
4389
|
+
.filter((e) => e != null)
|
|
4390
|
+
.map((entry) => {
|
|
4391
|
+
if (entry === null) {
|
|
4392
|
+
return null;
|
|
4393
|
+
}
|
|
4394
|
+
return deserializeAws_restJson1WorkspaceSummary(entry, context);
|
|
4395
|
+
});
|
|
4396
|
+
};
|
|
4397
|
+
const deserializeAws_restJson1WorkspaceSummary = (output, context) => {
|
|
4398
|
+
return {
|
|
4399
|
+
arn: smithy_client_1.expectString(output.arn),
|
|
4400
|
+
creationDateTime: output.creationDateTime !== undefined && output.creationDateTime !== null
|
|
4401
|
+
? smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(output.creationDateTime)))
|
|
4402
|
+
: undefined,
|
|
4403
|
+
description: smithy_client_1.expectString(output.description),
|
|
4404
|
+
updateDateTime: output.updateDateTime !== undefined && output.updateDateTime !== null
|
|
4405
|
+
? smithy_client_1.expectNonNull(smithy_client_1.parseEpochTimestamp(smithy_client_1.expectNumber(output.updateDateTime)))
|
|
4406
|
+
: undefined,
|
|
4407
|
+
workspaceId: smithy_client_1.expectString(output.workspaceId),
|
|
4408
|
+
};
|
|
4409
|
+
};
|
|
4410
|
+
const deserializeMetadata = (output) => {
|
|
4411
|
+
var _a;
|
|
4412
|
+
return ({
|
|
4413
|
+
httpStatusCode: output.statusCode,
|
|
4414
|
+
requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"],
|
|
4415
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
4416
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
4417
|
+
});
|
|
4418
|
+
};
|
|
4419
|
+
const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
4420
|
+
if (streamBody instanceof Uint8Array) {
|
|
4421
|
+
return Promise.resolve(streamBody);
|
|
4422
|
+
}
|
|
4423
|
+
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
4424
|
+
};
|
|
4425
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
4426
|
+
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
4427
|
+
value !== null &&
|
|
4428
|
+
value !== "" &&
|
|
4429
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
4430
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
4431
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
4432
|
+
if (encoded.length) {
|
|
4433
|
+
return JSON.parse(encoded);
|
|
4434
|
+
}
|
|
4435
|
+
return {};
|
|
4436
|
+
});
|
|
4437
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
4438
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
4439
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
4440
|
+
let cleanValue = rawValue;
|
|
4441
|
+
if (cleanValue.indexOf(":") >= 0) {
|
|
4442
|
+
cleanValue = cleanValue.split(":")[0];
|
|
4443
|
+
}
|
|
4444
|
+
if (cleanValue.indexOf("#") >= 0) {
|
|
4445
|
+
cleanValue = cleanValue.split("#")[1];
|
|
4446
|
+
}
|
|
4447
|
+
return cleanValue;
|
|
4448
|
+
};
|
|
4449
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
4450
|
+
if (headerKey !== undefined) {
|
|
4451
|
+
return sanitizeErrorCode(output.headers[headerKey]);
|
|
4452
|
+
}
|
|
4453
|
+
if (data.code !== undefined) {
|
|
4454
|
+
return sanitizeErrorCode(data.code);
|
|
4455
|
+
}
|
|
4456
|
+
if (data["__type"] !== undefined) {
|
|
4457
|
+
return sanitizeErrorCode(data["__type"]);
|
|
4458
|
+
}
|
|
4459
|
+
return "";
|
|
4460
|
+
};
|