@aws-sdk/client-finspace 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 (140) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/{dist/cjs → dist-cjs}/Finspace.js +1 -2
  3. package/{dist/cjs → dist-cjs}/FinspaceClient.js +8 -9
  4. package/{dist/cjs → dist-cjs}/commands/CreateEnvironmentCommand.js +2 -3
  5. package/{dist/cjs → dist-cjs}/commands/DeleteEnvironmentCommand.js +2 -3
  6. package/{dist/cjs → dist-cjs}/commands/GetEnvironmentCommand.js +2 -3
  7. package/{dist/cjs → dist-cjs}/commands/ListEnvironmentsCommand.js +2 -3
  8. package/{dist/cjs → dist-cjs}/commands/ListTagsForResourceCommand.js +2 -3
  9. package/{dist/cjs → dist-cjs}/commands/TagResourceCommand.js +2 -3
  10. package/{dist/cjs → dist-cjs}/commands/UntagResourceCommand.js +2 -3
  11. package/{dist/cjs → dist-cjs}/commands/UpdateEnvironmentCommand.js +2 -3
  12. package/{dist/cjs → dist-cjs}/endpoints.js +0 -1
  13. package/{dist/cjs → dist-cjs}/index.js +0 -1
  14. package/{dist/cjs → dist-cjs}/models/index.js +0 -1
  15. package/{dist/cjs → dist-cjs}/models/models_0.js +0 -1
  16. package/{dist/cjs → dist-cjs}/protocols/Aws_restJson1.js +2 -3
  17. package/{dist/cjs → dist-cjs}/runtimeConfig.browser.js +2 -2
  18. package/{dist/cjs → dist-cjs}/runtimeConfig.js +2 -2
  19. package/{dist/cjs → dist-cjs}/runtimeConfig.native.js +0 -1
  20. package/{dist/cjs → dist-cjs}/runtimeConfig.shared.js +1 -2
  21. package/{dist/es → dist-es}/Finspace.js +2 -7
  22. package/{dist/es → dist-es}/FinspaceClient.js +2 -12
  23. package/{dist/es → dist-es}/commands/CreateEnvironmentCommand.js +4 -30
  24. package/{dist/es → dist-es}/commands/DeleteEnvironmentCommand.js +4 -30
  25. package/{dist/es → dist-es}/commands/GetEnvironmentCommand.js +4 -30
  26. package/{dist/es → dist-es}/commands/ListEnvironmentsCommand.js +4 -30
  27. package/{dist/es → dist-es}/commands/ListTagsForResourceCommand.js +4 -30
  28. package/{dist/es → dist-es}/commands/TagResourceCommand.js +4 -30
  29. package/{dist/es → dist-es}/commands/UntagResourceCommand.js +4 -30
  30. package/{dist/es → dist-es}/commands/UpdateEnvironmentCommand.js +4 -30
  31. package/{dist/es → dist-es}/endpoints.js +1 -2
  32. package/{dist/types/index.d.ts → dist-es/index.js} +0 -0
  33. package/{dist/types/models/index.d.ts → dist-es/models/index.js} +0 -0
  34. package/{dist/es → dist-es}/models/models_0.js +0 -79
  35. package/{dist/es → dist-es}/protocols/Aws_restJson1.js +196 -202
  36. package/{dist/es → dist-es}/runtimeConfig.browser.js +1 -5
  37. package/{dist/es → dist-es}/runtimeConfig.js +1 -5
  38. package/{dist/es → dist-es}/runtimeConfig.native.js +0 -4
  39. package/{dist/es → dist-es}/runtimeConfig.shared.js +1 -5
  40. package/{dist/types → dist-types}/Finspace.d.ts +2 -2
  41. package/{dist/types → dist-types}/FinspaceClient.d.ts +8 -8
  42. package/{dist/types → dist-types}/commands/CreateEnvironmentCommand.d.ts +2 -2
  43. package/{dist/types → dist-types}/commands/DeleteEnvironmentCommand.d.ts +2 -2
  44. package/{dist/types → dist-types}/commands/GetEnvironmentCommand.d.ts +2 -2
  45. package/{dist/types → dist-types}/commands/ListEnvironmentsCommand.d.ts +2 -2
  46. package/{dist/types → dist-types}/commands/ListTagsForResourceCommand.d.ts +2 -2
  47. package/{dist/types → dist-types}/commands/TagResourceCommand.d.ts +2 -2
  48. package/{dist/types → dist-types}/commands/UntagResourceCommand.d.ts +2 -2
  49. package/{dist/types → dist-types}/commands/UpdateEnvironmentCommand.d.ts +2 -2
  50. package/{dist/types → dist-types}/endpoints.d.ts +0 -0
  51. package/{index.ts → dist-types/index.d.ts} +0 -0
  52. package/{models/index.ts → dist-types/models/index.d.ts} +0 -0
  53. package/{dist/types → dist-types}/models/models_0.d.ts +0 -0
  54. package/{dist/types → dist-types}/protocols/Aws_restJson1.d.ts +2 -2
  55. package/{dist/types/ts3.4 → dist-types}/runtimeConfig.browser.d.ts +37 -36
  56. package/{dist/types/ts3.4 → dist-types}/runtimeConfig.d.ts +37 -36
  57. package/{dist/types → dist-types}/runtimeConfig.native.d.ts +1 -0
  58. package/{dist/types → dist-types}/runtimeConfig.shared.d.ts +0 -0
  59. package/{dist/types → dist-types}/ts3.4/Finspace.d.ts +2 -2
  60. package/{dist/types → dist-types}/ts3.4/FinspaceClient.d.ts +8 -8
  61. package/{dist/types → dist-types}/ts3.4/commands/CreateEnvironmentCommand.d.ts +2 -2
  62. package/{dist/types → dist-types}/ts3.4/commands/DeleteEnvironmentCommand.d.ts +2 -2
  63. package/{dist/types → dist-types}/ts3.4/commands/GetEnvironmentCommand.d.ts +2 -2
  64. package/{dist/types → dist-types}/ts3.4/commands/ListEnvironmentsCommand.d.ts +2 -2
  65. package/{dist/types → dist-types}/ts3.4/commands/ListTagsForResourceCommand.d.ts +2 -2
  66. package/{dist/types → dist-types}/ts3.4/commands/TagResourceCommand.d.ts +2 -2
  67. package/{dist/types → dist-types}/ts3.4/commands/UntagResourceCommand.d.ts +2 -2
  68. package/{dist/types → dist-types}/ts3.4/commands/UpdateEnvironmentCommand.d.ts +2 -2
  69. package/{dist/types → dist-types}/ts3.4/endpoints.d.ts +0 -0
  70. package/{dist/types → dist-types}/ts3.4/index.d.ts +0 -0
  71. package/{dist/types → dist-types}/ts3.4/models/index.d.ts +0 -0
  72. package/{dist/types → dist-types}/ts3.4/models/models_0.d.ts +0 -0
  73. package/{dist/types → dist-types}/ts3.4/protocols/Aws_restJson1.d.ts +2 -2
  74. package/{dist/types → dist-types/ts3.4}/runtimeConfig.browser.d.ts +37 -36
  75. package/{dist/types → dist-types/ts3.4}/runtimeConfig.d.ts +37 -36
  76. package/{dist/types → dist-types}/ts3.4/runtimeConfig.native.d.ts +1 -0
  77. package/{dist/types → dist-types}/ts3.4/runtimeConfig.shared.d.ts +0 -0
  78. package/package.json +52 -49
  79. package/Finspace.ts +0 -294
  80. package/FinspaceClient.ts +0 -263
  81. package/commands/CreateEnvironmentCommand.ts +0 -94
  82. package/commands/DeleteEnvironmentCommand.ts +0 -94
  83. package/commands/GetEnvironmentCommand.ts +0 -94
  84. package/commands/ListEnvironmentsCommand.ts +0 -94
  85. package/commands/ListTagsForResourceCommand.ts +0 -94
  86. package/commands/TagResourceCommand.ts +0 -94
  87. package/commands/UntagResourceCommand.ts +0 -94
  88. package/commands/UpdateEnvironmentCommand.ts +0 -94
  89. package/dist/cjs/Finspace.js.map +0 -1
  90. package/dist/cjs/FinspaceClient.js.map +0 -1
  91. package/dist/cjs/commands/CreateEnvironmentCommand.js.map +0 -1
  92. package/dist/cjs/commands/DeleteEnvironmentCommand.js.map +0 -1
  93. package/dist/cjs/commands/GetEnvironmentCommand.js.map +0 -1
  94. package/dist/cjs/commands/ListEnvironmentsCommand.js.map +0 -1
  95. package/dist/cjs/commands/ListTagsForResourceCommand.js.map +0 -1
  96. package/dist/cjs/commands/TagResourceCommand.js.map +0 -1
  97. package/dist/cjs/commands/UntagResourceCommand.js.map +0 -1
  98. package/dist/cjs/commands/UpdateEnvironmentCommand.js.map +0 -1
  99. package/dist/cjs/endpoints.js.map +0 -1
  100. package/dist/cjs/index.js.map +0 -1
  101. package/dist/cjs/models/index.js.map +0 -1
  102. package/dist/cjs/models/models_0.js.map +0 -1
  103. package/dist/cjs/package.json +0 -91
  104. package/dist/cjs/protocols/Aws_restJson1.js.map +0 -1
  105. package/dist/cjs/runtimeConfig.browser.js.map +0 -1
  106. package/dist/cjs/runtimeConfig.js.map +0 -1
  107. package/dist/cjs/runtimeConfig.native.js.map +0 -1
  108. package/dist/cjs/runtimeConfig.shared.js.map +0 -1
  109. package/dist/es/Finspace.js.map +0 -1
  110. package/dist/es/FinspaceClient.js.map +0 -1
  111. package/dist/es/commands/CreateEnvironmentCommand.js.map +0 -1
  112. package/dist/es/commands/DeleteEnvironmentCommand.js.map +0 -1
  113. package/dist/es/commands/GetEnvironmentCommand.js.map +0 -1
  114. package/dist/es/commands/ListEnvironmentsCommand.js.map +0 -1
  115. package/dist/es/commands/ListTagsForResourceCommand.js.map +0 -1
  116. package/dist/es/commands/TagResourceCommand.js.map +0 -1
  117. package/dist/es/commands/UntagResourceCommand.js.map +0 -1
  118. package/dist/es/commands/UpdateEnvironmentCommand.js.map +0 -1
  119. package/dist/es/endpoints.js.map +0 -1
  120. package/dist/es/index.js +0 -12
  121. package/dist/es/index.js.map +0 -1
  122. package/dist/es/models/index.js +0 -2
  123. package/dist/es/models/index.js.map +0 -1
  124. package/dist/es/models/models_0.js.map +0 -1
  125. package/dist/es/package.json +0 -91
  126. package/dist/es/protocols/Aws_restJson1.js.map +0 -1
  127. package/dist/es/runtimeConfig.browser.js.map +0 -1
  128. package/dist/es/runtimeConfig.js.map +0 -1
  129. package/dist/es/runtimeConfig.native.js.map +0 -1
  130. package/dist/es/runtimeConfig.shared.js.map +0 -1
  131. package/endpoints.ts +0 -57
  132. package/jest.config.js +0 -4
  133. package/models/models_0.ts +0 -626
  134. package/protocols/Aws_restJson1.ts +0 -1214
  135. package/runtimeConfig.browser.ts +0 -40
  136. package/runtimeConfig.native.ts +0 -16
  137. package/runtimeConfig.shared.ts +0 -16
  138. package/runtimeConfig.ts +0 -45
  139. package/tsconfig.es.json +0 -12
  140. package/tsconfig.json +0 -32
@@ -1,1214 +0,0 @@
1
- import { CreateEnvironmentCommandInput, CreateEnvironmentCommandOutput } from "../commands/CreateEnvironmentCommand";
2
- import { DeleteEnvironmentCommandInput, DeleteEnvironmentCommandOutput } from "../commands/DeleteEnvironmentCommand";
3
- import { GetEnvironmentCommandInput, GetEnvironmentCommandOutput } from "../commands/GetEnvironmentCommand";
4
- import { ListEnvironmentsCommandInput, ListEnvironmentsCommandOutput } from "../commands/ListEnvironmentsCommand";
5
- import {
6
- ListTagsForResourceCommandInput,
7
- ListTagsForResourceCommandOutput,
8
- } from "../commands/ListTagsForResourceCommand";
9
- import { TagResourceCommandInput, TagResourceCommandOutput } from "../commands/TagResourceCommand";
10
- import { UntagResourceCommandInput, UntagResourceCommandOutput } from "../commands/UntagResourceCommand";
11
- import { UpdateEnvironmentCommandInput, UpdateEnvironmentCommandOutput } from "../commands/UpdateEnvironmentCommand";
12
- import {
13
- AccessDeniedException,
14
- Environment,
15
- FederationParameters,
16
- InternalServerException,
17
- InvalidRequestException,
18
- LimitExceededException,
19
- ResourceNotFoundException,
20
- ServiceQuotaExceededException,
21
- ThrottlingException,
22
- ValidationException,
23
- } from "../models/models_0";
24
- import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
25
- import {
26
- expectNonNull as __expectNonNull,
27
- expectObject as __expectObject,
28
- expectString as __expectString,
29
- extendedEncodeURIComponent as __extendedEncodeURIComponent,
30
- } from "@aws-sdk/smithy-client";
31
- import {
32
- Endpoint as __Endpoint,
33
- MetadataBearer as __MetadataBearer,
34
- ResponseMetadata as __ResponseMetadata,
35
- SerdeContext as __SerdeContext,
36
- SmithyException as __SmithyException,
37
- } from "@aws-sdk/types";
38
-
39
- export const serializeAws_restJson1CreateEnvironmentCommand = async (
40
- input: CreateEnvironmentCommandInput,
41
- context: __SerdeContext
42
- ): Promise<__HttpRequest> => {
43
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
44
- const headers: any = {
45
- "content-type": "application/json",
46
- };
47
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/environment";
48
- let body: any;
49
- body = JSON.stringify({
50
- ...(input.description !== undefined && input.description !== null && { description: input.description }),
51
- ...(input.federationMode !== undefined &&
52
- input.federationMode !== null && { federationMode: input.federationMode }),
53
- ...(input.federationParameters !== undefined &&
54
- input.federationParameters !== null && {
55
- federationParameters: serializeAws_restJson1FederationParameters(input.federationParameters, context),
56
- }),
57
- ...(input.kmsKeyId !== undefined && input.kmsKeyId !== null && { kmsKeyId: input.kmsKeyId }),
58
- ...(input.name !== undefined && input.name !== null && { name: input.name }),
59
- ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
60
- });
61
- return new __HttpRequest({
62
- protocol,
63
- hostname,
64
- port,
65
- method: "POST",
66
- headers,
67
- path: resolvedPath,
68
- body,
69
- });
70
- };
71
-
72
- export const serializeAws_restJson1DeleteEnvironmentCommand = async (
73
- input: DeleteEnvironmentCommandInput,
74
- context: __SerdeContext
75
- ): Promise<__HttpRequest> => {
76
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
77
- const headers: any = {};
78
- let resolvedPath =
79
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/environment/{environmentId}";
80
- if (input.environmentId !== undefined) {
81
- const labelValue: string = input.environmentId;
82
- if (labelValue.length <= 0) {
83
- throw new Error("Empty value provided for input HTTP label: environmentId.");
84
- }
85
- resolvedPath = resolvedPath.replace("{environmentId}", __extendedEncodeURIComponent(labelValue));
86
- } else {
87
- throw new Error("No value provided for input HTTP label: environmentId.");
88
- }
89
- let body: any;
90
- return new __HttpRequest({
91
- protocol,
92
- hostname,
93
- port,
94
- method: "DELETE",
95
- headers,
96
- path: resolvedPath,
97
- body,
98
- });
99
- };
100
-
101
- export const serializeAws_restJson1GetEnvironmentCommand = async (
102
- input: GetEnvironmentCommandInput,
103
- context: __SerdeContext
104
- ): Promise<__HttpRequest> => {
105
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
106
- const headers: any = {};
107
- let resolvedPath =
108
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/environment/{environmentId}";
109
- if (input.environmentId !== undefined) {
110
- const labelValue: string = input.environmentId;
111
- if (labelValue.length <= 0) {
112
- throw new Error("Empty value provided for input HTTP label: environmentId.");
113
- }
114
- resolvedPath = resolvedPath.replace("{environmentId}", __extendedEncodeURIComponent(labelValue));
115
- } else {
116
- throw new Error("No value provided for input HTTP label: environmentId.");
117
- }
118
- let body: any;
119
- return new __HttpRequest({
120
- protocol,
121
- hostname,
122
- port,
123
- method: "GET",
124
- headers,
125
- path: resolvedPath,
126
- body,
127
- });
128
- };
129
-
130
- export const serializeAws_restJson1ListEnvironmentsCommand = async (
131
- input: ListEnvironmentsCommandInput,
132
- context: __SerdeContext
133
- ): Promise<__HttpRequest> => {
134
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
135
- const headers: any = {};
136
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/environment";
137
- const query: any = {
138
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
139
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
140
- };
141
- let body: any;
142
- return new __HttpRequest({
143
- protocol,
144
- hostname,
145
- port,
146
- method: "GET",
147
- headers,
148
- path: resolvedPath,
149
- query,
150
- body,
151
- });
152
- };
153
-
154
- export const serializeAws_restJson1ListTagsForResourceCommand = async (
155
- input: ListTagsForResourceCommandInput,
156
- context: __SerdeContext
157
- ): Promise<__HttpRequest> => {
158
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
159
- const headers: any = {};
160
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
161
- if (input.resourceArn !== undefined) {
162
- const labelValue: string = input.resourceArn;
163
- if (labelValue.length <= 0) {
164
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
165
- }
166
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
167
- } else {
168
- throw new Error("No value provided for input HTTP label: resourceArn.");
169
- }
170
- let body: any;
171
- return new __HttpRequest({
172
- protocol,
173
- hostname,
174
- port,
175
- method: "GET",
176
- headers,
177
- path: resolvedPath,
178
- body,
179
- });
180
- };
181
-
182
- export const serializeAws_restJson1TagResourceCommand = async (
183
- input: TagResourceCommandInput,
184
- context: __SerdeContext
185
- ): Promise<__HttpRequest> => {
186
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
187
- const headers: any = {
188
- "content-type": "application/json",
189
- };
190
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
191
- if (input.resourceArn !== undefined) {
192
- const labelValue: string = input.resourceArn;
193
- if (labelValue.length <= 0) {
194
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
195
- }
196
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
197
- } else {
198
- throw new Error("No value provided for input HTTP label: resourceArn.");
199
- }
200
- let body: any;
201
- body = JSON.stringify({
202
- ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
203
- });
204
- return new __HttpRequest({
205
- protocol,
206
- hostname,
207
- port,
208
- method: "POST",
209
- headers,
210
- path: resolvedPath,
211
- body,
212
- });
213
- };
214
-
215
- export const serializeAws_restJson1UntagResourceCommand = async (
216
- input: UntagResourceCommandInput,
217
- context: __SerdeContext
218
- ): Promise<__HttpRequest> => {
219
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
220
- const headers: any = {};
221
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
222
- if (input.resourceArn !== undefined) {
223
- const labelValue: string = input.resourceArn;
224
- if (labelValue.length <= 0) {
225
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
226
- }
227
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
228
- } else {
229
- throw new Error("No value provided for input HTTP label: resourceArn.");
230
- }
231
- const query: any = {
232
- ...(input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map((_entry) => _entry as any) }),
233
- };
234
- let body: any;
235
- return new __HttpRequest({
236
- protocol,
237
- hostname,
238
- port,
239
- method: "DELETE",
240
- headers,
241
- path: resolvedPath,
242
- query,
243
- body,
244
- });
245
- };
246
-
247
- export const serializeAws_restJson1UpdateEnvironmentCommand = async (
248
- input: UpdateEnvironmentCommandInput,
249
- context: __SerdeContext
250
- ): Promise<__HttpRequest> => {
251
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
252
- const headers: any = {
253
- "content-type": "application/json",
254
- };
255
- let resolvedPath =
256
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/environment/{environmentId}";
257
- if (input.environmentId !== undefined) {
258
- const labelValue: string = input.environmentId;
259
- if (labelValue.length <= 0) {
260
- throw new Error("Empty value provided for input HTTP label: environmentId.");
261
- }
262
- resolvedPath = resolvedPath.replace("{environmentId}", __extendedEncodeURIComponent(labelValue));
263
- } else {
264
- throw new Error("No value provided for input HTTP label: environmentId.");
265
- }
266
- let body: any;
267
- body = JSON.stringify({
268
- ...(input.description !== undefined && input.description !== null && { description: input.description }),
269
- ...(input.federationMode !== undefined &&
270
- input.federationMode !== null && { federationMode: input.federationMode }),
271
- ...(input.federationParameters !== undefined &&
272
- input.federationParameters !== null && {
273
- federationParameters: serializeAws_restJson1FederationParameters(input.federationParameters, context),
274
- }),
275
- ...(input.name !== undefined && input.name !== null && { name: input.name }),
276
- });
277
- return new __HttpRequest({
278
- protocol,
279
- hostname,
280
- port,
281
- method: "PUT",
282
- headers,
283
- path: resolvedPath,
284
- body,
285
- });
286
- };
287
-
288
- export const deserializeAws_restJson1CreateEnvironmentCommand = async (
289
- output: __HttpResponse,
290
- context: __SerdeContext
291
- ): Promise<CreateEnvironmentCommandOutput> => {
292
- if (output.statusCode !== 200 && output.statusCode >= 300) {
293
- return deserializeAws_restJson1CreateEnvironmentCommandError(output, context);
294
- }
295
- const contents: CreateEnvironmentCommandOutput = {
296
- $metadata: deserializeMetadata(output),
297
- environmentArn: undefined,
298
- environmentId: undefined,
299
- environmentUrl: undefined,
300
- };
301
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
302
- if (data.environmentArn !== undefined && data.environmentArn !== null) {
303
- contents.environmentArn = __expectString(data.environmentArn);
304
- }
305
- if (data.environmentId !== undefined && data.environmentId !== null) {
306
- contents.environmentId = __expectString(data.environmentId);
307
- }
308
- if (data.environmentUrl !== undefined && data.environmentUrl !== null) {
309
- contents.environmentUrl = __expectString(data.environmentUrl);
310
- }
311
- return Promise.resolve(contents);
312
- };
313
-
314
- const deserializeAws_restJson1CreateEnvironmentCommandError = async (
315
- output: __HttpResponse,
316
- context: __SerdeContext
317
- ): Promise<CreateEnvironmentCommandOutput> => {
318
- const parsedOutput: any = {
319
- ...output,
320
- body: await parseBody(output.body, context),
321
- };
322
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
323
- let errorCode: string = "UnknownError";
324
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
325
- switch (errorCode) {
326
- case "AccessDeniedException":
327
- case "com.amazonaws.finspace#AccessDeniedException":
328
- response = {
329
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
330
- name: errorCode,
331
- $metadata: deserializeMetadata(output),
332
- };
333
- break;
334
- case "InternalServerException":
335
- case "com.amazonaws.finspace#InternalServerException":
336
- response = {
337
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
338
- name: errorCode,
339
- $metadata: deserializeMetadata(output),
340
- };
341
- break;
342
- case "LimitExceededException":
343
- case "com.amazonaws.finspace#LimitExceededException":
344
- response = {
345
- ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
346
- name: errorCode,
347
- $metadata: deserializeMetadata(output),
348
- };
349
- break;
350
- case "ServiceQuotaExceededException":
351
- case "com.amazonaws.finspace#ServiceQuotaExceededException":
352
- response = {
353
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
354
- name: errorCode,
355
- $metadata: deserializeMetadata(output),
356
- };
357
- break;
358
- case "ThrottlingException":
359
- case "com.amazonaws.finspace#ThrottlingException":
360
- response = {
361
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
362
- name: errorCode,
363
- $metadata: deserializeMetadata(output),
364
- };
365
- break;
366
- case "ValidationException":
367
- case "com.amazonaws.finspace#ValidationException":
368
- response = {
369
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
370
- name: errorCode,
371
- $metadata: deserializeMetadata(output),
372
- };
373
- break;
374
- default:
375
- const parsedBody = parsedOutput.body;
376
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
377
- response = {
378
- ...parsedBody,
379
- name: `${errorCode}`,
380
- message: parsedBody.message || parsedBody.Message || errorCode,
381
- $fault: "client",
382
- $metadata: deserializeMetadata(output),
383
- } as any;
384
- }
385
- const message = response.message || response.Message || errorCode;
386
- response.message = message;
387
- delete response.Message;
388
- return Promise.reject(Object.assign(new Error(message), response));
389
- };
390
-
391
- export const deserializeAws_restJson1DeleteEnvironmentCommand = async (
392
- output: __HttpResponse,
393
- context: __SerdeContext
394
- ): Promise<DeleteEnvironmentCommandOutput> => {
395
- if (output.statusCode !== 200 && output.statusCode >= 300) {
396
- return deserializeAws_restJson1DeleteEnvironmentCommandError(output, context);
397
- }
398
- const contents: DeleteEnvironmentCommandOutput = {
399
- $metadata: deserializeMetadata(output),
400
- };
401
- await collectBody(output.body, context);
402
- return Promise.resolve(contents);
403
- };
404
-
405
- const deserializeAws_restJson1DeleteEnvironmentCommandError = async (
406
- output: __HttpResponse,
407
- context: __SerdeContext
408
- ): Promise<DeleteEnvironmentCommandOutput> => {
409
- const parsedOutput: any = {
410
- ...output,
411
- body: await parseBody(output.body, context),
412
- };
413
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
414
- let errorCode: string = "UnknownError";
415
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
416
- switch (errorCode) {
417
- case "AccessDeniedException":
418
- case "com.amazonaws.finspace#AccessDeniedException":
419
- response = {
420
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
421
- name: errorCode,
422
- $metadata: deserializeMetadata(output),
423
- };
424
- break;
425
- case "InternalServerException":
426
- case "com.amazonaws.finspace#InternalServerException":
427
- response = {
428
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
429
- name: errorCode,
430
- $metadata: deserializeMetadata(output),
431
- };
432
- break;
433
- case "ResourceNotFoundException":
434
- case "com.amazonaws.finspace#ResourceNotFoundException":
435
- response = {
436
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
437
- name: errorCode,
438
- $metadata: deserializeMetadata(output),
439
- };
440
- break;
441
- case "ThrottlingException":
442
- case "com.amazonaws.finspace#ThrottlingException":
443
- response = {
444
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
445
- name: errorCode,
446
- $metadata: deserializeMetadata(output),
447
- };
448
- break;
449
- case "ValidationException":
450
- case "com.amazonaws.finspace#ValidationException":
451
- response = {
452
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
453
- name: errorCode,
454
- $metadata: deserializeMetadata(output),
455
- };
456
- break;
457
- default:
458
- const parsedBody = parsedOutput.body;
459
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
460
- response = {
461
- ...parsedBody,
462
- name: `${errorCode}`,
463
- message: parsedBody.message || parsedBody.Message || errorCode,
464
- $fault: "client",
465
- $metadata: deserializeMetadata(output),
466
- } as any;
467
- }
468
- const message = response.message || response.Message || errorCode;
469
- response.message = message;
470
- delete response.Message;
471
- return Promise.reject(Object.assign(new Error(message), response));
472
- };
473
-
474
- export const deserializeAws_restJson1GetEnvironmentCommand = async (
475
- output: __HttpResponse,
476
- context: __SerdeContext
477
- ): Promise<GetEnvironmentCommandOutput> => {
478
- if (output.statusCode !== 200 && output.statusCode >= 300) {
479
- return deserializeAws_restJson1GetEnvironmentCommandError(output, context);
480
- }
481
- const contents: GetEnvironmentCommandOutput = {
482
- $metadata: deserializeMetadata(output),
483
- environment: undefined,
484
- };
485
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
486
- if (data.environment !== undefined && data.environment !== null) {
487
- contents.environment = deserializeAws_restJson1Environment(data.environment, context);
488
- }
489
- return Promise.resolve(contents);
490
- };
491
-
492
- const deserializeAws_restJson1GetEnvironmentCommandError = async (
493
- output: __HttpResponse,
494
- context: __SerdeContext
495
- ): Promise<GetEnvironmentCommandOutput> => {
496
- const parsedOutput: any = {
497
- ...output,
498
- body: await parseBody(output.body, context),
499
- };
500
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
501
- let errorCode: string = "UnknownError";
502
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
503
- switch (errorCode) {
504
- case "AccessDeniedException":
505
- case "com.amazonaws.finspace#AccessDeniedException":
506
- response = {
507
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
508
- name: errorCode,
509
- $metadata: deserializeMetadata(output),
510
- };
511
- break;
512
- case "InternalServerException":
513
- case "com.amazonaws.finspace#InternalServerException":
514
- response = {
515
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
516
- name: errorCode,
517
- $metadata: deserializeMetadata(output),
518
- };
519
- break;
520
- case "ResourceNotFoundException":
521
- case "com.amazonaws.finspace#ResourceNotFoundException":
522
- response = {
523
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
524
- name: errorCode,
525
- $metadata: deserializeMetadata(output),
526
- };
527
- break;
528
- case "ValidationException":
529
- case "com.amazonaws.finspace#ValidationException":
530
- response = {
531
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
532
- name: errorCode,
533
- $metadata: deserializeMetadata(output),
534
- };
535
- break;
536
- default:
537
- const parsedBody = parsedOutput.body;
538
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
539
- response = {
540
- ...parsedBody,
541
- name: `${errorCode}`,
542
- message: parsedBody.message || parsedBody.Message || errorCode,
543
- $fault: "client",
544
- $metadata: deserializeMetadata(output),
545
- } as any;
546
- }
547
- const message = response.message || response.Message || errorCode;
548
- response.message = message;
549
- delete response.Message;
550
- return Promise.reject(Object.assign(new Error(message), response));
551
- };
552
-
553
- export const deserializeAws_restJson1ListEnvironmentsCommand = async (
554
- output: __HttpResponse,
555
- context: __SerdeContext
556
- ): Promise<ListEnvironmentsCommandOutput> => {
557
- if (output.statusCode !== 200 && output.statusCode >= 300) {
558
- return deserializeAws_restJson1ListEnvironmentsCommandError(output, context);
559
- }
560
- const contents: ListEnvironmentsCommandOutput = {
561
- $metadata: deserializeMetadata(output),
562
- environments: undefined,
563
- nextToken: undefined,
564
- };
565
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
566
- if (data.environments !== undefined && data.environments !== null) {
567
- contents.environments = deserializeAws_restJson1EnvironmentList(data.environments, context);
568
- }
569
- if (data.nextToken !== undefined && data.nextToken !== null) {
570
- contents.nextToken = __expectString(data.nextToken);
571
- }
572
- return Promise.resolve(contents);
573
- };
574
-
575
- const deserializeAws_restJson1ListEnvironmentsCommandError = async (
576
- output: __HttpResponse,
577
- context: __SerdeContext
578
- ): Promise<ListEnvironmentsCommandOutput> => {
579
- const parsedOutput: any = {
580
- ...output,
581
- body: await parseBody(output.body, context),
582
- };
583
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
584
- let errorCode: string = "UnknownError";
585
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
586
- switch (errorCode) {
587
- case "InternalServerException":
588
- case "com.amazonaws.finspace#InternalServerException":
589
- response = {
590
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
591
- name: errorCode,
592
- $metadata: deserializeMetadata(output),
593
- };
594
- break;
595
- case "ValidationException":
596
- case "com.amazonaws.finspace#ValidationException":
597
- response = {
598
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
599
- name: errorCode,
600
- $metadata: deserializeMetadata(output),
601
- };
602
- break;
603
- default:
604
- const parsedBody = parsedOutput.body;
605
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
606
- response = {
607
- ...parsedBody,
608
- name: `${errorCode}`,
609
- message: parsedBody.message || parsedBody.Message || errorCode,
610
- $fault: "client",
611
- $metadata: deserializeMetadata(output),
612
- } as any;
613
- }
614
- const message = response.message || response.Message || errorCode;
615
- response.message = message;
616
- delete response.Message;
617
- return Promise.reject(Object.assign(new Error(message), response));
618
- };
619
-
620
- export const deserializeAws_restJson1ListTagsForResourceCommand = async (
621
- output: __HttpResponse,
622
- context: __SerdeContext
623
- ): Promise<ListTagsForResourceCommandOutput> => {
624
- if (output.statusCode !== 200 && output.statusCode >= 300) {
625
- return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
626
- }
627
- const contents: ListTagsForResourceCommandOutput = {
628
- $metadata: deserializeMetadata(output),
629
- tags: undefined,
630
- };
631
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
632
- if (data.tags !== undefined && data.tags !== null) {
633
- contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
634
- }
635
- return Promise.resolve(contents);
636
- };
637
-
638
- const deserializeAws_restJson1ListTagsForResourceCommandError = async (
639
- output: __HttpResponse,
640
- context: __SerdeContext
641
- ): Promise<ListTagsForResourceCommandOutput> => {
642
- const parsedOutput: any = {
643
- ...output,
644
- body: await parseBody(output.body, context),
645
- };
646
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
647
- let errorCode: string = "UnknownError";
648
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
649
- switch (errorCode) {
650
- case "InternalServerException":
651
- case "com.amazonaws.finspace#InternalServerException":
652
- response = {
653
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
654
- name: errorCode,
655
- $metadata: deserializeMetadata(output),
656
- };
657
- break;
658
- case "InvalidRequestException":
659
- case "com.amazonaws.finspace#InvalidRequestException":
660
- response = {
661
- ...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
662
- name: errorCode,
663
- $metadata: deserializeMetadata(output),
664
- };
665
- break;
666
- case "ResourceNotFoundException":
667
- case "com.amazonaws.finspace#ResourceNotFoundException":
668
- response = {
669
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
670
- name: errorCode,
671
- $metadata: deserializeMetadata(output),
672
- };
673
- break;
674
- default:
675
- const parsedBody = parsedOutput.body;
676
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
677
- response = {
678
- ...parsedBody,
679
- name: `${errorCode}`,
680
- message: parsedBody.message || parsedBody.Message || errorCode,
681
- $fault: "client",
682
- $metadata: deserializeMetadata(output),
683
- } as any;
684
- }
685
- const message = response.message || response.Message || errorCode;
686
- response.message = message;
687
- delete response.Message;
688
- return Promise.reject(Object.assign(new Error(message), response));
689
- };
690
-
691
- export const deserializeAws_restJson1TagResourceCommand = async (
692
- output: __HttpResponse,
693
- context: __SerdeContext
694
- ): Promise<TagResourceCommandOutput> => {
695
- if (output.statusCode !== 200 && output.statusCode >= 300) {
696
- return deserializeAws_restJson1TagResourceCommandError(output, context);
697
- }
698
- const contents: TagResourceCommandOutput = {
699
- $metadata: deserializeMetadata(output),
700
- };
701
- await collectBody(output.body, context);
702
- return Promise.resolve(contents);
703
- };
704
-
705
- const deserializeAws_restJson1TagResourceCommandError = async (
706
- output: __HttpResponse,
707
- context: __SerdeContext
708
- ): Promise<TagResourceCommandOutput> => {
709
- const parsedOutput: any = {
710
- ...output,
711
- body: await parseBody(output.body, context),
712
- };
713
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
714
- let errorCode: string = "UnknownError";
715
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
716
- switch (errorCode) {
717
- case "InternalServerException":
718
- case "com.amazonaws.finspace#InternalServerException":
719
- response = {
720
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
721
- name: errorCode,
722
- $metadata: deserializeMetadata(output),
723
- };
724
- break;
725
- case "InvalidRequestException":
726
- case "com.amazonaws.finspace#InvalidRequestException":
727
- response = {
728
- ...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
729
- name: errorCode,
730
- $metadata: deserializeMetadata(output),
731
- };
732
- break;
733
- case "ResourceNotFoundException":
734
- case "com.amazonaws.finspace#ResourceNotFoundException":
735
- response = {
736
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
737
- name: errorCode,
738
- $metadata: deserializeMetadata(output),
739
- };
740
- break;
741
- default:
742
- const parsedBody = parsedOutput.body;
743
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
744
- response = {
745
- ...parsedBody,
746
- name: `${errorCode}`,
747
- message: parsedBody.message || parsedBody.Message || errorCode,
748
- $fault: "client",
749
- $metadata: deserializeMetadata(output),
750
- } as any;
751
- }
752
- const message = response.message || response.Message || errorCode;
753
- response.message = message;
754
- delete response.Message;
755
- return Promise.reject(Object.assign(new Error(message), response));
756
- };
757
-
758
- export const deserializeAws_restJson1UntagResourceCommand = async (
759
- output: __HttpResponse,
760
- context: __SerdeContext
761
- ): Promise<UntagResourceCommandOutput> => {
762
- if (output.statusCode !== 200 && output.statusCode >= 300) {
763
- return deserializeAws_restJson1UntagResourceCommandError(output, context);
764
- }
765
- const contents: UntagResourceCommandOutput = {
766
- $metadata: deserializeMetadata(output),
767
- };
768
- await collectBody(output.body, context);
769
- return Promise.resolve(contents);
770
- };
771
-
772
- const deserializeAws_restJson1UntagResourceCommandError = async (
773
- output: __HttpResponse,
774
- context: __SerdeContext
775
- ): Promise<UntagResourceCommandOutput> => {
776
- const parsedOutput: any = {
777
- ...output,
778
- body: await parseBody(output.body, context),
779
- };
780
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
781
- let errorCode: string = "UnknownError";
782
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
783
- switch (errorCode) {
784
- case "InternalServerException":
785
- case "com.amazonaws.finspace#InternalServerException":
786
- response = {
787
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
788
- name: errorCode,
789
- $metadata: deserializeMetadata(output),
790
- };
791
- break;
792
- case "InvalidRequestException":
793
- case "com.amazonaws.finspace#InvalidRequestException":
794
- response = {
795
- ...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
796
- name: errorCode,
797
- $metadata: deserializeMetadata(output),
798
- };
799
- break;
800
- case "ResourceNotFoundException":
801
- case "com.amazonaws.finspace#ResourceNotFoundException":
802
- response = {
803
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
804
- name: errorCode,
805
- $metadata: deserializeMetadata(output),
806
- };
807
- break;
808
- default:
809
- const parsedBody = parsedOutput.body;
810
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
811
- response = {
812
- ...parsedBody,
813
- name: `${errorCode}`,
814
- message: parsedBody.message || parsedBody.Message || errorCode,
815
- $fault: "client",
816
- $metadata: deserializeMetadata(output),
817
- } as any;
818
- }
819
- const message = response.message || response.Message || errorCode;
820
- response.message = message;
821
- delete response.Message;
822
- return Promise.reject(Object.assign(new Error(message), response));
823
- };
824
-
825
- export const deserializeAws_restJson1UpdateEnvironmentCommand = async (
826
- output: __HttpResponse,
827
- context: __SerdeContext
828
- ): Promise<UpdateEnvironmentCommandOutput> => {
829
- if (output.statusCode !== 200 && output.statusCode >= 300) {
830
- return deserializeAws_restJson1UpdateEnvironmentCommandError(output, context);
831
- }
832
- const contents: UpdateEnvironmentCommandOutput = {
833
- $metadata: deserializeMetadata(output),
834
- environment: undefined,
835
- };
836
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
837
- if (data.environment !== undefined && data.environment !== null) {
838
- contents.environment = deserializeAws_restJson1Environment(data.environment, context);
839
- }
840
- return Promise.resolve(contents);
841
- };
842
-
843
- const deserializeAws_restJson1UpdateEnvironmentCommandError = async (
844
- output: __HttpResponse,
845
- context: __SerdeContext
846
- ): Promise<UpdateEnvironmentCommandOutput> => {
847
- const parsedOutput: any = {
848
- ...output,
849
- body: await parseBody(output.body, context),
850
- };
851
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
852
- let errorCode: string = "UnknownError";
853
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
854
- switch (errorCode) {
855
- case "AccessDeniedException":
856
- case "com.amazonaws.finspace#AccessDeniedException":
857
- response = {
858
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
859
- name: errorCode,
860
- $metadata: deserializeMetadata(output),
861
- };
862
- break;
863
- case "InternalServerException":
864
- case "com.amazonaws.finspace#InternalServerException":
865
- response = {
866
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
867
- name: errorCode,
868
- $metadata: deserializeMetadata(output),
869
- };
870
- break;
871
- case "ResourceNotFoundException":
872
- case "com.amazonaws.finspace#ResourceNotFoundException":
873
- response = {
874
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
875
- name: errorCode,
876
- $metadata: deserializeMetadata(output),
877
- };
878
- break;
879
- case "ThrottlingException":
880
- case "com.amazonaws.finspace#ThrottlingException":
881
- response = {
882
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
883
- name: errorCode,
884
- $metadata: deserializeMetadata(output),
885
- };
886
- break;
887
- case "ValidationException":
888
- case "com.amazonaws.finspace#ValidationException":
889
- response = {
890
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
891
- name: errorCode,
892
- $metadata: deserializeMetadata(output),
893
- };
894
- break;
895
- default:
896
- const parsedBody = parsedOutput.body;
897
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
898
- response = {
899
- ...parsedBody,
900
- name: `${errorCode}`,
901
- message: parsedBody.message || parsedBody.Message || errorCode,
902
- $fault: "client",
903
- $metadata: deserializeMetadata(output),
904
- } as any;
905
- }
906
- const message = response.message || response.Message || errorCode;
907
- response.message = message;
908
- delete response.Message;
909
- return Promise.reject(Object.assign(new Error(message), response));
910
- };
911
-
912
- const deserializeAws_restJson1AccessDeniedExceptionResponse = async (
913
- parsedOutput: any,
914
- context: __SerdeContext
915
- ): Promise<AccessDeniedException> => {
916
- const contents: AccessDeniedException = {
917
- name: "AccessDeniedException",
918
- $fault: "client",
919
- $metadata: deserializeMetadata(parsedOutput),
920
- };
921
- const data: any = parsedOutput.body;
922
- return contents;
923
- };
924
-
925
- const deserializeAws_restJson1InternalServerExceptionResponse = async (
926
- parsedOutput: any,
927
- context: __SerdeContext
928
- ): Promise<InternalServerException> => {
929
- const contents: InternalServerException = {
930
- name: "InternalServerException",
931
- $fault: "server",
932
- $metadata: deserializeMetadata(parsedOutput),
933
- message: undefined,
934
- };
935
- const data: any = parsedOutput.body;
936
- if (data.message !== undefined && data.message !== null) {
937
- contents.message = __expectString(data.message);
938
- }
939
- return contents;
940
- };
941
-
942
- const deserializeAws_restJson1InvalidRequestExceptionResponse = async (
943
- parsedOutput: any,
944
- context: __SerdeContext
945
- ): Promise<InvalidRequestException> => {
946
- const contents: InvalidRequestException = {
947
- name: "InvalidRequestException",
948
- $fault: "client",
949
- $metadata: deserializeMetadata(parsedOutput),
950
- message: undefined,
951
- };
952
- const data: any = parsedOutput.body;
953
- if (data.message !== undefined && data.message !== null) {
954
- contents.message = __expectString(data.message);
955
- }
956
- return contents;
957
- };
958
-
959
- const deserializeAws_restJson1LimitExceededExceptionResponse = async (
960
- parsedOutput: any,
961
- context: __SerdeContext
962
- ): Promise<LimitExceededException> => {
963
- const contents: LimitExceededException = {
964
- name: "LimitExceededException",
965
- $fault: "client",
966
- $metadata: deserializeMetadata(parsedOutput),
967
- message: undefined,
968
- };
969
- const data: any = parsedOutput.body;
970
- if (data.message !== undefined && data.message !== null) {
971
- contents.message = __expectString(data.message);
972
- }
973
- return contents;
974
- };
975
-
976
- const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (
977
- parsedOutput: any,
978
- context: __SerdeContext
979
- ): Promise<ResourceNotFoundException> => {
980
- const contents: ResourceNotFoundException = {
981
- name: "ResourceNotFoundException",
982
- $fault: "client",
983
- $metadata: deserializeMetadata(parsedOutput),
984
- message: undefined,
985
- };
986
- const data: any = parsedOutput.body;
987
- if (data.message !== undefined && data.message !== null) {
988
- contents.message = __expectString(data.message);
989
- }
990
- return contents;
991
- };
992
-
993
- const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (
994
- parsedOutput: any,
995
- context: __SerdeContext
996
- ): Promise<ServiceQuotaExceededException> => {
997
- const contents: ServiceQuotaExceededException = {
998
- name: "ServiceQuotaExceededException",
999
- $fault: "client",
1000
- $metadata: deserializeMetadata(parsedOutput),
1001
- message: undefined,
1002
- };
1003
- const data: any = parsedOutput.body;
1004
- if (data.message !== undefined && data.message !== null) {
1005
- contents.message = __expectString(data.message);
1006
- }
1007
- return contents;
1008
- };
1009
-
1010
- const deserializeAws_restJson1ThrottlingExceptionResponse = async (
1011
- parsedOutput: any,
1012
- context: __SerdeContext
1013
- ): Promise<ThrottlingException> => {
1014
- const contents: ThrottlingException = {
1015
- name: "ThrottlingException",
1016
- $fault: "client",
1017
- $metadata: deserializeMetadata(parsedOutput),
1018
- };
1019
- const data: any = parsedOutput.body;
1020
- return contents;
1021
- };
1022
-
1023
- const deserializeAws_restJson1ValidationExceptionResponse = async (
1024
- parsedOutput: any,
1025
- context: __SerdeContext
1026
- ): Promise<ValidationException> => {
1027
- const contents: ValidationException = {
1028
- name: "ValidationException",
1029
- $fault: "client",
1030
- $metadata: deserializeMetadata(parsedOutput),
1031
- message: undefined,
1032
- };
1033
- const data: any = parsedOutput.body;
1034
- if (data.message !== undefined && data.message !== null) {
1035
- contents.message = __expectString(data.message);
1036
- }
1037
- return contents;
1038
- };
1039
-
1040
- const serializeAws_restJson1AttributeMap = (input: { [key: string]: string }, context: __SerdeContext): any => {
1041
- return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
1042
- if (value === null) {
1043
- return acc;
1044
- }
1045
- return {
1046
- ...acc,
1047
- [key]: value,
1048
- };
1049
- }, {});
1050
- };
1051
-
1052
- const serializeAws_restJson1FederationParameters = (input: FederationParameters, context: __SerdeContext): any => {
1053
- return {
1054
- ...(input.applicationCallBackURL !== undefined &&
1055
- input.applicationCallBackURL !== null && { applicationCallBackURL: input.applicationCallBackURL }),
1056
- ...(input.attributeMap !== undefined &&
1057
- input.attributeMap !== null && { attributeMap: serializeAws_restJson1AttributeMap(input.attributeMap, context) }),
1058
- ...(input.federationProviderName !== undefined &&
1059
- input.federationProviderName !== null && { federationProviderName: input.federationProviderName }),
1060
- ...(input.federationURN !== undefined && input.federationURN !== null && { federationURN: input.federationURN }),
1061
- ...(input.samlMetadataDocument !== undefined &&
1062
- input.samlMetadataDocument !== null && { samlMetadataDocument: input.samlMetadataDocument }),
1063
- ...(input.samlMetadataURL !== undefined &&
1064
- input.samlMetadataURL !== null && { samlMetadataURL: input.samlMetadataURL }),
1065
- };
1066
- };
1067
-
1068
- const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => {
1069
- return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
1070
- if (value === null) {
1071
- return acc;
1072
- }
1073
- return {
1074
- ...acc,
1075
- [key]: value,
1076
- };
1077
- }, {});
1078
- };
1079
-
1080
- const deserializeAws_restJson1AttributeMap = (output: any, context: __SerdeContext): { [key: string]: string } => {
1081
- return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {
1082
- if (value === null) {
1083
- return acc;
1084
- }
1085
- return {
1086
- ...acc,
1087
- [key]: __expectString(value) as any,
1088
- };
1089
- }, {});
1090
- };
1091
-
1092
- const deserializeAws_restJson1Environment = (output: any, context: __SerdeContext): Environment => {
1093
- return {
1094
- awsAccountId: __expectString(output.awsAccountId),
1095
- dedicatedServiceAccountId: __expectString(output.dedicatedServiceAccountId),
1096
- description: __expectString(output.description),
1097
- environmentArn: __expectString(output.environmentArn),
1098
- environmentId: __expectString(output.environmentId),
1099
- environmentUrl: __expectString(output.environmentUrl),
1100
- federationMode: __expectString(output.federationMode),
1101
- federationParameters:
1102
- output.federationParameters !== undefined && output.federationParameters !== null
1103
- ? deserializeAws_restJson1FederationParameters(output.federationParameters, context)
1104
- : undefined,
1105
- kmsKeyId: __expectString(output.kmsKeyId),
1106
- name: __expectString(output.name),
1107
- sageMakerStudioDomainUrl: __expectString(output.sageMakerStudioDomainUrl),
1108
- status: __expectString(output.status),
1109
- } as any;
1110
- };
1111
-
1112
- const deserializeAws_restJson1EnvironmentList = (output: any, context: __SerdeContext): Environment[] => {
1113
- return (output || [])
1114
- .filter((e: any) => e != null)
1115
- .map((entry: any) => {
1116
- if (entry === null) {
1117
- return null as any;
1118
- }
1119
- return deserializeAws_restJson1Environment(entry, context);
1120
- });
1121
- };
1122
-
1123
- const deserializeAws_restJson1FederationParameters = (output: any, context: __SerdeContext): FederationParameters => {
1124
- return {
1125
- applicationCallBackURL: __expectString(output.applicationCallBackURL),
1126
- attributeMap:
1127
- output.attributeMap !== undefined && output.attributeMap !== null
1128
- ? deserializeAws_restJson1AttributeMap(output.attributeMap, context)
1129
- : undefined,
1130
- federationProviderName: __expectString(output.federationProviderName),
1131
- federationURN: __expectString(output.federationURN),
1132
- samlMetadataDocument: __expectString(output.samlMetadataDocument),
1133
- samlMetadataURL: __expectString(output.samlMetadataURL),
1134
- } as any;
1135
- };
1136
-
1137
- const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => {
1138
- return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {
1139
- if (value === null) {
1140
- return acc;
1141
- }
1142
- return {
1143
- ...acc,
1144
- [key]: __expectString(value) as any,
1145
- };
1146
- }, {});
1147
- };
1148
-
1149
- const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
1150
- httpStatusCode: output.statusCode,
1151
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
1152
- extendedRequestId: output.headers["x-amz-id-2"],
1153
- cfId: output.headers["x-amz-cf-id"],
1154
- });
1155
-
1156
- // Collect low-level response body stream to Uint8Array.
1157
- const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
1158
- if (streamBody instanceof Uint8Array) {
1159
- return Promise.resolve(streamBody);
1160
- }
1161
- return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1162
- };
1163
-
1164
- // Encode Uint8Array data into string with utf-8.
1165
- const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
1166
- collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1167
-
1168
- const isSerializableHeaderValue = (value: any): boolean =>
1169
- value !== undefined &&
1170
- value !== null &&
1171
- value !== "" &&
1172
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1173
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1174
-
1175
- const parseBody = (streamBody: any, context: __SerdeContext): any =>
1176
- collectBodyString(streamBody, context).then((encoded) => {
1177
- if (encoded.length) {
1178
- return JSON.parse(encoded);
1179
- }
1180
- return {};
1181
- });
1182
-
1183
- /**
1184
- * Load an error code for the aws.rest-json-1.1 protocol.
1185
- */
1186
- const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => {
1187
- const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1188
-
1189
- const sanitizeErrorCode = (rawValue: string): string => {
1190
- let cleanValue = rawValue;
1191
- if (cleanValue.indexOf(":") >= 0) {
1192
- cleanValue = cleanValue.split(":")[0];
1193
- }
1194
- if (cleanValue.indexOf("#") >= 0) {
1195
- cleanValue = cleanValue.split("#")[1];
1196
- }
1197
- return cleanValue;
1198
- };
1199
-
1200
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1201
- if (headerKey !== undefined) {
1202
- return sanitizeErrorCode(output.headers[headerKey]);
1203
- }
1204
-
1205
- if (data.code !== undefined) {
1206
- return sanitizeErrorCode(data.code);
1207
- }
1208
-
1209
- if (data["__type"] !== undefined) {
1210
- return sanitizeErrorCode(data["__type"]);
1211
- }
1212
-
1213
- return "";
1214
- };