@aws-sdk/client-chime-sdk-media-pipelines 3.79.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 (96) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE +201 -0
  3. package/README.md +212 -0
  4. package/dist-cjs/ChimeSDKMediaPipelines.js +112 -0
  5. package/dist-cjs/ChimeSDKMediaPipelinesClient.js +35 -0
  6. package/dist-cjs/commands/CreateMediaCapturePipelineCommand.js +36 -0
  7. package/dist-cjs/commands/DeleteMediaCapturePipelineCommand.js +36 -0
  8. package/dist-cjs/commands/GetMediaCapturePipelineCommand.js +36 -0
  9. package/dist-cjs/commands/ListMediaCapturePipelinesCommand.js +36 -0
  10. package/dist-cjs/commands/ListTagsForResourceCommand.js +36 -0
  11. package/dist-cjs/commands/TagResourceCommand.js +36 -0
  12. package/dist-cjs/commands/UntagResourceCommand.js +36 -0
  13. package/dist-cjs/commands/index.js +10 -0
  14. package/dist-cjs/endpoints.js +131 -0
  15. package/dist-cjs/index.js +11 -0
  16. package/dist-cjs/models/ChimeSDKMediaPipelinesServiceException.js +11 -0
  17. package/dist-cjs/models/index.js +4 -0
  18. package/dist-cjs/models/models_0.js +339 -0
  19. package/dist-cjs/pagination/Interfaces.js +2 -0
  20. package/dist-cjs/pagination/ListMediaCapturePipelinesPaginator.js +36 -0
  21. package/dist-cjs/pagination/index.js +5 -0
  22. package/dist-cjs/protocols/Aws_restJson1.js +999 -0
  23. package/dist-cjs/runtimeConfig.browser.js +45 -0
  24. package/dist-cjs/runtimeConfig.js +50 -0
  25. package/dist-cjs/runtimeConfig.native.js +16 -0
  26. package/dist-cjs/runtimeConfig.shared.js +17 -0
  27. package/dist-es/ChimeSDKMediaPipelines.js +115 -0
  28. package/dist-es/ChimeSDKMediaPipelinesClient.js +37 -0
  29. package/dist-es/commands/CreateMediaCapturePipelineCommand.js +39 -0
  30. package/dist-es/commands/DeleteMediaCapturePipelineCommand.js +39 -0
  31. package/dist-es/commands/GetMediaCapturePipelineCommand.js +39 -0
  32. package/dist-es/commands/ListMediaCapturePipelinesCommand.js +39 -0
  33. package/dist-es/commands/ListTagsForResourceCommand.js +39 -0
  34. package/dist-es/commands/TagResourceCommand.js +39 -0
  35. package/dist-es/commands/UntagResourceCommand.js +39 -0
  36. package/dist-es/commands/index.js +7 -0
  37. package/dist-es/endpoints.js +127 -0
  38. package/dist-es/index.js +6 -0
  39. package/dist-es/models/ChimeSDKMediaPipelinesServiceException.js +12 -0
  40. package/dist-es/models/index.js +1 -0
  41. package/dist-es/models/models_0.js +271 -0
  42. package/dist-es/pagination/Interfaces.js +1 -0
  43. package/dist-es/pagination/ListMediaCapturePipelinesPaginator.js +75 -0
  44. package/dist-es/pagination/index.js +2 -0
  45. package/dist-es/protocols/Aws_restJson1.js +1166 -0
  46. package/dist-es/runtimeConfig.browser.js +26 -0
  47. package/dist-es/runtimeConfig.js +28 -0
  48. package/dist-es/runtimeConfig.native.js +8 -0
  49. package/dist-es/runtimeConfig.shared.js +13 -0
  50. package/dist-types/ChimeSDKMediaPipelines.d.ts +59 -0
  51. package/dist-types/ChimeSDKMediaPipelinesClient.d.ts +154 -0
  52. package/dist-types/commands/CreateMediaCapturePipelineCommand.d.ts +35 -0
  53. package/dist-types/commands/DeleteMediaCapturePipelineCommand.d.ts +35 -0
  54. package/dist-types/commands/GetMediaCapturePipelineCommand.d.ts +35 -0
  55. package/dist-types/commands/ListMediaCapturePipelinesCommand.d.ts +35 -0
  56. package/dist-types/commands/ListTagsForResourceCommand.d.ts +35 -0
  57. package/dist-types/commands/TagResourceCommand.d.ts +35 -0
  58. package/dist-types/commands/UntagResourceCommand.d.ts +35 -0
  59. package/dist-types/commands/index.d.ts +7 -0
  60. package/dist-types/endpoints.d.ts +2 -0
  61. package/dist-types/index.d.ts +6 -0
  62. package/dist-types/models/ChimeSDKMediaPipelinesServiceException.d.ts +10 -0
  63. package/dist-types/models/index.d.ts +1 -0
  64. package/dist-types/models/models_0.d.ts +581 -0
  65. package/dist-types/pagination/Interfaces.d.ts +6 -0
  66. package/dist-types/pagination/ListMediaCapturePipelinesPaginator.d.ts +4 -0
  67. package/dist-types/pagination/index.d.ts +2 -0
  68. package/dist-types/protocols/Aws_restJson1.d.ts +23 -0
  69. package/dist-types/runtimeConfig.browser.d.ts +40 -0
  70. package/dist-types/runtimeConfig.d.ts +40 -0
  71. package/dist-types/runtimeConfig.native.d.ts +39 -0
  72. package/dist-types/runtimeConfig.shared.d.ts +13 -0
  73. package/dist-types/ts3.4/ChimeSDKMediaPipelines.d.ts +40 -0
  74. package/dist-types/ts3.4/ChimeSDKMediaPipelinesClient.d.ts +80 -0
  75. package/dist-types/ts3.4/commands/CreateMediaCapturePipelineCommand.d.ts +17 -0
  76. package/dist-types/ts3.4/commands/DeleteMediaCapturePipelineCommand.d.ts +17 -0
  77. package/dist-types/ts3.4/commands/GetMediaCapturePipelineCommand.d.ts +17 -0
  78. package/dist-types/ts3.4/commands/ListMediaCapturePipelinesCommand.d.ts +17 -0
  79. package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +17 -0
  80. package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +17 -0
  81. package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +17 -0
  82. package/dist-types/ts3.4/commands/index.d.ts +7 -0
  83. package/dist-types/ts3.4/endpoints.d.ts +2 -0
  84. package/dist-types/ts3.4/index.d.ts +6 -0
  85. package/dist-types/ts3.4/models/ChimeSDKMediaPipelinesServiceException.d.ts +6 -0
  86. package/dist-types/ts3.4/models/index.d.ts +1 -0
  87. package/dist-types/ts3.4/models/models_0.d.ts +370 -0
  88. package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
  89. package/dist-types/ts3.4/pagination/ListMediaCapturePipelinesPaginator.d.ts +4 -0
  90. package/dist-types/ts3.4/pagination/index.d.ts +2 -0
  91. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +23 -0
  92. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +38 -0
  93. package/dist-types/ts3.4/runtimeConfig.d.ts +38 -0
  94. package/dist-types/ts3.4/runtimeConfig.native.d.ts +37 -0
  95. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +11 -0
  96. package/package.json +95 -0
@@ -0,0 +1,1166 @@
1
+ import { __assign, __awaiter, __generator } from "tslib";
2
+ import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
+ import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, parseRfc3339DateTime as __parseRfc3339DateTime, } from "@aws-sdk/smithy-client";
4
+ import { v4 as generateIdempotencyToken } from "uuid";
5
+ import { ChimeSDKMediaPipelinesServiceException as __BaseException } from "../models/ChimeSDKMediaPipelinesServiceException";
6
+ import { BadRequestException, ForbiddenException, NotFoundException, ResourceLimitExceededException, ServiceFailureException, ServiceUnavailableException, ThrottledClientException, UnauthorizedClientException, } from "../models/models_0";
7
+ export var serializeAws_restJson1CreateMediaCapturePipelineCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
8
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
9
+ var _c;
10
+ return __generator(this, function (_d) {
11
+ switch (_d.label) {
12
+ case 0: return [4, context.endpoint()];
13
+ case 1:
14
+ _a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
15
+ headers = {
16
+ "content-type": "application/json",
17
+ };
18
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/sdk-media-capture-pipelines";
19
+ body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.ChimeSdkMeetingConfiguration !== undefined &&
20
+ input.ChimeSdkMeetingConfiguration !== null && {
21
+ ChimeSdkMeetingConfiguration: serializeAws_restJson1ChimeSdkMeetingConfiguration(input.ChimeSdkMeetingConfiguration, context),
22
+ })), { ClientRequestToken: (_c = input.ClientRequestToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }), (input.SinkArn !== undefined && input.SinkArn !== null && { SinkArn: input.SinkArn })), (input.SinkType !== undefined && input.SinkType !== null && { SinkType: input.SinkType })), (input.SourceArn !== undefined && input.SourceArn !== null && { SourceArn: input.SourceArn })), (input.SourceType !== undefined && input.SourceType !== null && { SourceType: input.SourceType })), (input.Tags !== undefined &&
23
+ input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) })));
24
+ return [2, new __HttpRequest({
25
+ protocol: protocol,
26
+ hostname: hostname,
27
+ port: port,
28
+ method: "POST",
29
+ headers: headers,
30
+ path: resolvedPath,
31
+ body: body,
32
+ })];
33
+ }
34
+ });
35
+ }); };
36
+ export var serializeAws_restJson1DeleteMediaCapturePipelineCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
37
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
38
+ return __generator(this, function (_c) {
39
+ switch (_c.label) {
40
+ case 0: return [4, context.endpoint()];
41
+ case 1:
42
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
43
+ headers = {};
44
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
45
+ "/sdk-media-capture-pipelines/{MediaPipelineId}";
46
+ if (input.MediaPipelineId !== undefined) {
47
+ labelValue = input.MediaPipelineId;
48
+ if (labelValue.length <= 0) {
49
+ throw new Error("Empty value provided for input HTTP label: MediaPipelineId.");
50
+ }
51
+ resolvedPath = resolvedPath.replace("{MediaPipelineId}", __extendedEncodeURIComponent(labelValue));
52
+ }
53
+ else {
54
+ throw new Error("No value provided for input HTTP label: MediaPipelineId.");
55
+ }
56
+ return [2, new __HttpRequest({
57
+ protocol: protocol,
58
+ hostname: hostname,
59
+ port: port,
60
+ method: "DELETE",
61
+ headers: headers,
62
+ path: resolvedPath,
63
+ body: body,
64
+ })];
65
+ }
66
+ });
67
+ }); };
68
+ export var serializeAws_restJson1GetMediaCapturePipelineCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
69
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
70
+ return __generator(this, function (_c) {
71
+ switch (_c.label) {
72
+ case 0: return [4, context.endpoint()];
73
+ case 1:
74
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
75
+ headers = {};
76
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
77
+ "/sdk-media-capture-pipelines/{MediaPipelineId}";
78
+ if (input.MediaPipelineId !== undefined) {
79
+ labelValue = input.MediaPipelineId;
80
+ if (labelValue.length <= 0) {
81
+ throw new Error("Empty value provided for input HTTP label: MediaPipelineId.");
82
+ }
83
+ resolvedPath = resolvedPath.replace("{MediaPipelineId}", __extendedEncodeURIComponent(labelValue));
84
+ }
85
+ else {
86
+ throw new Error("No value provided for input HTTP label: MediaPipelineId.");
87
+ }
88
+ return [2, new __HttpRequest({
89
+ protocol: protocol,
90
+ hostname: hostname,
91
+ port: port,
92
+ method: "GET",
93
+ headers: headers,
94
+ path: resolvedPath,
95
+ body: body,
96
+ })];
97
+ }
98
+ });
99
+ }); };
100
+ export var serializeAws_restJson1ListMediaCapturePipelinesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
101
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
102
+ return __generator(this, function (_c) {
103
+ switch (_c.label) {
104
+ case 0: return [4, context.endpoint()];
105
+ case 1:
106
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
107
+ headers = {};
108
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/sdk-media-capture-pipelines";
109
+ query = __assign(__assign({}, (input.NextToken !== undefined && { "next-token": input.NextToken })), (input.MaxResults !== undefined && { "max-results": input.MaxResults.toString() }));
110
+ return [2, new __HttpRequest({
111
+ protocol: protocol,
112
+ hostname: hostname,
113
+ port: port,
114
+ method: "GET",
115
+ headers: headers,
116
+ path: resolvedPath,
117
+ query: query,
118
+ body: body,
119
+ })];
120
+ }
121
+ });
122
+ }); };
123
+ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
124
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
125
+ return __generator(this, function (_c) {
126
+ switch (_c.label) {
127
+ case 0: return [4, context.endpoint()];
128
+ case 1:
129
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
130
+ headers = {};
131
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags";
132
+ query = __assign({}, (input.ResourceARN !== undefined && { arn: input.ResourceARN }));
133
+ return [2, new __HttpRequest({
134
+ protocol: protocol,
135
+ hostname: hostname,
136
+ port: port,
137
+ method: "GET",
138
+ headers: headers,
139
+ path: resolvedPath,
140
+ query: query,
141
+ body: body,
142
+ })];
143
+ }
144
+ });
145
+ }); };
146
+ export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
147
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
148
+ return __generator(this, function (_c) {
149
+ switch (_c.label) {
150
+ case 0: return [4, context.endpoint()];
151
+ case 1:
152
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
153
+ headers = {
154
+ "content-type": "application/json",
155
+ };
156
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags";
157
+ query = {
158
+ operation: "tag-resource",
159
+ };
160
+ body = JSON.stringify(__assign(__assign({}, (input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN })), (input.Tags !== undefined &&
161
+ input.Tags !== null && { Tags: serializeAws_restJson1TagList(input.Tags, context) })));
162
+ return [2, new __HttpRequest({
163
+ protocol: protocol,
164
+ hostname: hostname,
165
+ port: port,
166
+ method: "POST",
167
+ headers: headers,
168
+ path: resolvedPath,
169
+ query: query,
170
+ body: body,
171
+ })];
172
+ }
173
+ });
174
+ }); };
175
+ export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
176
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, 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
+ "content-type": "application/json",
184
+ };
185
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags";
186
+ query = {
187
+ operation: "untag-resource",
188
+ };
189
+ body = JSON.stringify(__assign(__assign({}, (input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN })), (input.TagKeys !== undefined &&
190
+ input.TagKeys !== null && { TagKeys: serializeAws_restJson1TagKeyList(input.TagKeys, context) })));
191
+ return [2, new __HttpRequest({
192
+ protocol: protocol,
193
+ hostname: hostname,
194
+ port: port,
195
+ method: "POST",
196
+ headers: headers,
197
+ path: resolvedPath,
198
+ query: query,
199
+ body: body,
200
+ })];
201
+ }
202
+ });
203
+ }); };
204
+ export var deserializeAws_restJson1CreateMediaCapturePipelineCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
205
+ var contents, data, _a, _b;
206
+ return __generator(this, function (_c) {
207
+ switch (_c.label) {
208
+ case 0:
209
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
210
+ return [2, deserializeAws_restJson1CreateMediaCapturePipelineCommandError(output, context)];
211
+ }
212
+ contents = {
213
+ $metadata: deserializeMetadata(output),
214
+ MediaCapturePipeline: undefined,
215
+ };
216
+ _a = __expectNonNull;
217
+ _b = __expectObject;
218
+ return [4, parseBody(output.body, context)];
219
+ case 1:
220
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
221
+ if (data.MediaCapturePipeline !== undefined && data.MediaCapturePipeline !== null) {
222
+ contents.MediaCapturePipeline = deserializeAws_restJson1MediaCapturePipeline(data.MediaCapturePipeline, context);
223
+ }
224
+ return [2, Promise.resolve(contents)];
225
+ }
226
+ });
227
+ }); };
228
+ var deserializeAws_restJson1CreateMediaCapturePipelineCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
229
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
230
+ var _c;
231
+ return __generator(this, function (_d) {
232
+ switch (_d.label) {
233
+ case 0:
234
+ _a = [__assign({}, output)];
235
+ _c = {};
236
+ return [4, parseBody(output.body, context)];
237
+ case 1:
238
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
239
+ errorCode = "UnknownError";
240
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
241
+ _b = errorCode;
242
+ switch (_b) {
243
+ case "BadRequestException": return [3, 2];
244
+ case "com.amazonaws.chimesdkmediapipelines#BadRequestException": return [3, 2];
245
+ case "ForbiddenException": return [3, 4];
246
+ case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": return [3, 4];
247
+ case "ResourceLimitExceededException": return [3, 6];
248
+ case "com.amazonaws.chimesdkmediapipelines#ResourceLimitExceededException": return [3, 6];
249
+ case "ServiceFailureException": return [3, 8];
250
+ case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": return [3, 8];
251
+ case "ServiceUnavailableException": return [3, 10];
252
+ case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": return [3, 10];
253
+ case "ThrottledClientException": return [3, 12];
254
+ case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": return [3, 12];
255
+ case "UnauthorizedClientException": return [3, 14];
256
+ case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": return [3, 14];
257
+ }
258
+ return [3, 16];
259
+ case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
260
+ case 3: throw _d.sent();
261
+ case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
262
+ case 5: throw _d.sent();
263
+ case 6: return [4, deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context)];
264
+ case 7: throw _d.sent();
265
+ case 8: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
266
+ case 9: throw _d.sent();
267
+ case 10: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
268
+ case 11: throw _d.sent();
269
+ case 12: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
270
+ case 13: throw _d.sent();
271
+ case 14: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
272
+ case 15: throw _d.sent();
273
+ case 16:
274
+ parsedBody = parsedOutput.body;
275
+ response = new __BaseException({
276
+ name: parsedBody.code || parsedBody.Code || errorCode,
277
+ $fault: "client",
278
+ $metadata: deserializeMetadata(output),
279
+ });
280
+ throw __decorateServiceException(response, parsedBody);
281
+ }
282
+ });
283
+ }); };
284
+ export var deserializeAws_restJson1DeleteMediaCapturePipelineCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
285
+ var contents;
286
+ return __generator(this, function (_a) {
287
+ switch (_a.label) {
288
+ case 0:
289
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
290
+ return [2, deserializeAws_restJson1DeleteMediaCapturePipelineCommandError(output, context)];
291
+ }
292
+ contents = {
293
+ $metadata: deserializeMetadata(output),
294
+ };
295
+ return [4, collectBody(output.body, context)];
296
+ case 1:
297
+ _a.sent();
298
+ return [2, Promise.resolve(contents)];
299
+ }
300
+ });
301
+ }); };
302
+ var deserializeAws_restJson1DeleteMediaCapturePipelineCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
303
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
304
+ var _c;
305
+ return __generator(this, function (_d) {
306
+ switch (_d.label) {
307
+ case 0:
308
+ _a = [__assign({}, output)];
309
+ _c = {};
310
+ return [4, parseBody(output.body, context)];
311
+ case 1:
312
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
313
+ errorCode = "UnknownError";
314
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
315
+ _b = errorCode;
316
+ switch (_b) {
317
+ case "BadRequestException": return [3, 2];
318
+ case "com.amazonaws.chimesdkmediapipelines#BadRequestException": return [3, 2];
319
+ case "ForbiddenException": return [3, 4];
320
+ case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": return [3, 4];
321
+ case "NotFoundException": return [3, 6];
322
+ case "com.amazonaws.chimesdkmediapipelines#NotFoundException": return [3, 6];
323
+ case "ServiceFailureException": return [3, 8];
324
+ case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": return [3, 8];
325
+ case "ServiceUnavailableException": return [3, 10];
326
+ case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": return [3, 10];
327
+ case "ThrottledClientException": return [3, 12];
328
+ case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": return [3, 12];
329
+ case "UnauthorizedClientException": return [3, 14];
330
+ case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": return [3, 14];
331
+ }
332
+ return [3, 16];
333
+ case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
334
+ case 3: throw _d.sent();
335
+ case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
336
+ case 5: throw _d.sent();
337
+ case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
338
+ case 7: throw _d.sent();
339
+ case 8: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
340
+ case 9: throw _d.sent();
341
+ case 10: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
342
+ case 11: throw _d.sent();
343
+ case 12: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
344
+ case 13: throw _d.sent();
345
+ case 14: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
346
+ case 15: throw _d.sent();
347
+ case 16:
348
+ parsedBody = parsedOutput.body;
349
+ response = new __BaseException({
350
+ name: parsedBody.code || parsedBody.Code || errorCode,
351
+ $fault: "client",
352
+ $metadata: deserializeMetadata(output),
353
+ });
354
+ throw __decorateServiceException(response, parsedBody);
355
+ }
356
+ });
357
+ }); };
358
+ export var deserializeAws_restJson1GetMediaCapturePipelineCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
359
+ var contents, data, _a, _b;
360
+ return __generator(this, function (_c) {
361
+ switch (_c.label) {
362
+ case 0:
363
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
364
+ return [2, deserializeAws_restJson1GetMediaCapturePipelineCommandError(output, context)];
365
+ }
366
+ contents = {
367
+ $metadata: deserializeMetadata(output),
368
+ MediaCapturePipeline: undefined,
369
+ };
370
+ _a = __expectNonNull;
371
+ _b = __expectObject;
372
+ return [4, parseBody(output.body, context)];
373
+ case 1:
374
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
375
+ if (data.MediaCapturePipeline !== undefined && data.MediaCapturePipeline !== null) {
376
+ contents.MediaCapturePipeline = deserializeAws_restJson1MediaCapturePipeline(data.MediaCapturePipeline, context);
377
+ }
378
+ return [2, Promise.resolve(contents)];
379
+ }
380
+ });
381
+ }); };
382
+ var deserializeAws_restJson1GetMediaCapturePipelineCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
383
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
384
+ var _c;
385
+ return __generator(this, function (_d) {
386
+ switch (_d.label) {
387
+ case 0:
388
+ _a = [__assign({}, output)];
389
+ _c = {};
390
+ return [4, parseBody(output.body, context)];
391
+ case 1:
392
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
393
+ errorCode = "UnknownError";
394
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
395
+ _b = errorCode;
396
+ switch (_b) {
397
+ case "BadRequestException": return [3, 2];
398
+ case "com.amazonaws.chimesdkmediapipelines#BadRequestException": return [3, 2];
399
+ case "ForbiddenException": return [3, 4];
400
+ case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": return [3, 4];
401
+ case "NotFoundException": return [3, 6];
402
+ case "com.amazonaws.chimesdkmediapipelines#NotFoundException": return [3, 6];
403
+ case "ServiceFailureException": return [3, 8];
404
+ case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": return [3, 8];
405
+ case "ServiceUnavailableException": return [3, 10];
406
+ case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": return [3, 10];
407
+ case "ThrottledClientException": return [3, 12];
408
+ case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": return [3, 12];
409
+ case "UnauthorizedClientException": return [3, 14];
410
+ case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": return [3, 14];
411
+ }
412
+ return [3, 16];
413
+ case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
414
+ case 3: throw _d.sent();
415
+ case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
416
+ case 5: throw _d.sent();
417
+ case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
418
+ case 7: throw _d.sent();
419
+ case 8: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
420
+ case 9: throw _d.sent();
421
+ case 10: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
422
+ case 11: throw _d.sent();
423
+ case 12: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
424
+ case 13: throw _d.sent();
425
+ case 14: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
426
+ case 15: throw _d.sent();
427
+ case 16:
428
+ parsedBody = parsedOutput.body;
429
+ response = new __BaseException({
430
+ name: parsedBody.code || parsedBody.Code || errorCode,
431
+ $fault: "client",
432
+ $metadata: deserializeMetadata(output),
433
+ });
434
+ throw __decorateServiceException(response, parsedBody);
435
+ }
436
+ });
437
+ }); };
438
+ export var deserializeAws_restJson1ListMediaCapturePipelinesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
439
+ var contents, data, _a, _b;
440
+ return __generator(this, function (_c) {
441
+ switch (_c.label) {
442
+ case 0:
443
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
444
+ return [2, deserializeAws_restJson1ListMediaCapturePipelinesCommandError(output, context)];
445
+ }
446
+ contents = {
447
+ $metadata: deserializeMetadata(output),
448
+ MediaCapturePipelines: undefined,
449
+ NextToken: undefined,
450
+ };
451
+ _a = __expectNonNull;
452
+ _b = __expectObject;
453
+ return [4, parseBody(output.body, context)];
454
+ case 1:
455
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
456
+ if (data.MediaCapturePipelines !== undefined && data.MediaCapturePipelines !== null) {
457
+ contents.MediaCapturePipelines = deserializeAws_restJson1MediaCapturePipelineSummaryList(data.MediaCapturePipelines, context);
458
+ }
459
+ if (data.NextToken !== undefined && data.NextToken !== null) {
460
+ contents.NextToken = __expectString(data.NextToken);
461
+ }
462
+ return [2, Promise.resolve(contents)];
463
+ }
464
+ });
465
+ }); };
466
+ var deserializeAws_restJson1ListMediaCapturePipelinesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
467
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
468
+ var _c;
469
+ return __generator(this, function (_d) {
470
+ switch (_d.label) {
471
+ case 0:
472
+ _a = [__assign({}, output)];
473
+ _c = {};
474
+ return [4, parseBody(output.body, context)];
475
+ case 1:
476
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
477
+ errorCode = "UnknownError";
478
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
479
+ _b = errorCode;
480
+ switch (_b) {
481
+ case "BadRequestException": return [3, 2];
482
+ case "com.amazonaws.chimesdkmediapipelines#BadRequestException": return [3, 2];
483
+ case "ForbiddenException": return [3, 4];
484
+ case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": return [3, 4];
485
+ case "ResourceLimitExceededException": return [3, 6];
486
+ case "com.amazonaws.chimesdkmediapipelines#ResourceLimitExceededException": return [3, 6];
487
+ case "ServiceFailureException": return [3, 8];
488
+ case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": return [3, 8];
489
+ case "ServiceUnavailableException": return [3, 10];
490
+ case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": return [3, 10];
491
+ case "ThrottledClientException": return [3, 12];
492
+ case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": return [3, 12];
493
+ case "UnauthorizedClientException": return [3, 14];
494
+ case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": return [3, 14];
495
+ }
496
+ return [3, 16];
497
+ case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
498
+ case 3: throw _d.sent();
499
+ case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
500
+ case 5: throw _d.sent();
501
+ case 6: return [4, deserializeAws_restJson1ResourceLimitExceededExceptionResponse(parsedOutput, context)];
502
+ case 7: throw _d.sent();
503
+ case 8: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
504
+ case 9: throw _d.sent();
505
+ case 10: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
506
+ case 11: throw _d.sent();
507
+ case 12: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
508
+ case 13: throw _d.sent();
509
+ case 14: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
510
+ case 15: throw _d.sent();
511
+ case 16:
512
+ parsedBody = parsedOutput.body;
513
+ response = new __BaseException({
514
+ name: parsedBody.code || parsedBody.Code || errorCode,
515
+ $fault: "client",
516
+ $metadata: deserializeMetadata(output),
517
+ });
518
+ throw __decorateServiceException(response, parsedBody);
519
+ }
520
+ });
521
+ }); };
522
+ export var deserializeAws_restJson1ListTagsForResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
523
+ var contents, data, _a, _b;
524
+ return __generator(this, function (_c) {
525
+ switch (_c.label) {
526
+ case 0:
527
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
528
+ return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
529
+ }
530
+ contents = {
531
+ $metadata: deserializeMetadata(output),
532
+ Tags: undefined,
533
+ };
534
+ _a = __expectNonNull;
535
+ _b = __expectObject;
536
+ return [4, parseBody(output.body, context)];
537
+ case 1:
538
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
539
+ if (data.Tags !== undefined && data.Tags !== null) {
540
+ contents.Tags = deserializeAws_restJson1TagList(data.Tags, context);
541
+ }
542
+ return [2, Promise.resolve(contents)];
543
+ }
544
+ });
545
+ }); };
546
+ var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
547
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
548
+ var _c;
549
+ return __generator(this, function (_d) {
550
+ switch (_d.label) {
551
+ case 0:
552
+ _a = [__assign({}, output)];
553
+ _c = {};
554
+ return [4, parseBody(output.body, context)];
555
+ case 1:
556
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
557
+ errorCode = "UnknownError";
558
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
559
+ _b = errorCode;
560
+ switch (_b) {
561
+ case "BadRequestException": return [3, 2];
562
+ case "com.amazonaws.chimesdkmediapipelines#BadRequestException": return [3, 2];
563
+ case "ForbiddenException": return [3, 4];
564
+ case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": return [3, 4];
565
+ case "NotFoundException": return [3, 6];
566
+ case "com.amazonaws.chimesdkmediapipelines#NotFoundException": return [3, 6];
567
+ case "ServiceFailureException": return [3, 8];
568
+ case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": return [3, 8];
569
+ case "ServiceUnavailableException": return [3, 10];
570
+ case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": return [3, 10];
571
+ case "ThrottledClientException": return [3, 12];
572
+ case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": return [3, 12];
573
+ case "UnauthorizedClientException": return [3, 14];
574
+ case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": return [3, 14];
575
+ }
576
+ return [3, 16];
577
+ case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
578
+ case 3: throw _d.sent();
579
+ case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
580
+ case 5: throw _d.sent();
581
+ case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
582
+ case 7: throw _d.sent();
583
+ case 8: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
584
+ case 9: throw _d.sent();
585
+ case 10: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
586
+ case 11: throw _d.sent();
587
+ case 12: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
588
+ case 13: throw _d.sent();
589
+ case 14: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
590
+ case 15: throw _d.sent();
591
+ case 16:
592
+ parsedBody = parsedOutput.body;
593
+ response = new __BaseException({
594
+ name: parsedBody.code || parsedBody.Code || errorCode,
595
+ $fault: "client",
596
+ $metadata: deserializeMetadata(output),
597
+ });
598
+ throw __decorateServiceException(response, parsedBody);
599
+ }
600
+ });
601
+ }); };
602
+ export var deserializeAws_restJson1TagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
603
+ var contents;
604
+ return __generator(this, function (_a) {
605
+ switch (_a.label) {
606
+ case 0:
607
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
608
+ return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
609
+ }
610
+ contents = {
611
+ $metadata: deserializeMetadata(output),
612
+ };
613
+ return [4, collectBody(output.body, context)];
614
+ case 1:
615
+ _a.sent();
616
+ return [2, Promise.resolve(contents)];
617
+ }
618
+ });
619
+ }); };
620
+ var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
621
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
622
+ var _c;
623
+ return __generator(this, function (_d) {
624
+ switch (_d.label) {
625
+ case 0:
626
+ _a = [__assign({}, output)];
627
+ _c = {};
628
+ return [4, parseBody(output.body, context)];
629
+ case 1:
630
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
631
+ errorCode = "UnknownError";
632
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
633
+ _b = errorCode;
634
+ switch (_b) {
635
+ case "BadRequestException": return [3, 2];
636
+ case "com.amazonaws.chimesdkmediapipelines#BadRequestException": return [3, 2];
637
+ case "ForbiddenException": return [3, 4];
638
+ case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": return [3, 4];
639
+ case "NotFoundException": return [3, 6];
640
+ case "com.amazonaws.chimesdkmediapipelines#NotFoundException": return [3, 6];
641
+ case "ServiceFailureException": return [3, 8];
642
+ case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": return [3, 8];
643
+ case "ServiceUnavailableException": return [3, 10];
644
+ case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": return [3, 10];
645
+ case "ThrottledClientException": return [3, 12];
646
+ case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": return [3, 12];
647
+ case "UnauthorizedClientException": return [3, 14];
648
+ case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": return [3, 14];
649
+ }
650
+ return [3, 16];
651
+ case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
652
+ case 3: throw _d.sent();
653
+ case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
654
+ case 5: throw _d.sent();
655
+ case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
656
+ case 7: throw _d.sent();
657
+ case 8: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
658
+ case 9: throw _d.sent();
659
+ case 10: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
660
+ case 11: throw _d.sent();
661
+ case 12: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
662
+ case 13: throw _d.sent();
663
+ case 14: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
664
+ case 15: throw _d.sent();
665
+ case 16:
666
+ parsedBody = parsedOutput.body;
667
+ response = new __BaseException({
668
+ name: parsedBody.code || parsedBody.Code || errorCode,
669
+ $fault: "client",
670
+ $metadata: deserializeMetadata(output),
671
+ });
672
+ throw __decorateServiceException(response, parsedBody);
673
+ }
674
+ });
675
+ }); };
676
+ export var deserializeAws_restJson1UntagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
677
+ var contents;
678
+ return __generator(this, function (_a) {
679
+ switch (_a.label) {
680
+ case 0:
681
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
682
+ return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
683
+ }
684
+ contents = {
685
+ $metadata: deserializeMetadata(output),
686
+ };
687
+ return [4, collectBody(output.body, context)];
688
+ case 1:
689
+ _a.sent();
690
+ return [2, Promise.resolve(contents)];
691
+ }
692
+ });
693
+ }); };
694
+ var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
695
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
696
+ var _c;
697
+ return __generator(this, function (_d) {
698
+ switch (_d.label) {
699
+ case 0:
700
+ _a = [__assign({}, output)];
701
+ _c = {};
702
+ return [4, parseBody(output.body, context)];
703
+ case 1:
704
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
705
+ errorCode = "UnknownError";
706
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
707
+ _b = errorCode;
708
+ switch (_b) {
709
+ case "BadRequestException": return [3, 2];
710
+ case "com.amazonaws.chimesdkmediapipelines#BadRequestException": return [3, 2];
711
+ case "ForbiddenException": return [3, 4];
712
+ case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": return [3, 4];
713
+ case "NotFoundException": return [3, 6];
714
+ case "com.amazonaws.chimesdkmediapipelines#NotFoundException": return [3, 6];
715
+ case "ServiceFailureException": return [3, 8];
716
+ case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": return [3, 8];
717
+ case "ServiceUnavailableException": return [3, 10];
718
+ case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": return [3, 10];
719
+ case "ThrottledClientException": return [3, 12];
720
+ case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": return [3, 12];
721
+ case "UnauthorizedClientException": return [3, 14];
722
+ case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": return [3, 14];
723
+ }
724
+ return [3, 16];
725
+ case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
726
+ case 3: throw _d.sent();
727
+ case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
728
+ case 5: throw _d.sent();
729
+ case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
730
+ case 7: throw _d.sent();
731
+ case 8: return [4, deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)];
732
+ case 9: throw _d.sent();
733
+ case 10: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
734
+ case 11: throw _d.sent();
735
+ case 12: return [4, deserializeAws_restJson1ThrottledClientExceptionResponse(parsedOutput, context)];
736
+ case 13: throw _d.sent();
737
+ case 14: return [4, deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)];
738
+ case 15: throw _d.sent();
739
+ case 16:
740
+ parsedBody = parsedOutput.body;
741
+ response = new __BaseException({
742
+ name: parsedBody.code || parsedBody.Code || errorCode,
743
+ $fault: "client",
744
+ $metadata: deserializeMetadata(output),
745
+ });
746
+ throw __decorateServiceException(response, parsedBody);
747
+ }
748
+ });
749
+ }); };
750
+ var deserializeAws_restJson1BadRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
751
+ var contents, data, exception;
752
+ return __generator(this, function (_a) {
753
+ contents = {};
754
+ data = parsedOutput.body;
755
+ if (data.Code !== undefined && data.Code !== null) {
756
+ contents.Code = __expectString(data.Code);
757
+ }
758
+ if (data.Message !== undefined && data.Message !== null) {
759
+ contents.Message = __expectString(data.Message);
760
+ }
761
+ if (data.RequestId !== undefined && data.RequestId !== null) {
762
+ contents.RequestId = __expectString(data.RequestId);
763
+ }
764
+ exception = new BadRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
765
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
766
+ });
767
+ }); };
768
+ var deserializeAws_restJson1ForbiddenExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
769
+ var contents, data, exception;
770
+ return __generator(this, function (_a) {
771
+ contents = {};
772
+ data = parsedOutput.body;
773
+ if (data.Code !== undefined && data.Code !== null) {
774
+ contents.Code = __expectString(data.Code);
775
+ }
776
+ if (data.Message !== undefined && data.Message !== null) {
777
+ contents.Message = __expectString(data.Message);
778
+ }
779
+ if (data.RequestId !== undefined && data.RequestId !== null) {
780
+ contents.RequestId = __expectString(data.RequestId);
781
+ }
782
+ exception = new ForbiddenException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
783
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
784
+ });
785
+ }); };
786
+ var deserializeAws_restJson1NotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
787
+ var contents, data, exception;
788
+ return __generator(this, function (_a) {
789
+ contents = {};
790
+ data = parsedOutput.body;
791
+ if (data.Code !== undefined && data.Code !== null) {
792
+ contents.Code = __expectString(data.Code);
793
+ }
794
+ if (data.Message !== undefined && data.Message !== null) {
795
+ contents.Message = __expectString(data.Message);
796
+ }
797
+ if (data.RequestId !== undefined && data.RequestId !== null) {
798
+ contents.RequestId = __expectString(data.RequestId);
799
+ }
800
+ exception = new NotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
801
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
802
+ });
803
+ }); };
804
+ var deserializeAws_restJson1ResourceLimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
805
+ var contents, data, exception;
806
+ return __generator(this, function (_a) {
807
+ contents = {};
808
+ data = parsedOutput.body;
809
+ if (data.Code !== undefined && data.Code !== null) {
810
+ contents.Code = __expectString(data.Code);
811
+ }
812
+ if (data.Message !== undefined && data.Message !== null) {
813
+ contents.Message = __expectString(data.Message);
814
+ }
815
+ if (data.RequestId !== undefined && data.RequestId !== null) {
816
+ contents.RequestId = __expectString(data.RequestId);
817
+ }
818
+ exception = new ResourceLimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
819
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
820
+ });
821
+ }); };
822
+ var deserializeAws_restJson1ServiceFailureExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
823
+ var contents, data, exception;
824
+ return __generator(this, function (_a) {
825
+ contents = {};
826
+ data = parsedOutput.body;
827
+ if (data.Code !== undefined && data.Code !== null) {
828
+ contents.Code = __expectString(data.Code);
829
+ }
830
+ if (data.Message !== undefined && data.Message !== null) {
831
+ contents.Message = __expectString(data.Message);
832
+ }
833
+ if (data.RequestId !== undefined && data.RequestId !== null) {
834
+ contents.RequestId = __expectString(data.RequestId);
835
+ }
836
+ exception = new ServiceFailureException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
837
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
838
+ });
839
+ }); };
840
+ var deserializeAws_restJson1ServiceUnavailableExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
841
+ var contents, data, exception;
842
+ return __generator(this, function (_a) {
843
+ contents = {};
844
+ data = parsedOutput.body;
845
+ if (data.Code !== undefined && data.Code !== null) {
846
+ contents.Code = __expectString(data.Code);
847
+ }
848
+ if (data.Message !== undefined && data.Message !== null) {
849
+ contents.Message = __expectString(data.Message);
850
+ }
851
+ if (data.RequestId !== undefined && data.RequestId !== null) {
852
+ contents.RequestId = __expectString(data.RequestId);
853
+ }
854
+ exception = new ServiceUnavailableException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
855
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
856
+ });
857
+ }); };
858
+ var deserializeAws_restJson1ThrottledClientExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
859
+ var contents, data, exception;
860
+ return __generator(this, function (_a) {
861
+ contents = {};
862
+ data = parsedOutput.body;
863
+ if (data.Code !== undefined && data.Code !== null) {
864
+ contents.Code = __expectString(data.Code);
865
+ }
866
+ if (data.Message !== undefined && data.Message !== null) {
867
+ contents.Message = __expectString(data.Message);
868
+ }
869
+ if (data.RequestId !== undefined && data.RequestId !== null) {
870
+ contents.RequestId = __expectString(data.RequestId);
871
+ }
872
+ exception = new ThrottledClientException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
873
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
874
+ });
875
+ }); };
876
+ var deserializeAws_restJson1UnauthorizedClientExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
877
+ var contents, data, exception;
878
+ return __generator(this, function (_a) {
879
+ contents = {};
880
+ data = parsedOutput.body;
881
+ if (data.Code !== undefined && data.Code !== null) {
882
+ contents.Code = __expectString(data.Code);
883
+ }
884
+ if (data.Message !== undefined && data.Message !== null) {
885
+ contents.Message = __expectString(data.Message);
886
+ }
887
+ if (data.RequestId !== undefined && data.RequestId !== null) {
888
+ contents.RequestId = __expectString(data.RequestId);
889
+ }
890
+ exception = new UnauthorizedClientException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
891
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
892
+ });
893
+ }); };
894
+ var serializeAws_restJson1ArtifactsConfiguration = function (input, context) {
895
+ return __assign(__assign(__assign({}, (input.Audio !== undefined &&
896
+ input.Audio !== null && { Audio: serializeAws_restJson1AudioArtifactsConfiguration(input.Audio, context) })), (input.Content !== undefined &&
897
+ input.Content !== null && {
898
+ Content: serializeAws_restJson1ContentArtifactsConfiguration(input.Content, context),
899
+ })), (input.Video !== undefined &&
900
+ input.Video !== null && { Video: serializeAws_restJson1VideoArtifactsConfiguration(input.Video, context) }));
901
+ };
902
+ var serializeAws_restJson1AttendeeIdList = function (input, context) {
903
+ return input
904
+ .filter(function (e) { return e != null; })
905
+ .map(function (entry) {
906
+ if (entry === null) {
907
+ return null;
908
+ }
909
+ return entry;
910
+ });
911
+ };
912
+ var serializeAws_restJson1AudioArtifactsConfiguration = function (input, context) {
913
+ return __assign({}, (input.MuxType !== undefined && input.MuxType !== null && { MuxType: input.MuxType }));
914
+ };
915
+ var serializeAws_restJson1ChimeSdkMeetingConfiguration = function (input, context) {
916
+ return __assign(__assign({}, (input.ArtifactsConfiguration !== undefined &&
917
+ input.ArtifactsConfiguration !== null && {
918
+ ArtifactsConfiguration: serializeAws_restJson1ArtifactsConfiguration(input.ArtifactsConfiguration, context),
919
+ })), (input.SourceConfiguration !== undefined &&
920
+ input.SourceConfiguration !== null && {
921
+ SourceConfiguration: serializeAws_restJson1SourceConfiguration(input.SourceConfiguration, context),
922
+ }));
923
+ };
924
+ var serializeAws_restJson1ContentArtifactsConfiguration = function (input, context) {
925
+ return __assign(__assign({}, (input.MuxType !== undefined && input.MuxType !== null && { MuxType: input.MuxType })), (input.State !== undefined && input.State !== null && { State: input.State }));
926
+ };
927
+ var serializeAws_restJson1ExternalUserIdList = function (input, context) {
928
+ return input
929
+ .filter(function (e) { return e != null; })
930
+ .map(function (entry) {
931
+ if (entry === null) {
932
+ return null;
933
+ }
934
+ return entry;
935
+ });
936
+ };
937
+ var serializeAws_restJson1SelectedVideoStreams = function (input, context) {
938
+ return __assign(__assign({}, (input.AttendeeIds !== undefined &&
939
+ input.AttendeeIds !== null && { AttendeeIds: serializeAws_restJson1AttendeeIdList(input.AttendeeIds, context) })), (input.ExternalUserIds !== undefined &&
940
+ input.ExternalUserIds !== null && {
941
+ ExternalUserIds: serializeAws_restJson1ExternalUserIdList(input.ExternalUserIds, context),
942
+ }));
943
+ };
944
+ var serializeAws_restJson1SourceConfiguration = function (input, context) {
945
+ return __assign({}, (input.SelectedVideoStreams !== undefined &&
946
+ input.SelectedVideoStreams !== null && {
947
+ SelectedVideoStreams: serializeAws_restJson1SelectedVideoStreams(input.SelectedVideoStreams, context),
948
+ }));
949
+ };
950
+ var serializeAws_restJson1Tag = function (input, context) {
951
+ return __assign(__assign({}, (input.Key !== undefined && input.Key !== null && { Key: input.Key })), (input.Value !== undefined && input.Value !== null && { Value: input.Value }));
952
+ };
953
+ var serializeAws_restJson1TagKeyList = function (input, context) {
954
+ return input
955
+ .filter(function (e) { return e != null; })
956
+ .map(function (entry) {
957
+ if (entry === null) {
958
+ return null;
959
+ }
960
+ return entry;
961
+ });
962
+ };
963
+ var serializeAws_restJson1TagList = function (input, context) {
964
+ return input
965
+ .filter(function (e) { return e != null; })
966
+ .map(function (entry) {
967
+ if (entry === null) {
968
+ return null;
969
+ }
970
+ return serializeAws_restJson1Tag(entry, context);
971
+ });
972
+ };
973
+ var serializeAws_restJson1VideoArtifactsConfiguration = function (input, context) {
974
+ return __assign(__assign({}, (input.MuxType !== undefined && input.MuxType !== null && { MuxType: input.MuxType })), (input.State !== undefined && input.State !== null && { State: input.State }));
975
+ };
976
+ var deserializeAws_restJson1ArtifactsConfiguration = function (output, context) {
977
+ return {
978
+ Audio: output.Audio !== undefined && output.Audio !== null
979
+ ? deserializeAws_restJson1AudioArtifactsConfiguration(output.Audio, context)
980
+ : undefined,
981
+ Content: output.Content !== undefined && output.Content !== null
982
+ ? deserializeAws_restJson1ContentArtifactsConfiguration(output.Content, context)
983
+ : undefined,
984
+ Video: output.Video !== undefined && output.Video !== null
985
+ ? deserializeAws_restJson1VideoArtifactsConfiguration(output.Video, context)
986
+ : undefined,
987
+ };
988
+ };
989
+ var deserializeAws_restJson1AttendeeIdList = function (output, context) {
990
+ var retVal = (output || [])
991
+ .filter(function (e) { return e != null; })
992
+ .map(function (entry) {
993
+ if (entry === null) {
994
+ return null;
995
+ }
996
+ return __expectString(entry);
997
+ });
998
+ return retVal;
999
+ };
1000
+ var deserializeAws_restJson1AudioArtifactsConfiguration = function (output, context) {
1001
+ return {
1002
+ MuxType: __expectString(output.MuxType),
1003
+ };
1004
+ };
1005
+ var deserializeAws_restJson1ChimeSdkMeetingConfiguration = function (output, context) {
1006
+ return {
1007
+ ArtifactsConfiguration: output.ArtifactsConfiguration !== undefined && output.ArtifactsConfiguration !== null
1008
+ ? deserializeAws_restJson1ArtifactsConfiguration(output.ArtifactsConfiguration, context)
1009
+ : undefined,
1010
+ SourceConfiguration: output.SourceConfiguration !== undefined && output.SourceConfiguration !== null
1011
+ ? deserializeAws_restJson1SourceConfiguration(output.SourceConfiguration, context)
1012
+ : undefined,
1013
+ };
1014
+ };
1015
+ var deserializeAws_restJson1ContentArtifactsConfiguration = function (output, context) {
1016
+ return {
1017
+ MuxType: __expectString(output.MuxType),
1018
+ State: __expectString(output.State),
1019
+ };
1020
+ };
1021
+ var deserializeAws_restJson1ExternalUserIdList = function (output, context) {
1022
+ var retVal = (output || [])
1023
+ .filter(function (e) { return e != null; })
1024
+ .map(function (entry) {
1025
+ if (entry === null) {
1026
+ return null;
1027
+ }
1028
+ return __expectString(entry);
1029
+ });
1030
+ return retVal;
1031
+ };
1032
+ var deserializeAws_restJson1MediaCapturePipeline = function (output, context) {
1033
+ return {
1034
+ ChimeSdkMeetingConfiguration: output.ChimeSdkMeetingConfiguration !== undefined && output.ChimeSdkMeetingConfiguration !== null
1035
+ ? deserializeAws_restJson1ChimeSdkMeetingConfiguration(output.ChimeSdkMeetingConfiguration, context)
1036
+ : undefined,
1037
+ CreatedTimestamp: output.CreatedTimestamp !== undefined && output.CreatedTimestamp !== null
1038
+ ? __expectNonNull(__parseRfc3339DateTime(output.CreatedTimestamp))
1039
+ : undefined,
1040
+ MediaPipelineArn: __expectString(output.MediaPipelineArn),
1041
+ MediaPipelineId: __expectString(output.MediaPipelineId),
1042
+ SinkArn: __expectString(output.SinkArn),
1043
+ SinkType: __expectString(output.SinkType),
1044
+ SourceArn: __expectString(output.SourceArn),
1045
+ SourceType: __expectString(output.SourceType),
1046
+ Status: __expectString(output.Status),
1047
+ UpdatedTimestamp: output.UpdatedTimestamp !== undefined && output.UpdatedTimestamp !== null
1048
+ ? __expectNonNull(__parseRfc3339DateTime(output.UpdatedTimestamp))
1049
+ : undefined,
1050
+ };
1051
+ };
1052
+ var deserializeAws_restJson1MediaCapturePipelineSummary = function (output, context) {
1053
+ return {
1054
+ MediaPipelineArn: __expectString(output.MediaPipelineArn),
1055
+ MediaPipelineId: __expectString(output.MediaPipelineId),
1056
+ };
1057
+ };
1058
+ var deserializeAws_restJson1MediaCapturePipelineSummaryList = function (output, context) {
1059
+ var retVal = (output || [])
1060
+ .filter(function (e) { return e != null; })
1061
+ .map(function (entry) {
1062
+ if (entry === null) {
1063
+ return null;
1064
+ }
1065
+ return deserializeAws_restJson1MediaCapturePipelineSummary(entry, context);
1066
+ });
1067
+ return retVal;
1068
+ };
1069
+ var deserializeAws_restJson1SelectedVideoStreams = function (output, context) {
1070
+ return {
1071
+ AttendeeIds: output.AttendeeIds !== undefined && output.AttendeeIds !== null
1072
+ ? deserializeAws_restJson1AttendeeIdList(output.AttendeeIds, context)
1073
+ : undefined,
1074
+ ExternalUserIds: output.ExternalUserIds !== undefined && output.ExternalUserIds !== null
1075
+ ? deserializeAws_restJson1ExternalUserIdList(output.ExternalUserIds, context)
1076
+ : undefined,
1077
+ };
1078
+ };
1079
+ var deserializeAws_restJson1SourceConfiguration = function (output, context) {
1080
+ return {
1081
+ SelectedVideoStreams: output.SelectedVideoStreams !== undefined && output.SelectedVideoStreams !== null
1082
+ ? deserializeAws_restJson1SelectedVideoStreams(output.SelectedVideoStreams, context)
1083
+ : undefined,
1084
+ };
1085
+ };
1086
+ var deserializeAws_restJson1Tag = function (output, context) {
1087
+ return {
1088
+ Key: __expectString(output.Key),
1089
+ Value: __expectString(output.Value),
1090
+ };
1091
+ };
1092
+ var deserializeAws_restJson1TagList = function (output, context) {
1093
+ var retVal = (output || [])
1094
+ .filter(function (e) { return e != null; })
1095
+ .map(function (entry) {
1096
+ if (entry === null) {
1097
+ return null;
1098
+ }
1099
+ return deserializeAws_restJson1Tag(entry, context);
1100
+ });
1101
+ return retVal;
1102
+ };
1103
+ var deserializeAws_restJson1VideoArtifactsConfiguration = function (output, context) {
1104
+ return {
1105
+ MuxType: __expectString(output.MuxType),
1106
+ State: __expectString(output.State),
1107
+ };
1108
+ };
1109
+ var deserializeMetadata = function (output) {
1110
+ var _a;
1111
+ return ({
1112
+ httpStatusCode: output.statusCode,
1113
+ requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"],
1114
+ extendedRequestId: output.headers["x-amz-id-2"],
1115
+ cfId: output.headers["x-amz-cf-id"],
1116
+ });
1117
+ };
1118
+ var collectBody = function (streamBody, context) {
1119
+ if (streamBody === void 0) { streamBody = new Uint8Array(); }
1120
+ if (streamBody instanceof Uint8Array) {
1121
+ return Promise.resolve(streamBody);
1122
+ }
1123
+ return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1124
+ };
1125
+ var collectBodyString = function (streamBody, context) {
1126
+ return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
1127
+ };
1128
+ var isSerializableHeaderValue = function (value) {
1129
+ return value !== undefined &&
1130
+ value !== null &&
1131
+ value !== "" &&
1132
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1133
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1134
+ };
1135
+ var parseBody = function (streamBody, context) {
1136
+ return collectBodyString(streamBody, context).then(function (encoded) {
1137
+ if (encoded.length) {
1138
+ return JSON.parse(encoded);
1139
+ }
1140
+ return {};
1141
+ });
1142
+ };
1143
+ var loadRestJsonErrorCode = function (output, data) {
1144
+ var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
1145
+ var sanitizeErrorCode = function (rawValue) {
1146
+ var cleanValue = rawValue;
1147
+ if (cleanValue.indexOf(":") >= 0) {
1148
+ cleanValue = cleanValue.split(":")[0];
1149
+ }
1150
+ if (cleanValue.indexOf("#") >= 0) {
1151
+ cleanValue = cleanValue.split("#")[1];
1152
+ }
1153
+ return cleanValue;
1154
+ };
1155
+ var headerKey = findKey(output.headers, "x-amzn-errortype");
1156
+ if (headerKey !== undefined) {
1157
+ return sanitizeErrorCode(output.headers[headerKey]);
1158
+ }
1159
+ if (data.code !== undefined) {
1160
+ return sanitizeErrorCode(data.code);
1161
+ }
1162
+ if (data["__type"] !== undefined) {
1163
+ return sanitizeErrorCode(data["__type"]);
1164
+ }
1165
+ return "";
1166
+ };