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