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