@aws-sdk/client-ivs 3.35.0 → 3.38.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 (282) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/README.md +54 -107
  3. package/dist-cjs/Ivs.js +0 -363
  4. package/dist-cjs/IvsClient.js +0 -368
  5. package/dist-cjs/commands/BatchGetChannelCommand.js +0 -25
  6. package/dist-cjs/commands/BatchGetStreamKeyCommand.js +0 -25
  7. package/dist-cjs/commands/CreateChannelCommand.js +0 -25
  8. package/dist-cjs/commands/CreateRecordingConfigurationCommand.js +0 -36
  9. package/dist-cjs/commands/CreateStreamKeyCommand.js +0 -28
  10. package/dist-cjs/commands/DeleteChannelCommand.js +0 -29
  11. package/dist-cjs/commands/DeletePlaybackKeyPairCommand.js +0 -27
  12. package/dist-cjs/commands/DeleteRecordingConfigurationCommand.js +0 -30
  13. package/dist-cjs/commands/DeleteStreamKeyCommand.js +0 -26
  14. package/dist-cjs/commands/GetChannelCommand.js +0 -25
  15. package/dist-cjs/commands/GetPlaybackKeyPairCommand.js +0 -29
  16. package/dist-cjs/commands/GetRecordingConfigurationCommand.js +0 -25
  17. package/dist-cjs/commands/GetStreamCommand.js +0 -25
  18. package/dist-cjs/commands/GetStreamKeyCommand.js +0 -25
  19. package/dist-cjs/commands/ImportPlaybackKeyPairCommand.js +0 -29
  20. package/dist-cjs/commands/ListChannelsCommand.js +0 -28
  21. package/dist-cjs/commands/ListPlaybackKeyPairsCommand.js +0 -26
  22. package/dist-cjs/commands/ListRecordingConfigurationsCommand.js +0 -26
  23. package/dist-cjs/commands/ListStreamKeysCommand.js +0 -25
  24. package/dist-cjs/commands/ListStreamsCommand.js +0 -26
  25. package/dist-cjs/commands/ListTagsForResourceCommand.js +0 -25
  26. package/dist-cjs/commands/PutMetadataCommand.js +0 -31
  27. package/dist-cjs/commands/StopStreamCommand.js +0 -32
  28. package/dist-cjs/commands/TagResourceCommand.js +0 -25
  29. package/dist-cjs/commands/UntagResourceCommand.js +0 -25
  30. package/dist-cjs/commands/UpdateChannelCommand.js +0 -26
  31. package/dist-cjs/commands/index.js +29 -0
  32. package/dist-cjs/endpoints.js +1 -2
  33. package/dist-cjs/index.js +4 -36
  34. package/dist-cjs/models/index.js +0 -1
  35. package/dist-cjs/models/models_0.js +7 -214
  36. package/dist-cjs/pagination/Interfaces.js +0 -1
  37. package/dist-cjs/pagination/ListChannelsPaginator.js +0 -11
  38. package/dist-cjs/pagination/ListPlaybackKeyPairsPaginator.js +0 -11
  39. package/dist-cjs/pagination/ListRecordingConfigurationsPaginator.js +0 -11
  40. package/dist-cjs/pagination/ListStreamKeysPaginator.js +0 -11
  41. package/dist-cjs/pagination/ListStreamsPaginator.js +0 -11
  42. package/dist-cjs/pagination/index.js +9 -0
  43. package/dist-cjs/protocols/Aws_restJson1.js +1 -17
  44. package/dist-cjs/runtimeConfig.browser.js +1 -6
  45. package/dist-cjs/runtimeConfig.js +2 -7
  46. package/dist-cjs/runtimeConfig.native.js +0 -4
  47. package/dist-cjs/runtimeConfig.shared.js +0 -4
  48. package/dist-es/Ivs.js +0 -1
  49. package/dist-es/IvsClient.js +0 -1
  50. package/dist-es/commands/BatchGetChannelCommand.js +0 -1
  51. package/dist-es/commands/BatchGetStreamKeyCommand.js +0 -1
  52. package/dist-es/commands/CreateChannelCommand.js +0 -1
  53. package/dist-es/commands/CreateRecordingConfigurationCommand.js +0 -1
  54. package/dist-es/commands/CreateStreamKeyCommand.js +0 -1
  55. package/dist-es/commands/DeleteChannelCommand.js +0 -1
  56. package/dist-es/commands/DeletePlaybackKeyPairCommand.js +0 -1
  57. package/dist-es/commands/DeleteRecordingConfigurationCommand.js +0 -1
  58. package/dist-es/commands/DeleteStreamKeyCommand.js +0 -1
  59. package/dist-es/commands/GetChannelCommand.js +0 -1
  60. package/dist-es/commands/GetPlaybackKeyPairCommand.js +0 -1
  61. package/dist-es/commands/GetRecordingConfigurationCommand.js +0 -1
  62. package/dist-es/commands/GetStreamCommand.js +0 -1
  63. package/dist-es/commands/GetStreamKeyCommand.js +0 -1
  64. package/dist-es/commands/ImportPlaybackKeyPairCommand.js +0 -1
  65. package/dist-es/commands/ListChannelsCommand.js +0 -1
  66. package/dist-es/commands/ListPlaybackKeyPairsCommand.js +0 -1
  67. package/dist-es/commands/ListRecordingConfigurationsCommand.js +0 -1
  68. package/dist-es/commands/ListStreamKeysCommand.js +0 -1
  69. package/dist-es/commands/ListStreamsCommand.js +0 -1
  70. package/dist-es/commands/ListTagsForResourceCommand.js +0 -1
  71. package/dist-es/commands/PutMetadataCommand.js +0 -1
  72. package/dist-es/commands/StopStreamCommand.js +0 -1
  73. package/dist-es/commands/TagResourceCommand.js +0 -1
  74. package/dist-es/commands/UntagResourceCommand.js +0 -1
  75. package/dist-es/commands/UpdateChannelCommand.js +0 -1
  76. package/dist-es/commands/index.js +26 -0
  77. package/dist-es/endpoints.js +1 -2
  78. package/dist-es/index.js +4 -36
  79. package/dist-es/models/index.js +0 -1
  80. package/dist-es/models/models_0.js +7 -7
  81. package/dist-es/pagination/Interfaces.js +0 -1
  82. package/dist-es/pagination/ListChannelsPaginator.js +0 -1
  83. package/dist-es/pagination/ListPlaybackKeyPairsPaginator.js +0 -1
  84. package/dist-es/pagination/ListRecordingConfigurationsPaginator.js +0 -1
  85. package/dist-es/pagination/ListStreamKeysPaginator.js +0 -1
  86. package/dist-es/pagination/ListStreamsPaginator.js +0 -1
  87. package/dist-es/pagination/index.js +6 -0
  88. package/dist-es/protocols/Aws_restJson1.js +1 -9
  89. package/dist-es/runtimeConfig.browser.js +1 -2
  90. package/dist-es/runtimeConfig.js +2 -3
  91. package/dist-es/runtimeConfig.native.js +0 -1
  92. package/dist-es/runtimeConfig.shared.js +0 -1
  93. package/dist-types/Ivs.d.ts +65 -124
  94. package/dist-types/IvsClient.d.ts +54 -111
  95. package/dist-types/commands/CreateRecordingConfigurationCommand.d.ts +1 -1
  96. package/dist-types/commands/ListChannelsCommand.d.ts +1 -1
  97. package/dist-types/commands/ListRecordingConfigurationsCommand.d.ts +1 -1
  98. package/dist-types/commands/ListStreamsCommand.d.ts +1 -1
  99. package/dist-types/commands/ListTagsForResourceCommand.d.ts +1 -1
  100. package/dist-types/commands/PutMetadataCommand.d.ts +5 -7
  101. package/dist-types/commands/TagResourceCommand.d.ts +1 -1
  102. package/dist-types/commands/index.d.ts +26 -0
  103. package/dist-types/index.d.ts +4 -35
  104. package/dist-types/models/models_0.d.ts +92 -60
  105. package/dist-types/pagination/index.d.ts +6 -0
  106. package/dist-types/ts3.4/Ivs.d.ts +27 -494
  107. package/dist-types/ts3.4/IvsClient.d.ts +24 -448
  108. package/dist-types/ts3.4/commands/BatchGetChannelCommand.d.ts +2 -20
  109. package/dist-types/ts3.4/commands/BatchGetStreamKeyCommand.d.ts +2 -20
  110. package/dist-types/ts3.4/commands/CreateChannelCommand.d.ts +2 -20
  111. package/dist-types/ts3.4/commands/CreateRecordingConfigurationCommand.d.ts +2 -31
  112. package/dist-types/ts3.4/commands/CreateStreamKeyCommand.d.ts +2 -23
  113. package/dist-types/ts3.4/commands/DeleteChannelCommand.d.ts +2 -24
  114. package/dist-types/ts3.4/commands/DeletePlaybackKeyPairCommand.d.ts +2 -22
  115. package/dist-types/ts3.4/commands/DeleteRecordingConfigurationCommand.d.ts +2 -25
  116. package/dist-types/ts3.4/commands/DeleteStreamKeyCommand.d.ts +2 -21
  117. package/dist-types/ts3.4/commands/GetChannelCommand.d.ts +2 -20
  118. package/dist-types/ts3.4/commands/GetPlaybackKeyPairCommand.d.ts +2 -24
  119. package/dist-types/ts3.4/commands/GetRecordingConfigurationCommand.d.ts +2 -20
  120. package/dist-types/ts3.4/commands/GetStreamCommand.d.ts +2 -20
  121. package/dist-types/ts3.4/commands/GetStreamKeyCommand.d.ts +2 -20
  122. package/dist-types/ts3.4/commands/ImportPlaybackKeyPairCommand.d.ts +2 -24
  123. package/dist-types/ts3.4/commands/ListChannelsCommand.d.ts +2 -23
  124. package/dist-types/ts3.4/commands/ListPlaybackKeyPairsCommand.d.ts +2 -21
  125. package/dist-types/ts3.4/commands/ListRecordingConfigurationsCommand.d.ts +2 -21
  126. package/dist-types/ts3.4/commands/ListStreamKeysCommand.d.ts +2 -20
  127. package/dist-types/ts3.4/commands/ListStreamsCommand.d.ts +2 -21
  128. package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +2 -20
  129. package/dist-types/ts3.4/commands/PutMetadataCommand.d.ts +2 -26
  130. package/dist-types/ts3.4/commands/StopStreamCommand.d.ts +2 -27
  131. package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +2 -20
  132. package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +2 -20
  133. package/dist-types/ts3.4/commands/UpdateChannelCommand.d.ts +2 -21
  134. package/dist-types/ts3.4/commands/index.d.ts +26 -0
  135. package/dist-types/ts3.4/index.d.ts +4 -35
  136. package/dist-types/ts3.4/models/models_0.d.ts +237 -771
  137. package/dist-types/ts3.4/pagination/index.d.ts +6 -0
  138. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -3
  139. package/dist-types/ts3.4/runtimeConfig.d.ts +1 -3
  140. package/dist-types/ts3.4/runtimeConfig.native.d.ts +1 -3
  141. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +1 -3
  142. package/package.json +33 -30
  143. package/dist-cjs/Ivs.js.map +0 -1
  144. package/dist-cjs/IvsClient.js.map +0 -1
  145. package/dist-cjs/commands/BatchGetChannelCommand.js.map +0 -1
  146. package/dist-cjs/commands/BatchGetStreamKeyCommand.js.map +0 -1
  147. package/dist-cjs/commands/CreateChannelCommand.js.map +0 -1
  148. package/dist-cjs/commands/CreateRecordingConfigurationCommand.js.map +0 -1
  149. package/dist-cjs/commands/CreateStreamKeyCommand.js.map +0 -1
  150. package/dist-cjs/commands/DeleteChannelCommand.js.map +0 -1
  151. package/dist-cjs/commands/DeletePlaybackKeyPairCommand.js.map +0 -1
  152. package/dist-cjs/commands/DeleteRecordingConfigurationCommand.js.map +0 -1
  153. package/dist-cjs/commands/DeleteStreamKeyCommand.js.map +0 -1
  154. package/dist-cjs/commands/GetChannelCommand.js.map +0 -1
  155. package/dist-cjs/commands/GetPlaybackKeyPairCommand.js.map +0 -1
  156. package/dist-cjs/commands/GetRecordingConfigurationCommand.js.map +0 -1
  157. package/dist-cjs/commands/GetStreamCommand.js.map +0 -1
  158. package/dist-cjs/commands/GetStreamKeyCommand.js.map +0 -1
  159. package/dist-cjs/commands/ImportPlaybackKeyPairCommand.js.map +0 -1
  160. package/dist-cjs/commands/ListChannelsCommand.js.map +0 -1
  161. package/dist-cjs/commands/ListPlaybackKeyPairsCommand.js.map +0 -1
  162. package/dist-cjs/commands/ListRecordingConfigurationsCommand.js.map +0 -1
  163. package/dist-cjs/commands/ListStreamKeysCommand.js.map +0 -1
  164. package/dist-cjs/commands/ListStreamsCommand.js.map +0 -1
  165. package/dist-cjs/commands/ListTagsForResourceCommand.js.map +0 -1
  166. package/dist-cjs/commands/PutMetadataCommand.js.map +0 -1
  167. package/dist-cjs/commands/StopStreamCommand.js.map +0 -1
  168. package/dist-cjs/commands/TagResourceCommand.js.map +0 -1
  169. package/dist-cjs/commands/UntagResourceCommand.js.map +0 -1
  170. package/dist-cjs/commands/UpdateChannelCommand.js.map +0 -1
  171. package/dist-cjs/endpoints.js.map +0 -1
  172. package/dist-cjs/index.js.map +0 -1
  173. package/dist-cjs/models/index.js.map +0 -1
  174. package/dist-cjs/models/models_0.js.map +0 -1
  175. package/dist-cjs/pagination/Interfaces.js.map +0 -1
  176. package/dist-cjs/pagination/ListChannelsPaginator.js.map +0 -1
  177. package/dist-cjs/pagination/ListPlaybackKeyPairsPaginator.js.map +0 -1
  178. package/dist-cjs/pagination/ListRecordingConfigurationsPaginator.js.map +0 -1
  179. package/dist-cjs/pagination/ListStreamKeysPaginator.js.map +0 -1
  180. package/dist-cjs/pagination/ListStreamsPaginator.js.map +0 -1
  181. package/dist-cjs/pagination/ListTagsForResourcePaginator.js +0 -46
  182. package/dist-cjs/pagination/ListTagsForResourcePaginator.js.map +0 -1
  183. package/dist-cjs/protocols/Aws_restJson1.js.map +0 -1
  184. package/dist-cjs/runtimeConfig.browser.js.map +0 -1
  185. package/dist-cjs/runtimeConfig.js.map +0 -1
  186. package/dist-cjs/runtimeConfig.native.js.map +0 -1
  187. package/dist-cjs/runtimeConfig.shared.js.map +0 -1
  188. package/dist-es/Ivs.js.map +0 -1
  189. package/dist-es/IvsClient.js.map +0 -1
  190. package/dist-es/commands/BatchGetChannelCommand.js.map +0 -1
  191. package/dist-es/commands/BatchGetStreamKeyCommand.js.map +0 -1
  192. package/dist-es/commands/CreateChannelCommand.js.map +0 -1
  193. package/dist-es/commands/CreateRecordingConfigurationCommand.js.map +0 -1
  194. package/dist-es/commands/CreateStreamKeyCommand.js.map +0 -1
  195. package/dist-es/commands/DeleteChannelCommand.js.map +0 -1
  196. package/dist-es/commands/DeletePlaybackKeyPairCommand.js.map +0 -1
  197. package/dist-es/commands/DeleteRecordingConfigurationCommand.js.map +0 -1
  198. package/dist-es/commands/DeleteStreamKeyCommand.js.map +0 -1
  199. package/dist-es/commands/GetChannelCommand.js.map +0 -1
  200. package/dist-es/commands/GetPlaybackKeyPairCommand.js.map +0 -1
  201. package/dist-es/commands/GetRecordingConfigurationCommand.js.map +0 -1
  202. package/dist-es/commands/GetStreamCommand.js.map +0 -1
  203. package/dist-es/commands/GetStreamKeyCommand.js.map +0 -1
  204. package/dist-es/commands/ImportPlaybackKeyPairCommand.js.map +0 -1
  205. package/dist-es/commands/ListChannelsCommand.js.map +0 -1
  206. package/dist-es/commands/ListPlaybackKeyPairsCommand.js.map +0 -1
  207. package/dist-es/commands/ListRecordingConfigurationsCommand.js.map +0 -1
  208. package/dist-es/commands/ListStreamKeysCommand.js.map +0 -1
  209. package/dist-es/commands/ListStreamsCommand.js.map +0 -1
  210. package/dist-es/commands/ListTagsForResourceCommand.js.map +0 -1
  211. package/dist-es/commands/PutMetadataCommand.js.map +0 -1
  212. package/dist-es/commands/StopStreamCommand.js.map +0 -1
  213. package/dist-es/commands/TagResourceCommand.js.map +0 -1
  214. package/dist-es/commands/UntagResourceCommand.js.map +0 -1
  215. package/dist-es/commands/UpdateChannelCommand.js.map +0 -1
  216. package/dist-es/endpoints.js.map +0 -1
  217. package/dist-es/index.js.map +0 -1
  218. package/dist-es/models/index.js.map +0 -1
  219. package/dist-es/models/models_0.js.map +0 -1
  220. package/dist-es/pagination/Interfaces.js.map +0 -1
  221. package/dist-es/pagination/ListChannelsPaginator.js.map +0 -1
  222. package/dist-es/pagination/ListPlaybackKeyPairsPaginator.js.map +0 -1
  223. package/dist-es/pagination/ListRecordingConfigurationsPaginator.js.map +0 -1
  224. package/dist-es/pagination/ListStreamKeysPaginator.js.map +0 -1
  225. package/dist-es/pagination/ListStreamsPaginator.js.map +0 -1
  226. package/dist-es/pagination/ListTagsForResourcePaginator.js +0 -75
  227. package/dist-es/pagination/ListTagsForResourcePaginator.js.map +0 -1
  228. package/dist-es/protocols/Aws_restJson1.js.map +0 -1
  229. package/dist-es/runtimeConfig.browser.js.map +0 -1
  230. package/dist-es/runtimeConfig.js.map +0 -1
  231. package/dist-es/runtimeConfig.native.js.map +0 -1
  232. package/dist-es/runtimeConfig.shared.js.map +0 -1
  233. package/dist-types/pagination/ListTagsForResourcePaginator.d.ts +0 -4
  234. package/dist-types/ts3.4/pagination/ListTagsForResourcePaginator.d.ts +0 -4
  235. package/jest.config.js +0 -4
  236. package/src/Ivs.ts +0 -1317
  237. package/src/IvsClient.ts +0 -697
  238. package/src/commands/BatchGetChannelCommand.ts +0 -95
  239. package/src/commands/BatchGetStreamKeyCommand.ts +0 -95
  240. package/src/commands/CreateChannelCommand.ts +0 -95
  241. package/src/commands/CreateRecordingConfigurationCommand.ts +0 -111
  242. package/src/commands/CreateStreamKeyCommand.ts +0 -98
  243. package/src/commands/DeleteChannelCommand.ts +0 -99
  244. package/src/commands/DeletePlaybackKeyPairCommand.ts +0 -97
  245. package/src/commands/DeleteRecordingConfigurationCommand.ts +0 -103
  246. package/src/commands/DeleteStreamKeyCommand.ts +0 -96
  247. package/src/commands/GetChannelCommand.ts +0 -95
  248. package/src/commands/GetPlaybackKeyPairCommand.ts +0 -99
  249. package/src/commands/GetRecordingConfigurationCommand.ts +0 -98
  250. package/src/commands/GetStreamCommand.ts +0 -91
  251. package/src/commands/GetStreamKeyCommand.ts +0 -95
  252. package/src/commands/ImportPlaybackKeyPairCommand.ts +0 -99
  253. package/src/commands/ListChannelsCommand.ts +0 -98
  254. package/src/commands/ListPlaybackKeyPairsCommand.ts +0 -96
  255. package/src/commands/ListRecordingConfigurationsCommand.ts +0 -101
  256. package/src/commands/ListStreamKeysCommand.ts +0 -95
  257. package/src/commands/ListStreamsCommand.ts +0 -96
  258. package/src/commands/ListTagsForResourceCommand.ts +0 -95
  259. package/src/commands/PutMetadataCommand.ts +0 -101
  260. package/src/commands/StopStreamCommand.ts +0 -102
  261. package/src/commands/TagResourceCommand.ts +0 -95
  262. package/src/commands/UntagResourceCommand.ts +0 -95
  263. package/src/commands/UpdateChannelCommand.ts +0 -96
  264. package/src/endpoints.ts +0 -57
  265. package/src/index.ts +0 -36
  266. package/src/models/index.ts +0 -1
  267. package/src/models/models_0.ts +0 -1673
  268. package/src/pagination/Interfaces.ts +0 -8
  269. package/src/pagination/ListChannelsPaginator.ts +0 -59
  270. package/src/pagination/ListPlaybackKeyPairsPaginator.ts +0 -59
  271. package/src/pagination/ListRecordingConfigurationsPaginator.ts +0 -59
  272. package/src/pagination/ListStreamKeysPaginator.ts +0 -59
  273. package/src/pagination/ListStreamsPaginator.ts +0 -55
  274. package/src/pagination/ListTagsForResourcePaginator.ts +0 -59
  275. package/src/protocols/Aws_restJson1.ts +0 -3327
  276. package/src/runtimeConfig.browser.ts +0 -41
  277. package/src/runtimeConfig.native.ts +0 -17
  278. package/src/runtimeConfig.shared.ts +0 -17
  279. package/src/runtimeConfig.ts +0 -46
  280. package/tsconfig.es.json +0 -10
  281. package/tsconfig.json +0 -33
  282. package/tsconfig.types.json +0 -9
@@ -1,3327 +0,0 @@
1
- import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
2
- import {
3
- expectBoolean as __expectBoolean,
4
- expectLong as __expectLong,
5
- expectNonNull as __expectNonNull,
6
- expectObject as __expectObject,
7
- expectString as __expectString,
8
- extendedEncodeURIComponent as __extendedEncodeURIComponent,
9
- parseRfc3339DateTime as __parseRfc3339DateTime,
10
- } from "@aws-sdk/smithy-client";
11
- import {
12
- Endpoint as __Endpoint,
13
- MetadataBearer as __MetadataBearer,
14
- ResponseMetadata as __ResponseMetadata,
15
- SerdeContext as __SerdeContext,
16
- SmithyException as __SmithyException,
17
- } from "@aws-sdk/types";
18
-
19
- import { BatchGetChannelCommandInput, BatchGetChannelCommandOutput } from "../commands/BatchGetChannelCommand";
20
- import { BatchGetStreamKeyCommandInput, BatchGetStreamKeyCommandOutput } from "../commands/BatchGetStreamKeyCommand";
21
- import { CreateChannelCommandInput, CreateChannelCommandOutput } from "../commands/CreateChannelCommand";
22
- import {
23
- CreateRecordingConfigurationCommandInput,
24
- CreateRecordingConfigurationCommandOutput,
25
- } from "../commands/CreateRecordingConfigurationCommand";
26
- import { CreateStreamKeyCommandInput, CreateStreamKeyCommandOutput } from "../commands/CreateStreamKeyCommand";
27
- import { DeleteChannelCommandInput, DeleteChannelCommandOutput } from "../commands/DeleteChannelCommand";
28
- import {
29
- DeletePlaybackKeyPairCommandInput,
30
- DeletePlaybackKeyPairCommandOutput,
31
- } from "../commands/DeletePlaybackKeyPairCommand";
32
- import {
33
- DeleteRecordingConfigurationCommandInput,
34
- DeleteRecordingConfigurationCommandOutput,
35
- } from "../commands/DeleteRecordingConfigurationCommand";
36
- import { DeleteStreamKeyCommandInput, DeleteStreamKeyCommandOutput } from "../commands/DeleteStreamKeyCommand";
37
- import { GetChannelCommandInput, GetChannelCommandOutput } from "../commands/GetChannelCommand";
38
- import { GetPlaybackKeyPairCommandInput, GetPlaybackKeyPairCommandOutput } from "../commands/GetPlaybackKeyPairCommand";
39
- import {
40
- GetRecordingConfigurationCommandInput,
41
- GetRecordingConfigurationCommandOutput,
42
- } from "../commands/GetRecordingConfigurationCommand";
43
- import { GetStreamCommandInput, GetStreamCommandOutput } from "../commands/GetStreamCommand";
44
- import { GetStreamKeyCommandInput, GetStreamKeyCommandOutput } from "../commands/GetStreamKeyCommand";
45
- import {
46
- ImportPlaybackKeyPairCommandInput,
47
- ImportPlaybackKeyPairCommandOutput,
48
- } from "../commands/ImportPlaybackKeyPairCommand";
49
- import { ListChannelsCommandInput, ListChannelsCommandOutput } from "../commands/ListChannelsCommand";
50
- import {
51
- ListPlaybackKeyPairsCommandInput,
52
- ListPlaybackKeyPairsCommandOutput,
53
- } from "../commands/ListPlaybackKeyPairsCommand";
54
- import {
55
- ListRecordingConfigurationsCommandInput,
56
- ListRecordingConfigurationsCommandOutput,
57
- } from "../commands/ListRecordingConfigurationsCommand";
58
- import { ListStreamKeysCommandInput, ListStreamKeysCommandOutput } from "../commands/ListStreamKeysCommand";
59
- import { ListStreamsCommandInput, ListStreamsCommandOutput } from "../commands/ListStreamsCommand";
60
- import {
61
- ListTagsForResourceCommandInput,
62
- ListTagsForResourceCommandOutput,
63
- } from "../commands/ListTagsForResourceCommand";
64
- import { PutMetadataCommandInput, PutMetadataCommandOutput } from "../commands/PutMetadataCommand";
65
- import { StopStreamCommandInput, StopStreamCommandOutput } from "../commands/StopStreamCommand";
66
- import { TagResourceCommandInput, TagResourceCommandOutput } from "../commands/TagResourceCommand";
67
- import { UntagResourceCommandInput, UntagResourceCommandOutput } from "../commands/UntagResourceCommand";
68
- import { UpdateChannelCommandInput, UpdateChannelCommandOutput } from "../commands/UpdateChannelCommand";
69
- import {
70
- _Stream,
71
- AccessDeniedException,
72
- BatchError,
73
- Channel,
74
- ChannelNotBroadcasting,
75
- ChannelSummary,
76
- ConflictException,
77
- DestinationConfiguration,
78
- InternalServerException,
79
- PendingVerification,
80
- PlaybackKeyPair,
81
- PlaybackKeyPairSummary,
82
- RecordingConfiguration,
83
- RecordingConfigurationSummary,
84
- ResourceNotFoundException,
85
- S3DestinationConfiguration,
86
- ServiceQuotaExceededException,
87
- StreamKey,
88
- StreamKeySummary,
89
- StreamSummary,
90
- StreamUnavailable,
91
- ThrottlingException,
92
- ValidationException,
93
- } from "../models/models_0";
94
-
95
- export const serializeAws_restJson1BatchGetChannelCommand = async (
96
- input: BatchGetChannelCommandInput,
97
- context: __SerdeContext
98
- ): Promise<__HttpRequest> => {
99
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
100
- const headers: any = {
101
- "content-type": "application/json",
102
- };
103
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/BatchGetChannel";
104
- let body: any;
105
- body = JSON.stringify({
106
- ...(input.arns !== undefined &&
107
- input.arns !== null && { arns: serializeAws_restJson1ChannelArnList(input.arns, context) }),
108
- });
109
- return new __HttpRequest({
110
- protocol,
111
- hostname,
112
- port,
113
- method: "POST",
114
- headers,
115
- path: resolvedPath,
116
- body,
117
- });
118
- };
119
-
120
- export const serializeAws_restJson1BatchGetStreamKeyCommand = async (
121
- input: BatchGetStreamKeyCommandInput,
122
- context: __SerdeContext
123
- ): Promise<__HttpRequest> => {
124
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
125
- const headers: any = {
126
- "content-type": "application/json",
127
- };
128
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/BatchGetStreamKey";
129
- let body: any;
130
- body = JSON.stringify({
131
- ...(input.arns !== undefined &&
132
- input.arns !== null && { arns: serializeAws_restJson1StreamKeyArnList(input.arns, context) }),
133
- });
134
- return new __HttpRequest({
135
- protocol,
136
- hostname,
137
- port,
138
- method: "POST",
139
- headers,
140
- path: resolvedPath,
141
- body,
142
- });
143
- };
144
-
145
- export const serializeAws_restJson1CreateChannelCommand = async (
146
- input: CreateChannelCommandInput,
147
- context: __SerdeContext
148
- ): Promise<__HttpRequest> => {
149
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
150
- const headers: any = {
151
- "content-type": "application/json",
152
- };
153
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/CreateChannel";
154
- let body: any;
155
- body = JSON.stringify({
156
- ...(input.authorized !== undefined && input.authorized !== null && { authorized: input.authorized }),
157
- ...(input.latencyMode !== undefined && input.latencyMode !== null && { latencyMode: input.latencyMode }),
158
- ...(input.name !== undefined && input.name !== null && { name: input.name }),
159
- ...(input.recordingConfigurationArn !== undefined &&
160
- input.recordingConfigurationArn !== null && { recordingConfigurationArn: input.recordingConfigurationArn }),
161
- ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }),
162
- ...(input.type !== undefined && input.type !== null && { type: input.type }),
163
- });
164
- return new __HttpRequest({
165
- protocol,
166
- hostname,
167
- port,
168
- method: "POST",
169
- headers,
170
- path: resolvedPath,
171
- body,
172
- });
173
- };
174
-
175
- export const serializeAws_restJson1CreateRecordingConfigurationCommand = async (
176
- input: CreateRecordingConfigurationCommandInput,
177
- context: __SerdeContext
178
- ): Promise<__HttpRequest> => {
179
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
180
- const headers: any = {
181
- "content-type": "application/json",
182
- };
183
- const resolvedPath =
184
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/CreateRecordingConfiguration";
185
- let body: any;
186
- body = JSON.stringify({
187
- ...(input.destinationConfiguration !== undefined &&
188
- input.destinationConfiguration !== null && {
189
- destinationConfiguration: serializeAws_restJson1DestinationConfiguration(
190
- input.destinationConfiguration,
191
- context
192
- ),
193
- }),
194
- ...(input.name !== undefined && input.name !== null && { name: input.name }),
195
- ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }),
196
- });
197
- return new __HttpRequest({
198
- protocol,
199
- hostname,
200
- port,
201
- method: "POST",
202
- headers,
203
- path: resolvedPath,
204
- body,
205
- });
206
- };
207
-
208
- export const serializeAws_restJson1CreateStreamKeyCommand = async (
209
- input: CreateStreamKeyCommandInput,
210
- context: __SerdeContext
211
- ): Promise<__HttpRequest> => {
212
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
213
- const headers: any = {
214
- "content-type": "application/json",
215
- };
216
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/CreateStreamKey";
217
- let body: any;
218
- body = JSON.stringify({
219
- ...(input.channelArn !== undefined && input.channelArn !== null && { channelArn: input.channelArn }),
220
- ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }),
221
- });
222
- return new __HttpRequest({
223
- protocol,
224
- hostname,
225
- port,
226
- method: "POST",
227
- headers,
228
- path: resolvedPath,
229
- body,
230
- });
231
- };
232
-
233
- export const serializeAws_restJson1DeleteChannelCommand = async (
234
- input: DeleteChannelCommandInput,
235
- context: __SerdeContext
236
- ): Promise<__HttpRequest> => {
237
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
238
- const headers: any = {
239
- "content-type": "application/json",
240
- };
241
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/DeleteChannel";
242
- let body: any;
243
- body = JSON.stringify({
244
- ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }),
245
- });
246
- return new __HttpRequest({
247
- protocol,
248
- hostname,
249
- port,
250
- method: "POST",
251
- headers,
252
- path: resolvedPath,
253
- body,
254
- });
255
- };
256
-
257
- export const serializeAws_restJson1DeletePlaybackKeyPairCommand = async (
258
- input: DeletePlaybackKeyPairCommandInput,
259
- context: __SerdeContext
260
- ): Promise<__HttpRequest> => {
261
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
262
- const headers: any = {
263
- "content-type": "application/json",
264
- };
265
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/DeletePlaybackKeyPair";
266
- let body: any;
267
- body = JSON.stringify({
268
- ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }),
269
- });
270
- return new __HttpRequest({
271
- protocol,
272
- hostname,
273
- port,
274
- method: "POST",
275
- headers,
276
- path: resolvedPath,
277
- body,
278
- });
279
- };
280
-
281
- export const serializeAws_restJson1DeleteRecordingConfigurationCommand = async (
282
- input: DeleteRecordingConfigurationCommandInput,
283
- context: __SerdeContext
284
- ): Promise<__HttpRequest> => {
285
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
286
- const headers: any = {
287
- "content-type": "application/json",
288
- };
289
- const resolvedPath =
290
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/DeleteRecordingConfiguration";
291
- let body: any;
292
- body = JSON.stringify({
293
- ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }),
294
- });
295
- return new __HttpRequest({
296
- protocol,
297
- hostname,
298
- port,
299
- method: "POST",
300
- headers,
301
- path: resolvedPath,
302
- body,
303
- });
304
- };
305
-
306
- export const serializeAws_restJson1DeleteStreamKeyCommand = async (
307
- input: DeleteStreamKeyCommandInput,
308
- context: __SerdeContext
309
- ): Promise<__HttpRequest> => {
310
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
311
- const headers: any = {
312
- "content-type": "application/json",
313
- };
314
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/DeleteStreamKey";
315
- let body: any;
316
- body = JSON.stringify({
317
- ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }),
318
- });
319
- return new __HttpRequest({
320
- protocol,
321
- hostname,
322
- port,
323
- method: "POST",
324
- headers,
325
- path: resolvedPath,
326
- body,
327
- });
328
- };
329
-
330
- export const serializeAws_restJson1GetChannelCommand = async (
331
- input: GetChannelCommandInput,
332
- context: __SerdeContext
333
- ): Promise<__HttpRequest> => {
334
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
335
- const headers: any = {
336
- "content-type": "application/json",
337
- };
338
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/GetChannel";
339
- let body: any;
340
- body = JSON.stringify({
341
- ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }),
342
- });
343
- return new __HttpRequest({
344
- protocol,
345
- hostname,
346
- port,
347
- method: "POST",
348
- headers,
349
- path: resolvedPath,
350
- body,
351
- });
352
- };
353
-
354
- export const serializeAws_restJson1GetPlaybackKeyPairCommand = async (
355
- input: GetPlaybackKeyPairCommandInput,
356
- context: __SerdeContext
357
- ): Promise<__HttpRequest> => {
358
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
359
- const headers: any = {
360
- "content-type": "application/json",
361
- };
362
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/GetPlaybackKeyPair";
363
- let body: any;
364
- body = JSON.stringify({
365
- ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }),
366
- });
367
- return new __HttpRequest({
368
- protocol,
369
- hostname,
370
- port,
371
- method: "POST",
372
- headers,
373
- path: resolvedPath,
374
- body,
375
- });
376
- };
377
-
378
- export const serializeAws_restJson1GetRecordingConfigurationCommand = async (
379
- input: GetRecordingConfigurationCommandInput,
380
- context: __SerdeContext
381
- ): Promise<__HttpRequest> => {
382
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
383
- const headers: any = {
384
- "content-type": "application/json",
385
- };
386
- const resolvedPath =
387
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/GetRecordingConfiguration";
388
- let body: any;
389
- body = JSON.stringify({
390
- ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }),
391
- });
392
- return new __HttpRequest({
393
- protocol,
394
- hostname,
395
- port,
396
- method: "POST",
397
- headers,
398
- path: resolvedPath,
399
- body,
400
- });
401
- };
402
-
403
- export const serializeAws_restJson1GetStreamCommand = async (
404
- input: GetStreamCommandInput,
405
- context: __SerdeContext
406
- ): Promise<__HttpRequest> => {
407
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
408
- const headers: any = {
409
- "content-type": "application/json",
410
- };
411
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/GetStream";
412
- let body: any;
413
- body = JSON.stringify({
414
- ...(input.channelArn !== undefined && input.channelArn !== null && { channelArn: input.channelArn }),
415
- });
416
- return new __HttpRequest({
417
- protocol,
418
- hostname,
419
- port,
420
- method: "POST",
421
- headers,
422
- path: resolvedPath,
423
- body,
424
- });
425
- };
426
-
427
- export const serializeAws_restJson1GetStreamKeyCommand = async (
428
- input: GetStreamKeyCommandInput,
429
- context: __SerdeContext
430
- ): Promise<__HttpRequest> => {
431
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
432
- const headers: any = {
433
- "content-type": "application/json",
434
- };
435
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/GetStreamKey";
436
- let body: any;
437
- body = JSON.stringify({
438
- ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }),
439
- });
440
- return new __HttpRequest({
441
- protocol,
442
- hostname,
443
- port,
444
- method: "POST",
445
- headers,
446
- path: resolvedPath,
447
- body,
448
- });
449
- };
450
-
451
- export const serializeAws_restJson1ImportPlaybackKeyPairCommand = async (
452
- input: ImportPlaybackKeyPairCommandInput,
453
- context: __SerdeContext
454
- ): Promise<__HttpRequest> => {
455
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
456
- const headers: any = {
457
- "content-type": "application/json",
458
- };
459
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/ImportPlaybackKeyPair";
460
- let body: any;
461
- body = JSON.stringify({
462
- ...(input.name !== undefined && input.name !== null && { name: input.name }),
463
- ...(input.publicKeyMaterial !== undefined &&
464
- input.publicKeyMaterial !== null && { publicKeyMaterial: input.publicKeyMaterial }),
465
- ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }),
466
- });
467
- return new __HttpRequest({
468
- protocol,
469
- hostname,
470
- port,
471
- method: "POST",
472
- headers,
473
- path: resolvedPath,
474
- body,
475
- });
476
- };
477
-
478
- export const serializeAws_restJson1ListChannelsCommand = async (
479
- input: ListChannelsCommandInput,
480
- context: __SerdeContext
481
- ): Promise<__HttpRequest> => {
482
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
483
- const headers: any = {
484
- "content-type": "application/json",
485
- };
486
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/ListChannels";
487
- let body: any;
488
- body = JSON.stringify({
489
- ...(input.filterByName !== undefined && input.filterByName !== null && { filterByName: input.filterByName }),
490
- ...(input.filterByRecordingConfigurationArn !== undefined &&
491
- input.filterByRecordingConfigurationArn !== null && {
492
- filterByRecordingConfigurationArn: input.filterByRecordingConfigurationArn,
493
- }),
494
- ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }),
495
- ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }),
496
- });
497
- return new __HttpRequest({
498
- protocol,
499
- hostname,
500
- port,
501
- method: "POST",
502
- headers,
503
- path: resolvedPath,
504
- body,
505
- });
506
- };
507
-
508
- export const serializeAws_restJson1ListPlaybackKeyPairsCommand = async (
509
- input: ListPlaybackKeyPairsCommandInput,
510
- context: __SerdeContext
511
- ): Promise<__HttpRequest> => {
512
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
513
- const headers: any = {
514
- "content-type": "application/json",
515
- };
516
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/ListPlaybackKeyPairs";
517
- let body: any;
518
- body = JSON.stringify({
519
- ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }),
520
- ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }),
521
- });
522
- return new __HttpRequest({
523
- protocol,
524
- hostname,
525
- port,
526
- method: "POST",
527
- headers,
528
- path: resolvedPath,
529
- body,
530
- });
531
- };
532
-
533
- export const serializeAws_restJson1ListRecordingConfigurationsCommand = async (
534
- input: ListRecordingConfigurationsCommandInput,
535
- context: __SerdeContext
536
- ): Promise<__HttpRequest> => {
537
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
538
- const headers: any = {
539
- "content-type": "application/json",
540
- };
541
- const resolvedPath =
542
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/ListRecordingConfigurations";
543
- let body: any;
544
- body = JSON.stringify({
545
- ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }),
546
- ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }),
547
- });
548
- return new __HttpRequest({
549
- protocol,
550
- hostname,
551
- port,
552
- method: "POST",
553
- headers,
554
- path: resolvedPath,
555
- body,
556
- });
557
- };
558
-
559
- export const serializeAws_restJson1ListStreamKeysCommand = async (
560
- input: ListStreamKeysCommandInput,
561
- context: __SerdeContext
562
- ): Promise<__HttpRequest> => {
563
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
564
- const headers: any = {
565
- "content-type": "application/json",
566
- };
567
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/ListStreamKeys";
568
- let body: any;
569
- body = JSON.stringify({
570
- ...(input.channelArn !== undefined && input.channelArn !== null && { channelArn: input.channelArn }),
571
- ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }),
572
- ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }),
573
- });
574
- return new __HttpRequest({
575
- protocol,
576
- hostname,
577
- port,
578
- method: "POST",
579
- headers,
580
- path: resolvedPath,
581
- body,
582
- });
583
- };
584
-
585
- export const serializeAws_restJson1ListStreamsCommand = async (
586
- input: ListStreamsCommandInput,
587
- context: __SerdeContext
588
- ): Promise<__HttpRequest> => {
589
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
590
- const headers: any = {
591
- "content-type": "application/json",
592
- };
593
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/ListStreams";
594
- let body: any;
595
- body = JSON.stringify({
596
- ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }),
597
- ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }),
598
- });
599
- return new __HttpRequest({
600
- protocol,
601
- hostname,
602
- port,
603
- method: "POST",
604
- headers,
605
- path: resolvedPath,
606
- body,
607
- });
608
- };
609
-
610
- export const serializeAws_restJson1ListTagsForResourceCommand = async (
611
- input: ListTagsForResourceCommandInput,
612
- context: __SerdeContext
613
- ): Promise<__HttpRequest> => {
614
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
615
- const headers: any = {
616
- "content-type": "application/json",
617
- };
618
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
619
- if (input.resourceArn !== undefined) {
620
- const labelValue: string = input.resourceArn;
621
- if (labelValue.length <= 0) {
622
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
623
- }
624
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
625
- } else {
626
- throw new Error("No value provided for input HTTP label: resourceArn.");
627
- }
628
- let body: any;
629
- body = JSON.stringify({
630
- ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }),
631
- ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }),
632
- });
633
- return new __HttpRequest({
634
- protocol,
635
- hostname,
636
- port,
637
- method: "GET",
638
- headers,
639
- path: resolvedPath,
640
- body,
641
- });
642
- };
643
-
644
- export const serializeAws_restJson1PutMetadataCommand = async (
645
- input: PutMetadataCommandInput,
646
- context: __SerdeContext
647
- ): Promise<__HttpRequest> => {
648
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
649
- const headers: any = {
650
- "content-type": "application/json",
651
- };
652
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/PutMetadata";
653
- let body: any;
654
- body = JSON.stringify({
655
- ...(input.channelArn !== undefined && input.channelArn !== null && { channelArn: input.channelArn }),
656
- ...(input.metadata !== undefined && input.metadata !== null && { metadata: input.metadata }),
657
- });
658
- return new __HttpRequest({
659
- protocol,
660
- hostname,
661
- port,
662
- method: "POST",
663
- headers,
664
- path: resolvedPath,
665
- body,
666
- });
667
- };
668
-
669
- export const serializeAws_restJson1StopStreamCommand = async (
670
- input: StopStreamCommandInput,
671
- context: __SerdeContext
672
- ): Promise<__HttpRequest> => {
673
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
674
- const headers: any = {
675
- "content-type": "application/json",
676
- };
677
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/StopStream";
678
- let body: any;
679
- body = JSON.stringify({
680
- ...(input.channelArn !== undefined && input.channelArn !== null && { channelArn: input.channelArn }),
681
- });
682
- return new __HttpRequest({
683
- protocol,
684
- hostname,
685
- port,
686
- method: "POST",
687
- headers,
688
- path: resolvedPath,
689
- body,
690
- });
691
- };
692
-
693
- export const serializeAws_restJson1TagResourceCommand = async (
694
- input: TagResourceCommandInput,
695
- context: __SerdeContext
696
- ): Promise<__HttpRequest> => {
697
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
698
- const headers: any = {
699
- "content-type": "application/json",
700
- };
701
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
702
- if (input.resourceArn !== undefined) {
703
- const labelValue: string = input.resourceArn;
704
- if (labelValue.length <= 0) {
705
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
706
- }
707
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
708
- } else {
709
- throw new Error("No value provided for input HTTP label: resourceArn.");
710
- }
711
- let body: any;
712
- body = JSON.stringify({
713
- ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1Tags(input.tags, context) }),
714
- });
715
- return new __HttpRequest({
716
- protocol,
717
- hostname,
718
- port,
719
- method: "POST",
720
- headers,
721
- path: resolvedPath,
722
- body,
723
- });
724
- };
725
-
726
- export const serializeAws_restJson1UntagResourceCommand = async (
727
- input: UntagResourceCommandInput,
728
- context: __SerdeContext
729
- ): Promise<__HttpRequest> => {
730
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
731
- const headers: any = {};
732
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
733
- if (input.resourceArn !== undefined) {
734
- const labelValue: string = input.resourceArn;
735
- if (labelValue.length <= 0) {
736
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
737
- }
738
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
739
- } else {
740
- throw new Error("No value provided for input HTTP label: resourceArn.");
741
- }
742
- const query: any = {
743
- ...(input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map((_entry) => _entry as any) }),
744
- };
745
- let body: any;
746
- return new __HttpRequest({
747
- protocol,
748
- hostname,
749
- port,
750
- method: "DELETE",
751
- headers,
752
- path: resolvedPath,
753
- query,
754
- body,
755
- });
756
- };
757
-
758
- export const serializeAws_restJson1UpdateChannelCommand = async (
759
- input: UpdateChannelCommandInput,
760
- context: __SerdeContext
761
- ): Promise<__HttpRequest> => {
762
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
763
- const headers: any = {
764
- "content-type": "application/json",
765
- };
766
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/UpdateChannel";
767
- let body: any;
768
- body = JSON.stringify({
769
- ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }),
770
- ...(input.authorized !== undefined && input.authorized !== null && { authorized: input.authorized }),
771
- ...(input.latencyMode !== undefined && input.latencyMode !== null && { latencyMode: input.latencyMode }),
772
- ...(input.name !== undefined && input.name !== null && { name: input.name }),
773
- ...(input.recordingConfigurationArn !== undefined &&
774
- input.recordingConfigurationArn !== null && { recordingConfigurationArn: input.recordingConfigurationArn }),
775
- ...(input.type !== undefined && input.type !== null && { type: input.type }),
776
- });
777
- return new __HttpRequest({
778
- protocol,
779
- hostname,
780
- port,
781
- method: "POST",
782
- headers,
783
- path: resolvedPath,
784
- body,
785
- });
786
- };
787
-
788
- export const deserializeAws_restJson1BatchGetChannelCommand = async (
789
- output: __HttpResponse,
790
- context: __SerdeContext
791
- ): Promise<BatchGetChannelCommandOutput> => {
792
- if (output.statusCode !== 200 && output.statusCode >= 300) {
793
- return deserializeAws_restJson1BatchGetChannelCommandError(output, context);
794
- }
795
- const contents: BatchGetChannelCommandOutput = {
796
- $metadata: deserializeMetadata(output),
797
- channels: undefined,
798
- errors: undefined,
799
- };
800
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
801
- if (data.channels !== undefined && data.channels !== null) {
802
- contents.channels = deserializeAws_restJson1Channels(data.channels, context);
803
- }
804
- if (data.errors !== undefined && data.errors !== null) {
805
- contents.errors = deserializeAws_restJson1BatchErrors(data.errors, context);
806
- }
807
- return Promise.resolve(contents);
808
- };
809
-
810
- const deserializeAws_restJson1BatchGetChannelCommandError = async (
811
- output: __HttpResponse,
812
- context: __SerdeContext
813
- ): Promise<BatchGetChannelCommandOutput> => {
814
- const parsedOutput: any = {
815
- ...output,
816
- body: await parseBody(output.body, context),
817
- };
818
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
819
- let errorCode = "UnknownError";
820
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
821
- switch (errorCode) {
822
- default:
823
- const parsedBody = parsedOutput.body;
824
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
825
- response = {
826
- ...parsedBody,
827
- name: `${errorCode}`,
828
- message: parsedBody.message || parsedBody.Message || errorCode,
829
- $fault: "client",
830
- $metadata: deserializeMetadata(output),
831
- } as any;
832
- }
833
- const message = response.message || response.Message || errorCode;
834
- response.message = message;
835
- delete response.Message;
836
- return Promise.reject(Object.assign(new Error(message), response));
837
- };
838
-
839
- export const deserializeAws_restJson1BatchGetStreamKeyCommand = async (
840
- output: __HttpResponse,
841
- context: __SerdeContext
842
- ): Promise<BatchGetStreamKeyCommandOutput> => {
843
- if (output.statusCode !== 200 && output.statusCode >= 300) {
844
- return deserializeAws_restJson1BatchGetStreamKeyCommandError(output, context);
845
- }
846
- const contents: BatchGetStreamKeyCommandOutput = {
847
- $metadata: deserializeMetadata(output),
848
- errors: undefined,
849
- streamKeys: undefined,
850
- };
851
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
852
- if (data.errors !== undefined && data.errors !== null) {
853
- contents.errors = deserializeAws_restJson1BatchErrors(data.errors, context);
854
- }
855
- if (data.streamKeys !== undefined && data.streamKeys !== null) {
856
- contents.streamKeys = deserializeAws_restJson1StreamKeys(data.streamKeys, context);
857
- }
858
- return Promise.resolve(contents);
859
- };
860
-
861
- const deserializeAws_restJson1BatchGetStreamKeyCommandError = async (
862
- output: __HttpResponse,
863
- context: __SerdeContext
864
- ): Promise<BatchGetStreamKeyCommandOutput> => {
865
- const parsedOutput: any = {
866
- ...output,
867
- body: await parseBody(output.body, context),
868
- };
869
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
870
- let errorCode = "UnknownError";
871
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
872
- switch (errorCode) {
873
- default:
874
- const parsedBody = parsedOutput.body;
875
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
876
- response = {
877
- ...parsedBody,
878
- name: `${errorCode}`,
879
- message: parsedBody.message || parsedBody.Message || errorCode,
880
- $fault: "client",
881
- $metadata: deserializeMetadata(output),
882
- } as any;
883
- }
884
- const message = response.message || response.Message || errorCode;
885
- response.message = message;
886
- delete response.Message;
887
- return Promise.reject(Object.assign(new Error(message), response));
888
- };
889
-
890
- export const deserializeAws_restJson1CreateChannelCommand = async (
891
- output: __HttpResponse,
892
- context: __SerdeContext
893
- ): Promise<CreateChannelCommandOutput> => {
894
- if (output.statusCode !== 200 && output.statusCode >= 300) {
895
- return deserializeAws_restJson1CreateChannelCommandError(output, context);
896
- }
897
- const contents: CreateChannelCommandOutput = {
898
- $metadata: deserializeMetadata(output),
899
- channel: undefined,
900
- streamKey: undefined,
901
- };
902
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
903
- if (data.channel !== undefined && data.channel !== null) {
904
- contents.channel = deserializeAws_restJson1Channel(data.channel, context);
905
- }
906
- if (data.streamKey !== undefined && data.streamKey !== null) {
907
- contents.streamKey = deserializeAws_restJson1StreamKey(data.streamKey, context);
908
- }
909
- return Promise.resolve(contents);
910
- };
911
-
912
- const deserializeAws_restJson1CreateChannelCommandError = async (
913
- output: __HttpResponse,
914
- context: __SerdeContext
915
- ): Promise<CreateChannelCommandOutput> => {
916
- const parsedOutput: any = {
917
- ...output,
918
- body: await parseBody(output.body, context),
919
- };
920
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
921
- let errorCode = "UnknownError";
922
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
923
- switch (errorCode) {
924
- case "AccessDeniedException":
925
- case "com.amazonaws.ivs#AccessDeniedException":
926
- response = {
927
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
928
- name: errorCode,
929
- $metadata: deserializeMetadata(output),
930
- };
931
- break;
932
- case "PendingVerification":
933
- case "com.amazonaws.ivs#PendingVerification":
934
- response = {
935
- ...(await deserializeAws_restJson1PendingVerificationResponse(parsedOutput, context)),
936
- name: errorCode,
937
- $metadata: deserializeMetadata(output),
938
- };
939
- break;
940
- case "ResourceNotFoundException":
941
- case "com.amazonaws.ivs#ResourceNotFoundException":
942
- response = {
943
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
944
- name: errorCode,
945
- $metadata: deserializeMetadata(output),
946
- };
947
- break;
948
- case "ServiceQuotaExceededException":
949
- case "com.amazonaws.ivs#ServiceQuotaExceededException":
950
- response = {
951
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
952
- name: errorCode,
953
- $metadata: deserializeMetadata(output),
954
- };
955
- break;
956
- case "ValidationException":
957
- case "com.amazonaws.ivs#ValidationException":
958
- response = {
959
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
960
- name: errorCode,
961
- $metadata: deserializeMetadata(output),
962
- };
963
- break;
964
- default:
965
- const parsedBody = parsedOutput.body;
966
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
967
- response = {
968
- ...parsedBody,
969
- name: `${errorCode}`,
970
- message: parsedBody.message || parsedBody.Message || errorCode,
971
- $fault: "client",
972
- $metadata: deserializeMetadata(output),
973
- } as any;
974
- }
975
- const message = response.message || response.Message || errorCode;
976
- response.message = message;
977
- delete response.Message;
978
- return Promise.reject(Object.assign(new Error(message), response));
979
- };
980
-
981
- export const deserializeAws_restJson1CreateRecordingConfigurationCommand = async (
982
- output: __HttpResponse,
983
- context: __SerdeContext
984
- ): Promise<CreateRecordingConfigurationCommandOutput> => {
985
- if (output.statusCode !== 200 && output.statusCode >= 300) {
986
- return deserializeAws_restJson1CreateRecordingConfigurationCommandError(output, context);
987
- }
988
- const contents: CreateRecordingConfigurationCommandOutput = {
989
- $metadata: deserializeMetadata(output),
990
- recordingConfiguration: undefined,
991
- };
992
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
993
- if (data.recordingConfiguration !== undefined && data.recordingConfiguration !== null) {
994
- contents.recordingConfiguration = deserializeAws_restJson1RecordingConfiguration(
995
- data.recordingConfiguration,
996
- context
997
- );
998
- }
999
- return Promise.resolve(contents);
1000
- };
1001
-
1002
- const deserializeAws_restJson1CreateRecordingConfigurationCommandError = async (
1003
- output: __HttpResponse,
1004
- context: __SerdeContext
1005
- ): Promise<CreateRecordingConfigurationCommandOutput> => {
1006
- const parsedOutput: any = {
1007
- ...output,
1008
- body: await parseBody(output.body, context),
1009
- };
1010
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1011
- let errorCode = "UnknownError";
1012
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1013
- switch (errorCode) {
1014
- case "AccessDeniedException":
1015
- case "com.amazonaws.ivs#AccessDeniedException":
1016
- response = {
1017
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1018
- name: errorCode,
1019
- $metadata: deserializeMetadata(output),
1020
- };
1021
- break;
1022
- case "ConflictException":
1023
- case "com.amazonaws.ivs#ConflictException":
1024
- response = {
1025
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1026
- name: errorCode,
1027
- $metadata: deserializeMetadata(output),
1028
- };
1029
- break;
1030
- case "InternalServerException":
1031
- case "com.amazonaws.ivs#InternalServerException":
1032
- response = {
1033
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1034
- name: errorCode,
1035
- $metadata: deserializeMetadata(output),
1036
- };
1037
- break;
1038
- case "PendingVerification":
1039
- case "com.amazonaws.ivs#PendingVerification":
1040
- response = {
1041
- ...(await deserializeAws_restJson1PendingVerificationResponse(parsedOutput, context)),
1042
- name: errorCode,
1043
- $metadata: deserializeMetadata(output),
1044
- };
1045
- break;
1046
- case "ServiceQuotaExceededException":
1047
- case "com.amazonaws.ivs#ServiceQuotaExceededException":
1048
- response = {
1049
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
1050
- name: errorCode,
1051
- $metadata: deserializeMetadata(output),
1052
- };
1053
- break;
1054
- case "ValidationException":
1055
- case "com.amazonaws.ivs#ValidationException":
1056
- response = {
1057
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1058
- name: errorCode,
1059
- $metadata: deserializeMetadata(output),
1060
- };
1061
- break;
1062
- default:
1063
- const parsedBody = parsedOutput.body;
1064
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1065
- response = {
1066
- ...parsedBody,
1067
- name: `${errorCode}`,
1068
- message: parsedBody.message || parsedBody.Message || errorCode,
1069
- $fault: "client",
1070
- $metadata: deserializeMetadata(output),
1071
- } as any;
1072
- }
1073
- const message = response.message || response.Message || errorCode;
1074
- response.message = message;
1075
- delete response.Message;
1076
- return Promise.reject(Object.assign(new Error(message), response));
1077
- };
1078
-
1079
- export const deserializeAws_restJson1CreateStreamKeyCommand = async (
1080
- output: __HttpResponse,
1081
- context: __SerdeContext
1082
- ): Promise<CreateStreamKeyCommandOutput> => {
1083
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1084
- return deserializeAws_restJson1CreateStreamKeyCommandError(output, context);
1085
- }
1086
- const contents: CreateStreamKeyCommandOutput = {
1087
- $metadata: deserializeMetadata(output),
1088
- streamKey: undefined,
1089
- };
1090
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1091
- if (data.streamKey !== undefined && data.streamKey !== null) {
1092
- contents.streamKey = deserializeAws_restJson1StreamKey(data.streamKey, context);
1093
- }
1094
- return Promise.resolve(contents);
1095
- };
1096
-
1097
- const deserializeAws_restJson1CreateStreamKeyCommandError = async (
1098
- output: __HttpResponse,
1099
- context: __SerdeContext
1100
- ): Promise<CreateStreamKeyCommandOutput> => {
1101
- const parsedOutput: any = {
1102
- ...output,
1103
- body: await parseBody(output.body, context),
1104
- };
1105
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1106
- let errorCode = "UnknownError";
1107
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1108
- switch (errorCode) {
1109
- case "AccessDeniedException":
1110
- case "com.amazonaws.ivs#AccessDeniedException":
1111
- response = {
1112
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1113
- name: errorCode,
1114
- $metadata: deserializeMetadata(output),
1115
- };
1116
- break;
1117
- case "PendingVerification":
1118
- case "com.amazonaws.ivs#PendingVerification":
1119
- response = {
1120
- ...(await deserializeAws_restJson1PendingVerificationResponse(parsedOutput, context)),
1121
- name: errorCode,
1122
- $metadata: deserializeMetadata(output),
1123
- };
1124
- break;
1125
- case "ResourceNotFoundException":
1126
- case "com.amazonaws.ivs#ResourceNotFoundException":
1127
- response = {
1128
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1129
- name: errorCode,
1130
- $metadata: deserializeMetadata(output),
1131
- };
1132
- break;
1133
- case "ServiceQuotaExceededException":
1134
- case "com.amazonaws.ivs#ServiceQuotaExceededException":
1135
- response = {
1136
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
1137
- name: errorCode,
1138
- $metadata: deserializeMetadata(output),
1139
- };
1140
- break;
1141
- case "ValidationException":
1142
- case "com.amazonaws.ivs#ValidationException":
1143
- response = {
1144
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1145
- name: errorCode,
1146
- $metadata: deserializeMetadata(output),
1147
- };
1148
- break;
1149
- default:
1150
- const parsedBody = parsedOutput.body;
1151
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1152
- response = {
1153
- ...parsedBody,
1154
- name: `${errorCode}`,
1155
- message: parsedBody.message || parsedBody.Message || errorCode,
1156
- $fault: "client",
1157
- $metadata: deserializeMetadata(output),
1158
- } as any;
1159
- }
1160
- const message = response.message || response.Message || errorCode;
1161
- response.message = message;
1162
- delete response.Message;
1163
- return Promise.reject(Object.assign(new Error(message), response));
1164
- };
1165
-
1166
- export const deserializeAws_restJson1DeleteChannelCommand = async (
1167
- output: __HttpResponse,
1168
- context: __SerdeContext
1169
- ): Promise<DeleteChannelCommandOutput> => {
1170
- if (output.statusCode !== 204 && output.statusCode >= 300) {
1171
- return deserializeAws_restJson1DeleteChannelCommandError(output, context);
1172
- }
1173
- const contents: DeleteChannelCommandOutput = {
1174
- $metadata: deserializeMetadata(output),
1175
- };
1176
- await collectBody(output.body, context);
1177
- return Promise.resolve(contents);
1178
- };
1179
-
1180
- const deserializeAws_restJson1DeleteChannelCommandError = async (
1181
- output: __HttpResponse,
1182
- context: __SerdeContext
1183
- ): Promise<DeleteChannelCommandOutput> => {
1184
- const parsedOutput: any = {
1185
- ...output,
1186
- body: await parseBody(output.body, context),
1187
- };
1188
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1189
- let errorCode = "UnknownError";
1190
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1191
- switch (errorCode) {
1192
- case "AccessDeniedException":
1193
- case "com.amazonaws.ivs#AccessDeniedException":
1194
- response = {
1195
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1196
- name: errorCode,
1197
- $metadata: deserializeMetadata(output),
1198
- };
1199
- break;
1200
- case "ConflictException":
1201
- case "com.amazonaws.ivs#ConflictException":
1202
- response = {
1203
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1204
- name: errorCode,
1205
- $metadata: deserializeMetadata(output),
1206
- };
1207
- break;
1208
- case "PendingVerification":
1209
- case "com.amazonaws.ivs#PendingVerification":
1210
- response = {
1211
- ...(await deserializeAws_restJson1PendingVerificationResponse(parsedOutput, context)),
1212
- name: errorCode,
1213
- $metadata: deserializeMetadata(output),
1214
- };
1215
- break;
1216
- case "ResourceNotFoundException":
1217
- case "com.amazonaws.ivs#ResourceNotFoundException":
1218
- response = {
1219
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1220
- name: errorCode,
1221
- $metadata: deserializeMetadata(output),
1222
- };
1223
- break;
1224
- case "ValidationException":
1225
- case "com.amazonaws.ivs#ValidationException":
1226
- response = {
1227
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1228
- name: errorCode,
1229
- $metadata: deserializeMetadata(output),
1230
- };
1231
- break;
1232
- default:
1233
- const parsedBody = parsedOutput.body;
1234
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1235
- response = {
1236
- ...parsedBody,
1237
- name: `${errorCode}`,
1238
- message: parsedBody.message || parsedBody.Message || errorCode,
1239
- $fault: "client",
1240
- $metadata: deserializeMetadata(output),
1241
- } as any;
1242
- }
1243
- const message = response.message || response.Message || errorCode;
1244
- response.message = message;
1245
- delete response.Message;
1246
- return Promise.reject(Object.assign(new Error(message), response));
1247
- };
1248
-
1249
- export const deserializeAws_restJson1DeletePlaybackKeyPairCommand = async (
1250
- output: __HttpResponse,
1251
- context: __SerdeContext
1252
- ): Promise<DeletePlaybackKeyPairCommandOutput> => {
1253
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1254
- return deserializeAws_restJson1DeletePlaybackKeyPairCommandError(output, context);
1255
- }
1256
- const contents: DeletePlaybackKeyPairCommandOutput = {
1257
- $metadata: deserializeMetadata(output),
1258
- };
1259
- await collectBody(output.body, context);
1260
- return Promise.resolve(contents);
1261
- };
1262
-
1263
- const deserializeAws_restJson1DeletePlaybackKeyPairCommandError = async (
1264
- output: __HttpResponse,
1265
- context: __SerdeContext
1266
- ): Promise<DeletePlaybackKeyPairCommandOutput> => {
1267
- const parsedOutput: any = {
1268
- ...output,
1269
- body: await parseBody(output.body, context),
1270
- };
1271
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1272
- let errorCode = "UnknownError";
1273
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1274
- switch (errorCode) {
1275
- case "AccessDeniedException":
1276
- case "com.amazonaws.ivs#AccessDeniedException":
1277
- response = {
1278
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1279
- name: errorCode,
1280
- $metadata: deserializeMetadata(output),
1281
- };
1282
- break;
1283
- case "PendingVerification":
1284
- case "com.amazonaws.ivs#PendingVerification":
1285
- response = {
1286
- ...(await deserializeAws_restJson1PendingVerificationResponse(parsedOutput, context)),
1287
- name: errorCode,
1288
- $metadata: deserializeMetadata(output),
1289
- };
1290
- break;
1291
- case "ResourceNotFoundException":
1292
- case "com.amazonaws.ivs#ResourceNotFoundException":
1293
- response = {
1294
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1295
- name: errorCode,
1296
- $metadata: deserializeMetadata(output),
1297
- };
1298
- break;
1299
- case "ValidationException":
1300
- case "com.amazonaws.ivs#ValidationException":
1301
- response = {
1302
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1303
- name: errorCode,
1304
- $metadata: deserializeMetadata(output),
1305
- };
1306
- break;
1307
- default:
1308
- const parsedBody = parsedOutput.body;
1309
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1310
- response = {
1311
- ...parsedBody,
1312
- name: `${errorCode}`,
1313
- message: parsedBody.message || parsedBody.Message || errorCode,
1314
- $fault: "client",
1315
- $metadata: deserializeMetadata(output),
1316
- } as any;
1317
- }
1318
- const message = response.message || response.Message || errorCode;
1319
- response.message = message;
1320
- delete response.Message;
1321
- return Promise.reject(Object.assign(new Error(message), response));
1322
- };
1323
-
1324
- export const deserializeAws_restJson1DeleteRecordingConfigurationCommand = async (
1325
- output: __HttpResponse,
1326
- context: __SerdeContext
1327
- ): Promise<DeleteRecordingConfigurationCommandOutput> => {
1328
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1329
- return deserializeAws_restJson1DeleteRecordingConfigurationCommandError(output, context);
1330
- }
1331
- const contents: DeleteRecordingConfigurationCommandOutput = {
1332
- $metadata: deserializeMetadata(output),
1333
- };
1334
- await collectBody(output.body, context);
1335
- return Promise.resolve(contents);
1336
- };
1337
-
1338
- const deserializeAws_restJson1DeleteRecordingConfigurationCommandError = async (
1339
- output: __HttpResponse,
1340
- context: __SerdeContext
1341
- ): Promise<DeleteRecordingConfigurationCommandOutput> => {
1342
- const parsedOutput: any = {
1343
- ...output,
1344
- body: await parseBody(output.body, context),
1345
- };
1346
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1347
- let errorCode = "UnknownError";
1348
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1349
- switch (errorCode) {
1350
- case "AccessDeniedException":
1351
- case "com.amazonaws.ivs#AccessDeniedException":
1352
- response = {
1353
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1354
- name: errorCode,
1355
- $metadata: deserializeMetadata(output),
1356
- };
1357
- break;
1358
- case "ConflictException":
1359
- case "com.amazonaws.ivs#ConflictException":
1360
- response = {
1361
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1362
- name: errorCode,
1363
- $metadata: deserializeMetadata(output),
1364
- };
1365
- break;
1366
- case "InternalServerException":
1367
- case "com.amazonaws.ivs#InternalServerException":
1368
- response = {
1369
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1370
- name: errorCode,
1371
- $metadata: deserializeMetadata(output),
1372
- };
1373
- break;
1374
- case "ResourceNotFoundException":
1375
- case "com.amazonaws.ivs#ResourceNotFoundException":
1376
- response = {
1377
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1378
- name: errorCode,
1379
- $metadata: deserializeMetadata(output),
1380
- };
1381
- break;
1382
- case "ValidationException":
1383
- case "com.amazonaws.ivs#ValidationException":
1384
- response = {
1385
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1386
- name: errorCode,
1387
- $metadata: deserializeMetadata(output),
1388
- };
1389
- break;
1390
- default:
1391
- const parsedBody = parsedOutput.body;
1392
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1393
- response = {
1394
- ...parsedBody,
1395
- name: `${errorCode}`,
1396
- message: parsedBody.message || parsedBody.Message || errorCode,
1397
- $fault: "client",
1398
- $metadata: deserializeMetadata(output),
1399
- } as any;
1400
- }
1401
- const message = response.message || response.Message || errorCode;
1402
- response.message = message;
1403
- delete response.Message;
1404
- return Promise.reject(Object.assign(new Error(message), response));
1405
- };
1406
-
1407
- export const deserializeAws_restJson1DeleteStreamKeyCommand = async (
1408
- output: __HttpResponse,
1409
- context: __SerdeContext
1410
- ): Promise<DeleteStreamKeyCommandOutput> => {
1411
- if (output.statusCode !== 204 && output.statusCode >= 300) {
1412
- return deserializeAws_restJson1DeleteStreamKeyCommandError(output, context);
1413
- }
1414
- const contents: DeleteStreamKeyCommandOutput = {
1415
- $metadata: deserializeMetadata(output),
1416
- };
1417
- await collectBody(output.body, context);
1418
- return Promise.resolve(contents);
1419
- };
1420
-
1421
- const deserializeAws_restJson1DeleteStreamKeyCommandError = async (
1422
- output: __HttpResponse,
1423
- context: __SerdeContext
1424
- ): Promise<DeleteStreamKeyCommandOutput> => {
1425
- const parsedOutput: any = {
1426
- ...output,
1427
- body: await parseBody(output.body, context),
1428
- };
1429
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1430
- let errorCode = "UnknownError";
1431
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1432
- switch (errorCode) {
1433
- case "AccessDeniedException":
1434
- case "com.amazonaws.ivs#AccessDeniedException":
1435
- response = {
1436
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1437
- name: errorCode,
1438
- $metadata: deserializeMetadata(output),
1439
- };
1440
- break;
1441
- case "PendingVerification":
1442
- case "com.amazonaws.ivs#PendingVerification":
1443
- response = {
1444
- ...(await deserializeAws_restJson1PendingVerificationResponse(parsedOutput, context)),
1445
- name: errorCode,
1446
- $metadata: deserializeMetadata(output),
1447
- };
1448
- break;
1449
- case "ResourceNotFoundException":
1450
- case "com.amazonaws.ivs#ResourceNotFoundException":
1451
- response = {
1452
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1453
- name: errorCode,
1454
- $metadata: deserializeMetadata(output),
1455
- };
1456
- break;
1457
- case "ValidationException":
1458
- case "com.amazonaws.ivs#ValidationException":
1459
- response = {
1460
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1461
- name: errorCode,
1462
- $metadata: deserializeMetadata(output),
1463
- };
1464
- break;
1465
- default:
1466
- const parsedBody = parsedOutput.body;
1467
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1468
- response = {
1469
- ...parsedBody,
1470
- name: `${errorCode}`,
1471
- message: parsedBody.message || parsedBody.Message || errorCode,
1472
- $fault: "client",
1473
- $metadata: deserializeMetadata(output),
1474
- } as any;
1475
- }
1476
- const message = response.message || response.Message || errorCode;
1477
- response.message = message;
1478
- delete response.Message;
1479
- return Promise.reject(Object.assign(new Error(message), response));
1480
- };
1481
-
1482
- export const deserializeAws_restJson1GetChannelCommand = async (
1483
- output: __HttpResponse,
1484
- context: __SerdeContext
1485
- ): Promise<GetChannelCommandOutput> => {
1486
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1487
- return deserializeAws_restJson1GetChannelCommandError(output, context);
1488
- }
1489
- const contents: GetChannelCommandOutput = {
1490
- $metadata: deserializeMetadata(output),
1491
- channel: undefined,
1492
- };
1493
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1494
- if (data.channel !== undefined && data.channel !== null) {
1495
- contents.channel = deserializeAws_restJson1Channel(data.channel, context);
1496
- }
1497
- return Promise.resolve(contents);
1498
- };
1499
-
1500
- const deserializeAws_restJson1GetChannelCommandError = async (
1501
- output: __HttpResponse,
1502
- context: __SerdeContext
1503
- ): Promise<GetChannelCommandOutput> => {
1504
- const parsedOutput: any = {
1505
- ...output,
1506
- body: await parseBody(output.body, context),
1507
- };
1508
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1509
- let errorCode = "UnknownError";
1510
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1511
- switch (errorCode) {
1512
- case "AccessDeniedException":
1513
- case "com.amazonaws.ivs#AccessDeniedException":
1514
- response = {
1515
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1516
- name: errorCode,
1517
- $metadata: deserializeMetadata(output),
1518
- };
1519
- break;
1520
- case "ResourceNotFoundException":
1521
- case "com.amazonaws.ivs#ResourceNotFoundException":
1522
- response = {
1523
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1524
- name: errorCode,
1525
- $metadata: deserializeMetadata(output),
1526
- };
1527
- break;
1528
- case "ValidationException":
1529
- case "com.amazonaws.ivs#ValidationException":
1530
- response = {
1531
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1532
- name: errorCode,
1533
- $metadata: deserializeMetadata(output),
1534
- };
1535
- break;
1536
- default:
1537
- const parsedBody = parsedOutput.body;
1538
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1539
- response = {
1540
- ...parsedBody,
1541
- name: `${errorCode}`,
1542
- message: parsedBody.message || parsedBody.Message || errorCode,
1543
- $fault: "client",
1544
- $metadata: deserializeMetadata(output),
1545
- } as any;
1546
- }
1547
- const message = response.message || response.Message || errorCode;
1548
- response.message = message;
1549
- delete response.Message;
1550
- return Promise.reject(Object.assign(new Error(message), response));
1551
- };
1552
-
1553
- export const deserializeAws_restJson1GetPlaybackKeyPairCommand = async (
1554
- output: __HttpResponse,
1555
- context: __SerdeContext
1556
- ): Promise<GetPlaybackKeyPairCommandOutput> => {
1557
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1558
- return deserializeAws_restJson1GetPlaybackKeyPairCommandError(output, context);
1559
- }
1560
- const contents: GetPlaybackKeyPairCommandOutput = {
1561
- $metadata: deserializeMetadata(output),
1562
- keyPair: undefined,
1563
- };
1564
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1565
- if (data.keyPair !== undefined && data.keyPair !== null) {
1566
- contents.keyPair = deserializeAws_restJson1PlaybackKeyPair(data.keyPair, context);
1567
- }
1568
- return Promise.resolve(contents);
1569
- };
1570
-
1571
- const deserializeAws_restJson1GetPlaybackKeyPairCommandError = async (
1572
- output: __HttpResponse,
1573
- context: __SerdeContext
1574
- ): Promise<GetPlaybackKeyPairCommandOutput> => {
1575
- const parsedOutput: any = {
1576
- ...output,
1577
- body: await parseBody(output.body, context),
1578
- };
1579
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1580
- let errorCode = "UnknownError";
1581
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1582
- switch (errorCode) {
1583
- case "AccessDeniedException":
1584
- case "com.amazonaws.ivs#AccessDeniedException":
1585
- response = {
1586
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1587
- name: errorCode,
1588
- $metadata: deserializeMetadata(output),
1589
- };
1590
- break;
1591
- case "ResourceNotFoundException":
1592
- case "com.amazonaws.ivs#ResourceNotFoundException":
1593
- response = {
1594
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1595
- name: errorCode,
1596
- $metadata: deserializeMetadata(output),
1597
- };
1598
- break;
1599
- case "ValidationException":
1600
- case "com.amazonaws.ivs#ValidationException":
1601
- response = {
1602
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1603
- name: errorCode,
1604
- $metadata: deserializeMetadata(output),
1605
- };
1606
- break;
1607
- default:
1608
- const parsedBody = parsedOutput.body;
1609
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1610
- response = {
1611
- ...parsedBody,
1612
- name: `${errorCode}`,
1613
- message: parsedBody.message || parsedBody.Message || errorCode,
1614
- $fault: "client",
1615
- $metadata: deserializeMetadata(output),
1616
- } as any;
1617
- }
1618
- const message = response.message || response.Message || errorCode;
1619
- response.message = message;
1620
- delete response.Message;
1621
- return Promise.reject(Object.assign(new Error(message), response));
1622
- };
1623
-
1624
- export const deserializeAws_restJson1GetRecordingConfigurationCommand = async (
1625
- output: __HttpResponse,
1626
- context: __SerdeContext
1627
- ): Promise<GetRecordingConfigurationCommandOutput> => {
1628
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1629
- return deserializeAws_restJson1GetRecordingConfigurationCommandError(output, context);
1630
- }
1631
- const contents: GetRecordingConfigurationCommandOutput = {
1632
- $metadata: deserializeMetadata(output),
1633
- recordingConfiguration: undefined,
1634
- };
1635
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1636
- if (data.recordingConfiguration !== undefined && data.recordingConfiguration !== null) {
1637
- contents.recordingConfiguration = deserializeAws_restJson1RecordingConfiguration(
1638
- data.recordingConfiguration,
1639
- context
1640
- );
1641
- }
1642
- return Promise.resolve(contents);
1643
- };
1644
-
1645
- const deserializeAws_restJson1GetRecordingConfigurationCommandError = async (
1646
- output: __HttpResponse,
1647
- context: __SerdeContext
1648
- ): Promise<GetRecordingConfigurationCommandOutput> => {
1649
- const parsedOutput: any = {
1650
- ...output,
1651
- body: await parseBody(output.body, context),
1652
- };
1653
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1654
- let errorCode = "UnknownError";
1655
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1656
- switch (errorCode) {
1657
- case "AccessDeniedException":
1658
- case "com.amazonaws.ivs#AccessDeniedException":
1659
- response = {
1660
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1661
- name: errorCode,
1662
- $metadata: deserializeMetadata(output),
1663
- };
1664
- break;
1665
- case "InternalServerException":
1666
- case "com.amazonaws.ivs#InternalServerException":
1667
- response = {
1668
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1669
- name: errorCode,
1670
- $metadata: deserializeMetadata(output),
1671
- };
1672
- break;
1673
- case "ResourceNotFoundException":
1674
- case "com.amazonaws.ivs#ResourceNotFoundException":
1675
- response = {
1676
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1677
- name: errorCode,
1678
- $metadata: deserializeMetadata(output),
1679
- };
1680
- break;
1681
- case "ValidationException":
1682
- case "com.amazonaws.ivs#ValidationException":
1683
- response = {
1684
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1685
- name: errorCode,
1686
- $metadata: deserializeMetadata(output),
1687
- };
1688
- break;
1689
- default:
1690
- const parsedBody = parsedOutput.body;
1691
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1692
- response = {
1693
- ...parsedBody,
1694
- name: `${errorCode}`,
1695
- message: parsedBody.message || parsedBody.Message || errorCode,
1696
- $fault: "client",
1697
- $metadata: deserializeMetadata(output),
1698
- } as any;
1699
- }
1700
- const message = response.message || response.Message || errorCode;
1701
- response.message = message;
1702
- delete response.Message;
1703
- return Promise.reject(Object.assign(new Error(message), response));
1704
- };
1705
-
1706
- export const deserializeAws_restJson1GetStreamCommand = async (
1707
- output: __HttpResponse,
1708
- context: __SerdeContext
1709
- ): Promise<GetStreamCommandOutput> => {
1710
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1711
- return deserializeAws_restJson1GetStreamCommandError(output, context);
1712
- }
1713
- const contents: GetStreamCommandOutput = {
1714
- $metadata: deserializeMetadata(output),
1715
- stream: undefined,
1716
- };
1717
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1718
- if (data.stream !== undefined && data.stream !== null) {
1719
- contents.stream = deserializeAws_restJson1_Stream(data.stream, context);
1720
- }
1721
- return Promise.resolve(contents);
1722
- };
1723
-
1724
- const deserializeAws_restJson1GetStreamCommandError = async (
1725
- output: __HttpResponse,
1726
- context: __SerdeContext
1727
- ): Promise<GetStreamCommandOutput> => {
1728
- const parsedOutput: any = {
1729
- ...output,
1730
- body: await parseBody(output.body, context),
1731
- };
1732
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1733
- let errorCode = "UnknownError";
1734
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1735
- switch (errorCode) {
1736
- case "AccessDeniedException":
1737
- case "com.amazonaws.ivs#AccessDeniedException":
1738
- response = {
1739
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1740
- name: errorCode,
1741
- $metadata: deserializeMetadata(output),
1742
- };
1743
- break;
1744
- case "ChannelNotBroadcasting":
1745
- case "com.amazonaws.ivs#ChannelNotBroadcasting":
1746
- response = {
1747
- ...(await deserializeAws_restJson1ChannelNotBroadcastingResponse(parsedOutput, context)),
1748
- name: errorCode,
1749
- $metadata: deserializeMetadata(output),
1750
- };
1751
- break;
1752
- case "ResourceNotFoundException":
1753
- case "com.amazonaws.ivs#ResourceNotFoundException":
1754
- response = {
1755
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1756
- name: errorCode,
1757
- $metadata: deserializeMetadata(output),
1758
- };
1759
- break;
1760
- case "ValidationException":
1761
- case "com.amazonaws.ivs#ValidationException":
1762
- response = {
1763
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1764
- name: errorCode,
1765
- $metadata: deserializeMetadata(output),
1766
- };
1767
- break;
1768
- default:
1769
- const parsedBody = parsedOutput.body;
1770
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1771
- response = {
1772
- ...parsedBody,
1773
- name: `${errorCode}`,
1774
- message: parsedBody.message || parsedBody.Message || errorCode,
1775
- $fault: "client",
1776
- $metadata: deserializeMetadata(output),
1777
- } as any;
1778
- }
1779
- const message = response.message || response.Message || errorCode;
1780
- response.message = message;
1781
- delete response.Message;
1782
- return Promise.reject(Object.assign(new Error(message), response));
1783
- };
1784
-
1785
- export const deserializeAws_restJson1GetStreamKeyCommand = async (
1786
- output: __HttpResponse,
1787
- context: __SerdeContext
1788
- ): Promise<GetStreamKeyCommandOutput> => {
1789
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1790
- return deserializeAws_restJson1GetStreamKeyCommandError(output, context);
1791
- }
1792
- const contents: GetStreamKeyCommandOutput = {
1793
- $metadata: deserializeMetadata(output),
1794
- streamKey: undefined,
1795
- };
1796
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1797
- if (data.streamKey !== undefined && data.streamKey !== null) {
1798
- contents.streamKey = deserializeAws_restJson1StreamKey(data.streamKey, context);
1799
- }
1800
- return Promise.resolve(contents);
1801
- };
1802
-
1803
- const deserializeAws_restJson1GetStreamKeyCommandError = async (
1804
- output: __HttpResponse,
1805
- context: __SerdeContext
1806
- ): Promise<GetStreamKeyCommandOutput> => {
1807
- const parsedOutput: any = {
1808
- ...output,
1809
- body: await parseBody(output.body, context),
1810
- };
1811
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1812
- let errorCode = "UnknownError";
1813
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1814
- switch (errorCode) {
1815
- case "AccessDeniedException":
1816
- case "com.amazonaws.ivs#AccessDeniedException":
1817
- response = {
1818
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1819
- name: errorCode,
1820
- $metadata: deserializeMetadata(output),
1821
- };
1822
- break;
1823
- case "ResourceNotFoundException":
1824
- case "com.amazonaws.ivs#ResourceNotFoundException":
1825
- response = {
1826
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1827
- name: errorCode,
1828
- $metadata: deserializeMetadata(output),
1829
- };
1830
- break;
1831
- case "ValidationException":
1832
- case "com.amazonaws.ivs#ValidationException":
1833
- response = {
1834
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1835
- name: errorCode,
1836
- $metadata: deserializeMetadata(output),
1837
- };
1838
- break;
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_restJson1ImportPlaybackKeyPairCommand = async (
1857
- output: __HttpResponse,
1858
- context: __SerdeContext
1859
- ): Promise<ImportPlaybackKeyPairCommandOutput> => {
1860
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1861
- return deserializeAws_restJson1ImportPlaybackKeyPairCommandError(output, context);
1862
- }
1863
- const contents: ImportPlaybackKeyPairCommandOutput = {
1864
- $metadata: deserializeMetadata(output),
1865
- keyPair: undefined,
1866
- };
1867
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1868
- if (data.keyPair !== undefined && data.keyPair !== null) {
1869
- contents.keyPair = deserializeAws_restJson1PlaybackKeyPair(data.keyPair, context);
1870
- }
1871
- return Promise.resolve(contents);
1872
- };
1873
-
1874
- const deserializeAws_restJson1ImportPlaybackKeyPairCommandError = async (
1875
- output: __HttpResponse,
1876
- context: __SerdeContext
1877
- ): Promise<ImportPlaybackKeyPairCommandOutput> => {
1878
- const parsedOutput: any = {
1879
- ...output,
1880
- body: await parseBody(output.body, context),
1881
- };
1882
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1883
- let errorCode = "UnknownError";
1884
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1885
- switch (errorCode) {
1886
- case "AccessDeniedException":
1887
- case "com.amazonaws.ivs#AccessDeniedException":
1888
- response = {
1889
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1890
- name: errorCode,
1891
- $metadata: deserializeMetadata(output),
1892
- };
1893
- break;
1894
- case "ConflictException":
1895
- case "com.amazonaws.ivs#ConflictException":
1896
- response = {
1897
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1898
- name: errorCode,
1899
- $metadata: deserializeMetadata(output),
1900
- };
1901
- break;
1902
- case "PendingVerification":
1903
- case "com.amazonaws.ivs#PendingVerification":
1904
- response = {
1905
- ...(await deserializeAws_restJson1PendingVerificationResponse(parsedOutput, context)),
1906
- name: errorCode,
1907
- $metadata: deserializeMetadata(output),
1908
- };
1909
- break;
1910
- case "ServiceQuotaExceededException":
1911
- case "com.amazonaws.ivs#ServiceQuotaExceededException":
1912
- response = {
1913
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
1914
- name: errorCode,
1915
- $metadata: deserializeMetadata(output),
1916
- };
1917
- break;
1918
- case "ValidationException":
1919
- case "com.amazonaws.ivs#ValidationException":
1920
- response = {
1921
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1922
- name: errorCode,
1923
- $metadata: deserializeMetadata(output),
1924
- };
1925
- break;
1926
- default:
1927
- const parsedBody = parsedOutput.body;
1928
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1929
- response = {
1930
- ...parsedBody,
1931
- name: `${errorCode}`,
1932
- message: parsedBody.message || parsedBody.Message || errorCode,
1933
- $fault: "client",
1934
- $metadata: deserializeMetadata(output),
1935
- } as any;
1936
- }
1937
- const message = response.message || response.Message || errorCode;
1938
- response.message = message;
1939
- delete response.Message;
1940
- return Promise.reject(Object.assign(new Error(message), response));
1941
- };
1942
-
1943
- export const deserializeAws_restJson1ListChannelsCommand = async (
1944
- output: __HttpResponse,
1945
- context: __SerdeContext
1946
- ): Promise<ListChannelsCommandOutput> => {
1947
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1948
- return deserializeAws_restJson1ListChannelsCommandError(output, context);
1949
- }
1950
- const contents: ListChannelsCommandOutput = {
1951
- $metadata: deserializeMetadata(output),
1952
- channels: undefined,
1953
- nextToken: undefined,
1954
- };
1955
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1956
- if (data.channels !== undefined && data.channels !== null) {
1957
- contents.channels = deserializeAws_restJson1ChannelList(data.channels, context);
1958
- }
1959
- if (data.nextToken !== undefined && data.nextToken !== null) {
1960
- contents.nextToken = __expectString(data.nextToken);
1961
- }
1962
- return Promise.resolve(contents);
1963
- };
1964
-
1965
- const deserializeAws_restJson1ListChannelsCommandError = async (
1966
- output: __HttpResponse,
1967
- context: __SerdeContext
1968
- ): Promise<ListChannelsCommandOutput> => {
1969
- const parsedOutput: any = {
1970
- ...output,
1971
- body: await parseBody(output.body, context),
1972
- };
1973
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1974
- let errorCode = "UnknownError";
1975
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1976
- switch (errorCode) {
1977
- case "AccessDeniedException":
1978
- case "com.amazonaws.ivs#AccessDeniedException":
1979
- response = {
1980
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1981
- name: errorCode,
1982
- $metadata: deserializeMetadata(output),
1983
- };
1984
- break;
1985
- case "ConflictException":
1986
- case "com.amazonaws.ivs#ConflictException":
1987
- response = {
1988
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1989
- name: errorCode,
1990
- $metadata: deserializeMetadata(output),
1991
- };
1992
- break;
1993
- case "ValidationException":
1994
- case "com.amazonaws.ivs#ValidationException":
1995
- response = {
1996
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1997
- name: errorCode,
1998
- $metadata: deserializeMetadata(output),
1999
- };
2000
- break;
2001
- default:
2002
- const parsedBody = parsedOutput.body;
2003
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2004
- response = {
2005
- ...parsedBody,
2006
- name: `${errorCode}`,
2007
- message: parsedBody.message || parsedBody.Message || errorCode,
2008
- $fault: "client",
2009
- $metadata: deserializeMetadata(output),
2010
- } as any;
2011
- }
2012
- const message = response.message || response.Message || errorCode;
2013
- response.message = message;
2014
- delete response.Message;
2015
- return Promise.reject(Object.assign(new Error(message), response));
2016
- };
2017
-
2018
- export const deserializeAws_restJson1ListPlaybackKeyPairsCommand = async (
2019
- output: __HttpResponse,
2020
- context: __SerdeContext
2021
- ): Promise<ListPlaybackKeyPairsCommandOutput> => {
2022
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2023
- return deserializeAws_restJson1ListPlaybackKeyPairsCommandError(output, context);
2024
- }
2025
- const contents: ListPlaybackKeyPairsCommandOutput = {
2026
- $metadata: deserializeMetadata(output),
2027
- keyPairs: undefined,
2028
- nextToken: undefined,
2029
- };
2030
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2031
- if (data.keyPairs !== undefined && data.keyPairs !== null) {
2032
- contents.keyPairs = deserializeAws_restJson1PlaybackKeyPairList(data.keyPairs, context);
2033
- }
2034
- if (data.nextToken !== undefined && data.nextToken !== null) {
2035
- contents.nextToken = __expectString(data.nextToken);
2036
- }
2037
- return Promise.resolve(contents);
2038
- };
2039
-
2040
- const deserializeAws_restJson1ListPlaybackKeyPairsCommandError = async (
2041
- output: __HttpResponse,
2042
- context: __SerdeContext
2043
- ): Promise<ListPlaybackKeyPairsCommandOutput> => {
2044
- const parsedOutput: any = {
2045
- ...output,
2046
- body: await parseBody(output.body, context),
2047
- };
2048
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2049
- let errorCode = "UnknownError";
2050
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2051
- switch (errorCode) {
2052
- case "AccessDeniedException":
2053
- case "com.amazonaws.ivs#AccessDeniedException":
2054
- response = {
2055
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2056
- name: errorCode,
2057
- $metadata: deserializeMetadata(output),
2058
- };
2059
- break;
2060
- case "ValidationException":
2061
- case "com.amazonaws.ivs#ValidationException":
2062
- response = {
2063
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2064
- name: errorCode,
2065
- $metadata: deserializeMetadata(output),
2066
- };
2067
- break;
2068
- default:
2069
- const parsedBody = parsedOutput.body;
2070
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2071
- response = {
2072
- ...parsedBody,
2073
- name: `${errorCode}`,
2074
- message: parsedBody.message || parsedBody.Message || errorCode,
2075
- $fault: "client",
2076
- $metadata: deserializeMetadata(output),
2077
- } as any;
2078
- }
2079
- const message = response.message || response.Message || errorCode;
2080
- response.message = message;
2081
- delete response.Message;
2082
- return Promise.reject(Object.assign(new Error(message), response));
2083
- };
2084
-
2085
- export const deserializeAws_restJson1ListRecordingConfigurationsCommand = async (
2086
- output: __HttpResponse,
2087
- context: __SerdeContext
2088
- ): Promise<ListRecordingConfigurationsCommandOutput> => {
2089
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2090
- return deserializeAws_restJson1ListRecordingConfigurationsCommandError(output, context);
2091
- }
2092
- const contents: ListRecordingConfigurationsCommandOutput = {
2093
- $metadata: deserializeMetadata(output),
2094
- nextToken: undefined,
2095
- recordingConfigurations: undefined,
2096
- };
2097
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2098
- if (data.nextToken !== undefined && data.nextToken !== null) {
2099
- contents.nextToken = __expectString(data.nextToken);
2100
- }
2101
- if (data.recordingConfigurations !== undefined && data.recordingConfigurations !== null) {
2102
- contents.recordingConfigurations = deserializeAws_restJson1RecordingConfigurationList(
2103
- data.recordingConfigurations,
2104
- context
2105
- );
2106
- }
2107
- return Promise.resolve(contents);
2108
- };
2109
-
2110
- const deserializeAws_restJson1ListRecordingConfigurationsCommandError = async (
2111
- output: __HttpResponse,
2112
- context: __SerdeContext
2113
- ): Promise<ListRecordingConfigurationsCommandOutput> => {
2114
- const parsedOutput: any = {
2115
- ...output,
2116
- body: await parseBody(output.body, context),
2117
- };
2118
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2119
- let errorCode = "UnknownError";
2120
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2121
- switch (errorCode) {
2122
- case "AccessDeniedException":
2123
- case "com.amazonaws.ivs#AccessDeniedException":
2124
- response = {
2125
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2126
- name: errorCode,
2127
- $metadata: deserializeMetadata(output),
2128
- };
2129
- break;
2130
- case "InternalServerException":
2131
- case "com.amazonaws.ivs#InternalServerException":
2132
- response = {
2133
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2134
- name: errorCode,
2135
- $metadata: deserializeMetadata(output),
2136
- };
2137
- break;
2138
- case "ValidationException":
2139
- case "com.amazonaws.ivs#ValidationException":
2140
- response = {
2141
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2142
- name: errorCode,
2143
- $metadata: deserializeMetadata(output),
2144
- };
2145
- break;
2146
- default:
2147
- const parsedBody = parsedOutput.body;
2148
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2149
- response = {
2150
- ...parsedBody,
2151
- name: `${errorCode}`,
2152
- message: parsedBody.message || parsedBody.Message || errorCode,
2153
- $fault: "client",
2154
- $metadata: deserializeMetadata(output),
2155
- } as any;
2156
- }
2157
- const message = response.message || response.Message || errorCode;
2158
- response.message = message;
2159
- delete response.Message;
2160
- return Promise.reject(Object.assign(new Error(message), response));
2161
- };
2162
-
2163
- export const deserializeAws_restJson1ListStreamKeysCommand = async (
2164
- output: __HttpResponse,
2165
- context: __SerdeContext
2166
- ): Promise<ListStreamKeysCommandOutput> => {
2167
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2168
- return deserializeAws_restJson1ListStreamKeysCommandError(output, context);
2169
- }
2170
- const contents: ListStreamKeysCommandOutput = {
2171
- $metadata: deserializeMetadata(output),
2172
- nextToken: undefined,
2173
- streamKeys: undefined,
2174
- };
2175
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2176
- if (data.nextToken !== undefined && data.nextToken !== null) {
2177
- contents.nextToken = __expectString(data.nextToken);
2178
- }
2179
- if (data.streamKeys !== undefined && data.streamKeys !== null) {
2180
- contents.streamKeys = deserializeAws_restJson1StreamKeyList(data.streamKeys, context);
2181
- }
2182
- return Promise.resolve(contents);
2183
- };
2184
-
2185
- const deserializeAws_restJson1ListStreamKeysCommandError = async (
2186
- output: __HttpResponse,
2187
- context: __SerdeContext
2188
- ): Promise<ListStreamKeysCommandOutput> => {
2189
- const parsedOutput: any = {
2190
- ...output,
2191
- body: await parseBody(output.body, context),
2192
- };
2193
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2194
- let errorCode = "UnknownError";
2195
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2196
- switch (errorCode) {
2197
- case "AccessDeniedException":
2198
- case "com.amazonaws.ivs#AccessDeniedException":
2199
- response = {
2200
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2201
- name: errorCode,
2202
- $metadata: deserializeMetadata(output),
2203
- };
2204
- break;
2205
- case "ResourceNotFoundException":
2206
- case "com.amazonaws.ivs#ResourceNotFoundException":
2207
- response = {
2208
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2209
- name: errorCode,
2210
- $metadata: deserializeMetadata(output),
2211
- };
2212
- break;
2213
- case "ValidationException":
2214
- case "com.amazonaws.ivs#ValidationException":
2215
- response = {
2216
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2217
- name: errorCode,
2218
- $metadata: deserializeMetadata(output),
2219
- };
2220
- break;
2221
- default:
2222
- const parsedBody = parsedOutput.body;
2223
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2224
- response = {
2225
- ...parsedBody,
2226
- name: `${errorCode}`,
2227
- message: parsedBody.message || parsedBody.Message || errorCode,
2228
- $fault: "client",
2229
- $metadata: deserializeMetadata(output),
2230
- } as any;
2231
- }
2232
- const message = response.message || response.Message || errorCode;
2233
- response.message = message;
2234
- delete response.Message;
2235
- return Promise.reject(Object.assign(new Error(message), response));
2236
- };
2237
-
2238
- export const deserializeAws_restJson1ListStreamsCommand = async (
2239
- output: __HttpResponse,
2240
- context: __SerdeContext
2241
- ): Promise<ListStreamsCommandOutput> => {
2242
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2243
- return deserializeAws_restJson1ListStreamsCommandError(output, context);
2244
- }
2245
- const contents: ListStreamsCommandOutput = {
2246
- $metadata: deserializeMetadata(output),
2247
- nextToken: undefined,
2248
- streams: undefined,
2249
- };
2250
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2251
- if (data.nextToken !== undefined && data.nextToken !== null) {
2252
- contents.nextToken = __expectString(data.nextToken);
2253
- }
2254
- if (data.streams !== undefined && data.streams !== null) {
2255
- contents.streams = deserializeAws_restJson1StreamList(data.streams, context);
2256
- }
2257
- return Promise.resolve(contents);
2258
- };
2259
-
2260
- const deserializeAws_restJson1ListStreamsCommandError = async (
2261
- output: __HttpResponse,
2262
- context: __SerdeContext
2263
- ): Promise<ListStreamsCommandOutput> => {
2264
- const parsedOutput: any = {
2265
- ...output,
2266
- body: await parseBody(output.body, context),
2267
- };
2268
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2269
- let errorCode = "UnknownError";
2270
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2271
- switch (errorCode) {
2272
- case "AccessDeniedException":
2273
- case "com.amazonaws.ivs#AccessDeniedException":
2274
- response = {
2275
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2276
- name: errorCode,
2277
- $metadata: deserializeMetadata(output),
2278
- };
2279
- break;
2280
- default:
2281
- const parsedBody = parsedOutput.body;
2282
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2283
- response = {
2284
- ...parsedBody,
2285
- name: `${errorCode}`,
2286
- message: parsedBody.message || parsedBody.Message || errorCode,
2287
- $fault: "client",
2288
- $metadata: deserializeMetadata(output),
2289
- } as any;
2290
- }
2291
- const message = response.message || response.Message || errorCode;
2292
- response.message = message;
2293
- delete response.Message;
2294
- return Promise.reject(Object.assign(new Error(message), response));
2295
- };
2296
-
2297
- export const deserializeAws_restJson1ListTagsForResourceCommand = async (
2298
- output: __HttpResponse,
2299
- context: __SerdeContext
2300
- ): Promise<ListTagsForResourceCommandOutput> => {
2301
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2302
- return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
2303
- }
2304
- const contents: ListTagsForResourceCommandOutput = {
2305
- $metadata: deserializeMetadata(output),
2306
- nextToken: undefined,
2307
- tags: undefined,
2308
- };
2309
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2310
- if (data.nextToken !== undefined && data.nextToken !== null) {
2311
- contents.nextToken = __expectString(data.nextToken);
2312
- }
2313
- if (data.tags !== undefined && data.tags !== null) {
2314
- contents.tags = deserializeAws_restJson1Tags(data.tags, context);
2315
- }
2316
- return Promise.resolve(contents);
2317
- };
2318
-
2319
- const deserializeAws_restJson1ListTagsForResourceCommandError = async (
2320
- output: __HttpResponse,
2321
- context: __SerdeContext
2322
- ): Promise<ListTagsForResourceCommandOutput> => {
2323
- const parsedOutput: any = {
2324
- ...output,
2325
- body: await parseBody(output.body, context),
2326
- };
2327
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2328
- let errorCode = "UnknownError";
2329
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2330
- switch (errorCode) {
2331
- case "InternalServerException":
2332
- case "com.amazonaws.ivs#InternalServerException":
2333
- response = {
2334
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2335
- name: errorCode,
2336
- $metadata: deserializeMetadata(output),
2337
- };
2338
- break;
2339
- case "ResourceNotFoundException":
2340
- case "com.amazonaws.ivs#ResourceNotFoundException":
2341
- response = {
2342
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2343
- name: errorCode,
2344
- $metadata: deserializeMetadata(output),
2345
- };
2346
- break;
2347
- case "ValidationException":
2348
- case "com.amazonaws.ivs#ValidationException":
2349
- response = {
2350
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2351
- name: errorCode,
2352
- $metadata: deserializeMetadata(output),
2353
- };
2354
- break;
2355
- default:
2356
- const parsedBody = parsedOutput.body;
2357
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2358
- response = {
2359
- ...parsedBody,
2360
- name: `${errorCode}`,
2361
- message: parsedBody.message || parsedBody.Message || errorCode,
2362
- $fault: "client",
2363
- $metadata: deserializeMetadata(output),
2364
- } as any;
2365
- }
2366
- const message = response.message || response.Message || errorCode;
2367
- response.message = message;
2368
- delete response.Message;
2369
- return Promise.reject(Object.assign(new Error(message), response));
2370
- };
2371
-
2372
- export const deserializeAws_restJson1PutMetadataCommand = async (
2373
- output: __HttpResponse,
2374
- context: __SerdeContext
2375
- ): Promise<PutMetadataCommandOutput> => {
2376
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2377
- return deserializeAws_restJson1PutMetadataCommandError(output, context);
2378
- }
2379
- const contents: PutMetadataCommandOutput = {
2380
- $metadata: deserializeMetadata(output),
2381
- };
2382
- await collectBody(output.body, context);
2383
- return Promise.resolve(contents);
2384
- };
2385
-
2386
- const deserializeAws_restJson1PutMetadataCommandError = async (
2387
- output: __HttpResponse,
2388
- context: __SerdeContext
2389
- ): Promise<PutMetadataCommandOutput> => {
2390
- const parsedOutput: any = {
2391
- ...output,
2392
- body: await parseBody(output.body, context),
2393
- };
2394
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2395
- let errorCode = "UnknownError";
2396
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2397
- switch (errorCode) {
2398
- case "AccessDeniedException":
2399
- case "com.amazonaws.ivs#AccessDeniedException":
2400
- response = {
2401
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2402
- name: errorCode,
2403
- $metadata: deserializeMetadata(output),
2404
- };
2405
- break;
2406
- case "ChannelNotBroadcasting":
2407
- case "com.amazonaws.ivs#ChannelNotBroadcasting":
2408
- response = {
2409
- ...(await deserializeAws_restJson1ChannelNotBroadcastingResponse(parsedOutput, context)),
2410
- name: errorCode,
2411
- $metadata: deserializeMetadata(output),
2412
- };
2413
- break;
2414
- case "ResourceNotFoundException":
2415
- case "com.amazonaws.ivs#ResourceNotFoundException":
2416
- response = {
2417
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2418
- name: errorCode,
2419
- $metadata: deserializeMetadata(output),
2420
- };
2421
- break;
2422
- case "ThrottlingException":
2423
- case "com.amazonaws.ivs#ThrottlingException":
2424
- response = {
2425
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2426
- name: errorCode,
2427
- $metadata: deserializeMetadata(output),
2428
- };
2429
- break;
2430
- case "ValidationException":
2431
- case "com.amazonaws.ivs#ValidationException":
2432
- response = {
2433
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2434
- name: errorCode,
2435
- $metadata: deserializeMetadata(output),
2436
- };
2437
- break;
2438
- default:
2439
- const parsedBody = parsedOutput.body;
2440
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2441
- response = {
2442
- ...parsedBody,
2443
- name: `${errorCode}`,
2444
- message: parsedBody.message || parsedBody.Message || errorCode,
2445
- $fault: "client",
2446
- $metadata: deserializeMetadata(output),
2447
- } as any;
2448
- }
2449
- const message = response.message || response.Message || errorCode;
2450
- response.message = message;
2451
- delete response.Message;
2452
- return Promise.reject(Object.assign(new Error(message), response));
2453
- };
2454
-
2455
- export const deserializeAws_restJson1StopStreamCommand = async (
2456
- output: __HttpResponse,
2457
- context: __SerdeContext
2458
- ): Promise<StopStreamCommandOutput> => {
2459
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2460
- return deserializeAws_restJson1StopStreamCommandError(output, context);
2461
- }
2462
- const contents: StopStreamCommandOutput = {
2463
- $metadata: deserializeMetadata(output),
2464
- };
2465
- await collectBody(output.body, context);
2466
- return Promise.resolve(contents);
2467
- };
2468
-
2469
- const deserializeAws_restJson1StopStreamCommandError = async (
2470
- output: __HttpResponse,
2471
- context: __SerdeContext
2472
- ): Promise<StopStreamCommandOutput> => {
2473
- const parsedOutput: any = {
2474
- ...output,
2475
- body: await parseBody(output.body, context),
2476
- };
2477
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2478
- let errorCode = "UnknownError";
2479
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2480
- switch (errorCode) {
2481
- case "AccessDeniedException":
2482
- case "com.amazonaws.ivs#AccessDeniedException":
2483
- response = {
2484
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2485
- name: errorCode,
2486
- $metadata: deserializeMetadata(output),
2487
- };
2488
- break;
2489
- case "ChannelNotBroadcasting":
2490
- case "com.amazonaws.ivs#ChannelNotBroadcasting":
2491
- response = {
2492
- ...(await deserializeAws_restJson1ChannelNotBroadcastingResponse(parsedOutput, context)),
2493
- name: errorCode,
2494
- $metadata: deserializeMetadata(output),
2495
- };
2496
- break;
2497
- case "ResourceNotFoundException":
2498
- case "com.amazonaws.ivs#ResourceNotFoundException":
2499
- response = {
2500
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2501
- name: errorCode,
2502
- $metadata: deserializeMetadata(output),
2503
- };
2504
- break;
2505
- case "StreamUnavailable":
2506
- case "com.amazonaws.ivs#StreamUnavailable":
2507
- response = {
2508
- ...(await deserializeAws_restJson1StreamUnavailableResponse(parsedOutput, context)),
2509
- name: errorCode,
2510
- $metadata: deserializeMetadata(output),
2511
- };
2512
- break;
2513
- case "ValidationException":
2514
- case "com.amazonaws.ivs#ValidationException":
2515
- response = {
2516
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2517
- name: errorCode,
2518
- $metadata: deserializeMetadata(output),
2519
- };
2520
- break;
2521
- default:
2522
- const parsedBody = parsedOutput.body;
2523
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2524
- response = {
2525
- ...parsedBody,
2526
- name: `${errorCode}`,
2527
- message: parsedBody.message || parsedBody.Message || errorCode,
2528
- $fault: "client",
2529
- $metadata: deserializeMetadata(output),
2530
- } as any;
2531
- }
2532
- const message = response.message || response.Message || errorCode;
2533
- response.message = message;
2534
- delete response.Message;
2535
- return Promise.reject(Object.assign(new Error(message), response));
2536
- };
2537
-
2538
- export const deserializeAws_restJson1TagResourceCommand = async (
2539
- output: __HttpResponse,
2540
- context: __SerdeContext
2541
- ): Promise<TagResourceCommandOutput> => {
2542
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2543
- return deserializeAws_restJson1TagResourceCommandError(output, context);
2544
- }
2545
- const contents: TagResourceCommandOutput = {
2546
- $metadata: deserializeMetadata(output),
2547
- };
2548
- await collectBody(output.body, context);
2549
- return Promise.resolve(contents);
2550
- };
2551
-
2552
- const deserializeAws_restJson1TagResourceCommandError = async (
2553
- output: __HttpResponse,
2554
- context: __SerdeContext
2555
- ): Promise<TagResourceCommandOutput> => {
2556
- const parsedOutput: any = {
2557
- ...output,
2558
- body: await parseBody(output.body, context),
2559
- };
2560
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2561
- let errorCode = "UnknownError";
2562
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2563
- switch (errorCode) {
2564
- case "InternalServerException":
2565
- case "com.amazonaws.ivs#InternalServerException":
2566
- response = {
2567
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2568
- name: errorCode,
2569
- $metadata: deserializeMetadata(output),
2570
- };
2571
- break;
2572
- case "ResourceNotFoundException":
2573
- case "com.amazonaws.ivs#ResourceNotFoundException":
2574
- response = {
2575
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2576
- name: errorCode,
2577
- $metadata: deserializeMetadata(output),
2578
- };
2579
- break;
2580
- case "ValidationException":
2581
- case "com.amazonaws.ivs#ValidationException":
2582
- response = {
2583
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2584
- name: errorCode,
2585
- $metadata: deserializeMetadata(output),
2586
- };
2587
- break;
2588
- default:
2589
- const parsedBody = parsedOutput.body;
2590
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2591
- response = {
2592
- ...parsedBody,
2593
- name: `${errorCode}`,
2594
- message: parsedBody.message || parsedBody.Message || errorCode,
2595
- $fault: "client",
2596
- $metadata: deserializeMetadata(output),
2597
- } as any;
2598
- }
2599
- const message = response.message || response.Message || errorCode;
2600
- response.message = message;
2601
- delete response.Message;
2602
- return Promise.reject(Object.assign(new Error(message), response));
2603
- };
2604
-
2605
- export const deserializeAws_restJson1UntagResourceCommand = async (
2606
- output: __HttpResponse,
2607
- context: __SerdeContext
2608
- ): Promise<UntagResourceCommandOutput> => {
2609
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2610
- return deserializeAws_restJson1UntagResourceCommandError(output, context);
2611
- }
2612
- const contents: UntagResourceCommandOutput = {
2613
- $metadata: deserializeMetadata(output),
2614
- };
2615
- await collectBody(output.body, context);
2616
- return Promise.resolve(contents);
2617
- };
2618
-
2619
- const deserializeAws_restJson1UntagResourceCommandError = async (
2620
- output: __HttpResponse,
2621
- context: __SerdeContext
2622
- ): Promise<UntagResourceCommandOutput> => {
2623
- const parsedOutput: any = {
2624
- ...output,
2625
- body: await parseBody(output.body, context),
2626
- };
2627
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2628
- let errorCode = "UnknownError";
2629
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2630
- switch (errorCode) {
2631
- case "InternalServerException":
2632
- case "com.amazonaws.ivs#InternalServerException":
2633
- response = {
2634
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2635
- name: errorCode,
2636
- $metadata: deserializeMetadata(output),
2637
- };
2638
- break;
2639
- case "ResourceNotFoundException":
2640
- case "com.amazonaws.ivs#ResourceNotFoundException":
2641
- response = {
2642
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2643
- name: errorCode,
2644
- $metadata: deserializeMetadata(output),
2645
- };
2646
- break;
2647
- case "ValidationException":
2648
- case "com.amazonaws.ivs#ValidationException":
2649
- response = {
2650
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2651
- name: errorCode,
2652
- $metadata: deserializeMetadata(output),
2653
- };
2654
- break;
2655
- default:
2656
- const parsedBody = parsedOutput.body;
2657
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2658
- response = {
2659
- ...parsedBody,
2660
- name: `${errorCode}`,
2661
- message: parsedBody.message || parsedBody.Message || errorCode,
2662
- $fault: "client",
2663
- $metadata: deserializeMetadata(output),
2664
- } as any;
2665
- }
2666
- const message = response.message || response.Message || errorCode;
2667
- response.message = message;
2668
- delete response.Message;
2669
- return Promise.reject(Object.assign(new Error(message), response));
2670
- };
2671
-
2672
- export const deserializeAws_restJson1UpdateChannelCommand = async (
2673
- output: __HttpResponse,
2674
- context: __SerdeContext
2675
- ): Promise<UpdateChannelCommandOutput> => {
2676
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2677
- return deserializeAws_restJson1UpdateChannelCommandError(output, context);
2678
- }
2679
- const contents: UpdateChannelCommandOutput = {
2680
- $metadata: deserializeMetadata(output),
2681
- channel: undefined,
2682
- };
2683
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2684
- if (data.channel !== undefined && data.channel !== null) {
2685
- contents.channel = deserializeAws_restJson1Channel(data.channel, context);
2686
- }
2687
- return Promise.resolve(contents);
2688
- };
2689
-
2690
- const deserializeAws_restJson1UpdateChannelCommandError = async (
2691
- output: __HttpResponse,
2692
- context: __SerdeContext
2693
- ): Promise<UpdateChannelCommandOutput> => {
2694
- const parsedOutput: any = {
2695
- ...output,
2696
- body: await parseBody(output.body, context),
2697
- };
2698
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2699
- let errorCode = "UnknownError";
2700
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2701
- switch (errorCode) {
2702
- case "AccessDeniedException":
2703
- case "com.amazonaws.ivs#AccessDeniedException":
2704
- response = {
2705
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2706
- name: errorCode,
2707
- $metadata: deserializeMetadata(output),
2708
- };
2709
- break;
2710
- case "ConflictException":
2711
- case "com.amazonaws.ivs#ConflictException":
2712
- response = {
2713
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
2714
- name: errorCode,
2715
- $metadata: deserializeMetadata(output),
2716
- };
2717
- break;
2718
- case "PendingVerification":
2719
- case "com.amazonaws.ivs#PendingVerification":
2720
- response = {
2721
- ...(await deserializeAws_restJson1PendingVerificationResponse(parsedOutput, context)),
2722
- name: errorCode,
2723
- $metadata: deserializeMetadata(output),
2724
- };
2725
- break;
2726
- case "ResourceNotFoundException":
2727
- case "com.amazonaws.ivs#ResourceNotFoundException":
2728
- response = {
2729
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2730
- name: errorCode,
2731
- $metadata: deserializeMetadata(output),
2732
- };
2733
- break;
2734
- case "ValidationException":
2735
- case "com.amazonaws.ivs#ValidationException":
2736
- response = {
2737
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2738
- name: errorCode,
2739
- $metadata: deserializeMetadata(output),
2740
- };
2741
- break;
2742
- default:
2743
- const parsedBody = parsedOutput.body;
2744
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2745
- response = {
2746
- ...parsedBody,
2747
- name: `${errorCode}`,
2748
- message: parsedBody.message || parsedBody.Message || errorCode,
2749
- $fault: "client",
2750
- $metadata: deserializeMetadata(output),
2751
- } as any;
2752
- }
2753
- const message = response.message || response.Message || errorCode;
2754
- response.message = message;
2755
- delete response.Message;
2756
- return Promise.reject(Object.assign(new Error(message), response));
2757
- };
2758
-
2759
- const deserializeAws_restJson1AccessDeniedExceptionResponse = async (
2760
- parsedOutput: any,
2761
- context: __SerdeContext
2762
- ): Promise<AccessDeniedException> => {
2763
- const contents: AccessDeniedException = {
2764
- name: "AccessDeniedException",
2765
- $fault: "client",
2766
- $metadata: deserializeMetadata(parsedOutput),
2767
- exceptionMessage: undefined,
2768
- };
2769
- const data: any = parsedOutput.body;
2770
- if (data.exceptionMessage !== undefined && data.exceptionMessage !== null) {
2771
- contents.exceptionMessage = __expectString(data.exceptionMessage);
2772
- }
2773
- return contents;
2774
- };
2775
-
2776
- const deserializeAws_restJson1ChannelNotBroadcastingResponse = async (
2777
- parsedOutput: any,
2778
- context: __SerdeContext
2779
- ): Promise<ChannelNotBroadcasting> => {
2780
- const contents: ChannelNotBroadcasting = {
2781
- name: "ChannelNotBroadcasting",
2782
- $fault: "client",
2783
- $metadata: deserializeMetadata(parsedOutput),
2784
- exceptionMessage: undefined,
2785
- };
2786
- const data: any = parsedOutput.body;
2787
- if (data.exceptionMessage !== undefined && data.exceptionMessage !== null) {
2788
- contents.exceptionMessage = __expectString(data.exceptionMessage);
2789
- }
2790
- return contents;
2791
- };
2792
-
2793
- const deserializeAws_restJson1ConflictExceptionResponse = async (
2794
- parsedOutput: any,
2795
- context: __SerdeContext
2796
- ): Promise<ConflictException> => {
2797
- const contents: ConflictException = {
2798
- name: "ConflictException",
2799
- $fault: "client",
2800
- $metadata: deserializeMetadata(parsedOutput),
2801
- exceptionMessage: undefined,
2802
- };
2803
- const data: any = parsedOutput.body;
2804
- if (data.exceptionMessage !== undefined && data.exceptionMessage !== null) {
2805
- contents.exceptionMessage = __expectString(data.exceptionMessage);
2806
- }
2807
- return contents;
2808
- };
2809
-
2810
- const deserializeAws_restJson1InternalServerExceptionResponse = async (
2811
- parsedOutput: any,
2812
- context: __SerdeContext
2813
- ): Promise<InternalServerException> => {
2814
- const contents: InternalServerException = {
2815
- name: "InternalServerException",
2816
- $fault: "server",
2817
- $metadata: deserializeMetadata(parsedOutput),
2818
- exceptionMessage: undefined,
2819
- };
2820
- const data: any = parsedOutput.body;
2821
- if (data.exceptionMessage !== undefined && data.exceptionMessage !== null) {
2822
- contents.exceptionMessage = __expectString(data.exceptionMessage);
2823
- }
2824
- return contents;
2825
- };
2826
-
2827
- const deserializeAws_restJson1PendingVerificationResponse = async (
2828
- parsedOutput: any,
2829
- context: __SerdeContext
2830
- ): Promise<PendingVerification> => {
2831
- const contents: PendingVerification = {
2832
- name: "PendingVerification",
2833
- $fault: "client",
2834
- $metadata: deserializeMetadata(parsedOutput),
2835
- exceptionMessage: undefined,
2836
- };
2837
- const data: any = parsedOutput.body;
2838
- if (data.exceptionMessage !== undefined && data.exceptionMessage !== null) {
2839
- contents.exceptionMessage = __expectString(data.exceptionMessage);
2840
- }
2841
- return contents;
2842
- };
2843
-
2844
- const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (
2845
- parsedOutput: any,
2846
- context: __SerdeContext
2847
- ): Promise<ResourceNotFoundException> => {
2848
- const contents: ResourceNotFoundException = {
2849
- name: "ResourceNotFoundException",
2850
- $fault: "client",
2851
- $metadata: deserializeMetadata(parsedOutput),
2852
- exceptionMessage: undefined,
2853
- };
2854
- const data: any = parsedOutput.body;
2855
- if (data.exceptionMessage !== undefined && data.exceptionMessage !== null) {
2856
- contents.exceptionMessage = __expectString(data.exceptionMessage);
2857
- }
2858
- return contents;
2859
- };
2860
-
2861
- const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (
2862
- parsedOutput: any,
2863
- context: __SerdeContext
2864
- ): Promise<ServiceQuotaExceededException> => {
2865
- const contents: ServiceQuotaExceededException = {
2866
- name: "ServiceQuotaExceededException",
2867
- $fault: "client",
2868
- $metadata: deserializeMetadata(parsedOutput),
2869
- exceptionMessage: undefined,
2870
- };
2871
- const data: any = parsedOutput.body;
2872
- if (data.exceptionMessage !== undefined && data.exceptionMessage !== null) {
2873
- contents.exceptionMessage = __expectString(data.exceptionMessage);
2874
- }
2875
- return contents;
2876
- };
2877
-
2878
- const deserializeAws_restJson1StreamUnavailableResponse = async (
2879
- parsedOutput: any,
2880
- context: __SerdeContext
2881
- ): Promise<StreamUnavailable> => {
2882
- const contents: StreamUnavailable = {
2883
- name: "StreamUnavailable",
2884
- $fault: "server",
2885
- $metadata: deserializeMetadata(parsedOutput),
2886
- exceptionMessage: undefined,
2887
- };
2888
- const data: any = parsedOutput.body;
2889
- if (data.exceptionMessage !== undefined && data.exceptionMessage !== null) {
2890
- contents.exceptionMessage = __expectString(data.exceptionMessage);
2891
- }
2892
- return contents;
2893
- };
2894
-
2895
- const deserializeAws_restJson1ThrottlingExceptionResponse = async (
2896
- parsedOutput: any,
2897
- context: __SerdeContext
2898
- ): Promise<ThrottlingException> => {
2899
- const contents: ThrottlingException = {
2900
- name: "ThrottlingException",
2901
- $fault: "client",
2902
- $metadata: deserializeMetadata(parsedOutput),
2903
- exceptionMessage: undefined,
2904
- };
2905
- const data: any = parsedOutput.body;
2906
- if (data.exceptionMessage !== undefined && data.exceptionMessage !== null) {
2907
- contents.exceptionMessage = __expectString(data.exceptionMessage);
2908
- }
2909
- return contents;
2910
- };
2911
-
2912
- const deserializeAws_restJson1ValidationExceptionResponse = async (
2913
- parsedOutput: any,
2914
- context: __SerdeContext
2915
- ): Promise<ValidationException> => {
2916
- const contents: ValidationException = {
2917
- name: "ValidationException",
2918
- $fault: "client",
2919
- $metadata: deserializeMetadata(parsedOutput),
2920
- exceptionMessage: undefined,
2921
- };
2922
- const data: any = parsedOutput.body;
2923
- if (data.exceptionMessage !== undefined && data.exceptionMessage !== null) {
2924
- contents.exceptionMessage = __expectString(data.exceptionMessage);
2925
- }
2926
- return contents;
2927
- };
2928
-
2929
- const serializeAws_restJson1ChannelArnList = (input: string[], context: __SerdeContext): any => {
2930
- return input
2931
- .filter((e: any) => e != null)
2932
- .map((entry) => {
2933
- if (entry === null) {
2934
- return null as any;
2935
- }
2936
- return entry;
2937
- });
2938
- };
2939
-
2940
- const serializeAws_restJson1DestinationConfiguration = (
2941
- input: DestinationConfiguration,
2942
- context: __SerdeContext
2943
- ): any => {
2944
- return {
2945
- ...(input.s3 !== undefined &&
2946
- input.s3 !== null && { s3: serializeAws_restJson1S3DestinationConfiguration(input.s3, context) }),
2947
- };
2948
- };
2949
-
2950
- const serializeAws_restJson1S3DestinationConfiguration = (
2951
- input: S3DestinationConfiguration,
2952
- context: __SerdeContext
2953
- ): any => {
2954
- return {
2955
- ...(input.bucketName !== undefined && input.bucketName !== null && { bucketName: input.bucketName }),
2956
- };
2957
- };
2958
-
2959
- const serializeAws_restJson1StreamKeyArnList = (input: string[], context: __SerdeContext): any => {
2960
- return input
2961
- .filter((e: any) => e != null)
2962
- .map((entry) => {
2963
- if (entry === null) {
2964
- return null as any;
2965
- }
2966
- return entry;
2967
- });
2968
- };
2969
-
2970
- const serializeAws_restJson1Tags = (input: { [key: string]: string }, context: __SerdeContext): any => {
2971
- return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
2972
- if (value === null) {
2973
- return acc;
2974
- }
2975
- return {
2976
- ...acc,
2977
- [key]: value,
2978
- };
2979
- }, {});
2980
- };
2981
-
2982
- const deserializeAws_restJson1BatchError = (output: any, context: __SerdeContext): BatchError => {
2983
- return {
2984
- arn: __expectString(output.arn),
2985
- code: __expectString(output.code),
2986
- message: __expectString(output.message),
2987
- } as any;
2988
- };
2989
-
2990
- const deserializeAws_restJson1BatchErrors = (output: any, context: __SerdeContext): BatchError[] => {
2991
- return (output || [])
2992
- .filter((e: any) => e != null)
2993
- .map((entry: any) => {
2994
- if (entry === null) {
2995
- return null as any;
2996
- }
2997
- return deserializeAws_restJson1BatchError(entry, context);
2998
- });
2999
- };
3000
-
3001
- const deserializeAws_restJson1Channel = (output: any, context: __SerdeContext): Channel => {
3002
- return {
3003
- arn: __expectString(output.arn),
3004
- authorized: __expectBoolean(output.authorized),
3005
- ingestEndpoint: __expectString(output.ingestEndpoint),
3006
- latencyMode: __expectString(output.latencyMode),
3007
- name: __expectString(output.name),
3008
- playbackUrl: __expectString(output.playbackUrl),
3009
- recordingConfigurationArn: __expectString(output.recordingConfigurationArn),
3010
- tags:
3011
- output.tags !== undefined && output.tags !== null
3012
- ? deserializeAws_restJson1Tags(output.tags, context)
3013
- : undefined,
3014
- type: __expectString(output.type),
3015
- } as any;
3016
- };
3017
-
3018
- const deserializeAws_restJson1ChannelList = (output: any, context: __SerdeContext): ChannelSummary[] => {
3019
- return (output || [])
3020
- .filter((e: any) => e != null)
3021
- .map((entry: any) => {
3022
- if (entry === null) {
3023
- return null as any;
3024
- }
3025
- return deserializeAws_restJson1ChannelSummary(entry, context);
3026
- });
3027
- };
3028
-
3029
- const deserializeAws_restJson1Channels = (output: any, context: __SerdeContext): Channel[] => {
3030
- return (output || [])
3031
- .filter((e: any) => e != null)
3032
- .map((entry: any) => {
3033
- if (entry === null) {
3034
- return null as any;
3035
- }
3036
- return deserializeAws_restJson1Channel(entry, context);
3037
- });
3038
- };
3039
-
3040
- const deserializeAws_restJson1ChannelSummary = (output: any, context: __SerdeContext): ChannelSummary => {
3041
- return {
3042
- arn: __expectString(output.arn),
3043
- authorized: __expectBoolean(output.authorized),
3044
- latencyMode: __expectString(output.latencyMode),
3045
- name: __expectString(output.name),
3046
- recordingConfigurationArn: __expectString(output.recordingConfigurationArn),
3047
- tags:
3048
- output.tags !== undefined && output.tags !== null
3049
- ? deserializeAws_restJson1Tags(output.tags, context)
3050
- : undefined,
3051
- } as any;
3052
- };
3053
-
3054
- const deserializeAws_restJson1DestinationConfiguration = (
3055
- output: any,
3056
- context: __SerdeContext
3057
- ): DestinationConfiguration => {
3058
- return {
3059
- s3:
3060
- output.s3 !== undefined && output.s3 !== null
3061
- ? deserializeAws_restJson1S3DestinationConfiguration(output.s3, context)
3062
- : undefined,
3063
- } as any;
3064
- };
3065
-
3066
- const deserializeAws_restJson1PlaybackKeyPair = (output: any, context: __SerdeContext): PlaybackKeyPair => {
3067
- return {
3068
- arn: __expectString(output.arn),
3069
- fingerprint: __expectString(output.fingerprint),
3070
- name: __expectString(output.name),
3071
- tags:
3072
- output.tags !== undefined && output.tags !== null
3073
- ? deserializeAws_restJson1Tags(output.tags, context)
3074
- : undefined,
3075
- } as any;
3076
- };
3077
-
3078
- const deserializeAws_restJson1PlaybackKeyPairList = (
3079
- output: any,
3080
- context: __SerdeContext
3081
- ): PlaybackKeyPairSummary[] => {
3082
- return (output || [])
3083
- .filter((e: any) => e != null)
3084
- .map((entry: any) => {
3085
- if (entry === null) {
3086
- return null as any;
3087
- }
3088
- return deserializeAws_restJson1PlaybackKeyPairSummary(entry, context);
3089
- });
3090
- };
3091
-
3092
- const deserializeAws_restJson1PlaybackKeyPairSummary = (
3093
- output: any,
3094
- context: __SerdeContext
3095
- ): PlaybackKeyPairSummary => {
3096
- return {
3097
- arn: __expectString(output.arn),
3098
- name: __expectString(output.name),
3099
- tags:
3100
- output.tags !== undefined && output.tags !== null
3101
- ? deserializeAws_restJson1Tags(output.tags, context)
3102
- : undefined,
3103
- } as any;
3104
- };
3105
-
3106
- const deserializeAws_restJson1RecordingConfiguration = (
3107
- output: any,
3108
- context: __SerdeContext
3109
- ): RecordingConfiguration => {
3110
- return {
3111
- arn: __expectString(output.arn),
3112
- destinationConfiguration:
3113
- output.destinationConfiguration !== undefined && output.destinationConfiguration !== null
3114
- ? deserializeAws_restJson1DestinationConfiguration(output.destinationConfiguration, context)
3115
- : undefined,
3116
- name: __expectString(output.name),
3117
- state: __expectString(output.state),
3118
- tags:
3119
- output.tags !== undefined && output.tags !== null
3120
- ? deserializeAws_restJson1Tags(output.tags, context)
3121
- : undefined,
3122
- } as any;
3123
- };
3124
-
3125
- const deserializeAws_restJson1RecordingConfigurationList = (
3126
- output: any,
3127
- context: __SerdeContext
3128
- ): RecordingConfigurationSummary[] => {
3129
- return (output || [])
3130
- .filter((e: any) => e != null)
3131
- .map((entry: any) => {
3132
- if (entry === null) {
3133
- return null as any;
3134
- }
3135
- return deserializeAws_restJson1RecordingConfigurationSummary(entry, context);
3136
- });
3137
- };
3138
-
3139
- const deserializeAws_restJson1RecordingConfigurationSummary = (
3140
- output: any,
3141
- context: __SerdeContext
3142
- ): RecordingConfigurationSummary => {
3143
- return {
3144
- arn: __expectString(output.arn),
3145
- destinationConfiguration:
3146
- output.destinationConfiguration !== undefined && output.destinationConfiguration !== null
3147
- ? deserializeAws_restJson1DestinationConfiguration(output.destinationConfiguration, context)
3148
- : undefined,
3149
- name: __expectString(output.name),
3150
- state: __expectString(output.state),
3151
- tags:
3152
- output.tags !== undefined && output.tags !== null
3153
- ? deserializeAws_restJson1Tags(output.tags, context)
3154
- : undefined,
3155
- } as any;
3156
- };
3157
-
3158
- const deserializeAws_restJson1S3DestinationConfiguration = (
3159
- output: any,
3160
- context: __SerdeContext
3161
- ): S3DestinationConfiguration => {
3162
- return {
3163
- bucketName: __expectString(output.bucketName),
3164
- } as any;
3165
- };
3166
-
3167
- const deserializeAws_restJson1_Stream = (output: any, context: __SerdeContext): _Stream => {
3168
- return {
3169
- channelArn: __expectString(output.channelArn),
3170
- health: __expectString(output.health),
3171
- playbackUrl: __expectString(output.playbackUrl),
3172
- startTime:
3173
- output.startTime !== undefined && output.startTime !== null
3174
- ? __expectNonNull(__parseRfc3339DateTime(output.startTime))
3175
- : undefined,
3176
- state: __expectString(output.state),
3177
- viewerCount: __expectLong(output.viewerCount),
3178
- } as any;
3179
- };
3180
-
3181
- const deserializeAws_restJson1StreamKey = (output: any, context: __SerdeContext): StreamKey => {
3182
- return {
3183
- arn: __expectString(output.arn),
3184
- channelArn: __expectString(output.channelArn),
3185
- tags:
3186
- output.tags !== undefined && output.tags !== null
3187
- ? deserializeAws_restJson1Tags(output.tags, context)
3188
- : undefined,
3189
- value: __expectString(output.value),
3190
- } as any;
3191
- };
3192
-
3193
- const deserializeAws_restJson1StreamKeyList = (output: any, context: __SerdeContext): StreamKeySummary[] => {
3194
- return (output || [])
3195
- .filter((e: any) => e != null)
3196
- .map((entry: any) => {
3197
- if (entry === null) {
3198
- return null as any;
3199
- }
3200
- return deserializeAws_restJson1StreamKeySummary(entry, context);
3201
- });
3202
- };
3203
-
3204
- const deserializeAws_restJson1StreamKeys = (output: any, context: __SerdeContext): StreamKey[] => {
3205
- return (output || [])
3206
- .filter((e: any) => e != null)
3207
- .map((entry: any) => {
3208
- if (entry === null) {
3209
- return null as any;
3210
- }
3211
- return deserializeAws_restJson1StreamKey(entry, context);
3212
- });
3213
- };
3214
-
3215
- const deserializeAws_restJson1StreamKeySummary = (output: any, context: __SerdeContext): StreamKeySummary => {
3216
- return {
3217
- arn: __expectString(output.arn),
3218
- channelArn: __expectString(output.channelArn),
3219
- tags:
3220
- output.tags !== undefined && output.tags !== null
3221
- ? deserializeAws_restJson1Tags(output.tags, context)
3222
- : undefined,
3223
- } as any;
3224
- };
3225
-
3226
- const deserializeAws_restJson1StreamList = (output: any, context: __SerdeContext): StreamSummary[] => {
3227
- return (output || [])
3228
- .filter((e: any) => e != null)
3229
- .map((entry: any) => {
3230
- if (entry === null) {
3231
- return null as any;
3232
- }
3233
- return deserializeAws_restJson1StreamSummary(entry, context);
3234
- });
3235
- };
3236
-
3237
- const deserializeAws_restJson1StreamSummary = (output: any, context: __SerdeContext): StreamSummary => {
3238
- return {
3239
- channelArn: __expectString(output.channelArn),
3240
- health: __expectString(output.health),
3241
- startTime:
3242
- output.startTime !== undefined && output.startTime !== null
3243
- ? __expectNonNull(__parseRfc3339DateTime(output.startTime))
3244
- : undefined,
3245
- state: __expectString(output.state),
3246
- viewerCount: __expectLong(output.viewerCount),
3247
- } as any;
3248
- };
3249
-
3250
- const deserializeAws_restJson1Tags = (output: any, context: __SerdeContext): { [key: string]: string } => {
3251
- return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {
3252
- if (value === null) {
3253
- return acc;
3254
- }
3255
- return {
3256
- ...acc,
3257
- [key]: __expectString(value) as any,
3258
- };
3259
- }, {});
3260
- };
3261
-
3262
- const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
3263
- httpStatusCode: output.statusCode,
3264
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
3265
- extendedRequestId: output.headers["x-amz-id-2"],
3266
- cfId: output.headers["x-amz-cf-id"],
3267
- });
3268
-
3269
- // Collect low-level response body stream to Uint8Array.
3270
- const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
3271
- if (streamBody instanceof Uint8Array) {
3272
- return Promise.resolve(streamBody);
3273
- }
3274
- return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
3275
- };
3276
-
3277
- // Encode Uint8Array data into string with utf-8.
3278
- const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
3279
- collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
3280
-
3281
- const isSerializableHeaderValue = (value: any): boolean =>
3282
- value !== undefined &&
3283
- value !== null &&
3284
- value !== "" &&
3285
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
3286
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
3287
-
3288
- const parseBody = (streamBody: any, context: __SerdeContext): any =>
3289
- collectBodyString(streamBody, context).then((encoded) => {
3290
- if (encoded.length) {
3291
- return JSON.parse(encoded);
3292
- }
3293
- return {};
3294
- });
3295
-
3296
- /**
3297
- * Load an error code for the aws.rest-json-1.1 protocol.
3298
- */
3299
- const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => {
3300
- const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
3301
-
3302
- const sanitizeErrorCode = (rawValue: string): string => {
3303
- let cleanValue = rawValue;
3304
- if (cleanValue.indexOf(":") >= 0) {
3305
- cleanValue = cleanValue.split(":")[0];
3306
- }
3307
- if (cleanValue.indexOf("#") >= 0) {
3308
- cleanValue = cleanValue.split("#")[1];
3309
- }
3310
- return cleanValue;
3311
- };
3312
-
3313
- const headerKey = findKey(output.headers, "x-amzn-errortype");
3314
- if (headerKey !== undefined) {
3315
- return sanitizeErrorCode(output.headers[headerKey]);
3316
- }
3317
-
3318
- if (data.code !== undefined) {
3319
- return sanitizeErrorCode(data.code);
3320
- }
3321
-
3322
- if (data["__type"] !== undefined) {
3323
- return sanitizeErrorCode(data["__type"]);
3324
- }
3325
-
3326
- return "";
3327
- };