@aws-sdk/client-ebs 3.181.0 → 3.183.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist-es/EBS.js +26 -33
- package/dist-es/EBSClient.js +22 -28
- package/dist-es/commands/CompleteSnapshotCommand.js +21 -28
- package/dist-es/commands/GetSnapshotBlockCommand.js +21 -28
- package/dist-es/commands/ListChangedBlocksCommand.js +21 -28
- package/dist-es/commands/ListSnapshotBlocksCommand.js +21 -28
- package/dist-es/commands/PutSnapshotBlockCommand.js +21 -28
- package/dist-es/commands/StartSnapshotCommand.js +21 -28
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/EBSServiceException.js +5 -10
- package/dist-es/models/models_0.js +152 -117
- package/dist-es/pagination/ListChangedBlocksPaginator.js +25 -68
- package/dist-es/pagination/ListSnapshotBlocksPaginator.js +25 -68
- package/dist-es/protocols/Aws_restJson1.js +639 -844
- package/dist-es/runtimeConfig.browser.js +26 -12
- package/dist-es/runtimeConfig.js +30 -12
- package/dist-es/runtimeConfig.native.js +8 -5
- package/dist-es/runtimeConfig.shared.js +8 -11
- package/package.json +33 -33
|
@@ -1,825 +1,638 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator } from "tslib";
|
|
2
1
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
3
2
|
import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map as __map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, strictParseInt32 as __strictParseInt32, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
4
3
|
import { v4 as generateIdempotencyToken } from "uuid";
|
|
5
4
|
import { EBSServiceException as __BaseException } from "../models/EBSServiceException";
|
|
6
5
|
import { AccessDeniedException, ConcurrentLimitExceededException, ConflictException, InternalServerException, RequestThrottledException, ResourceNotFoundException, ServiceQuotaExceededException, ValidationException, } from "../models/models_0";
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
method: "POST",
|
|
30
|
-
headers: headers,
|
|
31
|
-
path: resolvedPath,
|
|
32
|
-
body: body,
|
|
33
|
-
})];
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
}); };
|
|
37
|
-
export var serializeAws_restJson1GetSnapshotBlockCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
38
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
|
|
39
|
-
return __generator(this, function (_c) {
|
|
40
|
-
switch (_c.label) {
|
|
41
|
-
case 0: return [4, context.endpoint()];
|
|
42
|
-
case 1:
|
|
43
|
-
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
44
|
-
headers = {};
|
|
45
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
|
|
46
|
-
"/snapshots/{SnapshotId}/blocks/{BlockIndex}";
|
|
47
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "SnapshotId", function () { return input.SnapshotId; }, "{SnapshotId}", false);
|
|
48
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "BlockIndex", function () { return input.BlockIndex.toString(); }, "{BlockIndex}", false);
|
|
49
|
-
query = map({
|
|
50
|
-
blockToken: [, input.BlockToken],
|
|
51
|
-
});
|
|
52
|
-
return [2, new __HttpRequest({
|
|
53
|
-
protocol: protocol,
|
|
54
|
-
hostname: hostname,
|
|
55
|
-
port: port,
|
|
56
|
-
method: "GET",
|
|
57
|
-
headers: headers,
|
|
58
|
-
path: resolvedPath,
|
|
59
|
-
query: query,
|
|
60
|
-
body: body,
|
|
61
|
-
})];
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
}); };
|
|
65
|
-
export var serializeAws_restJson1ListChangedBlocksCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
66
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
|
|
67
|
-
return __generator(this, function (_c) {
|
|
68
|
-
switch (_c.label) {
|
|
69
|
-
case 0: return [4, context.endpoint()];
|
|
70
|
-
case 1:
|
|
71
|
-
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
72
|
-
headers = {};
|
|
73
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
|
|
74
|
-
"/snapshots/{SecondSnapshotId}/changedblocks";
|
|
75
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "SecondSnapshotId", function () { return input.SecondSnapshotId; }, "{SecondSnapshotId}", false);
|
|
76
|
-
query = map({
|
|
77
|
-
firstSnapshotId: [, input.FirstSnapshotId],
|
|
78
|
-
pageToken: [, input.NextToken],
|
|
79
|
-
maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
|
|
80
|
-
startingBlockIndex: [function () { return input.StartingBlockIndex !== void 0; }, function () { return input.StartingBlockIndex.toString(); }],
|
|
81
|
-
});
|
|
82
|
-
return [2, new __HttpRequest({
|
|
83
|
-
protocol: protocol,
|
|
84
|
-
hostname: hostname,
|
|
85
|
-
port: port,
|
|
86
|
-
method: "GET",
|
|
87
|
-
headers: headers,
|
|
88
|
-
path: resolvedPath,
|
|
89
|
-
query: query,
|
|
90
|
-
body: body,
|
|
91
|
-
})];
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
}); };
|
|
95
|
-
export var serializeAws_restJson1ListSnapshotBlocksCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
96
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
|
|
97
|
-
return __generator(this, function (_c) {
|
|
98
|
-
switch (_c.label) {
|
|
99
|
-
case 0: return [4, context.endpoint()];
|
|
100
|
-
case 1:
|
|
101
|
-
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
102
|
-
headers = {};
|
|
103
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/snapshots/{SnapshotId}/blocks";
|
|
104
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "SnapshotId", function () { return input.SnapshotId; }, "{SnapshotId}", false);
|
|
105
|
-
query = map({
|
|
106
|
-
pageToken: [, input.NextToken],
|
|
107
|
-
maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
|
|
108
|
-
startingBlockIndex: [function () { return input.StartingBlockIndex !== void 0; }, function () { return input.StartingBlockIndex.toString(); }],
|
|
109
|
-
});
|
|
110
|
-
return [2, new __HttpRequest({
|
|
111
|
-
protocol: protocol,
|
|
112
|
-
hostname: hostname,
|
|
113
|
-
port: port,
|
|
114
|
-
method: "GET",
|
|
115
|
-
headers: headers,
|
|
116
|
-
path: resolvedPath,
|
|
117
|
-
query: query,
|
|
118
|
-
body: body,
|
|
119
|
-
})];
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
}); };
|
|
123
|
-
export var serializeAws_restJson1PutSnapshotBlockCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
124
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
125
|
-
return __generator(this, function (_c) {
|
|
126
|
-
switch (_c.label) {
|
|
127
|
-
case 0: return [4, context.endpoint()];
|
|
128
|
-
case 1:
|
|
129
|
-
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
130
|
-
headers = map({}, isSerializableHeaderValue, {
|
|
131
|
-
"x-amz-content-sha256": "UNSIGNED-PAYLOAD",
|
|
132
|
-
"content-type": "application/octet-stream",
|
|
133
|
-
"x-amz-data-length": [function () { return isSerializableHeaderValue(input.DataLength); }, function () { return input.DataLength.toString(); }],
|
|
134
|
-
"x-amz-progress": [function () { return isSerializableHeaderValue(input.Progress); }, function () { return input.Progress.toString(); }],
|
|
135
|
-
"x-amz-checksum": input.Checksum,
|
|
136
|
-
"x-amz-checksum-algorithm": input.ChecksumAlgorithm,
|
|
137
|
-
});
|
|
138
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
|
|
139
|
-
"/snapshots/{SnapshotId}/blocks/{BlockIndex}";
|
|
140
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "SnapshotId", function () { return input.SnapshotId; }, "{SnapshotId}", false);
|
|
141
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "BlockIndex", function () { return input.BlockIndex.toString(); }, "{BlockIndex}", false);
|
|
142
|
-
if (input.BlockData !== undefined) {
|
|
143
|
-
body = input.BlockData;
|
|
144
|
-
}
|
|
145
|
-
return [2, new __HttpRequest({
|
|
146
|
-
protocol: protocol,
|
|
147
|
-
hostname: hostname,
|
|
148
|
-
port: port,
|
|
149
|
-
method: "PUT",
|
|
150
|
-
headers: headers,
|
|
151
|
-
path: resolvedPath,
|
|
152
|
-
body: body,
|
|
153
|
-
})];
|
|
154
|
-
}
|
|
6
|
+
export const serializeAws_restJson1CompleteSnapshotCommand = async (input, context) => {
|
|
7
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
8
|
+
const headers = map({}, isSerializableHeaderValue, {
|
|
9
|
+
"x-amz-changedblockscount": [
|
|
10
|
+
() => isSerializableHeaderValue(input.ChangedBlocksCount),
|
|
11
|
+
() => input.ChangedBlocksCount.toString(),
|
|
12
|
+
],
|
|
13
|
+
"x-amz-checksum": input.Checksum,
|
|
14
|
+
"x-amz-checksum-algorithm": input.ChecksumAlgorithm,
|
|
15
|
+
"x-amz-checksum-aggregation-method": input.ChecksumAggregationMethod,
|
|
16
|
+
});
|
|
17
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/snapshots/completion/{SnapshotId}";
|
|
18
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "SnapshotId", () => input.SnapshotId, "{SnapshotId}", false);
|
|
19
|
+
let body;
|
|
20
|
+
return new __HttpRequest({
|
|
21
|
+
protocol,
|
|
22
|
+
hostname,
|
|
23
|
+
port,
|
|
24
|
+
method: "POST",
|
|
25
|
+
headers,
|
|
26
|
+
path: resolvedPath,
|
|
27
|
+
body,
|
|
155
28
|
});
|
|
156
|
-
}
|
|
157
|
-
export
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
body: body,
|
|
178
|
-
})];
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
}); };
|
|
182
|
-
export var deserializeAws_restJson1CompleteSnapshotCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
183
|
-
var contents, data, _a, _b;
|
|
184
|
-
return __generator(this, function (_c) {
|
|
185
|
-
switch (_c.label) {
|
|
186
|
-
case 0:
|
|
187
|
-
if (output.statusCode !== 202 && output.statusCode >= 300) {
|
|
188
|
-
return [2, deserializeAws_restJson1CompleteSnapshotCommandError(output, context)];
|
|
189
|
-
}
|
|
190
|
-
contents = map({
|
|
191
|
-
$metadata: deserializeMetadata(output),
|
|
192
|
-
});
|
|
193
|
-
_a = __expectNonNull;
|
|
194
|
-
_b = __expectObject;
|
|
195
|
-
return [4, parseBody(output.body, context)];
|
|
196
|
-
case 1:
|
|
197
|
-
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
198
|
-
if (data.Status != null) {
|
|
199
|
-
contents.Status = __expectString(data.Status);
|
|
200
|
-
}
|
|
201
|
-
return [2, contents];
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
|
-
}); };
|
|
205
|
-
var deserializeAws_restJson1CompleteSnapshotCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
206
|
-
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
207
|
-
var _c;
|
|
208
|
-
return __generator(this, function (_d) {
|
|
209
|
-
switch (_d.label) {
|
|
210
|
-
case 0:
|
|
211
|
-
_a = [__assign({}, output)];
|
|
212
|
-
_c = {};
|
|
213
|
-
return [4, parseErrorBody(output.body, context)];
|
|
214
|
-
case 1:
|
|
215
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
216
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
217
|
-
_b = errorCode;
|
|
218
|
-
switch (_b) {
|
|
219
|
-
case "AccessDeniedException": return [3, 2];
|
|
220
|
-
case "com.amazonaws.ebs#AccessDeniedException": return [3, 2];
|
|
221
|
-
case "InternalServerException": return [3, 4];
|
|
222
|
-
case "com.amazonaws.ebs#InternalServerException": return [3, 4];
|
|
223
|
-
case "RequestThrottledException": return [3, 6];
|
|
224
|
-
case "com.amazonaws.ebs#RequestThrottledException": return [3, 6];
|
|
225
|
-
case "ResourceNotFoundException": return [3, 8];
|
|
226
|
-
case "com.amazonaws.ebs#ResourceNotFoundException": return [3, 8];
|
|
227
|
-
case "ServiceQuotaExceededException": return [3, 10];
|
|
228
|
-
case "com.amazonaws.ebs#ServiceQuotaExceededException": return [3, 10];
|
|
229
|
-
case "ValidationException": return [3, 12];
|
|
230
|
-
case "com.amazonaws.ebs#ValidationException": return [3, 12];
|
|
231
|
-
}
|
|
232
|
-
return [3, 14];
|
|
233
|
-
case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
234
|
-
case 3: throw _d.sent();
|
|
235
|
-
case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
236
|
-
case 5: throw _d.sent();
|
|
237
|
-
case 6: return [4, deserializeAws_restJson1RequestThrottledExceptionResponse(parsedOutput, context)];
|
|
238
|
-
case 7: throw _d.sent();
|
|
239
|
-
case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
240
|
-
case 9: throw _d.sent();
|
|
241
|
-
case 10: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
|
|
242
|
-
case 11: throw _d.sent();
|
|
243
|
-
case 12: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
244
|
-
case 13: throw _d.sent();
|
|
245
|
-
case 14:
|
|
246
|
-
parsedBody = parsedOutput.body;
|
|
247
|
-
throwDefaultError({
|
|
248
|
-
output: output,
|
|
249
|
-
parsedBody: parsedBody,
|
|
250
|
-
exceptionCtor: __BaseException,
|
|
251
|
-
errorCode: errorCode,
|
|
252
|
-
});
|
|
253
|
-
_d.label = 15;
|
|
254
|
-
case 15: return [2];
|
|
255
|
-
}
|
|
256
|
-
});
|
|
257
|
-
}); };
|
|
258
|
-
export var deserializeAws_restJson1GetSnapshotBlockCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
259
|
-
var contents, data;
|
|
260
|
-
return __generator(this, function (_a) {
|
|
261
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
262
|
-
return [2, deserializeAws_restJson1GetSnapshotBlockCommandError(output, context)];
|
|
263
|
-
}
|
|
264
|
-
contents = map({
|
|
265
|
-
$metadata: deserializeMetadata(output),
|
|
266
|
-
DataLength: [
|
|
267
|
-
function () { return void 0 !== output.headers["x-amz-data-length"]; },
|
|
268
|
-
function () { return __strictParseInt32(output.headers["x-amz-data-length"]); },
|
|
269
|
-
],
|
|
270
|
-
Checksum: [, output.headers["x-amz-checksum"]],
|
|
271
|
-
ChecksumAlgorithm: [, output.headers["x-amz-checksum-algorithm"]],
|
|
272
|
-
});
|
|
273
|
-
data = output.body;
|
|
274
|
-
contents.BlockData = data;
|
|
275
|
-
return [2, contents];
|
|
29
|
+
};
|
|
30
|
+
export const serializeAws_restJson1GetSnapshotBlockCommand = async (input, context) => {
|
|
31
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
32
|
+
const headers = {};
|
|
33
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
34
|
+
"/snapshots/{SnapshotId}/blocks/{BlockIndex}";
|
|
35
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "SnapshotId", () => input.SnapshotId, "{SnapshotId}", false);
|
|
36
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "BlockIndex", () => input.BlockIndex.toString(), "{BlockIndex}", false);
|
|
37
|
+
const query = map({
|
|
38
|
+
blockToken: [, input.BlockToken],
|
|
39
|
+
});
|
|
40
|
+
let body;
|
|
41
|
+
return new __HttpRequest({
|
|
42
|
+
protocol,
|
|
43
|
+
hostname,
|
|
44
|
+
port,
|
|
45
|
+
method: "GET",
|
|
46
|
+
headers,
|
|
47
|
+
path: resolvedPath,
|
|
48
|
+
query,
|
|
49
|
+
body,
|
|
276
50
|
});
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
case "ServiceQuotaExceededException": return [3, 10];
|
|
301
|
-
case "com.amazonaws.ebs#ServiceQuotaExceededException": return [3, 10];
|
|
302
|
-
case "ValidationException": return [3, 12];
|
|
303
|
-
case "com.amazonaws.ebs#ValidationException": return [3, 12];
|
|
304
|
-
}
|
|
305
|
-
return [3, 14];
|
|
306
|
-
case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
307
|
-
case 3: throw _d.sent();
|
|
308
|
-
case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
309
|
-
case 5: throw _d.sent();
|
|
310
|
-
case 6: return [4, deserializeAws_restJson1RequestThrottledExceptionResponse(parsedOutput, context)];
|
|
311
|
-
case 7: throw _d.sent();
|
|
312
|
-
case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
313
|
-
case 9: throw _d.sent();
|
|
314
|
-
case 10: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
|
|
315
|
-
case 11: throw _d.sent();
|
|
316
|
-
case 12: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
317
|
-
case 13: throw _d.sent();
|
|
318
|
-
case 14:
|
|
319
|
-
parsedBody = parsedOutput.body;
|
|
320
|
-
throwDefaultError({
|
|
321
|
-
output: output,
|
|
322
|
-
parsedBody: parsedBody,
|
|
323
|
-
exceptionCtor: __BaseException,
|
|
324
|
-
errorCode: errorCode,
|
|
325
|
-
});
|
|
326
|
-
_d.label = 15;
|
|
327
|
-
case 15: return [2];
|
|
328
|
-
}
|
|
51
|
+
};
|
|
52
|
+
export const serializeAws_restJson1ListChangedBlocksCommand = async (input, context) => {
|
|
53
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
54
|
+
const headers = {};
|
|
55
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
56
|
+
"/snapshots/{SecondSnapshotId}/changedblocks";
|
|
57
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "SecondSnapshotId", () => input.SecondSnapshotId, "{SecondSnapshotId}", false);
|
|
58
|
+
const query = map({
|
|
59
|
+
firstSnapshotId: [, input.FirstSnapshotId],
|
|
60
|
+
pageToken: [, input.NextToken],
|
|
61
|
+
maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
|
|
62
|
+
startingBlockIndex: [() => input.StartingBlockIndex !== void 0, () => input.StartingBlockIndex.toString()],
|
|
63
|
+
});
|
|
64
|
+
let body;
|
|
65
|
+
return new __HttpRequest({
|
|
66
|
+
protocol,
|
|
67
|
+
hostname,
|
|
68
|
+
port,
|
|
69
|
+
method: "GET",
|
|
70
|
+
headers,
|
|
71
|
+
path: resolvedPath,
|
|
72
|
+
query,
|
|
73
|
+
body,
|
|
329
74
|
});
|
|
330
|
-
}
|
|
331
|
-
export
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
contents.ChangedBlocks = deserializeAws_restJson1ChangedBlocks(data.ChangedBlocks, context);
|
|
352
|
-
}
|
|
353
|
-
if (data.ExpiryTime != null) {
|
|
354
|
-
contents.ExpiryTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.ExpiryTime)));
|
|
355
|
-
}
|
|
356
|
-
if (data.NextToken != null) {
|
|
357
|
-
contents.NextToken = __expectString(data.NextToken);
|
|
358
|
-
}
|
|
359
|
-
if (data.VolumeSize != null) {
|
|
360
|
-
contents.VolumeSize = __expectLong(data.VolumeSize);
|
|
361
|
-
}
|
|
362
|
-
return [2, contents];
|
|
363
|
-
}
|
|
75
|
+
};
|
|
76
|
+
export const serializeAws_restJson1ListSnapshotBlocksCommand = async (input, context) => {
|
|
77
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
78
|
+
const headers = {};
|
|
79
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/snapshots/{SnapshotId}/blocks";
|
|
80
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "SnapshotId", () => input.SnapshotId, "{SnapshotId}", false);
|
|
81
|
+
const query = map({
|
|
82
|
+
pageToken: [, input.NextToken],
|
|
83
|
+
maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
|
|
84
|
+
startingBlockIndex: [() => input.StartingBlockIndex !== void 0, () => input.StartingBlockIndex.toString()],
|
|
85
|
+
});
|
|
86
|
+
let body;
|
|
87
|
+
return new __HttpRequest({
|
|
88
|
+
protocol,
|
|
89
|
+
hostname,
|
|
90
|
+
port,
|
|
91
|
+
method: "GET",
|
|
92
|
+
headers,
|
|
93
|
+
path: resolvedPath,
|
|
94
|
+
query,
|
|
95
|
+
body,
|
|
364
96
|
});
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
}
|
|
393
|
-
return [3, 14];
|
|
394
|
-
case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
395
|
-
case 3: throw _d.sent();
|
|
396
|
-
case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
397
|
-
case 5: throw _d.sent();
|
|
398
|
-
case 6: return [4, deserializeAws_restJson1RequestThrottledExceptionResponse(parsedOutput, context)];
|
|
399
|
-
case 7: throw _d.sent();
|
|
400
|
-
case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
401
|
-
case 9: throw _d.sent();
|
|
402
|
-
case 10: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
|
|
403
|
-
case 11: throw _d.sent();
|
|
404
|
-
case 12: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
405
|
-
case 13: throw _d.sent();
|
|
406
|
-
case 14:
|
|
407
|
-
parsedBody = parsedOutput.body;
|
|
408
|
-
throwDefaultError({
|
|
409
|
-
output: output,
|
|
410
|
-
parsedBody: parsedBody,
|
|
411
|
-
exceptionCtor: __BaseException,
|
|
412
|
-
errorCode: errorCode,
|
|
413
|
-
});
|
|
414
|
-
_d.label = 15;
|
|
415
|
-
case 15: return [2];
|
|
416
|
-
}
|
|
97
|
+
};
|
|
98
|
+
export const serializeAws_restJson1PutSnapshotBlockCommand = async (input, context) => {
|
|
99
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
100
|
+
const headers = map({}, isSerializableHeaderValue, {
|
|
101
|
+
"x-amz-content-sha256": "UNSIGNED-PAYLOAD",
|
|
102
|
+
"content-type": "application/octet-stream",
|
|
103
|
+
"x-amz-data-length": [() => isSerializableHeaderValue(input.DataLength), () => input.DataLength.toString()],
|
|
104
|
+
"x-amz-progress": [() => isSerializableHeaderValue(input.Progress), () => input.Progress.toString()],
|
|
105
|
+
"x-amz-checksum": input.Checksum,
|
|
106
|
+
"x-amz-checksum-algorithm": input.ChecksumAlgorithm,
|
|
107
|
+
});
|
|
108
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
109
|
+
"/snapshots/{SnapshotId}/blocks/{BlockIndex}";
|
|
110
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "SnapshotId", () => input.SnapshotId, "{SnapshotId}", false);
|
|
111
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "BlockIndex", () => input.BlockIndex.toString(), "{BlockIndex}", false);
|
|
112
|
+
let body;
|
|
113
|
+
if (input.BlockData !== undefined) {
|
|
114
|
+
body = input.BlockData;
|
|
115
|
+
}
|
|
116
|
+
return new __HttpRequest({
|
|
117
|
+
protocol,
|
|
118
|
+
hostname,
|
|
119
|
+
port,
|
|
120
|
+
method: "PUT",
|
|
121
|
+
headers,
|
|
122
|
+
path: resolvedPath,
|
|
123
|
+
body,
|
|
417
124
|
});
|
|
418
|
-
}
|
|
419
|
-
export
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
if (data.NextToken != null) {
|
|
445
|
-
contents.NextToken = __expectString(data.NextToken);
|
|
446
|
-
}
|
|
447
|
-
if (data.VolumeSize != null) {
|
|
448
|
-
contents.VolumeSize = __expectLong(data.VolumeSize);
|
|
449
|
-
}
|
|
450
|
-
return [2, contents];
|
|
451
|
-
}
|
|
125
|
+
};
|
|
126
|
+
export const serializeAws_restJson1StartSnapshotCommand = async (input, context) => {
|
|
127
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
128
|
+
const headers = {
|
|
129
|
+
"content-type": "application/json",
|
|
130
|
+
};
|
|
131
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/snapshots";
|
|
132
|
+
let body;
|
|
133
|
+
body = JSON.stringify({
|
|
134
|
+
ClientToken: input.ClientToken ?? generateIdempotencyToken(),
|
|
135
|
+
...(input.Description != null && { Description: input.Description }),
|
|
136
|
+
...(input.Encrypted != null && { Encrypted: input.Encrypted }),
|
|
137
|
+
...(input.KmsKeyArn != null && { KmsKeyArn: input.KmsKeyArn }),
|
|
138
|
+
...(input.ParentSnapshotId != null && { ParentSnapshotId: input.ParentSnapshotId }),
|
|
139
|
+
...(input.Tags != null && { Tags: serializeAws_restJson1Tags(input.Tags, context) }),
|
|
140
|
+
...(input.Timeout != null && { Timeout: input.Timeout }),
|
|
141
|
+
...(input.VolumeSize != null && { VolumeSize: input.VolumeSize }),
|
|
142
|
+
});
|
|
143
|
+
return new __HttpRequest({
|
|
144
|
+
protocol,
|
|
145
|
+
hostname,
|
|
146
|
+
port,
|
|
147
|
+
method: "POST",
|
|
148
|
+
headers,
|
|
149
|
+
path: resolvedPath,
|
|
150
|
+
body,
|
|
452
151
|
});
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
_a = [__assign({}, output)];
|
|
461
|
-
_c = {};
|
|
462
|
-
return [4, parseErrorBody(output.body, context)];
|
|
463
|
-
case 1:
|
|
464
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
465
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
466
|
-
_b = errorCode;
|
|
467
|
-
switch (_b) {
|
|
468
|
-
case "AccessDeniedException": return [3, 2];
|
|
469
|
-
case "com.amazonaws.ebs#AccessDeniedException": return [3, 2];
|
|
470
|
-
case "InternalServerException": return [3, 4];
|
|
471
|
-
case "com.amazonaws.ebs#InternalServerException": return [3, 4];
|
|
472
|
-
case "RequestThrottledException": return [3, 6];
|
|
473
|
-
case "com.amazonaws.ebs#RequestThrottledException": return [3, 6];
|
|
474
|
-
case "ResourceNotFoundException": return [3, 8];
|
|
475
|
-
case "com.amazonaws.ebs#ResourceNotFoundException": return [3, 8];
|
|
476
|
-
case "ServiceQuotaExceededException": return [3, 10];
|
|
477
|
-
case "com.amazonaws.ebs#ServiceQuotaExceededException": return [3, 10];
|
|
478
|
-
case "ValidationException": return [3, 12];
|
|
479
|
-
case "com.amazonaws.ebs#ValidationException": return [3, 12];
|
|
480
|
-
}
|
|
481
|
-
return [3, 14];
|
|
482
|
-
case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
483
|
-
case 3: throw _d.sent();
|
|
484
|
-
case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
485
|
-
case 5: throw _d.sent();
|
|
486
|
-
case 6: return [4, deserializeAws_restJson1RequestThrottledExceptionResponse(parsedOutput, context)];
|
|
487
|
-
case 7: throw _d.sent();
|
|
488
|
-
case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
489
|
-
case 9: throw _d.sent();
|
|
490
|
-
case 10: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
|
|
491
|
-
case 11: throw _d.sent();
|
|
492
|
-
case 12: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
493
|
-
case 13: throw _d.sent();
|
|
494
|
-
case 14:
|
|
495
|
-
parsedBody = parsedOutput.body;
|
|
496
|
-
throwDefaultError({
|
|
497
|
-
output: output,
|
|
498
|
-
parsedBody: parsedBody,
|
|
499
|
-
exceptionCtor: __BaseException,
|
|
500
|
-
errorCode: errorCode,
|
|
501
|
-
});
|
|
502
|
-
_d.label = 15;
|
|
503
|
-
case 15: return [2];
|
|
504
|
-
}
|
|
152
|
+
};
|
|
153
|
+
export const deserializeAws_restJson1CompleteSnapshotCommand = async (output, context) => {
|
|
154
|
+
if (output.statusCode !== 202 && output.statusCode >= 300) {
|
|
155
|
+
return deserializeAws_restJson1CompleteSnapshotCommandError(output, context);
|
|
156
|
+
}
|
|
157
|
+
const contents = map({
|
|
158
|
+
$metadata: deserializeMetadata(output),
|
|
505
159
|
});
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
160
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
161
|
+
if (data.Status != null) {
|
|
162
|
+
contents.Status = __expectString(data.Status);
|
|
163
|
+
}
|
|
164
|
+
return contents;
|
|
165
|
+
};
|
|
166
|
+
const deserializeAws_restJson1CompleteSnapshotCommandError = async (output, context) => {
|
|
167
|
+
const parsedOutput = {
|
|
168
|
+
...output,
|
|
169
|
+
body: await parseErrorBody(output.body, context),
|
|
170
|
+
};
|
|
171
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
172
|
+
switch (errorCode) {
|
|
173
|
+
case "AccessDeniedException":
|
|
174
|
+
case "com.amazonaws.ebs#AccessDeniedException":
|
|
175
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
176
|
+
case "InternalServerException":
|
|
177
|
+
case "com.amazonaws.ebs#InternalServerException":
|
|
178
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
179
|
+
case "RequestThrottledException":
|
|
180
|
+
case "com.amazonaws.ebs#RequestThrottledException":
|
|
181
|
+
throw await deserializeAws_restJson1RequestThrottledExceptionResponse(parsedOutput, context);
|
|
182
|
+
case "ResourceNotFoundException":
|
|
183
|
+
case "com.amazonaws.ebs#ResourceNotFoundException":
|
|
184
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
185
|
+
case "ServiceQuotaExceededException":
|
|
186
|
+
case "com.amazonaws.ebs#ServiceQuotaExceededException":
|
|
187
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
188
|
+
case "ValidationException":
|
|
189
|
+
case "com.amazonaws.ebs#ValidationException":
|
|
190
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
191
|
+
default:
|
|
192
|
+
const parsedBody = parsedOutput.body;
|
|
193
|
+
throwDefaultError({
|
|
194
|
+
output,
|
|
195
|
+
parsedBody,
|
|
196
|
+
exceptionCtor: __BaseException,
|
|
197
|
+
errorCode,
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
export const deserializeAws_restJson1GetSnapshotBlockCommand = async (output, context) => {
|
|
202
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
203
|
+
return deserializeAws_restJson1GetSnapshotBlockCommandError(output, context);
|
|
204
|
+
}
|
|
205
|
+
const contents = map({
|
|
206
|
+
$metadata: deserializeMetadata(output),
|
|
207
|
+
DataLength: [
|
|
208
|
+
() => void 0 !== output.headers["x-amz-data-length"],
|
|
209
|
+
() => __strictParseInt32(output.headers["x-amz-data-length"]),
|
|
210
|
+
],
|
|
211
|
+
Checksum: [, output.headers["x-amz-checksum"]],
|
|
212
|
+
ChecksumAlgorithm: [, output.headers["x-amz-checksum-algorithm"]],
|
|
213
|
+
});
|
|
214
|
+
const data = output.body;
|
|
215
|
+
contents.BlockData = data;
|
|
216
|
+
return contents;
|
|
217
|
+
};
|
|
218
|
+
const deserializeAws_restJson1GetSnapshotBlockCommandError = async (output, context) => {
|
|
219
|
+
const parsedOutput = {
|
|
220
|
+
...output,
|
|
221
|
+
body: await parseErrorBody(output.body, context),
|
|
222
|
+
};
|
|
223
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
224
|
+
switch (errorCode) {
|
|
225
|
+
case "AccessDeniedException":
|
|
226
|
+
case "com.amazonaws.ebs#AccessDeniedException":
|
|
227
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
228
|
+
case "InternalServerException":
|
|
229
|
+
case "com.amazonaws.ebs#InternalServerException":
|
|
230
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
231
|
+
case "RequestThrottledException":
|
|
232
|
+
case "com.amazonaws.ebs#RequestThrottledException":
|
|
233
|
+
throw await deserializeAws_restJson1RequestThrottledExceptionResponse(parsedOutput, context);
|
|
234
|
+
case "ResourceNotFoundException":
|
|
235
|
+
case "com.amazonaws.ebs#ResourceNotFoundException":
|
|
236
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
237
|
+
case "ServiceQuotaExceededException":
|
|
238
|
+
case "com.amazonaws.ebs#ServiceQuotaExceededException":
|
|
239
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
240
|
+
case "ValidationException":
|
|
241
|
+
case "com.amazonaws.ebs#ValidationException":
|
|
242
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
243
|
+
default:
|
|
244
|
+
const parsedBody = parsedOutput.body;
|
|
245
|
+
throwDefaultError({
|
|
246
|
+
output,
|
|
247
|
+
parsedBody,
|
|
248
|
+
exceptionCtor: __BaseException,
|
|
249
|
+
errorCode,
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
export const deserializeAws_restJson1ListChangedBlocksCommand = async (output, context) => {
|
|
254
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
255
|
+
return deserializeAws_restJson1ListChangedBlocksCommandError(output, context);
|
|
256
|
+
}
|
|
257
|
+
const contents = map({
|
|
258
|
+
$metadata: deserializeMetadata(output),
|
|
525
259
|
});
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
260
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
261
|
+
if (data.BlockSize != null) {
|
|
262
|
+
contents.BlockSize = __expectInt32(data.BlockSize);
|
|
263
|
+
}
|
|
264
|
+
if (data.ChangedBlocks != null) {
|
|
265
|
+
contents.ChangedBlocks = deserializeAws_restJson1ChangedBlocks(data.ChangedBlocks, context);
|
|
266
|
+
}
|
|
267
|
+
if (data.ExpiryTime != null) {
|
|
268
|
+
contents.ExpiryTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.ExpiryTime)));
|
|
269
|
+
}
|
|
270
|
+
if (data.NextToken != null) {
|
|
271
|
+
contents.NextToken = __expectString(data.NextToken);
|
|
272
|
+
}
|
|
273
|
+
if (data.VolumeSize != null) {
|
|
274
|
+
contents.VolumeSize = __expectLong(data.VolumeSize);
|
|
275
|
+
}
|
|
276
|
+
return contents;
|
|
277
|
+
};
|
|
278
|
+
const deserializeAws_restJson1ListChangedBlocksCommandError = async (output, context) => {
|
|
279
|
+
const parsedOutput = {
|
|
280
|
+
...output,
|
|
281
|
+
body: await parseErrorBody(output.body, context),
|
|
282
|
+
};
|
|
283
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
284
|
+
switch (errorCode) {
|
|
285
|
+
case "AccessDeniedException":
|
|
286
|
+
case "com.amazonaws.ebs#AccessDeniedException":
|
|
287
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
288
|
+
case "InternalServerException":
|
|
289
|
+
case "com.amazonaws.ebs#InternalServerException":
|
|
290
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
291
|
+
case "RequestThrottledException":
|
|
292
|
+
case "com.amazonaws.ebs#RequestThrottledException":
|
|
293
|
+
throw await deserializeAws_restJson1RequestThrottledExceptionResponse(parsedOutput, context);
|
|
294
|
+
case "ResourceNotFoundException":
|
|
295
|
+
case "com.amazonaws.ebs#ResourceNotFoundException":
|
|
296
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
297
|
+
case "ServiceQuotaExceededException":
|
|
298
|
+
case "com.amazonaws.ebs#ServiceQuotaExceededException":
|
|
299
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
300
|
+
case "ValidationException":
|
|
301
|
+
case "com.amazonaws.ebs#ValidationException":
|
|
302
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
303
|
+
default:
|
|
304
|
+
const parsedBody = parsedOutput.body;
|
|
305
|
+
throwDefaultError({
|
|
306
|
+
output,
|
|
307
|
+
parsedBody,
|
|
308
|
+
exceptionCtor: __BaseException,
|
|
309
|
+
errorCode,
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
export const deserializeAws_restJson1ListSnapshotBlocksCommand = async (output, context) => {
|
|
314
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
315
|
+
return deserializeAws_restJson1ListSnapshotBlocksCommandError(output, context);
|
|
316
|
+
}
|
|
317
|
+
const contents = map({
|
|
318
|
+
$metadata: deserializeMetadata(output),
|
|
578
319
|
});
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
320
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
321
|
+
if (data.BlockSize != null) {
|
|
322
|
+
contents.BlockSize = __expectInt32(data.BlockSize);
|
|
323
|
+
}
|
|
324
|
+
if (data.Blocks != null) {
|
|
325
|
+
contents.Blocks = deserializeAws_restJson1Blocks(data.Blocks, context);
|
|
326
|
+
}
|
|
327
|
+
if (data.ExpiryTime != null) {
|
|
328
|
+
contents.ExpiryTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.ExpiryTime)));
|
|
329
|
+
}
|
|
330
|
+
if (data.NextToken != null) {
|
|
331
|
+
contents.NextToken = __expectString(data.NextToken);
|
|
332
|
+
}
|
|
333
|
+
if (data.VolumeSize != null) {
|
|
334
|
+
contents.VolumeSize = __expectLong(data.VolumeSize);
|
|
335
|
+
}
|
|
336
|
+
return contents;
|
|
337
|
+
};
|
|
338
|
+
const deserializeAws_restJson1ListSnapshotBlocksCommandError = async (output, context) => {
|
|
339
|
+
const parsedOutput = {
|
|
340
|
+
...output,
|
|
341
|
+
body: await parseErrorBody(output.body, context),
|
|
342
|
+
};
|
|
343
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
344
|
+
switch (errorCode) {
|
|
345
|
+
case "AccessDeniedException":
|
|
346
|
+
case "com.amazonaws.ebs#AccessDeniedException":
|
|
347
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
348
|
+
case "InternalServerException":
|
|
349
|
+
case "com.amazonaws.ebs#InternalServerException":
|
|
350
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
351
|
+
case "RequestThrottledException":
|
|
352
|
+
case "com.amazonaws.ebs#RequestThrottledException":
|
|
353
|
+
throw await deserializeAws_restJson1RequestThrottledExceptionResponse(parsedOutput, context);
|
|
354
|
+
case "ResourceNotFoundException":
|
|
355
|
+
case "com.amazonaws.ebs#ResourceNotFoundException":
|
|
356
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
357
|
+
case "ServiceQuotaExceededException":
|
|
358
|
+
case "com.amazonaws.ebs#ServiceQuotaExceededException":
|
|
359
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
360
|
+
case "ValidationException":
|
|
361
|
+
case "com.amazonaws.ebs#ValidationException":
|
|
362
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
363
|
+
default:
|
|
364
|
+
const parsedBody = parsedOutput.body;
|
|
365
|
+
throwDefaultError({
|
|
366
|
+
output,
|
|
367
|
+
parsedBody,
|
|
368
|
+
exceptionCtor: __BaseException,
|
|
369
|
+
errorCode,
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
export const deserializeAws_restJson1PutSnapshotBlockCommand = async (output, context) => {
|
|
374
|
+
if (output.statusCode !== 201 && output.statusCode >= 300) {
|
|
375
|
+
return deserializeAws_restJson1PutSnapshotBlockCommandError(output, context);
|
|
376
|
+
}
|
|
377
|
+
const contents = map({
|
|
378
|
+
$metadata: deserializeMetadata(output),
|
|
379
|
+
Checksum: [, output.headers["x-amz-checksum"]],
|
|
380
|
+
ChecksumAlgorithm: [, output.headers["x-amz-checksum-algorithm"]],
|
|
628
381
|
});
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
case 13: throw _d.sent();
|
|
674
|
-
case 14: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
|
|
675
|
-
case 15: throw _d.sent();
|
|
676
|
-
case 16: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
677
|
-
case 17: throw _d.sent();
|
|
678
|
-
case 18:
|
|
679
|
-
parsedBody = parsedOutput.body;
|
|
680
|
-
throwDefaultError({
|
|
681
|
-
output: output,
|
|
682
|
-
parsedBody: parsedBody,
|
|
683
|
-
exceptionCtor: __BaseException,
|
|
684
|
-
errorCode: errorCode,
|
|
685
|
-
});
|
|
686
|
-
_d.label = 19;
|
|
687
|
-
case 19: return [2];
|
|
688
|
-
}
|
|
382
|
+
await collectBody(output.body, context);
|
|
383
|
+
return contents;
|
|
384
|
+
};
|
|
385
|
+
const deserializeAws_restJson1PutSnapshotBlockCommandError = async (output, context) => {
|
|
386
|
+
const parsedOutput = {
|
|
387
|
+
...output,
|
|
388
|
+
body: await parseErrorBody(output.body, context),
|
|
389
|
+
};
|
|
390
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
391
|
+
switch (errorCode) {
|
|
392
|
+
case "AccessDeniedException":
|
|
393
|
+
case "com.amazonaws.ebs#AccessDeniedException":
|
|
394
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
395
|
+
case "InternalServerException":
|
|
396
|
+
case "com.amazonaws.ebs#InternalServerException":
|
|
397
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
398
|
+
case "RequestThrottledException":
|
|
399
|
+
case "com.amazonaws.ebs#RequestThrottledException":
|
|
400
|
+
throw await deserializeAws_restJson1RequestThrottledExceptionResponse(parsedOutput, context);
|
|
401
|
+
case "ResourceNotFoundException":
|
|
402
|
+
case "com.amazonaws.ebs#ResourceNotFoundException":
|
|
403
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
404
|
+
case "ServiceQuotaExceededException":
|
|
405
|
+
case "com.amazonaws.ebs#ServiceQuotaExceededException":
|
|
406
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
407
|
+
case "ValidationException":
|
|
408
|
+
case "com.amazonaws.ebs#ValidationException":
|
|
409
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
410
|
+
default:
|
|
411
|
+
const parsedBody = parsedOutput.body;
|
|
412
|
+
throwDefaultError({
|
|
413
|
+
output,
|
|
414
|
+
parsedBody,
|
|
415
|
+
exceptionCtor: __BaseException,
|
|
416
|
+
errorCode,
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
};
|
|
420
|
+
export const deserializeAws_restJson1StartSnapshotCommand = async (output, context) => {
|
|
421
|
+
if (output.statusCode !== 201 && output.statusCode >= 300) {
|
|
422
|
+
return deserializeAws_restJson1StartSnapshotCommandError(output, context);
|
|
423
|
+
}
|
|
424
|
+
const contents = map({
|
|
425
|
+
$metadata: deserializeMetadata(output),
|
|
689
426
|
});
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
contents =
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
427
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
428
|
+
if (data.BlockSize != null) {
|
|
429
|
+
contents.BlockSize = __expectInt32(data.BlockSize);
|
|
430
|
+
}
|
|
431
|
+
if (data.Description != null) {
|
|
432
|
+
contents.Description = __expectString(data.Description);
|
|
433
|
+
}
|
|
434
|
+
if (data.KmsKeyArn != null) {
|
|
435
|
+
contents.KmsKeyArn = __expectString(data.KmsKeyArn);
|
|
436
|
+
}
|
|
437
|
+
if (data.OwnerId != null) {
|
|
438
|
+
contents.OwnerId = __expectString(data.OwnerId);
|
|
439
|
+
}
|
|
440
|
+
if (data.ParentSnapshotId != null) {
|
|
441
|
+
contents.ParentSnapshotId = __expectString(data.ParentSnapshotId);
|
|
442
|
+
}
|
|
443
|
+
if (data.SnapshotId != null) {
|
|
444
|
+
contents.SnapshotId = __expectString(data.SnapshotId);
|
|
445
|
+
}
|
|
446
|
+
if (data.StartTime != null) {
|
|
447
|
+
contents.StartTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.StartTime)));
|
|
448
|
+
}
|
|
449
|
+
if (data.Status != null) {
|
|
450
|
+
contents.Status = __expectString(data.Status);
|
|
451
|
+
}
|
|
452
|
+
if (data.Tags != null) {
|
|
453
|
+
contents.Tags = deserializeAws_restJson1Tags(data.Tags, context);
|
|
454
|
+
}
|
|
455
|
+
if (data.VolumeSize != null) {
|
|
456
|
+
contents.VolumeSize = __expectLong(data.VolumeSize);
|
|
457
|
+
}
|
|
458
|
+
return contents;
|
|
459
|
+
};
|
|
460
|
+
const deserializeAws_restJson1StartSnapshotCommandError = async (output, context) => {
|
|
461
|
+
const parsedOutput = {
|
|
462
|
+
...output,
|
|
463
|
+
body: await parseErrorBody(output.body, context),
|
|
464
|
+
};
|
|
465
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
466
|
+
switch (errorCode) {
|
|
467
|
+
case "AccessDeniedException":
|
|
468
|
+
case "com.amazonaws.ebs#AccessDeniedException":
|
|
469
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
470
|
+
case "ConcurrentLimitExceededException":
|
|
471
|
+
case "com.amazonaws.ebs#ConcurrentLimitExceededException":
|
|
472
|
+
throw await deserializeAws_restJson1ConcurrentLimitExceededExceptionResponse(parsedOutput, context);
|
|
473
|
+
case "ConflictException":
|
|
474
|
+
case "com.amazonaws.ebs#ConflictException":
|
|
475
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
476
|
+
case "InternalServerException":
|
|
477
|
+
case "com.amazonaws.ebs#InternalServerException":
|
|
478
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
479
|
+
case "RequestThrottledException":
|
|
480
|
+
case "com.amazonaws.ebs#RequestThrottledException":
|
|
481
|
+
throw await deserializeAws_restJson1RequestThrottledExceptionResponse(parsedOutput, context);
|
|
482
|
+
case "ResourceNotFoundException":
|
|
483
|
+
case "com.amazonaws.ebs#ResourceNotFoundException":
|
|
484
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
485
|
+
case "ServiceQuotaExceededException":
|
|
486
|
+
case "com.amazonaws.ebs#ServiceQuotaExceededException":
|
|
487
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
488
|
+
case "ValidationException":
|
|
489
|
+
case "com.amazonaws.ebs#ValidationException":
|
|
490
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
491
|
+
default:
|
|
492
|
+
const parsedBody = parsedOutput.body;
|
|
493
|
+
throwDefaultError({
|
|
494
|
+
output,
|
|
495
|
+
parsedBody,
|
|
496
|
+
exceptionCtor: __BaseException,
|
|
497
|
+
errorCode,
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
};
|
|
501
|
+
const map = __map;
|
|
502
|
+
const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
|
|
503
|
+
const contents = map({});
|
|
504
|
+
const data = parsedOutput.body;
|
|
505
|
+
if (data.Message != null) {
|
|
506
|
+
contents.Message = __expectString(data.Message);
|
|
507
|
+
}
|
|
508
|
+
if (data.Reason != null) {
|
|
509
|
+
contents.Reason = __expectString(data.Reason);
|
|
510
|
+
}
|
|
511
|
+
const exception = new AccessDeniedException({
|
|
512
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
513
|
+
...contents,
|
|
705
514
|
});
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
515
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
516
|
+
};
|
|
517
|
+
const deserializeAws_restJson1ConcurrentLimitExceededExceptionResponse = async (parsedOutput, context) => {
|
|
518
|
+
const contents = map({});
|
|
519
|
+
const data = parsedOutput.body;
|
|
520
|
+
if (data.Message != null) {
|
|
521
|
+
contents.Message = __expectString(data.Message);
|
|
522
|
+
}
|
|
523
|
+
const exception = new ConcurrentLimitExceededException({
|
|
524
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
525
|
+
...contents,
|
|
717
526
|
});
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
527
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
528
|
+
};
|
|
529
|
+
const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
|
|
530
|
+
const contents = map({});
|
|
531
|
+
const data = parsedOutput.body;
|
|
532
|
+
if (data.Message != null) {
|
|
533
|
+
contents.Message = __expectString(data.Message);
|
|
534
|
+
}
|
|
535
|
+
const exception = new ConflictException({
|
|
536
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
537
|
+
...contents,
|
|
729
538
|
});
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
539
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
540
|
+
};
|
|
541
|
+
const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
|
|
542
|
+
const contents = map({});
|
|
543
|
+
const data = parsedOutput.body;
|
|
544
|
+
if (data.Message != null) {
|
|
545
|
+
contents.Message = __expectString(data.Message);
|
|
546
|
+
}
|
|
547
|
+
const exception = new InternalServerException({
|
|
548
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
549
|
+
...contents,
|
|
741
550
|
});
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
551
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
552
|
+
};
|
|
553
|
+
const deserializeAws_restJson1RequestThrottledExceptionResponse = async (parsedOutput, context) => {
|
|
554
|
+
const contents = map({});
|
|
555
|
+
const data = parsedOutput.body;
|
|
556
|
+
if (data.Message != null) {
|
|
557
|
+
contents.Message = __expectString(data.Message);
|
|
558
|
+
}
|
|
559
|
+
if (data.Reason != null) {
|
|
560
|
+
contents.Reason = __expectString(data.Reason);
|
|
561
|
+
}
|
|
562
|
+
const exception = new RequestThrottledException({
|
|
563
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
564
|
+
...contents,
|
|
756
565
|
});
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
566
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
567
|
+
};
|
|
568
|
+
const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
|
|
569
|
+
const contents = map({});
|
|
570
|
+
const data = parsedOutput.body;
|
|
571
|
+
if (data.Message != null) {
|
|
572
|
+
contents.Message = __expectString(data.Message);
|
|
573
|
+
}
|
|
574
|
+
if (data.Reason != null) {
|
|
575
|
+
contents.Reason = __expectString(data.Reason);
|
|
576
|
+
}
|
|
577
|
+
const exception = new ResourceNotFoundException({
|
|
578
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
579
|
+
...contents,
|
|
771
580
|
});
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
581
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
582
|
+
};
|
|
583
|
+
const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
|
|
584
|
+
const contents = map({});
|
|
585
|
+
const data = parsedOutput.body;
|
|
586
|
+
if (data.Message != null) {
|
|
587
|
+
contents.Message = __expectString(data.Message);
|
|
588
|
+
}
|
|
589
|
+
if (data.Reason != null) {
|
|
590
|
+
contents.Reason = __expectString(data.Reason);
|
|
591
|
+
}
|
|
592
|
+
const exception = new ServiceQuotaExceededException({
|
|
593
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
594
|
+
...contents,
|
|
786
595
|
});
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
596
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
597
|
+
};
|
|
598
|
+
const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
|
|
599
|
+
const contents = map({});
|
|
600
|
+
const data = parsedOutput.body;
|
|
601
|
+
if (data.Message != null) {
|
|
602
|
+
contents.Message = __expectString(data.Message);
|
|
603
|
+
}
|
|
604
|
+
if (data.Reason != null) {
|
|
605
|
+
contents.Reason = __expectString(data.Reason);
|
|
606
|
+
}
|
|
607
|
+
const exception = new ValidationException({
|
|
608
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
609
|
+
...contents,
|
|
801
610
|
});
|
|
802
|
-
|
|
803
|
-
var serializeAws_restJson1Tag = function (input, context) {
|
|
804
|
-
return __assign(__assign({}, (input.Key != null && { Key: input.Key })), (input.Value != null && { Value: input.Value }));
|
|
611
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
805
612
|
};
|
|
806
|
-
|
|
613
|
+
const serializeAws_restJson1Tag = (input, context) => {
|
|
614
|
+
return {
|
|
615
|
+
...(input.Key != null && { Key: input.Key }),
|
|
616
|
+
...(input.Value != null && { Value: input.Value }),
|
|
617
|
+
};
|
|
618
|
+
};
|
|
619
|
+
const serializeAws_restJson1Tags = (input, context) => {
|
|
807
620
|
return input
|
|
808
|
-
.filter(
|
|
809
|
-
.map(
|
|
621
|
+
.filter((e) => e != null)
|
|
622
|
+
.map((entry) => {
|
|
810
623
|
return serializeAws_restJson1Tag(entry, context);
|
|
811
624
|
});
|
|
812
625
|
};
|
|
813
|
-
|
|
626
|
+
const deserializeAws_restJson1Block = (output, context) => {
|
|
814
627
|
return {
|
|
815
628
|
BlockIndex: __expectInt32(output.BlockIndex),
|
|
816
629
|
BlockToken: __expectString(output.BlockToken),
|
|
817
630
|
};
|
|
818
631
|
};
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
.filter(
|
|
822
|
-
.map(
|
|
632
|
+
const deserializeAws_restJson1Blocks = (output, context) => {
|
|
633
|
+
const retVal = (output || [])
|
|
634
|
+
.filter((e) => e != null)
|
|
635
|
+
.map((entry) => {
|
|
823
636
|
if (entry === null) {
|
|
824
637
|
return null;
|
|
825
638
|
}
|
|
@@ -827,17 +640,17 @@ var deserializeAws_restJson1Blocks = function (output, context) {
|
|
|
827
640
|
});
|
|
828
641
|
return retVal;
|
|
829
642
|
};
|
|
830
|
-
|
|
643
|
+
const deserializeAws_restJson1ChangedBlock = (output, context) => {
|
|
831
644
|
return {
|
|
832
645
|
BlockIndex: __expectInt32(output.BlockIndex),
|
|
833
646
|
FirstBlockToken: __expectString(output.FirstBlockToken),
|
|
834
647
|
SecondBlockToken: __expectString(output.SecondBlockToken),
|
|
835
648
|
};
|
|
836
649
|
};
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
.filter(
|
|
840
|
-
.map(
|
|
650
|
+
const deserializeAws_restJson1ChangedBlocks = (output, context) => {
|
|
651
|
+
const retVal = (output || [])
|
|
652
|
+
.filter((e) => e != null)
|
|
653
|
+
.map((entry) => {
|
|
841
654
|
if (entry === null) {
|
|
842
655
|
return null;
|
|
843
656
|
}
|
|
@@ -845,16 +658,16 @@ var deserializeAws_restJson1ChangedBlocks = function (output, context) {
|
|
|
845
658
|
});
|
|
846
659
|
return retVal;
|
|
847
660
|
};
|
|
848
|
-
|
|
661
|
+
const deserializeAws_restJson1Tag = (output, context) => {
|
|
849
662
|
return {
|
|
850
663
|
Key: __expectString(output.Key),
|
|
851
664
|
Value: __expectString(output.Value),
|
|
852
665
|
};
|
|
853
666
|
};
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
.filter(
|
|
857
|
-
.map(
|
|
667
|
+
const deserializeAws_restJson1Tags = (output, context) => {
|
|
668
|
+
const retVal = (output || [])
|
|
669
|
+
.filter((e) => e != null)
|
|
670
|
+
.map((entry) => {
|
|
858
671
|
if (entry === null) {
|
|
859
672
|
return null;
|
|
860
673
|
}
|
|
@@ -862,57 +675,39 @@ var deserializeAws_restJson1Tags = function (output, context) {
|
|
|
862
675
|
});
|
|
863
676
|
return retVal;
|
|
864
677
|
};
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
});
|
|
873
|
-
};
|
|
874
|
-
var collectBody = function (streamBody, context) {
|
|
875
|
-
if (streamBody === void 0) { streamBody = new Uint8Array(); }
|
|
678
|
+
const deserializeMetadata = (output) => ({
|
|
679
|
+
httpStatusCode: output.statusCode,
|
|
680
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
|
|
681
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
682
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
683
|
+
});
|
|
684
|
+
const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
876
685
|
if (streamBody instanceof Uint8Array) {
|
|
877
686
|
return Promise.resolve(streamBody);
|
|
878
687
|
}
|
|
879
688
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
880
689
|
};
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
}
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
});
|
|
690
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
691
|
+
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
692
|
+
value !== null &&
|
|
693
|
+
value !== "" &&
|
|
694
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
695
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
696
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
697
|
+
if (encoded.length) {
|
|
698
|
+
return JSON.parse(encoded);
|
|
699
|
+
}
|
|
700
|
+
return {};
|
|
701
|
+
});
|
|
702
|
+
const parseErrorBody = async (errorBody, context) => {
|
|
703
|
+
const value = await parseBody(errorBody, context);
|
|
704
|
+
value.message = value.message ?? value.Message;
|
|
705
|
+
return value;
|
|
898
706
|
};
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
switch (_b.label) {
|
|
904
|
-
case 0: return [4, parseBody(errorBody, context)];
|
|
905
|
-
case 1:
|
|
906
|
-
value = _b.sent();
|
|
907
|
-
value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
|
|
908
|
-
return [2, value];
|
|
909
|
-
}
|
|
910
|
-
});
|
|
911
|
-
}); };
|
|
912
|
-
var loadRestJsonErrorCode = function (output, data) {
|
|
913
|
-
var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
|
|
914
|
-
var sanitizeErrorCode = function (rawValue) {
|
|
915
|
-
var cleanValue = rawValue;
|
|
707
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
708
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
709
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
710
|
+
let cleanValue = rawValue;
|
|
916
711
|
if (typeof cleanValue === "number") {
|
|
917
712
|
cleanValue = cleanValue.toString();
|
|
918
713
|
}
|
|
@@ -927,7 +722,7 @@ var loadRestJsonErrorCode = function (output, data) {
|
|
|
927
722
|
}
|
|
928
723
|
return cleanValue;
|
|
929
724
|
};
|
|
930
|
-
|
|
725
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
931
726
|
if (headerKey !== undefined) {
|
|
932
727
|
return sanitizeErrorCode(output.headers[headerKey]);
|
|
933
728
|
}
|