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