@aws-sdk/client-emr-containers 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 (188) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist-cjs/EMRContainers.js +0 -25
  3. package/dist-cjs/EMRContainersClient.js +0 -30
  4. package/dist-cjs/commands/CancelJobRunCommand.js +0 -25
  5. package/dist-cjs/commands/CreateManagedEndpointCommand.js +0 -25
  6. package/dist-cjs/commands/CreateVirtualClusterCommand.js +0 -25
  7. package/dist-cjs/commands/DeleteManagedEndpointCommand.js +0 -25
  8. package/dist-cjs/commands/DeleteVirtualClusterCommand.js +0 -25
  9. package/dist-cjs/commands/DescribeJobRunCommand.js +0 -25
  10. package/dist-cjs/commands/DescribeManagedEndpointCommand.js +0 -25
  11. package/dist-cjs/commands/DescribeVirtualClusterCommand.js +0 -25
  12. package/dist-cjs/commands/ListJobRunsCommand.js +0 -25
  13. package/dist-cjs/commands/ListManagedEndpointsCommand.js +0 -25
  14. package/dist-cjs/commands/ListTagsForResourceCommand.js +0 -25
  15. package/dist-cjs/commands/ListVirtualClustersCommand.js +0 -25
  16. package/dist-cjs/commands/StartJobRunCommand.js +0 -25
  17. package/dist-cjs/commands/TagResourceCommand.js +0 -25
  18. package/dist-cjs/commands/UntagResourceCommand.js +0 -25
  19. package/dist-cjs/commands/index.js +18 -0
  20. package/dist-cjs/endpoints.js +1 -2
  21. package/dist-cjs/index.js +4 -22
  22. package/dist-cjs/models/index.js +0 -1
  23. package/dist-cjs/models/models_0.js +0 -139
  24. package/dist-cjs/pagination/Interfaces.js +0 -1
  25. package/dist-cjs/pagination/ListJobRunsPaginator.js +0 -11
  26. package/dist-cjs/pagination/ListManagedEndpointsPaginator.js +0 -11
  27. package/dist-cjs/pagination/ListVirtualClustersPaginator.js +0 -11
  28. package/dist-cjs/pagination/index.js +7 -0
  29. package/dist-cjs/protocols/Aws_restJson1.js +0 -6
  30. package/dist-cjs/runtimeConfig.browser.js +1 -6
  31. package/dist-cjs/runtimeConfig.js +2 -7
  32. package/dist-cjs/runtimeConfig.native.js +0 -4
  33. package/dist-cjs/runtimeConfig.shared.js +0 -4
  34. package/dist-es/EMRContainers.js +0 -1
  35. package/dist-es/EMRContainersClient.js +0 -1
  36. package/dist-es/commands/CancelJobRunCommand.js +0 -1
  37. package/dist-es/commands/CreateManagedEndpointCommand.js +0 -1
  38. package/dist-es/commands/CreateVirtualClusterCommand.js +0 -1
  39. package/dist-es/commands/DeleteManagedEndpointCommand.js +0 -1
  40. package/dist-es/commands/DeleteVirtualClusterCommand.js +0 -1
  41. package/dist-es/commands/DescribeJobRunCommand.js +0 -1
  42. package/dist-es/commands/DescribeManagedEndpointCommand.js +0 -1
  43. package/dist-es/commands/DescribeVirtualClusterCommand.js +0 -1
  44. package/dist-es/commands/ListJobRunsCommand.js +0 -1
  45. package/dist-es/commands/ListManagedEndpointsCommand.js +0 -1
  46. package/dist-es/commands/ListTagsForResourceCommand.js +0 -1
  47. package/dist-es/commands/ListVirtualClustersCommand.js +0 -1
  48. package/dist-es/commands/StartJobRunCommand.js +0 -1
  49. package/dist-es/commands/TagResourceCommand.js +0 -1
  50. package/dist-es/commands/UntagResourceCommand.js +0 -1
  51. package/dist-es/commands/index.js +15 -0
  52. package/dist-es/endpoints.js +1 -2
  53. package/dist-es/index.js +4 -22
  54. package/dist-es/models/index.js +0 -1
  55. package/dist-es/models/models_0.js +0 -1
  56. package/dist-es/pagination/Interfaces.js +0 -1
  57. package/dist-es/pagination/ListJobRunsPaginator.js +0 -1
  58. package/dist-es/pagination/ListManagedEndpointsPaginator.js +0 -1
  59. package/dist-es/pagination/ListVirtualClustersPaginator.js +0 -1
  60. package/dist-es/pagination/index.js +4 -0
  61. package/dist-es/protocols/Aws_restJson1.js +0 -1
  62. package/dist-es/runtimeConfig.browser.js +1 -2
  63. package/dist-es/runtimeConfig.js +2 -3
  64. package/dist-es/runtimeConfig.native.js +0 -1
  65. package/dist-es/runtimeConfig.shared.js +0 -1
  66. package/dist-types/commands/index.d.ts +15 -0
  67. package/dist-types/index.d.ts +4 -21
  68. package/dist-types/pagination/index.d.ts +4 -0
  69. package/dist-types/ts3.4/EMRContainers.d.ts +16 -69
  70. package/dist-types/ts3.4/EMRContainersClient.d.ts +24 -110
  71. package/dist-types/ts3.4/commands/CancelJobRunCommand.d.ts +2 -20
  72. package/dist-types/ts3.4/commands/CreateManagedEndpointCommand.d.ts +2 -20
  73. package/dist-types/ts3.4/commands/CreateVirtualClusterCommand.d.ts +2 -20
  74. package/dist-types/ts3.4/commands/DeleteManagedEndpointCommand.d.ts +2 -20
  75. package/dist-types/ts3.4/commands/DeleteVirtualClusterCommand.d.ts +2 -20
  76. package/dist-types/ts3.4/commands/DescribeJobRunCommand.d.ts +2 -20
  77. package/dist-types/ts3.4/commands/DescribeManagedEndpointCommand.d.ts +2 -20
  78. package/dist-types/ts3.4/commands/DescribeVirtualClusterCommand.d.ts +2 -20
  79. package/dist-types/ts3.4/commands/ListJobRunsCommand.d.ts +2 -20
  80. package/dist-types/ts3.4/commands/ListManagedEndpointsCommand.d.ts +2 -20
  81. package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +2 -20
  82. package/dist-types/ts3.4/commands/ListVirtualClustersCommand.d.ts +2 -20
  83. package/dist-types/ts3.4/commands/StartJobRunCommand.d.ts +2 -20
  84. package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +2 -20
  85. package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +2 -20
  86. package/dist-types/ts3.4/commands/index.d.ts +15 -0
  87. package/dist-types/ts3.4/index.d.ts +4 -21
  88. package/dist-types/ts3.4/models/models_0.d.ts +205 -623
  89. package/dist-types/ts3.4/pagination/index.d.ts +4 -0
  90. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -3
  91. package/dist-types/ts3.4/runtimeConfig.d.ts +1 -3
  92. package/dist-types/ts3.4/runtimeConfig.native.d.ts +1 -3
  93. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +1 -3
  94. package/package.json +33 -30
  95. package/dist-cjs/EMRContainers.js.map +0 -1
  96. package/dist-cjs/EMRContainersClient.js.map +0 -1
  97. package/dist-cjs/commands/CancelJobRunCommand.js.map +0 -1
  98. package/dist-cjs/commands/CreateManagedEndpointCommand.js.map +0 -1
  99. package/dist-cjs/commands/CreateVirtualClusterCommand.js.map +0 -1
  100. package/dist-cjs/commands/DeleteManagedEndpointCommand.js.map +0 -1
  101. package/dist-cjs/commands/DeleteVirtualClusterCommand.js.map +0 -1
  102. package/dist-cjs/commands/DescribeJobRunCommand.js.map +0 -1
  103. package/dist-cjs/commands/DescribeManagedEndpointCommand.js.map +0 -1
  104. package/dist-cjs/commands/DescribeVirtualClusterCommand.js.map +0 -1
  105. package/dist-cjs/commands/ListJobRunsCommand.js.map +0 -1
  106. package/dist-cjs/commands/ListManagedEndpointsCommand.js.map +0 -1
  107. package/dist-cjs/commands/ListTagsForResourceCommand.js.map +0 -1
  108. package/dist-cjs/commands/ListVirtualClustersCommand.js.map +0 -1
  109. package/dist-cjs/commands/StartJobRunCommand.js.map +0 -1
  110. package/dist-cjs/commands/TagResourceCommand.js.map +0 -1
  111. package/dist-cjs/commands/UntagResourceCommand.js.map +0 -1
  112. package/dist-cjs/endpoints.js.map +0 -1
  113. package/dist-cjs/index.js.map +0 -1
  114. package/dist-cjs/models/index.js.map +0 -1
  115. package/dist-cjs/models/models_0.js.map +0 -1
  116. package/dist-cjs/pagination/Interfaces.js.map +0 -1
  117. package/dist-cjs/pagination/ListJobRunsPaginator.js.map +0 -1
  118. package/dist-cjs/pagination/ListManagedEndpointsPaginator.js.map +0 -1
  119. package/dist-cjs/pagination/ListVirtualClustersPaginator.js.map +0 -1
  120. package/dist-cjs/protocols/Aws_restJson1.js.map +0 -1
  121. package/dist-cjs/runtimeConfig.browser.js.map +0 -1
  122. package/dist-cjs/runtimeConfig.js.map +0 -1
  123. package/dist-cjs/runtimeConfig.native.js.map +0 -1
  124. package/dist-cjs/runtimeConfig.shared.js.map +0 -1
  125. package/dist-es/EMRContainers.js.map +0 -1
  126. package/dist-es/EMRContainersClient.js.map +0 -1
  127. package/dist-es/commands/CancelJobRunCommand.js.map +0 -1
  128. package/dist-es/commands/CreateManagedEndpointCommand.js.map +0 -1
  129. package/dist-es/commands/CreateVirtualClusterCommand.js.map +0 -1
  130. package/dist-es/commands/DeleteManagedEndpointCommand.js.map +0 -1
  131. package/dist-es/commands/DeleteVirtualClusterCommand.js.map +0 -1
  132. package/dist-es/commands/DescribeJobRunCommand.js.map +0 -1
  133. package/dist-es/commands/DescribeManagedEndpointCommand.js.map +0 -1
  134. package/dist-es/commands/DescribeVirtualClusterCommand.js.map +0 -1
  135. package/dist-es/commands/ListJobRunsCommand.js.map +0 -1
  136. package/dist-es/commands/ListManagedEndpointsCommand.js.map +0 -1
  137. package/dist-es/commands/ListTagsForResourceCommand.js.map +0 -1
  138. package/dist-es/commands/ListVirtualClustersCommand.js.map +0 -1
  139. package/dist-es/commands/StartJobRunCommand.js.map +0 -1
  140. package/dist-es/commands/TagResourceCommand.js.map +0 -1
  141. package/dist-es/commands/UntagResourceCommand.js.map +0 -1
  142. package/dist-es/endpoints.js.map +0 -1
  143. package/dist-es/index.js.map +0 -1
  144. package/dist-es/models/index.js.map +0 -1
  145. package/dist-es/models/models_0.js.map +0 -1
  146. package/dist-es/pagination/Interfaces.js.map +0 -1
  147. package/dist-es/pagination/ListJobRunsPaginator.js.map +0 -1
  148. package/dist-es/pagination/ListManagedEndpointsPaginator.js.map +0 -1
  149. package/dist-es/pagination/ListVirtualClustersPaginator.js.map +0 -1
  150. package/dist-es/protocols/Aws_restJson1.js.map +0 -1
  151. package/dist-es/runtimeConfig.browser.js.map +0 -1
  152. package/dist-es/runtimeConfig.js.map +0 -1
  153. package/dist-es/runtimeConfig.native.js.map +0 -1
  154. package/dist-es/runtimeConfig.shared.js.map +0 -1
  155. package/jest.config.js +0 -4
  156. package/src/EMRContainers.ts +0 -551
  157. package/src/EMRContainersClient.ts +0 -329
  158. package/src/commands/CancelJobRunCommand.ts +0 -95
  159. package/src/commands/CreateManagedEndpointCommand.ts +0 -95
  160. package/src/commands/CreateVirtualClusterCommand.ts +0 -95
  161. package/src/commands/DeleteManagedEndpointCommand.ts +0 -95
  162. package/src/commands/DeleteVirtualClusterCommand.ts +0 -95
  163. package/src/commands/DescribeJobRunCommand.ts +0 -95
  164. package/src/commands/DescribeManagedEndpointCommand.ts +0 -95
  165. package/src/commands/DescribeVirtualClusterCommand.ts +0 -95
  166. package/src/commands/ListJobRunsCommand.ts +0 -95
  167. package/src/commands/ListManagedEndpointsCommand.ts +0 -95
  168. package/src/commands/ListTagsForResourceCommand.ts +0 -95
  169. package/src/commands/ListVirtualClustersCommand.ts +0 -95
  170. package/src/commands/StartJobRunCommand.ts +0 -95
  171. package/src/commands/TagResourceCommand.ts +0 -95
  172. package/src/commands/UntagResourceCommand.ts +0 -95
  173. package/src/endpoints.ts +0 -83
  174. package/src/index.ts +0 -22
  175. package/src/models/index.ts +0 -1
  176. package/src/models/models_0.ts +0 -1388
  177. package/src/pagination/Interfaces.ts +0 -8
  178. package/src/pagination/ListJobRunsPaginator.ts +0 -55
  179. package/src/pagination/ListManagedEndpointsPaginator.ts +0 -59
  180. package/src/pagination/ListVirtualClustersPaginator.ts +0 -59
  181. package/src/protocols/Aws_restJson1.ts +0 -2265
  182. package/src/runtimeConfig.browser.ts +0 -41
  183. package/src/runtimeConfig.native.ts +0 -17
  184. package/src/runtimeConfig.shared.ts +0 -17
  185. package/src/runtimeConfig.ts +0 -46
  186. package/tsconfig.es.json +0 -10
  187. package/tsconfig.json +0 -33
  188. package/tsconfig.types.json +0 -9
@@ -1,2265 +0,0 @@
1
- import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
2
- import {
3
- expectNonNull as __expectNonNull,
4
- expectNumber as __expectNumber,
5
- expectObject as __expectObject,
6
- expectString as __expectString,
7
- expectUnion as __expectUnion,
8
- extendedEncodeURIComponent as __extendedEncodeURIComponent,
9
- parseEpochTimestamp as __parseEpochTimestamp,
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
- import { v4 as generateIdempotencyToken } from "uuid";
19
-
20
- import { CancelJobRunCommandInput, CancelJobRunCommandOutput } from "../commands/CancelJobRunCommand";
21
- import {
22
- CreateManagedEndpointCommandInput,
23
- CreateManagedEndpointCommandOutput,
24
- } from "../commands/CreateManagedEndpointCommand";
25
- import {
26
- CreateVirtualClusterCommandInput,
27
- CreateVirtualClusterCommandOutput,
28
- } from "../commands/CreateVirtualClusterCommand";
29
- import {
30
- DeleteManagedEndpointCommandInput,
31
- DeleteManagedEndpointCommandOutput,
32
- } from "../commands/DeleteManagedEndpointCommand";
33
- import {
34
- DeleteVirtualClusterCommandInput,
35
- DeleteVirtualClusterCommandOutput,
36
- } from "../commands/DeleteVirtualClusterCommand";
37
- import { DescribeJobRunCommandInput, DescribeJobRunCommandOutput } from "../commands/DescribeJobRunCommand";
38
- import {
39
- DescribeManagedEndpointCommandInput,
40
- DescribeManagedEndpointCommandOutput,
41
- } from "../commands/DescribeManagedEndpointCommand";
42
- import {
43
- DescribeVirtualClusterCommandInput,
44
- DescribeVirtualClusterCommandOutput,
45
- } from "../commands/DescribeVirtualClusterCommand";
46
- import { ListJobRunsCommandInput, ListJobRunsCommandOutput } from "../commands/ListJobRunsCommand";
47
- import {
48
- ListManagedEndpointsCommandInput,
49
- ListManagedEndpointsCommandOutput,
50
- } from "../commands/ListManagedEndpointsCommand";
51
- import {
52
- ListTagsForResourceCommandInput,
53
- ListTagsForResourceCommandOutput,
54
- } from "../commands/ListTagsForResourceCommand";
55
- import {
56
- ListVirtualClustersCommandInput,
57
- ListVirtualClustersCommandOutput,
58
- } from "../commands/ListVirtualClustersCommand";
59
- import { StartJobRunCommandInput, StartJobRunCommandOutput } from "../commands/StartJobRunCommand";
60
- import { TagResourceCommandInput, TagResourceCommandOutput } from "../commands/TagResourceCommand";
61
- import { UntagResourceCommandInput, UntagResourceCommandOutput } from "../commands/UntagResourceCommand";
62
- import {
63
- CloudWatchMonitoringConfiguration,
64
- Configuration,
65
- ConfigurationOverrides,
66
- ContainerInfo,
67
- ContainerProvider,
68
- EksInfo,
69
- Endpoint,
70
- InternalServerException,
71
- JobDriver,
72
- JobRun,
73
- MonitoringConfiguration,
74
- ResourceNotFoundException,
75
- S3MonitoringConfiguration,
76
- SparkSubmitJobDriver,
77
- ValidationException,
78
- VirtualCluster,
79
- } from "../models/models_0";
80
-
81
- export const serializeAws_restJson1CancelJobRunCommand = async (
82
- input: CancelJobRunCommandInput,
83
- context: __SerdeContext
84
- ): Promise<__HttpRequest> => {
85
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
86
- const headers: any = {};
87
- let resolvedPath =
88
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
89
- "/virtualclusters/{virtualClusterId}/jobruns/{id}";
90
- if (input.id !== undefined) {
91
- const labelValue: string = input.id;
92
- if (labelValue.length <= 0) {
93
- throw new Error("Empty value provided for input HTTP label: id.");
94
- }
95
- resolvedPath = resolvedPath.replace("{id}", __extendedEncodeURIComponent(labelValue));
96
- } else {
97
- throw new Error("No value provided for input HTTP label: id.");
98
- }
99
- if (input.virtualClusterId !== undefined) {
100
- const labelValue: string = input.virtualClusterId;
101
- if (labelValue.length <= 0) {
102
- throw new Error("Empty value provided for input HTTP label: virtualClusterId.");
103
- }
104
- resolvedPath = resolvedPath.replace("{virtualClusterId}", __extendedEncodeURIComponent(labelValue));
105
- } else {
106
- throw new Error("No value provided for input HTTP label: virtualClusterId.");
107
- }
108
- let body: any;
109
- return new __HttpRequest({
110
- protocol,
111
- hostname,
112
- port,
113
- method: "DELETE",
114
- headers,
115
- path: resolvedPath,
116
- body,
117
- });
118
- };
119
-
120
- export const serializeAws_restJson1CreateManagedEndpointCommand = async (
121
- input: CreateManagedEndpointCommandInput,
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
- let resolvedPath =
129
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
130
- "/virtualclusters/{virtualClusterId}/endpoints";
131
- if (input.virtualClusterId !== undefined) {
132
- const labelValue: string = input.virtualClusterId;
133
- if (labelValue.length <= 0) {
134
- throw new Error("Empty value provided for input HTTP label: virtualClusterId.");
135
- }
136
- resolvedPath = resolvedPath.replace("{virtualClusterId}", __extendedEncodeURIComponent(labelValue));
137
- } else {
138
- throw new Error("No value provided for input HTTP label: virtualClusterId.");
139
- }
140
- let body: any;
141
- body = JSON.stringify({
142
- ...(input.certificateArn !== undefined &&
143
- input.certificateArn !== null && { certificateArn: input.certificateArn }),
144
- clientToken: input.clientToken ?? generateIdempotencyToken(),
145
- ...(input.configurationOverrides !== undefined &&
146
- input.configurationOverrides !== null && {
147
- configurationOverrides: serializeAws_restJson1ConfigurationOverrides(input.configurationOverrides, context),
148
- }),
149
- ...(input.executionRoleArn !== undefined &&
150
- input.executionRoleArn !== null && { executionRoleArn: input.executionRoleArn }),
151
- ...(input.name !== undefined && input.name !== null && { name: input.name }),
152
- ...(input.releaseLabel !== undefined && input.releaseLabel !== null && { releaseLabel: input.releaseLabel }),
153
- ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
154
- ...(input.type !== undefined && input.type !== null && { type: input.type }),
155
- });
156
- return new __HttpRequest({
157
- protocol,
158
- hostname,
159
- port,
160
- method: "POST",
161
- headers,
162
- path: resolvedPath,
163
- body,
164
- });
165
- };
166
-
167
- export const serializeAws_restJson1CreateVirtualClusterCommand = async (
168
- input: CreateVirtualClusterCommandInput,
169
- context: __SerdeContext
170
- ): Promise<__HttpRequest> => {
171
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
172
- const headers: any = {
173
- "content-type": "application/json",
174
- };
175
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/virtualclusters";
176
- let body: any;
177
- body = JSON.stringify({
178
- clientToken: input.clientToken ?? generateIdempotencyToken(),
179
- ...(input.containerProvider !== undefined &&
180
- input.containerProvider !== null && {
181
- containerProvider: serializeAws_restJson1ContainerProvider(input.containerProvider, context),
182
- }),
183
- ...(input.name !== undefined && input.name !== null && { name: input.name }),
184
- ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
185
- });
186
- return new __HttpRequest({
187
- protocol,
188
- hostname,
189
- port,
190
- method: "POST",
191
- headers,
192
- path: resolvedPath,
193
- body,
194
- });
195
- };
196
-
197
- export const serializeAws_restJson1DeleteManagedEndpointCommand = async (
198
- input: DeleteManagedEndpointCommandInput,
199
- context: __SerdeContext
200
- ): Promise<__HttpRequest> => {
201
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
202
- const headers: any = {};
203
- let resolvedPath =
204
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
205
- "/virtualclusters/{virtualClusterId}/endpoints/{id}";
206
- if (input.id !== undefined) {
207
- const labelValue: string = input.id;
208
- if (labelValue.length <= 0) {
209
- throw new Error("Empty value provided for input HTTP label: id.");
210
- }
211
- resolvedPath = resolvedPath.replace("{id}", __extendedEncodeURIComponent(labelValue));
212
- } else {
213
- throw new Error("No value provided for input HTTP label: id.");
214
- }
215
- if (input.virtualClusterId !== undefined) {
216
- const labelValue: string = input.virtualClusterId;
217
- if (labelValue.length <= 0) {
218
- throw new Error("Empty value provided for input HTTP label: virtualClusterId.");
219
- }
220
- resolvedPath = resolvedPath.replace("{virtualClusterId}", __extendedEncodeURIComponent(labelValue));
221
- } else {
222
- throw new Error("No value provided for input HTTP label: virtualClusterId.");
223
- }
224
- let body: any;
225
- return new __HttpRequest({
226
- protocol,
227
- hostname,
228
- port,
229
- method: "DELETE",
230
- headers,
231
- path: resolvedPath,
232
- body,
233
- });
234
- };
235
-
236
- export const serializeAws_restJson1DeleteVirtualClusterCommand = async (
237
- input: DeleteVirtualClusterCommandInput,
238
- context: __SerdeContext
239
- ): Promise<__HttpRequest> => {
240
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
241
- const headers: any = {};
242
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/virtualclusters/{id}";
243
- if (input.id !== undefined) {
244
- const labelValue: string = input.id;
245
- if (labelValue.length <= 0) {
246
- throw new Error("Empty value provided for input HTTP label: id.");
247
- }
248
- resolvedPath = resolvedPath.replace("{id}", __extendedEncodeURIComponent(labelValue));
249
- } else {
250
- throw new Error("No value provided for input HTTP label: id.");
251
- }
252
- let body: any;
253
- return new __HttpRequest({
254
- protocol,
255
- hostname,
256
- port,
257
- method: "DELETE",
258
- headers,
259
- path: resolvedPath,
260
- body,
261
- });
262
- };
263
-
264
- export const serializeAws_restJson1DescribeJobRunCommand = async (
265
- input: DescribeJobRunCommandInput,
266
- context: __SerdeContext
267
- ): Promise<__HttpRequest> => {
268
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
269
- const headers: any = {};
270
- let resolvedPath =
271
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
272
- "/virtualclusters/{virtualClusterId}/jobruns/{id}";
273
- if (input.id !== undefined) {
274
- const labelValue: string = input.id;
275
- if (labelValue.length <= 0) {
276
- throw new Error("Empty value provided for input HTTP label: id.");
277
- }
278
- resolvedPath = resolvedPath.replace("{id}", __extendedEncodeURIComponent(labelValue));
279
- } else {
280
- throw new Error("No value provided for input HTTP label: id.");
281
- }
282
- if (input.virtualClusterId !== undefined) {
283
- const labelValue: string = input.virtualClusterId;
284
- if (labelValue.length <= 0) {
285
- throw new Error("Empty value provided for input HTTP label: virtualClusterId.");
286
- }
287
- resolvedPath = resolvedPath.replace("{virtualClusterId}", __extendedEncodeURIComponent(labelValue));
288
- } else {
289
- throw new Error("No value provided for input HTTP label: virtualClusterId.");
290
- }
291
- let body: any;
292
- return new __HttpRequest({
293
- protocol,
294
- hostname,
295
- port,
296
- method: "GET",
297
- headers,
298
- path: resolvedPath,
299
- body,
300
- });
301
- };
302
-
303
- export const serializeAws_restJson1DescribeManagedEndpointCommand = async (
304
- input: DescribeManagedEndpointCommandInput,
305
- context: __SerdeContext
306
- ): Promise<__HttpRequest> => {
307
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
308
- const headers: any = {};
309
- let resolvedPath =
310
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
311
- "/virtualclusters/{virtualClusterId}/endpoints/{id}";
312
- if (input.id !== undefined) {
313
- const labelValue: string = input.id;
314
- if (labelValue.length <= 0) {
315
- throw new Error("Empty value provided for input HTTP label: id.");
316
- }
317
- resolvedPath = resolvedPath.replace("{id}", __extendedEncodeURIComponent(labelValue));
318
- } else {
319
- throw new Error("No value provided for input HTTP label: id.");
320
- }
321
- if (input.virtualClusterId !== undefined) {
322
- const labelValue: string = input.virtualClusterId;
323
- if (labelValue.length <= 0) {
324
- throw new Error("Empty value provided for input HTTP label: virtualClusterId.");
325
- }
326
- resolvedPath = resolvedPath.replace("{virtualClusterId}", __extendedEncodeURIComponent(labelValue));
327
- } else {
328
- throw new Error("No value provided for input HTTP label: virtualClusterId.");
329
- }
330
- let body: any;
331
- return new __HttpRequest({
332
- protocol,
333
- hostname,
334
- port,
335
- method: "GET",
336
- headers,
337
- path: resolvedPath,
338
- body,
339
- });
340
- };
341
-
342
- export const serializeAws_restJson1DescribeVirtualClusterCommand = async (
343
- input: DescribeVirtualClusterCommandInput,
344
- context: __SerdeContext
345
- ): Promise<__HttpRequest> => {
346
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
347
- const headers: any = {};
348
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/virtualclusters/{id}";
349
- if (input.id !== undefined) {
350
- const labelValue: string = input.id;
351
- if (labelValue.length <= 0) {
352
- throw new Error("Empty value provided for input HTTP label: id.");
353
- }
354
- resolvedPath = resolvedPath.replace("{id}", __extendedEncodeURIComponent(labelValue));
355
- } else {
356
- throw new Error("No value provided for input HTTP label: id.");
357
- }
358
- let body: any;
359
- return new __HttpRequest({
360
- protocol,
361
- hostname,
362
- port,
363
- method: "GET",
364
- headers,
365
- path: resolvedPath,
366
- body,
367
- });
368
- };
369
-
370
- export const serializeAws_restJson1ListJobRunsCommand = async (
371
- input: ListJobRunsCommandInput,
372
- context: __SerdeContext
373
- ): Promise<__HttpRequest> => {
374
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
375
- const headers: any = {};
376
- let resolvedPath =
377
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
378
- "/virtualclusters/{virtualClusterId}/jobruns";
379
- if (input.virtualClusterId !== undefined) {
380
- const labelValue: string = input.virtualClusterId;
381
- if (labelValue.length <= 0) {
382
- throw new Error("Empty value provided for input HTTP label: virtualClusterId.");
383
- }
384
- resolvedPath = resolvedPath.replace("{virtualClusterId}", __extendedEncodeURIComponent(labelValue));
385
- } else {
386
- throw new Error("No value provided for input HTTP label: virtualClusterId.");
387
- }
388
- const query: any = {
389
- ...(input.createdBefore !== undefined && {
390
- createdBefore: (input.createdBefore.toISOString().split(".")[0] + "Z").toString(),
391
- }),
392
- ...(input.createdAfter !== undefined && {
393
- createdAfter: (input.createdAfter.toISOString().split(".")[0] + "Z").toString(),
394
- }),
395
- ...(input.name !== undefined && { name: input.name }),
396
- ...(input.states !== undefined && { states: (input.states || []).map((_entry) => _entry as any) }),
397
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
398
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
399
- };
400
- let body: any;
401
- return new __HttpRequest({
402
- protocol,
403
- hostname,
404
- port,
405
- method: "GET",
406
- headers,
407
- path: resolvedPath,
408
- query,
409
- body,
410
- });
411
- };
412
-
413
- export const serializeAws_restJson1ListManagedEndpointsCommand = async (
414
- input: ListManagedEndpointsCommandInput,
415
- context: __SerdeContext
416
- ): Promise<__HttpRequest> => {
417
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
418
- const headers: any = {};
419
- let resolvedPath =
420
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
421
- "/virtualclusters/{virtualClusterId}/endpoints";
422
- if (input.virtualClusterId !== undefined) {
423
- const labelValue: string = input.virtualClusterId;
424
- if (labelValue.length <= 0) {
425
- throw new Error("Empty value provided for input HTTP label: virtualClusterId.");
426
- }
427
- resolvedPath = resolvedPath.replace("{virtualClusterId}", __extendedEncodeURIComponent(labelValue));
428
- } else {
429
- throw new Error("No value provided for input HTTP label: virtualClusterId.");
430
- }
431
- const query: any = {
432
- ...(input.createdBefore !== undefined && {
433
- createdBefore: (input.createdBefore.toISOString().split(".")[0] + "Z").toString(),
434
- }),
435
- ...(input.createdAfter !== undefined && {
436
- createdAfter: (input.createdAfter.toISOString().split(".")[0] + "Z").toString(),
437
- }),
438
- ...(input.types !== undefined && { types: (input.types || []).map((_entry) => _entry as any) }),
439
- ...(input.states !== undefined && { states: (input.states || []).map((_entry) => _entry as any) }),
440
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
441
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
442
- };
443
- let body: any;
444
- return new __HttpRequest({
445
- protocol,
446
- hostname,
447
- port,
448
- method: "GET",
449
- headers,
450
- path: resolvedPath,
451
- query,
452
- body,
453
- });
454
- };
455
-
456
- export const serializeAws_restJson1ListTagsForResourceCommand = async (
457
- input: ListTagsForResourceCommandInput,
458
- context: __SerdeContext
459
- ): Promise<__HttpRequest> => {
460
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
461
- const headers: any = {};
462
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
463
- if (input.resourceArn !== undefined) {
464
- const labelValue: string = input.resourceArn;
465
- if (labelValue.length <= 0) {
466
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
467
- }
468
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
469
- } else {
470
- throw new Error("No value provided for input HTTP label: resourceArn.");
471
- }
472
- let body: any;
473
- return new __HttpRequest({
474
- protocol,
475
- hostname,
476
- port,
477
- method: "GET",
478
- headers,
479
- path: resolvedPath,
480
- body,
481
- });
482
- };
483
-
484
- export const serializeAws_restJson1ListVirtualClustersCommand = async (
485
- input: ListVirtualClustersCommandInput,
486
- context: __SerdeContext
487
- ): Promise<__HttpRequest> => {
488
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
489
- const headers: any = {};
490
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/virtualclusters";
491
- const query: any = {
492
- ...(input.containerProviderId !== undefined && { containerProviderId: input.containerProviderId }),
493
- ...(input.containerProviderType !== undefined && { containerProviderType: input.containerProviderType }),
494
- ...(input.createdAfter !== undefined && {
495
- createdAfter: (input.createdAfter.toISOString().split(".")[0] + "Z").toString(),
496
- }),
497
- ...(input.createdBefore !== undefined && {
498
- createdBefore: (input.createdBefore.toISOString().split(".")[0] + "Z").toString(),
499
- }),
500
- ...(input.states !== undefined && { states: (input.states || []).map((_entry) => _entry as any) }),
501
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
502
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
503
- };
504
- let body: any;
505
- return new __HttpRequest({
506
- protocol,
507
- hostname,
508
- port,
509
- method: "GET",
510
- headers,
511
- path: resolvedPath,
512
- query,
513
- body,
514
- });
515
- };
516
-
517
- export const serializeAws_restJson1StartJobRunCommand = async (
518
- input: StartJobRunCommandInput,
519
- context: __SerdeContext
520
- ): Promise<__HttpRequest> => {
521
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
522
- const headers: any = {
523
- "content-type": "application/json",
524
- };
525
- let resolvedPath =
526
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
527
- "/virtualclusters/{virtualClusterId}/jobruns";
528
- if (input.virtualClusterId !== undefined) {
529
- const labelValue: string = input.virtualClusterId;
530
- if (labelValue.length <= 0) {
531
- throw new Error("Empty value provided for input HTTP label: virtualClusterId.");
532
- }
533
- resolvedPath = resolvedPath.replace("{virtualClusterId}", __extendedEncodeURIComponent(labelValue));
534
- } else {
535
- throw new Error("No value provided for input HTTP label: virtualClusterId.");
536
- }
537
- let body: any;
538
- body = JSON.stringify({
539
- clientToken: input.clientToken ?? generateIdempotencyToken(),
540
- ...(input.configurationOverrides !== undefined &&
541
- input.configurationOverrides !== null && {
542
- configurationOverrides: serializeAws_restJson1ConfigurationOverrides(input.configurationOverrides, context),
543
- }),
544
- ...(input.executionRoleArn !== undefined &&
545
- input.executionRoleArn !== null && { executionRoleArn: input.executionRoleArn }),
546
- ...(input.jobDriver !== undefined &&
547
- input.jobDriver !== null && { jobDriver: serializeAws_restJson1JobDriver(input.jobDriver, context) }),
548
- ...(input.name !== undefined && input.name !== null && { name: input.name }),
549
- ...(input.releaseLabel !== undefined && input.releaseLabel !== null && { releaseLabel: input.releaseLabel }),
550
- ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
551
- });
552
- return new __HttpRequest({
553
- protocol,
554
- hostname,
555
- port,
556
- method: "POST",
557
- headers,
558
- path: resolvedPath,
559
- body,
560
- });
561
- };
562
-
563
- export const serializeAws_restJson1TagResourceCommand = async (
564
- input: TagResourceCommandInput,
565
- context: __SerdeContext
566
- ): Promise<__HttpRequest> => {
567
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
568
- const headers: any = {
569
- "content-type": "application/json",
570
- };
571
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
572
- if (input.resourceArn !== undefined) {
573
- const labelValue: string = input.resourceArn;
574
- if (labelValue.length <= 0) {
575
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
576
- }
577
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
578
- } else {
579
- throw new Error("No value provided for input HTTP label: resourceArn.");
580
- }
581
- let body: any;
582
- body = JSON.stringify({
583
- ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
584
- });
585
- return new __HttpRequest({
586
- protocol,
587
- hostname,
588
- port,
589
- method: "POST",
590
- headers,
591
- path: resolvedPath,
592
- body,
593
- });
594
- };
595
-
596
- export const serializeAws_restJson1UntagResourceCommand = async (
597
- input: UntagResourceCommandInput,
598
- context: __SerdeContext
599
- ): Promise<__HttpRequest> => {
600
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
601
- const headers: any = {};
602
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
603
- if (input.resourceArn !== undefined) {
604
- const labelValue: string = input.resourceArn;
605
- if (labelValue.length <= 0) {
606
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
607
- }
608
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
609
- } else {
610
- throw new Error("No value provided for input HTTP label: resourceArn.");
611
- }
612
- const query: any = {
613
- ...(input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map((_entry) => _entry as any) }),
614
- };
615
- let body: any;
616
- return new __HttpRequest({
617
- protocol,
618
- hostname,
619
- port,
620
- method: "DELETE",
621
- headers,
622
- path: resolvedPath,
623
- query,
624
- body,
625
- });
626
- };
627
-
628
- export const deserializeAws_restJson1CancelJobRunCommand = async (
629
- output: __HttpResponse,
630
- context: __SerdeContext
631
- ): Promise<CancelJobRunCommandOutput> => {
632
- if (output.statusCode !== 200 && output.statusCode >= 300) {
633
- return deserializeAws_restJson1CancelJobRunCommandError(output, context);
634
- }
635
- const contents: CancelJobRunCommandOutput = {
636
- $metadata: deserializeMetadata(output),
637
- id: undefined,
638
- virtualClusterId: undefined,
639
- };
640
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
641
- if (data.id !== undefined && data.id !== null) {
642
- contents.id = __expectString(data.id);
643
- }
644
- if (data.virtualClusterId !== undefined && data.virtualClusterId !== null) {
645
- contents.virtualClusterId = __expectString(data.virtualClusterId);
646
- }
647
- return Promise.resolve(contents);
648
- };
649
-
650
- const deserializeAws_restJson1CancelJobRunCommandError = async (
651
- output: __HttpResponse,
652
- context: __SerdeContext
653
- ): Promise<CancelJobRunCommandOutput> => {
654
- const parsedOutput: any = {
655
- ...output,
656
- body: await parseBody(output.body, context),
657
- };
658
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
659
- let errorCode = "UnknownError";
660
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
661
- switch (errorCode) {
662
- case "InternalServerException":
663
- case "com.amazonaws.emrcontainers#InternalServerException":
664
- response = {
665
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
666
- name: errorCode,
667
- $metadata: deserializeMetadata(output),
668
- };
669
- break;
670
- case "ValidationException":
671
- case "com.amazonaws.emrcontainers#ValidationException":
672
- response = {
673
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
674
- name: errorCode,
675
- $metadata: deserializeMetadata(output),
676
- };
677
- break;
678
- default:
679
- const parsedBody = parsedOutput.body;
680
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
681
- response = {
682
- ...parsedBody,
683
- name: `${errorCode}`,
684
- message: parsedBody.message || parsedBody.Message || errorCode,
685
- $fault: "client",
686
- $metadata: deserializeMetadata(output),
687
- } as any;
688
- }
689
- const message = response.message || response.Message || errorCode;
690
- response.message = message;
691
- delete response.Message;
692
- return Promise.reject(Object.assign(new Error(message), response));
693
- };
694
-
695
- export const deserializeAws_restJson1CreateManagedEndpointCommand = async (
696
- output: __HttpResponse,
697
- context: __SerdeContext
698
- ): Promise<CreateManagedEndpointCommandOutput> => {
699
- if (output.statusCode !== 200 && output.statusCode >= 300) {
700
- return deserializeAws_restJson1CreateManagedEndpointCommandError(output, context);
701
- }
702
- const contents: CreateManagedEndpointCommandOutput = {
703
- $metadata: deserializeMetadata(output),
704
- arn: undefined,
705
- id: undefined,
706
- name: undefined,
707
- virtualClusterId: undefined,
708
- };
709
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
710
- if (data.arn !== undefined && data.arn !== null) {
711
- contents.arn = __expectString(data.arn);
712
- }
713
- if (data.id !== undefined && data.id !== null) {
714
- contents.id = __expectString(data.id);
715
- }
716
- if (data.name !== undefined && data.name !== null) {
717
- contents.name = __expectString(data.name);
718
- }
719
- if (data.virtualClusterId !== undefined && data.virtualClusterId !== null) {
720
- contents.virtualClusterId = __expectString(data.virtualClusterId);
721
- }
722
- return Promise.resolve(contents);
723
- };
724
-
725
- const deserializeAws_restJson1CreateManagedEndpointCommandError = async (
726
- output: __HttpResponse,
727
- context: __SerdeContext
728
- ): Promise<CreateManagedEndpointCommandOutput> => {
729
- const parsedOutput: any = {
730
- ...output,
731
- body: await parseBody(output.body, context),
732
- };
733
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
734
- let errorCode = "UnknownError";
735
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
736
- switch (errorCode) {
737
- case "InternalServerException":
738
- case "com.amazonaws.emrcontainers#InternalServerException":
739
- response = {
740
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
741
- name: errorCode,
742
- $metadata: deserializeMetadata(output),
743
- };
744
- break;
745
- case "ResourceNotFoundException":
746
- case "com.amazonaws.emrcontainers#ResourceNotFoundException":
747
- response = {
748
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
749
- name: errorCode,
750
- $metadata: deserializeMetadata(output),
751
- };
752
- break;
753
- case "ValidationException":
754
- case "com.amazonaws.emrcontainers#ValidationException":
755
- response = {
756
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
757
- name: errorCode,
758
- $metadata: deserializeMetadata(output),
759
- };
760
- break;
761
- default:
762
- const parsedBody = parsedOutput.body;
763
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
764
- response = {
765
- ...parsedBody,
766
- name: `${errorCode}`,
767
- message: parsedBody.message || parsedBody.Message || errorCode,
768
- $fault: "client",
769
- $metadata: deserializeMetadata(output),
770
- } as any;
771
- }
772
- const message = response.message || response.Message || errorCode;
773
- response.message = message;
774
- delete response.Message;
775
- return Promise.reject(Object.assign(new Error(message), response));
776
- };
777
-
778
- export const deserializeAws_restJson1CreateVirtualClusterCommand = async (
779
- output: __HttpResponse,
780
- context: __SerdeContext
781
- ): Promise<CreateVirtualClusterCommandOutput> => {
782
- if (output.statusCode !== 200 && output.statusCode >= 300) {
783
- return deserializeAws_restJson1CreateVirtualClusterCommandError(output, context);
784
- }
785
- const contents: CreateVirtualClusterCommandOutput = {
786
- $metadata: deserializeMetadata(output),
787
- arn: undefined,
788
- id: undefined,
789
- name: undefined,
790
- };
791
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
792
- if (data.arn !== undefined && data.arn !== null) {
793
- contents.arn = __expectString(data.arn);
794
- }
795
- if (data.id !== undefined && data.id !== null) {
796
- contents.id = __expectString(data.id);
797
- }
798
- if (data.name !== undefined && data.name !== null) {
799
- contents.name = __expectString(data.name);
800
- }
801
- return Promise.resolve(contents);
802
- };
803
-
804
- const deserializeAws_restJson1CreateVirtualClusterCommandError = async (
805
- output: __HttpResponse,
806
- context: __SerdeContext
807
- ): Promise<CreateVirtualClusterCommandOutput> => {
808
- const parsedOutput: any = {
809
- ...output,
810
- body: await parseBody(output.body, context),
811
- };
812
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
813
- let errorCode = "UnknownError";
814
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
815
- switch (errorCode) {
816
- case "InternalServerException":
817
- case "com.amazonaws.emrcontainers#InternalServerException":
818
- response = {
819
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
820
- name: errorCode,
821
- $metadata: deserializeMetadata(output),
822
- };
823
- break;
824
- case "ResourceNotFoundException":
825
- case "com.amazonaws.emrcontainers#ResourceNotFoundException":
826
- response = {
827
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
828
- name: errorCode,
829
- $metadata: deserializeMetadata(output),
830
- };
831
- break;
832
- case "ValidationException":
833
- case "com.amazonaws.emrcontainers#ValidationException":
834
- response = {
835
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
836
- name: errorCode,
837
- $metadata: deserializeMetadata(output),
838
- };
839
- break;
840
- default:
841
- const parsedBody = parsedOutput.body;
842
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
843
- response = {
844
- ...parsedBody,
845
- name: `${errorCode}`,
846
- message: parsedBody.message || parsedBody.Message || errorCode,
847
- $fault: "client",
848
- $metadata: deserializeMetadata(output),
849
- } as any;
850
- }
851
- const message = response.message || response.Message || errorCode;
852
- response.message = message;
853
- delete response.Message;
854
- return Promise.reject(Object.assign(new Error(message), response));
855
- };
856
-
857
- export const deserializeAws_restJson1DeleteManagedEndpointCommand = async (
858
- output: __HttpResponse,
859
- context: __SerdeContext
860
- ): Promise<DeleteManagedEndpointCommandOutput> => {
861
- if (output.statusCode !== 200 && output.statusCode >= 300) {
862
- return deserializeAws_restJson1DeleteManagedEndpointCommandError(output, context);
863
- }
864
- const contents: DeleteManagedEndpointCommandOutput = {
865
- $metadata: deserializeMetadata(output),
866
- id: undefined,
867
- virtualClusterId: undefined,
868
- };
869
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
870
- if (data.id !== undefined && data.id !== null) {
871
- contents.id = __expectString(data.id);
872
- }
873
- if (data.virtualClusterId !== undefined && data.virtualClusterId !== null) {
874
- contents.virtualClusterId = __expectString(data.virtualClusterId);
875
- }
876
- return Promise.resolve(contents);
877
- };
878
-
879
- const deserializeAws_restJson1DeleteManagedEndpointCommandError = async (
880
- output: __HttpResponse,
881
- context: __SerdeContext
882
- ): Promise<DeleteManagedEndpointCommandOutput> => {
883
- const parsedOutput: any = {
884
- ...output,
885
- body: await parseBody(output.body, context),
886
- };
887
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
888
- let errorCode = "UnknownError";
889
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
890
- switch (errorCode) {
891
- case "InternalServerException":
892
- case "com.amazonaws.emrcontainers#InternalServerException":
893
- response = {
894
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
895
- name: errorCode,
896
- $metadata: deserializeMetadata(output),
897
- };
898
- break;
899
- case "ValidationException":
900
- case "com.amazonaws.emrcontainers#ValidationException":
901
- response = {
902
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
903
- name: errorCode,
904
- $metadata: deserializeMetadata(output),
905
- };
906
- break;
907
- default:
908
- const parsedBody = parsedOutput.body;
909
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
910
- response = {
911
- ...parsedBody,
912
- name: `${errorCode}`,
913
- message: parsedBody.message || parsedBody.Message || errorCode,
914
- $fault: "client",
915
- $metadata: deserializeMetadata(output),
916
- } as any;
917
- }
918
- const message = response.message || response.Message || errorCode;
919
- response.message = message;
920
- delete response.Message;
921
- return Promise.reject(Object.assign(new Error(message), response));
922
- };
923
-
924
- export const deserializeAws_restJson1DeleteVirtualClusterCommand = async (
925
- output: __HttpResponse,
926
- context: __SerdeContext
927
- ): Promise<DeleteVirtualClusterCommandOutput> => {
928
- if (output.statusCode !== 200 && output.statusCode >= 300) {
929
- return deserializeAws_restJson1DeleteVirtualClusterCommandError(output, context);
930
- }
931
- const contents: DeleteVirtualClusterCommandOutput = {
932
- $metadata: deserializeMetadata(output),
933
- id: undefined,
934
- };
935
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
936
- if (data.id !== undefined && data.id !== null) {
937
- contents.id = __expectString(data.id);
938
- }
939
- return Promise.resolve(contents);
940
- };
941
-
942
- const deserializeAws_restJson1DeleteVirtualClusterCommandError = async (
943
- output: __HttpResponse,
944
- context: __SerdeContext
945
- ): Promise<DeleteVirtualClusterCommandOutput> => {
946
- const parsedOutput: any = {
947
- ...output,
948
- body: await parseBody(output.body, context),
949
- };
950
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
951
- let errorCode = "UnknownError";
952
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
953
- switch (errorCode) {
954
- case "InternalServerException":
955
- case "com.amazonaws.emrcontainers#InternalServerException":
956
- response = {
957
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
958
- name: errorCode,
959
- $metadata: deserializeMetadata(output),
960
- };
961
- break;
962
- case "ValidationException":
963
- case "com.amazonaws.emrcontainers#ValidationException":
964
- response = {
965
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
966
- name: errorCode,
967
- $metadata: deserializeMetadata(output),
968
- };
969
- break;
970
- default:
971
- const parsedBody = parsedOutput.body;
972
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
973
- response = {
974
- ...parsedBody,
975
- name: `${errorCode}`,
976
- message: parsedBody.message || parsedBody.Message || errorCode,
977
- $fault: "client",
978
- $metadata: deserializeMetadata(output),
979
- } as any;
980
- }
981
- const message = response.message || response.Message || errorCode;
982
- response.message = message;
983
- delete response.Message;
984
- return Promise.reject(Object.assign(new Error(message), response));
985
- };
986
-
987
- export const deserializeAws_restJson1DescribeJobRunCommand = async (
988
- output: __HttpResponse,
989
- context: __SerdeContext
990
- ): Promise<DescribeJobRunCommandOutput> => {
991
- if (output.statusCode !== 200 && output.statusCode >= 300) {
992
- return deserializeAws_restJson1DescribeJobRunCommandError(output, context);
993
- }
994
- const contents: DescribeJobRunCommandOutput = {
995
- $metadata: deserializeMetadata(output),
996
- jobRun: undefined,
997
- };
998
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
999
- if (data.jobRun !== undefined && data.jobRun !== null) {
1000
- contents.jobRun = deserializeAws_restJson1JobRun(data.jobRun, context);
1001
- }
1002
- return Promise.resolve(contents);
1003
- };
1004
-
1005
- const deserializeAws_restJson1DescribeJobRunCommandError = async (
1006
- output: __HttpResponse,
1007
- context: __SerdeContext
1008
- ): Promise<DescribeJobRunCommandOutput> => {
1009
- const parsedOutput: any = {
1010
- ...output,
1011
- body: await parseBody(output.body, context),
1012
- };
1013
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1014
- let errorCode = "UnknownError";
1015
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1016
- switch (errorCode) {
1017
- case "InternalServerException":
1018
- case "com.amazonaws.emrcontainers#InternalServerException":
1019
- response = {
1020
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1021
- name: errorCode,
1022
- $metadata: deserializeMetadata(output),
1023
- };
1024
- break;
1025
- case "ResourceNotFoundException":
1026
- case "com.amazonaws.emrcontainers#ResourceNotFoundException":
1027
- response = {
1028
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1029
- name: errorCode,
1030
- $metadata: deserializeMetadata(output),
1031
- };
1032
- break;
1033
- case "ValidationException":
1034
- case "com.amazonaws.emrcontainers#ValidationException":
1035
- response = {
1036
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1037
- name: errorCode,
1038
- $metadata: deserializeMetadata(output),
1039
- };
1040
- break;
1041
- default:
1042
- const parsedBody = parsedOutput.body;
1043
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1044
- response = {
1045
- ...parsedBody,
1046
- name: `${errorCode}`,
1047
- message: parsedBody.message || parsedBody.Message || errorCode,
1048
- $fault: "client",
1049
- $metadata: deserializeMetadata(output),
1050
- } as any;
1051
- }
1052
- const message = response.message || response.Message || errorCode;
1053
- response.message = message;
1054
- delete response.Message;
1055
- return Promise.reject(Object.assign(new Error(message), response));
1056
- };
1057
-
1058
- export const deserializeAws_restJson1DescribeManagedEndpointCommand = async (
1059
- output: __HttpResponse,
1060
- context: __SerdeContext
1061
- ): Promise<DescribeManagedEndpointCommandOutput> => {
1062
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1063
- return deserializeAws_restJson1DescribeManagedEndpointCommandError(output, context);
1064
- }
1065
- const contents: DescribeManagedEndpointCommandOutput = {
1066
- $metadata: deserializeMetadata(output),
1067
- endpoint: undefined,
1068
- };
1069
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1070
- if (data.endpoint !== undefined && data.endpoint !== null) {
1071
- contents.endpoint = deserializeAws_restJson1Endpoint(data.endpoint, context);
1072
- }
1073
- return Promise.resolve(contents);
1074
- };
1075
-
1076
- const deserializeAws_restJson1DescribeManagedEndpointCommandError = async (
1077
- output: __HttpResponse,
1078
- context: __SerdeContext
1079
- ): Promise<DescribeManagedEndpointCommandOutput> => {
1080
- const parsedOutput: any = {
1081
- ...output,
1082
- body: await parseBody(output.body, context),
1083
- };
1084
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1085
- let errorCode = "UnknownError";
1086
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1087
- switch (errorCode) {
1088
- case "InternalServerException":
1089
- case "com.amazonaws.emrcontainers#InternalServerException":
1090
- response = {
1091
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1092
- name: errorCode,
1093
- $metadata: deserializeMetadata(output),
1094
- };
1095
- break;
1096
- case "ResourceNotFoundException":
1097
- case "com.amazonaws.emrcontainers#ResourceNotFoundException":
1098
- response = {
1099
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1100
- name: errorCode,
1101
- $metadata: deserializeMetadata(output),
1102
- };
1103
- break;
1104
- case "ValidationException":
1105
- case "com.amazonaws.emrcontainers#ValidationException":
1106
- response = {
1107
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1108
- name: errorCode,
1109
- $metadata: deserializeMetadata(output),
1110
- };
1111
- break;
1112
- default:
1113
- const parsedBody = parsedOutput.body;
1114
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1115
- response = {
1116
- ...parsedBody,
1117
- name: `${errorCode}`,
1118
- message: parsedBody.message || parsedBody.Message || errorCode,
1119
- $fault: "client",
1120
- $metadata: deserializeMetadata(output),
1121
- } as any;
1122
- }
1123
- const message = response.message || response.Message || errorCode;
1124
- response.message = message;
1125
- delete response.Message;
1126
- return Promise.reject(Object.assign(new Error(message), response));
1127
- };
1128
-
1129
- export const deserializeAws_restJson1DescribeVirtualClusterCommand = async (
1130
- output: __HttpResponse,
1131
- context: __SerdeContext
1132
- ): Promise<DescribeVirtualClusterCommandOutput> => {
1133
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1134
- return deserializeAws_restJson1DescribeVirtualClusterCommandError(output, context);
1135
- }
1136
- const contents: DescribeVirtualClusterCommandOutput = {
1137
- $metadata: deserializeMetadata(output),
1138
- virtualCluster: undefined,
1139
- };
1140
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1141
- if (data.virtualCluster !== undefined && data.virtualCluster !== null) {
1142
- contents.virtualCluster = deserializeAws_restJson1VirtualCluster(data.virtualCluster, context);
1143
- }
1144
- return Promise.resolve(contents);
1145
- };
1146
-
1147
- const deserializeAws_restJson1DescribeVirtualClusterCommandError = async (
1148
- output: __HttpResponse,
1149
- context: __SerdeContext
1150
- ): Promise<DescribeVirtualClusterCommandOutput> => {
1151
- const parsedOutput: any = {
1152
- ...output,
1153
- body: await parseBody(output.body, context),
1154
- };
1155
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1156
- let errorCode = "UnknownError";
1157
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1158
- switch (errorCode) {
1159
- case "InternalServerException":
1160
- case "com.amazonaws.emrcontainers#InternalServerException":
1161
- response = {
1162
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1163
- name: errorCode,
1164
- $metadata: deserializeMetadata(output),
1165
- };
1166
- break;
1167
- case "ResourceNotFoundException":
1168
- case "com.amazonaws.emrcontainers#ResourceNotFoundException":
1169
- response = {
1170
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1171
- name: errorCode,
1172
- $metadata: deserializeMetadata(output),
1173
- };
1174
- break;
1175
- case "ValidationException":
1176
- case "com.amazonaws.emrcontainers#ValidationException":
1177
- response = {
1178
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1179
- name: errorCode,
1180
- $metadata: deserializeMetadata(output),
1181
- };
1182
- break;
1183
- default:
1184
- const parsedBody = parsedOutput.body;
1185
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1186
- response = {
1187
- ...parsedBody,
1188
- name: `${errorCode}`,
1189
- message: parsedBody.message || parsedBody.Message || errorCode,
1190
- $fault: "client",
1191
- $metadata: deserializeMetadata(output),
1192
- } as any;
1193
- }
1194
- const message = response.message || response.Message || errorCode;
1195
- response.message = message;
1196
- delete response.Message;
1197
- return Promise.reject(Object.assign(new Error(message), response));
1198
- };
1199
-
1200
- export const deserializeAws_restJson1ListJobRunsCommand = async (
1201
- output: __HttpResponse,
1202
- context: __SerdeContext
1203
- ): Promise<ListJobRunsCommandOutput> => {
1204
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1205
- return deserializeAws_restJson1ListJobRunsCommandError(output, context);
1206
- }
1207
- const contents: ListJobRunsCommandOutput = {
1208
- $metadata: deserializeMetadata(output),
1209
- jobRuns: undefined,
1210
- nextToken: undefined,
1211
- };
1212
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1213
- if (data.jobRuns !== undefined && data.jobRuns !== null) {
1214
- contents.jobRuns = deserializeAws_restJson1JobRuns(data.jobRuns, context);
1215
- }
1216
- if (data.nextToken !== undefined && data.nextToken !== null) {
1217
- contents.nextToken = __expectString(data.nextToken);
1218
- }
1219
- return Promise.resolve(contents);
1220
- };
1221
-
1222
- const deserializeAws_restJson1ListJobRunsCommandError = async (
1223
- output: __HttpResponse,
1224
- context: __SerdeContext
1225
- ): Promise<ListJobRunsCommandOutput> => {
1226
- const parsedOutput: any = {
1227
- ...output,
1228
- body: await parseBody(output.body, context),
1229
- };
1230
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1231
- let errorCode = "UnknownError";
1232
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1233
- switch (errorCode) {
1234
- case "InternalServerException":
1235
- case "com.amazonaws.emrcontainers#InternalServerException":
1236
- response = {
1237
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1238
- name: errorCode,
1239
- $metadata: deserializeMetadata(output),
1240
- };
1241
- break;
1242
- case "ValidationException":
1243
- case "com.amazonaws.emrcontainers#ValidationException":
1244
- response = {
1245
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1246
- name: errorCode,
1247
- $metadata: deserializeMetadata(output),
1248
- };
1249
- break;
1250
- default:
1251
- const parsedBody = parsedOutput.body;
1252
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1253
- response = {
1254
- ...parsedBody,
1255
- name: `${errorCode}`,
1256
- message: parsedBody.message || parsedBody.Message || errorCode,
1257
- $fault: "client",
1258
- $metadata: deserializeMetadata(output),
1259
- } as any;
1260
- }
1261
- const message = response.message || response.Message || errorCode;
1262
- response.message = message;
1263
- delete response.Message;
1264
- return Promise.reject(Object.assign(new Error(message), response));
1265
- };
1266
-
1267
- export const deserializeAws_restJson1ListManagedEndpointsCommand = async (
1268
- output: __HttpResponse,
1269
- context: __SerdeContext
1270
- ): Promise<ListManagedEndpointsCommandOutput> => {
1271
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1272
- return deserializeAws_restJson1ListManagedEndpointsCommandError(output, context);
1273
- }
1274
- const contents: ListManagedEndpointsCommandOutput = {
1275
- $metadata: deserializeMetadata(output),
1276
- endpoints: undefined,
1277
- nextToken: undefined,
1278
- };
1279
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1280
- if (data.endpoints !== undefined && data.endpoints !== null) {
1281
- contents.endpoints = deserializeAws_restJson1Endpoints(data.endpoints, context);
1282
- }
1283
- if (data.nextToken !== undefined && data.nextToken !== null) {
1284
- contents.nextToken = __expectString(data.nextToken);
1285
- }
1286
- return Promise.resolve(contents);
1287
- };
1288
-
1289
- const deserializeAws_restJson1ListManagedEndpointsCommandError = async (
1290
- output: __HttpResponse,
1291
- context: __SerdeContext
1292
- ): Promise<ListManagedEndpointsCommandOutput> => {
1293
- const parsedOutput: any = {
1294
- ...output,
1295
- body: await parseBody(output.body, context),
1296
- };
1297
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1298
- let errorCode = "UnknownError";
1299
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1300
- switch (errorCode) {
1301
- case "InternalServerException":
1302
- case "com.amazonaws.emrcontainers#InternalServerException":
1303
- response = {
1304
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1305
- name: errorCode,
1306
- $metadata: deserializeMetadata(output),
1307
- };
1308
- break;
1309
- case "ValidationException":
1310
- case "com.amazonaws.emrcontainers#ValidationException":
1311
- response = {
1312
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1313
- name: errorCode,
1314
- $metadata: deserializeMetadata(output),
1315
- };
1316
- break;
1317
- default:
1318
- const parsedBody = parsedOutput.body;
1319
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1320
- response = {
1321
- ...parsedBody,
1322
- name: `${errorCode}`,
1323
- message: parsedBody.message || parsedBody.Message || errorCode,
1324
- $fault: "client",
1325
- $metadata: deserializeMetadata(output),
1326
- } as any;
1327
- }
1328
- const message = response.message || response.Message || errorCode;
1329
- response.message = message;
1330
- delete response.Message;
1331
- return Promise.reject(Object.assign(new Error(message), response));
1332
- };
1333
-
1334
- export const deserializeAws_restJson1ListTagsForResourceCommand = async (
1335
- output: __HttpResponse,
1336
- context: __SerdeContext
1337
- ): Promise<ListTagsForResourceCommandOutput> => {
1338
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1339
- return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
1340
- }
1341
- const contents: ListTagsForResourceCommandOutput = {
1342
- $metadata: deserializeMetadata(output),
1343
- tags: undefined,
1344
- };
1345
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1346
- if (data.tags !== undefined && data.tags !== null) {
1347
- contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
1348
- }
1349
- return Promise.resolve(contents);
1350
- };
1351
-
1352
- const deserializeAws_restJson1ListTagsForResourceCommandError = async (
1353
- output: __HttpResponse,
1354
- context: __SerdeContext
1355
- ): Promise<ListTagsForResourceCommandOutput> => {
1356
- const parsedOutput: any = {
1357
- ...output,
1358
- body: await parseBody(output.body, context),
1359
- };
1360
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1361
- let errorCode = "UnknownError";
1362
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1363
- switch (errorCode) {
1364
- case "InternalServerException":
1365
- case "com.amazonaws.emrcontainers#InternalServerException":
1366
- response = {
1367
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1368
- name: errorCode,
1369
- $metadata: deserializeMetadata(output),
1370
- };
1371
- break;
1372
- case "ResourceNotFoundException":
1373
- case "com.amazonaws.emrcontainers#ResourceNotFoundException":
1374
- response = {
1375
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1376
- name: errorCode,
1377
- $metadata: deserializeMetadata(output),
1378
- };
1379
- break;
1380
- case "ValidationException":
1381
- case "com.amazonaws.emrcontainers#ValidationException":
1382
- response = {
1383
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1384
- name: errorCode,
1385
- $metadata: deserializeMetadata(output),
1386
- };
1387
- break;
1388
- default:
1389
- const parsedBody = parsedOutput.body;
1390
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1391
- response = {
1392
- ...parsedBody,
1393
- name: `${errorCode}`,
1394
- message: parsedBody.message || parsedBody.Message || errorCode,
1395
- $fault: "client",
1396
- $metadata: deserializeMetadata(output),
1397
- } as any;
1398
- }
1399
- const message = response.message || response.Message || errorCode;
1400
- response.message = message;
1401
- delete response.Message;
1402
- return Promise.reject(Object.assign(new Error(message), response));
1403
- };
1404
-
1405
- export const deserializeAws_restJson1ListVirtualClustersCommand = async (
1406
- output: __HttpResponse,
1407
- context: __SerdeContext
1408
- ): Promise<ListVirtualClustersCommandOutput> => {
1409
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1410
- return deserializeAws_restJson1ListVirtualClustersCommandError(output, context);
1411
- }
1412
- const contents: ListVirtualClustersCommandOutput = {
1413
- $metadata: deserializeMetadata(output),
1414
- nextToken: undefined,
1415
- virtualClusters: undefined,
1416
- };
1417
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1418
- if (data.nextToken !== undefined && data.nextToken !== null) {
1419
- contents.nextToken = __expectString(data.nextToken);
1420
- }
1421
- if (data.virtualClusters !== undefined && data.virtualClusters !== null) {
1422
- contents.virtualClusters = deserializeAws_restJson1VirtualClusters(data.virtualClusters, context);
1423
- }
1424
- return Promise.resolve(contents);
1425
- };
1426
-
1427
- const deserializeAws_restJson1ListVirtualClustersCommandError = async (
1428
- output: __HttpResponse,
1429
- context: __SerdeContext
1430
- ): Promise<ListVirtualClustersCommandOutput> => {
1431
- const parsedOutput: any = {
1432
- ...output,
1433
- body: await parseBody(output.body, context),
1434
- };
1435
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1436
- let errorCode = "UnknownError";
1437
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1438
- switch (errorCode) {
1439
- case "InternalServerException":
1440
- case "com.amazonaws.emrcontainers#InternalServerException":
1441
- response = {
1442
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1443
- name: errorCode,
1444
- $metadata: deserializeMetadata(output),
1445
- };
1446
- break;
1447
- case "ValidationException":
1448
- case "com.amazonaws.emrcontainers#ValidationException":
1449
- response = {
1450
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1451
- name: errorCode,
1452
- $metadata: deserializeMetadata(output),
1453
- };
1454
- break;
1455
- default:
1456
- const parsedBody = parsedOutput.body;
1457
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1458
- response = {
1459
- ...parsedBody,
1460
- name: `${errorCode}`,
1461
- message: parsedBody.message || parsedBody.Message || errorCode,
1462
- $fault: "client",
1463
- $metadata: deserializeMetadata(output),
1464
- } as any;
1465
- }
1466
- const message = response.message || response.Message || errorCode;
1467
- response.message = message;
1468
- delete response.Message;
1469
- return Promise.reject(Object.assign(new Error(message), response));
1470
- };
1471
-
1472
- export const deserializeAws_restJson1StartJobRunCommand = async (
1473
- output: __HttpResponse,
1474
- context: __SerdeContext
1475
- ): Promise<StartJobRunCommandOutput> => {
1476
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1477
- return deserializeAws_restJson1StartJobRunCommandError(output, context);
1478
- }
1479
- const contents: StartJobRunCommandOutput = {
1480
- $metadata: deserializeMetadata(output),
1481
- arn: undefined,
1482
- id: undefined,
1483
- name: undefined,
1484
- virtualClusterId: undefined,
1485
- };
1486
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1487
- if (data.arn !== undefined && data.arn !== null) {
1488
- contents.arn = __expectString(data.arn);
1489
- }
1490
- if (data.id !== undefined && data.id !== null) {
1491
- contents.id = __expectString(data.id);
1492
- }
1493
- if (data.name !== undefined && data.name !== null) {
1494
- contents.name = __expectString(data.name);
1495
- }
1496
- if (data.virtualClusterId !== undefined && data.virtualClusterId !== null) {
1497
- contents.virtualClusterId = __expectString(data.virtualClusterId);
1498
- }
1499
- return Promise.resolve(contents);
1500
- };
1501
-
1502
- const deserializeAws_restJson1StartJobRunCommandError = async (
1503
- output: __HttpResponse,
1504
- context: __SerdeContext
1505
- ): Promise<StartJobRunCommandOutput> => {
1506
- const parsedOutput: any = {
1507
- ...output,
1508
- body: await parseBody(output.body, context),
1509
- };
1510
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1511
- let errorCode = "UnknownError";
1512
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1513
- switch (errorCode) {
1514
- case "InternalServerException":
1515
- case "com.amazonaws.emrcontainers#InternalServerException":
1516
- response = {
1517
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1518
- name: errorCode,
1519
- $metadata: deserializeMetadata(output),
1520
- };
1521
- break;
1522
- case "ResourceNotFoundException":
1523
- case "com.amazonaws.emrcontainers#ResourceNotFoundException":
1524
- response = {
1525
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1526
- name: errorCode,
1527
- $metadata: deserializeMetadata(output),
1528
- };
1529
- break;
1530
- case "ValidationException":
1531
- case "com.amazonaws.emrcontainers#ValidationException":
1532
- response = {
1533
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1534
- name: errorCode,
1535
- $metadata: deserializeMetadata(output),
1536
- };
1537
- break;
1538
- default:
1539
- const parsedBody = parsedOutput.body;
1540
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1541
- response = {
1542
- ...parsedBody,
1543
- name: `${errorCode}`,
1544
- message: parsedBody.message || parsedBody.Message || errorCode,
1545
- $fault: "client",
1546
- $metadata: deserializeMetadata(output),
1547
- } as any;
1548
- }
1549
- const message = response.message || response.Message || errorCode;
1550
- response.message = message;
1551
- delete response.Message;
1552
- return Promise.reject(Object.assign(new Error(message), response));
1553
- };
1554
-
1555
- export const deserializeAws_restJson1TagResourceCommand = async (
1556
- output: __HttpResponse,
1557
- context: __SerdeContext
1558
- ): Promise<TagResourceCommandOutput> => {
1559
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1560
- return deserializeAws_restJson1TagResourceCommandError(output, context);
1561
- }
1562
- const contents: TagResourceCommandOutput = {
1563
- $metadata: deserializeMetadata(output),
1564
- };
1565
- await collectBody(output.body, context);
1566
- return Promise.resolve(contents);
1567
- };
1568
-
1569
- const deserializeAws_restJson1TagResourceCommandError = async (
1570
- output: __HttpResponse,
1571
- context: __SerdeContext
1572
- ): Promise<TagResourceCommandOutput> => {
1573
- const parsedOutput: any = {
1574
- ...output,
1575
- body: await parseBody(output.body, context),
1576
- };
1577
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1578
- let errorCode = "UnknownError";
1579
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1580
- switch (errorCode) {
1581
- case "InternalServerException":
1582
- case "com.amazonaws.emrcontainers#InternalServerException":
1583
- response = {
1584
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1585
- name: errorCode,
1586
- $metadata: deserializeMetadata(output),
1587
- };
1588
- break;
1589
- case "ResourceNotFoundException":
1590
- case "com.amazonaws.emrcontainers#ResourceNotFoundException":
1591
- response = {
1592
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1593
- name: errorCode,
1594
- $metadata: deserializeMetadata(output),
1595
- };
1596
- break;
1597
- case "ValidationException":
1598
- case "com.amazonaws.emrcontainers#ValidationException":
1599
- response = {
1600
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1601
- name: errorCode,
1602
- $metadata: deserializeMetadata(output),
1603
- };
1604
- break;
1605
- default:
1606
- const parsedBody = parsedOutput.body;
1607
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1608
- response = {
1609
- ...parsedBody,
1610
- name: `${errorCode}`,
1611
- message: parsedBody.message || parsedBody.Message || errorCode,
1612
- $fault: "client",
1613
- $metadata: deserializeMetadata(output),
1614
- } as any;
1615
- }
1616
- const message = response.message || response.Message || errorCode;
1617
- response.message = message;
1618
- delete response.Message;
1619
- return Promise.reject(Object.assign(new Error(message), response));
1620
- };
1621
-
1622
- export const deserializeAws_restJson1UntagResourceCommand = async (
1623
- output: __HttpResponse,
1624
- context: __SerdeContext
1625
- ): Promise<UntagResourceCommandOutput> => {
1626
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1627
- return deserializeAws_restJson1UntagResourceCommandError(output, context);
1628
- }
1629
- const contents: UntagResourceCommandOutput = {
1630
- $metadata: deserializeMetadata(output),
1631
- };
1632
- await collectBody(output.body, context);
1633
- return Promise.resolve(contents);
1634
- };
1635
-
1636
- const deserializeAws_restJson1UntagResourceCommandError = async (
1637
- output: __HttpResponse,
1638
- context: __SerdeContext
1639
- ): Promise<UntagResourceCommandOutput> => {
1640
- const parsedOutput: any = {
1641
- ...output,
1642
- body: await parseBody(output.body, context),
1643
- };
1644
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1645
- let errorCode = "UnknownError";
1646
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1647
- switch (errorCode) {
1648
- case "InternalServerException":
1649
- case "com.amazonaws.emrcontainers#InternalServerException":
1650
- response = {
1651
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1652
- name: errorCode,
1653
- $metadata: deserializeMetadata(output),
1654
- };
1655
- break;
1656
- case "ResourceNotFoundException":
1657
- case "com.amazonaws.emrcontainers#ResourceNotFoundException":
1658
- response = {
1659
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1660
- name: errorCode,
1661
- $metadata: deserializeMetadata(output),
1662
- };
1663
- break;
1664
- case "ValidationException":
1665
- case "com.amazonaws.emrcontainers#ValidationException":
1666
- response = {
1667
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1668
- name: errorCode,
1669
- $metadata: deserializeMetadata(output),
1670
- };
1671
- break;
1672
- default:
1673
- const parsedBody = parsedOutput.body;
1674
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1675
- response = {
1676
- ...parsedBody,
1677
- name: `${errorCode}`,
1678
- message: parsedBody.message || parsedBody.Message || errorCode,
1679
- $fault: "client",
1680
- $metadata: deserializeMetadata(output),
1681
- } as any;
1682
- }
1683
- const message = response.message || response.Message || errorCode;
1684
- response.message = message;
1685
- delete response.Message;
1686
- return Promise.reject(Object.assign(new Error(message), response));
1687
- };
1688
-
1689
- const deserializeAws_restJson1InternalServerExceptionResponse = async (
1690
- parsedOutput: any,
1691
- context: __SerdeContext
1692
- ): Promise<InternalServerException> => {
1693
- const contents: InternalServerException = {
1694
- name: "InternalServerException",
1695
- $fault: "server",
1696
- $metadata: deserializeMetadata(parsedOutput),
1697
- message: undefined,
1698
- };
1699
- const data: any = parsedOutput.body;
1700
- if (data.message !== undefined && data.message !== null) {
1701
- contents.message = __expectString(data.message);
1702
- }
1703
- return contents;
1704
- };
1705
-
1706
- const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (
1707
- parsedOutput: any,
1708
- context: __SerdeContext
1709
- ): Promise<ResourceNotFoundException> => {
1710
- const contents: ResourceNotFoundException = {
1711
- name: "ResourceNotFoundException",
1712
- $fault: "client",
1713
- $metadata: deserializeMetadata(parsedOutput),
1714
- message: undefined,
1715
- };
1716
- const data: any = parsedOutput.body;
1717
- if (data.message !== undefined && data.message !== null) {
1718
- contents.message = __expectString(data.message);
1719
- }
1720
- return contents;
1721
- };
1722
-
1723
- const deserializeAws_restJson1ValidationExceptionResponse = async (
1724
- parsedOutput: any,
1725
- context: __SerdeContext
1726
- ): Promise<ValidationException> => {
1727
- const contents: ValidationException = {
1728
- name: "ValidationException",
1729
- $fault: "client",
1730
- $metadata: deserializeMetadata(parsedOutput),
1731
- message: undefined,
1732
- };
1733
- const data: any = parsedOutput.body;
1734
- if (data.message !== undefined && data.message !== null) {
1735
- contents.message = __expectString(data.message);
1736
- }
1737
- return contents;
1738
- };
1739
-
1740
- const serializeAws_restJson1CloudWatchMonitoringConfiguration = (
1741
- input: CloudWatchMonitoringConfiguration,
1742
- context: __SerdeContext
1743
- ): any => {
1744
- return {
1745
- ...(input.logGroupName !== undefined && input.logGroupName !== null && { logGroupName: input.logGroupName }),
1746
- ...(input.logStreamNamePrefix !== undefined &&
1747
- input.logStreamNamePrefix !== null && { logStreamNamePrefix: input.logStreamNamePrefix }),
1748
- };
1749
- };
1750
-
1751
- const serializeAws_restJson1Configuration = (input: Configuration, context: __SerdeContext): any => {
1752
- return {
1753
- ...(input.classification !== undefined &&
1754
- input.classification !== null && { classification: input.classification }),
1755
- ...(input.configurations !== undefined &&
1756
- input.configurations !== null && {
1757
- configurations: serializeAws_restJson1ConfigurationList(input.configurations, context),
1758
- }),
1759
- ...(input.properties !== undefined &&
1760
- input.properties !== null && {
1761
- properties: serializeAws_restJson1SensitivePropertiesMap(input.properties, context),
1762
- }),
1763
- };
1764
- };
1765
-
1766
- const serializeAws_restJson1ConfigurationList = (input: Configuration[], context: __SerdeContext): any => {
1767
- return input
1768
- .filter((e: any) => e != null)
1769
- .map((entry) => {
1770
- if (entry === null) {
1771
- return null as any;
1772
- }
1773
- return serializeAws_restJson1Configuration(entry, context);
1774
- });
1775
- };
1776
-
1777
- const serializeAws_restJson1ConfigurationOverrides = (input: ConfigurationOverrides, context: __SerdeContext): any => {
1778
- return {
1779
- ...(input.applicationConfiguration !== undefined &&
1780
- input.applicationConfiguration !== null && {
1781
- applicationConfiguration: serializeAws_restJson1ConfigurationList(input.applicationConfiguration, context),
1782
- }),
1783
- ...(input.monitoringConfiguration !== undefined &&
1784
- input.monitoringConfiguration !== null && {
1785
- monitoringConfiguration: serializeAws_restJson1MonitoringConfiguration(input.monitoringConfiguration, context),
1786
- }),
1787
- };
1788
- };
1789
-
1790
- const serializeAws_restJson1ContainerInfo = (input: ContainerInfo, context: __SerdeContext): any => {
1791
- return ContainerInfo.visit(input, {
1792
- eksInfo: (value) => ({ eksInfo: serializeAws_restJson1EksInfo(value, context) }),
1793
- _: (name, value) => ({ name: value } as any),
1794
- });
1795
- };
1796
-
1797
- const serializeAws_restJson1ContainerProvider = (input: ContainerProvider, context: __SerdeContext): any => {
1798
- return {
1799
- ...(input.id !== undefined && input.id !== null && { id: input.id }),
1800
- ...(input.info !== undefined &&
1801
- input.info !== null && { info: serializeAws_restJson1ContainerInfo(input.info, context) }),
1802
- ...(input.type !== undefined && input.type !== null && { type: input.type }),
1803
- };
1804
- };
1805
-
1806
- const serializeAws_restJson1EksInfo = (input: EksInfo, context: __SerdeContext): any => {
1807
- return {
1808
- ...(input.namespace !== undefined && input.namespace !== null && { namespace: input.namespace }),
1809
- };
1810
- };
1811
-
1812
- const serializeAws_restJson1EntryPointArguments = (input: string[], context: __SerdeContext): any => {
1813
- return input
1814
- .filter((e: any) => e != null)
1815
- .map((entry) => {
1816
- if (entry === null) {
1817
- return null as any;
1818
- }
1819
- return entry;
1820
- });
1821
- };
1822
-
1823
- const serializeAws_restJson1JobDriver = (input: JobDriver, context: __SerdeContext): any => {
1824
- return {
1825
- ...(input.sparkSubmitJobDriver !== undefined &&
1826
- input.sparkSubmitJobDriver !== null && {
1827
- sparkSubmitJobDriver: serializeAws_restJson1SparkSubmitJobDriver(input.sparkSubmitJobDriver, context),
1828
- }),
1829
- };
1830
- };
1831
-
1832
- const serializeAws_restJson1MonitoringConfiguration = (
1833
- input: MonitoringConfiguration,
1834
- context: __SerdeContext
1835
- ): any => {
1836
- return {
1837
- ...(input.cloudWatchMonitoringConfiguration !== undefined &&
1838
- input.cloudWatchMonitoringConfiguration !== null && {
1839
- cloudWatchMonitoringConfiguration: serializeAws_restJson1CloudWatchMonitoringConfiguration(
1840
- input.cloudWatchMonitoringConfiguration,
1841
- context
1842
- ),
1843
- }),
1844
- ...(input.persistentAppUI !== undefined &&
1845
- input.persistentAppUI !== null && { persistentAppUI: input.persistentAppUI }),
1846
- ...(input.s3MonitoringConfiguration !== undefined &&
1847
- input.s3MonitoringConfiguration !== null && {
1848
- s3MonitoringConfiguration: serializeAws_restJson1S3MonitoringConfiguration(
1849
- input.s3MonitoringConfiguration,
1850
- context
1851
- ),
1852
- }),
1853
- };
1854
- };
1855
-
1856
- const serializeAws_restJson1S3MonitoringConfiguration = (
1857
- input: S3MonitoringConfiguration,
1858
- context: __SerdeContext
1859
- ): any => {
1860
- return {
1861
- ...(input.logUri !== undefined && input.logUri !== null && { logUri: input.logUri }),
1862
- };
1863
- };
1864
-
1865
- const serializeAws_restJson1SensitivePropertiesMap = (
1866
- input: { [key: string]: string },
1867
- context: __SerdeContext
1868
- ): any => {
1869
- return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
1870
- if (value === null) {
1871
- return acc;
1872
- }
1873
- return {
1874
- ...acc,
1875
- [key]: value,
1876
- };
1877
- }, {});
1878
- };
1879
-
1880
- const serializeAws_restJson1SparkSubmitJobDriver = (input: SparkSubmitJobDriver, context: __SerdeContext): any => {
1881
- return {
1882
- ...(input.entryPoint !== undefined && input.entryPoint !== null && { entryPoint: input.entryPoint }),
1883
- ...(input.entryPointArguments !== undefined &&
1884
- input.entryPointArguments !== null && {
1885
- entryPointArguments: serializeAws_restJson1EntryPointArguments(input.entryPointArguments, context),
1886
- }),
1887
- ...(input.sparkSubmitParameters !== undefined &&
1888
- input.sparkSubmitParameters !== null && { sparkSubmitParameters: input.sparkSubmitParameters }),
1889
- };
1890
- };
1891
-
1892
- const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => {
1893
- return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
1894
- if (value === null) {
1895
- return acc;
1896
- }
1897
- return {
1898
- ...acc,
1899
- [key]: value,
1900
- };
1901
- }, {});
1902
- };
1903
-
1904
- const deserializeAws_restJson1CloudWatchMonitoringConfiguration = (
1905
- output: any,
1906
- context: __SerdeContext
1907
- ): CloudWatchMonitoringConfiguration => {
1908
- return {
1909
- logGroupName: __expectString(output.logGroupName),
1910
- logStreamNamePrefix: __expectString(output.logStreamNamePrefix),
1911
- } as any;
1912
- };
1913
-
1914
- const deserializeAws_restJson1Configuration = (output: any, context: __SerdeContext): Configuration => {
1915
- return {
1916
- classification: __expectString(output.classification),
1917
- configurations:
1918
- output.configurations !== undefined && output.configurations !== null
1919
- ? deserializeAws_restJson1ConfigurationList(output.configurations, context)
1920
- : undefined,
1921
- properties:
1922
- output.properties !== undefined && output.properties !== null
1923
- ? deserializeAws_restJson1SensitivePropertiesMap(output.properties, context)
1924
- : undefined,
1925
- } as any;
1926
- };
1927
-
1928
- const deserializeAws_restJson1ConfigurationList = (output: any, context: __SerdeContext): Configuration[] => {
1929
- return (output || [])
1930
- .filter((e: any) => e != null)
1931
- .map((entry: any) => {
1932
- if (entry === null) {
1933
- return null as any;
1934
- }
1935
- return deserializeAws_restJson1Configuration(entry, context);
1936
- });
1937
- };
1938
-
1939
- const deserializeAws_restJson1ConfigurationOverrides = (
1940
- output: any,
1941
- context: __SerdeContext
1942
- ): ConfigurationOverrides => {
1943
- return {
1944
- applicationConfiguration:
1945
- output.applicationConfiguration !== undefined && output.applicationConfiguration !== null
1946
- ? deserializeAws_restJson1ConfigurationList(output.applicationConfiguration, context)
1947
- : undefined,
1948
- monitoringConfiguration:
1949
- output.monitoringConfiguration !== undefined && output.monitoringConfiguration !== null
1950
- ? deserializeAws_restJson1MonitoringConfiguration(output.monitoringConfiguration, context)
1951
- : undefined,
1952
- } as any;
1953
- };
1954
-
1955
- const deserializeAws_restJson1ContainerInfo = (output: any, context: __SerdeContext): ContainerInfo => {
1956
- if (output.eksInfo !== undefined && output.eksInfo !== null) {
1957
- return {
1958
- eksInfo: deserializeAws_restJson1EksInfo(output.eksInfo, context),
1959
- };
1960
- }
1961
- return { $unknown: Object.entries(output)[0] };
1962
- };
1963
-
1964
- const deserializeAws_restJson1ContainerProvider = (output: any, context: __SerdeContext): ContainerProvider => {
1965
- return {
1966
- id: __expectString(output.id),
1967
- info:
1968
- output.info !== undefined && output.info !== null
1969
- ? deserializeAws_restJson1ContainerInfo(__expectUnion(output.info), context)
1970
- : undefined,
1971
- type: __expectString(output.type),
1972
- } as any;
1973
- };
1974
-
1975
- const deserializeAws_restJson1EksInfo = (output: any, context: __SerdeContext): EksInfo => {
1976
- return {
1977
- namespace: __expectString(output.namespace),
1978
- } as any;
1979
- };
1980
-
1981
- const deserializeAws_restJson1Endpoint = (output: any, context: __SerdeContext): Endpoint => {
1982
- return {
1983
- arn: __expectString(output.arn),
1984
- certificateArn: __expectString(output.certificateArn),
1985
- configurationOverrides:
1986
- output.configurationOverrides !== undefined && output.configurationOverrides !== null
1987
- ? deserializeAws_restJson1ConfigurationOverrides(output.configurationOverrides, context)
1988
- : undefined,
1989
- createdAt:
1990
- output.createdAt !== undefined && output.createdAt !== null
1991
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createdAt)))
1992
- : undefined,
1993
- executionRoleArn: __expectString(output.executionRoleArn),
1994
- failureReason: __expectString(output.failureReason),
1995
- id: __expectString(output.id),
1996
- name: __expectString(output.name),
1997
- releaseLabel: __expectString(output.releaseLabel),
1998
- securityGroup: __expectString(output.securityGroup),
1999
- serverUrl: __expectString(output.serverUrl),
2000
- state: __expectString(output.state),
2001
- stateDetails: __expectString(output.stateDetails),
2002
- subnetIds:
2003
- output.subnetIds !== undefined && output.subnetIds !== null
2004
- ? deserializeAws_restJson1SubnetIds(output.subnetIds, context)
2005
- : undefined,
2006
- tags:
2007
- output.tags !== undefined && output.tags !== null
2008
- ? deserializeAws_restJson1TagMap(output.tags, context)
2009
- : undefined,
2010
- type: __expectString(output.type),
2011
- virtualClusterId: __expectString(output.virtualClusterId),
2012
- } as any;
2013
- };
2014
-
2015
- const deserializeAws_restJson1Endpoints = (output: any, context: __SerdeContext): Endpoint[] => {
2016
- return (output || [])
2017
- .filter((e: any) => e != null)
2018
- .map((entry: any) => {
2019
- if (entry === null) {
2020
- return null as any;
2021
- }
2022
- return deserializeAws_restJson1Endpoint(entry, context);
2023
- });
2024
- };
2025
-
2026
- const deserializeAws_restJson1EntryPointArguments = (output: any, context: __SerdeContext): string[] => {
2027
- return (output || [])
2028
- .filter((e: any) => e != null)
2029
- .map((entry: any) => {
2030
- if (entry === null) {
2031
- return null as any;
2032
- }
2033
- return __expectString(entry) as any;
2034
- });
2035
- };
2036
-
2037
- const deserializeAws_restJson1JobDriver = (output: any, context: __SerdeContext): JobDriver => {
2038
- return {
2039
- sparkSubmitJobDriver:
2040
- output.sparkSubmitJobDriver !== undefined && output.sparkSubmitJobDriver !== null
2041
- ? deserializeAws_restJson1SparkSubmitJobDriver(output.sparkSubmitJobDriver, context)
2042
- : undefined,
2043
- } as any;
2044
- };
2045
-
2046
- const deserializeAws_restJson1JobRun = (output: any, context: __SerdeContext): JobRun => {
2047
- return {
2048
- arn: __expectString(output.arn),
2049
- clientToken: __expectString(output.clientToken),
2050
- configurationOverrides:
2051
- output.configurationOverrides !== undefined && output.configurationOverrides !== null
2052
- ? deserializeAws_restJson1ConfigurationOverrides(output.configurationOverrides, context)
2053
- : undefined,
2054
- createdAt:
2055
- output.createdAt !== undefined && output.createdAt !== null
2056
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createdAt)))
2057
- : undefined,
2058
- createdBy: __expectString(output.createdBy),
2059
- executionRoleArn: __expectString(output.executionRoleArn),
2060
- failureReason: __expectString(output.failureReason),
2061
- finishedAt:
2062
- output.finishedAt !== undefined && output.finishedAt !== null
2063
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.finishedAt)))
2064
- : undefined,
2065
- id: __expectString(output.id),
2066
- jobDriver:
2067
- output.jobDriver !== undefined && output.jobDriver !== null
2068
- ? deserializeAws_restJson1JobDriver(output.jobDriver, context)
2069
- : undefined,
2070
- name: __expectString(output.name),
2071
- releaseLabel: __expectString(output.releaseLabel),
2072
- state: __expectString(output.state),
2073
- stateDetails: __expectString(output.stateDetails),
2074
- tags:
2075
- output.tags !== undefined && output.tags !== null
2076
- ? deserializeAws_restJson1TagMap(output.tags, context)
2077
- : undefined,
2078
- virtualClusterId: __expectString(output.virtualClusterId),
2079
- } as any;
2080
- };
2081
-
2082
- const deserializeAws_restJson1JobRuns = (output: any, context: __SerdeContext): JobRun[] => {
2083
- return (output || [])
2084
- .filter((e: any) => e != null)
2085
- .map((entry: any) => {
2086
- if (entry === null) {
2087
- return null as any;
2088
- }
2089
- return deserializeAws_restJson1JobRun(entry, context);
2090
- });
2091
- };
2092
-
2093
- const deserializeAws_restJson1MonitoringConfiguration = (
2094
- output: any,
2095
- context: __SerdeContext
2096
- ): MonitoringConfiguration => {
2097
- return {
2098
- cloudWatchMonitoringConfiguration:
2099
- output.cloudWatchMonitoringConfiguration !== undefined && output.cloudWatchMonitoringConfiguration !== null
2100
- ? deserializeAws_restJson1CloudWatchMonitoringConfiguration(output.cloudWatchMonitoringConfiguration, context)
2101
- : undefined,
2102
- persistentAppUI: __expectString(output.persistentAppUI),
2103
- s3MonitoringConfiguration:
2104
- output.s3MonitoringConfiguration !== undefined && output.s3MonitoringConfiguration !== null
2105
- ? deserializeAws_restJson1S3MonitoringConfiguration(output.s3MonitoringConfiguration, context)
2106
- : undefined,
2107
- } as any;
2108
- };
2109
-
2110
- const deserializeAws_restJson1S3MonitoringConfiguration = (
2111
- output: any,
2112
- context: __SerdeContext
2113
- ): S3MonitoringConfiguration => {
2114
- return {
2115
- logUri: __expectString(output.logUri),
2116
- } as any;
2117
- };
2118
-
2119
- const deserializeAws_restJson1SensitivePropertiesMap = (
2120
- output: any,
2121
- context: __SerdeContext
2122
- ): { [key: string]: string } => {
2123
- return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {
2124
- if (value === null) {
2125
- return acc;
2126
- }
2127
- return {
2128
- ...acc,
2129
- [key]: __expectString(value) as any,
2130
- };
2131
- }, {});
2132
- };
2133
-
2134
- const deserializeAws_restJson1SparkSubmitJobDriver = (output: any, context: __SerdeContext): SparkSubmitJobDriver => {
2135
- return {
2136
- entryPoint: __expectString(output.entryPoint),
2137
- entryPointArguments:
2138
- output.entryPointArguments !== undefined && output.entryPointArguments !== null
2139
- ? deserializeAws_restJson1EntryPointArguments(output.entryPointArguments, context)
2140
- : undefined,
2141
- sparkSubmitParameters: __expectString(output.sparkSubmitParameters),
2142
- } as any;
2143
- };
2144
-
2145
- const deserializeAws_restJson1SubnetIds = (output: any, context: __SerdeContext): string[] => {
2146
- return (output || [])
2147
- .filter((e: any) => e != null)
2148
- .map((entry: any) => {
2149
- if (entry === null) {
2150
- return null as any;
2151
- }
2152
- return __expectString(entry) as any;
2153
- });
2154
- };
2155
-
2156
- const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => {
2157
- return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {
2158
- if (value === null) {
2159
- return acc;
2160
- }
2161
- return {
2162
- ...acc,
2163
- [key]: __expectString(value) as any,
2164
- };
2165
- }, {});
2166
- };
2167
-
2168
- const deserializeAws_restJson1VirtualCluster = (output: any, context: __SerdeContext): VirtualCluster => {
2169
- return {
2170
- arn: __expectString(output.arn),
2171
- containerProvider:
2172
- output.containerProvider !== undefined && output.containerProvider !== null
2173
- ? deserializeAws_restJson1ContainerProvider(output.containerProvider, context)
2174
- : undefined,
2175
- createdAt:
2176
- output.createdAt !== undefined && output.createdAt !== null
2177
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createdAt)))
2178
- : undefined,
2179
- id: __expectString(output.id),
2180
- name: __expectString(output.name),
2181
- state: __expectString(output.state),
2182
- tags:
2183
- output.tags !== undefined && output.tags !== null
2184
- ? deserializeAws_restJson1TagMap(output.tags, context)
2185
- : undefined,
2186
- } as any;
2187
- };
2188
-
2189
- const deserializeAws_restJson1VirtualClusters = (output: any, context: __SerdeContext): VirtualCluster[] => {
2190
- return (output || [])
2191
- .filter((e: any) => e != null)
2192
- .map((entry: any) => {
2193
- if (entry === null) {
2194
- return null as any;
2195
- }
2196
- return deserializeAws_restJson1VirtualCluster(entry, context);
2197
- });
2198
- };
2199
-
2200
- const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
2201
- httpStatusCode: output.statusCode,
2202
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
2203
- extendedRequestId: output.headers["x-amz-id-2"],
2204
- cfId: output.headers["x-amz-cf-id"],
2205
- });
2206
-
2207
- // Collect low-level response body stream to Uint8Array.
2208
- const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
2209
- if (streamBody instanceof Uint8Array) {
2210
- return Promise.resolve(streamBody);
2211
- }
2212
- return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
2213
- };
2214
-
2215
- // Encode Uint8Array data into string with utf-8.
2216
- const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
2217
- collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
2218
-
2219
- const isSerializableHeaderValue = (value: any): boolean =>
2220
- value !== undefined &&
2221
- value !== null &&
2222
- value !== "" &&
2223
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
2224
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
2225
-
2226
- const parseBody = (streamBody: any, context: __SerdeContext): any =>
2227
- collectBodyString(streamBody, context).then((encoded) => {
2228
- if (encoded.length) {
2229
- return JSON.parse(encoded);
2230
- }
2231
- return {};
2232
- });
2233
-
2234
- /**
2235
- * Load an error code for the aws.rest-json-1.1 protocol.
2236
- */
2237
- const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => {
2238
- const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
2239
-
2240
- const sanitizeErrorCode = (rawValue: string): string => {
2241
- let cleanValue = rawValue;
2242
- if (cleanValue.indexOf(":") >= 0) {
2243
- cleanValue = cleanValue.split(":")[0];
2244
- }
2245
- if (cleanValue.indexOf("#") >= 0) {
2246
- cleanValue = cleanValue.split("#")[1];
2247
- }
2248
- return cleanValue;
2249
- };
2250
-
2251
- const headerKey = findKey(output.headers, "x-amzn-errortype");
2252
- if (headerKey !== undefined) {
2253
- return sanitizeErrorCode(output.headers[headerKey]);
2254
- }
2255
-
2256
- if (data.code !== undefined) {
2257
- return sanitizeErrorCode(data.code);
2258
- }
2259
-
2260
- if (data["__type"] !== undefined) {
2261
- return sanitizeErrorCode(data["__type"]);
2262
- }
2263
-
2264
- return "";
2265
- };