@aws-sdk/client-iot-jobs-data-plane 3.186.0 → 3.190.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist-es/IoTJobsDataPlane.js +18 -25
- package/dist-es/IoTJobsDataPlaneClient.js +22 -28
- package/dist-es/commands/DescribeJobExecutionCommand.js +21 -28
- package/dist-es/commands/GetPendingJobExecutionsCommand.js +21 -28
- package/dist-es/commands/StartNextPendingJobExecutionCommand.js +21 -28
- package/dist-es/commands/UpdateJobExecutionCommand.js +21 -28
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/IoTJobsDataPlaneServiceException.js +5 -10
- package/dist-es/models/models_0.js +111 -90
- package/dist-es/protocols/Aws_restJson1.js +401 -541
- package/dist-es/runtimeConfig.browser.js +26 -12
- package/dist-es/runtimeConfig.js +30 -12
- package/dist-es/runtimeConfig.native.js +8 -5
- package/dist-es/runtimeConfig.shared.js +8 -11
- package/package.json +33 -33
|
@@ -1,524 +1,402 @@
|
|
|
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, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
4
3
|
import { IoTJobsDataPlaneServiceException as __BaseException } from "../models/IoTJobsDataPlaneServiceException";
|
|
5
4
|
import { CertificateValidationException, InvalidRequestException, InvalidStateTransitionException, ResourceNotFoundException, ServiceUnavailableException, TerminalStateException, ThrottlingException, } from "../models/models_0";
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "jobId", function () { return input.jobId; }, "{jobId}", false);
|
|
16
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "thingName", function () { return input.thingName; }, "{thingName}", false);
|
|
17
|
-
query = map({
|
|
18
|
-
includeJobDocument: [function () { return input.includeJobDocument !== void 0; }, function () { return input.includeJobDocument.toString(); }],
|
|
19
|
-
executionNumber: [function () { return input.executionNumber !== void 0; }, function () { return input.executionNumber.toString(); }],
|
|
20
|
-
});
|
|
21
|
-
return [2, new __HttpRequest({
|
|
22
|
-
protocol: protocol,
|
|
23
|
-
hostname: hostname,
|
|
24
|
-
port: port,
|
|
25
|
-
method: "GET",
|
|
26
|
-
headers: headers,
|
|
27
|
-
path: resolvedPath,
|
|
28
|
-
query: query,
|
|
29
|
-
body: body,
|
|
30
|
-
})];
|
|
31
|
-
}
|
|
5
|
+
export const serializeAws_restJson1DescribeJobExecutionCommand = async (input, context) => {
|
|
6
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
7
|
+
const headers = {};
|
|
8
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/things/{thingName}/jobs/{jobId}";
|
|
9
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "jobId", () => input.jobId, "{jobId}", false);
|
|
10
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "thingName", () => input.thingName, "{thingName}", false);
|
|
11
|
+
const query = map({
|
|
12
|
+
includeJobDocument: [() => input.includeJobDocument !== void 0, () => input.includeJobDocument.toString()],
|
|
13
|
+
executionNumber: [() => input.executionNumber !== void 0, () => input.executionNumber.toString()],
|
|
32
14
|
});
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "thingName", function () { return input.thingName; }, "{thingName}", false);
|
|
44
|
-
return [2, new __HttpRequest({
|
|
45
|
-
protocol: protocol,
|
|
46
|
-
hostname: hostname,
|
|
47
|
-
port: port,
|
|
48
|
-
method: "GET",
|
|
49
|
-
headers: headers,
|
|
50
|
-
path: resolvedPath,
|
|
51
|
-
body: body,
|
|
52
|
-
})];
|
|
53
|
-
}
|
|
15
|
+
let body;
|
|
16
|
+
return new __HttpRequest({
|
|
17
|
+
protocol,
|
|
18
|
+
hostname,
|
|
19
|
+
port,
|
|
20
|
+
method: "GET",
|
|
21
|
+
headers,
|
|
22
|
+
path: resolvedPath,
|
|
23
|
+
query,
|
|
24
|
+
body,
|
|
54
25
|
});
|
|
55
|
-
}
|
|
56
|
-
export
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
})), (input.stepTimeoutInMinutes != null && { stepTimeoutInMinutes: input.stepTimeoutInMinutes })));
|
|
71
|
-
return [2, new __HttpRequest({
|
|
72
|
-
protocol: protocol,
|
|
73
|
-
hostname: hostname,
|
|
74
|
-
port: port,
|
|
75
|
-
method: "PUT",
|
|
76
|
-
headers: headers,
|
|
77
|
-
path: resolvedPath,
|
|
78
|
-
body: body,
|
|
79
|
-
})];
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
}); };
|
|
83
|
-
export var serializeAws_restJson1UpdateJobExecutionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
84
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
85
|
-
return __generator(this, function (_c) {
|
|
86
|
-
switch (_c.label) {
|
|
87
|
-
case 0: return [4, context.endpoint()];
|
|
88
|
-
case 1:
|
|
89
|
-
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
90
|
-
headers = {
|
|
91
|
-
"content-type": "application/json",
|
|
92
|
-
};
|
|
93
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/things/{thingName}/jobs/{jobId}";
|
|
94
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "jobId", function () { return input.jobId; }, "{jobId}", false);
|
|
95
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "thingName", function () { return input.thingName; }, "{thingName}", false);
|
|
96
|
-
body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.executionNumber != null && { executionNumber: input.executionNumber })), (input.expectedVersion != null && { expectedVersion: input.expectedVersion })), (input.includeJobDocument != null && { includeJobDocument: input.includeJobDocument })), (input.includeJobExecutionState != null && { includeJobExecutionState: input.includeJobExecutionState })), (input.status != null && { status: input.status })), (input.statusDetails != null && {
|
|
97
|
-
statusDetails: serializeAws_restJson1DetailsMap(input.statusDetails, context),
|
|
98
|
-
})), (input.stepTimeoutInMinutes != null && { stepTimeoutInMinutes: input.stepTimeoutInMinutes })));
|
|
99
|
-
return [2, new __HttpRequest({
|
|
100
|
-
protocol: protocol,
|
|
101
|
-
hostname: hostname,
|
|
102
|
-
port: port,
|
|
103
|
-
method: "POST",
|
|
104
|
-
headers: headers,
|
|
105
|
-
path: resolvedPath,
|
|
106
|
-
body: body,
|
|
107
|
-
})];
|
|
108
|
-
}
|
|
26
|
+
};
|
|
27
|
+
export const serializeAws_restJson1GetPendingJobExecutionsCommand = async (input, context) => {
|
|
28
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
29
|
+
const headers = {};
|
|
30
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/things/{thingName}/jobs";
|
|
31
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "thingName", () => input.thingName, "{thingName}", false);
|
|
32
|
+
let body;
|
|
33
|
+
return new __HttpRequest({
|
|
34
|
+
protocol,
|
|
35
|
+
hostname,
|
|
36
|
+
port,
|
|
37
|
+
method: "GET",
|
|
38
|
+
headers,
|
|
39
|
+
path: resolvedPath,
|
|
40
|
+
body,
|
|
109
41
|
});
|
|
110
|
-
}
|
|
111
|
-
export
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
return [4, parseBody(output.body, context)];
|
|
125
|
-
case 1:
|
|
126
|
-
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
127
|
-
if (data.execution != null) {
|
|
128
|
-
contents.execution = deserializeAws_restJson1JobExecution(data.execution, context);
|
|
129
|
-
}
|
|
130
|
-
return [2, contents];
|
|
131
|
-
}
|
|
42
|
+
};
|
|
43
|
+
export const serializeAws_restJson1StartNextPendingJobExecutionCommand = async (input, context) => {
|
|
44
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
45
|
+
const headers = {
|
|
46
|
+
"content-type": "application/json",
|
|
47
|
+
};
|
|
48
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/things/{thingName}/jobs/$next";
|
|
49
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "thingName", () => input.thingName, "{thingName}", false);
|
|
50
|
+
let body;
|
|
51
|
+
body = JSON.stringify({
|
|
52
|
+
...(input.statusDetails != null && {
|
|
53
|
+
statusDetails: serializeAws_restJson1DetailsMap(input.statusDetails, context),
|
|
54
|
+
}),
|
|
55
|
+
...(input.stepTimeoutInMinutes != null && { stepTimeoutInMinutes: input.stepTimeoutInMinutes }),
|
|
132
56
|
});
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
_c = {};
|
|
142
|
-
return [4, parseErrorBody(output.body, context)];
|
|
143
|
-
case 1:
|
|
144
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
145
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
146
|
-
_b = errorCode;
|
|
147
|
-
switch (_b) {
|
|
148
|
-
case "CertificateValidationException": return [3, 2];
|
|
149
|
-
case "com.amazonaws.iotjobsdataplane#CertificateValidationException": return [3, 2];
|
|
150
|
-
case "InvalidRequestException": return [3, 4];
|
|
151
|
-
case "com.amazonaws.iotjobsdataplane#InvalidRequestException": return [3, 4];
|
|
152
|
-
case "ResourceNotFoundException": return [3, 6];
|
|
153
|
-
case "com.amazonaws.iotjobsdataplane#ResourceNotFoundException": return [3, 6];
|
|
154
|
-
case "ServiceUnavailableException": return [3, 8];
|
|
155
|
-
case "com.amazonaws.iotjobsdataplane#ServiceUnavailableException": return [3, 8];
|
|
156
|
-
case "TerminalStateException": return [3, 10];
|
|
157
|
-
case "com.amazonaws.iotjobsdataplane#TerminalStateException": return [3, 10];
|
|
158
|
-
case "ThrottlingException": return [3, 12];
|
|
159
|
-
case "com.amazonaws.iotjobsdataplane#ThrottlingException": return [3, 12];
|
|
160
|
-
}
|
|
161
|
-
return [3, 14];
|
|
162
|
-
case 2: return [4, deserializeAws_restJson1CertificateValidationExceptionResponse(parsedOutput, context)];
|
|
163
|
-
case 3: throw _d.sent();
|
|
164
|
-
case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
|
|
165
|
-
case 5: throw _d.sent();
|
|
166
|
-
case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
167
|
-
case 7: throw _d.sent();
|
|
168
|
-
case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
|
|
169
|
-
case 9: throw _d.sent();
|
|
170
|
-
case 10: return [4, deserializeAws_restJson1TerminalStateExceptionResponse(parsedOutput, context)];
|
|
171
|
-
case 11: throw _d.sent();
|
|
172
|
-
case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
173
|
-
case 13: throw _d.sent();
|
|
174
|
-
case 14:
|
|
175
|
-
parsedBody = parsedOutput.body;
|
|
176
|
-
throwDefaultError({
|
|
177
|
-
output: output,
|
|
178
|
-
parsedBody: parsedBody,
|
|
179
|
-
exceptionCtor: __BaseException,
|
|
180
|
-
errorCode: errorCode,
|
|
181
|
-
});
|
|
182
|
-
_d.label = 15;
|
|
183
|
-
case 15: return [2];
|
|
184
|
-
}
|
|
57
|
+
return new __HttpRequest({
|
|
58
|
+
protocol,
|
|
59
|
+
hostname,
|
|
60
|
+
port,
|
|
61
|
+
method: "PUT",
|
|
62
|
+
headers,
|
|
63
|
+
path: resolvedPath,
|
|
64
|
+
body,
|
|
185
65
|
});
|
|
186
|
-
}
|
|
187
|
-
export
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
if (data.queuedJobs != null) {
|
|
207
|
-
contents.queuedJobs = deserializeAws_restJson1JobExecutionSummaryList(data.queuedJobs, context);
|
|
208
|
-
}
|
|
209
|
-
return [2, contents];
|
|
210
|
-
}
|
|
66
|
+
};
|
|
67
|
+
export const serializeAws_restJson1UpdateJobExecutionCommand = async (input, context) => {
|
|
68
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
69
|
+
const headers = {
|
|
70
|
+
"content-type": "application/json",
|
|
71
|
+
};
|
|
72
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/things/{thingName}/jobs/{jobId}";
|
|
73
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "jobId", () => input.jobId, "{jobId}", false);
|
|
74
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "thingName", () => input.thingName, "{thingName}", false);
|
|
75
|
+
let body;
|
|
76
|
+
body = JSON.stringify({
|
|
77
|
+
...(input.executionNumber != null && { executionNumber: input.executionNumber }),
|
|
78
|
+
...(input.expectedVersion != null && { expectedVersion: input.expectedVersion }),
|
|
79
|
+
...(input.includeJobDocument != null && { includeJobDocument: input.includeJobDocument }),
|
|
80
|
+
...(input.includeJobExecutionState != null && { includeJobExecutionState: input.includeJobExecutionState }),
|
|
81
|
+
...(input.status != null && { status: input.status }),
|
|
82
|
+
...(input.statusDetails != null && {
|
|
83
|
+
statusDetails: serializeAws_restJson1DetailsMap(input.statusDetails, context),
|
|
84
|
+
}),
|
|
85
|
+
...(input.stepTimeoutInMinutes != null && { stepTimeoutInMinutes: input.stepTimeoutInMinutes }),
|
|
211
86
|
});
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
_c = {};
|
|
221
|
-
return [4, parseErrorBody(output.body, context)];
|
|
222
|
-
case 1:
|
|
223
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
224
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
225
|
-
_b = errorCode;
|
|
226
|
-
switch (_b) {
|
|
227
|
-
case "CertificateValidationException": return [3, 2];
|
|
228
|
-
case "com.amazonaws.iotjobsdataplane#CertificateValidationException": return [3, 2];
|
|
229
|
-
case "InvalidRequestException": return [3, 4];
|
|
230
|
-
case "com.amazonaws.iotjobsdataplane#InvalidRequestException": return [3, 4];
|
|
231
|
-
case "ResourceNotFoundException": return [3, 6];
|
|
232
|
-
case "com.amazonaws.iotjobsdataplane#ResourceNotFoundException": return [3, 6];
|
|
233
|
-
case "ServiceUnavailableException": return [3, 8];
|
|
234
|
-
case "com.amazonaws.iotjobsdataplane#ServiceUnavailableException": return [3, 8];
|
|
235
|
-
case "ThrottlingException": return [3, 10];
|
|
236
|
-
case "com.amazonaws.iotjobsdataplane#ThrottlingException": return [3, 10];
|
|
237
|
-
}
|
|
238
|
-
return [3, 12];
|
|
239
|
-
case 2: return [4, deserializeAws_restJson1CertificateValidationExceptionResponse(parsedOutput, context)];
|
|
240
|
-
case 3: throw _d.sent();
|
|
241
|
-
case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
|
|
242
|
-
case 5: throw _d.sent();
|
|
243
|
-
case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
244
|
-
case 7: throw _d.sent();
|
|
245
|
-
case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
|
|
246
|
-
case 9: throw _d.sent();
|
|
247
|
-
case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
248
|
-
case 11: throw _d.sent();
|
|
249
|
-
case 12:
|
|
250
|
-
parsedBody = parsedOutput.body;
|
|
251
|
-
throwDefaultError({
|
|
252
|
-
output: output,
|
|
253
|
-
parsedBody: parsedBody,
|
|
254
|
-
exceptionCtor: __BaseException,
|
|
255
|
-
errorCode: errorCode,
|
|
256
|
-
});
|
|
257
|
-
_d.label = 13;
|
|
258
|
-
case 13: return [2];
|
|
259
|
-
}
|
|
87
|
+
return new __HttpRequest({
|
|
88
|
+
protocol,
|
|
89
|
+
hostname,
|
|
90
|
+
port,
|
|
91
|
+
method: "POST",
|
|
92
|
+
headers,
|
|
93
|
+
path: resolvedPath,
|
|
94
|
+
body,
|
|
260
95
|
});
|
|
261
|
-
}
|
|
262
|
-
export
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
return [2, deserializeAws_restJson1StartNextPendingJobExecutionCommandError(output, context)];
|
|
269
|
-
}
|
|
270
|
-
contents = map({
|
|
271
|
-
$metadata: deserializeMetadata(output),
|
|
272
|
-
});
|
|
273
|
-
_a = __expectNonNull;
|
|
274
|
-
_b = __expectObject;
|
|
275
|
-
return [4, parseBody(output.body, context)];
|
|
276
|
-
case 1:
|
|
277
|
-
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
278
|
-
if (data.execution != null) {
|
|
279
|
-
contents.execution = deserializeAws_restJson1JobExecution(data.execution, context);
|
|
280
|
-
}
|
|
281
|
-
return [2, contents];
|
|
282
|
-
}
|
|
96
|
+
};
|
|
97
|
+
export const deserializeAws_restJson1DescribeJobExecutionCommand = async (output, context) => {
|
|
98
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
99
|
+
return deserializeAws_restJson1DescribeJobExecutionCommandError(output, context);
|
|
100
|
+
}
|
|
101
|
+
const contents = map({
|
|
102
|
+
$metadata: deserializeMetadata(output),
|
|
283
103
|
});
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
return
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
}
|
|
104
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
105
|
+
if (data.execution != null) {
|
|
106
|
+
contents.execution = deserializeAws_restJson1JobExecution(data.execution, context);
|
|
107
|
+
}
|
|
108
|
+
return contents;
|
|
109
|
+
};
|
|
110
|
+
const deserializeAws_restJson1DescribeJobExecutionCommandError = async (output, context) => {
|
|
111
|
+
const parsedOutput = {
|
|
112
|
+
...output,
|
|
113
|
+
body: await parseErrorBody(output.body, context),
|
|
114
|
+
};
|
|
115
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
116
|
+
switch (errorCode) {
|
|
117
|
+
case "CertificateValidationException":
|
|
118
|
+
case "com.amazonaws.iotjobsdataplane#CertificateValidationException":
|
|
119
|
+
throw await deserializeAws_restJson1CertificateValidationExceptionResponse(parsedOutput, context);
|
|
120
|
+
case "InvalidRequestException":
|
|
121
|
+
case "com.amazonaws.iotjobsdataplane#InvalidRequestException":
|
|
122
|
+
throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
|
|
123
|
+
case "ResourceNotFoundException":
|
|
124
|
+
case "com.amazonaws.iotjobsdataplane#ResourceNotFoundException":
|
|
125
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
126
|
+
case "ServiceUnavailableException":
|
|
127
|
+
case "com.amazonaws.iotjobsdataplane#ServiceUnavailableException":
|
|
128
|
+
throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
|
|
129
|
+
case "TerminalStateException":
|
|
130
|
+
case "com.amazonaws.iotjobsdataplane#TerminalStateException":
|
|
131
|
+
throw await deserializeAws_restJson1TerminalStateExceptionResponse(parsedOutput, context);
|
|
132
|
+
case "ThrottlingException":
|
|
133
|
+
case "com.amazonaws.iotjobsdataplane#ThrottlingException":
|
|
134
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
135
|
+
default:
|
|
136
|
+
const parsedBody = parsedOutput.body;
|
|
137
|
+
throwDefaultError({
|
|
138
|
+
output,
|
|
139
|
+
parsedBody,
|
|
140
|
+
exceptionCtor: __BaseException,
|
|
141
|
+
errorCode,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
export const deserializeAws_restJson1GetPendingJobExecutionsCommand = async (output, context) => {
|
|
146
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
147
|
+
return deserializeAws_restJson1GetPendingJobExecutionsCommandError(output, context);
|
|
148
|
+
}
|
|
149
|
+
const contents = map({
|
|
150
|
+
$metadata: deserializeMetadata(output),
|
|
332
151
|
});
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
152
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
153
|
+
if (data.inProgressJobs != null) {
|
|
154
|
+
contents.inProgressJobs = deserializeAws_restJson1JobExecutionSummaryList(data.inProgressJobs, context);
|
|
155
|
+
}
|
|
156
|
+
if (data.queuedJobs != null) {
|
|
157
|
+
contents.queuedJobs = deserializeAws_restJson1JobExecutionSummaryList(data.queuedJobs, context);
|
|
158
|
+
}
|
|
159
|
+
return contents;
|
|
160
|
+
};
|
|
161
|
+
const deserializeAws_restJson1GetPendingJobExecutionsCommandError = async (output, context) => {
|
|
162
|
+
const parsedOutput = {
|
|
163
|
+
...output,
|
|
164
|
+
body: await parseErrorBody(output.body, context),
|
|
165
|
+
};
|
|
166
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
167
|
+
switch (errorCode) {
|
|
168
|
+
case "CertificateValidationException":
|
|
169
|
+
case "com.amazonaws.iotjobsdataplane#CertificateValidationException":
|
|
170
|
+
throw await deserializeAws_restJson1CertificateValidationExceptionResponse(parsedOutput, context);
|
|
171
|
+
case "InvalidRequestException":
|
|
172
|
+
case "com.amazonaws.iotjobsdataplane#InvalidRequestException":
|
|
173
|
+
throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
|
|
174
|
+
case "ResourceNotFoundException":
|
|
175
|
+
case "com.amazonaws.iotjobsdataplane#ResourceNotFoundException":
|
|
176
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
177
|
+
case "ServiceUnavailableException":
|
|
178
|
+
case "com.amazonaws.iotjobsdataplane#ServiceUnavailableException":
|
|
179
|
+
throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
|
|
180
|
+
case "ThrottlingException":
|
|
181
|
+
case "com.amazonaws.iotjobsdataplane#ThrottlingException":
|
|
182
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
183
|
+
default:
|
|
184
|
+
const parsedBody = parsedOutput.body;
|
|
185
|
+
throwDefaultError({
|
|
186
|
+
output,
|
|
187
|
+
parsedBody,
|
|
188
|
+
exceptionCtor: __BaseException,
|
|
189
|
+
errorCode,
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
export const deserializeAws_restJson1StartNextPendingJobExecutionCommand = async (output, context) => {
|
|
194
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
195
|
+
return deserializeAws_restJson1StartNextPendingJobExecutionCommandError(output, context);
|
|
196
|
+
}
|
|
197
|
+
const contents = map({
|
|
198
|
+
$metadata: deserializeMetadata(output),
|
|
358
199
|
});
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
return
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
output: output,
|
|
404
|
-
parsedBody: parsedBody,
|
|
405
|
-
exceptionCtor: __BaseException,
|
|
406
|
-
errorCode: errorCode,
|
|
407
|
-
});
|
|
408
|
-
_d.label = 15;
|
|
409
|
-
case 15: return [2];
|
|
410
|
-
}
|
|
200
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
201
|
+
if (data.execution != null) {
|
|
202
|
+
contents.execution = deserializeAws_restJson1JobExecution(data.execution, context);
|
|
203
|
+
}
|
|
204
|
+
return contents;
|
|
205
|
+
};
|
|
206
|
+
const deserializeAws_restJson1StartNextPendingJobExecutionCommandError = async (output, context) => {
|
|
207
|
+
const parsedOutput = {
|
|
208
|
+
...output,
|
|
209
|
+
body: await parseErrorBody(output.body, context),
|
|
210
|
+
};
|
|
211
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
212
|
+
switch (errorCode) {
|
|
213
|
+
case "CertificateValidationException":
|
|
214
|
+
case "com.amazonaws.iotjobsdataplane#CertificateValidationException":
|
|
215
|
+
throw await deserializeAws_restJson1CertificateValidationExceptionResponse(parsedOutput, context);
|
|
216
|
+
case "InvalidRequestException":
|
|
217
|
+
case "com.amazonaws.iotjobsdataplane#InvalidRequestException":
|
|
218
|
+
throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
|
|
219
|
+
case "ResourceNotFoundException":
|
|
220
|
+
case "com.amazonaws.iotjobsdataplane#ResourceNotFoundException":
|
|
221
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
222
|
+
case "ServiceUnavailableException":
|
|
223
|
+
case "com.amazonaws.iotjobsdataplane#ServiceUnavailableException":
|
|
224
|
+
throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
|
|
225
|
+
case "ThrottlingException":
|
|
226
|
+
case "com.amazonaws.iotjobsdataplane#ThrottlingException":
|
|
227
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
228
|
+
default:
|
|
229
|
+
const parsedBody = parsedOutput.body;
|
|
230
|
+
throwDefaultError({
|
|
231
|
+
output,
|
|
232
|
+
parsedBody,
|
|
233
|
+
exceptionCtor: __BaseException,
|
|
234
|
+
errorCode,
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
export const deserializeAws_restJson1UpdateJobExecutionCommand = async (output, context) => {
|
|
239
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
240
|
+
return deserializeAws_restJson1UpdateJobExecutionCommandError(output, context);
|
|
241
|
+
}
|
|
242
|
+
const contents = map({
|
|
243
|
+
$metadata: deserializeMetadata(output),
|
|
411
244
|
});
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
contents =
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
245
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
246
|
+
if (data.executionState != null) {
|
|
247
|
+
contents.executionState = deserializeAws_restJson1JobExecutionState(data.executionState, context);
|
|
248
|
+
}
|
|
249
|
+
if (data.jobDocument != null) {
|
|
250
|
+
contents.jobDocument = __expectString(data.jobDocument);
|
|
251
|
+
}
|
|
252
|
+
return contents;
|
|
253
|
+
};
|
|
254
|
+
const deserializeAws_restJson1UpdateJobExecutionCommandError = async (output, context) => {
|
|
255
|
+
const parsedOutput = {
|
|
256
|
+
...output,
|
|
257
|
+
body: await parseErrorBody(output.body, context),
|
|
258
|
+
};
|
|
259
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
260
|
+
switch (errorCode) {
|
|
261
|
+
case "CertificateValidationException":
|
|
262
|
+
case "com.amazonaws.iotjobsdataplane#CertificateValidationException":
|
|
263
|
+
throw await deserializeAws_restJson1CertificateValidationExceptionResponse(parsedOutput, context);
|
|
264
|
+
case "InvalidRequestException":
|
|
265
|
+
case "com.amazonaws.iotjobsdataplane#InvalidRequestException":
|
|
266
|
+
throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
|
|
267
|
+
case "InvalidStateTransitionException":
|
|
268
|
+
case "com.amazonaws.iotjobsdataplane#InvalidStateTransitionException":
|
|
269
|
+
throw await deserializeAws_restJson1InvalidStateTransitionExceptionResponse(parsedOutput, context);
|
|
270
|
+
case "ResourceNotFoundException":
|
|
271
|
+
case "com.amazonaws.iotjobsdataplane#ResourceNotFoundException":
|
|
272
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
273
|
+
case "ServiceUnavailableException":
|
|
274
|
+
case "com.amazonaws.iotjobsdataplane#ServiceUnavailableException":
|
|
275
|
+
throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
|
|
276
|
+
case "ThrottlingException":
|
|
277
|
+
case "com.amazonaws.iotjobsdataplane#ThrottlingException":
|
|
278
|
+
throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
|
|
279
|
+
default:
|
|
280
|
+
const parsedBody = parsedOutput.body;
|
|
281
|
+
throwDefaultError({
|
|
282
|
+
output,
|
|
283
|
+
parsedBody,
|
|
284
|
+
exceptionCtor: __BaseException,
|
|
285
|
+
errorCode,
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
const map = __map;
|
|
290
|
+
const deserializeAws_restJson1CertificateValidationExceptionResponse = async (parsedOutput, context) => {
|
|
291
|
+
const contents = map({});
|
|
292
|
+
const data = parsedOutput.body;
|
|
293
|
+
if (data.message != null) {
|
|
294
|
+
contents.message = __expectString(data.message);
|
|
295
|
+
}
|
|
296
|
+
const exception = new CertificateValidationException({
|
|
297
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
298
|
+
...contents,
|
|
424
299
|
});
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
300
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
301
|
+
};
|
|
302
|
+
const deserializeAws_restJson1InvalidRequestExceptionResponse = async (parsedOutput, context) => {
|
|
303
|
+
const contents = map({});
|
|
304
|
+
const data = parsedOutput.body;
|
|
305
|
+
if (data.message != null) {
|
|
306
|
+
contents.message = __expectString(data.message);
|
|
307
|
+
}
|
|
308
|
+
const exception = new InvalidRequestException({
|
|
309
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
310
|
+
...contents,
|
|
436
311
|
});
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
312
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
313
|
+
};
|
|
314
|
+
const deserializeAws_restJson1InvalidStateTransitionExceptionResponse = async (parsedOutput, context) => {
|
|
315
|
+
const contents = map({});
|
|
316
|
+
const data = parsedOutput.body;
|
|
317
|
+
if (data.message != null) {
|
|
318
|
+
contents.message = __expectString(data.message);
|
|
319
|
+
}
|
|
320
|
+
const exception = new InvalidStateTransitionException({
|
|
321
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
322
|
+
...contents,
|
|
448
323
|
});
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
324
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
325
|
+
};
|
|
326
|
+
const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
|
|
327
|
+
const contents = map({});
|
|
328
|
+
const data = parsedOutput.body;
|
|
329
|
+
if (data.message != null) {
|
|
330
|
+
contents.message = __expectString(data.message);
|
|
331
|
+
}
|
|
332
|
+
const exception = new ResourceNotFoundException({
|
|
333
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
334
|
+
...contents,
|
|
460
335
|
});
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
336
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
337
|
+
};
|
|
338
|
+
const deserializeAws_restJson1ServiceUnavailableExceptionResponse = async (parsedOutput, context) => {
|
|
339
|
+
const contents = map({});
|
|
340
|
+
const data = parsedOutput.body;
|
|
341
|
+
if (data.message != null) {
|
|
342
|
+
contents.message = __expectString(data.message);
|
|
343
|
+
}
|
|
344
|
+
const exception = new ServiceUnavailableException({
|
|
345
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
346
|
+
...contents,
|
|
472
347
|
});
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
348
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
349
|
+
};
|
|
350
|
+
const deserializeAws_restJson1TerminalStateExceptionResponse = async (parsedOutput, context) => {
|
|
351
|
+
const contents = map({});
|
|
352
|
+
const data = parsedOutput.body;
|
|
353
|
+
if (data.message != null) {
|
|
354
|
+
contents.message = __expectString(data.message);
|
|
355
|
+
}
|
|
356
|
+
const exception = new TerminalStateException({
|
|
357
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
358
|
+
...contents,
|
|
484
359
|
});
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
360
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
361
|
+
};
|
|
362
|
+
const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
|
|
363
|
+
const contents = map({});
|
|
364
|
+
const data = parsedOutput.body;
|
|
365
|
+
if (data.message != null) {
|
|
366
|
+
contents.message = __expectString(data.message);
|
|
367
|
+
}
|
|
368
|
+
if (data.payload != null) {
|
|
369
|
+
contents.payload = context.base64Decoder(data.payload);
|
|
370
|
+
}
|
|
371
|
+
const exception = new ThrottlingException({
|
|
372
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
373
|
+
...contents,
|
|
499
374
|
});
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
375
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
376
|
+
};
|
|
377
|
+
const serializeAws_restJson1DetailsMap = (input, context) => {
|
|
378
|
+
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
505
379
|
if (value === null) {
|
|
506
380
|
return acc;
|
|
507
381
|
}
|
|
508
|
-
return
|
|
382
|
+
return {
|
|
383
|
+
...acc,
|
|
384
|
+
[key]: value,
|
|
385
|
+
};
|
|
509
386
|
}, {});
|
|
510
387
|
};
|
|
511
|
-
|
|
512
|
-
return Object.entries(output).reduce(
|
|
513
|
-
var _b;
|
|
514
|
-
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
388
|
+
const deserializeAws_restJson1DetailsMap = (output, context) => {
|
|
389
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
515
390
|
if (value === null) {
|
|
516
391
|
return acc;
|
|
517
392
|
}
|
|
518
|
-
return
|
|
393
|
+
return {
|
|
394
|
+
...acc,
|
|
395
|
+
[key]: __expectString(value),
|
|
396
|
+
};
|
|
519
397
|
}, {});
|
|
520
398
|
};
|
|
521
|
-
|
|
399
|
+
const deserializeAws_restJson1JobExecution = (output, context) => {
|
|
522
400
|
return {
|
|
523
401
|
approximateSecondsBeforeTimedOut: __expectLong(output.approximateSecondsBeforeTimedOut),
|
|
524
402
|
executionNumber: __expectLong(output.executionNumber),
|
|
@@ -533,14 +411,14 @@ var deserializeAws_restJson1JobExecution = function (output, context) {
|
|
|
533
411
|
versionNumber: __expectLong(output.versionNumber),
|
|
534
412
|
};
|
|
535
413
|
};
|
|
536
|
-
|
|
414
|
+
const deserializeAws_restJson1JobExecutionState = (output, context) => {
|
|
537
415
|
return {
|
|
538
416
|
status: __expectString(output.status),
|
|
539
417
|
statusDetails: output.statusDetails != null ? deserializeAws_restJson1DetailsMap(output.statusDetails, context) : undefined,
|
|
540
418
|
versionNumber: __expectLong(output.versionNumber),
|
|
541
419
|
};
|
|
542
420
|
};
|
|
543
|
-
|
|
421
|
+
const deserializeAws_restJson1JobExecutionSummary = (output, context) => {
|
|
544
422
|
return {
|
|
545
423
|
executionNumber: __expectLong(output.executionNumber),
|
|
546
424
|
jobId: __expectString(output.jobId),
|
|
@@ -550,10 +428,10 @@ var deserializeAws_restJson1JobExecutionSummary = function (output, context) {
|
|
|
550
428
|
versionNumber: __expectLong(output.versionNumber),
|
|
551
429
|
};
|
|
552
430
|
};
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
.filter(
|
|
556
|
-
.map(
|
|
431
|
+
const deserializeAws_restJson1JobExecutionSummaryList = (output, context) => {
|
|
432
|
+
const retVal = (output || [])
|
|
433
|
+
.filter((e) => e != null)
|
|
434
|
+
.map((entry) => {
|
|
557
435
|
if (entry === null) {
|
|
558
436
|
return null;
|
|
559
437
|
}
|
|
@@ -561,57 +439,39 @@ var deserializeAws_restJson1JobExecutionSummaryList = function (output, context)
|
|
|
561
439
|
});
|
|
562
440
|
return retVal;
|
|
563
441
|
};
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
});
|
|
572
|
-
};
|
|
573
|
-
var collectBody = function (streamBody, context) {
|
|
574
|
-
if (streamBody === void 0) { streamBody = new Uint8Array(); }
|
|
442
|
+
const deserializeMetadata = (output) => ({
|
|
443
|
+
httpStatusCode: output.statusCode,
|
|
444
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
445
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
446
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
447
|
+
});
|
|
448
|
+
const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
575
449
|
if (streamBody instanceof Uint8Array) {
|
|
576
450
|
return Promise.resolve(streamBody);
|
|
577
451
|
}
|
|
578
452
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
579
453
|
};
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
});
|
|
454
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
455
|
+
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
456
|
+
value !== null &&
|
|
457
|
+
value !== "" &&
|
|
458
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
459
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
460
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
461
|
+
if (encoded.length) {
|
|
462
|
+
return JSON.parse(encoded);
|
|
463
|
+
}
|
|
464
|
+
return {};
|
|
465
|
+
});
|
|
466
|
+
const parseErrorBody = async (errorBody, context) => {
|
|
467
|
+
const value = await parseBody(errorBody, context);
|
|
468
|
+
value.message = value.message ?? value.Message;
|
|
469
|
+
return value;
|
|
597
470
|
};
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
switch (_b.label) {
|
|
603
|
-
case 0: return [4, parseBody(errorBody, context)];
|
|
604
|
-
case 1:
|
|
605
|
-
value = _b.sent();
|
|
606
|
-
value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
|
|
607
|
-
return [2, value];
|
|
608
|
-
}
|
|
609
|
-
});
|
|
610
|
-
}); };
|
|
611
|
-
var loadRestJsonErrorCode = function (output, data) {
|
|
612
|
-
var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
|
|
613
|
-
var sanitizeErrorCode = function (rawValue) {
|
|
614
|
-
var cleanValue = rawValue;
|
|
471
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
472
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
473
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
474
|
+
let cleanValue = rawValue;
|
|
615
475
|
if (typeof cleanValue === "number") {
|
|
616
476
|
cleanValue = cleanValue.toString();
|
|
617
477
|
}
|
|
@@ -626,7 +486,7 @@ var loadRestJsonErrorCode = function (output, data) {
|
|
|
626
486
|
}
|
|
627
487
|
return cleanValue;
|
|
628
488
|
};
|
|
629
|
-
|
|
489
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
630
490
|
if (headerKey !== undefined) {
|
|
631
491
|
return sanitizeErrorCode(output.headers[headerKey]);
|
|
632
492
|
}
|