@aws-sdk/client-iot-data-plane 3.35.0 → 3.38.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 +47 -0
- package/dist-cjs/IoTDataPlane.js +0 -14
- package/dist-cjs/IoTDataPlaneClient.js +0 -19
- package/dist-cjs/commands/DeleteThingShadowCommand.js +0 -27
- package/dist-cjs/commands/GetRetainedMessageCommand.js +0 -31
- package/dist-cjs/commands/GetThingShadowCommand.js +0 -28
- package/dist-cjs/commands/ListNamedShadowsForThingCommand.js +0 -26
- package/dist-cjs/commands/ListRetainedMessagesCommand.js +0 -34
- package/dist-cjs/commands/PublishCommand.js +0 -31
- package/dist-cjs/commands/UpdateThingShadowCommand.js +0 -28
- package/dist-cjs/commands/index.js +10 -0
- package/dist-cjs/endpoints.js +1 -2
- package/dist-cjs/index.js +4 -12
- package/dist-cjs/models/index.js +0 -1
- package/dist-cjs/models/models_0.js +0 -73
- package/dist-cjs/pagination/Interfaces.js +0 -1
- package/dist-cjs/pagination/ListRetainedMessagesPaginator.js +0 -11
- package/dist-cjs/pagination/index.js +5 -0
- package/dist-cjs/protocols/Aws_restJson1.js +0 -6
- package/dist-cjs/runtimeConfig.browser.js +1 -6
- package/dist-cjs/runtimeConfig.js +2 -7
- package/dist-cjs/runtimeConfig.native.js +0 -4
- package/dist-cjs/runtimeConfig.shared.js +0 -4
- package/dist-es/IoTDataPlane.js +0 -1
- package/dist-es/IoTDataPlaneClient.js +0 -1
- package/dist-es/commands/DeleteThingShadowCommand.js +0 -1
- package/dist-es/commands/GetRetainedMessageCommand.js +0 -1
- package/dist-es/commands/GetThingShadowCommand.js +0 -1
- package/dist-es/commands/ListNamedShadowsForThingCommand.js +0 -1
- package/dist-es/commands/ListRetainedMessagesCommand.js +0 -1
- package/dist-es/commands/PublishCommand.js +0 -1
- package/dist-es/commands/UpdateThingShadowCommand.js +0 -1
- package/dist-es/commands/index.js +7 -0
- package/dist-es/endpoints.js +1 -2
- package/dist-es/index.js +4 -12
- package/dist-es/models/index.js +0 -1
- package/dist-es/models/models_0.js +0 -1
- package/dist-es/pagination/Interfaces.js +0 -1
- package/dist-es/pagination/ListRetainedMessagesPaginator.js +0 -1
- package/dist-es/pagination/index.js +2 -0
- package/dist-es/protocols/Aws_restJson1.js +0 -1
- package/dist-es/runtimeConfig.browser.js +1 -2
- package/dist-es/runtimeConfig.js +2 -3
- package/dist-es/runtimeConfig.native.js +0 -1
- package/dist-es/runtimeConfig.shared.js +0 -1
- package/dist-types/commands/index.d.ts +7 -0
- package/dist-types/index.d.ts +4 -11
- package/dist-types/pagination/index.d.ts +2 -0
- package/dist-types/ts3.4/IoTDataPlane.d.ts +8 -64
- package/dist-types/ts3.4/IoTDataPlaneClient.d.ts +24 -99
- package/dist-types/ts3.4/commands/DeleteThingShadowCommand.d.ts +2 -22
- package/dist-types/ts3.4/commands/GetRetainedMessageCommand.d.ts +2 -26
- package/dist-types/ts3.4/commands/GetThingShadowCommand.d.ts +2 -23
- package/dist-types/ts3.4/commands/ListNamedShadowsForThingCommand.d.ts +2 -21
- package/dist-types/ts3.4/commands/ListRetainedMessagesCommand.d.ts +2 -29
- package/dist-types/ts3.4/commands/PublishCommand.d.ts +2 -26
- package/dist-types/ts3.4/commands/UpdateThingShadowCommand.d.ts +2 -23
- package/dist-types/ts3.4/commands/index.d.ts +7 -0
- package/dist-types/ts3.4/index.d.ts +4 -11
- package/dist-types/ts3.4/models/models_0.d.ts +87 -271
- package/dist-types/ts3.4/pagination/index.d.ts +2 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -3
- package/dist-types/ts3.4/runtimeConfig.d.ts +1 -3
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +1 -3
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +1 -3
- package/package.json +33 -30
- package/dist-cjs/IoTDataPlane.js.map +0 -1
- package/dist-cjs/IoTDataPlaneClient.js.map +0 -1
- package/dist-cjs/commands/DeleteThingShadowCommand.js.map +0 -1
- package/dist-cjs/commands/GetRetainedMessageCommand.js.map +0 -1
- package/dist-cjs/commands/GetThingShadowCommand.js.map +0 -1
- package/dist-cjs/commands/ListNamedShadowsForThingCommand.js.map +0 -1
- package/dist-cjs/commands/ListRetainedMessagesCommand.js.map +0 -1
- package/dist-cjs/commands/PublishCommand.js.map +0 -1
- package/dist-cjs/commands/UpdateThingShadowCommand.js.map +0 -1
- package/dist-cjs/endpoints.js.map +0 -1
- package/dist-cjs/index.js.map +0 -1
- package/dist-cjs/models/index.js.map +0 -1
- package/dist-cjs/models/models_0.js.map +0 -1
- package/dist-cjs/pagination/Interfaces.js.map +0 -1
- package/dist-cjs/pagination/ListRetainedMessagesPaginator.js.map +0 -1
- package/dist-cjs/protocols/Aws_restJson1.js.map +0 -1
- package/dist-cjs/runtimeConfig.browser.js.map +0 -1
- package/dist-cjs/runtimeConfig.js.map +0 -1
- package/dist-cjs/runtimeConfig.native.js.map +0 -1
- package/dist-cjs/runtimeConfig.shared.js.map +0 -1
- package/dist-es/IoTDataPlane.js.map +0 -1
- package/dist-es/IoTDataPlaneClient.js.map +0 -1
- package/dist-es/commands/DeleteThingShadowCommand.js.map +0 -1
- package/dist-es/commands/GetRetainedMessageCommand.js.map +0 -1
- package/dist-es/commands/GetThingShadowCommand.js.map +0 -1
- package/dist-es/commands/ListNamedShadowsForThingCommand.js.map +0 -1
- package/dist-es/commands/ListRetainedMessagesCommand.js.map +0 -1
- package/dist-es/commands/PublishCommand.js.map +0 -1
- package/dist-es/commands/UpdateThingShadowCommand.js.map +0 -1
- package/dist-es/endpoints.js.map +0 -1
- package/dist-es/index.js.map +0 -1
- package/dist-es/models/index.js.map +0 -1
- package/dist-es/models/models_0.js.map +0 -1
- package/dist-es/pagination/Interfaces.js.map +0 -1
- package/dist-es/pagination/ListRetainedMessagesPaginator.js.map +0 -1
- package/dist-es/protocols/Aws_restJson1.js.map +0 -1
- package/dist-es/runtimeConfig.browser.js.map +0 -1
- package/dist-es/runtimeConfig.js.map +0 -1
- package/dist-es/runtimeConfig.native.js.map +0 -1
- package/dist-es/runtimeConfig.shared.js.map +0 -1
- package/jest.config.js +0 -4
- package/src/IoTDataPlane.ts +0 -297
- package/src/IoTDataPlaneClient.ts +0 -273
- package/src/commands/DeleteThingShadowCommand.ts +0 -97
- package/src/commands/GetRetainedMessageCommand.ts +0 -101
- package/src/commands/GetThingShadowCommand.ts +0 -98
- package/src/commands/ListNamedShadowsForThingCommand.ts +0 -96
- package/src/commands/ListRetainedMessagesCommand.ts +0 -104
- package/src/commands/PublishCommand.ts +0 -101
- package/src/commands/UpdateThingShadowCommand.ts +0 -98
- package/src/endpoints.ts +0 -91
- package/src/index.ts +0 -12
- package/src/models/index.ts +0 -1
- package/src/models/models_0.ts +0 -570
- package/src/pagination/Interfaces.ts +0 -8
- package/src/pagination/ListRetainedMessagesPaginator.ts +0 -59
- package/src/protocols/Aws_restJson1.ts +0 -1281
- package/src/runtimeConfig.browser.ts +0 -41
- package/src/runtimeConfig.native.ts +0 -17
- package/src/runtimeConfig.shared.ts +0 -17
- package/src/runtimeConfig.ts +0 -46
- package/tsconfig.es.json +0 -10
- package/tsconfig.json +0 -33
- package/tsconfig.types.json +0 -9
|
@@ -1,1281 +0,0 @@
|
|
|
1
|
-
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
|
|
2
|
-
import {
|
|
3
|
-
expectInt32 as __expectInt32,
|
|
4
|
-
expectLong as __expectLong,
|
|
5
|
-
expectNonNull as __expectNonNull,
|
|
6
|
-
expectObject as __expectObject,
|
|
7
|
-
expectString as __expectString,
|
|
8
|
-
extendedEncodeURIComponent as __extendedEncodeURIComponent,
|
|
9
|
-
} from "@aws-sdk/smithy-client";
|
|
10
|
-
import {
|
|
11
|
-
Endpoint as __Endpoint,
|
|
12
|
-
MetadataBearer as __MetadataBearer,
|
|
13
|
-
ResponseMetadata as __ResponseMetadata,
|
|
14
|
-
SerdeContext as __SerdeContext,
|
|
15
|
-
SmithyException as __SmithyException,
|
|
16
|
-
} from "@aws-sdk/types";
|
|
17
|
-
|
|
18
|
-
import { DeleteThingShadowCommandInput, DeleteThingShadowCommandOutput } from "../commands/DeleteThingShadowCommand";
|
|
19
|
-
import { GetRetainedMessageCommandInput, GetRetainedMessageCommandOutput } from "../commands/GetRetainedMessageCommand";
|
|
20
|
-
import { GetThingShadowCommandInput, GetThingShadowCommandOutput } from "../commands/GetThingShadowCommand";
|
|
21
|
-
import {
|
|
22
|
-
ListNamedShadowsForThingCommandInput,
|
|
23
|
-
ListNamedShadowsForThingCommandOutput,
|
|
24
|
-
} from "../commands/ListNamedShadowsForThingCommand";
|
|
25
|
-
import {
|
|
26
|
-
ListRetainedMessagesCommandInput,
|
|
27
|
-
ListRetainedMessagesCommandOutput,
|
|
28
|
-
} from "../commands/ListRetainedMessagesCommand";
|
|
29
|
-
import { PublishCommandInput, PublishCommandOutput } from "../commands/PublishCommand";
|
|
30
|
-
import { UpdateThingShadowCommandInput, UpdateThingShadowCommandOutput } from "../commands/UpdateThingShadowCommand";
|
|
31
|
-
import {
|
|
32
|
-
ConflictException,
|
|
33
|
-
InternalFailureException,
|
|
34
|
-
InvalidRequestException,
|
|
35
|
-
MethodNotAllowedException,
|
|
36
|
-
RequestEntityTooLargeException,
|
|
37
|
-
ResourceNotFoundException,
|
|
38
|
-
RetainedMessageSummary,
|
|
39
|
-
ServiceUnavailableException,
|
|
40
|
-
ThrottlingException,
|
|
41
|
-
UnauthorizedException,
|
|
42
|
-
UnsupportedDocumentEncodingException,
|
|
43
|
-
} from "../models/models_0";
|
|
44
|
-
|
|
45
|
-
export const serializeAws_restJson1DeleteThingShadowCommand = async (
|
|
46
|
-
input: DeleteThingShadowCommandInput,
|
|
47
|
-
context: __SerdeContext
|
|
48
|
-
): Promise<__HttpRequest> => {
|
|
49
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
50
|
-
const headers: any = {};
|
|
51
|
-
let resolvedPath =
|
|
52
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/things/{thingName}/shadow";
|
|
53
|
-
if (input.thingName !== undefined) {
|
|
54
|
-
const labelValue: string = input.thingName;
|
|
55
|
-
if (labelValue.length <= 0) {
|
|
56
|
-
throw new Error("Empty value provided for input HTTP label: thingName.");
|
|
57
|
-
}
|
|
58
|
-
resolvedPath = resolvedPath.replace("{thingName}", __extendedEncodeURIComponent(labelValue));
|
|
59
|
-
} else {
|
|
60
|
-
throw new Error("No value provided for input HTTP label: thingName.");
|
|
61
|
-
}
|
|
62
|
-
const query: any = {
|
|
63
|
-
...(input.shadowName !== undefined && { name: input.shadowName }),
|
|
64
|
-
};
|
|
65
|
-
let body: any;
|
|
66
|
-
return new __HttpRequest({
|
|
67
|
-
protocol,
|
|
68
|
-
hostname,
|
|
69
|
-
port,
|
|
70
|
-
method: "DELETE",
|
|
71
|
-
headers,
|
|
72
|
-
path: resolvedPath,
|
|
73
|
-
query,
|
|
74
|
-
body,
|
|
75
|
-
});
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
export const serializeAws_restJson1GetRetainedMessageCommand = async (
|
|
79
|
-
input: GetRetainedMessageCommandInput,
|
|
80
|
-
context: __SerdeContext
|
|
81
|
-
): Promise<__HttpRequest> => {
|
|
82
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
83
|
-
const headers: any = {};
|
|
84
|
-
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/retainedMessage/{topic}";
|
|
85
|
-
if (input.topic !== undefined) {
|
|
86
|
-
const labelValue: string = input.topic;
|
|
87
|
-
if (labelValue.length <= 0) {
|
|
88
|
-
throw new Error("Empty value provided for input HTTP label: topic.");
|
|
89
|
-
}
|
|
90
|
-
resolvedPath = resolvedPath.replace("{topic}", __extendedEncodeURIComponent(labelValue));
|
|
91
|
-
} else {
|
|
92
|
-
throw new Error("No value provided for input HTTP label: topic.");
|
|
93
|
-
}
|
|
94
|
-
let body: any;
|
|
95
|
-
return new __HttpRequest({
|
|
96
|
-
protocol,
|
|
97
|
-
hostname,
|
|
98
|
-
port,
|
|
99
|
-
method: "GET",
|
|
100
|
-
headers,
|
|
101
|
-
path: resolvedPath,
|
|
102
|
-
body,
|
|
103
|
-
});
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
export const serializeAws_restJson1GetThingShadowCommand = async (
|
|
107
|
-
input: GetThingShadowCommandInput,
|
|
108
|
-
context: __SerdeContext
|
|
109
|
-
): Promise<__HttpRequest> => {
|
|
110
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
111
|
-
const headers: any = {};
|
|
112
|
-
let resolvedPath =
|
|
113
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/things/{thingName}/shadow";
|
|
114
|
-
if (input.thingName !== undefined) {
|
|
115
|
-
const labelValue: string = input.thingName;
|
|
116
|
-
if (labelValue.length <= 0) {
|
|
117
|
-
throw new Error("Empty value provided for input HTTP label: thingName.");
|
|
118
|
-
}
|
|
119
|
-
resolvedPath = resolvedPath.replace("{thingName}", __extendedEncodeURIComponent(labelValue));
|
|
120
|
-
} else {
|
|
121
|
-
throw new Error("No value provided for input HTTP label: thingName.");
|
|
122
|
-
}
|
|
123
|
-
const query: any = {
|
|
124
|
-
...(input.shadowName !== undefined && { name: input.shadowName }),
|
|
125
|
-
};
|
|
126
|
-
let body: any;
|
|
127
|
-
return new __HttpRequest({
|
|
128
|
-
protocol,
|
|
129
|
-
hostname,
|
|
130
|
-
port,
|
|
131
|
-
method: "GET",
|
|
132
|
-
headers,
|
|
133
|
-
path: resolvedPath,
|
|
134
|
-
query,
|
|
135
|
-
body,
|
|
136
|
-
});
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
export const serializeAws_restJson1ListNamedShadowsForThingCommand = async (
|
|
140
|
-
input: ListNamedShadowsForThingCommandInput,
|
|
141
|
-
context: __SerdeContext
|
|
142
|
-
): Promise<__HttpRequest> => {
|
|
143
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
144
|
-
const headers: any = {};
|
|
145
|
-
let resolvedPath =
|
|
146
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
147
|
-
"/api/things/shadow/ListNamedShadowsForThing/{thingName}";
|
|
148
|
-
if (input.thingName !== undefined) {
|
|
149
|
-
const labelValue: string = input.thingName;
|
|
150
|
-
if (labelValue.length <= 0) {
|
|
151
|
-
throw new Error("Empty value provided for input HTTP label: thingName.");
|
|
152
|
-
}
|
|
153
|
-
resolvedPath = resolvedPath.replace("{thingName}", __extendedEncodeURIComponent(labelValue));
|
|
154
|
-
} else {
|
|
155
|
-
throw new Error("No value provided for input HTTP label: thingName.");
|
|
156
|
-
}
|
|
157
|
-
const query: any = {
|
|
158
|
-
...(input.nextToken !== undefined && { nextToken: input.nextToken }),
|
|
159
|
-
...(input.pageSize !== undefined && { pageSize: input.pageSize.toString() }),
|
|
160
|
-
};
|
|
161
|
-
let body: any;
|
|
162
|
-
return new __HttpRequest({
|
|
163
|
-
protocol,
|
|
164
|
-
hostname,
|
|
165
|
-
port,
|
|
166
|
-
method: "GET",
|
|
167
|
-
headers,
|
|
168
|
-
path: resolvedPath,
|
|
169
|
-
query,
|
|
170
|
-
body,
|
|
171
|
-
});
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
export const serializeAws_restJson1ListRetainedMessagesCommand = async (
|
|
175
|
-
input: ListRetainedMessagesCommandInput,
|
|
176
|
-
context: __SerdeContext
|
|
177
|
-
): Promise<__HttpRequest> => {
|
|
178
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
179
|
-
const headers: any = {};
|
|
180
|
-
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/retainedMessage";
|
|
181
|
-
const query: any = {
|
|
182
|
-
...(input.nextToken !== undefined && { nextToken: input.nextToken }),
|
|
183
|
-
...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
|
|
184
|
-
};
|
|
185
|
-
let body: any;
|
|
186
|
-
return new __HttpRequest({
|
|
187
|
-
protocol,
|
|
188
|
-
hostname,
|
|
189
|
-
port,
|
|
190
|
-
method: "GET",
|
|
191
|
-
headers,
|
|
192
|
-
path: resolvedPath,
|
|
193
|
-
query,
|
|
194
|
-
body,
|
|
195
|
-
});
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
export const serializeAws_restJson1PublishCommand = async (
|
|
199
|
-
input: PublishCommandInput,
|
|
200
|
-
context: __SerdeContext
|
|
201
|
-
): Promise<__HttpRequest> => {
|
|
202
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
203
|
-
const headers: any = {
|
|
204
|
-
"content-type": "application/octet-stream",
|
|
205
|
-
};
|
|
206
|
-
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/topics/{topic}";
|
|
207
|
-
if (input.topic !== undefined) {
|
|
208
|
-
const labelValue: string = input.topic;
|
|
209
|
-
if (labelValue.length <= 0) {
|
|
210
|
-
throw new Error("Empty value provided for input HTTP label: topic.");
|
|
211
|
-
}
|
|
212
|
-
resolvedPath = resolvedPath.replace("{topic}", __extendedEncodeURIComponent(labelValue));
|
|
213
|
-
} else {
|
|
214
|
-
throw new Error("No value provided for input HTTP label: topic.");
|
|
215
|
-
}
|
|
216
|
-
const query: any = {
|
|
217
|
-
...(input.qos !== undefined && { qos: input.qos.toString() }),
|
|
218
|
-
...(input.retain !== undefined && { retain: input.retain.toString() }),
|
|
219
|
-
};
|
|
220
|
-
let body: any;
|
|
221
|
-
if (input.payload !== undefined) {
|
|
222
|
-
body = input.payload;
|
|
223
|
-
}
|
|
224
|
-
return new __HttpRequest({
|
|
225
|
-
protocol,
|
|
226
|
-
hostname,
|
|
227
|
-
port,
|
|
228
|
-
method: "POST",
|
|
229
|
-
headers,
|
|
230
|
-
path: resolvedPath,
|
|
231
|
-
query,
|
|
232
|
-
body,
|
|
233
|
-
});
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
export const serializeAws_restJson1UpdateThingShadowCommand = async (
|
|
237
|
-
input: UpdateThingShadowCommandInput,
|
|
238
|
-
context: __SerdeContext
|
|
239
|
-
): Promise<__HttpRequest> => {
|
|
240
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
241
|
-
const headers: any = {
|
|
242
|
-
"content-type": "application/octet-stream",
|
|
243
|
-
};
|
|
244
|
-
let resolvedPath =
|
|
245
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/things/{thingName}/shadow";
|
|
246
|
-
if (input.thingName !== undefined) {
|
|
247
|
-
const labelValue: string = input.thingName;
|
|
248
|
-
if (labelValue.length <= 0) {
|
|
249
|
-
throw new Error("Empty value provided for input HTTP label: thingName.");
|
|
250
|
-
}
|
|
251
|
-
resolvedPath = resolvedPath.replace("{thingName}", __extendedEncodeURIComponent(labelValue));
|
|
252
|
-
} else {
|
|
253
|
-
throw new Error("No value provided for input HTTP label: thingName.");
|
|
254
|
-
}
|
|
255
|
-
const query: any = {
|
|
256
|
-
...(input.shadowName !== undefined && { name: input.shadowName }),
|
|
257
|
-
};
|
|
258
|
-
let body: any;
|
|
259
|
-
if (input.payload !== undefined) {
|
|
260
|
-
body = input.payload;
|
|
261
|
-
}
|
|
262
|
-
return new __HttpRequest({
|
|
263
|
-
protocol,
|
|
264
|
-
hostname,
|
|
265
|
-
port,
|
|
266
|
-
method: "POST",
|
|
267
|
-
headers,
|
|
268
|
-
path: resolvedPath,
|
|
269
|
-
query,
|
|
270
|
-
body,
|
|
271
|
-
});
|
|
272
|
-
};
|
|
273
|
-
|
|
274
|
-
export const deserializeAws_restJson1DeleteThingShadowCommand = async (
|
|
275
|
-
output: __HttpResponse,
|
|
276
|
-
context: __SerdeContext
|
|
277
|
-
): Promise<DeleteThingShadowCommandOutput> => {
|
|
278
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
279
|
-
return deserializeAws_restJson1DeleteThingShadowCommandError(output, context);
|
|
280
|
-
}
|
|
281
|
-
const contents: DeleteThingShadowCommandOutput = {
|
|
282
|
-
$metadata: deserializeMetadata(output),
|
|
283
|
-
payload: undefined,
|
|
284
|
-
};
|
|
285
|
-
const data: any = await collectBody(output.body, context);
|
|
286
|
-
contents.payload = data;
|
|
287
|
-
return Promise.resolve(contents);
|
|
288
|
-
};
|
|
289
|
-
|
|
290
|
-
const deserializeAws_restJson1DeleteThingShadowCommandError = async (
|
|
291
|
-
output: __HttpResponse,
|
|
292
|
-
context: __SerdeContext
|
|
293
|
-
): Promise<DeleteThingShadowCommandOutput> => {
|
|
294
|
-
const parsedOutput: any = {
|
|
295
|
-
...output,
|
|
296
|
-
body: await parseBody(output.body, context),
|
|
297
|
-
};
|
|
298
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
299
|
-
let errorCode = "UnknownError";
|
|
300
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
301
|
-
switch (errorCode) {
|
|
302
|
-
case "InternalFailureException":
|
|
303
|
-
case "com.amazonaws.iotdataplane#InternalFailureException":
|
|
304
|
-
response = {
|
|
305
|
-
...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
|
|
306
|
-
name: errorCode,
|
|
307
|
-
$metadata: deserializeMetadata(output),
|
|
308
|
-
};
|
|
309
|
-
break;
|
|
310
|
-
case "InvalidRequestException":
|
|
311
|
-
case "com.amazonaws.iotdataplane#InvalidRequestException":
|
|
312
|
-
response = {
|
|
313
|
-
...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
|
|
314
|
-
name: errorCode,
|
|
315
|
-
$metadata: deserializeMetadata(output),
|
|
316
|
-
};
|
|
317
|
-
break;
|
|
318
|
-
case "MethodNotAllowedException":
|
|
319
|
-
case "com.amazonaws.iotdataplane#MethodNotAllowedException":
|
|
320
|
-
response = {
|
|
321
|
-
...(await deserializeAws_restJson1MethodNotAllowedExceptionResponse(parsedOutput, context)),
|
|
322
|
-
name: errorCode,
|
|
323
|
-
$metadata: deserializeMetadata(output),
|
|
324
|
-
};
|
|
325
|
-
break;
|
|
326
|
-
case "ResourceNotFoundException":
|
|
327
|
-
case "com.amazonaws.iotdataplane#ResourceNotFoundException":
|
|
328
|
-
response = {
|
|
329
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
330
|
-
name: errorCode,
|
|
331
|
-
$metadata: deserializeMetadata(output),
|
|
332
|
-
};
|
|
333
|
-
break;
|
|
334
|
-
case "ServiceUnavailableException":
|
|
335
|
-
case "com.amazonaws.iotdataplane#ServiceUnavailableException":
|
|
336
|
-
response = {
|
|
337
|
-
...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
|
|
338
|
-
name: errorCode,
|
|
339
|
-
$metadata: deserializeMetadata(output),
|
|
340
|
-
};
|
|
341
|
-
break;
|
|
342
|
-
case "ThrottlingException":
|
|
343
|
-
case "com.amazonaws.iotdataplane#ThrottlingException":
|
|
344
|
-
response = {
|
|
345
|
-
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
346
|
-
name: errorCode,
|
|
347
|
-
$metadata: deserializeMetadata(output),
|
|
348
|
-
};
|
|
349
|
-
break;
|
|
350
|
-
case "UnauthorizedException":
|
|
351
|
-
case "com.amazonaws.iotdataplane#UnauthorizedException":
|
|
352
|
-
response = {
|
|
353
|
-
...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
|
|
354
|
-
name: errorCode,
|
|
355
|
-
$metadata: deserializeMetadata(output),
|
|
356
|
-
};
|
|
357
|
-
break;
|
|
358
|
-
case "UnsupportedDocumentEncodingException":
|
|
359
|
-
case "com.amazonaws.iotdataplane#UnsupportedDocumentEncodingException":
|
|
360
|
-
response = {
|
|
361
|
-
...(await deserializeAws_restJson1UnsupportedDocumentEncodingExceptionResponse(parsedOutput, context)),
|
|
362
|
-
name: errorCode,
|
|
363
|
-
$metadata: deserializeMetadata(output),
|
|
364
|
-
};
|
|
365
|
-
break;
|
|
366
|
-
default:
|
|
367
|
-
const parsedBody = parsedOutput.body;
|
|
368
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
369
|
-
response = {
|
|
370
|
-
...parsedBody,
|
|
371
|
-
name: `${errorCode}`,
|
|
372
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
373
|
-
$fault: "client",
|
|
374
|
-
$metadata: deserializeMetadata(output),
|
|
375
|
-
} as any;
|
|
376
|
-
}
|
|
377
|
-
const message = response.message || response.Message || errorCode;
|
|
378
|
-
response.message = message;
|
|
379
|
-
delete response.Message;
|
|
380
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
381
|
-
};
|
|
382
|
-
|
|
383
|
-
export const deserializeAws_restJson1GetRetainedMessageCommand = async (
|
|
384
|
-
output: __HttpResponse,
|
|
385
|
-
context: __SerdeContext
|
|
386
|
-
): Promise<GetRetainedMessageCommandOutput> => {
|
|
387
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
388
|
-
return deserializeAws_restJson1GetRetainedMessageCommandError(output, context);
|
|
389
|
-
}
|
|
390
|
-
const contents: GetRetainedMessageCommandOutput = {
|
|
391
|
-
$metadata: deserializeMetadata(output),
|
|
392
|
-
lastModifiedTime: undefined,
|
|
393
|
-
payload: undefined,
|
|
394
|
-
qos: undefined,
|
|
395
|
-
topic: undefined,
|
|
396
|
-
};
|
|
397
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
398
|
-
if (data.lastModifiedTime !== undefined && data.lastModifiedTime !== null) {
|
|
399
|
-
contents.lastModifiedTime = __expectLong(data.lastModifiedTime);
|
|
400
|
-
}
|
|
401
|
-
if (data.payload !== undefined && data.payload !== null) {
|
|
402
|
-
contents.payload = context.base64Decoder(data.payload);
|
|
403
|
-
}
|
|
404
|
-
if (data.qos !== undefined && data.qos !== null) {
|
|
405
|
-
contents.qos = __expectInt32(data.qos);
|
|
406
|
-
}
|
|
407
|
-
if (data.topic !== undefined && data.topic !== null) {
|
|
408
|
-
contents.topic = __expectString(data.topic);
|
|
409
|
-
}
|
|
410
|
-
return Promise.resolve(contents);
|
|
411
|
-
};
|
|
412
|
-
|
|
413
|
-
const deserializeAws_restJson1GetRetainedMessageCommandError = async (
|
|
414
|
-
output: __HttpResponse,
|
|
415
|
-
context: __SerdeContext
|
|
416
|
-
): Promise<GetRetainedMessageCommandOutput> => {
|
|
417
|
-
const parsedOutput: any = {
|
|
418
|
-
...output,
|
|
419
|
-
body: await parseBody(output.body, context),
|
|
420
|
-
};
|
|
421
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
422
|
-
let errorCode = "UnknownError";
|
|
423
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
424
|
-
switch (errorCode) {
|
|
425
|
-
case "InternalFailureException":
|
|
426
|
-
case "com.amazonaws.iotdataplane#InternalFailureException":
|
|
427
|
-
response = {
|
|
428
|
-
...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
|
|
429
|
-
name: errorCode,
|
|
430
|
-
$metadata: deserializeMetadata(output),
|
|
431
|
-
};
|
|
432
|
-
break;
|
|
433
|
-
case "InvalidRequestException":
|
|
434
|
-
case "com.amazonaws.iotdataplane#InvalidRequestException":
|
|
435
|
-
response = {
|
|
436
|
-
...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
|
|
437
|
-
name: errorCode,
|
|
438
|
-
$metadata: deserializeMetadata(output),
|
|
439
|
-
};
|
|
440
|
-
break;
|
|
441
|
-
case "MethodNotAllowedException":
|
|
442
|
-
case "com.amazonaws.iotdataplane#MethodNotAllowedException":
|
|
443
|
-
response = {
|
|
444
|
-
...(await deserializeAws_restJson1MethodNotAllowedExceptionResponse(parsedOutput, context)),
|
|
445
|
-
name: errorCode,
|
|
446
|
-
$metadata: deserializeMetadata(output),
|
|
447
|
-
};
|
|
448
|
-
break;
|
|
449
|
-
case "ResourceNotFoundException":
|
|
450
|
-
case "com.amazonaws.iotdataplane#ResourceNotFoundException":
|
|
451
|
-
response = {
|
|
452
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
453
|
-
name: errorCode,
|
|
454
|
-
$metadata: deserializeMetadata(output),
|
|
455
|
-
};
|
|
456
|
-
break;
|
|
457
|
-
case "ServiceUnavailableException":
|
|
458
|
-
case "com.amazonaws.iotdataplane#ServiceUnavailableException":
|
|
459
|
-
response = {
|
|
460
|
-
...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
|
|
461
|
-
name: errorCode,
|
|
462
|
-
$metadata: deserializeMetadata(output),
|
|
463
|
-
};
|
|
464
|
-
break;
|
|
465
|
-
case "ThrottlingException":
|
|
466
|
-
case "com.amazonaws.iotdataplane#ThrottlingException":
|
|
467
|
-
response = {
|
|
468
|
-
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
469
|
-
name: errorCode,
|
|
470
|
-
$metadata: deserializeMetadata(output),
|
|
471
|
-
};
|
|
472
|
-
break;
|
|
473
|
-
case "UnauthorizedException":
|
|
474
|
-
case "com.amazonaws.iotdataplane#UnauthorizedException":
|
|
475
|
-
response = {
|
|
476
|
-
...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
|
|
477
|
-
name: errorCode,
|
|
478
|
-
$metadata: deserializeMetadata(output),
|
|
479
|
-
};
|
|
480
|
-
break;
|
|
481
|
-
default:
|
|
482
|
-
const parsedBody = parsedOutput.body;
|
|
483
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
484
|
-
response = {
|
|
485
|
-
...parsedBody,
|
|
486
|
-
name: `${errorCode}`,
|
|
487
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
488
|
-
$fault: "client",
|
|
489
|
-
$metadata: deserializeMetadata(output),
|
|
490
|
-
} as any;
|
|
491
|
-
}
|
|
492
|
-
const message = response.message || response.Message || errorCode;
|
|
493
|
-
response.message = message;
|
|
494
|
-
delete response.Message;
|
|
495
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
496
|
-
};
|
|
497
|
-
|
|
498
|
-
export const deserializeAws_restJson1GetThingShadowCommand = async (
|
|
499
|
-
output: __HttpResponse,
|
|
500
|
-
context: __SerdeContext
|
|
501
|
-
): Promise<GetThingShadowCommandOutput> => {
|
|
502
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
503
|
-
return deserializeAws_restJson1GetThingShadowCommandError(output, context);
|
|
504
|
-
}
|
|
505
|
-
const contents: GetThingShadowCommandOutput = {
|
|
506
|
-
$metadata: deserializeMetadata(output),
|
|
507
|
-
payload: undefined,
|
|
508
|
-
};
|
|
509
|
-
const data: any = await collectBody(output.body, context);
|
|
510
|
-
contents.payload = data;
|
|
511
|
-
return Promise.resolve(contents);
|
|
512
|
-
};
|
|
513
|
-
|
|
514
|
-
const deserializeAws_restJson1GetThingShadowCommandError = async (
|
|
515
|
-
output: __HttpResponse,
|
|
516
|
-
context: __SerdeContext
|
|
517
|
-
): Promise<GetThingShadowCommandOutput> => {
|
|
518
|
-
const parsedOutput: any = {
|
|
519
|
-
...output,
|
|
520
|
-
body: await parseBody(output.body, context),
|
|
521
|
-
};
|
|
522
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
523
|
-
let errorCode = "UnknownError";
|
|
524
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
525
|
-
switch (errorCode) {
|
|
526
|
-
case "InternalFailureException":
|
|
527
|
-
case "com.amazonaws.iotdataplane#InternalFailureException":
|
|
528
|
-
response = {
|
|
529
|
-
...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
|
|
530
|
-
name: errorCode,
|
|
531
|
-
$metadata: deserializeMetadata(output),
|
|
532
|
-
};
|
|
533
|
-
break;
|
|
534
|
-
case "InvalidRequestException":
|
|
535
|
-
case "com.amazonaws.iotdataplane#InvalidRequestException":
|
|
536
|
-
response = {
|
|
537
|
-
...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
|
|
538
|
-
name: errorCode,
|
|
539
|
-
$metadata: deserializeMetadata(output),
|
|
540
|
-
};
|
|
541
|
-
break;
|
|
542
|
-
case "MethodNotAllowedException":
|
|
543
|
-
case "com.amazonaws.iotdataplane#MethodNotAllowedException":
|
|
544
|
-
response = {
|
|
545
|
-
...(await deserializeAws_restJson1MethodNotAllowedExceptionResponse(parsedOutput, context)),
|
|
546
|
-
name: errorCode,
|
|
547
|
-
$metadata: deserializeMetadata(output),
|
|
548
|
-
};
|
|
549
|
-
break;
|
|
550
|
-
case "ResourceNotFoundException":
|
|
551
|
-
case "com.amazonaws.iotdataplane#ResourceNotFoundException":
|
|
552
|
-
response = {
|
|
553
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
554
|
-
name: errorCode,
|
|
555
|
-
$metadata: deserializeMetadata(output),
|
|
556
|
-
};
|
|
557
|
-
break;
|
|
558
|
-
case "ServiceUnavailableException":
|
|
559
|
-
case "com.amazonaws.iotdataplane#ServiceUnavailableException":
|
|
560
|
-
response = {
|
|
561
|
-
...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
|
|
562
|
-
name: errorCode,
|
|
563
|
-
$metadata: deserializeMetadata(output),
|
|
564
|
-
};
|
|
565
|
-
break;
|
|
566
|
-
case "ThrottlingException":
|
|
567
|
-
case "com.amazonaws.iotdataplane#ThrottlingException":
|
|
568
|
-
response = {
|
|
569
|
-
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
570
|
-
name: errorCode,
|
|
571
|
-
$metadata: deserializeMetadata(output),
|
|
572
|
-
};
|
|
573
|
-
break;
|
|
574
|
-
case "UnauthorizedException":
|
|
575
|
-
case "com.amazonaws.iotdataplane#UnauthorizedException":
|
|
576
|
-
response = {
|
|
577
|
-
...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
|
|
578
|
-
name: errorCode,
|
|
579
|
-
$metadata: deserializeMetadata(output),
|
|
580
|
-
};
|
|
581
|
-
break;
|
|
582
|
-
case "UnsupportedDocumentEncodingException":
|
|
583
|
-
case "com.amazonaws.iotdataplane#UnsupportedDocumentEncodingException":
|
|
584
|
-
response = {
|
|
585
|
-
...(await deserializeAws_restJson1UnsupportedDocumentEncodingExceptionResponse(parsedOutput, context)),
|
|
586
|
-
name: errorCode,
|
|
587
|
-
$metadata: deserializeMetadata(output),
|
|
588
|
-
};
|
|
589
|
-
break;
|
|
590
|
-
default:
|
|
591
|
-
const parsedBody = parsedOutput.body;
|
|
592
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
593
|
-
response = {
|
|
594
|
-
...parsedBody,
|
|
595
|
-
name: `${errorCode}`,
|
|
596
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
597
|
-
$fault: "client",
|
|
598
|
-
$metadata: deserializeMetadata(output),
|
|
599
|
-
} as any;
|
|
600
|
-
}
|
|
601
|
-
const message = response.message || response.Message || errorCode;
|
|
602
|
-
response.message = message;
|
|
603
|
-
delete response.Message;
|
|
604
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
605
|
-
};
|
|
606
|
-
|
|
607
|
-
export const deserializeAws_restJson1ListNamedShadowsForThingCommand = async (
|
|
608
|
-
output: __HttpResponse,
|
|
609
|
-
context: __SerdeContext
|
|
610
|
-
): Promise<ListNamedShadowsForThingCommandOutput> => {
|
|
611
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
612
|
-
return deserializeAws_restJson1ListNamedShadowsForThingCommandError(output, context);
|
|
613
|
-
}
|
|
614
|
-
const contents: ListNamedShadowsForThingCommandOutput = {
|
|
615
|
-
$metadata: deserializeMetadata(output),
|
|
616
|
-
nextToken: undefined,
|
|
617
|
-
results: undefined,
|
|
618
|
-
timestamp: undefined,
|
|
619
|
-
};
|
|
620
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
621
|
-
if (data.nextToken !== undefined && data.nextToken !== null) {
|
|
622
|
-
contents.nextToken = __expectString(data.nextToken);
|
|
623
|
-
}
|
|
624
|
-
if (data.results !== undefined && data.results !== null) {
|
|
625
|
-
contents.results = deserializeAws_restJson1NamedShadowList(data.results, context);
|
|
626
|
-
}
|
|
627
|
-
if (data.timestamp !== undefined && data.timestamp !== null) {
|
|
628
|
-
contents.timestamp = __expectLong(data.timestamp);
|
|
629
|
-
}
|
|
630
|
-
return Promise.resolve(contents);
|
|
631
|
-
};
|
|
632
|
-
|
|
633
|
-
const deserializeAws_restJson1ListNamedShadowsForThingCommandError = async (
|
|
634
|
-
output: __HttpResponse,
|
|
635
|
-
context: __SerdeContext
|
|
636
|
-
): Promise<ListNamedShadowsForThingCommandOutput> => {
|
|
637
|
-
const parsedOutput: any = {
|
|
638
|
-
...output,
|
|
639
|
-
body: await parseBody(output.body, context),
|
|
640
|
-
};
|
|
641
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
642
|
-
let errorCode = "UnknownError";
|
|
643
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
644
|
-
switch (errorCode) {
|
|
645
|
-
case "InternalFailureException":
|
|
646
|
-
case "com.amazonaws.iotdataplane#InternalFailureException":
|
|
647
|
-
response = {
|
|
648
|
-
...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
|
|
649
|
-
name: errorCode,
|
|
650
|
-
$metadata: deserializeMetadata(output),
|
|
651
|
-
};
|
|
652
|
-
break;
|
|
653
|
-
case "InvalidRequestException":
|
|
654
|
-
case "com.amazonaws.iotdataplane#InvalidRequestException":
|
|
655
|
-
response = {
|
|
656
|
-
...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
|
|
657
|
-
name: errorCode,
|
|
658
|
-
$metadata: deserializeMetadata(output),
|
|
659
|
-
};
|
|
660
|
-
break;
|
|
661
|
-
case "MethodNotAllowedException":
|
|
662
|
-
case "com.amazonaws.iotdataplane#MethodNotAllowedException":
|
|
663
|
-
response = {
|
|
664
|
-
...(await deserializeAws_restJson1MethodNotAllowedExceptionResponse(parsedOutput, context)),
|
|
665
|
-
name: errorCode,
|
|
666
|
-
$metadata: deserializeMetadata(output),
|
|
667
|
-
};
|
|
668
|
-
break;
|
|
669
|
-
case "ResourceNotFoundException":
|
|
670
|
-
case "com.amazonaws.iotdataplane#ResourceNotFoundException":
|
|
671
|
-
response = {
|
|
672
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
673
|
-
name: errorCode,
|
|
674
|
-
$metadata: deserializeMetadata(output),
|
|
675
|
-
};
|
|
676
|
-
break;
|
|
677
|
-
case "ServiceUnavailableException":
|
|
678
|
-
case "com.amazonaws.iotdataplane#ServiceUnavailableException":
|
|
679
|
-
response = {
|
|
680
|
-
...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
|
|
681
|
-
name: errorCode,
|
|
682
|
-
$metadata: deserializeMetadata(output),
|
|
683
|
-
};
|
|
684
|
-
break;
|
|
685
|
-
case "ThrottlingException":
|
|
686
|
-
case "com.amazonaws.iotdataplane#ThrottlingException":
|
|
687
|
-
response = {
|
|
688
|
-
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
689
|
-
name: errorCode,
|
|
690
|
-
$metadata: deserializeMetadata(output),
|
|
691
|
-
};
|
|
692
|
-
break;
|
|
693
|
-
case "UnauthorizedException":
|
|
694
|
-
case "com.amazonaws.iotdataplane#UnauthorizedException":
|
|
695
|
-
response = {
|
|
696
|
-
...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
|
|
697
|
-
name: errorCode,
|
|
698
|
-
$metadata: deserializeMetadata(output),
|
|
699
|
-
};
|
|
700
|
-
break;
|
|
701
|
-
default:
|
|
702
|
-
const parsedBody = parsedOutput.body;
|
|
703
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
704
|
-
response = {
|
|
705
|
-
...parsedBody,
|
|
706
|
-
name: `${errorCode}`,
|
|
707
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
708
|
-
$fault: "client",
|
|
709
|
-
$metadata: deserializeMetadata(output),
|
|
710
|
-
} as any;
|
|
711
|
-
}
|
|
712
|
-
const message = response.message || response.Message || errorCode;
|
|
713
|
-
response.message = message;
|
|
714
|
-
delete response.Message;
|
|
715
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
716
|
-
};
|
|
717
|
-
|
|
718
|
-
export const deserializeAws_restJson1ListRetainedMessagesCommand = async (
|
|
719
|
-
output: __HttpResponse,
|
|
720
|
-
context: __SerdeContext
|
|
721
|
-
): Promise<ListRetainedMessagesCommandOutput> => {
|
|
722
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
723
|
-
return deserializeAws_restJson1ListRetainedMessagesCommandError(output, context);
|
|
724
|
-
}
|
|
725
|
-
const contents: ListRetainedMessagesCommandOutput = {
|
|
726
|
-
$metadata: deserializeMetadata(output),
|
|
727
|
-
nextToken: undefined,
|
|
728
|
-
retainedTopics: undefined,
|
|
729
|
-
};
|
|
730
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
731
|
-
if (data.nextToken !== undefined && data.nextToken !== null) {
|
|
732
|
-
contents.nextToken = __expectString(data.nextToken);
|
|
733
|
-
}
|
|
734
|
-
if (data.retainedTopics !== undefined && data.retainedTopics !== null) {
|
|
735
|
-
contents.retainedTopics = deserializeAws_restJson1RetainedMessageList(data.retainedTopics, context);
|
|
736
|
-
}
|
|
737
|
-
return Promise.resolve(contents);
|
|
738
|
-
};
|
|
739
|
-
|
|
740
|
-
const deserializeAws_restJson1ListRetainedMessagesCommandError = async (
|
|
741
|
-
output: __HttpResponse,
|
|
742
|
-
context: __SerdeContext
|
|
743
|
-
): Promise<ListRetainedMessagesCommandOutput> => {
|
|
744
|
-
const parsedOutput: any = {
|
|
745
|
-
...output,
|
|
746
|
-
body: await parseBody(output.body, context),
|
|
747
|
-
};
|
|
748
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
749
|
-
let errorCode = "UnknownError";
|
|
750
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
751
|
-
switch (errorCode) {
|
|
752
|
-
case "InternalFailureException":
|
|
753
|
-
case "com.amazonaws.iotdataplane#InternalFailureException":
|
|
754
|
-
response = {
|
|
755
|
-
...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
|
|
756
|
-
name: errorCode,
|
|
757
|
-
$metadata: deserializeMetadata(output),
|
|
758
|
-
};
|
|
759
|
-
break;
|
|
760
|
-
case "InvalidRequestException":
|
|
761
|
-
case "com.amazonaws.iotdataplane#InvalidRequestException":
|
|
762
|
-
response = {
|
|
763
|
-
...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
|
|
764
|
-
name: errorCode,
|
|
765
|
-
$metadata: deserializeMetadata(output),
|
|
766
|
-
};
|
|
767
|
-
break;
|
|
768
|
-
case "MethodNotAllowedException":
|
|
769
|
-
case "com.amazonaws.iotdataplane#MethodNotAllowedException":
|
|
770
|
-
response = {
|
|
771
|
-
...(await deserializeAws_restJson1MethodNotAllowedExceptionResponse(parsedOutput, context)),
|
|
772
|
-
name: errorCode,
|
|
773
|
-
$metadata: deserializeMetadata(output),
|
|
774
|
-
};
|
|
775
|
-
break;
|
|
776
|
-
case "ServiceUnavailableException":
|
|
777
|
-
case "com.amazonaws.iotdataplane#ServiceUnavailableException":
|
|
778
|
-
response = {
|
|
779
|
-
...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
|
|
780
|
-
name: errorCode,
|
|
781
|
-
$metadata: deserializeMetadata(output),
|
|
782
|
-
};
|
|
783
|
-
break;
|
|
784
|
-
case "ThrottlingException":
|
|
785
|
-
case "com.amazonaws.iotdataplane#ThrottlingException":
|
|
786
|
-
response = {
|
|
787
|
-
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
788
|
-
name: errorCode,
|
|
789
|
-
$metadata: deserializeMetadata(output),
|
|
790
|
-
};
|
|
791
|
-
break;
|
|
792
|
-
case "UnauthorizedException":
|
|
793
|
-
case "com.amazonaws.iotdataplane#UnauthorizedException":
|
|
794
|
-
response = {
|
|
795
|
-
...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
|
|
796
|
-
name: errorCode,
|
|
797
|
-
$metadata: deserializeMetadata(output),
|
|
798
|
-
};
|
|
799
|
-
break;
|
|
800
|
-
default:
|
|
801
|
-
const parsedBody = parsedOutput.body;
|
|
802
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
803
|
-
response = {
|
|
804
|
-
...parsedBody,
|
|
805
|
-
name: `${errorCode}`,
|
|
806
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
807
|
-
$fault: "client",
|
|
808
|
-
$metadata: deserializeMetadata(output),
|
|
809
|
-
} as any;
|
|
810
|
-
}
|
|
811
|
-
const message = response.message || response.Message || errorCode;
|
|
812
|
-
response.message = message;
|
|
813
|
-
delete response.Message;
|
|
814
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
815
|
-
};
|
|
816
|
-
|
|
817
|
-
export const deserializeAws_restJson1PublishCommand = async (
|
|
818
|
-
output: __HttpResponse,
|
|
819
|
-
context: __SerdeContext
|
|
820
|
-
): Promise<PublishCommandOutput> => {
|
|
821
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
822
|
-
return deserializeAws_restJson1PublishCommandError(output, context);
|
|
823
|
-
}
|
|
824
|
-
const contents: PublishCommandOutput = {
|
|
825
|
-
$metadata: deserializeMetadata(output),
|
|
826
|
-
};
|
|
827
|
-
await collectBody(output.body, context);
|
|
828
|
-
return Promise.resolve(contents);
|
|
829
|
-
};
|
|
830
|
-
|
|
831
|
-
const deserializeAws_restJson1PublishCommandError = async (
|
|
832
|
-
output: __HttpResponse,
|
|
833
|
-
context: __SerdeContext
|
|
834
|
-
): Promise<PublishCommandOutput> => {
|
|
835
|
-
const parsedOutput: any = {
|
|
836
|
-
...output,
|
|
837
|
-
body: await parseBody(output.body, context),
|
|
838
|
-
};
|
|
839
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
840
|
-
let errorCode = "UnknownError";
|
|
841
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
842
|
-
switch (errorCode) {
|
|
843
|
-
case "InternalFailureException":
|
|
844
|
-
case "com.amazonaws.iotdataplane#InternalFailureException":
|
|
845
|
-
response = {
|
|
846
|
-
...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
|
|
847
|
-
name: errorCode,
|
|
848
|
-
$metadata: deserializeMetadata(output),
|
|
849
|
-
};
|
|
850
|
-
break;
|
|
851
|
-
case "InvalidRequestException":
|
|
852
|
-
case "com.amazonaws.iotdataplane#InvalidRequestException":
|
|
853
|
-
response = {
|
|
854
|
-
...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
|
|
855
|
-
name: errorCode,
|
|
856
|
-
$metadata: deserializeMetadata(output),
|
|
857
|
-
};
|
|
858
|
-
break;
|
|
859
|
-
case "MethodNotAllowedException":
|
|
860
|
-
case "com.amazonaws.iotdataplane#MethodNotAllowedException":
|
|
861
|
-
response = {
|
|
862
|
-
...(await deserializeAws_restJson1MethodNotAllowedExceptionResponse(parsedOutput, context)),
|
|
863
|
-
name: errorCode,
|
|
864
|
-
$metadata: deserializeMetadata(output),
|
|
865
|
-
};
|
|
866
|
-
break;
|
|
867
|
-
case "UnauthorizedException":
|
|
868
|
-
case "com.amazonaws.iotdataplane#UnauthorizedException":
|
|
869
|
-
response = {
|
|
870
|
-
...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
|
|
871
|
-
name: errorCode,
|
|
872
|
-
$metadata: deserializeMetadata(output),
|
|
873
|
-
};
|
|
874
|
-
break;
|
|
875
|
-
default:
|
|
876
|
-
const parsedBody = parsedOutput.body;
|
|
877
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
878
|
-
response = {
|
|
879
|
-
...parsedBody,
|
|
880
|
-
name: `${errorCode}`,
|
|
881
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
882
|
-
$fault: "client",
|
|
883
|
-
$metadata: deserializeMetadata(output),
|
|
884
|
-
} as any;
|
|
885
|
-
}
|
|
886
|
-
const message = response.message || response.Message || errorCode;
|
|
887
|
-
response.message = message;
|
|
888
|
-
delete response.Message;
|
|
889
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
890
|
-
};
|
|
891
|
-
|
|
892
|
-
export const deserializeAws_restJson1UpdateThingShadowCommand = async (
|
|
893
|
-
output: __HttpResponse,
|
|
894
|
-
context: __SerdeContext
|
|
895
|
-
): Promise<UpdateThingShadowCommandOutput> => {
|
|
896
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
897
|
-
return deserializeAws_restJson1UpdateThingShadowCommandError(output, context);
|
|
898
|
-
}
|
|
899
|
-
const contents: UpdateThingShadowCommandOutput = {
|
|
900
|
-
$metadata: deserializeMetadata(output),
|
|
901
|
-
payload: undefined,
|
|
902
|
-
};
|
|
903
|
-
const data: any = await collectBody(output.body, context);
|
|
904
|
-
contents.payload = data;
|
|
905
|
-
return Promise.resolve(contents);
|
|
906
|
-
};
|
|
907
|
-
|
|
908
|
-
const deserializeAws_restJson1UpdateThingShadowCommandError = async (
|
|
909
|
-
output: __HttpResponse,
|
|
910
|
-
context: __SerdeContext
|
|
911
|
-
): Promise<UpdateThingShadowCommandOutput> => {
|
|
912
|
-
const parsedOutput: any = {
|
|
913
|
-
...output,
|
|
914
|
-
body: await parseBody(output.body, context),
|
|
915
|
-
};
|
|
916
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
917
|
-
let errorCode = "UnknownError";
|
|
918
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
919
|
-
switch (errorCode) {
|
|
920
|
-
case "ConflictException":
|
|
921
|
-
case "com.amazonaws.iotdataplane#ConflictException":
|
|
922
|
-
response = {
|
|
923
|
-
...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
|
|
924
|
-
name: errorCode,
|
|
925
|
-
$metadata: deserializeMetadata(output),
|
|
926
|
-
};
|
|
927
|
-
break;
|
|
928
|
-
case "InternalFailureException":
|
|
929
|
-
case "com.amazonaws.iotdataplane#InternalFailureException":
|
|
930
|
-
response = {
|
|
931
|
-
...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
|
|
932
|
-
name: errorCode,
|
|
933
|
-
$metadata: deserializeMetadata(output),
|
|
934
|
-
};
|
|
935
|
-
break;
|
|
936
|
-
case "InvalidRequestException":
|
|
937
|
-
case "com.amazonaws.iotdataplane#InvalidRequestException":
|
|
938
|
-
response = {
|
|
939
|
-
...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
|
|
940
|
-
name: errorCode,
|
|
941
|
-
$metadata: deserializeMetadata(output),
|
|
942
|
-
};
|
|
943
|
-
break;
|
|
944
|
-
case "MethodNotAllowedException":
|
|
945
|
-
case "com.amazonaws.iotdataplane#MethodNotAllowedException":
|
|
946
|
-
response = {
|
|
947
|
-
...(await deserializeAws_restJson1MethodNotAllowedExceptionResponse(parsedOutput, context)),
|
|
948
|
-
name: errorCode,
|
|
949
|
-
$metadata: deserializeMetadata(output),
|
|
950
|
-
};
|
|
951
|
-
break;
|
|
952
|
-
case "RequestEntityTooLargeException":
|
|
953
|
-
case "com.amazonaws.iotdataplane#RequestEntityTooLargeException":
|
|
954
|
-
response = {
|
|
955
|
-
...(await deserializeAws_restJson1RequestEntityTooLargeExceptionResponse(parsedOutput, context)),
|
|
956
|
-
name: errorCode,
|
|
957
|
-
$metadata: deserializeMetadata(output),
|
|
958
|
-
};
|
|
959
|
-
break;
|
|
960
|
-
case "ServiceUnavailableException":
|
|
961
|
-
case "com.amazonaws.iotdataplane#ServiceUnavailableException":
|
|
962
|
-
response = {
|
|
963
|
-
...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
|
|
964
|
-
name: errorCode,
|
|
965
|
-
$metadata: deserializeMetadata(output),
|
|
966
|
-
};
|
|
967
|
-
break;
|
|
968
|
-
case "ThrottlingException":
|
|
969
|
-
case "com.amazonaws.iotdataplane#ThrottlingException":
|
|
970
|
-
response = {
|
|
971
|
-
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
972
|
-
name: errorCode,
|
|
973
|
-
$metadata: deserializeMetadata(output),
|
|
974
|
-
};
|
|
975
|
-
break;
|
|
976
|
-
case "UnauthorizedException":
|
|
977
|
-
case "com.amazonaws.iotdataplane#UnauthorizedException":
|
|
978
|
-
response = {
|
|
979
|
-
...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
|
|
980
|
-
name: errorCode,
|
|
981
|
-
$metadata: deserializeMetadata(output),
|
|
982
|
-
};
|
|
983
|
-
break;
|
|
984
|
-
case "UnsupportedDocumentEncodingException":
|
|
985
|
-
case "com.amazonaws.iotdataplane#UnsupportedDocumentEncodingException":
|
|
986
|
-
response = {
|
|
987
|
-
...(await deserializeAws_restJson1UnsupportedDocumentEncodingExceptionResponse(parsedOutput, context)),
|
|
988
|
-
name: errorCode,
|
|
989
|
-
$metadata: deserializeMetadata(output),
|
|
990
|
-
};
|
|
991
|
-
break;
|
|
992
|
-
default:
|
|
993
|
-
const parsedBody = parsedOutput.body;
|
|
994
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
995
|
-
response = {
|
|
996
|
-
...parsedBody,
|
|
997
|
-
name: `${errorCode}`,
|
|
998
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
999
|
-
$fault: "client",
|
|
1000
|
-
$metadata: deserializeMetadata(output),
|
|
1001
|
-
} as any;
|
|
1002
|
-
}
|
|
1003
|
-
const message = response.message || response.Message || errorCode;
|
|
1004
|
-
response.message = message;
|
|
1005
|
-
delete response.Message;
|
|
1006
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
1007
|
-
};
|
|
1008
|
-
|
|
1009
|
-
const deserializeAws_restJson1ConflictExceptionResponse = async (
|
|
1010
|
-
parsedOutput: any,
|
|
1011
|
-
context: __SerdeContext
|
|
1012
|
-
): Promise<ConflictException> => {
|
|
1013
|
-
const contents: ConflictException = {
|
|
1014
|
-
name: "ConflictException",
|
|
1015
|
-
$fault: "client",
|
|
1016
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1017
|
-
message: undefined,
|
|
1018
|
-
};
|
|
1019
|
-
const data: any = parsedOutput.body;
|
|
1020
|
-
if (data.message !== undefined && data.message !== null) {
|
|
1021
|
-
contents.message = __expectString(data.message);
|
|
1022
|
-
}
|
|
1023
|
-
return contents;
|
|
1024
|
-
};
|
|
1025
|
-
|
|
1026
|
-
const deserializeAws_restJson1InternalFailureExceptionResponse = async (
|
|
1027
|
-
parsedOutput: any,
|
|
1028
|
-
context: __SerdeContext
|
|
1029
|
-
): Promise<InternalFailureException> => {
|
|
1030
|
-
const contents: InternalFailureException = {
|
|
1031
|
-
name: "InternalFailureException",
|
|
1032
|
-
$fault: "server",
|
|
1033
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1034
|
-
message: undefined,
|
|
1035
|
-
};
|
|
1036
|
-
const data: any = parsedOutput.body;
|
|
1037
|
-
if (data.message !== undefined && data.message !== null) {
|
|
1038
|
-
contents.message = __expectString(data.message);
|
|
1039
|
-
}
|
|
1040
|
-
return contents;
|
|
1041
|
-
};
|
|
1042
|
-
|
|
1043
|
-
const deserializeAws_restJson1InvalidRequestExceptionResponse = async (
|
|
1044
|
-
parsedOutput: any,
|
|
1045
|
-
context: __SerdeContext
|
|
1046
|
-
): Promise<InvalidRequestException> => {
|
|
1047
|
-
const contents: InvalidRequestException = {
|
|
1048
|
-
name: "InvalidRequestException",
|
|
1049
|
-
$fault: "client",
|
|
1050
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1051
|
-
message: undefined,
|
|
1052
|
-
};
|
|
1053
|
-
const data: any = parsedOutput.body;
|
|
1054
|
-
if (data.message !== undefined && data.message !== null) {
|
|
1055
|
-
contents.message = __expectString(data.message);
|
|
1056
|
-
}
|
|
1057
|
-
return contents;
|
|
1058
|
-
};
|
|
1059
|
-
|
|
1060
|
-
const deserializeAws_restJson1MethodNotAllowedExceptionResponse = async (
|
|
1061
|
-
parsedOutput: any,
|
|
1062
|
-
context: __SerdeContext
|
|
1063
|
-
): Promise<MethodNotAllowedException> => {
|
|
1064
|
-
const contents: MethodNotAllowedException = {
|
|
1065
|
-
name: "MethodNotAllowedException",
|
|
1066
|
-
$fault: "client",
|
|
1067
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1068
|
-
message: undefined,
|
|
1069
|
-
};
|
|
1070
|
-
const data: any = parsedOutput.body;
|
|
1071
|
-
if (data.message !== undefined && data.message !== null) {
|
|
1072
|
-
contents.message = __expectString(data.message);
|
|
1073
|
-
}
|
|
1074
|
-
return contents;
|
|
1075
|
-
};
|
|
1076
|
-
|
|
1077
|
-
const deserializeAws_restJson1RequestEntityTooLargeExceptionResponse = async (
|
|
1078
|
-
parsedOutput: any,
|
|
1079
|
-
context: __SerdeContext
|
|
1080
|
-
): Promise<RequestEntityTooLargeException> => {
|
|
1081
|
-
const contents: RequestEntityTooLargeException = {
|
|
1082
|
-
name: "RequestEntityTooLargeException",
|
|
1083
|
-
$fault: "client",
|
|
1084
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1085
|
-
message: undefined,
|
|
1086
|
-
};
|
|
1087
|
-
const data: any = parsedOutput.body;
|
|
1088
|
-
if (data.message !== undefined && data.message !== null) {
|
|
1089
|
-
contents.message = __expectString(data.message);
|
|
1090
|
-
}
|
|
1091
|
-
return contents;
|
|
1092
|
-
};
|
|
1093
|
-
|
|
1094
|
-
const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (
|
|
1095
|
-
parsedOutput: any,
|
|
1096
|
-
context: __SerdeContext
|
|
1097
|
-
): Promise<ResourceNotFoundException> => {
|
|
1098
|
-
const contents: ResourceNotFoundException = {
|
|
1099
|
-
name: "ResourceNotFoundException",
|
|
1100
|
-
$fault: "client",
|
|
1101
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1102
|
-
message: undefined,
|
|
1103
|
-
};
|
|
1104
|
-
const data: any = parsedOutput.body;
|
|
1105
|
-
if (data.message !== undefined && data.message !== null) {
|
|
1106
|
-
contents.message = __expectString(data.message);
|
|
1107
|
-
}
|
|
1108
|
-
return contents;
|
|
1109
|
-
};
|
|
1110
|
-
|
|
1111
|
-
const deserializeAws_restJson1ServiceUnavailableExceptionResponse = async (
|
|
1112
|
-
parsedOutput: any,
|
|
1113
|
-
context: __SerdeContext
|
|
1114
|
-
): Promise<ServiceUnavailableException> => {
|
|
1115
|
-
const contents: ServiceUnavailableException = {
|
|
1116
|
-
name: "ServiceUnavailableException",
|
|
1117
|
-
$fault: "server",
|
|
1118
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1119
|
-
message: undefined,
|
|
1120
|
-
};
|
|
1121
|
-
const data: any = parsedOutput.body;
|
|
1122
|
-
if (data.message !== undefined && data.message !== null) {
|
|
1123
|
-
contents.message = __expectString(data.message);
|
|
1124
|
-
}
|
|
1125
|
-
return contents;
|
|
1126
|
-
};
|
|
1127
|
-
|
|
1128
|
-
const deserializeAws_restJson1ThrottlingExceptionResponse = async (
|
|
1129
|
-
parsedOutput: any,
|
|
1130
|
-
context: __SerdeContext
|
|
1131
|
-
): Promise<ThrottlingException> => {
|
|
1132
|
-
const contents: ThrottlingException = {
|
|
1133
|
-
name: "ThrottlingException",
|
|
1134
|
-
$fault: "client",
|
|
1135
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1136
|
-
message: undefined,
|
|
1137
|
-
};
|
|
1138
|
-
const data: any = parsedOutput.body;
|
|
1139
|
-
if (data.message !== undefined && data.message !== null) {
|
|
1140
|
-
contents.message = __expectString(data.message);
|
|
1141
|
-
}
|
|
1142
|
-
return contents;
|
|
1143
|
-
};
|
|
1144
|
-
|
|
1145
|
-
const deserializeAws_restJson1UnauthorizedExceptionResponse = async (
|
|
1146
|
-
parsedOutput: any,
|
|
1147
|
-
context: __SerdeContext
|
|
1148
|
-
): Promise<UnauthorizedException> => {
|
|
1149
|
-
const contents: UnauthorizedException = {
|
|
1150
|
-
name: "UnauthorizedException",
|
|
1151
|
-
$fault: "client",
|
|
1152
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1153
|
-
message: undefined,
|
|
1154
|
-
};
|
|
1155
|
-
const data: any = parsedOutput.body;
|
|
1156
|
-
if (data.message !== undefined && data.message !== null) {
|
|
1157
|
-
contents.message = __expectString(data.message);
|
|
1158
|
-
}
|
|
1159
|
-
return contents;
|
|
1160
|
-
};
|
|
1161
|
-
|
|
1162
|
-
const deserializeAws_restJson1UnsupportedDocumentEncodingExceptionResponse = async (
|
|
1163
|
-
parsedOutput: any,
|
|
1164
|
-
context: __SerdeContext
|
|
1165
|
-
): Promise<UnsupportedDocumentEncodingException> => {
|
|
1166
|
-
const contents: UnsupportedDocumentEncodingException = {
|
|
1167
|
-
name: "UnsupportedDocumentEncodingException",
|
|
1168
|
-
$fault: "client",
|
|
1169
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1170
|
-
message: undefined,
|
|
1171
|
-
};
|
|
1172
|
-
const data: any = parsedOutput.body;
|
|
1173
|
-
if (data.message !== undefined && data.message !== null) {
|
|
1174
|
-
contents.message = __expectString(data.message);
|
|
1175
|
-
}
|
|
1176
|
-
return contents;
|
|
1177
|
-
};
|
|
1178
|
-
|
|
1179
|
-
const deserializeAws_restJson1NamedShadowList = (output: any, context: __SerdeContext): string[] => {
|
|
1180
|
-
return (output || [])
|
|
1181
|
-
.filter((e: any) => e != null)
|
|
1182
|
-
.map((entry: any) => {
|
|
1183
|
-
if (entry === null) {
|
|
1184
|
-
return null as any;
|
|
1185
|
-
}
|
|
1186
|
-
return __expectString(entry) as any;
|
|
1187
|
-
});
|
|
1188
|
-
};
|
|
1189
|
-
|
|
1190
|
-
const deserializeAws_restJson1RetainedMessageList = (
|
|
1191
|
-
output: any,
|
|
1192
|
-
context: __SerdeContext
|
|
1193
|
-
): RetainedMessageSummary[] => {
|
|
1194
|
-
return (output || [])
|
|
1195
|
-
.filter((e: any) => e != null)
|
|
1196
|
-
.map((entry: any) => {
|
|
1197
|
-
if (entry === null) {
|
|
1198
|
-
return null as any;
|
|
1199
|
-
}
|
|
1200
|
-
return deserializeAws_restJson1RetainedMessageSummary(entry, context);
|
|
1201
|
-
});
|
|
1202
|
-
};
|
|
1203
|
-
|
|
1204
|
-
const deserializeAws_restJson1RetainedMessageSummary = (
|
|
1205
|
-
output: any,
|
|
1206
|
-
context: __SerdeContext
|
|
1207
|
-
): RetainedMessageSummary => {
|
|
1208
|
-
return {
|
|
1209
|
-
lastModifiedTime: __expectLong(output.lastModifiedTime),
|
|
1210
|
-
payloadSize: __expectLong(output.payloadSize),
|
|
1211
|
-
qos: __expectInt32(output.qos),
|
|
1212
|
-
topic: __expectString(output.topic),
|
|
1213
|
-
} as any;
|
|
1214
|
-
};
|
|
1215
|
-
|
|
1216
|
-
const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
|
|
1217
|
-
httpStatusCode: output.statusCode,
|
|
1218
|
-
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
|
|
1219
|
-
extendedRequestId: output.headers["x-amz-id-2"],
|
|
1220
|
-
cfId: output.headers["x-amz-cf-id"],
|
|
1221
|
-
});
|
|
1222
|
-
|
|
1223
|
-
// Collect low-level response body stream to Uint8Array.
|
|
1224
|
-
const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
|
|
1225
|
-
if (streamBody instanceof Uint8Array) {
|
|
1226
|
-
return Promise.resolve(streamBody);
|
|
1227
|
-
}
|
|
1228
|
-
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
1229
|
-
};
|
|
1230
|
-
|
|
1231
|
-
// Encode Uint8Array data into string with utf-8.
|
|
1232
|
-
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
|
|
1233
|
-
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
1234
|
-
|
|
1235
|
-
const isSerializableHeaderValue = (value: any): boolean =>
|
|
1236
|
-
value !== undefined &&
|
|
1237
|
-
value !== null &&
|
|
1238
|
-
value !== "" &&
|
|
1239
|
-
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
1240
|
-
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
1241
|
-
|
|
1242
|
-
const parseBody = (streamBody: any, context: __SerdeContext): any =>
|
|
1243
|
-
collectBodyString(streamBody, context).then((encoded) => {
|
|
1244
|
-
if (encoded.length) {
|
|
1245
|
-
return JSON.parse(encoded);
|
|
1246
|
-
}
|
|
1247
|
-
return {};
|
|
1248
|
-
});
|
|
1249
|
-
|
|
1250
|
-
/**
|
|
1251
|
-
* Load an error code for the aws.rest-json-1.1 protocol.
|
|
1252
|
-
*/
|
|
1253
|
-
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => {
|
|
1254
|
-
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
1255
|
-
|
|
1256
|
-
const sanitizeErrorCode = (rawValue: string): string => {
|
|
1257
|
-
let cleanValue = rawValue;
|
|
1258
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
1259
|
-
cleanValue = cleanValue.split(":")[0];
|
|
1260
|
-
}
|
|
1261
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
1262
|
-
cleanValue = cleanValue.split("#")[1];
|
|
1263
|
-
}
|
|
1264
|
-
return cleanValue;
|
|
1265
|
-
};
|
|
1266
|
-
|
|
1267
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
1268
|
-
if (headerKey !== undefined) {
|
|
1269
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
1270
|
-
}
|
|
1271
|
-
|
|
1272
|
-
if (data.code !== undefined) {
|
|
1273
|
-
return sanitizeErrorCode(data.code);
|
|
1274
|
-
}
|
|
1275
|
-
|
|
1276
|
-
if (data["__type"] !== undefined) {
|
|
1277
|
-
return sanitizeErrorCode(data["__type"]);
|
|
1278
|
-
}
|
|
1279
|
-
|
|
1280
|
-
return "";
|
|
1281
|
-
};
|