@aws-sdk/client-iot-data-plane 3.181.0 → 3.183.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 +8 -0
- package/dist-es/IoTDataPlane.js +30 -37
- package/dist-es/IoTDataPlaneClient.js +22 -28
- package/dist-es/commands/DeleteThingShadowCommand.js +21 -28
- package/dist-es/commands/GetRetainedMessageCommand.js +21 -28
- package/dist-es/commands/GetThingShadowCommand.js +21 -28
- package/dist-es/commands/ListNamedShadowsForThingCommand.js +21 -28
- package/dist-es/commands/ListRetainedMessagesCommand.js +21 -28
- package/dist-es/commands/PublishCommand.js +22 -29
- package/dist-es/commands/UpdateThingShadowCommand.js +21 -28
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/IoTDataPlaneServiceException.js +5 -10
- package/dist-es/models/models_0.js +152 -125
- package/dist-es/pagination/ListRetainedMessagesPaginator.js +25 -68
- package/dist-es/protocols/Aws_restJson1.js +652 -908
- package/dist-es/runtimeConfig.browser.js +26 -12
- package/dist-es/runtimeConfig.js +30 -12
- package/dist-es/runtimeConfig.native.js +8 -5
- package/dist-es/runtimeConfig.shared.js +8 -11
- package/package.json +33 -33
|
@@ -1,885 +1,647 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator } from "tslib";
|
|
2
1
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
3
2
|
import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
4
3
|
import { IoTDataPlaneServiceException as __BaseException } from "../models/IoTDataPlaneServiceException";
|
|
5
4
|
import { ConflictException, InternalFailureException, InvalidRequestException, MethodNotAllowedException, RequestEntityTooLargeException, ResourceNotFoundException, ServiceUnavailableException, ThrottlingException, UnauthorizedException, UnsupportedDocumentEncodingException, } from "../models/models_0";
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
headers: headers,
|
|
25
|
-
path: resolvedPath,
|
|
26
|
-
query: query,
|
|
27
|
-
body: body,
|
|
28
|
-
})];
|
|
29
|
-
}
|
|
5
|
+
export const serializeAws_restJson1DeleteThingShadowCommand = async (input, context) => {
|
|
6
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
7
|
+
const headers = {};
|
|
8
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/things/{thingName}/shadow";
|
|
9
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "thingName", () => input.thingName, "{thingName}", false);
|
|
10
|
+
const query = map({
|
|
11
|
+
name: [, input.shadowName],
|
|
12
|
+
});
|
|
13
|
+
let body;
|
|
14
|
+
return new __HttpRequest({
|
|
15
|
+
protocol,
|
|
16
|
+
hostname,
|
|
17
|
+
port,
|
|
18
|
+
method: "DELETE",
|
|
19
|
+
headers,
|
|
20
|
+
path: resolvedPath,
|
|
21
|
+
query,
|
|
22
|
+
body,
|
|
30
23
|
});
|
|
31
|
-
}
|
|
32
|
-
export
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
method: "GET",
|
|
47
|
-
headers: headers,
|
|
48
|
-
path: resolvedPath,
|
|
49
|
-
body: body,
|
|
50
|
-
})];
|
|
51
|
-
}
|
|
24
|
+
};
|
|
25
|
+
export const serializeAws_restJson1GetRetainedMessageCommand = async (input, context) => {
|
|
26
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
27
|
+
const headers = {};
|
|
28
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/retainedMessage/{topic}";
|
|
29
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "topic", () => input.topic, "{topic}", false);
|
|
30
|
+
let body;
|
|
31
|
+
return new __HttpRequest({
|
|
32
|
+
protocol,
|
|
33
|
+
hostname,
|
|
34
|
+
port,
|
|
35
|
+
method: "GET",
|
|
36
|
+
headers,
|
|
37
|
+
path: resolvedPath,
|
|
38
|
+
body,
|
|
52
39
|
});
|
|
53
|
-
}
|
|
54
|
-
export
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
headers: headers,
|
|
73
|
-
path: resolvedPath,
|
|
74
|
-
query: query,
|
|
75
|
-
body: body,
|
|
76
|
-
})];
|
|
77
|
-
}
|
|
40
|
+
};
|
|
41
|
+
export const serializeAws_restJson1GetThingShadowCommand = async (input, context) => {
|
|
42
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
43
|
+
const headers = {};
|
|
44
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/things/{thingName}/shadow";
|
|
45
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "thingName", () => input.thingName, "{thingName}", false);
|
|
46
|
+
const query = map({
|
|
47
|
+
name: [, input.shadowName],
|
|
48
|
+
});
|
|
49
|
+
let body;
|
|
50
|
+
return new __HttpRequest({
|
|
51
|
+
protocol,
|
|
52
|
+
hostname,
|
|
53
|
+
port,
|
|
54
|
+
method: "GET",
|
|
55
|
+
headers,
|
|
56
|
+
path: resolvedPath,
|
|
57
|
+
query,
|
|
58
|
+
body,
|
|
78
59
|
});
|
|
79
|
-
}
|
|
80
|
-
export
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
headers: headers,
|
|
101
|
-
path: resolvedPath,
|
|
102
|
-
query: query,
|
|
103
|
-
body: body,
|
|
104
|
-
})];
|
|
105
|
-
}
|
|
60
|
+
};
|
|
61
|
+
export const serializeAws_restJson1ListNamedShadowsForThingCommand = async (input, context) => {
|
|
62
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
63
|
+
const headers = {};
|
|
64
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
65
|
+
"/api/things/shadow/ListNamedShadowsForThing/{thingName}";
|
|
66
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "thingName", () => input.thingName, "{thingName}", false);
|
|
67
|
+
const query = map({
|
|
68
|
+
nextToken: [, input.nextToken],
|
|
69
|
+
pageSize: [() => input.pageSize !== void 0, () => input.pageSize.toString()],
|
|
70
|
+
});
|
|
71
|
+
let body;
|
|
72
|
+
return new __HttpRequest({
|
|
73
|
+
protocol,
|
|
74
|
+
hostname,
|
|
75
|
+
port,
|
|
76
|
+
method: "GET",
|
|
77
|
+
headers,
|
|
78
|
+
path: resolvedPath,
|
|
79
|
+
query,
|
|
80
|
+
body,
|
|
106
81
|
});
|
|
107
|
-
}
|
|
108
|
-
export
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
headers: headers,
|
|
127
|
-
path: resolvedPath,
|
|
128
|
-
query: query,
|
|
129
|
-
body: body,
|
|
130
|
-
})];
|
|
131
|
-
}
|
|
82
|
+
};
|
|
83
|
+
export const serializeAws_restJson1ListRetainedMessagesCommand = async (input, context) => {
|
|
84
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
85
|
+
const headers = {};
|
|
86
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/retainedMessage";
|
|
87
|
+
const query = map({
|
|
88
|
+
nextToken: [, input.nextToken],
|
|
89
|
+
maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
|
|
90
|
+
});
|
|
91
|
+
let body;
|
|
92
|
+
return new __HttpRequest({
|
|
93
|
+
protocol,
|
|
94
|
+
hostname,
|
|
95
|
+
port,
|
|
96
|
+
method: "GET",
|
|
97
|
+
headers,
|
|
98
|
+
path: resolvedPath,
|
|
99
|
+
query,
|
|
100
|
+
body,
|
|
132
101
|
});
|
|
133
|
-
}
|
|
134
|
-
export
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
headers: headers,
|
|
159
|
-
path: resolvedPath,
|
|
160
|
-
query: query,
|
|
161
|
-
body: body,
|
|
162
|
-
})];
|
|
163
|
-
}
|
|
102
|
+
};
|
|
103
|
+
export const serializeAws_restJson1PublishCommand = async (input, context) => {
|
|
104
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
105
|
+
const headers = {
|
|
106
|
+
"content-type": "application/octet-stream",
|
|
107
|
+
};
|
|
108
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/topics/{topic}";
|
|
109
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "topic", () => input.topic, "{topic}", false);
|
|
110
|
+
const query = map({
|
|
111
|
+
qos: [() => input.qos !== void 0, () => input.qos.toString()],
|
|
112
|
+
retain: [() => input.retain !== void 0, () => input.retain.toString()],
|
|
113
|
+
});
|
|
114
|
+
let body;
|
|
115
|
+
if (input.payload !== undefined) {
|
|
116
|
+
body = input.payload;
|
|
117
|
+
}
|
|
118
|
+
return new __HttpRequest({
|
|
119
|
+
protocol,
|
|
120
|
+
hostname,
|
|
121
|
+
port,
|
|
122
|
+
method: "POST",
|
|
123
|
+
headers,
|
|
124
|
+
path: resolvedPath,
|
|
125
|
+
query,
|
|
126
|
+
body,
|
|
164
127
|
});
|
|
165
|
-
}
|
|
166
|
-
export
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
headers: headers,
|
|
190
|
-
path: resolvedPath,
|
|
191
|
-
query: query,
|
|
192
|
-
body: body,
|
|
193
|
-
})];
|
|
194
|
-
}
|
|
128
|
+
};
|
|
129
|
+
export const serializeAws_restJson1UpdateThingShadowCommand = async (input, context) => {
|
|
130
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
131
|
+
const headers = {
|
|
132
|
+
"content-type": "application/octet-stream",
|
|
133
|
+
};
|
|
134
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/things/{thingName}/shadow";
|
|
135
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "thingName", () => input.thingName, "{thingName}", false);
|
|
136
|
+
const query = map({
|
|
137
|
+
name: [, input.shadowName],
|
|
138
|
+
});
|
|
139
|
+
let body;
|
|
140
|
+
if (input.payload !== undefined) {
|
|
141
|
+
body = input.payload;
|
|
142
|
+
}
|
|
143
|
+
return new __HttpRequest({
|
|
144
|
+
protocol,
|
|
145
|
+
hostname,
|
|
146
|
+
port,
|
|
147
|
+
method: "POST",
|
|
148
|
+
headers,
|
|
149
|
+
path: resolvedPath,
|
|
150
|
+
query,
|
|
151
|
+
body,
|
|
195
152
|
});
|
|
196
|
-
}
|
|
197
|
-
export
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
return [2, deserializeAws_restJson1DeleteThingShadowCommandError(output, context)];
|
|
204
|
-
}
|
|
205
|
-
contents = map({
|
|
206
|
-
$metadata: deserializeMetadata(output),
|
|
207
|
-
});
|
|
208
|
-
return [4, collectBody(output.body, context)];
|
|
209
|
-
case 1:
|
|
210
|
-
data = _a.sent();
|
|
211
|
-
contents.payload = data;
|
|
212
|
-
return [2, contents];
|
|
213
|
-
}
|
|
153
|
+
};
|
|
154
|
+
export const deserializeAws_restJson1DeleteThingShadowCommand = async (output, context) => {
|
|
155
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
156
|
+
return deserializeAws_restJson1DeleteThingShadowCommandError(output, context);
|
|
157
|
+
}
|
|
158
|
+
const contents = map({
|
|
159
|
+
$metadata: deserializeMetadata(output),
|
|
214
160
|
});
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
throwDefaultError({
|
|
267
|
-
output: output,
|
|
268
|
-
parsedBody: parsedBody,
|
|
269
|
-
exceptionCtor: __BaseException,
|
|
270
|
-
errorCode: errorCode,
|
|
271
|
-
});
|
|
272
|
-
_d.label = 19;
|
|
273
|
-
case 19: return [2];
|
|
274
|
-
}
|
|
161
|
+
const data = await collectBody(output.body, context);
|
|
162
|
+
contents.payload = data;
|
|
163
|
+
return contents;
|
|
164
|
+
};
|
|
165
|
+
const deserializeAws_restJson1DeleteThingShadowCommandError = async (output, context) => {
|
|
166
|
+
const parsedOutput = {
|
|
167
|
+
...output,
|
|
168
|
+
body: await parseErrorBody(output.body, context),
|
|
169
|
+
};
|
|
170
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
171
|
+
switch (errorCode) {
|
|
172
|
+
case "InternalFailureException":
|
|
173
|
+
case "com.amazonaws.iotdataplane#InternalFailureException":
|
|
174
|
+
throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
|
|
175
|
+
case "InvalidRequestException":
|
|
176
|
+
case "com.amazonaws.iotdataplane#InvalidRequestException":
|
|
177
|
+
throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
|
|
178
|
+
case "MethodNotAllowedException":
|
|
179
|
+
case "com.amazonaws.iotdataplane#MethodNotAllowedException":
|
|
180
|
+
throw await deserializeAws_restJson1MethodNotAllowedExceptionResponse(parsedOutput, context);
|
|
181
|
+
case "ResourceNotFoundException":
|
|
182
|
+
case "com.amazonaws.iotdataplane#ResourceNotFoundException":
|
|
183
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
184
|
+
case "ServiceUnavailableException":
|
|
185
|
+
case "com.amazonaws.iotdataplane#ServiceUnavailableException":
|
|
186
|
+
throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
|
|
187
|
+
case "ThrottlingException":
|
|
188
|
+
case "com.amazonaws.iotdataplane#ThrottlingException":
|
|
189
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
190
|
+
case "UnauthorizedException":
|
|
191
|
+
case "com.amazonaws.iotdataplane#UnauthorizedException":
|
|
192
|
+
throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
|
|
193
|
+
case "UnsupportedDocumentEncodingException":
|
|
194
|
+
case "com.amazonaws.iotdataplane#UnsupportedDocumentEncodingException":
|
|
195
|
+
throw await deserializeAws_restJson1UnsupportedDocumentEncodingExceptionResponse(parsedOutput, context);
|
|
196
|
+
default:
|
|
197
|
+
const parsedBody = parsedOutput.body;
|
|
198
|
+
throwDefaultError({
|
|
199
|
+
output,
|
|
200
|
+
parsedBody,
|
|
201
|
+
exceptionCtor: __BaseException,
|
|
202
|
+
errorCode,
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
export const deserializeAws_restJson1GetRetainedMessageCommand = async (output, context) => {
|
|
207
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
208
|
+
return deserializeAws_restJson1GetRetainedMessageCommandError(output, context);
|
|
209
|
+
}
|
|
210
|
+
const contents = map({
|
|
211
|
+
$metadata: deserializeMetadata(output),
|
|
275
212
|
});
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
213
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
214
|
+
if (data.lastModifiedTime != null) {
|
|
215
|
+
contents.lastModifiedTime = __expectLong(data.lastModifiedTime);
|
|
216
|
+
}
|
|
217
|
+
if (data.payload != null) {
|
|
218
|
+
contents.payload = context.base64Decoder(data.payload);
|
|
219
|
+
}
|
|
220
|
+
if (data.qos != null) {
|
|
221
|
+
contents.qos = __expectInt32(data.qos);
|
|
222
|
+
}
|
|
223
|
+
if (data.topic != null) {
|
|
224
|
+
contents.topic = __expectString(data.topic);
|
|
225
|
+
}
|
|
226
|
+
return contents;
|
|
227
|
+
};
|
|
228
|
+
const deserializeAws_restJson1GetRetainedMessageCommandError = async (output, context) => {
|
|
229
|
+
const parsedOutput = {
|
|
230
|
+
...output,
|
|
231
|
+
body: await parseErrorBody(output.body, context),
|
|
232
|
+
};
|
|
233
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
234
|
+
switch (errorCode) {
|
|
235
|
+
case "InternalFailureException":
|
|
236
|
+
case "com.amazonaws.iotdataplane#InternalFailureException":
|
|
237
|
+
throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
|
|
238
|
+
case "InvalidRequestException":
|
|
239
|
+
case "com.amazonaws.iotdataplane#InvalidRequestException":
|
|
240
|
+
throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
|
|
241
|
+
case "MethodNotAllowedException":
|
|
242
|
+
case "com.amazonaws.iotdataplane#MethodNotAllowedException":
|
|
243
|
+
throw await deserializeAws_restJson1MethodNotAllowedExceptionResponse(parsedOutput, context);
|
|
244
|
+
case "ResourceNotFoundException":
|
|
245
|
+
case "com.amazonaws.iotdataplane#ResourceNotFoundException":
|
|
246
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
247
|
+
case "ServiceUnavailableException":
|
|
248
|
+
case "com.amazonaws.iotdataplane#ServiceUnavailableException":
|
|
249
|
+
throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
|
|
250
|
+
case "ThrottlingException":
|
|
251
|
+
case "com.amazonaws.iotdataplane#ThrottlingException":
|
|
252
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
253
|
+
case "UnauthorizedException":
|
|
254
|
+
case "com.amazonaws.iotdataplane#UnauthorizedException":
|
|
255
|
+
throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
|
|
256
|
+
default:
|
|
257
|
+
const parsedBody = parsedOutput.body;
|
|
258
|
+
throwDefaultError({
|
|
259
|
+
output,
|
|
260
|
+
parsedBody,
|
|
261
|
+
exceptionCtor: __BaseException,
|
|
262
|
+
errorCode,
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
export const deserializeAws_restJson1GetThingShadowCommand = async (output, context) => {
|
|
267
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
268
|
+
return deserializeAws_restJson1GetThingShadowCommandError(output, context);
|
|
269
|
+
}
|
|
270
|
+
const contents = map({
|
|
271
|
+
$metadata: deserializeMetadata(output),
|
|
307
272
|
});
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
errorCode: errorCode,
|
|
360
|
-
});
|
|
361
|
-
_d.label = 17;
|
|
362
|
-
case 17: return [2];
|
|
363
|
-
}
|
|
273
|
+
const data = await collectBody(output.body, context);
|
|
274
|
+
contents.payload = data;
|
|
275
|
+
return contents;
|
|
276
|
+
};
|
|
277
|
+
const deserializeAws_restJson1GetThingShadowCommandError = async (output, context) => {
|
|
278
|
+
const parsedOutput = {
|
|
279
|
+
...output,
|
|
280
|
+
body: await parseErrorBody(output.body, context),
|
|
281
|
+
};
|
|
282
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
283
|
+
switch (errorCode) {
|
|
284
|
+
case "InternalFailureException":
|
|
285
|
+
case "com.amazonaws.iotdataplane#InternalFailureException":
|
|
286
|
+
throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
|
|
287
|
+
case "InvalidRequestException":
|
|
288
|
+
case "com.amazonaws.iotdataplane#InvalidRequestException":
|
|
289
|
+
throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
|
|
290
|
+
case "MethodNotAllowedException":
|
|
291
|
+
case "com.amazonaws.iotdataplane#MethodNotAllowedException":
|
|
292
|
+
throw await deserializeAws_restJson1MethodNotAllowedExceptionResponse(parsedOutput, context);
|
|
293
|
+
case "ResourceNotFoundException":
|
|
294
|
+
case "com.amazonaws.iotdataplane#ResourceNotFoundException":
|
|
295
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
296
|
+
case "ServiceUnavailableException":
|
|
297
|
+
case "com.amazonaws.iotdataplane#ServiceUnavailableException":
|
|
298
|
+
throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
|
|
299
|
+
case "ThrottlingException":
|
|
300
|
+
case "com.amazonaws.iotdataplane#ThrottlingException":
|
|
301
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
302
|
+
case "UnauthorizedException":
|
|
303
|
+
case "com.amazonaws.iotdataplane#UnauthorizedException":
|
|
304
|
+
throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
|
|
305
|
+
case "UnsupportedDocumentEncodingException":
|
|
306
|
+
case "com.amazonaws.iotdataplane#UnsupportedDocumentEncodingException":
|
|
307
|
+
throw await deserializeAws_restJson1UnsupportedDocumentEncodingExceptionResponse(parsedOutput, context);
|
|
308
|
+
default:
|
|
309
|
+
const parsedBody = parsedOutput.body;
|
|
310
|
+
throwDefaultError({
|
|
311
|
+
output,
|
|
312
|
+
parsedBody,
|
|
313
|
+
exceptionCtor: __BaseException,
|
|
314
|
+
errorCode,
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
export const deserializeAws_restJson1ListNamedShadowsForThingCommand = async (output, context) => {
|
|
319
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
320
|
+
return deserializeAws_restJson1ListNamedShadowsForThingCommandError(output, context);
|
|
321
|
+
}
|
|
322
|
+
const contents = map({
|
|
323
|
+
$metadata: deserializeMetadata(output),
|
|
364
324
|
});
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
325
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
326
|
+
if (data.nextToken != null) {
|
|
327
|
+
contents.nextToken = __expectString(data.nextToken);
|
|
328
|
+
}
|
|
329
|
+
if (data.results != null) {
|
|
330
|
+
contents.results = deserializeAws_restJson1NamedShadowList(data.results, context);
|
|
331
|
+
}
|
|
332
|
+
if (data.timestamp != null) {
|
|
333
|
+
contents.timestamp = __expectLong(data.timestamp);
|
|
334
|
+
}
|
|
335
|
+
return contents;
|
|
336
|
+
};
|
|
337
|
+
const deserializeAws_restJson1ListNamedShadowsForThingCommandError = async (output, context) => {
|
|
338
|
+
const parsedOutput = {
|
|
339
|
+
...output,
|
|
340
|
+
body: await parseErrorBody(output.body, context),
|
|
341
|
+
};
|
|
342
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
343
|
+
switch (errorCode) {
|
|
344
|
+
case "InternalFailureException":
|
|
345
|
+
case "com.amazonaws.iotdataplane#InternalFailureException":
|
|
346
|
+
throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
|
|
347
|
+
case "InvalidRequestException":
|
|
348
|
+
case "com.amazonaws.iotdataplane#InvalidRequestException":
|
|
349
|
+
throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
|
|
350
|
+
case "MethodNotAllowedException":
|
|
351
|
+
case "com.amazonaws.iotdataplane#MethodNotAllowedException":
|
|
352
|
+
throw await deserializeAws_restJson1MethodNotAllowedExceptionResponse(parsedOutput, context);
|
|
353
|
+
case "ResourceNotFoundException":
|
|
354
|
+
case "com.amazonaws.iotdataplane#ResourceNotFoundException":
|
|
355
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
356
|
+
case "ServiceUnavailableException":
|
|
357
|
+
case "com.amazonaws.iotdataplane#ServiceUnavailableException":
|
|
358
|
+
throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
|
|
359
|
+
case "ThrottlingException":
|
|
360
|
+
case "com.amazonaws.iotdataplane#ThrottlingException":
|
|
361
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
362
|
+
case "UnauthorizedException":
|
|
363
|
+
case "com.amazonaws.iotdataplane#UnauthorizedException":
|
|
364
|
+
throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
|
|
365
|
+
default:
|
|
366
|
+
const parsedBody = parsedOutput.body;
|
|
367
|
+
throwDefaultError({
|
|
368
|
+
output,
|
|
369
|
+
parsedBody,
|
|
370
|
+
exceptionCtor: __BaseException,
|
|
371
|
+
errorCode,
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
};
|
|
375
|
+
export const deserializeAws_restJson1ListRetainedMessagesCommand = async (output, context) => {
|
|
376
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
377
|
+
return deserializeAws_restJson1ListRetainedMessagesCommandError(output, context);
|
|
378
|
+
}
|
|
379
|
+
const contents = map({
|
|
380
|
+
$metadata: deserializeMetadata(output),
|
|
383
381
|
});
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
parsedBody = parsedOutput.body;
|
|
435
|
-
throwDefaultError({
|
|
436
|
-
output: output,
|
|
437
|
-
parsedBody: parsedBody,
|
|
438
|
-
exceptionCtor: __BaseException,
|
|
439
|
-
errorCode: errorCode,
|
|
440
|
-
});
|
|
441
|
-
_d.label = 19;
|
|
442
|
-
case 19: return [2];
|
|
443
|
-
}
|
|
382
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
383
|
+
if (data.nextToken != null) {
|
|
384
|
+
contents.nextToken = __expectString(data.nextToken);
|
|
385
|
+
}
|
|
386
|
+
if (data.retainedTopics != null) {
|
|
387
|
+
contents.retainedTopics = deserializeAws_restJson1RetainedMessageList(data.retainedTopics, context);
|
|
388
|
+
}
|
|
389
|
+
return contents;
|
|
390
|
+
};
|
|
391
|
+
const deserializeAws_restJson1ListRetainedMessagesCommandError = async (output, context) => {
|
|
392
|
+
const parsedOutput = {
|
|
393
|
+
...output,
|
|
394
|
+
body: await parseErrorBody(output.body, context),
|
|
395
|
+
};
|
|
396
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
397
|
+
switch (errorCode) {
|
|
398
|
+
case "InternalFailureException":
|
|
399
|
+
case "com.amazonaws.iotdataplane#InternalFailureException":
|
|
400
|
+
throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
|
|
401
|
+
case "InvalidRequestException":
|
|
402
|
+
case "com.amazonaws.iotdataplane#InvalidRequestException":
|
|
403
|
+
throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
|
|
404
|
+
case "MethodNotAllowedException":
|
|
405
|
+
case "com.amazonaws.iotdataplane#MethodNotAllowedException":
|
|
406
|
+
throw await deserializeAws_restJson1MethodNotAllowedExceptionResponse(parsedOutput, context);
|
|
407
|
+
case "ServiceUnavailableException":
|
|
408
|
+
case "com.amazonaws.iotdataplane#ServiceUnavailableException":
|
|
409
|
+
throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
|
|
410
|
+
case "ThrottlingException":
|
|
411
|
+
case "com.amazonaws.iotdataplane#ThrottlingException":
|
|
412
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
413
|
+
case "UnauthorizedException":
|
|
414
|
+
case "com.amazonaws.iotdataplane#UnauthorizedException":
|
|
415
|
+
throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
|
|
416
|
+
default:
|
|
417
|
+
const parsedBody = parsedOutput.body;
|
|
418
|
+
throwDefaultError({
|
|
419
|
+
output,
|
|
420
|
+
parsedBody,
|
|
421
|
+
exceptionCtor: __BaseException,
|
|
422
|
+
errorCode,
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
};
|
|
426
|
+
export const deserializeAws_restJson1PublishCommand = async (output, context) => {
|
|
427
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
428
|
+
return deserializeAws_restJson1PublishCommandError(output, context);
|
|
429
|
+
}
|
|
430
|
+
const contents = map({
|
|
431
|
+
$metadata: deserializeMetadata(output),
|
|
444
432
|
});
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
433
|
+
await collectBody(output.body, context);
|
|
434
|
+
return contents;
|
|
435
|
+
};
|
|
436
|
+
const deserializeAws_restJson1PublishCommandError = async (output, context) => {
|
|
437
|
+
const parsedOutput = {
|
|
438
|
+
...output,
|
|
439
|
+
body: await parseErrorBody(output.body, context),
|
|
440
|
+
};
|
|
441
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
442
|
+
switch (errorCode) {
|
|
443
|
+
case "InternalFailureException":
|
|
444
|
+
case "com.amazonaws.iotdataplane#InternalFailureException":
|
|
445
|
+
throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
|
|
446
|
+
case "InvalidRequestException":
|
|
447
|
+
case "com.amazonaws.iotdataplane#InvalidRequestException":
|
|
448
|
+
throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
|
|
449
|
+
case "MethodNotAllowedException":
|
|
450
|
+
case "com.amazonaws.iotdataplane#MethodNotAllowedException":
|
|
451
|
+
throw await deserializeAws_restJson1MethodNotAllowedExceptionResponse(parsedOutput, context);
|
|
452
|
+
case "UnauthorizedException":
|
|
453
|
+
case "com.amazonaws.iotdataplane#UnauthorizedException":
|
|
454
|
+
throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
|
|
455
|
+
default:
|
|
456
|
+
const parsedBody = parsedOutput.body;
|
|
457
|
+
throwDefaultError({
|
|
458
|
+
output,
|
|
459
|
+
parsedBody,
|
|
460
|
+
exceptionCtor: __BaseException,
|
|
461
|
+
errorCode,
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
};
|
|
465
|
+
export const deserializeAws_restJson1UpdateThingShadowCommand = async (output, context) => {
|
|
466
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
467
|
+
return deserializeAws_restJson1UpdateThingShadowCommandError(output, context);
|
|
468
|
+
}
|
|
469
|
+
const contents = map({
|
|
470
|
+
$metadata: deserializeMetadata(output),
|
|
473
471
|
});
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
472
|
+
const data = await collectBody(output.body, context);
|
|
473
|
+
contents.payload = data;
|
|
474
|
+
return contents;
|
|
475
|
+
};
|
|
476
|
+
const deserializeAws_restJson1UpdateThingShadowCommandError = async (output, context) => {
|
|
477
|
+
const parsedOutput = {
|
|
478
|
+
...output,
|
|
479
|
+
body: await parseErrorBody(output.body, context),
|
|
480
|
+
};
|
|
481
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
482
|
+
switch (errorCode) {
|
|
483
|
+
case "ConflictException":
|
|
484
|
+
case "com.amazonaws.iotdataplane#ConflictException":
|
|
485
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
486
|
+
case "InternalFailureException":
|
|
487
|
+
case "com.amazonaws.iotdataplane#InternalFailureException":
|
|
488
|
+
throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
|
|
489
|
+
case "InvalidRequestException":
|
|
490
|
+
case "com.amazonaws.iotdataplane#InvalidRequestException":
|
|
491
|
+
throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
|
|
492
|
+
case "MethodNotAllowedException":
|
|
493
|
+
case "com.amazonaws.iotdataplane#MethodNotAllowedException":
|
|
494
|
+
throw await deserializeAws_restJson1MethodNotAllowedExceptionResponse(parsedOutput, context);
|
|
495
|
+
case "RequestEntityTooLargeException":
|
|
496
|
+
case "com.amazonaws.iotdataplane#RequestEntityTooLargeException":
|
|
497
|
+
throw await deserializeAws_restJson1RequestEntityTooLargeExceptionResponse(parsedOutput, context);
|
|
498
|
+
case "ServiceUnavailableException":
|
|
499
|
+
case "com.amazonaws.iotdataplane#ServiceUnavailableException":
|
|
500
|
+
throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
|
|
501
|
+
case "ThrottlingException":
|
|
502
|
+
case "com.amazonaws.iotdataplane#ThrottlingException":
|
|
503
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
504
|
+
case "UnauthorizedException":
|
|
505
|
+
case "com.amazonaws.iotdataplane#UnauthorizedException":
|
|
506
|
+
throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
|
|
507
|
+
case "UnsupportedDocumentEncodingException":
|
|
508
|
+
case "com.amazonaws.iotdataplane#UnsupportedDocumentEncodingException":
|
|
509
|
+
throw await deserializeAws_restJson1UnsupportedDocumentEncodingExceptionResponse(parsedOutput, context);
|
|
510
|
+
default:
|
|
511
|
+
const parsedBody = parsedOutput.body;
|
|
512
|
+
throwDefaultError({
|
|
513
|
+
output,
|
|
514
|
+
parsedBody,
|
|
515
|
+
exceptionCtor: __BaseException,
|
|
516
|
+
errorCode,
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
};
|
|
520
|
+
const map = __map;
|
|
521
|
+
const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
|
|
522
|
+
const contents = map({});
|
|
523
|
+
const data = parsedOutput.body;
|
|
524
|
+
if (data.message != null) {
|
|
525
|
+
contents.message = __expectString(data.message);
|
|
526
|
+
}
|
|
527
|
+
const exception = new ConflictException({
|
|
528
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
529
|
+
...contents,
|
|
530
530
|
});
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
});
|
|
543
|
-
_a = __expectNonNull;
|
|
544
|
-
_b = __expectObject;
|
|
545
|
-
return [4, parseBody(output.body, context)];
|
|
546
|
-
case 1:
|
|
547
|
-
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
548
|
-
if (data.nextToken != null) {
|
|
549
|
-
contents.nextToken = __expectString(data.nextToken);
|
|
550
|
-
}
|
|
551
|
-
if (data.retainedTopics != null) {
|
|
552
|
-
contents.retainedTopics = deserializeAws_restJson1RetainedMessageList(data.retainedTopics, context);
|
|
553
|
-
}
|
|
554
|
-
return [2, contents];
|
|
555
|
-
}
|
|
531
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
532
|
+
};
|
|
533
|
+
const deserializeAws_restJson1InternalFailureExceptionResponse = async (parsedOutput, context) => {
|
|
534
|
+
const contents = map({});
|
|
535
|
+
const data = parsedOutput.body;
|
|
536
|
+
if (data.message != null) {
|
|
537
|
+
contents.message = __expectString(data.message);
|
|
538
|
+
}
|
|
539
|
+
const exception = new InternalFailureException({
|
|
540
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
541
|
+
...contents,
|
|
556
542
|
});
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
569
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
570
|
-
_b = errorCode;
|
|
571
|
-
switch (_b) {
|
|
572
|
-
case "InternalFailureException": return [3, 2];
|
|
573
|
-
case "com.amazonaws.iotdataplane#InternalFailureException": return [3, 2];
|
|
574
|
-
case "InvalidRequestException": return [3, 4];
|
|
575
|
-
case "com.amazonaws.iotdataplane#InvalidRequestException": return [3, 4];
|
|
576
|
-
case "MethodNotAllowedException": return [3, 6];
|
|
577
|
-
case "com.amazonaws.iotdataplane#MethodNotAllowedException": return [3, 6];
|
|
578
|
-
case "ServiceUnavailableException": return [3, 8];
|
|
579
|
-
case "com.amazonaws.iotdataplane#ServiceUnavailableException": return [3, 8];
|
|
580
|
-
case "ThrottlingException": return [3, 10];
|
|
581
|
-
case "com.amazonaws.iotdataplane#ThrottlingException": return [3, 10];
|
|
582
|
-
case "UnauthorizedException": return [3, 12];
|
|
583
|
-
case "com.amazonaws.iotdataplane#UnauthorizedException": return [3, 12];
|
|
584
|
-
}
|
|
585
|
-
return [3, 14];
|
|
586
|
-
case 2: return [4, deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)];
|
|
587
|
-
case 3: throw _d.sent();
|
|
588
|
-
case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
|
|
589
|
-
case 5: throw _d.sent();
|
|
590
|
-
case 6: return [4, deserializeAws_restJson1MethodNotAllowedExceptionResponse(parsedOutput, context)];
|
|
591
|
-
case 7: throw _d.sent();
|
|
592
|
-
case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
|
|
593
|
-
case 9: throw _d.sent();
|
|
594
|
-
case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
595
|
-
case 11: throw _d.sent();
|
|
596
|
-
case 12: return [4, deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)];
|
|
597
|
-
case 13: throw _d.sent();
|
|
598
|
-
case 14:
|
|
599
|
-
parsedBody = parsedOutput.body;
|
|
600
|
-
throwDefaultError({
|
|
601
|
-
output: output,
|
|
602
|
-
parsedBody: parsedBody,
|
|
603
|
-
exceptionCtor: __BaseException,
|
|
604
|
-
errorCode: errorCode,
|
|
605
|
-
});
|
|
606
|
-
_d.label = 15;
|
|
607
|
-
case 15: return [2];
|
|
608
|
-
}
|
|
543
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
544
|
+
};
|
|
545
|
+
const deserializeAws_restJson1InvalidRequestExceptionResponse = async (parsedOutput, context) => {
|
|
546
|
+
const contents = map({});
|
|
547
|
+
const data = parsedOutput.body;
|
|
548
|
+
if (data.message != null) {
|
|
549
|
+
contents.message = __expectString(data.message);
|
|
550
|
+
}
|
|
551
|
+
const exception = new InvalidRequestException({
|
|
552
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
553
|
+
...contents,
|
|
609
554
|
});
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
});
|
|
622
|
-
return [4, collectBody(output.body, context)];
|
|
623
|
-
case 1:
|
|
624
|
-
_a.sent();
|
|
625
|
-
return [2, contents];
|
|
626
|
-
}
|
|
555
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
556
|
+
};
|
|
557
|
+
const deserializeAws_restJson1MethodNotAllowedExceptionResponse = async (parsedOutput, context) => {
|
|
558
|
+
const contents = map({});
|
|
559
|
+
const data = parsedOutput.body;
|
|
560
|
+
if (data.message != null) {
|
|
561
|
+
contents.message = __expectString(data.message);
|
|
562
|
+
}
|
|
563
|
+
const exception = new MethodNotAllowedException({
|
|
564
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
565
|
+
...contents,
|
|
627
566
|
});
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
640
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
641
|
-
_b = errorCode;
|
|
642
|
-
switch (_b) {
|
|
643
|
-
case "InternalFailureException": return [3, 2];
|
|
644
|
-
case "com.amazonaws.iotdataplane#InternalFailureException": return [3, 2];
|
|
645
|
-
case "InvalidRequestException": return [3, 4];
|
|
646
|
-
case "com.amazonaws.iotdataplane#InvalidRequestException": return [3, 4];
|
|
647
|
-
case "MethodNotAllowedException": return [3, 6];
|
|
648
|
-
case "com.amazonaws.iotdataplane#MethodNotAllowedException": return [3, 6];
|
|
649
|
-
case "UnauthorizedException": return [3, 8];
|
|
650
|
-
case "com.amazonaws.iotdataplane#UnauthorizedException": return [3, 8];
|
|
651
|
-
}
|
|
652
|
-
return [3, 10];
|
|
653
|
-
case 2: return [4, deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)];
|
|
654
|
-
case 3: throw _d.sent();
|
|
655
|
-
case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
|
|
656
|
-
case 5: throw _d.sent();
|
|
657
|
-
case 6: return [4, deserializeAws_restJson1MethodNotAllowedExceptionResponse(parsedOutput, context)];
|
|
658
|
-
case 7: throw _d.sent();
|
|
659
|
-
case 8: return [4, deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)];
|
|
660
|
-
case 9: throw _d.sent();
|
|
661
|
-
case 10:
|
|
662
|
-
parsedBody = parsedOutput.body;
|
|
663
|
-
throwDefaultError({
|
|
664
|
-
output: output,
|
|
665
|
-
parsedBody: parsedBody,
|
|
666
|
-
exceptionCtor: __BaseException,
|
|
667
|
-
errorCode: errorCode,
|
|
668
|
-
});
|
|
669
|
-
_d.label = 11;
|
|
670
|
-
case 11: return [2];
|
|
671
|
-
}
|
|
567
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
568
|
+
};
|
|
569
|
+
const deserializeAws_restJson1RequestEntityTooLargeExceptionResponse = async (parsedOutput, context) => {
|
|
570
|
+
const contents = map({});
|
|
571
|
+
const data = parsedOutput.body;
|
|
572
|
+
if (data.message != null) {
|
|
573
|
+
contents.message = __expectString(data.message);
|
|
574
|
+
}
|
|
575
|
+
const exception = new RequestEntityTooLargeException({
|
|
576
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
577
|
+
...contents,
|
|
672
578
|
});
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
});
|
|
685
|
-
return [4, collectBody(output.body, context)];
|
|
686
|
-
case 1:
|
|
687
|
-
data = _a.sent();
|
|
688
|
-
contents.payload = data;
|
|
689
|
-
return [2, contents];
|
|
690
|
-
}
|
|
579
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
580
|
+
};
|
|
581
|
+
const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
|
|
582
|
+
const contents = map({});
|
|
583
|
+
const data = parsedOutput.body;
|
|
584
|
+
if (data.message != null) {
|
|
585
|
+
contents.message = __expectString(data.message);
|
|
586
|
+
}
|
|
587
|
+
const exception = new ResourceNotFoundException({
|
|
588
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
589
|
+
...contents,
|
|
691
590
|
});
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
704
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
705
|
-
_b = errorCode;
|
|
706
|
-
switch (_b) {
|
|
707
|
-
case "ConflictException": return [3, 2];
|
|
708
|
-
case "com.amazonaws.iotdataplane#ConflictException": return [3, 2];
|
|
709
|
-
case "InternalFailureException": return [3, 4];
|
|
710
|
-
case "com.amazonaws.iotdataplane#InternalFailureException": return [3, 4];
|
|
711
|
-
case "InvalidRequestException": return [3, 6];
|
|
712
|
-
case "com.amazonaws.iotdataplane#InvalidRequestException": return [3, 6];
|
|
713
|
-
case "MethodNotAllowedException": return [3, 8];
|
|
714
|
-
case "com.amazonaws.iotdataplane#MethodNotAllowedException": return [3, 8];
|
|
715
|
-
case "RequestEntityTooLargeException": return [3, 10];
|
|
716
|
-
case "com.amazonaws.iotdataplane#RequestEntityTooLargeException": return [3, 10];
|
|
717
|
-
case "ServiceUnavailableException": return [3, 12];
|
|
718
|
-
case "com.amazonaws.iotdataplane#ServiceUnavailableException": return [3, 12];
|
|
719
|
-
case "ThrottlingException": return [3, 14];
|
|
720
|
-
case "com.amazonaws.iotdataplane#ThrottlingException": return [3, 14];
|
|
721
|
-
case "UnauthorizedException": return [3, 16];
|
|
722
|
-
case "com.amazonaws.iotdataplane#UnauthorizedException": return [3, 16];
|
|
723
|
-
case "UnsupportedDocumentEncodingException": return [3, 18];
|
|
724
|
-
case "com.amazonaws.iotdataplane#UnsupportedDocumentEncodingException": return [3, 18];
|
|
725
|
-
}
|
|
726
|
-
return [3, 20];
|
|
727
|
-
case 2: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
|
|
728
|
-
case 3: throw _d.sent();
|
|
729
|
-
case 4: return [4, deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)];
|
|
730
|
-
case 5: throw _d.sent();
|
|
731
|
-
case 6: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
|
|
732
|
-
case 7: throw _d.sent();
|
|
733
|
-
case 8: return [4, deserializeAws_restJson1MethodNotAllowedExceptionResponse(parsedOutput, context)];
|
|
734
|
-
case 9: throw _d.sent();
|
|
735
|
-
case 10: return [4, deserializeAws_restJson1RequestEntityTooLargeExceptionResponse(parsedOutput, context)];
|
|
736
|
-
case 11: throw _d.sent();
|
|
737
|
-
case 12: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
|
|
738
|
-
case 13: throw _d.sent();
|
|
739
|
-
case 14: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
740
|
-
case 15: throw _d.sent();
|
|
741
|
-
case 16: return [4, deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)];
|
|
742
|
-
case 17: throw _d.sent();
|
|
743
|
-
case 18: return [4, deserializeAws_restJson1UnsupportedDocumentEncodingExceptionResponse(parsedOutput, context)];
|
|
744
|
-
case 19: throw _d.sent();
|
|
745
|
-
case 20:
|
|
746
|
-
parsedBody = parsedOutput.body;
|
|
747
|
-
throwDefaultError({
|
|
748
|
-
output: output,
|
|
749
|
-
parsedBody: parsedBody,
|
|
750
|
-
exceptionCtor: __BaseException,
|
|
751
|
-
errorCode: errorCode,
|
|
752
|
-
});
|
|
753
|
-
_d.label = 21;
|
|
754
|
-
case 21: return [2];
|
|
755
|
-
}
|
|
591
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
592
|
+
};
|
|
593
|
+
const deserializeAws_restJson1ServiceUnavailableExceptionResponse = async (parsedOutput, context) => {
|
|
594
|
+
const contents = map({});
|
|
595
|
+
const data = parsedOutput.body;
|
|
596
|
+
if (data.message != null) {
|
|
597
|
+
contents.message = __expectString(data.message);
|
|
598
|
+
}
|
|
599
|
+
const exception = new ServiceUnavailableException({
|
|
600
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
601
|
+
...contents,
|
|
756
602
|
});
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
data = parsedOutput.body;
|
|
800
|
-
if (data.message != null) {
|
|
801
|
-
contents.message = __expectString(data.message);
|
|
802
|
-
}
|
|
803
|
-
exception = new MethodNotAllowedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
804
|
-
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
805
|
-
});
|
|
806
|
-
}); };
|
|
807
|
-
var deserializeAws_restJson1RequestEntityTooLargeExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
808
|
-
var contents, data, exception;
|
|
809
|
-
return __generator(this, function (_a) {
|
|
810
|
-
contents = map({});
|
|
811
|
-
data = parsedOutput.body;
|
|
812
|
-
if (data.message != null) {
|
|
813
|
-
contents.message = __expectString(data.message);
|
|
814
|
-
}
|
|
815
|
-
exception = new RequestEntityTooLargeException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
816
|
-
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
817
|
-
});
|
|
818
|
-
}); };
|
|
819
|
-
var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
820
|
-
var contents, data, exception;
|
|
821
|
-
return __generator(this, function (_a) {
|
|
822
|
-
contents = map({});
|
|
823
|
-
data = parsedOutput.body;
|
|
824
|
-
if (data.message != null) {
|
|
825
|
-
contents.message = __expectString(data.message);
|
|
826
|
-
}
|
|
827
|
-
exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
828
|
-
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
829
|
-
});
|
|
830
|
-
}); };
|
|
831
|
-
var deserializeAws_restJson1ServiceUnavailableExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
832
|
-
var contents, data, exception;
|
|
833
|
-
return __generator(this, function (_a) {
|
|
834
|
-
contents = map({});
|
|
835
|
-
data = parsedOutput.body;
|
|
836
|
-
if (data.message != null) {
|
|
837
|
-
contents.message = __expectString(data.message);
|
|
838
|
-
}
|
|
839
|
-
exception = new ServiceUnavailableException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
840
|
-
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
841
|
-
});
|
|
842
|
-
}); };
|
|
843
|
-
var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
844
|
-
var contents, data, exception;
|
|
845
|
-
return __generator(this, function (_a) {
|
|
846
|
-
contents = map({});
|
|
847
|
-
data = parsedOutput.body;
|
|
848
|
-
if (data.message != null) {
|
|
849
|
-
contents.message = __expectString(data.message);
|
|
850
|
-
}
|
|
851
|
-
exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
852
|
-
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
853
|
-
});
|
|
854
|
-
}); };
|
|
855
|
-
var deserializeAws_restJson1UnauthorizedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
856
|
-
var contents, data, exception;
|
|
857
|
-
return __generator(this, function (_a) {
|
|
858
|
-
contents = map({});
|
|
859
|
-
data = parsedOutput.body;
|
|
860
|
-
if (data.message != null) {
|
|
861
|
-
contents.message = __expectString(data.message);
|
|
862
|
-
}
|
|
863
|
-
exception = new UnauthorizedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
864
|
-
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
865
|
-
});
|
|
866
|
-
}); };
|
|
867
|
-
var deserializeAws_restJson1UnsupportedDocumentEncodingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
868
|
-
var contents, data, exception;
|
|
869
|
-
return __generator(this, function (_a) {
|
|
870
|
-
contents = map({});
|
|
871
|
-
data = parsedOutput.body;
|
|
872
|
-
if (data.message != null) {
|
|
873
|
-
contents.message = __expectString(data.message);
|
|
874
|
-
}
|
|
875
|
-
exception = new UnsupportedDocumentEncodingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
876
|
-
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
877
|
-
});
|
|
878
|
-
}); };
|
|
879
|
-
var deserializeAws_restJson1NamedShadowList = function (output, context) {
|
|
880
|
-
var retVal = (output || [])
|
|
881
|
-
.filter(function (e) { return e != null; })
|
|
882
|
-
.map(function (entry) {
|
|
603
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
604
|
+
};
|
|
605
|
+
const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
|
|
606
|
+
const contents = map({});
|
|
607
|
+
const data = parsedOutput.body;
|
|
608
|
+
if (data.message != null) {
|
|
609
|
+
contents.message = __expectString(data.message);
|
|
610
|
+
}
|
|
611
|
+
const exception = new ThrottlingException({
|
|
612
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
613
|
+
...contents,
|
|
614
|
+
});
|
|
615
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
616
|
+
};
|
|
617
|
+
const deserializeAws_restJson1UnauthorizedExceptionResponse = async (parsedOutput, context) => {
|
|
618
|
+
const contents = map({});
|
|
619
|
+
const data = parsedOutput.body;
|
|
620
|
+
if (data.message != null) {
|
|
621
|
+
contents.message = __expectString(data.message);
|
|
622
|
+
}
|
|
623
|
+
const exception = new UnauthorizedException({
|
|
624
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
625
|
+
...contents,
|
|
626
|
+
});
|
|
627
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
628
|
+
};
|
|
629
|
+
const deserializeAws_restJson1UnsupportedDocumentEncodingExceptionResponse = async (parsedOutput, context) => {
|
|
630
|
+
const contents = map({});
|
|
631
|
+
const data = parsedOutput.body;
|
|
632
|
+
if (data.message != null) {
|
|
633
|
+
contents.message = __expectString(data.message);
|
|
634
|
+
}
|
|
635
|
+
const exception = new UnsupportedDocumentEncodingException({
|
|
636
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
637
|
+
...contents,
|
|
638
|
+
});
|
|
639
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
640
|
+
};
|
|
641
|
+
const deserializeAws_restJson1NamedShadowList = (output, context) => {
|
|
642
|
+
const retVal = (output || [])
|
|
643
|
+
.filter((e) => e != null)
|
|
644
|
+
.map((entry) => {
|
|
883
645
|
if (entry === null) {
|
|
884
646
|
return null;
|
|
885
647
|
}
|
|
@@ -887,10 +649,10 @@ var deserializeAws_restJson1NamedShadowList = function (output, context) {
|
|
|
887
649
|
});
|
|
888
650
|
return retVal;
|
|
889
651
|
};
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
.filter(
|
|
893
|
-
.map(
|
|
652
|
+
const deserializeAws_restJson1RetainedMessageList = (output, context) => {
|
|
653
|
+
const retVal = (output || [])
|
|
654
|
+
.filter((e) => e != null)
|
|
655
|
+
.map((entry) => {
|
|
894
656
|
if (entry === null) {
|
|
895
657
|
return null;
|
|
896
658
|
}
|
|
@@ -898,7 +660,7 @@ var deserializeAws_restJson1RetainedMessageList = function (output, context) {
|
|
|
898
660
|
});
|
|
899
661
|
return retVal;
|
|
900
662
|
};
|
|
901
|
-
|
|
663
|
+
const deserializeAws_restJson1RetainedMessageSummary = (output, context) => {
|
|
902
664
|
return {
|
|
903
665
|
lastModifiedTime: __expectLong(output.lastModifiedTime),
|
|
904
666
|
payloadSize: __expectLong(output.payloadSize),
|
|
@@ -906,57 +668,39 @@ var deserializeAws_restJson1RetainedMessageSummary = function (output, context)
|
|
|
906
668
|
topic: __expectString(output.topic),
|
|
907
669
|
};
|
|
908
670
|
};
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
});
|
|
917
|
-
};
|
|
918
|
-
var collectBody = function (streamBody, context) {
|
|
919
|
-
if (streamBody === void 0) { streamBody = new Uint8Array(); }
|
|
671
|
+
const deserializeMetadata = (output) => ({
|
|
672
|
+
httpStatusCode: output.statusCode,
|
|
673
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
|
|
674
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
675
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
676
|
+
});
|
|
677
|
+
const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
920
678
|
if (streamBody instanceof Uint8Array) {
|
|
921
679
|
return Promise.resolve(streamBody);
|
|
922
680
|
}
|
|
923
681
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
924
682
|
};
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
683
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
684
|
+
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
685
|
+
value !== null &&
|
|
686
|
+
value !== "" &&
|
|
687
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
688
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
689
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
690
|
+
if (encoded.length) {
|
|
691
|
+
return JSON.parse(encoded);
|
|
692
|
+
}
|
|
693
|
+
return {};
|
|
694
|
+
});
|
|
695
|
+
const parseErrorBody = async (errorBody, context) => {
|
|
696
|
+
const value = await parseBody(errorBody, context);
|
|
697
|
+
value.message = value.message ?? value.Message;
|
|
698
|
+
return value;
|
|
934
699
|
};
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
}
|
|
940
|
-
return {};
|
|
941
|
-
});
|
|
942
|
-
};
|
|
943
|
-
var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
944
|
-
var value;
|
|
945
|
-
var _a;
|
|
946
|
-
return __generator(this, function (_b) {
|
|
947
|
-
switch (_b.label) {
|
|
948
|
-
case 0: return [4, parseBody(errorBody, context)];
|
|
949
|
-
case 1:
|
|
950
|
-
value = _b.sent();
|
|
951
|
-
value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
|
|
952
|
-
return [2, value];
|
|
953
|
-
}
|
|
954
|
-
});
|
|
955
|
-
}); };
|
|
956
|
-
var loadRestJsonErrorCode = function (output, data) {
|
|
957
|
-
var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
|
|
958
|
-
var sanitizeErrorCode = function (rawValue) {
|
|
959
|
-
var cleanValue = rawValue;
|
|
700
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
701
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
702
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
703
|
+
let cleanValue = rawValue;
|
|
960
704
|
if (typeof cleanValue === "number") {
|
|
961
705
|
cleanValue = cleanValue.toString();
|
|
962
706
|
}
|
|
@@ -971,7 +715,7 @@ var loadRestJsonErrorCode = function (output, data) {
|
|
|
971
715
|
}
|
|
972
716
|
return cleanValue;
|
|
973
717
|
};
|
|
974
|
-
|
|
718
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
975
719
|
if (headerKey !== undefined) {
|
|
976
720
|
return sanitizeErrorCode(output.headers[headerKey]);
|
|
977
721
|
}
|