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