@aws-sdk/client-mediatailor 3.131.0 → 3.142.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 (93) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +1 -1
  3. package/dist-cjs/commands/ConfigureLogsForPlaybackConfigurationCommand.js +2 -2
  4. package/dist-cjs/commands/CreateChannelCommand.js +2 -2
  5. package/dist-cjs/commands/CreateLiveSourceCommand.js +2 -2
  6. package/dist-cjs/commands/CreatePrefetchScheduleCommand.js +2 -2
  7. package/dist-cjs/commands/CreateProgramCommand.js +2 -2
  8. package/dist-cjs/commands/CreateSourceLocationCommand.js +2 -2
  9. package/dist-cjs/commands/CreateVodSourceCommand.js +2 -2
  10. package/dist-cjs/commands/DeleteChannelCommand.js +2 -2
  11. package/dist-cjs/commands/DeleteChannelPolicyCommand.js +2 -2
  12. package/dist-cjs/commands/DeleteLiveSourceCommand.js +2 -2
  13. package/dist-cjs/commands/DeletePlaybackConfigurationCommand.js +2 -2
  14. package/dist-cjs/commands/DeletePrefetchScheduleCommand.js +2 -2
  15. package/dist-cjs/commands/DeleteProgramCommand.js +2 -2
  16. package/dist-cjs/commands/DeleteSourceLocationCommand.js +2 -2
  17. package/dist-cjs/commands/DeleteVodSourceCommand.js +2 -2
  18. package/dist-cjs/commands/DescribeChannelCommand.js +2 -2
  19. package/dist-cjs/commands/DescribeLiveSourceCommand.js +2 -2
  20. package/dist-cjs/commands/DescribeProgramCommand.js +2 -2
  21. package/dist-cjs/commands/DescribeSourceLocationCommand.js +2 -2
  22. package/dist-cjs/commands/DescribeVodSourceCommand.js +2 -2
  23. package/dist-cjs/commands/GetChannelPolicyCommand.js +2 -2
  24. package/dist-cjs/commands/GetChannelScheduleCommand.js +2 -2
  25. package/dist-cjs/commands/GetPlaybackConfigurationCommand.js +2 -2
  26. package/dist-cjs/commands/GetPrefetchScheduleCommand.js +2 -2
  27. package/dist-cjs/commands/ListAlertsCommand.js +2 -2
  28. package/dist-cjs/commands/ListChannelsCommand.js +2 -2
  29. package/dist-cjs/commands/ListLiveSourcesCommand.js +2 -2
  30. package/dist-cjs/commands/ListPlaybackConfigurationsCommand.js +2 -2
  31. package/dist-cjs/commands/ListPrefetchSchedulesCommand.js +2 -2
  32. package/dist-cjs/commands/ListSourceLocationsCommand.js +2 -2
  33. package/dist-cjs/commands/ListTagsForResourceCommand.js +2 -2
  34. package/dist-cjs/commands/ListVodSourcesCommand.js +2 -2
  35. package/dist-cjs/commands/PutChannelPolicyCommand.js +2 -2
  36. package/dist-cjs/commands/PutPlaybackConfigurationCommand.js +2 -2
  37. package/dist-cjs/commands/StartChannelCommand.js +2 -2
  38. package/dist-cjs/commands/StopChannelCommand.js +2 -2
  39. package/dist-cjs/commands/TagResourceCommand.js +1 -1
  40. package/dist-cjs/commands/UntagResourceCommand.js +1 -1
  41. package/dist-cjs/commands/UpdateChannelCommand.js +2 -2
  42. package/dist-cjs/commands/UpdateLiveSourceCommand.js +2 -2
  43. package/dist-cjs/commands/UpdateSourceLocationCommand.js +2 -2
  44. package/dist-cjs/commands/UpdateVodSourceCommand.js +2 -2
  45. package/dist-cjs/models/models_0.js +479 -717
  46. package/dist-cjs/protocols/Aws_restJson1.js +687 -1581
  47. package/dist-es/commands/ConfigureLogsForPlaybackConfigurationCommand.js +3 -3
  48. package/dist-es/commands/CreateChannelCommand.js +3 -3
  49. package/dist-es/commands/CreateLiveSourceCommand.js +3 -3
  50. package/dist-es/commands/CreatePrefetchScheduleCommand.js +3 -3
  51. package/dist-es/commands/CreateProgramCommand.js +3 -3
  52. package/dist-es/commands/CreateSourceLocationCommand.js +3 -3
  53. package/dist-es/commands/CreateVodSourceCommand.js +3 -3
  54. package/dist-es/commands/DeleteChannelCommand.js +3 -3
  55. package/dist-es/commands/DeleteChannelPolicyCommand.js +3 -3
  56. package/dist-es/commands/DeleteLiveSourceCommand.js +3 -3
  57. package/dist-es/commands/DeletePlaybackConfigurationCommand.js +3 -3
  58. package/dist-es/commands/DeletePrefetchScheduleCommand.js +3 -3
  59. package/dist-es/commands/DeleteProgramCommand.js +3 -3
  60. package/dist-es/commands/DeleteSourceLocationCommand.js +3 -3
  61. package/dist-es/commands/DeleteVodSourceCommand.js +3 -3
  62. package/dist-es/commands/DescribeChannelCommand.js +3 -3
  63. package/dist-es/commands/DescribeLiveSourceCommand.js +3 -3
  64. package/dist-es/commands/DescribeProgramCommand.js +3 -3
  65. package/dist-es/commands/DescribeSourceLocationCommand.js +3 -3
  66. package/dist-es/commands/DescribeVodSourceCommand.js +3 -3
  67. package/dist-es/commands/GetChannelPolicyCommand.js +3 -3
  68. package/dist-es/commands/GetChannelScheduleCommand.js +3 -3
  69. package/dist-es/commands/GetPlaybackConfigurationCommand.js +3 -3
  70. package/dist-es/commands/GetPrefetchScheduleCommand.js +3 -3
  71. package/dist-es/commands/ListAlertsCommand.js +3 -3
  72. package/dist-es/commands/ListChannelsCommand.js +3 -3
  73. package/dist-es/commands/ListLiveSourcesCommand.js +3 -3
  74. package/dist-es/commands/ListPlaybackConfigurationsCommand.js +3 -3
  75. package/dist-es/commands/ListPrefetchSchedulesCommand.js +3 -3
  76. package/dist-es/commands/ListSourceLocationsCommand.js +3 -3
  77. package/dist-es/commands/ListTagsForResourceCommand.js +3 -3
  78. package/dist-es/commands/ListVodSourcesCommand.js +3 -3
  79. package/dist-es/commands/PutChannelPolicyCommand.js +3 -3
  80. package/dist-es/commands/PutPlaybackConfigurationCommand.js +3 -3
  81. package/dist-es/commands/StartChannelCommand.js +3 -3
  82. package/dist-es/commands/StopChannelCommand.js +3 -3
  83. package/dist-es/commands/TagResourceCommand.js +2 -2
  84. package/dist-es/commands/UntagResourceCommand.js +2 -2
  85. package/dist-es/commands/UpdateChannelCommand.js +3 -3
  86. package/dist-es/commands/UpdateLiveSourceCommand.js +3 -3
  87. package/dist-es/commands/UpdateSourceLocationCommand.js +3 -3
  88. package/dist-es/commands/UpdateVodSourceCommand.js +3 -3
  89. package/dist-es/models/models_0.js +119 -476
  90. package/dist-es/protocols/Aws_restJson1.js +772 -1593
  91. package/dist-types/models/models_0.d.ts +476 -714
  92. package/dist-types/ts3.4/models/models_0.d.ts +238 -476
  93. package/package.json +6 -6
@@ -1,6 +1,6 @@
1
1
  import { __assign, __awaiter, __generator, __read } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, parseEpochTimestamp as __parseEpochTimestamp, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map as __map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
4
4
  import { MediaTailorServiceException as __BaseException } from "../models/MediaTailorServiceException";
5
5
  import { BadRequestException, } from "../models/models_0";
6
6
  export var serializeAws_restJson1ConfigureLogsForPlaybackConfigurationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
@@ -28,7 +28,7 @@ export var serializeAws_restJson1ConfigureLogsForPlaybackConfigurationCommand =
28
28
  });
29
29
  }); };
30
30
  export var serializeAws_restJson1CreateChannelCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
31
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
31
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
32
32
  return __generator(this, function (_c) {
33
33
  switch (_c.label) {
34
34
  case 0: return [4, context.endpoint()];
@@ -38,16 +38,7 @@ export var serializeAws_restJson1CreateChannelCommand = function (input, context
38
38
  "content-type": "application/json",
39
39
  };
40
40
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/channel/{ChannelName}";
41
- if (input.ChannelName !== undefined) {
42
- labelValue = input.ChannelName;
43
- if (labelValue.length <= 0) {
44
- throw new Error("Empty value provided for input HTTP label: ChannelName.");
45
- }
46
- resolvedPath = resolvedPath.replace("{ChannelName}", __extendedEncodeURIComponent(labelValue));
47
- }
48
- else {
49
- throw new Error("No value provided for input HTTP label: ChannelName.");
50
- }
41
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelName", function () { return input.ChannelName; }, "{ChannelName}", false);
51
42
  body = JSON.stringify(__assign(__assign(__assign(__assign(__assign({}, (input.FillerSlate != null && { FillerSlate: serializeAws_restJson1SlateSource(input.FillerSlate, context) })), (input.Outputs != null && { Outputs: serializeAws_restJson1RequestOutputs(input.Outputs, context) })), (input.PlaybackMode != null && { PlaybackMode: input.PlaybackMode })), (input.Tags != null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) })), (input.Tier != null && { Tier: input.Tier })));
52
43
  return [2, new __HttpRequest({
53
44
  protocol: protocol,
@@ -62,7 +53,7 @@ export var serializeAws_restJson1CreateChannelCommand = function (input, context
62
53
  });
63
54
  }); };
64
55
  export var serializeAws_restJson1CreateLiveSourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
65
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
56
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
66
57
  return __generator(this, function (_c) {
67
58
  switch (_c.label) {
68
59
  case 0: return [4, context.endpoint()];
@@ -73,26 +64,8 @@ export var serializeAws_restJson1CreateLiveSourceCommand = function (input, cont
73
64
  };
74
65
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
75
66
  "/sourceLocation/{SourceLocationName}/liveSource/{LiveSourceName}";
76
- if (input.LiveSourceName !== undefined) {
77
- labelValue = input.LiveSourceName;
78
- if (labelValue.length <= 0) {
79
- throw new Error("Empty value provided for input HTTP label: LiveSourceName.");
80
- }
81
- resolvedPath = resolvedPath.replace("{LiveSourceName}", __extendedEncodeURIComponent(labelValue));
82
- }
83
- else {
84
- throw new Error("No value provided for input HTTP label: LiveSourceName.");
85
- }
86
- if (input.SourceLocationName !== undefined) {
87
- labelValue = input.SourceLocationName;
88
- if (labelValue.length <= 0) {
89
- throw new Error("Empty value provided for input HTTP label: SourceLocationName.");
90
- }
91
- resolvedPath = resolvedPath.replace("{SourceLocationName}", __extendedEncodeURIComponent(labelValue));
92
- }
93
- else {
94
- throw new Error("No value provided for input HTTP label: SourceLocationName.");
95
- }
67
+ resolvedPath = __resolvedPath(resolvedPath, input, "LiveSourceName", function () { return input.LiveSourceName; }, "{LiveSourceName}", false);
68
+ resolvedPath = __resolvedPath(resolvedPath, input, "SourceLocationName", function () { return input.SourceLocationName; }, "{SourceLocationName}", false);
96
69
  body = JSON.stringify(__assign(__assign({}, (input.HttpPackageConfigurations != null && {
97
70
  HttpPackageConfigurations: serializeAws_restJson1HttpPackageConfigurations(input.HttpPackageConfigurations, context),
98
71
  })), (input.Tags != null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) })));
@@ -109,7 +82,7 @@ export var serializeAws_restJson1CreateLiveSourceCommand = function (input, cont
109
82
  });
110
83
  }); };
111
84
  export var serializeAws_restJson1CreatePrefetchScheduleCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
112
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
85
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
113
86
  return __generator(this, function (_c) {
114
87
  switch (_c.label) {
115
88
  case 0: return [4, context.endpoint()];
@@ -120,26 +93,8 @@ export var serializeAws_restJson1CreatePrefetchScheduleCommand = function (input
120
93
  };
121
94
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
122
95
  "/prefetchSchedule/{PlaybackConfigurationName}/{Name}";
123
- if (input.Name !== undefined) {
124
- labelValue = input.Name;
125
- if (labelValue.length <= 0) {
126
- throw new Error("Empty value provided for input HTTP label: Name.");
127
- }
128
- resolvedPath = resolvedPath.replace("{Name}", __extendedEncodeURIComponent(labelValue));
129
- }
130
- else {
131
- throw new Error("No value provided for input HTTP label: Name.");
132
- }
133
- if (input.PlaybackConfigurationName !== undefined) {
134
- labelValue = input.PlaybackConfigurationName;
135
- if (labelValue.length <= 0) {
136
- throw new Error("Empty value provided for input HTTP label: PlaybackConfigurationName.");
137
- }
138
- resolvedPath = resolvedPath.replace("{PlaybackConfigurationName}", __extendedEncodeURIComponent(labelValue));
139
- }
140
- else {
141
- throw new Error("No value provided for input HTTP label: PlaybackConfigurationName.");
142
- }
96
+ resolvedPath = __resolvedPath(resolvedPath, input, "Name", function () { return input.Name; }, "{Name}", false);
97
+ resolvedPath = __resolvedPath(resolvedPath, input, "PlaybackConfigurationName", function () { return input.PlaybackConfigurationName; }, "{PlaybackConfigurationName}", false);
143
98
  body = JSON.stringify(__assign(__assign(__assign({}, (input.Consumption != null && {
144
99
  Consumption: serializeAws_restJson1PrefetchConsumption(input.Consumption, context),
145
100
  })), (input.Retrieval != null && { Retrieval: serializeAws_restJson1PrefetchRetrieval(input.Retrieval, context) })), (input.StreamId != null && { StreamId: input.StreamId })));
@@ -156,7 +111,7 @@ export var serializeAws_restJson1CreatePrefetchScheduleCommand = function (input
156
111
  });
157
112
  }); };
158
113
  export var serializeAws_restJson1CreateProgramCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
159
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
114
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
160
115
  return __generator(this, function (_c) {
161
116
  switch (_c.label) {
162
117
  case 0: return [4, context.endpoint()];
@@ -167,26 +122,8 @@ export var serializeAws_restJson1CreateProgramCommand = function (input, context
167
122
  };
168
123
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
169
124
  "/channel/{ChannelName}/program/{ProgramName}";
170
- if (input.ChannelName !== undefined) {
171
- labelValue = input.ChannelName;
172
- if (labelValue.length <= 0) {
173
- throw new Error("Empty value provided for input HTTP label: ChannelName.");
174
- }
175
- resolvedPath = resolvedPath.replace("{ChannelName}", __extendedEncodeURIComponent(labelValue));
176
- }
177
- else {
178
- throw new Error("No value provided for input HTTP label: ChannelName.");
179
- }
180
- if (input.ProgramName !== undefined) {
181
- labelValue = input.ProgramName;
182
- if (labelValue.length <= 0) {
183
- throw new Error("Empty value provided for input HTTP label: ProgramName.");
184
- }
185
- resolvedPath = resolvedPath.replace("{ProgramName}", __extendedEncodeURIComponent(labelValue));
186
- }
187
- else {
188
- throw new Error("No value provided for input HTTP label: ProgramName.");
189
- }
125
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelName", function () { return input.ChannelName; }, "{ChannelName}", false);
126
+ resolvedPath = __resolvedPath(resolvedPath, input, "ProgramName", function () { return input.ProgramName; }, "{ProgramName}", false);
190
127
  body = JSON.stringify(__assign(__assign(__assign(__assign(__assign({}, (input.AdBreaks != null && { AdBreaks: serializeAws_restJson1__listOfAdBreak(input.AdBreaks, context) })), (input.LiveSourceName != null && { LiveSourceName: input.LiveSourceName })), (input.ScheduleConfiguration != null && {
191
128
  ScheduleConfiguration: serializeAws_restJson1ScheduleConfiguration(input.ScheduleConfiguration, context),
192
129
  })), (input.SourceLocationName != null && { SourceLocationName: input.SourceLocationName })), (input.VodSourceName != null && { VodSourceName: input.VodSourceName })));
@@ -203,7 +140,7 @@ export var serializeAws_restJson1CreateProgramCommand = function (input, context
203
140
  });
204
141
  }); };
205
142
  export var serializeAws_restJson1CreateSourceLocationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
206
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
143
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
207
144
  return __generator(this, function (_c) {
208
145
  switch (_c.label) {
209
146
  case 0: return [4, context.endpoint()];
@@ -213,16 +150,7 @@ export var serializeAws_restJson1CreateSourceLocationCommand = function (input,
213
150
  "content-type": "application/json",
214
151
  };
215
152
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/sourceLocation/{SourceLocationName}";
216
- if (input.SourceLocationName !== undefined) {
217
- labelValue = input.SourceLocationName;
218
- if (labelValue.length <= 0) {
219
- throw new Error("Empty value provided for input HTTP label: SourceLocationName.");
220
- }
221
- resolvedPath = resolvedPath.replace("{SourceLocationName}", __extendedEncodeURIComponent(labelValue));
222
- }
223
- else {
224
- throw new Error("No value provided for input HTTP label: SourceLocationName.");
225
- }
153
+ resolvedPath = __resolvedPath(resolvedPath, input, "SourceLocationName", function () { return input.SourceLocationName; }, "{SourceLocationName}", false);
226
154
  body = JSON.stringify(__assign(__assign(__assign(__assign(__assign({}, (input.AccessConfiguration != null && {
227
155
  AccessConfiguration: serializeAws_restJson1AccessConfiguration(input.AccessConfiguration, context),
228
156
  })), (input.DefaultSegmentDeliveryConfiguration != null && {
@@ -245,7 +173,7 @@ export var serializeAws_restJson1CreateSourceLocationCommand = function (input,
245
173
  });
246
174
  }); };
247
175
  export var serializeAws_restJson1CreateVodSourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
248
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
176
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
249
177
  return __generator(this, function (_c) {
250
178
  switch (_c.label) {
251
179
  case 0: return [4, context.endpoint()];
@@ -256,26 +184,8 @@ export var serializeAws_restJson1CreateVodSourceCommand = function (input, conte
256
184
  };
257
185
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
258
186
  "/sourceLocation/{SourceLocationName}/vodSource/{VodSourceName}";
259
- if (input.SourceLocationName !== undefined) {
260
- labelValue = input.SourceLocationName;
261
- if (labelValue.length <= 0) {
262
- throw new Error("Empty value provided for input HTTP label: SourceLocationName.");
263
- }
264
- resolvedPath = resolvedPath.replace("{SourceLocationName}", __extendedEncodeURIComponent(labelValue));
265
- }
266
- else {
267
- throw new Error("No value provided for input HTTP label: SourceLocationName.");
268
- }
269
- if (input.VodSourceName !== undefined) {
270
- labelValue = input.VodSourceName;
271
- if (labelValue.length <= 0) {
272
- throw new Error("Empty value provided for input HTTP label: VodSourceName.");
273
- }
274
- resolvedPath = resolvedPath.replace("{VodSourceName}", __extendedEncodeURIComponent(labelValue));
275
- }
276
- else {
277
- throw new Error("No value provided for input HTTP label: VodSourceName.");
278
- }
187
+ resolvedPath = __resolvedPath(resolvedPath, input, "SourceLocationName", function () { return input.SourceLocationName; }, "{SourceLocationName}", false);
188
+ resolvedPath = __resolvedPath(resolvedPath, input, "VodSourceName", function () { return input.VodSourceName; }, "{VodSourceName}", false);
279
189
  body = JSON.stringify(__assign(__assign({}, (input.HttpPackageConfigurations != null && {
280
190
  HttpPackageConfigurations: serializeAws_restJson1HttpPackageConfigurations(input.HttpPackageConfigurations, context),
281
191
  })), (input.Tags != null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) })));
@@ -292,7 +202,7 @@ export var serializeAws_restJson1CreateVodSourceCommand = function (input, conte
292
202
  });
293
203
  }); };
294
204
  export var serializeAws_restJson1DeleteChannelCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
295
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
205
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
296
206
  return __generator(this, function (_c) {
297
207
  switch (_c.label) {
298
208
  case 0: return [4, context.endpoint()];
@@ -300,16 +210,7 @@ export var serializeAws_restJson1DeleteChannelCommand = function (input, context
300
210
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
301
211
  headers = {};
302
212
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/channel/{ChannelName}";
303
- if (input.ChannelName !== undefined) {
304
- labelValue = input.ChannelName;
305
- if (labelValue.length <= 0) {
306
- throw new Error("Empty value provided for input HTTP label: ChannelName.");
307
- }
308
- resolvedPath = resolvedPath.replace("{ChannelName}", __extendedEncodeURIComponent(labelValue));
309
- }
310
- else {
311
- throw new Error("No value provided for input HTTP label: ChannelName.");
312
- }
213
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelName", function () { return input.ChannelName; }, "{ChannelName}", false);
313
214
  return [2, new __HttpRequest({
314
215
  protocol: protocol,
315
216
  hostname: hostname,
@@ -323,7 +224,7 @@ export var serializeAws_restJson1DeleteChannelCommand = function (input, context
323
224
  });
324
225
  }); };
325
226
  export var serializeAws_restJson1DeleteChannelPolicyCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
326
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
227
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
327
228
  return __generator(this, function (_c) {
328
229
  switch (_c.label) {
329
230
  case 0: return [4, context.endpoint()];
@@ -331,16 +232,7 @@ export var serializeAws_restJson1DeleteChannelPolicyCommand = function (input, c
331
232
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
332
233
  headers = {};
333
234
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/channel/{ChannelName}/policy";
334
- if (input.ChannelName !== undefined) {
335
- labelValue = input.ChannelName;
336
- if (labelValue.length <= 0) {
337
- throw new Error("Empty value provided for input HTTP label: ChannelName.");
338
- }
339
- resolvedPath = resolvedPath.replace("{ChannelName}", __extendedEncodeURIComponent(labelValue));
340
- }
341
- else {
342
- throw new Error("No value provided for input HTTP label: ChannelName.");
343
- }
235
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelName", function () { return input.ChannelName; }, "{ChannelName}", false);
344
236
  return [2, new __HttpRequest({
345
237
  protocol: protocol,
346
238
  hostname: hostname,
@@ -354,7 +246,7 @@ export var serializeAws_restJson1DeleteChannelPolicyCommand = function (input, c
354
246
  });
355
247
  }); };
356
248
  export var serializeAws_restJson1DeleteLiveSourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
357
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
249
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
358
250
  return __generator(this, function (_c) {
359
251
  switch (_c.label) {
360
252
  case 0: return [4, context.endpoint()];
@@ -363,26 +255,8 @@ export var serializeAws_restJson1DeleteLiveSourceCommand = function (input, cont
363
255
  headers = {};
364
256
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
365
257
  "/sourceLocation/{SourceLocationName}/liveSource/{LiveSourceName}";
366
- if (input.LiveSourceName !== undefined) {
367
- labelValue = input.LiveSourceName;
368
- if (labelValue.length <= 0) {
369
- throw new Error("Empty value provided for input HTTP label: LiveSourceName.");
370
- }
371
- resolvedPath = resolvedPath.replace("{LiveSourceName}", __extendedEncodeURIComponent(labelValue));
372
- }
373
- else {
374
- throw new Error("No value provided for input HTTP label: LiveSourceName.");
375
- }
376
- if (input.SourceLocationName !== undefined) {
377
- labelValue = input.SourceLocationName;
378
- if (labelValue.length <= 0) {
379
- throw new Error("Empty value provided for input HTTP label: SourceLocationName.");
380
- }
381
- resolvedPath = resolvedPath.replace("{SourceLocationName}", __extendedEncodeURIComponent(labelValue));
382
- }
383
- else {
384
- throw new Error("No value provided for input HTTP label: SourceLocationName.");
385
- }
258
+ resolvedPath = __resolvedPath(resolvedPath, input, "LiveSourceName", function () { return input.LiveSourceName; }, "{LiveSourceName}", false);
259
+ resolvedPath = __resolvedPath(resolvedPath, input, "SourceLocationName", function () { return input.SourceLocationName; }, "{SourceLocationName}", false);
386
260
  return [2, new __HttpRequest({
387
261
  protocol: protocol,
388
262
  hostname: hostname,
@@ -396,7 +270,7 @@ export var serializeAws_restJson1DeleteLiveSourceCommand = function (input, cont
396
270
  });
397
271
  }); };
398
272
  export var serializeAws_restJson1DeletePlaybackConfigurationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
399
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
273
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
400
274
  return __generator(this, function (_c) {
401
275
  switch (_c.label) {
402
276
  case 0: return [4, context.endpoint()];
@@ -404,16 +278,7 @@ export var serializeAws_restJson1DeletePlaybackConfigurationCommand = function (
404
278
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
405
279
  headers = {};
406
280
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/playbackConfiguration/{Name}";
407
- if (input.Name !== undefined) {
408
- labelValue = input.Name;
409
- if (labelValue.length <= 0) {
410
- throw new Error("Empty value provided for input HTTP label: Name.");
411
- }
412
- resolvedPath = resolvedPath.replace("{Name}", __extendedEncodeURIComponent(labelValue));
413
- }
414
- else {
415
- throw new Error("No value provided for input HTTP label: Name.");
416
- }
281
+ resolvedPath = __resolvedPath(resolvedPath, input, "Name", function () { return input.Name; }, "{Name}", false);
417
282
  return [2, new __HttpRequest({
418
283
  protocol: protocol,
419
284
  hostname: hostname,
@@ -427,7 +292,7 @@ export var serializeAws_restJson1DeletePlaybackConfigurationCommand = function (
427
292
  });
428
293
  }); };
429
294
  export var serializeAws_restJson1DeletePrefetchScheduleCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
430
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
295
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
431
296
  return __generator(this, function (_c) {
432
297
  switch (_c.label) {
433
298
  case 0: return [4, context.endpoint()];
@@ -436,26 +301,8 @@ export var serializeAws_restJson1DeletePrefetchScheduleCommand = function (input
436
301
  headers = {};
437
302
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
438
303
  "/prefetchSchedule/{PlaybackConfigurationName}/{Name}";
439
- if (input.Name !== undefined) {
440
- labelValue = input.Name;
441
- if (labelValue.length <= 0) {
442
- throw new Error("Empty value provided for input HTTP label: Name.");
443
- }
444
- resolvedPath = resolvedPath.replace("{Name}", __extendedEncodeURIComponent(labelValue));
445
- }
446
- else {
447
- throw new Error("No value provided for input HTTP label: Name.");
448
- }
449
- if (input.PlaybackConfigurationName !== undefined) {
450
- labelValue = input.PlaybackConfigurationName;
451
- if (labelValue.length <= 0) {
452
- throw new Error("Empty value provided for input HTTP label: PlaybackConfigurationName.");
453
- }
454
- resolvedPath = resolvedPath.replace("{PlaybackConfigurationName}", __extendedEncodeURIComponent(labelValue));
455
- }
456
- else {
457
- throw new Error("No value provided for input HTTP label: PlaybackConfigurationName.");
458
- }
304
+ resolvedPath = __resolvedPath(resolvedPath, input, "Name", function () { return input.Name; }, "{Name}", false);
305
+ resolvedPath = __resolvedPath(resolvedPath, input, "PlaybackConfigurationName", function () { return input.PlaybackConfigurationName; }, "{PlaybackConfigurationName}", false);
459
306
  return [2, new __HttpRequest({
460
307
  protocol: protocol,
461
308
  hostname: hostname,
@@ -469,7 +316,7 @@ export var serializeAws_restJson1DeletePrefetchScheduleCommand = function (input
469
316
  });
470
317
  }); };
471
318
  export var serializeAws_restJson1DeleteProgramCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
472
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
319
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
473
320
  return __generator(this, function (_c) {
474
321
  switch (_c.label) {
475
322
  case 0: return [4, context.endpoint()];
@@ -478,26 +325,8 @@ export var serializeAws_restJson1DeleteProgramCommand = function (input, context
478
325
  headers = {};
479
326
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
480
327
  "/channel/{ChannelName}/program/{ProgramName}";
481
- if (input.ChannelName !== undefined) {
482
- labelValue = input.ChannelName;
483
- if (labelValue.length <= 0) {
484
- throw new Error("Empty value provided for input HTTP label: ChannelName.");
485
- }
486
- resolvedPath = resolvedPath.replace("{ChannelName}", __extendedEncodeURIComponent(labelValue));
487
- }
488
- else {
489
- throw new Error("No value provided for input HTTP label: ChannelName.");
490
- }
491
- if (input.ProgramName !== undefined) {
492
- labelValue = input.ProgramName;
493
- if (labelValue.length <= 0) {
494
- throw new Error("Empty value provided for input HTTP label: ProgramName.");
495
- }
496
- resolvedPath = resolvedPath.replace("{ProgramName}", __extendedEncodeURIComponent(labelValue));
497
- }
498
- else {
499
- throw new Error("No value provided for input HTTP label: ProgramName.");
500
- }
328
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelName", function () { return input.ChannelName; }, "{ChannelName}", false);
329
+ resolvedPath = __resolvedPath(resolvedPath, input, "ProgramName", function () { return input.ProgramName; }, "{ProgramName}", false);
501
330
  return [2, new __HttpRequest({
502
331
  protocol: protocol,
503
332
  hostname: hostname,
@@ -511,7 +340,7 @@ export var serializeAws_restJson1DeleteProgramCommand = function (input, context
511
340
  });
512
341
  }); };
513
342
  export var serializeAws_restJson1DeleteSourceLocationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
514
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
343
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
515
344
  return __generator(this, function (_c) {
516
345
  switch (_c.label) {
517
346
  case 0: return [4, context.endpoint()];
@@ -519,16 +348,7 @@ export var serializeAws_restJson1DeleteSourceLocationCommand = function (input,
519
348
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
520
349
  headers = {};
521
350
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/sourceLocation/{SourceLocationName}";
522
- if (input.SourceLocationName !== undefined) {
523
- labelValue = input.SourceLocationName;
524
- if (labelValue.length <= 0) {
525
- throw new Error("Empty value provided for input HTTP label: SourceLocationName.");
526
- }
527
- resolvedPath = resolvedPath.replace("{SourceLocationName}", __extendedEncodeURIComponent(labelValue));
528
- }
529
- else {
530
- throw new Error("No value provided for input HTTP label: SourceLocationName.");
531
- }
351
+ resolvedPath = __resolvedPath(resolvedPath, input, "SourceLocationName", function () { return input.SourceLocationName; }, "{SourceLocationName}", false);
532
352
  return [2, new __HttpRequest({
533
353
  protocol: protocol,
534
354
  hostname: hostname,
@@ -542,7 +362,7 @@ export var serializeAws_restJson1DeleteSourceLocationCommand = function (input,
542
362
  });
543
363
  }); };
544
364
  export var serializeAws_restJson1DeleteVodSourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
545
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
365
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
546
366
  return __generator(this, function (_c) {
547
367
  switch (_c.label) {
548
368
  case 0: return [4, context.endpoint()];
@@ -551,26 +371,8 @@ export var serializeAws_restJson1DeleteVodSourceCommand = function (input, conte
551
371
  headers = {};
552
372
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
553
373
  "/sourceLocation/{SourceLocationName}/vodSource/{VodSourceName}";
554
- if (input.SourceLocationName !== undefined) {
555
- labelValue = input.SourceLocationName;
556
- if (labelValue.length <= 0) {
557
- throw new Error("Empty value provided for input HTTP label: SourceLocationName.");
558
- }
559
- resolvedPath = resolvedPath.replace("{SourceLocationName}", __extendedEncodeURIComponent(labelValue));
560
- }
561
- else {
562
- throw new Error("No value provided for input HTTP label: SourceLocationName.");
563
- }
564
- if (input.VodSourceName !== undefined) {
565
- labelValue = input.VodSourceName;
566
- if (labelValue.length <= 0) {
567
- throw new Error("Empty value provided for input HTTP label: VodSourceName.");
568
- }
569
- resolvedPath = resolvedPath.replace("{VodSourceName}", __extendedEncodeURIComponent(labelValue));
570
- }
571
- else {
572
- throw new Error("No value provided for input HTTP label: VodSourceName.");
573
- }
374
+ resolvedPath = __resolvedPath(resolvedPath, input, "SourceLocationName", function () { return input.SourceLocationName; }, "{SourceLocationName}", false);
375
+ resolvedPath = __resolvedPath(resolvedPath, input, "VodSourceName", function () { return input.VodSourceName; }, "{VodSourceName}", false);
574
376
  return [2, new __HttpRequest({
575
377
  protocol: protocol,
576
378
  hostname: hostname,
@@ -584,7 +386,7 @@ export var serializeAws_restJson1DeleteVodSourceCommand = function (input, conte
584
386
  });
585
387
  }); };
586
388
  export var serializeAws_restJson1DescribeChannelCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
587
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
389
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
588
390
  return __generator(this, function (_c) {
589
391
  switch (_c.label) {
590
392
  case 0: return [4, context.endpoint()];
@@ -592,16 +394,7 @@ export var serializeAws_restJson1DescribeChannelCommand = function (input, conte
592
394
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
593
395
  headers = {};
594
396
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/channel/{ChannelName}";
595
- if (input.ChannelName !== undefined) {
596
- labelValue = input.ChannelName;
597
- if (labelValue.length <= 0) {
598
- throw new Error("Empty value provided for input HTTP label: ChannelName.");
599
- }
600
- resolvedPath = resolvedPath.replace("{ChannelName}", __extendedEncodeURIComponent(labelValue));
601
- }
602
- else {
603
- throw new Error("No value provided for input HTTP label: ChannelName.");
604
- }
397
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelName", function () { return input.ChannelName; }, "{ChannelName}", false);
605
398
  return [2, new __HttpRequest({
606
399
  protocol: protocol,
607
400
  hostname: hostname,
@@ -615,7 +408,7 @@ export var serializeAws_restJson1DescribeChannelCommand = function (input, conte
615
408
  });
616
409
  }); };
617
410
  export var serializeAws_restJson1DescribeLiveSourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
618
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
411
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
619
412
  return __generator(this, function (_c) {
620
413
  switch (_c.label) {
621
414
  case 0: return [4, context.endpoint()];
@@ -624,26 +417,8 @@ export var serializeAws_restJson1DescribeLiveSourceCommand = function (input, co
624
417
  headers = {};
625
418
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
626
419
  "/sourceLocation/{SourceLocationName}/liveSource/{LiveSourceName}";
627
- if (input.LiveSourceName !== undefined) {
628
- labelValue = input.LiveSourceName;
629
- if (labelValue.length <= 0) {
630
- throw new Error("Empty value provided for input HTTP label: LiveSourceName.");
631
- }
632
- resolvedPath = resolvedPath.replace("{LiveSourceName}", __extendedEncodeURIComponent(labelValue));
633
- }
634
- else {
635
- throw new Error("No value provided for input HTTP label: LiveSourceName.");
636
- }
637
- if (input.SourceLocationName !== undefined) {
638
- labelValue = input.SourceLocationName;
639
- if (labelValue.length <= 0) {
640
- throw new Error("Empty value provided for input HTTP label: SourceLocationName.");
641
- }
642
- resolvedPath = resolvedPath.replace("{SourceLocationName}", __extendedEncodeURIComponent(labelValue));
643
- }
644
- else {
645
- throw new Error("No value provided for input HTTP label: SourceLocationName.");
646
- }
420
+ resolvedPath = __resolvedPath(resolvedPath, input, "LiveSourceName", function () { return input.LiveSourceName; }, "{LiveSourceName}", false);
421
+ resolvedPath = __resolvedPath(resolvedPath, input, "SourceLocationName", function () { return input.SourceLocationName; }, "{SourceLocationName}", false);
647
422
  return [2, new __HttpRequest({
648
423
  protocol: protocol,
649
424
  hostname: hostname,
@@ -657,7 +432,7 @@ export var serializeAws_restJson1DescribeLiveSourceCommand = function (input, co
657
432
  });
658
433
  }); };
659
434
  export var serializeAws_restJson1DescribeProgramCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
660
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
435
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
661
436
  return __generator(this, function (_c) {
662
437
  switch (_c.label) {
663
438
  case 0: return [4, context.endpoint()];
@@ -666,26 +441,8 @@ export var serializeAws_restJson1DescribeProgramCommand = function (input, conte
666
441
  headers = {};
667
442
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
668
443
  "/channel/{ChannelName}/program/{ProgramName}";
669
- if (input.ChannelName !== undefined) {
670
- labelValue = input.ChannelName;
671
- if (labelValue.length <= 0) {
672
- throw new Error("Empty value provided for input HTTP label: ChannelName.");
673
- }
674
- resolvedPath = resolvedPath.replace("{ChannelName}", __extendedEncodeURIComponent(labelValue));
675
- }
676
- else {
677
- throw new Error("No value provided for input HTTP label: ChannelName.");
678
- }
679
- if (input.ProgramName !== undefined) {
680
- labelValue = input.ProgramName;
681
- if (labelValue.length <= 0) {
682
- throw new Error("Empty value provided for input HTTP label: ProgramName.");
683
- }
684
- resolvedPath = resolvedPath.replace("{ProgramName}", __extendedEncodeURIComponent(labelValue));
685
- }
686
- else {
687
- throw new Error("No value provided for input HTTP label: ProgramName.");
688
- }
444
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelName", function () { return input.ChannelName; }, "{ChannelName}", false);
445
+ resolvedPath = __resolvedPath(resolvedPath, input, "ProgramName", function () { return input.ProgramName; }, "{ProgramName}", false);
689
446
  return [2, new __HttpRequest({
690
447
  protocol: protocol,
691
448
  hostname: hostname,
@@ -699,7 +456,7 @@ export var serializeAws_restJson1DescribeProgramCommand = function (input, conte
699
456
  });
700
457
  }); };
701
458
  export var serializeAws_restJson1DescribeSourceLocationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
702
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
459
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
703
460
  return __generator(this, function (_c) {
704
461
  switch (_c.label) {
705
462
  case 0: return [4, context.endpoint()];
@@ -707,16 +464,7 @@ export var serializeAws_restJson1DescribeSourceLocationCommand = function (input
707
464
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
708
465
  headers = {};
709
466
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/sourceLocation/{SourceLocationName}";
710
- if (input.SourceLocationName !== undefined) {
711
- labelValue = input.SourceLocationName;
712
- if (labelValue.length <= 0) {
713
- throw new Error("Empty value provided for input HTTP label: SourceLocationName.");
714
- }
715
- resolvedPath = resolvedPath.replace("{SourceLocationName}", __extendedEncodeURIComponent(labelValue));
716
- }
717
- else {
718
- throw new Error("No value provided for input HTTP label: SourceLocationName.");
719
- }
467
+ resolvedPath = __resolvedPath(resolvedPath, input, "SourceLocationName", function () { return input.SourceLocationName; }, "{SourceLocationName}", false);
720
468
  return [2, new __HttpRequest({
721
469
  protocol: protocol,
722
470
  hostname: hostname,
@@ -730,7 +478,7 @@ export var serializeAws_restJson1DescribeSourceLocationCommand = function (input
730
478
  });
731
479
  }); };
732
480
  export var serializeAws_restJson1DescribeVodSourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
733
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
481
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
734
482
  return __generator(this, function (_c) {
735
483
  switch (_c.label) {
736
484
  case 0: return [4, context.endpoint()];
@@ -739,26 +487,8 @@ export var serializeAws_restJson1DescribeVodSourceCommand = function (input, con
739
487
  headers = {};
740
488
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
741
489
  "/sourceLocation/{SourceLocationName}/vodSource/{VodSourceName}";
742
- if (input.SourceLocationName !== undefined) {
743
- labelValue = input.SourceLocationName;
744
- if (labelValue.length <= 0) {
745
- throw new Error("Empty value provided for input HTTP label: SourceLocationName.");
746
- }
747
- resolvedPath = resolvedPath.replace("{SourceLocationName}", __extendedEncodeURIComponent(labelValue));
748
- }
749
- else {
750
- throw new Error("No value provided for input HTTP label: SourceLocationName.");
751
- }
752
- if (input.VodSourceName !== undefined) {
753
- labelValue = input.VodSourceName;
754
- if (labelValue.length <= 0) {
755
- throw new Error("Empty value provided for input HTTP label: VodSourceName.");
756
- }
757
- resolvedPath = resolvedPath.replace("{VodSourceName}", __extendedEncodeURIComponent(labelValue));
758
- }
759
- else {
760
- throw new Error("No value provided for input HTTP label: VodSourceName.");
761
- }
490
+ resolvedPath = __resolvedPath(resolvedPath, input, "SourceLocationName", function () { return input.SourceLocationName; }, "{SourceLocationName}", false);
491
+ resolvedPath = __resolvedPath(resolvedPath, input, "VodSourceName", function () { return input.VodSourceName; }, "{VodSourceName}", false);
762
492
  return [2, new __HttpRequest({
763
493
  protocol: protocol,
764
494
  hostname: hostname,
@@ -772,7 +502,7 @@ export var serializeAws_restJson1DescribeVodSourceCommand = function (input, con
772
502
  });
773
503
  }); };
774
504
  export var serializeAws_restJson1GetChannelPolicyCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
775
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
505
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
776
506
  return __generator(this, function (_c) {
777
507
  switch (_c.label) {
778
508
  case 0: return [4, context.endpoint()];
@@ -780,16 +510,7 @@ export var serializeAws_restJson1GetChannelPolicyCommand = function (input, cont
780
510
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
781
511
  headers = {};
782
512
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/channel/{ChannelName}/policy";
783
- if (input.ChannelName !== undefined) {
784
- labelValue = input.ChannelName;
785
- if (labelValue.length <= 0) {
786
- throw new Error("Empty value provided for input HTTP label: ChannelName.");
787
- }
788
- resolvedPath = resolvedPath.replace("{ChannelName}", __extendedEncodeURIComponent(labelValue));
789
- }
790
- else {
791
- throw new Error("No value provided for input HTTP label: ChannelName.");
792
- }
513
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelName", function () { return input.ChannelName; }, "{ChannelName}", false);
793
514
  return [2, new __HttpRequest({
794
515
  protocol: protocol,
795
516
  hostname: hostname,
@@ -803,7 +524,7 @@ export var serializeAws_restJson1GetChannelPolicyCommand = function (input, cont
803
524
  });
804
525
  }); };
805
526
  export var serializeAws_restJson1GetChannelScheduleCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
806
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
527
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
807
528
  return __generator(this, function (_c) {
808
529
  switch (_c.label) {
809
530
  case 0: return [4, context.endpoint()];
@@ -811,17 +532,12 @@ export var serializeAws_restJson1GetChannelScheduleCommand = function (input, co
811
532
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
812
533
  headers = {};
813
534
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/channel/{ChannelName}/schedule";
814
- if (input.ChannelName !== undefined) {
815
- labelValue = input.ChannelName;
816
- if (labelValue.length <= 0) {
817
- throw new Error("Empty value provided for input HTTP label: ChannelName.");
818
- }
819
- resolvedPath = resolvedPath.replace("{ChannelName}", __extendedEncodeURIComponent(labelValue));
820
- }
821
- else {
822
- throw new Error("No value provided for input HTTP label: ChannelName.");
823
- }
824
- query = __assign(__assign(__assign({}, (input.DurationMinutes !== undefined && { durationMinutes: input.DurationMinutes })), (input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() })), (input.NextToken !== undefined && { nextToken: input.NextToken }));
535
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelName", function () { return input.ChannelName; }, "{ChannelName}", false);
536
+ query = map({
537
+ durationMinutes: [, input.DurationMinutes],
538
+ maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
539
+ nextToken: [, input.NextToken],
540
+ });
825
541
  return [2, new __HttpRequest({
826
542
  protocol: protocol,
827
543
  hostname: hostname,
@@ -836,7 +552,7 @@ export var serializeAws_restJson1GetChannelScheduleCommand = function (input, co
836
552
  });
837
553
  }); };
838
554
  export var serializeAws_restJson1GetPlaybackConfigurationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
839
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
555
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
840
556
  return __generator(this, function (_c) {
841
557
  switch (_c.label) {
842
558
  case 0: return [4, context.endpoint()];
@@ -844,16 +560,7 @@ export var serializeAws_restJson1GetPlaybackConfigurationCommand = function (inp
844
560
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
845
561
  headers = {};
846
562
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/playbackConfiguration/{Name}";
847
- if (input.Name !== undefined) {
848
- labelValue = input.Name;
849
- if (labelValue.length <= 0) {
850
- throw new Error("Empty value provided for input HTTP label: Name.");
851
- }
852
- resolvedPath = resolvedPath.replace("{Name}", __extendedEncodeURIComponent(labelValue));
853
- }
854
- else {
855
- throw new Error("No value provided for input HTTP label: Name.");
856
- }
563
+ resolvedPath = __resolvedPath(resolvedPath, input, "Name", function () { return input.Name; }, "{Name}", false);
857
564
  return [2, new __HttpRequest({
858
565
  protocol: protocol,
859
566
  hostname: hostname,
@@ -867,7 +574,7 @@ export var serializeAws_restJson1GetPlaybackConfigurationCommand = function (inp
867
574
  });
868
575
  }); };
869
576
  export var serializeAws_restJson1GetPrefetchScheduleCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
870
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
577
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
871
578
  return __generator(this, function (_c) {
872
579
  switch (_c.label) {
873
580
  case 0: return [4, context.endpoint()];
@@ -876,26 +583,8 @@ export var serializeAws_restJson1GetPrefetchScheduleCommand = function (input, c
876
583
  headers = {};
877
584
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
878
585
  "/prefetchSchedule/{PlaybackConfigurationName}/{Name}";
879
- if (input.Name !== undefined) {
880
- labelValue = input.Name;
881
- if (labelValue.length <= 0) {
882
- throw new Error("Empty value provided for input HTTP label: Name.");
883
- }
884
- resolvedPath = resolvedPath.replace("{Name}", __extendedEncodeURIComponent(labelValue));
885
- }
886
- else {
887
- throw new Error("No value provided for input HTTP label: Name.");
888
- }
889
- if (input.PlaybackConfigurationName !== undefined) {
890
- labelValue = input.PlaybackConfigurationName;
891
- if (labelValue.length <= 0) {
892
- throw new Error("Empty value provided for input HTTP label: PlaybackConfigurationName.");
893
- }
894
- resolvedPath = resolvedPath.replace("{PlaybackConfigurationName}", __extendedEncodeURIComponent(labelValue));
895
- }
896
- else {
897
- throw new Error("No value provided for input HTTP label: PlaybackConfigurationName.");
898
- }
586
+ resolvedPath = __resolvedPath(resolvedPath, input, "Name", function () { return input.Name; }, "{Name}", false);
587
+ resolvedPath = __resolvedPath(resolvedPath, input, "PlaybackConfigurationName", function () { return input.PlaybackConfigurationName; }, "{PlaybackConfigurationName}", false);
899
588
  return [2, new __HttpRequest({
900
589
  protocol: protocol,
901
590
  hostname: hostname,
@@ -917,7 +606,11 @@ export var serializeAws_restJson1ListAlertsCommand = function (input, context) {
917
606
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
918
607
  headers = {};
919
608
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/alerts";
920
- query = __assign(__assign(__assign({}, (input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() })), (input.NextToken !== undefined && { nextToken: input.NextToken })), (input.ResourceArn !== undefined && { resourceArn: input.ResourceArn }));
609
+ query = map({
610
+ maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
611
+ nextToken: [, input.NextToken],
612
+ resourceArn: [, input.ResourceArn],
613
+ });
921
614
  return [2, new __HttpRequest({
922
615
  protocol: protocol,
923
616
  hostname: hostname,
@@ -940,7 +633,10 @@ export var serializeAws_restJson1ListChannelsCommand = function (input, context)
940
633
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
941
634
  headers = {};
942
635
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/channels";
943
- query = __assign(__assign({}, (input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() })), (input.NextToken !== undefined && { nextToken: input.NextToken }));
636
+ query = map({
637
+ maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
638
+ nextToken: [, input.NextToken],
639
+ });
944
640
  return [2, new __HttpRequest({
945
641
  protocol: protocol,
946
642
  hostname: hostname,
@@ -955,7 +651,7 @@ export var serializeAws_restJson1ListChannelsCommand = function (input, context)
955
651
  });
956
652
  }); };
957
653
  export var serializeAws_restJson1ListLiveSourcesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
958
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
654
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
959
655
  return __generator(this, function (_c) {
960
656
  switch (_c.label) {
961
657
  case 0: return [4, context.endpoint()];
@@ -964,17 +660,11 @@ export var serializeAws_restJson1ListLiveSourcesCommand = function (input, conte
964
660
  headers = {};
965
661
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
966
662
  "/sourceLocation/{SourceLocationName}/liveSources";
967
- if (input.SourceLocationName !== undefined) {
968
- labelValue = input.SourceLocationName;
969
- if (labelValue.length <= 0) {
970
- throw new Error("Empty value provided for input HTTP label: SourceLocationName.");
971
- }
972
- resolvedPath = resolvedPath.replace("{SourceLocationName}", __extendedEncodeURIComponent(labelValue));
973
- }
974
- else {
975
- throw new Error("No value provided for input HTTP label: SourceLocationName.");
976
- }
977
- query = __assign(__assign({}, (input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() })), (input.NextToken !== undefined && { nextToken: input.NextToken }));
663
+ resolvedPath = __resolvedPath(resolvedPath, input, "SourceLocationName", function () { return input.SourceLocationName; }, "{SourceLocationName}", false);
664
+ query = map({
665
+ maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
666
+ nextToken: [, input.NextToken],
667
+ });
978
668
  return [2, new __HttpRequest({
979
669
  protocol: protocol,
980
670
  hostname: hostname,
@@ -997,7 +687,10 @@ export var serializeAws_restJson1ListPlaybackConfigurationsCommand = function (i
997
687
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
998
688
  headers = {};
999
689
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/playbackConfigurations";
1000
- query = __assign(__assign({}, (input.MaxResults !== undefined && { MaxResults: input.MaxResults.toString() })), (input.NextToken !== undefined && { NextToken: input.NextToken }));
690
+ query = map({
691
+ MaxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
692
+ NextToken: [, input.NextToken],
693
+ });
1001
694
  return [2, new __HttpRequest({
1002
695
  protocol: protocol,
1003
696
  hostname: hostname,
@@ -1012,7 +705,7 @@ export var serializeAws_restJson1ListPlaybackConfigurationsCommand = function (i
1012
705
  });
1013
706
  }); };
1014
707
  export var serializeAws_restJson1ListPrefetchSchedulesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1015
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
708
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1016
709
  return __generator(this, function (_c) {
1017
710
  switch (_c.label) {
1018
711
  case 0: return [4, context.endpoint()];
@@ -1023,16 +716,7 @@ export var serializeAws_restJson1ListPrefetchSchedulesCommand = function (input,
1023
716
  };
1024
717
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
1025
718
  "/prefetchSchedule/{PlaybackConfigurationName}";
1026
- if (input.PlaybackConfigurationName !== undefined) {
1027
- labelValue = input.PlaybackConfigurationName;
1028
- if (labelValue.length <= 0) {
1029
- throw new Error("Empty value provided for input HTTP label: PlaybackConfigurationName.");
1030
- }
1031
- resolvedPath = resolvedPath.replace("{PlaybackConfigurationName}", __extendedEncodeURIComponent(labelValue));
1032
- }
1033
- else {
1034
- throw new Error("No value provided for input HTTP label: PlaybackConfigurationName.");
1035
- }
719
+ resolvedPath = __resolvedPath(resolvedPath, input, "PlaybackConfigurationName", function () { return input.PlaybackConfigurationName; }, "{PlaybackConfigurationName}", false);
1036
720
  body = JSON.stringify(__assign(__assign(__assign({}, (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })), (input.StreamId != null && { StreamId: input.StreamId })));
1037
721
  return [2, new __HttpRequest({
1038
722
  protocol: protocol,
@@ -1055,7 +739,10 @@ export var serializeAws_restJson1ListSourceLocationsCommand = function (input, c
1055
739
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
1056
740
  headers = {};
1057
741
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/sourceLocations";
1058
- query = __assign(__assign({}, (input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() })), (input.NextToken !== undefined && { nextToken: input.NextToken }));
742
+ query = map({
743
+ maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
744
+ nextToken: [, input.NextToken],
745
+ });
1059
746
  return [2, new __HttpRequest({
1060
747
  protocol: protocol,
1061
748
  hostname: hostname,
@@ -1070,7 +757,7 @@ export var serializeAws_restJson1ListSourceLocationsCommand = function (input, c
1070
757
  });
1071
758
  }); };
1072
759
  export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1073
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
760
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1074
761
  return __generator(this, function (_c) {
1075
762
  switch (_c.label) {
1076
763
  case 0: return [4, context.endpoint()];
@@ -1078,16 +765,7 @@ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, c
1078
765
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
1079
766
  headers = {};
1080
767
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
1081
- if (input.ResourceArn !== undefined) {
1082
- labelValue = input.ResourceArn;
1083
- if (labelValue.length <= 0) {
1084
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
1085
- }
1086
- resolvedPath = resolvedPath.replace("{ResourceArn}", __extendedEncodeURIComponent(labelValue));
1087
- }
1088
- else {
1089
- throw new Error("No value provided for input HTTP label: ResourceArn.");
1090
- }
768
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
1091
769
  return [2, new __HttpRequest({
1092
770
  protocol: protocol,
1093
771
  hostname: hostname,
@@ -1101,7 +779,7 @@ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, c
1101
779
  });
1102
780
  }); };
1103
781
  export var serializeAws_restJson1ListVodSourcesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1104
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
782
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
1105
783
  return __generator(this, function (_c) {
1106
784
  switch (_c.label) {
1107
785
  case 0: return [4, context.endpoint()];
@@ -1110,17 +788,11 @@ export var serializeAws_restJson1ListVodSourcesCommand = function (input, contex
1110
788
  headers = {};
1111
789
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
1112
790
  "/sourceLocation/{SourceLocationName}/vodSources";
1113
- if (input.SourceLocationName !== undefined) {
1114
- labelValue = input.SourceLocationName;
1115
- if (labelValue.length <= 0) {
1116
- throw new Error("Empty value provided for input HTTP label: SourceLocationName.");
1117
- }
1118
- resolvedPath = resolvedPath.replace("{SourceLocationName}", __extendedEncodeURIComponent(labelValue));
1119
- }
1120
- else {
1121
- throw new Error("No value provided for input HTTP label: SourceLocationName.");
1122
- }
1123
- query = __assign(__assign({}, (input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() })), (input.NextToken !== undefined && { nextToken: input.NextToken }));
791
+ resolvedPath = __resolvedPath(resolvedPath, input, "SourceLocationName", function () { return input.SourceLocationName; }, "{SourceLocationName}", false);
792
+ query = map({
793
+ maxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
794
+ nextToken: [, input.NextToken],
795
+ });
1124
796
  return [2, new __HttpRequest({
1125
797
  protocol: protocol,
1126
798
  hostname: hostname,
@@ -1135,7 +807,7 @@ export var serializeAws_restJson1ListVodSourcesCommand = function (input, contex
1135
807
  });
1136
808
  }); };
1137
809
  export var serializeAws_restJson1PutChannelPolicyCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1138
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
810
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1139
811
  return __generator(this, function (_c) {
1140
812
  switch (_c.label) {
1141
813
  case 0: return [4, context.endpoint()];
@@ -1145,16 +817,7 @@ export var serializeAws_restJson1PutChannelPolicyCommand = function (input, cont
1145
817
  "content-type": "application/json",
1146
818
  };
1147
819
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/channel/{ChannelName}/policy";
1148
- if (input.ChannelName !== undefined) {
1149
- labelValue = input.ChannelName;
1150
- if (labelValue.length <= 0) {
1151
- throw new Error("Empty value provided for input HTTP label: ChannelName.");
1152
- }
1153
- resolvedPath = resolvedPath.replace("{ChannelName}", __extendedEncodeURIComponent(labelValue));
1154
- }
1155
- else {
1156
- throw new Error("No value provided for input HTTP label: ChannelName.");
1157
- }
820
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelName", function () { return input.ChannelName; }, "{ChannelName}", false);
1158
821
  body = JSON.stringify(__assign({}, (input.Policy != null && { Policy: input.Policy })));
1159
822
  return [2, new __HttpRequest({
1160
823
  protocol: protocol,
@@ -1207,7 +870,7 @@ export var serializeAws_restJson1PutPlaybackConfigurationCommand = function (inp
1207
870
  });
1208
871
  }); };
1209
872
  export var serializeAws_restJson1StartChannelCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1210
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
873
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1211
874
  return __generator(this, function (_c) {
1212
875
  switch (_c.label) {
1213
876
  case 0: return [4, context.endpoint()];
@@ -1215,16 +878,7 @@ export var serializeAws_restJson1StartChannelCommand = function (input, context)
1215
878
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
1216
879
  headers = {};
1217
880
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/channel/{ChannelName}/start";
1218
- if (input.ChannelName !== undefined) {
1219
- labelValue = input.ChannelName;
1220
- if (labelValue.length <= 0) {
1221
- throw new Error("Empty value provided for input HTTP label: ChannelName.");
1222
- }
1223
- resolvedPath = resolvedPath.replace("{ChannelName}", __extendedEncodeURIComponent(labelValue));
1224
- }
1225
- else {
1226
- throw new Error("No value provided for input HTTP label: ChannelName.");
1227
- }
881
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelName", function () { return input.ChannelName; }, "{ChannelName}", false);
1228
882
  return [2, new __HttpRequest({
1229
883
  protocol: protocol,
1230
884
  hostname: hostname,
@@ -1238,7 +892,7 @@ export var serializeAws_restJson1StartChannelCommand = function (input, context)
1238
892
  });
1239
893
  }); };
1240
894
  export var serializeAws_restJson1StopChannelCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1241
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
895
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1242
896
  return __generator(this, function (_c) {
1243
897
  switch (_c.label) {
1244
898
  case 0: return [4, context.endpoint()];
@@ -1246,16 +900,7 @@ export var serializeAws_restJson1StopChannelCommand = function (input, context)
1246
900
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
1247
901
  headers = {};
1248
902
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/channel/{ChannelName}/stop";
1249
- if (input.ChannelName !== undefined) {
1250
- labelValue = input.ChannelName;
1251
- if (labelValue.length <= 0) {
1252
- throw new Error("Empty value provided for input HTTP label: ChannelName.");
1253
- }
1254
- resolvedPath = resolvedPath.replace("{ChannelName}", __extendedEncodeURIComponent(labelValue));
1255
- }
1256
- else {
1257
- throw new Error("No value provided for input HTTP label: ChannelName.");
1258
- }
903
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelName", function () { return input.ChannelName; }, "{ChannelName}", false);
1259
904
  return [2, new __HttpRequest({
1260
905
  protocol: protocol,
1261
906
  hostname: hostname,
@@ -1269,7 +914,7 @@ export var serializeAws_restJson1StopChannelCommand = function (input, context)
1269
914
  });
1270
915
  }); };
1271
916
  export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1272
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
917
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1273
918
  return __generator(this, function (_c) {
1274
919
  switch (_c.label) {
1275
920
  case 0: return [4, context.endpoint()];
@@ -1279,16 +924,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
1279
924
  "content-type": "application/json",
1280
925
  };
1281
926
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
1282
- if (input.ResourceArn !== undefined) {
1283
- labelValue = input.ResourceArn;
1284
- if (labelValue.length <= 0) {
1285
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
1286
- }
1287
- resolvedPath = resolvedPath.replace("{ResourceArn}", __extendedEncodeURIComponent(labelValue));
1288
- }
1289
- else {
1290
- throw new Error("No value provided for input HTTP label: ResourceArn.");
1291
- }
927
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
1292
928
  body = JSON.stringify(__assign({}, (input.Tags != null && { tags: serializeAws_restJson1__mapOf__string(input.Tags, context) })));
1293
929
  return [2, new __HttpRequest({
1294
930
  protocol: protocol,
@@ -1303,7 +939,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
1303
939
  });
1304
940
  }); };
1305
941
  export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1306
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
942
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
1307
943
  return __generator(this, function (_c) {
1308
944
  switch (_c.label) {
1309
945
  case 0: return [4, context.endpoint()];
@@ -1311,17 +947,10 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
1311
947
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
1312
948
  headers = {};
1313
949
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
1314
- if (input.ResourceArn !== undefined) {
1315
- labelValue = input.ResourceArn;
1316
- if (labelValue.length <= 0) {
1317
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
1318
- }
1319
- resolvedPath = resolvedPath.replace("{ResourceArn}", __extendedEncodeURIComponent(labelValue));
1320
- }
1321
- else {
1322
- throw new Error("No value provided for input HTTP label: ResourceArn.");
1323
- }
1324
- query = __assign({}, (input.TagKeys !== undefined && { tagKeys: (input.TagKeys || []).map(function (_entry) { return _entry; }) }));
950
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
951
+ query = map({
952
+ tagKeys: [function () { return input.TagKeys !== void 0; }, function () { return (input.TagKeys || []).map(function (_entry) { return _entry; }); }],
953
+ });
1325
954
  return [2, new __HttpRequest({
1326
955
  protocol: protocol,
1327
956
  hostname: hostname,
@@ -1336,7 +965,7 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
1336
965
  });
1337
966
  }); };
1338
967
  export var serializeAws_restJson1UpdateChannelCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1339
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
968
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1340
969
  return __generator(this, function (_c) {
1341
970
  switch (_c.label) {
1342
971
  case 0: return [4, context.endpoint()];
@@ -1346,16 +975,7 @@ export var serializeAws_restJson1UpdateChannelCommand = function (input, context
1346
975
  "content-type": "application/json",
1347
976
  };
1348
977
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/channel/{ChannelName}";
1349
- if (input.ChannelName !== undefined) {
1350
- labelValue = input.ChannelName;
1351
- if (labelValue.length <= 0) {
1352
- throw new Error("Empty value provided for input HTTP label: ChannelName.");
1353
- }
1354
- resolvedPath = resolvedPath.replace("{ChannelName}", __extendedEncodeURIComponent(labelValue));
1355
- }
1356
- else {
1357
- throw new Error("No value provided for input HTTP label: ChannelName.");
1358
- }
978
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelName", function () { return input.ChannelName; }, "{ChannelName}", false);
1359
979
  body = JSON.stringify(__assign(__assign({}, (input.FillerSlate != null && { FillerSlate: serializeAws_restJson1SlateSource(input.FillerSlate, context) })), (input.Outputs != null && { Outputs: serializeAws_restJson1RequestOutputs(input.Outputs, context) })));
1360
980
  return [2, new __HttpRequest({
1361
981
  protocol: protocol,
@@ -1370,7 +990,7 @@ export var serializeAws_restJson1UpdateChannelCommand = function (input, context
1370
990
  });
1371
991
  }); };
1372
992
  export var serializeAws_restJson1UpdateLiveSourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1373
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
993
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1374
994
  return __generator(this, function (_c) {
1375
995
  switch (_c.label) {
1376
996
  case 0: return [4, context.endpoint()];
@@ -1381,26 +1001,8 @@ export var serializeAws_restJson1UpdateLiveSourceCommand = function (input, cont
1381
1001
  };
1382
1002
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
1383
1003
  "/sourceLocation/{SourceLocationName}/liveSource/{LiveSourceName}";
1384
- if (input.LiveSourceName !== undefined) {
1385
- labelValue = input.LiveSourceName;
1386
- if (labelValue.length <= 0) {
1387
- throw new Error("Empty value provided for input HTTP label: LiveSourceName.");
1388
- }
1389
- resolvedPath = resolvedPath.replace("{LiveSourceName}", __extendedEncodeURIComponent(labelValue));
1390
- }
1391
- else {
1392
- throw new Error("No value provided for input HTTP label: LiveSourceName.");
1393
- }
1394
- if (input.SourceLocationName !== undefined) {
1395
- labelValue = input.SourceLocationName;
1396
- if (labelValue.length <= 0) {
1397
- throw new Error("Empty value provided for input HTTP label: SourceLocationName.");
1398
- }
1399
- resolvedPath = resolvedPath.replace("{SourceLocationName}", __extendedEncodeURIComponent(labelValue));
1400
- }
1401
- else {
1402
- throw new Error("No value provided for input HTTP label: SourceLocationName.");
1403
- }
1004
+ resolvedPath = __resolvedPath(resolvedPath, input, "LiveSourceName", function () { return input.LiveSourceName; }, "{LiveSourceName}", false);
1005
+ resolvedPath = __resolvedPath(resolvedPath, input, "SourceLocationName", function () { return input.SourceLocationName; }, "{SourceLocationName}", false);
1404
1006
  body = JSON.stringify(__assign({}, (input.HttpPackageConfigurations != null && {
1405
1007
  HttpPackageConfigurations: serializeAws_restJson1HttpPackageConfigurations(input.HttpPackageConfigurations, context),
1406
1008
  })));
@@ -1417,7 +1019,7 @@ export var serializeAws_restJson1UpdateLiveSourceCommand = function (input, cont
1417
1019
  });
1418
1020
  }); };
1419
1021
  export var serializeAws_restJson1UpdateSourceLocationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1420
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
1022
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1421
1023
  return __generator(this, function (_c) {
1422
1024
  switch (_c.label) {
1423
1025
  case 0: return [4, context.endpoint()];
@@ -1427,16 +1029,7 @@ export var serializeAws_restJson1UpdateSourceLocationCommand = function (input,
1427
1029
  "content-type": "application/json",
1428
1030
  };
1429
1031
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/sourceLocation/{SourceLocationName}";
1430
- if (input.SourceLocationName !== undefined) {
1431
- labelValue = input.SourceLocationName;
1432
- if (labelValue.length <= 0) {
1433
- throw new Error("Empty value provided for input HTTP label: SourceLocationName.");
1434
- }
1435
- resolvedPath = resolvedPath.replace("{SourceLocationName}", __extendedEncodeURIComponent(labelValue));
1436
- }
1437
- else {
1438
- throw new Error("No value provided for input HTTP label: SourceLocationName.");
1439
- }
1032
+ resolvedPath = __resolvedPath(resolvedPath, input, "SourceLocationName", function () { return input.SourceLocationName; }, "{SourceLocationName}", false);
1440
1033
  body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.AccessConfiguration != null && {
1441
1034
  AccessConfiguration: serializeAws_restJson1AccessConfiguration(input.AccessConfiguration, context),
1442
1035
  })), (input.DefaultSegmentDeliveryConfiguration != null && {
@@ -1459,7 +1052,7 @@ export var serializeAws_restJson1UpdateSourceLocationCommand = function (input,
1459
1052
  });
1460
1053
  }); };
1461
1054
  export var serializeAws_restJson1UpdateVodSourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1462
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
1055
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1463
1056
  return __generator(this, function (_c) {
1464
1057
  switch (_c.label) {
1465
1058
  case 0: return [4, context.endpoint()];
@@ -1470,26 +1063,8 @@ export var serializeAws_restJson1UpdateVodSourceCommand = function (input, conte
1470
1063
  };
1471
1064
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
1472
1065
  "/sourceLocation/{SourceLocationName}/vodSource/{VodSourceName}";
1473
- if (input.SourceLocationName !== undefined) {
1474
- labelValue = input.SourceLocationName;
1475
- if (labelValue.length <= 0) {
1476
- throw new Error("Empty value provided for input HTTP label: SourceLocationName.");
1477
- }
1478
- resolvedPath = resolvedPath.replace("{SourceLocationName}", __extendedEncodeURIComponent(labelValue));
1479
- }
1480
- else {
1481
- throw new Error("No value provided for input HTTP label: SourceLocationName.");
1482
- }
1483
- if (input.VodSourceName !== undefined) {
1484
- labelValue = input.VodSourceName;
1485
- if (labelValue.length <= 0) {
1486
- throw new Error("Empty value provided for input HTTP label: VodSourceName.");
1487
- }
1488
- resolvedPath = resolvedPath.replace("{VodSourceName}", __extendedEncodeURIComponent(labelValue));
1489
- }
1490
- else {
1491
- throw new Error("No value provided for input HTTP label: VodSourceName.");
1492
- }
1066
+ resolvedPath = __resolvedPath(resolvedPath, input, "SourceLocationName", function () { return input.SourceLocationName; }, "{SourceLocationName}", false);
1067
+ resolvedPath = __resolvedPath(resolvedPath, input, "VodSourceName", function () { return input.VodSourceName; }, "{VodSourceName}", false);
1493
1068
  body = JSON.stringify(__assign({}, (input.HttpPackageConfigurations != null && {
1494
1069
  HttpPackageConfigurations: serializeAws_restJson1HttpPackageConfigurations(input.HttpPackageConfigurations, context),
1495
1070
  })));
@@ -1513,28 +1088,26 @@ export var deserializeAws_restJson1ConfigureLogsForPlaybackConfigurationCommand
1513
1088
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1514
1089
  return [2, deserializeAws_restJson1ConfigureLogsForPlaybackConfigurationCommandError(output, context)];
1515
1090
  }
1516
- contents = {
1091
+ contents = map({
1517
1092
  $metadata: deserializeMetadata(output),
1518
- PercentEnabled: undefined,
1519
- PlaybackConfigurationName: undefined,
1520
- };
1093
+ });
1521
1094
  _a = __expectNonNull;
1522
1095
  _b = __expectObject;
1523
1096
  return [4, parseBody(output.body, context)];
1524
1097
  case 1:
1525
1098
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1526
- if (data.PercentEnabled !== undefined && data.PercentEnabled !== null) {
1099
+ if (data.PercentEnabled != null) {
1527
1100
  contents.PercentEnabled = __expectInt32(data.PercentEnabled);
1528
1101
  }
1529
- if (data.PlaybackConfigurationName !== undefined && data.PlaybackConfigurationName !== null) {
1102
+ if (data.PlaybackConfigurationName != null) {
1530
1103
  contents.PlaybackConfigurationName = __expectString(data.PlaybackConfigurationName);
1531
1104
  }
1532
- return [2, Promise.resolve(contents)];
1105
+ return [2, contents];
1533
1106
  }
1534
1107
  });
1535
1108
  }); };
1536
1109
  var deserializeAws_restJson1ConfigureLogsForPlaybackConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1537
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
1110
+ var parsedOutput, _a, errorCode, parsedBody;
1538
1111
  var _b;
1539
1112
  return __generator(this, function (_c) {
1540
1113
  switch (_c.label) {
@@ -1545,18 +1118,13 @@ var deserializeAws_restJson1ConfigureLogsForPlaybackConfigurationCommandError =
1545
1118
  case 1:
1546
1119
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
1547
1120
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1548
- switch (errorCode) {
1549
- default:
1550
- parsedBody = parsedOutput.body;
1551
- $metadata = deserializeMetadata(output);
1552
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1553
- response = new __BaseException({
1554
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1555
- $fault: "client",
1556
- $metadata: $metadata,
1557
- });
1558
- throw __decorateServiceException(response, parsedBody);
1559
- }
1121
+ parsedBody = parsedOutput.body;
1122
+ throwDefaultError({
1123
+ output: output,
1124
+ parsedBody: parsedBody,
1125
+ exceptionCtor: __BaseException,
1126
+ errorCode: errorCode,
1127
+ });
1560
1128
  return [2];
1561
1129
  }
1562
1130
  });
@@ -1569,60 +1137,50 @@ export var deserializeAws_restJson1CreateChannelCommand = function (output, cont
1569
1137
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1570
1138
  return [2, deserializeAws_restJson1CreateChannelCommandError(output, context)];
1571
1139
  }
1572
- contents = {
1140
+ contents = map({
1573
1141
  $metadata: deserializeMetadata(output),
1574
- Arn: undefined,
1575
- ChannelName: undefined,
1576
- ChannelState: undefined,
1577
- CreationTime: undefined,
1578
- FillerSlate: undefined,
1579
- LastModifiedTime: undefined,
1580
- Outputs: undefined,
1581
- PlaybackMode: undefined,
1582
- Tags: undefined,
1583
- Tier: undefined,
1584
- };
1142
+ });
1585
1143
  _a = __expectNonNull;
1586
1144
  _b = __expectObject;
1587
1145
  return [4, parseBody(output.body, context)];
1588
1146
  case 1:
1589
1147
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1590
- if (data.Arn !== undefined && data.Arn !== null) {
1148
+ if (data.Arn != null) {
1591
1149
  contents.Arn = __expectString(data.Arn);
1592
1150
  }
1593
- if (data.ChannelName !== undefined && data.ChannelName !== null) {
1151
+ if (data.ChannelName != null) {
1594
1152
  contents.ChannelName = __expectString(data.ChannelName);
1595
1153
  }
1596
- if (data.ChannelState !== undefined && data.ChannelState !== null) {
1154
+ if (data.ChannelState != null) {
1597
1155
  contents.ChannelState = __expectString(data.ChannelState);
1598
1156
  }
1599
- if (data.CreationTime !== undefined && data.CreationTime !== null) {
1157
+ if (data.CreationTime != null) {
1600
1158
  contents.CreationTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.CreationTime)));
1601
1159
  }
1602
- if (data.FillerSlate !== undefined && data.FillerSlate !== null) {
1160
+ if (data.FillerSlate != null) {
1603
1161
  contents.FillerSlate = deserializeAws_restJson1SlateSource(data.FillerSlate, context);
1604
1162
  }
1605
- if (data.LastModifiedTime !== undefined && data.LastModifiedTime !== null) {
1163
+ if (data.LastModifiedTime != null) {
1606
1164
  contents.LastModifiedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LastModifiedTime)));
1607
1165
  }
1608
- if (data.Outputs !== undefined && data.Outputs !== null) {
1166
+ if (data.Outputs != null) {
1609
1167
  contents.Outputs = deserializeAws_restJson1ResponseOutputs(data.Outputs, context);
1610
1168
  }
1611
- if (data.PlaybackMode !== undefined && data.PlaybackMode !== null) {
1169
+ if (data.PlaybackMode != null) {
1612
1170
  contents.PlaybackMode = __expectString(data.PlaybackMode);
1613
1171
  }
1614
- if (data.tags !== undefined && data.tags !== null) {
1172
+ if (data.tags != null) {
1615
1173
  contents.Tags = deserializeAws_restJson1__mapOf__string(data.tags, context);
1616
1174
  }
1617
- if (data.Tier !== undefined && data.Tier !== null) {
1175
+ if (data.Tier != null) {
1618
1176
  contents.Tier = __expectString(data.Tier);
1619
1177
  }
1620
- return [2, Promise.resolve(contents)];
1178
+ return [2, contents];
1621
1179
  }
1622
1180
  });
1623
1181
  }); };
1624
1182
  var deserializeAws_restJson1CreateChannelCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1625
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
1183
+ var parsedOutput, _a, errorCode, parsedBody;
1626
1184
  var _b;
1627
1185
  return __generator(this, function (_c) {
1628
1186
  switch (_c.label) {
@@ -1633,18 +1191,13 @@ var deserializeAws_restJson1CreateChannelCommandError = function (output, contex
1633
1191
  case 1:
1634
1192
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
1635
1193
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1636
- switch (errorCode) {
1637
- default:
1638
- parsedBody = parsedOutput.body;
1639
- $metadata = deserializeMetadata(output);
1640
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1641
- response = new __BaseException({
1642
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1643
- $fault: "client",
1644
- $metadata: $metadata,
1645
- });
1646
- throw __decorateServiceException(response, parsedBody);
1647
- }
1194
+ parsedBody = parsedOutput.body;
1195
+ throwDefaultError({
1196
+ output: output,
1197
+ parsedBody: parsedBody,
1198
+ exceptionCtor: __BaseException,
1199
+ errorCode: errorCode,
1200
+ });
1648
1201
  return [2];
1649
1202
  }
1650
1203
  });
@@ -1657,48 +1210,41 @@ export var deserializeAws_restJson1CreateLiveSourceCommand = function (output, c
1657
1210
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1658
1211
  return [2, deserializeAws_restJson1CreateLiveSourceCommandError(output, context)];
1659
1212
  }
1660
- contents = {
1213
+ contents = map({
1661
1214
  $metadata: deserializeMetadata(output),
1662
- Arn: undefined,
1663
- CreationTime: undefined,
1664
- HttpPackageConfigurations: undefined,
1665
- LastModifiedTime: undefined,
1666
- LiveSourceName: undefined,
1667
- SourceLocationName: undefined,
1668
- Tags: undefined,
1669
- };
1215
+ });
1670
1216
  _a = __expectNonNull;
1671
1217
  _b = __expectObject;
1672
1218
  return [4, parseBody(output.body, context)];
1673
1219
  case 1:
1674
1220
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1675
- if (data.Arn !== undefined && data.Arn !== null) {
1221
+ if (data.Arn != null) {
1676
1222
  contents.Arn = __expectString(data.Arn);
1677
1223
  }
1678
- if (data.CreationTime !== undefined && data.CreationTime !== null) {
1224
+ if (data.CreationTime != null) {
1679
1225
  contents.CreationTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.CreationTime)));
1680
1226
  }
1681
- if (data.HttpPackageConfigurations !== undefined && data.HttpPackageConfigurations !== null) {
1227
+ if (data.HttpPackageConfigurations != null) {
1682
1228
  contents.HttpPackageConfigurations = deserializeAws_restJson1HttpPackageConfigurations(data.HttpPackageConfigurations, context);
1683
1229
  }
1684
- if (data.LastModifiedTime !== undefined && data.LastModifiedTime !== null) {
1230
+ if (data.LastModifiedTime != null) {
1685
1231
  contents.LastModifiedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LastModifiedTime)));
1686
1232
  }
1687
- if (data.LiveSourceName !== undefined && data.LiveSourceName !== null) {
1233
+ if (data.LiveSourceName != null) {
1688
1234
  contents.LiveSourceName = __expectString(data.LiveSourceName);
1689
1235
  }
1690
- if (data.SourceLocationName !== undefined && data.SourceLocationName !== null) {
1236
+ if (data.SourceLocationName != null) {
1691
1237
  contents.SourceLocationName = __expectString(data.SourceLocationName);
1692
1238
  }
1693
- if (data.tags !== undefined && data.tags !== null) {
1239
+ if (data.tags != null) {
1694
1240
  contents.Tags = deserializeAws_restJson1__mapOf__string(data.tags, context);
1695
1241
  }
1696
- return [2, Promise.resolve(contents)];
1242
+ return [2, contents];
1697
1243
  }
1698
1244
  });
1699
1245
  }); };
1700
1246
  var deserializeAws_restJson1CreateLiveSourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1701
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
1247
+ var parsedOutput, _a, errorCode, parsedBody;
1702
1248
  var _b;
1703
1249
  return __generator(this, function (_c) {
1704
1250
  switch (_c.label) {
@@ -1709,18 +1255,13 @@ var deserializeAws_restJson1CreateLiveSourceCommandError = function (output, con
1709
1255
  case 1:
1710
1256
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
1711
1257
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1712
- switch (errorCode) {
1713
- default:
1714
- parsedBody = parsedOutput.body;
1715
- $metadata = deserializeMetadata(output);
1716
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1717
- response = new __BaseException({
1718
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1719
- $fault: "client",
1720
- $metadata: $metadata,
1721
- });
1722
- throw __decorateServiceException(response, parsedBody);
1723
- }
1258
+ parsedBody = parsedOutput.body;
1259
+ throwDefaultError({
1260
+ output: output,
1261
+ parsedBody: parsedBody,
1262
+ exceptionCtor: __BaseException,
1263
+ errorCode: errorCode,
1264
+ });
1724
1265
  return [2];
1725
1266
  }
1726
1267
  });
@@ -1733,44 +1274,38 @@ export var deserializeAws_restJson1CreatePrefetchScheduleCommand = function (out
1733
1274
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1734
1275
  return [2, deserializeAws_restJson1CreatePrefetchScheduleCommandError(output, context)];
1735
1276
  }
1736
- contents = {
1277
+ contents = map({
1737
1278
  $metadata: deserializeMetadata(output),
1738
- Arn: undefined,
1739
- Consumption: undefined,
1740
- Name: undefined,
1741
- PlaybackConfigurationName: undefined,
1742
- Retrieval: undefined,
1743
- StreamId: undefined,
1744
- };
1279
+ });
1745
1280
  _a = __expectNonNull;
1746
1281
  _b = __expectObject;
1747
1282
  return [4, parseBody(output.body, context)];
1748
1283
  case 1:
1749
1284
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1750
- if (data.Arn !== undefined && data.Arn !== null) {
1285
+ if (data.Arn != null) {
1751
1286
  contents.Arn = __expectString(data.Arn);
1752
1287
  }
1753
- if (data.Consumption !== undefined && data.Consumption !== null) {
1288
+ if (data.Consumption != null) {
1754
1289
  contents.Consumption = deserializeAws_restJson1PrefetchConsumption(data.Consumption, context);
1755
1290
  }
1756
- if (data.Name !== undefined && data.Name !== null) {
1291
+ if (data.Name != null) {
1757
1292
  contents.Name = __expectString(data.Name);
1758
1293
  }
1759
- if (data.PlaybackConfigurationName !== undefined && data.PlaybackConfigurationName !== null) {
1294
+ if (data.PlaybackConfigurationName != null) {
1760
1295
  contents.PlaybackConfigurationName = __expectString(data.PlaybackConfigurationName);
1761
1296
  }
1762
- if (data.Retrieval !== undefined && data.Retrieval !== null) {
1297
+ if (data.Retrieval != null) {
1763
1298
  contents.Retrieval = deserializeAws_restJson1PrefetchRetrieval(data.Retrieval, context);
1764
1299
  }
1765
- if (data.StreamId !== undefined && data.StreamId !== null) {
1300
+ if (data.StreamId != null) {
1766
1301
  contents.StreamId = __expectString(data.StreamId);
1767
1302
  }
1768
- return [2, Promise.resolve(contents)];
1303
+ return [2, contents];
1769
1304
  }
1770
1305
  });
1771
1306
  }); };
1772
1307
  var deserializeAws_restJson1CreatePrefetchScheduleCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1773
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
1308
+ var parsedOutput, _a, errorCode, parsedBody;
1774
1309
  var _b;
1775
1310
  return __generator(this, function (_c) {
1776
1311
  switch (_c.label) {
@@ -1781,18 +1316,13 @@ var deserializeAws_restJson1CreatePrefetchScheduleCommandError = function (outpu
1781
1316
  case 1:
1782
1317
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
1783
1318
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1784
- switch (errorCode) {
1785
- default:
1786
- parsedBody = parsedOutput.body;
1787
- $metadata = deserializeMetadata(output);
1788
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1789
- response = new __BaseException({
1790
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1791
- $fault: "client",
1792
- $metadata: $metadata,
1793
- });
1794
- throw __decorateServiceException(response, parsedBody);
1795
- }
1319
+ parsedBody = parsedOutput.body;
1320
+ throwDefaultError({
1321
+ output: output,
1322
+ parsedBody: parsedBody,
1323
+ exceptionCtor: __BaseException,
1324
+ errorCode: errorCode,
1325
+ });
1796
1326
  return [2];
1797
1327
  }
1798
1328
  });
@@ -1805,56 +1335,47 @@ export var deserializeAws_restJson1CreateProgramCommand = function (output, cont
1805
1335
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1806
1336
  return [2, deserializeAws_restJson1CreateProgramCommandError(output, context)];
1807
1337
  }
1808
- contents = {
1338
+ contents = map({
1809
1339
  $metadata: deserializeMetadata(output),
1810
- AdBreaks: undefined,
1811
- Arn: undefined,
1812
- ChannelName: undefined,
1813
- CreationTime: undefined,
1814
- LiveSourceName: undefined,
1815
- ProgramName: undefined,
1816
- ScheduledStartTime: undefined,
1817
- SourceLocationName: undefined,
1818
- VodSourceName: undefined,
1819
- };
1340
+ });
1820
1341
  _a = __expectNonNull;
1821
1342
  _b = __expectObject;
1822
1343
  return [4, parseBody(output.body, context)];
1823
1344
  case 1:
1824
1345
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1825
- if (data.AdBreaks !== undefined && data.AdBreaks !== null) {
1346
+ if (data.AdBreaks != null) {
1826
1347
  contents.AdBreaks = deserializeAws_restJson1__listOfAdBreak(data.AdBreaks, context);
1827
1348
  }
1828
- if (data.Arn !== undefined && data.Arn !== null) {
1349
+ if (data.Arn != null) {
1829
1350
  contents.Arn = __expectString(data.Arn);
1830
1351
  }
1831
- if (data.ChannelName !== undefined && data.ChannelName !== null) {
1352
+ if (data.ChannelName != null) {
1832
1353
  contents.ChannelName = __expectString(data.ChannelName);
1833
1354
  }
1834
- if (data.CreationTime !== undefined && data.CreationTime !== null) {
1355
+ if (data.CreationTime != null) {
1835
1356
  contents.CreationTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.CreationTime)));
1836
1357
  }
1837
- if (data.LiveSourceName !== undefined && data.LiveSourceName !== null) {
1358
+ if (data.LiveSourceName != null) {
1838
1359
  contents.LiveSourceName = __expectString(data.LiveSourceName);
1839
1360
  }
1840
- if (data.ProgramName !== undefined && data.ProgramName !== null) {
1361
+ if (data.ProgramName != null) {
1841
1362
  contents.ProgramName = __expectString(data.ProgramName);
1842
1363
  }
1843
- if (data.ScheduledStartTime !== undefined && data.ScheduledStartTime !== null) {
1364
+ if (data.ScheduledStartTime != null) {
1844
1365
  contents.ScheduledStartTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.ScheduledStartTime)));
1845
1366
  }
1846
- if (data.SourceLocationName !== undefined && data.SourceLocationName !== null) {
1367
+ if (data.SourceLocationName != null) {
1847
1368
  contents.SourceLocationName = __expectString(data.SourceLocationName);
1848
1369
  }
1849
- if (data.VodSourceName !== undefined && data.VodSourceName !== null) {
1370
+ if (data.VodSourceName != null) {
1850
1371
  contents.VodSourceName = __expectString(data.VodSourceName);
1851
1372
  }
1852
- return [2, Promise.resolve(contents)];
1373
+ return [2, contents];
1853
1374
  }
1854
1375
  });
1855
1376
  }); };
1856
1377
  var deserializeAws_restJson1CreateProgramCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1857
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
1378
+ var parsedOutput, _a, errorCode, parsedBody;
1858
1379
  var _b;
1859
1380
  return __generator(this, function (_c) {
1860
1381
  switch (_c.label) {
@@ -1865,18 +1386,13 @@ var deserializeAws_restJson1CreateProgramCommandError = function (output, contex
1865
1386
  case 1:
1866
1387
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
1867
1388
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1868
- switch (errorCode) {
1869
- default:
1870
- parsedBody = parsedOutput.body;
1871
- $metadata = deserializeMetadata(output);
1872
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1873
- response = new __BaseException({
1874
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1875
- $fault: "client",
1876
- $metadata: $metadata,
1877
- });
1878
- throw __decorateServiceException(response, parsedBody);
1879
- }
1389
+ parsedBody = parsedOutput.body;
1390
+ throwDefaultError({
1391
+ output: output,
1392
+ parsedBody: parsedBody,
1393
+ exceptionCtor: __BaseException,
1394
+ errorCode: errorCode,
1395
+ });
1880
1396
  return [2];
1881
1397
  }
1882
1398
  });
@@ -1889,56 +1405,47 @@ export var deserializeAws_restJson1CreateSourceLocationCommand = function (outpu
1889
1405
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1890
1406
  return [2, deserializeAws_restJson1CreateSourceLocationCommandError(output, context)];
1891
1407
  }
1892
- contents = {
1408
+ contents = map({
1893
1409
  $metadata: deserializeMetadata(output),
1894
- AccessConfiguration: undefined,
1895
- Arn: undefined,
1896
- CreationTime: undefined,
1897
- DefaultSegmentDeliveryConfiguration: undefined,
1898
- HttpConfiguration: undefined,
1899
- LastModifiedTime: undefined,
1900
- SegmentDeliveryConfigurations: undefined,
1901
- SourceLocationName: undefined,
1902
- Tags: undefined,
1903
- };
1410
+ });
1904
1411
  _a = __expectNonNull;
1905
1412
  _b = __expectObject;
1906
1413
  return [4, parseBody(output.body, context)];
1907
1414
  case 1:
1908
1415
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1909
- if (data.AccessConfiguration !== undefined && data.AccessConfiguration !== null) {
1416
+ if (data.AccessConfiguration != null) {
1910
1417
  contents.AccessConfiguration = deserializeAws_restJson1AccessConfiguration(data.AccessConfiguration, context);
1911
1418
  }
1912
- if (data.Arn !== undefined && data.Arn !== null) {
1419
+ if (data.Arn != null) {
1913
1420
  contents.Arn = __expectString(data.Arn);
1914
1421
  }
1915
- if (data.CreationTime !== undefined && data.CreationTime !== null) {
1422
+ if (data.CreationTime != null) {
1916
1423
  contents.CreationTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.CreationTime)));
1917
1424
  }
1918
- if (data.DefaultSegmentDeliveryConfiguration !== undefined && data.DefaultSegmentDeliveryConfiguration !== null) {
1425
+ if (data.DefaultSegmentDeliveryConfiguration != null) {
1919
1426
  contents.DefaultSegmentDeliveryConfiguration = deserializeAws_restJson1DefaultSegmentDeliveryConfiguration(data.DefaultSegmentDeliveryConfiguration, context);
1920
1427
  }
1921
- if (data.HttpConfiguration !== undefined && data.HttpConfiguration !== null) {
1428
+ if (data.HttpConfiguration != null) {
1922
1429
  contents.HttpConfiguration = deserializeAws_restJson1HttpConfiguration(data.HttpConfiguration, context);
1923
1430
  }
1924
- if (data.LastModifiedTime !== undefined && data.LastModifiedTime !== null) {
1431
+ if (data.LastModifiedTime != null) {
1925
1432
  contents.LastModifiedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LastModifiedTime)));
1926
1433
  }
1927
- if (data.SegmentDeliveryConfigurations !== undefined && data.SegmentDeliveryConfigurations !== null) {
1434
+ if (data.SegmentDeliveryConfigurations != null) {
1928
1435
  contents.SegmentDeliveryConfigurations = deserializeAws_restJson1__listOfSegmentDeliveryConfiguration(data.SegmentDeliveryConfigurations, context);
1929
1436
  }
1930
- if (data.SourceLocationName !== undefined && data.SourceLocationName !== null) {
1437
+ if (data.SourceLocationName != null) {
1931
1438
  contents.SourceLocationName = __expectString(data.SourceLocationName);
1932
1439
  }
1933
- if (data.tags !== undefined && data.tags !== null) {
1440
+ if (data.tags != null) {
1934
1441
  contents.Tags = deserializeAws_restJson1__mapOf__string(data.tags, context);
1935
1442
  }
1936
- return [2, Promise.resolve(contents)];
1443
+ return [2, contents];
1937
1444
  }
1938
1445
  });
1939
1446
  }); };
1940
1447
  var deserializeAws_restJson1CreateSourceLocationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1941
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
1448
+ var parsedOutput, _a, errorCode, parsedBody;
1942
1449
  var _b;
1943
1450
  return __generator(this, function (_c) {
1944
1451
  switch (_c.label) {
@@ -1949,18 +1456,13 @@ var deserializeAws_restJson1CreateSourceLocationCommandError = function (output,
1949
1456
  case 1:
1950
1457
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
1951
1458
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1952
- switch (errorCode) {
1953
- default:
1954
- parsedBody = parsedOutput.body;
1955
- $metadata = deserializeMetadata(output);
1956
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1957
- response = new __BaseException({
1958
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1959
- $fault: "client",
1960
- $metadata: $metadata,
1961
- });
1962
- throw __decorateServiceException(response, parsedBody);
1963
- }
1459
+ parsedBody = parsedOutput.body;
1460
+ throwDefaultError({
1461
+ output: output,
1462
+ parsedBody: parsedBody,
1463
+ exceptionCtor: __BaseException,
1464
+ errorCode: errorCode,
1465
+ });
1964
1466
  return [2];
1965
1467
  }
1966
1468
  });
@@ -1973,48 +1475,41 @@ export var deserializeAws_restJson1CreateVodSourceCommand = function (output, co
1973
1475
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1974
1476
  return [2, deserializeAws_restJson1CreateVodSourceCommandError(output, context)];
1975
1477
  }
1976
- contents = {
1478
+ contents = map({
1977
1479
  $metadata: deserializeMetadata(output),
1978
- Arn: undefined,
1979
- CreationTime: undefined,
1980
- HttpPackageConfigurations: undefined,
1981
- LastModifiedTime: undefined,
1982
- SourceLocationName: undefined,
1983
- Tags: undefined,
1984
- VodSourceName: undefined,
1985
- };
1480
+ });
1986
1481
  _a = __expectNonNull;
1987
1482
  _b = __expectObject;
1988
1483
  return [4, parseBody(output.body, context)];
1989
1484
  case 1:
1990
1485
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1991
- if (data.Arn !== undefined && data.Arn !== null) {
1486
+ if (data.Arn != null) {
1992
1487
  contents.Arn = __expectString(data.Arn);
1993
1488
  }
1994
- if (data.CreationTime !== undefined && data.CreationTime !== null) {
1489
+ if (data.CreationTime != null) {
1995
1490
  contents.CreationTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.CreationTime)));
1996
1491
  }
1997
- if (data.HttpPackageConfigurations !== undefined && data.HttpPackageConfigurations !== null) {
1492
+ if (data.HttpPackageConfigurations != null) {
1998
1493
  contents.HttpPackageConfigurations = deserializeAws_restJson1HttpPackageConfigurations(data.HttpPackageConfigurations, context);
1999
1494
  }
2000
- if (data.LastModifiedTime !== undefined && data.LastModifiedTime !== null) {
1495
+ if (data.LastModifiedTime != null) {
2001
1496
  contents.LastModifiedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LastModifiedTime)));
2002
1497
  }
2003
- if (data.SourceLocationName !== undefined && data.SourceLocationName !== null) {
1498
+ if (data.SourceLocationName != null) {
2004
1499
  contents.SourceLocationName = __expectString(data.SourceLocationName);
2005
1500
  }
2006
- if (data.tags !== undefined && data.tags !== null) {
1501
+ if (data.tags != null) {
2007
1502
  contents.Tags = deserializeAws_restJson1__mapOf__string(data.tags, context);
2008
1503
  }
2009
- if (data.VodSourceName !== undefined && data.VodSourceName !== null) {
1504
+ if (data.VodSourceName != null) {
2010
1505
  contents.VodSourceName = __expectString(data.VodSourceName);
2011
1506
  }
2012
- return [2, Promise.resolve(contents)];
1507
+ return [2, contents];
2013
1508
  }
2014
1509
  });
2015
1510
  }); };
2016
1511
  var deserializeAws_restJson1CreateVodSourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2017
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
1512
+ var parsedOutput, _a, errorCode, parsedBody;
2018
1513
  var _b;
2019
1514
  return __generator(this, function (_c) {
2020
1515
  switch (_c.label) {
@@ -2025,18 +1520,13 @@ var deserializeAws_restJson1CreateVodSourceCommandError = function (output, cont
2025
1520
  case 1:
2026
1521
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
2027
1522
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2028
- switch (errorCode) {
2029
- default:
2030
- parsedBody = parsedOutput.body;
2031
- $metadata = deserializeMetadata(output);
2032
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2033
- response = new __BaseException({
2034
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2035
- $fault: "client",
2036
- $metadata: $metadata,
2037
- });
2038
- throw __decorateServiceException(response, parsedBody);
2039
- }
1523
+ parsedBody = parsedOutput.body;
1524
+ throwDefaultError({
1525
+ output: output,
1526
+ parsedBody: parsedBody,
1527
+ exceptionCtor: __BaseException,
1528
+ errorCode: errorCode,
1529
+ });
2040
1530
  return [2];
2041
1531
  }
2042
1532
  });
@@ -2049,18 +1539,18 @@ export var deserializeAws_restJson1DeleteChannelCommand = function (output, cont
2049
1539
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2050
1540
  return [2, deserializeAws_restJson1DeleteChannelCommandError(output, context)];
2051
1541
  }
2052
- contents = {
1542
+ contents = map({
2053
1543
  $metadata: deserializeMetadata(output),
2054
- };
1544
+ });
2055
1545
  return [4, collectBody(output.body, context)];
2056
1546
  case 1:
2057
1547
  _a.sent();
2058
- return [2, Promise.resolve(contents)];
1548
+ return [2, contents];
2059
1549
  }
2060
1550
  });
2061
1551
  }); };
2062
1552
  var deserializeAws_restJson1DeleteChannelCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2063
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
1553
+ var parsedOutput, _a, errorCode, parsedBody;
2064
1554
  var _b;
2065
1555
  return __generator(this, function (_c) {
2066
1556
  switch (_c.label) {
@@ -2071,18 +1561,13 @@ var deserializeAws_restJson1DeleteChannelCommandError = function (output, contex
2071
1561
  case 1:
2072
1562
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
2073
1563
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2074
- switch (errorCode) {
2075
- default:
2076
- parsedBody = parsedOutput.body;
2077
- $metadata = deserializeMetadata(output);
2078
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2079
- response = new __BaseException({
2080
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2081
- $fault: "client",
2082
- $metadata: $metadata,
2083
- });
2084
- throw __decorateServiceException(response, parsedBody);
2085
- }
1564
+ parsedBody = parsedOutput.body;
1565
+ throwDefaultError({
1566
+ output: output,
1567
+ parsedBody: parsedBody,
1568
+ exceptionCtor: __BaseException,
1569
+ errorCode: errorCode,
1570
+ });
2086
1571
  return [2];
2087
1572
  }
2088
1573
  });
@@ -2095,18 +1580,18 @@ export var deserializeAws_restJson1DeleteChannelPolicyCommand = function (output
2095
1580
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2096
1581
  return [2, deserializeAws_restJson1DeleteChannelPolicyCommandError(output, context)];
2097
1582
  }
2098
- contents = {
1583
+ contents = map({
2099
1584
  $metadata: deserializeMetadata(output),
2100
- };
1585
+ });
2101
1586
  return [4, collectBody(output.body, context)];
2102
1587
  case 1:
2103
1588
  _a.sent();
2104
- return [2, Promise.resolve(contents)];
1589
+ return [2, contents];
2105
1590
  }
2106
1591
  });
2107
1592
  }); };
2108
1593
  var deserializeAws_restJson1DeleteChannelPolicyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2109
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
1594
+ var parsedOutput, _a, errorCode, parsedBody;
2110
1595
  var _b;
2111
1596
  return __generator(this, function (_c) {
2112
1597
  switch (_c.label) {
@@ -2117,18 +1602,13 @@ var deserializeAws_restJson1DeleteChannelPolicyCommandError = function (output,
2117
1602
  case 1:
2118
1603
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
2119
1604
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2120
- switch (errorCode) {
2121
- default:
2122
- parsedBody = parsedOutput.body;
2123
- $metadata = deserializeMetadata(output);
2124
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2125
- response = new __BaseException({
2126
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2127
- $fault: "client",
2128
- $metadata: $metadata,
2129
- });
2130
- throw __decorateServiceException(response, parsedBody);
2131
- }
1605
+ parsedBody = parsedOutput.body;
1606
+ throwDefaultError({
1607
+ output: output,
1608
+ parsedBody: parsedBody,
1609
+ exceptionCtor: __BaseException,
1610
+ errorCode: errorCode,
1611
+ });
2132
1612
  return [2];
2133
1613
  }
2134
1614
  });
@@ -2141,18 +1621,18 @@ export var deserializeAws_restJson1DeleteLiveSourceCommand = function (output, c
2141
1621
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2142
1622
  return [2, deserializeAws_restJson1DeleteLiveSourceCommandError(output, context)];
2143
1623
  }
2144
- contents = {
1624
+ contents = map({
2145
1625
  $metadata: deserializeMetadata(output),
2146
- };
1626
+ });
2147
1627
  return [4, collectBody(output.body, context)];
2148
1628
  case 1:
2149
1629
  _a.sent();
2150
- return [2, Promise.resolve(contents)];
1630
+ return [2, contents];
2151
1631
  }
2152
1632
  });
2153
1633
  }); };
2154
1634
  var deserializeAws_restJson1DeleteLiveSourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2155
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
1635
+ var parsedOutput, _a, errorCode, parsedBody;
2156
1636
  var _b;
2157
1637
  return __generator(this, function (_c) {
2158
1638
  switch (_c.label) {
@@ -2163,18 +1643,13 @@ var deserializeAws_restJson1DeleteLiveSourceCommandError = function (output, con
2163
1643
  case 1:
2164
1644
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
2165
1645
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2166
- switch (errorCode) {
2167
- default:
2168
- parsedBody = parsedOutput.body;
2169
- $metadata = deserializeMetadata(output);
2170
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2171
- response = new __BaseException({
2172
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2173
- $fault: "client",
2174
- $metadata: $metadata,
2175
- });
2176
- throw __decorateServiceException(response, parsedBody);
2177
- }
1646
+ parsedBody = parsedOutput.body;
1647
+ throwDefaultError({
1648
+ output: output,
1649
+ parsedBody: parsedBody,
1650
+ exceptionCtor: __BaseException,
1651
+ errorCode: errorCode,
1652
+ });
2178
1653
  return [2];
2179
1654
  }
2180
1655
  });
@@ -2187,18 +1662,18 @@ export var deserializeAws_restJson1DeletePlaybackConfigurationCommand = function
2187
1662
  if (output.statusCode !== 204 && output.statusCode >= 300) {
2188
1663
  return [2, deserializeAws_restJson1DeletePlaybackConfigurationCommandError(output, context)];
2189
1664
  }
2190
- contents = {
1665
+ contents = map({
2191
1666
  $metadata: deserializeMetadata(output),
2192
- };
1667
+ });
2193
1668
  return [4, collectBody(output.body, context)];
2194
1669
  case 1:
2195
1670
  _a.sent();
2196
- return [2, Promise.resolve(contents)];
1671
+ return [2, contents];
2197
1672
  }
2198
1673
  });
2199
1674
  }); };
2200
1675
  var deserializeAws_restJson1DeletePlaybackConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2201
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
1676
+ var parsedOutput, _a, errorCode, parsedBody;
2202
1677
  var _b;
2203
1678
  return __generator(this, function (_c) {
2204
1679
  switch (_c.label) {
@@ -2209,18 +1684,13 @@ var deserializeAws_restJson1DeletePlaybackConfigurationCommandError = function (
2209
1684
  case 1:
2210
1685
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
2211
1686
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2212
- switch (errorCode) {
2213
- default:
2214
- parsedBody = parsedOutput.body;
2215
- $metadata = deserializeMetadata(output);
2216
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2217
- response = new __BaseException({
2218
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2219
- $fault: "client",
2220
- $metadata: $metadata,
2221
- });
2222
- throw __decorateServiceException(response, parsedBody);
2223
- }
1687
+ parsedBody = parsedOutput.body;
1688
+ throwDefaultError({
1689
+ output: output,
1690
+ parsedBody: parsedBody,
1691
+ exceptionCtor: __BaseException,
1692
+ errorCode: errorCode,
1693
+ });
2224
1694
  return [2];
2225
1695
  }
2226
1696
  });
@@ -2233,18 +1703,18 @@ export var deserializeAws_restJson1DeletePrefetchScheduleCommand = function (out
2233
1703
  if (output.statusCode !== 204 && output.statusCode >= 300) {
2234
1704
  return [2, deserializeAws_restJson1DeletePrefetchScheduleCommandError(output, context)];
2235
1705
  }
2236
- contents = {
1706
+ contents = map({
2237
1707
  $metadata: deserializeMetadata(output),
2238
- };
1708
+ });
2239
1709
  return [4, collectBody(output.body, context)];
2240
1710
  case 1:
2241
1711
  _a.sent();
2242
- return [2, Promise.resolve(contents)];
1712
+ return [2, contents];
2243
1713
  }
2244
1714
  });
2245
1715
  }); };
2246
1716
  var deserializeAws_restJson1DeletePrefetchScheduleCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2247
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
1717
+ var parsedOutput, _a, errorCode, parsedBody;
2248
1718
  var _b;
2249
1719
  return __generator(this, function (_c) {
2250
1720
  switch (_c.label) {
@@ -2255,18 +1725,13 @@ var deserializeAws_restJson1DeletePrefetchScheduleCommandError = function (outpu
2255
1725
  case 1:
2256
1726
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
2257
1727
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2258
- switch (errorCode) {
2259
- default:
2260
- parsedBody = parsedOutput.body;
2261
- $metadata = deserializeMetadata(output);
2262
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2263
- response = new __BaseException({
2264
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2265
- $fault: "client",
2266
- $metadata: $metadata,
2267
- });
2268
- throw __decorateServiceException(response, parsedBody);
2269
- }
1728
+ parsedBody = parsedOutput.body;
1729
+ throwDefaultError({
1730
+ output: output,
1731
+ parsedBody: parsedBody,
1732
+ exceptionCtor: __BaseException,
1733
+ errorCode: errorCode,
1734
+ });
2270
1735
  return [2];
2271
1736
  }
2272
1737
  });
@@ -2279,18 +1744,18 @@ export var deserializeAws_restJson1DeleteProgramCommand = function (output, cont
2279
1744
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2280
1745
  return [2, deserializeAws_restJson1DeleteProgramCommandError(output, context)];
2281
1746
  }
2282
- contents = {
1747
+ contents = map({
2283
1748
  $metadata: deserializeMetadata(output),
2284
- };
1749
+ });
2285
1750
  return [4, collectBody(output.body, context)];
2286
1751
  case 1:
2287
1752
  _a.sent();
2288
- return [2, Promise.resolve(contents)];
1753
+ return [2, contents];
2289
1754
  }
2290
1755
  });
2291
1756
  }); };
2292
1757
  var deserializeAws_restJson1DeleteProgramCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2293
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
1758
+ var parsedOutput, _a, errorCode, parsedBody;
2294
1759
  var _b;
2295
1760
  return __generator(this, function (_c) {
2296
1761
  switch (_c.label) {
@@ -2301,18 +1766,13 @@ var deserializeAws_restJson1DeleteProgramCommandError = function (output, contex
2301
1766
  case 1:
2302
1767
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
2303
1768
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2304
- switch (errorCode) {
2305
- default:
2306
- parsedBody = parsedOutput.body;
2307
- $metadata = deserializeMetadata(output);
2308
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2309
- response = new __BaseException({
2310
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2311
- $fault: "client",
2312
- $metadata: $metadata,
2313
- });
2314
- throw __decorateServiceException(response, parsedBody);
2315
- }
1769
+ parsedBody = parsedOutput.body;
1770
+ throwDefaultError({
1771
+ output: output,
1772
+ parsedBody: parsedBody,
1773
+ exceptionCtor: __BaseException,
1774
+ errorCode: errorCode,
1775
+ });
2316
1776
  return [2];
2317
1777
  }
2318
1778
  });
@@ -2325,18 +1785,18 @@ export var deserializeAws_restJson1DeleteSourceLocationCommand = function (outpu
2325
1785
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2326
1786
  return [2, deserializeAws_restJson1DeleteSourceLocationCommandError(output, context)];
2327
1787
  }
2328
- contents = {
1788
+ contents = map({
2329
1789
  $metadata: deserializeMetadata(output),
2330
- };
1790
+ });
2331
1791
  return [4, collectBody(output.body, context)];
2332
1792
  case 1:
2333
1793
  _a.sent();
2334
- return [2, Promise.resolve(contents)];
1794
+ return [2, contents];
2335
1795
  }
2336
1796
  });
2337
1797
  }); };
2338
1798
  var deserializeAws_restJson1DeleteSourceLocationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2339
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
1799
+ var parsedOutput, _a, errorCode, parsedBody;
2340
1800
  var _b;
2341
1801
  return __generator(this, function (_c) {
2342
1802
  switch (_c.label) {
@@ -2347,18 +1807,13 @@ var deserializeAws_restJson1DeleteSourceLocationCommandError = function (output,
2347
1807
  case 1:
2348
1808
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
2349
1809
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2350
- switch (errorCode) {
2351
- default:
2352
- parsedBody = parsedOutput.body;
2353
- $metadata = deserializeMetadata(output);
2354
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2355
- response = new __BaseException({
2356
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2357
- $fault: "client",
2358
- $metadata: $metadata,
2359
- });
2360
- throw __decorateServiceException(response, parsedBody);
2361
- }
1810
+ parsedBody = parsedOutput.body;
1811
+ throwDefaultError({
1812
+ output: output,
1813
+ parsedBody: parsedBody,
1814
+ exceptionCtor: __BaseException,
1815
+ errorCode: errorCode,
1816
+ });
2362
1817
  return [2];
2363
1818
  }
2364
1819
  });
@@ -2371,18 +1826,18 @@ export var deserializeAws_restJson1DeleteVodSourceCommand = function (output, co
2371
1826
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2372
1827
  return [2, deserializeAws_restJson1DeleteVodSourceCommandError(output, context)];
2373
1828
  }
2374
- contents = {
1829
+ contents = map({
2375
1830
  $metadata: deserializeMetadata(output),
2376
- };
1831
+ });
2377
1832
  return [4, collectBody(output.body, context)];
2378
1833
  case 1:
2379
1834
  _a.sent();
2380
- return [2, Promise.resolve(contents)];
1835
+ return [2, contents];
2381
1836
  }
2382
1837
  });
2383
1838
  }); };
2384
1839
  var deserializeAws_restJson1DeleteVodSourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2385
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
1840
+ var parsedOutput, _a, errorCode, parsedBody;
2386
1841
  var _b;
2387
1842
  return __generator(this, function (_c) {
2388
1843
  switch (_c.label) {
@@ -2393,18 +1848,13 @@ var deserializeAws_restJson1DeleteVodSourceCommandError = function (output, cont
2393
1848
  case 1:
2394
1849
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
2395
1850
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2396
- switch (errorCode) {
2397
- default:
2398
- parsedBody = parsedOutput.body;
2399
- $metadata = deserializeMetadata(output);
2400
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2401
- response = new __BaseException({
2402
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2403
- $fault: "client",
2404
- $metadata: $metadata,
2405
- });
2406
- throw __decorateServiceException(response, parsedBody);
2407
- }
1851
+ parsedBody = parsedOutput.body;
1852
+ throwDefaultError({
1853
+ output: output,
1854
+ parsedBody: parsedBody,
1855
+ exceptionCtor: __BaseException,
1856
+ errorCode: errorCode,
1857
+ });
2408
1858
  return [2];
2409
1859
  }
2410
1860
  });
@@ -2417,60 +1867,50 @@ export var deserializeAws_restJson1DescribeChannelCommand = function (output, co
2417
1867
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2418
1868
  return [2, deserializeAws_restJson1DescribeChannelCommandError(output, context)];
2419
1869
  }
2420
- contents = {
1870
+ contents = map({
2421
1871
  $metadata: deserializeMetadata(output),
2422
- Arn: undefined,
2423
- ChannelName: undefined,
2424
- ChannelState: undefined,
2425
- CreationTime: undefined,
2426
- FillerSlate: undefined,
2427
- LastModifiedTime: undefined,
2428
- Outputs: undefined,
2429
- PlaybackMode: undefined,
2430
- Tags: undefined,
2431
- Tier: undefined,
2432
- };
1872
+ });
2433
1873
  _a = __expectNonNull;
2434
1874
  _b = __expectObject;
2435
1875
  return [4, parseBody(output.body, context)];
2436
1876
  case 1:
2437
1877
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2438
- if (data.Arn !== undefined && data.Arn !== null) {
1878
+ if (data.Arn != null) {
2439
1879
  contents.Arn = __expectString(data.Arn);
2440
1880
  }
2441
- if (data.ChannelName !== undefined && data.ChannelName !== null) {
1881
+ if (data.ChannelName != null) {
2442
1882
  contents.ChannelName = __expectString(data.ChannelName);
2443
1883
  }
2444
- if (data.ChannelState !== undefined && data.ChannelState !== null) {
1884
+ if (data.ChannelState != null) {
2445
1885
  contents.ChannelState = __expectString(data.ChannelState);
2446
1886
  }
2447
- if (data.CreationTime !== undefined && data.CreationTime !== null) {
1887
+ if (data.CreationTime != null) {
2448
1888
  contents.CreationTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.CreationTime)));
2449
1889
  }
2450
- if (data.FillerSlate !== undefined && data.FillerSlate !== null) {
1890
+ if (data.FillerSlate != null) {
2451
1891
  contents.FillerSlate = deserializeAws_restJson1SlateSource(data.FillerSlate, context);
2452
1892
  }
2453
- if (data.LastModifiedTime !== undefined && data.LastModifiedTime !== null) {
1893
+ if (data.LastModifiedTime != null) {
2454
1894
  contents.LastModifiedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LastModifiedTime)));
2455
1895
  }
2456
- if (data.Outputs !== undefined && data.Outputs !== null) {
1896
+ if (data.Outputs != null) {
2457
1897
  contents.Outputs = deserializeAws_restJson1ResponseOutputs(data.Outputs, context);
2458
1898
  }
2459
- if (data.PlaybackMode !== undefined && data.PlaybackMode !== null) {
1899
+ if (data.PlaybackMode != null) {
2460
1900
  contents.PlaybackMode = __expectString(data.PlaybackMode);
2461
1901
  }
2462
- if (data.tags !== undefined && data.tags !== null) {
1902
+ if (data.tags != null) {
2463
1903
  contents.Tags = deserializeAws_restJson1__mapOf__string(data.tags, context);
2464
1904
  }
2465
- if (data.Tier !== undefined && data.Tier !== null) {
1905
+ if (data.Tier != null) {
2466
1906
  contents.Tier = __expectString(data.Tier);
2467
1907
  }
2468
- return [2, Promise.resolve(contents)];
1908
+ return [2, contents];
2469
1909
  }
2470
1910
  });
2471
1911
  }); };
2472
1912
  var deserializeAws_restJson1DescribeChannelCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2473
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
1913
+ var parsedOutput, _a, errorCode, parsedBody;
2474
1914
  var _b;
2475
1915
  return __generator(this, function (_c) {
2476
1916
  switch (_c.label) {
@@ -2481,18 +1921,13 @@ var deserializeAws_restJson1DescribeChannelCommandError = function (output, cont
2481
1921
  case 1:
2482
1922
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
2483
1923
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2484
- switch (errorCode) {
2485
- default:
2486
- parsedBody = parsedOutput.body;
2487
- $metadata = deserializeMetadata(output);
2488
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2489
- response = new __BaseException({
2490
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2491
- $fault: "client",
2492
- $metadata: $metadata,
2493
- });
2494
- throw __decorateServiceException(response, parsedBody);
2495
- }
1924
+ parsedBody = parsedOutput.body;
1925
+ throwDefaultError({
1926
+ output: output,
1927
+ parsedBody: parsedBody,
1928
+ exceptionCtor: __BaseException,
1929
+ errorCode: errorCode,
1930
+ });
2496
1931
  return [2];
2497
1932
  }
2498
1933
  });
@@ -2505,48 +1940,41 @@ export var deserializeAws_restJson1DescribeLiveSourceCommand = function (output,
2505
1940
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2506
1941
  return [2, deserializeAws_restJson1DescribeLiveSourceCommandError(output, context)];
2507
1942
  }
2508
- contents = {
1943
+ contents = map({
2509
1944
  $metadata: deserializeMetadata(output),
2510
- Arn: undefined,
2511
- CreationTime: undefined,
2512
- HttpPackageConfigurations: undefined,
2513
- LastModifiedTime: undefined,
2514
- LiveSourceName: undefined,
2515
- SourceLocationName: undefined,
2516
- Tags: undefined,
2517
- };
1945
+ });
2518
1946
  _a = __expectNonNull;
2519
1947
  _b = __expectObject;
2520
1948
  return [4, parseBody(output.body, context)];
2521
1949
  case 1:
2522
1950
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2523
- if (data.Arn !== undefined && data.Arn !== null) {
1951
+ if (data.Arn != null) {
2524
1952
  contents.Arn = __expectString(data.Arn);
2525
1953
  }
2526
- if (data.CreationTime !== undefined && data.CreationTime !== null) {
1954
+ if (data.CreationTime != null) {
2527
1955
  contents.CreationTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.CreationTime)));
2528
1956
  }
2529
- if (data.HttpPackageConfigurations !== undefined && data.HttpPackageConfigurations !== null) {
1957
+ if (data.HttpPackageConfigurations != null) {
2530
1958
  contents.HttpPackageConfigurations = deserializeAws_restJson1HttpPackageConfigurations(data.HttpPackageConfigurations, context);
2531
1959
  }
2532
- if (data.LastModifiedTime !== undefined && data.LastModifiedTime !== null) {
1960
+ if (data.LastModifiedTime != null) {
2533
1961
  contents.LastModifiedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LastModifiedTime)));
2534
1962
  }
2535
- if (data.LiveSourceName !== undefined && data.LiveSourceName !== null) {
1963
+ if (data.LiveSourceName != null) {
2536
1964
  contents.LiveSourceName = __expectString(data.LiveSourceName);
2537
1965
  }
2538
- if (data.SourceLocationName !== undefined && data.SourceLocationName !== null) {
1966
+ if (data.SourceLocationName != null) {
2539
1967
  contents.SourceLocationName = __expectString(data.SourceLocationName);
2540
1968
  }
2541
- if (data.tags !== undefined && data.tags !== null) {
1969
+ if (data.tags != null) {
2542
1970
  contents.Tags = deserializeAws_restJson1__mapOf__string(data.tags, context);
2543
1971
  }
2544
- return [2, Promise.resolve(contents)];
1972
+ return [2, contents];
2545
1973
  }
2546
1974
  });
2547
1975
  }); };
2548
1976
  var deserializeAws_restJson1DescribeLiveSourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2549
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
1977
+ var parsedOutput, _a, errorCode, parsedBody;
2550
1978
  var _b;
2551
1979
  return __generator(this, function (_c) {
2552
1980
  switch (_c.label) {
@@ -2557,18 +1985,13 @@ var deserializeAws_restJson1DescribeLiveSourceCommandError = function (output, c
2557
1985
  case 1:
2558
1986
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
2559
1987
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2560
- switch (errorCode) {
2561
- default:
2562
- parsedBody = parsedOutput.body;
2563
- $metadata = deserializeMetadata(output);
2564
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2565
- response = new __BaseException({
2566
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2567
- $fault: "client",
2568
- $metadata: $metadata,
2569
- });
2570
- throw __decorateServiceException(response, parsedBody);
2571
- }
1988
+ parsedBody = parsedOutput.body;
1989
+ throwDefaultError({
1990
+ output: output,
1991
+ parsedBody: parsedBody,
1992
+ exceptionCtor: __BaseException,
1993
+ errorCode: errorCode,
1994
+ });
2572
1995
  return [2];
2573
1996
  }
2574
1997
  });
@@ -2581,56 +2004,47 @@ export var deserializeAws_restJson1DescribeProgramCommand = function (output, co
2581
2004
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2582
2005
  return [2, deserializeAws_restJson1DescribeProgramCommandError(output, context)];
2583
2006
  }
2584
- contents = {
2007
+ contents = map({
2585
2008
  $metadata: deserializeMetadata(output),
2586
- AdBreaks: undefined,
2587
- Arn: undefined,
2588
- ChannelName: undefined,
2589
- CreationTime: undefined,
2590
- LiveSourceName: undefined,
2591
- ProgramName: undefined,
2592
- ScheduledStartTime: undefined,
2593
- SourceLocationName: undefined,
2594
- VodSourceName: undefined,
2595
- };
2009
+ });
2596
2010
  _a = __expectNonNull;
2597
2011
  _b = __expectObject;
2598
2012
  return [4, parseBody(output.body, context)];
2599
2013
  case 1:
2600
2014
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2601
- if (data.AdBreaks !== undefined && data.AdBreaks !== null) {
2015
+ if (data.AdBreaks != null) {
2602
2016
  contents.AdBreaks = deserializeAws_restJson1__listOfAdBreak(data.AdBreaks, context);
2603
2017
  }
2604
- if (data.Arn !== undefined && data.Arn !== null) {
2018
+ if (data.Arn != null) {
2605
2019
  contents.Arn = __expectString(data.Arn);
2606
2020
  }
2607
- if (data.ChannelName !== undefined && data.ChannelName !== null) {
2021
+ if (data.ChannelName != null) {
2608
2022
  contents.ChannelName = __expectString(data.ChannelName);
2609
2023
  }
2610
- if (data.CreationTime !== undefined && data.CreationTime !== null) {
2024
+ if (data.CreationTime != null) {
2611
2025
  contents.CreationTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.CreationTime)));
2612
2026
  }
2613
- if (data.LiveSourceName !== undefined && data.LiveSourceName !== null) {
2027
+ if (data.LiveSourceName != null) {
2614
2028
  contents.LiveSourceName = __expectString(data.LiveSourceName);
2615
2029
  }
2616
- if (data.ProgramName !== undefined && data.ProgramName !== null) {
2030
+ if (data.ProgramName != null) {
2617
2031
  contents.ProgramName = __expectString(data.ProgramName);
2618
2032
  }
2619
- if (data.ScheduledStartTime !== undefined && data.ScheduledStartTime !== null) {
2033
+ if (data.ScheduledStartTime != null) {
2620
2034
  contents.ScheduledStartTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.ScheduledStartTime)));
2621
2035
  }
2622
- if (data.SourceLocationName !== undefined && data.SourceLocationName !== null) {
2036
+ if (data.SourceLocationName != null) {
2623
2037
  contents.SourceLocationName = __expectString(data.SourceLocationName);
2624
2038
  }
2625
- if (data.VodSourceName !== undefined && data.VodSourceName !== null) {
2039
+ if (data.VodSourceName != null) {
2626
2040
  contents.VodSourceName = __expectString(data.VodSourceName);
2627
2041
  }
2628
- return [2, Promise.resolve(contents)];
2042
+ return [2, contents];
2629
2043
  }
2630
2044
  });
2631
2045
  }); };
2632
2046
  var deserializeAws_restJson1DescribeProgramCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2633
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
2047
+ var parsedOutput, _a, errorCode, parsedBody;
2634
2048
  var _b;
2635
2049
  return __generator(this, function (_c) {
2636
2050
  switch (_c.label) {
@@ -2641,18 +2055,13 @@ var deserializeAws_restJson1DescribeProgramCommandError = function (output, cont
2641
2055
  case 1:
2642
2056
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
2643
2057
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2644
- switch (errorCode) {
2645
- default:
2646
- parsedBody = parsedOutput.body;
2647
- $metadata = deserializeMetadata(output);
2648
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2649
- response = new __BaseException({
2650
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2651
- $fault: "client",
2652
- $metadata: $metadata,
2653
- });
2654
- throw __decorateServiceException(response, parsedBody);
2655
- }
2058
+ parsedBody = parsedOutput.body;
2059
+ throwDefaultError({
2060
+ output: output,
2061
+ parsedBody: parsedBody,
2062
+ exceptionCtor: __BaseException,
2063
+ errorCode: errorCode,
2064
+ });
2656
2065
  return [2];
2657
2066
  }
2658
2067
  });
@@ -2665,56 +2074,47 @@ export var deserializeAws_restJson1DescribeSourceLocationCommand = function (out
2665
2074
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2666
2075
  return [2, deserializeAws_restJson1DescribeSourceLocationCommandError(output, context)];
2667
2076
  }
2668
- contents = {
2077
+ contents = map({
2669
2078
  $metadata: deserializeMetadata(output),
2670
- AccessConfiguration: undefined,
2671
- Arn: undefined,
2672
- CreationTime: undefined,
2673
- DefaultSegmentDeliveryConfiguration: undefined,
2674
- HttpConfiguration: undefined,
2675
- LastModifiedTime: undefined,
2676
- SegmentDeliveryConfigurations: undefined,
2677
- SourceLocationName: undefined,
2678
- Tags: undefined,
2679
- };
2079
+ });
2680
2080
  _a = __expectNonNull;
2681
2081
  _b = __expectObject;
2682
2082
  return [4, parseBody(output.body, context)];
2683
2083
  case 1:
2684
2084
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2685
- if (data.AccessConfiguration !== undefined && data.AccessConfiguration !== null) {
2085
+ if (data.AccessConfiguration != null) {
2686
2086
  contents.AccessConfiguration = deserializeAws_restJson1AccessConfiguration(data.AccessConfiguration, context);
2687
2087
  }
2688
- if (data.Arn !== undefined && data.Arn !== null) {
2088
+ if (data.Arn != null) {
2689
2089
  contents.Arn = __expectString(data.Arn);
2690
2090
  }
2691
- if (data.CreationTime !== undefined && data.CreationTime !== null) {
2091
+ if (data.CreationTime != null) {
2692
2092
  contents.CreationTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.CreationTime)));
2693
2093
  }
2694
- if (data.DefaultSegmentDeliveryConfiguration !== undefined && data.DefaultSegmentDeliveryConfiguration !== null) {
2094
+ if (data.DefaultSegmentDeliveryConfiguration != null) {
2695
2095
  contents.DefaultSegmentDeliveryConfiguration = deserializeAws_restJson1DefaultSegmentDeliveryConfiguration(data.DefaultSegmentDeliveryConfiguration, context);
2696
2096
  }
2697
- if (data.HttpConfiguration !== undefined && data.HttpConfiguration !== null) {
2097
+ if (data.HttpConfiguration != null) {
2698
2098
  contents.HttpConfiguration = deserializeAws_restJson1HttpConfiguration(data.HttpConfiguration, context);
2699
2099
  }
2700
- if (data.LastModifiedTime !== undefined && data.LastModifiedTime !== null) {
2100
+ if (data.LastModifiedTime != null) {
2701
2101
  contents.LastModifiedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LastModifiedTime)));
2702
2102
  }
2703
- if (data.SegmentDeliveryConfigurations !== undefined && data.SegmentDeliveryConfigurations !== null) {
2103
+ if (data.SegmentDeliveryConfigurations != null) {
2704
2104
  contents.SegmentDeliveryConfigurations = deserializeAws_restJson1__listOfSegmentDeliveryConfiguration(data.SegmentDeliveryConfigurations, context);
2705
2105
  }
2706
- if (data.SourceLocationName !== undefined && data.SourceLocationName !== null) {
2106
+ if (data.SourceLocationName != null) {
2707
2107
  contents.SourceLocationName = __expectString(data.SourceLocationName);
2708
2108
  }
2709
- if (data.tags !== undefined && data.tags !== null) {
2109
+ if (data.tags != null) {
2710
2110
  contents.Tags = deserializeAws_restJson1__mapOf__string(data.tags, context);
2711
2111
  }
2712
- return [2, Promise.resolve(contents)];
2112
+ return [2, contents];
2713
2113
  }
2714
2114
  });
2715
2115
  }); };
2716
2116
  var deserializeAws_restJson1DescribeSourceLocationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2717
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
2117
+ var parsedOutput, _a, errorCode, parsedBody;
2718
2118
  var _b;
2719
2119
  return __generator(this, function (_c) {
2720
2120
  switch (_c.label) {
@@ -2725,18 +2125,13 @@ var deserializeAws_restJson1DescribeSourceLocationCommandError = function (outpu
2725
2125
  case 1:
2726
2126
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
2727
2127
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2728
- switch (errorCode) {
2729
- default:
2730
- parsedBody = parsedOutput.body;
2731
- $metadata = deserializeMetadata(output);
2732
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2733
- response = new __BaseException({
2734
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2735
- $fault: "client",
2736
- $metadata: $metadata,
2737
- });
2738
- throw __decorateServiceException(response, parsedBody);
2739
- }
2128
+ parsedBody = parsedOutput.body;
2129
+ throwDefaultError({
2130
+ output: output,
2131
+ parsedBody: parsedBody,
2132
+ exceptionCtor: __BaseException,
2133
+ errorCode: errorCode,
2134
+ });
2740
2135
  return [2];
2741
2136
  }
2742
2137
  });
@@ -2749,48 +2144,41 @@ export var deserializeAws_restJson1DescribeVodSourceCommand = function (output,
2749
2144
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2750
2145
  return [2, deserializeAws_restJson1DescribeVodSourceCommandError(output, context)];
2751
2146
  }
2752
- contents = {
2147
+ contents = map({
2753
2148
  $metadata: deserializeMetadata(output),
2754
- Arn: undefined,
2755
- CreationTime: undefined,
2756
- HttpPackageConfigurations: undefined,
2757
- LastModifiedTime: undefined,
2758
- SourceLocationName: undefined,
2759
- Tags: undefined,
2760
- VodSourceName: undefined,
2761
- };
2149
+ });
2762
2150
  _a = __expectNonNull;
2763
2151
  _b = __expectObject;
2764
2152
  return [4, parseBody(output.body, context)];
2765
2153
  case 1:
2766
2154
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2767
- if (data.Arn !== undefined && data.Arn !== null) {
2155
+ if (data.Arn != null) {
2768
2156
  contents.Arn = __expectString(data.Arn);
2769
2157
  }
2770
- if (data.CreationTime !== undefined && data.CreationTime !== null) {
2158
+ if (data.CreationTime != null) {
2771
2159
  contents.CreationTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.CreationTime)));
2772
2160
  }
2773
- if (data.HttpPackageConfigurations !== undefined && data.HttpPackageConfigurations !== null) {
2161
+ if (data.HttpPackageConfigurations != null) {
2774
2162
  contents.HttpPackageConfigurations = deserializeAws_restJson1HttpPackageConfigurations(data.HttpPackageConfigurations, context);
2775
2163
  }
2776
- if (data.LastModifiedTime !== undefined && data.LastModifiedTime !== null) {
2164
+ if (data.LastModifiedTime != null) {
2777
2165
  contents.LastModifiedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LastModifiedTime)));
2778
2166
  }
2779
- if (data.SourceLocationName !== undefined && data.SourceLocationName !== null) {
2167
+ if (data.SourceLocationName != null) {
2780
2168
  contents.SourceLocationName = __expectString(data.SourceLocationName);
2781
2169
  }
2782
- if (data.tags !== undefined && data.tags !== null) {
2170
+ if (data.tags != null) {
2783
2171
  contents.Tags = deserializeAws_restJson1__mapOf__string(data.tags, context);
2784
2172
  }
2785
- if (data.VodSourceName !== undefined && data.VodSourceName !== null) {
2173
+ if (data.VodSourceName != null) {
2786
2174
  contents.VodSourceName = __expectString(data.VodSourceName);
2787
2175
  }
2788
- return [2, Promise.resolve(contents)];
2176
+ return [2, contents];
2789
2177
  }
2790
2178
  });
2791
2179
  }); };
2792
2180
  var deserializeAws_restJson1DescribeVodSourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2793
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
2181
+ var parsedOutput, _a, errorCode, parsedBody;
2794
2182
  var _b;
2795
2183
  return __generator(this, function (_c) {
2796
2184
  switch (_c.label) {
@@ -2801,18 +2189,13 @@ var deserializeAws_restJson1DescribeVodSourceCommandError = function (output, co
2801
2189
  case 1:
2802
2190
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
2803
2191
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2804
- switch (errorCode) {
2805
- default:
2806
- parsedBody = parsedOutput.body;
2807
- $metadata = deserializeMetadata(output);
2808
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2809
- response = new __BaseException({
2810
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2811
- $fault: "client",
2812
- $metadata: $metadata,
2813
- });
2814
- throw __decorateServiceException(response, parsedBody);
2815
- }
2192
+ parsedBody = parsedOutput.body;
2193
+ throwDefaultError({
2194
+ output: output,
2195
+ parsedBody: parsedBody,
2196
+ exceptionCtor: __BaseException,
2197
+ errorCode: errorCode,
2198
+ });
2816
2199
  return [2];
2817
2200
  }
2818
2201
  });
@@ -2825,24 +2208,23 @@ export var deserializeAws_restJson1GetChannelPolicyCommand = function (output, c
2825
2208
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2826
2209
  return [2, deserializeAws_restJson1GetChannelPolicyCommandError(output, context)];
2827
2210
  }
2828
- contents = {
2211
+ contents = map({
2829
2212
  $metadata: deserializeMetadata(output),
2830
- Policy: undefined,
2831
- };
2213
+ });
2832
2214
  _a = __expectNonNull;
2833
2215
  _b = __expectObject;
2834
2216
  return [4, parseBody(output.body, context)];
2835
2217
  case 1:
2836
2218
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2837
- if (data.Policy !== undefined && data.Policy !== null) {
2219
+ if (data.Policy != null) {
2838
2220
  contents.Policy = __expectString(data.Policy);
2839
2221
  }
2840
- return [2, Promise.resolve(contents)];
2222
+ return [2, contents];
2841
2223
  }
2842
2224
  });
2843
2225
  }); };
2844
2226
  var deserializeAws_restJson1GetChannelPolicyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2845
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
2227
+ var parsedOutput, _a, errorCode, parsedBody;
2846
2228
  var _b;
2847
2229
  return __generator(this, function (_c) {
2848
2230
  switch (_c.label) {
@@ -2853,18 +2235,13 @@ var deserializeAws_restJson1GetChannelPolicyCommandError = function (output, con
2853
2235
  case 1:
2854
2236
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
2855
2237
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2856
- switch (errorCode) {
2857
- default:
2858
- parsedBody = parsedOutput.body;
2859
- $metadata = deserializeMetadata(output);
2860
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2861
- response = new __BaseException({
2862
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2863
- $fault: "client",
2864
- $metadata: $metadata,
2865
- });
2866
- throw __decorateServiceException(response, parsedBody);
2867
- }
2238
+ parsedBody = parsedOutput.body;
2239
+ throwDefaultError({
2240
+ output: output,
2241
+ parsedBody: parsedBody,
2242
+ exceptionCtor: __BaseException,
2243
+ errorCode: errorCode,
2244
+ });
2868
2245
  return [2];
2869
2246
  }
2870
2247
  });
@@ -2877,28 +2254,26 @@ export var deserializeAws_restJson1GetChannelScheduleCommand = function (output,
2877
2254
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2878
2255
  return [2, deserializeAws_restJson1GetChannelScheduleCommandError(output, context)];
2879
2256
  }
2880
- contents = {
2257
+ contents = map({
2881
2258
  $metadata: deserializeMetadata(output),
2882
- Items: undefined,
2883
- NextToken: undefined,
2884
- };
2259
+ });
2885
2260
  _a = __expectNonNull;
2886
2261
  _b = __expectObject;
2887
2262
  return [4, parseBody(output.body, context)];
2888
2263
  case 1:
2889
2264
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2890
- if (data.Items !== undefined && data.Items !== null) {
2265
+ if (data.Items != null) {
2891
2266
  contents.Items = deserializeAws_restJson1__listOfScheduleEntry(data.Items, context);
2892
2267
  }
2893
- if (data.NextToken !== undefined && data.NextToken !== null) {
2268
+ if (data.NextToken != null) {
2894
2269
  contents.NextToken = __expectString(data.NextToken);
2895
2270
  }
2896
- return [2, Promise.resolve(contents)];
2271
+ return [2, contents];
2897
2272
  }
2898
2273
  });
2899
2274
  }); };
2900
2275
  var deserializeAws_restJson1GetChannelScheduleCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2901
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
2276
+ var parsedOutput, _a, errorCode, parsedBody;
2902
2277
  var _b;
2903
2278
  return __generator(this, function (_c) {
2904
2279
  switch (_c.label) {
@@ -2909,18 +2284,13 @@ var deserializeAws_restJson1GetChannelScheduleCommandError = function (output, c
2909
2284
  case 1:
2910
2285
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
2911
2286
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2912
- switch (errorCode) {
2913
- default:
2914
- parsedBody = parsedOutput.body;
2915
- $metadata = deserializeMetadata(output);
2916
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2917
- response = new __BaseException({
2918
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2919
- $fault: "client",
2920
- $metadata: $metadata,
2921
- });
2922
- throw __decorateServiceException(response, parsedBody);
2923
- }
2287
+ parsedBody = parsedOutput.body;
2288
+ throwDefaultError({
2289
+ output: output,
2290
+ parsedBody: parsedBody,
2291
+ exceptionCtor: __BaseException,
2292
+ errorCode: errorCode,
2293
+ });
2924
2294
  return [2];
2925
2295
  }
2926
2296
  });
@@ -2933,96 +2303,77 @@ export var deserializeAws_restJson1GetPlaybackConfigurationCommand = function (o
2933
2303
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2934
2304
  return [2, deserializeAws_restJson1GetPlaybackConfigurationCommandError(output, context)];
2935
2305
  }
2936
- contents = {
2306
+ contents = map({
2937
2307
  $metadata: deserializeMetadata(output),
2938
- AdDecisionServerUrl: undefined,
2939
- AvailSuppression: undefined,
2940
- Bumper: undefined,
2941
- CdnConfiguration: undefined,
2942
- ConfigurationAliases: undefined,
2943
- DashConfiguration: undefined,
2944
- HlsConfiguration: undefined,
2945
- LivePreRollConfiguration: undefined,
2946
- LogConfiguration: undefined,
2947
- ManifestProcessingRules: undefined,
2948
- Name: undefined,
2949
- PersonalizationThresholdSeconds: undefined,
2950
- PlaybackConfigurationArn: undefined,
2951
- PlaybackEndpointPrefix: undefined,
2952
- SessionInitializationEndpointPrefix: undefined,
2953
- SlateAdUrl: undefined,
2954
- Tags: undefined,
2955
- TranscodeProfileName: undefined,
2956
- VideoContentSourceUrl: undefined,
2957
- };
2308
+ });
2958
2309
  _a = __expectNonNull;
2959
2310
  _b = __expectObject;
2960
2311
  return [4, parseBody(output.body, context)];
2961
2312
  case 1:
2962
2313
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2963
- if (data.AdDecisionServerUrl !== undefined && data.AdDecisionServerUrl !== null) {
2314
+ if (data.AdDecisionServerUrl != null) {
2964
2315
  contents.AdDecisionServerUrl = __expectString(data.AdDecisionServerUrl);
2965
2316
  }
2966
- if (data.AvailSuppression !== undefined && data.AvailSuppression !== null) {
2317
+ if (data.AvailSuppression != null) {
2967
2318
  contents.AvailSuppression = deserializeAws_restJson1AvailSuppression(data.AvailSuppression, context);
2968
2319
  }
2969
- if (data.Bumper !== undefined && data.Bumper !== null) {
2320
+ if (data.Bumper != null) {
2970
2321
  contents.Bumper = deserializeAws_restJson1Bumper(data.Bumper, context);
2971
2322
  }
2972
- if (data.CdnConfiguration !== undefined && data.CdnConfiguration !== null) {
2323
+ if (data.CdnConfiguration != null) {
2973
2324
  contents.CdnConfiguration = deserializeAws_restJson1CdnConfiguration(data.CdnConfiguration, context);
2974
2325
  }
2975
- if (data.ConfigurationAliases !== undefined && data.ConfigurationAliases !== null) {
2326
+ if (data.ConfigurationAliases != null) {
2976
2327
  contents.ConfigurationAliases = deserializeAws_restJson1ConfigurationAliasesResponse(data.ConfigurationAliases, context);
2977
2328
  }
2978
- if (data.DashConfiguration !== undefined && data.DashConfiguration !== null) {
2329
+ if (data.DashConfiguration != null) {
2979
2330
  contents.DashConfiguration = deserializeAws_restJson1DashConfiguration(data.DashConfiguration, context);
2980
2331
  }
2981
- if (data.HlsConfiguration !== undefined && data.HlsConfiguration !== null) {
2332
+ if (data.HlsConfiguration != null) {
2982
2333
  contents.HlsConfiguration = deserializeAws_restJson1HlsConfiguration(data.HlsConfiguration, context);
2983
2334
  }
2984
- if (data.LivePreRollConfiguration !== undefined && data.LivePreRollConfiguration !== null) {
2335
+ if (data.LivePreRollConfiguration != null) {
2985
2336
  contents.LivePreRollConfiguration = deserializeAws_restJson1LivePreRollConfiguration(data.LivePreRollConfiguration, context);
2986
2337
  }
2987
- if (data.LogConfiguration !== undefined && data.LogConfiguration !== null) {
2338
+ if (data.LogConfiguration != null) {
2988
2339
  contents.LogConfiguration = deserializeAws_restJson1LogConfiguration(data.LogConfiguration, context);
2989
2340
  }
2990
- if (data.ManifestProcessingRules !== undefined && data.ManifestProcessingRules !== null) {
2341
+ if (data.ManifestProcessingRules != null) {
2991
2342
  contents.ManifestProcessingRules = deserializeAws_restJson1ManifestProcessingRules(data.ManifestProcessingRules, context);
2992
2343
  }
2993
- if (data.Name !== undefined && data.Name !== null) {
2344
+ if (data.Name != null) {
2994
2345
  contents.Name = __expectString(data.Name);
2995
2346
  }
2996
- if (data.PersonalizationThresholdSeconds !== undefined && data.PersonalizationThresholdSeconds !== null) {
2347
+ if (data.PersonalizationThresholdSeconds != null) {
2997
2348
  contents.PersonalizationThresholdSeconds = __expectInt32(data.PersonalizationThresholdSeconds);
2998
2349
  }
2999
- if (data.PlaybackConfigurationArn !== undefined && data.PlaybackConfigurationArn !== null) {
2350
+ if (data.PlaybackConfigurationArn != null) {
3000
2351
  contents.PlaybackConfigurationArn = __expectString(data.PlaybackConfigurationArn);
3001
2352
  }
3002
- if (data.PlaybackEndpointPrefix !== undefined && data.PlaybackEndpointPrefix !== null) {
2353
+ if (data.PlaybackEndpointPrefix != null) {
3003
2354
  contents.PlaybackEndpointPrefix = __expectString(data.PlaybackEndpointPrefix);
3004
2355
  }
3005
- if (data.SessionInitializationEndpointPrefix !== undefined && data.SessionInitializationEndpointPrefix !== null) {
2356
+ if (data.SessionInitializationEndpointPrefix != null) {
3006
2357
  contents.SessionInitializationEndpointPrefix = __expectString(data.SessionInitializationEndpointPrefix);
3007
2358
  }
3008
- if (data.SlateAdUrl !== undefined && data.SlateAdUrl !== null) {
2359
+ if (data.SlateAdUrl != null) {
3009
2360
  contents.SlateAdUrl = __expectString(data.SlateAdUrl);
3010
2361
  }
3011
- if (data.tags !== undefined && data.tags !== null) {
2362
+ if (data.tags != null) {
3012
2363
  contents.Tags = deserializeAws_restJson1__mapOf__string(data.tags, context);
3013
2364
  }
3014
- if (data.TranscodeProfileName !== undefined && data.TranscodeProfileName !== null) {
2365
+ if (data.TranscodeProfileName != null) {
3015
2366
  contents.TranscodeProfileName = __expectString(data.TranscodeProfileName);
3016
2367
  }
3017
- if (data.VideoContentSourceUrl !== undefined && data.VideoContentSourceUrl !== null) {
2368
+ if (data.VideoContentSourceUrl != null) {
3018
2369
  contents.VideoContentSourceUrl = __expectString(data.VideoContentSourceUrl);
3019
2370
  }
3020
- return [2, Promise.resolve(contents)];
2371
+ return [2, contents];
3021
2372
  }
3022
2373
  });
3023
2374
  }); };
3024
2375
  var deserializeAws_restJson1GetPlaybackConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3025
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
2376
+ var parsedOutput, _a, errorCode, parsedBody;
3026
2377
  var _b;
3027
2378
  return __generator(this, function (_c) {
3028
2379
  switch (_c.label) {
@@ -3033,18 +2384,13 @@ var deserializeAws_restJson1GetPlaybackConfigurationCommandError = function (out
3033
2384
  case 1:
3034
2385
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
3035
2386
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3036
- switch (errorCode) {
3037
- default:
3038
- parsedBody = parsedOutput.body;
3039
- $metadata = deserializeMetadata(output);
3040
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3041
- response = new __BaseException({
3042
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3043
- $fault: "client",
3044
- $metadata: $metadata,
3045
- });
3046
- throw __decorateServiceException(response, parsedBody);
3047
- }
2387
+ parsedBody = parsedOutput.body;
2388
+ throwDefaultError({
2389
+ output: output,
2390
+ parsedBody: parsedBody,
2391
+ exceptionCtor: __BaseException,
2392
+ errorCode: errorCode,
2393
+ });
3048
2394
  return [2];
3049
2395
  }
3050
2396
  });
@@ -3057,44 +2403,38 @@ export var deserializeAws_restJson1GetPrefetchScheduleCommand = function (output
3057
2403
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3058
2404
  return [2, deserializeAws_restJson1GetPrefetchScheduleCommandError(output, context)];
3059
2405
  }
3060
- contents = {
2406
+ contents = map({
3061
2407
  $metadata: deserializeMetadata(output),
3062
- Arn: undefined,
3063
- Consumption: undefined,
3064
- Name: undefined,
3065
- PlaybackConfigurationName: undefined,
3066
- Retrieval: undefined,
3067
- StreamId: undefined,
3068
- };
2408
+ });
3069
2409
  _a = __expectNonNull;
3070
2410
  _b = __expectObject;
3071
2411
  return [4, parseBody(output.body, context)];
3072
2412
  case 1:
3073
2413
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3074
- if (data.Arn !== undefined && data.Arn !== null) {
2414
+ if (data.Arn != null) {
3075
2415
  contents.Arn = __expectString(data.Arn);
3076
2416
  }
3077
- if (data.Consumption !== undefined && data.Consumption !== null) {
2417
+ if (data.Consumption != null) {
3078
2418
  contents.Consumption = deserializeAws_restJson1PrefetchConsumption(data.Consumption, context);
3079
2419
  }
3080
- if (data.Name !== undefined && data.Name !== null) {
2420
+ if (data.Name != null) {
3081
2421
  contents.Name = __expectString(data.Name);
3082
2422
  }
3083
- if (data.PlaybackConfigurationName !== undefined && data.PlaybackConfigurationName !== null) {
2423
+ if (data.PlaybackConfigurationName != null) {
3084
2424
  contents.PlaybackConfigurationName = __expectString(data.PlaybackConfigurationName);
3085
2425
  }
3086
- if (data.Retrieval !== undefined && data.Retrieval !== null) {
2426
+ if (data.Retrieval != null) {
3087
2427
  contents.Retrieval = deserializeAws_restJson1PrefetchRetrieval(data.Retrieval, context);
3088
2428
  }
3089
- if (data.StreamId !== undefined && data.StreamId !== null) {
2429
+ if (data.StreamId != null) {
3090
2430
  contents.StreamId = __expectString(data.StreamId);
3091
2431
  }
3092
- return [2, Promise.resolve(contents)];
2432
+ return [2, contents];
3093
2433
  }
3094
2434
  });
3095
2435
  }); };
3096
2436
  var deserializeAws_restJson1GetPrefetchScheduleCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3097
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
2437
+ var parsedOutput, _a, errorCode, parsedBody;
3098
2438
  var _b;
3099
2439
  return __generator(this, function (_c) {
3100
2440
  switch (_c.label) {
@@ -3105,18 +2445,13 @@ var deserializeAws_restJson1GetPrefetchScheduleCommandError = function (output,
3105
2445
  case 1:
3106
2446
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
3107
2447
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3108
- switch (errorCode) {
3109
- default:
3110
- parsedBody = parsedOutput.body;
3111
- $metadata = deserializeMetadata(output);
3112
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3113
- response = new __BaseException({
3114
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3115
- $fault: "client",
3116
- $metadata: $metadata,
3117
- });
3118
- throw __decorateServiceException(response, parsedBody);
3119
- }
2448
+ parsedBody = parsedOutput.body;
2449
+ throwDefaultError({
2450
+ output: output,
2451
+ parsedBody: parsedBody,
2452
+ exceptionCtor: __BaseException,
2453
+ errorCode: errorCode,
2454
+ });
3120
2455
  return [2];
3121
2456
  }
3122
2457
  });
@@ -3129,28 +2464,26 @@ export var deserializeAws_restJson1ListAlertsCommand = function (output, context
3129
2464
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3130
2465
  return [2, deserializeAws_restJson1ListAlertsCommandError(output, context)];
3131
2466
  }
3132
- contents = {
2467
+ contents = map({
3133
2468
  $metadata: deserializeMetadata(output),
3134
- Items: undefined,
3135
- NextToken: undefined,
3136
- };
2469
+ });
3137
2470
  _a = __expectNonNull;
3138
2471
  _b = __expectObject;
3139
2472
  return [4, parseBody(output.body, context)];
3140
2473
  case 1:
3141
2474
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3142
- if (data.Items !== undefined && data.Items !== null) {
2475
+ if (data.Items != null) {
3143
2476
  contents.Items = deserializeAws_restJson1__listOfAlert(data.Items, context);
3144
2477
  }
3145
- if (data.NextToken !== undefined && data.NextToken !== null) {
2478
+ if (data.NextToken != null) {
3146
2479
  contents.NextToken = __expectString(data.NextToken);
3147
2480
  }
3148
- return [2, Promise.resolve(contents)];
2481
+ return [2, contents];
3149
2482
  }
3150
2483
  });
3151
2484
  }); };
3152
2485
  var deserializeAws_restJson1ListAlertsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3153
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
2486
+ var parsedOutput, _a, errorCode, parsedBody;
3154
2487
  var _b;
3155
2488
  return __generator(this, function (_c) {
3156
2489
  switch (_c.label) {
@@ -3161,18 +2494,13 @@ var deserializeAws_restJson1ListAlertsCommandError = function (output, context)
3161
2494
  case 1:
3162
2495
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
3163
2496
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3164
- switch (errorCode) {
3165
- default:
3166
- parsedBody = parsedOutput.body;
3167
- $metadata = deserializeMetadata(output);
3168
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3169
- response = new __BaseException({
3170
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3171
- $fault: "client",
3172
- $metadata: $metadata,
3173
- });
3174
- throw __decorateServiceException(response, parsedBody);
3175
- }
2497
+ parsedBody = parsedOutput.body;
2498
+ throwDefaultError({
2499
+ output: output,
2500
+ parsedBody: parsedBody,
2501
+ exceptionCtor: __BaseException,
2502
+ errorCode: errorCode,
2503
+ });
3176
2504
  return [2];
3177
2505
  }
3178
2506
  });
@@ -3185,28 +2513,26 @@ export var deserializeAws_restJson1ListChannelsCommand = function (output, conte
3185
2513
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3186
2514
  return [2, deserializeAws_restJson1ListChannelsCommandError(output, context)];
3187
2515
  }
3188
- contents = {
2516
+ contents = map({
3189
2517
  $metadata: deserializeMetadata(output),
3190
- Items: undefined,
3191
- NextToken: undefined,
3192
- };
2518
+ });
3193
2519
  _a = __expectNonNull;
3194
2520
  _b = __expectObject;
3195
2521
  return [4, parseBody(output.body, context)];
3196
2522
  case 1:
3197
2523
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3198
- if (data.Items !== undefined && data.Items !== null) {
2524
+ if (data.Items != null) {
3199
2525
  contents.Items = deserializeAws_restJson1__listOfChannel(data.Items, context);
3200
2526
  }
3201
- if (data.NextToken !== undefined && data.NextToken !== null) {
2527
+ if (data.NextToken != null) {
3202
2528
  contents.NextToken = __expectString(data.NextToken);
3203
2529
  }
3204
- return [2, Promise.resolve(contents)];
2530
+ return [2, contents];
3205
2531
  }
3206
2532
  });
3207
2533
  }); };
3208
2534
  var deserializeAws_restJson1ListChannelsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3209
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
2535
+ var parsedOutput, _a, errorCode, parsedBody;
3210
2536
  var _b;
3211
2537
  return __generator(this, function (_c) {
3212
2538
  switch (_c.label) {
@@ -3217,18 +2543,13 @@ var deserializeAws_restJson1ListChannelsCommandError = function (output, context
3217
2543
  case 1:
3218
2544
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
3219
2545
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3220
- switch (errorCode) {
3221
- default:
3222
- parsedBody = parsedOutput.body;
3223
- $metadata = deserializeMetadata(output);
3224
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3225
- response = new __BaseException({
3226
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3227
- $fault: "client",
3228
- $metadata: $metadata,
3229
- });
3230
- throw __decorateServiceException(response, parsedBody);
3231
- }
2546
+ parsedBody = parsedOutput.body;
2547
+ throwDefaultError({
2548
+ output: output,
2549
+ parsedBody: parsedBody,
2550
+ exceptionCtor: __BaseException,
2551
+ errorCode: errorCode,
2552
+ });
3232
2553
  return [2];
3233
2554
  }
3234
2555
  });
@@ -3241,28 +2562,26 @@ export var deserializeAws_restJson1ListLiveSourcesCommand = function (output, co
3241
2562
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3242
2563
  return [2, deserializeAws_restJson1ListLiveSourcesCommandError(output, context)];
3243
2564
  }
3244
- contents = {
2565
+ contents = map({
3245
2566
  $metadata: deserializeMetadata(output),
3246
- Items: undefined,
3247
- NextToken: undefined,
3248
- };
2567
+ });
3249
2568
  _a = __expectNonNull;
3250
2569
  _b = __expectObject;
3251
2570
  return [4, parseBody(output.body, context)];
3252
2571
  case 1:
3253
2572
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3254
- if (data.Items !== undefined && data.Items !== null) {
2573
+ if (data.Items != null) {
3255
2574
  contents.Items = deserializeAws_restJson1__listOfLiveSource(data.Items, context);
3256
2575
  }
3257
- if (data.NextToken !== undefined && data.NextToken !== null) {
2576
+ if (data.NextToken != null) {
3258
2577
  contents.NextToken = __expectString(data.NextToken);
3259
2578
  }
3260
- return [2, Promise.resolve(contents)];
2579
+ return [2, contents];
3261
2580
  }
3262
2581
  });
3263
2582
  }); };
3264
2583
  var deserializeAws_restJson1ListLiveSourcesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3265
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
2584
+ var parsedOutput, _a, errorCode, parsedBody;
3266
2585
  var _b;
3267
2586
  return __generator(this, function (_c) {
3268
2587
  switch (_c.label) {
@@ -3273,18 +2592,13 @@ var deserializeAws_restJson1ListLiveSourcesCommandError = function (output, cont
3273
2592
  case 1:
3274
2593
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
3275
2594
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3276
- switch (errorCode) {
3277
- default:
3278
- parsedBody = parsedOutput.body;
3279
- $metadata = deserializeMetadata(output);
3280
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3281
- response = new __BaseException({
3282
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3283
- $fault: "client",
3284
- $metadata: $metadata,
3285
- });
3286
- throw __decorateServiceException(response, parsedBody);
3287
- }
2595
+ parsedBody = parsedOutput.body;
2596
+ throwDefaultError({
2597
+ output: output,
2598
+ parsedBody: parsedBody,
2599
+ exceptionCtor: __BaseException,
2600
+ errorCode: errorCode,
2601
+ });
3288
2602
  return [2];
3289
2603
  }
3290
2604
  });
@@ -3297,28 +2611,26 @@ export var deserializeAws_restJson1ListPlaybackConfigurationsCommand = function
3297
2611
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3298
2612
  return [2, deserializeAws_restJson1ListPlaybackConfigurationsCommandError(output, context)];
3299
2613
  }
3300
- contents = {
2614
+ contents = map({
3301
2615
  $metadata: deserializeMetadata(output),
3302
- Items: undefined,
3303
- NextToken: undefined,
3304
- };
2616
+ });
3305
2617
  _a = __expectNonNull;
3306
2618
  _b = __expectObject;
3307
2619
  return [4, parseBody(output.body, context)];
3308
2620
  case 1:
3309
2621
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3310
- if (data.Items !== undefined && data.Items !== null) {
2622
+ if (data.Items != null) {
3311
2623
  contents.Items = deserializeAws_restJson1__listOfPlaybackConfiguration(data.Items, context);
3312
2624
  }
3313
- if (data.NextToken !== undefined && data.NextToken !== null) {
2625
+ if (data.NextToken != null) {
3314
2626
  contents.NextToken = __expectString(data.NextToken);
3315
2627
  }
3316
- return [2, Promise.resolve(contents)];
2628
+ return [2, contents];
3317
2629
  }
3318
2630
  });
3319
2631
  }); };
3320
2632
  var deserializeAws_restJson1ListPlaybackConfigurationsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3321
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
2633
+ var parsedOutput, _a, errorCode, parsedBody;
3322
2634
  var _b;
3323
2635
  return __generator(this, function (_c) {
3324
2636
  switch (_c.label) {
@@ -3329,18 +2641,13 @@ var deserializeAws_restJson1ListPlaybackConfigurationsCommandError = function (o
3329
2641
  case 1:
3330
2642
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
3331
2643
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3332
- switch (errorCode) {
3333
- default:
3334
- parsedBody = parsedOutput.body;
3335
- $metadata = deserializeMetadata(output);
3336
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3337
- response = new __BaseException({
3338
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3339
- $fault: "client",
3340
- $metadata: $metadata,
3341
- });
3342
- throw __decorateServiceException(response, parsedBody);
3343
- }
2644
+ parsedBody = parsedOutput.body;
2645
+ throwDefaultError({
2646
+ output: output,
2647
+ parsedBody: parsedBody,
2648
+ exceptionCtor: __BaseException,
2649
+ errorCode: errorCode,
2650
+ });
3344
2651
  return [2];
3345
2652
  }
3346
2653
  });
@@ -3353,28 +2660,26 @@ export var deserializeAws_restJson1ListPrefetchSchedulesCommand = function (outp
3353
2660
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3354
2661
  return [2, deserializeAws_restJson1ListPrefetchSchedulesCommandError(output, context)];
3355
2662
  }
3356
- contents = {
2663
+ contents = map({
3357
2664
  $metadata: deserializeMetadata(output),
3358
- Items: undefined,
3359
- NextToken: undefined,
3360
- };
2665
+ });
3361
2666
  _a = __expectNonNull;
3362
2667
  _b = __expectObject;
3363
2668
  return [4, parseBody(output.body, context)];
3364
2669
  case 1:
3365
2670
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3366
- if (data.Items !== undefined && data.Items !== null) {
2671
+ if (data.Items != null) {
3367
2672
  contents.Items = deserializeAws_restJson1__listOfPrefetchSchedule(data.Items, context);
3368
2673
  }
3369
- if (data.NextToken !== undefined && data.NextToken !== null) {
2674
+ if (data.NextToken != null) {
3370
2675
  contents.NextToken = __expectString(data.NextToken);
3371
2676
  }
3372
- return [2, Promise.resolve(contents)];
2677
+ return [2, contents];
3373
2678
  }
3374
2679
  });
3375
2680
  }); };
3376
2681
  var deserializeAws_restJson1ListPrefetchSchedulesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3377
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
2682
+ var parsedOutput, _a, errorCode, parsedBody;
3378
2683
  var _b;
3379
2684
  return __generator(this, function (_c) {
3380
2685
  switch (_c.label) {
@@ -3385,18 +2690,13 @@ var deserializeAws_restJson1ListPrefetchSchedulesCommandError = function (output
3385
2690
  case 1:
3386
2691
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
3387
2692
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3388
- switch (errorCode) {
3389
- default:
3390
- parsedBody = parsedOutput.body;
3391
- $metadata = deserializeMetadata(output);
3392
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3393
- response = new __BaseException({
3394
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3395
- $fault: "client",
3396
- $metadata: $metadata,
3397
- });
3398
- throw __decorateServiceException(response, parsedBody);
3399
- }
2693
+ parsedBody = parsedOutput.body;
2694
+ throwDefaultError({
2695
+ output: output,
2696
+ parsedBody: parsedBody,
2697
+ exceptionCtor: __BaseException,
2698
+ errorCode: errorCode,
2699
+ });
3400
2700
  return [2];
3401
2701
  }
3402
2702
  });
@@ -3409,28 +2709,26 @@ export var deserializeAws_restJson1ListSourceLocationsCommand = function (output
3409
2709
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3410
2710
  return [2, deserializeAws_restJson1ListSourceLocationsCommandError(output, context)];
3411
2711
  }
3412
- contents = {
2712
+ contents = map({
3413
2713
  $metadata: deserializeMetadata(output),
3414
- Items: undefined,
3415
- NextToken: undefined,
3416
- };
2714
+ });
3417
2715
  _a = __expectNonNull;
3418
2716
  _b = __expectObject;
3419
2717
  return [4, parseBody(output.body, context)];
3420
2718
  case 1:
3421
2719
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3422
- if (data.Items !== undefined && data.Items !== null) {
2720
+ if (data.Items != null) {
3423
2721
  contents.Items = deserializeAws_restJson1__listOfSourceLocation(data.Items, context);
3424
2722
  }
3425
- if (data.NextToken !== undefined && data.NextToken !== null) {
2723
+ if (data.NextToken != null) {
3426
2724
  contents.NextToken = __expectString(data.NextToken);
3427
2725
  }
3428
- return [2, Promise.resolve(contents)];
2726
+ return [2, contents];
3429
2727
  }
3430
2728
  });
3431
2729
  }); };
3432
2730
  var deserializeAws_restJson1ListSourceLocationsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3433
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
2731
+ var parsedOutput, _a, errorCode, parsedBody;
3434
2732
  var _b;
3435
2733
  return __generator(this, function (_c) {
3436
2734
  switch (_c.label) {
@@ -3441,18 +2739,13 @@ var deserializeAws_restJson1ListSourceLocationsCommandError = function (output,
3441
2739
  case 1:
3442
2740
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
3443
2741
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3444
- switch (errorCode) {
3445
- default:
3446
- parsedBody = parsedOutput.body;
3447
- $metadata = deserializeMetadata(output);
3448
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3449
- response = new __BaseException({
3450
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3451
- $fault: "client",
3452
- $metadata: $metadata,
3453
- });
3454
- throw __decorateServiceException(response, parsedBody);
3455
- }
2742
+ parsedBody = parsedOutput.body;
2743
+ throwDefaultError({
2744
+ output: output,
2745
+ parsedBody: parsedBody,
2746
+ exceptionCtor: __BaseException,
2747
+ errorCode: errorCode,
2748
+ });
3456
2749
  return [2];
3457
2750
  }
3458
2751
  });
@@ -3465,24 +2758,23 @@ export var deserializeAws_restJson1ListTagsForResourceCommand = function (output
3465
2758
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3466
2759
  return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
3467
2760
  }
3468
- contents = {
2761
+ contents = map({
3469
2762
  $metadata: deserializeMetadata(output),
3470
- Tags: undefined,
3471
- };
2763
+ });
3472
2764
  _a = __expectNonNull;
3473
2765
  _b = __expectObject;
3474
2766
  return [4, parseBody(output.body, context)];
3475
2767
  case 1:
3476
2768
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3477
- if (data.tags !== undefined && data.tags !== null) {
2769
+ if (data.tags != null) {
3478
2770
  contents.Tags = deserializeAws_restJson1__mapOf__string(data.tags, context);
3479
2771
  }
3480
- return [2, Promise.resolve(contents)];
2772
+ return [2, contents];
3481
2773
  }
3482
2774
  });
3483
2775
  }); };
3484
2776
  var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3485
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2777
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3486
2778
  var _c;
3487
2779
  return __generator(this, function (_d) {
3488
2780
  switch (_d.label) {
@@ -3503,14 +2795,14 @@ var deserializeAws_restJson1ListTagsForResourceCommandError = function (output,
3503
2795
  case 3: throw _d.sent();
3504
2796
  case 4:
3505
2797
  parsedBody = parsedOutput.body;
3506
- $metadata = deserializeMetadata(output);
3507
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3508
- response = new __BaseException({
3509
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3510
- $fault: "client",
3511
- $metadata: $metadata,
2798
+ throwDefaultError({
2799
+ output: output,
2800
+ parsedBody: parsedBody,
2801
+ exceptionCtor: __BaseException,
2802
+ errorCode: errorCode,
3512
2803
  });
3513
- throw __decorateServiceException(response, parsedBody);
2804
+ _d.label = 5;
2805
+ case 5: return [2];
3514
2806
  }
3515
2807
  });
3516
2808
  }); };
@@ -3522,28 +2814,26 @@ export var deserializeAws_restJson1ListVodSourcesCommand = function (output, con
3522
2814
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3523
2815
  return [2, deserializeAws_restJson1ListVodSourcesCommandError(output, context)];
3524
2816
  }
3525
- contents = {
2817
+ contents = map({
3526
2818
  $metadata: deserializeMetadata(output),
3527
- Items: undefined,
3528
- NextToken: undefined,
3529
- };
2819
+ });
3530
2820
  _a = __expectNonNull;
3531
2821
  _b = __expectObject;
3532
2822
  return [4, parseBody(output.body, context)];
3533
2823
  case 1:
3534
2824
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3535
- if (data.Items !== undefined && data.Items !== null) {
2825
+ if (data.Items != null) {
3536
2826
  contents.Items = deserializeAws_restJson1__listOfVodSource(data.Items, context);
3537
2827
  }
3538
- if (data.NextToken !== undefined && data.NextToken !== null) {
2828
+ if (data.NextToken != null) {
3539
2829
  contents.NextToken = __expectString(data.NextToken);
3540
2830
  }
3541
- return [2, Promise.resolve(contents)];
2831
+ return [2, contents];
3542
2832
  }
3543
2833
  });
3544
2834
  }); };
3545
2835
  var deserializeAws_restJson1ListVodSourcesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3546
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
2836
+ var parsedOutput, _a, errorCode, parsedBody;
3547
2837
  var _b;
3548
2838
  return __generator(this, function (_c) {
3549
2839
  switch (_c.label) {
@@ -3554,18 +2844,13 @@ var deserializeAws_restJson1ListVodSourcesCommandError = function (output, conte
3554
2844
  case 1:
3555
2845
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
3556
2846
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3557
- switch (errorCode) {
3558
- default:
3559
- parsedBody = parsedOutput.body;
3560
- $metadata = deserializeMetadata(output);
3561
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3562
- response = new __BaseException({
3563
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3564
- $fault: "client",
3565
- $metadata: $metadata,
3566
- });
3567
- throw __decorateServiceException(response, parsedBody);
3568
- }
2847
+ parsedBody = parsedOutput.body;
2848
+ throwDefaultError({
2849
+ output: output,
2850
+ parsedBody: parsedBody,
2851
+ exceptionCtor: __BaseException,
2852
+ errorCode: errorCode,
2853
+ });
3569
2854
  return [2];
3570
2855
  }
3571
2856
  });
@@ -3578,18 +2863,18 @@ export var deserializeAws_restJson1PutChannelPolicyCommand = function (output, c
3578
2863
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3579
2864
  return [2, deserializeAws_restJson1PutChannelPolicyCommandError(output, context)];
3580
2865
  }
3581
- contents = {
2866
+ contents = map({
3582
2867
  $metadata: deserializeMetadata(output),
3583
- };
2868
+ });
3584
2869
  return [4, collectBody(output.body, context)];
3585
2870
  case 1:
3586
2871
  _a.sent();
3587
- return [2, Promise.resolve(contents)];
2872
+ return [2, contents];
3588
2873
  }
3589
2874
  });
3590
2875
  }); };
3591
2876
  var deserializeAws_restJson1PutChannelPolicyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3592
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
2877
+ var parsedOutput, _a, errorCode, parsedBody;
3593
2878
  var _b;
3594
2879
  return __generator(this, function (_c) {
3595
2880
  switch (_c.label) {
@@ -3600,18 +2885,13 @@ var deserializeAws_restJson1PutChannelPolicyCommandError = function (output, con
3600
2885
  case 1:
3601
2886
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
3602
2887
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3603
- switch (errorCode) {
3604
- default:
3605
- parsedBody = parsedOutput.body;
3606
- $metadata = deserializeMetadata(output);
3607
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3608
- response = new __BaseException({
3609
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3610
- $fault: "client",
3611
- $metadata: $metadata,
3612
- });
3613
- throw __decorateServiceException(response, parsedBody);
3614
- }
2888
+ parsedBody = parsedOutput.body;
2889
+ throwDefaultError({
2890
+ output: output,
2891
+ parsedBody: parsedBody,
2892
+ exceptionCtor: __BaseException,
2893
+ errorCode: errorCode,
2894
+ });
3615
2895
  return [2];
3616
2896
  }
3617
2897
  });
@@ -3624,96 +2904,77 @@ export var deserializeAws_restJson1PutPlaybackConfigurationCommand = function (o
3624
2904
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3625
2905
  return [2, deserializeAws_restJson1PutPlaybackConfigurationCommandError(output, context)];
3626
2906
  }
3627
- contents = {
2907
+ contents = map({
3628
2908
  $metadata: deserializeMetadata(output),
3629
- AdDecisionServerUrl: undefined,
3630
- AvailSuppression: undefined,
3631
- Bumper: undefined,
3632
- CdnConfiguration: undefined,
3633
- ConfigurationAliases: undefined,
3634
- DashConfiguration: undefined,
3635
- HlsConfiguration: undefined,
3636
- LivePreRollConfiguration: undefined,
3637
- LogConfiguration: undefined,
3638
- ManifestProcessingRules: undefined,
3639
- Name: undefined,
3640
- PersonalizationThresholdSeconds: undefined,
3641
- PlaybackConfigurationArn: undefined,
3642
- PlaybackEndpointPrefix: undefined,
3643
- SessionInitializationEndpointPrefix: undefined,
3644
- SlateAdUrl: undefined,
3645
- Tags: undefined,
3646
- TranscodeProfileName: undefined,
3647
- VideoContentSourceUrl: undefined,
3648
- };
2909
+ });
3649
2910
  _a = __expectNonNull;
3650
2911
  _b = __expectObject;
3651
2912
  return [4, parseBody(output.body, context)];
3652
2913
  case 1:
3653
2914
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3654
- if (data.AdDecisionServerUrl !== undefined && data.AdDecisionServerUrl !== null) {
2915
+ if (data.AdDecisionServerUrl != null) {
3655
2916
  contents.AdDecisionServerUrl = __expectString(data.AdDecisionServerUrl);
3656
2917
  }
3657
- if (data.AvailSuppression !== undefined && data.AvailSuppression !== null) {
2918
+ if (data.AvailSuppression != null) {
3658
2919
  contents.AvailSuppression = deserializeAws_restJson1AvailSuppression(data.AvailSuppression, context);
3659
2920
  }
3660
- if (data.Bumper !== undefined && data.Bumper !== null) {
2921
+ if (data.Bumper != null) {
3661
2922
  contents.Bumper = deserializeAws_restJson1Bumper(data.Bumper, context);
3662
2923
  }
3663
- if (data.CdnConfiguration !== undefined && data.CdnConfiguration !== null) {
2924
+ if (data.CdnConfiguration != null) {
3664
2925
  contents.CdnConfiguration = deserializeAws_restJson1CdnConfiguration(data.CdnConfiguration, context);
3665
2926
  }
3666
- if (data.ConfigurationAliases !== undefined && data.ConfigurationAliases !== null) {
2927
+ if (data.ConfigurationAliases != null) {
3667
2928
  contents.ConfigurationAliases = deserializeAws_restJson1ConfigurationAliasesResponse(data.ConfigurationAliases, context);
3668
2929
  }
3669
- if (data.DashConfiguration !== undefined && data.DashConfiguration !== null) {
2930
+ if (data.DashConfiguration != null) {
3670
2931
  contents.DashConfiguration = deserializeAws_restJson1DashConfiguration(data.DashConfiguration, context);
3671
2932
  }
3672
- if (data.HlsConfiguration !== undefined && data.HlsConfiguration !== null) {
2933
+ if (data.HlsConfiguration != null) {
3673
2934
  contents.HlsConfiguration = deserializeAws_restJson1HlsConfiguration(data.HlsConfiguration, context);
3674
2935
  }
3675
- if (data.LivePreRollConfiguration !== undefined && data.LivePreRollConfiguration !== null) {
2936
+ if (data.LivePreRollConfiguration != null) {
3676
2937
  contents.LivePreRollConfiguration = deserializeAws_restJson1LivePreRollConfiguration(data.LivePreRollConfiguration, context);
3677
2938
  }
3678
- if (data.LogConfiguration !== undefined && data.LogConfiguration !== null) {
2939
+ if (data.LogConfiguration != null) {
3679
2940
  contents.LogConfiguration = deserializeAws_restJson1LogConfiguration(data.LogConfiguration, context);
3680
2941
  }
3681
- if (data.ManifestProcessingRules !== undefined && data.ManifestProcessingRules !== null) {
2942
+ if (data.ManifestProcessingRules != null) {
3682
2943
  contents.ManifestProcessingRules = deserializeAws_restJson1ManifestProcessingRules(data.ManifestProcessingRules, context);
3683
2944
  }
3684
- if (data.Name !== undefined && data.Name !== null) {
2945
+ if (data.Name != null) {
3685
2946
  contents.Name = __expectString(data.Name);
3686
2947
  }
3687
- if (data.PersonalizationThresholdSeconds !== undefined && data.PersonalizationThresholdSeconds !== null) {
2948
+ if (data.PersonalizationThresholdSeconds != null) {
3688
2949
  contents.PersonalizationThresholdSeconds = __expectInt32(data.PersonalizationThresholdSeconds);
3689
2950
  }
3690
- if (data.PlaybackConfigurationArn !== undefined && data.PlaybackConfigurationArn !== null) {
2951
+ if (data.PlaybackConfigurationArn != null) {
3691
2952
  contents.PlaybackConfigurationArn = __expectString(data.PlaybackConfigurationArn);
3692
2953
  }
3693
- if (data.PlaybackEndpointPrefix !== undefined && data.PlaybackEndpointPrefix !== null) {
2954
+ if (data.PlaybackEndpointPrefix != null) {
3694
2955
  contents.PlaybackEndpointPrefix = __expectString(data.PlaybackEndpointPrefix);
3695
2956
  }
3696
- if (data.SessionInitializationEndpointPrefix !== undefined && data.SessionInitializationEndpointPrefix !== null) {
2957
+ if (data.SessionInitializationEndpointPrefix != null) {
3697
2958
  contents.SessionInitializationEndpointPrefix = __expectString(data.SessionInitializationEndpointPrefix);
3698
2959
  }
3699
- if (data.SlateAdUrl !== undefined && data.SlateAdUrl !== null) {
2960
+ if (data.SlateAdUrl != null) {
3700
2961
  contents.SlateAdUrl = __expectString(data.SlateAdUrl);
3701
2962
  }
3702
- if (data.tags !== undefined && data.tags !== null) {
2963
+ if (data.tags != null) {
3703
2964
  contents.Tags = deserializeAws_restJson1__mapOf__string(data.tags, context);
3704
2965
  }
3705
- if (data.TranscodeProfileName !== undefined && data.TranscodeProfileName !== null) {
2966
+ if (data.TranscodeProfileName != null) {
3706
2967
  contents.TranscodeProfileName = __expectString(data.TranscodeProfileName);
3707
2968
  }
3708
- if (data.VideoContentSourceUrl !== undefined && data.VideoContentSourceUrl !== null) {
2969
+ if (data.VideoContentSourceUrl != null) {
3709
2970
  contents.VideoContentSourceUrl = __expectString(data.VideoContentSourceUrl);
3710
2971
  }
3711
- return [2, Promise.resolve(contents)];
2972
+ return [2, contents];
3712
2973
  }
3713
2974
  });
3714
2975
  }); };
3715
2976
  var deserializeAws_restJson1PutPlaybackConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3716
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
2977
+ var parsedOutput, _a, errorCode, parsedBody;
3717
2978
  var _b;
3718
2979
  return __generator(this, function (_c) {
3719
2980
  switch (_c.label) {
@@ -3724,18 +2985,13 @@ var deserializeAws_restJson1PutPlaybackConfigurationCommandError = function (out
3724
2985
  case 1:
3725
2986
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
3726
2987
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3727
- switch (errorCode) {
3728
- default:
3729
- parsedBody = parsedOutput.body;
3730
- $metadata = deserializeMetadata(output);
3731
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3732
- response = new __BaseException({
3733
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3734
- $fault: "client",
3735
- $metadata: $metadata,
3736
- });
3737
- throw __decorateServiceException(response, parsedBody);
3738
- }
2988
+ parsedBody = parsedOutput.body;
2989
+ throwDefaultError({
2990
+ output: output,
2991
+ parsedBody: parsedBody,
2992
+ exceptionCtor: __BaseException,
2993
+ errorCode: errorCode,
2994
+ });
3739
2995
  return [2];
3740
2996
  }
3741
2997
  });
@@ -3748,18 +3004,18 @@ export var deserializeAws_restJson1StartChannelCommand = function (output, conte
3748
3004
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3749
3005
  return [2, deserializeAws_restJson1StartChannelCommandError(output, context)];
3750
3006
  }
3751
- contents = {
3007
+ contents = map({
3752
3008
  $metadata: deserializeMetadata(output),
3753
- };
3009
+ });
3754
3010
  return [4, collectBody(output.body, context)];
3755
3011
  case 1:
3756
3012
  _a.sent();
3757
- return [2, Promise.resolve(contents)];
3013
+ return [2, contents];
3758
3014
  }
3759
3015
  });
3760
3016
  }); };
3761
3017
  var deserializeAws_restJson1StartChannelCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3762
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
3018
+ var parsedOutput, _a, errorCode, parsedBody;
3763
3019
  var _b;
3764
3020
  return __generator(this, function (_c) {
3765
3021
  switch (_c.label) {
@@ -3770,18 +3026,13 @@ var deserializeAws_restJson1StartChannelCommandError = function (output, context
3770
3026
  case 1:
3771
3027
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
3772
3028
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3773
- switch (errorCode) {
3774
- default:
3775
- parsedBody = parsedOutput.body;
3776
- $metadata = deserializeMetadata(output);
3777
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3778
- response = new __BaseException({
3779
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3780
- $fault: "client",
3781
- $metadata: $metadata,
3782
- });
3783
- throw __decorateServiceException(response, parsedBody);
3784
- }
3029
+ parsedBody = parsedOutput.body;
3030
+ throwDefaultError({
3031
+ output: output,
3032
+ parsedBody: parsedBody,
3033
+ exceptionCtor: __BaseException,
3034
+ errorCode: errorCode,
3035
+ });
3785
3036
  return [2];
3786
3037
  }
3787
3038
  });
@@ -3794,18 +3045,18 @@ export var deserializeAws_restJson1StopChannelCommand = function (output, contex
3794
3045
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3795
3046
  return [2, deserializeAws_restJson1StopChannelCommandError(output, context)];
3796
3047
  }
3797
- contents = {
3048
+ contents = map({
3798
3049
  $metadata: deserializeMetadata(output),
3799
- };
3050
+ });
3800
3051
  return [4, collectBody(output.body, context)];
3801
3052
  case 1:
3802
3053
  _a.sent();
3803
- return [2, Promise.resolve(contents)];
3054
+ return [2, contents];
3804
3055
  }
3805
3056
  });
3806
3057
  }); };
3807
3058
  var deserializeAws_restJson1StopChannelCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3808
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
3059
+ var parsedOutput, _a, errorCode, parsedBody;
3809
3060
  var _b;
3810
3061
  return __generator(this, function (_c) {
3811
3062
  switch (_c.label) {
@@ -3816,18 +3067,13 @@ var deserializeAws_restJson1StopChannelCommandError = function (output, context)
3816
3067
  case 1:
3817
3068
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
3818
3069
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3819
- switch (errorCode) {
3820
- default:
3821
- parsedBody = parsedOutput.body;
3822
- $metadata = deserializeMetadata(output);
3823
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3824
- response = new __BaseException({
3825
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3826
- $fault: "client",
3827
- $metadata: $metadata,
3828
- });
3829
- throw __decorateServiceException(response, parsedBody);
3830
- }
3070
+ parsedBody = parsedOutput.body;
3071
+ throwDefaultError({
3072
+ output: output,
3073
+ parsedBody: parsedBody,
3074
+ exceptionCtor: __BaseException,
3075
+ errorCode: errorCode,
3076
+ });
3831
3077
  return [2];
3832
3078
  }
3833
3079
  });
@@ -3840,18 +3086,18 @@ export var deserializeAws_restJson1TagResourceCommand = function (output, contex
3840
3086
  if (output.statusCode !== 204 && output.statusCode >= 300) {
3841
3087
  return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
3842
3088
  }
3843
- contents = {
3089
+ contents = map({
3844
3090
  $metadata: deserializeMetadata(output),
3845
- };
3091
+ });
3846
3092
  return [4, collectBody(output.body, context)];
3847
3093
  case 1:
3848
3094
  _a.sent();
3849
- return [2, Promise.resolve(contents)];
3095
+ return [2, contents];
3850
3096
  }
3851
3097
  });
3852
3098
  }); };
3853
3099
  var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3854
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3100
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3855
3101
  var _c;
3856
3102
  return __generator(this, function (_d) {
3857
3103
  switch (_d.label) {
@@ -3872,14 +3118,14 @@ var deserializeAws_restJson1TagResourceCommandError = function (output, context)
3872
3118
  case 3: throw _d.sent();
3873
3119
  case 4:
3874
3120
  parsedBody = parsedOutput.body;
3875
- $metadata = deserializeMetadata(output);
3876
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3877
- response = new __BaseException({
3878
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3879
- $fault: "client",
3880
- $metadata: $metadata,
3121
+ throwDefaultError({
3122
+ output: output,
3123
+ parsedBody: parsedBody,
3124
+ exceptionCtor: __BaseException,
3125
+ errorCode: errorCode,
3881
3126
  });
3882
- throw __decorateServiceException(response, parsedBody);
3127
+ _d.label = 5;
3128
+ case 5: return [2];
3883
3129
  }
3884
3130
  });
3885
3131
  }); };
@@ -3891,18 +3137,18 @@ export var deserializeAws_restJson1UntagResourceCommand = function (output, cont
3891
3137
  if (output.statusCode !== 204 && output.statusCode >= 300) {
3892
3138
  return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
3893
3139
  }
3894
- contents = {
3140
+ contents = map({
3895
3141
  $metadata: deserializeMetadata(output),
3896
- };
3142
+ });
3897
3143
  return [4, collectBody(output.body, context)];
3898
3144
  case 1:
3899
3145
  _a.sent();
3900
- return [2, Promise.resolve(contents)];
3146
+ return [2, contents];
3901
3147
  }
3902
3148
  });
3903
3149
  }); };
3904
3150
  var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3905
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3151
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3906
3152
  var _c;
3907
3153
  return __generator(this, function (_d) {
3908
3154
  switch (_d.label) {
@@ -3923,14 +3169,14 @@ var deserializeAws_restJson1UntagResourceCommandError = function (output, contex
3923
3169
  case 3: throw _d.sent();
3924
3170
  case 4:
3925
3171
  parsedBody = parsedOutput.body;
3926
- $metadata = deserializeMetadata(output);
3927
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3928
- response = new __BaseException({
3929
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3930
- $fault: "client",
3931
- $metadata: $metadata,
3172
+ throwDefaultError({
3173
+ output: output,
3174
+ parsedBody: parsedBody,
3175
+ exceptionCtor: __BaseException,
3176
+ errorCode: errorCode,
3932
3177
  });
3933
- throw __decorateServiceException(response, parsedBody);
3178
+ _d.label = 5;
3179
+ case 5: return [2];
3934
3180
  }
3935
3181
  });
3936
3182
  }); };
@@ -3942,60 +3188,50 @@ export var deserializeAws_restJson1UpdateChannelCommand = function (output, cont
3942
3188
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3943
3189
  return [2, deserializeAws_restJson1UpdateChannelCommandError(output, context)];
3944
3190
  }
3945
- contents = {
3191
+ contents = map({
3946
3192
  $metadata: deserializeMetadata(output),
3947
- Arn: undefined,
3948
- ChannelName: undefined,
3949
- ChannelState: undefined,
3950
- CreationTime: undefined,
3951
- FillerSlate: undefined,
3952
- LastModifiedTime: undefined,
3953
- Outputs: undefined,
3954
- PlaybackMode: undefined,
3955
- Tags: undefined,
3956
- Tier: undefined,
3957
- };
3193
+ });
3958
3194
  _a = __expectNonNull;
3959
3195
  _b = __expectObject;
3960
3196
  return [4, parseBody(output.body, context)];
3961
3197
  case 1:
3962
3198
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3963
- if (data.Arn !== undefined && data.Arn !== null) {
3199
+ if (data.Arn != null) {
3964
3200
  contents.Arn = __expectString(data.Arn);
3965
3201
  }
3966
- if (data.ChannelName !== undefined && data.ChannelName !== null) {
3202
+ if (data.ChannelName != null) {
3967
3203
  contents.ChannelName = __expectString(data.ChannelName);
3968
3204
  }
3969
- if (data.ChannelState !== undefined && data.ChannelState !== null) {
3205
+ if (data.ChannelState != null) {
3970
3206
  contents.ChannelState = __expectString(data.ChannelState);
3971
3207
  }
3972
- if (data.CreationTime !== undefined && data.CreationTime !== null) {
3208
+ if (data.CreationTime != null) {
3973
3209
  contents.CreationTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.CreationTime)));
3974
3210
  }
3975
- if (data.FillerSlate !== undefined && data.FillerSlate !== null) {
3211
+ if (data.FillerSlate != null) {
3976
3212
  contents.FillerSlate = deserializeAws_restJson1SlateSource(data.FillerSlate, context);
3977
3213
  }
3978
- if (data.LastModifiedTime !== undefined && data.LastModifiedTime !== null) {
3214
+ if (data.LastModifiedTime != null) {
3979
3215
  contents.LastModifiedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LastModifiedTime)));
3980
3216
  }
3981
- if (data.Outputs !== undefined && data.Outputs !== null) {
3217
+ if (data.Outputs != null) {
3982
3218
  contents.Outputs = deserializeAws_restJson1ResponseOutputs(data.Outputs, context);
3983
3219
  }
3984
- if (data.PlaybackMode !== undefined && data.PlaybackMode !== null) {
3220
+ if (data.PlaybackMode != null) {
3985
3221
  contents.PlaybackMode = __expectString(data.PlaybackMode);
3986
3222
  }
3987
- if (data.tags !== undefined && data.tags !== null) {
3223
+ if (data.tags != null) {
3988
3224
  contents.Tags = deserializeAws_restJson1__mapOf__string(data.tags, context);
3989
3225
  }
3990
- if (data.Tier !== undefined && data.Tier !== null) {
3226
+ if (data.Tier != null) {
3991
3227
  contents.Tier = __expectString(data.Tier);
3992
3228
  }
3993
- return [2, Promise.resolve(contents)];
3229
+ return [2, contents];
3994
3230
  }
3995
3231
  });
3996
3232
  }); };
3997
3233
  var deserializeAws_restJson1UpdateChannelCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3998
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
3234
+ var parsedOutput, _a, errorCode, parsedBody;
3999
3235
  var _b;
4000
3236
  return __generator(this, function (_c) {
4001
3237
  switch (_c.label) {
@@ -4006,18 +3242,13 @@ var deserializeAws_restJson1UpdateChannelCommandError = function (output, contex
4006
3242
  case 1:
4007
3243
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
4008
3244
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4009
- switch (errorCode) {
4010
- default:
4011
- parsedBody = parsedOutput.body;
4012
- $metadata = deserializeMetadata(output);
4013
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4014
- response = new __BaseException({
4015
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4016
- $fault: "client",
4017
- $metadata: $metadata,
4018
- });
4019
- throw __decorateServiceException(response, parsedBody);
4020
- }
3245
+ parsedBody = parsedOutput.body;
3246
+ throwDefaultError({
3247
+ output: output,
3248
+ parsedBody: parsedBody,
3249
+ exceptionCtor: __BaseException,
3250
+ errorCode: errorCode,
3251
+ });
4021
3252
  return [2];
4022
3253
  }
4023
3254
  });
@@ -4030,48 +3261,41 @@ export var deserializeAws_restJson1UpdateLiveSourceCommand = function (output, c
4030
3261
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4031
3262
  return [2, deserializeAws_restJson1UpdateLiveSourceCommandError(output, context)];
4032
3263
  }
4033
- contents = {
3264
+ contents = map({
4034
3265
  $metadata: deserializeMetadata(output),
4035
- Arn: undefined,
4036
- CreationTime: undefined,
4037
- HttpPackageConfigurations: undefined,
4038
- LastModifiedTime: undefined,
4039
- LiveSourceName: undefined,
4040
- SourceLocationName: undefined,
4041
- Tags: undefined,
4042
- };
3266
+ });
4043
3267
  _a = __expectNonNull;
4044
3268
  _b = __expectObject;
4045
3269
  return [4, parseBody(output.body, context)];
4046
3270
  case 1:
4047
3271
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
4048
- if (data.Arn !== undefined && data.Arn !== null) {
3272
+ if (data.Arn != null) {
4049
3273
  contents.Arn = __expectString(data.Arn);
4050
3274
  }
4051
- if (data.CreationTime !== undefined && data.CreationTime !== null) {
3275
+ if (data.CreationTime != null) {
4052
3276
  contents.CreationTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.CreationTime)));
4053
3277
  }
4054
- if (data.HttpPackageConfigurations !== undefined && data.HttpPackageConfigurations !== null) {
3278
+ if (data.HttpPackageConfigurations != null) {
4055
3279
  contents.HttpPackageConfigurations = deserializeAws_restJson1HttpPackageConfigurations(data.HttpPackageConfigurations, context);
4056
3280
  }
4057
- if (data.LastModifiedTime !== undefined && data.LastModifiedTime !== null) {
3281
+ if (data.LastModifiedTime != null) {
4058
3282
  contents.LastModifiedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LastModifiedTime)));
4059
3283
  }
4060
- if (data.LiveSourceName !== undefined && data.LiveSourceName !== null) {
3284
+ if (data.LiveSourceName != null) {
4061
3285
  contents.LiveSourceName = __expectString(data.LiveSourceName);
4062
3286
  }
4063
- if (data.SourceLocationName !== undefined && data.SourceLocationName !== null) {
3287
+ if (data.SourceLocationName != null) {
4064
3288
  contents.SourceLocationName = __expectString(data.SourceLocationName);
4065
3289
  }
4066
- if (data.tags !== undefined && data.tags !== null) {
3290
+ if (data.tags != null) {
4067
3291
  contents.Tags = deserializeAws_restJson1__mapOf__string(data.tags, context);
4068
3292
  }
4069
- return [2, Promise.resolve(contents)];
3293
+ return [2, contents];
4070
3294
  }
4071
3295
  });
4072
3296
  }); };
4073
3297
  var deserializeAws_restJson1UpdateLiveSourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
4074
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
3298
+ var parsedOutput, _a, errorCode, parsedBody;
4075
3299
  var _b;
4076
3300
  return __generator(this, function (_c) {
4077
3301
  switch (_c.label) {
@@ -4082,18 +3306,13 @@ var deserializeAws_restJson1UpdateLiveSourceCommandError = function (output, con
4082
3306
  case 1:
4083
3307
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
4084
3308
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4085
- switch (errorCode) {
4086
- default:
4087
- parsedBody = parsedOutput.body;
4088
- $metadata = deserializeMetadata(output);
4089
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4090
- response = new __BaseException({
4091
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4092
- $fault: "client",
4093
- $metadata: $metadata,
4094
- });
4095
- throw __decorateServiceException(response, parsedBody);
4096
- }
3309
+ parsedBody = parsedOutput.body;
3310
+ throwDefaultError({
3311
+ output: output,
3312
+ parsedBody: parsedBody,
3313
+ exceptionCtor: __BaseException,
3314
+ errorCode: errorCode,
3315
+ });
4097
3316
  return [2];
4098
3317
  }
4099
3318
  });
@@ -4106,56 +3325,47 @@ export var deserializeAws_restJson1UpdateSourceLocationCommand = function (outpu
4106
3325
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4107
3326
  return [2, deserializeAws_restJson1UpdateSourceLocationCommandError(output, context)];
4108
3327
  }
4109
- contents = {
3328
+ contents = map({
4110
3329
  $metadata: deserializeMetadata(output),
4111
- AccessConfiguration: undefined,
4112
- Arn: undefined,
4113
- CreationTime: undefined,
4114
- DefaultSegmentDeliveryConfiguration: undefined,
4115
- HttpConfiguration: undefined,
4116
- LastModifiedTime: undefined,
4117
- SegmentDeliveryConfigurations: undefined,
4118
- SourceLocationName: undefined,
4119
- Tags: undefined,
4120
- };
3330
+ });
4121
3331
  _a = __expectNonNull;
4122
3332
  _b = __expectObject;
4123
3333
  return [4, parseBody(output.body, context)];
4124
3334
  case 1:
4125
3335
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
4126
- if (data.AccessConfiguration !== undefined && data.AccessConfiguration !== null) {
3336
+ if (data.AccessConfiguration != null) {
4127
3337
  contents.AccessConfiguration = deserializeAws_restJson1AccessConfiguration(data.AccessConfiguration, context);
4128
3338
  }
4129
- if (data.Arn !== undefined && data.Arn !== null) {
3339
+ if (data.Arn != null) {
4130
3340
  contents.Arn = __expectString(data.Arn);
4131
3341
  }
4132
- if (data.CreationTime !== undefined && data.CreationTime !== null) {
3342
+ if (data.CreationTime != null) {
4133
3343
  contents.CreationTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.CreationTime)));
4134
3344
  }
4135
- if (data.DefaultSegmentDeliveryConfiguration !== undefined && data.DefaultSegmentDeliveryConfiguration !== null) {
3345
+ if (data.DefaultSegmentDeliveryConfiguration != null) {
4136
3346
  contents.DefaultSegmentDeliveryConfiguration = deserializeAws_restJson1DefaultSegmentDeliveryConfiguration(data.DefaultSegmentDeliveryConfiguration, context);
4137
3347
  }
4138
- if (data.HttpConfiguration !== undefined && data.HttpConfiguration !== null) {
3348
+ if (data.HttpConfiguration != null) {
4139
3349
  contents.HttpConfiguration = deserializeAws_restJson1HttpConfiguration(data.HttpConfiguration, context);
4140
3350
  }
4141
- if (data.LastModifiedTime !== undefined && data.LastModifiedTime !== null) {
3351
+ if (data.LastModifiedTime != null) {
4142
3352
  contents.LastModifiedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LastModifiedTime)));
4143
3353
  }
4144
- if (data.SegmentDeliveryConfigurations !== undefined && data.SegmentDeliveryConfigurations !== null) {
3354
+ if (data.SegmentDeliveryConfigurations != null) {
4145
3355
  contents.SegmentDeliveryConfigurations = deserializeAws_restJson1__listOfSegmentDeliveryConfiguration(data.SegmentDeliveryConfigurations, context);
4146
3356
  }
4147
- if (data.SourceLocationName !== undefined && data.SourceLocationName !== null) {
3357
+ if (data.SourceLocationName != null) {
4148
3358
  contents.SourceLocationName = __expectString(data.SourceLocationName);
4149
3359
  }
4150
- if (data.tags !== undefined && data.tags !== null) {
3360
+ if (data.tags != null) {
4151
3361
  contents.Tags = deserializeAws_restJson1__mapOf__string(data.tags, context);
4152
3362
  }
4153
- return [2, Promise.resolve(contents)];
3363
+ return [2, contents];
4154
3364
  }
4155
3365
  });
4156
3366
  }); };
4157
3367
  var deserializeAws_restJson1UpdateSourceLocationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
4158
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
3368
+ var parsedOutput, _a, errorCode, parsedBody;
4159
3369
  var _b;
4160
3370
  return __generator(this, function (_c) {
4161
3371
  switch (_c.label) {
@@ -4166,18 +3376,13 @@ var deserializeAws_restJson1UpdateSourceLocationCommandError = function (output,
4166
3376
  case 1:
4167
3377
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
4168
3378
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4169
- switch (errorCode) {
4170
- default:
4171
- parsedBody = parsedOutput.body;
4172
- $metadata = deserializeMetadata(output);
4173
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4174
- response = new __BaseException({
4175
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4176
- $fault: "client",
4177
- $metadata: $metadata,
4178
- });
4179
- throw __decorateServiceException(response, parsedBody);
4180
- }
3379
+ parsedBody = parsedOutput.body;
3380
+ throwDefaultError({
3381
+ output: output,
3382
+ parsedBody: parsedBody,
3383
+ exceptionCtor: __BaseException,
3384
+ errorCode: errorCode,
3385
+ });
4181
3386
  return [2];
4182
3387
  }
4183
3388
  });
@@ -4190,48 +3395,41 @@ export var deserializeAws_restJson1UpdateVodSourceCommand = function (output, co
4190
3395
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4191
3396
  return [2, deserializeAws_restJson1UpdateVodSourceCommandError(output, context)];
4192
3397
  }
4193
- contents = {
3398
+ contents = map({
4194
3399
  $metadata: deserializeMetadata(output),
4195
- Arn: undefined,
4196
- CreationTime: undefined,
4197
- HttpPackageConfigurations: undefined,
4198
- LastModifiedTime: undefined,
4199
- SourceLocationName: undefined,
4200
- Tags: undefined,
4201
- VodSourceName: undefined,
4202
- };
3400
+ });
4203
3401
  _a = __expectNonNull;
4204
3402
  _b = __expectObject;
4205
3403
  return [4, parseBody(output.body, context)];
4206
3404
  case 1:
4207
3405
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
4208
- if (data.Arn !== undefined && data.Arn !== null) {
3406
+ if (data.Arn != null) {
4209
3407
  contents.Arn = __expectString(data.Arn);
4210
3408
  }
4211
- if (data.CreationTime !== undefined && data.CreationTime !== null) {
3409
+ if (data.CreationTime != null) {
4212
3410
  contents.CreationTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.CreationTime)));
4213
3411
  }
4214
- if (data.HttpPackageConfigurations !== undefined && data.HttpPackageConfigurations !== null) {
3412
+ if (data.HttpPackageConfigurations != null) {
4215
3413
  contents.HttpPackageConfigurations = deserializeAws_restJson1HttpPackageConfigurations(data.HttpPackageConfigurations, context);
4216
3414
  }
4217
- if (data.LastModifiedTime !== undefined && data.LastModifiedTime !== null) {
3415
+ if (data.LastModifiedTime != null) {
4218
3416
  contents.LastModifiedTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LastModifiedTime)));
4219
3417
  }
4220
- if (data.SourceLocationName !== undefined && data.SourceLocationName !== null) {
3418
+ if (data.SourceLocationName != null) {
4221
3419
  contents.SourceLocationName = __expectString(data.SourceLocationName);
4222
3420
  }
4223
- if (data.tags !== undefined && data.tags !== null) {
3421
+ if (data.tags != null) {
4224
3422
  contents.Tags = deserializeAws_restJson1__mapOf__string(data.tags, context);
4225
3423
  }
4226
- if (data.VodSourceName !== undefined && data.VodSourceName !== null) {
3424
+ if (data.VodSourceName != null) {
4227
3425
  contents.VodSourceName = __expectString(data.VodSourceName);
4228
3426
  }
4229
- return [2, Promise.resolve(contents)];
3427
+ return [2, contents];
4230
3428
  }
4231
3429
  });
4232
3430
  }); };
4233
3431
  var deserializeAws_restJson1UpdateVodSourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
4234
- var parsedOutput, _a, response, errorCode, parsedBody, $metadata, statusCode;
3432
+ var parsedOutput, _a, errorCode, parsedBody;
4235
3433
  var _b;
4236
3434
  return __generator(this, function (_c) {
4237
3435
  switch (_c.label) {
@@ -4242,28 +3440,24 @@ var deserializeAws_restJson1UpdateVodSourceCommandError = function (output, cont
4242
3440
  case 1:
4243
3441
  parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
4244
3442
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4245
- switch (errorCode) {
4246
- default:
4247
- parsedBody = parsedOutput.body;
4248
- $metadata = deserializeMetadata(output);
4249
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4250
- response = new __BaseException({
4251
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4252
- $fault: "client",
4253
- $metadata: $metadata,
4254
- });
4255
- throw __decorateServiceException(response, parsedBody);
4256
- }
3443
+ parsedBody = parsedOutput.body;
3444
+ throwDefaultError({
3445
+ output: output,
3446
+ parsedBody: parsedBody,
3447
+ exceptionCtor: __BaseException,
3448
+ errorCode: errorCode,
3449
+ });
4257
3450
  return [2];
4258
3451
  }
4259
3452
  });
4260
3453
  }); };
3454
+ var map = __map;
4261
3455
  var deserializeAws_restJson1BadRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
4262
3456
  var contents, data, exception;
4263
3457
  return __generator(this, function (_a) {
4264
- contents = {};
3458
+ contents = map({});
4265
3459
  data = parsedOutput.body;
4266
- if (data.Message !== undefined && data.Message !== null) {
3460
+ if (data.Message != null) {
4267
3461
  contents.Message = __expectString(data.Message);
4268
3462
  }
4269
3463
  exception = new BadRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -4274,9 +3468,6 @@ var serializeAws_restJson1__listOfAdBreak = function (input, context) {
4274
3468
  return input
4275
3469
  .filter(function (e) { return e != null; })
4276
3470
  .map(function (entry) {
4277
- if (entry === null) {
4278
- return null;
4279
- }
4280
3471
  return serializeAws_restJson1AdBreak(entry, context);
4281
3472
  });
4282
3473
  };
@@ -4284,9 +3475,6 @@ var serializeAws_restJson1__listOfAvailMatchingCriteria = function (input, conte
4284
3475
  return input
4285
3476
  .filter(function (e) { return e != null; })
4286
3477
  .map(function (entry) {
4287
- if (entry === null) {
4288
- return null;
4289
- }
4290
3478
  return serializeAws_restJson1AvailMatchingCriteria(entry, context);
4291
3479
  });
4292
3480
  };
@@ -4294,9 +3482,6 @@ var serializeAws_restJson1__listOfSegmentDeliveryConfiguration = function (input
4294
3482
  return input
4295
3483
  .filter(function (e) { return e != null; })
4296
3484
  .map(function (entry) {
4297
- if (entry === null) {
4298
- return null;
4299
- }
4300
3485
  return serializeAws_restJson1SegmentDeliveryConfiguration(entry, context);
4301
3486
  });
4302
3487
  };
@@ -4369,9 +3554,6 @@ var serializeAws_restJson1HttpPackageConfigurations = function (input, context)
4369
3554
  return input
4370
3555
  .filter(function (e) { return e != null; })
4371
3556
  .map(function (entry) {
4372
- if (entry === null) {
4373
- return null;
4374
- }
4375
3557
  return serializeAws_restJson1HttpPackageConfiguration(entry, context);
4376
3558
  });
4377
3559
  };
@@ -4404,9 +3586,6 @@ var serializeAws_restJson1RequestOutputs = function (input, context) {
4404
3586
  return input
4405
3587
  .filter(function (e) { return e != null; })
4406
3588
  .map(function (entry) {
4407
- if (entry === null) {
4408
- return null;
4409
- }
4410
3589
  return serializeAws_restJson1RequestOutputItem(entry, context);
4411
3590
  });
4412
3591
  };