@aws-sdk/client-mediapackage-vod 3.185.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.
Files changed (36) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist-cjs/models/models_0.js +27 -2
  3. package/dist-cjs/protocols/Aws_restJson1.js +18 -0
  4. package/dist-es/MediaPackageVod.js +70 -77
  5. package/dist-es/MediaPackageVodClient.js +22 -28
  6. package/dist-es/commands/ConfigureLogsCommand.js +21 -28
  7. package/dist-es/commands/CreateAssetCommand.js +21 -28
  8. package/dist-es/commands/CreatePackagingConfigurationCommand.js +21 -28
  9. package/dist-es/commands/CreatePackagingGroupCommand.js +21 -28
  10. package/dist-es/commands/DeleteAssetCommand.js +21 -28
  11. package/dist-es/commands/DeletePackagingConfigurationCommand.js +21 -28
  12. package/dist-es/commands/DeletePackagingGroupCommand.js +21 -28
  13. package/dist-es/commands/DescribeAssetCommand.js +21 -28
  14. package/dist-es/commands/DescribePackagingConfigurationCommand.js +21 -28
  15. package/dist-es/commands/DescribePackagingGroupCommand.js +21 -28
  16. package/dist-es/commands/ListAssetsCommand.js +21 -28
  17. package/dist-es/commands/ListPackagingConfigurationsCommand.js +21 -28
  18. package/dist-es/commands/ListPackagingGroupsCommand.js +21 -28
  19. package/dist-es/commands/ListTagsForResourceCommand.js +21 -28
  20. package/dist-es/commands/TagResourceCommand.js +22 -29
  21. package/dist-es/commands/UntagResourceCommand.js +22 -29
  22. package/dist-es/commands/UpdatePackagingGroupCommand.js +21 -28
  23. package/dist-es/endpoints.js +8 -8
  24. package/dist-es/models/MediaPackageVodServiceException.js +5 -10
  25. package/dist-es/models/models_0.js +249 -124
  26. package/dist-es/pagination/ListAssetsPaginator.js +25 -68
  27. package/dist-es/pagination/ListPackagingConfigurationsPaginator.js +25 -68
  28. package/dist-es/pagination/ListPackagingGroupsPaginator.js +25 -68
  29. package/dist-es/protocols/Aws_restJson1.js +1548 -1997
  30. package/dist-es/runtimeConfig.browser.js +26 -12
  31. package/dist-es/runtimeConfig.js +30 -12
  32. package/dist-es/runtimeConfig.native.js +8 -5
  33. package/dist-es/runtimeConfig.shared.js +8 -11
  34. package/dist-types/models/models_0.d.ts +50 -0
  35. package/dist-types/ts3.4/models/models_0.d.ts +27 -0
  36. package/package.json +33 -33
@@ -1,1970 +1,1528 @@
1
- import { __assign, __awaiter, __generator, __read } from "tslib";
2
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
2
  import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
4
3
  import { MediaPackageVodServiceException as __BaseException } from "../models/MediaPackageVodServiceException";
5
4
  import { ForbiddenException, InternalServerErrorException, NotFoundException, ServiceUnavailableException, TooManyRequestsException, UnprocessableEntityException, } from "../models/models_0";
6
- export var serializeAws_restJson1ConfigureLogsCommand = 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
- "content-type": "application/json",
15
- };
16
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/packaging_groups/{Id}/configure_logs";
17
- resolvedPath = __resolvedPath(resolvedPath, input, "Id", function () { return input.Id; }, "{Id}", false);
18
- body = JSON.stringify(__assign({}, (input.EgressAccessLogs != null && {
19
- egressAccessLogs: serializeAws_restJson1EgressAccessLogs(input.EgressAccessLogs, context),
20
- })));
21
- return [2, new __HttpRequest({
22
- protocol: protocol,
23
- hostname: hostname,
24
- port: port,
25
- method: "PUT",
26
- headers: headers,
27
- path: resolvedPath,
28
- body: body,
29
- })];
30
- }
31
- });
32
- }); };
33
- export var serializeAws_restJson1CreateAssetCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
34
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
35
- return __generator(this, function (_c) {
36
- switch (_c.label) {
37
- case 0: return [4, context.endpoint()];
38
- case 1:
39
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
40
- headers = {
41
- "content-type": "application/json",
42
- };
43
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/assets";
44
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.Id != null && { id: input.Id })), (input.PackagingGroupId != null && { packagingGroupId: input.PackagingGroupId })), (input.ResourceId != null && { resourceId: input.ResourceId })), (input.SourceArn != null && { sourceArn: input.SourceArn })), (input.SourceRoleArn != null && { sourceRoleArn: input.SourceRoleArn })), (input.Tags != null && { tags: serializeAws_restJson1Tags(input.Tags, context) })));
45
- return [2, new __HttpRequest({
46
- protocol: protocol,
47
- hostname: hostname,
48
- port: port,
49
- method: "POST",
50
- headers: headers,
51
- path: resolvedPath,
52
- body: body,
53
- })];
54
- }
55
- });
56
- }); };
57
- export var serializeAws_restJson1CreatePackagingConfigurationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
58
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
59
- return __generator(this, function (_c) {
60
- switch (_c.label) {
61
- case 0: return [4, context.endpoint()];
62
- case 1:
63
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
64
- headers = {
65
- "content-type": "application/json",
66
- };
67
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/packaging_configurations";
68
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.CmafPackage != null && { cmafPackage: serializeAws_restJson1CmafPackage(input.CmafPackage, context) })), (input.DashPackage != null && { dashPackage: serializeAws_restJson1DashPackage(input.DashPackage, context) })), (input.HlsPackage != null && { hlsPackage: serializeAws_restJson1HlsPackage(input.HlsPackage, context) })), (input.Id != null && { id: input.Id })), (input.MssPackage != null && { mssPackage: serializeAws_restJson1MssPackage(input.MssPackage, context) })), (input.PackagingGroupId != null && { packagingGroupId: input.PackagingGroupId })), (input.Tags != null && { tags: serializeAws_restJson1Tags(input.Tags, context) })));
69
- return [2, new __HttpRequest({
70
- protocol: protocol,
71
- hostname: hostname,
72
- port: port,
73
- method: "POST",
74
- headers: headers,
75
- path: resolvedPath,
76
- body: body,
77
- })];
78
- }
79
- });
80
- }); };
81
- export var serializeAws_restJson1CreatePackagingGroupCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
82
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
83
- return __generator(this, function (_c) {
84
- switch (_c.label) {
85
- case 0: return [4, context.endpoint()];
86
- case 1:
87
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
88
- headers = {
89
- "content-type": "application/json",
90
- };
91
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/packaging_groups";
92
- body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.Authorization != null && {
93
- authorization: serializeAws_restJson1Authorization(input.Authorization, context),
94
- })), (input.EgressAccessLogs != null && {
95
- egressAccessLogs: serializeAws_restJson1EgressAccessLogs(input.EgressAccessLogs, context),
96
- })), (input.Id != null && { id: input.Id })), (input.Tags != null && { tags: serializeAws_restJson1Tags(input.Tags, context) })));
97
- return [2, new __HttpRequest({
98
- protocol: protocol,
99
- hostname: hostname,
100
- port: port,
101
- method: "POST",
102
- headers: headers,
103
- path: resolvedPath,
104
- body: body,
105
- })];
106
- }
107
- });
108
- }); };
109
- export var serializeAws_restJson1DeleteAssetCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
110
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
111
- return __generator(this, function (_c) {
112
- switch (_c.label) {
113
- case 0: return [4, context.endpoint()];
114
- case 1:
115
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
116
- headers = {};
117
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/assets/{Id}";
118
- resolvedPath = __resolvedPath(resolvedPath, input, "Id", function () { return input.Id; }, "{Id}", false);
119
- return [2, new __HttpRequest({
120
- protocol: protocol,
121
- hostname: hostname,
122
- port: port,
123
- method: "DELETE",
124
- headers: headers,
125
- path: resolvedPath,
126
- body: body,
127
- })];
128
- }
129
- });
130
- }); };
131
- export var serializeAws_restJson1DeletePackagingConfigurationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
132
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
133
- return __generator(this, function (_c) {
134
- switch (_c.label) {
135
- case 0: return [4, context.endpoint()];
136
- case 1:
137
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
138
- headers = {};
139
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/packaging_configurations/{Id}";
140
- resolvedPath = __resolvedPath(resolvedPath, input, "Id", function () { return input.Id; }, "{Id}", false);
141
- return [2, new __HttpRequest({
142
- protocol: protocol,
143
- hostname: hostname,
144
- port: port,
145
- method: "DELETE",
146
- headers: headers,
147
- path: resolvedPath,
148
- body: body,
149
- })];
150
- }
151
- });
152
- }); };
153
- export var serializeAws_restJson1DeletePackagingGroupCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
154
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
155
- return __generator(this, function (_c) {
156
- switch (_c.label) {
157
- case 0: return [4, context.endpoint()];
158
- case 1:
159
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
160
- headers = {};
161
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/packaging_groups/{Id}";
162
- resolvedPath = __resolvedPath(resolvedPath, input, "Id", function () { return input.Id; }, "{Id}", false);
163
- return [2, new __HttpRequest({
164
- protocol: protocol,
165
- hostname: hostname,
166
- port: port,
167
- method: "DELETE",
168
- headers: headers,
169
- path: resolvedPath,
170
- body: body,
171
- })];
172
- }
173
- });
174
- }); };
175
- export var serializeAws_restJson1DescribeAssetCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
176
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
177
- return __generator(this, function (_c) {
178
- switch (_c.label) {
179
- case 0: return [4, context.endpoint()];
180
- case 1:
181
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
182
- headers = {};
183
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/assets/{Id}";
184
- resolvedPath = __resolvedPath(resolvedPath, input, "Id", function () { return input.Id; }, "{Id}", false);
185
- return [2, new __HttpRequest({
186
- protocol: protocol,
187
- hostname: hostname,
188
- port: port,
189
- method: "GET",
190
- headers: headers,
191
- path: resolvedPath,
192
- body: body,
193
- })];
194
- }
195
- });
196
- }); };
197
- export var serializeAws_restJson1DescribePackagingConfigurationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
198
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
199
- return __generator(this, function (_c) {
200
- switch (_c.label) {
201
- case 0: return [4, context.endpoint()];
202
- case 1:
203
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
204
- headers = {};
205
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/packaging_configurations/{Id}";
206
- resolvedPath = __resolvedPath(resolvedPath, input, "Id", function () { return input.Id; }, "{Id}", false);
207
- return [2, new __HttpRequest({
208
- protocol: protocol,
209
- hostname: hostname,
210
- port: port,
211
- method: "GET",
212
- headers: headers,
213
- path: resolvedPath,
214
- body: body,
215
- })];
216
- }
217
- });
218
- }); };
219
- export var serializeAws_restJson1DescribePackagingGroupCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
220
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
221
- return __generator(this, function (_c) {
222
- switch (_c.label) {
223
- case 0: return [4, context.endpoint()];
224
- case 1:
225
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
226
- headers = {};
227
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/packaging_groups/{Id}";
228
- resolvedPath = __resolvedPath(resolvedPath, input, "Id", function () { return input.Id; }, "{Id}", false);
229
- return [2, new __HttpRequest({
230
- protocol: protocol,
231
- hostname: hostname,
232
- port: port,
233
- method: "GET",
234
- headers: headers,
235
- path: resolvedPath,
236
- body: body,
237
- })];
238
- }
5
+ export const serializeAws_restJson1ConfigureLogsCommand = async (input, context) => {
6
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
7
+ const headers = {
8
+ "content-type": "application/json",
9
+ };
10
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/packaging_groups/{Id}/configure_logs";
11
+ resolvedPath = __resolvedPath(resolvedPath, input, "Id", () => input.Id, "{Id}", false);
12
+ let body;
13
+ body = JSON.stringify({
14
+ ...(input.EgressAccessLogs != null && {
15
+ egressAccessLogs: serializeAws_restJson1EgressAccessLogs(input.EgressAccessLogs, context),
16
+ }),
17
+ });
18
+ return new __HttpRequest({
19
+ protocol,
20
+ hostname,
21
+ port,
22
+ method: "PUT",
23
+ headers,
24
+ path: resolvedPath,
25
+ body,
239
26
  });
240
- }); };
241
- export var serializeAws_restJson1ListAssetsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
242
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
243
- return __generator(this, function (_c) {
244
- switch (_c.label) {
245
- case 0: return [4, context.endpoint()];
246
- case 1:
247
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
248
- headers = {};
249
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/assets";
250
- query = map({
251
- maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
252
- nextToken: [, input.NextToken],
253
- packagingGroupId: [, input.PackagingGroupId],
254
- });
255
- return [2, new __HttpRequest({
256
- protocol: protocol,
257
- hostname: hostname,
258
- port: port,
259
- method: "GET",
260
- headers: headers,
261
- path: resolvedPath,
262
- query: query,
263
- body: body,
264
- })];
265
- }
27
+ };
28
+ export const serializeAws_restJson1CreateAssetCommand = async (input, context) => {
29
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
30
+ const headers = {
31
+ "content-type": "application/json",
32
+ };
33
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assets";
34
+ let body;
35
+ body = JSON.stringify({
36
+ ...(input.Id != null && { id: input.Id }),
37
+ ...(input.PackagingGroupId != null && { packagingGroupId: input.PackagingGroupId }),
38
+ ...(input.ResourceId != null && { resourceId: input.ResourceId }),
39
+ ...(input.SourceArn != null && { sourceArn: input.SourceArn }),
40
+ ...(input.SourceRoleArn != null && { sourceRoleArn: input.SourceRoleArn }),
41
+ ...(input.Tags != null && { tags: serializeAws_restJson1Tags(input.Tags, context) }),
42
+ });
43
+ return new __HttpRequest({
44
+ protocol,
45
+ hostname,
46
+ port,
47
+ method: "POST",
48
+ headers,
49
+ path: resolvedPath,
50
+ body,
266
51
  });
267
- }); };
268
- export var serializeAws_restJson1ListPackagingConfigurationsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
269
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
270
- return __generator(this, function (_c) {
271
- switch (_c.label) {
272
- case 0: return [4, context.endpoint()];
273
- case 1:
274
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
275
- headers = {};
276
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/packaging_configurations";
277
- query = map({
278
- maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
279
- nextToken: [, input.NextToken],
280
- packagingGroupId: [, input.PackagingGroupId],
281
- });
282
- return [2, new __HttpRequest({
283
- protocol: protocol,
284
- hostname: hostname,
285
- port: port,
286
- method: "GET",
287
- headers: headers,
288
- path: resolvedPath,
289
- query: query,
290
- body: body,
291
- })];
292
- }
52
+ };
53
+ export const serializeAws_restJson1CreatePackagingConfigurationCommand = async (input, context) => {
54
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
55
+ const headers = {
56
+ "content-type": "application/json",
57
+ };
58
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/packaging_configurations";
59
+ let body;
60
+ body = JSON.stringify({
61
+ ...(input.CmafPackage != null && { cmafPackage: serializeAws_restJson1CmafPackage(input.CmafPackage, context) }),
62
+ ...(input.DashPackage != null && { dashPackage: serializeAws_restJson1DashPackage(input.DashPackage, context) }),
63
+ ...(input.HlsPackage != null && { hlsPackage: serializeAws_restJson1HlsPackage(input.HlsPackage, context) }),
64
+ ...(input.Id != null && { id: input.Id }),
65
+ ...(input.MssPackage != null && { mssPackage: serializeAws_restJson1MssPackage(input.MssPackage, context) }),
66
+ ...(input.PackagingGroupId != null && { packagingGroupId: input.PackagingGroupId }),
67
+ ...(input.Tags != null && { tags: serializeAws_restJson1Tags(input.Tags, context) }),
68
+ });
69
+ return new __HttpRequest({
70
+ protocol,
71
+ hostname,
72
+ port,
73
+ method: "POST",
74
+ headers,
75
+ path: resolvedPath,
76
+ body,
293
77
  });
294
- }); };
295
- export var serializeAws_restJson1ListPackagingGroupsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
296
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
297
- return __generator(this, function (_c) {
298
- switch (_c.label) {
299
- case 0: return [4, context.endpoint()];
300
- case 1:
301
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
302
- headers = {};
303
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/packaging_groups";
304
- query = map({
305
- maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
306
- nextToken: [, input.NextToken],
307
- });
308
- return [2, new __HttpRequest({
309
- protocol: protocol,
310
- hostname: hostname,
311
- port: port,
312
- method: "GET",
313
- headers: headers,
314
- path: resolvedPath,
315
- query: query,
316
- body: body,
317
- })];
318
- }
78
+ };
79
+ export const serializeAws_restJson1CreatePackagingGroupCommand = async (input, context) => {
80
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
81
+ const headers = {
82
+ "content-type": "application/json",
83
+ };
84
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/packaging_groups";
85
+ let body;
86
+ body = JSON.stringify({
87
+ ...(input.Authorization != null && {
88
+ authorization: serializeAws_restJson1Authorization(input.Authorization, context),
89
+ }),
90
+ ...(input.EgressAccessLogs != null && {
91
+ egressAccessLogs: serializeAws_restJson1EgressAccessLogs(input.EgressAccessLogs, context),
92
+ }),
93
+ ...(input.Id != null && { id: input.Id }),
94
+ ...(input.Tags != null && { tags: serializeAws_restJson1Tags(input.Tags, context) }),
95
+ });
96
+ return new __HttpRequest({
97
+ protocol,
98
+ hostname,
99
+ port,
100
+ method: "POST",
101
+ headers,
102
+ path: resolvedPath,
103
+ body,
319
104
  });
320
- }); };
321
- export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
322
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
323
- return __generator(this, function (_c) {
324
- switch (_c.label) {
325
- case 0: return [4, context.endpoint()];
326
- case 1:
327
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
328
- headers = {};
329
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
330
- resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
331
- return [2, new __HttpRequest({
332
- protocol: protocol,
333
- hostname: hostname,
334
- port: port,
335
- method: "GET",
336
- headers: headers,
337
- path: resolvedPath,
338
- body: body,
339
- })];
340
- }
105
+ };
106
+ export const serializeAws_restJson1DeleteAssetCommand = async (input, context) => {
107
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
108
+ const headers = {};
109
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assets/{Id}";
110
+ resolvedPath = __resolvedPath(resolvedPath, input, "Id", () => input.Id, "{Id}", false);
111
+ let body;
112
+ return new __HttpRequest({
113
+ protocol,
114
+ hostname,
115
+ port,
116
+ method: "DELETE",
117
+ headers,
118
+ path: resolvedPath,
119
+ body,
341
120
  });
342
- }); };
343
- export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
344
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
345
- return __generator(this, function (_c) {
346
- switch (_c.label) {
347
- case 0: return [4, context.endpoint()];
348
- case 1:
349
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
350
- headers = {
351
- "content-type": "application/json",
352
- };
353
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
354
- resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
355
- body = JSON.stringify(__assign({}, (input.Tags != null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) })));
356
- return [2, new __HttpRequest({
357
- protocol: protocol,
358
- hostname: hostname,
359
- port: port,
360
- method: "POST",
361
- headers: headers,
362
- path: resolvedPath,
363
- body: body,
364
- })];
365
- }
121
+ };
122
+ export const serializeAws_restJson1DeletePackagingConfigurationCommand = async (input, context) => {
123
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
124
+ const headers = {};
125
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/packaging_configurations/{Id}";
126
+ resolvedPath = __resolvedPath(resolvedPath, input, "Id", () => input.Id, "{Id}", false);
127
+ let body;
128
+ return new __HttpRequest({
129
+ protocol,
130
+ hostname,
131
+ port,
132
+ method: "DELETE",
133
+ headers,
134
+ path: resolvedPath,
135
+ body,
366
136
  });
367
- }); };
368
- export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
369
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
370
- return __generator(this, function (_c) {
371
- switch (_c.label) {
372
- case 0: return [4, context.endpoint()];
373
- case 1:
374
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
375
- headers = {};
376
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
377
- resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
378
- query = map({
379
- tagKeys: [function () { return input.TagKeys !== void 0; }, function () { return (input.TagKeys || []).map(function (_entry) { return _entry; }); }],
380
- });
381
- return [2, new __HttpRequest({
382
- protocol: protocol,
383
- hostname: hostname,
384
- port: port,
385
- method: "DELETE",
386
- headers: headers,
387
- path: resolvedPath,
388
- query: query,
389
- body: body,
390
- })];
391
- }
137
+ };
138
+ export const serializeAws_restJson1DeletePackagingGroupCommand = async (input, context) => {
139
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
140
+ const headers = {};
141
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/packaging_groups/{Id}";
142
+ resolvedPath = __resolvedPath(resolvedPath, input, "Id", () => input.Id, "{Id}", false);
143
+ let body;
144
+ return new __HttpRequest({
145
+ protocol,
146
+ hostname,
147
+ port,
148
+ method: "DELETE",
149
+ headers,
150
+ path: resolvedPath,
151
+ body,
392
152
  });
393
- }); };
394
- export var serializeAws_restJson1UpdatePackagingGroupCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
395
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
396
- return __generator(this, function (_c) {
397
- switch (_c.label) {
398
- case 0: return [4, context.endpoint()];
399
- case 1:
400
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
401
- headers = {
402
- "content-type": "application/json",
403
- };
404
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/packaging_groups/{Id}";
405
- resolvedPath = __resolvedPath(resolvedPath, input, "Id", function () { return input.Id; }, "{Id}", false);
406
- body = JSON.stringify(__assign({}, (input.Authorization != null && {
407
- authorization: serializeAws_restJson1Authorization(input.Authorization, context),
408
- })));
409
- return [2, new __HttpRequest({
410
- protocol: protocol,
411
- hostname: hostname,
412
- port: port,
413
- method: "PUT",
414
- headers: headers,
415
- path: resolvedPath,
416
- body: body,
417
- })];
418
- }
153
+ };
154
+ export const serializeAws_restJson1DescribeAssetCommand = async (input, context) => {
155
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
156
+ const headers = {};
157
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assets/{Id}";
158
+ resolvedPath = __resolvedPath(resolvedPath, input, "Id", () => input.Id, "{Id}", false);
159
+ let body;
160
+ return new __HttpRequest({
161
+ protocol,
162
+ hostname,
163
+ port,
164
+ method: "GET",
165
+ headers,
166
+ path: resolvedPath,
167
+ body,
419
168
  });
420
- }); };
421
- export var deserializeAws_restJson1ConfigureLogsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
422
- var contents, data, _a, _b;
423
- return __generator(this, function (_c) {
424
- switch (_c.label) {
425
- case 0:
426
- if (output.statusCode !== 200 && output.statusCode >= 300) {
427
- return [2, deserializeAws_restJson1ConfigureLogsCommandError(output, context)];
428
- }
429
- contents = map({
430
- $metadata: deserializeMetadata(output),
431
- });
432
- _a = __expectNonNull;
433
- _b = __expectObject;
434
- return [4, parseBody(output.body, context)];
435
- case 1:
436
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
437
- if (data.arn != null) {
438
- contents.Arn = __expectString(data.arn);
439
- }
440
- if (data.authorization != null) {
441
- contents.Authorization = deserializeAws_restJson1Authorization(data.authorization, context);
442
- }
443
- if (data.domainName != null) {
444
- contents.DomainName = __expectString(data.domainName);
445
- }
446
- if (data.egressAccessLogs != null) {
447
- contents.EgressAccessLogs = deserializeAws_restJson1EgressAccessLogs(data.egressAccessLogs, context);
448
- }
449
- if (data.id != null) {
450
- contents.Id = __expectString(data.id);
451
- }
452
- if (data.tags != null) {
453
- contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
454
- }
455
- return [2, contents];
456
- }
169
+ };
170
+ export const serializeAws_restJson1DescribePackagingConfigurationCommand = async (input, context) => {
171
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
172
+ const headers = {};
173
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/packaging_configurations/{Id}";
174
+ resolvedPath = __resolvedPath(resolvedPath, input, "Id", () => input.Id, "{Id}", false);
175
+ let body;
176
+ return new __HttpRequest({
177
+ protocol,
178
+ hostname,
179
+ port,
180
+ method: "GET",
181
+ headers,
182
+ path: resolvedPath,
183
+ body,
457
184
  });
458
- }); };
459
- var deserializeAws_restJson1ConfigureLogsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
460
- var parsedOutput, _a, errorCode, _b, parsedBody;
461
- var _c;
462
- return __generator(this, function (_d) {
463
- switch (_d.label) {
464
- case 0:
465
- _a = [__assign({}, output)];
466
- _c = {};
467
- return [4, parseErrorBody(output.body, context)];
468
- case 1:
469
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
470
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
471
- _b = errorCode;
472
- switch (_b) {
473
- case "ForbiddenException": return [3, 2];
474
- case "com.amazonaws.mediapackagevod#ForbiddenException": return [3, 2];
475
- case "InternalServerErrorException": return [3, 4];
476
- case "com.amazonaws.mediapackagevod#InternalServerErrorException": return [3, 4];
477
- case "NotFoundException": return [3, 6];
478
- case "com.amazonaws.mediapackagevod#NotFoundException": return [3, 6];
479
- case "ServiceUnavailableException": return [3, 8];
480
- case "com.amazonaws.mediapackagevod#ServiceUnavailableException": return [3, 8];
481
- case "TooManyRequestsException": return [3, 10];
482
- case "com.amazonaws.mediapackagevod#TooManyRequestsException": return [3, 10];
483
- case "UnprocessableEntityException": return [3, 12];
484
- case "com.amazonaws.mediapackagevod#UnprocessableEntityException": return [3, 12];
485
- }
486
- return [3, 14];
487
- case 2: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
488
- case 3: throw _d.sent();
489
- case 4: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
490
- case 5: throw _d.sent();
491
- case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
492
- case 7: throw _d.sent();
493
- case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
494
- case 9: throw _d.sent();
495
- case 10: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
496
- case 11: throw _d.sent();
497
- case 12: return [4, deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context)];
498
- case 13: throw _d.sent();
499
- case 14:
500
- parsedBody = parsedOutput.body;
501
- throwDefaultError({
502
- output: output,
503
- parsedBody: parsedBody,
504
- exceptionCtor: __BaseException,
505
- errorCode: errorCode,
506
- });
507
- _d.label = 15;
508
- case 15: return [2];
509
- }
185
+ };
186
+ export const serializeAws_restJson1DescribePackagingGroupCommand = async (input, context) => {
187
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
188
+ const headers = {};
189
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/packaging_groups/{Id}";
190
+ resolvedPath = __resolvedPath(resolvedPath, input, "Id", () => input.Id, "{Id}", false);
191
+ let body;
192
+ return new __HttpRequest({
193
+ protocol,
194
+ hostname,
195
+ port,
196
+ method: "GET",
197
+ headers,
198
+ path: resolvedPath,
199
+ body,
510
200
  });
511
- }); };
512
- export var deserializeAws_restJson1CreateAssetCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
513
- var contents, data, _a, _b;
514
- return __generator(this, function (_c) {
515
- switch (_c.label) {
516
- case 0:
517
- if (output.statusCode !== 200 && output.statusCode >= 300) {
518
- return [2, deserializeAws_restJson1CreateAssetCommandError(output, context)];
519
- }
520
- contents = map({
521
- $metadata: deserializeMetadata(output),
522
- });
523
- _a = __expectNonNull;
524
- _b = __expectObject;
525
- return [4, parseBody(output.body, context)];
526
- case 1:
527
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
528
- if (data.arn != null) {
529
- contents.Arn = __expectString(data.arn);
530
- }
531
- if (data.createdAt != null) {
532
- contents.CreatedAt = __expectString(data.createdAt);
533
- }
534
- if (data.egressEndpoints != null) {
535
- contents.EgressEndpoints = deserializeAws_restJson1__listOfEgressEndpoint(data.egressEndpoints, context);
536
- }
537
- if (data.id != null) {
538
- contents.Id = __expectString(data.id);
539
- }
540
- if (data.packagingGroupId != null) {
541
- contents.PackagingGroupId = __expectString(data.packagingGroupId);
542
- }
543
- if (data.resourceId != null) {
544
- contents.ResourceId = __expectString(data.resourceId);
545
- }
546
- if (data.sourceArn != null) {
547
- contents.SourceArn = __expectString(data.sourceArn);
548
- }
549
- if (data.sourceRoleArn != null) {
550
- contents.SourceRoleArn = __expectString(data.sourceRoleArn);
551
- }
552
- if (data.tags != null) {
553
- contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
554
- }
555
- return [2, contents];
556
- }
201
+ };
202
+ export const serializeAws_restJson1ListAssetsCommand = async (input, context) => {
203
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
204
+ const headers = {};
205
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assets";
206
+ const query = map({
207
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
208
+ nextToken: [, input.NextToken],
209
+ packagingGroupId: [, input.PackagingGroupId],
210
+ });
211
+ let body;
212
+ return new __HttpRequest({
213
+ protocol,
214
+ hostname,
215
+ port,
216
+ method: "GET",
217
+ headers,
218
+ path: resolvedPath,
219
+ query,
220
+ body,
557
221
  });
558
- }); };
559
- var deserializeAws_restJson1CreateAssetCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
560
- var parsedOutput, _a, errorCode, _b, parsedBody;
561
- var _c;
562
- return __generator(this, function (_d) {
563
- switch (_d.label) {
564
- case 0:
565
- _a = [__assign({}, output)];
566
- _c = {};
567
- return [4, parseErrorBody(output.body, context)];
568
- case 1:
569
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
570
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
571
- _b = errorCode;
572
- switch (_b) {
573
- case "ForbiddenException": return [3, 2];
574
- case "com.amazonaws.mediapackagevod#ForbiddenException": return [3, 2];
575
- case "InternalServerErrorException": return [3, 4];
576
- case "com.amazonaws.mediapackagevod#InternalServerErrorException": return [3, 4];
577
- case "NotFoundException": return [3, 6];
578
- case "com.amazonaws.mediapackagevod#NotFoundException": return [3, 6];
579
- case "ServiceUnavailableException": return [3, 8];
580
- case "com.amazonaws.mediapackagevod#ServiceUnavailableException": return [3, 8];
581
- case "TooManyRequestsException": return [3, 10];
582
- case "com.amazonaws.mediapackagevod#TooManyRequestsException": return [3, 10];
583
- case "UnprocessableEntityException": return [3, 12];
584
- case "com.amazonaws.mediapackagevod#UnprocessableEntityException": return [3, 12];
585
- }
586
- return [3, 14];
587
- case 2: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
588
- case 3: throw _d.sent();
589
- case 4: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
590
- case 5: throw _d.sent();
591
- case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
592
- case 7: throw _d.sent();
593
- case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
594
- case 9: throw _d.sent();
595
- case 10: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
596
- case 11: throw _d.sent();
597
- case 12: return [4, deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context)];
598
- case 13: throw _d.sent();
599
- case 14:
600
- parsedBody = parsedOutput.body;
601
- throwDefaultError({
602
- output: output,
603
- parsedBody: parsedBody,
604
- exceptionCtor: __BaseException,
605
- errorCode: errorCode,
606
- });
607
- _d.label = 15;
608
- case 15: return [2];
609
- }
222
+ };
223
+ export const serializeAws_restJson1ListPackagingConfigurationsCommand = async (input, context) => {
224
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
225
+ const headers = {};
226
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/packaging_configurations";
227
+ const query = map({
228
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
229
+ nextToken: [, input.NextToken],
230
+ packagingGroupId: [, input.PackagingGroupId],
231
+ });
232
+ let body;
233
+ return new __HttpRequest({
234
+ protocol,
235
+ hostname,
236
+ port,
237
+ method: "GET",
238
+ headers,
239
+ path: resolvedPath,
240
+ query,
241
+ body,
610
242
  });
611
- }); };
612
- export var deserializeAws_restJson1CreatePackagingConfigurationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
613
- var contents, data, _a, _b;
614
- return __generator(this, function (_c) {
615
- switch (_c.label) {
616
- case 0:
617
- if (output.statusCode !== 200 && output.statusCode >= 300) {
618
- return [2, deserializeAws_restJson1CreatePackagingConfigurationCommandError(output, context)];
619
- }
620
- contents = map({
621
- $metadata: deserializeMetadata(output),
622
- });
623
- _a = __expectNonNull;
624
- _b = __expectObject;
625
- return [4, parseBody(output.body, context)];
626
- case 1:
627
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
628
- if (data.arn != null) {
629
- contents.Arn = __expectString(data.arn);
630
- }
631
- if (data.cmafPackage != null) {
632
- contents.CmafPackage = deserializeAws_restJson1CmafPackage(data.cmafPackage, context);
633
- }
634
- if (data.dashPackage != null) {
635
- contents.DashPackage = deserializeAws_restJson1DashPackage(data.dashPackage, context);
636
- }
637
- if (data.hlsPackage != null) {
638
- contents.HlsPackage = deserializeAws_restJson1HlsPackage(data.hlsPackage, context);
639
- }
640
- if (data.id != null) {
641
- contents.Id = __expectString(data.id);
642
- }
643
- if (data.mssPackage != null) {
644
- contents.MssPackage = deserializeAws_restJson1MssPackage(data.mssPackage, context);
645
- }
646
- if (data.packagingGroupId != null) {
647
- contents.PackagingGroupId = __expectString(data.packagingGroupId);
648
- }
649
- if (data.tags != null) {
650
- contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
651
- }
652
- return [2, contents];
653
- }
243
+ };
244
+ export const serializeAws_restJson1ListPackagingGroupsCommand = async (input, context) => {
245
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
246
+ const headers = {};
247
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/packaging_groups";
248
+ const query = map({
249
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
250
+ nextToken: [, input.NextToken],
251
+ });
252
+ let body;
253
+ return new __HttpRequest({
254
+ protocol,
255
+ hostname,
256
+ port,
257
+ method: "GET",
258
+ headers,
259
+ path: resolvedPath,
260
+ query,
261
+ body,
654
262
  });
655
- }); };
656
- var deserializeAws_restJson1CreatePackagingConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
657
- var parsedOutput, _a, errorCode, _b, parsedBody;
658
- var _c;
659
- return __generator(this, function (_d) {
660
- switch (_d.label) {
661
- case 0:
662
- _a = [__assign({}, output)];
663
- _c = {};
664
- return [4, parseErrorBody(output.body, context)];
665
- case 1:
666
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
667
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
668
- _b = errorCode;
669
- switch (_b) {
670
- case "ForbiddenException": return [3, 2];
671
- case "com.amazonaws.mediapackagevod#ForbiddenException": return [3, 2];
672
- case "InternalServerErrorException": return [3, 4];
673
- case "com.amazonaws.mediapackagevod#InternalServerErrorException": return [3, 4];
674
- case "NotFoundException": return [3, 6];
675
- case "com.amazonaws.mediapackagevod#NotFoundException": return [3, 6];
676
- case "ServiceUnavailableException": return [3, 8];
677
- case "com.amazonaws.mediapackagevod#ServiceUnavailableException": return [3, 8];
678
- case "TooManyRequestsException": return [3, 10];
679
- case "com.amazonaws.mediapackagevod#TooManyRequestsException": return [3, 10];
680
- case "UnprocessableEntityException": return [3, 12];
681
- case "com.amazonaws.mediapackagevod#UnprocessableEntityException": return [3, 12];
682
- }
683
- return [3, 14];
684
- case 2: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
685
- case 3: throw _d.sent();
686
- case 4: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
687
- case 5: throw _d.sent();
688
- case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
689
- case 7: throw _d.sent();
690
- case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
691
- case 9: throw _d.sent();
692
- case 10: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
693
- case 11: throw _d.sent();
694
- case 12: return [4, deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context)];
695
- case 13: throw _d.sent();
696
- case 14:
697
- parsedBody = parsedOutput.body;
698
- throwDefaultError({
699
- output: output,
700
- parsedBody: parsedBody,
701
- exceptionCtor: __BaseException,
702
- errorCode: errorCode,
703
- });
704
- _d.label = 15;
705
- case 15: return [2];
706
- }
263
+ };
264
+ export const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
265
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
266
+ const headers = {};
267
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
268
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
269
+ let body;
270
+ return new __HttpRequest({
271
+ protocol,
272
+ hostname,
273
+ port,
274
+ method: "GET",
275
+ headers,
276
+ path: resolvedPath,
277
+ body,
707
278
  });
708
- }); };
709
- export var deserializeAws_restJson1CreatePackagingGroupCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
710
- var contents, data, _a, _b;
711
- return __generator(this, function (_c) {
712
- switch (_c.label) {
713
- case 0:
714
- if (output.statusCode !== 200 && output.statusCode >= 300) {
715
- return [2, deserializeAws_restJson1CreatePackagingGroupCommandError(output, context)];
716
- }
717
- contents = map({
718
- $metadata: deserializeMetadata(output),
719
- });
720
- _a = __expectNonNull;
721
- _b = __expectObject;
722
- return [4, parseBody(output.body, context)];
723
- case 1:
724
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
725
- if (data.arn != null) {
726
- contents.Arn = __expectString(data.arn);
727
- }
728
- if (data.authorization != null) {
729
- contents.Authorization = deserializeAws_restJson1Authorization(data.authorization, context);
730
- }
731
- if (data.domainName != null) {
732
- contents.DomainName = __expectString(data.domainName);
733
- }
734
- if (data.egressAccessLogs != null) {
735
- contents.EgressAccessLogs = deserializeAws_restJson1EgressAccessLogs(data.egressAccessLogs, context);
736
- }
737
- if (data.id != null) {
738
- contents.Id = __expectString(data.id);
739
- }
740
- if (data.tags != null) {
741
- contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
742
- }
743
- return [2, contents];
744
- }
279
+ };
280
+ export const serializeAws_restJson1TagResourceCommand = async (input, context) => {
281
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
282
+ const headers = {
283
+ "content-type": "application/json",
284
+ };
285
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
286
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
287
+ let body;
288
+ body = JSON.stringify({
289
+ ...(input.Tags != null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) }),
290
+ });
291
+ return new __HttpRequest({
292
+ protocol,
293
+ hostname,
294
+ port,
295
+ method: "POST",
296
+ headers,
297
+ path: resolvedPath,
298
+ body,
745
299
  });
746
- }); };
747
- var deserializeAws_restJson1CreatePackagingGroupCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
748
- var parsedOutput, _a, errorCode, _b, parsedBody;
749
- var _c;
750
- return __generator(this, function (_d) {
751
- switch (_d.label) {
752
- case 0:
753
- _a = [__assign({}, output)];
754
- _c = {};
755
- return [4, parseErrorBody(output.body, context)];
756
- case 1:
757
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
758
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
759
- _b = errorCode;
760
- switch (_b) {
761
- case "ForbiddenException": return [3, 2];
762
- case "com.amazonaws.mediapackagevod#ForbiddenException": return [3, 2];
763
- case "InternalServerErrorException": return [3, 4];
764
- case "com.amazonaws.mediapackagevod#InternalServerErrorException": return [3, 4];
765
- case "NotFoundException": return [3, 6];
766
- case "com.amazonaws.mediapackagevod#NotFoundException": return [3, 6];
767
- case "ServiceUnavailableException": return [3, 8];
768
- case "com.amazonaws.mediapackagevod#ServiceUnavailableException": return [3, 8];
769
- case "TooManyRequestsException": return [3, 10];
770
- case "com.amazonaws.mediapackagevod#TooManyRequestsException": return [3, 10];
771
- case "UnprocessableEntityException": return [3, 12];
772
- case "com.amazonaws.mediapackagevod#UnprocessableEntityException": return [3, 12];
773
- }
774
- return [3, 14];
775
- case 2: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
776
- case 3: throw _d.sent();
777
- case 4: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
778
- case 5: throw _d.sent();
779
- case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
780
- case 7: throw _d.sent();
781
- case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
782
- case 9: throw _d.sent();
783
- case 10: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
784
- case 11: throw _d.sent();
785
- case 12: return [4, deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context)];
786
- case 13: throw _d.sent();
787
- case 14:
788
- parsedBody = parsedOutput.body;
789
- throwDefaultError({
790
- output: output,
791
- parsedBody: parsedBody,
792
- exceptionCtor: __BaseException,
793
- errorCode: errorCode,
794
- });
795
- _d.label = 15;
796
- case 15: return [2];
797
- }
300
+ };
301
+ export const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
302
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
303
+ const headers = {};
304
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
305
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
306
+ const query = map({
307
+ tagKeys: [() => input.TagKeys !== void 0, () => (input.TagKeys || []).map((_entry) => _entry)],
308
+ });
309
+ let body;
310
+ return new __HttpRequest({
311
+ protocol,
312
+ hostname,
313
+ port,
314
+ method: "DELETE",
315
+ headers,
316
+ path: resolvedPath,
317
+ query,
318
+ body,
798
319
  });
799
- }); };
800
- export var deserializeAws_restJson1DeleteAssetCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
801
- var contents;
802
- return __generator(this, function (_a) {
803
- switch (_a.label) {
804
- case 0:
805
- if (output.statusCode !== 202 && output.statusCode >= 300) {
806
- return [2, deserializeAws_restJson1DeleteAssetCommandError(output, context)];
807
- }
808
- contents = map({
809
- $metadata: deserializeMetadata(output),
810
- });
811
- return [4, collectBody(output.body, context)];
812
- case 1:
813
- _a.sent();
814
- return [2, contents];
815
- }
320
+ };
321
+ export const serializeAws_restJson1UpdatePackagingGroupCommand = async (input, context) => {
322
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
323
+ const headers = {
324
+ "content-type": "application/json",
325
+ };
326
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/packaging_groups/{Id}";
327
+ resolvedPath = __resolvedPath(resolvedPath, input, "Id", () => input.Id, "{Id}", false);
328
+ let body;
329
+ body = JSON.stringify({
330
+ ...(input.Authorization != null && {
331
+ authorization: serializeAws_restJson1Authorization(input.Authorization, context),
332
+ }),
333
+ });
334
+ return new __HttpRequest({
335
+ protocol,
336
+ hostname,
337
+ port,
338
+ method: "PUT",
339
+ headers,
340
+ path: resolvedPath,
341
+ body,
816
342
  });
817
- }); };
818
- var deserializeAws_restJson1DeleteAssetCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
819
- var parsedOutput, _a, errorCode, _b, parsedBody;
820
- var _c;
821
- return __generator(this, function (_d) {
822
- switch (_d.label) {
823
- case 0:
824
- _a = [__assign({}, output)];
825
- _c = {};
826
- return [4, parseErrorBody(output.body, context)];
827
- case 1:
828
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
829
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
830
- _b = errorCode;
831
- switch (_b) {
832
- case "ForbiddenException": return [3, 2];
833
- case "com.amazonaws.mediapackagevod#ForbiddenException": return [3, 2];
834
- case "InternalServerErrorException": return [3, 4];
835
- case "com.amazonaws.mediapackagevod#InternalServerErrorException": return [3, 4];
836
- case "NotFoundException": return [3, 6];
837
- case "com.amazonaws.mediapackagevod#NotFoundException": return [3, 6];
838
- case "ServiceUnavailableException": return [3, 8];
839
- case "com.amazonaws.mediapackagevod#ServiceUnavailableException": return [3, 8];
840
- case "TooManyRequestsException": return [3, 10];
841
- case "com.amazonaws.mediapackagevod#TooManyRequestsException": return [3, 10];
842
- case "UnprocessableEntityException": return [3, 12];
843
- case "com.amazonaws.mediapackagevod#UnprocessableEntityException": return [3, 12];
844
- }
845
- return [3, 14];
846
- case 2: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
847
- case 3: throw _d.sent();
848
- case 4: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
849
- case 5: throw _d.sent();
850
- case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
851
- case 7: throw _d.sent();
852
- case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
853
- case 9: throw _d.sent();
854
- case 10: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
855
- case 11: throw _d.sent();
856
- case 12: return [4, deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context)];
857
- case 13: throw _d.sent();
858
- case 14:
859
- parsedBody = parsedOutput.body;
860
- throwDefaultError({
861
- output: output,
862
- parsedBody: parsedBody,
863
- exceptionCtor: __BaseException,
864
- errorCode: errorCode,
865
- });
866
- _d.label = 15;
867
- case 15: return [2];
868
- }
343
+ };
344
+ export const deserializeAws_restJson1ConfigureLogsCommand = async (output, context) => {
345
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
346
+ return deserializeAws_restJson1ConfigureLogsCommandError(output, context);
347
+ }
348
+ const contents = map({
349
+ $metadata: deserializeMetadata(output),
869
350
  });
870
- }); };
871
- export var deserializeAws_restJson1DeletePackagingConfigurationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
872
- var contents;
873
- return __generator(this, function (_a) {
874
- switch (_a.label) {
875
- case 0:
876
- if (output.statusCode !== 202 && output.statusCode >= 300) {
877
- return [2, deserializeAws_restJson1DeletePackagingConfigurationCommandError(output, context)];
878
- }
879
- contents = map({
880
- $metadata: deserializeMetadata(output),
881
- });
882
- return [4, collectBody(output.body, context)];
883
- case 1:
884
- _a.sent();
885
- return [2, contents];
886
- }
351
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
352
+ if (data.arn != null) {
353
+ contents.Arn = __expectString(data.arn);
354
+ }
355
+ if (data.authorization != null) {
356
+ contents.Authorization = deserializeAws_restJson1Authorization(data.authorization, context);
357
+ }
358
+ if (data.domainName != null) {
359
+ contents.DomainName = __expectString(data.domainName);
360
+ }
361
+ if (data.egressAccessLogs != null) {
362
+ contents.EgressAccessLogs = deserializeAws_restJson1EgressAccessLogs(data.egressAccessLogs, context);
363
+ }
364
+ if (data.id != null) {
365
+ contents.Id = __expectString(data.id);
366
+ }
367
+ if (data.tags != null) {
368
+ contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
369
+ }
370
+ return contents;
371
+ };
372
+ const deserializeAws_restJson1ConfigureLogsCommandError = async (output, context) => {
373
+ const parsedOutput = {
374
+ ...output,
375
+ body: await parseErrorBody(output.body, context),
376
+ };
377
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
378
+ switch (errorCode) {
379
+ case "ForbiddenException":
380
+ case "com.amazonaws.mediapackagevod#ForbiddenException":
381
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
382
+ case "InternalServerErrorException":
383
+ case "com.amazonaws.mediapackagevod#InternalServerErrorException":
384
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
385
+ case "NotFoundException":
386
+ case "com.amazonaws.mediapackagevod#NotFoundException":
387
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
388
+ case "ServiceUnavailableException":
389
+ case "com.amazonaws.mediapackagevod#ServiceUnavailableException":
390
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
391
+ case "TooManyRequestsException":
392
+ case "com.amazonaws.mediapackagevod#TooManyRequestsException":
393
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
394
+ case "UnprocessableEntityException":
395
+ case "com.amazonaws.mediapackagevod#UnprocessableEntityException":
396
+ throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
397
+ default:
398
+ const parsedBody = parsedOutput.body;
399
+ throwDefaultError({
400
+ output,
401
+ parsedBody,
402
+ exceptionCtor: __BaseException,
403
+ errorCode,
404
+ });
405
+ }
406
+ };
407
+ export const deserializeAws_restJson1CreateAssetCommand = async (output, context) => {
408
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
409
+ return deserializeAws_restJson1CreateAssetCommandError(output, context);
410
+ }
411
+ const contents = map({
412
+ $metadata: deserializeMetadata(output),
887
413
  });
888
- }); };
889
- var deserializeAws_restJson1DeletePackagingConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
890
- var parsedOutput, _a, errorCode, _b, parsedBody;
891
- var _c;
892
- return __generator(this, function (_d) {
893
- switch (_d.label) {
894
- case 0:
895
- _a = [__assign({}, output)];
896
- _c = {};
897
- return [4, parseErrorBody(output.body, context)];
898
- case 1:
899
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
900
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
901
- _b = errorCode;
902
- switch (_b) {
903
- case "ForbiddenException": return [3, 2];
904
- case "com.amazonaws.mediapackagevod#ForbiddenException": return [3, 2];
905
- case "InternalServerErrorException": return [3, 4];
906
- case "com.amazonaws.mediapackagevod#InternalServerErrorException": return [3, 4];
907
- case "NotFoundException": return [3, 6];
908
- case "com.amazonaws.mediapackagevod#NotFoundException": return [3, 6];
909
- case "ServiceUnavailableException": return [3, 8];
910
- case "com.amazonaws.mediapackagevod#ServiceUnavailableException": return [3, 8];
911
- case "TooManyRequestsException": return [3, 10];
912
- case "com.amazonaws.mediapackagevod#TooManyRequestsException": return [3, 10];
913
- case "UnprocessableEntityException": return [3, 12];
914
- case "com.amazonaws.mediapackagevod#UnprocessableEntityException": return [3, 12];
915
- }
916
- return [3, 14];
917
- case 2: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
918
- case 3: throw _d.sent();
919
- case 4: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
920
- case 5: throw _d.sent();
921
- case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
922
- case 7: throw _d.sent();
923
- case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
924
- case 9: throw _d.sent();
925
- case 10: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
926
- case 11: throw _d.sent();
927
- case 12: return [4, deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context)];
928
- case 13: throw _d.sent();
929
- case 14:
930
- parsedBody = parsedOutput.body;
931
- throwDefaultError({
932
- output: output,
933
- parsedBody: parsedBody,
934
- exceptionCtor: __BaseException,
935
- errorCode: errorCode,
936
- });
937
- _d.label = 15;
938
- case 15: return [2];
939
- }
414
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
415
+ if (data.arn != null) {
416
+ contents.Arn = __expectString(data.arn);
417
+ }
418
+ if (data.createdAt != null) {
419
+ contents.CreatedAt = __expectString(data.createdAt);
420
+ }
421
+ if (data.egressEndpoints != null) {
422
+ contents.EgressEndpoints = deserializeAws_restJson1__listOfEgressEndpoint(data.egressEndpoints, context);
423
+ }
424
+ if (data.id != null) {
425
+ contents.Id = __expectString(data.id);
426
+ }
427
+ if (data.packagingGroupId != null) {
428
+ contents.PackagingGroupId = __expectString(data.packagingGroupId);
429
+ }
430
+ if (data.resourceId != null) {
431
+ contents.ResourceId = __expectString(data.resourceId);
432
+ }
433
+ if (data.sourceArn != null) {
434
+ contents.SourceArn = __expectString(data.sourceArn);
435
+ }
436
+ if (data.sourceRoleArn != null) {
437
+ contents.SourceRoleArn = __expectString(data.sourceRoleArn);
438
+ }
439
+ if (data.tags != null) {
440
+ contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
441
+ }
442
+ return contents;
443
+ };
444
+ const deserializeAws_restJson1CreateAssetCommandError = async (output, context) => {
445
+ const parsedOutput = {
446
+ ...output,
447
+ body: await parseErrorBody(output.body, context),
448
+ };
449
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
450
+ switch (errorCode) {
451
+ case "ForbiddenException":
452
+ case "com.amazonaws.mediapackagevod#ForbiddenException":
453
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
454
+ case "InternalServerErrorException":
455
+ case "com.amazonaws.mediapackagevod#InternalServerErrorException":
456
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
457
+ case "NotFoundException":
458
+ case "com.amazonaws.mediapackagevod#NotFoundException":
459
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
460
+ case "ServiceUnavailableException":
461
+ case "com.amazonaws.mediapackagevod#ServiceUnavailableException":
462
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
463
+ case "TooManyRequestsException":
464
+ case "com.amazonaws.mediapackagevod#TooManyRequestsException":
465
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
466
+ case "UnprocessableEntityException":
467
+ case "com.amazonaws.mediapackagevod#UnprocessableEntityException":
468
+ throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
469
+ default:
470
+ const parsedBody = parsedOutput.body;
471
+ throwDefaultError({
472
+ output,
473
+ parsedBody,
474
+ exceptionCtor: __BaseException,
475
+ errorCode,
476
+ });
477
+ }
478
+ };
479
+ export const deserializeAws_restJson1CreatePackagingConfigurationCommand = async (output, context) => {
480
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
481
+ return deserializeAws_restJson1CreatePackagingConfigurationCommandError(output, context);
482
+ }
483
+ const contents = map({
484
+ $metadata: deserializeMetadata(output),
940
485
  });
941
- }); };
942
- export var deserializeAws_restJson1DeletePackagingGroupCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
943
- var contents;
944
- return __generator(this, function (_a) {
945
- switch (_a.label) {
946
- case 0:
947
- if (output.statusCode !== 202 && output.statusCode >= 300) {
948
- return [2, deserializeAws_restJson1DeletePackagingGroupCommandError(output, context)];
949
- }
950
- contents = map({
951
- $metadata: deserializeMetadata(output),
952
- });
953
- return [4, collectBody(output.body, context)];
954
- case 1:
955
- _a.sent();
956
- return [2, contents];
957
- }
486
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
487
+ if (data.arn != null) {
488
+ contents.Arn = __expectString(data.arn);
489
+ }
490
+ if (data.cmafPackage != null) {
491
+ contents.CmafPackage = deserializeAws_restJson1CmafPackage(data.cmafPackage, context);
492
+ }
493
+ if (data.dashPackage != null) {
494
+ contents.DashPackage = deserializeAws_restJson1DashPackage(data.dashPackage, context);
495
+ }
496
+ if (data.hlsPackage != null) {
497
+ contents.HlsPackage = deserializeAws_restJson1HlsPackage(data.hlsPackage, context);
498
+ }
499
+ if (data.id != null) {
500
+ contents.Id = __expectString(data.id);
501
+ }
502
+ if (data.mssPackage != null) {
503
+ contents.MssPackage = deserializeAws_restJson1MssPackage(data.mssPackage, context);
504
+ }
505
+ if (data.packagingGroupId != null) {
506
+ contents.PackagingGroupId = __expectString(data.packagingGroupId);
507
+ }
508
+ if (data.tags != null) {
509
+ contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
510
+ }
511
+ return contents;
512
+ };
513
+ const deserializeAws_restJson1CreatePackagingConfigurationCommandError = async (output, context) => {
514
+ const parsedOutput = {
515
+ ...output,
516
+ body: await parseErrorBody(output.body, context),
517
+ };
518
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
519
+ switch (errorCode) {
520
+ case "ForbiddenException":
521
+ case "com.amazonaws.mediapackagevod#ForbiddenException":
522
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
523
+ case "InternalServerErrorException":
524
+ case "com.amazonaws.mediapackagevod#InternalServerErrorException":
525
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
526
+ case "NotFoundException":
527
+ case "com.amazonaws.mediapackagevod#NotFoundException":
528
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
529
+ case "ServiceUnavailableException":
530
+ case "com.amazonaws.mediapackagevod#ServiceUnavailableException":
531
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
532
+ case "TooManyRequestsException":
533
+ case "com.amazonaws.mediapackagevod#TooManyRequestsException":
534
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
535
+ case "UnprocessableEntityException":
536
+ case "com.amazonaws.mediapackagevod#UnprocessableEntityException":
537
+ throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
538
+ default:
539
+ const parsedBody = parsedOutput.body;
540
+ throwDefaultError({
541
+ output,
542
+ parsedBody,
543
+ exceptionCtor: __BaseException,
544
+ errorCode,
545
+ });
546
+ }
547
+ };
548
+ export const deserializeAws_restJson1CreatePackagingGroupCommand = async (output, context) => {
549
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
550
+ return deserializeAws_restJson1CreatePackagingGroupCommandError(output, context);
551
+ }
552
+ const contents = map({
553
+ $metadata: deserializeMetadata(output),
958
554
  });
959
- }); };
960
- var deserializeAws_restJson1DeletePackagingGroupCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
961
- var parsedOutput, _a, errorCode, _b, parsedBody;
962
- var _c;
963
- return __generator(this, function (_d) {
964
- switch (_d.label) {
965
- case 0:
966
- _a = [__assign({}, output)];
967
- _c = {};
968
- return [4, parseErrorBody(output.body, context)];
969
- case 1:
970
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
971
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
972
- _b = errorCode;
973
- switch (_b) {
974
- case "ForbiddenException": return [3, 2];
975
- case "com.amazonaws.mediapackagevod#ForbiddenException": return [3, 2];
976
- case "InternalServerErrorException": return [3, 4];
977
- case "com.amazonaws.mediapackagevod#InternalServerErrorException": return [3, 4];
978
- case "NotFoundException": return [3, 6];
979
- case "com.amazonaws.mediapackagevod#NotFoundException": return [3, 6];
980
- case "ServiceUnavailableException": return [3, 8];
981
- case "com.amazonaws.mediapackagevod#ServiceUnavailableException": return [3, 8];
982
- case "TooManyRequestsException": return [3, 10];
983
- case "com.amazonaws.mediapackagevod#TooManyRequestsException": return [3, 10];
984
- case "UnprocessableEntityException": return [3, 12];
985
- case "com.amazonaws.mediapackagevod#UnprocessableEntityException": return [3, 12];
986
- }
987
- return [3, 14];
988
- case 2: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
989
- case 3: throw _d.sent();
990
- case 4: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
991
- case 5: throw _d.sent();
992
- case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
993
- case 7: throw _d.sent();
994
- case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
995
- case 9: throw _d.sent();
996
- case 10: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
997
- case 11: throw _d.sent();
998
- case 12: return [4, deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context)];
999
- case 13: throw _d.sent();
1000
- case 14:
1001
- parsedBody = parsedOutput.body;
1002
- throwDefaultError({
1003
- output: output,
1004
- parsedBody: parsedBody,
1005
- exceptionCtor: __BaseException,
1006
- errorCode: errorCode,
1007
- });
1008
- _d.label = 15;
1009
- case 15: return [2];
1010
- }
555
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
556
+ if (data.arn != null) {
557
+ contents.Arn = __expectString(data.arn);
558
+ }
559
+ if (data.authorization != null) {
560
+ contents.Authorization = deserializeAws_restJson1Authorization(data.authorization, context);
561
+ }
562
+ if (data.domainName != null) {
563
+ contents.DomainName = __expectString(data.domainName);
564
+ }
565
+ if (data.egressAccessLogs != null) {
566
+ contents.EgressAccessLogs = deserializeAws_restJson1EgressAccessLogs(data.egressAccessLogs, context);
567
+ }
568
+ if (data.id != null) {
569
+ contents.Id = __expectString(data.id);
570
+ }
571
+ if (data.tags != null) {
572
+ contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
573
+ }
574
+ return contents;
575
+ };
576
+ const deserializeAws_restJson1CreatePackagingGroupCommandError = async (output, context) => {
577
+ const parsedOutput = {
578
+ ...output,
579
+ body: await parseErrorBody(output.body, context),
580
+ };
581
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
582
+ switch (errorCode) {
583
+ case "ForbiddenException":
584
+ case "com.amazonaws.mediapackagevod#ForbiddenException":
585
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
586
+ case "InternalServerErrorException":
587
+ case "com.amazonaws.mediapackagevod#InternalServerErrorException":
588
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
589
+ case "NotFoundException":
590
+ case "com.amazonaws.mediapackagevod#NotFoundException":
591
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
592
+ case "ServiceUnavailableException":
593
+ case "com.amazonaws.mediapackagevod#ServiceUnavailableException":
594
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
595
+ case "TooManyRequestsException":
596
+ case "com.amazonaws.mediapackagevod#TooManyRequestsException":
597
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
598
+ case "UnprocessableEntityException":
599
+ case "com.amazonaws.mediapackagevod#UnprocessableEntityException":
600
+ throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
601
+ default:
602
+ const parsedBody = parsedOutput.body;
603
+ throwDefaultError({
604
+ output,
605
+ parsedBody,
606
+ exceptionCtor: __BaseException,
607
+ errorCode,
608
+ });
609
+ }
610
+ };
611
+ export const deserializeAws_restJson1DeleteAssetCommand = async (output, context) => {
612
+ if (output.statusCode !== 202 && output.statusCode >= 300) {
613
+ return deserializeAws_restJson1DeleteAssetCommandError(output, context);
614
+ }
615
+ const contents = map({
616
+ $metadata: deserializeMetadata(output),
1011
617
  });
1012
- }); };
1013
- export var deserializeAws_restJson1DescribeAssetCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1014
- var contents, data, _a, _b;
1015
- return __generator(this, function (_c) {
1016
- switch (_c.label) {
1017
- case 0:
1018
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1019
- return [2, deserializeAws_restJson1DescribeAssetCommandError(output, context)];
1020
- }
1021
- contents = map({
1022
- $metadata: deserializeMetadata(output),
1023
- });
1024
- _a = __expectNonNull;
1025
- _b = __expectObject;
1026
- return [4, parseBody(output.body, context)];
1027
- case 1:
1028
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1029
- if (data.arn != null) {
1030
- contents.Arn = __expectString(data.arn);
1031
- }
1032
- if (data.createdAt != null) {
1033
- contents.CreatedAt = __expectString(data.createdAt);
1034
- }
1035
- if (data.egressEndpoints != null) {
1036
- contents.EgressEndpoints = deserializeAws_restJson1__listOfEgressEndpoint(data.egressEndpoints, context);
1037
- }
1038
- if (data.id != null) {
1039
- contents.Id = __expectString(data.id);
1040
- }
1041
- if (data.packagingGroupId != null) {
1042
- contents.PackagingGroupId = __expectString(data.packagingGroupId);
1043
- }
1044
- if (data.resourceId != null) {
1045
- contents.ResourceId = __expectString(data.resourceId);
1046
- }
1047
- if (data.sourceArn != null) {
1048
- contents.SourceArn = __expectString(data.sourceArn);
1049
- }
1050
- if (data.sourceRoleArn != null) {
1051
- contents.SourceRoleArn = __expectString(data.sourceRoleArn);
1052
- }
1053
- if (data.tags != null) {
1054
- contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
1055
- }
1056
- return [2, contents];
1057
- }
618
+ await collectBody(output.body, context);
619
+ return contents;
620
+ };
621
+ const deserializeAws_restJson1DeleteAssetCommandError = async (output, context) => {
622
+ const parsedOutput = {
623
+ ...output,
624
+ body: await parseErrorBody(output.body, context),
625
+ };
626
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
627
+ switch (errorCode) {
628
+ case "ForbiddenException":
629
+ case "com.amazonaws.mediapackagevod#ForbiddenException":
630
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
631
+ case "InternalServerErrorException":
632
+ case "com.amazonaws.mediapackagevod#InternalServerErrorException":
633
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
634
+ case "NotFoundException":
635
+ case "com.amazonaws.mediapackagevod#NotFoundException":
636
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
637
+ case "ServiceUnavailableException":
638
+ case "com.amazonaws.mediapackagevod#ServiceUnavailableException":
639
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
640
+ case "TooManyRequestsException":
641
+ case "com.amazonaws.mediapackagevod#TooManyRequestsException":
642
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
643
+ case "UnprocessableEntityException":
644
+ case "com.amazonaws.mediapackagevod#UnprocessableEntityException":
645
+ throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
646
+ default:
647
+ const parsedBody = parsedOutput.body;
648
+ throwDefaultError({
649
+ output,
650
+ parsedBody,
651
+ exceptionCtor: __BaseException,
652
+ errorCode,
653
+ });
654
+ }
655
+ };
656
+ export const deserializeAws_restJson1DeletePackagingConfigurationCommand = async (output, context) => {
657
+ if (output.statusCode !== 202 && output.statusCode >= 300) {
658
+ return deserializeAws_restJson1DeletePackagingConfigurationCommandError(output, context);
659
+ }
660
+ const contents = map({
661
+ $metadata: deserializeMetadata(output),
1058
662
  });
1059
- }); };
1060
- var deserializeAws_restJson1DescribeAssetCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1061
- var parsedOutput, _a, errorCode, _b, parsedBody;
1062
- var _c;
1063
- return __generator(this, function (_d) {
1064
- switch (_d.label) {
1065
- case 0:
1066
- _a = [__assign({}, output)];
1067
- _c = {};
1068
- return [4, parseErrorBody(output.body, context)];
1069
- case 1:
1070
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1071
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1072
- _b = errorCode;
1073
- switch (_b) {
1074
- case "ForbiddenException": return [3, 2];
1075
- case "com.amazonaws.mediapackagevod#ForbiddenException": return [3, 2];
1076
- case "InternalServerErrorException": return [3, 4];
1077
- case "com.amazonaws.mediapackagevod#InternalServerErrorException": return [3, 4];
1078
- case "NotFoundException": return [3, 6];
1079
- case "com.amazonaws.mediapackagevod#NotFoundException": return [3, 6];
1080
- case "ServiceUnavailableException": return [3, 8];
1081
- case "com.amazonaws.mediapackagevod#ServiceUnavailableException": return [3, 8];
1082
- case "TooManyRequestsException": return [3, 10];
1083
- case "com.amazonaws.mediapackagevod#TooManyRequestsException": return [3, 10];
1084
- case "UnprocessableEntityException": return [3, 12];
1085
- case "com.amazonaws.mediapackagevod#UnprocessableEntityException": return [3, 12];
1086
- }
1087
- return [3, 14];
1088
- case 2: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1089
- case 3: throw _d.sent();
1090
- case 4: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
1091
- case 5: throw _d.sent();
1092
- case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1093
- case 7: throw _d.sent();
1094
- case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
1095
- case 9: throw _d.sent();
1096
- case 10: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1097
- case 11: throw _d.sent();
1098
- case 12: return [4, deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context)];
1099
- case 13: throw _d.sent();
1100
- case 14:
1101
- parsedBody = parsedOutput.body;
1102
- throwDefaultError({
1103
- output: output,
1104
- parsedBody: parsedBody,
1105
- exceptionCtor: __BaseException,
1106
- errorCode: errorCode,
1107
- });
1108
- _d.label = 15;
1109
- case 15: return [2];
1110
- }
663
+ await collectBody(output.body, context);
664
+ return contents;
665
+ };
666
+ const deserializeAws_restJson1DeletePackagingConfigurationCommandError = async (output, context) => {
667
+ const parsedOutput = {
668
+ ...output,
669
+ body: await parseErrorBody(output.body, context),
670
+ };
671
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
672
+ switch (errorCode) {
673
+ case "ForbiddenException":
674
+ case "com.amazonaws.mediapackagevod#ForbiddenException":
675
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
676
+ case "InternalServerErrorException":
677
+ case "com.amazonaws.mediapackagevod#InternalServerErrorException":
678
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
679
+ case "NotFoundException":
680
+ case "com.amazonaws.mediapackagevod#NotFoundException":
681
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
682
+ case "ServiceUnavailableException":
683
+ case "com.amazonaws.mediapackagevod#ServiceUnavailableException":
684
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
685
+ case "TooManyRequestsException":
686
+ case "com.amazonaws.mediapackagevod#TooManyRequestsException":
687
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
688
+ case "UnprocessableEntityException":
689
+ case "com.amazonaws.mediapackagevod#UnprocessableEntityException":
690
+ throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
691
+ default:
692
+ const parsedBody = parsedOutput.body;
693
+ throwDefaultError({
694
+ output,
695
+ parsedBody,
696
+ exceptionCtor: __BaseException,
697
+ errorCode,
698
+ });
699
+ }
700
+ };
701
+ export const deserializeAws_restJson1DeletePackagingGroupCommand = async (output, context) => {
702
+ if (output.statusCode !== 202 && output.statusCode >= 300) {
703
+ return deserializeAws_restJson1DeletePackagingGroupCommandError(output, context);
704
+ }
705
+ const contents = map({
706
+ $metadata: deserializeMetadata(output),
1111
707
  });
1112
- }); };
1113
- export var deserializeAws_restJson1DescribePackagingConfigurationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1114
- var contents, data, _a, _b;
1115
- return __generator(this, function (_c) {
1116
- switch (_c.label) {
1117
- case 0:
1118
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1119
- return [2, deserializeAws_restJson1DescribePackagingConfigurationCommandError(output, context)];
1120
- }
1121
- contents = map({
1122
- $metadata: deserializeMetadata(output),
1123
- });
1124
- _a = __expectNonNull;
1125
- _b = __expectObject;
1126
- return [4, parseBody(output.body, context)];
1127
- case 1:
1128
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1129
- if (data.arn != null) {
1130
- contents.Arn = __expectString(data.arn);
1131
- }
1132
- if (data.cmafPackage != null) {
1133
- contents.CmafPackage = deserializeAws_restJson1CmafPackage(data.cmafPackage, context);
1134
- }
1135
- if (data.dashPackage != null) {
1136
- contents.DashPackage = deserializeAws_restJson1DashPackage(data.dashPackage, context);
1137
- }
1138
- if (data.hlsPackage != null) {
1139
- contents.HlsPackage = deserializeAws_restJson1HlsPackage(data.hlsPackage, context);
1140
- }
1141
- if (data.id != null) {
1142
- contents.Id = __expectString(data.id);
1143
- }
1144
- if (data.mssPackage != null) {
1145
- contents.MssPackage = deserializeAws_restJson1MssPackage(data.mssPackage, context);
1146
- }
1147
- if (data.packagingGroupId != null) {
1148
- contents.PackagingGroupId = __expectString(data.packagingGroupId);
1149
- }
1150
- if (data.tags != null) {
1151
- contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
1152
- }
1153
- return [2, contents];
1154
- }
708
+ await collectBody(output.body, context);
709
+ return contents;
710
+ };
711
+ const deserializeAws_restJson1DeletePackagingGroupCommandError = async (output, context) => {
712
+ const parsedOutput = {
713
+ ...output,
714
+ body: await parseErrorBody(output.body, context),
715
+ };
716
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
717
+ switch (errorCode) {
718
+ case "ForbiddenException":
719
+ case "com.amazonaws.mediapackagevod#ForbiddenException":
720
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
721
+ case "InternalServerErrorException":
722
+ case "com.amazonaws.mediapackagevod#InternalServerErrorException":
723
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
724
+ case "NotFoundException":
725
+ case "com.amazonaws.mediapackagevod#NotFoundException":
726
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
727
+ case "ServiceUnavailableException":
728
+ case "com.amazonaws.mediapackagevod#ServiceUnavailableException":
729
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
730
+ case "TooManyRequestsException":
731
+ case "com.amazonaws.mediapackagevod#TooManyRequestsException":
732
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
733
+ case "UnprocessableEntityException":
734
+ case "com.amazonaws.mediapackagevod#UnprocessableEntityException":
735
+ throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
736
+ default:
737
+ const parsedBody = parsedOutput.body;
738
+ throwDefaultError({
739
+ output,
740
+ parsedBody,
741
+ exceptionCtor: __BaseException,
742
+ errorCode,
743
+ });
744
+ }
745
+ };
746
+ export const deserializeAws_restJson1DescribeAssetCommand = async (output, context) => {
747
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
748
+ return deserializeAws_restJson1DescribeAssetCommandError(output, context);
749
+ }
750
+ const contents = map({
751
+ $metadata: deserializeMetadata(output),
1155
752
  });
1156
- }); };
1157
- var deserializeAws_restJson1DescribePackagingConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1158
- var parsedOutput, _a, errorCode, _b, parsedBody;
1159
- var _c;
1160
- return __generator(this, function (_d) {
1161
- switch (_d.label) {
1162
- case 0:
1163
- _a = [__assign({}, output)];
1164
- _c = {};
1165
- return [4, parseErrorBody(output.body, context)];
1166
- case 1:
1167
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1168
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1169
- _b = errorCode;
1170
- switch (_b) {
1171
- case "ForbiddenException": return [3, 2];
1172
- case "com.amazonaws.mediapackagevod#ForbiddenException": return [3, 2];
1173
- case "InternalServerErrorException": return [3, 4];
1174
- case "com.amazonaws.mediapackagevod#InternalServerErrorException": return [3, 4];
1175
- case "NotFoundException": return [3, 6];
1176
- case "com.amazonaws.mediapackagevod#NotFoundException": return [3, 6];
1177
- case "ServiceUnavailableException": return [3, 8];
1178
- case "com.amazonaws.mediapackagevod#ServiceUnavailableException": return [3, 8];
1179
- case "TooManyRequestsException": return [3, 10];
1180
- case "com.amazonaws.mediapackagevod#TooManyRequestsException": return [3, 10];
1181
- case "UnprocessableEntityException": return [3, 12];
1182
- case "com.amazonaws.mediapackagevod#UnprocessableEntityException": return [3, 12];
1183
- }
1184
- return [3, 14];
1185
- case 2: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1186
- case 3: throw _d.sent();
1187
- case 4: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
1188
- case 5: throw _d.sent();
1189
- case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1190
- case 7: throw _d.sent();
1191
- case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
1192
- case 9: throw _d.sent();
1193
- case 10: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1194
- case 11: throw _d.sent();
1195
- case 12: return [4, deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context)];
1196
- case 13: throw _d.sent();
1197
- case 14:
1198
- parsedBody = parsedOutput.body;
1199
- throwDefaultError({
1200
- output: output,
1201
- parsedBody: parsedBody,
1202
- exceptionCtor: __BaseException,
1203
- errorCode: errorCode,
1204
- });
1205
- _d.label = 15;
1206
- case 15: return [2];
1207
- }
753
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
754
+ if (data.arn != null) {
755
+ contents.Arn = __expectString(data.arn);
756
+ }
757
+ if (data.createdAt != null) {
758
+ contents.CreatedAt = __expectString(data.createdAt);
759
+ }
760
+ if (data.egressEndpoints != null) {
761
+ contents.EgressEndpoints = deserializeAws_restJson1__listOfEgressEndpoint(data.egressEndpoints, context);
762
+ }
763
+ if (data.id != null) {
764
+ contents.Id = __expectString(data.id);
765
+ }
766
+ if (data.packagingGroupId != null) {
767
+ contents.PackagingGroupId = __expectString(data.packagingGroupId);
768
+ }
769
+ if (data.resourceId != null) {
770
+ contents.ResourceId = __expectString(data.resourceId);
771
+ }
772
+ if (data.sourceArn != null) {
773
+ contents.SourceArn = __expectString(data.sourceArn);
774
+ }
775
+ if (data.sourceRoleArn != null) {
776
+ contents.SourceRoleArn = __expectString(data.sourceRoleArn);
777
+ }
778
+ if (data.tags != null) {
779
+ contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
780
+ }
781
+ return contents;
782
+ };
783
+ const deserializeAws_restJson1DescribeAssetCommandError = async (output, context) => {
784
+ const parsedOutput = {
785
+ ...output,
786
+ body: await parseErrorBody(output.body, context),
787
+ };
788
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
789
+ switch (errorCode) {
790
+ case "ForbiddenException":
791
+ case "com.amazonaws.mediapackagevod#ForbiddenException":
792
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
793
+ case "InternalServerErrorException":
794
+ case "com.amazonaws.mediapackagevod#InternalServerErrorException":
795
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
796
+ case "NotFoundException":
797
+ case "com.amazonaws.mediapackagevod#NotFoundException":
798
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
799
+ case "ServiceUnavailableException":
800
+ case "com.amazonaws.mediapackagevod#ServiceUnavailableException":
801
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
802
+ case "TooManyRequestsException":
803
+ case "com.amazonaws.mediapackagevod#TooManyRequestsException":
804
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
805
+ case "UnprocessableEntityException":
806
+ case "com.amazonaws.mediapackagevod#UnprocessableEntityException":
807
+ throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
808
+ default:
809
+ const parsedBody = parsedOutput.body;
810
+ throwDefaultError({
811
+ output,
812
+ parsedBody,
813
+ exceptionCtor: __BaseException,
814
+ errorCode,
815
+ });
816
+ }
817
+ };
818
+ export const deserializeAws_restJson1DescribePackagingConfigurationCommand = async (output, context) => {
819
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
820
+ return deserializeAws_restJson1DescribePackagingConfigurationCommandError(output, context);
821
+ }
822
+ const contents = map({
823
+ $metadata: deserializeMetadata(output),
1208
824
  });
1209
- }); };
1210
- export var deserializeAws_restJson1DescribePackagingGroupCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1211
- var contents, data, _a, _b;
1212
- return __generator(this, function (_c) {
1213
- switch (_c.label) {
1214
- case 0:
1215
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1216
- return [2, deserializeAws_restJson1DescribePackagingGroupCommandError(output, context)];
1217
- }
1218
- contents = map({
1219
- $metadata: deserializeMetadata(output),
1220
- });
1221
- _a = __expectNonNull;
1222
- _b = __expectObject;
1223
- return [4, parseBody(output.body, context)];
1224
- case 1:
1225
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1226
- if (data.arn != null) {
1227
- contents.Arn = __expectString(data.arn);
1228
- }
1229
- if (data.authorization != null) {
1230
- contents.Authorization = deserializeAws_restJson1Authorization(data.authorization, context);
1231
- }
1232
- if (data.domainName != null) {
1233
- contents.DomainName = __expectString(data.domainName);
1234
- }
1235
- if (data.egressAccessLogs != null) {
1236
- contents.EgressAccessLogs = deserializeAws_restJson1EgressAccessLogs(data.egressAccessLogs, context);
1237
- }
1238
- if (data.id != null) {
1239
- contents.Id = __expectString(data.id);
1240
- }
1241
- if (data.tags != null) {
1242
- contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
1243
- }
1244
- return [2, contents];
1245
- }
825
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
826
+ if (data.arn != null) {
827
+ contents.Arn = __expectString(data.arn);
828
+ }
829
+ if (data.cmafPackage != null) {
830
+ contents.CmafPackage = deserializeAws_restJson1CmafPackage(data.cmafPackage, context);
831
+ }
832
+ if (data.dashPackage != null) {
833
+ contents.DashPackage = deserializeAws_restJson1DashPackage(data.dashPackage, context);
834
+ }
835
+ if (data.hlsPackage != null) {
836
+ contents.HlsPackage = deserializeAws_restJson1HlsPackage(data.hlsPackage, context);
837
+ }
838
+ if (data.id != null) {
839
+ contents.Id = __expectString(data.id);
840
+ }
841
+ if (data.mssPackage != null) {
842
+ contents.MssPackage = deserializeAws_restJson1MssPackage(data.mssPackage, context);
843
+ }
844
+ if (data.packagingGroupId != null) {
845
+ contents.PackagingGroupId = __expectString(data.packagingGroupId);
846
+ }
847
+ if (data.tags != null) {
848
+ contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
849
+ }
850
+ return contents;
851
+ };
852
+ const deserializeAws_restJson1DescribePackagingConfigurationCommandError = async (output, context) => {
853
+ const parsedOutput = {
854
+ ...output,
855
+ body: await parseErrorBody(output.body, context),
856
+ };
857
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
858
+ switch (errorCode) {
859
+ case "ForbiddenException":
860
+ case "com.amazonaws.mediapackagevod#ForbiddenException":
861
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
862
+ case "InternalServerErrorException":
863
+ case "com.amazonaws.mediapackagevod#InternalServerErrorException":
864
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
865
+ case "NotFoundException":
866
+ case "com.amazonaws.mediapackagevod#NotFoundException":
867
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
868
+ case "ServiceUnavailableException":
869
+ case "com.amazonaws.mediapackagevod#ServiceUnavailableException":
870
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
871
+ case "TooManyRequestsException":
872
+ case "com.amazonaws.mediapackagevod#TooManyRequestsException":
873
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
874
+ case "UnprocessableEntityException":
875
+ case "com.amazonaws.mediapackagevod#UnprocessableEntityException":
876
+ throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
877
+ default:
878
+ const parsedBody = parsedOutput.body;
879
+ throwDefaultError({
880
+ output,
881
+ parsedBody,
882
+ exceptionCtor: __BaseException,
883
+ errorCode,
884
+ });
885
+ }
886
+ };
887
+ export const deserializeAws_restJson1DescribePackagingGroupCommand = async (output, context) => {
888
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
889
+ return deserializeAws_restJson1DescribePackagingGroupCommandError(output, context);
890
+ }
891
+ const contents = map({
892
+ $metadata: deserializeMetadata(output),
1246
893
  });
1247
- }); };
1248
- var deserializeAws_restJson1DescribePackagingGroupCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1249
- var parsedOutput, _a, errorCode, _b, parsedBody;
1250
- var _c;
1251
- return __generator(this, function (_d) {
1252
- switch (_d.label) {
1253
- case 0:
1254
- _a = [__assign({}, output)];
1255
- _c = {};
1256
- return [4, parseErrorBody(output.body, context)];
1257
- case 1:
1258
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1259
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1260
- _b = errorCode;
1261
- switch (_b) {
1262
- case "ForbiddenException": return [3, 2];
1263
- case "com.amazonaws.mediapackagevod#ForbiddenException": return [3, 2];
1264
- case "InternalServerErrorException": return [3, 4];
1265
- case "com.amazonaws.mediapackagevod#InternalServerErrorException": return [3, 4];
1266
- case "NotFoundException": return [3, 6];
1267
- case "com.amazonaws.mediapackagevod#NotFoundException": return [3, 6];
1268
- case "ServiceUnavailableException": return [3, 8];
1269
- case "com.amazonaws.mediapackagevod#ServiceUnavailableException": return [3, 8];
1270
- case "TooManyRequestsException": return [3, 10];
1271
- case "com.amazonaws.mediapackagevod#TooManyRequestsException": return [3, 10];
1272
- case "UnprocessableEntityException": return [3, 12];
1273
- case "com.amazonaws.mediapackagevod#UnprocessableEntityException": return [3, 12];
1274
- }
1275
- return [3, 14];
1276
- case 2: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1277
- case 3: throw _d.sent();
1278
- case 4: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
1279
- case 5: throw _d.sent();
1280
- case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1281
- case 7: throw _d.sent();
1282
- case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
1283
- case 9: throw _d.sent();
1284
- case 10: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1285
- case 11: throw _d.sent();
1286
- case 12: return [4, deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context)];
1287
- case 13: throw _d.sent();
1288
- case 14:
1289
- parsedBody = parsedOutput.body;
1290
- throwDefaultError({
1291
- output: output,
1292
- parsedBody: parsedBody,
1293
- exceptionCtor: __BaseException,
1294
- errorCode: errorCode,
1295
- });
1296
- _d.label = 15;
1297
- case 15: return [2];
1298
- }
894
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
895
+ if (data.arn != null) {
896
+ contents.Arn = __expectString(data.arn);
897
+ }
898
+ if (data.authorization != null) {
899
+ contents.Authorization = deserializeAws_restJson1Authorization(data.authorization, context);
900
+ }
901
+ if (data.domainName != null) {
902
+ contents.DomainName = __expectString(data.domainName);
903
+ }
904
+ if (data.egressAccessLogs != null) {
905
+ contents.EgressAccessLogs = deserializeAws_restJson1EgressAccessLogs(data.egressAccessLogs, context);
906
+ }
907
+ if (data.id != null) {
908
+ contents.Id = __expectString(data.id);
909
+ }
910
+ if (data.tags != null) {
911
+ contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
912
+ }
913
+ return contents;
914
+ };
915
+ const deserializeAws_restJson1DescribePackagingGroupCommandError = async (output, context) => {
916
+ const parsedOutput = {
917
+ ...output,
918
+ body: await parseErrorBody(output.body, context),
919
+ };
920
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
921
+ switch (errorCode) {
922
+ case "ForbiddenException":
923
+ case "com.amazonaws.mediapackagevod#ForbiddenException":
924
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
925
+ case "InternalServerErrorException":
926
+ case "com.amazonaws.mediapackagevod#InternalServerErrorException":
927
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
928
+ case "NotFoundException":
929
+ case "com.amazonaws.mediapackagevod#NotFoundException":
930
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
931
+ case "ServiceUnavailableException":
932
+ case "com.amazonaws.mediapackagevod#ServiceUnavailableException":
933
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
934
+ case "TooManyRequestsException":
935
+ case "com.amazonaws.mediapackagevod#TooManyRequestsException":
936
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
937
+ case "UnprocessableEntityException":
938
+ case "com.amazonaws.mediapackagevod#UnprocessableEntityException":
939
+ throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
940
+ default:
941
+ const parsedBody = parsedOutput.body;
942
+ throwDefaultError({
943
+ output,
944
+ parsedBody,
945
+ exceptionCtor: __BaseException,
946
+ errorCode,
947
+ });
948
+ }
949
+ };
950
+ export const deserializeAws_restJson1ListAssetsCommand = async (output, context) => {
951
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
952
+ return deserializeAws_restJson1ListAssetsCommandError(output, context);
953
+ }
954
+ const contents = map({
955
+ $metadata: deserializeMetadata(output),
1299
956
  });
1300
- }); };
1301
- export var deserializeAws_restJson1ListAssetsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1302
- var contents, data, _a, _b;
1303
- return __generator(this, function (_c) {
1304
- switch (_c.label) {
1305
- case 0:
1306
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1307
- return [2, deserializeAws_restJson1ListAssetsCommandError(output, context)];
1308
- }
1309
- contents = map({
1310
- $metadata: deserializeMetadata(output),
1311
- });
1312
- _a = __expectNonNull;
1313
- _b = __expectObject;
1314
- return [4, parseBody(output.body, context)];
1315
- case 1:
1316
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1317
- if (data.assets != null) {
1318
- contents.Assets = deserializeAws_restJson1__listOfAssetShallow(data.assets, context);
1319
- }
1320
- if (data.nextToken != null) {
1321
- contents.NextToken = __expectString(data.nextToken);
1322
- }
1323
- return [2, contents];
1324
- }
957
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
958
+ if (data.assets != null) {
959
+ contents.Assets = deserializeAws_restJson1__listOfAssetShallow(data.assets, context);
960
+ }
961
+ if (data.nextToken != null) {
962
+ contents.NextToken = __expectString(data.nextToken);
963
+ }
964
+ return contents;
965
+ };
966
+ const deserializeAws_restJson1ListAssetsCommandError = async (output, context) => {
967
+ const parsedOutput = {
968
+ ...output,
969
+ body: await parseErrorBody(output.body, context),
970
+ };
971
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
972
+ switch (errorCode) {
973
+ case "ForbiddenException":
974
+ case "com.amazonaws.mediapackagevod#ForbiddenException":
975
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
976
+ case "InternalServerErrorException":
977
+ case "com.amazonaws.mediapackagevod#InternalServerErrorException":
978
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
979
+ case "NotFoundException":
980
+ case "com.amazonaws.mediapackagevod#NotFoundException":
981
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
982
+ case "ServiceUnavailableException":
983
+ case "com.amazonaws.mediapackagevod#ServiceUnavailableException":
984
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
985
+ case "TooManyRequestsException":
986
+ case "com.amazonaws.mediapackagevod#TooManyRequestsException":
987
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
988
+ case "UnprocessableEntityException":
989
+ case "com.amazonaws.mediapackagevod#UnprocessableEntityException":
990
+ throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
991
+ default:
992
+ const parsedBody = parsedOutput.body;
993
+ throwDefaultError({
994
+ output,
995
+ parsedBody,
996
+ exceptionCtor: __BaseException,
997
+ errorCode,
998
+ });
999
+ }
1000
+ };
1001
+ export const deserializeAws_restJson1ListPackagingConfigurationsCommand = async (output, context) => {
1002
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1003
+ return deserializeAws_restJson1ListPackagingConfigurationsCommandError(output, context);
1004
+ }
1005
+ const contents = map({
1006
+ $metadata: deserializeMetadata(output),
1325
1007
  });
1326
- }); };
1327
- var deserializeAws_restJson1ListAssetsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1328
- var parsedOutput, _a, errorCode, _b, parsedBody;
1329
- var _c;
1330
- return __generator(this, function (_d) {
1331
- switch (_d.label) {
1332
- case 0:
1333
- _a = [__assign({}, output)];
1334
- _c = {};
1335
- return [4, parseErrorBody(output.body, context)];
1336
- case 1:
1337
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1338
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1339
- _b = errorCode;
1340
- switch (_b) {
1341
- case "ForbiddenException": return [3, 2];
1342
- case "com.amazonaws.mediapackagevod#ForbiddenException": return [3, 2];
1343
- case "InternalServerErrorException": return [3, 4];
1344
- case "com.amazonaws.mediapackagevod#InternalServerErrorException": return [3, 4];
1345
- case "NotFoundException": return [3, 6];
1346
- case "com.amazonaws.mediapackagevod#NotFoundException": return [3, 6];
1347
- case "ServiceUnavailableException": return [3, 8];
1348
- case "com.amazonaws.mediapackagevod#ServiceUnavailableException": return [3, 8];
1349
- case "TooManyRequestsException": return [3, 10];
1350
- case "com.amazonaws.mediapackagevod#TooManyRequestsException": return [3, 10];
1351
- case "UnprocessableEntityException": return [3, 12];
1352
- case "com.amazonaws.mediapackagevod#UnprocessableEntityException": return [3, 12];
1353
- }
1354
- return [3, 14];
1355
- case 2: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1356
- case 3: throw _d.sent();
1357
- case 4: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
1358
- case 5: throw _d.sent();
1359
- case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1360
- case 7: throw _d.sent();
1361
- case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
1362
- case 9: throw _d.sent();
1363
- case 10: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1364
- case 11: throw _d.sent();
1365
- case 12: return [4, deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context)];
1366
- case 13: throw _d.sent();
1367
- case 14:
1368
- parsedBody = parsedOutput.body;
1369
- throwDefaultError({
1370
- output: output,
1371
- parsedBody: parsedBody,
1372
- exceptionCtor: __BaseException,
1373
- errorCode: errorCode,
1374
- });
1375
- _d.label = 15;
1376
- case 15: return [2];
1377
- }
1008
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1009
+ if (data.nextToken != null) {
1010
+ contents.NextToken = __expectString(data.nextToken);
1011
+ }
1012
+ if (data.packagingConfigurations != null) {
1013
+ contents.PackagingConfigurations = deserializeAws_restJson1__listOfPackagingConfiguration(data.packagingConfigurations, context);
1014
+ }
1015
+ return contents;
1016
+ };
1017
+ const deserializeAws_restJson1ListPackagingConfigurationsCommandError = async (output, context) => {
1018
+ const parsedOutput = {
1019
+ ...output,
1020
+ body: await parseErrorBody(output.body, context),
1021
+ };
1022
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1023
+ switch (errorCode) {
1024
+ case "ForbiddenException":
1025
+ case "com.amazonaws.mediapackagevod#ForbiddenException":
1026
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1027
+ case "InternalServerErrorException":
1028
+ case "com.amazonaws.mediapackagevod#InternalServerErrorException":
1029
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1030
+ case "NotFoundException":
1031
+ case "com.amazonaws.mediapackagevod#NotFoundException":
1032
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1033
+ case "ServiceUnavailableException":
1034
+ case "com.amazonaws.mediapackagevod#ServiceUnavailableException":
1035
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1036
+ case "TooManyRequestsException":
1037
+ case "com.amazonaws.mediapackagevod#TooManyRequestsException":
1038
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1039
+ case "UnprocessableEntityException":
1040
+ case "com.amazonaws.mediapackagevod#UnprocessableEntityException":
1041
+ throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
1042
+ default:
1043
+ const parsedBody = parsedOutput.body;
1044
+ throwDefaultError({
1045
+ output,
1046
+ parsedBody,
1047
+ exceptionCtor: __BaseException,
1048
+ errorCode,
1049
+ });
1050
+ }
1051
+ };
1052
+ export const deserializeAws_restJson1ListPackagingGroupsCommand = async (output, context) => {
1053
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1054
+ return deserializeAws_restJson1ListPackagingGroupsCommandError(output, context);
1055
+ }
1056
+ const contents = map({
1057
+ $metadata: deserializeMetadata(output),
1378
1058
  });
1379
- }); };
1380
- export var deserializeAws_restJson1ListPackagingConfigurationsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1381
- var contents, data, _a, _b;
1382
- return __generator(this, function (_c) {
1383
- switch (_c.label) {
1384
- case 0:
1385
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1386
- return [2, deserializeAws_restJson1ListPackagingConfigurationsCommandError(output, context)];
1387
- }
1388
- contents = map({
1389
- $metadata: deserializeMetadata(output),
1390
- });
1391
- _a = __expectNonNull;
1392
- _b = __expectObject;
1393
- return [4, parseBody(output.body, context)];
1394
- case 1:
1395
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1396
- if (data.nextToken != null) {
1397
- contents.NextToken = __expectString(data.nextToken);
1398
- }
1399
- if (data.packagingConfigurations != null) {
1400
- contents.PackagingConfigurations = deserializeAws_restJson1__listOfPackagingConfiguration(data.packagingConfigurations, context);
1401
- }
1402
- return [2, contents];
1403
- }
1059
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1060
+ if (data.nextToken != null) {
1061
+ contents.NextToken = __expectString(data.nextToken);
1062
+ }
1063
+ if (data.packagingGroups != null) {
1064
+ contents.PackagingGroups = deserializeAws_restJson1__listOfPackagingGroup(data.packagingGroups, context);
1065
+ }
1066
+ return contents;
1067
+ };
1068
+ const deserializeAws_restJson1ListPackagingGroupsCommandError = async (output, context) => {
1069
+ const parsedOutput = {
1070
+ ...output,
1071
+ body: await parseErrorBody(output.body, context),
1072
+ };
1073
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1074
+ switch (errorCode) {
1075
+ case "ForbiddenException":
1076
+ case "com.amazonaws.mediapackagevod#ForbiddenException":
1077
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1078
+ case "InternalServerErrorException":
1079
+ case "com.amazonaws.mediapackagevod#InternalServerErrorException":
1080
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1081
+ case "NotFoundException":
1082
+ case "com.amazonaws.mediapackagevod#NotFoundException":
1083
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1084
+ case "ServiceUnavailableException":
1085
+ case "com.amazonaws.mediapackagevod#ServiceUnavailableException":
1086
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1087
+ case "TooManyRequestsException":
1088
+ case "com.amazonaws.mediapackagevod#TooManyRequestsException":
1089
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1090
+ case "UnprocessableEntityException":
1091
+ case "com.amazonaws.mediapackagevod#UnprocessableEntityException":
1092
+ throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
1093
+ default:
1094
+ const parsedBody = parsedOutput.body;
1095
+ throwDefaultError({
1096
+ output,
1097
+ parsedBody,
1098
+ exceptionCtor: __BaseException,
1099
+ errorCode,
1100
+ });
1101
+ }
1102
+ };
1103
+ export const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
1104
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1105
+ return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
1106
+ }
1107
+ const contents = map({
1108
+ $metadata: deserializeMetadata(output),
1404
1109
  });
1405
- }); };
1406
- var deserializeAws_restJson1ListPackagingConfigurationsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1407
- var parsedOutput, _a, errorCode, _b, parsedBody;
1408
- var _c;
1409
- return __generator(this, function (_d) {
1410
- switch (_d.label) {
1411
- case 0:
1412
- _a = [__assign({}, output)];
1413
- _c = {};
1414
- return [4, parseErrorBody(output.body, context)];
1415
- case 1:
1416
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1417
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1418
- _b = errorCode;
1419
- switch (_b) {
1420
- case "ForbiddenException": return [3, 2];
1421
- case "com.amazonaws.mediapackagevod#ForbiddenException": return [3, 2];
1422
- case "InternalServerErrorException": return [3, 4];
1423
- case "com.amazonaws.mediapackagevod#InternalServerErrorException": return [3, 4];
1424
- case "NotFoundException": return [3, 6];
1425
- case "com.amazonaws.mediapackagevod#NotFoundException": return [3, 6];
1426
- case "ServiceUnavailableException": return [3, 8];
1427
- case "com.amazonaws.mediapackagevod#ServiceUnavailableException": return [3, 8];
1428
- case "TooManyRequestsException": return [3, 10];
1429
- case "com.amazonaws.mediapackagevod#TooManyRequestsException": return [3, 10];
1430
- case "UnprocessableEntityException": return [3, 12];
1431
- case "com.amazonaws.mediapackagevod#UnprocessableEntityException": return [3, 12];
1432
- }
1433
- return [3, 14];
1434
- case 2: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1435
- case 3: throw _d.sent();
1436
- case 4: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
1437
- case 5: throw _d.sent();
1438
- case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1439
- case 7: throw _d.sent();
1440
- case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
1441
- case 9: throw _d.sent();
1442
- case 10: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1443
- case 11: throw _d.sent();
1444
- case 12: return [4, deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context)];
1445
- case 13: throw _d.sent();
1446
- case 14:
1447
- parsedBody = parsedOutput.body;
1448
- throwDefaultError({
1449
- output: output,
1450
- parsedBody: parsedBody,
1451
- exceptionCtor: __BaseException,
1452
- errorCode: errorCode,
1453
- });
1454
- _d.label = 15;
1455
- case 15: return [2];
1456
- }
1110
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1111
+ if (data.tags != null) {
1112
+ contents.Tags = deserializeAws_restJson1__mapOf__string(data.tags, context);
1113
+ }
1114
+ return contents;
1115
+ };
1116
+ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
1117
+ const parsedOutput = {
1118
+ ...output,
1119
+ body: await parseErrorBody(output.body, context),
1120
+ };
1121
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1122
+ const parsedBody = parsedOutput.body;
1123
+ throwDefaultError({
1124
+ output,
1125
+ parsedBody,
1126
+ exceptionCtor: __BaseException,
1127
+ errorCode,
1457
1128
  });
1458
- }); };
1459
- export var deserializeAws_restJson1ListPackagingGroupsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1460
- var contents, data, _a, _b;
1461
- return __generator(this, function (_c) {
1462
- switch (_c.label) {
1463
- case 0:
1464
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1465
- return [2, deserializeAws_restJson1ListPackagingGroupsCommandError(output, context)];
1466
- }
1467
- contents = map({
1468
- $metadata: deserializeMetadata(output),
1469
- });
1470
- _a = __expectNonNull;
1471
- _b = __expectObject;
1472
- return [4, parseBody(output.body, context)];
1473
- case 1:
1474
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1475
- if (data.nextToken != null) {
1476
- contents.NextToken = __expectString(data.nextToken);
1477
- }
1478
- if (data.packagingGroups != null) {
1479
- contents.PackagingGroups = deserializeAws_restJson1__listOfPackagingGroup(data.packagingGroups, context);
1480
- }
1481
- return [2, contents];
1482
- }
1129
+ };
1130
+ export const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
1131
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
1132
+ return deserializeAws_restJson1TagResourceCommandError(output, context);
1133
+ }
1134
+ const contents = map({
1135
+ $metadata: deserializeMetadata(output),
1483
1136
  });
1484
- }); };
1485
- var deserializeAws_restJson1ListPackagingGroupsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1486
- var parsedOutput, _a, errorCode, _b, parsedBody;
1487
- var _c;
1488
- return __generator(this, function (_d) {
1489
- switch (_d.label) {
1490
- case 0:
1491
- _a = [__assign({}, output)];
1492
- _c = {};
1493
- return [4, parseErrorBody(output.body, context)];
1494
- case 1:
1495
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1496
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1497
- _b = errorCode;
1498
- switch (_b) {
1499
- case "ForbiddenException": return [3, 2];
1500
- case "com.amazonaws.mediapackagevod#ForbiddenException": return [3, 2];
1501
- case "InternalServerErrorException": return [3, 4];
1502
- case "com.amazonaws.mediapackagevod#InternalServerErrorException": return [3, 4];
1503
- case "NotFoundException": return [3, 6];
1504
- case "com.amazonaws.mediapackagevod#NotFoundException": return [3, 6];
1505
- case "ServiceUnavailableException": return [3, 8];
1506
- case "com.amazonaws.mediapackagevod#ServiceUnavailableException": return [3, 8];
1507
- case "TooManyRequestsException": return [3, 10];
1508
- case "com.amazonaws.mediapackagevod#TooManyRequestsException": return [3, 10];
1509
- case "UnprocessableEntityException": return [3, 12];
1510
- case "com.amazonaws.mediapackagevod#UnprocessableEntityException": return [3, 12];
1511
- }
1512
- return [3, 14];
1513
- case 2: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1514
- case 3: throw _d.sent();
1515
- case 4: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
1516
- case 5: throw _d.sent();
1517
- case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1518
- case 7: throw _d.sent();
1519
- case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
1520
- case 9: throw _d.sent();
1521
- case 10: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1522
- case 11: throw _d.sent();
1523
- case 12: return [4, deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context)];
1524
- case 13: throw _d.sent();
1525
- case 14:
1526
- parsedBody = parsedOutput.body;
1527
- throwDefaultError({
1528
- output: output,
1529
- parsedBody: parsedBody,
1530
- exceptionCtor: __BaseException,
1531
- errorCode: errorCode,
1532
- });
1533
- _d.label = 15;
1534
- case 15: return [2];
1535
- }
1137
+ await collectBody(output.body, context);
1138
+ return contents;
1139
+ };
1140
+ const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
1141
+ const parsedOutput = {
1142
+ ...output,
1143
+ body: await parseErrorBody(output.body, context),
1144
+ };
1145
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1146
+ const parsedBody = parsedOutput.body;
1147
+ throwDefaultError({
1148
+ output,
1149
+ parsedBody,
1150
+ exceptionCtor: __BaseException,
1151
+ errorCode,
1536
1152
  });
1537
- }); };
1538
- export var deserializeAws_restJson1ListTagsForResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1539
- var contents, data, _a, _b;
1540
- return __generator(this, function (_c) {
1541
- switch (_c.label) {
1542
- case 0:
1543
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1544
- return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
1545
- }
1546
- contents = map({
1547
- $metadata: deserializeMetadata(output),
1548
- });
1549
- _a = __expectNonNull;
1550
- _b = __expectObject;
1551
- return [4, parseBody(output.body, context)];
1552
- case 1:
1553
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1554
- if (data.tags != null) {
1555
- contents.Tags = deserializeAws_restJson1__mapOf__string(data.tags, context);
1556
- }
1557
- return [2, contents];
1558
- }
1153
+ };
1154
+ export const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
1155
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
1156
+ return deserializeAws_restJson1UntagResourceCommandError(output, context);
1157
+ }
1158
+ const contents = map({
1159
+ $metadata: deserializeMetadata(output),
1559
1160
  });
1560
- }); };
1561
- var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1562
- var parsedOutput, _a, errorCode, parsedBody;
1563
- var _b;
1564
- return __generator(this, function (_c) {
1565
- switch (_c.label) {
1566
- case 0:
1567
- _a = [__assign({}, output)];
1568
- _b = {};
1569
- return [4, parseErrorBody(output.body, context)];
1570
- case 1:
1571
- parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
1572
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1573
- parsedBody = parsedOutput.body;
1574
- throwDefaultError({
1575
- output: output,
1576
- parsedBody: parsedBody,
1577
- exceptionCtor: __BaseException,
1578
- errorCode: errorCode,
1579
- });
1580
- return [2];
1581
- }
1161
+ await collectBody(output.body, context);
1162
+ return contents;
1163
+ };
1164
+ const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
1165
+ const parsedOutput = {
1166
+ ...output,
1167
+ body: await parseErrorBody(output.body, context),
1168
+ };
1169
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1170
+ const parsedBody = parsedOutput.body;
1171
+ throwDefaultError({
1172
+ output,
1173
+ parsedBody,
1174
+ exceptionCtor: __BaseException,
1175
+ errorCode,
1582
1176
  });
1583
- }); };
1584
- export var deserializeAws_restJson1TagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1585
- var contents;
1586
- return __generator(this, function (_a) {
1587
- switch (_a.label) {
1588
- case 0:
1589
- if (output.statusCode !== 204 && output.statusCode >= 300) {
1590
- return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
1591
- }
1592
- contents = map({
1593
- $metadata: deserializeMetadata(output),
1594
- });
1595
- return [4, collectBody(output.body, context)];
1596
- case 1:
1597
- _a.sent();
1598
- return [2, contents];
1599
- }
1177
+ };
1178
+ export const deserializeAws_restJson1UpdatePackagingGroupCommand = async (output, context) => {
1179
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1180
+ return deserializeAws_restJson1UpdatePackagingGroupCommandError(output, context);
1181
+ }
1182
+ const contents = map({
1183
+ $metadata: deserializeMetadata(output),
1600
1184
  });
1601
- }); };
1602
- var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1603
- var parsedOutput, _a, errorCode, parsedBody;
1604
- var _b;
1605
- return __generator(this, function (_c) {
1606
- switch (_c.label) {
1607
- case 0:
1608
- _a = [__assign({}, output)];
1609
- _b = {};
1610
- return [4, parseErrorBody(output.body, context)];
1611
- case 1:
1612
- parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
1613
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1614
- parsedBody = parsedOutput.body;
1615
- throwDefaultError({
1616
- output: output,
1617
- parsedBody: parsedBody,
1618
- exceptionCtor: __BaseException,
1619
- errorCode: errorCode,
1620
- });
1621
- return [2];
1622
- }
1185
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1186
+ if (data.arn != null) {
1187
+ contents.Arn = __expectString(data.arn);
1188
+ }
1189
+ if (data.authorization != null) {
1190
+ contents.Authorization = deserializeAws_restJson1Authorization(data.authorization, context);
1191
+ }
1192
+ if (data.domainName != null) {
1193
+ contents.DomainName = __expectString(data.domainName);
1194
+ }
1195
+ if (data.egressAccessLogs != null) {
1196
+ contents.EgressAccessLogs = deserializeAws_restJson1EgressAccessLogs(data.egressAccessLogs, context);
1197
+ }
1198
+ if (data.id != null) {
1199
+ contents.Id = __expectString(data.id);
1200
+ }
1201
+ if (data.tags != null) {
1202
+ contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
1203
+ }
1204
+ return contents;
1205
+ };
1206
+ const deserializeAws_restJson1UpdatePackagingGroupCommandError = async (output, context) => {
1207
+ const parsedOutput = {
1208
+ ...output,
1209
+ body: await parseErrorBody(output.body, context),
1210
+ };
1211
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1212
+ switch (errorCode) {
1213
+ case "ForbiddenException":
1214
+ case "com.amazonaws.mediapackagevod#ForbiddenException":
1215
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1216
+ case "InternalServerErrorException":
1217
+ case "com.amazonaws.mediapackagevod#InternalServerErrorException":
1218
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1219
+ case "NotFoundException":
1220
+ case "com.amazonaws.mediapackagevod#NotFoundException":
1221
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1222
+ case "ServiceUnavailableException":
1223
+ case "com.amazonaws.mediapackagevod#ServiceUnavailableException":
1224
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1225
+ case "TooManyRequestsException":
1226
+ case "com.amazonaws.mediapackagevod#TooManyRequestsException":
1227
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1228
+ case "UnprocessableEntityException":
1229
+ case "com.amazonaws.mediapackagevod#UnprocessableEntityException":
1230
+ throw await deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context);
1231
+ default:
1232
+ const parsedBody = parsedOutput.body;
1233
+ throwDefaultError({
1234
+ output,
1235
+ parsedBody,
1236
+ exceptionCtor: __BaseException,
1237
+ errorCode,
1238
+ });
1239
+ }
1240
+ };
1241
+ const map = __map;
1242
+ const deserializeAws_restJson1ForbiddenExceptionResponse = async (parsedOutput, context) => {
1243
+ const contents = map({});
1244
+ const data = parsedOutput.body;
1245
+ if (data.message != null) {
1246
+ contents.Message = __expectString(data.message);
1247
+ }
1248
+ const exception = new ForbiddenException({
1249
+ $metadata: deserializeMetadata(parsedOutput),
1250
+ ...contents,
1623
1251
  });
1624
- }); };
1625
- export var deserializeAws_restJson1UntagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1626
- var contents;
1627
- return __generator(this, function (_a) {
1628
- switch (_a.label) {
1629
- case 0:
1630
- if (output.statusCode !== 204 && output.statusCode >= 300) {
1631
- return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
1632
- }
1633
- contents = map({
1634
- $metadata: deserializeMetadata(output),
1635
- });
1636
- return [4, collectBody(output.body, context)];
1637
- case 1:
1638
- _a.sent();
1639
- return [2, contents];
1640
- }
1252
+ return __decorateServiceException(exception, parsedOutput.body);
1253
+ };
1254
+ const deserializeAws_restJson1InternalServerErrorExceptionResponse = async (parsedOutput, context) => {
1255
+ const contents = map({});
1256
+ const data = parsedOutput.body;
1257
+ if (data.message != null) {
1258
+ contents.Message = __expectString(data.message);
1259
+ }
1260
+ const exception = new InternalServerErrorException({
1261
+ $metadata: deserializeMetadata(parsedOutput),
1262
+ ...contents,
1641
1263
  });
1642
- }); };
1643
- var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1644
- var parsedOutput, _a, errorCode, parsedBody;
1645
- var _b;
1646
- return __generator(this, function (_c) {
1647
- switch (_c.label) {
1648
- case 0:
1649
- _a = [__assign({}, output)];
1650
- _b = {};
1651
- return [4, parseErrorBody(output.body, context)];
1652
- case 1:
1653
- parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
1654
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1655
- parsedBody = parsedOutput.body;
1656
- throwDefaultError({
1657
- output: output,
1658
- parsedBody: parsedBody,
1659
- exceptionCtor: __BaseException,
1660
- errorCode: errorCode,
1661
- });
1662
- return [2];
1663
- }
1264
+ return __decorateServiceException(exception, parsedOutput.body);
1265
+ };
1266
+ const deserializeAws_restJson1NotFoundExceptionResponse = async (parsedOutput, context) => {
1267
+ const contents = map({});
1268
+ const data = parsedOutput.body;
1269
+ if (data.message != null) {
1270
+ contents.Message = __expectString(data.message);
1271
+ }
1272
+ const exception = new NotFoundException({
1273
+ $metadata: deserializeMetadata(parsedOutput),
1274
+ ...contents,
1664
1275
  });
1665
- }); };
1666
- export var deserializeAws_restJson1UpdatePackagingGroupCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1667
- var contents, data, _a, _b;
1668
- return __generator(this, function (_c) {
1669
- switch (_c.label) {
1670
- case 0:
1671
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1672
- return [2, deserializeAws_restJson1UpdatePackagingGroupCommandError(output, context)];
1673
- }
1674
- contents = map({
1675
- $metadata: deserializeMetadata(output),
1676
- });
1677
- _a = __expectNonNull;
1678
- _b = __expectObject;
1679
- return [4, parseBody(output.body, context)];
1680
- case 1:
1681
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1682
- if (data.arn != null) {
1683
- contents.Arn = __expectString(data.arn);
1684
- }
1685
- if (data.authorization != null) {
1686
- contents.Authorization = deserializeAws_restJson1Authorization(data.authorization, context);
1687
- }
1688
- if (data.domainName != null) {
1689
- contents.DomainName = __expectString(data.domainName);
1690
- }
1691
- if (data.egressAccessLogs != null) {
1692
- contents.EgressAccessLogs = deserializeAws_restJson1EgressAccessLogs(data.egressAccessLogs, context);
1693
- }
1694
- if (data.id != null) {
1695
- contents.Id = __expectString(data.id);
1696
- }
1697
- if (data.tags != null) {
1698
- contents.Tags = deserializeAws_restJson1Tags(data.tags, context);
1699
- }
1700
- return [2, contents];
1701
- }
1276
+ return __decorateServiceException(exception, parsedOutput.body);
1277
+ };
1278
+ const deserializeAws_restJson1ServiceUnavailableExceptionResponse = async (parsedOutput, context) => {
1279
+ const contents = map({});
1280
+ const data = parsedOutput.body;
1281
+ if (data.message != null) {
1282
+ contents.Message = __expectString(data.message);
1283
+ }
1284
+ const exception = new ServiceUnavailableException({
1285
+ $metadata: deserializeMetadata(parsedOutput),
1286
+ ...contents,
1702
1287
  });
1703
- }); };
1704
- var deserializeAws_restJson1UpdatePackagingGroupCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1705
- var parsedOutput, _a, errorCode, _b, parsedBody;
1706
- var _c;
1707
- return __generator(this, function (_d) {
1708
- switch (_d.label) {
1709
- case 0:
1710
- _a = [__assign({}, output)];
1711
- _c = {};
1712
- return [4, parseErrorBody(output.body, context)];
1713
- case 1:
1714
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1715
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1716
- _b = errorCode;
1717
- switch (_b) {
1718
- case "ForbiddenException": return [3, 2];
1719
- case "com.amazonaws.mediapackagevod#ForbiddenException": return [3, 2];
1720
- case "InternalServerErrorException": return [3, 4];
1721
- case "com.amazonaws.mediapackagevod#InternalServerErrorException": return [3, 4];
1722
- case "NotFoundException": return [3, 6];
1723
- case "com.amazonaws.mediapackagevod#NotFoundException": return [3, 6];
1724
- case "ServiceUnavailableException": return [3, 8];
1725
- case "com.amazonaws.mediapackagevod#ServiceUnavailableException": return [3, 8];
1726
- case "TooManyRequestsException": return [3, 10];
1727
- case "com.amazonaws.mediapackagevod#TooManyRequestsException": return [3, 10];
1728
- case "UnprocessableEntityException": return [3, 12];
1729
- case "com.amazonaws.mediapackagevod#UnprocessableEntityException": return [3, 12];
1730
- }
1731
- return [3, 14];
1732
- case 2: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1733
- case 3: throw _d.sent();
1734
- case 4: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
1735
- case 5: throw _d.sent();
1736
- case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1737
- case 7: throw _d.sent();
1738
- case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
1739
- case 9: throw _d.sent();
1740
- case 10: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1741
- case 11: throw _d.sent();
1742
- case 12: return [4, deserializeAws_restJson1UnprocessableEntityExceptionResponse(parsedOutput, context)];
1743
- case 13: throw _d.sent();
1744
- case 14:
1745
- parsedBody = parsedOutput.body;
1746
- throwDefaultError({
1747
- output: output,
1748
- parsedBody: parsedBody,
1749
- exceptionCtor: __BaseException,
1750
- errorCode: errorCode,
1751
- });
1752
- _d.label = 15;
1753
- case 15: return [2];
1754
- }
1288
+ return __decorateServiceException(exception, parsedOutput.body);
1289
+ };
1290
+ const deserializeAws_restJson1TooManyRequestsExceptionResponse = async (parsedOutput, context) => {
1291
+ const contents = map({});
1292
+ const data = parsedOutput.body;
1293
+ if (data.message != null) {
1294
+ contents.Message = __expectString(data.message);
1295
+ }
1296
+ const exception = new TooManyRequestsException({
1297
+ $metadata: deserializeMetadata(parsedOutput),
1298
+ ...contents,
1755
1299
  });
1756
- }); };
1757
- var map = __map;
1758
- var deserializeAws_restJson1ForbiddenExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1759
- var contents, data, exception;
1760
- return __generator(this, function (_a) {
1761
- contents = map({});
1762
- data = parsedOutput.body;
1763
- if (data.message != null) {
1764
- contents.Message = __expectString(data.message);
1765
- }
1766
- exception = new ForbiddenException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1767
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1768
- });
1769
- }); };
1770
- var deserializeAws_restJson1InternalServerErrorExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1771
- var contents, data, exception;
1772
- return __generator(this, function (_a) {
1773
- contents = map({});
1774
- data = parsedOutput.body;
1775
- if (data.message != null) {
1776
- contents.Message = __expectString(data.message);
1777
- }
1778
- exception = new InternalServerErrorException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1779
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1780
- });
1781
- }); };
1782
- var deserializeAws_restJson1NotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1783
- var contents, data, exception;
1784
- return __generator(this, function (_a) {
1785
- contents = map({});
1786
- data = parsedOutput.body;
1787
- if (data.message != null) {
1788
- contents.Message = __expectString(data.message);
1789
- }
1790
- exception = new NotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1791
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1792
- });
1793
- }); };
1794
- var deserializeAws_restJson1ServiceUnavailableExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1795
- var contents, data, exception;
1796
- return __generator(this, function (_a) {
1797
- contents = map({});
1798
- data = parsedOutput.body;
1799
- if (data.message != null) {
1800
- contents.Message = __expectString(data.message);
1801
- }
1802
- exception = new ServiceUnavailableException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1803
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1804
- });
1805
- }); };
1806
- var deserializeAws_restJson1TooManyRequestsExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1807
- var contents, data, exception;
1808
- return __generator(this, function (_a) {
1809
- contents = map({});
1810
- data = parsedOutput.body;
1811
- if (data.message != null) {
1812
- contents.Message = __expectString(data.message);
1813
- }
1814
- exception = new TooManyRequestsException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1815
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1816
- });
1817
- }); };
1818
- var deserializeAws_restJson1UnprocessableEntityExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1819
- var contents, data, exception;
1820
- return __generator(this, function (_a) {
1821
- contents = map({});
1822
- data = parsedOutput.body;
1823
- if (data.message != null) {
1824
- contents.Message = __expectString(data.message);
1825
- }
1826
- exception = new UnprocessableEntityException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1827
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1300
+ return __decorateServiceException(exception, parsedOutput.body);
1301
+ };
1302
+ const deserializeAws_restJson1UnprocessableEntityExceptionResponse = async (parsedOutput, context) => {
1303
+ const contents = map({});
1304
+ const data = parsedOutput.body;
1305
+ if (data.message != null) {
1306
+ contents.Message = __expectString(data.message);
1307
+ }
1308
+ const exception = new UnprocessableEntityException({
1309
+ $metadata: deserializeMetadata(parsedOutput),
1310
+ ...contents,
1828
1311
  });
1829
- }); };
1830
- var serializeAws_restJson1__listOf__PeriodTriggersElement = function (input, context) {
1312
+ return __decorateServiceException(exception, parsedOutput.body);
1313
+ };
1314
+ const serializeAws_restJson1__listOf__PeriodTriggersElement = (input, context) => {
1831
1315
  return input
1832
- .filter(function (e) { return e != null; })
1833
- .map(function (entry) {
1316
+ .filter((e) => e != null)
1317
+ .map((entry) => {
1834
1318
  return entry;
1835
1319
  });
1836
1320
  };
1837
- var serializeAws_restJson1__listOf__string = function (input, context) {
1321
+ const serializeAws_restJson1__listOf__string = (input, context) => {
1838
1322
  return input
1839
- .filter(function (e) { return e != null; })
1840
- .map(function (entry) {
1323
+ .filter((e) => e != null)
1324
+ .map((entry) => {
1841
1325
  return entry;
1842
1326
  });
1843
1327
  };
1844
- var serializeAws_restJson1__listOfDashManifest = function (input, context) {
1328
+ const serializeAws_restJson1__listOfDashManifest = (input, context) => {
1845
1329
  return input
1846
- .filter(function (e) { return e != null; })
1847
- .map(function (entry) {
1330
+ .filter((e) => e != null)
1331
+ .map((entry) => {
1848
1332
  return serializeAws_restJson1DashManifest(entry, context);
1849
1333
  });
1850
1334
  };
1851
- var serializeAws_restJson1__listOfHlsManifest = function (input, context) {
1335
+ const serializeAws_restJson1__listOfHlsManifest = (input, context) => {
1852
1336
  return input
1853
- .filter(function (e) { return e != null; })
1854
- .map(function (entry) {
1337
+ .filter((e) => e != null)
1338
+ .map((entry) => {
1855
1339
  return serializeAws_restJson1HlsManifest(entry, context);
1856
1340
  });
1857
1341
  };
1858
- var serializeAws_restJson1__listOfMssManifest = function (input, context) {
1342
+ const serializeAws_restJson1__listOfMssManifest = (input, context) => {
1859
1343
  return input
1860
- .filter(function (e) { return e != null; })
1861
- .map(function (entry) {
1344
+ .filter((e) => e != null)
1345
+ .map((entry) => {
1862
1346
  return serializeAws_restJson1MssManifest(entry, context);
1863
1347
  });
1864
1348
  };
1865
- var serializeAws_restJson1__mapOf__string = function (input, context) {
1866
- return Object.entries(input).reduce(function (acc, _a) {
1867
- var _b;
1868
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1349
+ const serializeAws_restJson1__mapOf__string = (input, context) => {
1350
+ return Object.entries(input).reduce((acc, [key, value]) => {
1869
1351
  if (value === null) {
1870
1352
  return acc;
1871
1353
  }
1872
- return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
1354
+ return {
1355
+ ...acc,
1356
+ [key]: value,
1357
+ };
1873
1358
  }, {});
1874
1359
  };
1875
- var serializeAws_restJson1Authorization = function (input, context) {
1876
- return __assign(__assign({}, (input.CdnIdentifierSecret != null && { cdnIdentifierSecret: input.CdnIdentifierSecret })), (input.SecretsRoleArn != null && { secretsRoleArn: input.SecretsRoleArn }));
1877
- };
1878
- var serializeAws_restJson1CmafEncryption = function (input, context) {
1879
- return __assign(__assign({}, (input.ConstantInitializationVector != null && {
1880
- constantInitializationVector: input.ConstantInitializationVector,
1881
- })), (input.SpekeKeyProvider != null && {
1882
- spekeKeyProvider: serializeAws_restJson1SpekeKeyProvider(input.SpekeKeyProvider, context),
1883
- }));
1884
- };
1885
- var serializeAws_restJson1CmafPackage = function (input, context) {
1886
- return __assign(__assign(__assign(__assign({}, (input.Encryption != null && { encryption: serializeAws_restJson1CmafEncryption(input.Encryption, context) })), (input.HlsManifests != null && {
1887
- hlsManifests: serializeAws_restJson1__listOfHlsManifest(input.HlsManifests, context),
1888
- })), (input.IncludeEncoderConfigurationInSegments != null && {
1889
- includeEncoderConfigurationInSegments: input.IncludeEncoderConfigurationInSegments,
1890
- })), (input.SegmentDurationSeconds != null && { segmentDurationSeconds: input.SegmentDurationSeconds }));
1891
- };
1892
- var serializeAws_restJson1DashEncryption = function (input, context) {
1893
- return __assign({}, (input.SpekeKeyProvider != null && {
1894
- spekeKeyProvider: serializeAws_restJson1SpekeKeyProvider(input.SpekeKeyProvider, context),
1895
- }));
1896
- };
1897
- var serializeAws_restJson1DashManifest = function (input, context) {
1898
- return __assign(__assign(__assign(__assign(__assign(__assign({}, (input.ManifestLayout != null && { manifestLayout: input.ManifestLayout })), (input.ManifestName != null && { manifestName: input.ManifestName })), (input.MinBufferTimeSeconds != null && { minBufferTimeSeconds: input.MinBufferTimeSeconds })), (input.Profile != null && { profile: input.Profile })), (input.ScteMarkersSource != null && { scteMarkersSource: input.ScteMarkersSource })), (input.StreamSelection != null && {
1899
- streamSelection: serializeAws_restJson1StreamSelection(input.StreamSelection, context),
1900
- }));
1901
- };
1902
- var serializeAws_restJson1DashPackage = function (input, context) {
1903
- return __assign(__assign(__assign(__assign(__assign(__assign({}, (input.DashManifests != null && {
1904
- dashManifests: serializeAws_restJson1__listOfDashManifest(input.DashManifests, context),
1905
- })), (input.Encryption != null && { encryption: serializeAws_restJson1DashEncryption(input.Encryption, context) })), (input.IncludeEncoderConfigurationInSegments != null && {
1906
- includeEncoderConfigurationInSegments: input.IncludeEncoderConfigurationInSegments,
1907
- })), (input.PeriodTriggers != null && {
1908
- periodTriggers: serializeAws_restJson1__listOf__PeriodTriggersElement(input.PeriodTriggers, context),
1909
- })), (input.SegmentDurationSeconds != null && { segmentDurationSeconds: input.SegmentDurationSeconds })), (input.SegmentTemplateFormat != null && { segmentTemplateFormat: input.SegmentTemplateFormat }));
1910
- };
1911
- var serializeAws_restJson1EgressAccessLogs = function (input, context) {
1912
- return __assign({}, (input.LogGroupName != null && { logGroupName: input.LogGroupName }));
1913
- };
1914
- var serializeAws_restJson1HlsEncryption = function (input, context) {
1915
- return __assign(__assign(__assign({}, (input.ConstantInitializationVector != null && {
1916
- constantInitializationVector: input.ConstantInitializationVector,
1917
- })), (input.EncryptionMethod != null && { encryptionMethod: input.EncryptionMethod })), (input.SpekeKeyProvider != null && {
1918
- spekeKeyProvider: serializeAws_restJson1SpekeKeyProvider(input.SpekeKeyProvider, context),
1919
- }));
1920
- };
1921
- var serializeAws_restJson1HlsManifest = function (input, context) {
1922
- return __assign(__assign(__assign(__assign(__assign(__assign({}, (input.AdMarkers != null && { adMarkers: input.AdMarkers })), (input.IncludeIframeOnlyStream != null && { includeIframeOnlyStream: input.IncludeIframeOnlyStream })), (input.ManifestName != null && { manifestName: input.ManifestName })), (input.ProgramDateTimeIntervalSeconds != null && {
1923
- programDateTimeIntervalSeconds: input.ProgramDateTimeIntervalSeconds,
1924
- })), (input.RepeatExtXKey != null && { repeatExtXKey: input.RepeatExtXKey })), (input.StreamSelection != null && {
1925
- streamSelection: serializeAws_restJson1StreamSelection(input.StreamSelection, context),
1926
- }));
1927
- };
1928
- var serializeAws_restJson1HlsPackage = function (input, context) {
1929
- return __assign(__assign(__assign(__assign(__assign({}, (input.Encryption != null && { encryption: serializeAws_restJson1HlsEncryption(input.Encryption, context) })), (input.HlsManifests != null && {
1930
- hlsManifests: serializeAws_restJson1__listOfHlsManifest(input.HlsManifests, context),
1931
- })), (input.IncludeDvbSubtitles != null && { includeDvbSubtitles: input.IncludeDvbSubtitles })), (input.SegmentDurationSeconds != null && { segmentDurationSeconds: input.SegmentDurationSeconds })), (input.UseAudioRenditionGroup != null && { useAudioRenditionGroup: input.UseAudioRenditionGroup }));
1932
- };
1933
- var serializeAws_restJson1MssEncryption = function (input, context) {
1934
- return __assign({}, (input.SpekeKeyProvider != null && {
1935
- spekeKeyProvider: serializeAws_restJson1SpekeKeyProvider(input.SpekeKeyProvider, context),
1936
- }));
1937
- };
1938
- var serializeAws_restJson1MssManifest = function (input, context) {
1939
- return __assign(__assign({}, (input.ManifestName != null && { manifestName: input.ManifestName })), (input.StreamSelection != null && {
1940
- streamSelection: serializeAws_restJson1StreamSelection(input.StreamSelection, context),
1941
- }));
1942
- };
1943
- var serializeAws_restJson1MssPackage = function (input, context) {
1944
- return __assign(__assign(__assign({}, (input.Encryption != null && { encryption: serializeAws_restJson1MssEncryption(input.Encryption, context) })), (input.MssManifests != null && {
1945
- mssManifests: serializeAws_restJson1__listOfMssManifest(input.MssManifests, context),
1946
- })), (input.SegmentDurationSeconds != null && { segmentDurationSeconds: input.SegmentDurationSeconds }));
1947
- };
1948
- var serializeAws_restJson1SpekeKeyProvider = function (input, context) {
1949
- return __assign(__assign(__assign({}, (input.RoleArn != null && { roleArn: input.RoleArn })), (input.SystemIds != null && { systemIds: serializeAws_restJson1__listOf__string(input.SystemIds, context) })), (input.Url != null && { url: input.Url }));
1950
- };
1951
- var serializeAws_restJson1StreamSelection = function (input, context) {
1952
- return __assign(__assign(__assign({}, (input.MaxVideoBitsPerSecond != null && { maxVideoBitsPerSecond: input.MaxVideoBitsPerSecond })), (input.MinVideoBitsPerSecond != null && { minVideoBitsPerSecond: input.MinVideoBitsPerSecond })), (input.StreamOrder != null && { streamOrder: input.StreamOrder }));
1953
- };
1954
- var serializeAws_restJson1Tags = function (input, context) {
1955
- return Object.entries(input).reduce(function (acc, _a) {
1956
- var _b;
1957
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1360
+ const serializeAws_restJson1Authorization = (input, context) => {
1361
+ return {
1362
+ ...(input.CdnIdentifierSecret != null && { cdnIdentifierSecret: input.CdnIdentifierSecret }),
1363
+ ...(input.SecretsRoleArn != null && { secretsRoleArn: input.SecretsRoleArn }),
1364
+ };
1365
+ };
1366
+ const serializeAws_restJson1CmafEncryption = (input, context) => {
1367
+ return {
1368
+ ...(input.ConstantInitializationVector != null && {
1369
+ constantInitializationVector: input.ConstantInitializationVector,
1370
+ }),
1371
+ ...(input.SpekeKeyProvider != null && {
1372
+ spekeKeyProvider: serializeAws_restJson1SpekeKeyProvider(input.SpekeKeyProvider, context),
1373
+ }),
1374
+ };
1375
+ };
1376
+ const serializeAws_restJson1CmafPackage = (input, context) => {
1377
+ return {
1378
+ ...(input.Encryption != null && { encryption: serializeAws_restJson1CmafEncryption(input.Encryption, context) }),
1379
+ ...(input.HlsManifests != null && {
1380
+ hlsManifests: serializeAws_restJson1__listOfHlsManifest(input.HlsManifests, context),
1381
+ }),
1382
+ ...(input.IncludeEncoderConfigurationInSegments != null && {
1383
+ includeEncoderConfigurationInSegments: input.IncludeEncoderConfigurationInSegments,
1384
+ }),
1385
+ ...(input.SegmentDurationSeconds != null && { segmentDurationSeconds: input.SegmentDurationSeconds }),
1386
+ };
1387
+ };
1388
+ const serializeAws_restJson1DashEncryption = (input, context) => {
1389
+ return {
1390
+ ...(input.SpekeKeyProvider != null && {
1391
+ spekeKeyProvider: serializeAws_restJson1SpekeKeyProvider(input.SpekeKeyProvider, context),
1392
+ }),
1393
+ };
1394
+ };
1395
+ const serializeAws_restJson1DashManifest = (input, context) => {
1396
+ return {
1397
+ ...(input.ManifestLayout != null && { manifestLayout: input.ManifestLayout }),
1398
+ ...(input.ManifestName != null && { manifestName: input.ManifestName }),
1399
+ ...(input.MinBufferTimeSeconds != null && { minBufferTimeSeconds: input.MinBufferTimeSeconds }),
1400
+ ...(input.Profile != null && { profile: input.Profile }),
1401
+ ...(input.ScteMarkersSource != null && { scteMarkersSource: input.ScteMarkersSource }),
1402
+ ...(input.StreamSelection != null && {
1403
+ streamSelection: serializeAws_restJson1StreamSelection(input.StreamSelection, context),
1404
+ }),
1405
+ };
1406
+ };
1407
+ const serializeAws_restJson1DashPackage = (input, context) => {
1408
+ return {
1409
+ ...(input.DashManifests != null && {
1410
+ dashManifests: serializeAws_restJson1__listOfDashManifest(input.DashManifests, context),
1411
+ }),
1412
+ ...(input.Encryption != null && { encryption: serializeAws_restJson1DashEncryption(input.Encryption, context) }),
1413
+ ...(input.IncludeEncoderConfigurationInSegments != null && {
1414
+ includeEncoderConfigurationInSegments: input.IncludeEncoderConfigurationInSegments,
1415
+ }),
1416
+ ...(input.PeriodTriggers != null && {
1417
+ periodTriggers: serializeAws_restJson1__listOf__PeriodTriggersElement(input.PeriodTriggers, context),
1418
+ }),
1419
+ ...(input.SegmentDurationSeconds != null && { segmentDurationSeconds: input.SegmentDurationSeconds }),
1420
+ ...(input.SegmentTemplateFormat != null && { segmentTemplateFormat: input.SegmentTemplateFormat }),
1421
+ };
1422
+ };
1423
+ const serializeAws_restJson1EgressAccessLogs = (input, context) => {
1424
+ return {
1425
+ ...(input.LogGroupName != null && { logGroupName: input.LogGroupName }),
1426
+ };
1427
+ };
1428
+ const serializeAws_restJson1EncryptionContractConfiguration = (input, context) => {
1429
+ return {
1430
+ ...(input.PresetSpeke20Audio != null && { presetSpeke20Audio: input.PresetSpeke20Audio }),
1431
+ ...(input.PresetSpeke20Video != null && { presetSpeke20Video: input.PresetSpeke20Video }),
1432
+ };
1433
+ };
1434
+ const serializeAws_restJson1HlsEncryption = (input, context) => {
1435
+ return {
1436
+ ...(input.ConstantInitializationVector != null && {
1437
+ constantInitializationVector: input.ConstantInitializationVector,
1438
+ }),
1439
+ ...(input.EncryptionMethod != null && { encryptionMethod: input.EncryptionMethod }),
1440
+ ...(input.SpekeKeyProvider != null && {
1441
+ spekeKeyProvider: serializeAws_restJson1SpekeKeyProvider(input.SpekeKeyProvider, context),
1442
+ }),
1443
+ };
1444
+ };
1445
+ const serializeAws_restJson1HlsManifest = (input, context) => {
1446
+ return {
1447
+ ...(input.AdMarkers != null && { adMarkers: input.AdMarkers }),
1448
+ ...(input.IncludeIframeOnlyStream != null && { includeIframeOnlyStream: input.IncludeIframeOnlyStream }),
1449
+ ...(input.ManifestName != null && { manifestName: input.ManifestName }),
1450
+ ...(input.ProgramDateTimeIntervalSeconds != null && {
1451
+ programDateTimeIntervalSeconds: input.ProgramDateTimeIntervalSeconds,
1452
+ }),
1453
+ ...(input.RepeatExtXKey != null && { repeatExtXKey: input.RepeatExtXKey }),
1454
+ ...(input.StreamSelection != null && {
1455
+ streamSelection: serializeAws_restJson1StreamSelection(input.StreamSelection, context),
1456
+ }),
1457
+ };
1458
+ };
1459
+ const serializeAws_restJson1HlsPackage = (input, context) => {
1460
+ return {
1461
+ ...(input.Encryption != null && { encryption: serializeAws_restJson1HlsEncryption(input.Encryption, context) }),
1462
+ ...(input.HlsManifests != null && {
1463
+ hlsManifests: serializeAws_restJson1__listOfHlsManifest(input.HlsManifests, context),
1464
+ }),
1465
+ ...(input.IncludeDvbSubtitles != null && { includeDvbSubtitles: input.IncludeDvbSubtitles }),
1466
+ ...(input.SegmentDurationSeconds != null && { segmentDurationSeconds: input.SegmentDurationSeconds }),
1467
+ ...(input.UseAudioRenditionGroup != null && { useAudioRenditionGroup: input.UseAudioRenditionGroup }),
1468
+ };
1469
+ };
1470
+ const serializeAws_restJson1MssEncryption = (input, context) => {
1471
+ return {
1472
+ ...(input.SpekeKeyProvider != null && {
1473
+ spekeKeyProvider: serializeAws_restJson1SpekeKeyProvider(input.SpekeKeyProvider, context),
1474
+ }),
1475
+ };
1476
+ };
1477
+ const serializeAws_restJson1MssManifest = (input, context) => {
1478
+ return {
1479
+ ...(input.ManifestName != null && { manifestName: input.ManifestName }),
1480
+ ...(input.StreamSelection != null && {
1481
+ streamSelection: serializeAws_restJson1StreamSelection(input.StreamSelection, context),
1482
+ }),
1483
+ };
1484
+ };
1485
+ const serializeAws_restJson1MssPackage = (input, context) => {
1486
+ return {
1487
+ ...(input.Encryption != null && { encryption: serializeAws_restJson1MssEncryption(input.Encryption, context) }),
1488
+ ...(input.MssManifests != null && {
1489
+ mssManifests: serializeAws_restJson1__listOfMssManifest(input.MssManifests, context),
1490
+ }),
1491
+ ...(input.SegmentDurationSeconds != null && { segmentDurationSeconds: input.SegmentDurationSeconds }),
1492
+ };
1493
+ };
1494
+ const serializeAws_restJson1SpekeKeyProvider = (input, context) => {
1495
+ return {
1496
+ ...(input.EncryptionContractConfiguration != null && {
1497
+ encryptionContractConfiguration: serializeAws_restJson1EncryptionContractConfiguration(input.EncryptionContractConfiguration, context),
1498
+ }),
1499
+ ...(input.RoleArn != null && { roleArn: input.RoleArn }),
1500
+ ...(input.SystemIds != null && { systemIds: serializeAws_restJson1__listOf__string(input.SystemIds, context) }),
1501
+ ...(input.Url != null && { url: input.Url }),
1502
+ };
1503
+ };
1504
+ const serializeAws_restJson1StreamSelection = (input, context) => {
1505
+ return {
1506
+ ...(input.MaxVideoBitsPerSecond != null && { maxVideoBitsPerSecond: input.MaxVideoBitsPerSecond }),
1507
+ ...(input.MinVideoBitsPerSecond != null && { minVideoBitsPerSecond: input.MinVideoBitsPerSecond }),
1508
+ ...(input.StreamOrder != null && { streamOrder: input.StreamOrder }),
1509
+ };
1510
+ };
1511
+ const serializeAws_restJson1Tags = (input, context) => {
1512
+ return Object.entries(input).reduce((acc, [key, value]) => {
1958
1513
  if (value === null) {
1959
1514
  return acc;
1960
1515
  }
1961
- return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
1516
+ return {
1517
+ ...acc,
1518
+ [key]: value,
1519
+ };
1962
1520
  }, {});
1963
1521
  };
1964
- var deserializeAws_restJson1__listOf__PeriodTriggersElement = function (output, context) {
1965
- var retVal = (output || [])
1966
- .filter(function (e) { return e != null; })
1967
- .map(function (entry) {
1522
+ const deserializeAws_restJson1__listOf__PeriodTriggersElement = (output, context) => {
1523
+ const retVal = (output || [])
1524
+ .filter((e) => e != null)
1525
+ .map((entry) => {
1968
1526
  if (entry === null) {
1969
1527
  return null;
1970
1528
  }
@@ -1972,10 +1530,10 @@ var deserializeAws_restJson1__listOf__PeriodTriggersElement = function (output,
1972
1530
  });
1973
1531
  return retVal;
1974
1532
  };
1975
- var deserializeAws_restJson1__listOf__string = function (output, context) {
1976
- var retVal = (output || [])
1977
- .filter(function (e) { return e != null; })
1978
- .map(function (entry) {
1533
+ const deserializeAws_restJson1__listOf__string = (output, context) => {
1534
+ const retVal = (output || [])
1535
+ .filter((e) => e != null)
1536
+ .map((entry) => {
1979
1537
  if (entry === null) {
1980
1538
  return null;
1981
1539
  }
@@ -1983,10 +1541,10 @@ var deserializeAws_restJson1__listOf__string = function (output, context) {
1983
1541
  });
1984
1542
  return retVal;
1985
1543
  };
1986
- var deserializeAws_restJson1__listOfAssetShallow = function (output, context) {
1987
- var retVal = (output || [])
1988
- .filter(function (e) { return e != null; })
1989
- .map(function (entry) {
1544
+ const deserializeAws_restJson1__listOfAssetShallow = (output, context) => {
1545
+ const retVal = (output || [])
1546
+ .filter((e) => e != null)
1547
+ .map((entry) => {
1990
1548
  if (entry === null) {
1991
1549
  return null;
1992
1550
  }
@@ -1994,10 +1552,10 @@ var deserializeAws_restJson1__listOfAssetShallow = function (output, context) {
1994
1552
  });
1995
1553
  return retVal;
1996
1554
  };
1997
- var deserializeAws_restJson1__listOfDashManifest = function (output, context) {
1998
- var retVal = (output || [])
1999
- .filter(function (e) { return e != null; })
2000
- .map(function (entry) {
1555
+ const deserializeAws_restJson1__listOfDashManifest = (output, context) => {
1556
+ const retVal = (output || [])
1557
+ .filter((e) => e != null)
1558
+ .map((entry) => {
2001
1559
  if (entry === null) {
2002
1560
  return null;
2003
1561
  }
@@ -2005,10 +1563,10 @@ var deserializeAws_restJson1__listOfDashManifest = function (output, context) {
2005
1563
  });
2006
1564
  return retVal;
2007
1565
  };
2008
- var deserializeAws_restJson1__listOfEgressEndpoint = function (output, context) {
2009
- var retVal = (output || [])
2010
- .filter(function (e) { return e != null; })
2011
- .map(function (entry) {
1566
+ const deserializeAws_restJson1__listOfEgressEndpoint = (output, context) => {
1567
+ const retVal = (output || [])
1568
+ .filter((e) => e != null)
1569
+ .map((entry) => {
2012
1570
  if (entry === null) {
2013
1571
  return null;
2014
1572
  }
@@ -2016,10 +1574,10 @@ var deserializeAws_restJson1__listOfEgressEndpoint = function (output, context)
2016
1574
  });
2017
1575
  return retVal;
2018
1576
  };
2019
- var deserializeAws_restJson1__listOfHlsManifest = function (output, context) {
2020
- var retVal = (output || [])
2021
- .filter(function (e) { return e != null; })
2022
- .map(function (entry) {
1577
+ const deserializeAws_restJson1__listOfHlsManifest = (output, context) => {
1578
+ const retVal = (output || [])
1579
+ .filter((e) => e != null)
1580
+ .map((entry) => {
2023
1581
  if (entry === null) {
2024
1582
  return null;
2025
1583
  }
@@ -2027,10 +1585,10 @@ var deserializeAws_restJson1__listOfHlsManifest = function (output, context) {
2027
1585
  });
2028
1586
  return retVal;
2029
1587
  };
2030
- var deserializeAws_restJson1__listOfMssManifest = function (output, context) {
2031
- var retVal = (output || [])
2032
- .filter(function (e) { return e != null; })
2033
- .map(function (entry) {
1588
+ const deserializeAws_restJson1__listOfMssManifest = (output, context) => {
1589
+ const retVal = (output || [])
1590
+ .filter((e) => e != null)
1591
+ .map((entry) => {
2034
1592
  if (entry === null) {
2035
1593
  return null;
2036
1594
  }
@@ -2038,10 +1596,10 @@ var deserializeAws_restJson1__listOfMssManifest = function (output, context) {
2038
1596
  });
2039
1597
  return retVal;
2040
1598
  };
2041
- var deserializeAws_restJson1__listOfPackagingConfiguration = function (output, context) {
2042
- var retVal = (output || [])
2043
- .filter(function (e) { return e != null; })
2044
- .map(function (entry) {
1599
+ const deserializeAws_restJson1__listOfPackagingConfiguration = (output, context) => {
1600
+ const retVal = (output || [])
1601
+ .filter((e) => e != null)
1602
+ .map((entry) => {
2045
1603
  if (entry === null) {
2046
1604
  return null;
2047
1605
  }
@@ -2049,10 +1607,10 @@ var deserializeAws_restJson1__listOfPackagingConfiguration = function (output, c
2049
1607
  });
2050
1608
  return retVal;
2051
1609
  };
2052
- var deserializeAws_restJson1__listOfPackagingGroup = function (output, context) {
2053
- var retVal = (output || [])
2054
- .filter(function (e) { return e != null; })
2055
- .map(function (entry) {
1610
+ const deserializeAws_restJson1__listOfPackagingGroup = (output, context) => {
1611
+ const retVal = (output || [])
1612
+ .filter((e) => e != null)
1613
+ .map((entry) => {
2056
1614
  if (entry === null) {
2057
1615
  return null;
2058
1616
  }
@@ -2060,17 +1618,18 @@ var deserializeAws_restJson1__listOfPackagingGroup = function (output, context)
2060
1618
  });
2061
1619
  return retVal;
2062
1620
  };
2063
- var deserializeAws_restJson1__mapOf__string = function (output, context) {
2064
- return Object.entries(output).reduce(function (acc, _a) {
2065
- var _b;
2066
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1621
+ const deserializeAws_restJson1__mapOf__string = (output, context) => {
1622
+ return Object.entries(output).reduce((acc, [key, value]) => {
2067
1623
  if (value === null) {
2068
1624
  return acc;
2069
1625
  }
2070
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1626
+ return {
1627
+ ...acc,
1628
+ [key]: __expectString(value),
1629
+ };
2071
1630
  }, {});
2072
1631
  };
2073
- var deserializeAws_restJson1AssetShallow = function (output, context) {
1632
+ const deserializeAws_restJson1AssetShallow = (output, context) => {
2074
1633
  return {
2075
1634
  Arn: __expectString(output.arn),
2076
1635
  CreatedAt: __expectString(output.createdAt),
@@ -2082,13 +1641,13 @@ var deserializeAws_restJson1AssetShallow = function (output, context) {
2082
1641
  Tags: output.tags != null ? deserializeAws_restJson1Tags(output.tags, context) : undefined,
2083
1642
  };
2084
1643
  };
2085
- var deserializeAws_restJson1Authorization = function (output, context) {
1644
+ const deserializeAws_restJson1Authorization = (output, context) => {
2086
1645
  return {
2087
1646
  CdnIdentifierSecret: __expectString(output.cdnIdentifierSecret),
2088
1647
  SecretsRoleArn: __expectString(output.secretsRoleArn),
2089
1648
  };
2090
1649
  };
2091
- var deserializeAws_restJson1CmafEncryption = function (output, context) {
1650
+ const deserializeAws_restJson1CmafEncryption = (output, context) => {
2092
1651
  return {
2093
1652
  ConstantInitializationVector: __expectString(output.constantInitializationVector),
2094
1653
  SpekeKeyProvider: output.spekeKeyProvider != null
@@ -2096,7 +1655,7 @@ var deserializeAws_restJson1CmafEncryption = function (output, context) {
2096
1655
  : undefined,
2097
1656
  };
2098
1657
  };
2099
- var deserializeAws_restJson1CmafPackage = function (output, context) {
1658
+ const deserializeAws_restJson1CmafPackage = (output, context) => {
2100
1659
  return {
2101
1660
  Encryption: output.encryption != null ? deserializeAws_restJson1CmafEncryption(output.encryption, context) : undefined,
2102
1661
  HlsManifests: output.hlsManifests != null
@@ -2106,14 +1665,14 @@ var deserializeAws_restJson1CmafPackage = function (output, context) {
2106
1665
  SegmentDurationSeconds: __expectInt32(output.segmentDurationSeconds),
2107
1666
  };
2108
1667
  };
2109
- var deserializeAws_restJson1DashEncryption = function (output, context) {
1668
+ const deserializeAws_restJson1DashEncryption = (output, context) => {
2110
1669
  return {
2111
1670
  SpekeKeyProvider: output.spekeKeyProvider != null
2112
1671
  ? deserializeAws_restJson1SpekeKeyProvider(output.spekeKeyProvider, context)
2113
1672
  : undefined,
2114
1673
  };
2115
1674
  };
2116
- var deserializeAws_restJson1DashManifest = function (output, context) {
1675
+ const deserializeAws_restJson1DashManifest = (output, context) => {
2117
1676
  return {
2118
1677
  ManifestLayout: __expectString(output.manifestLayout),
2119
1678
  ManifestName: __expectString(output.manifestName),
@@ -2125,7 +1684,7 @@ var deserializeAws_restJson1DashManifest = function (output, context) {
2125
1684
  : undefined,
2126
1685
  };
2127
1686
  };
2128
- var deserializeAws_restJson1DashPackage = function (output, context) {
1687
+ const deserializeAws_restJson1DashPackage = (output, context) => {
2129
1688
  return {
2130
1689
  DashManifests: output.dashManifests != null
2131
1690
  ? deserializeAws_restJson1__listOfDashManifest(output.dashManifests, context)
@@ -2139,19 +1698,25 @@ var deserializeAws_restJson1DashPackage = function (output, context) {
2139
1698
  SegmentTemplateFormat: __expectString(output.segmentTemplateFormat),
2140
1699
  };
2141
1700
  };
2142
- var deserializeAws_restJson1EgressAccessLogs = function (output, context) {
1701
+ const deserializeAws_restJson1EgressAccessLogs = (output, context) => {
2143
1702
  return {
2144
1703
  LogGroupName: __expectString(output.logGroupName),
2145
1704
  };
2146
1705
  };
2147
- var deserializeAws_restJson1EgressEndpoint = function (output, context) {
1706
+ const deserializeAws_restJson1EgressEndpoint = (output, context) => {
2148
1707
  return {
2149
1708
  PackagingConfigurationId: __expectString(output.packagingConfigurationId),
2150
1709
  Status: __expectString(output.status),
2151
1710
  Url: __expectString(output.url),
2152
1711
  };
2153
1712
  };
2154
- var deserializeAws_restJson1HlsEncryption = function (output, context) {
1713
+ const deserializeAws_restJson1EncryptionContractConfiguration = (output, context) => {
1714
+ return {
1715
+ PresetSpeke20Audio: __expectString(output.presetSpeke20Audio),
1716
+ PresetSpeke20Video: __expectString(output.presetSpeke20Video),
1717
+ };
1718
+ };
1719
+ const deserializeAws_restJson1HlsEncryption = (output, context) => {
2155
1720
  return {
2156
1721
  ConstantInitializationVector: __expectString(output.constantInitializationVector),
2157
1722
  EncryptionMethod: __expectString(output.encryptionMethod),
@@ -2160,7 +1725,7 @@ var deserializeAws_restJson1HlsEncryption = function (output, context) {
2160
1725
  : undefined,
2161
1726
  };
2162
1727
  };
2163
- var deserializeAws_restJson1HlsManifest = function (output, context) {
1728
+ const deserializeAws_restJson1HlsManifest = (output, context) => {
2164
1729
  return {
2165
1730
  AdMarkers: __expectString(output.adMarkers),
2166
1731
  IncludeIframeOnlyStream: __expectBoolean(output.includeIframeOnlyStream),
@@ -2172,7 +1737,7 @@ var deserializeAws_restJson1HlsManifest = function (output, context) {
2172
1737
  : undefined,
2173
1738
  };
2174
1739
  };
2175
- var deserializeAws_restJson1HlsPackage = function (output, context) {
1740
+ const deserializeAws_restJson1HlsPackage = (output, context) => {
2176
1741
  return {
2177
1742
  Encryption: output.encryption != null ? deserializeAws_restJson1HlsEncryption(output.encryption, context) : undefined,
2178
1743
  HlsManifests: output.hlsManifests != null
@@ -2183,14 +1748,14 @@ var deserializeAws_restJson1HlsPackage = function (output, context) {
2183
1748
  UseAudioRenditionGroup: __expectBoolean(output.useAudioRenditionGroup),
2184
1749
  };
2185
1750
  };
2186
- var deserializeAws_restJson1MssEncryption = function (output, context) {
1751
+ const deserializeAws_restJson1MssEncryption = (output, context) => {
2187
1752
  return {
2188
1753
  SpekeKeyProvider: output.spekeKeyProvider != null
2189
1754
  ? deserializeAws_restJson1SpekeKeyProvider(output.spekeKeyProvider, context)
2190
1755
  : undefined,
2191
1756
  };
2192
1757
  };
2193
- var deserializeAws_restJson1MssManifest = function (output, context) {
1758
+ const deserializeAws_restJson1MssManifest = (output, context) => {
2194
1759
  return {
2195
1760
  ManifestName: __expectString(output.manifestName),
2196
1761
  StreamSelection: output.streamSelection != null
@@ -2198,7 +1763,7 @@ var deserializeAws_restJson1MssManifest = function (output, context) {
2198
1763
  : undefined,
2199
1764
  };
2200
1765
  };
2201
- var deserializeAws_restJson1MssPackage = function (output, context) {
1766
+ const deserializeAws_restJson1MssPackage = (output, context) => {
2202
1767
  return {
2203
1768
  Encryption: output.encryption != null ? deserializeAws_restJson1MssEncryption(output.encryption, context) : undefined,
2204
1769
  MssManifests: output.mssManifests != null
@@ -2207,7 +1772,7 @@ var deserializeAws_restJson1MssPackage = function (output, context) {
2207
1772
  SegmentDurationSeconds: __expectInt32(output.segmentDurationSeconds),
2208
1773
  };
2209
1774
  };
2210
- var deserializeAws_restJson1PackagingConfiguration = function (output, context) {
1775
+ const deserializeAws_restJson1PackagingConfiguration = (output, context) => {
2211
1776
  return {
2212
1777
  Arn: __expectString(output.arn),
2213
1778
  CmafPackage: output.cmafPackage != null ? deserializeAws_restJson1CmafPackage(output.cmafPackage, context) : undefined,
@@ -2219,7 +1784,7 @@ var deserializeAws_restJson1PackagingConfiguration = function (output, context)
2219
1784
  Tags: output.tags != null ? deserializeAws_restJson1Tags(output.tags, context) : undefined,
2220
1785
  };
2221
1786
  };
2222
- var deserializeAws_restJson1PackagingGroup = function (output, context) {
1787
+ const deserializeAws_restJson1PackagingGroup = (output, context) => {
2223
1788
  return {
2224
1789
  Arn: __expectString(output.arn),
2225
1790
  Authorization: output.authorization != null ? deserializeAws_restJson1Authorization(output.authorization, context) : undefined,
@@ -2231,81 +1796,67 @@ var deserializeAws_restJson1PackagingGroup = function (output, context) {
2231
1796
  Tags: output.tags != null ? deserializeAws_restJson1Tags(output.tags, context) : undefined,
2232
1797
  };
2233
1798
  };
2234
- var deserializeAws_restJson1SpekeKeyProvider = function (output, context) {
1799
+ const deserializeAws_restJson1SpekeKeyProvider = (output, context) => {
2235
1800
  return {
1801
+ EncryptionContractConfiguration: output.encryptionContractConfiguration != null
1802
+ ? deserializeAws_restJson1EncryptionContractConfiguration(output.encryptionContractConfiguration, context)
1803
+ : undefined,
2236
1804
  RoleArn: __expectString(output.roleArn),
2237
1805
  SystemIds: output.systemIds != null ? deserializeAws_restJson1__listOf__string(output.systemIds, context) : undefined,
2238
1806
  Url: __expectString(output.url),
2239
1807
  };
2240
1808
  };
2241
- var deserializeAws_restJson1StreamSelection = function (output, context) {
1809
+ const deserializeAws_restJson1StreamSelection = (output, context) => {
2242
1810
  return {
2243
1811
  MaxVideoBitsPerSecond: __expectInt32(output.maxVideoBitsPerSecond),
2244
1812
  MinVideoBitsPerSecond: __expectInt32(output.minVideoBitsPerSecond),
2245
1813
  StreamOrder: __expectString(output.streamOrder),
2246
1814
  };
2247
1815
  };
2248
- var deserializeAws_restJson1Tags = function (output, context) {
2249
- return Object.entries(output).reduce(function (acc, _a) {
2250
- var _b;
2251
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1816
+ const deserializeAws_restJson1Tags = (output, context) => {
1817
+ return Object.entries(output).reduce((acc, [key, value]) => {
2252
1818
  if (value === null) {
2253
1819
  return acc;
2254
1820
  }
2255
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1821
+ return {
1822
+ ...acc,
1823
+ [key]: __expectString(value),
1824
+ };
2256
1825
  }, {});
2257
1826
  };
2258
- var deserializeMetadata = function (output) {
2259
- var _a, _b;
2260
- return ({
2261
- httpStatusCode: output.statusCode,
2262
- 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"],
2263
- extendedRequestId: output.headers["x-amz-id-2"],
2264
- cfId: output.headers["x-amz-cf-id"],
2265
- });
2266
- };
2267
- var collectBody = function (streamBody, context) {
2268
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
1827
+ const deserializeMetadata = (output) => ({
1828
+ httpStatusCode: output.statusCode,
1829
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1830
+ extendedRequestId: output.headers["x-amz-id-2"],
1831
+ cfId: output.headers["x-amz-cf-id"],
1832
+ });
1833
+ const collectBody = (streamBody = new Uint8Array(), context) => {
2269
1834
  if (streamBody instanceof Uint8Array) {
2270
1835
  return Promise.resolve(streamBody);
2271
1836
  }
2272
1837
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
2273
1838
  };
2274
- var collectBodyString = function (streamBody, context) {
2275
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
2276
- };
2277
- var isSerializableHeaderValue = function (value) {
2278
- return value !== undefined &&
2279
- value !== null &&
2280
- value !== "" &&
2281
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
2282
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1839
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1840
+ const isSerializableHeaderValue = (value) => value !== undefined &&
1841
+ value !== null &&
1842
+ value !== "" &&
1843
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1844
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1845
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1846
+ if (encoded.length) {
1847
+ return JSON.parse(encoded);
1848
+ }
1849
+ return {};
1850
+ });
1851
+ const parseErrorBody = async (errorBody, context) => {
1852
+ const value = await parseBody(errorBody, context);
1853
+ value.message = value.message ?? value.Message;
1854
+ return value;
2283
1855
  };
2284
- var parseBody = function (streamBody, context) {
2285
- return collectBodyString(streamBody, context).then(function (encoded) {
2286
- if (encoded.length) {
2287
- return JSON.parse(encoded);
2288
- }
2289
- return {};
2290
- });
2291
- };
2292
- var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
2293
- var value;
2294
- var _a;
2295
- return __generator(this, function (_b) {
2296
- switch (_b.label) {
2297
- case 0: return [4, parseBody(errorBody, context)];
2298
- case 1:
2299
- value = _b.sent();
2300
- value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
2301
- return [2, value];
2302
- }
2303
- });
2304
- }); };
2305
- var loadRestJsonErrorCode = function (output, data) {
2306
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
2307
- var sanitizeErrorCode = function (rawValue) {
2308
- var cleanValue = rawValue;
1856
+ const loadRestJsonErrorCode = (output, data) => {
1857
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1858
+ const sanitizeErrorCode = (rawValue) => {
1859
+ let cleanValue = rawValue;
2309
1860
  if (typeof cleanValue === "number") {
2310
1861
  cleanValue = cleanValue.toString();
2311
1862
  }
@@ -2320,7 +1871,7 @@ var loadRestJsonErrorCode = function (output, data) {
2320
1871
  }
2321
1872
  return cleanValue;
2322
1873
  };
2323
- var headerKey = findKey(output.headers, "x-amzn-errortype");
1874
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
2324
1875
  if (headerKey !== undefined) {
2325
1876
  return sanitizeErrorCode(output.headers[headerKey]);
2326
1877
  }