@aws-sdk/client-mediapackagev2 3.336.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 (179) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +408 -0
  3. package/dist-cjs/MediaPackageV2.js +59 -0
  4. package/dist-cjs/MediaPackageV2Client.js +40 -0
  5. package/dist-cjs/commands/CreateChannelCommand.js +45 -0
  6. package/dist-cjs/commands/CreateChannelGroupCommand.js +45 -0
  7. package/dist-cjs/commands/CreateOriginEndpointCommand.js +45 -0
  8. package/dist-cjs/commands/DeleteChannelCommand.js +45 -0
  9. package/dist-cjs/commands/DeleteChannelGroupCommand.js +45 -0
  10. package/dist-cjs/commands/DeleteChannelPolicyCommand.js +45 -0
  11. package/dist-cjs/commands/DeleteOriginEndpointCommand.js +45 -0
  12. package/dist-cjs/commands/DeleteOriginEndpointPolicyCommand.js +45 -0
  13. package/dist-cjs/commands/GetChannelCommand.js +45 -0
  14. package/dist-cjs/commands/GetChannelGroupCommand.js +45 -0
  15. package/dist-cjs/commands/GetChannelPolicyCommand.js +45 -0
  16. package/dist-cjs/commands/GetOriginEndpointCommand.js +45 -0
  17. package/dist-cjs/commands/GetOriginEndpointPolicyCommand.js +45 -0
  18. package/dist-cjs/commands/ListChannelGroupsCommand.js +45 -0
  19. package/dist-cjs/commands/ListChannelsCommand.js +45 -0
  20. package/dist-cjs/commands/ListOriginEndpointsCommand.js +45 -0
  21. package/dist-cjs/commands/ListTagsForResourceCommand.js +45 -0
  22. package/dist-cjs/commands/PutChannelPolicyCommand.js +45 -0
  23. package/dist-cjs/commands/PutOriginEndpointPolicyCommand.js +45 -0
  24. package/dist-cjs/commands/TagResourceCommand.js +45 -0
  25. package/dist-cjs/commands/UntagResourceCommand.js +45 -0
  26. package/dist-cjs/commands/UpdateChannelCommand.js +45 -0
  27. package/dist-cjs/commands/UpdateChannelGroupCommand.js +45 -0
  28. package/dist-cjs/commands/UpdateOriginEndpointCommand.js +45 -0
  29. package/dist-cjs/commands/index.js +27 -0
  30. package/dist-cjs/endpoint/EndpointParameters.js +12 -0
  31. package/dist-cjs/endpoint/endpointResolver.js +12 -0
  32. package/dist-cjs/endpoint/ruleset.js +7 -0
  33. package/dist-cjs/index.js +11 -0
  34. package/dist-cjs/models/MediaPackageV2ServiceException.js +11 -0
  35. package/dist-cjs/models/index.js +4 -0
  36. package/dist-cjs/models/models_0.js +203 -0
  37. package/dist-cjs/pagination/Interfaces.js +2 -0
  38. package/dist-cjs/pagination/ListChannelGroupsPaginator.js +29 -0
  39. package/dist-cjs/pagination/ListChannelsPaginator.js +29 -0
  40. package/dist-cjs/pagination/ListOriginEndpointsPaginator.js +29 -0
  41. package/dist-cjs/pagination/index.js +7 -0
  42. package/dist-cjs/protocols/Aws_restJson1.js +1885 -0
  43. package/dist-cjs/runtimeConfig.browser.js +39 -0
  44. package/dist-cjs/runtimeConfig.js +48 -0
  45. package/dist-cjs/runtimeConfig.native.js +15 -0
  46. package/dist-cjs/runtimeConfig.shared.js +21 -0
  47. package/dist-es/MediaPackageV2.js +55 -0
  48. package/dist-es/MediaPackageV2Client.js +36 -0
  49. package/dist-es/commands/CreateChannelCommand.js +41 -0
  50. package/dist-es/commands/CreateChannelGroupCommand.js +41 -0
  51. package/dist-es/commands/CreateOriginEndpointCommand.js +41 -0
  52. package/dist-es/commands/DeleteChannelCommand.js +41 -0
  53. package/dist-es/commands/DeleteChannelGroupCommand.js +41 -0
  54. package/dist-es/commands/DeleteChannelPolicyCommand.js +41 -0
  55. package/dist-es/commands/DeleteOriginEndpointCommand.js +41 -0
  56. package/dist-es/commands/DeleteOriginEndpointPolicyCommand.js +41 -0
  57. package/dist-es/commands/GetChannelCommand.js +41 -0
  58. package/dist-es/commands/GetChannelGroupCommand.js +41 -0
  59. package/dist-es/commands/GetChannelPolicyCommand.js +41 -0
  60. package/dist-es/commands/GetOriginEndpointCommand.js +41 -0
  61. package/dist-es/commands/GetOriginEndpointPolicyCommand.js +41 -0
  62. package/dist-es/commands/ListChannelGroupsCommand.js +41 -0
  63. package/dist-es/commands/ListChannelsCommand.js +41 -0
  64. package/dist-es/commands/ListOriginEndpointsCommand.js +41 -0
  65. package/dist-es/commands/ListTagsForResourceCommand.js +41 -0
  66. package/dist-es/commands/PutChannelPolicyCommand.js +41 -0
  67. package/dist-es/commands/PutOriginEndpointPolicyCommand.js +41 -0
  68. package/dist-es/commands/TagResourceCommand.js +41 -0
  69. package/dist-es/commands/UntagResourceCommand.js +41 -0
  70. package/dist-es/commands/UpdateChannelCommand.js +41 -0
  71. package/dist-es/commands/UpdateChannelGroupCommand.js +41 -0
  72. package/dist-es/commands/UpdateOriginEndpointCommand.js +41 -0
  73. package/dist-es/commands/index.js +24 -0
  74. package/dist-es/endpoint/EndpointParameters.js +8 -0
  75. package/dist-es/endpoint/endpointResolver.js +8 -0
  76. package/dist-es/endpoint/ruleset.js +4 -0
  77. package/dist-es/index.js +6 -0
  78. package/dist-es/models/MediaPackageV2ServiceException.js +7 -0
  79. package/dist-es/models/index.js +1 -0
  80. package/dist-es/models/models_0.js +193 -0
  81. package/dist-es/pagination/Interfaces.js +1 -0
  82. package/dist-es/pagination/ListChannelGroupsPaginator.js +25 -0
  83. package/dist-es/pagination/ListChannelsPaginator.js +25 -0
  84. package/dist-es/pagination/ListOriginEndpointsPaginator.js +25 -0
  85. package/dist-es/pagination/index.js +4 -0
  86. package/dist-es/protocols/Aws_restJson1.js +1834 -0
  87. package/dist-es/runtimeConfig.browser.js +34 -0
  88. package/dist-es/runtimeConfig.js +43 -0
  89. package/dist-es/runtimeConfig.native.js +11 -0
  90. package/dist-es/runtimeConfig.shared.js +17 -0
  91. package/dist-types/MediaPackageV2.d.ts +189 -0
  92. package/dist-types/MediaPackageV2Client.d.ts +197 -0
  93. package/dist-types/commands/CreateChannelCommand.d.ts +110 -0
  94. package/dist-types/commands/CreateChannelGroupCommand.d.ts +103 -0
  95. package/dist-types/commands/CreateOriginEndpointCommand.d.ts +220 -0
  96. package/dist-types/commands/DeleteChannelCommand.d.ts +83 -0
  97. package/dist-types/commands/DeleteChannelGroupCommand.d.ts +82 -0
  98. package/dist-types/commands/DeleteChannelPolicyCommand.d.ts +83 -0
  99. package/dist-types/commands/DeleteOriginEndpointCommand.d.ts +81 -0
  100. package/dist-types/commands/DeleteOriginEndpointPolicyCommand.d.ts +84 -0
  101. package/dist-types/commands/GetChannelCommand.d.ts +99 -0
  102. package/dist-types/commands/GetChannelGroupCommand.d.ts +92 -0
  103. package/dist-types/commands/GetChannelPolicyCommand.d.ts +87 -0
  104. package/dist-types/commands/GetOriginEndpointCommand.d.ts +153 -0
  105. package/dist-types/commands/GetOriginEndpointPolicyCommand.d.ts +89 -0
  106. package/dist-types/commands/ListChannelGroupsCommand.d.ts +91 -0
  107. package/dist-types/commands/ListChannelsCommand.d.ts +93 -0
  108. package/dist-types/commands/ListOriginEndpointsCommand.d.ts +113 -0
  109. package/dist-types/commands/ListTagsForResourceCommand.d.ts +74 -0
  110. package/dist-types/commands/PutChannelPolicyCommand.d.ts +87 -0
  111. package/dist-types/commands/PutOriginEndpointPolicyCommand.d.ts +88 -0
  112. package/dist-types/commands/TagResourceCommand.d.ts +78 -0
  113. package/dist-types/commands/UntagResourceCommand.d.ts +73 -0
  114. package/dist-types/commands/UpdateChannelCommand.d.ts +104 -0
  115. package/dist-types/commands/UpdateChannelGroupCommand.d.ts +97 -0
  116. package/dist-types/commands/UpdateOriginEndpointCommand.d.ts +217 -0
  117. package/dist-types/commands/index.d.ts +24 -0
  118. package/dist-types/endpoint/EndpointParameters.d.ts +20 -0
  119. package/dist-types/endpoint/endpointResolver.d.ts +5 -0
  120. package/dist-types/endpoint/ruleset.d.ts +2 -0
  121. package/dist-types/index.d.ts +6 -0
  122. package/dist-types/models/MediaPackageV2ServiceException.d.ts +12 -0
  123. package/dist-types/models/index.d.ts +1 -0
  124. package/dist-types/models/models_0.d.ts +1739 -0
  125. package/dist-types/pagination/Interfaces.d.ts +8 -0
  126. package/dist-types/pagination/ListChannelGroupsPaginator.d.ts +7 -0
  127. package/dist-types/pagination/ListChannelsPaginator.d.ts +7 -0
  128. package/dist-types/pagination/ListOriginEndpointsPaginator.d.ts +7 -0
  129. package/dist-types/pagination/index.d.ts +4 -0
  130. package/dist-types/protocols/Aws_restJson1.d.ts +218 -0
  131. package/dist-types/runtimeConfig.browser.d.ts +42 -0
  132. package/dist-types/runtimeConfig.d.ts +42 -0
  133. package/dist-types/runtimeConfig.native.d.ts +41 -0
  134. package/dist-types/runtimeConfig.shared.d.ts +18 -0
  135. package/dist-types/ts3.4/MediaPackageV2.d.ts +415 -0
  136. package/dist-types/ts3.4/MediaPackageV2Client.d.ts +259 -0
  137. package/dist-types/ts3.4/commands/CreateChannelCommand.d.ts +37 -0
  138. package/dist-types/ts3.4/commands/CreateChannelGroupCommand.d.ts +38 -0
  139. package/dist-types/ts3.4/commands/CreateOriginEndpointCommand.d.ts +41 -0
  140. package/dist-types/ts3.4/commands/DeleteChannelCommand.d.ts +37 -0
  141. package/dist-types/ts3.4/commands/DeleteChannelGroupCommand.d.ts +38 -0
  142. package/dist-types/ts3.4/commands/DeleteChannelPolicyCommand.d.ts +38 -0
  143. package/dist-types/ts3.4/commands/DeleteOriginEndpointCommand.d.ts +41 -0
  144. package/dist-types/ts3.4/commands/DeleteOriginEndpointPolicyCommand.d.ts +41 -0
  145. package/dist-types/ts3.4/commands/GetChannelCommand.d.ts +34 -0
  146. package/dist-types/ts3.4/commands/GetChannelGroupCommand.d.ts +37 -0
  147. package/dist-types/ts3.4/commands/GetChannelPolicyCommand.d.ts +37 -0
  148. package/dist-types/ts3.4/commands/GetOriginEndpointCommand.d.ts +38 -0
  149. package/dist-types/ts3.4/commands/GetOriginEndpointPolicyCommand.d.ts +41 -0
  150. package/dist-types/ts3.4/commands/ListChannelGroupsCommand.d.ts +38 -0
  151. package/dist-types/ts3.4/commands/ListChannelsCommand.d.ts +34 -0
  152. package/dist-types/ts3.4/commands/ListOriginEndpointsCommand.d.ts +38 -0
  153. package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +38 -0
  154. package/dist-types/ts3.4/commands/PutChannelPolicyCommand.d.ts +37 -0
  155. package/dist-types/ts3.4/commands/PutOriginEndpointPolicyCommand.d.ts +41 -0
  156. package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +32 -0
  157. package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +32 -0
  158. package/dist-types/ts3.4/commands/UpdateChannelCommand.d.ts +37 -0
  159. package/dist-types/ts3.4/commands/UpdateChannelGroupCommand.d.ts +38 -0
  160. package/dist-types/ts3.4/commands/UpdateOriginEndpointCommand.d.ts +41 -0
  161. package/dist-types/ts3.4/commands/index.d.ts +24 -0
  162. package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +32 -0
  163. package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
  164. package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
  165. package/dist-types/ts3.4/index.d.ts +6 -0
  166. package/dist-types/ts3.4/models/MediaPackageV2ServiceException.d.ts +7 -0
  167. package/dist-types/ts3.4/models/index.d.ts +1 -0
  168. package/dist-types/ts3.4/models/models_0.d.ts +542 -0
  169. package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
  170. package/dist-types/ts3.4/pagination/ListChannelGroupsPaginator.d.ts +11 -0
  171. package/dist-types/ts3.4/pagination/ListChannelsPaginator.d.ts +11 -0
  172. package/dist-types/ts3.4/pagination/ListOriginEndpointsPaginator.d.ts +11 -0
  173. package/dist-types/ts3.4/pagination/index.d.ts +4 -0
  174. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +293 -0
  175. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +94 -0
  176. package/dist-types/ts3.4/runtimeConfig.d.ts +91 -0
  177. package/dist-types/ts3.4/runtimeConfig.native.d.ts +85 -0
  178. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +18 -0
  179. package/package.json +101 -0
@@ -0,0 +1,1834 @@
1
+ import { _json, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, take, withBaseException, } from "@aws-sdk/smithy-client";
2
+ import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
3
+ import { MediaPackageV2ServiceException as __BaseException } from "../models/MediaPackageV2ServiceException";
4
+ import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
5
+ export const se_CreateChannelCommand = async (input, context) => {
6
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
7
+ const headers = map({}, isSerializableHeaderValue, {
8
+ "content-type": "application/json",
9
+ "x-amzn-client-token": input.ClientToken,
10
+ });
11
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channelGroup/{ChannelGroupName}/channel";
12
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelGroupName", () => input.ChannelGroupName, "{ChannelGroupName}", false);
13
+ let body;
14
+ body = JSON.stringify(take(input, {
15
+ ChannelName: [],
16
+ Description: [],
17
+ tags: [, (_) => _json(_), `Tags`],
18
+ }));
19
+ return new __HttpRequest({
20
+ protocol,
21
+ hostname,
22
+ port,
23
+ method: "POST",
24
+ headers,
25
+ path: resolvedPath,
26
+ body,
27
+ });
28
+ };
29
+ export const se_CreateChannelGroupCommand = async (input, context) => {
30
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
31
+ const headers = map({}, isSerializableHeaderValue, {
32
+ "content-type": "application/json",
33
+ "x-amzn-client-token": input.ClientToken,
34
+ });
35
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channelGroup";
36
+ let body;
37
+ body = JSON.stringify(take(input, {
38
+ ChannelGroupName: [],
39
+ Description: [],
40
+ tags: [, (_) => _json(_), `Tags`],
41
+ }));
42
+ return new __HttpRequest({
43
+ protocol,
44
+ hostname,
45
+ port,
46
+ method: "POST",
47
+ headers,
48
+ path: resolvedPath,
49
+ body,
50
+ });
51
+ };
52
+ export const se_CreateOriginEndpointCommand = async (input, context) => {
53
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
54
+ const headers = map({}, isSerializableHeaderValue, {
55
+ "content-type": "application/json",
56
+ "x-amzn-client-token": input.ClientToken,
57
+ });
58
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
59
+ "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/originEndpoint";
60
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelGroupName", () => input.ChannelGroupName, "{ChannelGroupName}", false);
61
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelName", () => input.ChannelName, "{ChannelName}", false);
62
+ let body;
63
+ body = JSON.stringify(take(input, {
64
+ ContainerType: [],
65
+ Description: [],
66
+ HlsManifests: (_) => _json(_),
67
+ LowLatencyHlsManifests: (_) => _json(_),
68
+ OriginEndpointName: [],
69
+ Segment: (_) => _json(_),
70
+ StartoverWindowSeconds: [],
71
+ Tags: (_) => _json(_),
72
+ }));
73
+ return new __HttpRequest({
74
+ protocol,
75
+ hostname,
76
+ port,
77
+ method: "POST",
78
+ headers,
79
+ path: resolvedPath,
80
+ body,
81
+ });
82
+ };
83
+ export const se_DeleteChannelCommand = async (input, context) => {
84
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
85
+ const headers = {};
86
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
87
+ "/channelGroup/{ChannelGroupName}/channel/{ChannelName}";
88
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelGroupName", () => input.ChannelGroupName, "{ChannelGroupName}", false);
89
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelName", () => input.ChannelName, "{ChannelName}", false);
90
+ let body;
91
+ return new __HttpRequest({
92
+ protocol,
93
+ hostname,
94
+ port,
95
+ method: "DELETE",
96
+ headers,
97
+ path: resolvedPath,
98
+ body,
99
+ });
100
+ };
101
+ export const se_DeleteChannelGroupCommand = async (input, context) => {
102
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
103
+ const headers = {};
104
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channelGroup/{ChannelGroupName}";
105
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelGroupName", () => input.ChannelGroupName, "{ChannelGroupName}", false);
106
+ let body;
107
+ return new __HttpRequest({
108
+ protocol,
109
+ hostname,
110
+ port,
111
+ method: "DELETE",
112
+ headers,
113
+ path: resolvedPath,
114
+ body,
115
+ });
116
+ };
117
+ export const se_DeleteChannelPolicyCommand = async (input, context) => {
118
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
119
+ const headers = {};
120
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
121
+ "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/policy";
122
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelGroupName", () => input.ChannelGroupName, "{ChannelGroupName}", false);
123
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelName", () => input.ChannelName, "{ChannelName}", false);
124
+ let body;
125
+ return new __HttpRequest({
126
+ protocol,
127
+ hostname,
128
+ port,
129
+ method: "DELETE",
130
+ headers,
131
+ path: resolvedPath,
132
+ body,
133
+ });
134
+ };
135
+ export const se_DeleteOriginEndpointCommand = async (input, context) => {
136
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
137
+ const headers = {};
138
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
139
+ "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/originEndpoint/{OriginEndpointName}";
140
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelGroupName", () => input.ChannelGroupName, "{ChannelGroupName}", false);
141
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelName", () => input.ChannelName, "{ChannelName}", false);
142
+ resolvedPath = __resolvedPath(resolvedPath, input, "OriginEndpointName", () => input.OriginEndpointName, "{OriginEndpointName}", false);
143
+ let body;
144
+ return new __HttpRequest({
145
+ protocol,
146
+ hostname,
147
+ port,
148
+ method: "DELETE",
149
+ headers,
150
+ path: resolvedPath,
151
+ body,
152
+ });
153
+ };
154
+ export const se_DeleteOriginEndpointPolicyCommand = async (input, context) => {
155
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
156
+ const headers = {};
157
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
158
+ "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/originEndpoint/{OriginEndpointName}/policy";
159
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelGroupName", () => input.ChannelGroupName, "{ChannelGroupName}", false);
160
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelName", () => input.ChannelName, "{ChannelName}", false);
161
+ resolvedPath = __resolvedPath(resolvedPath, input, "OriginEndpointName", () => input.OriginEndpointName, "{OriginEndpointName}", false);
162
+ let body;
163
+ return new __HttpRequest({
164
+ protocol,
165
+ hostname,
166
+ port,
167
+ method: "DELETE",
168
+ headers,
169
+ path: resolvedPath,
170
+ body,
171
+ });
172
+ };
173
+ export const se_GetChannelCommand = async (input, context) => {
174
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
175
+ const headers = {};
176
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
177
+ "/channelGroup/{ChannelGroupName}/channel/{ChannelName}";
178
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelGroupName", () => input.ChannelGroupName, "{ChannelGroupName}", false);
179
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelName", () => input.ChannelName, "{ChannelName}", false);
180
+ let body;
181
+ return new __HttpRequest({
182
+ protocol,
183
+ hostname,
184
+ port,
185
+ method: "GET",
186
+ headers,
187
+ path: resolvedPath,
188
+ body,
189
+ });
190
+ };
191
+ export const se_GetChannelGroupCommand = async (input, context) => {
192
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
193
+ const headers = {};
194
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channelGroup/{ChannelGroupName}";
195
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelGroupName", () => input.ChannelGroupName, "{ChannelGroupName}", false);
196
+ let body;
197
+ return new __HttpRequest({
198
+ protocol,
199
+ hostname,
200
+ port,
201
+ method: "GET",
202
+ headers,
203
+ path: resolvedPath,
204
+ body,
205
+ });
206
+ };
207
+ export const se_GetChannelPolicyCommand = async (input, context) => {
208
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
209
+ const headers = {};
210
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
211
+ "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/policy";
212
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelGroupName", () => input.ChannelGroupName, "{ChannelGroupName}", false);
213
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelName", () => input.ChannelName, "{ChannelName}", false);
214
+ let body;
215
+ return new __HttpRequest({
216
+ protocol,
217
+ hostname,
218
+ port,
219
+ method: "GET",
220
+ headers,
221
+ path: resolvedPath,
222
+ body,
223
+ });
224
+ };
225
+ export const se_GetOriginEndpointCommand = async (input, context) => {
226
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
227
+ const headers = {};
228
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
229
+ "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/originEndpoint/{OriginEndpointName}";
230
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelGroupName", () => input.ChannelGroupName, "{ChannelGroupName}", false);
231
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelName", () => input.ChannelName, "{ChannelName}", false);
232
+ resolvedPath = __resolvedPath(resolvedPath, input, "OriginEndpointName", () => input.OriginEndpointName, "{OriginEndpointName}", false);
233
+ let body;
234
+ return new __HttpRequest({
235
+ protocol,
236
+ hostname,
237
+ port,
238
+ method: "GET",
239
+ headers,
240
+ path: resolvedPath,
241
+ body,
242
+ });
243
+ };
244
+ export const se_GetOriginEndpointPolicyCommand = async (input, context) => {
245
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
246
+ const headers = {};
247
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
248
+ "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/originEndpoint/{OriginEndpointName}/policy";
249
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelGroupName", () => input.ChannelGroupName, "{ChannelGroupName}", false);
250
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelName", () => input.ChannelName, "{ChannelName}", false);
251
+ resolvedPath = __resolvedPath(resolvedPath, input, "OriginEndpointName", () => input.OriginEndpointName, "{OriginEndpointName}", false);
252
+ let body;
253
+ return new __HttpRequest({
254
+ protocol,
255
+ hostname,
256
+ port,
257
+ method: "GET",
258
+ headers,
259
+ path: resolvedPath,
260
+ body,
261
+ });
262
+ };
263
+ export const se_ListChannelGroupsCommand = async (input, context) => {
264
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
265
+ const headers = {};
266
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channelGroup";
267
+ const query = map({
268
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
269
+ nextToken: [, input.NextToken],
270
+ });
271
+ let body;
272
+ return new __HttpRequest({
273
+ protocol,
274
+ hostname,
275
+ port,
276
+ method: "GET",
277
+ headers,
278
+ path: resolvedPath,
279
+ query,
280
+ body,
281
+ });
282
+ };
283
+ export const se_ListChannelsCommand = async (input, context) => {
284
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
285
+ const headers = {};
286
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channelGroup/{ChannelGroupName}/channel";
287
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelGroupName", () => input.ChannelGroupName, "{ChannelGroupName}", false);
288
+ const query = map({
289
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
290
+ nextToken: [, input.NextToken],
291
+ });
292
+ let body;
293
+ return new __HttpRequest({
294
+ protocol,
295
+ hostname,
296
+ port,
297
+ method: "GET",
298
+ headers,
299
+ path: resolvedPath,
300
+ query,
301
+ body,
302
+ });
303
+ };
304
+ export const se_ListOriginEndpointsCommand = async (input, context) => {
305
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
306
+ const headers = {};
307
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
308
+ "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/originEndpoint";
309
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelGroupName", () => input.ChannelGroupName, "{ChannelGroupName}", false);
310
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelName", () => input.ChannelName, "{ChannelName}", false);
311
+ const query = map({
312
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
313
+ nextToken: [, input.NextToken],
314
+ });
315
+ let body;
316
+ return new __HttpRequest({
317
+ protocol,
318
+ hostname,
319
+ port,
320
+ method: "GET",
321
+ headers,
322
+ path: resolvedPath,
323
+ query,
324
+ body,
325
+ });
326
+ };
327
+ export const se_ListTagsForResourceCommand = async (input, context) => {
328
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
329
+ const headers = {};
330
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
331
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
332
+ let body;
333
+ return new __HttpRequest({
334
+ protocol,
335
+ hostname,
336
+ port,
337
+ method: "GET",
338
+ headers,
339
+ path: resolvedPath,
340
+ body,
341
+ });
342
+ };
343
+ export const se_PutChannelPolicyCommand = async (input, context) => {
344
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
345
+ const headers = {
346
+ "content-type": "application/json",
347
+ };
348
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
349
+ "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/policy";
350
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelGroupName", () => input.ChannelGroupName, "{ChannelGroupName}", false);
351
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelName", () => input.ChannelName, "{ChannelName}", false);
352
+ let body;
353
+ body = JSON.stringify(take(input, {
354
+ Policy: [],
355
+ }));
356
+ return new __HttpRequest({
357
+ protocol,
358
+ hostname,
359
+ port,
360
+ method: "PUT",
361
+ headers,
362
+ path: resolvedPath,
363
+ body,
364
+ });
365
+ };
366
+ export const se_PutOriginEndpointPolicyCommand = async (input, context) => {
367
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
368
+ const headers = {
369
+ "content-type": "application/json",
370
+ };
371
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
372
+ "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/originEndpoint/{OriginEndpointName}/policy";
373
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelGroupName", () => input.ChannelGroupName, "{ChannelGroupName}", false);
374
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelName", () => input.ChannelName, "{ChannelName}", false);
375
+ resolvedPath = __resolvedPath(resolvedPath, input, "OriginEndpointName", () => input.OriginEndpointName, "{OriginEndpointName}", false);
376
+ let body;
377
+ body = JSON.stringify(take(input, {
378
+ Policy: [],
379
+ }));
380
+ return new __HttpRequest({
381
+ protocol,
382
+ hostname,
383
+ port,
384
+ method: "POST",
385
+ headers,
386
+ path: resolvedPath,
387
+ body,
388
+ });
389
+ };
390
+ export const se_TagResourceCommand = async (input, context) => {
391
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
392
+ const headers = {
393
+ "content-type": "application/json",
394
+ };
395
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
396
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
397
+ let body;
398
+ body = JSON.stringify(take(input, {
399
+ tags: [, (_) => _json(_), `Tags`],
400
+ }));
401
+ return new __HttpRequest({
402
+ protocol,
403
+ hostname,
404
+ port,
405
+ method: "POST",
406
+ headers,
407
+ path: resolvedPath,
408
+ body,
409
+ });
410
+ };
411
+ export const se_UntagResourceCommand = async (input, context) => {
412
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
413
+ const headers = {};
414
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
415
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
416
+ const query = map({
417
+ tagKeys: [
418
+ __expectNonNull(input.TagKeys, `TagKeys`) != null,
419
+ () => (input.TagKeys || []).map((_entry) => _entry),
420
+ ],
421
+ });
422
+ let body;
423
+ return new __HttpRequest({
424
+ protocol,
425
+ hostname,
426
+ port,
427
+ method: "DELETE",
428
+ headers,
429
+ path: resolvedPath,
430
+ query,
431
+ body,
432
+ });
433
+ };
434
+ export const se_UpdateChannelCommand = async (input, context) => {
435
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
436
+ const headers = {
437
+ "content-type": "application/json",
438
+ };
439
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
440
+ "/channelGroup/{ChannelGroupName}/channel/{ChannelName}";
441
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelGroupName", () => input.ChannelGroupName, "{ChannelGroupName}", false);
442
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelName", () => input.ChannelName, "{ChannelName}", false);
443
+ let body;
444
+ body = JSON.stringify(take(input, {
445
+ Description: [],
446
+ }));
447
+ return new __HttpRequest({
448
+ protocol,
449
+ hostname,
450
+ port,
451
+ method: "PUT",
452
+ headers,
453
+ path: resolvedPath,
454
+ body,
455
+ });
456
+ };
457
+ export const se_UpdateChannelGroupCommand = async (input, context) => {
458
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
459
+ const headers = {
460
+ "content-type": "application/json",
461
+ };
462
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/channelGroup/{ChannelGroupName}";
463
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelGroupName", () => input.ChannelGroupName, "{ChannelGroupName}", false);
464
+ let body;
465
+ body = JSON.stringify(take(input, {
466
+ Description: [],
467
+ }));
468
+ return new __HttpRequest({
469
+ protocol,
470
+ hostname,
471
+ port,
472
+ method: "PUT",
473
+ headers,
474
+ path: resolvedPath,
475
+ body,
476
+ });
477
+ };
478
+ export const se_UpdateOriginEndpointCommand = async (input, context) => {
479
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
480
+ const headers = {
481
+ "content-type": "application/json",
482
+ };
483
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
484
+ "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/originEndpoint/{OriginEndpointName}";
485
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelGroupName", () => input.ChannelGroupName, "{ChannelGroupName}", false);
486
+ resolvedPath = __resolvedPath(resolvedPath, input, "ChannelName", () => input.ChannelName, "{ChannelName}", false);
487
+ resolvedPath = __resolvedPath(resolvedPath, input, "OriginEndpointName", () => input.OriginEndpointName, "{OriginEndpointName}", false);
488
+ let body;
489
+ body = JSON.stringify(take(input, {
490
+ ContainerType: [],
491
+ Description: [],
492
+ HlsManifests: (_) => _json(_),
493
+ LowLatencyHlsManifests: (_) => _json(_),
494
+ Segment: (_) => _json(_),
495
+ StartoverWindowSeconds: [],
496
+ }));
497
+ return new __HttpRequest({
498
+ protocol,
499
+ hostname,
500
+ port,
501
+ method: "PUT",
502
+ headers,
503
+ path: resolvedPath,
504
+ body,
505
+ });
506
+ };
507
+ export const de_CreateChannelCommand = async (output, context) => {
508
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
509
+ return de_CreateChannelCommandError(output, context);
510
+ }
511
+ const contents = map({
512
+ $metadata: deserializeMetadata(output),
513
+ });
514
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
515
+ const doc = take(data, {
516
+ Arn: __expectString,
517
+ ChannelGroupName: __expectString,
518
+ ChannelName: __expectString,
519
+ CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
520
+ Description: __expectString,
521
+ IngestEndpoints: _json,
522
+ ModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
523
+ Tags: _json,
524
+ });
525
+ Object.assign(contents, doc);
526
+ return contents;
527
+ };
528
+ const de_CreateChannelCommandError = async (output, context) => {
529
+ const parsedOutput = {
530
+ ...output,
531
+ body: await parseErrorBody(output.body, context),
532
+ };
533
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
534
+ switch (errorCode) {
535
+ case "AccessDeniedException":
536
+ case "com.amazonaws.mediapackagev2#AccessDeniedException":
537
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
538
+ case "ConflictException":
539
+ case "com.amazonaws.mediapackagev2#ConflictException":
540
+ throw await de_ConflictExceptionRes(parsedOutput, context);
541
+ case "InternalServerException":
542
+ case "com.amazonaws.mediapackagev2#InternalServerException":
543
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
544
+ case "ResourceNotFoundException":
545
+ case "com.amazonaws.mediapackagev2#ResourceNotFoundException":
546
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
547
+ case "ServiceQuotaExceededException":
548
+ case "com.amazonaws.mediapackagev2#ServiceQuotaExceededException":
549
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
550
+ case "ThrottlingException":
551
+ case "com.amazonaws.mediapackagev2#ThrottlingException":
552
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
553
+ case "ValidationException":
554
+ case "com.amazonaws.mediapackagev2#ValidationException":
555
+ throw await de_ValidationExceptionRes(parsedOutput, context);
556
+ default:
557
+ const parsedBody = parsedOutput.body;
558
+ return throwDefaultError({
559
+ output,
560
+ parsedBody,
561
+ errorCode,
562
+ });
563
+ }
564
+ };
565
+ export const de_CreateChannelGroupCommand = async (output, context) => {
566
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
567
+ return de_CreateChannelGroupCommandError(output, context);
568
+ }
569
+ const contents = map({
570
+ $metadata: deserializeMetadata(output),
571
+ });
572
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
573
+ const doc = take(data, {
574
+ Arn: __expectString,
575
+ ChannelGroupName: __expectString,
576
+ CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
577
+ Description: __expectString,
578
+ EgressDomain: __expectString,
579
+ ModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
580
+ Tags: _json,
581
+ });
582
+ Object.assign(contents, doc);
583
+ return contents;
584
+ };
585
+ const de_CreateChannelGroupCommandError = async (output, context) => {
586
+ const parsedOutput = {
587
+ ...output,
588
+ body: await parseErrorBody(output.body, context),
589
+ };
590
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
591
+ switch (errorCode) {
592
+ case "AccessDeniedException":
593
+ case "com.amazonaws.mediapackagev2#AccessDeniedException":
594
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
595
+ case "ConflictException":
596
+ case "com.amazonaws.mediapackagev2#ConflictException":
597
+ throw await de_ConflictExceptionRes(parsedOutput, context);
598
+ case "InternalServerException":
599
+ case "com.amazonaws.mediapackagev2#InternalServerException":
600
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
601
+ case "ResourceNotFoundException":
602
+ case "com.amazonaws.mediapackagev2#ResourceNotFoundException":
603
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
604
+ case "ServiceQuotaExceededException":
605
+ case "com.amazonaws.mediapackagev2#ServiceQuotaExceededException":
606
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
607
+ case "ThrottlingException":
608
+ case "com.amazonaws.mediapackagev2#ThrottlingException":
609
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
610
+ case "ValidationException":
611
+ case "com.amazonaws.mediapackagev2#ValidationException":
612
+ throw await de_ValidationExceptionRes(parsedOutput, context);
613
+ default:
614
+ const parsedBody = parsedOutput.body;
615
+ return throwDefaultError({
616
+ output,
617
+ parsedBody,
618
+ errorCode,
619
+ });
620
+ }
621
+ };
622
+ export const de_CreateOriginEndpointCommand = async (output, context) => {
623
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
624
+ return de_CreateOriginEndpointCommandError(output, context);
625
+ }
626
+ const contents = map({
627
+ $metadata: deserializeMetadata(output),
628
+ });
629
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
630
+ const doc = take(data, {
631
+ Arn: __expectString,
632
+ ChannelGroupName: __expectString,
633
+ ChannelName: __expectString,
634
+ ContainerType: __expectString,
635
+ CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
636
+ Description: __expectString,
637
+ HlsManifests: _json,
638
+ LowLatencyHlsManifests: _json,
639
+ ModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
640
+ OriginEndpointName: __expectString,
641
+ Segment: _json,
642
+ StartoverWindowSeconds: __expectInt32,
643
+ Tags: _json,
644
+ });
645
+ Object.assign(contents, doc);
646
+ return contents;
647
+ };
648
+ const de_CreateOriginEndpointCommandError = async (output, context) => {
649
+ const parsedOutput = {
650
+ ...output,
651
+ body: await parseErrorBody(output.body, context),
652
+ };
653
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
654
+ switch (errorCode) {
655
+ case "AccessDeniedException":
656
+ case "com.amazonaws.mediapackagev2#AccessDeniedException":
657
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
658
+ case "ConflictException":
659
+ case "com.amazonaws.mediapackagev2#ConflictException":
660
+ throw await de_ConflictExceptionRes(parsedOutput, context);
661
+ case "InternalServerException":
662
+ case "com.amazonaws.mediapackagev2#InternalServerException":
663
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
664
+ case "ResourceNotFoundException":
665
+ case "com.amazonaws.mediapackagev2#ResourceNotFoundException":
666
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
667
+ case "ServiceQuotaExceededException":
668
+ case "com.amazonaws.mediapackagev2#ServiceQuotaExceededException":
669
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
670
+ case "ThrottlingException":
671
+ case "com.amazonaws.mediapackagev2#ThrottlingException":
672
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
673
+ case "ValidationException":
674
+ case "com.amazonaws.mediapackagev2#ValidationException":
675
+ throw await de_ValidationExceptionRes(parsedOutput, context);
676
+ default:
677
+ const parsedBody = parsedOutput.body;
678
+ return throwDefaultError({
679
+ output,
680
+ parsedBody,
681
+ errorCode,
682
+ });
683
+ }
684
+ };
685
+ export const de_DeleteChannelCommand = async (output, context) => {
686
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
687
+ return de_DeleteChannelCommandError(output, context);
688
+ }
689
+ const contents = map({
690
+ $metadata: deserializeMetadata(output),
691
+ });
692
+ await collectBody(output.body, context);
693
+ return contents;
694
+ };
695
+ const de_DeleteChannelCommandError = async (output, context) => {
696
+ const parsedOutput = {
697
+ ...output,
698
+ body: await parseErrorBody(output.body, context),
699
+ };
700
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
701
+ switch (errorCode) {
702
+ case "AccessDeniedException":
703
+ case "com.amazonaws.mediapackagev2#AccessDeniedException":
704
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
705
+ case "ConflictException":
706
+ case "com.amazonaws.mediapackagev2#ConflictException":
707
+ throw await de_ConflictExceptionRes(parsedOutput, context);
708
+ case "InternalServerException":
709
+ case "com.amazonaws.mediapackagev2#InternalServerException":
710
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
711
+ case "ThrottlingException":
712
+ case "com.amazonaws.mediapackagev2#ThrottlingException":
713
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
714
+ case "ValidationException":
715
+ case "com.amazonaws.mediapackagev2#ValidationException":
716
+ throw await de_ValidationExceptionRes(parsedOutput, context);
717
+ default:
718
+ const parsedBody = parsedOutput.body;
719
+ return throwDefaultError({
720
+ output,
721
+ parsedBody,
722
+ errorCode,
723
+ });
724
+ }
725
+ };
726
+ export const de_DeleteChannelGroupCommand = async (output, context) => {
727
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
728
+ return de_DeleteChannelGroupCommandError(output, context);
729
+ }
730
+ const contents = map({
731
+ $metadata: deserializeMetadata(output),
732
+ });
733
+ await collectBody(output.body, context);
734
+ return contents;
735
+ };
736
+ const de_DeleteChannelGroupCommandError = async (output, context) => {
737
+ const parsedOutput = {
738
+ ...output,
739
+ body: await parseErrorBody(output.body, context),
740
+ };
741
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
742
+ switch (errorCode) {
743
+ case "AccessDeniedException":
744
+ case "com.amazonaws.mediapackagev2#AccessDeniedException":
745
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
746
+ case "ConflictException":
747
+ case "com.amazonaws.mediapackagev2#ConflictException":
748
+ throw await de_ConflictExceptionRes(parsedOutput, context);
749
+ case "InternalServerException":
750
+ case "com.amazonaws.mediapackagev2#InternalServerException":
751
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
752
+ case "ThrottlingException":
753
+ case "com.amazonaws.mediapackagev2#ThrottlingException":
754
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
755
+ case "ValidationException":
756
+ case "com.amazonaws.mediapackagev2#ValidationException":
757
+ throw await de_ValidationExceptionRes(parsedOutput, context);
758
+ default:
759
+ const parsedBody = parsedOutput.body;
760
+ return throwDefaultError({
761
+ output,
762
+ parsedBody,
763
+ errorCode,
764
+ });
765
+ }
766
+ };
767
+ export const de_DeleteChannelPolicyCommand = async (output, context) => {
768
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
769
+ return de_DeleteChannelPolicyCommandError(output, context);
770
+ }
771
+ const contents = map({
772
+ $metadata: deserializeMetadata(output),
773
+ });
774
+ await collectBody(output.body, context);
775
+ return contents;
776
+ };
777
+ const de_DeleteChannelPolicyCommandError = async (output, context) => {
778
+ const parsedOutput = {
779
+ ...output,
780
+ body: await parseErrorBody(output.body, context),
781
+ };
782
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
783
+ switch (errorCode) {
784
+ case "AccessDeniedException":
785
+ case "com.amazonaws.mediapackagev2#AccessDeniedException":
786
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
787
+ case "ConflictException":
788
+ case "com.amazonaws.mediapackagev2#ConflictException":
789
+ throw await de_ConflictExceptionRes(parsedOutput, context);
790
+ case "InternalServerException":
791
+ case "com.amazonaws.mediapackagev2#InternalServerException":
792
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
793
+ case "ThrottlingException":
794
+ case "com.amazonaws.mediapackagev2#ThrottlingException":
795
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
796
+ case "ValidationException":
797
+ case "com.amazonaws.mediapackagev2#ValidationException":
798
+ throw await de_ValidationExceptionRes(parsedOutput, context);
799
+ default:
800
+ const parsedBody = parsedOutput.body;
801
+ return throwDefaultError({
802
+ output,
803
+ parsedBody,
804
+ errorCode,
805
+ });
806
+ }
807
+ };
808
+ export const de_DeleteOriginEndpointCommand = async (output, context) => {
809
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
810
+ return de_DeleteOriginEndpointCommandError(output, context);
811
+ }
812
+ const contents = map({
813
+ $metadata: deserializeMetadata(output),
814
+ });
815
+ await collectBody(output.body, context);
816
+ return contents;
817
+ };
818
+ const de_DeleteOriginEndpointCommandError = async (output, context) => {
819
+ const parsedOutput = {
820
+ ...output,
821
+ body: await parseErrorBody(output.body, context),
822
+ };
823
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
824
+ switch (errorCode) {
825
+ case "AccessDeniedException":
826
+ case "com.amazonaws.mediapackagev2#AccessDeniedException":
827
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
828
+ case "InternalServerException":
829
+ case "com.amazonaws.mediapackagev2#InternalServerException":
830
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
831
+ case "ThrottlingException":
832
+ case "com.amazonaws.mediapackagev2#ThrottlingException":
833
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
834
+ case "ValidationException":
835
+ case "com.amazonaws.mediapackagev2#ValidationException":
836
+ throw await de_ValidationExceptionRes(parsedOutput, context);
837
+ default:
838
+ const parsedBody = parsedOutput.body;
839
+ return throwDefaultError({
840
+ output,
841
+ parsedBody,
842
+ errorCode,
843
+ });
844
+ }
845
+ };
846
+ export const de_DeleteOriginEndpointPolicyCommand = async (output, context) => {
847
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
848
+ return de_DeleteOriginEndpointPolicyCommandError(output, context);
849
+ }
850
+ const contents = map({
851
+ $metadata: deserializeMetadata(output),
852
+ });
853
+ await collectBody(output.body, context);
854
+ return contents;
855
+ };
856
+ const de_DeleteOriginEndpointPolicyCommandError = async (output, context) => {
857
+ const parsedOutput = {
858
+ ...output,
859
+ body: await parseErrorBody(output.body, context),
860
+ };
861
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
862
+ switch (errorCode) {
863
+ case "AccessDeniedException":
864
+ case "com.amazonaws.mediapackagev2#AccessDeniedException":
865
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
866
+ case "ConflictException":
867
+ case "com.amazonaws.mediapackagev2#ConflictException":
868
+ throw await de_ConflictExceptionRes(parsedOutput, context);
869
+ case "InternalServerException":
870
+ case "com.amazonaws.mediapackagev2#InternalServerException":
871
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
872
+ case "ThrottlingException":
873
+ case "com.amazonaws.mediapackagev2#ThrottlingException":
874
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
875
+ case "ValidationException":
876
+ case "com.amazonaws.mediapackagev2#ValidationException":
877
+ throw await de_ValidationExceptionRes(parsedOutput, context);
878
+ default:
879
+ const parsedBody = parsedOutput.body;
880
+ return throwDefaultError({
881
+ output,
882
+ parsedBody,
883
+ errorCode,
884
+ });
885
+ }
886
+ };
887
+ export const de_GetChannelCommand = async (output, context) => {
888
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
889
+ return de_GetChannelCommandError(output, context);
890
+ }
891
+ const contents = map({
892
+ $metadata: deserializeMetadata(output),
893
+ });
894
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
895
+ const doc = take(data, {
896
+ Arn: __expectString,
897
+ ChannelGroupName: __expectString,
898
+ ChannelName: __expectString,
899
+ CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
900
+ Description: __expectString,
901
+ IngestEndpoints: _json,
902
+ ModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
903
+ Tags: _json,
904
+ });
905
+ Object.assign(contents, doc);
906
+ return contents;
907
+ };
908
+ const de_GetChannelCommandError = async (output, context) => {
909
+ const parsedOutput = {
910
+ ...output,
911
+ body: await parseErrorBody(output.body, context),
912
+ };
913
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
914
+ switch (errorCode) {
915
+ case "AccessDeniedException":
916
+ case "com.amazonaws.mediapackagev2#AccessDeniedException":
917
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
918
+ case "InternalServerException":
919
+ case "com.amazonaws.mediapackagev2#InternalServerException":
920
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
921
+ case "ResourceNotFoundException":
922
+ case "com.amazonaws.mediapackagev2#ResourceNotFoundException":
923
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
924
+ case "ThrottlingException":
925
+ case "com.amazonaws.mediapackagev2#ThrottlingException":
926
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
927
+ case "ValidationException":
928
+ case "com.amazonaws.mediapackagev2#ValidationException":
929
+ throw await de_ValidationExceptionRes(parsedOutput, context);
930
+ default:
931
+ const parsedBody = parsedOutput.body;
932
+ return throwDefaultError({
933
+ output,
934
+ parsedBody,
935
+ errorCode,
936
+ });
937
+ }
938
+ };
939
+ export const de_GetChannelGroupCommand = async (output, context) => {
940
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
941
+ return de_GetChannelGroupCommandError(output, context);
942
+ }
943
+ const contents = map({
944
+ $metadata: deserializeMetadata(output),
945
+ });
946
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
947
+ const doc = take(data, {
948
+ Arn: __expectString,
949
+ ChannelGroupName: __expectString,
950
+ CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
951
+ Description: __expectString,
952
+ EgressDomain: __expectString,
953
+ ModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
954
+ Tags: [, _json, `tags`],
955
+ });
956
+ Object.assign(contents, doc);
957
+ return contents;
958
+ };
959
+ const de_GetChannelGroupCommandError = async (output, context) => {
960
+ const parsedOutput = {
961
+ ...output,
962
+ body: await parseErrorBody(output.body, context),
963
+ };
964
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
965
+ switch (errorCode) {
966
+ case "AccessDeniedException":
967
+ case "com.amazonaws.mediapackagev2#AccessDeniedException":
968
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
969
+ case "InternalServerException":
970
+ case "com.amazonaws.mediapackagev2#InternalServerException":
971
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
972
+ case "ResourceNotFoundException":
973
+ case "com.amazonaws.mediapackagev2#ResourceNotFoundException":
974
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
975
+ case "ThrottlingException":
976
+ case "com.amazonaws.mediapackagev2#ThrottlingException":
977
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
978
+ case "ValidationException":
979
+ case "com.amazonaws.mediapackagev2#ValidationException":
980
+ throw await de_ValidationExceptionRes(parsedOutput, context);
981
+ default:
982
+ const parsedBody = parsedOutput.body;
983
+ return throwDefaultError({
984
+ output,
985
+ parsedBody,
986
+ errorCode,
987
+ });
988
+ }
989
+ };
990
+ export const de_GetChannelPolicyCommand = async (output, context) => {
991
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
992
+ return de_GetChannelPolicyCommandError(output, context);
993
+ }
994
+ const contents = map({
995
+ $metadata: deserializeMetadata(output),
996
+ });
997
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
998
+ const doc = take(data, {
999
+ ChannelGroupName: __expectString,
1000
+ ChannelName: __expectString,
1001
+ Policy: __expectString,
1002
+ });
1003
+ Object.assign(contents, doc);
1004
+ return contents;
1005
+ };
1006
+ const de_GetChannelPolicyCommandError = async (output, context) => {
1007
+ const parsedOutput = {
1008
+ ...output,
1009
+ body: await parseErrorBody(output.body, context),
1010
+ };
1011
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1012
+ switch (errorCode) {
1013
+ case "AccessDeniedException":
1014
+ case "com.amazonaws.mediapackagev2#AccessDeniedException":
1015
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1016
+ case "InternalServerException":
1017
+ case "com.amazonaws.mediapackagev2#InternalServerException":
1018
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
1019
+ case "ResourceNotFoundException":
1020
+ case "com.amazonaws.mediapackagev2#ResourceNotFoundException":
1021
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1022
+ case "ThrottlingException":
1023
+ case "com.amazonaws.mediapackagev2#ThrottlingException":
1024
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
1025
+ case "ValidationException":
1026
+ case "com.amazonaws.mediapackagev2#ValidationException":
1027
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1028
+ default:
1029
+ const parsedBody = parsedOutput.body;
1030
+ return throwDefaultError({
1031
+ output,
1032
+ parsedBody,
1033
+ errorCode,
1034
+ });
1035
+ }
1036
+ };
1037
+ export const de_GetOriginEndpointCommand = async (output, context) => {
1038
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1039
+ return de_GetOriginEndpointCommandError(output, context);
1040
+ }
1041
+ const contents = map({
1042
+ $metadata: deserializeMetadata(output),
1043
+ });
1044
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1045
+ const doc = take(data, {
1046
+ Arn: __expectString,
1047
+ ChannelGroupName: __expectString,
1048
+ ChannelName: __expectString,
1049
+ ContainerType: __expectString,
1050
+ CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1051
+ Description: __expectString,
1052
+ HlsManifests: _json,
1053
+ LowLatencyHlsManifests: _json,
1054
+ ModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1055
+ OriginEndpointName: __expectString,
1056
+ Segment: _json,
1057
+ StartoverWindowSeconds: __expectInt32,
1058
+ Tags: _json,
1059
+ });
1060
+ Object.assign(contents, doc);
1061
+ return contents;
1062
+ };
1063
+ const de_GetOriginEndpointCommandError = async (output, context) => {
1064
+ const parsedOutput = {
1065
+ ...output,
1066
+ body: await parseErrorBody(output.body, context),
1067
+ };
1068
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1069
+ switch (errorCode) {
1070
+ case "AccessDeniedException":
1071
+ case "com.amazonaws.mediapackagev2#AccessDeniedException":
1072
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1073
+ case "InternalServerException":
1074
+ case "com.amazonaws.mediapackagev2#InternalServerException":
1075
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
1076
+ case "ResourceNotFoundException":
1077
+ case "com.amazonaws.mediapackagev2#ResourceNotFoundException":
1078
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1079
+ case "ThrottlingException":
1080
+ case "com.amazonaws.mediapackagev2#ThrottlingException":
1081
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
1082
+ case "ValidationException":
1083
+ case "com.amazonaws.mediapackagev2#ValidationException":
1084
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1085
+ default:
1086
+ const parsedBody = parsedOutput.body;
1087
+ return throwDefaultError({
1088
+ output,
1089
+ parsedBody,
1090
+ errorCode,
1091
+ });
1092
+ }
1093
+ };
1094
+ export const de_GetOriginEndpointPolicyCommand = async (output, context) => {
1095
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1096
+ return de_GetOriginEndpointPolicyCommandError(output, context);
1097
+ }
1098
+ const contents = map({
1099
+ $metadata: deserializeMetadata(output),
1100
+ });
1101
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1102
+ const doc = take(data, {
1103
+ ChannelGroupName: __expectString,
1104
+ ChannelName: __expectString,
1105
+ OriginEndpointName: __expectString,
1106
+ Policy: __expectString,
1107
+ });
1108
+ Object.assign(contents, doc);
1109
+ return contents;
1110
+ };
1111
+ const de_GetOriginEndpointPolicyCommandError = async (output, context) => {
1112
+ const parsedOutput = {
1113
+ ...output,
1114
+ body: await parseErrorBody(output.body, context),
1115
+ };
1116
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1117
+ switch (errorCode) {
1118
+ case "AccessDeniedException":
1119
+ case "com.amazonaws.mediapackagev2#AccessDeniedException":
1120
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1121
+ case "InternalServerException":
1122
+ case "com.amazonaws.mediapackagev2#InternalServerException":
1123
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
1124
+ case "ResourceNotFoundException":
1125
+ case "com.amazonaws.mediapackagev2#ResourceNotFoundException":
1126
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1127
+ case "ThrottlingException":
1128
+ case "com.amazonaws.mediapackagev2#ThrottlingException":
1129
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
1130
+ case "ValidationException":
1131
+ case "com.amazonaws.mediapackagev2#ValidationException":
1132
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1133
+ default:
1134
+ const parsedBody = parsedOutput.body;
1135
+ return throwDefaultError({
1136
+ output,
1137
+ parsedBody,
1138
+ errorCode,
1139
+ });
1140
+ }
1141
+ };
1142
+ export const de_ListChannelGroupsCommand = async (output, context) => {
1143
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1144
+ return de_ListChannelGroupsCommandError(output, context);
1145
+ }
1146
+ const contents = map({
1147
+ $metadata: deserializeMetadata(output),
1148
+ });
1149
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1150
+ const doc = take(data, {
1151
+ Items: (_) => de_ChannelGroupsList(_, context),
1152
+ NextToken: __expectString,
1153
+ });
1154
+ Object.assign(contents, doc);
1155
+ return contents;
1156
+ };
1157
+ const de_ListChannelGroupsCommandError = async (output, context) => {
1158
+ const parsedOutput = {
1159
+ ...output,
1160
+ body: await parseErrorBody(output.body, context),
1161
+ };
1162
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1163
+ switch (errorCode) {
1164
+ case "AccessDeniedException":
1165
+ case "com.amazonaws.mediapackagev2#AccessDeniedException":
1166
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1167
+ case "InternalServerException":
1168
+ case "com.amazonaws.mediapackagev2#InternalServerException":
1169
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
1170
+ case "ThrottlingException":
1171
+ case "com.amazonaws.mediapackagev2#ThrottlingException":
1172
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
1173
+ case "ValidationException":
1174
+ case "com.amazonaws.mediapackagev2#ValidationException":
1175
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1176
+ default:
1177
+ const parsedBody = parsedOutput.body;
1178
+ return throwDefaultError({
1179
+ output,
1180
+ parsedBody,
1181
+ errorCode,
1182
+ });
1183
+ }
1184
+ };
1185
+ export const de_ListChannelsCommand = async (output, context) => {
1186
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1187
+ return de_ListChannelsCommandError(output, context);
1188
+ }
1189
+ const contents = map({
1190
+ $metadata: deserializeMetadata(output),
1191
+ });
1192
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1193
+ const doc = take(data, {
1194
+ Items: (_) => de_ChannelList(_, context),
1195
+ NextToken: __expectString,
1196
+ });
1197
+ Object.assign(contents, doc);
1198
+ return contents;
1199
+ };
1200
+ const de_ListChannelsCommandError = async (output, context) => {
1201
+ const parsedOutput = {
1202
+ ...output,
1203
+ body: await parseErrorBody(output.body, context),
1204
+ };
1205
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1206
+ switch (errorCode) {
1207
+ case "AccessDeniedException":
1208
+ case "com.amazonaws.mediapackagev2#AccessDeniedException":
1209
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1210
+ case "InternalServerException":
1211
+ case "com.amazonaws.mediapackagev2#InternalServerException":
1212
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
1213
+ case "ThrottlingException":
1214
+ case "com.amazonaws.mediapackagev2#ThrottlingException":
1215
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
1216
+ case "ValidationException":
1217
+ case "com.amazonaws.mediapackagev2#ValidationException":
1218
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1219
+ default:
1220
+ const parsedBody = parsedOutput.body;
1221
+ return throwDefaultError({
1222
+ output,
1223
+ parsedBody,
1224
+ errorCode,
1225
+ });
1226
+ }
1227
+ };
1228
+ export const de_ListOriginEndpointsCommand = async (output, context) => {
1229
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1230
+ return de_ListOriginEndpointsCommandError(output, context);
1231
+ }
1232
+ const contents = map({
1233
+ $metadata: deserializeMetadata(output),
1234
+ });
1235
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1236
+ const doc = take(data, {
1237
+ Items: (_) => de_OriginEndpointsList(_, context),
1238
+ NextToken: __expectString,
1239
+ });
1240
+ Object.assign(contents, doc);
1241
+ return contents;
1242
+ };
1243
+ const de_ListOriginEndpointsCommandError = async (output, context) => {
1244
+ const parsedOutput = {
1245
+ ...output,
1246
+ body: await parseErrorBody(output.body, context),
1247
+ };
1248
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1249
+ switch (errorCode) {
1250
+ case "AccessDeniedException":
1251
+ case "com.amazonaws.mediapackagev2#AccessDeniedException":
1252
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1253
+ case "InternalServerException":
1254
+ case "com.amazonaws.mediapackagev2#InternalServerException":
1255
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
1256
+ case "ResourceNotFoundException":
1257
+ case "com.amazonaws.mediapackagev2#ResourceNotFoundException":
1258
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1259
+ case "ThrottlingException":
1260
+ case "com.amazonaws.mediapackagev2#ThrottlingException":
1261
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
1262
+ case "ValidationException":
1263
+ case "com.amazonaws.mediapackagev2#ValidationException":
1264
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1265
+ default:
1266
+ const parsedBody = parsedOutput.body;
1267
+ return throwDefaultError({
1268
+ output,
1269
+ parsedBody,
1270
+ errorCode,
1271
+ });
1272
+ }
1273
+ };
1274
+ export const de_ListTagsForResourceCommand = async (output, context) => {
1275
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1276
+ return de_ListTagsForResourceCommandError(output, context);
1277
+ }
1278
+ const contents = map({
1279
+ $metadata: deserializeMetadata(output),
1280
+ });
1281
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1282
+ const doc = take(data, {
1283
+ Tags: [, _json, `tags`],
1284
+ });
1285
+ Object.assign(contents, doc);
1286
+ return contents;
1287
+ };
1288
+ const de_ListTagsForResourceCommandError = async (output, context) => {
1289
+ const parsedOutput = {
1290
+ ...output,
1291
+ body: await parseErrorBody(output.body, context),
1292
+ };
1293
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1294
+ switch (errorCode) {
1295
+ case "ValidationException":
1296
+ case "com.amazonaws.mediapackagev2#ValidationException":
1297
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1298
+ default:
1299
+ const parsedBody = parsedOutput.body;
1300
+ return throwDefaultError({
1301
+ output,
1302
+ parsedBody,
1303
+ errorCode,
1304
+ });
1305
+ }
1306
+ };
1307
+ export const de_PutChannelPolicyCommand = async (output, context) => {
1308
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1309
+ return de_PutChannelPolicyCommandError(output, context);
1310
+ }
1311
+ const contents = map({
1312
+ $metadata: deserializeMetadata(output),
1313
+ });
1314
+ await collectBody(output.body, context);
1315
+ return contents;
1316
+ };
1317
+ const de_PutChannelPolicyCommandError = async (output, context) => {
1318
+ const parsedOutput = {
1319
+ ...output,
1320
+ body: await parseErrorBody(output.body, context),
1321
+ };
1322
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1323
+ switch (errorCode) {
1324
+ case "AccessDeniedException":
1325
+ case "com.amazonaws.mediapackagev2#AccessDeniedException":
1326
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1327
+ case "ConflictException":
1328
+ case "com.amazonaws.mediapackagev2#ConflictException":
1329
+ throw await de_ConflictExceptionRes(parsedOutput, context);
1330
+ case "InternalServerException":
1331
+ case "com.amazonaws.mediapackagev2#InternalServerException":
1332
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
1333
+ case "ResourceNotFoundException":
1334
+ case "com.amazonaws.mediapackagev2#ResourceNotFoundException":
1335
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1336
+ case "ThrottlingException":
1337
+ case "com.amazonaws.mediapackagev2#ThrottlingException":
1338
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
1339
+ case "ValidationException":
1340
+ case "com.amazonaws.mediapackagev2#ValidationException":
1341
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1342
+ default:
1343
+ const parsedBody = parsedOutput.body;
1344
+ return throwDefaultError({
1345
+ output,
1346
+ parsedBody,
1347
+ errorCode,
1348
+ });
1349
+ }
1350
+ };
1351
+ export const de_PutOriginEndpointPolicyCommand = async (output, context) => {
1352
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1353
+ return de_PutOriginEndpointPolicyCommandError(output, context);
1354
+ }
1355
+ const contents = map({
1356
+ $metadata: deserializeMetadata(output),
1357
+ });
1358
+ await collectBody(output.body, context);
1359
+ return contents;
1360
+ };
1361
+ const de_PutOriginEndpointPolicyCommandError = async (output, context) => {
1362
+ const parsedOutput = {
1363
+ ...output,
1364
+ body: await parseErrorBody(output.body, context),
1365
+ };
1366
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1367
+ switch (errorCode) {
1368
+ case "AccessDeniedException":
1369
+ case "com.amazonaws.mediapackagev2#AccessDeniedException":
1370
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1371
+ case "ConflictException":
1372
+ case "com.amazonaws.mediapackagev2#ConflictException":
1373
+ throw await de_ConflictExceptionRes(parsedOutput, context);
1374
+ case "InternalServerException":
1375
+ case "com.amazonaws.mediapackagev2#InternalServerException":
1376
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
1377
+ case "ResourceNotFoundException":
1378
+ case "com.amazonaws.mediapackagev2#ResourceNotFoundException":
1379
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1380
+ case "ThrottlingException":
1381
+ case "com.amazonaws.mediapackagev2#ThrottlingException":
1382
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
1383
+ case "ValidationException":
1384
+ case "com.amazonaws.mediapackagev2#ValidationException":
1385
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1386
+ default:
1387
+ const parsedBody = parsedOutput.body;
1388
+ return throwDefaultError({
1389
+ output,
1390
+ parsedBody,
1391
+ errorCode,
1392
+ });
1393
+ }
1394
+ };
1395
+ export const de_TagResourceCommand = async (output, context) => {
1396
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
1397
+ return de_TagResourceCommandError(output, context);
1398
+ }
1399
+ const contents = map({
1400
+ $metadata: deserializeMetadata(output),
1401
+ });
1402
+ await collectBody(output.body, context);
1403
+ return contents;
1404
+ };
1405
+ const de_TagResourceCommandError = async (output, context) => {
1406
+ const parsedOutput = {
1407
+ ...output,
1408
+ body: await parseErrorBody(output.body, context),
1409
+ };
1410
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1411
+ switch (errorCode) {
1412
+ case "ValidationException":
1413
+ case "com.amazonaws.mediapackagev2#ValidationException":
1414
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1415
+ default:
1416
+ const parsedBody = parsedOutput.body;
1417
+ return throwDefaultError({
1418
+ output,
1419
+ parsedBody,
1420
+ errorCode,
1421
+ });
1422
+ }
1423
+ };
1424
+ export const de_UntagResourceCommand = async (output, context) => {
1425
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
1426
+ return de_UntagResourceCommandError(output, context);
1427
+ }
1428
+ const contents = map({
1429
+ $metadata: deserializeMetadata(output),
1430
+ });
1431
+ await collectBody(output.body, context);
1432
+ return contents;
1433
+ };
1434
+ const de_UntagResourceCommandError = async (output, context) => {
1435
+ const parsedOutput = {
1436
+ ...output,
1437
+ body: await parseErrorBody(output.body, context),
1438
+ };
1439
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1440
+ switch (errorCode) {
1441
+ case "ValidationException":
1442
+ case "com.amazonaws.mediapackagev2#ValidationException":
1443
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1444
+ default:
1445
+ const parsedBody = parsedOutput.body;
1446
+ return throwDefaultError({
1447
+ output,
1448
+ parsedBody,
1449
+ errorCode,
1450
+ });
1451
+ }
1452
+ };
1453
+ export const de_UpdateChannelCommand = async (output, context) => {
1454
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1455
+ return de_UpdateChannelCommandError(output, context);
1456
+ }
1457
+ const contents = map({
1458
+ $metadata: deserializeMetadata(output),
1459
+ });
1460
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1461
+ const doc = take(data, {
1462
+ Arn: __expectString,
1463
+ ChannelGroupName: __expectString,
1464
+ ChannelName: __expectString,
1465
+ CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1466
+ Description: __expectString,
1467
+ IngestEndpoints: _json,
1468
+ ModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1469
+ Tags: [, _json, `tags`],
1470
+ });
1471
+ Object.assign(contents, doc);
1472
+ return contents;
1473
+ };
1474
+ const de_UpdateChannelCommandError = async (output, context) => {
1475
+ const parsedOutput = {
1476
+ ...output,
1477
+ body: await parseErrorBody(output.body, context),
1478
+ };
1479
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1480
+ switch (errorCode) {
1481
+ case "AccessDeniedException":
1482
+ case "com.amazonaws.mediapackagev2#AccessDeniedException":
1483
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1484
+ case "ConflictException":
1485
+ case "com.amazonaws.mediapackagev2#ConflictException":
1486
+ throw await de_ConflictExceptionRes(parsedOutput, context);
1487
+ case "InternalServerException":
1488
+ case "com.amazonaws.mediapackagev2#InternalServerException":
1489
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
1490
+ case "ResourceNotFoundException":
1491
+ case "com.amazonaws.mediapackagev2#ResourceNotFoundException":
1492
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1493
+ case "ThrottlingException":
1494
+ case "com.amazonaws.mediapackagev2#ThrottlingException":
1495
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
1496
+ case "ValidationException":
1497
+ case "com.amazonaws.mediapackagev2#ValidationException":
1498
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1499
+ default:
1500
+ const parsedBody = parsedOutput.body;
1501
+ return throwDefaultError({
1502
+ output,
1503
+ parsedBody,
1504
+ errorCode,
1505
+ });
1506
+ }
1507
+ };
1508
+ export const de_UpdateChannelGroupCommand = async (output, context) => {
1509
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1510
+ return de_UpdateChannelGroupCommandError(output, context);
1511
+ }
1512
+ const contents = map({
1513
+ $metadata: deserializeMetadata(output),
1514
+ });
1515
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1516
+ const doc = take(data, {
1517
+ Arn: __expectString,
1518
+ ChannelGroupName: __expectString,
1519
+ CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1520
+ Description: __expectString,
1521
+ EgressDomain: __expectString,
1522
+ ModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1523
+ Tags: [, _json, `tags`],
1524
+ });
1525
+ Object.assign(contents, doc);
1526
+ return contents;
1527
+ };
1528
+ const de_UpdateChannelGroupCommandError = async (output, context) => {
1529
+ const parsedOutput = {
1530
+ ...output,
1531
+ body: await parseErrorBody(output.body, context),
1532
+ };
1533
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1534
+ switch (errorCode) {
1535
+ case "AccessDeniedException":
1536
+ case "com.amazonaws.mediapackagev2#AccessDeniedException":
1537
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1538
+ case "ConflictException":
1539
+ case "com.amazonaws.mediapackagev2#ConflictException":
1540
+ throw await de_ConflictExceptionRes(parsedOutput, context);
1541
+ case "InternalServerException":
1542
+ case "com.amazonaws.mediapackagev2#InternalServerException":
1543
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
1544
+ case "ResourceNotFoundException":
1545
+ case "com.amazonaws.mediapackagev2#ResourceNotFoundException":
1546
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1547
+ case "ThrottlingException":
1548
+ case "com.amazonaws.mediapackagev2#ThrottlingException":
1549
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
1550
+ case "ValidationException":
1551
+ case "com.amazonaws.mediapackagev2#ValidationException":
1552
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1553
+ default:
1554
+ const parsedBody = parsedOutput.body;
1555
+ return throwDefaultError({
1556
+ output,
1557
+ parsedBody,
1558
+ errorCode,
1559
+ });
1560
+ }
1561
+ };
1562
+ export const de_UpdateOriginEndpointCommand = async (output, context) => {
1563
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1564
+ return de_UpdateOriginEndpointCommandError(output, context);
1565
+ }
1566
+ const contents = map({
1567
+ $metadata: deserializeMetadata(output),
1568
+ });
1569
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1570
+ const doc = take(data, {
1571
+ Arn: __expectString,
1572
+ ChannelGroupName: __expectString,
1573
+ ChannelName: __expectString,
1574
+ ContainerType: __expectString,
1575
+ CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1576
+ Description: __expectString,
1577
+ HlsManifests: _json,
1578
+ LowLatencyHlsManifests: _json,
1579
+ ModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1580
+ OriginEndpointName: __expectString,
1581
+ Segment: _json,
1582
+ StartoverWindowSeconds: __expectInt32,
1583
+ Tags: [, _json, `tags`],
1584
+ });
1585
+ Object.assign(contents, doc);
1586
+ return contents;
1587
+ };
1588
+ const de_UpdateOriginEndpointCommandError = async (output, context) => {
1589
+ const parsedOutput = {
1590
+ ...output,
1591
+ body: await parseErrorBody(output.body, context),
1592
+ };
1593
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1594
+ switch (errorCode) {
1595
+ case "AccessDeniedException":
1596
+ case "com.amazonaws.mediapackagev2#AccessDeniedException":
1597
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1598
+ case "ConflictException":
1599
+ case "com.amazonaws.mediapackagev2#ConflictException":
1600
+ throw await de_ConflictExceptionRes(parsedOutput, context);
1601
+ case "InternalServerException":
1602
+ case "com.amazonaws.mediapackagev2#InternalServerException":
1603
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
1604
+ case "ResourceNotFoundException":
1605
+ case "com.amazonaws.mediapackagev2#ResourceNotFoundException":
1606
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1607
+ case "ServiceQuotaExceededException":
1608
+ case "com.amazonaws.mediapackagev2#ServiceQuotaExceededException":
1609
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
1610
+ case "ThrottlingException":
1611
+ case "com.amazonaws.mediapackagev2#ThrottlingException":
1612
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
1613
+ case "ValidationException":
1614
+ case "com.amazonaws.mediapackagev2#ValidationException":
1615
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1616
+ default:
1617
+ const parsedBody = parsedOutput.body;
1618
+ return throwDefaultError({
1619
+ output,
1620
+ parsedBody,
1621
+ errorCode,
1622
+ });
1623
+ }
1624
+ };
1625
+ const throwDefaultError = withBaseException(__BaseException);
1626
+ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
1627
+ const contents = map({});
1628
+ const data = parsedOutput.body;
1629
+ const doc = take(data, {
1630
+ Message: __expectString,
1631
+ });
1632
+ Object.assign(contents, doc);
1633
+ const exception = new AccessDeniedException({
1634
+ $metadata: deserializeMetadata(parsedOutput),
1635
+ ...contents,
1636
+ });
1637
+ return __decorateServiceException(exception, parsedOutput.body);
1638
+ };
1639
+ const de_ConflictExceptionRes = async (parsedOutput, context) => {
1640
+ const contents = map({});
1641
+ const data = parsedOutput.body;
1642
+ const doc = take(data, {
1643
+ ConflictExceptionType: __expectString,
1644
+ Message: __expectString,
1645
+ });
1646
+ Object.assign(contents, doc);
1647
+ const exception = new ConflictException({
1648
+ $metadata: deserializeMetadata(parsedOutput),
1649
+ ...contents,
1650
+ });
1651
+ return __decorateServiceException(exception, parsedOutput.body);
1652
+ };
1653
+ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
1654
+ const contents = map({});
1655
+ const data = parsedOutput.body;
1656
+ const doc = take(data, {
1657
+ Message: __expectString,
1658
+ });
1659
+ Object.assign(contents, doc);
1660
+ const exception = new InternalServerException({
1661
+ $metadata: deserializeMetadata(parsedOutput),
1662
+ ...contents,
1663
+ });
1664
+ return __decorateServiceException(exception, parsedOutput.body);
1665
+ };
1666
+ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
1667
+ const contents = map({});
1668
+ const data = parsedOutput.body;
1669
+ const doc = take(data, {
1670
+ Message: __expectString,
1671
+ ResourceTypeNotFound: __expectString,
1672
+ });
1673
+ Object.assign(contents, doc);
1674
+ const exception = new ResourceNotFoundException({
1675
+ $metadata: deserializeMetadata(parsedOutput),
1676
+ ...contents,
1677
+ });
1678
+ return __decorateServiceException(exception, parsedOutput.body);
1679
+ };
1680
+ const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
1681
+ const contents = map({});
1682
+ const data = parsedOutput.body;
1683
+ const doc = take(data, {
1684
+ Message: __expectString,
1685
+ });
1686
+ Object.assign(contents, doc);
1687
+ const exception = new ServiceQuotaExceededException({
1688
+ $metadata: deserializeMetadata(parsedOutput),
1689
+ ...contents,
1690
+ });
1691
+ return __decorateServiceException(exception, parsedOutput.body);
1692
+ };
1693
+ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
1694
+ const contents = map({});
1695
+ const data = parsedOutput.body;
1696
+ const doc = take(data, {
1697
+ Message: __expectString,
1698
+ });
1699
+ Object.assign(contents, doc);
1700
+ const exception = new ThrottlingException({
1701
+ $metadata: deserializeMetadata(parsedOutput),
1702
+ ...contents,
1703
+ });
1704
+ return __decorateServiceException(exception, parsedOutput.body);
1705
+ };
1706
+ const de_ValidationExceptionRes = async (parsedOutput, context) => {
1707
+ const contents = map({});
1708
+ const data = parsedOutput.body;
1709
+ const doc = take(data, {
1710
+ Message: __expectString,
1711
+ ValidationExceptionType: __expectString,
1712
+ });
1713
+ Object.assign(contents, doc);
1714
+ const exception = new ValidationException({
1715
+ $metadata: deserializeMetadata(parsedOutput),
1716
+ ...contents,
1717
+ });
1718
+ return __decorateServiceException(exception, parsedOutput.body);
1719
+ };
1720
+ const de_ChannelGroupListConfiguration = (output, context) => {
1721
+ return take(output, {
1722
+ Arn: __expectString,
1723
+ ChannelGroupName: __expectString,
1724
+ CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1725
+ Description: __expectString,
1726
+ ModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1727
+ });
1728
+ };
1729
+ const de_ChannelGroupsList = (output, context) => {
1730
+ const retVal = (output || [])
1731
+ .filter((e) => e != null)
1732
+ .map((entry) => {
1733
+ return de_ChannelGroupListConfiguration(entry, context);
1734
+ });
1735
+ return retVal;
1736
+ };
1737
+ const de_ChannelList = (output, context) => {
1738
+ const retVal = (output || [])
1739
+ .filter((e) => e != null)
1740
+ .map((entry) => {
1741
+ return de_ChannelListConfiguration(entry, context);
1742
+ });
1743
+ return retVal;
1744
+ };
1745
+ const de_ChannelListConfiguration = (output, context) => {
1746
+ return take(output, {
1747
+ Arn: __expectString,
1748
+ ChannelGroupName: __expectString,
1749
+ ChannelName: __expectString,
1750
+ CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1751
+ Description: __expectString,
1752
+ ModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1753
+ });
1754
+ };
1755
+ const de_OriginEndpointListConfiguration = (output, context) => {
1756
+ return take(output, {
1757
+ Arn: __expectString,
1758
+ ChannelGroupName: __expectString,
1759
+ ChannelName: __expectString,
1760
+ ContainerType: __expectString,
1761
+ CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1762
+ Description: __expectString,
1763
+ HlsManifests: _json,
1764
+ LowLatencyHlsManifests: _json,
1765
+ ModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1766
+ OriginEndpointName: __expectString,
1767
+ });
1768
+ };
1769
+ const de_OriginEndpointsList = (output, context) => {
1770
+ const retVal = (output || [])
1771
+ .filter((e) => e != null)
1772
+ .map((entry) => {
1773
+ return de_OriginEndpointListConfiguration(entry, context);
1774
+ });
1775
+ return retVal;
1776
+ };
1777
+ const deserializeMetadata = (output) => ({
1778
+ httpStatusCode: output.statusCode,
1779
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1780
+ extendedRequestId: output.headers["x-amz-id-2"],
1781
+ cfId: output.headers["x-amz-cf-id"],
1782
+ });
1783
+ const collectBody = (streamBody = new Uint8Array(), context) => {
1784
+ if (streamBody instanceof Uint8Array) {
1785
+ return Promise.resolve(streamBody);
1786
+ }
1787
+ return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1788
+ };
1789
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1790
+ const isSerializableHeaderValue = (value) => value !== undefined &&
1791
+ value !== null &&
1792
+ value !== "" &&
1793
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1794
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1795
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1796
+ if (encoded.length) {
1797
+ return JSON.parse(encoded);
1798
+ }
1799
+ return {};
1800
+ });
1801
+ const parseErrorBody = async (errorBody, context) => {
1802
+ const value = await parseBody(errorBody, context);
1803
+ value.message = value.message ?? value.Message;
1804
+ return value;
1805
+ };
1806
+ const loadRestJsonErrorCode = (output, data) => {
1807
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1808
+ const sanitizeErrorCode = (rawValue) => {
1809
+ let cleanValue = rawValue;
1810
+ if (typeof cleanValue === "number") {
1811
+ cleanValue = cleanValue.toString();
1812
+ }
1813
+ if (cleanValue.indexOf(",") >= 0) {
1814
+ cleanValue = cleanValue.split(",")[0];
1815
+ }
1816
+ if (cleanValue.indexOf(":") >= 0) {
1817
+ cleanValue = cleanValue.split(":")[0];
1818
+ }
1819
+ if (cleanValue.indexOf("#") >= 0) {
1820
+ cleanValue = cleanValue.split("#")[1];
1821
+ }
1822
+ return cleanValue;
1823
+ };
1824
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
1825
+ if (headerKey !== undefined) {
1826
+ return sanitizeErrorCode(output.headers[headerKey]);
1827
+ }
1828
+ if (data.code !== undefined) {
1829
+ return sanitizeErrorCode(data.code);
1830
+ }
1831
+ if (data["__type"] !== undefined) {
1832
+ return sanitizeErrorCode(data["__type"]);
1833
+ }
1834
+ };