@aws-sdk/client-ebs 3.186.0 → 3.188.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist-cjs/protocols/Aws_restJson1.js +1 -0
- package/dist-cjs/runtimeConfig.browser.js +9 -7
- package/dist-cjs/runtimeConfig.js +9 -7
- 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 +640 -844
- package/dist-es/runtimeConfig.browser.js +28 -12
- package/dist-es/runtimeConfig.js +32 -12
- package/dist-es/runtimeConfig.native.js +8 -5
- package/dist-es/runtimeConfig.shared.js +8 -11
- package/dist-types/EBSClient.d.ts +6 -1
- package/dist-types/commands/GetSnapshotBlockCommand.d.ts +2 -2
- package/dist-types/protocols/Aws_restJson1.d.ts +2 -2
- package/dist-types/runtimeConfig.browser.d.ts +1 -0
- package/dist-types/runtimeConfig.d.ts +1 -0
- package/dist-types/runtimeConfig.native.d.ts +1 -0
- package/dist-types/ts3.4/EBSClient.d.ts +2 -0
- package/dist-types/ts3.4/commands/GetSnapshotBlockCommand.d.ts +2 -1
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +5 -2
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -0
- package/dist-types/ts3.4/runtimeConfig.d.ts +1 -0
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +1 -0
- package/package.json +35 -33
|
@@ -1,825 +1,639 @@
|
|
|
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
|
+
context.sdkStreamMixin(data);
|
|
216
|
+
contents.BlockData = data;
|
|
217
|
+
return contents;
|
|
218
|
+
};
|
|
219
|
+
const deserializeAws_restJson1GetSnapshotBlockCommandError = async (output, context) => {
|
|
220
|
+
const parsedOutput = {
|
|
221
|
+
...output,
|
|
222
|
+
body: await parseErrorBody(output.body, context),
|
|
223
|
+
};
|
|
224
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
225
|
+
switch (errorCode) {
|
|
226
|
+
case "AccessDeniedException":
|
|
227
|
+
case "com.amazonaws.ebs#AccessDeniedException":
|
|
228
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
229
|
+
case "InternalServerException":
|
|
230
|
+
case "com.amazonaws.ebs#InternalServerException":
|
|
231
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
232
|
+
case "RequestThrottledException":
|
|
233
|
+
case "com.amazonaws.ebs#RequestThrottledException":
|
|
234
|
+
throw await deserializeAws_restJson1RequestThrottledExceptionResponse(parsedOutput, context);
|
|
235
|
+
case "ResourceNotFoundException":
|
|
236
|
+
case "com.amazonaws.ebs#ResourceNotFoundException":
|
|
237
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
238
|
+
case "ServiceQuotaExceededException":
|
|
239
|
+
case "com.amazonaws.ebs#ServiceQuotaExceededException":
|
|
240
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
241
|
+
case "ValidationException":
|
|
242
|
+
case "com.amazonaws.ebs#ValidationException":
|
|
243
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
244
|
+
default:
|
|
245
|
+
const parsedBody = parsedOutput.body;
|
|
246
|
+
throwDefaultError({
|
|
247
|
+
output,
|
|
248
|
+
parsedBody,
|
|
249
|
+
exceptionCtor: __BaseException,
|
|
250
|
+
errorCode,
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
export const deserializeAws_restJson1ListChangedBlocksCommand = async (output, context) => {
|
|
255
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
256
|
+
return deserializeAws_restJson1ListChangedBlocksCommandError(output, context);
|
|
257
|
+
}
|
|
258
|
+
const contents = map({
|
|
259
|
+
$metadata: deserializeMetadata(output),
|
|
525
260
|
});
|
|
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
|
-
|
|
261
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
262
|
+
if (data.BlockSize != null) {
|
|
263
|
+
contents.BlockSize = __expectInt32(data.BlockSize);
|
|
264
|
+
}
|
|
265
|
+
if (data.ChangedBlocks != null) {
|
|
266
|
+
contents.ChangedBlocks = deserializeAws_restJson1ChangedBlocks(data.ChangedBlocks, context);
|
|
267
|
+
}
|
|
268
|
+
if (data.ExpiryTime != null) {
|
|
269
|
+
contents.ExpiryTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.ExpiryTime)));
|
|
270
|
+
}
|
|
271
|
+
if (data.NextToken != null) {
|
|
272
|
+
contents.NextToken = __expectString(data.NextToken);
|
|
273
|
+
}
|
|
274
|
+
if (data.VolumeSize != null) {
|
|
275
|
+
contents.VolumeSize = __expectLong(data.VolumeSize);
|
|
276
|
+
}
|
|
277
|
+
return contents;
|
|
278
|
+
};
|
|
279
|
+
const deserializeAws_restJson1ListChangedBlocksCommandError = async (output, context) => {
|
|
280
|
+
const parsedOutput = {
|
|
281
|
+
...output,
|
|
282
|
+
body: await parseErrorBody(output.body, context),
|
|
283
|
+
};
|
|
284
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
285
|
+
switch (errorCode) {
|
|
286
|
+
case "AccessDeniedException":
|
|
287
|
+
case "com.amazonaws.ebs#AccessDeniedException":
|
|
288
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
289
|
+
case "InternalServerException":
|
|
290
|
+
case "com.amazonaws.ebs#InternalServerException":
|
|
291
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
292
|
+
case "RequestThrottledException":
|
|
293
|
+
case "com.amazonaws.ebs#RequestThrottledException":
|
|
294
|
+
throw await deserializeAws_restJson1RequestThrottledExceptionResponse(parsedOutput, context);
|
|
295
|
+
case "ResourceNotFoundException":
|
|
296
|
+
case "com.amazonaws.ebs#ResourceNotFoundException":
|
|
297
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
298
|
+
case "ServiceQuotaExceededException":
|
|
299
|
+
case "com.amazonaws.ebs#ServiceQuotaExceededException":
|
|
300
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
301
|
+
case "ValidationException":
|
|
302
|
+
case "com.amazonaws.ebs#ValidationException":
|
|
303
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
304
|
+
default:
|
|
305
|
+
const parsedBody = parsedOutput.body;
|
|
306
|
+
throwDefaultError({
|
|
307
|
+
output,
|
|
308
|
+
parsedBody,
|
|
309
|
+
exceptionCtor: __BaseException,
|
|
310
|
+
errorCode,
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
export const deserializeAws_restJson1ListSnapshotBlocksCommand = async (output, context) => {
|
|
315
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
316
|
+
return deserializeAws_restJson1ListSnapshotBlocksCommandError(output, context);
|
|
317
|
+
}
|
|
318
|
+
const contents = map({
|
|
319
|
+
$metadata: deserializeMetadata(output),
|
|
578
320
|
});
|
|
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
|
-
|
|
321
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
322
|
+
if (data.BlockSize != null) {
|
|
323
|
+
contents.BlockSize = __expectInt32(data.BlockSize);
|
|
324
|
+
}
|
|
325
|
+
if (data.Blocks != null) {
|
|
326
|
+
contents.Blocks = deserializeAws_restJson1Blocks(data.Blocks, context);
|
|
327
|
+
}
|
|
328
|
+
if (data.ExpiryTime != null) {
|
|
329
|
+
contents.ExpiryTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.ExpiryTime)));
|
|
330
|
+
}
|
|
331
|
+
if (data.NextToken != null) {
|
|
332
|
+
contents.NextToken = __expectString(data.NextToken);
|
|
333
|
+
}
|
|
334
|
+
if (data.VolumeSize != null) {
|
|
335
|
+
contents.VolumeSize = __expectLong(data.VolumeSize);
|
|
336
|
+
}
|
|
337
|
+
return contents;
|
|
338
|
+
};
|
|
339
|
+
const deserializeAws_restJson1ListSnapshotBlocksCommandError = async (output, context) => {
|
|
340
|
+
const parsedOutput = {
|
|
341
|
+
...output,
|
|
342
|
+
body: await parseErrorBody(output.body, context),
|
|
343
|
+
};
|
|
344
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
345
|
+
switch (errorCode) {
|
|
346
|
+
case "AccessDeniedException":
|
|
347
|
+
case "com.amazonaws.ebs#AccessDeniedException":
|
|
348
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
349
|
+
case "InternalServerException":
|
|
350
|
+
case "com.amazonaws.ebs#InternalServerException":
|
|
351
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
352
|
+
case "RequestThrottledException":
|
|
353
|
+
case "com.amazonaws.ebs#RequestThrottledException":
|
|
354
|
+
throw await deserializeAws_restJson1RequestThrottledExceptionResponse(parsedOutput, context);
|
|
355
|
+
case "ResourceNotFoundException":
|
|
356
|
+
case "com.amazonaws.ebs#ResourceNotFoundException":
|
|
357
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
358
|
+
case "ServiceQuotaExceededException":
|
|
359
|
+
case "com.amazonaws.ebs#ServiceQuotaExceededException":
|
|
360
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
361
|
+
case "ValidationException":
|
|
362
|
+
case "com.amazonaws.ebs#ValidationException":
|
|
363
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
364
|
+
default:
|
|
365
|
+
const parsedBody = parsedOutput.body;
|
|
366
|
+
throwDefaultError({
|
|
367
|
+
output,
|
|
368
|
+
parsedBody,
|
|
369
|
+
exceptionCtor: __BaseException,
|
|
370
|
+
errorCode,
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
export const deserializeAws_restJson1PutSnapshotBlockCommand = async (output, context) => {
|
|
375
|
+
if (output.statusCode !== 201 && output.statusCode >= 300) {
|
|
376
|
+
return deserializeAws_restJson1PutSnapshotBlockCommandError(output, context);
|
|
377
|
+
}
|
|
378
|
+
const contents = map({
|
|
379
|
+
$metadata: deserializeMetadata(output),
|
|
380
|
+
Checksum: [, output.headers["x-amz-checksum"]],
|
|
381
|
+
ChecksumAlgorithm: [, output.headers["x-amz-checksum-algorithm"]],
|
|
628
382
|
});
|
|
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
|
-
}
|
|
383
|
+
await collectBody(output.body, context);
|
|
384
|
+
return contents;
|
|
385
|
+
};
|
|
386
|
+
const deserializeAws_restJson1PutSnapshotBlockCommandError = async (output, context) => {
|
|
387
|
+
const parsedOutput = {
|
|
388
|
+
...output,
|
|
389
|
+
body: await parseErrorBody(output.body, context),
|
|
390
|
+
};
|
|
391
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
392
|
+
switch (errorCode) {
|
|
393
|
+
case "AccessDeniedException":
|
|
394
|
+
case "com.amazonaws.ebs#AccessDeniedException":
|
|
395
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
396
|
+
case "InternalServerException":
|
|
397
|
+
case "com.amazonaws.ebs#InternalServerException":
|
|
398
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
399
|
+
case "RequestThrottledException":
|
|
400
|
+
case "com.amazonaws.ebs#RequestThrottledException":
|
|
401
|
+
throw await deserializeAws_restJson1RequestThrottledExceptionResponse(parsedOutput, context);
|
|
402
|
+
case "ResourceNotFoundException":
|
|
403
|
+
case "com.amazonaws.ebs#ResourceNotFoundException":
|
|
404
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
405
|
+
case "ServiceQuotaExceededException":
|
|
406
|
+
case "com.amazonaws.ebs#ServiceQuotaExceededException":
|
|
407
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
408
|
+
case "ValidationException":
|
|
409
|
+
case "com.amazonaws.ebs#ValidationException":
|
|
410
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
411
|
+
default:
|
|
412
|
+
const parsedBody = parsedOutput.body;
|
|
413
|
+
throwDefaultError({
|
|
414
|
+
output,
|
|
415
|
+
parsedBody,
|
|
416
|
+
exceptionCtor: __BaseException,
|
|
417
|
+
errorCode,
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
};
|
|
421
|
+
export const deserializeAws_restJson1StartSnapshotCommand = async (output, context) => {
|
|
422
|
+
if (output.statusCode !== 201 && output.statusCode >= 300) {
|
|
423
|
+
return deserializeAws_restJson1StartSnapshotCommandError(output, context);
|
|
424
|
+
}
|
|
425
|
+
const contents = map({
|
|
426
|
+
$metadata: deserializeMetadata(output),
|
|
689
427
|
});
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
contents =
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
428
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
429
|
+
if (data.BlockSize != null) {
|
|
430
|
+
contents.BlockSize = __expectInt32(data.BlockSize);
|
|
431
|
+
}
|
|
432
|
+
if (data.Description != null) {
|
|
433
|
+
contents.Description = __expectString(data.Description);
|
|
434
|
+
}
|
|
435
|
+
if (data.KmsKeyArn != null) {
|
|
436
|
+
contents.KmsKeyArn = __expectString(data.KmsKeyArn);
|
|
437
|
+
}
|
|
438
|
+
if (data.OwnerId != null) {
|
|
439
|
+
contents.OwnerId = __expectString(data.OwnerId);
|
|
440
|
+
}
|
|
441
|
+
if (data.ParentSnapshotId != null) {
|
|
442
|
+
contents.ParentSnapshotId = __expectString(data.ParentSnapshotId);
|
|
443
|
+
}
|
|
444
|
+
if (data.SnapshotId != null) {
|
|
445
|
+
contents.SnapshotId = __expectString(data.SnapshotId);
|
|
446
|
+
}
|
|
447
|
+
if (data.StartTime != null) {
|
|
448
|
+
contents.StartTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.StartTime)));
|
|
449
|
+
}
|
|
450
|
+
if (data.Status != null) {
|
|
451
|
+
contents.Status = __expectString(data.Status);
|
|
452
|
+
}
|
|
453
|
+
if (data.Tags != null) {
|
|
454
|
+
contents.Tags = deserializeAws_restJson1Tags(data.Tags, context);
|
|
455
|
+
}
|
|
456
|
+
if (data.VolumeSize != null) {
|
|
457
|
+
contents.VolumeSize = __expectLong(data.VolumeSize);
|
|
458
|
+
}
|
|
459
|
+
return contents;
|
|
460
|
+
};
|
|
461
|
+
const deserializeAws_restJson1StartSnapshotCommandError = async (output, context) => {
|
|
462
|
+
const parsedOutput = {
|
|
463
|
+
...output,
|
|
464
|
+
body: await parseErrorBody(output.body, context),
|
|
465
|
+
};
|
|
466
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
467
|
+
switch (errorCode) {
|
|
468
|
+
case "AccessDeniedException":
|
|
469
|
+
case "com.amazonaws.ebs#AccessDeniedException":
|
|
470
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
471
|
+
case "ConcurrentLimitExceededException":
|
|
472
|
+
case "com.amazonaws.ebs#ConcurrentLimitExceededException":
|
|
473
|
+
throw await deserializeAws_restJson1ConcurrentLimitExceededExceptionResponse(parsedOutput, context);
|
|
474
|
+
case "ConflictException":
|
|
475
|
+
case "com.amazonaws.ebs#ConflictException":
|
|
476
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
477
|
+
case "InternalServerException":
|
|
478
|
+
case "com.amazonaws.ebs#InternalServerException":
|
|
479
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
480
|
+
case "RequestThrottledException":
|
|
481
|
+
case "com.amazonaws.ebs#RequestThrottledException":
|
|
482
|
+
throw await deserializeAws_restJson1RequestThrottledExceptionResponse(parsedOutput, context);
|
|
483
|
+
case "ResourceNotFoundException":
|
|
484
|
+
case "com.amazonaws.ebs#ResourceNotFoundException":
|
|
485
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
486
|
+
case "ServiceQuotaExceededException":
|
|
487
|
+
case "com.amazonaws.ebs#ServiceQuotaExceededException":
|
|
488
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
489
|
+
case "ValidationException":
|
|
490
|
+
case "com.amazonaws.ebs#ValidationException":
|
|
491
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
492
|
+
default:
|
|
493
|
+
const parsedBody = parsedOutput.body;
|
|
494
|
+
throwDefaultError({
|
|
495
|
+
output,
|
|
496
|
+
parsedBody,
|
|
497
|
+
exceptionCtor: __BaseException,
|
|
498
|
+
errorCode,
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
const map = __map;
|
|
503
|
+
const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
|
|
504
|
+
const contents = map({});
|
|
505
|
+
const data = parsedOutput.body;
|
|
506
|
+
if (data.Message != null) {
|
|
507
|
+
contents.Message = __expectString(data.Message);
|
|
508
|
+
}
|
|
509
|
+
if (data.Reason != null) {
|
|
510
|
+
contents.Reason = __expectString(data.Reason);
|
|
511
|
+
}
|
|
512
|
+
const exception = new AccessDeniedException({
|
|
513
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
514
|
+
...contents,
|
|
705
515
|
});
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
516
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
517
|
+
};
|
|
518
|
+
const deserializeAws_restJson1ConcurrentLimitExceededExceptionResponse = async (parsedOutput, context) => {
|
|
519
|
+
const contents = map({});
|
|
520
|
+
const data = parsedOutput.body;
|
|
521
|
+
if (data.Message != null) {
|
|
522
|
+
contents.Message = __expectString(data.Message);
|
|
523
|
+
}
|
|
524
|
+
const exception = new ConcurrentLimitExceededException({
|
|
525
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
526
|
+
...contents,
|
|
717
527
|
});
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
528
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
529
|
+
};
|
|
530
|
+
const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
|
|
531
|
+
const contents = map({});
|
|
532
|
+
const data = parsedOutput.body;
|
|
533
|
+
if (data.Message != null) {
|
|
534
|
+
contents.Message = __expectString(data.Message);
|
|
535
|
+
}
|
|
536
|
+
const exception = new ConflictException({
|
|
537
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
538
|
+
...contents,
|
|
729
539
|
});
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
540
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
541
|
+
};
|
|
542
|
+
const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
|
|
543
|
+
const contents = map({});
|
|
544
|
+
const data = parsedOutput.body;
|
|
545
|
+
if (data.Message != null) {
|
|
546
|
+
contents.Message = __expectString(data.Message);
|
|
547
|
+
}
|
|
548
|
+
const exception = new InternalServerException({
|
|
549
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
550
|
+
...contents,
|
|
741
551
|
});
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
552
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
553
|
+
};
|
|
554
|
+
const deserializeAws_restJson1RequestThrottledExceptionResponse = async (parsedOutput, context) => {
|
|
555
|
+
const contents = map({});
|
|
556
|
+
const data = parsedOutput.body;
|
|
557
|
+
if (data.Message != null) {
|
|
558
|
+
contents.Message = __expectString(data.Message);
|
|
559
|
+
}
|
|
560
|
+
if (data.Reason != null) {
|
|
561
|
+
contents.Reason = __expectString(data.Reason);
|
|
562
|
+
}
|
|
563
|
+
const exception = new RequestThrottledException({
|
|
564
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
565
|
+
...contents,
|
|
756
566
|
});
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
567
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
568
|
+
};
|
|
569
|
+
const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
|
|
570
|
+
const contents = map({});
|
|
571
|
+
const data = parsedOutput.body;
|
|
572
|
+
if (data.Message != null) {
|
|
573
|
+
contents.Message = __expectString(data.Message);
|
|
574
|
+
}
|
|
575
|
+
if (data.Reason != null) {
|
|
576
|
+
contents.Reason = __expectString(data.Reason);
|
|
577
|
+
}
|
|
578
|
+
const exception = new ResourceNotFoundException({
|
|
579
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
580
|
+
...contents,
|
|
771
581
|
});
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
582
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
583
|
+
};
|
|
584
|
+
const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
|
|
585
|
+
const contents = map({});
|
|
586
|
+
const data = parsedOutput.body;
|
|
587
|
+
if (data.Message != null) {
|
|
588
|
+
contents.Message = __expectString(data.Message);
|
|
589
|
+
}
|
|
590
|
+
if (data.Reason != null) {
|
|
591
|
+
contents.Reason = __expectString(data.Reason);
|
|
592
|
+
}
|
|
593
|
+
const exception = new ServiceQuotaExceededException({
|
|
594
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
595
|
+
...contents,
|
|
786
596
|
});
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
597
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
598
|
+
};
|
|
599
|
+
const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
|
|
600
|
+
const contents = map({});
|
|
601
|
+
const data = parsedOutput.body;
|
|
602
|
+
if (data.Message != null) {
|
|
603
|
+
contents.Message = __expectString(data.Message);
|
|
604
|
+
}
|
|
605
|
+
if (data.Reason != null) {
|
|
606
|
+
contents.Reason = __expectString(data.Reason);
|
|
607
|
+
}
|
|
608
|
+
const exception = new ValidationException({
|
|
609
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
610
|
+
...contents,
|
|
801
611
|
});
|
|
802
|
-
|
|
803
|
-
var serializeAws_restJson1Tag = function (input, context) {
|
|
804
|
-
return __assign(__assign({}, (input.Key != null && { Key: input.Key })), (input.Value != null && { Value: input.Value }));
|
|
612
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
805
613
|
};
|
|
806
|
-
|
|
614
|
+
const serializeAws_restJson1Tag = (input, context) => {
|
|
615
|
+
return {
|
|
616
|
+
...(input.Key != null && { Key: input.Key }),
|
|
617
|
+
...(input.Value != null && { Value: input.Value }),
|
|
618
|
+
};
|
|
619
|
+
};
|
|
620
|
+
const serializeAws_restJson1Tags = (input, context) => {
|
|
807
621
|
return input
|
|
808
|
-
.filter(
|
|
809
|
-
.map(
|
|
622
|
+
.filter((e) => e != null)
|
|
623
|
+
.map((entry) => {
|
|
810
624
|
return serializeAws_restJson1Tag(entry, context);
|
|
811
625
|
});
|
|
812
626
|
};
|
|
813
|
-
|
|
627
|
+
const deserializeAws_restJson1Block = (output, context) => {
|
|
814
628
|
return {
|
|
815
629
|
BlockIndex: __expectInt32(output.BlockIndex),
|
|
816
630
|
BlockToken: __expectString(output.BlockToken),
|
|
817
631
|
};
|
|
818
632
|
};
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
.filter(
|
|
822
|
-
.map(
|
|
633
|
+
const deserializeAws_restJson1Blocks = (output, context) => {
|
|
634
|
+
const retVal = (output || [])
|
|
635
|
+
.filter((e) => e != null)
|
|
636
|
+
.map((entry) => {
|
|
823
637
|
if (entry === null) {
|
|
824
638
|
return null;
|
|
825
639
|
}
|
|
@@ -827,17 +641,17 @@ var deserializeAws_restJson1Blocks = function (output, context) {
|
|
|
827
641
|
});
|
|
828
642
|
return retVal;
|
|
829
643
|
};
|
|
830
|
-
|
|
644
|
+
const deserializeAws_restJson1ChangedBlock = (output, context) => {
|
|
831
645
|
return {
|
|
832
646
|
BlockIndex: __expectInt32(output.BlockIndex),
|
|
833
647
|
FirstBlockToken: __expectString(output.FirstBlockToken),
|
|
834
648
|
SecondBlockToken: __expectString(output.SecondBlockToken),
|
|
835
649
|
};
|
|
836
650
|
};
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
.filter(
|
|
840
|
-
.map(
|
|
651
|
+
const deserializeAws_restJson1ChangedBlocks = (output, context) => {
|
|
652
|
+
const retVal = (output || [])
|
|
653
|
+
.filter((e) => e != null)
|
|
654
|
+
.map((entry) => {
|
|
841
655
|
if (entry === null) {
|
|
842
656
|
return null;
|
|
843
657
|
}
|
|
@@ -845,16 +659,16 @@ var deserializeAws_restJson1ChangedBlocks = function (output, context) {
|
|
|
845
659
|
});
|
|
846
660
|
return retVal;
|
|
847
661
|
};
|
|
848
|
-
|
|
662
|
+
const deserializeAws_restJson1Tag = (output, context) => {
|
|
849
663
|
return {
|
|
850
664
|
Key: __expectString(output.Key),
|
|
851
665
|
Value: __expectString(output.Value),
|
|
852
666
|
};
|
|
853
667
|
};
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
.filter(
|
|
857
|
-
.map(
|
|
668
|
+
const deserializeAws_restJson1Tags = (output, context) => {
|
|
669
|
+
const retVal = (output || [])
|
|
670
|
+
.filter((e) => e != null)
|
|
671
|
+
.map((entry) => {
|
|
858
672
|
if (entry === null) {
|
|
859
673
|
return null;
|
|
860
674
|
}
|
|
@@ -862,57 +676,39 @@ var deserializeAws_restJson1Tags = function (output, context) {
|
|
|
862
676
|
});
|
|
863
677
|
return retVal;
|
|
864
678
|
};
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
});
|
|
873
|
-
};
|
|
874
|
-
var collectBody = function (streamBody, context) {
|
|
875
|
-
if (streamBody === void 0) { streamBody = new Uint8Array(); }
|
|
679
|
+
const deserializeMetadata = (output) => ({
|
|
680
|
+
httpStatusCode: output.statusCode,
|
|
681
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
682
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
683
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
684
|
+
});
|
|
685
|
+
const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
876
686
|
if (streamBody instanceof Uint8Array) {
|
|
877
687
|
return Promise.resolve(streamBody);
|
|
878
688
|
}
|
|
879
689
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
880
690
|
};
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
}
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
});
|
|
691
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
692
|
+
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
693
|
+
value !== null &&
|
|
694
|
+
value !== "" &&
|
|
695
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
696
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
697
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
698
|
+
if (encoded.length) {
|
|
699
|
+
return JSON.parse(encoded);
|
|
700
|
+
}
|
|
701
|
+
return {};
|
|
702
|
+
});
|
|
703
|
+
const parseErrorBody = async (errorBody, context) => {
|
|
704
|
+
const value = await parseBody(errorBody, context);
|
|
705
|
+
value.message = value.message ?? value.Message;
|
|
706
|
+
return value;
|
|
898
707
|
};
|
|
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;
|
|
708
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
709
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
710
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
711
|
+
let cleanValue = rawValue;
|
|
916
712
|
if (typeof cleanValue === "number") {
|
|
917
713
|
cleanValue = cleanValue.toString();
|
|
918
714
|
}
|
|
@@ -927,7 +723,7 @@ var loadRestJsonErrorCode = function (output, data) {
|
|
|
927
723
|
}
|
|
928
724
|
return cleanValue;
|
|
929
725
|
};
|
|
930
|
-
|
|
726
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
931
727
|
if (headerKey !== undefined) {
|
|
932
728
|
return sanitizeErrorCode(output.headers[headerKey]);
|
|
933
729
|
}
|