@aws-sdk/client-snow-device-management 3.490.0 → 3.496.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/dist-cjs/SnowDeviceManagement.js +1 -37
- package/dist-cjs/SnowDeviceManagementClient.js +1 -43
- package/dist-cjs/commands/CancelTaskCommand.js +1 -28
- package/dist-cjs/commands/CreateTaskCommand.js +1 -28
- package/dist-cjs/commands/DescribeDeviceCommand.js +1 -28
- package/dist-cjs/commands/DescribeDeviceEc2InstancesCommand.js +1 -28
- package/dist-cjs/commands/DescribeExecutionCommand.js +1 -28
- package/dist-cjs/commands/DescribeTaskCommand.js +1 -28
- package/dist-cjs/commands/ListDeviceResourcesCommand.js +1 -28
- package/dist-cjs/commands/ListDevicesCommand.js +1 -28
- package/dist-cjs/commands/ListExecutionsCommand.js +1 -28
- package/dist-cjs/commands/ListTagsForResourceCommand.js +1 -28
- package/dist-cjs/commands/ListTasksCommand.js +1 -28
- package/dist-cjs/commands/TagResourceCommand.js +1 -28
- package/dist-cjs/commands/UntagResourceCommand.js +1 -28
- package/dist-cjs/commands/index.js +1 -16
- package/dist-cjs/endpoint/EndpointParameters.js +1 -18
- package/dist-cjs/extensionConfiguration.js +1 -2
- package/dist-cjs/index.js +1566 -11
- package/dist-cjs/models/SnowDeviceManagementServiceException.js +1 -12
- package/dist-cjs/models/index.js +1 -4
- package/dist-cjs/models/models_0.js +1 -140
- package/dist-cjs/pagination/Interfaces.js +1 -2
- package/dist-cjs/pagination/ListDeviceResourcesPaginator.js +1 -7
- package/dist-cjs/pagination/ListDevicesPaginator.js +1 -7
- package/dist-cjs/pagination/ListExecutionsPaginator.js +1 -7
- package/dist-cjs/pagination/ListTasksPaginator.js +1 -7
- package/dist-cjs/pagination/index.js +1 -8
- package/dist-cjs/protocols/Aws_restJson1.js +1 -969
- package/dist-cjs/runtimeExtensions.js +1 -22
- package/package.json +40 -40
|
@@ -1,969 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_ListTasksCommand = exports.de_ListTagsForResourceCommand = exports.de_ListExecutionsCommand = exports.de_ListDevicesCommand = exports.de_ListDeviceResourcesCommand = exports.de_DescribeTaskCommand = exports.de_DescribeExecutionCommand = exports.de_DescribeDeviceEc2InstancesCommand = exports.de_DescribeDeviceCommand = exports.de_CreateTaskCommand = exports.de_CancelTaskCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_ListTasksCommand = exports.se_ListTagsForResourceCommand = exports.se_ListExecutionsCommand = exports.se_ListDevicesCommand = exports.se_ListDeviceResourcesCommand = exports.se_DescribeTaskCommand = exports.se_DescribeExecutionCommand = exports.se_DescribeDeviceEc2InstancesCommand = exports.se_DescribeDeviceCommand = exports.se_CreateTaskCommand = exports.se_CancelTaskCommand = void 0;
|
|
4
|
-
const core_1 = require("@smithy/core");
|
|
5
|
-
const smithy_client_1 = require("@smithy/smithy-client");
|
|
6
|
-
const uuid_1 = require("uuid");
|
|
7
|
-
const models_0_1 = require("../models/models_0");
|
|
8
|
-
const SnowDeviceManagementServiceException_1 = require("../models/SnowDeviceManagementServiceException");
|
|
9
|
-
const se_CancelTaskCommand = async (input, context) => {
|
|
10
|
-
const b = (0, core_1.requestBuilder)(input, context);
|
|
11
|
-
const headers = {};
|
|
12
|
-
b.bp("/task/{taskId}/cancel");
|
|
13
|
-
b.p("taskId", () => input.taskId, "{taskId}", false);
|
|
14
|
-
let body;
|
|
15
|
-
b.m("POST").h(headers).b(body);
|
|
16
|
-
return b.build();
|
|
17
|
-
};
|
|
18
|
-
exports.se_CancelTaskCommand = se_CancelTaskCommand;
|
|
19
|
-
const se_CreateTaskCommand = async (input, context) => {
|
|
20
|
-
const b = (0, core_1.requestBuilder)(input, context);
|
|
21
|
-
const headers = {
|
|
22
|
-
"content-type": "application/json",
|
|
23
|
-
};
|
|
24
|
-
b.bp("/task");
|
|
25
|
-
let body;
|
|
26
|
-
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
27
|
-
clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
|
|
28
|
-
command: (_) => (0, smithy_client_1._json)(_),
|
|
29
|
-
description: [],
|
|
30
|
-
tags: (_) => (0, smithy_client_1._json)(_),
|
|
31
|
-
targets: (_) => (0, smithy_client_1._json)(_),
|
|
32
|
-
}));
|
|
33
|
-
b.m("POST").h(headers).b(body);
|
|
34
|
-
return b.build();
|
|
35
|
-
};
|
|
36
|
-
exports.se_CreateTaskCommand = se_CreateTaskCommand;
|
|
37
|
-
const se_DescribeDeviceCommand = async (input, context) => {
|
|
38
|
-
const b = (0, core_1.requestBuilder)(input, context);
|
|
39
|
-
const headers = {};
|
|
40
|
-
b.bp("/managed-device/{managedDeviceId}/describe");
|
|
41
|
-
b.p("managedDeviceId", () => input.managedDeviceId, "{managedDeviceId}", false);
|
|
42
|
-
let body;
|
|
43
|
-
b.m("POST").h(headers).b(body);
|
|
44
|
-
return b.build();
|
|
45
|
-
};
|
|
46
|
-
exports.se_DescribeDeviceCommand = se_DescribeDeviceCommand;
|
|
47
|
-
const se_DescribeDeviceEc2InstancesCommand = async (input, context) => {
|
|
48
|
-
const b = (0, core_1.requestBuilder)(input, context);
|
|
49
|
-
const headers = {
|
|
50
|
-
"content-type": "application/json",
|
|
51
|
-
};
|
|
52
|
-
b.bp("/managed-device/{managedDeviceId}/resources/ec2/describe");
|
|
53
|
-
b.p("managedDeviceId", () => input.managedDeviceId, "{managedDeviceId}", false);
|
|
54
|
-
let body;
|
|
55
|
-
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
56
|
-
instanceIds: (_) => (0, smithy_client_1._json)(_),
|
|
57
|
-
}));
|
|
58
|
-
b.m("POST").h(headers).b(body);
|
|
59
|
-
return b.build();
|
|
60
|
-
};
|
|
61
|
-
exports.se_DescribeDeviceEc2InstancesCommand = se_DescribeDeviceEc2InstancesCommand;
|
|
62
|
-
const se_DescribeExecutionCommand = async (input, context) => {
|
|
63
|
-
const b = (0, core_1.requestBuilder)(input, context);
|
|
64
|
-
const headers = {};
|
|
65
|
-
b.bp("/task/{taskId}/execution/{managedDeviceId}");
|
|
66
|
-
b.p("taskId", () => input.taskId, "{taskId}", false);
|
|
67
|
-
b.p("managedDeviceId", () => input.managedDeviceId, "{managedDeviceId}", false);
|
|
68
|
-
let body;
|
|
69
|
-
b.m("POST").h(headers).b(body);
|
|
70
|
-
return b.build();
|
|
71
|
-
};
|
|
72
|
-
exports.se_DescribeExecutionCommand = se_DescribeExecutionCommand;
|
|
73
|
-
const se_DescribeTaskCommand = async (input, context) => {
|
|
74
|
-
const b = (0, core_1.requestBuilder)(input, context);
|
|
75
|
-
const headers = {};
|
|
76
|
-
b.bp("/task/{taskId}");
|
|
77
|
-
b.p("taskId", () => input.taskId, "{taskId}", false);
|
|
78
|
-
let body;
|
|
79
|
-
b.m("POST").h(headers).b(body);
|
|
80
|
-
return b.build();
|
|
81
|
-
};
|
|
82
|
-
exports.se_DescribeTaskCommand = se_DescribeTaskCommand;
|
|
83
|
-
const se_ListDeviceResourcesCommand = async (input, context) => {
|
|
84
|
-
const b = (0, core_1.requestBuilder)(input, context);
|
|
85
|
-
const headers = {};
|
|
86
|
-
b.bp("/managed-device/{managedDeviceId}/resources");
|
|
87
|
-
b.p("managedDeviceId", () => input.managedDeviceId, "{managedDeviceId}", false);
|
|
88
|
-
const query = (0, smithy_client_1.map)({
|
|
89
|
-
[_t]: [, input[_t]],
|
|
90
|
-
[_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
|
|
91
|
-
[_nT]: [, input[_nT]],
|
|
92
|
-
});
|
|
93
|
-
let body;
|
|
94
|
-
b.m("GET").h(headers).q(query).b(body);
|
|
95
|
-
return b.build();
|
|
96
|
-
};
|
|
97
|
-
exports.se_ListDeviceResourcesCommand = se_ListDeviceResourcesCommand;
|
|
98
|
-
const se_ListDevicesCommand = async (input, context) => {
|
|
99
|
-
const b = (0, core_1.requestBuilder)(input, context);
|
|
100
|
-
const headers = {};
|
|
101
|
-
b.bp("/managed-devices");
|
|
102
|
-
const query = (0, smithy_client_1.map)({
|
|
103
|
-
[_jI]: [, input[_jI]],
|
|
104
|
-
[_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
|
|
105
|
-
[_nT]: [, input[_nT]],
|
|
106
|
-
});
|
|
107
|
-
let body;
|
|
108
|
-
b.m("GET").h(headers).q(query).b(body);
|
|
109
|
-
return b.build();
|
|
110
|
-
};
|
|
111
|
-
exports.se_ListDevicesCommand = se_ListDevicesCommand;
|
|
112
|
-
const se_ListExecutionsCommand = async (input, context) => {
|
|
113
|
-
const b = (0, core_1.requestBuilder)(input, context);
|
|
114
|
-
const headers = {};
|
|
115
|
-
b.bp("/executions");
|
|
116
|
-
const query = (0, smithy_client_1.map)({
|
|
117
|
-
[_tI]: [, (0, smithy_client_1.expectNonNull)(input[_tI], `taskId`)],
|
|
118
|
-
[_s]: [, input[_s]],
|
|
119
|
-
[_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
|
|
120
|
-
[_nT]: [, input[_nT]],
|
|
121
|
-
});
|
|
122
|
-
let body;
|
|
123
|
-
b.m("GET").h(headers).q(query).b(body);
|
|
124
|
-
return b.build();
|
|
125
|
-
};
|
|
126
|
-
exports.se_ListExecutionsCommand = se_ListExecutionsCommand;
|
|
127
|
-
const se_ListTagsForResourceCommand = async (input, context) => {
|
|
128
|
-
const b = (0, core_1.requestBuilder)(input, context);
|
|
129
|
-
const headers = {};
|
|
130
|
-
b.bp("/tags/{resourceArn}");
|
|
131
|
-
b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
|
|
132
|
-
let body;
|
|
133
|
-
b.m("GET").h(headers).b(body);
|
|
134
|
-
return b.build();
|
|
135
|
-
};
|
|
136
|
-
exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand;
|
|
137
|
-
const se_ListTasksCommand = async (input, context) => {
|
|
138
|
-
const b = (0, core_1.requestBuilder)(input, context);
|
|
139
|
-
const headers = {};
|
|
140
|
-
b.bp("/tasks");
|
|
141
|
-
const query = (0, smithy_client_1.map)({
|
|
142
|
-
[_s]: [, input[_s]],
|
|
143
|
-
[_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
|
|
144
|
-
[_nT]: [, input[_nT]],
|
|
145
|
-
});
|
|
146
|
-
let body;
|
|
147
|
-
b.m("GET").h(headers).q(query).b(body);
|
|
148
|
-
return b.build();
|
|
149
|
-
};
|
|
150
|
-
exports.se_ListTasksCommand = se_ListTasksCommand;
|
|
151
|
-
const se_TagResourceCommand = async (input, context) => {
|
|
152
|
-
const b = (0, core_1.requestBuilder)(input, context);
|
|
153
|
-
const headers = {
|
|
154
|
-
"content-type": "application/json",
|
|
155
|
-
};
|
|
156
|
-
b.bp("/tags/{resourceArn}");
|
|
157
|
-
b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
|
|
158
|
-
let body;
|
|
159
|
-
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
160
|
-
tags: (_) => (0, smithy_client_1._json)(_),
|
|
161
|
-
}));
|
|
162
|
-
b.m("POST").h(headers).b(body);
|
|
163
|
-
return b.build();
|
|
164
|
-
};
|
|
165
|
-
exports.se_TagResourceCommand = se_TagResourceCommand;
|
|
166
|
-
const se_UntagResourceCommand = async (input, context) => {
|
|
167
|
-
const b = (0, core_1.requestBuilder)(input, context);
|
|
168
|
-
const headers = {};
|
|
169
|
-
b.bp("/tags/{resourceArn}");
|
|
170
|
-
b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
|
|
171
|
-
const query = (0, smithy_client_1.map)({
|
|
172
|
-
[_tK]: [
|
|
173
|
-
(0, smithy_client_1.expectNonNull)(input.tagKeys, `tagKeys`) != null,
|
|
174
|
-
() => (input[_tK] || []).map((_entry) => _entry),
|
|
175
|
-
],
|
|
176
|
-
});
|
|
177
|
-
let body;
|
|
178
|
-
b.m("DELETE").h(headers).q(query).b(body);
|
|
179
|
-
return b.build();
|
|
180
|
-
};
|
|
181
|
-
exports.se_UntagResourceCommand = se_UntagResourceCommand;
|
|
182
|
-
const de_CancelTaskCommand = async (output, context) => {
|
|
183
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
184
|
-
return de_CancelTaskCommandError(output, context);
|
|
185
|
-
}
|
|
186
|
-
const contents = (0, smithy_client_1.map)({
|
|
187
|
-
$metadata: deserializeMetadata(output),
|
|
188
|
-
});
|
|
189
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
190
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
191
|
-
taskId: smithy_client_1.expectString,
|
|
192
|
-
});
|
|
193
|
-
Object.assign(contents, doc);
|
|
194
|
-
return contents;
|
|
195
|
-
};
|
|
196
|
-
exports.de_CancelTaskCommand = de_CancelTaskCommand;
|
|
197
|
-
const de_CancelTaskCommandError = async (output, context) => {
|
|
198
|
-
const parsedOutput = {
|
|
199
|
-
...output,
|
|
200
|
-
body: await parseErrorBody(output.body, context),
|
|
201
|
-
};
|
|
202
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
203
|
-
switch (errorCode) {
|
|
204
|
-
case "AccessDeniedException":
|
|
205
|
-
case "com.amazonaws.snowdevicemanagement#AccessDeniedException":
|
|
206
|
-
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
207
|
-
case "InternalServerException":
|
|
208
|
-
case "com.amazonaws.snowdevicemanagement#InternalServerException":
|
|
209
|
-
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
210
|
-
case "ResourceNotFoundException":
|
|
211
|
-
case "com.amazonaws.snowdevicemanagement#ResourceNotFoundException":
|
|
212
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
213
|
-
case "ThrottlingException":
|
|
214
|
-
case "com.amazonaws.snowdevicemanagement#ThrottlingException":
|
|
215
|
-
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
216
|
-
case "ValidationException":
|
|
217
|
-
case "com.amazonaws.snowdevicemanagement#ValidationException":
|
|
218
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
219
|
-
default:
|
|
220
|
-
const parsedBody = parsedOutput.body;
|
|
221
|
-
return throwDefaultError({
|
|
222
|
-
output,
|
|
223
|
-
parsedBody,
|
|
224
|
-
errorCode,
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
};
|
|
228
|
-
const de_CreateTaskCommand = async (output, context) => {
|
|
229
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
230
|
-
return de_CreateTaskCommandError(output, context);
|
|
231
|
-
}
|
|
232
|
-
const contents = (0, smithy_client_1.map)({
|
|
233
|
-
$metadata: deserializeMetadata(output),
|
|
234
|
-
});
|
|
235
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
236
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
237
|
-
taskArn: smithy_client_1.expectString,
|
|
238
|
-
taskId: smithy_client_1.expectString,
|
|
239
|
-
});
|
|
240
|
-
Object.assign(contents, doc);
|
|
241
|
-
return contents;
|
|
242
|
-
};
|
|
243
|
-
exports.de_CreateTaskCommand = de_CreateTaskCommand;
|
|
244
|
-
const de_CreateTaskCommandError = async (output, context) => {
|
|
245
|
-
const parsedOutput = {
|
|
246
|
-
...output,
|
|
247
|
-
body: await parseErrorBody(output.body, context),
|
|
248
|
-
};
|
|
249
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
250
|
-
switch (errorCode) {
|
|
251
|
-
case "AccessDeniedException":
|
|
252
|
-
case "com.amazonaws.snowdevicemanagement#AccessDeniedException":
|
|
253
|
-
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
254
|
-
case "InternalServerException":
|
|
255
|
-
case "com.amazonaws.snowdevicemanagement#InternalServerException":
|
|
256
|
-
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
257
|
-
case "ResourceNotFoundException":
|
|
258
|
-
case "com.amazonaws.snowdevicemanagement#ResourceNotFoundException":
|
|
259
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
260
|
-
case "ServiceQuotaExceededException":
|
|
261
|
-
case "com.amazonaws.snowdevicemanagement#ServiceQuotaExceededException":
|
|
262
|
-
throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
|
|
263
|
-
case "ThrottlingException":
|
|
264
|
-
case "com.amazonaws.snowdevicemanagement#ThrottlingException":
|
|
265
|
-
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
266
|
-
case "ValidationException":
|
|
267
|
-
case "com.amazonaws.snowdevicemanagement#ValidationException":
|
|
268
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
269
|
-
default:
|
|
270
|
-
const parsedBody = parsedOutput.body;
|
|
271
|
-
return throwDefaultError({
|
|
272
|
-
output,
|
|
273
|
-
parsedBody,
|
|
274
|
-
errorCode,
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
};
|
|
278
|
-
const de_DescribeDeviceCommand = async (output, context) => {
|
|
279
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
280
|
-
return de_DescribeDeviceCommandError(output, context);
|
|
281
|
-
}
|
|
282
|
-
const contents = (0, smithy_client_1.map)({
|
|
283
|
-
$metadata: deserializeMetadata(output),
|
|
284
|
-
});
|
|
285
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
286
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
287
|
-
associatedWithJob: smithy_client_1.expectString,
|
|
288
|
-
deviceCapacities: smithy_client_1._json,
|
|
289
|
-
deviceState: smithy_client_1.expectString,
|
|
290
|
-
deviceType: smithy_client_1.expectString,
|
|
291
|
-
lastReachedOutAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
292
|
-
lastUpdatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
293
|
-
managedDeviceArn: smithy_client_1.expectString,
|
|
294
|
-
managedDeviceId: smithy_client_1.expectString,
|
|
295
|
-
physicalNetworkInterfaces: smithy_client_1._json,
|
|
296
|
-
software: smithy_client_1._json,
|
|
297
|
-
tags: smithy_client_1._json,
|
|
298
|
-
});
|
|
299
|
-
Object.assign(contents, doc);
|
|
300
|
-
return contents;
|
|
301
|
-
};
|
|
302
|
-
exports.de_DescribeDeviceCommand = de_DescribeDeviceCommand;
|
|
303
|
-
const de_DescribeDeviceCommandError = async (output, context) => {
|
|
304
|
-
const parsedOutput = {
|
|
305
|
-
...output,
|
|
306
|
-
body: await parseErrorBody(output.body, context),
|
|
307
|
-
};
|
|
308
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
309
|
-
switch (errorCode) {
|
|
310
|
-
case "AccessDeniedException":
|
|
311
|
-
case "com.amazonaws.snowdevicemanagement#AccessDeniedException":
|
|
312
|
-
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
313
|
-
case "InternalServerException":
|
|
314
|
-
case "com.amazonaws.snowdevicemanagement#InternalServerException":
|
|
315
|
-
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
316
|
-
case "ResourceNotFoundException":
|
|
317
|
-
case "com.amazonaws.snowdevicemanagement#ResourceNotFoundException":
|
|
318
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
319
|
-
case "ThrottlingException":
|
|
320
|
-
case "com.amazonaws.snowdevicemanagement#ThrottlingException":
|
|
321
|
-
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
322
|
-
case "ValidationException":
|
|
323
|
-
case "com.amazonaws.snowdevicemanagement#ValidationException":
|
|
324
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
325
|
-
default:
|
|
326
|
-
const parsedBody = parsedOutput.body;
|
|
327
|
-
return throwDefaultError({
|
|
328
|
-
output,
|
|
329
|
-
parsedBody,
|
|
330
|
-
errorCode,
|
|
331
|
-
});
|
|
332
|
-
}
|
|
333
|
-
};
|
|
334
|
-
const de_DescribeDeviceEc2InstancesCommand = async (output, context) => {
|
|
335
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
336
|
-
return de_DescribeDeviceEc2InstancesCommandError(output, context);
|
|
337
|
-
}
|
|
338
|
-
const contents = (0, smithy_client_1.map)({
|
|
339
|
-
$metadata: deserializeMetadata(output),
|
|
340
|
-
});
|
|
341
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
342
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
343
|
-
instances: (_) => de_InstanceSummaryList(_, context),
|
|
344
|
-
});
|
|
345
|
-
Object.assign(contents, doc);
|
|
346
|
-
return contents;
|
|
347
|
-
};
|
|
348
|
-
exports.de_DescribeDeviceEc2InstancesCommand = de_DescribeDeviceEc2InstancesCommand;
|
|
349
|
-
const de_DescribeDeviceEc2InstancesCommandError = async (output, context) => {
|
|
350
|
-
const parsedOutput = {
|
|
351
|
-
...output,
|
|
352
|
-
body: await parseErrorBody(output.body, context),
|
|
353
|
-
};
|
|
354
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
355
|
-
switch (errorCode) {
|
|
356
|
-
case "AccessDeniedException":
|
|
357
|
-
case "com.amazonaws.snowdevicemanagement#AccessDeniedException":
|
|
358
|
-
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
359
|
-
case "InternalServerException":
|
|
360
|
-
case "com.amazonaws.snowdevicemanagement#InternalServerException":
|
|
361
|
-
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
362
|
-
case "ResourceNotFoundException":
|
|
363
|
-
case "com.amazonaws.snowdevicemanagement#ResourceNotFoundException":
|
|
364
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
365
|
-
case "ThrottlingException":
|
|
366
|
-
case "com.amazonaws.snowdevicemanagement#ThrottlingException":
|
|
367
|
-
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
368
|
-
case "ValidationException":
|
|
369
|
-
case "com.amazonaws.snowdevicemanagement#ValidationException":
|
|
370
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
371
|
-
default:
|
|
372
|
-
const parsedBody = parsedOutput.body;
|
|
373
|
-
return throwDefaultError({
|
|
374
|
-
output,
|
|
375
|
-
parsedBody,
|
|
376
|
-
errorCode,
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
|
-
};
|
|
380
|
-
const de_DescribeExecutionCommand = async (output, context) => {
|
|
381
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
382
|
-
return de_DescribeExecutionCommandError(output, context);
|
|
383
|
-
}
|
|
384
|
-
const contents = (0, smithy_client_1.map)({
|
|
385
|
-
$metadata: deserializeMetadata(output),
|
|
386
|
-
});
|
|
387
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
388
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
389
|
-
executionId: smithy_client_1.expectString,
|
|
390
|
-
lastUpdatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
391
|
-
managedDeviceId: smithy_client_1.expectString,
|
|
392
|
-
startedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
393
|
-
state: smithy_client_1.expectString,
|
|
394
|
-
taskId: smithy_client_1.expectString,
|
|
395
|
-
});
|
|
396
|
-
Object.assign(contents, doc);
|
|
397
|
-
return contents;
|
|
398
|
-
};
|
|
399
|
-
exports.de_DescribeExecutionCommand = de_DescribeExecutionCommand;
|
|
400
|
-
const de_DescribeExecutionCommandError = async (output, context) => {
|
|
401
|
-
const parsedOutput = {
|
|
402
|
-
...output,
|
|
403
|
-
body: await parseErrorBody(output.body, context),
|
|
404
|
-
};
|
|
405
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
406
|
-
switch (errorCode) {
|
|
407
|
-
case "AccessDeniedException":
|
|
408
|
-
case "com.amazonaws.snowdevicemanagement#AccessDeniedException":
|
|
409
|
-
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
410
|
-
case "InternalServerException":
|
|
411
|
-
case "com.amazonaws.snowdevicemanagement#InternalServerException":
|
|
412
|
-
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
413
|
-
case "ResourceNotFoundException":
|
|
414
|
-
case "com.amazonaws.snowdevicemanagement#ResourceNotFoundException":
|
|
415
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
416
|
-
case "ThrottlingException":
|
|
417
|
-
case "com.amazonaws.snowdevicemanagement#ThrottlingException":
|
|
418
|
-
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
419
|
-
case "ValidationException":
|
|
420
|
-
case "com.amazonaws.snowdevicemanagement#ValidationException":
|
|
421
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
422
|
-
default:
|
|
423
|
-
const parsedBody = parsedOutput.body;
|
|
424
|
-
return throwDefaultError({
|
|
425
|
-
output,
|
|
426
|
-
parsedBody,
|
|
427
|
-
errorCode,
|
|
428
|
-
});
|
|
429
|
-
}
|
|
430
|
-
};
|
|
431
|
-
const de_DescribeTaskCommand = async (output, context) => {
|
|
432
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
433
|
-
return de_DescribeTaskCommandError(output, context);
|
|
434
|
-
}
|
|
435
|
-
const contents = (0, smithy_client_1.map)({
|
|
436
|
-
$metadata: deserializeMetadata(output),
|
|
437
|
-
});
|
|
438
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
439
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
440
|
-
completedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
441
|
-
createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
442
|
-
description: smithy_client_1.expectString,
|
|
443
|
-
lastUpdatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
444
|
-
state: smithy_client_1.expectString,
|
|
445
|
-
tags: smithy_client_1._json,
|
|
446
|
-
targets: smithy_client_1._json,
|
|
447
|
-
taskArn: smithy_client_1.expectString,
|
|
448
|
-
taskId: smithy_client_1.expectString,
|
|
449
|
-
});
|
|
450
|
-
Object.assign(contents, doc);
|
|
451
|
-
return contents;
|
|
452
|
-
};
|
|
453
|
-
exports.de_DescribeTaskCommand = de_DescribeTaskCommand;
|
|
454
|
-
const de_DescribeTaskCommandError = async (output, context) => {
|
|
455
|
-
const parsedOutput = {
|
|
456
|
-
...output,
|
|
457
|
-
body: await parseErrorBody(output.body, context),
|
|
458
|
-
};
|
|
459
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
460
|
-
switch (errorCode) {
|
|
461
|
-
case "AccessDeniedException":
|
|
462
|
-
case "com.amazonaws.snowdevicemanagement#AccessDeniedException":
|
|
463
|
-
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
464
|
-
case "InternalServerException":
|
|
465
|
-
case "com.amazonaws.snowdevicemanagement#InternalServerException":
|
|
466
|
-
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
467
|
-
case "ResourceNotFoundException":
|
|
468
|
-
case "com.amazonaws.snowdevicemanagement#ResourceNotFoundException":
|
|
469
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
470
|
-
case "ThrottlingException":
|
|
471
|
-
case "com.amazonaws.snowdevicemanagement#ThrottlingException":
|
|
472
|
-
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
473
|
-
case "ValidationException":
|
|
474
|
-
case "com.amazonaws.snowdevicemanagement#ValidationException":
|
|
475
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
476
|
-
default:
|
|
477
|
-
const parsedBody = parsedOutput.body;
|
|
478
|
-
return throwDefaultError({
|
|
479
|
-
output,
|
|
480
|
-
parsedBody,
|
|
481
|
-
errorCode,
|
|
482
|
-
});
|
|
483
|
-
}
|
|
484
|
-
};
|
|
485
|
-
const de_ListDeviceResourcesCommand = async (output, context) => {
|
|
486
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
487
|
-
return de_ListDeviceResourcesCommandError(output, context);
|
|
488
|
-
}
|
|
489
|
-
const contents = (0, smithy_client_1.map)({
|
|
490
|
-
$metadata: deserializeMetadata(output),
|
|
491
|
-
});
|
|
492
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
493
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
494
|
-
nextToken: smithy_client_1.expectString,
|
|
495
|
-
resources: smithy_client_1._json,
|
|
496
|
-
});
|
|
497
|
-
Object.assign(contents, doc);
|
|
498
|
-
return contents;
|
|
499
|
-
};
|
|
500
|
-
exports.de_ListDeviceResourcesCommand = de_ListDeviceResourcesCommand;
|
|
501
|
-
const de_ListDeviceResourcesCommandError = async (output, context) => {
|
|
502
|
-
const parsedOutput = {
|
|
503
|
-
...output,
|
|
504
|
-
body: await parseErrorBody(output.body, context),
|
|
505
|
-
};
|
|
506
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
507
|
-
switch (errorCode) {
|
|
508
|
-
case "AccessDeniedException":
|
|
509
|
-
case "com.amazonaws.snowdevicemanagement#AccessDeniedException":
|
|
510
|
-
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
511
|
-
case "InternalServerException":
|
|
512
|
-
case "com.amazonaws.snowdevicemanagement#InternalServerException":
|
|
513
|
-
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
514
|
-
case "ResourceNotFoundException":
|
|
515
|
-
case "com.amazonaws.snowdevicemanagement#ResourceNotFoundException":
|
|
516
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
517
|
-
case "ThrottlingException":
|
|
518
|
-
case "com.amazonaws.snowdevicemanagement#ThrottlingException":
|
|
519
|
-
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
520
|
-
case "ValidationException":
|
|
521
|
-
case "com.amazonaws.snowdevicemanagement#ValidationException":
|
|
522
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
523
|
-
default:
|
|
524
|
-
const parsedBody = parsedOutput.body;
|
|
525
|
-
return throwDefaultError({
|
|
526
|
-
output,
|
|
527
|
-
parsedBody,
|
|
528
|
-
errorCode,
|
|
529
|
-
});
|
|
530
|
-
}
|
|
531
|
-
};
|
|
532
|
-
const de_ListDevicesCommand = async (output, context) => {
|
|
533
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
534
|
-
return de_ListDevicesCommandError(output, context);
|
|
535
|
-
}
|
|
536
|
-
const contents = (0, smithy_client_1.map)({
|
|
537
|
-
$metadata: deserializeMetadata(output),
|
|
538
|
-
});
|
|
539
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
540
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
541
|
-
devices: smithy_client_1._json,
|
|
542
|
-
nextToken: smithy_client_1.expectString,
|
|
543
|
-
});
|
|
544
|
-
Object.assign(contents, doc);
|
|
545
|
-
return contents;
|
|
546
|
-
};
|
|
547
|
-
exports.de_ListDevicesCommand = de_ListDevicesCommand;
|
|
548
|
-
const de_ListDevicesCommandError = async (output, context) => {
|
|
549
|
-
const parsedOutput = {
|
|
550
|
-
...output,
|
|
551
|
-
body: await parseErrorBody(output.body, context),
|
|
552
|
-
};
|
|
553
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
554
|
-
switch (errorCode) {
|
|
555
|
-
case "AccessDeniedException":
|
|
556
|
-
case "com.amazonaws.snowdevicemanagement#AccessDeniedException":
|
|
557
|
-
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
558
|
-
case "InternalServerException":
|
|
559
|
-
case "com.amazonaws.snowdevicemanagement#InternalServerException":
|
|
560
|
-
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
561
|
-
case "ThrottlingException":
|
|
562
|
-
case "com.amazonaws.snowdevicemanagement#ThrottlingException":
|
|
563
|
-
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
564
|
-
case "ValidationException":
|
|
565
|
-
case "com.amazonaws.snowdevicemanagement#ValidationException":
|
|
566
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
567
|
-
default:
|
|
568
|
-
const parsedBody = parsedOutput.body;
|
|
569
|
-
return throwDefaultError({
|
|
570
|
-
output,
|
|
571
|
-
parsedBody,
|
|
572
|
-
errorCode,
|
|
573
|
-
});
|
|
574
|
-
}
|
|
575
|
-
};
|
|
576
|
-
const de_ListExecutionsCommand = async (output, context) => {
|
|
577
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
578
|
-
return de_ListExecutionsCommandError(output, context);
|
|
579
|
-
}
|
|
580
|
-
const contents = (0, smithy_client_1.map)({
|
|
581
|
-
$metadata: deserializeMetadata(output),
|
|
582
|
-
});
|
|
583
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
584
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
585
|
-
executions: smithy_client_1._json,
|
|
586
|
-
nextToken: smithy_client_1.expectString,
|
|
587
|
-
});
|
|
588
|
-
Object.assign(contents, doc);
|
|
589
|
-
return contents;
|
|
590
|
-
};
|
|
591
|
-
exports.de_ListExecutionsCommand = de_ListExecutionsCommand;
|
|
592
|
-
const de_ListExecutionsCommandError = async (output, context) => {
|
|
593
|
-
const parsedOutput = {
|
|
594
|
-
...output,
|
|
595
|
-
body: await parseErrorBody(output.body, context),
|
|
596
|
-
};
|
|
597
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
598
|
-
switch (errorCode) {
|
|
599
|
-
case "AccessDeniedException":
|
|
600
|
-
case "com.amazonaws.snowdevicemanagement#AccessDeniedException":
|
|
601
|
-
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
602
|
-
case "InternalServerException":
|
|
603
|
-
case "com.amazonaws.snowdevicemanagement#InternalServerException":
|
|
604
|
-
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
605
|
-
case "ResourceNotFoundException":
|
|
606
|
-
case "com.amazonaws.snowdevicemanagement#ResourceNotFoundException":
|
|
607
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
608
|
-
case "ThrottlingException":
|
|
609
|
-
case "com.amazonaws.snowdevicemanagement#ThrottlingException":
|
|
610
|
-
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
611
|
-
case "ValidationException":
|
|
612
|
-
case "com.amazonaws.snowdevicemanagement#ValidationException":
|
|
613
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
614
|
-
default:
|
|
615
|
-
const parsedBody = parsedOutput.body;
|
|
616
|
-
return throwDefaultError({
|
|
617
|
-
output,
|
|
618
|
-
parsedBody,
|
|
619
|
-
errorCode,
|
|
620
|
-
});
|
|
621
|
-
}
|
|
622
|
-
};
|
|
623
|
-
const de_ListTagsForResourceCommand = async (output, context) => {
|
|
624
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
625
|
-
return de_ListTagsForResourceCommandError(output, context);
|
|
626
|
-
}
|
|
627
|
-
const contents = (0, smithy_client_1.map)({
|
|
628
|
-
$metadata: deserializeMetadata(output),
|
|
629
|
-
});
|
|
630
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
631
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
632
|
-
tags: smithy_client_1._json,
|
|
633
|
-
});
|
|
634
|
-
Object.assign(contents, doc);
|
|
635
|
-
return contents;
|
|
636
|
-
};
|
|
637
|
-
exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
|
|
638
|
-
const de_ListTagsForResourceCommandError = async (output, context) => {
|
|
639
|
-
const parsedOutput = {
|
|
640
|
-
...output,
|
|
641
|
-
body: await parseErrorBody(output.body, context),
|
|
642
|
-
};
|
|
643
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
644
|
-
switch (errorCode) {
|
|
645
|
-
case "InternalServerException":
|
|
646
|
-
case "com.amazonaws.snowdevicemanagement#InternalServerException":
|
|
647
|
-
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
648
|
-
case "ResourceNotFoundException":
|
|
649
|
-
case "com.amazonaws.snowdevicemanagement#ResourceNotFoundException":
|
|
650
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
651
|
-
case "ValidationException":
|
|
652
|
-
case "com.amazonaws.snowdevicemanagement#ValidationException":
|
|
653
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
654
|
-
default:
|
|
655
|
-
const parsedBody = parsedOutput.body;
|
|
656
|
-
return throwDefaultError({
|
|
657
|
-
output,
|
|
658
|
-
parsedBody,
|
|
659
|
-
errorCode,
|
|
660
|
-
});
|
|
661
|
-
}
|
|
662
|
-
};
|
|
663
|
-
const de_ListTasksCommand = async (output, context) => {
|
|
664
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
665
|
-
return de_ListTasksCommandError(output, context);
|
|
666
|
-
}
|
|
667
|
-
const contents = (0, smithy_client_1.map)({
|
|
668
|
-
$metadata: deserializeMetadata(output),
|
|
669
|
-
});
|
|
670
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
671
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
672
|
-
nextToken: smithy_client_1.expectString,
|
|
673
|
-
tasks: smithy_client_1._json,
|
|
674
|
-
});
|
|
675
|
-
Object.assign(contents, doc);
|
|
676
|
-
return contents;
|
|
677
|
-
};
|
|
678
|
-
exports.de_ListTasksCommand = de_ListTasksCommand;
|
|
679
|
-
const de_ListTasksCommandError = async (output, context) => {
|
|
680
|
-
const parsedOutput = {
|
|
681
|
-
...output,
|
|
682
|
-
body: await parseErrorBody(output.body, context),
|
|
683
|
-
};
|
|
684
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
685
|
-
switch (errorCode) {
|
|
686
|
-
case "AccessDeniedException":
|
|
687
|
-
case "com.amazonaws.snowdevicemanagement#AccessDeniedException":
|
|
688
|
-
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
689
|
-
case "InternalServerException":
|
|
690
|
-
case "com.amazonaws.snowdevicemanagement#InternalServerException":
|
|
691
|
-
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
692
|
-
case "ThrottlingException":
|
|
693
|
-
case "com.amazonaws.snowdevicemanagement#ThrottlingException":
|
|
694
|
-
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
695
|
-
case "ValidationException":
|
|
696
|
-
case "com.amazonaws.snowdevicemanagement#ValidationException":
|
|
697
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
698
|
-
default:
|
|
699
|
-
const parsedBody = parsedOutput.body;
|
|
700
|
-
return throwDefaultError({
|
|
701
|
-
output,
|
|
702
|
-
parsedBody,
|
|
703
|
-
errorCode,
|
|
704
|
-
});
|
|
705
|
-
}
|
|
706
|
-
};
|
|
707
|
-
const de_TagResourceCommand = async (output, context) => {
|
|
708
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
709
|
-
return de_TagResourceCommandError(output, context);
|
|
710
|
-
}
|
|
711
|
-
const contents = (0, smithy_client_1.map)({
|
|
712
|
-
$metadata: deserializeMetadata(output),
|
|
713
|
-
});
|
|
714
|
-
await (0, smithy_client_1.collectBody)(output.body, context);
|
|
715
|
-
return contents;
|
|
716
|
-
};
|
|
717
|
-
exports.de_TagResourceCommand = de_TagResourceCommand;
|
|
718
|
-
const de_TagResourceCommandError = async (output, context) => {
|
|
719
|
-
const parsedOutput = {
|
|
720
|
-
...output,
|
|
721
|
-
body: await parseErrorBody(output.body, context),
|
|
722
|
-
};
|
|
723
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
724
|
-
switch (errorCode) {
|
|
725
|
-
case "InternalServerException":
|
|
726
|
-
case "com.amazonaws.snowdevicemanagement#InternalServerException":
|
|
727
|
-
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
728
|
-
case "ResourceNotFoundException":
|
|
729
|
-
case "com.amazonaws.snowdevicemanagement#ResourceNotFoundException":
|
|
730
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
731
|
-
case "ValidationException":
|
|
732
|
-
case "com.amazonaws.snowdevicemanagement#ValidationException":
|
|
733
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
734
|
-
default:
|
|
735
|
-
const parsedBody = parsedOutput.body;
|
|
736
|
-
return throwDefaultError({
|
|
737
|
-
output,
|
|
738
|
-
parsedBody,
|
|
739
|
-
errorCode,
|
|
740
|
-
});
|
|
741
|
-
}
|
|
742
|
-
};
|
|
743
|
-
const de_UntagResourceCommand = async (output, context) => {
|
|
744
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
745
|
-
return de_UntagResourceCommandError(output, context);
|
|
746
|
-
}
|
|
747
|
-
const contents = (0, smithy_client_1.map)({
|
|
748
|
-
$metadata: deserializeMetadata(output),
|
|
749
|
-
});
|
|
750
|
-
await (0, smithy_client_1.collectBody)(output.body, context);
|
|
751
|
-
return contents;
|
|
752
|
-
};
|
|
753
|
-
exports.de_UntagResourceCommand = de_UntagResourceCommand;
|
|
754
|
-
const de_UntagResourceCommandError = async (output, context) => {
|
|
755
|
-
const parsedOutput = {
|
|
756
|
-
...output,
|
|
757
|
-
body: await parseErrorBody(output.body, context),
|
|
758
|
-
};
|
|
759
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
760
|
-
switch (errorCode) {
|
|
761
|
-
case "InternalServerException":
|
|
762
|
-
case "com.amazonaws.snowdevicemanagement#InternalServerException":
|
|
763
|
-
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
764
|
-
case "ResourceNotFoundException":
|
|
765
|
-
case "com.amazonaws.snowdevicemanagement#ResourceNotFoundException":
|
|
766
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
767
|
-
case "ValidationException":
|
|
768
|
-
case "com.amazonaws.snowdevicemanagement#ValidationException":
|
|
769
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
770
|
-
default:
|
|
771
|
-
const parsedBody = parsedOutput.body;
|
|
772
|
-
return throwDefaultError({
|
|
773
|
-
output,
|
|
774
|
-
parsedBody,
|
|
775
|
-
errorCode,
|
|
776
|
-
});
|
|
777
|
-
}
|
|
778
|
-
};
|
|
779
|
-
const throwDefaultError = (0, smithy_client_1.withBaseException)(SnowDeviceManagementServiceException_1.SnowDeviceManagementServiceException);
|
|
780
|
-
const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
|
|
781
|
-
const contents = (0, smithy_client_1.map)({});
|
|
782
|
-
const data = parsedOutput.body;
|
|
783
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
784
|
-
message: smithy_client_1.expectString,
|
|
785
|
-
});
|
|
786
|
-
Object.assign(contents, doc);
|
|
787
|
-
const exception = new models_0_1.AccessDeniedException({
|
|
788
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
789
|
-
...contents,
|
|
790
|
-
});
|
|
791
|
-
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
792
|
-
};
|
|
793
|
-
const de_InternalServerExceptionRes = async (parsedOutput, context) => {
|
|
794
|
-
const contents = (0, smithy_client_1.map)({});
|
|
795
|
-
const data = parsedOutput.body;
|
|
796
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
797
|
-
message: smithy_client_1.expectString,
|
|
798
|
-
});
|
|
799
|
-
Object.assign(contents, doc);
|
|
800
|
-
const exception = new models_0_1.InternalServerException({
|
|
801
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
802
|
-
...contents,
|
|
803
|
-
});
|
|
804
|
-
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
805
|
-
};
|
|
806
|
-
const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
807
|
-
const contents = (0, smithy_client_1.map)({});
|
|
808
|
-
const data = parsedOutput.body;
|
|
809
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
810
|
-
message: smithy_client_1.expectString,
|
|
811
|
-
});
|
|
812
|
-
Object.assign(contents, doc);
|
|
813
|
-
const exception = new models_0_1.ResourceNotFoundException({
|
|
814
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
815
|
-
...contents,
|
|
816
|
-
});
|
|
817
|
-
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
818
|
-
};
|
|
819
|
-
const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
|
|
820
|
-
const contents = (0, smithy_client_1.map)({});
|
|
821
|
-
const data = parsedOutput.body;
|
|
822
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
823
|
-
message: smithy_client_1.expectString,
|
|
824
|
-
});
|
|
825
|
-
Object.assign(contents, doc);
|
|
826
|
-
const exception = new models_0_1.ServiceQuotaExceededException({
|
|
827
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
828
|
-
...contents,
|
|
829
|
-
});
|
|
830
|
-
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
831
|
-
};
|
|
832
|
-
const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
|
|
833
|
-
const contents = (0, smithy_client_1.map)({});
|
|
834
|
-
const data = parsedOutput.body;
|
|
835
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
836
|
-
message: smithy_client_1.expectString,
|
|
837
|
-
});
|
|
838
|
-
Object.assign(contents, doc);
|
|
839
|
-
const exception = new models_0_1.ThrottlingException({
|
|
840
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
841
|
-
...contents,
|
|
842
|
-
});
|
|
843
|
-
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
844
|
-
};
|
|
845
|
-
const de_ValidationExceptionRes = async (parsedOutput, context) => {
|
|
846
|
-
const contents = (0, smithy_client_1.map)({});
|
|
847
|
-
const data = parsedOutput.body;
|
|
848
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
849
|
-
message: smithy_client_1.expectString,
|
|
850
|
-
});
|
|
851
|
-
Object.assign(contents, doc);
|
|
852
|
-
const exception = new models_0_1.ValidationException({
|
|
853
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
854
|
-
...contents,
|
|
855
|
-
});
|
|
856
|
-
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
857
|
-
};
|
|
858
|
-
const de_EbsInstanceBlockDevice = (output, context) => {
|
|
859
|
-
return (0, smithy_client_1.take)(output, {
|
|
860
|
-
attachTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
861
|
-
deleteOnTermination: smithy_client_1.expectBoolean,
|
|
862
|
-
status: smithy_client_1.expectString,
|
|
863
|
-
volumeId: smithy_client_1.expectString,
|
|
864
|
-
});
|
|
865
|
-
};
|
|
866
|
-
const de_Instance = (output, context) => {
|
|
867
|
-
return (0, smithy_client_1.take)(output, {
|
|
868
|
-
amiLaunchIndex: smithy_client_1.expectInt32,
|
|
869
|
-
blockDeviceMappings: (_) => de_InstanceBlockDeviceMappingList(_, context),
|
|
870
|
-
cpuOptions: smithy_client_1._json,
|
|
871
|
-
createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
872
|
-
imageId: smithy_client_1.expectString,
|
|
873
|
-
instanceId: smithy_client_1.expectString,
|
|
874
|
-
instanceType: smithy_client_1.expectString,
|
|
875
|
-
privateIpAddress: smithy_client_1.expectString,
|
|
876
|
-
publicIpAddress: smithy_client_1.expectString,
|
|
877
|
-
rootDeviceName: smithy_client_1.expectString,
|
|
878
|
-
securityGroups: smithy_client_1._json,
|
|
879
|
-
state: smithy_client_1._json,
|
|
880
|
-
updatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
881
|
-
});
|
|
882
|
-
};
|
|
883
|
-
const de_InstanceBlockDeviceMapping = (output, context) => {
|
|
884
|
-
return (0, smithy_client_1.take)(output, {
|
|
885
|
-
deviceName: smithy_client_1.expectString,
|
|
886
|
-
ebs: (_) => de_EbsInstanceBlockDevice(_, context),
|
|
887
|
-
});
|
|
888
|
-
};
|
|
889
|
-
const de_InstanceBlockDeviceMappingList = (output, context) => {
|
|
890
|
-
const retVal = (output || [])
|
|
891
|
-
.filter((e) => e != null)
|
|
892
|
-
.map((entry) => {
|
|
893
|
-
return de_InstanceBlockDeviceMapping(entry, context);
|
|
894
|
-
});
|
|
895
|
-
return retVal;
|
|
896
|
-
};
|
|
897
|
-
const de_InstanceSummary = (output, context) => {
|
|
898
|
-
return (0, smithy_client_1.take)(output, {
|
|
899
|
-
instance: (_) => de_Instance(_, context),
|
|
900
|
-
lastUpdatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
901
|
-
});
|
|
902
|
-
};
|
|
903
|
-
const de_InstanceSummaryList = (output, context) => {
|
|
904
|
-
const retVal = (output || [])
|
|
905
|
-
.filter((e) => e != null)
|
|
906
|
-
.map((entry) => {
|
|
907
|
-
return de_InstanceSummary(entry, context);
|
|
908
|
-
});
|
|
909
|
-
return retVal;
|
|
910
|
-
};
|
|
911
|
-
const deserializeMetadata = (output) => ({
|
|
912
|
-
httpStatusCode: output.statusCode,
|
|
913
|
-
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
914
|
-
extendedRequestId: output.headers["x-amz-id-2"],
|
|
915
|
-
cfId: output.headers["x-amz-cf-id"],
|
|
916
|
-
});
|
|
917
|
-
const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
918
|
-
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
919
|
-
value !== null &&
|
|
920
|
-
value !== "" &&
|
|
921
|
-
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
922
|
-
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
923
|
-
const _jI = "jobId";
|
|
924
|
-
const _mR = "maxResults";
|
|
925
|
-
const _nT = "nextToken";
|
|
926
|
-
const _s = "state";
|
|
927
|
-
const _t = "type";
|
|
928
|
-
const _tI = "taskId";
|
|
929
|
-
const _tK = "tagKeys";
|
|
930
|
-
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
931
|
-
if (encoded.length) {
|
|
932
|
-
return JSON.parse(encoded);
|
|
933
|
-
}
|
|
934
|
-
return {};
|
|
935
|
-
});
|
|
936
|
-
const parseErrorBody = async (errorBody, context) => {
|
|
937
|
-
const value = await parseBody(errorBody, context);
|
|
938
|
-
value.message = value.message ?? value.Message;
|
|
939
|
-
return value;
|
|
940
|
-
};
|
|
941
|
-
const loadRestJsonErrorCode = (output, data) => {
|
|
942
|
-
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
943
|
-
const sanitizeErrorCode = (rawValue) => {
|
|
944
|
-
let cleanValue = rawValue;
|
|
945
|
-
if (typeof cleanValue === "number") {
|
|
946
|
-
cleanValue = cleanValue.toString();
|
|
947
|
-
}
|
|
948
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
949
|
-
cleanValue = cleanValue.split(",")[0];
|
|
950
|
-
}
|
|
951
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
952
|
-
cleanValue = cleanValue.split(":")[0];
|
|
953
|
-
}
|
|
954
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
955
|
-
cleanValue = cleanValue.split("#")[1];
|
|
956
|
-
}
|
|
957
|
-
return cleanValue;
|
|
958
|
-
};
|
|
959
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
960
|
-
if (headerKey !== undefined) {
|
|
961
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
962
|
-
}
|
|
963
|
-
if (data.code !== undefined) {
|
|
964
|
-
return sanitizeErrorCode(data.code);
|
|
965
|
-
}
|
|
966
|
-
if (data["__type"] !== undefined) {
|
|
967
|
-
return sanitizeErrorCode(data["__type"]);
|
|
968
|
-
}
|
|
969
|
-
};
|
|
1
|
+
module.exports = require("../index.js");
|