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