@aws-sdk/client-m2 3.107.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 (228) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE +201 -0
  3. package/README.md +209 -0
  4. package/dist-cjs/M2.js +487 -0
  5. package/dist-cjs/M2Client.js +37 -0
  6. package/dist-cjs/commands/CancelBatchJobExecutionCommand.js +36 -0
  7. package/dist-cjs/commands/CreateApplicationCommand.js +36 -0
  8. package/dist-cjs/commands/CreateDataSetImportTaskCommand.js +36 -0
  9. package/dist-cjs/commands/CreateDeploymentCommand.js +36 -0
  10. package/dist-cjs/commands/CreateEnvironmentCommand.js +36 -0
  11. package/dist-cjs/commands/DeleteApplicationCommand.js +36 -0
  12. package/dist-cjs/commands/DeleteApplicationFromEnvironmentCommand.js +36 -0
  13. package/dist-cjs/commands/DeleteEnvironmentCommand.js +36 -0
  14. package/dist-cjs/commands/GetApplicationCommand.js +36 -0
  15. package/dist-cjs/commands/GetApplicationVersionCommand.js +36 -0
  16. package/dist-cjs/commands/GetBatchJobExecutionCommand.js +36 -0
  17. package/dist-cjs/commands/GetDataSetDetailsCommand.js +36 -0
  18. package/dist-cjs/commands/GetDataSetImportTaskCommand.js +36 -0
  19. package/dist-cjs/commands/GetDeploymentCommand.js +36 -0
  20. package/dist-cjs/commands/GetEnvironmentCommand.js +36 -0
  21. package/dist-cjs/commands/ListApplicationVersionsCommand.js +36 -0
  22. package/dist-cjs/commands/ListApplicationsCommand.js +36 -0
  23. package/dist-cjs/commands/ListBatchJobDefinitionsCommand.js +36 -0
  24. package/dist-cjs/commands/ListBatchJobExecutionsCommand.js +36 -0
  25. package/dist-cjs/commands/ListDataSetImportHistoryCommand.js +36 -0
  26. package/dist-cjs/commands/ListDataSetsCommand.js +36 -0
  27. package/dist-cjs/commands/ListDeploymentsCommand.js +36 -0
  28. package/dist-cjs/commands/ListEngineVersionsCommand.js +36 -0
  29. package/dist-cjs/commands/ListEnvironmentsCommand.js +36 -0
  30. package/dist-cjs/commands/ListTagsForResourceCommand.js +36 -0
  31. package/dist-cjs/commands/StartApplicationCommand.js +36 -0
  32. package/dist-cjs/commands/StartBatchJobCommand.js +36 -0
  33. package/dist-cjs/commands/StopApplicationCommand.js +36 -0
  34. package/dist-cjs/commands/TagResourceCommand.js +36 -0
  35. package/dist-cjs/commands/UntagResourceCommand.js +36 -0
  36. package/dist-cjs/commands/UpdateApplicationCommand.js +36 -0
  37. package/dist-cjs/commands/UpdateEnvironmentCommand.js +36 -0
  38. package/dist-cjs/commands/index.js +35 -0
  39. package/dist-cjs/endpoints.js +131 -0
  40. package/dist-cjs/index.js +11 -0
  41. package/dist-cjs/models/M2ServiceException.js +11 -0
  42. package/dist-cjs/models/index.js +4 -0
  43. package/dist-cjs/models/models_0.js +911 -0
  44. package/dist-cjs/pagination/Interfaces.js +2 -0
  45. package/dist-cjs/pagination/ListApplicationVersionsPaginator.js +36 -0
  46. package/dist-cjs/pagination/ListApplicationsPaginator.js +36 -0
  47. package/dist-cjs/pagination/ListBatchJobDefinitionsPaginator.js +36 -0
  48. package/dist-cjs/pagination/ListBatchJobExecutionsPaginator.js +36 -0
  49. package/dist-cjs/pagination/ListDataSetImportHistoryPaginator.js +36 -0
  50. package/dist-cjs/pagination/ListDataSetsPaginator.js +36 -0
  51. package/dist-cjs/pagination/ListDeploymentsPaginator.js +36 -0
  52. package/dist-cjs/pagination/ListEngineVersionsPaginator.js +36 -0
  53. package/dist-cjs/pagination/ListEnvironmentsPaginator.js +36 -0
  54. package/dist-cjs/pagination/index.js +13 -0
  55. package/dist-cjs/protocols/Aws_restJson1.js +3744 -0
  56. package/dist-cjs/runtimeConfig.browser.js +45 -0
  57. package/dist-cjs/runtimeConfig.js +52 -0
  58. package/dist-cjs/runtimeConfig.native.js +16 -0
  59. package/dist-cjs/runtimeConfig.shared.js +17 -0
  60. package/dist-es/M2.js +490 -0
  61. package/dist-es/M2Client.js +39 -0
  62. package/dist-es/commands/CancelBatchJobExecutionCommand.js +39 -0
  63. package/dist-es/commands/CreateApplicationCommand.js +39 -0
  64. package/dist-es/commands/CreateDataSetImportTaskCommand.js +39 -0
  65. package/dist-es/commands/CreateDeploymentCommand.js +39 -0
  66. package/dist-es/commands/CreateEnvironmentCommand.js +39 -0
  67. package/dist-es/commands/DeleteApplicationCommand.js +39 -0
  68. package/dist-es/commands/DeleteApplicationFromEnvironmentCommand.js +39 -0
  69. package/dist-es/commands/DeleteEnvironmentCommand.js +39 -0
  70. package/dist-es/commands/GetApplicationCommand.js +39 -0
  71. package/dist-es/commands/GetApplicationVersionCommand.js +39 -0
  72. package/dist-es/commands/GetBatchJobExecutionCommand.js +39 -0
  73. package/dist-es/commands/GetDataSetDetailsCommand.js +39 -0
  74. package/dist-es/commands/GetDataSetImportTaskCommand.js +39 -0
  75. package/dist-es/commands/GetDeploymentCommand.js +39 -0
  76. package/dist-es/commands/GetEnvironmentCommand.js +39 -0
  77. package/dist-es/commands/ListApplicationVersionsCommand.js +39 -0
  78. package/dist-es/commands/ListApplicationsCommand.js +39 -0
  79. package/dist-es/commands/ListBatchJobDefinitionsCommand.js +39 -0
  80. package/dist-es/commands/ListBatchJobExecutionsCommand.js +39 -0
  81. package/dist-es/commands/ListDataSetImportHistoryCommand.js +39 -0
  82. package/dist-es/commands/ListDataSetsCommand.js +39 -0
  83. package/dist-es/commands/ListDeploymentsCommand.js +39 -0
  84. package/dist-es/commands/ListEngineVersionsCommand.js +39 -0
  85. package/dist-es/commands/ListEnvironmentsCommand.js +39 -0
  86. package/dist-es/commands/ListTagsForResourceCommand.js +39 -0
  87. package/dist-es/commands/StartApplicationCommand.js +39 -0
  88. package/dist-es/commands/StartBatchJobCommand.js +39 -0
  89. package/dist-es/commands/StopApplicationCommand.js +39 -0
  90. package/dist-es/commands/TagResourceCommand.js +39 -0
  91. package/dist-es/commands/UntagResourceCommand.js +39 -0
  92. package/dist-es/commands/UpdateApplicationCommand.js +39 -0
  93. package/dist-es/commands/UpdateEnvironmentCommand.js +39 -0
  94. package/dist-es/commands/index.js +32 -0
  95. package/dist-es/endpoints.js +127 -0
  96. package/dist-es/index.js +6 -0
  97. package/dist-es/models/M2ServiceException.js +12 -0
  98. package/dist-es/models/index.js +1 -0
  99. package/dist-es/models/models_0.js +709 -0
  100. package/dist-es/pagination/Interfaces.js +1 -0
  101. package/dist-es/pagination/ListApplicationVersionsPaginator.js +75 -0
  102. package/dist-es/pagination/ListApplicationsPaginator.js +75 -0
  103. package/dist-es/pagination/ListBatchJobDefinitionsPaginator.js +75 -0
  104. package/dist-es/pagination/ListBatchJobExecutionsPaginator.js +75 -0
  105. package/dist-es/pagination/ListDataSetImportHistoryPaginator.js +75 -0
  106. package/dist-es/pagination/ListDataSetsPaginator.js +75 -0
  107. package/dist-es/pagination/ListDeploymentsPaginator.js +75 -0
  108. package/dist-es/pagination/ListEngineVersionsPaginator.js +75 -0
  109. package/dist-es/pagination/ListEnvironmentsPaginator.js +75 -0
  110. package/dist-es/pagination/index.js +10 -0
  111. package/dist-es/protocols/Aws_restJson1.js +4508 -0
  112. package/dist-es/runtimeConfig.browser.js +26 -0
  113. package/dist-es/runtimeConfig.js +30 -0
  114. package/dist-es/runtimeConfig.native.js +8 -0
  115. package/dist-es/runtimeConfig.shared.js +13 -0
  116. package/dist-types/M2.d.ts +250 -0
  117. package/dist-types/M2Client.d.ts +180 -0
  118. package/dist-types/commands/CancelBatchJobExecutionCommand.d.ts +35 -0
  119. package/dist-types/commands/CreateApplicationCommand.d.ts +36 -0
  120. package/dist-types/commands/CreateDataSetImportTaskCommand.d.ts +35 -0
  121. package/dist-types/commands/CreateDeploymentCommand.d.ts +35 -0
  122. package/dist-types/commands/CreateEnvironmentCommand.d.ts +35 -0
  123. package/dist-types/commands/DeleteApplicationCommand.d.ts +35 -0
  124. package/dist-types/commands/DeleteApplicationFromEnvironmentCommand.d.ts +38 -0
  125. package/dist-types/commands/DeleteEnvironmentCommand.d.ts +36 -0
  126. package/dist-types/commands/GetApplicationCommand.d.ts +35 -0
  127. package/dist-types/commands/GetApplicationVersionCommand.d.ts +35 -0
  128. package/dist-types/commands/GetBatchJobExecutionCommand.d.ts +35 -0
  129. package/dist-types/commands/GetDataSetDetailsCommand.d.ts +35 -0
  130. package/dist-types/commands/GetDataSetImportTaskCommand.d.ts +35 -0
  131. package/dist-types/commands/GetDeploymentCommand.d.ts +35 -0
  132. package/dist-types/commands/GetEnvironmentCommand.d.ts +35 -0
  133. package/dist-types/commands/ListApplicationVersionsCommand.d.ts +35 -0
  134. package/dist-types/commands/ListApplicationsCommand.d.ts +37 -0
  135. package/dist-types/commands/ListBatchJobDefinitionsCommand.d.ts +37 -0
  136. package/dist-types/commands/ListBatchJobExecutionsCommand.d.ts +36 -0
  137. package/dist-types/commands/ListDataSetImportHistoryCommand.d.ts +35 -0
  138. package/dist-types/commands/ListDataSetsCommand.d.ts +37 -0
  139. package/dist-types/commands/ListDeploymentsCommand.d.ts +37 -0
  140. package/dist-types/commands/ListEngineVersionsCommand.d.ts +35 -0
  141. package/dist-types/commands/ListEnvironmentsCommand.d.ts +35 -0
  142. package/dist-types/commands/ListTagsForResourceCommand.d.ts +35 -0
  143. package/dist-types/commands/StartApplicationCommand.d.ts +35 -0
  144. package/dist-types/commands/StartBatchJobCommand.d.ts +36 -0
  145. package/dist-types/commands/StopApplicationCommand.d.ts +35 -0
  146. package/dist-types/commands/TagResourceCommand.d.ts +35 -0
  147. package/dist-types/commands/UntagResourceCommand.d.ts +35 -0
  148. package/dist-types/commands/UpdateApplicationCommand.d.ts +35 -0
  149. package/dist-types/commands/UpdateEnvironmentCommand.d.ts +35 -0
  150. package/dist-types/commands/index.d.ts +32 -0
  151. package/dist-types/endpoints.d.ts +2 -0
  152. package/dist-types/index.d.ts +6 -0
  153. package/dist-types/models/M2ServiceException.d.ts +10 -0
  154. package/dist-types/models/index.d.ts +1 -0
  155. package/dist-types/models/models_0.d.ts +2682 -0
  156. package/dist-types/pagination/Interfaces.d.ts +6 -0
  157. package/dist-types/pagination/ListApplicationVersionsPaginator.d.ts +4 -0
  158. package/dist-types/pagination/ListApplicationsPaginator.d.ts +4 -0
  159. package/dist-types/pagination/ListBatchJobDefinitionsPaginator.d.ts +4 -0
  160. package/dist-types/pagination/ListBatchJobExecutionsPaginator.d.ts +4 -0
  161. package/dist-types/pagination/ListDataSetImportHistoryPaginator.d.ts +4 -0
  162. package/dist-types/pagination/ListDataSetsPaginator.d.ts +4 -0
  163. package/dist-types/pagination/ListDeploymentsPaginator.d.ts +4 -0
  164. package/dist-types/pagination/ListEngineVersionsPaginator.d.ts +4 -0
  165. package/dist-types/pagination/ListEnvironmentsPaginator.d.ts +4 -0
  166. package/dist-types/pagination/index.d.ts +10 -0
  167. package/dist-types/protocols/Aws_restJson1.d.ts +98 -0
  168. package/dist-types/runtimeConfig.browser.d.ts +40 -0
  169. package/dist-types/runtimeConfig.d.ts +40 -0
  170. package/dist-types/runtimeConfig.native.d.ts +39 -0
  171. package/dist-types/runtimeConfig.shared.d.ts +13 -0
  172. package/dist-types/ts3.4/M2.d.ts +165 -0
  173. package/dist-types/ts3.4/M2Client.d.ts +105 -0
  174. package/dist-types/ts3.4/commands/CancelBatchJobExecutionCommand.d.ts +17 -0
  175. package/dist-types/ts3.4/commands/CreateApplicationCommand.d.ts +17 -0
  176. package/dist-types/ts3.4/commands/CreateDataSetImportTaskCommand.d.ts +17 -0
  177. package/dist-types/ts3.4/commands/CreateDeploymentCommand.d.ts +17 -0
  178. package/dist-types/ts3.4/commands/CreateEnvironmentCommand.d.ts +17 -0
  179. package/dist-types/ts3.4/commands/DeleteApplicationCommand.d.ts +17 -0
  180. package/dist-types/ts3.4/commands/DeleteApplicationFromEnvironmentCommand.d.ts +17 -0
  181. package/dist-types/ts3.4/commands/DeleteEnvironmentCommand.d.ts +17 -0
  182. package/dist-types/ts3.4/commands/GetApplicationCommand.d.ts +17 -0
  183. package/dist-types/ts3.4/commands/GetApplicationVersionCommand.d.ts +17 -0
  184. package/dist-types/ts3.4/commands/GetBatchJobExecutionCommand.d.ts +17 -0
  185. package/dist-types/ts3.4/commands/GetDataSetDetailsCommand.d.ts +17 -0
  186. package/dist-types/ts3.4/commands/GetDataSetImportTaskCommand.d.ts +17 -0
  187. package/dist-types/ts3.4/commands/GetDeploymentCommand.d.ts +17 -0
  188. package/dist-types/ts3.4/commands/GetEnvironmentCommand.d.ts +17 -0
  189. package/dist-types/ts3.4/commands/ListApplicationVersionsCommand.d.ts +17 -0
  190. package/dist-types/ts3.4/commands/ListApplicationsCommand.d.ts +17 -0
  191. package/dist-types/ts3.4/commands/ListBatchJobDefinitionsCommand.d.ts +17 -0
  192. package/dist-types/ts3.4/commands/ListBatchJobExecutionsCommand.d.ts +17 -0
  193. package/dist-types/ts3.4/commands/ListDataSetImportHistoryCommand.d.ts +17 -0
  194. package/dist-types/ts3.4/commands/ListDataSetsCommand.d.ts +17 -0
  195. package/dist-types/ts3.4/commands/ListDeploymentsCommand.d.ts +17 -0
  196. package/dist-types/ts3.4/commands/ListEngineVersionsCommand.d.ts +17 -0
  197. package/dist-types/ts3.4/commands/ListEnvironmentsCommand.d.ts +17 -0
  198. package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +17 -0
  199. package/dist-types/ts3.4/commands/StartApplicationCommand.d.ts +17 -0
  200. package/dist-types/ts3.4/commands/StartBatchJobCommand.d.ts +17 -0
  201. package/dist-types/ts3.4/commands/StopApplicationCommand.d.ts +17 -0
  202. package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +17 -0
  203. package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +17 -0
  204. package/dist-types/ts3.4/commands/UpdateApplicationCommand.d.ts +17 -0
  205. package/dist-types/ts3.4/commands/UpdateEnvironmentCommand.d.ts +17 -0
  206. package/dist-types/ts3.4/commands/index.d.ts +32 -0
  207. package/dist-types/ts3.4/endpoints.d.ts +2 -0
  208. package/dist-types/ts3.4/index.d.ts +6 -0
  209. package/dist-types/ts3.4/models/M2ServiceException.d.ts +6 -0
  210. package/dist-types/ts3.4/models/index.d.ts +1 -0
  211. package/dist-types/ts3.4/models/models_0.d.ts +1609 -0
  212. package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
  213. package/dist-types/ts3.4/pagination/ListApplicationVersionsPaginator.d.ts +4 -0
  214. package/dist-types/ts3.4/pagination/ListApplicationsPaginator.d.ts +4 -0
  215. package/dist-types/ts3.4/pagination/ListBatchJobDefinitionsPaginator.d.ts +4 -0
  216. package/dist-types/ts3.4/pagination/ListBatchJobExecutionsPaginator.d.ts +4 -0
  217. package/dist-types/ts3.4/pagination/ListDataSetImportHistoryPaginator.d.ts +4 -0
  218. package/dist-types/ts3.4/pagination/ListDataSetsPaginator.d.ts +4 -0
  219. package/dist-types/ts3.4/pagination/ListDeploymentsPaginator.d.ts +4 -0
  220. package/dist-types/ts3.4/pagination/ListEngineVersionsPaginator.d.ts +4 -0
  221. package/dist-types/ts3.4/pagination/ListEnvironmentsPaginator.d.ts +4 -0
  222. package/dist-types/ts3.4/pagination/index.d.ts +10 -0
  223. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +98 -0
  224. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +38 -0
  225. package/dist-types/ts3.4/runtimeConfig.d.ts +38 -0
  226. package/dist-types/ts3.4/runtimeConfig.native.d.ts +37 -0
  227. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +11 -0
  228. package/package.json +96 -0
@@ -0,0 +1,3744 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deserializeAws_restJson1ListBatchJobDefinitionsCommand = exports.deserializeAws_restJson1ListApplicationVersionsCommand = exports.deserializeAws_restJson1ListApplicationsCommand = exports.deserializeAws_restJson1GetEnvironmentCommand = exports.deserializeAws_restJson1GetDeploymentCommand = exports.deserializeAws_restJson1GetDataSetImportTaskCommand = exports.deserializeAws_restJson1GetDataSetDetailsCommand = exports.deserializeAws_restJson1GetBatchJobExecutionCommand = exports.deserializeAws_restJson1GetApplicationVersionCommand = exports.deserializeAws_restJson1GetApplicationCommand = exports.deserializeAws_restJson1DeleteEnvironmentCommand = exports.deserializeAws_restJson1DeleteApplicationFromEnvironmentCommand = exports.deserializeAws_restJson1DeleteApplicationCommand = exports.deserializeAws_restJson1CreateEnvironmentCommand = exports.deserializeAws_restJson1CreateDeploymentCommand = exports.deserializeAws_restJson1CreateDataSetImportTaskCommand = exports.deserializeAws_restJson1CreateApplicationCommand = exports.deserializeAws_restJson1CancelBatchJobExecutionCommand = exports.serializeAws_restJson1UpdateEnvironmentCommand = exports.serializeAws_restJson1UpdateApplicationCommand = exports.serializeAws_restJson1UntagResourceCommand = exports.serializeAws_restJson1TagResourceCommand = exports.serializeAws_restJson1StopApplicationCommand = exports.serializeAws_restJson1StartBatchJobCommand = exports.serializeAws_restJson1StartApplicationCommand = exports.serializeAws_restJson1ListTagsForResourceCommand = exports.serializeAws_restJson1ListEnvironmentsCommand = exports.serializeAws_restJson1ListEngineVersionsCommand = exports.serializeAws_restJson1ListDeploymentsCommand = exports.serializeAws_restJson1ListDataSetsCommand = exports.serializeAws_restJson1ListDataSetImportHistoryCommand = exports.serializeAws_restJson1ListBatchJobExecutionsCommand = exports.serializeAws_restJson1ListBatchJobDefinitionsCommand = exports.serializeAws_restJson1ListApplicationVersionsCommand = exports.serializeAws_restJson1ListApplicationsCommand = exports.serializeAws_restJson1GetEnvironmentCommand = exports.serializeAws_restJson1GetDeploymentCommand = exports.serializeAws_restJson1GetDataSetImportTaskCommand = exports.serializeAws_restJson1GetDataSetDetailsCommand = exports.serializeAws_restJson1GetBatchJobExecutionCommand = exports.serializeAws_restJson1GetApplicationVersionCommand = exports.serializeAws_restJson1GetApplicationCommand = exports.serializeAws_restJson1DeleteEnvironmentCommand = exports.serializeAws_restJson1DeleteApplicationFromEnvironmentCommand = exports.serializeAws_restJson1DeleteApplicationCommand = exports.serializeAws_restJson1CreateEnvironmentCommand = exports.serializeAws_restJson1CreateDeploymentCommand = exports.serializeAws_restJson1CreateDataSetImportTaskCommand = exports.serializeAws_restJson1CreateApplicationCommand = exports.serializeAws_restJson1CancelBatchJobExecutionCommand = void 0;
4
+ exports.deserializeAws_restJson1UpdateEnvironmentCommand = exports.deserializeAws_restJson1UpdateApplicationCommand = exports.deserializeAws_restJson1UntagResourceCommand = exports.deserializeAws_restJson1TagResourceCommand = exports.deserializeAws_restJson1StopApplicationCommand = exports.deserializeAws_restJson1StartBatchJobCommand = exports.deserializeAws_restJson1StartApplicationCommand = exports.deserializeAws_restJson1ListTagsForResourceCommand = exports.deserializeAws_restJson1ListEnvironmentsCommand = exports.deserializeAws_restJson1ListEngineVersionsCommand = exports.deserializeAws_restJson1ListDeploymentsCommand = exports.deserializeAws_restJson1ListDataSetsCommand = exports.deserializeAws_restJson1ListDataSetImportHistoryCommand = exports.deserializeAws_restJson1ListBatchJobExecutionsCommand = void 0;
5
+ const protocol_http_1 = require("@aws-sdk/protocol-http");
6
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
7
+ const uuid_1 = require("uuid");
8
+ const M2ServiceException_1 = require("../models/M2ServiceException");
9
+ const models_0_1 = require("../models/models_0");
10
+ const serializeAws_restJson1CancelBatchJobExecutionCommand = async (input, context) => {
11
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
12
+ const headers = {};
13
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
14
+ "/applications/{applicationId}/batch-job-executions/{executionId}/cancel";
15
+ if (input.applicationId !== undefined) {
16
+ const labelValue = input.applicationId;
17
+ if (labelValue.length <= 0) {
18
+ throw new Error("Empty value provided for input HTTP label: applicationId.");
19
+ }
20
+ resolvedPath = resolvedPath.replace("{applicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
21
+ }
22
+ else {
23
+ throw new Error("No value provided for input HTTP label: applicationId.");
24
+ }
25
+ if (input.executionId !== undefined) {
26
+ const labelValue = input.executionId;
27
+ if (labelValue.length <= 0) {
28
+ throw new Error("Empty value provided for input HTTP label: executionId.");
29
+ }
30
+ resolvedPath = resolvedPath.replace("{executionId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
31
+ }
32
+ else {
33
+ throw new Error("No value provided for input HTTP label: executionId.");
34
+ }
35
+ let body;
36
+ return new protocol_http_1.HttpRequest({
37
+ protocol,
38
+ hostname,
39
+ port,
40
+ method: "POST",
41
+ headers,
42
+ path: resolvedPath,
43
+ body,
44
+ });
45
+ };
46
+ exports.serializeAws_restJson1CancelBatchJobExecutionCommand = serializeAws_restJson1CancelBatchJobExecutionCommand;
47
+ const serializeAws_restJson1CreateApplicationCommand = async (input, context) => {
48
+ var _a;
49
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
50
+ const headers = {
51
+ "content-type": "application/json",
52
+ };
53
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/applications";
54
+ let body;
55
+ body = JSON.stringify({
56
+ clientToken: (_a = input.clientToken) !== null && _a !== void 0 ? _a : (0, uuid_1.v4)(),
57
+ ...(input.definition !== undefined &&
58
+ input.definition !== null && { definition: serializeAws_restJson1Definition(input.definition, context) }),
59
+ ...(input.description !== undefined && input.description !== null && { description: input.description }),
60
+ ...(input.engineType !== undefined && input.engineType !== null && { engineType: input.engineType }),
61
+ ...(input.name !== undefined && input.name !== null && { name: input.name }),
62
+ ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
63
+ });
64
+ return new protocol_http_1.HttpRequest({
65
+ protocol,
66
+ hostname,
67
+ port,
68
+ method: "POST",
69
+ headers,
70
+ path: resolvedPath,
71
+ body,
72
+ });
73
+ };
74
+ exports.serializeAws_restJson1CreateApplicationCommand = serializeAws_restJson1CreateApplicationCommand;
75
+ const serializeAws_restJson1CreateDataSetImportTaskCommand = async (input, context) => {
76
+ var _a;
77
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
78
+ const headers = {
79
+ "content-type": "application/json",
80
+ };
81
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
82
+ "/applications/{applicationId}/dataset-import-task";
83
+ if (input.applicationId !== undefined) {
84
+ const labelValue = input.applicationId;
85
+ if (labelValue.length <= 0) {
86
+ throw new Error("Empty value provided for input HTTP label: applicationId.");
87
+ }
88
+ resolvedPath = resolvedPath.replace("{applicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
89
+ }
90
+ else {
91
+ throw new Error("No value provided for input HTTP label: applicationId.");
92
+ }
93
+ let body;
94
+ body = JSON.stringify({
95
+ clientToken: (_a = input.clientToken) !== null && _a !== void 0 ? _a : (0, uuid_1.v4)(),
96
+ ...(input.importConfig !== undefined &&
97
+ input.importConfig !== null && {
98
+ importConfig: serializeAws_restJson1DataSetImportConfig(input.importConfig, context),
99
+ }),
100
+ });
101
+ return new protocol_http_1.HttpRequest({
102
+ protocol,
103
+ hostname,
104
+ port,
105
+ method: "POST",
106
+ headers,
107
+ path: resolvedPath,
108
+ body,
109
+ });
110
+ };
111
+ exports.serializeAws_restJson1CreateDataSetImportTaskCommand = serializeAws_restJson1CreateDataSetImportTaskCommand;
112
+ const serializeAws_restJson1CreateDeploymentCommand = async (input, context) => {
113
+ var _a;
114
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
115
+ const headers = {
116
+ "content-type": "application/json",
117
+ };
118
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{applicationId}/deployments";
119
+ if (input.applicationId !== undefined) {
120
+ const labelValue = input.applicationId;
121
+ if (labelValue.length <= 0) {
122
+ throw new Error("Empty value provided for input HTTP label: applicationId.");
123
+ }
124
+ resolvedPath = resolvedPath.replace("{applicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
125
+ }
126
+ else {
127
+ throw new Error("No value provided for input HTTP label: applicationId.");
128
+ }
129
+ let body;
130
+ body = JSON.stringify({
131
+ ...(input.applicationVersion !== undefined &&
132
+ input.applicationVersion !== null && { applicationVersion: input.applicationVersion }),
133
+ clientToken: (_a = input.clientToken) !== null && _a !== void 0 ? _a : (0, uuid_1.v4)(),
134
+ ...(input.environmentId !== undefined && input.environmentId !== null && { environmentId: input.environmentId }),
135
+ });
136
+ return new protocol_http_1.HttpRequest({
137
+ protocol,
138
+ hostname,
139
+ port,
140
+ method: "POST",
141
+ headers,
142
+ path: resolvedPath,
143
+ body,
144
+ });
145
+ };
146
+ exports.serializeAws_restJson1CreateDeploymentCommand = serializeAws_restJson1CreateDeploymentCommand;
147
+ const serializeAws_restJson1CreateEnvironmentCommand = async (input, context) => {
148
+ var _a;
149
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
150
+ const headers = {
151
+ "content-type": "application/json",
152
+ };
153
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/environments";
154
+ let body;
155
+ body = JSON.stringify({
156
+ clientToken: (_a = input.clientToken) !== null && _a !== void 0 ? _a : (0, uuid_1.v4)(),
157
+ ...(input.description !== undefined && input.description !== null && { description: input.description }),
158
+ ...(input.engineType !== undefined && input.engineType !== null && { engineType: input.engineType }),
159
+ ...(input.engineVersion !== undefined && input.engineVersion !== null && { engineVersion: input.engineVersion }),
160
+ ...(input.highAvailabilityConfig !== undefined &&
161
+ input.highAvailabilityConfig !== null && {
162
+ highAvailabilityConfig: serializeAws_restJson1HighAvailabilityConfig(input.highAvailabilityConfig, context),
163
+ }),
164
+ ...(input.instanceType !== undefined && input.instanceType !== null && { instanceType: input.instanceType }),
165
+ ...(input.name !== undefined && input.name !== null && { name: input.name }),
166
+ ...(input.preferredMaintenanceWindow !== undefined &&
167
+ input.preferredMaintenanceWindow !== null && { preferredMaintenanceWindow: input.preferredMaintenanceWindow }),
168
+ ...(input.publiclyAccessible !== undefined &&
169
+ input.publiclyAccessible !== null && { publiclyAccessible: input.publiclyAccessible }),
170
+ ...(input.securityGroupIds !== undefined &&
171
+ input.securityGroupIds !== null && {
172
+ securityGroupIds: serializeAws_restJson1String50List(input.securityGroupIds, context),
173
+ }),
174
+ ...(input.storageConfigurations !== undefined &&
175
+ input.storageConfigurations !== null && {
176
+ storageConfigurations: serializeAws_restJson1StorageConfigurationList(input.storageConfigurations, context),
177
+ }),
178
+ ...(input.subnetIds !== undefined &&
179
+ input.subnetIds !== null && { subnetIds: serializeAws_restJson1String50List(input.subnetIds, context) }),
180
+ ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
181
+ });
182
+ return new protocol_http_1.HttpRequest({
183
+ protocol,
184
+ hostname,
185
+ port,
186
+ method: "POST",
187
+ headers,
188
+ path: resolvedPath,
189
+ body,
190
+ });
191
+ };
192
+ exports.serializeAws_restJson1CreateEnvironmentCommand = serializeAws_restJson1CreateEnvironmentCommand;
193
+ const serializeAws_restJson1DeleteApplicationCommand = async (input, context) => {
194
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
195
+ const headers = {};
196
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{applicationId}";
197
+ if (input.applicationId !== undefined) {
198
+ const labelValue = input.applicationId;
199
+ if (labelValue.length <= 0) {
200
+ throw new Error("Empty value provided for input HTTP label: applicationId.");
201
+ }
202
+ resolvedPath = resolvedPath.replace("{applicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
203
+ }
204
+ else {
205
+ throw new Error("No value provided for input HTTP label: applicationId.");
206
+ }
207
+ let body;
208
+ return new protocol_http_1.HttpRequest({
209
+ protocol,
210
+ hostname,
211
+ port,
212
+ method: "DELETE",
213
+ headers,
214
+ path: resolvedPath,
215
+ body,
216
+ });
217
+ };
218
+ exports.serializeAws_restJson1DeleteApplicationCommand = serializeAws_restJson1DeleteApplicationCommand;
219
+ const serializeAws_restJson1DeleteApplicationFromEnvironmentCommand = async (input, context) => {
220
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
221
+ const headers = {};
222
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
223
+ "/applications/{applicationId}/environment/{environmentId}";
224
+ if (input.applicationId !== undefined) {
225
+ const labelValue = input.applicationId;
226
+ if (labelValue.length <= 0) {
227
+ throw new Error("Empty value provided for input HTTP label: applicationId.");
228
+ }
229
+ resolvedPath = resolvedPath.replace("{applicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
230
+ }
231
+ else {
232
+ throw new Error("No value provided for input HTTP label: applicationId.");
233
+ }
234
+ if (input.environmentId !== undefined) {
235
+ const labelValue = input.environmentId;
236
+ if (labelValue.length <= 0) {
237
+ throw new Error("Empty value provided for input HTTP label: environmentId.");
238
+ }
239
+ resolvedPath = resolvedPath.replace("{environmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
240
+ }
241
+ else {
242
+ throw new Error("No value provided for input HTTP label: environmentId.");
243
+ }
244
+ let body;
245
+ return new protocol_http_1.HttpRequest({
246
+ protocol,
247
+ hostname,
248
+ port,
249
+ method: "DELETE",
250
+ headers,
251
+ path: resolvedPath,
252
+ body,
253
+ });
254
+ };
255
+ exports.serializeAws_restJson1DeleteApplicationFromEnvironmentCommand = serializeAws_restJson1DeleteApplicationFromEnvironmentCommand;
256
+ const serializeAws_restJson1DeleteEnvironmentCommand = async (input, context) => {
257
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
258
+ const headers = {};
259
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/environments/{environmentId}";
260
+ if (input.environmentId !== undefined) {
261
+ const labelValue = input.environmentId;
262
+ if (labelValue.length <= 0) {
263
+ throw new Error("Empty value provided for input HTTP label: environmentId.");
264
+ }
265
+ resolvedPath = resolvedPath.replace("{environmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
266
+ }
267
+ else {
268
+ throw new Error("No value provided for input HTTP label: environmentId.");
269
+ }
270
+ let body;
271
+ return new protocol_http_1.HttpRequest({
272
+ protocol,
273
+ hostname,
274
+ port,
275
+ method: "DELETE",
276
+ headers,
277
+ path: resolvedPath,
278
+ body,
279
+ });
280
+ };
281
+ exports.serializeAws_restJson1DeleteEnvironmentCommand = serializeAws_restJson1DeleteEnvironmentCommand;
282
+ const serializeAws_restJson1GetApplicationCommand = async (input, context) => {
283
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
284
+ const headers = {};
285
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{applicationId}";
286
+ if (input.applicationId !== undefined) {
287
+ const labelValue = input.applicationId;
288
+ if (labelValue.length <= 0) {
289
+ throw new Error("Empty value provided for input HTTP label: applicationId.");
290
+ }
291
+ resolvedPath = resolvedPath.replace("{applicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
292
+ }
293
+ else {
294
+ throw new Error("No value provided for input HTTP label: applicationId.");
295
+ }
296
+ let body;
297
+ return new protocol_http_1.HttpRequest({
298
+ protocol,
299
+ hostname,
300
+ port,
301
+ method: "GET",
302
+ headers,
303
+ path: resolvedPath,
304
+ body,
305
+ });
306
+ };
307
+ exports.serializeAws_restJson1GetApplicationCommand = serializeAws_restJson1GetApplicationCommand;
308
+ const serializeAws_restJson1GetApplicationVersionCommand = async (input, context) => {
309
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
310
+ const headers = {};
311
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
312
+ "/applications/{applicationId}/versions/{applicationVersion}";
313
+ if (input.applicationId !== undefined) {
314
+ const labelValue = input.applicationId;
315
+ if (labelValue.length <= 0) {
316
+ throw new Error("Empty value provided for input HTTP label: applicationId.");
317
+ }
318
+ resolvedPath = resolvedPath.replace("{applicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
319
+ }
320
+ else {
321
+ throw new Error("No value provided for input HTTP label: applicationId.");
322
+ }
323
+ if (input.applicationVersion !== undefined) {
324
+ const labelValue = input.applicationVersion.toString();
325
+ if (labelValue.length <= 0) {
326
+ throw new Error("Empty value provided for input HTTP label: applicationVersion.");
327
+ }
328
+ resolvedPath = resolvedPath.replace("{applicationVersion}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
329
+ }
330
+ else {
331
+ throw new Error("No value provided for input HTTP label: applicationVersion.");
332
+ }
333
+ let body;
334
+ return new protocol_http_1.HttpRequest({
335
+ protocol,
336
+ hostname,
337
+ port,
338
+ method: "GET",
339
+ headers,
340
+ path: resolvedPath,
341
+ body,
342
+ });
343
+ };
344
+ exports.serializeAws_restJson1GetApplicationVersionCommand = serializeAws_restJson1GetApplicationVersionCommand;
345
+ const serializeAws_restJson1GetBatchJobExecutionCommand = async (input, context) => {
346
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
347
+ const headers = {};
348
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
349
+ "/applications/{applicationId}/batch-job-executions/{executionId}";
350
+ if (input.applicationId !== undefined) {
351
+ const labelValue = input.applicationId;
352
+ if (labelValue.length <= 0) {
353
+ throw new Error("Empty value provided for input HTTP label: applicationId.");
354
+ }
355
+ resolvedPath = resolvedPath.replace("{applicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
356
+ }
357
+ else {
358
+ throw new Error("No value provided for input HTTP label: applicationId.");
359
+ }
360
+ if (input.executionId !== undefined) {
361
+ const labelValue = input.executionId;
362
+ if (labelValue.length <= 0) {
363
+ throw new Error("Empty value provided for input HTTP label: executionId.");
364
+ }
365
+ resolvedPath = resolvedPath.replace("{executionId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
366
+ }
367
+ else {
368
+ throw new Error("No value provided for input HTTP label: executionId.");
369
+ }
370
+ let body;
371
+ return new protocol_http_1.HttpRequest({
372
+ protocol,
373
+ hostname,
374
+ port,
375
+ method: "GET",
376
+ headers,
377
+ path: resolvedPath,
378
+ body,
379
+ });
380
+ };
381
+ exports.serializeAws_restJson1GetBatchJobExecutionCommand = serializeAws_restJson1GetBatchJobExecutionCommand;
382
+ const serializeAws_restJson1GetDataSetDetailsCommand = async (input, context) => {
383
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
384
+ const headers = {};
385
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
386
+ "/applications/{applicationId}/datasets/{dataSetName}";
387
+ if (input.applicationId !== undefined) {
388
+ const labelValue = input.applicationId;
389
+ if (labelValue.length <= 0) {
390
+ throw new Error("Empty value provided for input HTTP label: applicationId.");
391
+ }
392
+ resolvedPath = resolvedPath.replace("{applicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
393
+ }
394
+ else {
395
+ throw new Error("No value provided for input HTTP label: applicationId.");
396
+ }
397
+ if (input.dataSetName !== undefined) {
398
+ const labelValue = input.dataSetName;
399
+ if (labelValue.length <= 0) {
400
+ throw new Error("Empty value provided for input HTTP label: dataSetName.");
401
+ }
402
+ resolvedPath = resolvedPath.replace("{dataSetName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
403
+ }
404
+ else {
405
+ throw new Error("No value provided for input HTTP label: dataSetName.");
406
+ }
407
+ let body;
408
+ return new protocol_http_1.HttpRequest({
409
+ protocol,
410
+ hostname,
411
+ port,
412
+ method: "GET",
413
+ headers,
414
+ path: resolvedPath,
415
+ body,
416
+ });
417
+ };
418
+ exports.serializeAws_restJson1GetDataSetDetailsCommand = serializeAws_restJson1GetDataSetDetailsCommand;
419
+ const serializeAws_restJson1GetDataSetImportTaskCommand = async (input, context) => {
420
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
421
+ const headers = {};
422
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
423
+ "/applications/{applicationId}/dataset-import-tasks/{taskId}";
424
+ if (input.applicationId !== undefined) {
425
+ const labelValue = input.applicationId;
426
+ if (labelValue.length <= 0) {
427
+ throw new Error("Empty value provided for input HTTP label: applicationId.");
428
+ }
429
+ resolvedPath = resolvedPath.replace("{applicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
430
+ }
431
+ else {
432
+ throw new Error("No value provided for input HTTP label: applicationId.");
433
+ }
434
+ if (input.taskId !== undefined) {
435
+ const labelValue = input.taskId;
436
+ if (labelValue.length <= 0) {
437
+ throw new Error("Empty value provided for input HTTP label: taskId.");
438
+ }
439
+ resolvedPath = resolvedPath.replace("{taskId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
440
+ }
441
+ else {
442
+ throw new Error("No value provided for input HTTP label: taskId.");
443
+ }
444
+ let body;
445
+ return new protocol_http_1.HttpRequest({
446
+ protocol,
447
+ hostname,
448
+ port,
449
+ method: "GET",
450
+ headers,
451
+ path: resolvedPath,
452
+ body,
453
+ });
454
+ };
455
+ exports.serializeAws_restJson1GetDataSetImportTaskCommand = serializeAws_restJson1GetDataSetImportTaskCommand;
456
+ const serializeAws_restJson1GetDeploymentCommand = async (input, context) => {
457
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
458
+ const headers = {};
459
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
460
+ "/applications/{applicationId}/deployments/{deploymentId}";
461
+ if (input.deploymentId !== undefined) {
462
+ const labelValue = input.deploymentId;
463
+ if (labelValue.length <= 0) {
464
+ throw new Error("Empty value provided for input HTTP label: deploymentId.");
465
+ }
466
+ resolvedPath = resolvedPath.replace("{deploymentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
467
+ }
468
+ else {
469
+ throw new Error("No value provided for input HTTP label: deploymentId.");
470
+ }
471
+ if (input.applicationId !== undefined) {
472
+ const labelValue = input.applicationId;
473
+ if (labelValue.length <= 0) {
474
+ throw new Error("Empty value provided for input HTTP label: applicationId.");
475
+ }
476
+ resolvedPath = resolvedPath.replace("{applicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
477
+ }
478
+ else {
479
+ throw new Error("No value provided for input HTTP label: applicationId.");
480
+ }
481
+ let body;
482
+ return new protocol_http_1.HttpRequest({
483
+ protocol,
484
+ hostname,
485
+ port,
486
+ method: "GET",
487
+ headers,
488
+ path: resolvedPath,
489
+ body,
490
+ });
491
+ };
492
+ exports.serializeAws_restJson1GetDeploymentCommand = serializeAws_restJson1GetDeploymentCommand;
493
+ const serializeAws_restJson1GetEnvironmentCommand = async (input, context) => {
494
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
495
+ const headers = {};
496
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/environments/{environmentId}";
497
+ if (input.environmentId !== undefined) {
498
+ const labelValue = input.environmentId;
499
+ if (labelValue.length <= 0) {
500
+ throw new Error("Empty value provided for input HTTP label: environmentId.");
501
+ }
502
+ resolvedPath = resolvedPath.replace("{environmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
503
+ }
504
+ else {
505
+ throw new Error("No value provided for input HTTP label: environmentId.");
506
+ }
507
+ let body;
508
+ return new protocol_http_1.HttpRequest({
509
+ protocol,
510
+ hostname,
511
+ port,
512
+ method: "GET",
513
+ headers,
514
+ path: resolvedPath,
515
+ body,
516
+ });
517
+ };
518
+ exports.serializeAws_restJson1GetEnvironmentCommand = serializeAws_restJson1GetEnvironmentCommand;
519
+ const serializeAws_restJson1ListApplicationsCommand = async (input, context) => {
520
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
521
+ const headers = {};
522
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/applications";
523
+ const query = {
524
+ ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
525
+ ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
526
+ ...(input.names !== undefined && { names: (input.names || []).map((_entry) => _entry) }),
527
+ ...(input.environmentId !== undefined && { environmentId: input.environmentId }),
528
+ };
529
+ let body;
530
+ return new protocol_http_1.HttpRequest({
531
+ protocol,
532
+ hostname,
533
+ port,
534
+ method: "GET",
535
+ headers,
536
+ path: resolvedPath,
537
+ query,
538
+ body,
539
+ });
540
+ };
541
+ exports.serializeAws_restJson1ListApplicationsCommand = serializeAws_restJson1ListApplicationsCommand;
542
+ const serializeAws_restJson1ListApplicationVersionsCommand = async (input, context) => {
543
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
544
+ const headers = {};
545
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{applicationId}/versions";
546
+ if (input.applicationId !== undefined) {
547
+ const labelValue = input.applicationId;
548
+ if (labelValue.length <= 0) {
549
+ throw new Error("Empty value provided for input HTTP label: applicationId.");
550
+ }
551
+ resolvedPath = resolvedPath.replace("{applicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
552
+ }
553
+ else {
554
+ throw new Error("No value provided for input HTTP label: applicationId.");
555
+ }
556
+ const query = {
557
+ ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
558
+ ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
559
+ };
560
+ let body;
561
+ return new protocol_http_1.HttpRequest({
562
+ protocol,
563
+ hostname,
564
+ port,
565
+ method: "GET",
566
+ headers,
567
+ path: resolvedPath,
568
+ query,
569
+ body,
570
+ });
571
+ };
572
+ exports.serializeAws_restJson1ListApplicationVersionsCommand = serializeAws_restJson1ListApplicationVersionsCommand;
573
+ const serializeAws_restJson1ListBatchJobDefinitionsCommand = async (input, context) => {
574
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
575
+ const headers = {};
576
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
577
+ "/applications/{applicationId}/batch-job-definitions";
578
+ if (input.applicationId !== undefined) {
579
+ const labelValue = input.applicationId;
580
+ if (labelValue.length <= 0) {
581
+ throw new Error("Empty value provided for input HTTP label: applicationId.");
582
+ }
583
+ resolvedPath = resolvedPath.replace("{applicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
584
+ }
585
+ else {
586
+ throw new Error("No value provided for input HTTP label: applicationId.");
587
+ }
588
+ const query = {
589
+ ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
590
+ ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
591
+ ...(input.prefix !== undefined && { prefix: input.prefix }),
592
+ };
593
+ let body;
594
+ return new protocol_http_1.HttpRequest({
595
+ protocol,
596
+ hostname,
597
+ port,
598
+ method: "GET",
599
+ headers,
600
+ path: resolvedPath,
601
+ query,
602
+ body,
603
+ });
604
+ };
605
+ exports.serializeAws_restJson1ListBatchJobDefinitionsCommand = serializeAws_restJson1ListBatchJobDefinitionsCommand;
606
+ const serializeAws_restJson1ListBatchJobExecutionsCommand = async (input, context) => {
607
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
608
+ const headers = {};
609
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
610
+ "/applications/{applicationId}/batch-job-executions";
611
+ if (input.applicationId !== undefined) {
612
+ const labelValue = input.applicationId;
613
+ if (labelValue.length <= 0) {
614
+ throw new Error("Empty value provided for input HTTP label: applicationId.");
615
+ }
616
+ resolvedPath = resolvedPath.replace("{applicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
617
+ }
618
+ else {
619
+ throw new Error("No value provided for input HTTP label: applicationId.");
620
+ }
621
+ const query = {
622
+ ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
623
+ ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
624
+ ...(input.executionIds !== undefined && {
625
+ executionIds: (input.executionIds || []).map((_entry) => _entry),
626
+ }),
627
+ ...(input.jobName !== undefined && { jobName: input.jobName }),
628
+ ...(input.status !== undefined && { status: input.status }),
629
+ ...(input.startedAfter !== undefined && {
630
+ startedAfter: (input.startedAfter.toISOString().split(".")[0] + "Z").toString(),
631
+ }),
632
+ ...(input.startedBefore !== undefined && {
633
+ startedBefore: (input.startedBefore.toISOString().split(".")[0] + "Z").toString(),
634
+ }),
635
+ };
636
+ let body;
637
+ return new protocol_http_1.HttpRequest({
638
+ protocol,
639
+ hostname,
640
+ port,
641
+ method: "GET",
642
+ headers,
643
+ path: resolvedPath,
644
+ query,
645
+ body,
646
+ });
647
+ };
648
+ exports.serializeAws_restJson1ListBatchJobExecutionsCommand = serializeAws_restJson1ListBatchJobExecutionsCommand;
649
+ const serializeAws_restJson1ListDataSetImportHistoryCommand = async (input, context) => {
650
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
651
+ const headers = {};
652
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
653
+ "/applications/{applicationId}/dataset-import-tasks";
654
+ if (input.applicationId !== undefined) {
655
+ const labelValue = input.applicationId;
656
+ if (labelValue.length <= 0) {
657
+ throw new Error("Empty value provided for input HTTP label: applicationId.");
658
+ }
659
+ resolvedPath = resolvedPath.replace("{applicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
660
+ }
661
+ else {
662
+ throw new Error("No value provided for input HTTP label: applicationId.");
663
+ }
664
+ const query = {
665
+ ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
666
+ ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
667
+ };
668
+ let body;
669
+ return new protocol_http_1.HttpRequest({
670
+ protocol,
671
+ hostname,
672
+ port,
673
+ method: "GET",
674
+ headers,
675
+ path: resolvedPath,
676
+ query,
677
+ body,
678
+ });
679
+ };
680
+ exports.serializeAws_restJson1ListDataSetImportHistoryCommand = serializeAws_restJson1ListDataSetImportHistoryCommand;
681
+ const serializeAws_restJson1ListDataSetsCommand = async (input, context) => {
682
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
683
+ const headers = {};
684
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{applicationId}/datasets";
685
+ if (input.applicationId !== undefined) {
686
+ const labelValue = input.applicationId;
687
+ if (labelValue.length <= 0) {
688
+ throw new Error("Empty value provided for input HTTP label: applicationId.");
689
+ }
690
+ resolvedPath = resolvedPath.replace("{applicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
691
+ }
692
+ else {
693
+ throw new Error("No value provided for input HTTP label: applicationId.");
694
+ }
695
+ const query = {
696
+ ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
697
+ ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
698
+ ...(input.prefix !== undefined && { prefix: input.prefix }),
699
+ };
700
+ let body;
701
+ return new protocol_http_1.HttpRequest({
702
+ protocol,
703
+ hostname,
704
+ port,
705
+ method: "GET",
706
+ headers,
707
+ path: resolvedPath,
708
+ query,
709
+ body,
710
+ });
711
+ };
712
+ exports.serializeAws_restJson1ListDataSetsCommand = serializeAws_restJson1ListDataSetsCommand;
713
+ const serializeAws_restJson1ListDeploymentsCommand = async (input, context) => {
714
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
715
+ const headers = {};
716
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{applicationId}/deployments";
717
+ if (input.applicationId !== undefined) {
718
+ const labelValue = input.applicationId;
719
+ if (labelValue.length <= 0) {
720
+ throw new Error("Empty value provided for input HTTP label: applicationId.");
721
+ }
722
+ resolvedPath = resolvedPath.replace("{applicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
723
+ }
724
+ else {
725
+ throw new Error("No value provided for input HTTP label: applicationId.");
726
+ }
727
+ const query = {
728
+ ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
729
+ ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
730
+ };
731
+ let body;
732
+ return new protocol_http_1.HttpRequest({
733
+ protocol,
734
+ hostname,
735
+ port,
736
+ method: "GET",
737
+ headers,
738
+ path: resolvedPath,
739
+ query,
740
+ body,
741
+ });
742
+ };
743
+ exports.serializeAws_restJson1ListDeploymentsCommand = serializeAws_restJson1ListDeploymentsCommand;
744
+ const serializeAws_restJson1ListEngineVersionsCommand = async (input, context) => {
745
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
746
+ const headers = {};
747
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/engine-versions";
748
+ const query = {
749
+ ...(input.engineType !== undefined && { engineType: input.engineType }),
750
+ ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
751
+ ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
752
+ };
753
+ let body;
754
+ return new protocol_http_1.HttpRequest({
755
+ protocol,
756
+ hostname,
757
+ port,
758
+ method: "GET",
759
+ headers,
760
+ path: resolvedPath,
761
+ query,
762
+ body,
763
+ });
764
+ };
765
+ exports.serializeAws_restJson1ListEngineVersionsCommand = serializeAws_restJson1ListEngineVersionsCommand;
766
+ const serializeAws_restJson1ListEnvironmentsCommand = async (input, context) => {
767
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
768
+ const headers = {};
769
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/environments";
770
+ const query = {
771
+ ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
772
+ ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
773
+ ...(input.names !== undefined && { names: (input.names || []).map((_entry) => _entry) }),
774
+ ...(input.engineType !== undefined && { engineType: input.engineType }),
775
+ };
776
+ let body;
777
+ return new protocol_http_1.HttpRequest({
778
+ protocol,
779
+ hostname,
780
+ port,
781
+ method: "GET",
782
+ headers,
783
+ path: resolvedPath,
784
+ query,
785
+ body,
786
+ });
787
+ };
788
+ exports.serializeAws_restJson1ListEnvironmentsCommand = serializeAws_restJson1ListEnvironmentsCommand;
789
+ const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
790
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
791
+ const headers = {};
792
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
793
+ if (input.resourceArn !== undefined) {
794
+ const labelValue = input.resourceArn;
795
+ if (labelValue.length <= 0) {
796
+ throw new Error("Empty value provided for input HTTP label: resourceArn.");
797
+ }
798
+ resolvedPath = resolvedPath.replace("{resourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
799
+ }
800
+ else {
801
+ throw new Error("No value provided for input HTTP label: resourceArn.");
802
+ }
803
+ let body;
804
+ return new protocol_http_1.HttpRequest({
805
+ protocol,
806
+ hostname,
807
+ port,
808
+ method: "GET",
809
+ headers,
810
+ path: resolvedPath,
811
+ body,
812
+ });
813
+ };
814
+ exports.serializeAws_restJson1ListTagsForResourceCommand = serializeAws_restJson1ListTagsForResourceCommand;
815
+ const serializeAws_restJson1StartApplicationCommand = async (input, context) => {
816
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
817
+ const headers = {};
818
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{applicationId}/start";
819
+ if (input.applicationId !== undefined) {
820
+ const labelValue = input.applicationId;
821
+ if (labelValue.length <= 0) {
822
+ throw new Error("Empty value provided for input HTTP label: applicationId.");
823
+ }
824
+ resolvedPath = resolvedPath.replace("{applicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
825
+ }
826
+ else {
827
+ throw new Error("No value provided for input HTTP label: applicationId.");
828
+ }
829
+ let body;
830
+ return new protocol_http_1.HttpRequest({
831
+ protocol,
832
+ hostname,
833
+ port,
834
+ method: "POST",
835
+ headers,
836
+ path: resolvedPath,
837
+ body,
838
+ });
839
+ };
840
+ exports.serializeAws_restJson1StartApplicationCommand = serializeAws_restJson1StartApplicationCommand;
841
+ const serializeAws_restJson1StartBatchJobCommand = async (input, context) => {
842
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
843
+ const headers = {
844
+ "content-type": "application/json",
845
+ };
846
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{applicationId}/batch-job";
847
+ if (input.applicationId !== undefined) {
848
+ const labelValue = input.applicationId;
849
+ if (labelValue.length <= 0) {
850
+ throw new Error("Empty value provided for input HTTP label: applicationId.");
851
+ }
852
+ resolvedPath = resolvedPath.replace("{applicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
853
+ }
854
+ else {
855
+ throw new Error("No value provided for input HTTP label: applicationId.");
856
+ }
857
+ let body;
858
+ body = JSON.stringify({
859
+ ...(input.batchJobIdentifier !== undefined &&
860
+ input.batchJobIdentifier !== null && {
861
+ batchJobIdentifier: serializeAws_restJson1BatchJobIdentifier(input.batchJobIdentifier, context),
862
+ }),
863
+ ...(input.jobParams !== undefined &&
864
+ input.jobParams !== null && { jobParams: serializeAws_restJson1BatchJobParametersMap(input.jobParams, context) }),
865
+ });
866
+ return new protocol_http_1.HttpRequest({
867
+ protocol,
868
+ hostname,
869
+ port,
870
+ method: "POST",
871
+ headers,
872
+ path: resolvedPath,
873
+ body,
874
+ });
875
+ };
876
+ exports.serializeAws_restJson1StartBatchJobCommand = serializeAws_restJson1StartBatchJobCommand;
877
+ const serializeAws_restJson1StopApplicationCommand = async (input, context) => {
878
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
879
+ const headers = {
880
+ "content-type": "application/json",
881
+ };
882
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{applicationId}/stop";
883
+ if (input.applicationId !== undefined) {
884
+ const labelValue = input.applicationId;
885
+ if (labelValue.length <= 0) {
886
+ throw new Error("Empty value provided for input HTTP label: applicationId.");
887
+ }
888
+ resolvedPath = resolvedPath.replace("{applicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
889
+ }
890
+ else {
891
+ throw new Error("No value provided for input HTTP label: applicationId.");
892
+ }
893
+ let body;
894
+ body = JSON.stringify({
895
+ ...(input.forceStop !== undefined && input.forceStop !== null && { forceStop: input.forceStop }),
896
+ });
897
+ return new protocol_http_1.HttpRequest({
898
+ protocol,
899
+ hostname,
900
+ port,
901
+ method: "POST",
902
+ headers,
903
+ path: resolvedPath,
904
+ body,
905
+ });
906
+ };
907
+ exports.serializeAws_restJson1StopApplicationCommand = serializeAws_restJson1StopApplicationCommand;
908
+ const serializeAws_restJson1TagResourceCommand = async (input, context) => {
909
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
910
+ const headers = {
911
+ "content-type": "application/json",
912
+ };
913
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
914
+ if (input.resourceArn !== undefined) {
915
+ const labelValue = input.resourceArn;
916
+ if (labelValue.length <= 0) {
917
+ throw new Error("Empty value provided for input HTTP label: resourceArn.");
918
+ }
919
+ resolvedPath = resolvedPath.replace("{resourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
920
+ }
921
+ else {
922
+ throw new Error("No value provided for input HTTP label: resourceArn.");
923
+ }
924
+ let body;
925
+ body = JSON.stringify({
926
+ ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
927
+ });
928
+ return new protocol_http_1.HttpRequest({
929
+ protocol,
930
+ hostname,
931
+ port,
932
+ method: "POST",
933
+ headers,
934
+ path: resolvedPath,
935
+ body,
936
+ });
937
+ };
938
+ exports.serializeAws_restJson1TagResourceCommand = serializeAws_restJson1TagResourceCommand;
939
+ const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
940
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
941
+ const headers = {};
942
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
943
+ if (input.resourceArn !== undefined) {
944
+ const labelValue = input.resourceArn;
945
+ if (labelValue.length <= 0) {
946
+ throw new Error("Empty value provided for input HTTP label: resourceArn.");
947
+ }
948
+ resolvedPath = resolvedPath.replace("{resourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
949
+ }
950
+ else {
951
+ throw new Error("No value provided for input HTTP label: resourceArn.");
952
+ }
953
+ const query = {
954
+ ...(input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map((_entry) => _entry) }),
955
+ };
956
+ let body;
957
+ return new protocol_http_1.HttpRequest({
958
+ protocol,
959
+ hostname,
960
+ port,
961
+ method: "DELETE",
962
+ headers,
963
+ path: resolvedPath,
964
+ query,
965
+ body,
966
+ });
967
+ };
968
+ exports.serializeAws_restJson1UntagResourceCommand = serializeAws_restJson1UntagResourceCommand;
969
+ const serializeAws_restJson1UpdateApplicationCommand = async (input, context) => {
970
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
971
+ const headers = {
972
+ "content-type": "application/json",
973
+ };
974
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{applicationId}";
975
+ if (input.applicationId !== undefined) {
976
+ const labelValue = input.applicationId;
977
+ if (labelValue.length <= 0) {
978
+ throw new Error("Empty value provided for input HTTP label: applicationId.");
979
+ }
980
+ resolvedPath = resolvedPath.replace("{applicationId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
981
+ }
982
+ else {
983
+ throw new Error("No value provided for input HTTP label: applicationId.");
984
+ }
985
+ let body;
986
+ body = JSON.stringify({
987
+ ...(input.currentApplicationVersion !== undefined &&
988
+ input.currentApplicationVersion !== null && { currentApplicationVersion: input.currentApplicationVersion }),
989
+ ...(input.definition !== undefined &&
990
+ input.definition !== null && { definition: serializeAws_restJson1Definition(input.definition, context) }),
991
+ ...(input.description !== undefined && input.description !== null && { description: input.description }),
992
+ });
993
+ return new protocol_http_1.HttpRequest({
994
+ protocol,
995
+ hostname,
996
+ port,
997
+ method: "PATCH",
998
+ headers,
999
+ path: resolvedPath,
1000
+ body,
1001
+ });
1002
+ };
1003
+ exports.serializeAws_restJson1UpdateApplicationCommand = serializeAws_restJson1UpdateApplicationCommand;
1004
+ const serializeAws_restJson1UpdateEnvironmentCommand = async (input, context) => {
1005
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1006
+ const headers = {
1007
+ "content-type": "application/json",
1008
+ };
1009
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/environments/{environmentId}";
1010
+ if (input.environmentId !== undefined) {
1011
+ const labelValue = input.environmentId;
1012
+ if (labelValue.length <= 0) {
1013
+ throw new Error("Empty value provided for input HTTP label: environmentId.");
1014
+ }
1015
+ resolvedPath = resolvedPath.replace("{environmentId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
1016
+ }
1017
+ else {
1018
+ throw new Error("No value provided for input HTTP label: environmentId.");
1019
+ }
1020
+ let body;
1021
+ body = JSON.stringify({
1022
+ ...(input.applyDuringMaintenanceWindow !== undefined &&
1023
+ input.applyDuringMaintenanceWindow !== null && {
1024
+ applyDuringMaintenanceWindow: input.applyDuringMaintenanceWindow,
1025
+ }),
1026
+ ...(input.desiredCapacity !== undefined &&
1027
+ input.desiredCapacity !== null && { desiredCapacity: input.desiredCapacity }),
1028
+ ...(input.engineVersion !== undefined && input.engineVersion !== null && { engineVersion: input.engineVersion }),
1029
+ ...(input.instanceType !== undefined && input.instanceType !== null && { instanceType: input.instanceType }),
1030
+ ...(input.preferredMaintenanceWindow !== undefined &&
1031
+ input.preferredMaintenanceWindow !== null && { preferredMaintenanceWindow: input.preferredMaintenanceWindow }),
1032
+ });
1033
+ return new protocol_http_1.HttpRequest({
1034
+ protocol,
1035
+ hostname,
1036
+ port,
1037
+ method: "PATCH",
1038
+ headers,
1039
+ path: resolvedPath,
1040
+ body,
1041
+ });
1042
+ };
1043
+ exports.serializeAws_restJson1UpdateEnvironmentCommand = serializeAws_restJson1UpdateEnvironmentCommand;
1044
+ const deserializeAws_restJson1CancelBatchJobExecutionCommand = async (output, context) => {
1045
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1046
+ return deserializeAws_restJson1CancelBatchJobExecutionCommandError(output, context);
1047
+ }
1048
+ const contents = {
1049
+ $metadata: deserializeMetadata(output),
1050
+ };
1051
+ await collectBody(output.body, context);
1052
+ return Promise.resolve(contents);
1053
+ };
1054
+ exports.deserializeAws_restJson1CancelBatchJobExecutionCommand = deserializeAws_restJson1CancelBatchJobExecutionCommand;
1055
+ const deserializeAws_restJson1CancelBatchJobExecutionCommandError = async (output, context) => {
1056
+ const parsedOutput = {
1057
+ ...output,
1058
+ body: await parseBody(output.body, context),
1059
+ };
1060
+ let response;
1061
+ let errorCode = "UnknownError";
1062
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1063
+ switch (errorCode) {
1064
+ case "AccessDeniedException":
1065
+ case "com.amazonaws.m2#AccessDeniedException":
1066
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1067
+ case "ConflictException":
1068
+ case "com.amazonaws.m2#ConflictException":
1069
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1070
+ case "InternalServerException":
1071
+ case "com.amazonaws.m2#InternalServerException":
1072
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1073
+ case "ResourceNotFoundException":
1074
+ case "com.amazonaws.m2#ResourceNotFoundException":
1075
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1076
+ case "ThrottlingException":
1077
+ case "com.amazonaws.m2#ThrottlingException":
1078
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1079
+ case "ValidationException":
1080
+ case "com.amazonaws.m2#ValidationException":
1081
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1082
+ default:
1083
+ const parsedBody = parsedOutput.body;
1084
+ response = new M2ServiceException_1.M2ServiceException({
1085
+ name: parsedBody.code || parsedBody.Code || errorCode,
1086
+ $fault: "client",
1087
+ $metadata: deserializeMetadata(output),
1088
+ });
1089
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1090
+ }
1091
+ };
1092
+ const deserializeAws_restJson1CreateApplicationCommand = async (output, context) => {
1093
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1094
+ return deserializeAws_restJson1CreateApplicationCommandError(output, context);
1095
+ }
1096
+ const contents = {
1097
+ $metadata: deserializeMetadata(output),
1098
+ applicationArn: undefined,
1099
+ applicationId: undefined,
1100
+ applicationVersion: undefined,
1101
+ };
1102
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1103
+ if (data.applicationArn !== undefined && data.applicationArn !== null) {
1104
+ contents.applicationArn = (0, smithy_client_1.expectString)(data.applicationArn);
1105
+ }
1106
+ if (data.applicationId !== undefined && data.applicationId !== null) {
1107
+ contents.applicationId = (0, smithy_client_1.expectString)(data.applicationId);
1108
+ }
1109
+ if (data.applicationVersion !== undefined && data.applicationVersion !== null) {
1110
+ contents.applicationVersion = (0, smithy_client_1.expectInt32)(data.applicationVersion);
1111
+ }
1112
+ return Promise.resolve(contents);
1113
+ };
1114
+ exports.deserializeAws_restJson1CreateApplicationCommand = deserializeAws_restJson1CreateApplicationCommand;
1115
+ const deserializeAws_restJson1CreateApplicationCommandError = async (output, context) => {
1116
+ const parsedOutput = {
1117
+ ...output,
1118
+ body: await parseBody(output.body, context),
1119
+ };
1120
+ let response;
1121
+ let errorCode = "UnknownError";
1122
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1123
+ switch (errorCode) {
1124
+ case "AccessDeniedException":
1125
+ case "com.amazonaws.m2#AccessDeniedException":
1126
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1127
+ case "ConflictException":
1128
+ case "com.amazonaws.m2#ConflictException":
1129
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1130
+ case "InternalServerException":
1131
+ case "com.amazonaws.m2#InternalServerException":
1132
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1133
+ case "ServiceQuotaExceededException":
1134
+ case "com.amazonaws.m2#ServiceQuotaExceededException":
1135
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1136
+ case "ThrottlingException":
1137
+ case "com.amazonaws.m2#ThrottlingException":
1138
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1139
+ case "ValidationException":
1140
+ case "com.amazonaws.m2#ValidationException":
1141
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1142
+ default:
1143
+ const parsedBody = parsedOutput.body;
1144
+ response = new M2ServiceException_1.M2ServiceException({
1145
+ name: parsedBody.code || parsedBody.Code || errorCode,
1146
+ $fault: "client",
1147
+ $metadata: deserializeMetadata(output),
1148
+ });
1149
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1150
+ }
1151
+ };
1152
+ const deserializeAws_restJson1CreateDataSetImportTaskCommand = async (output, context) => {
1153
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1154
+ return deserializeAws_restJson1CreateDataSetImportTaskCommandError(output, context);
1155
+ }
1156
+ const contents = {
1157
+ $metadata: deserializeMetadata(output),
1158
+ taskId: undefined,
1159
+ };
1160
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1161
+ if (data.taskId !== undefined && data.taskId !== null) {
1162
+ contents.taskId = (0, smithy_client_1.expectString)(data.taskId);
1163
+ }
1164
+ return Promise.resolve(contents);
1165
+ };
1166
+ exports.deserializeAws_restJson1CreateDataSetImportTaskCommand = deserializeAws_restJson1CreateDataSetImportTaskCommand;
1167
+ const deserializeAws_restJson1CreateDataSetImportTaskCommandError = async (output, context) => {
1168
+ const parsedOutput = {
1169
+ ...output,
1170
+ body: await parseBody(output.body, context),
1171
+ };
1172
+ let response;
1173
+ let errorCode = "UnknownError";
1174
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1175
+ switch (errorCode) {
1176
+ case "AccessDeniedException":
1177
+ case "com.amazonaws.m2#AccessDeniedException":
1178
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1179
+ case "ConflictException":
1180
+ case "com.amazonaws.m2#ConflictException":
1181
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1182
+ case "InternalServerException":
1183
+ case "com.amazonaws.m2#InternalServerException":
1184
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1185
+ case "ResourceNotFoundException":
1186
+ case "com.amazonaws.m2#ResourceNotFoundException":
1187
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1188
+ case "ServiceQuotaExceededException":
1189
+ case "com.amazonaws.m2#ServiceQuotaExceededException":
1190
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1191
+ case "ThrottlingException":
1192
+ case "com.amazonaws.m2#ThrottlingException":
1193
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1194
+ case "ValidationException":
1195
+ case "com.amazonaws.m2#ValidationException":
1196
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1197
+ default:
1198
+ const parsedBody = parsedOutput.body;
1199
+ response = new M2ServiceException_1.M2ServiceException({
1200
+ name: parsedBody.code || parsedBody.Code || errorCode,
1201
+ $fault: "client",
1202
+ $metadata: deserializeMetadata(output),
1203
+ });
1204
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1205
+ }
1206
+ };
1207
+ const deserializeAws_restJson1CreateDeploymentCommand = async (output, context) => {
1208
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1209
+ return deserializeAws_restJson1CreateDeploymentCommandError(output, context);
1210
+ }
1211
+ const contents = {
1212
+ $metadata: deserializeMetadata(output),
1213
+ deploymentId: undefined,
1214
+ };
1215
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1216
+ if (data.deploymentId !== undefined && data.deploymentId !== null) {
1217
+ contents.deploymentId = (0, smithy_client_1.expectString)(data.deploymentId);
1218
+ }
1219
+ return Promise.resolve(contents);
1220
+ };
1221
+ exports.deserializeAws_restJson1CreateDeploymentCommand = deserializeAws_restJson1CreateDeploymentCommand;
1222
+ const deserializeAws_restJson1CreateDeploymentCommandError = async (output, context) => {
1223
+ const parsedOutput = {
1224
+ ...output,
1225
+ body: await parseBody(output.body, context),
1226
+ };
1227
+ let response;
1228
+ let errorCode = "UnknownError";
1229
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1230
+ switch (errorCode) {
1231
+ case "AccessDeniedException":
1232
+ case "com.amazonaws.m2#AccessDeniedException":
1233
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1234
+ case "ConflictException":
1235
+ case "com.amazonaws.m2#ConflictException":
1236
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1237
+ case "InternalServerException":
1238
+ case "com.amazonaws.m2#InternalServerException":
1239
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1240
+ case "ResourceNotFoundException":
1241
+ case "com.amazonaws.m2#ResourceNotFoundException":
1242
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1243
+ case "ServiceQuotaExceededException":
1244
+ case "com.amazonaws.m2#ServiceQuotaExceededException":
1245
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1246
+ case "ThrottlingException":
1247
+ case "com.amazonaws.m2#ThrottlingException":
1248
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1249
+ case "ValidationException":
1250
+ case "com.amazonaws.m2#ValidationException":
1251
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1252
+ default:
1253
+ const parsedBody = parsedOutput.body;
1254
+ response = new M2ServiceException_1.M2ServiceException({
1255
+ name: parsedBody.code || parsedBody.Code || errorCode,
1256
+ $fault: "client",
1257
+ $metadata: deserializeMetadata(output),
1258
+ });
1259
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1260
+ }
1261
+ };
1262
+ const deserializeAws_restJson1CreateEnvironmentCommand = async (output, context) => {
1263
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1264
+ return deserializeAws_restJson1CreateEnvironmentCommandError(output, context);
1265
+ }
1266
+ const contents = {
1267
+ $metadata: deserializeMetadata(output),
1268
+ environmentId: undefined,
1269
+ };
1270
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1271
+ if (data.environmentId !== undefined && data.environmentId !== null) {
1272
+ contents.environmentId = (0, smithy_client_1.expectString)(data.environmentId);
1273
+ }
1274
+ return Promise.resolve(contents);
1275
+ };
1276
+ exports.deserializeAws_restJson1CreateEnvironmentCommand = deserializeAws_restJson1CreateEnvironmentCommand;
1277
+ const deserializeAws_restJson1CreateEnvironmentCommandError = async (output, context) => {
1278
+ const parsedOutput = {
1279
+ ...output,
1280
+ body: await parseBody(output.body, context),
1281
+ };
1282
+ let response;
1283
+ let errorCode = "UnknownError";
1284
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1285
+ switch (errorCode) {
1286
+ case "AccessDeniedException":
1287
+ case "com.amazonaws.m2#AccessDeniedException":
1288
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1289
+ case "ConflictException":
1290
+ case "com.amazonaws.m2#ConflictException":
1291
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1292
+ case "InternalServerException":
1293
+ case "com.amazonaws.m2#InternalServerException":
1294
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1295
+ case "ServiceQuotaExceededException":
1296
+ case "com.amazonaws.m2#ServiceQuotaExceededException":
1297
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1298
+ case "ThrottlingException":
1299
+ case "com.amazonaws.m2#ThrottlingException":
1300
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1301
+ case "ValidationException":
1302
+ case "com.amazonaws.m2#ValidationException":
1303
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1304
+ default:
1305
+ const parsedBody = parsedOutput.body;
1306
+ response = new M2ServiceException_1.M2ServiceException({
1307
+ name: parsedBody.code || parsedBody.Code || errorCode,
1308
+ $fault: "client",
1309
+ $metadata: deserializeMetadata(output),
1310
+ });
1311
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1312
+ }
1313
+ };
1314
+ const deserializeAws_restJson1DeleteApplicationCommand = async (output, context) => {
1315
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1316
+ return deserializeAws_restJson1DeleteApplicationCommandError(output, context);
1317
+ }
1318
+ const contents = {
1319
+ $metadata: deserializeMetadata(output),
1320
+ };
1321
+ await collectBody(output.body, context);
1322
+ return Promise.resolve(contents);
1323
+ };
1324
+ exports.deserializeAws_restJson1DeleteApplicationCommand = deserializeAws_restJson1DeleteApplicationCommand;
1325
+ const deserializeAws_restJson1DeleteApplicationCommandError = async (output, context) => {
1326
+ const parsedOutput = {
1327
+ ...output,
1328
+ body: await parseBody(output.body, context),
1329
+ };
1330
+ let response;
1331
+ let errorCode = "UnknownError";
1332
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1333
+ switch (errorCode) {
1334
+ case "AccessDeniedException":
1335
+ case "com.amazonaws.m2#AccessDeniedException":
1336
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1337
+ case "ConflictException":
1338
+ case "com.amazonaws.m2#ConflictException":
1339
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1340
+ case "InternalServerException":
1341
+ case "com.amazonaws.m2#InternalServerException":
1342
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1343
+ case "ThrottlingException":
1344
+ case "com.amazonaws.m2#ThrottlingException":
1345
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1346
+ case "ValidationException":
1347
+ case "com.amazonaws.m2#ValidationException":
1348
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1349
+ default:
1350
+ const parsedBody = parsedOutput.body;
1351
+ response = new M2ServiceException_1.M2ServiceException({
1352
+ name: parsedBody.code || parsedBody.Code || errorCode,
1353
+ $fault: "client",
1354
+ $metadata: deserializeMetadata(output),
1355
+ });
1356
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1357
+ }
1358
+ };
1359
+ const deserializeAws_restJson1DeleteApplicationFromEnvironmentCommand = async (output, context) => {
1360
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1361
+ return deserializeAws_restJson1DeleteApplicationFromEnvironmentCommandError(output, context);
1362
+ }
1363
+ const contents = {
1364
+ $metadata: deserializeMetadata(output),
1365
+ };
1366
+ await collectBody(output.body, context);
1367
+ return Promise.resolve(contents);
1368
+ };
1369
+ exports.deserializeAws_restJson1DeleteApplicationFromEnvironmentCommand = deserializeAws_restJson1DeleteApplicationFromEnvironmentCommand;
1370
+ const deserializeAws_restJson1DeleteApplicationFromEnvironmentCommandError = async (output, context) => {
1371
+ const parsedOutput = {
1372
+ ...output,
1373
+ body: await parseBody(output.body, context),
1374
+ };
1375
+ let response;
1376
+ let errorCode = "UnknownError";
1377
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1378
+ switch (errorCode) {
1379
+ case "AccessDeniedException":
1380
+ case "com.amazonaws.m2#AccessDeniedException":
1381
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1382
+ case "ConflictException":
1383
+ case "com.amazonaws.m2#ConflictException":
1384
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1385
+ case "InternalServerException":
1386
+ case "com.amazonaws.m2#InternalServerException":
1387
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1388
+ case "ResourceNotFoundException":
1389
+ case "com.amazonaws.m2#ResourceNotFoundException":
1390
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1391
+ case "ThrottlingException":
1392
+ case "com.amazonaws.m2#ThrottlingException":
1393
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1394
+ case "ValidationException":
1395
+ case "com.amazonaws.m2#ValidationException":
1396
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1397
+ default:
1398
+ const parsedBody = parsedOutput.body;
1399
+ response = new M2ServiceException_1.M2ServiceException({
1400
+ name: parsedBody.code || parsedBody.Code || errorCode,
1401
+ $fault: "client",
1402
+ $metadata: deserializeMetadata(output),
1403
+ });
1404
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1405
+ }
1406
+ };
1407
+ const deserializeAws_restJson1DeleteEnvironmentCommand = async (output, context) => {
1408
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1409
+ return deserializeAws_restJson1DeleteEnvironmentCommandError(output, context);
1410
+ }
1411
+ const contents = {
1412
+ $metadata: deserializeMetadata(output),
1413
+ };
1414
+ await collectBody(output.body, context);
1415
+ return Promise.resolve(contents);
1416
+ };
1417
+ exports.deserializeAws_restJson1DeleteEnvironmentCommand = deserializeAws_restJson1DeleteEnvironmentCommand;
1418
+ const deserializeAws_restJson1DeleteEnvironmentCommandError = async (output, context) => {
1419
+ const parsedOutput = {
1420
+ ...output,
1421
+ body: await parseBody(output.body, context),
1422
+ };
1423
+ let response;
1424
+ let errorCode = "UnknownError";
1425
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1426
+ switch (errorCode) {
1427
+ case "AccessDeniedException":
1428
+ case "com.amazonaws.m2#AccessDeniedException":
1429
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1430
+ case "ConflictException":
1431
+ case "com.amazonaws.m2#ConflictException":
1432
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1433
+ case "InternalServerException":
1434
+ case "com.amazonaws.m2#InternalServerException":
1435
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1436
+ case "ThrottlingException":
1437
+ case "com.amazonaws.m2#ThrottlingException":
1438
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1439
+ case "ValidationException":
1440
+ case "com.amazonaws.m2#ValidationException":
1441
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1442
+ default:
1443
+ const parsedBody = parsedOutput.body;
1444
+ response = new M2ServiceException_1.M2ServiceException({
1445
+ name: parsedBody.code || parsedBody.Code || errorCode,
1446
+ $fault: "client",
1447
+ $metadata: deserializeMetadata(output),
1448
+ });
1449
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1450
+ }
1451
+ };
1452
+ const deserializeAws_restJson1GetApplicationCommand = async (output, context) => {
1453
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1454
+ return deserializeAws_restJson1GetApplicationCommandError(output, context);
1455
+ }
1456
+ const contents = {
1457
+ $metadata: deserializeMetadata(output),
1458
+ applicationArn: undefined,
1459
+ applicationId: undefined,
1460
+ creationTime: undefined,
1461
+ deployedVersion: undefined,
1462
+ description: undefined,
1463
+ engineType: undefined,
1464
+ environmentId: undefined,
1465
+ lastStartTime: undefined,
1466
+ latestVersion: undefined,
1467
+ listenerArns: undefined,
1468
+ listenerPorts: undefined,
1469
+ loadBalancerDnsName: undefined,
1470
+ logGroups: undefined,
1471
+ name: undefined,
1472
+ status: undefined,
1473
+ statusReason: undefined,
1474
+ tags: undefined,
1475
+ targetGroupArns: undefined,
1476
+ };
1477
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1478
+ if (data.applicationArn !== undefined && data.applicationArn !== null) {
1479
+ contents.applicationArn = (0, smithy_client_1.expectString)(data.applicationArn);
1480
+ }
1481
+ if (data.applicationId !== undefined && data.applicationId !== null) {
1482
+ contents.applicationId = (0, smithy_client_1.expectString)(data.applicationId);
1483
+ }
1484
+ if (data.creationTime !== undefined && data.creationTime !== null) {
1485
+ contents.creationTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.creationTime)));
1486
+ }
1487
+ if (data.deployedVersion !== undefined && data.deployedVersion !== null) {
1488
+ contents.deployedVersion = deserializeAws_restJson1DeployedVersionSummary(data.deployedVersion, context);
1489
+ }
1490
+ if (data.description !== undefined && data.description !== null) {
1491
+ contents.description = (0, smithy_client_1.expectString)(data.description);
1492
+ }
1493
+ if (data.engineType !== undefined && data.engineType !== null) {
1494
+ contents.engineType = (0, smithy_client_1.expectString)(data.engineType);
1495
+ }
1496
+ if (data.environmentId !== undefined && data.environmentId !== null) {
1497
+ contents.environmentId = (0, smithy_client_1.expectString)(data.environmentId);
1498
+ }
1499
+ if (data.lastStartTime !== undefined && data.lastStartTime !== null) {
1500
+ contents.lastStartTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.lastStartTime)));
1501
+ }
1502
+ if (data.latestVersion !== undefined && data.latestVersion !== null) {
1503
+ contents.latestVersion = deserializeAws_restJson1ApplicationVersionSummary(data.latestVersion, context);
1504
+ }
1505
+ if (data.listenerArns !== undefined && data.listenerArns !== null) {
1506
+ contents.listenerArns = deserializeAws_restJson1ArnList(data.listenerArns, context);
1507
+ }
1508
+ if (data.listenerPorts !== undefined && data.listenerPorts !== null) {
1509
+ contents.listenerPorts = deserializeAws_restJson1PortList(data.listenerPorts, context);
1510
+ }
1511
+ if (data.loadBalancerDnsName !== undefined && data.loadBalancerDnsName !== null) {
1512
+ contents.loadBalancerDnsName = (0, smithy_client_1.expectString)(data.loadBalancerDnsName);
1513
+ }
1514
+ if (data.logGroups !== undefined && data.logGroups !== null) {
1515
+ contents.logGroups = deserializeAws_restJson1LogGroupSummaries(data.logGroups, context);
1516
+ }
1517
+ if (data.name !== undefined && data.name !== null) {
1518
+ contents.name = (0, smithy_client_1.expectString)(data.name);
1519
+ }
1520
+ if (data.status !== undefined && data.status !== null) {
1521
+ contents.status = (0, smithy_client_1.expectString)(data.status);
1522
+ }
1523
+ if (data.statusReason !== undefined && data.statusReason !== null) {
1524
+ contents.statusReason = (0, smithy_client_1.expectString)(data.statusReason);
1525
+ }
1526
+ if (data.tags !== undefined && data.tags !== null) {
1527
+ contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
1528
+ }
1529
+ if (data.targetGroupArns !== undefined && data.targetGroupArns !== null) {
1530
+ contents.targetGroupArns = deserializeAws_restJson1ArnList(data.targetGroupArns, context);
1531
+ }
1532
+ return Promise.resolve(contents);
1533
+ };
1534
+ exports.deserializeAws_restJson1GetApplicationCommand = deserializeAws_restJson1GetApplicationCommand;
1535
+ const deserializeAws_restJson1GetApplicationCommandError = async (output, context) => {
1536
+ const parsedOutput = {
1537
+ ...output,
1538
+ body: await parseBody(output.body, context),
1539
+ };
1540
+ let response;
1541
+ let errorCode = "UnknownError";
1542
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1543
+ switch (errorCode) {
1544
+ case "AccessDeniedException":
1545
+ case "com.amazonaws.m2#AccessDeniedException":
1546
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1547
+ case "InternalServerException":
1548
+ case "com.amazonaws.m2#InternalServerException":
1549
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1550
+ case "ResourceNotFoundException":
1551
+ case "com.amazonaws.m2#ResourceNotFoundException":
1552
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1553
+ case "ThrottlingException":
1554
+ case "com.amazonaws.m2#ThrottlingException":
1555
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1556
+ case "ValidationException":
1557
+ case "com.amazonaws.m2#ValidationException":
1558
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1559
+ default:
1560
+ const parsedBody = parsedOutput.body;
1561
+ response = new M2ServiceException_1.M2ServiceException({
1562
+ name: parsedBody.code || parsedBody.Code || errorCode,
1563
+ $fault: "client",
1564
+ $metadata: deserializeMetadata(output),
1565
+ });
1566
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1567
+ }
1568
+ };
1569
+ const deserializeAws_restJson1GetApplicationVersionCommand = async (output, context) => {
1570
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1571
+ return deserializeAws_restJson1GetApplicationVersionCommandError(output, context);
1572
+ }
1573
+ const contents = {
1574
+ $metadata: deserializeMetadata(output),
1575
+ applicationVersion: undefined,
1576
+ creationTime: undefined,
1577
+ definitionContent: undefined,
1578
+ description: undefined,
1579
+ name: undefined,
1580
+ status: undefined,
1581
+ statusReason: undefined,
1582
+ };
1583
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1584
+ if (data.applicationVersion !== undefined && data.applicationVersion !== null) {
1585
+ contents.applicationVersion = (0, smithy_client_1.expectInt32)(data.applicationVersion);
1586
+ }
1587
+ if (data.creationTime !== undefined && data.creationTime !== null) {
1588
+ contents.creationTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.creationTime)));
1589
+ }
1590
+ if (data.definitionContent !== undefined && data.definitionContent !== null) {
1591
+ contents.definitionContent = (0, smithy_client_1.expectString)(data.definitionContent);
1592
+ }
1593
+ if (data.description !== undefined && data.description !== null) {
1594
+ contents.description = (0, smithy_client_1.expectString)(data.description);
1595
+ }
1596
+ if (data.name !== undefined && data.name !== null) {
1597
+ contents.name = (0, smithy_client_1.expectString)(data.name);
1598
+ }
1599
+ if (data.status !== undefined && data.status !== null) {
1600
+ contents.status = (0, smithy_client_1.expectString)(data.status);
1601
+ }
1602
+ if (data.statusReason !== undefined && data.statusReason !== null) {
1603
+ contents.statusReason = (0, smithy_client_1.expectString)(data.statusReason);
1604
+ }
1605
+ return Promise.resolve(contents);
1606
+ };
1607
+ exports.deserializeAws_restJson1GetApplicationVersionCommand = deserializeAws_restJson1GetApplicationVersionCommand;
1608
+ const deserializeAws_restJson1GetApplicationVersionCommandError = async (output, context) => {
1609
+ const parsedOutput = {
1610
+ ...output,
1611
+ body: await parseBody(output.body, context),
1612
+ };
1613
+ let response;
1614
+ let errorCode = "UnknownError";
1615
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1616
+ switch (errorCode) {
1617
+ case "AccessDeniedException":
1618
+ case "com.amazonaws.m2#AccessDeniedException":
1619
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1620
+ case "InternalServerException":
1621
+ case "com.amazonaws.m2#InternalServerException":
1622
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1623
+ case "ResourceNotFoundException":
1624
+ case "com.amazonaws.m2#ResourceNotFoundException":
1625
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1626
+ case "ThrottlingException":
1627
+ case "com.amazonaws.m2#ThrottlingException":
1628
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1629
+ case "ValidationException":
1630
+ case "com.amazonaws.m2#ValidationException":
1631
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1632
+ default:
1633
+ const parsedBody = parsedOutput.body;
1634
+ response = new M2ServiceException_1.M2ServiceException({
1635
+ name: parsedBody.code || parsedBody.Code || errorCode,
1636
+ $fault: "client",
1637
+ $metadata: deserializeMetadata(output),
1638
+ });
1639
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1640
+ }
1641
+ };
1642
+ const deserializeAws_restJson1GetBatchJobExecutionCommand = async (output, context) => {
1643
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1644
+ return deserializeAws_restJson1GetBatchJobExecutionCommandError(output, context);
1645
+ }
1646
+ const contents = {
1647
+ $metadata: deserializeMetadata(output),
1648
+ applicationId: undefined,
1649
+ endTime: undefined,
1650
+ executionId: undefined,
1651
+ jobId: undefined,
1652
+ jobName: undefined,
1653
+ jobType: undefined,
1654
+ jobUser: undefined,
1655
+ startTime: undefined,
1656
+ status: undefined,
1657
+ statusReason: undefined,
1658
+ };
1659
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1660
+ if (data.applicationId !== undefined && data.applicationId !== null) {
1661
+ contents.applicationId = (0, smithy_client_1.expectString)(data.applicationId);
1662
+ }
1663
+ if (data.endTime !== undefined && data.endTime !== null) {
1664
+ contents.endTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.endTime)));
1665
+ }
1666
+ if (data.executionId !== undefined && data.executionId !== null) {
1667
+ contents.executionId = (0, smithy_client_1.expectString)(data.executionId);
1668
+ }
1669
+ if (data.jobId !== undefined && data.jobId !== null) {
1670
+ contents.jobId = (0, smithy_client_1.expectString)(data.jobId);
1671
+ }
1672
+ if (data.jobName !== undefined && data.jobName !== null) {
1673
+ contents.jobName = (0, smithy_client_1.expectString)(data.jobName);
1674
+ }
1675
+ if (data.jobType !== undefined && data.jobType !== null) {
1676
+ contents.jobType = (0, smithy_client_1.expectString)(data.jobType);
1677
+ }
1678
+ if (data.jobUser !== undefined && data.jobUser !== null) {
1679
+ contents.jobUser = (0, smithy_client_1.expectString)(data.jobUser);
1680
+ }
1681
+ if (data.startTime !== undefined && data.startTime !== null) {
1682
+ contents.startTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.startTime)));
1683
+ }
1684
+ if (data.status !== undefined && data.status !== null) {
1685
+ contents.status = (0, smithy_client_1.expectString)(data.status);
1686
+ }
1687
+ if (data.statusReason !== undefined && data.statusReason !== null) {
1688
+ contents.statusReason = (0, smithy_client_1.expectString)(data.statusReason);
1689
+ }
1690
+ return Promise.resolve(contents);
1691
+ };
1692
+ exports.deserializeAws_restJson1GetBatchJobExecutionCommand = deserializeAws_restJson1GetBatchJobExecutionCommand;
1693
+ const deserializeAws_restJson1GetBatchJobExecutionCommandError = async (output, context) => {
1694
+ const parsedOutput = {
1695
+ ...output,
1696
+ body: await parseBody(output.body, context),
1697
+ };
1698
+ let response;
1699
+ let errorCode = "UnknownError";
1700
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1701
+ switch (errorCode) {
1702
+ case "AccessDeniedException":
1703
+ case "com.amazonaws.m2#AccessDeniedException":
1704
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1705
+ case "InternalServerException":
1706
+ case "com.amazonaws.m2#InternalServerException":
1707
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1708
+ case "ResourceNotFoundException":
1709
+ case "com.amazonaws.m2#ResourceNotFoundException":
1710
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1711
+ case "ThrottlingException":
1712
+ case "com.amazonaws.m2#ThrottlingException":
1713
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1714
+ case "ValidationException":
1715
+ case "com.amazonaws.m2#ValidationException":
1716
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1717
+ default:
1718
+ const parsedBody = parsedOutput.body;
1719
+ response = new M2ServiceException_1.M2ServiceException({
1720
+ name: parsedBody.code || parsedBody.Code || errorCode,
1721
+ $fault: "client",
1722
+ $metadata: deserializeMetadata(output),
1723
+ });
1724
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1725
+ }
1726
+ };
1727
+ const deserializeAws_restJson1GetDataSetDetailsCommand = async (output, context) => {
1728
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1729
+ return deserializeAws_restJson1GetDataSetDetailsCommandError(output, context);
1730
+ }
1731
+ const contents = {
1732
+ $metadata: deserializeMetadata(output),
1733
+ blocksize: undefined,
1734
+ creationTime: undefined,
1735
+ dataSetName: undefined,
1736
+ dataSetOrg: undefined,
1737
+ lastReferencedTime: undefined,
1738
+ lastUpdatedTime: undefined,
1739
+ location: undefined,
1740
+ recordLength: undefined,
1741
+ };
1742
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1743
+ if (data.blocksize !== undefined && data.blocksize !== null) {
1744
+ contents.blocksize = (0, smithy_client_1.expectInt32)(data.blocksize);
1745
+ }
1746
+ if (data.creationTime !== undefined && data.creationTime !== null) {
1747
+ contents.creationTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.creationTime)));
1748
+ }
1749
+ if (data.dataSetName !== undefined && data.dataSetName !== null) {
1750
+ contents.dataSetName = (0, smithy_client_1.expectString)(data.dataSetName);
1751
+ }
1752
+ if (data.dataSetOrg !== undefined && data.dataSetOrg !== null) {
1753
+ contents.dataSetOrg = deserializeAws_restJson1DatasetDetailOrgAttributes((0, smithy_client_1.expectUnion)(data.dataSetOrg), context);
1754
+ }
1755
+ if (data.lastReferencedTime !== undefined && data.lastReferencedTime !== null) {
1756
+ contents.lastReferencedTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.lastReferencedTime)));
1757
+ }
1758
+ if (data.lastUpdatedTime !== undefined && data.lastUpdatedTime !== null) {
1759
+ contents.lastUpdatedTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.lastUpdatedTime)));
1760
+ }
1761
+ if (data.location !== undefined && data.location !== null) {
1762
+ contents.location = (0, smithy_client_1.expectString)(data.location);
1763
+ }
1764
+ if (data.recordLength !== undefined && data.recordLength !== null) {
1765
+ contents.recordLength = (0, smithy_client_1.expectInt32)(data.recordLength);
1766
+ }
1767
+ return Promise.resolve(contents);
1768
+ };
1769
+ exports.deserializeAws_restJson1GetDataSetDetailsCommand = deserializeAws_restJson1GetDataSetDetailsCommand;
1770
+ const deserializeAws_restJson1GetDataSetDetailsCommandError = async (output, context) => {
1771
+ const parsedOutput = {
1772
+ ...output,
1773
+ body: await parseBody(output.body, context),
1774
+ };
1775
+ let response;
1776
+ let errorCode = "UnknownError";
1777
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1778
+ switch (errorCode) {
1779
+ case "AccessDeniedException":
1780
+ case "com.amazonaws.m2#AccessDeniedException":
1781
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1782
+ case "InternalServerException":
1783
+ case "com.amazonaws.m2#InternalServerException":
1784
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1785
+ case "ResourceNotFoundException":
1786
+ case "com.amazonaws.m2#ResourceNotFoundException":
1787
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1788
+ case "ThrottlingException":
1789
+ case "com.amazonaws.m2#ThrottlingException":
1790
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1791
+ case "ValidationException":
1792
+ case "com.amazonaws.m2#ValidationException":
1793
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1794
+ default:
1795
+ const parsedBody = parsedOutput.body;
1796
+ response = new M2ServiceException_1.M2ServiceException({
1797
+ name: parsedBody.code || parsedBody.Code || errorCode,
1798
+ $fault: "client",
1799
+ $metadata: deserializeMetadata(output),
1800
+ });
1801
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1802
+ }
1803
+ };
1804
+ const deserializeAws_restJson1GetDataSetImportTaskCommand = async (output, context) => {
1805
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1806
+ return deserializeAws_restJson1GetDataSetImportTaskCommandError(output, context);
1807
+ }
1808
+ const contents = {
1809
+ $metadata: deserializeMetadata(output),
1810
+ status: undefined,
1811
+ summary: undefined,
1812
+ taskId: undefined,
1813
+ };
1814
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1815
+ if (data.status !== undefined && data.status !== null) {
1816
+ contents.status = (0, smithy_client_1.expectString)(data.status);
1817
+ }
1818
+ if (data.summary !== undefined && data.summary !== null) {
1819
+ contents.summary = deserializeAws_restJson1DataSetImportSummary(data.summary, context);
1820
+ }
1821
+ if (data.taskId !== undefined && data.taskId !== null) {
1822
+ contents.taskId = (0, smithy_client_1.expectString)(data.taskId);
1823
+ }
1824
+ return Promise.resolve(contents);
1825
+ };
1826
+ exports.deserializeAws_restJson1GetDataSetImportTaskCommand = deserializeAws_restJson1GetDataSetImportTaskCommand;
1827
+ const deserializeAws_restJson1GetDataSetImportTaskCommandError = async (output, context) => {
1828
+ const parsedOutput = {
1829
+ ...output,
1830
+ body: await parseBody(output.body, context),
1831
+ };
1832
+ let response;
1833
+ let errorCode = "UnknownError";
1834
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1835
+ switch (errorCode) {
1836
+ case "AccessDeniedException":
1837
+ case "com.amazonaws.m2#AccessDeniedException":
1838
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1839
+ case "InternalServerException":
1840
+ case "com.amazonaws.m2#InternalServerException":
1841
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1842
+ case "ResourceNotFoundException":
1843
+ case "com.amazonaws.m2#ResourceNotFoundException":
1844
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1845
+ case "ThrottlingException":
1846
+ case "com.amazonaws.m2#ThrottlingException":
1847
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1848
+ case "ValidationException":
1849
+ case "com.amazonaws.m2#ValidationException":
1850
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1851
+ default:
1852
+ const parsedBody = parsedOutput.body;
1853
+ response = new M2ServiceException_1.M2ServiceException({
1854
+ name: parsedBody.code || parsedBody.Code || errorCode,
1855
+ $fault: "client",
1856
+ $metadata: deserializeMetadata(output),
1857
+ });
1858
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1859
+ }
1860
+ };
1861
+ const deserializeAws_restJson1GetDeploymentCommand = async (output, context) => {
1862
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1863
+ return deserializeAws_restJson1GetDeploymentCommandError(output, context);
1864
+ }
1865
+ const contents = {
1866
+ $metadata: deserializeMetadata(output),
1867
+ applicationId: undefined,
1868
+ applicationVersion: undefined,
1869
+ creationTime: undefined,
1870
+ deploymentId: undefined,
1871
+ environmentId: undefined,
1872
+ status: undefined,
1873
+ statusReason: undefined,
1874
+ };
1875
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1876
+ if (data.applicationId !== undefined && data.applicationId !== null) {
1877
+ contents.applicationId = (0, smithy_client_1.expectString)(data.applicationId);
1878
+ }
1879
+ if (data.applicationVersion !== undefined && data.applicationVersion !== null) {
1880
+ contents.applicationVersion = (0, smithy_client_1.expectInt32)(data.applicationVersion);
1881
+ }
1882
+ if (data.creationTime !== undefined && data.creationTime !== null) {
1883
+ contents.creationTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.creationTime)));
1884
+ }
1885
+ if (data.deploymentId !== undefined && data.deploymentId !== null) {
1886
+ contents.deploymentId = (0, smithy_client_1.expectString)(data.deploymentId);
1887
+ }
1888
+ if (data.environmentId !== undefined && data.environmentId !== null) {
1889
+ contents.environmentId = (0, smithy_client_1.expectString)(data.environmentId);
1890
+ }
1891
+ if (data.status !== undefined && data.status !== null) {
1892
+ contents.status = (0, smithy_client_1.expectString)(data.status);
1893
+ }
1894
+ if (data.statusReason !== undefined && data.statusReason !== null) {
1895
+ contents.statusReason = (0, smithy_client_1.expectString)(data.statusReason);
1896
+ }
1897
+ return Promise.resolve(contents);
1898
+ };
1899
+ exports.deserializeAws_restJson1GetDeploymentCommand = deserializeAws_restJson1GetDeploymentCommand;
1900
+ const deserializeAws_restJson1GetDeploymentCommandError = async (output, context) => {
1901
+ const parsedOutput = {
1902
+ ...output,
1903
+ body: await parseBody(output.body, context),
1904
+ };
1905
+ let response;
1906
+ let errorCode = "UnknownError";
1907
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1908
+ switch (errorCode) {
1909
+ case "AccessDeniedException":
1910
+ case "com.amazonaws.m2#AccessDeniedException":
1911
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1912
+ case "InternalServerException":
1913
+ case "com.amazonaws.m2#InternalServerException":
1914
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1915
+ case "ResourceNotFoundException":
1916
+ case "com.amazonaws.m2#ResourceNotFoundException":
1917
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1918
+ case "ThrottlingException":
1919
+ case "com.amazonaws.m2#ThrottlingException":
1920
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1921
+ case "ValidationException":
1922
+ case "com.amazonaws.m2#ValidationException":
1923
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1924
+ default:
1925
+ const parsedBody = parsedOutput.body;
1926
+ response = new M2ServiceException_1.M2ServiceException({
1927
+ name: parsedBody.code || parsedBody.Code || errorCode,
1928
+ $fault: "client",
1929
+ $metadata: deserializeMetadata(output),
1930
+ });
1931
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1932
+ }
1933
+ };
1934
+ const deserializeAws_restJson1GetEnvironmentCommand = async (output, context) => {
1935
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1936
+ return deserializeAws_restJson1GetEnvironmentCommandError(output, context);
1937
+ }
1938
+ const contents = {
1939
+ $metadata: deserializeMetadata(output),
1940
+ actualCapacity: undefined,
1941
+ creationTime: undefined,
1942
+ description: undefined,
1943
+ engineType: undefined,
1944
+ engineVersion: undefined,
1945
+ environmentArn: undefined,
1946
+ environmentId: undefined,
1947
+ highAvailabilityConfig: undefined,
1948
+ instanceType: undefined,
1949
+ loadBalancerArn: undefined,
1950
+ name: undefined,
1951
+ pendingMaintenance: undefined,
1952
+ preferredMaintenanceWindow: undefined,
1953
+ publiclyAccessible: undefined,
1954
+ securityGroupIds: undefined,
1955
+ status: undefined,
1956
+ statusReason: undefined,
1957
+ storageConfigurations: undefined,
1958
+ subnetIds: undefined,
1959
+ tags: undefined,
1960
+ vpcId: undefined,
1961
+ };
1962
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1963
+ if (data.actualCapacity !== undefined && data.actualCapacity !== null) {
1964
+ contents.actualCapacity = (0, smithy_client_1.expectInt32)(data.actualCapacity);
1965
+ }
1966
+ if (data.creationTime !== undefined && data.creationTime !== null) {
1967
+ contents.creationTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.creationTime)));
1968
+ }
1969
+ if (data.description !== undefined && data.description !== null) {
1970
+ contents.description = (0, smithy_client_1.expectString)(data.description);
1971
+ }
1972
+ if (data.engineType !== undefined && data.engineType !== null) {
1973
+ contents.engineType = (0, smithy_client_1.expectString)(data.engineType);
1974
+ }
1975
+ if (data.engineVersion !== undefined && data.engineVersion !== null) {
1976
+ contents.engineVersion = (0, smithy_client_1.expectString)(data.engineVersion);
1977
+ }
1978
+ if (data.environmentArn !== undefined && data.environmentArn !== null) {
1979
+ contents.environmentArn = (0, smithy_client_1.expectString)(data.environmentArn);
1980
+ }
1981
+ if (data.environmentId !== undefined && data.environmentId !== null) {
1982
+ contents.environmentId = (0, smithy_client_1.expectString)(data.environmentId);
1983
+ }
1984
+ if (data.highAvailabilityConfig !== undefined && data.highAvailabilityConfig !== null) {
1985
+ contents.highAvailabilityConfig = deserializeAws_restJson1HighAvailabilityConfig(data.highAvailabilityConfig, context);
1986
+ }
1987
+ if (data.instanceType !== undefined && data.instanceType !== null) {
1988
+ contents.instanceType = (0, smithy_client_1.expectString)(data.instanceType);
1989
+ }
1990
+ if (data.loadBalancerArn !== undefined && data.loadBalancerArn !== null) {
1991
+ contents.loadBalancerArn = (0, smithy_client_1.expectString)(data.loadBalancerArn);
1992
+ }
1993
+ if (data.name !== undefined && data.name !== null) {
1994
+ contents.name = (0, smithy_client_1.expectString)(data.name);
1995
+ }
1996
+ if (data.pendingMaintenance !== undefined && data.pendingMaintenance !== null) {
1997
+ contents.pendingMaintenance = deserializeAws_restJson1PendingMaintenance(data.pendingMaintenance, context);
1998
+ }
1999
+ if (data.preferredMaintenanceWindow !== undefined && data.preferredMaintenanceWindow !== null) {
2000
+ contents.preferredMaintenanceWindow = (0, smithy_client_1.expectString)(data.preferredMaintenanceWindow);
2001
+ }
2002
+ if (data.publiclyAccessible !== undefined && data.publiclyAccessible !== null) {
2003
+ contents.publiclyAccessible = (0, smithy_client_1.expectBoolean)(data.publiclyAccessible);
2004
+ }
2005
+ if (data.securityGroupIds !== undefined && data.securityGroupIds !== null) {
2006
+ contents.securityGroupIds = deserializeAws_restJson1String50List(data.securityGroupIds, context);
2007
+ }
2008
+ if (data.status !== undefined && data.status !== null) {
2009
+ contents.status = (0, smithy_client_1.expectString)(data.status);
2010
+ }
2011
+ if (data.statusReason !== undefined && data.statusReason !== null) {
2012
+ contents.statusReason = (0, smithy_client_1.expectString)(data.statusReason);
2013
+ }
2014
+ if (data.storageConfigurations !== undefined && data.storageConfigurations !== null) {
2015
+ contents.storageConfigurations = deserializeAws_restJson1StorageConfigurationList(data.storageConfigurations, context);
2016
+ }
2017
+ if (data.subnetIds !== undefined && data.subnetIds !== null) {
2018
+ contents.subnetIds = deserializeAws_restJson1String50List(data.subnetIds, context);
2019
+ }
2020
+ if (data.tags !== undefined && data.tags !== null) {
2021
+ contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
2022
+ }
2023
+ if (data.vpcId !== undefined && data.vpcId !== null) {
2024
+ contents.vpcId = (0, smithy_client_1.expectString)(data.vpcId);
2025
+ }
2026
+ return Promise.resolve(contents);
2027
+ };
2028
+ exports.deserializeAws_restJson1GetEnvironmentCommand = deserializeAws_restJson1GetEnvironmentCommand;
2029
+ const deserializeAws_restJson1GetEnvironmentCommandError = async (output, context) => {
2030
+ const parsedOutput = {
2031
+ ...output,
2032
+ body: await parseBody(output.body, context),
2033
+ };
2034
+ let response;
2035
+ let errorCode = "UnknownError";
2036
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2037
+ switch (errorCode) {
2038
+ case "AccessDeniedException":
2039
+ case "com.amazonaws.m2#AccessDeniedException":
2040
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2041
+ case "InternalServerException":
2042
+ case "com.amazonaws.m2#InternalServerException":
2043
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2044
+ case "ResourceNotFoundException":
2045
+ case "com.amazonaws.m2#ResourceNotFoundException":
2046
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2047
+ case "ThrottlingException":
2048
+ case "com.amazonaws.m2#ThrottlingException":
2049
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2050
+ case "ValidationException":
2051
+ case "com.amazonaws.m2#ValidationException":
2052
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2053
+ default:
2054
+ const parsedBody = parsedOutput.body;
2055
+ response = new M2ServiceException_1.M2ServiceException({
2056
+ name: parsedBody.code || parsedBody.Code || errorCode,
2057
+ $fault: "client",
2058
+ $metadata: deserializeMetadata(output),
2059
+ });
2060
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2061
+ }
2062
+ };
2063
+ const deserializeAws_restJson1ListApplicationsCommand = async (output, context) => {
2064
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2065
+ return deserializeAws_restJson1ListApplicationsCommandError(output, context);
2066
+ }
2067
+ const contents = {
2068
+ $metadata: deserializeMetadata(output),
2069
+ applications: undefined,
2070
+ nextToken: undefined,
2071
+ };
2072
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2073
+ if (data.applications !== undefined && data.applications !== null) {
2074
+ contents.applications = deserializeAws_restJson1ApplicationSummaryList(data.applications, context);
2075
+ }
2076
+ if (data.nextToken !== undefined && data.nextToken !== null) {
2077
+ contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
2078
+ }
2079
+ return Promise.resolve(contents);
2080
+ };
2081
+ exports.deserializeAws_restJson1ListApplicationsCommand = deserializeAws_restJson1ListApplicationsCommand;
2082
+ const deserializeAws_restJson1ListApplicationsCommandError = async (output, context) => {
2083
+ const parsedOutput = {
2084
+ ...output,
2085
+ body: await parseBody(output.body, context),
2086
+ };
2087
+ let response;
2088
+ let errorCode = "UnknownError";
2089
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2090
+ switch (errorCode) {
2091
+ case "AccessDeniedException":
2092
+ case "com.amazonaws.m2#AccessDeniedException":
2093
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2094
+ case "InternalServerException":
2095
+ case "com.amazonaws.m2#InternalServerException":
2096
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2097
+ case "ThrottlingException":
2098
+ case "com.amazonaws.m2#ThrottlingException":
2099
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2100
+ case "ValidationException":
2101
+ case "com.amazonaws.m2#ValidationException":
2102
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2103
+ default:
2104
+ const parsedBody = parsedOutput.body;
2105
+ response = new M2ServiceException_1.M2ServiceException({
2106
+ name: parsedBody.code || parsedBody.Code || errorCode,
2107
+ $fault: "client",
2108
+ $metadata: deserializeMetadata(output),
2109
+ });
2110
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2111
+ }
2112
+ };
2113
+ const deserializeAws_restJson1ListApplicationVersionsCommand = async (output, context) => {
2114
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2115
+ return deserializeAws_restJson1ListApplicationVersionsCommandError(output, context);
2116
+ }
2117
+ const contents = {
2118
+ $metadata: deserializeMetadata(output),
2119
+ applicationVersions: undefined,
2120
+ nextToken: undefined,
2121
+ };
2122
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2123
+ if (data.applicationVersions !== undefined && data.applicationVersions !== null) {
2124
+ contents.applicationVersions = deserializeAws_restJson1ApplicationVersionSummaryList(data.applicationVersions, context);
2125
+ }
2126
+ if (data.nextToken !== undefined && data.nextToken !== null) {
2127
+ contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
2128
+ }
2129
+ return Promise.resolve(contents);
2130
+ };
2131
+ exports.deserializeAws_restJson1ListApplicationVersionsCommand = deserializeAws_restJson1ListApplicationVersionsCommand;
2132
+ const deserializeAws_restJson1ListApplicationVersionsCommandError = async (output, context) => {
2133
+ const parsedOutput = {
2134
+ ...output,
2135
+ body: await parseBody(output.body, context),
2136
+ };
2137
+ let response;
2138
+ let errorCode = "UnknownError";
2139
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2140
+ switch (errorCode) {
2141
+ case "AccessDeniedException":
2142
+ case "com.amazonaws.m2#AccessDeniedException":
2143
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2144
+ case "InternalServerException":
2145
+ case "com.amazonaws.m2#InternalServerException":
2146
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2147
+ case "ResourceNotFoundException":
2148
+ case "com.amazonaws.m2#ResourceNotFoundException":
2149
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2150
+ case "ThrottlingException":
2151
+ case "com.amazonaws.m2#ThrottlingException":
2152
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2153
+ case "ValidationException":
2154
+ case "com.amazonaws.m2#ValidationException":
2155
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2156
+ default:
2157
+ const parsedBody = parsedOutput.body;
2158
+ response = new M2ServiceException_1.M2ServiceException({
2159
+ name: parsedBody.code || parsedBody.Code || errorCode,
2160
+ $fault: "client",
2161
+ $metadata: deserializeMetadata(output),
2162
+ });
2163
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2164
+ }
2165
+ };
2166
+ const deserializeAws_restJson1ListBatchJobDefinitionsCommand = async (output, context) => {
2167
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2168
+ return deserializeAws_restJson1ListBatchJobDefinitionsCommandError(output, context);
2169
+ }
2170
+ const contents = {
2171
+ $metadata: deserializeMetadata(output),
2172
+ batchJobDefinitions: undefined,
2173
+ nextToken: undefined,
2174
+ };
2175
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2176
+ if (data.batchJobDefinitions !== undefined && data.batchJobDefinitions !== null) {
2177
+ contents.batchJobDefinitions = deserializeAws_restJson1BatchJobDefinitions(data.batchJobDefinitions, context);
2178
+ }
2179
+ if (data.nextToken !== undefined && data.nextToken !== null) {
2180
+ contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
2181
+ }
2182
+ return Promise.resolve(contents);
2183
+ };
2184
+ exports.deserializeAws_restJson1ListBatchJobDefinitionsCommand = deserializeAws_restJson1ListBatchJobDefinitionsCommand;
2185
+ const deserializeAws_restJson1ListBatchJobDefinitionsCommandError = async (output, context) => {
2186
+ const parsedOutput = {
2187
+ ...output,
2188
+ body: await parseBody(output.body, context),
2189
+ };
2190
+ let response;
2191
+ let errorCode = "UnknownError";
2192
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2193
+ switch (errorCode) {
2194
+ case "AccessDeniedException":
2195
+ case "com.amazonaws.m2#AccessDeniedException":
2196
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2197
+ case "InternalServerException":
2198
+ case "com.amazonaws.m2#InternalServerException":
2199
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2200
+ case "ResourceNotFoundException":
2201
+ case "com.amazonaws.m2#ResourceNotFoundException":
2202
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2203
+ case "ThrottlingException":
2204
+ case "com.amazonaws.m2#ThrottlingException":
2205
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2206
+ case "ValidationException":
2207
+ case "com.amazonaws.m2#ValidationException":
2208
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2209
+ default:
2210
+ const parsedBody = parsedOutput.body;
2211
+ response = new M2ServiceException_1.M2ServiceException({
2212
+ name: parsedBody.code || parsedBody.Code || errorCode,
2213
+ $fault: "client",
2214
+ $metadata: deserializeMetadata(output),
2215
+ });
2216
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2217
+ }
2218
+ };
2219
+ const deserializeAws_restJson1ListBatchJobExecutionsCommand = async (output, context) => {
2220
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2221
+ return deserializeAws_restJson1ListBatchJobExecutionsCommandError(output, context);
2222
+ }
2223
+ const contents = {
2224
+ $metadata: deserializeMetadata(output),
2225
+ batchJobExecutions: undefined,
2226
+ nextToken: undefined,
2227
+ };
2228
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2229
+ if (data.batchJobExecutions !== undefined && data.batchJobExecutions !== null) {
2230
+ contents.batchJobExecutions = deserializeAws_restJson1BatchJobExecutionSummaryList(data.batchJobExecutions, context);
2231
+ }
2232
+ if (data.nextToken !== undefined && data.nextToken !== null) {
2233
+ contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
2234
+ }
2235
+ return Promise.resolve(contents);
2236
+ };
2237
+ exports.deserializeAws_restJson1ListBatchJobExecutionsCommand = deserializeAws_restJson1ListBatchJobExecutionsCommand;
2238
+ const deserializeAws_restJson1ListBatchJobExecutionsCommandError = async (output, context) => {
2239
+ const parsedOutput = {
2240
+ ...output,
2241
+ body: await parseBody(output.body, context),
2242
+ };
2243
+ let response;
2244
+ let errorCode = "UnknownError";
2245
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2246
+ switch (errorCode) {
2247
+ case "AccessDeniedException":
2248
+ case "com.amazonaws.m2#AccessDeniedException":
2249
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2250
+ case "InternalServerException":
2251
+ case "com.amazonaws.m2#InternalServerException":
2252
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2253
+ case "ResourceNotFoundException":
2254
+ case "com.amazonaws.m2#ResourceNotFoundException":
2255
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2256
+ case "ThrottlingException":
2257
+ case "com.amazonaws.m2#ThrottlingException":
2258
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2259
+ case "ValidationException":
2260
+ case "com.amazonaws.m2#ValidationException":
2261
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2262
+ default:
2263
+ const parsedBody = parsedOutput.body;
2264
+ response = new M2ServiceException_1.M2ServiceException({
2265
+ name: parsedBody.code || parsedBody.Code || errorCode,
2266
+ $fault: "client",
2267
+ $metadata: deserializeMetadata(output),
2268
+ });
2269
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2270
+ }
2271
+ };
2272
+ const deserializeAws_restJson1ListDataSetImportHistoryCommand = async (output, context) => {
2273
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2274
+ return deserializeAws_restJson1ListDataSetImportHistoryCommandError(output, context);
2275
+ }
2276
+ const contents = {
2277
+ $metadata: deserializeMetadata(output),
2278
+ dataSetImportTasks: undefined,
2279
+ nextToken: undefined,
2280
+ };
2281
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2282
+ if (data.dataSetImportTasks !== undefined && data.dataSetImportTasks !== null) {
2283
+ contents.dataSetImportTasks = deserializeAws_restJson1DataSetImportTaskList(data.dataSetImportTasks, context);
2284
+ }
2285
+ if (data.nextToken !== undefined && data.nextToken !== null) {
2286
+ contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
2287
+ }
2288
+ return Promise.resolve(contents);
2289
+ };
2290
+ exports.deserializeAws_restJson1ListDataSetImportHistoryCommand = deserializeAws_restJson1ListDataSetImportHistoryCommand;
2291
+ const deserializeAws_restJson1ListDataSetImportHistoryCommandError = async (output, context) => {
2292
+ const parsedOutput = {
2293
+ ...output,
2294
+ body: await parseBody(output.body, context),
2295
+ };
2296
+ let response;
2297
+ let errorCode = "UnknownError";
2298
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2299
+ switch (errorCode) {
2300
+ case "AccessDeniedException":
2301
+ case "com.amazonaws.m2#AccessDeniedException":
2302
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2303
+ case "InternalServerException":
2304
+ case "com.amazonaws.m2#InternalServerException":
2305
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2306
+ case "ResourceNotFoundException":
2307
+ case "com.amazonaws.m2#ResourceNotFoundException":
2308
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2309
+ case "ThrottlingException":
2310
+ case "com.amazonaws.m2#ThrottlingException":
2311
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2312
+ case "ValidationException":
2313
+ case "com.amazonaws.m2#ValidationException":
2314
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2315
+ default:
2316
+ const parsedBody = parsedOutput.body;
2317
+ response = new M2ServiceException_1.M2ServiceException({
2318
+ name: parsedBody.code || parsedBody.Code || errorCode,
2319
+ $fault: "client",
2320
+ $metadata: deserializeMetadata(output),
2321
+ });
2322
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2323
+ }
2324
+ };
2325
+ const deserializeAws_restJson1ListDataSetsCommand = async (output, context) => {
2326
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2327
+ return deserializeAws_restJson1ListDataSetsCommandError(output, context);
2328
+ }
2329
+ const contents = {
2330
+ $metadata: deserializeMetadata(output),
2331
+ dataSets: undefined,
2332
+ nextToken: undefined,
2333
+ };
2334
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2335
+ if (data.dataSets !== undefined && data.dataSets !== null) {
2336
+ contents.dataSets = deserializeAws_restJson1DataSetsSummaryList(data.dataSets, context);
2337
+ }
2338
+ if (data.nextToken !== undefined && data.nextToken !== null) {
2339
+ contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
2340
+ }
2341
+ return Promise.resolve(contents);
2342
+ };
2343
+ exports.deserializeAws_restJson1ListDataSetsCommand = deserializeAws_restJson1ListDataSetsCommand;
2344
+ const deserializeAws_restJson1ListDataSetsCommandError = async (output, context) => {
2345
+ const parsedOutput = {
2346
+ ...output,
2347
+ body: await parseBody(output.body, context),
2348
+ };
2349
+ let response;
2350
+ let errorCode = "UnknownError";
2351
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2352
+ switch (errorCode) {
2353
+ case "AccessDeniedException":
2354
+ case "com.amazonaws.m2#AccessDeniedException":
2355
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2356
+ case "InternalServerException":
2357
+ case "com.amazonaws.m2#InternalServerException":
2358
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2359
+ case "ResourceNotFoundException":
2360
+ case "com.amazonaws.m2#ResourceNotFoundException":
2361
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2362
+ case "ThrottlingException":
2363
+ case "com.amazonaws.m2#ThrottlingException":
2364
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2365
+ case "ValidationException":
2366
+ case "com.amazonaws.m2#ValidationException":
2367
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2368
+ default:
2369
+ const parsedBody = parsedOutput.body;
2370
+ response = new M2ServiceException_1.M2ServiceException({
2371
+ name: parsedBody.code || parsedBody.Code || errorCode,
2372
+ $fault: "client",
2373
+ $metadata: deserializeMetadata(output),
2374
+ });
2375
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2376
+ }
2377
+ };
2378
+ const deserializeAws_restJson1ListDeploymentsCommand = async (output, context) => {
2379
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2380
+ return deserializeAws_restJson1ListDeploymentsCommandError(output, context);
2381
+ }
2382
+ const contents = {
2383
+ $metadata: deserializeMetadata(output),
2384
+ deployments: undefined,
2385
+ nextToken: undefined,
2386
+ };
2387
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2388
+ if (data.deployments !== undefined && data.deployments !== null) {
2389
+ contents.deployments = deserializeAws_restJson1DeploymentList(data.deployments, context);
2390
+ }
2391
+ if (data.nextToken !== undefined && data.nextToken !== null) {
2392
+ contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
2393
+ }
2394
+ return Promise.resolve(contents);
2395
+ };
2396
+ exports.deserializeAws_restJson1ListDeploymentsCommand = deserializeAws_restJson1ListDeploymentsCommand;
2397
+ const deserializeAws_restJson1ListDeploymentsCommandError = async (output, context) => {
2398
+ const parsedOutput = {
2399
+ ...output,
2400
+ body: await parseBody(output.body, context),
2401
+ };
2402
+ let response;
2403
+ let errorCode = "UnknownError";
2404
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2405
+ switch (errorCode) {
2406
+ case "AccessDeniedException":
2407
+ case "com.amazonaws.m2#AccessDeniedException":
2408
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2409
+ case "InternalServerException":
2410
+ case "com.amazonaws.m2#InternalServerException":
2411
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2412
+ case "ResourceNotFoundException":
2413
+ case "com.amazonaws.m2#ResourceNotFoundException":
2414
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2415
+ case "ThrottlingException":
2416
+ case "com.amazonaws.m2#ThrottlingException":
2417
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2418
+ case "ValidationException":
2419
+ case "com.amazonaws.m2#ValidationException":
2420
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2421
+ default:
2422
+ const parsedBody = parsedOutput.body;
2423
+ response = new M2ServiceException_1.M2ServiceException({
2424
+ name: parsedBody.code || parsedBody.Code || errorCode,
2425
+ $fault: "client",
2426
+ $metadata: deserializeMetadata(output),
2427
+ });
2428
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2429
+ }
2430
+ };
2431
+ const deserializeAws_restJson1ListEngineVersionsCommand = async (output, context) => {
2432
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2433
+ return deserializeAws_restJson1ListEngineVersionsCommandError(output, context);
2434
+ }
2435
+ const contents = {
2436
+ $metadata: deserializeMetadata(output),
2437
+ engineVersions: undefined,
2438
+ nextToken: undefined,
2439
+ };
2440
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2441
+ if (data.engineVersions !== undefined && data.engineVersions !== null) {
2442
+ contents.engineVersions = deserializeAws_restJson1EngineVersionsSummaryList(data.engineVersions, context);
2443
+ }
2444
+ if (data.nextToken !== undefined && data.nextToken !== null) {
2445
+ contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
2446
+ }
2447
+ return Promise.resolve(contents);
2448
+ };
2449
+ exports.deserializeAws_restJson1ListEngineVersionsCommand = deserializeAws_restJson1ListEngineVersionsCommand;
2450
+ const deserializeAws_restJson1ListEngineVersionsCommandError = async (output, context) => {
2451
+ const parsedOutput = {
2452
+ ...output,
2453
+ body: await parseBody(output.body, context),
2454
+ };
2455
+ let response;
2456
+ let errorCode = "UnknownError";
2457
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2458
+ switch (errorCode) {
2459
+ case "AccessDeniedException":
2460
+ case "com.amazonaws.m2#AccessDeniedException":
2461
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2462
+ case "InternalServerException":
2463
+ case "com.amazonaws.m2#InternalServerException":
2464
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2465
+ case "ThrottlingException":
2466
+ case "com.amazonaws.m2#ThrottlingException":
2467
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2468
+ case "ValidationException":
2469
+ case "com.amazonaws.m2#ValidationException":
2470
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2471
+ default:
2472
+ const parsedBody = parsedOutput.body;
2473
+ response = new M2ServiceException_1.M2ServiceException({
2474
+ name: parsedBody.code || parsedBody.Code || errorCode,
2475
+ $fault: "client",
2476
+ $metadata: deserializeMetadata(output),
2477
+ });
2478
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2479
+ }
2480
+ };
2481
+ const deserializeAws_restJson1ListEnvironmentsCommand = async (output, context) => {
2482
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2483
+ return deserializeAws_restJson1ListEnvironmentsCommandError(output, context);
2484
+ }
2485
+ const contents = {
2486
+ $metadata: deserializeMetadata(output),
2487
+ environments: undefined,
2488
+ nextToken: undefined,
2489
+ };
2490
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2491
+ if (data.environments !== undefined && data.environments !== null) {
2492
+ contents.environments = deserializeAws_restJson1EnvironmentSummaryList(data.environments, context);
2493
+ }
2494
+ if (data.nextToken !== undefined && data.nextToken !== null) {
2495
+ contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
2496
+ }
2497
+ return Promise.resolve(contents);
2498
+ };
2499
+ exports.deserializeAws_restJson1ListEnvironmentsCommand = deserializeAws_restJson1ListEnvironmentsCommand;
2500
+ const deserializeAws_restJson1ListEnvironmentsCommandError = async (output, context) => {
2501
+ const parsedOutput = {
2502
+ ...output,
2503
+ body: await parseBody(output.body, context),
2504
+ };
2505
+ let response;
2506
+ let errorCode = "UnknownError";
2507
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2508
+ switch (errorCode) {
2509
+ case "AccessDeniedException":
2510
+ case "com.amazonaws.m2#AccessDeniedException":
2511
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2512
+ case "InternalServerException":
2513
+ case "com.amazonaws.m2#InternalServerException":
2514
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2515
+ case "ThrottlingException":
2516
+ case "com.amazonaws.m2#ThrottlingException":
2517
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2518
+ case "ValidationException":
2519
+ case "com.amazonaws.m2#ValidationException":
2520
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2521
+ default:
2522
+ const parsedBody = parsedOutput.body;
2523
+ response = new M2ServiceException_1.M2ServiceException({
2524
+ name: parsedBody.code || parsedBody.Code || errorCode,
2525
+ $fault: "client",
2526
+ $metadata: deserializeMetadata(output),
2527
+ });
2528
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2529
+ }
2530
+ };
2531
+ const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
2532
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2533
+ return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
2534
+ }
2535
+ const contents = {
2536
+ $metadata: deserializeMetadata(output),
2537
+ tags: undefined,
2538
+ };
2539
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2540
+ if (data.tags !== undefined && data.tags !== null) {
2541
+ contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
2542
+ }
2543
+ return Promise.resolve(contents);
2544
+ };
2545
+ exports.deserializeAws_restJson1ListTagsForResourceCommand = deserializeAws_restJson1ListTagsForResourceCommand;
2546
+ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
2547
+ const parsedOutput = {
2548
+ ...output,
2549
+ body: await parseBody(output.body, context),
2550
+ };
2551
+ let response;
2552
+ let errorCode = "UnknownError";
2553
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2554
+ switch (errorCode) {
2555
+ case "AccessDeniedException":
2556
+ case "com.amazonaws.m2#AccessDeniedException":
2557
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2558
+ case "InternalServerException":
2559
+ case "com.amazonaws.m2#InternalServerException":
2560
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2561
+ case "ResourceNotFoundException":
2562
+ case "com.amazonaws.m2#ResourceNotFoundException":
2563
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2564
+ case "ThrottlingException":
2565
+ case "com.amazonaws.m2#ThrottlingException":
2566
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2567
+ case "ValidationException":
2568
+ case "com.amazonaws.m2#ValidationException":
2569
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2570
+ default:
2571
+ const parsedBody = parsedOutput.body;
2572
+ response = new M2ServiceException_1.M2ServiceException({
2573
+ name: parsedBody.code || parsedBody.Code || errorCode,
2574
+ $fault: "client",
2575
+ $metadata: deserializeMetadata(output),
2576
+ });
2577
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2578
+ }
2579
+ };
2580
+ const deserializeAws_restJson1StartApplicationCommand = async (output, context) => {
2581
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2582
+ return deserializeAws_restJson1StartApplicationCommandError(output, context);
2583
+ }
2584
+ const contents = {
2585
+ $metadata: deserializeMetadata(output),
2586
+ };
2587
+ await collectBody(output.body, context);
2588
+ return Promise.resolve(contents);
2589
+ };
2590
+ exports.deserializeAws_restJson1StartApplicationCommand = deserializeAws_restJson1StartApplicationCommand;
2591
+ const deserializeAws_restJson1StartApplicationCommandError = async (output, context) => {
2592
+ const parsedOutput = {
2593
+ ...output,
2594
+ body: await parseBody(output.body, context),
2595
+ };
2596
+ let response;
2597
+ let errorCode = "UnknownError";
2598
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2599
+ switch (errorCode) {
2600
+ case "AccessDeniedException":
2601
+ case "com.amazonaws.m2#AccessDeniedException":
2602
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2603
+ case "ConflictException":
2604
+ case "com.amazonaws.m2#ConflictException":
2605
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
2606
+ case "InternalServerException":
2607
+ case "com.amazonaws.m2#InternalServerException":
2608
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2609
+ case "ResourceNotFoundException":
2610
+ case "com.amazonaws.m2#ResourceNotFoundException":
2611
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2612
+ case "ThrottlingException":
2613
+ case "com.amazonaws.m2#ThrottlingException":
2614
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2615
+ case "ValidationException":
2616
+ case "com.amazonaws.m2#ValidationException":
2617
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2618
+ default:
2619
+ const parsedBody = parsedOutput.body;
2620
+ response = new M2ServiceException_1.M2ServiceException({
2621
+ name: parsedBody.code || parsedBody.Code || errorCode,
2622
+ $fault: "client",
2623
+ $metadata: deserializeMetadata(output),
2624
+ });
2625
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2626
+ }
2627
+ };
2628
+ const deserializeAws_restJson1StartBatchJobCommand = async (output, context) => {
2629
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2630
+ return deserializeAws_restJson1StartBatchJobCommandError(output, context);
2631
+ }
2632
+ const contents = {
2633
+ $metadata: deserializeMetadata(output),
2634
+ executionId: undefined,
2635
+ };
2636
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2637
+ if (data.executionId !== undefined && data.executionId !== null) {
2638
+ contents.executionId = (0, smithy_client_1.expectString)(data.executionId);
2639
+ }
2640
+ return Promise.resolve(contents);
2641
+ };
2642
+ exports.deserializeAws_restJson1StartBatchJobCommand = deserializeAws_restJson1StartBatchJobCommand;
2643
+ const deserializeAws_restJson1StartBatchJobCommandError = async (output, context) => {
2644
+ const parsedOutput = {
2645
+ ...output,
2646
+ body: await parseBody(output.body, context),
2647
+ };
2648
+ let response;
2649
+ let errorCode = "UnknownError";
2650
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2651
+ switch (errorCode) {
2652
+ case "AccessDeniedException":
2653
+ case "com.amazonaws.m2#AccessDeniedException":
2654
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2655
+ case "ConflictException":
2656
+ case "com.amazonaws.m2#ConflictException":
2657
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
2658
+ case "InternalServerException":
2659
+ case "com.amazonaws.m2#InternalServerException":
2660
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2661
+ case "ResourceNotFoundException":
2662
+ case "com.amazonaws.m2#ResourceNotFoundException":
2663
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2664
+ case "ThrottlingException":
2665
+ case "com.amazonaws.m2#ThrottlingException":
2666
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2667
+ case "ValidationException":
2668
+ case "com.amazonaws.m2#ValidationException":
2669
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2670
+ default:
2671
+ const parsedBody = parsedOutput.body;
2672
+ response = new M2ServiceException_1.M2ServiceException({
2673
+ name: parsedBody.code || parsedBody.Code || errorCode,
2674
+ $fault: "client",
2675
+ $metadata: deserializeMetadata(output),
2676
+ });
2677
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2678
+ }
2679
+ };
2680
+ const deserializeAws_restJson1StopApplicationCommand = async (output, context) => {
2681
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2682
+ return deserializeAws_restJson1StopApplicationCommandError(output, context);
2683
+ }
2684
+ const contents = {
2685
+ $metadata: deserializeMetadata(output),
2686
+ };
2687
+ await collectBody(output.body, context);
2688
+ return Promise.resolve(contents);
2689
+ };
2690
+ exports.deserializeAws_restJson1StopApplicationCommand = deserializeAws_restJson1StopApplicationCommand;
2691
+ const deserializeAws_restJson1StopApplicationCommandError = async (output, context) => {
2692
+ const parsedOutput = {
2693
+ ...output,
2694
+ body: await parseBody(output.body, context),
2695
+ };
2696
+ let response;
2697
+ let errorCode = "UnknownError";
2698
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2699
+ switch (errorCode) {
2700
+ case "AccessDeniedException":
2701
+ case "com.amazonaws.m2#AccessDeniedException":
2702
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2703
+ case "ConflictException":
2704
+ case "com.amazonaws.m2#ConflictException":
2705
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
2706
+ case "InternalServerException":
2707
+ case "com.amazonaws.m2#InternalServerException":
2708
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2709
+ case "ResourceNotFoundException":
2710
+ case "com.amazonaws.m2#ResourceNotFoundException":
2711
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2712
+ case "ThrottlingException":
2713
+ case "com.amazonaws.m2#ThrottlingException":
2714
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2715
+ case "ValidationException":
2716
+ case "com.amazonaws.m2#ValidationException":
2717
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2718
+ default:
2719
+ const parsedBody = parsedOutput.body;
2720
+ response = new M2ServiceException_1.M2ServiceException({
2721
+ name: parsedBody.code || parsedBody.Code || errorCode,
2722
+ $fault: "client",
2723
+ $metadata: deserializeMetadata(output),
2724
+ });
2725
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2726
+ }
2727
+ };
2728
+ const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
2729
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2730
+ return deserializeAws_restJson1TagResourceCommandError(output, context);
2731
+ }
2732
+ const contents = {
2733
+ $metadata: deserializeMetadata(output),
2734
+ };
2735
+ await collectBody(output.body, context);
2736
+ return Promise.resolve(contents);
2737
+ };
2738
+ exports.deserializeAws_restJson1TagResourceCommand = deserializeAws_restJson1TagResourceCommand;
2739
+ const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
2740
+ const parsedOutput = {
2741
+ ...output,
2742
+ body: await parseBody(output.body, context),
2743
+ };
2744
+ let response;
2745
+ let errorCode = "UnknownError";
2746
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2747
+ switch (errorCode) {
2748
+ case "AccessDeniedException":
2749
+ case "com.amazonaws.m2#AccessDeniedException":
2750
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2751
+ case "InternalServerException":
2752
+ case "com.amazonaws.m2#InternalServerException":
2753
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2754
+ case "ResourceNotFoundException":
2755
+ case "com.amazonaws.m2#ResourceNotFoundException":
2756
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2757
+ case "ServiceQuotaExceededException":
2758
+ case "com.amazonaws.m2#ServiceQuotaExceededException":
2759
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
2760
+ case "ThrottlingException":
2761
+ case "com.amazonaws.m2#ThrottlingException":
2762
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2763
+ case "ValidationException":
2764
+ case "com.amazonaws.m2#ValidationException":
2765
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2766
+ default:
2767
+ const parsedBody = parsedOutput.body;
2768
+ response = new M2ServiceException_1.M2ServiceException({
2769
+ name: parsedBody.code || parsedBody.Code || errorCode,
2770
+ $fault: "client",
2771
+ $metadata: deserializeMetadata(output),
2772
+ });
2773
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2774
+ }
2775
+ };
2776
+ const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
2777
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2778
+ return deserializeAws_restJson1UntagResourceCommandError(output, context);
2779
+ }
2780
+ const contents = {
2781
+ $metadata: deserializeMetadata(output),
2782
+ };
2783
+ await collectBody(output.body, context);
2784
+ return Promise.resolve(contents);
2785
+ };
2786
+ exports.deserializeAws_restJson1UntagResourceCommand = deserializeAws_restJson1UntagResourceCommand;
2787
+ const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
2788
+ const parsedOutput = {
2789
+ ...output,
2790
+ body: await parseBody(output.body, context),
2791
+ };
2792
+ let response;
2793
+ let errorCode = "UnknownError";
2794
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2795
+ switch (errorCode) {
2796
+ case "AccessDeniedException":
2797
+ case "com.amazonaws.m2#AccessDeniedException":
2798
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2799
+ case "InternalServerException":
2800
+ case "com.amazonaws.m2#InternalServerException":
2801
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2802
+ case "ResourceNotFoundException":
2803
+ case "com.amazonaws.m2#ResourceNotFoundException":
2804
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2805
+ case "ThrottlingException":
2806
+ case "com.amazonaws.m2#ThrottlingException":
2807
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2808
+ case "ValidationException":
2809
+ case "com.amazonaws.m2#ValidationException":
2810
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2811
+ default:
2812
+ const parsedBody = parsedOutput.body;
2813
+ response = new M2ServiceException_1.M2ServiceException({
2814
+ name: parsedBody.code || parsedBody.Code || errorCode,
2815
+ $fault: "client",
2816
+ $metadata: deserializeMetadata(output),
2817
+ });
2818
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2819
+ }
2820
+ };
2821
+ const deserializeAws_restJson1UpdateApplicationCommand = async (output, context) => {
2822
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2823
+ return deserializeAws_restJson1UpdateApplicationCommandError(output, context);
2824
+ }
2825
+ const contents = {
2826
+ $metadata: deserializeMetadata(output),
2827
+ applicationVersion: undefined,
2828
+ };
2829
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2830
+ if (data.applicationVersion !== undefined && data.applicationVersion !== null) {
2831
+ contents.applicationVersion = (0, smithy_client_1.expectInt32)(data.applicationVersion);
2832
+ }
2833
+ return Promise.resolve(contents);
2834
+ };
2835
+ exports.deserializeAws_restJson1UpdateApplicationCommand = deserializeAws_restJson1UpdateApplicationCommand;
2836
+ const deserializeAws_restJson1UpdateApplicationCommandError = async (output, context) => {
2837
+ const parsedOutput = {
2838
+ ...output,
2839
+ body: await parseBody(output.body, context),
2840
+ };
2841
+ let response;
2842
+ let errorCode = "UnknownError";
2843
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2844
+ switch (errorCode) {
2845
+ case "AccessDeniedException":
2846
+ case "com.amazonaws.m2#AccessDeniedException":
2847
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2848
+ case "ConflictException":
2849
+ case "com.amazonaws.m2#ConflictException":
2850
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
2851
+ case "InternalServerException":
2852
+ case "com.amazonaws.m2#InternalServerException":
2853
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2854
+ case "ResourceNotFoundException":
2855
+ case "com.amazonaws.m2#ResourceNotFoundException":
2856
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2857
+ case "ThrottlingException":
2858
+ case "com.amazonaws.m2#ThrottlingException":
2859
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2860
+ case "ValidationException":
2861
+ case "com.amazonaws.m2#ValidationException":
2862
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2863
+ default:
2864
+ const parsedBody = parsedOutput.body;
2865
+ response = new M2ServiceException_1.M2ServiceException({
2866
+ name: parsedBody.code || parsedBody.Code || errorCode,
2867
+ $fault: "client",
2868
+ $metadata: deserializeMetadata(output),
2869
+ });
2870
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2871
+ }
2872
+ };
2873
+ const deserializeAws_restJson1UpdateEnvironmentCommand = async (output, context) => {
2874
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2875
+ return deserializeAws_restJson1UpdateEnvironmentCommandError(output, context);
2876
+ }
2877
+ const contents = {
2878
+ $metadata: deserializeMetadata(output),
2879
+ environmentId: undefined,
2880
+ };
2881
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2882
+ if (data.environmentId !== undefined && data.environmentId !== null) {
2883
+ contents.environmentId = (0, smithy_client_1.expectString)(data.environmentId);
2884
+ }
2885
+ return Promise.resolve(contents);
2886
+ };
2887
+ exports.deserializeAws_restJson1UpdateEnvironmentCommand = deserializeAws_restJson1UpdateEnvironmentCommand;
2888
+ const deserializeAws_restJson1UpdateEnvironmentCommandError = async (output, context) => {
2889
+ const parsedOutput = {
2890
+ ...output,
2891
+ body: await parseBody(output.body, context),
2892
+ };
2893
+ let response;
2894
+ let errorCode = "UnknownError";
2895
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2896
+ switch (errorCode) {
2897
+ case "AccessDeniedException":
2898
+ case "com.amazonaws.m2#AccessDeniedException":
2899
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2900
+ case "ConflictException":
2901
+ case "com.amazonaws.m2#ConflictException":
2902
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
2903
+ case "InternalServerException":
2904
+ case "com.amazonaws.m2#InternalServerException":
2905
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2906
+ case "ResourceNotFoundException":
2907
+ case "com.amazonaws.m2#ResourceNotFoundException":
2908
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2909
+ case "ServiceQuotaExceededException":
2910
+ case "com.amazonaws.m2#ServiceQuotaExceededException":
2911
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
2912
+ case "ThrottlingException":
2913
+ case "com.amazonaws.m2#ThrottlingException":
2914
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2915
+ case "ValidationException":
2916
+ case "com.amazonaws.m2#ValidationException":
2917
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2918
+ default:
2919
+ const parsedBody = parsedOutput.body;
2920
+ response = new M2ServiceException_1.M2ServiceException({
2921
+ name: parsedBody.code || parsedBody.Code || errorCode,
2922
+ $fault: "client",
2923
+ $metadata: deserializeMetadata(output),
2924
+ });
2925
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2926
+ }
2927
+ };
2928
+ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
2929
+ const contents = {};
2930
+ const data = parsedOutput.body;
2931
+ if (data.message !== undefined && data.message !== null) {
2932
+ contents.message = (0, smithy_client_1.expectString)(data.message);
2933
+ }
2934
+ const exception = new models_0_1.AccessDeniedException({
2935
+ $metadata: deserializeMetadata(parsedOutput),
2936
+ ...contents,
2937
+ });
2938
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2939
+ };
2940
+ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
2941
+ const contents = {};
2942
+ const data = parsedOutput.body;
2943
+ if (data.message !== undefined && data.message !== null) {
2944
+ contents.message = (0, smithy_client_1.expectString)(data.message);
2945
+ }
2946
+ if (data.resourceId !== undefined && data.resourceId !== null) {
2947
+ contents.resourceId = (0, smithy_client_1.expectString)(data.resourceId);
2948
+ }
2949
+ if (data.resourceType !== undefined && data.resourceType !== null) {
2950
+ contents.resourceType = (0, smithy_client_1.expectString)(data.resourceType);
2951
+ }
2952
+ const exception = new models_0_1.ConflictException({
2953
+ $metadata: deserializeMetadata(parsedOutput),
2954
+ ...contents,
2955
+ });
2956
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2957
+ };
2958
+ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
2959
+ const contents = {};
2960
+ if (parsedOutput.headers["retry-after"] !== undefined) {
2961
+ contents.retryAfterSeconds = (0, smithy_client_1.strictParseInt32)(parsedOutput.headers["retry-after"]);
2962
+ }
2963
+ const data = parsedOutput.body;
2964
+ if (data.message !== undefined && data.message !== null) {
2965
+ contents.message = (0, smithy_client_1.expectString)(data.message);
2966
+ }
2967
+ const exception = new models_0_1.InternalServerException({
2968
+ $metadata: deserializeMetadata(parsedOutput),
2969
+ ...contents,
2970
+ });
2971
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2972
+ };
2973
+ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
2974
+ const contents = {};
2975
+ const data = parsedOutput.body;
2976
+ if (data.message !== undefined && data.message !== null) {
2977
+ contents.message = (0, smithy_client_1.expectString)(data.message);
2978
+ }
2979
+ if (data.resourceId !== undefined && data.resourceId !== null) {
2980
+ contents.resourceId = (0, smithy_client_1.expectString)(data.resourceId);
2981
+ }
2982
+ if (data.resourceType !== undefined && data.resourceType !== null) {
2983
+ contents.resourceType = (0, smithy_client_1.expectString)(data.resourceType);
2984
+ }
2985
+ const exception = new models_0_1.ResourceNotFoundException({
2986
+ $metadata: deserializeMetadata(parsedOutput),
2987
+ ...contents,
2988
+ });
2989
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2990
+ };
2991
+ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
2992
+ const contents = {};
2993
+ const data = parsedOutput.body;
2994
+ if (data.message !== undefined && data.message !== null) {
2995
+ contents.message = (0, smithy_client_1.expectString)(data.message);
2996
+ }
2997
+ if (data.quotaCode !== undefined && data.quotaCode !== null) {
2998
+ contents.quotaCode = (0, smithy_client_1.expectString)(data.quotaCode);
2999
+ }
3000
+ if (data.resourceId !== undefined && data.resourceId !== null) {
3001
+ contents.resourceId = (0, smithy_client_1.expectString)(data.resourceId);
3002
+ }
3003
+ if (data.resourceType !== undefined && data.resourceType !== null) {
3004
+ contents.resourceType = (0, smithy_client_1.expectString)(data.resourceType);
3005
+ }
3006
+ if (data.serviceCode !== undefined && data.serviceCode !== null) {
3007
+ contents.serviceCode = (0, smithy_client_1.expectString)(data.serviceCode);
3008
+ }
3009
+ const exception = new models_0_1.ServiceQuotaExceededException({
3010
+ $metadata: deserializeMetadata(parsedOutput),
3011
+ ...contents,
3012
+ });
3013
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
3014
+ };
3015
+ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
3016
+ const contents = {};
3017
+ if (parsedOutput.headers["retry-after"] !== undefined) {
3018
+ contents.retryAfterSeconds = (0, smithy_client_1.strictParseInt32)(parsedOutput.headers["retry-after"]);
3019
+ }
3020
+ const data = parsedOutput.body;
3021
+ if (data.message !== undefined && data.message !== null) {
3022
+ contents.message = (0, smithy_client_1.expectString)(data.message);
3023
+ }
3024
+ if (data.quotaCode !== undefined && data.quotaCode !== null) {
3025
+ contents.quotaCode = (0, smithy_client_1.expectString)(data.quotaCode);
3026
+ }
3027
+ if (data.serviceCode !== undefined && data.serviceCode !== null) {
3028
+ contents.serviceCode = (0, smithy_client_1.expectString)(data.serviceCode);
3029
+ }
3030
+ const exception = new models_0_1.ThrottlingException({
3031
+ $metadata: deserializeMetadata(parsedOutput),
3032
+ ...contents,
3033
+ });
3034
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
3035
+ };
3036
+ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
3037
+ const contents = {};
3038
+ const data = parsedOutput.body;
3039
+ if (data.fieldList !== undefined && data.fieldList !== null) {
3040
+ contents.fieldList = deserializeAws_restJson1ValidationExceptionFieldList(data.fieldList, context);
3041
+ }
3042
+ if (data.message !== undefined && data.message !== null) {
3043
+ contents.message = (0, smithy_client_1.expectString)(data.message);
3044
+ }
3045
+ if (data.reason !== undefined && data.reason !== null) {
3046
+ contents.reason = (0, smithy_client_1.expectString)(data.reason);
3047
+ }
3048
+ const exception = new models_0_1.ValidationException({
3049
+ $metadata: deserializeMetadata(parsedOutput),
3050
+ ...contents,
3051
+ });
3052
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
3053
+ };
3054
+ const serializeAws_restJson1AlternateKey = (input, context) => {
3055
+ return {
3056
+ ...(input.allowDuplicates !== undefined &&
3057
+ input.allowDuplicates !== null && { allowDuplicates: input.allowDuplicates }),
3058
+ ...(input.length !== undefined && input.length !== null && { length: input.length }),
3059
+ ...(input.name !== undefined && input.name !== null && { name: input.name }),
3060
+ ...(input.offset !== undefined && input.offset !== null && { offset: input.offset }),
3061
+ };
3062
+ };
3063
+ const serializeAws_restJson1AlternateKeyList = (input, context) => {
3064
+ return input
3065
+ .filter((e) => e != null)
3066
+ .map((entry) => {
3067
+ if (entry === null) {
3068
+ return null;
3069
+ }
3070
+ return serializeAws_restJson1AlternateKey(entry, context);
3071
+ });
3072
+ };
3073
+ const serializeAws_restJson1BatchJobIdentifier = (input, context) => {
3074
+ return models_0_1.BatchJobIdentifier.visit(input, {
3075
+ fileBatchJobIdentifier: (value) => ({
3076
+ fileBatchJobIdentifier: serializeAws_restJson1FileBatchJobIdentifier(value, context),
3077
+ }),
3078
+ scriptBatchJobIdentifier: (value) => ({
3079
+ scriptBatchJobIdentifier: serializeAws_restJson1ScriptBatchJobIdentifier(value, context),
3080
+ }),
3081
+ _: (name, value) => ({ name: value }),
3082
+ });
3083
+ };
3084
+ const serializeAws_restJson1BatchJobParametersMap = (input, context) => {
3085
+ return Object.entries(input).reduce((acc, [key, value]) => {
3086
+ if (value === null) {
3087
+ return acc;
3088
+ }
3089
+ return {
3090
+ ...acc,
3091
+ [key]: value,
3092
+ };
3093
+ }, {});
3094
+ };
3095
+ const serializeAws_restJson1DataSet = (input, context) => {
3096
+ return {
3097
+ ...(input.datasetName !== undefined && input.datasetName !== null && { datasetName: input.datasetName }),
3098
+ ...(input.datasetOrg !== undefined &&
3099
+ input.datasetOrg !== null && {
3100
+ datasetOrg: serializeAws_restJson1DatasetOrgAttributes(input.datasetOrg, context),
3101
+ }),
3102
+ ...(input.recordLength !== undefined &&
3103
+ input.recordLength !== null && { recordLength: serializeAws_restJson1RecordLength(input.recordLength, context) }),
3104
+ ...(input.relativePath !== undefined && input.relativePath !== null && { relativePath: input.relativePath }),
3105
+ ...(input.storageType !== undefined && input.storageType !== null && { storageType: input.storageType }),
3106
+ };
3107
+ };
3108
+ const serializeAws_restJson1DataSetImportConfig = (input, context) => {
3109
+ return models_0_1.DataSetImportConfig.visit(input, {
3110
+ dataSets: (value) => ({ dataSets: serializeAws_restJson1DataSetImportList(value, context) }),
3111
+ s3Location: (value) => ({ s3Location: value }),
3112
+ _: (name, value) => ({ name: value }),
3113
+ });
3114
+ };
3115
+ const serializeAws_restJson1DataSetImportItem = (input, context) => {
3116
+ return {
3117
+ ...(input.dataSet !== undefined &&
3118
+ input.dataSet !== null && { dataSet: serializeAws_restJson1DataSet(input.dataSet, context) }),
3119
+ ...(input.externalLocation !== undefined &&
3120
+ input.externalLocation !== null && {
3121
+ externalLocation: serializeAws_restJson1ExternalLocation(input.externalLocation, context),
3122
+ }),
3123
+ };
3124
+ };
3125
+ const serializeAws_restJson1DataSetImportList = (input, context) => {
3126
+ return input
3127
+ .filter((e) => e != null)
3128
+ .map((entry) => {
3129
+ if (entry === null) {
3130
+ return null;
3131
+ }
3132
+ return serializeAws_restJson1DataSetImportItem(entry, context);
3133
+ });
3134
+ };
3135
+ const serializeAws_restJson1DatasetOrgAttributes = (input, context) => {
3136
+ return models_0_1.DatasetOrgAttributes.visit(input, {
3137
+ gdg: (value) => ({ gdg: serializeAws_restJson1GdgAttributes(value, context) }),
3138
+ vsam: (value) => ({ vsam: serializeAws_restJson1VsamAttributes(value, context) }),
3139
+ _: (name, value) => ({ name: value }),
3140
+ });
3141
+ };
3142
+ const serializeAws_restJson1Definition = (input, context) => {
3143
+ return models_0_1.Definition.visit(input, {
3144
+ content: (value) => ({ content: value }),
3145
+ s3Location: (value) => ({ s3Location: value }),
3146
+ _: (name, value) => ({ name: value }),
3147
+ });
3148
+ };
3149
+ const serializeAws_restJson1EfsStorageConfiguration = (input, context) => {
3150
+ return {
3151
+ ...(input.fileSystemId !== undefined && input.fileSystemId !== null && { "file-system-id": input.fileSystemId }),
3152
+ ...(input.mountPoint !== undefined && input.mountPoint !== null && { "mount-point": input.mountPoint }),
3153
+ };
3154
+ };
3155
+ const serializeAws_restJson1ExternalLocation = (input, context) => {
3156
+ return models_0_1.ExternalLocation.visit(input, {
3157
+ s3Location: (value) => ({ s3Location: value }),
3158
+ _: (name, value) => ({ name: value }),
3159
+ });
3160
+ };
3161
+ const serializeAws_restJson1FileBatchJobIdentifier = (input, context) => {
3162
+ return {
3163
+ ...(input.fileName !== undefined && input.fileName !== null && { fileName: input.fileName }),
3164
+ ...(input.folderPath !== undefined && input.folderPath !== null && { folderPath: input.folderPath }),
3165
+ };
3166
+ };
3167
+ const serializeAws_restJson1FsxStorageConfiguration = (input, context) => {
3168
+ return {
3169
+ ...(input.fileSystemId !== undefined && input.fileSystemId !== null && { "file-system-id": input.fileSystemId }),
3170
+ ...(input.mountPoint !== undefined && input.mountPoint !== null && { "mount-point": input.mountPoint }),
3171
+ };
3172
+ };
3173
+ const serializeAws_restJson1GdgAttributes = (input, context) => {
3174
+ return {
3175
+ ...(input.limit !== undefined && input.limit !== null && { limit: input.limit }),
3176
+ ...(input.rollDisposition !== undefined &&
3177
+ input.rollDisposition !== null && { rollDisposition: input.rollDisposition }),
3178
+ };
3179
+ };
3180
+ const serializeAws_restJson1HighAvailabilityConfig = (input, context) => {
3181
+ return {
3182
+ ...(input.desiredCapacity !== undefined &&
3183
+ input.desiredCapacity !== null && { desiredCapacity: input.desiredCapacity }),
3184
+ };
3185
+ };
3186
+ const serializeAws_restJson1PrimaryKey = (input, context) => {
3187
+ return {
3188
+ ...(input.length !== undefined && input.length !== null && { length: input.length }),
3189
+ ...(input.name !== undefined && input.name !== null && { name: input.name }),
3190
+ ...(input.offset !== undefined && input.offset !== null && { offset: input.offset }),
3191
+ };
3192
+ };
3193
+ const serializeAws_restJson1RecordLength = (input, context) => {
3194
+ return {
3195
+ ...(input.max !== undefined && input.max !== null && { max: input.max }),
3196
+ ...(input.min !== undefined && input.min !== null && { min: input.min }),
3197
+ };
3198
+ };
3199
+ const serializeAws_restJson1ScriptBatchJobIdentifier = (input, context) => {
3200
+ return {
3201
+ ...(input.scriptName !== undefined && input.scriptName !== null && { scriptName: input.scriptName }),
3202
+ };
3203
+ };
3204
+ const serializeAws_restJson1StorageConfiguration = (input, context) => {
3205
+ return models_0_1.StorageConfiguration.visit(input, {
3206
+ efs: (value) => ({ efs: serializeAws_restJson1EfsStorageConfiguration(value, context) }),
3207
+ fsx: (value) => ({ fsx: serializeAws_restJson1FsxStorageConfiguration(value, context) }),
3208
+ _: (name, value) => ({ name: value }),
3209
+ });
3210
+ };
3211
+ const serializeAws_restJson1StorageConfigurationList = (input, context) => {
3212
+ return input
3213
+ .filter((e) => e != null)
3214
+ .map((entry) => {
3215
+ if (entry === null) {
3216
+ return null;
3217
+ }
3218
+ return serializeAws_restJson1StorageConfiguration(entry, context);
3219
+ });
3220
+ };
3221
+ const serializeAws_restJson1String50List = (input, context) => {
3222
+ return input
3223
+ .filter((e) => e != null)
3224
+ .map((entry) => {
3225
+ if (entry === null) {
3226
+ return null;
3227
+ }
3228
+ return entry;
3229
+ });
3230
+ };
3231
+ const serializeAws_restJson1TagMap = (input, context) => {
3232
+ return Object.entries(input).reduce((acc, [key, value]) => {
3233
+ if (value === null) {
3234
+ return acc;
3235
+ }
3236
+ return {
3237
+ ...acc,
3238
+ [key]: value,
3239
+ };
3240
+ }, {});
3241
+ };
3242
+ const serializeAws_restJson1VsamAttributes = (input, context) => {
3243
+ return {
3244
+ ...(input.alternateKeys !== undefined &&
3245
+ input.alternateKeys !== null && {
3246
+ alternateKeys: serializeAws_restJson1AlternateKeyList(input.alternateKeys, context),
3247
+ }),
3248
+ ...(input.compressed !== undefined && input.compressed !== null && { compressed: input.compressed }),
3249
+ ...(input.encoding !== undefined && input.encoding !== null && { encoding: input.encoding }),
3250
+ ...(input.format !== undefined && input.format !== null && { format: input.format }),
3251
+ ...(input.primaryKey !== undefined &&
3252
+ input.primaryKey !== null && { primaryKey: serializeAws_restJson1PrimaryKey(input.primaryKey, context) }),
3253
+ };
3254
+ };
3255
+ const deserializeAws_restJson1AlternateKey = (output, context) => {
3256
+ return {
3257
+ allowDuplicates: (0, smithy_client_1.expectBoolean)(output.allowDuplicates),
3258
+ length: (0, smithy_client_1.expectInt32)(output.length),
3259
+ name: (0, smithy_client_1.expectString)(output.name),
3260
+ offset: (0, smithy_client_1.expectInt32)(output.offset),
3261
+ };
3262
+ };
3263
+ const deserializeAws_restJson1AlternateKeyList = (output, context) => {
3264
+ const retVal = (output || [])
3265
+ .filter((e) => e != null)
3266
+ .map((entry) => {
3267
+ if (entry === null) {
3268
+ return null;
3269
+ }
3270
+ return deserializeAws_restJson1AlternateKey(entry, context);
3271
+ });
3272
+ return retVal;
3273
+ };
3274
+ const deserializeAws_restJson1ApplicationSummary = (output, context) => {
3275
+ return {
3276
+ applicationArn: (0, smithy_client_1.expectString)(output.applicationArn),
3277
+ applicationId: (0, smithy_client_1.expectString)(output.applicationId),
3278
+ applicationVersion: (0, smithy_client_1.expectInt32)(output.applicationVersion),
3279
+ creationTime: output.creationTime !== undefined && output.creationTime !== null
3280
+ ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.creationTime)))
3281
+ : undefined,
3282
+ deploymentStatus: (0, smithy_client_1.expectString)(output.deploymentStatus),
3283
+ description: (0, smithy_client_1.expectString)(output.description),
3284
+ engineType: (0, smithy_client_1.expectString)(output.engineType),
3285
+ environmentId: (0, smithy_client_1.expectString)(output.environmentId),
3286
+ lastStartTime: output.lastStartTime !== undefined && output.lastStartTime !== null
3287
+ ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.lastStartTime)))
3288
+ : undefined,
3289
+ name: (0, smithy_client_1.expectString)(output.name),
3290
+ status: (0, smithy_client_1.expectString)(output.status),
3291
+ versionStatus: (0, smithy_client_1.expectString)(output.versionStatus),
3292
+ };
3293
+ };
3294
+ const deserializeAws_restJson1ApplicationSummaryList = (output, context) => {
3295
+ const retVal = (output || [])
3296
+ .filter((e) => e != null)
3297
+ .map((entry) => {
3298
+ if (entry === null) {
3299
+ return null;
3300
+ }
3301
+ return deserializeAws_restJson1ApplicationSummary(entry, context);
3302
+ });
3303
+ return retVal;
3304
+ };
3305
+ const deserializeAws_restJson1ApplicationVersionSummary = (output, context) => {
3306
+ return {
3307
+ applicationVersion: (0, smithy_client_1.expectInt32)(output.applicationVersion),
3308
+ creationTime: output.creationTime !== undefined && output.creationTime !== null
3309
+ ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.creationTime)))
3310
+ : undefined,
3311
+ status: (0, smithy_client_1.expectString)(output.status),
3312
+ statusReason: (0, smithy_client_1.expectString)(output.statusReason),
3313
+ };
3314
+ };
3315
+ const deserializeAws_restJson1ApplicationVersionSummaryList = (output, context) => {
3316
+ const retVal = (output || [])
3317
+ .filter((e) => e != null)
3318
+ .map((entry) => {
3319
+ if (entry === null) {
3320
+ return null;
3321
+ }
3322
+ return deserializeAws_restJson1ApplicationVersionSummary(entry, context);
3323
+ });
3324
+ return retVal;
3325
+ };
3326
+ const deserializeAws_restJson1ArnList = (output, context) => {
3327
+ const retVal = (output || [])
3328
+ .filter((e) => e != null)
3329
+ .map((entry) => {
3330
+ if (entry === null) {
3331
+ return null;
3332
+ }
3333
+ return (0, smithy_client_1.expectString)(entry);
3334
+ });
3335
+ return retVal;
3336
+ };
3337
+ const deserializeAws_restJson1BatchJobDefinition = (output, context) => {
3338
+ if (output.fileBatchJobDefinition !== undefined && output.fileBatchJobDefinition !== null) {
3339
+ return {
3340
+ fileBatchJobDefinition: deserializeAws_restJson1FileBatchJobDefinition(output.fileBatchJobDefinition, context),
3341
+ };
3342
+ }
3343
+ if (output.scriptBatchJobDefinition !== undefined && output.scriptBatchJobDefinition !== null) {
3344
+ return {
3345
+ scriptBatchJobDefinition: deserializeAws_restJson1ScriptBatchJobDefinition(output.scriptBatchJobDefinition, context),
3346
+ };
3347
+ }
3348
+ return { $unknown: Object.entries(output)[0] };
3349
+ };
3350
+ const deserializeAws_restJson1BatchJobDefinitions = (output, context) => {
3351
+ const retVal = (output || [])
3352
+ .filter((e) => e != null)
3353
+ .map((entry) => {
3354
+ if (entry === null) {
3355
+ return null;
3356
+ }
3357
+ return deserializeAws_restJson1BatchJobDefinition((0, smithy_client_1.expectUnion)(entry), context);
3358
+ });
3359
+ return retVal;
3360
+ };
3361
+ const deserializeAws_restJson1BatchJobExecutionSummary = (output, context) => {
3362
+ return {
3363
+ applicationId: (0, smithy_client_1.expectString)(output.applicationId),
3364
+ endTime: output.endTime !== undefined && output.endTime !== null
3365
+ ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.endTime)))
3366
+ : undefined,
3367
+ executionId: (0, smithy_client_1.expectString)(output.executionId),
3368
+ jobId: (0, smithy_client_1.expectString)(output.jobId),
3369
+ jobName: (0, smithy_client_1.expectString)(output.jobName),
3370
+ jobType: (0, smithy_client_1.expectString)(output.jobType),
3371
+ startTime: output.startTime !== undefined && output.startTime !== null
3372
+ ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.startTime)))
3373
+ : undefined,
3374
+ status: (0, smithy_client_1.expectString)(output.status),
3375
+ };
3376
+ };
3377
+ const deserializeAws_restJson1BatchJobExecutionSummaryList = (output, context) => {
3378
+ const retVal = (output || [])
3379
+ .filter((e) => e != null)
3380
+ .map((entry) => {
3381
+ if (entry === null) {
3382
+ return null;
3383
+ }
3384
+ return deserializeAws_restJson1BatchJobExecutionSummary(entry, context);
3385
+ });
3386
+ return retVal;
3387
+ };
3388
+ const deserializeAws_restJson1DatasetDetailOrgAttributes = (output, context) => {
3389
+ if (output.gdg !== undefined && output.gdg !== null) {
3390
+ return {
3391
+ gdg: deserializeAws_restJson1GdgDetailAttributes(output.gdg, context),
3392
+ };
3393
+ }
3394
+ if (output.vsam !== undefined && output.vsam !== null) {
3395
+ return {
3396
+ vsam: deserializeAws_restJson1VsamDetailAttributes(output.vsam, context),
3397
+ };
3398
+ }
3399
+ return { $unknown: Object.entries(output)[0] };
3400
+ };
3401
+ const deserializeAws_restJson1DataSetImportSummary = (output, context) => {
3402
+ return {
3403
+ failed: (0, smithy_client_1.expectInt32)(output.failed),
3404
+ inProgress: (0, smithy_client_1.expectInt32)(output.inProgress),
3405
+ pending: (0, smithy_client_1.expectInt32)(output.pending),
3406
+ succeeded: (0, smithy_client_1.expectInt32)(output.succeeded),
3407
+ total: (0, smithy_client_1.expectInt32)(output.total),
3408
+ };
3409
+ };
3410
+ const deserializeAws_restJson1DataSetImportTask = (output, context) => {
3411
+ return {
3412
+ status: (0, smithy_client_1.expectString)(output.status),
3413
+ summary: output.summary !== undefined && output.summary !== null
3414
+ ? deserializeAws_restJson1DataSetImportSummary(output.summary, context)
3415
+ : undefined,
3416
+ taskId: (0, smithy_client_1.expectString)(output.taskId),
3417
+ };
3418
+ };
3419
+ const deserializeAws_restJson1DataSetImportTaskList = (output, context) => {
3420
+ const retVal = (output || [])
3421
+ .filter((e) => e != null)
3422
+ .map((entry) => {
3423
+ if (entry === null) {
3424
+ return null;
3425
+ }
3426
+ return deserializeAws_restJson1DataSetImportTask(entry, context);
3427
+ });
3428
+ return retVal;
3429
+ };
3430
+ const deserializeAws_restJson1DataSetsSummaryList = (output, context) => {
3431
+ const retVal = (output || [])
3432
+ .filter((e) => e != null)
3433
+ .map((entry) => {
3434
+ if (entry === null) {
3435
+ return null;
3436
+ }
3437
+ return deserializeAws_restJson1DataSetSummary(entry, context);
3438
+ });
3439
+ return retVal;
3440
+ };
3441
+ const deserializeAws_restJson1DataSetSummary = (output, context) => {
3442
+ return {
3443
+ creationTime: output.creationTime !== undefined && output.creationTime !== null
3444
+ ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.creationTime)))
3445
+ : undefined,
3446
+ dataSetName: (0, smithy_client_1.expectString)(output.dataSetName),
3447
+ dataSetOrg: (0, smithy_client_1.expectString)(output.dataSetOrg),
3448
+ format: (0, smithy_client_1.expectString)(output.format),
3449
+ lastReferencedTime: output.lastReferencedTime !== undefined && output.lastReferencedTime !== null
3450
+ ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.lastReferencedTime)))
3451
+ : undefined,
3452
+ lastUpdatedTime: output.lastUpdatedTime !== undefined && output.lastUpdatedTime !== null
3453
+ ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.lastUpdatedTime)))
3454
+ : undefined,
3455
+ };
3456
+ };
3457
+ const deserializeAws_restJson1DeployedVersionSummary = (output, context) => {
3458
+ return {
3459
+ applicationVersion: (0, smithy_client_1.expectInt32)(output.applicationVersion),
3460
+ status: (0, smithy_client_1.expectString)(output.status),
3461
+ statusReason: (0, smithy_client_1.expectString)(output.statusReason),
3462
+ };
3463
+ };
3464
+ const deserializeAws_restJson1DeploymentList = (output, context) => {
3465
+ const retVal = (output || [])
3466
+ .filter((e) => e != null)
3467
+ .map((entry) => {
3468
+ if (entry === null) {
3469
+ return null;
3470
+ }
3471
+ return deserializeAws_restJson1DeploymentSummary(entry, context);
3472
+ });
3473
+ return retVal;
3474
+ };
3475
+ const deserializeAws_restJson1DeploymentSummary = (output, context) => {
3476
+ return {
3477
+ applicationId: (0, smithy_client_1.expectString)(output.applicationId),
3478
+ applicationVersion: (0, smithy_client_1.expectInt32)(output.applicationVersion),
3479
+ creationTime: output.creationTime !== undefined && output.creationTime !== null
3480
+ ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.creationTime)))
3481
+ : undefined,
3482
+ deploymentId: (0, smithy_client_1.expectString)(output.deploymentId),
3483
+ environmentId: (0, smithy_client_1.expectString)(output.environmentId),
3484
+ status: (0, smithy_client_1.expectString)(output.status),
3485
+ statusReason: (0, smithy_client_1.expectString)(output.statusReason),
3486
+ };
3487
+ };
3488
+ const deserializeAws_restJson1EfsStorageConfiguration = (output, context) => {
3489
+ return {
3490
+ fileSystemId: (0, smithy_client_1.expectString)(output["file-system-id"]),
3491
+ mountPoint: (0, smithy_client_1.expectString)(output["mount-point"]),
3492
+ };
3493
+ };
3494
+ const deserializeAws_restJson1EngineVersionsSummary = (output, context) => {
3495
+ return {
3496
+ engineType: (0, smithy_client_1.expectString)(output.engineType),
3497
+ engineVersion: (0, smithy_client_1.expectString)(output.engineVersion),
3498
+ };
3499
+ };
3500
+ const deserializeAws_restJson1EngineVersionsSummaryList = (output, context) => {
3501
+ const retVal = (output || [])
3502
+ .filter((e) => e != null)
3503
+ .map((entry) => {
3504
+ if (entry === null) {
3505
+ return null;
3506
+ }
3507
+ return deserializeAws_restJson1EngineVersionsSummary(entry, context);
3508
+ });
3509
+ return retVal;
3510
+ };
3511
+ const deserializeAws_restJson1EnvironmentSummary = (output, context) => {
3512
+ return {
3513
+ creationTime: output.creationTime !== undefined && output.creationTime !== null
3514
+ ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.creationTime)))
3515
+ : undefined,
3516
+ engineType: (0, smithy_client_1.expectString)(output.engineType),
3517
+ engineVersion: (0, smithy_client_1.expectString)(output.engineVersion),
3518
+ environmentArn: (0, smithy_client_1.expectString)(output.environmentArn),
3519
+ environmentId: (0, smithy_client_1.expectString)(output.environmentId),
3520
+ instanceType: (0, smithy_client_1.expectString)(output.instanceType),
3521
+ name: (0, smithy_client_1.expectString)(output.name),
3522
+ status: (0, smithy_client_1.expectString)(output.status),
3523
+ };
3524
+ };
3525
+ const deserializeAws_restJson1EnvironmentSummaryList = (output, context) => {
3526
+ const retVal = (output || [])
3527
+ .filter((e) => e != null)
3528
+ .map((entry) => {
3529
+ if (entry === null) {
3530
+ return null;
3531
+ }
3532
+ return deserializeAws_restJson1EnvironmentSummary(entry, context);
3533
+ });
3534
+ return retVal;
3535
+ };
3536
+ const deserializeAws_restJson1FileBatchJobDefinition = (output, context) => {
3537
+ return {
3538
+ fileName: (0, smithy_client_1.expectString)(output.fileName),
3539
+ folderPath: (0, smithy_client_1.expectString)(output.folderPath),
3540
+ };
3541
+ };
3542
+ const deserializeAws_restJson1FsxStorageConfiguration = (output, context) => {
3543
+ return {
3544
+ fileSystemId: (0, smithy_client_1.expectString)(output["file-system-id"]),
3545
+ mountPoint: (0, smithy_client_1.expectString)(output["mount-point"]),
3546
+ };
3547
+ };
3548
+ const deserializeAws_restJson1GdgDetailAttributes = (output, context) => {
3549
+ return {
3550
+ limit: (0, smithy_client_1.expectInt32)(output.limit),
3551
+ rollDisposition: (0, smithy_client_1.expectString)(output.rollDisposition),
3552
+ };
3553
+ };
3554
+ const deserializeAws_restJson1HighAvailabilityConfig = (output, context) => {
3555
+ return {
3556
+ desiredCapacity: (0, smithy_client_1.expectInt32)(output.desiredCapacity),
3557
+ };
3558
+ };
3559
+ const deserializeAws_restJson1LogGroupSummaries = (output, context) => {
3560
+ const retVal = (output || [])
3561
+ .filter((e) => e != null)
3562
+ .map((entry) => {
3563
+ if (entry === null) {
3564
+ return null;
3565
+ }
3566
+ return deserializeAws_restJson1LogGroupSummary(entry, context);
3567
+ });
3568
+ return retVal;
3569
+ };
3570
+ const deserializeAws_restJson1LogGroupSummary = (output, context) => {
3571
+ return {
3572
+ logGroupName: (0, smithy_client_1.expectString)(output.logGroupName),
3573
+ logType: (0, smithy_client_1.expectString)(output.logType),
3574
+ };
3575
+ };
3576
+ const deserializeAws_restJson1MaintenanceSchedule = (output, context) => {
3577
+ return {
3578
+ endTime: output.endTime !== undefined && output.endTime !== null
3579
+ ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.endTime)))
3580
+ : undefined,
3581
+ startTime: output.startTime !== undefined && output.startTime !== null
3582
+ ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.startTime)))
3583
+ : undefined,
3584
+ };
3585
+ };
3586
+ const deserializeAws_restJson1PendingMaintenance = (output, context) => {
3587
+ return {
3588
+ engineVersion: (0, smithy_client_1.expectString)(output.engineVersion),
3589
+ schedule: output.schedule !== undefined && output.schedule !== null
3590
+ ? deserializeAws_restJson1MaintenanceSchedule(output.schedule, context)
3591
+ : undefined,
3592
+ };
3593
+ };
3594
+ const deserializeAws_restJson1PortList = (output, context) => {
3595
+ const retVal = (output || [])
3596
+ .filter((e) => e != null)
3597
+ .map((entry) => {
3598
+ if (entry === null) {
3599
+ return null;
3600
+ }
3601
+ return (0, smithy_client_1.expectInt32)(entry);
3602
+ });
3603
+ return retVal;
3604
+ };
3605
+ const deserializeAws_restJson1PrimaryKey = (output, context) => {
3606
+ return {
3607
+ length: (0, smithy_client_1.expectInt32)(output.length),
3608
+ name: (0, smithy_client_1.expectString)(output.name),
3609
+ offset: (0, smithy_client_1.expectInt32)(output.offset),
3610
+ };
3611
+ };
3612
+ const deserializeAws_restJson1ScriptBatchJobDefinition = (output, context) => {
3613
+ return {
3614
+ scriptName: (0, smithy_client_1.expectString)(output.scriptName),
3615
+ };
3616
+ };
3617
+ const deserializeAws_restJson1StorageConfiguration = (output, context) => {
3618
+ if (output.efs !== undefined && output.efs !== null) {
3619
+ return {
3620
+ efs: deserializeAws_restJson1EfsStorageConfiguration(output.efs, context),
3621
+ };
3622
+ }
3623
+ if (output.fsx !== undefined && output.fsx !== null) {
3624
+ return {
3625
+ fsx: deserializeAws_restJson1FsxStorageConfiguration(output.fsx, context),
3626
+ };
3627
+ }
3628
+ return { $unknown: Object.entries(output)[0] };
3629
+ };
3630
+ const deserializeAws_restJson1StorageConfigurationList = (output, context) => {
3631
+ const retVal = (output || [])
3632
+ .filter((e) => e != null)
3633
+ .map((entry) => {
3634
+ if (entry === null) {
3635
+ return null;
3636
+ }
3637
+ return deserializeAws_restJson1StorageConfiguration((0, smithy_client_1.expectUnion)(entry), context);
3638
+ });
3639
+ return retVal;
3640
+ };
3641
+ const deserializeAws_restJson1String50List = (output, context) => {
3642
+ const retVal = (output || [])
3643
+ .filter((e) => e != null)
3644
+ .map((entry) => {
3645
+ if (entry === null) {
3646
+ return null;
3647
+ }
3648
+ return (0, smithy_client_1.expectString)(entry);
3649
+ });
3650
+ return retVal;
3651
+ };
3652
+ const deserializeAws_restJson1TagMap = (output, context) => {
3653
+ return Object.entries(output).reduce((acc, [key, value]) => {
3654
+ if (value === null) {
3655
+ return acc;
3656
+ }
3657
+ return {
3658
+ ...acc,
3659
+ [key]: (0, smithy_client_1.expectString)(value),
3660
+ };
3661
+ }, {});
3662
+ };
3663
+ const deserializeAws_restJson1ValidationExceptionField = (output, context) => {
3664
+ return {
3665
+ message: (0, smithy_client_1.expectString)(output.message),
3666
+ name: (0, smithy_client_1.expectString)(output.name),
3667
+ };
3668
+ };
3669
+ const deserializeAws_restJson1ValidationExceptionFieldList = (output, context) => {
3670
+ const retVal = (output || [])
3671
+ .filter((e) => e != null)
3672
+ .map((entry) => {
3673
+ if (entry === null) {
3674
+ return null;
3675
+ }
3676
+ return deserializeAws_restJson1ValidationExceptionField(entry, context);
3677
+ });
3678
+ return retVal;
3679
+ };
3680
+ const deserializeAws_restJson1VsamDetailAttributes = (output, context) => {
3681
+ return {
3682
+ alternateKeys: output.alternateKeys !== undefined && output.alternateKeys !== null
3683
+ ? deserializeAws_restJson1AlternateKeyList(output.alternateKeys, context)
3684
+ : undefined,
3685
+ cacheAtStartup: (0, smithy_client_1.expectBoolean)(output.cacheAtStartup),
3686
+ compressed: (0, smithy_client_1.expectBoolean)(output.compressed),
3687
+ encoding: (0, smithy_client_1.expectString)(output.encoding),
3688
+ primaryKey: output.primaryKey !== undefined && output.primaryKey !== null
3689
+ ? deserializeAws_restJson1PrimaryKey(output.primaryKey, context)
3690
+ : undefined,
3691
+ recordFormat: (0, smithy_client_1.expectString)(output.recordFormat),
3692
+ };
3693
+ };
3694
+ const deserializeMetadata = (output) => {
3695
+ var _a;
3696
+ return ({
3697
+ httpStatusCode: output.statusCode,
3698
+ requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"],
3699
+ extendedRequestId: output.headers["x-amz-id-2"],
3700
+ cfId: output.headers["x-amz-cf-id"],
3701
+ });
3702
+ };
3703
+ const collectBody = (streamBody = new Uint8Array(), context) => {
3704
+ if (streamBody instanceof Uint8Array) {
3705
+ return Promise.resolve(streamBody);
3706
+ }
3707
+ return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
3708
+ };
3709
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
3710
+ const isSerializableHeaderValue = (value) => value !== undefined &&
3711
+ value !== null &&
3712
+ value !== "" &&
3713
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
3714
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
3715
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
3716
+ if (encoded.length) {
3717
+ return JSON.parse(encoded);
3718
+ }
3719
+ return {};
3720
+ });
3721
+ const loadRestJsonErrorCode = (output, data) => {
3722
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
3723
+ const sanitizeErrorCode = (rawValue) => {
3724
+ let cleanValue = rawValue;
3725
+ if (cleanValue.indexOf(":") >= 0) {
3726
+ cleanValue = cleanValue.split(":")[0];
3727
+ }
3728
+ if (cleanValue.indexOf("#") >= 0) {
3729
+ cleanValue = cleanValue.split("#")[1];
3730
+ }
3731
+ return cleanValue;
3732
+ };
3733
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
3734
+ if (headerKey !== undefined) {
3735
+ return sanitizeErrorCode(output.headers[headerKey]);
3736
+ }
3737
+ if (data.code !== undefined) {
3738
+ return sanitizeErrorCode(data.code);
3739
+ }
3740
+ if (data["__type"] !== undefined) {
3741
+ return sanitizeErrorCode(data["__type"]);
3742
+ }
3743
+ return "";
3744
+ };