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