@aws-sdk/client-iot-data-plane 3.131.0 → 3.142.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 +33 -0
- package/README.md +1 -1
- package/dist-cjs/commands/DeleteThingShadowCommand.js +2 -2
- package/dist-cjs/commands/GetRetainedMessageCommand.js +2 -2
- package/dist-cjs/commands/GetThingShadowCommand.js +2 -2
- package/dist-cjs/commands/ListNamedShadowsForThingCommand.js +2 -2
- package/dist-cjs/commands/ListRetainedMessagesCommand.js +2 -2
- package/dist-cjs/commands/PublishCommand.js +1 -1
- package/dist-cjs/commands/UpdateThingShadowCommand.js +2 -2
- package/dist-cjs/models/models_0.js +57 -85
- package/dist-cjs/protocols/Aws_restJson1.js +113 -199
- package/dist-es/commands/DeleteThingShadowCommand.js +3 -3
- package/dist-es/commands/GetRetainedMessageCommand.js +3 -3
- package/dist-es/commands/GetThingShadowCommand.js +3 -3
- package/dist-es/commands/ListNamedShadowsForThingCommand.js +3 -3
- package/dist-es/commands/ListRetainedMessagesCommand.js +3 -3
- package/dist-es/commands/PublishCommand.js +2 -2
- package/dist-es/commands/UpdateThingShadowCommand.js +3 -3
- package/dist-es/models/models_0.js +14 -56
- package/dist-es/protocols/Aws_restJson1.js +141 -191
- package/dist-types/models/models_0.d.ts +56 -84
- package/dist-types/ts3.4/models/models_0.d.ts +28 -56
- package/package.json +6 -6
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __assign, __awaiter, __generator } from "tslib";
|
|
2
2
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
3
|
-
import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString,
|
|
3
|
+
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
4
|
import { IoTDataPlaneServiceException as __BaseException } from "../models/IoTDataPlaneServiceException";
|
|
5
5
|
import { ConflictException, InternalFailureException, InvalidRequestException, MethodNotAllowedException, RequestEntityTooLargeException, ResourceNotFoundException, ServiceUnavailableException, ThrottlingException, UnauthorizedException, UnsupportedDocumentEncodingException, } from "../models/models_0";
|
|
6
6
|
export var serializeAws_restJson1DeleteThingShadowCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath,
|
|
7
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
|
|
8
8
|
return __generator(this, function (_c) {
|
|
9
9
|
switch (_c.label) {
|
|
10
10
|
case 0: return [4, context.endpoint()];
|
|
@@ -12,17 +12,10 @@ export var serializeAws_restJson1DeleteThingShadowCommand = function (input, con
|
|
|
12
12
|
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
13
13
|
headers = {};
|
|
14
14
|
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/things/{thingName}/shadow";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
resolvedPath = resolvedPath.replace("{thingName}", __extendedEncodeURIComponent(labelValue));
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
throw new Error("No value provided for input HTTP label: thingName.");
|
|
24
|
-
}
|
|
25
|
-
query = __assign({}, (input.shadowName !== undefined && { name: input.shadowName }));
|
|
15
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "thingName", function () { return input.thingName; }, "{thingName}", false);
|
|
16
|
+
query = map({
|
|
17
|
+
name: [, input.shadowName],
|
|
18
|
+
});
|
|
26
19
|
return [2, new __HttpRequest({
|
|
27
20
|
protocol: protocol,
|
|
28
21
|
hostname: hostname,
|
|
@@ -37,7 +30,7 @@ export var serializeAws_restJson1DeleteThingShadowCommand = function (input, con
|
|
|
37
30
|
});
|
|
38
31
|
}); };
|
|
39
32
|
export var serializeAws_restJson1GetRetainedMessageCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
40
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath,
|
|
33
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
41
34
|
return __generator(this, function (_c) {
|
|
42
35
|
switch (_c.label) {
|
|
43
36
|
case 0: return [4, context.endpoint()];
|
|
@@ -45,16 +38,7 @@ export var serializeAws_restJson1GetRetainedMessageCommand = function (input, co
|
|
|
45
38
|
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
46
39
|
headers = {};
|
|
47
40
|
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/retainedMessage/{topic}";
|
|
48
|
-
|
|
49
|
-
labelValue = input.topic;
|
|
50
|
-
if (labelValue.length <= 0) {
|
|
51
|
-
throw new Error("Empty value provided for input HTTP label: topic.");
|
|
52
|
-
}
|
|
53
|
-
resolvedPath = resolvedPath.replace("{topic}", __extendedEncodeURIComponent(labelValue));
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
throw new Error("No value provided for input HTTP label: topic.");
|
|
57
|
-
}
|
|
41
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "topic", function () { return input.topic; }, "{topic}", false);
|
|
58
42
|
return [2, new __HttpRequest({
|
|
59
43
|
protocol: protocol,
|
|
60
44
|
hostname: hostname,
|
|
@@ -68,7 +52,7 @@ export var serializeAws_restJson1GetRetainedMessageCommand = function (input, co
|
|
|
68
52
|
});
|
|
69
53
|
}); };
|
|
70
54
|
export var serializeAws_restJson1GetThingShadowCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
71
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath,
|
|
55
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
|
|
72
56
|
return __generator(this, function (_c) {
|
|
73
57
|
switch (_c.label) {
|
|
74
58
|
case 0: return [4, context.endpoint()];
|
|
@@ -76,17 +60,10 @@ export var serializeAws_restJson1GetThingShadowCommand = function (input, contex
|
|
|
76
60
|
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
77
61
|
headers = {};
|
|
78
62
|
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/things/{thingName}/shadow";
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
resolvedPath = resolvedPath.replace("{thingName}", __extendedEncodeURIComponent(labelValue));
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
throw new Error("No value provided for input HTTP label: thingName.");
|
|
88
|
-
}
|
|
89
|
-
query = __assign({}, (input.shadowName !== undefined && { name: input.shadowName }));
|
|
63
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "thingName", function () { return input.thingName; }, "{thingName}", false);
|
|
64
|
+
query = map({
|
|
65
|
+
name: [, input.shadowName],
|
|
66
|
+
});
|
|
90
67
|
return [2, new __HttpRequest({
|
|
91
68
|
protocol: protocol,
|
|
92
69
|
hostname: hostname,
|
|
@@ -101,7 +78,7 @@ export var serializeAws_restJson1GetThingShadowCommand = function (input, contex
|
|
|
101
78
|
});
|
|
102
79
|
}); };
|
|
103
80
|
export var serializeAws_restJson1ListNamedShadowsForThingCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
104
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath,
|
|
81
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
|
|
105
82
|
return __generator(this, function (_c) {
|
|
106
83
|
switch (_c.label) {
|
|
107
84
|
case 0: return [4, context.endpoint()];
|
|
@@ -110,17 +87,11 @@ export var serializeAws_restJson1ListNamedShadowsForThingCommand = function (inp
|
|
|
110
87
|
headers = {};
|
|
111
88
|
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
|
|
112
89
|
"/api/things/shadow/ListNamedShadowsForThing/{thingName}";
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
resolvedPath = resolvedPath.replace("{thingName}", __extendedEncodeURIComponent(labelValue));
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
throw new Error("No value provided for input HTTP label: thingName.");
|
|
122
|
-
}
|
|
123
|
-
query = __assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.pageSize !== undefined && { pageSize: input.pageSize.toString() }));
|
|
90
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "thingName", function () { return input.thingName; }, "{thingName}", false);
|
|
91
|
+
query = map({
|
|
92
|
+
nextToken: [, input.nextToken],
|
|
93
|
+
pageSize: [function () { return input.pageSize !== void 0; }, function () { return input.pageSize.toString(); }],
|
|
94
|
+
});
|
|
124
95
|
return [2, new __HttpRequest({
|
|
125
96
|
protocol: protocol,
|
|
126
97
|
hostname: hostname,
|
|
@@ -143,7 +114,10 @@ export var serializeAws_restJson1ListRetainedMessagesCommand = function (input,
|
|
|
143
114
|
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
144
115
|
headers = {};
|
|
145
116
|
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/retainedMessage";
|
|
146
|
-
query =
|
|
117
|
+
query = map({
|
|
118
|
+
nextToken: [, input.nextToken],
|
|
119
|
+
maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
|
|
120
|
+
});
|
|
147
121
|
return [2, new __HttpRequest({
|
|
148
122
|
protocol: protocol,
|
|
149
123
|
hostname: hostname,
|
|
@@ -158,7 +132,7 @@ export var serializeAws_restJson1ListRetainedMessagesCommand = function (input,
|
|
|
158
132
|
});
|
|
159
133
|
}); };
|
|
160
134
|
export var serializeAws_restJson1PublishCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
161
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath,
|
|
135
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
|
|
162
136
|
return __generator(this, function (_c) {
|
|
163
137
|
switch (_c.label) {
|
|
164
138
|
case 0: return [4, context.endpoint()];
|
|
@@ -168,17 +142,11 @@ export var serializeAws_restJson1PublishCommand = function (input, context) { re
|
|
|
168
142
|
"content-type": "application/octet-stream",
|
|
169
143
|
};
|
|
170
144
|
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/topics/{topic}";
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
resolvedPath = resolvedPath.replace("{topic}", __extendedEncodeURIComponent(labelValue));
|
|
177
|
-
}
|
|
178
|
-
else {
|
|
179
|
-
throw new Error("No value provided for input HTTP label: topic.");
|
|
180
|
-
}
|
|
181
|
-
query = __assign(__assign({}, (input.qos !== undefined && { qos: input.qos.toString() })), (input.retain !== undefined && { retain: input.retain.toString() }));
|
|
145
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "topic", function () { return input.topic; }, "{topic}", false);
|
|
146
|
+
query = map({
|
|
147
|
+
qos: [function () { return input.qos !== void 0; }, function () { return input.qos.toString(); }],
|
|
148
|
+
retain: [function () { return input.retain !== void 0; }, function () { return input.retain.toString(); }],
|
|
149
|
+
});
|
|
182
150
|
if (input.payload !== undefined) {
|
|
183
151
|
body = input.payload;
|
|
184
152
|
}
|
|
@@ -196,7 +164,7 @@ export var serializeAws_restJson1PublishCommand = function (input, context) { re
|
|
|
196
164
|
});
|
|
197
165
|
}); };
|
|
198
166
|
export var serializeAws_restJson1UpdateThingShadowCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
199
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath,
|
|
167
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
|
|
200
168
|
return __generator(this, function (_c) {
|
|
201
169
|
switch (_c.label) {
|
|
202
170
|
case 0: return [4, context.endpoint()];
|
|
@@ -206,17 +174,10 @@ export var serializeAws_restJson1UpdateThingShadowCommand = function (input, con
|
|
|
206
174
|
"content-type": "application/octet-stream",
|
|
207
175
|
};
|
|
208
176
|
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/things/{thingName}/shadow";
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
}
|
|
214
|
-
resolvedPath = resolvedPath.replace("{thingName}", __extendedEncodeURIComponent(labelValue));
|
|
215
|
-
}
|
|
216
|
-
else {
|
|
217
|
-
throw new Error("No value provided for input HTTP label: thingName.");
|
|
218
|
-
}
|
|
219
|
-
query = __assign({}, (input.shadowName !== undefined && { name: input.shadowName }));
|
|
177
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "thingName", function () { return input.thingName; }, "{thingName}", false);
|
|
178
|
+
query = map({
|
|
179
|
+
name: [, input.shadowName],
|
|
180
|
+
});
|
|
220
181
|
if (input.payload !== undefined) {
|
|
221
182
|
body = input.payload;
|
|
222
183
|
}
|
|
@@ -241,20 +202,19 @@ export var deserializeAws_restJson1DeleteThingShadowCommand = function (output,
|
|
|
241
202
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
242
203
|
return [2, deserializeAws_restJson1DeleteThingShadowCommandError(output, context)];
|
|
243
204
|
}
|
|
244
|
-
contents = {
|
|
205
|
+
contents = map({
|
|
245
206
|
$metadata: deserializeMetadata(output),
|
|
246
|
-
|
|
247
|
-
};
|
|
207
|
+
});
|
|
248
208
|
return [4, collectBody(output.body, context)];
|
|
249
209
|
case 1:
|
|
250
210
|
data = _a.sent();
|
|
251
211
|
contents.payload = data;
|
|
252
|
-
return [2,
|
|
212
|
+
return [2, contents];
|
|
253
213
|
}
|
|
254
214
|
});
|
|
255
215
|
}); };
|
|
256
216
|
var deserializeAws_restJson1DeleteThingShadowCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
257
|
-
var parsedOutput, _a,
|
|
217
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
258
218
|
var _c;
|
|
259
219
|
return __generator(this, function (_d) {
|
|
260
220
|
switch (_d.label) {
|
|
@@ -303,14 +263,14 @@ var deserializeAws_restJson1DeleteThingShadowCommandError = function (output, co
|
|
|
303
263
|
case 17: throw _d.sent();
|
|
304
264
|
case 18:
|
|
305
265
|
parsedBody = parsedOutput.body;
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
$metadata: $metadata,
|
|
266
|
+
throwDefaultError({
|
|
267
|
+
output: output,
|
|
268
|
+
parsedBody: parsedBody,
|
|
269
|
+
exceptionCtor: __BaseException,
|
|
270
|
+
errorCode: errorCode,
|
|
312
271
|
});
|
|
313
|
-
|
|
272
|
+
_d.label = 19;
|
|
273
|
+
case 19: return [2];
|
|
314
274
|
}
|
|
315
275
|
});
|
|
316
276
|
}); };
|
|
@@ -322,36 +282,32 @@ export var deserializeAws_restJson1GetRetainedMessageCommand = function (output,
|
|
|
322
282
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
323
283
|
return [2, deserializeAws_restJson1GetRetainedMessageCommandError(output, context)];
|
|
324
284
|
}
|
|
325
|
-
contents = {
|
|
285
|
+
contents = map({
|
|
326
286
|
$metadata: deserializeMetadata(output),
|
|
327
|
-
|
|
328
|
-
payload: undefined,
|
|
329
|
-
qos: undefined,
|
|
330
|
-
topic: undefined,
|
|
331
|
-
};
|
|
287
|
+
});
|
|
332
288
|
_a = __expectNonNull;
|
|
333
289
|
_b = __expectObject;
|
|
334
290
|
return [4, parseBody(output.body, context)];
|
|
335
291
|
case 1:
|
|
336
292
|
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
337
|
-
if (data.lastModifiedTime
|
|
293
|
+
if (data.lastModifiedTime != null) {
|
|
338
294
|
contents.lastModifiedTime = __expectLong(data.lastModifiedTime);
|
|
339
295
|
}
|
|
340
|
-
if (data.payload
|
|
296
|
+
if (data.payload != null) {
|
|
341
297
|
contents.payload = context.base64Decoder(data.payload);
|
|
342
298
|
}
|
|
343
|
-
if (data.qos
|
|
299
|
+
if (data.qos != null) {
|
|
344
300
|
contents.qos = __expectInt32(data.qos);
|
|
345
301
|
}
|
|
346
|
-
if (data.topic
|
|
302
|
+
if (data.topic != null) {
|
|
347
303
|
contents.topic = __expectString(data.topic);
|
|
348
304
|
}
|
|
349
|
-
return [2,
|
|
305
|
+
return [2, contents];
|
|
350
306
|
}
|
|
351
307
|
});
|
|
352
308
|
}); };
|
|
353
309
|
var deserializeAws_restJson1GetRetainedMessageCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
354
|
-
var parsedOutput, _a,
|
|
310
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
355
311
|
var _c;
|
|
356
312
|
return __generator(this, function (_d) {
|
|
357
313
|
switch (_d.label) {
|
|
@@ -396,14 +352,14 @@ var deserializeAws_restJson1GetRetainedMessageCommandError = function (output, c
|
|
|
396
352
|
case 15: throw _d.sent();
|
|
397
353
|
case 16:
|
|
398
354
|
parsedBody = parsedOutput.body;
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
$metadata: $metadata,
|
|
355
|
+
throwDefaultError({
|
|
356
|
+
output: output,
|
|
357
|
+
parsedBody: parsedBody,
|
|
358
|
+
exceptionCtor: __BaseException,
|
|
359
|
+
errorCode: errorCode,
|
|
405
360
|
});
|
|
406
|
-
|
|
361
|
+
_d.label = 17;
|
|
362
|
+
case 17: return [2];
|
|
407
363
|
}
|
|
408
364
|
});
|
|
409
365
|
}); };
|
|
@@ -415,20 +371,19 @@ export var deserializeAws_restJson1GetThingShadowCommand = function (output, con
|
|
|
415
371
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
416
372
|
return [2, deserializeAws_restJson1GetThingShadowCommandError(output, context)];
|
|
417
373
|
}
|
|
418
|
-
contents = {
|
|
374
|
+
contents = map({
|
|
419
375
|
$metadata: deserializeMetadata(output),
|
|
420
|
-
|
|
421
|
-
};
|
|
376
|
+
});
|
|
422
377
|
return [4, collectBody(output.body, context)];
|
|
423
378
|
case 1:
|
|
424
379
|
data = _a.sent();
|
|
425
380
|
contents.payload = data;
|
|
426
|
-
return [2,
|
|
381
|
+
return [2, contents];
|
|
427
382
|
}
|
|
428
383
|
});
|
|
429
384
|
}); };
|
|
430
385
|
var deserializeAws_restJson1GetThingShadowCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
431
|
-
var parsedOutput, _a,
|
|
386
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
432
387
|
var _c;
|
|
433
388
|
return __generator(this, function (_d) {
|
|
434
389
|
switch (_d.label) {
|
|
@@ -477,14 +432,14 @@ var deserializeAws_restJson1GetThingShadowCommandError = function (output, conte
|
|
|
477
432
|
case 17: throw _d.sent();
|
|
478
433
|
case 18:
|
|
479
434
|
parsedBody = parsedOutput.body;
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
$metadata: $metadata,
|
|
435
|
+
throwDefaultError({
|
|
436
|
+
output: output,
|
|
437
|
+
parsedBody: parsedBody,
|
|
438
|
+
exceptionCtor: __BaseException,
|
|
439
|
+
errorCode: errorCode,
|
|
486
440
|
});
|
|
487
|
-
|
|
441
|
+
_d.label = 19;
|
|
442
|
+
case 19: return [2];
|
|
488
443
|
}
|
|
489
444
|
});
|
|
490
445
|
}); };
|
|
@@ -496,32 +451,29 @@ export var deserializeAws_restJson1ListNamedShadowsForThingCommand = function (o
|
|
|
496
451
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
497
452
|
return [2, deserializeAws_restJson1ListNamedShadowsForThingCommandError(output, context)];
|
|
498
453
|
}
|
|
499
|
-
contents = {
|
|
454
|
+
contents = map({
|
|
500
455
|
$metadata: deserializeMetadata(output),
|
|
501
|
-
|
|
502
|
-
results: undefined,
|
|
503
|
-
timestamp: undefined,
|
|
504
|
-
};
|
|
456
|
+
});
|
|
505
457
|
_a = __expectNonNull;
|
|
506
458
|
_b = __expectObject;
|
|
507
459
|
return [4, parseBody(output.body, context)];
|
|
508
460
|
case 1:
|
|
509
461
|
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
510
|
-
if (data.nextToken
|
|
462
|
+
if (data.nextToken != null) {
|
|
511
463
|
contents.nextToken = __expectString(data.nextToken);
|
|
512
464
|
}
|
|
513
|
-
if (data.results
|
|
465
|
+
if (data.results != null) {
|
|
514
466
|
contents.results = deserializeAws_restJson1NamedShadowList(data.results, context);
|
|
515
467
|
}
|
|
516
|
-
if (data.timestamp
|
|
468
|
+
if (data.timestamp != null) {
|
|
517
469
|
contents.timestamp = __expectLong(data.timestamp);
|
|
518
470
|
}
|
|
519
|
-
return [2,
|
|
471
|
+
return [2, contents];
|
|
520
472
|
}
|
|
521
473
|
});
|
|
522
474
|
}); };
|
|
523
475
|
var deserializeAws_restJson1ListNamedShadowsForThingCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
524
|
-
var parsedOutput, _a,
|
|
476
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
525
477
|
var _c;
|
|
526
478
|
return __generator(this, function (_d) {
|
|
527
479
|
switch (_d.label) {
|
|
@@ -566,14 +518,14 @@ var deserializeAws_restJson1ListNamedShadowsForThingCommandError = function (out
|
|
|
566
518
|
case 15: throw _d.sent();
|
|
567
519
|
case 16:
|
|
568
520
|
parsedBody = parsedOutput.body;
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
$metadata: $metadata,
|
|
521
|
+
throwDefaultError({
|
|
522
|
+
output: output,
|
|
523
|
+
parsedBody: parsedBody,
|
|
524
|
+
exceptionCtor: __BaseException,
|
|
525
|
+
errorCode: errorCode,
|
|
575
526
|
});
|
|
576
|
-
|
|
527
|
+
_d.label = 17;
|
|
528
|
+
case 17: return [2];
|
|
577
529
|
}
|
|
578
530
|
});
|
|
579
531
|
}); };
|
|
@@ -585,28 +537,26 @@ export var deserializeAws_restJson1ListRetainedMessagesCommand = function (outpu
|
|
|
585
537
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
586
538
|
return [2, deserializeAws_restJson1ListRetainedMessagesCommandError(output, context)];
|
|
587
539
|
}
|
|
588
|
-
contents = {
|
|
540
|
+
contents = map({
|
|
589
541
|
$metadata: deserializeMetadata(output),
|
|
590
|
-
|
|
591
|
-
retainedTopics: undefined,
|
|
592
|
-
};
|
|
542
|
+
});
|
|
593
543
|
_a = __expectNonNull;
|
|
594
544
|
_b = __expectObject;
|
|
595
545
|
return [4, parseBody(output.body, context)];
|
|
596
546
|
case 1:
|
|
597
547
|
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
598
|
-
if (data.nextToken
|
|
548
|
+
if (data.nextToken != null) {
|
|
599
549
|
contents.nextToken = __expectString(data.nextToken);
|
|
600
550
|
}
|
|
601
|
-
if (data.retainedTopics
|
|
551
|
+
if (data.retainedTopics != null) {
|
|
602
552
|
contents.retainedTopics = deserializeAws_restJson1RetainedMessageList(data.retainedTopics, context);
|
|
603
553
|
}
|
|
604
|
-
return [2,
|
|
554
|
+
return [2, contents];
|
|
605
555
|
}
|
|
606
556
|
});
|
|
607
557
|
}); };
|
|
608
558
|
var deserializeAws_restJson1ListRetainedMessagesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
609
|
-
var parsedOutput, _a,
|
|
559
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
610
560
|
var _c;
|
|
611
561
|
return __generator(this, function (_d) {
|
|
612
562
|
switch (_d.label) {
|
|
@@ -647,14 +597,14 @@ var deserializeAws_restJson1ListRetainedMessagesCommandError = function (output,
|
|
|
647
597
|
case 13: throw _d.sent();
|
|
648
598
|
case 14:
|
|
649
599
|
parsedBody = parsedOutput.body;
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
$metadata: $metadata,
|
|
600
|
+
throwDefaultError({
|
|
601
|
+
output: output,
|
|
602
|
+
parsedBody: parsedBody,
|
|
603
|
+
exceptionCtor: __BaseException,
|
|
604
|
+
errorCode: errorCode,
|
|
656
605
|
});
|
|
657
|
-
|
|
606
|
+
_d.label = 15;
|
|
607
|
+
case 15: return [2];
|
|
658
608
|
}
|
|
659
609
|
});
|
|
660
610
|
}); };
|
|
@@ -666,18 +616,18 @@ export var deserializeAws_restJson1PublishCommand = function (output, context) {
|
|
|
666
616
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
667
617
|
return [2, deserializeAws_restJson1PublishCommandError(output, context)];
|
|
668
618
|
}
|
|
669
|
-
contents = {
|
|
619
|
+
contents = map({
|
|
670
620
|
$metadata: deserializeMetadata(output),
|
|
671
|
-
};
|
|
621
|
+
});
|
|
672
622
|
return [4, collectBody(output.body, context)];
|
|
673
623
|
case 1:
|
|
674
624
|
_a.sent();
|
|
675
|
-
return [2,
|
|
625
|
+
return [2, contents];
|
|
676
626
|
}
|
|
677
627
|
});
|
|
678
628
|
}); };
|
|
679
629
|
var deserializeAws_restJson1PublishCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
680
|
-
var parsedOutput, _a,
|
|
630
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
681
631
|
var _c;
|
|
682
632
|
return __generator(this, function (_d) {
|
|
683
633
|
switch (_d.label) {
|
|
@@ -710,14 +660,14 @@ var deserializeAws_restJson1PublishCommandError = function (output, context) { r
|
|
|
710
660
|
case 9: throw _d.sent();
|
|
711
661
|
case 10:
|
|
712
662
|
parsedBody = parsedOutput.body;
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
$metadata: $metadata,
|
|
663
|
+
throwDefaultError({
|
|
664
|
+
output: output,
|
|
665
|
+
parsedBody: parsedBody,
|
|
666
|
+
exceptionCtor: __BaseException,
|
|
667
|
+
errorCode: errorCode,
|
|
719
668
|
});
|
|
720
|
-
|
|
669
|
+
_d.label = 11;
|
|
670
|
+
case 11: return [2];
|
|
721
671
|
}
|
|
722
672
|
});
|
|
723
673
|
}); };
|
|
@@ -729,20 +679,19 @@ export var deserializeAws_restJson1UpdateThingShadowCommand = function (output,
|
|
|
729
679
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
730
680
|
return [2, deserializeAws_restJson1UpdateThingShadowCommandError(output, context)];
|
|
731
681
|
}
|
|
732
|
-
contents = {
|
|
682
|
+
contents = map({
|
|
733
683
|
$metadata: deserializeMetadata(output),
|
|
734
|
-
|
|
735
|
-
};
|
|
684
|
+
});
|
|
736
685
|
return [4, collectBody(output.body, context)];
|
|
737
686
|
case 1:
|
|
738
687
|
data = _a.sent();
|
|
739
688
|
contents.payload = data;
|
|
740
|
-
return [2,
|
|
689
|
+
return [2, contents];
|
|
741
690
|
}
|
|
742
691
|
});
|
|
743
692
|
}); };
|
|
744
693
|
var deserializeAws_restJson1UpdateThingShadowCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
745
|
-
var parsedOutput, _a,
|
|
694
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
746
695
|
var _c;
|
|
747
696
|
return __generator(this, function (_d) {
|
|
748
697
|
switch (_d.label) {
|
|
@@ -795,23 +744,24 @@ var deserializeAws_restJson1UpdateThingShadowCommandError = function (output, co
|
|
|
795
744
|
case 19: throw _d.sent();
|
|
796
745
|
case 20:
|
|
797
746
|
parsedBody = parsedOutput.body;
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
$metadata: $metadata,
|
|
747
|
+
throwDefaultError({
|
|
748
|
+
output: output,
|
|
749
|
+
parsedBody: parsedBody,
|
|
750
|
+
exceptionCtor: __BaseException,
|
|
751
|
+
errorCode: errorCode,
|
|
804
752
|
});
|
|
805
|
-
|
|
753
|
+
_d.label = 21;
|
|
754
|
+
case 21: return [2];
|
|
806
755
|
}
|
|
807
756
|
});
|
|
808
757
|
}); };
|
|
758
|
+
var map = __map;
|
|
809
759
|
var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
810
760
|
var contents, data, exception;
|
|
811
761
|
return __generator(this, function (_a) {
|
|
812
|
-
contents = {};
|
|
762
|
+
contents = map({});
|
|
813
763
|
data = parsedOutput.body;
|
|
814
|
-
if (data.message
|
|
764
|
+
if (data.message != null) {
|
|
815
765
|
contents.message = __expectString(data.message);
|
|
816
766
|
}
|
|
817
767
|
exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
@@ -821,9 +771,9 @@ var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput,
|
|
|
821
771
|
var deserializeAws_restJson1InternalFailureExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
822
772
|
var contents, data, exception;
|
|
823
773
|
return __generator(this, function (_a) {
|
|
824
|
-
contents = {};
|
|
774
|
+
contents = map({});
|
|
825
775
|
data = parsedOutput.body;
|
|
826
|
-
if (data.message
|
|
776
|
+
if (data.message != null) {
|
|
827
777
|
contents.message = __expectString(data.message);
|
|
828
778
|
}
|
|
829
779
|
exception = new InternalFailureException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
@@ -833,9 +783,9 @@ var deserializeAws_restJson1InternalFailureExceptionResponse = function (parsedO
|
|
|
833
783
|
var deserializeAws_restJson1InvalidRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
834
784
|
var contents, data, exception;
|
|
835
785
|
return __generator(this, function (_a) {
|
|
836
|
-
contents = {};
|
|
786
|
+
contents = map({});
|
|
837
787
|
data = parsedOutput.body;
|
|
838
|
-
if (data.message
|
|
788
|
+
if (data.message != null) {
|
|
839
789
|
contents.message = __expectString(data.message);
|
|
840
790
|
}
|
|
841
791
|
exception = new InvalidRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
@@ -845,9 +795,9 @@ var deserializeAws_restJson1InvalidRequestExceptionResponse = function (parsedOu
|
|
|
845
795
|
var deserializeAws_restJson1MethodNotAllowedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
846
796
|
var contents, data, exception;
|
|
847
797
|
return __generator(this, function (_a) {
|
|
848
|
-
contents = {};
|
|
798
|
+
contents = map({});
|
|
849
799
|
data = parsedOutput.body;
|
|
850
|
-
if (data.message
|
|
800
|
+
if (data.message != null) {
|
|
851
801
|
contents.message = __expectString(data.message);
|
|
852
802
|
}
|
|
853
803
|
exception = new MethodNotAllowedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
@@ -857,9 +807,9 @@ var deserializeAws_restJson1MethodNotAllowedExceptionResponse = function (parsed
|
|
|
857
807
|
var deserializeAws_restJson1RequestEntityTooLargeExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
858
808
|
var contents, data, exception;
|
|
859
809
|
return __generator(this, function (_a) {
|
|
860
|
-
contents = {};
|
|
810
|
+
contents = map({});
|
|
861
811
|
data = parsedOutput.body;
|
|
862
|
-
if (data.message
|
|
812
|
+
if (data.message != null) {
|
|
863
813
|
contents.message = __expectString(data.message);
|
|
864
814
|
}
|
|
865
815
|
exception = new RequestEntityTooLargeException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
@@ -869,9 +819,9 @@ var deserializeAws_restJson1RequestEntityTooLargeExceptionResponse = function (p
|
|
|
869
819
|
var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
870
820
|
var contents, data, exception;
|
|
871
821
|
return __generator(this, function (_a) {
|
|
872
|
-
contents = {};
|
|
822
|
+
contents = map({});
|
|
873
823
|
data = parsedOutput.body;
|
|
874
|
-
if (data.message
|
|
824
|
+
if (data.message != null) {
|
|
875
825
|
contents.message = __expectString(data.message);
|
|
876
826
|
}
|
|
877
827
|
exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
@@ -881,9 +831,9 @@ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsed
|
|
|
881
831
|
var deserializeAws_restJson1ServiceUnavailableExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
882
832
|
var contents, data, exception;
|
|
883
833
|
return __generator(this, function (_a) {
|
|
884
|
-
contents = {};
|
|
834
|
+
contents = map({});
|
|
885
835
|
data = parsedOutput.body;
|
|
886
|
-
if (data.message
|
|
836
|
+
if (data.message != null) {
|
|
887
837
|
contents.message = __expectString(data.message);
|
|
888
838
|
}
|
|
889
839
|
exception = new ServiceUnavailableException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
@@ -893,9 +843,9 @@ var deserializeAws_restJson1ServiceUnavailableExceptionResponse = function (pars
|
|
|
893
843
|
var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
894
844
|
var contents, data, exception;
|
|
895
845
|
return __generator(this, function (_a) {
|
|
896
|
-
contents = {};
|
|
846
|
+
contents = map({});
|
|
897
847
|
data = parsedOutput.body;
|
|
898
|
-
if (data.message
|
|
848
|
+
if (data.message != null) {
|
|
899
849
|
contents.message = __expectString(data.message);
|
|
900
850
|
}
|
|
901
851
|
exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
@@ -905,9 +855,9 @@ var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput
|
|
|
905
855
|
var deserializeAws_restJson1UnauthorizedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
906
856
|
var contents, data, exception;
|
|
907
857
|
return __generator(this, function (_a) {
|
|
908
|
-
contents = {};
|
|
858
|
+
contents = map({});
|
|
909
859
|
data = parsedOutput.body;
|
|
910
|
-
if (data.message
|
|
860
|
+
if (data.message != null) {
|
|
911
861
|
contents.message = __expectString(data.message);
|
|
912
862
|
}
|
|
913
863
|
exception = new UnauthorizedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
@@ -917,9 +867,9 @@ var deserializeAws_restJson1UnauthorizedExceptionResponse = function (parsedOutp
|
|
|
917
867
|
var deserializeAws_restJson1UnsupportedDocumentEncodingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
918
868
|
var contents, data, exception;
|
|
919
869
|
return __generator(this, function (_a) {
|
|
920
|
-
contents = {};
|
|
870
|
+
contents = map({});
|
|
921
871
|
data = parsedOutput.body;
|
|
922
|
-
if (data.message
|
|
872
|
+
if (data.message != null) {
|
|
923
873
|
contents.message = __expectString(data.message);
|
|
924
874
|
}
|
|
925
875
|
exception = new UnsupportedDocumentEncodingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|