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