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