@aws-sdk/client-iotdeviceadvisor 3.181.0 → 3.183.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist-es/IotDeviceAdvisor.js +58 -65
  3. package/dist-es/IotDeviceAdvisorClient.js +22 -28
  4. package/dist-es/commands/CreateSuiteDefinitionCommand.js +21 -28
  5. package/dist-es/commands/DeleteSuiteDefinitionCommand.js +21 -28
  6. package/dist-es/commands/GetEndpointCommand.js +21 -28
  7. package/dist-es/commands/GetSuiteDefinitionCommand.js +21 -28
  8. package/dist-es/commands/GetSuiteRunCommand.js +21 -28
  9. package/dist-es/commands/GetSuiteRunReportCommand.js +21 -28
  10. package/dist-es/commands/ListSuiteDefinitionsCommand.js +21 -28
  11. package/dist-es/commands/ListSuiteRunsCommand.js +21 -28
  12. package/dist-es/commands/ListTagsForResourceCommand.js +21 -28
  13. package/dist-es/commands/StartSuiteRunCommand.js +21 -28
  14. package/dist-es/commands/StopSuiteRunCommand.js +21 -28
  15. package/dist-es/commands/TagResourceCommand.js +21 -28
  16. package/dist-es/commands/UntagResourceCommand.js +21 -28
  17. package/dist-es/commands/UpdateSuiteDefinitionCommand.js +21 -28
  18. package/dist-es/endpoints.js +8 -8
  19. package/dist-es/models/IotDeviceAdvisorServiceException.js +5 -10
  20. package/dist-es/models/models_0.js +155 -82
  21. package/dist-es/pagination/ListSuiteDefinitionsPaginator.js +25 -68
  22. package/dist-es/pagination/ListSuiteRunsPaginator.js +25 -68
  23. package/dist-es/protocols/Aws_restJson1.js +1003 -1415
  24. package/dist-es/runtimeConfig.browser.js +26 -12
  25. package/dist-es/runtimeConfig.js +30 -12
  26. package/dist-es/runtimeConfig.native.js +8 -5
  27. package/dist-es/runtimeConfig.shared.js +8 -11
  28. package/package.json +33 -33
@@ -1,1401 +1,1006 @@
1
- import { __assign, __awaiter, __generator, __read } from "tslib";
2
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
2
  import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map as __map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
4
3
  import { IotDeviceAdvisorServiceException as __BaseException } from "../models/IotDeviceAdvisorServiceException";
5
4
  import { ConflictException, InternalServerException, ResourceNotFoundException, ValidationException, } from "../models/models_0";
6
- export var serializeAws_restJson1CreateSuiteDefinitionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, 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
- "content-type": "application/json",
15
- };
16
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/suiteDefinitions";
17
- body = JSON.stringify(__assign(__assign({}, (input.suiteDefinitionConfiguration != null && {
18
- suiteDefinitionConfiguration: serializeAws_restJson1SuiteDefinitionConfiguration(input.suiteDefinitionConfiguration, context),
19
- })), (input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) })));
20
- return [2, new __HttpRequest({
21
- protocol: protocol,
22
- hostname: hostname,
23
- port: port,
24
- method: "POST",
25
- headers: headers,
26
- path: resolvedPath,
27
- body: body,
28
- })];
29
- }
30
- });
31
- }); };
32
- export var serializeAws_restJson1DeleteSuiteDefinitionCommand = 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 || "") + "/suiteDefinitions/{suiteDefinitionId}";
41
- resolvedPath = __resolvedPath(resolvedPath, input, "suiteDefinitionId", function () { return input.suiteDefinitionId; }, "{suiteDefinitionId}", false);
42
- return [2, new __HttpRequest({
43
- protocol: protocol,
44
- hostname: hostname,
45
- port: port,
46
- method: "DELETE",
47
- headers: headers,
48
- path: resolvedPath,
49
- body: body,
50
- })];
51
- }
52
- });
53
- }); };
54
- export var serializeAws_restJson1GetEndpointCommand = 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 || "") + "/endpoint";
63
- query = map({
64
- thingArn: [, input.thingArn],
65
- certificateArn: [, input.certificateArn],
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
- }
78
- });
79
- }); };
80
- export var serializeAws_restJson1GetSuiteDefinitionCommand = 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 || "") + "/suiteDefinitions/{suiteDefinitionId}";
89
- resolvedPath = __resolvedPath(resolvedPath, input, "suiteDefinitionId", function () { return input.suiteDefinitionId; }, "{suiteDefinitionId}", false);
90
- query = map({
91
- suiteDefinitionVersion: [, input.suiteDefinitionVersion],
92
- });
93
- return [2, new __HttpRequest({
94
- protocol: protocol,
95
- hostname: hostname,
96
- port: port,
97
- method: "GET",
98
- headers: headers,
99
- path: resolvedPath,
100
- query: query,
101
- body: body,
102
- })];
103
- }
104
- });
105
- }); };
106
- export var serializeAws_restJson1GetSuiteRunCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
107
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
108
- return __generator(this, function (_c) {
109
- switch (_c.label) {
110
- case 0: return [4, context.endpoint()];
111
- case 1:
112
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
113
- headers = {};
114
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
115
- "/suiteDefinitions/{suiteDefinitionId}/suiteRuns/{suiteRunId}";
116
- resolvedPath = __resolvedPath(resolvedPath, input, "suiteDefinitionId", function () { return input.suiteDefinitionId; }, "{suiteDefinitionId}", false);
117
- resolvedPath = __resolvedPath(resolvedPath, input, "suiteRunId", function () { return input.suiteRunId; }, "{suiteRunId}", false);
118
- return [2, new __HttpRequest({
119
- protocol: protocol,
120
- hostname: hostname,
121
- port: port,
122
- method: "GET",
123
- headers: headers,
124
- path: resolvedPath,
125
- body: body,
126
- })];
127
- }
128
- });
129
- }); };
130
- export var serializeAws_restJson1GetSuiteRunReportCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
131
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
132
- return __generator(this, function (_c) {
133
- switch (_c.label) {
134
- case 0: return [4, context.endpoint()];
135
- case 1:
136
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
137
- headers = {};
138
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
139
- "/suiteDefinitions/{suiteDefinitionId}/suiteRuns/{suiteRunId}/report";
140
- resolvedPath = __resolvedPath(resolvedPath, input, "suiteDefinitionId", function () { return input.suiteDefinitionId; }, "{suiteDefinitionId}", false);
141
- resolvedPath = __resolvedPath(resolvedPath, input, "suiteRunId", function () { return input.suiteRunId; }, "{suiteRunId}", false);
142
- return [2, new __HttpRequest({
143
- protocol: protocol,
144
- hostname: hostname,
145
- port: port,
146
- method: "GET",
147
- headers: headers,
148
- path: resolvedPath,
149
- body: body,
150
- })];
151
- }
5
+ export const serializeAws_restJson1CreateSuiteDefinitionCommand = async (input, context) => {
6
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
7
+ const headers = {
8
+ "content-type": "application/json",
9
+ };
10
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/suiteDefinitions";
11
+ let body;
12
+ body = JSON.stringify({
13
+ ...(input.suiteDefinitionConfiguration != null && {
14
+ suiteDefinitionConfiguration: serializeAws_restJson1SuiteDefinitionConfiguration(input.suiteDefinitionConfiguration, context),
15
+ }),
16
+ ...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
152
17
  });
153
- }); };
154
- export var serializeAws_restJson1ListSuiteDefinitionsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
155
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
156
- return __generator(this, function (_c) {
157
- switch (_c.label) {
158
- case 0: return [4, context.endpoint()];
159
- case 1:
160
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
161
- headers = {};
162
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/suiteDefinitions";
163
- query = map({
164
- maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
165
- nextToken: [, input.nextToken],
166
- });
167
- return [2, new __HttpRequest({
168
- protocol: protocol,
169
- hostname: hostname,
170
- port: port,
171
- method: "GET",
172
- headers: headers,
173
- path: resolvedPath,
174
- query: query,
175
- body: body,
176
- })];
177
- }
18
+ return new __HttpRequest({
19
+ protocol,
20
+ hostname,
21
+ port,
22
+ method: "POST",
23
+ headers,
24
+ path: resolvedPath,
25
+ body,
178
26
  });
179
- }); };
180
- export var serializeAws_restJson1ListSuiteRunsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
181
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
182
- return __generator(this, function (_c) {
183
- switch (_c.label) {
184
- case 0: return [4, context.endpoint()];
185
- case 1:
186
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
187
- headers = {};
188
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/suiteRuns";
189
- query = map({
190
- suiteDefinitionId: [, input.suiteDefinitionId],
191
- suiteDefinitionVersion: [, input.suiteDefinitionVersion],
192
- maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
193
- nextToken: [, input.nextToken],
194
- });
195
- return [2, new __HttpRequest({
196
- protocol: protocol,
197
- hostname: hostname,
198
- port: port,
199
- method: "GET",
200
- headers: headers,
201
- path: resolvedPath,
202
- query: query,
203
- body: body,
204
- })];
205
- }
27
+ };
28
+ export const serializeAws_restJson1DeleteSuiteDefinitionCommand = async (input, context) => {
29
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
30
+ const headers = {};
31
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/suiteDefinitions/{suiteDefinitionId}";
32
+ resolvedPath = __resolvedPath(resolvedPath, input, "suiteDefinitionId", () => input.suiteDefinitionId, "{suiteDefinitionId}", false);
33
+ let body;
34
+ return new __HttpRequest({
35
+ protocol,
36
+ hostname,
37
+ port,
38
+ method: "DELETE",
39
+ headers,
40
+ path: resolvedPath,
41
+ body,
206
42
  });
207
- }); };
208
- export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
209
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
210
- return __generator(this, function (_c) {
211
- switch (_c.label) {
212
- case 0: return [4, context.endpoint()];
213
- case 1:
214
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
215
- headers = {};
216
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
217
- resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
218
- return [2, new __HttpRequest({
219
- protocol: protocol,
220
- hostname: hostname,
221
- port: port,
222
- method: "GET",
223
- headers: headers,
224
- path: resolvedPath,
225
- body: body,
226
- })];
227
- }
43
+ };
44
+ export const serializeAws_restJson1GetEndpointCommand = async (input, context) => {
45
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
46
+ const headers = {};
47
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/endpoint";
48
+ const query = map({
49
+ thingArn: [, input.thingArn],
50
+ certificateArn: [, input.certificateArn],
228
51
  });
229
- }); };
230
- export var serializeAws_restJson1StartSuiteRunCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
231
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
232
- return __generator(this, function (_c) {
233
- switch (_c.label) {
234
- case 0: return [4, context.endpoint()];
235
- case 1:
236
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
237
- headers = {
238
- "content-type": "application/json",
239
- };
240
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
241
- "/suiteDefinitions/{suiteDefinitionId}/suiteRuns";
242
- resolvedPath = __resolvedPath(resolvedPath, input, "suiteDefinitionId", function () { return input.suiteDefinitionId; }, "{suiteDefinitionId}", false);
243
- body = JSON.stringify(__assign(__assign(__assign({}, (input.suiteDefinitionVersion != null && { suiteDefinitionVersion: input.suiteDefinitionVersion })), (input.suiteRunConfiguration != null && {
244
- suiteRunConfiguration: serializeAws_restJson1SuiteRunConfiguration(input.suiteRunConfiguration, context),
245
- })), (input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) })));
246
- return [2, new __HttpRequest({
247
- protocol: protocol,
248
- hostname: hostname,
249
- port: port,
250
- method: "POST",
251
- headers: headers,
252
- path: resolvedPath,
253
- body: body,
254
- })];
255
- }
52
+ let body;
53
+ return new __HttpRequest({
54
+ protocol,
55
+ hostname,
56
+ port,
57
+ method: "GET",
58
+ headers,
59
+ path: resolvedPath,
60
+ query,
61
+ body,
256
62
  });
257
- }); };
258
- export var serializeAws_restJson1StopSuiteRunCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
259
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
260
- return __generator(this, function (_c) {
261
- switch (_c.label) {
262
- case 0: return [4, context.endpoint()];
263
- case 1:
264
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
265
- headers = {};
266
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
267
- "/suiteDefinitions/{suiteDefinitionId}/suiteRuns/{suiteRunId}/stop";
268
- resolvedPath = __resolvedPath(resolvedPath, input, "suiteDefinitionId", function () { return input.suiteDefinitionId; }, "{suiteDefinitionId}", false);
269
- resolvedPath = __resolvedPath(resolvedPath, input, "suiteRunId", function () { return input.suiteRunId; }, "{suiteRunId}", false);
270
- return [2, new __HttpRequest({
271
- protocol: protocol,
272
- hostname: hostname,
273
- port: port,
274
- method: "POST",
275
- headers: headers,
276
- path: resolvedPath,
277
- body: body,
278
- })];
279
- }
63
+ };
64
+ export const serializeAws_restJson1GetSuiteDefinitionCommand = async (input, context) => {
65
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
66
+ const headers = {};
67
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/suiteDefinitions/{suiteDefinitionId}";
68
+ resolvedPath = __resolvedPath(resolvedPath, input, "suiteDefinitionId", () => input.suiteDefinitionId, "{suiteDefinitionId}", false);
69
+ const query = map({
70
+ suiteDefinitionVersion: [, input.suiteDefinitionVersion],
280
71
  });
281
- }); };
282
- export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
283
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
284
- return __generator(this, function (_c) {
285
- switch (_c.label) {
286
- case 0: return [4, context.endpoint()];
287
- case 1:
288
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
289
- headers = {
290
- "content-type": "application/json",
291
- };
292
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
293
- resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
294
- body = JSON.stringify(__assign({}, (input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) })));
295
- return [2, new __HttpRequest({
296
- protocol: protocol,
297
- hostname: hostname,
298
- port: port,
299
- method: "POST",
300
- headers: headers,
301
- path: resolvedPath,
302
- body: body,
303
- })];
304
- }
72
+ let body;
73
+ return new __HttpRequest({
74
+ protocol,
75
+ hostname,
76
+ port,
77
+ method: "GET",
78
+ headers,
79
+ path: resolvedPath,
80
+ query,
81
+ body,
305
82
  });
306
- }); };
307
- export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
308
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
309
- return __generator(this, function (_c) {
310
- switch (_c.label) {
311
- case 0: return [4, context.endpoint()];
312
- case 1:
313
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
314
- headers = {};
315
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
316
- resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
317
- query = map({
318
- tagKeys: [function () { return input.tagKeys !== void 0; }, function () { return (input.tagKeys || []).map(function (_entry) { return _entry; }); }],
319
- });
320
- return [2, new __HttpRequest({
321
- protocol: protocol,
322
- hostname: hostname,
323
- port: port,
324
- method: "DELETE",
325
- headers: headers,
326
- path: resolvedPath,
327
- query: query,
328
- body: body,
329
- })];
330
- }
83
+ };
84
+ export const serializeAws_restJson1GetSuiteRunCommand = async (input, context) => {
85
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
86
+ const headers = {};
87
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
88
+ "/suiteDefinitions/{suiteDefinitionId}/suiteRuns/{suiteRunId}";
89
+ resolvedPath = __resolvedPath(resolvedPath, input, "suiteDefinitionId", () => input.suiteDefinitionId, "{suiteDefinitionId}", false);
90
+ resolvedPath = __resolvedPath(resolvedPath, input, "suiteRunId", () => input.suiteRunId, "{suiteRunId}", false);
91
+ let body;
92
+ return new __HttpRequest({
93
+ protocol,
94
+ hostname,
95
+ port,
96
+ method: "GET",
97
+ headers,
98
+ path: resolvedPath,
99
+ body,
331
100
  });
332
- }); };
333
- export var serializeAws_restJson1UpdateSuiteDefinitionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
334
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
335
- return __generator(this, function (_c) {
336
- switch (_c.label) {
337
- case 0: return [4, context.endpoint()];
338
- case 1:
339
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
340
- headers = {
341
- "content-type": "application/json",
342
- };
343
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/suiteDefinitions/{suiteDefinitionId}";
344
- resolvedPath = __resolvedPath(resolvedPath, input, "suiteDefinitionId", function () { return input.suiteDefinitionId; }, "{suiteDefinitionId}", false);
345
- body = JSON.stringify(__assign({}, (input.suiteDefinitionConfiguration != null && {
346
- suiteDefinitionConfiguration: serializeAws_restJson1SuiteDefinitionConfiguration(input.suiteDefinitionConfiguration, context),
347
- })));
348
- return [2, new __HttpRequest({
349
- protocol: protocol,
350
- hostname: hostname,
351
- port: port,
352
- method: "PATCH",
353
- headers: headers,
354
- path: resolvedPath,
355
- body: body,
356
- })];
357
- }
101
+ };
102
+ export const serializeAws_restJson1GetSuiteRunReportCommand = async (input, context) => {
103
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
104
+ const headers = {};
105
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
106
+ "/suiteDefinitions/{suiteDefinitionId}/suiteRuns/{suiteRunId}/report";
107
+ resolvedPath = __resolvedPath(resolvedPath, input, "suiteDefinitionId", () => input.suiteDefinitionId, "{suiteDefinitionId}", false);
108
+ resolvedPath = __resolvedPath(resolvedPath, input, "suiteRunId", () => input.suiteRunId, "{suiteRunId}", false);
109
+ let body;
110
+ return new __HttpRequest({
111
+ protocol,
112
+ hostname,
113
+ port,
114
+ method: "GET",
115
+ headers,
116
+ path: resolvedPath,
117
+ body,
358
118
  });
359
- }); };
360
- export var deserializeAws_restJson1CreateSuiteDefinitionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
361
- var contents, data, _a, _b;
362
- return __generator(this, function (_c) {
363
- switch (_c.label) {
364
- case 0:
365
- if (output.statusCode !== 200 && output.statusCode >= 300) {
366
- return [2, deserializeAws_restJson1CreateSuiteDefinitionCommandError(output, context)];
367
- }
368
- contents = map({
369
- $metadata: deserializeMetadata(output),
370
- });
371
- _a = __expectNonNull;
372
- _b = __expectObject;
373
- return [4, parseBody(output.body, context)];
374
- case 1:
375
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
376
- if (data.createdAt != null) {
377
- contents.createdAt = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.createdAt)));
378
- }
379
- if (data.suiteDefinitionArn != null) {
380
- contents.suiteDefinitionArn = __expectString(data.suiteDefinitionArn);
381
- }
382
- if (data.suiteDefinitionId != null) {
383
- contents.suiteDefinitionId = __expectString(data.suiteDefinitionId);
384
- }
385
- if (data.suiteDefinitionName != null) {
386
- contents.suiteDefinitionName = __expectString(data.suiteDefinitionName);
387
- }
388
- return [2, contents];
389
- }
119
+ };
120
+ export const serializeAws_restJson1ListSuiteDefinitionsCommand = async (input, context) => {
121
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
122
+ const headers = {};
123
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/suiteDefinitions";
124
+ const query = map({
125
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
126
+ nextToken: [, input.nextToken],
390
127
  });
391
- }); };
392
- var deserializeAws_restJson1CreateSuiteDefinitionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
393
- var parsedOutput, _a, errorCode, _b, parsedBody;
394
- var _c;
395
- return __generator(this, function (_d) {
396
- switch (_d.label) {
397
- case 0:
398
- _a = [__assign({}, output)];
399
- _c = {};
400
- return [4, parseErrorBody(output.body, context)];
401
- case 1:
402
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
403
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
404
- _b = errorCode;
405
- switch (_b) {
406
- case "InternalServerException": return [3, 2];
407
- case "com.amazonaws.iotdeviceadvisor#InternalServerException": return [3, 2];
408
- case "ValidationException": return [3, 4];
409
- case "com.amazonaws.iotdeviceadvisor#ValidationException": return [3, 4];
410
- }
411
- return [3, 6];
412
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
413
- case 3: throw _d.sent();
414
- case 4: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
415
- case 5: throw _d.sent();
416
- case 6:
417
- parsedBody = parsedOutput.body;
418
- throwDefaultError({
419
- output: output,
420
- parsedBody: parsedBody,
421
- exceptionCtor: __BaseException,
422
- errorCode: errorCode,
423
- });
424
- _d.label = 7;
425
- case 7: return [2];
426
- }
128
+ let body;
129
+ return new __HttpRequest({
130
+ protocol,
131
+ hostname,
132
+ port,
133
+ method: "GET",
134
+ headers,
135
+ path: resolvedPath,
136
+ query,
137
+ body,
427
138
  });
428
- }); };
429
- export var deserializeAws_restJson1DeleteSuiteDefinitionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
430
- var contents;
431
- return __generator(this, function (_a) {
432
- switch (_a.label) {
433
- case 0:
434
- if (output.statusCode !== 200 && output.statusCode >= 300) {
435
- return [2, deserializeAws_restJson1DeleteSuiteDefinitionCommandError(output, context)];
436
- }
437
- contents = map({
438
- $metadata: deserializeMetadata(output),
439
- });
440
- return [4, collectBody(output.body, context)];
441
- case 1:
442
- _a.sent();
443
- return [2, contents];
444
- }
139
+ };
140
+ export const serializeAws_restJson1ListSuiteRunsCommand = async (input, context) => {
141
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
142
+ const headers = {};
143
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/suiteRuns";
144
+ const query = map({
145
+ suiteDefinitionId: [, input.suiteDefinitionId],
146
+ suiteDefinitionVersion: [, input.suiteDefinitionVersion],
147
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
148
+ nextToken: [, input.nextToken],
445
149
  });
446
- }); };
447
- var deserializeAws_restJson1DeleteSuiteDefinitionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
448
- var parsedOutput, _a, errorCode, _b, parsedBody;
449
- var _c;
450
- return __generator(this, function (_d) {
451
- switch (_d.label) {
452
- case 0:
453
- _a = [__assign({}, output)];
454
- _c = {};
455
- return [4, parseErrorBody(output.body, context)];
456
- case 1:
457
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
458
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
459
- _b = errorCode;
460
- switch (_b) {
461
- case "InternalServerException": return [3, 2];
462
- case "com.amazonaws.iotdeviceadvisor#InternalServerException": return [3, 2];
463
- case "ValidationException": return [3, 4];
464
- case "com.amazonaws.iotdeviceadvisor#ValidationException": return [3, 4];
465
- }
466
- return [3, 6];
467
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
468
- case 3: throw _d.sent();
469
- case 4: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
470
- case 5: throw _d.sent();
471
- case 6:
472
- parsedBody = parsedOutput.body;
473
- throwDefaultError({
474
- output: output,
475
- parsedBody: parsedBody,
476
- exceptionCtor: __BaseException,
477
- errorCode: errorCode,
478
- });
479
- _d.label = 7;
480
- case 7: return [2];
481
- }
150
+ let body;
151
+ return new __HttpRequest({
152
+ protocol,
153
+ hostname,
154
+ port,
155
+ method: "GET",
156
+ headers,
157
+ path: resolvedPath,
158
+ query,
159
+ body,
482
160
  });
483
- }); };
484
- export var deserializeAws_restJson1GetEndpointCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
485
- var contents, data, _a, _b;
486
- return __generator(this, function (_c) {
487
- switch (_c.label) {
488
- case 0:
489
- if (output.statusCode !== 200 && output.statusCode >= 300) {
490
- return [2, deserializeAws_restJson1GetEndpointCommandError(output, context)];
491
- }
492
- contents = map({
493
- $metadata: deserializeMetadata(output),
494
- });
495
- _a = __expectNonNull;
496
- _b = __expectObject;
497
- return [4, parseBody(output.body, context)];
498
- case 1:
499
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
500
- if (data.endpoint != null) {
501
- contents.endpoint = __expectString(data.endpoint);
502
- }
503
- return [2, contents];
504
- }
161
+ };
162
+ export const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
163
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
164
+ const headers = {};
165
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
166
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
167
+ let body;
168
+ return new __HttpRequest({
169
+ protocol,
170
+ hostname,
171
+ port,
172
+ method: "GET",
173
+ headers,
174
+ path: resolvedPath,
175
+ body,
505
176
  });
506
- }); };
507
- var deserializeAws_restJson1GetEndpointCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
508
- var parsedOutput, _a, errorCode, _b, parsedBody;
509
- var _c;
510
- return __generator(this, function (_d) {
511
- switch (_d.label) {
512
- case 0:
513
- _a = [__assign({}, output)];
514
- _c = {};
515
- return [4, parseErrorBody(output.body, context)];
516
- case 1:
517
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
518
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
519
- _b = errorCode;
520
- switch (_b) {
521
- case "InternalServerException": return [3, 2];
522
- case "com.amazonaws.iotdeviceadvisor#InternalServerException": return [3, 2];
523
- case "ResourceNotFoundException": return [3, 4];
524
- case "com.amazonaws.iotdeviceadvisor#ResourceNotFoundException": return [3, 4];
525
- case "ValidationException": return [3, 6];
526
- case "com.amazonaws.iotdeviceadvisor#ValidationException": return [3, 6];
527
- }
528
- return [3, 8];
529
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
530
- case 3: throw _d.sent();
531
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
532
- case 5: throw _d.sent();
533
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
534
- case 7: throw _d.sent();
535
- case 8:
536
- parsedBody = parsedOutput.body;
537
- throwDefaultError({
538
- output: output,
539
- parsedBody: parsedBody,
540
- exceptionCtor: __BaseException,
541
- errorCode: errorCode,
542
- });
543
- _d.label = 9;
544
- case 9: return [2];
545
- }
177
+ };
178
+ export const serializeAws_restJson1StartSuiteRunCommand = async (input, context) => {
179
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
180
+ const headers = {
181
+ "content-type": "application/json",
182
+ };
183
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
184
+ "/suiteDefinitions/{suiteDefinitionId}/suiteRuns";
185
+ resolvedPath = __resolvedPath(resolvedPath, input, "suiteDefinitionId", () => input.suiteDefinitionId, "{suiteDefinitionId}", false);
186
+ let body;
187
+ body = JSON.stringify({
188
+ ...(input.suiteDefinitionVersion != null && { suiteDefinitionVersion: input.suiteDefinitionVersion }),
189
+ ...(input.suiteRunConfiguration != null && {
190
+ suiteRunConfiguration: serializeAws_restJson1SuiteRunConfiguration(input.suiteRunConfiguration, context),
191
+ }),
192
+ ...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
546
193
  });
547
- }); };
548
- export var deserializeAws_restJson1GetSuiteDefinitionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
549
- var contents, data, _a, _b;
550
- return __generator(this, function (_c) {
551
- switch (_c.label) {
552
- case 0:
553
- if (output.statusCode !== 200 && output.statusCode >= 300) {
554
- return [2, deserializeAws_restJson1GetSuiteDefinitionCommandError(output, context)];
555
- }
556
- contents = map({
557
- $metadata: deserializeMetadata(output),
558
- });
559
- _a = __expectNonNull;
560
- _b = __expectObject;
561
- return [4, parseBody(output.body, context)];
562
- case 1:
563
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
564
- if (data.createdAt != null) {
565
- contents.createdAt = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.createdAt)));
566
- }
567
- if (data.lastModifiedAt != null) {
568
- contents.lastModifiedAt = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.lastModifiedAt)));
569
- }
570
- if (data.latestVersion != null) {
571
- contents.latestVersion = __expectString(data.latestVersion);
572
- }
573
- if (data.suiteDefinitionArn != null) {
574
- contents.suiteDefinitionArn = __expectString(data.suiteDefinitionArn);
575
- }
576
- if (data.suiteDefinitionConfiguration != null) {
577
- contents.suiteDefinitionConfiguration = deserializeAws_restJson1SuiteDefinitionConfiguration(data.suiteDefinitionConfiguration, context);
578
- }
579
- if (data.suiteDefinitionId != null) {
580
- contents.suiteDefinitionId = __expectString(data.suiteDefinitionId);
581
- }
582
- if (data.suiteDefinitionVersion != null) {
583
- contents.suiteDefinitionVersion = __expectString(data.suiteDefinitionVersion);
584
- }
585
- if (data.tags != null) {
586
- contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
587
- }
588
- return [2, contents];
589
- }
194
+ return new __HttpRequest({
195
+ protocol,
196
+ hostname,
197
+ port,
198
+ method: "POST",
199
+ headers,
200
+ path: resolvedPath,
201
+ body,
590
202
  });
591
- }); };
592
- var deserializeAws_restJson1GetSuiteDefinitionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
593
- var parsedOutput, _a, errorCode, _b, parsedBody;
594
- var _c;
595
- return __generator(this, function (_d) {
596
- switch (_d.label) {
597
- case 0:
598
- _a = [__assign({}, output)];
599
- _c = {};
600
- return [4, parseErrorBody(output.body, context)];
601
- case 1:
602
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
603
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
604
- _b = errorCode;
605
- switch (_b) {
606
- case "InternalServerException": return [3, 2];
607
- case "com.amazonaws.iotdeviceadvisor#InternalServerException": return [3, 2];
608
- case "ResourceNotFoundException": return [3, 4];
609
- case "com.amazonaws.iotdeviceadvisor#ResourceNotFoundException": return [3, 4];
610
- case "ValidationException": return [3, 6];
611
- case "com.amazonaws.iotdeviceadvisor#ValidationException": return [3, 6];
612
- }
613
- return [3, 8];
614
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
615
- case 3: throw _d.sent();
616
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
617
- case 5: throw _d.sent();
618
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
619
- case 7: throw _d.sent();
620
- case 8:
621
- parsedBody = parsedOutput.body;
622
- throwDefaultError({
623
- output: output,
624
- parsedBody: parsedBody,
625
- exceptionCtor: __BaseException,
626
- errorCode: errorCode,
627
- });
628
- _d.label = 9;
629
- case 9: return [2];
630
- }
203
+ };
204
+ export const serializeAws_restJson1StopSuiteRunCommand = async (input, context) => {
205
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
206
+ const headers = {};
207
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
208
+ "/suiteDefinitions/{suiteDefinitionId}/suiteRuns/{suiteRunId}/stop";
209
+ resolvedPath = __resolvedPath(resolvedPath, input, "suiteDefinitionId", () => input.suiteDefinitionId, "{suiteDefinitionId}", false);
210
+ resolvedPath = __resolvedPath(resolvedPath, input, "suiteRunId", () => input.suiteRunId, "{suiteRunId}", false);
211
+ let body;
212
+ return new __HttpRequest({
213
+ protocol,
214
+ hostname,
215
+ port,
216
+ method: "POST",
217
+ headers,
218
+ path: resolvedPath,
219
+ body,
631
220
  });
632
- }); };
633
- export var deserializeAws_restJson1GetSuiteRunCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
634
- var contents, data, _a, _b;
635
- return __generator(this, function (_c) {
636
- switch (_c.label) {
637
- case 0:
638
- if (output.statusCode !== 200 && output.statusCode >= 300) {
639
- return [2, deserializeAws_restJson1GetSuiteRunCommandError(output, context)];
640
- }
641
- contents = map({
642
- $metadata: deserializeMetadata(output),
643
- });
644
- _a = __expectNonNull;
645
- _b = __expectObject;
646
- return [4, parseBody(output.body, context)];
647
- case 1:
648
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
649
- if (data.endTime != null) {
650
- contents.endTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.endTime)));
651
- }
652
- if (data.errorReason != null) {
653
- contents.errorReason = __expectString(data.errorReason);
654
- }
655
- if (data.startTime != null) {
656
- contents.startTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.startTime)));
657
- }
658
- if (data.status != null) {
659
- contents.status = __expectString(data.status);
660
- }
661
- if (data.suiteDefinitionId != null) {
662
- contents.suiteDefinitionId = __expectString(data.suiteDefinitionId);
663
- }
664
- if (data.suiteDefinitionVersion != null) {
665
- contents.suiteDefinitionVersion = __expectString(data.suiteDefinitionVersion);
666
- }
667
- if (data.suiteRunArn != null) {
668
- contents.suiteRunArn = __expectString(data.suiteRunArn);
669
- }
670
- if (data.suiteRunConfiguration != null) {
671
- contents.suiteRunConfiguration = deserializeAws_restJson1SuiteRunConfiguration(data.suiteRunConfiguration, context);
672
- }
673
- if (data.suiteRunId != null) {
674
- contents.suiteRunId = __expectString(data.suiteRunId);
675
- }
676
- if (data.tags != null) {
677
- contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
678
- }
679
- if (data.testResult != null) {
680
- contents.testResult = deserializeAws_restJson1TestResult(data.testResult, context);
681
- }
682
- return [2, contents];
683
- }
221
+ };
222
+ export const serializeAws_restJson1TagResourceCommand = async (input, context) => {
223
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
224
+ const headers = {
225
+ "content-type": "application/json",
226
+ };
227
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
228
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
229
+ let body;
230
+ body = JSON.stringify({
231
+ ...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
684
232
  });
685
- }); };
686
- var deserializeAws_restJson1GetSuiteRunCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
687
- var parsedOutput, _a, errorCode, _b, parsedBody;
688
- var _c;
689
- return __generator(this, function (_d) {
690
- switch (_d.label) {
691
- case 0:
692
- _a = [__assign({}, output)];
693
- _c = {};
694
- return [4, parseErrorBody(output.body, context)];
695
- case 1:
696
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
697
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
698
- _b = errorCode;
699
- switch (_b) {
700
- case "InternalServerException": return [3, 2];
701
- case "com.amazonaws.iotdeviceadvisor#InternalServerException": return [3, 2];
702
- case "ResourceNotFoundException": return [3, 4];
703
- case "com.amazonaws.iotdeviceadvisor#ResourceNotFoundException": return [3, 4];
704
- case "ValidationException": return [3, 6];
705
- case "com.amazonaws.iotdeviceadvisor#ValidationException": return [3, 6];
706
- }
707
- return [3, 8];
708
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
709
- case 3: throw _d.sent();
710
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
711
- case 5: throw _d.sent();
712
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
713
- case 7: throw _d.sent();
714
- case 8:
715
- parsedBody = parsedOutput.body;
716
- throwDefaultError({
717
- output: output,
718
- parsedBody: parsedBody,
719
- exceptionCtor: __BaseException,
720
- errorCode: errorCode,
721
- });
722
- _d.label = 9;
723
- case 9: return [2];
724
- }
233
+ return new __HttpRequest({
234
+ protocol,
235
+ hostname,
236
+ port,
237
+ method: "POST",
238
+ headers,
239
+ path: resolvedPath,
240
+ body,
725
241
  });
726
- }); };
727
- export var deserializeAws_restJson1GetSuiteRunReportCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
728
- var contents, data, _a, _b;
729
- return __generator(this, function (_c) {
730
- switch (_c.label) {
731
- case 0:
732
- if (output.statusCode !== 200 && output.statusCode >= 300) {
733
- return [2, deserializeAws_restJson1GetSuiteRunReportCommandError(output, context)];
734
- }
735
- contents = map({
736
- $metadata: deserializeMetadata(output),
737
- });
738
- _a = __expectNonNull;
739
- _b = __expectObject;
740
- return [4, parseBody(output.body, context)];
741
- case 1:
742
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
743
- if (data.qualificationReportDownloadUrl != null) {
744
- contents.qualificationReportDownloadUrl = __expectString(data.qualificationReportDownloadUrl);
745
- }
746
- return [2, contents];
747
- }
242
+ };
243
+ export const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
244
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
245
+ const headers = {};
246
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
247
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
248
+ const query = map({
249
+ tagKeys: [() => input.tagKeys !== void 0, () => (input.tagKeys || []).map((_entry) => _entry)],
748
250
  });
749
- }); };
750
- var deserializeAws_restJson1GetSuiteRunReportCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
751
- var parsedOutput, _a, errorCode, _b, parsedBody;
752
- var _c;
753
- return __generator(this, function (_d) {
754
- switch (_d.label) {
755
- case 0:
756
- _a = [__assign({}, output)];
757
- _c = {};
758
- return [4, parseErrorBody(output.body, context)];
759
- case 1:
760
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
761
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
762
- _b = errorCode;
763
- switch (_b) {
764
- case "InternalServerException": return [3, 2];
765
- case "com.amazonaws.iotdeviceadvisor#InternalServerException": return [3, 2];
766
- case "ResourceNotFoundException": return [3, 4];
767
- case "com.amazonaws.iotdeviceadvisor#ResourceNotFoundException": return [3, 4];
768
- case "ValidationException": return [3, 6];
769
- case "com.amazonaws.iotdeviceadvisor#ValidationException": return [3, 6];
770
- }
771
- return [3, 8];
772
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
773
- case 3: throw _d.sent();
774
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
775
- case 5: throw _d.sent();
776
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
777
- case 7: throw _d.sent();
778
- case 8:
779
- parsedBody = parsedOutput.body;
780
- throwDefaultError({
781
- output: output,
782
- parsedBody: parsedBody,
783
- exceptionCtor: __BaseException,
784
- errorCode: errorCode,
785
- });
786
- _d.label = 9;
787
- case 9: return [2];
788
- }
251
+ let body;
252
+ return new __HttpRequest({
253
+ protocol,
254
+ hostname,
255
+ port,
256
+ method: "DELETE",
257
+ headers,
258
+ path: resolvedPath,
259
+ query,
260
+ body,
789
261
  });
790
- }); };
791
- export var deserializeAws_restJson1ListSuiteDefinitionsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
792
- var contents, data, _a, _b;
793
- return __generator(this, function (_c) {
794
- switch (_c.label) {
795
- case 0:
796
- if (output.statusCode !== 200 && output.statusCode >= 300) {
797
- return [2, deserializeAws_restJson1ListSuiteDefinitionsCommandError(output, context)];
798
- }
799
- contents = map({
800
- $metadata: deserializeMetadata(output),
801
- });
802
- _a = __expectNonNull;
803
- _b = __expectObject;
804
- return [4, parseBody(output.body, context)];
805
- case 1:
806
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
807
- if (data.nextToken != null) {
808
- contents.nextToken = __expectString(data.nextToken);
809
- }
810
- if (data.suiteDefinitionInformationList != null) {
811
- contents.suiteDefinitionInformationList = deserializeAws_restJson1SuiteDefinitionInformationList(data.suiteDefinitionInformationList, context);
812
- }
813
- return [2, contents];
814
- }
262
+ };
263
+ export const serializeAws_restJson1UpdateSuiteDefinitionCommand = async (input, context) => {
264
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
265
+ const headers = {
266
+ "content-type": "application/json",
267
+ };
268
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/suiteDefinitions/{suiteDefinitionId}";
269
+ resolvedPath = __resolvedPath(resolvedPath, input, "suiteDefinitionId", () => input.suiteDefinitionId, "{suiteDefinitionId}", false);
270
+ let body;
271
+ body = JSON.stringify({
272
+ ...(input.suiteDefinitionConfiguration != null && {
273
+ suiteDefinitionConfiguration: serializeAws_restJson1SuiteDefinitionConfiguration(input.suiteDefinitionConfiguration, context),
274
+ }),
815
275
  });
816
- }); };
817
- var deserializeAws_restJson1ListSuiteDefinitionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
818
- var parsedOutput, _a, errorCode, _b, parsedBody;
819
- var _c;
820
- return __generator(this, function (_d) {
821
- switch (_d.label) {
822
- case 0:
823
- _a = [__assign({}, output)];
824
- _c = {};
825
- return [4, parseErrorBody(output.body, context)];
826
- case 1:
827
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
828
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
829
- _b = errorCode;
830
- switch (_b) {
831
- case "InternalServerException": return [3, 2];
832
- case "com.amazonaws.iotdeviceadvisor#InternalServerException": return [3, 2];
833
- case "ValidationException": return [3, 4];
834
- case "com.amazonaws.iotdeviceadvisor#ValidationException": return [3, 4];
835
- }
836
- return [3, 6];
837
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
838
- case 3: throw _d.sent();
839
- case 4: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
840
- case 5: throw _d.sent();
841
- case 6:
842
- parsedBody = parsedOutput.body;
843
- throwDefaultError({
844
- output: output,
845
- parsedBody: parsedBody,
846
- exceptionCtor: __BaseException,
847
- errorCode: errorCode,
848
- });
849
- _d.label = 7;
850
- case 7: return [2];
851
- }
276
+ return new __HttpRequest({
277
+ protocol,
278
+ hostname,
279
+ port,
280
+ method: "PATCH",
281
+ headers,
282
+ path: resolvedPath,
283
+ body,
852
284
  });
853
- }); };
854
- export var deserializeAws_restJson1ListSuiteRunsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
855
- var contents, data, _a, _b;
856
- return __generator(this, function (_c) {
857
- switch (_c.label) {
858
- case 0:
859
- if (output.statusCode !== 200 && output.statusCode >= 300) {
860
- return [2, deserializeAws_restJson1ListSuiteRunsCommandError(output, context)];
861
- }
862
- contents = map({
863
- $metadata: deserializeMetadata(output),
864
- });
865
- _a = __expectNonNull;
866
- _b = __expectObject;
867
- return [4, parseBody(output.body, context)];
868
- case 1:
869
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
870
- if (data.nextToken != null) {
871
- contents.nextToken = __expectString(data.nextToken);
872
- }
873
- if (data.suiteRunsList != null) {
874
- contents.suiteRunsList = deserializeAws_restJson1SuiteRunsList(data.suiteRunsList, context);
875
- }
876
- return [2, contents];
877
- }
285
+ };
286
+ export const deserializeAws_restJson1CreateSuiteDefinitionCommand = async (output, context) => {
287
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
288
+ return deserializeAws_restJson1CreateSuiteDefinitionCommandError(output, context);
289
+ }
290
+ const contents = map({
291
+ $metadata: deserializeMetadata(output),
878
292
  });
879
- }); };
880
- var deserializeAws_restJson1ListSuiteRunsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
881
- var parsedOutput, _a, errorCode, _b, parsedBody;
882
- var _c;
883
- return __generator(this, function (_d) {
884
- switch (_d.label) {
885
- case 0:
886
- _a = [__assign({}, output)];
887
- _c = {};
888
- return [4, parseErrorBody(output.body, context)];
889
- case 1:
890
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
891
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
892
- _b = errorCode;
893
- switch (_b) {
894
- case "InternalServerException": return [3, 2];
895
- case "com.amazonaws.iotdeviceadvisor#InternalServerException": return [3, 2];
896
- case "ValidationException": return [3, 4];
897
- case "com.amazonaws.iotdeviceadvisor#ValidationException": return [3, 4];
898
- }
899
- return [3, 6];
900
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
901
- case 3: throw _d.sent();
902
- case 4: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
903
- case 5: throw _d.sent();
904
- case 6:
905
- parsedBody = parsedOutput.body;
906
- throwDefaultError({
907
- output: output,
908
- parsedBody: parsedBody,
909
- exceptionCtor: __BaseException,
910
- errorCode: errorCode,
911
- });
912
- _d.label = 7;
913
- case 7: return [2];
914
- }
293
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
294
+ if (data.createdAt != null) {
295
+ contents.createdAt = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.createdAt)));
296
+ }
297
+ if (data.suiteDefinitionArn != null) {
298
+ contents.suiteDefinitionArn = __expectString(data.suiteDefinitionArn);
299
+ }
300
+ if (data.suiteDefinitionId != null) {
301
+ contents.suiteDefinitionId = __expectString(data.suiteDefinitionId);
302
+ }
303
+ if (data.suiteDefinitionName != null) {
304
+ contents.suiteDefinitionName = __expectString(data.suiteDefinitionName);
305
+ }
306
+ return contents;
307
+ };
308
+ const deserializeAws_restJson1CreateSuiteDefinitionCommandError = async (output, context) => {
309
+ const parsedOutput = {
310
+ ...output,
311
+ body: await parseErrorBody(output.body, context),
312
+ };
313
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
314
+ switch (errorCode) {
315
+ case "InternalServerException":
316
+ case "com.amazonaws.iotdeviceadvisor#InternalServerException":
317
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
318
+ case "ValidationException":
319
+ case "com.amazonaws.iotdeviceadvisor#ValidationException":
320
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
321
+ default:
322
+ const parsedBody = parsedOutput.body;
323
+ throwDefaultError({
324
+ output,
325
+ parsedBody,
326
+ exceptionCtor: __BaseException,
327
+ errorCode,
328
+ });
329
+ }
330
+ };
331
+ export const deserializeAws_restJson1DeleteSuiteDefinitionCommand = async (output, context) => {
332
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
333
+ return deserializeAws_restJson1DeleteSuiteDefinitionCommandError(output, context);
334
+ }
335
+ const contents = map({
336
+ $metadata: deserializeMetadata(output),
915
337
  });
916
- }); };
917
- export var deserializeAws_restJson1ListTagsForResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
918
- var contents, data, _a, _b;
919
- return __generator(this, function (_c) {
920
- switch (_c.label) {
921
- case 0:
922
- if (output.statusCode !== 200 && output.statusCode >= 300) {
923
- return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
924
- }
925
- contents = map({
926
- $metadata: deserializeMetadata(output),
927
- });
928
- _a = __expectNonNull;
929
- _b = __expectObject;
930
- return [4, parseBody(output.body, context)];
931
- case 1:
932
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
933
- if (data.tags != null) {
934
- contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
935
- }
936
- return [2, contents];
937
- }
338
+ await collectBody(output.body, context);
339
+ return contents;
340
+ };
341
+ const deserializeAws_restJson1DeleteSuiteDefinitionCommandError = async (output, context) => {
342
+ const parsedOutput = {
343
+ ...output,
344
+ body: await parseErrorBody(output.body, context),
345
+ };
346
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
347
+ switch (errorCode) {
348
+ case "InternalServerException":
349
+ case "com.amazonaws.iotdeviceadvisor#InternalServerException":
350
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
351
+ case "ValidationException":
352
+ case "com.amazonaws.iotdeviceadvisor#ValidationException":
353
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
354
+ default:
355
+ const parsedBody = parsedOutput.body;
356
+ throwDefaultError({
357
+ output,
358
+ parsedBody,
359
+ exceptionCtor: __BaseException,
360
+ errorCode,
361
+ });
362
+ }
363
+ };
364
+ export const deserializeAws_restJson1GetEndpointCommand = async (output, context) => {
365
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
366
+ return deserializeAws_restJson1GetEndpointCommandError(output, context);
367
+ }
368
+ const contents = map({
369
+ $metadata: deserializeMetadata(output),
938
370
  });
939
- }); };
940
- var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
941
- var parsedOutput, _a, errorCode, _b, parsedBody;
942
- var _c;
943
- return __generator(this, function (_d) {
944
- switch (_d.label) {
945
- case 0:
946
- _a = [__assign({}, output)];
947
- _c = {};
948
- return [4, parseErrorBody(output.body, context)];
949
- case 1:
950
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
951
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
952
- _b = errorCode;
953
- switch (_b) {
954
- case "InternalServerException": return [3, 2];
955
- case "com.amazonaws.iotdeviceadvisor#InternalServerException": return [3, 2];
956
- case "ResourceNotFoundException": return [3, 4];
957
- case "com.amazonaws.iotdeviceadvisor#ResourceNotFoundException": return [3, 4];
958
- case "ValidationException": return [3, 6];
959
- case "com.amazonaws.iotdeviceadvisor#ValidationException": return [3, 6];
960
- }
961
- return [3, 8];
962
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
963
- case 3: throw _d.sent();
964
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
965
- case 5: throw _d.sent();
966
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
967
- case 7: throw _d.sent();
968
- case 8:
969
- parsedBody = parsedOutput.body;
970
- throwDefaultError({
971
- output: output,
972
- parsedBody: parsedBody,
973
- exceptionCtor: __BaseException,
974
- errorCode: errorCode,
975
- });
976
- _d.label = 9;
977
- case 9: return [2];
978
- }
371
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
372
+ if (data.endpoint != null) {
373
+ contents.endpoint = __expectString(data.endpoint);
374
+ }
375
+ return contents;
376
+ };
377
+ const deserializeAws_restJson1GetEndpointCommandError = async (output, context) => {
378
+ const parsedOutput = {
379
+ ...output,
380
+ body: await parseErrorBody(output.body, context),
381
+ };
382
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
383
+ switch (errorCode) {
384
+ case "InternalServerException":
385
+ case "com.amazonaws.iotdeviceadvisor#InternalServerException":
386
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
387
+ case "ResourceNotFoundException":
388
+ case "com.amazonaws.iotdeviceadvisor#ResourceNotFoundException":
389
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
390
+ case "ValidationException":
391
+ case "com.amazonaws.iotdeviceadvisor#ValidationException":
392
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
393
+ default:
394
+ const parsedBody = parsedOutput.body;
395
+ throwDefaultError({
396
+ output,
397
+ parsedBody,
398
+ exceptionCtor: __BaseException,
399
+ errorCode,
400
+ });
401
+ }
402
+ };
403
+ export const deserializeAws_restJson1GetSuiteDefinitionCommand = async (output, context) => {
404
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
405
+ return deserializeAws_restJson1GetSuiteDefinitionCommandError(output, context);
406
+ }
407
+ const contents = map({
408
+ $metadata: deserializeMetadata(output),
979
409
  });
980
- }); };
981
- export var deserializeAws_restJson1StartSuiteRunCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
982
- var contents, data, _a, _b;
983
- return __generator(this, function (_c) {
984
- switch (_c.label) {
985
- case 0:
986
- if (output.statusCode !== 200 && output.statusCode >= 300) {
987
- return [2, deserializeAws_restJson1StartSuiteRunCommandError(output, context)];
988
- }
989
- contents = map({
990
- $metadata: deserializeMetadata(output),
991
- });
992
- _a = __expectNonNull;
993
- _b = __expectObject;
994
- return [4, parseBody(output.body, context)];
995
- case 1:
996
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
997
- if (data.createdAt != null) {
998
- contents.createdAt = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.createdAt)));
999
- }
1000
- if (data.suiteRunArn != null) {
1001
- contents.suiteRunArn = __expectString(data.suiteRunArn);
1002
- }
1003
- if (data.suiteRunId != null) {
1004
- contents.suiteRunId = __expectString(data.suiteRunId);
1005
- }
1006
- return [2, contents];
1007
- }
410
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
411
+ if (data.createdAt != null) {
412
+ contents.createdAt = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.createdAt)));
413
+ }
414
+ if (data.lastModifiedAt != null) {
415
+ contents.lastModifiedAt = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.lastModifiedAt)));
416
+ }
417
+ if (data.latestVersion != null) {
418
+ contents.latestVersion = __expectString(data.latestVersion);
419
+ }
420
+ if (data.suiteDefinitionArn != null) {
421
+ contents.suiteDefinitionArn = __expectString(data.suiteDefinitionArn);
422
+ }
423
+ if (data.suiteDefinitionConfiguration != null) {
424
+ contents.suiteDefinitionConfiguration = deserializeAws_restJson1SuiteDefinitionConfiguration(data.suiteDefinitionConfiguration, context);
425
+ }
426
+ if (data.suiteDefinitionId != null) {
427
+ contents.suiteDefinitionId = __expectString(data.suiteDefinitionId);
428
+ }
429
+ if (data.suiteDefinitionVersion != null) {
430
+ contents.suiteDefinitionVersion = __expectString(data.suiteDefinitionVersion);
431
+ }
432
+ if (data.tags != null) {
433
+ contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
434
+ }
435
+ return contents;
436
+ };
437
+ const deserializeAws_restJson1GetSuiteDefinitionCommandError = async (output, context) => {
438
+ const parsedOutput = {
439
+ ...output,
440
+ body: await parseErrorBody(output.body, context),
441
+ };
442
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
443
+ switch (errorCode) {
444
+ case "InternalServerException":
445
+ case "com.amazonaws.iotdeviceadvisor#InternalServerException":
446
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
447
+ case "ResourceNotFoundException":
448
+ case "com.amazonaws.iotdeviceadvisor#ResourceNotFoundException":
449
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
450
+ case "ValidationException":
451
+ case "com.amazonaws.iotdeviceadvisor#ValidationException":
452
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
453
+ default:
454
+ const parsedBody = parsedOutput.body;
455
+ throwDefaultError({
456
+ output,
457
+ parsedBody,
458
+ exceptionCtor: __BaseException,
459
+ errorCode,
460
+ });
461
+ }
462
+ };
463
+ export const deserializeAws_restJson1GetSuiteRunCommand = async (output, context) => {
464
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
465
+ return deserializeAws_restJson1GetSuiteRunCommandError(output, context);
466
+ }
467
+ const contents = map({
468
+ $metadata: deserializeMetadata(output),
1008
469
  });
1009
- }); };
1010
- var deserializeAws_restJson1StartSuiteRunCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1011
- var parsedOutput, _a, errorCode, _b, parsedBody;
1012
- var _c;
1013
- return __generator(this, function (_d) {
1014
- switch (_d.label) {
1015
- case 0:
1016
- _a = [__assign({}, output)];
1017
- _c = {};
1018
- return [4, parseErrorBody(output.body, context)];
1019
- case 1:
1020
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1021
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1022
- _b = errorCode;
1023
- switch (_b) {
1024
- case "ConflictException": return [3, 2];
1025
- case "com.amazonaws.iotdeviceadvisor#ConflictException": return [3, 2];
1026
- case "InternalServerException": return [3, 4];
1027
- case "com.amazonaws.iotdeviceadvisor#InternalServerException": return [3, 4];
1028
- case "ValidationException": return [3, 6];
1029
- case "com.amazonaws.iotdeviceadvisor#ValidationException": return [3, 6];
1030
- }
1031
- return [3, 8];
1032
- case 2: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1033
- case 3: throw _d.sent();
1034
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1035
- case 5: throw _d.sent();
1036
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1037
- case 7: throw _d.sent();
1038
- case 8:
1039
- parsedBody = parsedOutput.body;
1040
- throwDefaultError({
1041
- output: output,
1042
- parsedBody: parsedBody,
1043
- exceptionCtor: __BaseException,
1044
- errorCode: errorCode,
1045
- });
1046
- _d.label = 9;
1047
- case 9: return [2];
1048
- }
470
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
471
+ if (data.endTime != null) {
472
+ contents.endTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.endTime)));
473
+ }
474
+ if (data.errorReason != null) {
475
+ contents.errorReason = __expectString(data.errorReason);
476
+ }
477
+ if (data.startTime != null) {
478
+ contents.startTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.startTime)));
479
+ }
480
+ if (data.status != null) {
481
+ contents.status = __expectString(data.status);
482
+ }
483
+ if (data.suiteDefinitionId != null) {
484
+ contents.suiteDefinitionId = __expectString(data.suiteDefinitionId);
485
+ }
486
+ if (data.suiteDefinitionVersion != null) {
487
+ contents.suiteDefinitionVersion = __expectString(data.suiteDefinitionVersion);
488
+ }
489
+ if (data.suiteRunArn != null) {
490
+ contents.suiteRunArn = __expectString(data.suiteRunArn);
491
+ }
492
+ if (data.suiteRunConfiguration != null) {
493
+ contents.suiteRunConfiguration = deserializeAws_restJson1SuiteRunConfiguration(data.suiteRunConfiguration, context);
494
+ }
495
+ if (data.suiteRunId != null) {
496
+ contents.suiteRunId = __expectString(data.suiteRunId);
497
+ }
498
+ if (data.tags != null) {
499
+ contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
500
+ }
501
+ if (data.testResult != null) {
502
+ contents.testResult = deserializeAws_restJson1TestResult(data.testResult, context);
503
+ }
504
+ return contents;
505
+ };
506
+ const deserializeAws_restJson1GetSuiteRunCommandError = async (output, context) => {
507
+ const parsedOutput = {
508
+ ...output,
509
+ body: await parseErrorBody(output.body, context),
510
+ };
511
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
512
+ switch (errorCode) {
513
+ case "InternalServerException":
514
+ case "com.amazonaws.iotdeviceadvisor#InternalServerException":
515
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
516
+ case "ResourceNotFoundException":
517
+ case "com.amazonaws.iotdeviceadvisor#ResourceNotFoundException":
518
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
519
+ case "ValidationException":
520
+ case "com.amazonaws.iotdeviceadvisor#ValidationException":
521
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
522
+ default:
523
+ const parsedBody = parsedOutput.body;
524
+ throwDefaultError({
525
+ output,
526
+ parsedBody,
527
+ exceptionCtor: __BaseException,
528
+ errorCode,
529
+ });
530
+ }
531
+ };
532
+ export const deserializeAws_restJson1GetSuiteRunReportCommand = async (output, context) => {
533
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
534
+ return deserializeAws_restJson1GetSuiteRunReportCommandError(output, context);
535
+ }
536
+ const contents = map({
537
+ $metadata: deserializeMetadata(output),
1049
538
  });
1050
- }); };
1051
- export var deserializeAws_restJson1StopSuiteRunCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1052
- var contents;
1053
- return __generator(this, function (_a) {
1054
- switch (_a.label) {
1055
- case 0:
1056
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1057
- return [2, deserializeAws_restJson1StopSuiteRunCommandError(output, context)];
1058
- }
1059
- contents = map({
1060
- $metadata: deserializeMetadata(output),
1061
- });
1062
- return [4, collectBody(output.body, context)];
1063
- case 1:
1064
- _a.sent();
1065
- return [2, contents];
1066
- }
539
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
540
+ if (data.qualificationReportDownloadUrl != null) {
541
+ contents.qualificationReportDownloadUrl = __expectString(data.qualificationReportDownloadUrl);
542
+ }
543
+ return contents;
544
+ };
545
+ const deserializeAws_restJson1GetSuiteRunReportCommandError = async (output, context) => {
546
+ const parsedOutput = {
547
+ ...output,
548
+ body: await parseErrorBody(output.body, context),
549
+ };
550
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
551
+ switch (errorCode) {
552
+ case "InternalServerException":
553
+ case "com.amazonaws.iotdeviceadvisor#InternalServerException":
554
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
555
+ case "ResourceNotFoundException":
556
+ case "com.amazonaws.iotdeviceadvisor#ResourceNotFoundException":
557
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
558
+ case "ValidationException":
559
+ case "com.amazonaws.iotdeviceadvisor#ValidationException":
560
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
561
+ default:
562
+ const parsedBody = parsedOutput.body;
563
+ throwDefaultError({
564
+ output,
565
+ parsedBody,
566
+ exceptionCtor: __BaseException,
567
+ errorCode,
568
+ });
569
+ }
570
+ };
571
+ export const deserializeAws_restJson1ListSuiteDefinitionsCommand = async (output, context) => {
572
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
573
+ return deserializeAws_restJson1ListSuiteDefinitionsCommandError(output, context);
574
+ }
575
+ const contents = map({
576
+ $metadata: deserializeMetadata(output),
1067
577
  });
1068
- }); };
1069
- var deserializeAws_restJson1StopSuiteRunCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1070
- var parsedOutput, _a, errorCode, _b, parsedBody;
1071
- var _c;
1072
- return __generator(this, function (_d) {
1073
- switch (_d.label) {
1074
- case 0:
1075
- _a = [__assign({}, output)];
1076
- _c = {};
1077
- return [4, parseErrorBody(output.body, context)];
1078
- case 1:
1079
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1080
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1081
- _b = errorCode;
1082
- switch (_b) {
1083
- case "InternalServerException": return [3, 2];
1084
- case "com.amazonaws.iotdeviceadvisor#InternalServerException": return [3, 2];
1085
- case "ResourceNotFoundException": return [3, 4];
1086
- case "com.amazonaws.iotdeviceadvisor#ResourceNotFoundException": return [3, 4];
1087
- case "ValidationException": return [3, 6];
1088
- case "com.amazonaws.iotdeviceadvisor#ValidationException": return [3, 6];
1089
- }
1090
- return [3, 8];
1091
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1092
- case 3: throw _d.sent();
1093
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1094
- case 5: throw _d.sent();
1095
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1096
- case 7: throw _d.sent();
1097
- case 8:
1098
- parsedBody = parsedOutput.body;
1099
- throwDefaultError({
1100
- output: output,
1101
- parsedBody: parsedBody,
1102
- exceptionCtor: __BaseException,
1103
- errorCode: errorCode,
1104
- });
1105
- _d.label = 9;
1106
- case 9: return [2];
1107
- }
578
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
579
+ if (data.nextToken != null) {
580
+ contents.nextToken = __expectString(data.nextToken);
581
+ }
582
+ if (data.suiteDefinitionInformationList != null) {
583
+ contents.suiteDefinitionInformationList = deserializeAws_restJson1SuiteDefinitionInformationList(data.suiteDefinitionInformationList, context);
584
+ }
585
+ return contents;
586
+ };
587
+ const deserializeAws_restJson1ListSuiteDefinitionsCommandError = async (output, context) => {
588
+ const parsedOutput = {
589
+ ...output,
590
+ body: await parseErrorBody(output.body, context),
591
+ };
592
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
593
+ switch (errorCode) {
594
+ case "InternalServerException":
595
+ case "com.amazonaws.iotdeviceadvisor#InternalServerException":
596
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
597
+ case "ValidationException":
598
+ case "com.amazonaws.iotdeviceadvisor#ValidationException":
599
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
600
+ default:
601
+ const parsedBody = parsedOutput.body;
602
+ throwDefaultError({
603
+ output,
604
+ parsedBody,
605
+ exceptionCtor: __BaseException,
606
+ errorCode,
607
+ });
608
+ }
609
+ };
610
+ export const deserializeAws_restJson1ListSuiteRunsCommand = async (output, context) => {
611
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
612
+ return deserializeAws_restJson1ListSuiteRunsCommandError(output, context);
613
+ }
614
+ const contents = map({
615
+ $metadata: deserializeMetadata(output),
1108
616
  });
1109
- }); };
1110
- export var deserializeAws_restJson1TagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1111
- var contents;
1112
- return __generator(this, function (_a) {
1113
- switch (_a.label) {
1114
- case 0:
1115
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1116
- return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
1117
- }
1118
- contents = map({
1119
- $metadata: deserializeMetadata(output),
1120
- });
1121
- return [4, collectBody(output.body, context)];
1122
- case 1:
1123
- _a.sent();
1124
- return [2, contents];
1125
- }
617
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
618
+ if (data.nextToken != null) {
619
+ contents.nextToken = __expectString(data.nextToken);
620
+ }
621
+ if (data.suiteRunsList != null) {
622
+ contents.suiteRunsList = deserializeAws_restJson1SuiteRunsList(data.suiteRunsList, context);
623
+ }
624
+ return contents;
625
+ };
626
+ const deserializeAws_restJson1ListSuiteRunsCommandError = async (output, context) => {
627
+ const parsedOutput = {
628
+ ...output,
629
+ body: await parseErrorBody(output.body, context),
630
+ };
631
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
632
+ switch (errorCode) {
633
+ case "InternalServerException":
634
+ case "com.amazonaws.iotdeviceadvisor#InternalServerException":
635
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
636
+ case "ValidationException":
637
+ case "com.amazonaws.iotdeviceadvisor#ValidationException":
638
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
639
+ default:
640
+ const parsedBody = parsedOutput.body;
641
+ throwDefaultError({
642
+ output,
643
+ parsedBody,
644
+ exceptionCtor: __BaseException,
645
+ errorCode,
646
+ });
647
+ }
648
+ };
649
+ export const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
650
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
651
+ return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
652
+ }
653
+ const contents = map({
654
+ $metadata: deserializeMetadata(output),
1126
655
  });
1127
- }); };
1128
- var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1129
- var parsedOutput, _a, errorCode, _b, parsedBody;
1130
- var _c;
1131
- return __generator(this, function (_d) {
1132
- switch (_d.label) {
1133
- case 0:
1134
- _a = [__assign({}, output)];
1135
- _c = {};
1136
- return [4, parseErrorBody(output.body, context)];
1137
- case 1:
1138
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1139
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1140
- _b = errorCode;
1141
- switch (_b) {
1142
- case "InternalServerException": return [3, 2];
1143
- case "com.amazonaws.iotdeviceadvisor#InternalServerException": return [3, 2];
1144
- case "ResourceNotFoundException": return [3, 4];
1145
- case "com.amazonaws.iotdeviceadvisor#ResourceNotFoundException": return [3, 4];
1146
- case "ValidationException": return [3, 6];
1147
- case "com.amazonaws.iotdeviceadvisor#ValidationException": return [3, 6];
1148
- }
1149
- return [3, 8];
1150
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1151
- case 3: throw _d.sent();
1152
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1153
- case 5: throw _d.sent();
1154
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1155
- case 7: throw _d.sent();
1156
- case 8:
1157
- parsedBody = parsedOutput.body;
1158
- throwDefaultError({
1159
- output: output,
1160
- parsedBody: parsedBody,
1161
- exceptionCtor: __BaseException,
1162
- errorCode: errorCode,
1163
- });
1164
- _d.label = 9;
1165
- case 9: return [2];
1166
- }
656
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
657
+ if (data.tags != null) {
658
+ contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
659
+ }
660
+ return contents;
661
+ };
662
+ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
663
+ const parsedOutput = {
664
+ ...output,
665
+ body: await parseErrorBody(output.body, context),
666
+ };
667
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
668
+ switch (errorCode) {
669
+ case "InternalServerException":
670
+ case "com.amazonaws.iotdeviceadvisor#InternalServerException":
671
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
672
+ case "ResourceNotFoundException":
673
+ case "com.amazonaws.iotdeviceadvisor#ResourceNotFoundException":
674
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
675
+ case "ValidationException":
676
+ case "com.amazonaws.iotdeviceadvisor#ValidationException":
677
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
678
+ default:
679
+ const parsedBody = parsedOutput.body;
680
+ throwDefaultError({
681
+ output,
682
+ parsedBody,
683
+ exceptionCtor: __BaseException,
684
+ errorCode,
685
+ });
686
+ }
687
+ };
688
+ export const deserializeAws_restJson1StartSuiteRunCommand = async (output, context) => {
689
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
690
+ return deserializeAws_restJson1StartSuiteRunCommandError(output, context);
691
+ }
692
+ const contents = map({
693
+ $metadata: deserializeMetadata(output),
1167
694
  });
1168
- }); };
1169
- export var deserializeAws_restJson1UntagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1170
- var contents;
1171
- return __generator(this, function (_a) {
1172
- switch (_a.label) {
1173
- case 0:
1174
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1175
- return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
1176
- }
1177
- contents = map({
1178
- $metadata: deserializeMetadata(output),
1179
- });
1180
- return [4, collectBody(output.body, context)];
1181
- case 1:
1182
- _a.sent();
1183
- return [2, contents];
1184
- }
695
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
696
+ if (data.createdAt != null) {
697
+ contents.createdAt = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.createdAt)));
698
+ }
699
+ if (data.suiteRunArn != null) {
700
+ contents.suiteRunArn = __expectString(data.suiteRunArn);
701
+ }
702
+ if (data.suiteRunId != null) {
703
+ contents.suiteRunId = __expectString(data.suiteRunId);
704
+ }
705
+ return contents;
706
+ };
707
+ const deserializeAws_restJson1StartSuiteRunCommandError = async (output, context) => {
708
+ const parsedOutput = {
709
+ ...output,
710
+ body: await parseErrorBody(output.body, context),
711
+ };
712
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
713
+ switch (errorCode) {
714
+ case "ConflictException":
715
+ case "com.amazonaws.iotdeviceadvisor#ConflictException":
716
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
717
+ case "InternalServerException":
718
+ case "com.amazonaws.iotdeviceadvisor#InternalServerException":
719
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
720
+ case "ValidationException":
721
+ case "com.amazonaws.iotdeviceadvisor#ValidationException":
722
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
723
+ default:
724
+ const parsedBody = parsedOutput.body;
725
+ throwDefaultError({
726
+ output,
727
+ parsedBody,
728
+ exceptionCtor: __BaseException,
729
+ errorCode,
730
+ });
731
+ }
732
+ };
733
+ export const deserializeAws_restJson1StopSuiteRunCommand = async (output, context) => {
734
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
735
+ return deserializeAws_restJson1StopSuiteRunCommandError(output, context);
736
+ }
737
+ const contents = map({
738
+ $metadata: deserializeMetadata(output),
1185
739
  });
1186
- }); };
1187
- var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1188
- var parsedOutput, _a, errorCode, _b, parsedBody;
1189
- var _c;
1190
- return __generator(this, function (_d) {
1191
- switch (_d.label) {
1192
- case 0:
1193
- _a = [__assign({}, output)];
1194
- _c = {};
1195
- return [4, parseErrorBody(output.body, context)];
1196
- case 1:
1197
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1198
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1199
- _b = errorCode;
1200
- switch (_b) {
1201
- case "InternalServerException": return [3, 2];
1202
- case "com.amazonaws.iotdeviceadvisor#InternalServerException": return [3, 2];
1203
- case "ResourceNotFoundException": return [3, 4];
1204
- case "com.amazonaws.iotdeviceadvisor#ResourceNotFoundException": return [3, 4];
1205
- case "ValidationException": return [3, 6];
1206
- case "com.amazonaws.iotdeviceadvisor#ValidationException": return [3, 6];
1207
- }
1208
- return [3, 8];
1209
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1210
- case 3: throw _d.sent();
1211
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1212
- case 5: throw _d.sent();
1213
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1214
- case 7: throw _d.sent();
1215
- case 8:
1216
- parsedBody = parsedOutput.body;
1217
- throwDefaultError({
1218
- output: output,
1219
- parsedBody: parsedBody,
1220
- exceptionCtor: __BaseException,
1221
- errorCode: errorCode,
1222
- });
1223
- _d.label = 9;
1224
- case 9: return [2];
1225
- }
740
+ await collectBody(output.body, context);
741
+ return contents;
742
+ };
743
+ const deserializeAws_restJson1StopSuiteRunCommandError = async (output, context) => {
744
+ const parsedOutput = {
745
+ ...output,
746
+ body: await parseErrorBody(output.body, context),
747
+ };
748
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
749
+ switch (errorCode) {
750
+ case "InternalServerException":
751
+ case "com.amazonaws.iotdeviceadvisor#InternalServerException":
752
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
753
+ case "ResourceNotFoundException":
754
+ case "com.amazonaws.iotdeviceadvisor#ResourceNotFoundException":
755
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
756
+ case "ValidationException":
757
+ case "com.amazonaws.iotdeviceadvisor#ValidationException":
758
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
759
+ default:
760
+ const parsedBody = parsedOutput.body;
761
+ throwDefaultError({
762
+ output,
763
+ parsedBody,
764
+ exceptionCtor: __BaseException,
765
+ errorCode,
766
+ });
767
+ }
768
+ };
769
+ export const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
770
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
771
+ return deserializeAws_restJson1TagResourceCommandError(output, context);
772
+ }
773
+ const contents = map({
774
+ $metadata: deserializeMetadata(output),
1226
775
  });
1227
- }); };
1228
- export var deserializeAws_restJson1UpdateSuiteDefinitionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1229
- var contents, data, _a, _b;
1230
- return __generator(this, function (_c) {
1231
- switch (_c.label) {
1232
- case 0:
1233
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1234
- return [2, deserializeAws_restJson1UpdateSuiteDefinitionCommandError(output, context)];
1235
- }
1236
- contents = map({
1237
- $metadata: deserializeMetadata(output),
1238
- });
1239
- _a = __expectNonNull;
1240
- _b = __expectObject;
1241
- return [4, parseBody(output.body, context)];
1242
- case 1:
1243
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1244
- if (data.createdAt != null) {
1245
- contents.createdAt = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.createdAt)));
1246
- }
1247
- if (data.lastUpdatedAt != null) {
1248
- contents.lastUpdatedAt = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.lastUpdatedAt)));
1249
- }
1250
- if (data.suiteDefinitionArn != null) {
1251
- contents.suiteDefinitionArn = __expectString(data.suiteDefinitionArn);
1252
- }
1253
- if (data.suiteDefinitionId != null) {
1254
- contents.suiteDefinitionId = __expectString(data.suiteDefinitionId);
1255
- }
1256
- if (data.suiteDefinitionName != null) {
1257
- contents.suiteDefinitionName = __expectString(data.suiteDefinitionName);
1258
- }
1259
- if (data.suiteDefinitionVersion != null) {
1260
- contents.suiteDefinitionVersion = __expectString(data.suiteDefinitionVersion);
1261
- }
1262
- return [2, contents];
1263
- }
776
+ await collectBody(output.body, context);
777
+ return contents;
778
+ };
779
+ const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
780
+ const parsedOutput = {
781
+ ...output,
782
+ body: await parseErrorBody(output.body, context),
783
+ };
784
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
785
+ switch (errorCode) {
786
+ case "InternalServerException":
787
+ case "com.amazonaws.iotdeviceadvisor#InternalServerException":
788
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
789
+ case "ResourceNotFoundException":
790
+ case "com.amazonaws.iotdeviceadvisor#ResourceNotFoundException":
791
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
792
+ case "ValidationException":
793
+ case "com.amazonaws.iotdeviceadvisor#ValidationException":
794
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
795
+ default:
796
+ const parsedBody = parsedOutput.body;
797
+ throwDefaultError({
798
+ output,
799
+ parsedBody,
800
+ exceptionCtor: __BaseException,
801
+ errorCode,
802
+ });
803
+ }
804
+ };
805
+ export const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
806
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
807
+ return deserializeAws_restJson1UntagResourceCommandError(output, context);
808
+ }
809
+ const contents = map({
810
+ $metadata: deserializeMetadata(output),
1264
811
  });
1265
- }); };
1266
- var deserializeAws_restJson1UpdateSuiteDefinitionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1267
- var parsedOutput, _a, errorCode, _b, parsedBody;
1268
- var _c;
1269
- return __generator(this, function (_d) {
1270
- switch (_d.label) {
1271
- case 0:
1272
- _a = [__assign({}, output)];
1273
- _c = {};
1274
- return [4, parseErrorBody(output.body, context)];
1275
- case 1:
1276
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1277
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1278
- _b = errorCode;
1279
- switch (_b) {
1280
- case "InternalServerException": return [3, 2];
1281
- case "com.amazonaws.iotdeviceadvisor#InternalServerException": return [3, 2];
1282
- case "ValidationException": return [3, 4];
1283
- case "com.amazonaws.iotdeviceadvisor#ValidationException": return [3, 4];
1284
- }
1285
- return [3, 6];
1286
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1287
- case 3: throw _d.sent();
1288
- case 4: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1289
- case 5: throw _d.sent();
1290
- case 6:
1291
- parsedBody = parsedOutput.body;
1292
- throwDefaultError({
1293
- output: output,
1294
- parsedBody: parsedBody,
1295
- exceptionCtor: __BaseException,
1296
- errorCode: errorCode,
1297
- });
1298
- _d.label = 7;
1299
- case 7: return [2];
1300
- }
812
+ await collectBody(output.body, context);
813
+ return contents;
814
+ };
815
+ const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
816
+ const parsedOutput = {
817
+ ...output,
818
+ body: await parseErrorBody(output.body, context),
819
+ };
820
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
821
+ switch (errorCode) {
822
+ case "InternalServerException":
823
+ case "com.amazonaws.iotdeviceadvisor#InternalServerException":
824
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
825
+ case "ResourceNotFoundException":
826
+ case "com.amazonaws.iotdeviceadvisor#ResourceNotFoundException":
827
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
828
+ case "ValidationException":
829
+ case "com.amazonaws.iotdeviceadvisor#ValidationException":
830
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
831
+ default:
832
+ const parsedBody = parsedOutput.body;
833
+ throwDefaultError({
834
+ output,
835
+ parsedBody,
836
+ exceptionCtor: __BaseException,
837
+ errorCode,
838
+ });
839
+ }
840
+ };
841
+ export const deserializeAws_restJson1UpdateSuiteDefinitionCommand = async (output, context) => {
842
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
843
+ return deserializeAws_restJson1UpdateSuiteDefinitionCommandError(output, context);
844
+ }
845
+ const contents = map({
846
+ $metadata: deserializeMetadata(output),
1301
847
  });
1302
- }); };
1303
- var map = __map;
1304
- var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1305
- var contents, data, exception;
1306
- return __generator(this, function (_a) {
1307
- contents = map({});
1308
- data = parsedOutput.body;
1309
- if (data.message != null) {
1310
- contents.message = __expectString(data.message);
1311
- }
1312
- exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1313
- return [2, __decorateServiceException(exception, parsedOutput.body)];
848
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
849
+ if (data.createdAt != null) {
850
+ contents.createdAt = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.createdAt)));
851
+ }
852
+ if (data.lastUpdatedAt != null) {
853
+ contents.lastUpdatedAt = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.lastUpdatedAt)));
854
+ }
855
+ if (data.suiteDefinitionArn != null) {
856
+ contents.suiteDefinitionArn = __expectString(data.suiteDefinitionArn);
857
+ }
858
+ if (data.suiteDefinitionId != null) {
859
+ contents.suiteDefinitionId = __expectString(data.suiteDefinitionId);
860
+ }
861
+ if (data.suiteDefinitionName != null) {
862
+ contents.suiteDefinitionName = __expectString(data.suiteDefinitionName);
863
+ }
864
+ if (data.suiteDefinitionVersion != null) {
865
+ contents.suiteDefinitionVersion = __expectString(data.suiteDefinitionVersion);
866
+ }
867
+ return contents;
868
+ };
869
+ const deserializeAws_restJson1UpdateSuiteDefinitionCommandError = async (output, context) => {
870
+ const parsedOutput = {
871
+ ...output,
872
+ body: await parseErrorBody(output.body, context),
873
+ };
874
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
875
+ switch (errorCode) {
876
+ case "InternalServerException":
877
+ case "com.amazonaws.iotdeviceadvisor#InternalServerException":
878
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
879
+ case "ValidationException":
880
+ case "com.amazonaws.iotdeviceadvisor#ValidationException":
881
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
882
+ default:
883
+ const parsedBody = parsedOutput.body;
884
+ throwDefaultError({
885
+ output,
886
+ parsedBody,
887
+ exceptionCtor: __BaseException,
888
+ errorCode,
889
+ });
890
+ }
891
+ };
892
+ const map = __map;
893
+ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
894
+ const contents = map({});
895
+ const data = parsedOutput.body;
896
+ if (data.message != null) {
897
+ contents.message = __expectString(data.message);
898
+ }
899
+ const exception = new ConflictException({
900
+ $metadata: deserializeMetadata(parsedOutput),
901
+ ...contents,
1314
902
  });
1315
- }); };
1316
- var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1317
- var contents, data, exception;
1318
- return __generator(this, function (_a) {
1319
- contents = map({});
1320
- data = parsedOutput.body;
1321
- if (data.message != null) {
1322
- contents.message = __expectString(data.message);
1323
- }
1324
- exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1325
- return [2, __decorateServiceException(exception, parsedOutput.body)];
903
+ return __decorateServiceException(exception, parsedOutput.body);
904
+ };
905
+ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
906
+ const contents = map({});
907
+ const data = parsedOutput.body;
908
+ if (data.message != null) {
909
+ contents.message = __expectString(data.message);
910
+ }
911
+ const exception = new InternalServerException({
912
+ $metadata: deserializeMetadata(parsedOutput),
913
+ ...contents,
1326
914
  });
1327
- }); };
1328
- var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1329
- var contents, data, exception;
1330
- return __generator(this, function (_a) {
1331
- contents = map({});
1332
- data = parsedOutput.body;
1333
- if (data.message != null) {
1334
- contents.message = __expectString(data.message);
1335
- }
1336
- exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1337
- return [2, __decorateServiceException(exception, parsedOutput.body)];
915
+ return __decorateServiceException(exception, parsedOutput.body);
916
+ };
917
+ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
918
+ const contents = map({});
919
+ const data = parsedOutput.body;
920
+ if (data.message != null) {
921
+ contents.message = __expectString(data.message);
922
+ }
923
+ const exception = new ResourceNotFoundException({
924
+ $metadata: deserializeMetadata(parsedOutput),
925
+ ...contents,
1338
926
  });
1339
- }); };
1340
- var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1341
- var contents, data, exception;
1342
- return __generator(this, function (_a) {
1343
- contents = map({});
1344
- data = parsedOutput.body;
1345
- if (data.message != null) {
1346
- contents.message = __expectString(data.message);
1347
- }
1348
- exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1349
- return [2, __decorateServiceException(exception, parsedOutput.body)];
927
+ return __decorateServiceException(exception, parsedOutput.body);
928
+ };
929
+ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
930
+ const contents = map({});
931
+ const data = parsedOutput.body;
932
+ if (data.message != null) {
933
+ contents.message = __expectString(data.message);
934
+ }
935
+ const exception = new ValidationException({
936
+ $metadata: deserializeMetadata(parsedOutput),
937
+ ...contents,
1350
938
  });
1351
- }); };
1352
- var serializeAws_restJson1DeviceUnderTest = function (input, context) {
1353
- return __assign(__assign({}, (input.certificateArn != null && { certificateArn: input.certificateArn })), (input.thingArn != null && { thingArn: input.thingArn }));
939
+ return __decorateServiceException(exception, parsedOutput.body);
940
+ };
941
+ const serializeAws_restJson1DeviceUnderTest = (input, context) => {
942
+ return {
943
+ ...(input.certificateArn != null && { certificateArn: input.certificateArn }),
944
+ ...(input.thingArn != null && { thingArn: input.thingArn }),
945
+ };
1354
946
  };
1355
- var serializeAws_restJson1DeviceUnderTestList = function (input, context) {
947
+ const serializeAws_restJson1DeviceUnderTestList = (input, context) => {
1356
948
  return input
1357
- .filter(function (e) { return e != null; })
1358
- .map(function (entry) {
949
+ .filter((e) => e != null)
950
+ .map((entry) => {
1359
951
  return serializeAws_restJson1DeviceUnderTest(entry, context);
1360
952
  });
1361
953
  };
1362
- var serializeAws_restJson1SelectedTestList = function (input, context) {
954
+ const serializeAws_restJson1SelectedTestList = (input, context) => {
1363
955
  return input
1364
- .filter(function (e) { return e != null; })
1365
- .map(function (entry) {
956
+ .filter((e) => e != null)
957
+ .map((entry) => {
1366
958
  return entry;
1367
959
  });
1368
960
  };
1369
- var serializeAws_restJson1SuiteDefinitionConfiguration = function (input, context) {
1370
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.devicePermissionRoleArn != null && { devicePermissionRoleArn: input.devicePermissionRoleArn })), (input.devices != null && { devices: serializeAws_restJson1DeviceUnderTestList(input.devices, context) })), (input.intendedForQualification != null && { intendedForQualification: input.intendedForQualification })), (input.isLongDurationTest != null && { isLongDurationTest: input.isLongDurationTest })), (input.protocol != null && { protocol: input.protocol })), (input.rootGroup != null && { rootGroup: input.rootGroup })), (input.suiteDefinitionName != null && { suiteDefinitionName: input.suiteDefinitionName }));
961
+ const serializeAws_restJson1SuiteDefinitionConfiguration = (input, context) => {
962
+ return {
963
+ ...(input.devicePermissionRoleArn != null && { devicePermissionRoleArn: input.devicePermissionRoleArn }),
964
+ ...(input.devices != null && { devices: serializeAws_restJson1DeviceUnderTestList(input.devices, context) }),
965
+ ...(input.intendedForQualification != null && { intendedForQualification: input.intendedForQualification }),
966
+ ...(input.isLongDurationTest != null && { isLongDurationTest: input.isLongDurationTest }),
967
+ ...(input.protocol != null && { protocol: input.protocol }),
968
+ ...(input.rootGroup != null && { rootGroup: input.rootGroup }),
969
+ ...(input.suiteDefinitionName != null && { suiteDefinitionName: input.suiteDefinitionName }),
970
+ };
1371
971
  };
1372
- var serializeAws_restJson1SuiteRunConfiguration = function (input, context) {
1373
- return __assign(__assign(__assign({}, (input.parallelRun != null && { parallelRun: input.parallelRun })), (input.primaryDevice != null && {
1374
- primaryDevice: serializeAws_restJson1DeviceUnderTest(input.primaryDevice, context),
1375
- })), (input.selectedTestList != null && {
1376
- selectedTestList: serializeAws_restJson1SelectedTestList(input.selectedTestList, context),
1377
- }));
972
+ const serializeAws_restJson1SuiteRunConfiguration = (input, context) => {
973
+ return {
974
+ ...(input.parallelRun != null && { parallelRun: input.parallelRun }),
975
+ ...(input.primaryDevice != null && {
976
+ primaryDevice: serializeAws_restJson1DeviceUnderTest(input.primaryDevice, context),
977
+ }),
978
+ ...(input.selectedTestList != null && {
979
+ selectedTestList: serializeAws_restJson1SelectedTestList(input.selectedTestList, context),
980
+ }),
981
+ };
1378
982
  };
1379
- var serializeAws_restJson1TagMap = function (input, context) {
1380
- return Object.entries(input).reduce(function (acc, _a) {
1381
- var _b;
1382
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
983
+ const serializeAws_restJson1TagMap = (input, context) => {
984
+ return Object.entries(input).reduce((acc, [key, value]) => {
1383
985
  if (value === null) {
1384
986
  return acc;
1385
987
  }
1386
- return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
988
+ return {
989
+ ...acc,
990
+ [key]: value,
991
+ };
1387
992
  }, {});
1388
993
  };
1389
- var deserializeAws_restJson1DeviceUnderTest = function (output, context) {
994
+ const deserializeAws_restJson1DeviceUnderTest = (output, context) => {
1390
995
  return {
1391
996
  certificateArn: __expectString(output.certificateArn),
1392
997
  thingArn: __expectString(output.thingArn),
1393
998
  };
1394
999
  };
1395
- var deserializeAws_restJson1DeviceUnderTestList = function (output, context) {
1396
- var retVal = (output || [])
1397
- .filter(function (e) { return e != null; })
1398
- .map(function (entry) {
1000
+ const deserializeAws_restJson1DeviceUnderTestList = (output, context) => {
1001
+ const retVal = (output || [])
1002
+ .filter((e) => e != null)
1003
+ .map((entry) => {
1399
1004
  if (entry === null) {
1400
1005
  return null;
1401
1006
  }
@@ -1403,17 +1008,17 @@ var deserializeAws_restJson1DeviceUnderTestList = function (output, context) {
1403
1008
  });
1404
1009
  return retVal;
1405
1010
  };
1406
- var deserializeAws_restJson1GroupResult = function (output, context) {
1011
+ const deserializeAws_restJson1GroupResult = (output, context) => {
1407
1012
  return {
1408
1013
  groupId: __expectString(output.groupId),
1409
1014
  groupName: __expectString(output.groupName),
1410
1015
  tests: output.tests != null ? deserializeAws_restJson1TestCaseRuns(output.tests, context) : undefined,
1411
1016
  };
1412
1017
  };
1413
- var deserializeAws_restJson1GroupResultList = function (output, context) {
1414
- var retVal = (output || [])
1415
- .filter(function (e) { return e != null; })
1416
- .map(function (entry) {
1018
+ const deserializeAws_restJson1GroupResultList = (output, context) => {
1019
+ const retVal = (output || [])
1020
+ .filter((e) => e != null)
1021
+ .map((entry) => {
1417
1022
  if (entry === null) {
1418
1023
  return null;
1419
1024
  }
@@ -1421,10 +1026,10 @@ var deserializeAws_restJson1GroupResultList = function (output, context) {
1421
1026
  });
1422
1027
  return retVal;
1423
1028
  };
1424
- var deserializeAws_restJson1SelectedTestList = function (output, context) {
1425
- var retVal = (output || [])
1426
- .filter(function (e) { return e != null; })
1427
- .map(function (entry) {
1029
+ const deserializeAws_restJson1SelectedTestList = (output, context) => {
1030
+ const retVal = (output || [])
1031
+ .filter((e) => e != null)
1032
+ .map((entry) => {
1428
1033
  if (entry === null) {
1429
1034
  return null;
1430
1035
  }
@@ -1432,7 +1037,7 @@ var deserializeAws_restJson1SelectedTestList = function (output, context) {
1432
1037
  });
1433
1038
  return retVal;
1434
1039
  };
1435
- var deserializeAws_restJson1SuiteDefinitionConfiguration = function (output, context) {
1040
+ const deserializeAws_restJson1SuiteDefinitionConfiguration = (output, context) => {
1436
1041
  return {
1437
1042
  devicePermissionRoleArn: __expectString(output.devicePermissionRoleArn),
1438
1043
  devices: output.devices != null ? deserializeAws_restJson1DeviceUnderTestList(output.devices, context) : undefined,
@@ -1443,7 +1048,7 @@ var deserializeAws_restJson1SuiteDefinitionConfiguration = function (output, con
1443
1048
  suiteDefinitionName: __expectString(output.suiteDefinitionName),
1444
1049
  };
1445
1050
  };
1446
- var deserializeAws_restJson1SuiteDefinitionInformation = function (output, context) {
1051
+ const deserializeAws_restJson1SuiteDefinitionInformation = (output, context) => {
1447
1052
  return {
1448
1053
  createdAt: output.createdAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createdAt))) : undefined,
1449
1054
  defaultDevices: output.defaultDevices != null
@@ -1456,10 +1061,10 @@ var deserializeAws_restJson1SuiteDefinitionInformation = function (output, conte
1456
1061
  suiteDefinitionName: __expectString(output.suiteDefinitionName),
1457
1062
  };
1458
1063
  };
1459
- var deserializeAws_restJson1SuiteDefinitionInformationList = function (output, context) {
1460
- var retVal = (output || [])
1461
- .filter(function (e) { return e != null; })
1462
- .map(function (entry) {
1064
+ const deserializeAws_restJson1SuiteDefinitionInformationList = (output, context) => {
1065
+ const retVal = (output || [])
1066
+ .filter((e) => e != null)
1067
+ .map((entry) => {
1463
1068
  if (entry === null) {
1464
1069
  return null;
1465
1070
  }
@@ -1467,7 +1072,7 @@ var deserializeAws_restJson1SuiteDefinitionInformationList = function (output, c
1467
1072
  });
1468
1073
  return retVal;
1469
1074
  };
1470
- var deserializeAws_restJson1SuiteRunConfiguration = function (output, context) {
1075
+ const deserializeAws_restJson1SuiteRunConfiguration = (output, context) => {
1471
1076
  return {
1472
1077
  parallelRun: __expectBoolean(output.parallelRun),
1473
1078
  primaryDevice: output.primaryDevice != null ? deserializeAws_restJson1DeviceUnderTest(output.primaryDevice, context) : undefined,
@@ -1476,7 +1081,7 @@ var deserializeAws_restJson1SuiteRunConfiguration = function (output, context) {
1476
1081
  : undefined,
1477
1082
  };
1478
1083
  };
1479
- var deserializeAws_restJson1SuiteRunInformation = function (output, context) {
1084
+ const deserializeAws_restJson1SuiteRunInformation = (output, context) => {
1480
1085
  return {
1481
1086
  createdAt: output.createdAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createdAt))) : undefined,
1482
1087
  endAt: output.endAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.endAt))) : undefined,
@@ -1490,10 +1095,10 @@ var deserializeAws_restJson1SuiteRunInformation = function (output, context) {
1490
1095
  suiteRunId: __expectString(output.suiteRunId),
1491
1096
  };
1492
1097
  };
1493
- var deserializeAws_restJson1SuiteRunsList = function (output, context) {
1494
- var retVal = (output || [])
1495
- .filter(function (e) { return e != null; })
1496
- .map(function (entry) {
1098
+ const deserializeAws_restJson1SuiteRunsList = (output, context) => {
1099
+ const retVal = (output || [])
1100
+ .filter((e) => e != null)
1101
+ .map((entry) => {
1497
1102
  if (entry === null) {
1498
1103
  return null;
1499
1104
  }
@@ -1501,17 +1106,18 @@ var deserializeAws_restJson1SuiteRunsList = function (output, context) {
1501
1106
  });
1502
1107
  return retVal;
1503
1108
  };
1504
- var deserializeAws_restJson1TagMap = function (output, context) {
1505
- return Object.entries(output).reduce(function (acc, _a) {
1506
- var _b;
1507
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1109
+ const deserializeAws_restJson1TagMap = (output, context) => {
1110
+ return Object.entries(output).reduce((acc, [key, value]) => {
1508
1111
  if (value === null) {
1509
1112
  return acc;
1510
1113
  }
1511
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1114
+ return {
1115
+ ...acc,
1116
+ [key]: __expectString(value),
1117
+ };
1512
1118
  }, {});
1513
1119
  };
1514
- var deserializeAws_restJson1TestCaseRun = function (output, context) {
1120
+ const deserializeAws_restJson1TestCaseRun = (output, context) => {
1515
1121
  return {
1516
1122
  endTime: output.endTime != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.endTime))) : undefined,
1517
1123
  failure: __expectString(output.failure),
@@ -1527,10 +1133,10 @@ var deserializeAws_restJson1TestCaseRun = function (output, context) {
1527
1133
  warnings: __expectString(output.warnings),
1528
1134
  };
1529
1135
  };
1530
- var deserializeAws_restJson1TestCaseRuns = function (output, context) {
1531
- var retVal = (output || [])
1532
- .filter(function (e) { return e != null; })
1533
- .map(function (entry) {
1136
+ const deserializeAws_restJson1TestCaseRuns = (output, context) => {
1137
+ const retVal = (output || [])
1138
+ .filter((e) => e != null)
1139
+ .map((entry) => {
1534
1140
  if (entry === null) {
1535
1141
  return null;
1536
1142
  }
@@ -1538,7 +1144,7 @@ var deserializeAws_restJson1TestCaseRuns = function (output, context) {
1538
1144
  });
1539
1145
  return retVal;
1540
1146
  };
1541
- var deserializeAws_restJson1TestCaseScenario = function (output, context) {
1147
+ const deserializeAws_restJson1TestCaseScenario = (output, context) => {
1542
1148
  return {
1543
1149
  failure: __expectString(output.failure),
1544
1150
  status: __expectString(output.status),
@@ -1547,10 +1153,10 @@ var deserializeAws_restJson1TestCaseScenario = function (output, context) {
1547
1153
  testCaseScenarioType: __expectString(output.testCaseScenarioType),
1548
1154
  };
1549
1155
  };
1550
- var deserializeAws_restJson1TestCaseScenariosList = function (output, context) {
1551
- var retVal = (output || [])
1552
- .filter(function (e) { return e != null; })
1553
- .map(function (entry) {
1156
+ const deserializeAws_restJson1TestCaseScenariosList = (output, context) => {
1157
+ const retVal = (output || [])
1158
+ .filter((e) => e != null)
1159
+ .map((entry) => {
1554
1160
  if (entry === null) {
1555
1161
  return null;
1556
1162
  }
@@ -1558,62 +1164,44 @@ var deserializeAws_restJson1TestCaseScenariosList = function (output, context) {
1558
1164
  });
1559
1165
  return retVal;
1560
1166
  };
1561
- var deserializeAws_restJson1TestResult = function (output, context) {
1167
+ const deserializeAws_restJson1TestResult = (output, context) => {
1562
1168
  return {
1563
1169
  groups: output.groups != null ? deserializeAws_restJson1GroupResultList(output.groups, context) : undefined,
1564
1170
  };
1565
1171
  };
1566
- var deserializeMetadata = function (output) {
1567
- var _a;
1568
- return ({
1569
- httpStatusCode: output.statusCode,
1570
- requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"],
1571
- extendedRequestId: output.headers["x-amz-id-2"],
1572
- cfId: output.headers["x-amz-cf-id"],
1573
- });
1574
- };
1575
- var collectBody = function (streamBody, context) {
1576
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
1172
+ const deserializeMetadata = (output) => ({
1173
+ httpStatusCode: output.statusCode,
1174
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
1175
+ extendedRequestId: output.headers["x-amz-id-2"],
1176
+ cfId: output.headers["x-amz-cf-id"],
1177
+ });
1178
+ const collectBody = (streamBody = new Uint8Array(), context) => {
1577
1179
  if (streamBody instanceof Uint8Array) {
1578
1180
  return Promise.resolve(streamBody);
1579
1181
  }
1580
1182
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1581
1183
  };
1582
- var collectBodyString = function (streamBody, context) {
1583
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
1584
- };
1585
- var isSerializableHeaderValue = function (value) {
1586
- return value !== undefined &&
1587
- value !== null &&
1588
- value !== "" &&
1589
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1590
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1591
- };
1592
- var parseBody = function (streamBody, context) {
1593
- return collectBodyString(streamBody, context).then(function (encoded) {
1594
- if (encoded.length) {
1595
- return JSON.parse(encoded);
1596
- }
1597
- return {};
1598
- });
1184
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1185
+ const isSerializableHeaderValue = (value) => value !== undefined &&
1186
+ value !== null &&
1187
+ value !== "" &&
1188
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1189
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1190
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1191
+ if (encoded.length) {
1192
+ return JSON.parse(encoded);
1193
+ }
1194
+ return {};
1195
+ });
1196
+ const parseErrorBody = async (errorBody, context) => {
1197
+ const value = await parseBody(errorBody, context);
1198
+ value.message = value.message ?? value.Message;
1199
+ return value;
1599
1200
  };
1600
- var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
1601
- var value;
1602
- var _a;
1603
- return __generator(this, function (_b) {
1604
- switch (_b.label) {
1605
- case 0: return [4, parseBody(errorBody, context)];
1606
- case 1:
1607
- value = _b.sent();
1608
- value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
1609
- return [2, value];
1610
- }
1611
- });
1612
- }); };
1613
- var loadRestJsonErrorCode = function (output, data) {
1614
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
1615
- var sanitizeErrorCode = function (rawValue) {
1616
- var cleanValue = rawValue;
1201
+ const loadRestJsonErrorCode = (output, data) => {
1202
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1203
+ const sanitizeErrorCode = (rawValue) => {
1204
+ let cleanValue = rawValue;
1617
1205
  if (typeof cleanValue === "number") {
1618
1206
  cleanValue = cleanValue.toString();
1619
1207
  }
@@ -1628,7 +1216,7 @@ var loadRestJsonErrorCode = function (output, data) {
1628
1216
  }
1629
1217
  return cleanValue;
1630
1218
  };
1631
- var headerKey = findKey(output.headers, "x-amzn-errortype");
1219
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
1632
1220
  if (headerKey !== undefined) {
1633
1221
  return sanitizeErrorCode(output.headers[headerKey]);
1634
1222
  }