@aws-sdk/client-mediastore-data 3.183.0 → 3.186.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 +19 -0
- package/dist-cjs/protocols/Aws_restJson1.js +2 -2
- package/dist-es/MediaStoreData.js +29 -22
- package/dist-es/MediaStoreDataClient.js +28 -22
- package/dist-es/commands/DeleteObjectCommand.js +28 -21
- package/dist-es/commands/DescribeObjectCommand.js +28 -21
- package/dist-es/commands/GetObjectCommand.js +28 -21
- package/dist-es/commands/ListItemsCommand.js +28 -21
- package/dist-es/commands/PutObjectCommand.js +28 -21
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/MediaStoreDataServiceException.js +10 -5
- package/dist-es/models/models_0.js +60 -81
- package/dist-es/pagination/ListItemsPaginator.js +68 -25
- package/dist-es/protocols/Aws_restJson1.js +541 -379
- 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 +33 -33
|
@@ -1,372 +1,516 @@
|
|
|
1
|
+
import { __assign, __awaiter, __generator } from "tslib";
|
|
1
2
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
2
3
|
import { decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map as __map, parseEpochTimestamp as __parseEpochTimestamp, parseRfc7231DateTime as __parseRfc7231DateTime, resolvedPath as __resolvedPath, strictParseLong as __strictParseLong, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
3
4
|
import { MediaStoreDataServiceException as __BaseException } from "../models/MediaStoreDataServiceException";
|
|
4
5
|
import { ContainerNotFoundException, InternalServerError, ObjectNotFoundException, RequestedRangeNotSatisfiableException, } from "../models/models_0";
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
export var serializeAws_restJson1DeleteObjectCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
8
|
+
return __generator(this, function (_c) {
|
|
9
|
+
switch (_c.label) {
|
|
10
|
+
case 0: return [4, context.endpoint()];
|
|
11
|
+
case 1:
|
|
12
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
13
|
+
headers = {};
|
|
14
|
+
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/{Path+}";
|
|
15
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "Path", function () { return input.Path; }, "{Path+}", true);
|
|
16
|
+
return [2, new __HttpRequest({
|
|
17
|
+
protocol: protocol,
|
|
18
|
+
hostname: hostname,
|
|
19
|
+
port: port,
|
|
20
|
+
method: "DELETE",
|
|
21
|
+
headers: headers,
|
|
22
|
+
path: resolvedPath,
|
|
23
|
+
body: body,
|
|
24
|
+
})];
|
|
25
|
+
}
|
|
19
26
|
});
|
|
20
|
-
};
|
|
21
|
-
export
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
}); };
|
|
28
|
+
export var serializeAws_restJson1DescribeObjectCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
29
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
30
|
+
return __generator(this, function (_c) {
|
|
31
|
+
switch (_c.label) {
|
|
32
|
+
case 0: return [4, context.endpoint()];
|
|
33
|
+
case 1:
|
|
34
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
35
|
+
headers = {};
|
|
36
|
+
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/{Path+}";
|
|
37
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "Path", function () { return input.Path; }, "{Path+}", true);
|
|
38
|
+
return [2, new __HttpRequest({
|
|
39
|
+
protocol: protocol,
|
|
40
|
+
hostname: hostname,
|
|
41
|
+
port: port,
|
|
42
|
+
method: "HEAD",
|
|
43
|
+
headers: headers,
|
|
44
|
+
path: resolvedPath,
|
|
45
|
+
body: body,
|
|
46
|
+
})];
|
|
47
|
+
}
|
|
35
48
|
});
|
|
36
|
-
};
|
|
37
|
-
export
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
49
|
+
}); };
|
|
50
|
+
export var serializeAws_restJson1GetObjectCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
51
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
52
|
+
return __generator(this, function (_c) {
|
|
53
|
+
switch (_c.label) {
|
|
54
|
+
case 0: return [4, context.endpoint()];
|
|
55
|
+
case 1:
|
|
56
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
57
|
+
headers = map({}, isSerializableHeaderValue, {
|
|
58
|
+
range: input.Range,
|
|
59
|
+
});
|
|
60
|
+
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/{Path+}";
|
|
61
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "Path", function () { return input.Path; }, "{Path+}", true);
|
|
62
|
+
return [2, new __HttpRequest({
|
|
63
|
+
protocol: protocol,
|
|
64
|
+
hostname: hostname,
|
|
65
|
+
port: port,
|
|
66
|
+
method: "GET",
|
|
67
|
+
headers: headers,
|
|
68
|
+
path: resolvedPath,
|
|
69
|
+
body: body,
|
|
70
|
+
})];
|
|
71
|
+
}
|
|
41
72
|
});
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
73
|
+
}); };
|
|
74
|
+
export var serializeAws_restJson1ListItemsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
75
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
|
|
76
|
+
return __generator(this, function (_c) {
|
|
77
|
+
switch (_c.label) {
|
|
78
|
+
case 0: return [4, context.endpoint()];
|
|
79
|
+
case 1:
|
|
80
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
81
|
+
headers = {};
|
|
82
|
+
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/";
|
|
83
|
+
query = map({
|
|
84
|
+
Path: [, input.Path],
|
|
85
|
+
MaxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
|
|
86
|
+
NextToken: [, input.NextToken],
|
|
87
|
+
});
|
|
88
|
+
return [2, new __HttpRequest({
|
|
89
|
+
protocol: protocol,
|
|
90
|
+
hostname: hostname,
|
|
91
|
+
port: port,
|
|
92
|
+
method: "GET",
|
|
93
|
+
headers: headers,
|
|
94
|
+
path: resolvedPath,
|
|
95
|
+
query: query,
|
|
96
|
+
body: body,
|
|
97
|
+
})];
|
|
98
|
+
}
|
|
53
99
|
});
|
|
54
|
-
};
|
|
55
|
-
export
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
100
|
+
}); };
|
|
101
|
+
export var serializeAws_restJson1PutObjectCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
102
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
103
|
+
return __generator(this, function (_c) {
|
|
104
|
+
switch (_c.label) {
|
|
105
|
+
case 0: return [4, context.endpoint()];
|
|
106
|
+
case 1:
|
|
107
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
108
|
+
headers = map({}, isSerializableHeaderValue, {
|
|
109
|
+
"x-amz-content-sha256": "UNSIGNED-PAYLOAD",
|
|
110
|
+
"content-type": input.ContentType || "application/octet-stream",
|
|
111
|
+
"cache-control": input.CacheControl,
|
|
112
|
+
"x-amz-storage-class": input.StorageClass,
|
|
113
|
+
"x-amz-upload-availability": input.UploadAvailability,
|
|
114
|
+
});
|
|
115
|
+
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/{Path+}";
|
|
116
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "Path", function () { return input.Path; }, "{Path+}", true);
|
|
117
|
+
if (input.Body !== undefined) {
|
|
118
|
+
body = input.Body;
|
|
119
|
+
}
|
|
120
|
+
return [2, new __HttpRequest({
|
|
121
|
+
protocol: protocol,
|
|
122
|
+
hostname: hostname,
|
|
123
|
+
port: port,
|
|
124
|
+
method: "PUT",
|
|
125
|
+
headers: headers,
|
|
126
|
+
path: resolvedPath,
|
|
127
|
+
body: body,
|
|
128
|
+
})];
|
|
129
|
+
}
|
|
63
130
|
});
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
131
|
+
}); };
|
|
132
|
+
export var deserializeAws_restJson1DeleteObjectCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
133
|
+
var contents;
|
|
134
|
+
return __generator(this, function (_a) {
|
|
135
|
+
switch (_a.label) {
|
|
136
|
+
case 0:
|
|
137
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
138
|
+
return [2, deserializeAws_restJson1DeleteObjectCommandError(output, context)];
|
|
139
|
+
}
|
|
140
|
+
contents = map({
|
|
141
|
+
$metadata: deserializeMetadata(output),
|
|
142
|
+
});
|
|
143
|
+
return [4, collectBody(output.body, context)];
|
|
144
|
+
case 1:
|
|
145
|
+
_a.sent();
|
|
146
|
+
return [2, contents];
|
|
147
|
+
}
|
|
74
148
|
});
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
149
|
+
}); };
|
|
150
|
+
var deserializeAws_restJson1DeleteObjectCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
151
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
152
|
+
var _c;
|
|
153
|
+
return __generator(this, function (_d) {
|
|
154
|
+
switch (_d.label) {
|
|
155
|
+
case 0:
|
|
156
|
+
_a = [__assign({}, output)];
|
|
157
|
+
_c = {};
|
|
158
|
+
return [4, parseErrorBody(output.body, context)];
|
|
159
|
+
case 1:
|
|
160
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
161
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
162
|
+
_b = errorCode;
|
|
163
|
+
switch (_b) {
|
|
164
|
+
case "ContainerNotFoundException": return [3, 2];
|
|
165
|
+
case "com.amazonaws.mediastoredata#ContainerNotFoundException": return [3, 2];
|
|
166
|
+
case "InternalServerError": return [3, 4];
|
|
167
|
+
case "com.amazonaws.mediastoredata#InternalServerError": return [3, 4];
|
|
168
|
+
case "ObjectNotFoundException": return [3, 6];
|
|
169
|
+
case "com.amazonaws.mediastoredata#ObjectNotFoundException": return [3, 6];
|
|
170
|
+
}
|
|
171
|
+
return [3, 8];
|
|
172
|
+
case 2: return [4, deserializeAws_restJson1ContainerNotFoundExceptionResponse(parsedOutput, context)];
|
|
173
|
+
case 3: throw _d.sent();
|
|
174
|
+
case 4: return [4, deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)];
|
|
175
|
+
case 5: throw _d.sent();
|
|
176
|
+
case 6: return [4, deserializeAws_restJson1ObjectNotFoundExceptionResponse(parsedOutput, context)];
|
|
177
|
+
case 7: throw _d.sent();
|
|
178
|
+
case 8:
|
|
179
|
+
parsedBody = parsedOutput.body;
|
|
180
|
+
throwDefaultError({
|
|
181
|
+
output: output,
|
|
182
|
+
parsedBody: parsedBody,
|
|
183
|
+
exceptionCtor: __BaseException,
|
|
184
|
+
errorCode: errorCode,
|
|
185
|
+
});
|
|
186
|
+
_d.label = 9;
|
|
187
|
+
case 9: return [2];
|
|
188
|
+
}
|
|
84
189
|
});
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
190
|
+
}); };
|
|
191
|
+
export var deserializeAws_restJson1DescribeObjectCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
192
|
+
var contents;
|
|
193
|
+
return __generator(this, function (_a) {
|
|
194
|
+
switch (_a.label) {
|
|
195
|
+
case 0:
|
|
196
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
197
|
+
return [2, deserializeAws_restJson1DescribeObjectCommandError(output, context)];
|
|
198
|
+
}
|
|
199
|
+
contents = map({
|
|
200
|
+
$metadata: deserializeMetadata(output),
|
|
201
|
+
ETag: [, output.headers["etag"]],
|
|
202
|
+
ContentType: [, output.headers["content-type"]],
|
|
203
|
+
ContentLength: [
|
|
204
|
+
function () { return void 0 !== output.headers["content-length"]; },
|
|
205
|
+
function () { return __strictParseLong(output.headers["content-length"]); },
|
|
206
|
+
],
|
|
207
|
+
CacheControl: [, output.headers["cache-control"]],
|
|
208
|
+
LastModified: [
|
|
209
|
+
function () { return void 0 !== output.headers["last-modified"]; },
|
|
210
|
+
function () { return __expectNonNull(__parseRfc7231DateTime(output.headers["last-modified"])); },
|
|
211
|
+
],
|
|
212
|
+
});
|
|
213
|
+
return [4, collectBody(output.body, context)];
|
|
214
|
+
case 1:
|
|
215
|
+
_a.sent();
|
|
216
|
+
return [2, contents];
|
|
217
|
+
}
|
|
99
218
|
});
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
219
|
+
}); };
|
|
220
|
+
var deserializeAws_restJson1DescribeObjectCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
221
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
222
|
+
var _c;
|
|
223
|
+
return __generator(this, function (_d) {
|
|
224
|
+
switch (_d.label) {
|
|
225
|
+
case 0:
|
|
226
|
+
_a = [__assign({}, output)];
|
|
227
|
+
_c = {};
|
|
228
|
+
return [4, parseErrorBody(output.body, context)];
|
|
229
|
+
case 1:
|
|
230
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
231
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
232
|
+
_b = errorCode;
|
|
233
|
+
switch (_b) {
|
|
234
|
+
case "ContainerNotFoundException": return [3, 2];
|
|
235
|
+
case "com.amazonaws.mediastoredata#ContainerNotFoundException": return [3, 2];
|
|
236
|
+
case "InternalServerError": return [3, 4];
|
|
237
|
+
case "com.amazonaws.mediastoredata#InternalServerError": return [3, 4];
|
|
238
|
+
case "ObjectNotFoundException": return [3, 6];
|
|
239
|
+
case "com.amazonaws.mediastoredata#ObjectNotFoundException": return [3, 6];
|
|
240
|
+
}
|
|
241
|
+
return [3, 8];
|
|
242
|
+
case 2: return [4, deserializeAws_restJson1ContainerNotFoundExceptionResponse(parsedOutput, context)];
|
|
243
|
+
case 3: throw _d.sent();
|
|
244
|
+
case 4: return [4, deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)];
|
|
245
|
+
case 5: throw _d.sent();
|
|
246
|
+
case 6: return [4, deserializeAws_restJson1ObjectNotFoundExceptionResponse(parsedOutput, context)];
|
|
247
|
+
case 7: throw _d.sent();
|
|
248
|
+
case 8:
|
|
249
|
+
parsedBody = parsedOutput.body;
|
|
250
|
+
throwDefaultError({
|
|
251
|
+
output: output,
|
|
252
|
+
parsedBody: parsedBody,
|
|
253
|
+
exceptionCtor: __BaseException,
|
|
254
|
+
errorCode: errorCode,
|
|
255
|
+
});
|
|
256
|
+
_d.label = 9;
|
|
257
|
+
case 9: return [2];
|
|
258
|
+
}
|
|
107
259
|
});
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
};
|
|
137
|
-
export const deserializeAws_restJson1DescribeObjectCommand = async (output, context) => {
|
|
138
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
139
|
-
return deserializeAws_restJson1DescribeObjectCommandError(output, context);
|
|
140
|
-
}
|
|
141
|
-
const contents = map({
|
|
142
|
-
$metadata: deserializeMetadata(output),
|
|
143
|
-
ETag: [, output.headers["etag"]],
|
|
144
|
-
ContentType: [, output.headers["content-type"]],
|
|
145
|
-
ContentLength: [
|
|
146
|
-
() => void 0 !== output.headers["content-length"],
|
|
147
|
-
() => __strictParseLong(output.headers["content-length"]),
|
|
148
|
-
],
|
|
149
|
-
CacheControl: [, output.headers["cache-control"]],
|
|
150
|
-
LastModified: [
|
|
151
|
-
() => void 0 !== output.headers["last-modified"],
|
|
152
|
-
() => __expectNonNull(__parseRfc7231DateTime(output.headers["last-modified"])),
|
|
153
|
-
],
|
|
260
|
+
}); };
|
|
261
|
+
export var deserializeAws_restJson1GetObjectCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
262
|
+
var contents, data;
|
|
263
|
+
return __generator(this, function (_a) {
|
|
264
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
265
|
+
return [2, deserializeAws_restJson1GetObjectCommandError(output, context)];
|
|
266
|
+
}
|
|
267
|
+
contents = map({
|
|
268
|
+
$metadata: deserializeMetadata(output),
|
|
269
|
+
CacheControl: [, output.headers["cache-control"]],
|
|
270
|
+
ContentRange: [, output.headers["content-range"]],
|
|
271
|
+
ContentLength: [
|
|
272
|
+
function () { return void 0 !== output.headers["content-length"]; },
|
|
273
|
+
function () { return __strictParseLong(output.headers["content-length"]); },
|
|
274
|
+
],
|
|
275
|
+
ContentType: [, output.headers["content-type"]],
|
|
276
|
+
ETag: [, output.headers["etag"]],
|
|
277
|
+
LastModified: [
|
|
278
|
+
function () { return void 0 !== output.headers["last-modified"]; },
|
|
279
|
+
function () { return __expectNonNull(__parseRfc7231DateTime(output.headers["last-modified"])); },
|
|
280
|
+
],
|
|
281
|
+
});
|
|
282
|
+
data = output.body;
|
|
283
|
+
contents.Body = data;
|
|
284
|
+
map(contents, {
|
|
285
|
+
StatusCode: [, output.statusCode],
|
|
286
|
+
});
|
|
287
|
+
return [2, contents];
|
|
154
288
|
});
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
() => void 0 !== output.headers["last-modified"],
|
|
200
|
-
() => __expectNonNull(__parseRfc7231DateTime(output.headers["last-modified"])),
|
|
201
|
-
],
|
|
289
|
+
}); };
|
|
290
|
+
var deserializeAws_restJson1GetObjectCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
291
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
292
|
+
var _c;
|
|
293
|
+
return __generator(this, function (_d) {
|
|
294
|
+
switch (_d.label) {
|
|
295
|
+
case 0:
|
|
296
|
+
_a = [__assign({}, output)];
|
|
297
|
+
_c = {};
|
|
298
|
+
return [4, parseErrorBody(output.body, context)];
|
|
299
|
+
case 1:
|
|
300
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
301
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
302
|
+
_b = errorCode;
|
|
303
|
+
switch (_b) {
|
|
304
|
+
case "ContainerNotFoundException": return [3, 2];
|
|
305
|
+
case "com.amazonaws.mediastoredata#ContainerNotFoundException": return [3, 2];
|
|
306
|
+
case "InternalServerError": return [3, 4];
|
|
307
|
+
case "com.amazonaws.mediastoredata#InternalServerError": return [3, 4];
|
|
308
|
+
case "ObjectNotFoundException": return [3, 6];
|
|
309
|
+
case "com.amazonaws.mediastoredata#ObjectNotFoundException": return [3, 6];
|
|
310
|
+
case "RequestedRangeNotSatisfiableException": return [3, 8];
|
|
311
|
+
case "com.amazonaws.mediastoredata#RequestedRangeNotSatisfiableException": return [3, 8];
|
|
312
|
+
}
|
|
313
|
+
return [3, 10];
|
|
314
|
+
case 2: return [4, deserializeAws_restJson1ContainerNotFoundExceptionResponse(parsedOutput, context)];
|
|
315
|
+
case 3: throw _d.sent();
|
|
316
|
+
case 4: return [4, deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)];
|
|
317
|
+
case 5: throw _d.sent();
|
|
318
|
+
case 6: return [4, deserializeAws_restJson1ObjectNotFoundExceptionResponse(parsedOutput, context)];
|
|
319
|
+
case 7: throw _d.sent();
|
|
320
|
+
case 8: return [4, deserializeAws_restJson1RequestedRangeNotSatisfiableExceptionResponse(parsedOutput, context)];
|
|
321
|
+
case 9: throw _d.sent();
|
|
322
|
+
case 10:
|
|
323
|
+
parsedBody = parsedOutput.body;
|
|
324
|
+
throwDefaultError({
|
|
325
|
+
output: output,
|
|
326
|
+
parsedBody: parsedBody,
|
|
327
|
+
exceptionCtor: __BaseException,
|
|
328
|
+
errorCode: errorCode,
|
|
329
|
+
});
|
|
330
|
+
_d.label = 11;
|
|
331
|
+
case 11: return [2];
|
|
332
|
+
}
|
|
202
333
|
});
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
334
|
+
}); };
|
|
335
|
+
export var deserializeAws_restJson1ListItemsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
336
|
+
var contents, data, _a, _b;
|
|
337
|
+
return __generator(this, function (_c) {
|
|
338
|
+
switch (_c.label) {
|
|
339
|
+
case 0:
|
|
340
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
341
|
+
return [2, deserializeAws_restJson1ListItemsCommandError(output, context)];
|
|
342
|
+
}
|
|
343
|
+
contents = map({
|
|
344
|
+
$metadata: deserializeMetadata(output),
|
|
345
|
+
});
|
|
346
|
+
_a = __expectNonNull;
|
|
347
|
+
_b = __expectObject;
|
|
348
|
+
return [4, parseBody(output.body, context)];
|
|
349
|
+
case 1:
|
|
350
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
351
|
+
if (data.Items != null) {
|
|
352
|
+
contents.Items = deserializeAws_restJson1ItemList(data.Items, context);
|
|
353
|
+
}
|
|
354
|
+
if (data.NextToken != null) {
|
|
355
|
+
contents.NextToken = __expectString(data.NextToken);
|
|
356
|
+
}
|
|
357
|
+
return [2, contents];
|
|
358
|
+
}
|
|
207
359
|
});
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
$metadata: deserializeMetadata(output),
|
|
360
|
+
}); };
|
|
361
|
+
var deserializeAws_restJson1ListItemsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
362
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
363
|
+
var _c;
|
|
364
|
+
return __generator(this, function (_d) {
|
|
365
|
+
switch (_d.label) {
|
|
366
|
+
case 0:
|
|
367
|
+
_a = [__assign({}, output)];
|
|
368
|
+
_c = {};
|
|
369
|
+
return [4, parseErrorBody(output.body, context)];
|
|
370
|
+
case 1:
|
|
371
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
372
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
373
|
+
_b = errorCode;
|
|
374
|
+
switch (_b) {
|
|
375
|
+
case "ContainerNotFoundException": return [3, 2];
|
|
376
|
+
case "com.amazonaws.mediastoredata#ContainerNotFoundException": return [3, 2];
|
|
377
|
+
case "InternalServerError": return [3, 4];
|
|
378
|
+
case "com.amazonaws.mediastoredata#InternalServerError": return [3, 4];
|
|
379
|
+
}
|
|
380
|
+
return [3, 6];
|
|
381
|
+
case 2: return [4, deserializeAws_restJson1ContainerNotFoundExceptionResponse(parsedOutput, context)];
|
|
382
|
+
case 3: throw _d.sent();
|
|
383
|
+
case 4: return [4, deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)];
|
|
384
|
+
case 5: throw _d.sent();
|
|
385
|
+
case 6:
|
|
386
|
+
parsedBody = parsedOutput.body;
|
|
387
|
+
throwDefaultError({
|
|
388
|
+
output: output,
|
|
389
|
+
parsedBody: parsedBody,
|
|
390
|
+
exceptionCtor: __BaseException,
|
|
391
|
+
errorCode: errorCode,
|
|
392
|
+
});
|
|
393
|
+
_d.label = 7;
|
|
394
|
+
case 7: return [2];
|
|
395
|
+
}
|
|
245
396
|
});
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
errorCode,
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
};
|
|
278
|
-
export const deserializeAws_restJson1PutObjectCommand = async (output, context) => {
|
|
279
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
280
|
-
return deserializeAws_restJson1PutObjectCommandError(output, context);
|
|
281
|
-
}
|
|
282
|
-
const contents = map({
|
|
283
|
-
$metadata: deserializeMetadata(output),
|
|
397
|
+
}); };
|
|
398
|
+
export var deserializeAws_restJson1PutObjectCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
399
|
+
var contents, data, _a, _b;
|
|
400
|
+
return __generator(this, function (_c) {
|
|
401
|
+
switch (_c.label) {
|
|
402
|
+
case 0:
|
|
403
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
404
|
+
return [2, deserializeAws_restJson1PutObjectCommandError(output, context)];
|
|
405
|
+
}
|
|
406
|
+
contents = map({
|
|
407
|
+
$metadata: deserializeMetadata(output),
|
|
408
|
+
});
|
|
409
|
+
_a = __expectNonNull;
|
|
410
|
+
_b = __expectObject;
|
|
411
|
+
return [4, parseBody(output.body, context)];
|
|
412
|
+
case 1:
|
|
413
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
414
|
+
if (data.ContentSHA256 != null) {
|
|
415
|
+
contents.ContentSHA256 = __expectString(data.ContentSHA256);
|
|
416
|
+
}
|
|
417
|
+
if (data.ETag != null) {
|
|
418
|
+
contents.ETag = __expectString(data.ETag);
|
|
419
|
+
}
|
|
420
|
+
if (data.StorageClass != null) {
|
|
421
|
+
contents.StorageClass = __expectString(data.StorageClass);
|
|
422
|
+
}
|
|
423
|
+
return [2, contents];
|
|
424
|
+
}
|
|
284
425
|
});
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
throw
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
const deserializeAws_restJson1ContainerNotFoundExceptionResponse = async (parsedOutput, context) => {
|
|
322
|
-
const contents = map({});
|
|
323
|
-
const data = parsedOutput.body;
|
|
324
|
-
if (data.Message != null) {
|
|
325
|
-
contents.Message = __expectString(data.Message);
|
|
326
|
-
}
|
|
327
|
-
const exception = new ContainerNotFoundException({
|
|
328
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
329
|
-
...contents,
|
|
426
|
+
}); };
|
|
427
|
+
var deserializeAws_restJson1PutObjectCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
428
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
429
|
+
var _c;
|
|
430
|
+
return __generator(this, function (_d) {
|
|
431
|
+
switch (_d.label) {
|
|
432
|
+
case 0:
|
|
433
|
+
_a = [__assign({}, output)];
|
|
434
|
+
_c = {};
|
|
435
|
+
return [4, parseErrorBody(output.body, context)];
|
|
436
|
+
case 1:
|
|
437
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
438
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
439
|
+
_b = errorCode;
|
|
440
|
+
switch (_b) {
|
|
441
|
+
case "ContainerNotFoundException": return [3, 2];
|
|
442
|
+
case "com.amazonaws.mediastoredata#ContainerNotFoundException": return [3, 2];
|
|
443
|
+
case "InternalServerError": return [3, 4];
|
|
444
|
+
case "com.amazonaws.mediastoredata#InternalServerError": return [3, 4];
|
|
445
|
+
}
|
|
446
|
+
return [3, 6];
|
|
447
|
+
case 2: return [4, deserializeAws_restJson1ContainerNotFoundExceptionResponse(parsedOutput, context)];
|
|
448
|
+
case 3: throw _d.sent();
|
|
449
|
+
case 4: return [4, deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)];
|
|
450
|
+
case 5: throw _d.sent();
|
|
451
|
+
case 6:
|
|
452
|
+
parsedBody = parsedOutput.body;
|
|
453
|
+
throwDefaultError({
|
|
454
|
+
output: output,
|
|
455
|
+
parsedBody: parsedBody,
|
|
456
|
+
exceptionCtor: __BaseException,
|
|
457
|
+
errorCode: errorCode,
|
|
458
|
+
});
|
|
459
|
+
_d.label = 7;
|
|
460
|
+
case 7: return [2];
|
|
461
|
+
}
|
|
330
462
|
});
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
463
|
+
}); };
|
|
464
|
+
var map = __map;
|
|
465
|
+
var deserializeAws_restJson1ContainerNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
466
|
+
var contents, data, exception;
|
|
467
|
+
return __generator(this, function (_a) {
|
|
468
|
+
contents = map({});
|
|
469
|
+
data = parsedOutput.body;
|
|
470
|
+
if (data.Message != null) {
|
|
471
|
+
contents.Message = __expectString(data.Message);
|
|
472
|
+
}
|
|
473
|
+
exception = new ContainerNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
474
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
342
475
|
});
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
353
|
-
|
|
476
|
+
}); };
|
|
477
|
+
var deserializeAws_restJson1InternalServerErrorResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
478
|
+
var contents, data, exception;
|
|
479
|
+
return __generator(this, function (_a) {
|
|
480
|
+
contents = map({});
|
|
481
|
+
data = parsedOutput.body;
|
|
482
|
+
if (data.Message != null) {
|
|
483
|
+
contents.Message = __expectString(data.Message);
|
|
484
|
+
}
|
|
485
|
+
exception = new InternalServerError(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
486
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
354
487
|
});
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
365
|
-
|
|
488
|
+
}); };
|
|
489
|
+
var deserializeAws_restJson1ObjectNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
490
|
+
var contents, data, exception;
|
|
491
|
+
return __generator(this, function (_a) {
|
|
492
|
+
contents = map({});
|
|
493
|
+
data = parsedOutput.body;
|
|
494
|
+
if (data.Message != null) {
|
|
495
|
+
contents.Message = __expectString(data.Message);
|
|
496
|
+
}
|
|
497
|
+
exception = new ObjectNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
498
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
366
499
|
});
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
500
|
+
}); };
|
|
501
|
+
var deserializeAws_restJson1RequestedRangeNotSatisfiableExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
502
|
+
var contents, data, exception;
|
|
503
|
+
return __generator(this, function (_a) {
|
|
504
|
+
contents = map({});
|
|
505
|
+
data = parsedOutput.body;
|
|
506
|
+
if (data.Message != null) {
|
|
507
|
+
contents.Message = __expectString(data.Message);
|
|
508
|
+
}
|
|
509
|
+
exception = new RequestedRangeNotSatisfiableException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
510
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
511
|
+
});
|
|
512
|
+
}); };
|
|
513
|
+
var deserializeAws_restJson1Item = function (output, context) {
|
|
370
514
|
return {
|
|
371
515
|
ContentLength: __expectLong(output.ContentLength),
|
|
372
516
|
ContentType: __expectString(output.ContentType),
|
|
@@ -378,10 +522,10 @@ const deserializeAws_restJson1Item = (output, context) => {
|
|
|
378
522
|
Type: __expectString(output.Type),
|
|
379
523
|
};
|
|
380
524
|
};
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
.filter((e)
|
|
384
|
-
.map((entry)
|
|
525
|
+
var deserializeAws_restJson1ItemList = function (output, context) {
|
|
526
|
+
var retVal = (output || [])
|
|
527
|
+
.filter(function (e) { return e != null; })
|
|
528
|
+
.map(function (entry) {
|
|
385
529
|
if (entry === null) {
|
|
386
530
|
return null;
|
|
387
531
|
}
|
|
@@ -389,39 +533,57 @@ const deserializeAws_restJson1ItemList = (output, context) => {
|
|
|
389
533
|
});
|
|
390
534
|
return retVal;
|
|
391
535
|
};
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
536
|
+
var deserializeMetadata = function (output) {
|
|
537
|
+
var _a, _b;
|
|
538
|
+
return ({
|
|
539
|
+
httpStatusCode: output.statusCode,
|
|
540
|
+
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"],
|
|
541
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
542
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
543
|
+
});
|
|
544
|
+
};
|
|
545
|
+
var collectBody = function (streamBody, context) {
|
|
546
|
+
if (streamBody === void 0) { streamBody = new Uint8Array(); }
|
|
399
547
|
if (streamBody instanceof Uint8Array) {
|
|
400
548
|
return Promise.resolve(streamBody);
|
|
401
549
|
}
|
|
402
550
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
403
551
|
};
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
value !== null &&
|
|
407
|
-
value !== "" &&
|
|
408
|
-
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
409
|
-
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
410
|
-
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
411
|
-
if (encoded.length) {
|
|
412
|
-
return JSON.parse(encoded);
|
|
413
|
-
}
|
|
414
|
-
return {};
|
|
415
|
-
});
|
|
416
|
-
const parseErrorBody = async (errorBody, context) => {
|
|
417
|
-
const value = await parseBody(errorBody, context);
|
|
418
|
-
value.message = value.message ?? value.Message;
|
|
419
|
-
return value;
|
|
552
|
+
var collectBodyString = function (streamBody, context) {
|
|
553
|
+
return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
|
|
420
554
|
};
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
555
|
+
var isSerializableHeaderValue = function (value) {
|
|
556
|
+
return value !== undefined &&
|
|
557
|
+
value !== null &&
|
|
558
|
+
value !== "" &&
|
|
559
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
560
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
561
|
+
};
|
|
562
|
+
var parseBody = function (streamBody, context) {
|
|
563
|
+
return collectBodyString(streamBody, context).then(function (encoded) {
|
|
564
|
+
if (encoded.length) {
|
|
565
|
+
return JSON.parse(encoded);
|
|
566
|
+
}
|
|
567
|
+
return {};
|
|
568
|
+
});
|
|
569
|
+
};
|
|
570
|
+
var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
571
|
+
var value;
|
|
572
|
+
var _a;
|
|
573
|
+
return __generator(this, function (_b) {
|
|
574
|
+
switch (_b.label) {
|
|
575
|
+
case 0: return [4, parseBody(errorBody, context)];
|
|
576
|
+
case 1:
|
|
577
|
+
value = _b.sent();
|
|
578
|
+
value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
|
|
579
|
+
return [2, value];
|
|
580
|
+
}
|
|
581
|
+
});
|
|
582
|
+
}); };
|
|
583
|
+
var loadRestJsonErrorCode = function (output, data) {
|
|
584
|
+
var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
|
|
585
|
+
var sanitizeErrorCode = function (rawValue) {
|
|
586
|
+
var cleanValue = rawValue;
|
|
425
587
|
if (typeof cleanValue === "number") {
|
|
426
588
|
cleanValue = cleanValue.toString();
|
|
427
589
|
}
|
|
@@ -436,7 +598,7 @@ const loadRestJsonErrorCode = (output, data) => {
|
|
|
436
598
|
}
|
|
437
599
|
return cleanValue;
|
|
438
600
|
};
|
|
439
|
-
|
|
601
|
+
var headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
440
602
|
if (headerKey !== undefined) {
|
|
441
603
|
return sanitizeErrorCode(output.headers[headerKey]);
|
|
442
604
|
}
|