@aws-sdk/client-finspace 3.183.0 → 3.185.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.
@@ -1,657 +1,877 @@
1
+ import { __assign, __awaiter, __generator, __read } from "tslib";
1
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
3
  import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
3
4
  import { FinspaceServiceException as __BaseException } from "../models/FinspaceServiceException";
4
5
  import { AccessDeniedException, InternalServerException, InvalidRequestException, LimitExceededException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
5
- export const serializeAws_restJson1CreateEnvironmentCommand = async (input, context) => {
6
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
7
- const headers = {
8
- "content-type": "application/json",
9
- };
10
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/environment";
11
- let body;
12
- body = JSON.stringify({
13
- ...(input.dataBundles != null && { dataBundles: serializeAws_restJson1DataBundleArns(input.dataBundles, context) }),
14
- ...(input.description != null && { description: input.description }),
15
- ...(input.federationMode != null && { federationMode: input.federationMode }),
16
- ...(input.federationParameters != null && {
17
- federationParameters: serializeAws_restJson1FederationParameters(input.federationParameters, context),
18
- }),
19
- ...(input.kmsKeyId != null && { kmsKeyId: input.kmsKeyId }),
20
- ...(input.name != null && { name: input.name }),
21
- ...(input.superuserParameters != null && {
22
- superuserParameters: serializeAws_restJson1SuperuserParameters(input.superuserParameters, context),
23
- }),
24
- ...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
25
- });
26
- return new __HttpRequest({
27
- protocol,
28
- hostname,
29
- port,
30
- method: "POST",
31
- headers,
32
- path: resolvedPath,
33
- body,
6
+ export var serializeAws_restJson1CreateEnvironmentCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
8
+ return __generator(this, function (_c) {
9
+ switch (_c.label) {
10
+ case 0: return [4, context.endpoint()];
11
+ case 1:
12
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
13
+ headers = {
14
+ "content-type": "application/json",
15
+ };
16
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/environment";
17
+ body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.dataBundles != null && { dataBundles: serializeAws_restJson1DataBundleArns(input.dataBundles, context) })), (input.description != null && { description: input.description })), (input.federationMode != null && { federationMode: input.federationMode })), (input.federationParameters != null && {
18
+ federationParameters: serializeAws_restJson1FederationParameters(input.federationParameters, context),
19
+ })), (input.kmsKeyId != null && { kmsKeyId: input.kmsKeyId })), (input.name != null && { name: input.name })), (input.superuserParameters != null && {
20
+ superuserParameters: serializeAws_restJson1SuperuserParameters(input.superuserParameters, context),
21
+ })), (input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) })));
22
+ return [2, new __HttpRequest({
23
+ protocol: protocol,
24
+ hostname: hostname,
25
+ port: port,
26
+ method: "POST",
27
+ headers: headers,
28
+ path: resolvedPath,
29
+ body: body,
30
+ })];
31
+ }
34
32
  });
35
- };
36
- export const serializeAws_restJson1DeleteEnvironmentCommand = async (input, context) => {
37
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
38
- const headers = {};
39
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/environment/{environmentId}";
40
- resolvedPath = __resolvedPath(resolvedPath, input, "environmentId", () => input.environmentId, "{environmentId}", false);
41
- let body;
42
- return new __HttpRequest({
43
- protocol,
44
- hostname,
45
- port,
46
- method: "DELETE",
47
- headers,
48
- path: resolvedPath,
49
- body,
33
+ }); };
34
+ export var serializeAws_restJson1DeleteEnvironmentCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
35
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
36
+ return __generator(this, function (_c) {
37
+ switch (_c.label) {
38
+ case 0: return [4, context.endpoint()];
39
+ case 1:
40
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
41
+ headers = {};
42
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/environment/{environmentId}";
43
+ resolvedPath = __resolvedPath(resolvedPath, input, "environmentId", function () { return input.environmentId; }, "{environmentId}", false);
44
+ return [2, new __HttpRequest({
45
+ protocol: protocol,
46
+ hostname: hostname,
47
+ port: port,
48
+ method: "DELETE",
49
+ headers: headers,
50
+ path: resolvedPath,
51
+ body: body,
52
+ })];
53
+ }
50
54
  });
51
- };
52
- export const serializeAws_restJson1GetEnvironmentCommand = async (input, context) => {
53
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
54
- const headers = {};
55
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/environment/{environmentId}";
56
- resolvedPath = __resolvedPath(resolvedPath, input, "environmentId", () => input.environmentId, "{environmentId}", false);
57
- let body;
58
- return new __HttpRequest({
59
- protocol,
60
- hostname,
61
- port,
62
- method: "GET",
63
- headers,
64
- path: resolvedPath,
65
- body,
55
+ }); };
56
+ export var serializeAws_restJson1GetEnvironmentCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
57
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
58
+ return __generator(this, function (_c) {
59
+ switch (_c.label) {
60
+ case 0: return [4, context.endpoint()];
61
+ case 1:
62
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
63
+ headers = {};
64
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/environment/{environmentId}";
65
+ resolvedPath = __resolvedPath(resolvedPath, input, "environmentId", function () { return input.environmentId; }, "{environmentId}", false);
66
+ return [2, new __HttpRequest({
67
+ protocol: protocol,
68
+ hostname: hostname,
69
+ port: port,
70
+ method: "GET",
71
+ headers: headers,
72
+ path: resolvedPath,
73
+ body: body,
74
+ })];
75
+ }
66
76
  });
67
- };
68
- export const serializeAws_restJson1ListEnvironmentsCommand = async (input, context) => {
69
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
70
- const headers = {};
71
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/environment";
72
- const query = map({
73
- nextToken: [, input.nextToken],
74
- maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
75
- });
76
- let body;
77
- return new __HttpRequest({
78
- protocol,
79
- hostname,
80
- port,
81
- method: "GET",
82
- headers,
83
- path: resolvedPath,
84
- query,
85
- body,
77
+ }); };
78
+ export var serializeAws_restJson1ListEnvironmentsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
79
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
80
+ return __generator(this, function (_c) {
81
+ switch (_c.label) {
82
+ case 0: return [4, context.endpoint()];
83
+ case 1:
84
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
85
+ headers = {};
86
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/environment";
87
+ query = map({
88
+ nextToken: [, input.nextToken],
89
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
90
+ });
91
+ return [2, new __HttpRequest({
92
+ protocol: protocol,
93
+ hostname: hostname,
94
+ port: port,
95
+ method: "GET",
96
+ headers: headers,
97
+ path: resolvedPath,
98
+ query: query,
99
+ body: body,
100
+ })];
101
+ }
86
102
  });
87
- };
88
- export const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
89
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
90
- const headers = {};
91
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
92
- resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
93
- let body;
94
- return new __HttpRequest({
95
- protocol,
96
- hostname,
97
- port,
98
- method: "GET",
99
- headers,
100
- path: resolvedPath,
101
- body,
103
+ }); };
104
+ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
105
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
106
+ return __generator(this, function (_c) {
107
+ switch (_c.label) {
108
+ case 0: return [4, context.endpoint()];
109
+ case 1:
110
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
111
+ headers = {};
112
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
113
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
114
+ return [2, new __HttpRequest({
115
+ protocol: protocol,
116
+ hostname: hostname,
117
+ port: port,
118
+ method: "GET",
119
+ headers: headers,
120
+ path: resolvedPath,
121
+ body: body,
122
+ })];
123
+ }
102
124
  });
103
- };
104
- export const serializeAws_restJson1TagResourceCommand = async (input, context) => {
105
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
106
- const headers = {
107
- "content-type": "application/json",
108
- };
109
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
110
- resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
111
- let body;
112
- body = JSON.stringify({
113
- ...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
114
- });
115
- return new __HttpRequest({
116
- protocol,
117
- hostname,
118
- port,
119
- method: "POST",
120
- headers,
121
- path: resolvedPath,
122
- body,
125
+ }); };
126
+ export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
127
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
128
+ return __generator(this, function (_c) {
129
+ switch (_c.label) {
130
+ case 0: return [4, context.endpoint()];
131
+ case 1:
132
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
133
+ headers = {
134
+ "content-type": "application/json",
135
+ };
136
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
137
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
138
+ body = JSON.stringify(__assign({}, (input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) })));
139
+ return [2, new __HttpRequest({
140
+ protocol: protocol,
141
+ hostname: hostname,
142
+ port: port,
143
+ method: "POST",
144
+ headers: headers,
145
+ path: resolvedPath,
146
+ body: body,
147
+ })];
148
+ }
123
149
  });
124
- };
125
- export const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
126
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
127
- const headers = {};
128
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
129
- resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
130
- const query = map({
131
- tagKeys: [() => input.tagKeys !== void 0, () => (input.tagKeys || []).map((_entry) => _entry)],
132
- });
133
- let body;
134
- return new __HttpRequest({
135
- protocol,
136
- hostname,
137
- port,
138
- method: "DELETE",
139
- headers,
140
- path: resolvedPath,
141
- query,
142
- body,
150
+ }); };
151
+ export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
152
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
153
+ return __generator(this, function (_c) {
154
+ switch (_c.label) {
155
+ case 0: return [4, context.endpoint()];
156
+ case 1:
157
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
158
+ headers = {};
159
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
160
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
161
+ query = map({
162
+ tagKeys: [function () { return input.tagKeys !== void 0; }, function () { return (input.tagKeys || []).map(function (_entry) { return _entry; }); }],
163
+ });
164
+ return [2, new __HttpRequest({
165
+ protocol: protocol,
166
+ hostname: hostname,
167
+ port: port,
168
+ method: "DELETE",
169
+ headers: headers,
170
+ path: resolvedPath,
171
+ query: query,
172
+ body: body,
173
+ })];
174
+ }
143
175
  });
144
- };
145
- export const serializeAws_restJson1UpdateEnvironmentCommand = async (input, context) => {
146
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
147
- const headers = {
148
- "content-type": "application/json",
149
- };
150
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/environment/{environmentId}";
151
- resolvedPath = __resolvedPath(resolvedPath, input, "environmentId", () => input.environmentId, "{environmentId}", false);
152
- let body;
153
- body = JSON.stringify({
154
- ...(input.description != null && { description: input.description }),
155
- ...(input.federationMode != null && { federationMode: input.federationMode }),
156
- ...(input.federationParameters != null && {
157
- federationParameters: serializeAws_restJson1FederationParameters(input.federationParameters, context),
158
- }),
159
- ...(input.name != null && { name: input.name }),
160
- });
161
- return new __HttpRequest({
162
- protocol,
163
- hostname,
164
- port,
165
- method: "PUT",
166
- headers,
167
- path: resolvedPath,
168
- body,
176
+ }); };
177
+ export var serializeAws_restJson1UpdateEnvironmentCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
178
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
179
+ return __generator(this, function (_c) {
180
+ switch (_c.label) {
181
+ case 0: return [4, context.endpoint()];
182
+ case 1:
183
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
184
+ headers = {
185
+ "content-type": "application/json",
186
+ };
187
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/environment/{environmentId}";
188
+ resolvedPath = __resolvedPath(resolvedPath, input, "environmentId", function () { return input.environmentId; }, "{environmentId}", false);
189
+ body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.description != null && { description: input.description })), (input.federationMode != null && { federationMode: input.federationMode })), (input.federationParameters != null && {
190
+ federationParameters: serializeAws_restJson1FederationParameters(input.federationParameters, context),
191
+ })), (input.name != null && { name: input.name })));
192
+ return [2, new __HttpRequest({
193
+ protocol: protocol,
194
+ hostname: hostname,
195
+ port: port,
196
+ method: "PUT",
197
+ headers: headers,
198
+ path: resolvedPath,
199
+ body: body,
200
+ })];
201
+ }
169
202
  });
170
- };
171
- export const deserializeAws_restJson1CreateEnvironmentCommand = async (output, context) => {
172
- if (output.statusCode !== 200 && output.statusCode >= 300) {
173
- return deserializeAws_restJson1CreateEnvironmentCommandError(output, context);
174
- }
175
- const contents = map({
176
- $metadata: deserializeMetadata(output),
203
+ }); };
204
+ export var deserializeAws_restJson1CreateEnvironmentCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
205
+ var contents, data, _a, _b;
206
+ return __generator(this, function (_c) {
207
+ switch (_c.label) {
208
+ case 0:
209
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
210
+ return [2, deserializeAws_restJson1CreateEnvironmentCommandError(output, context)];
211
+ }
212
+ contents = map({
213
+ $metadata: deserializeMetadata(output),
214
+ });
215
+ _a = __expectNonNull;
216
+ _b = __expectObject;
217
+ return [4, parseBody(output.body, context)];
218
+ case 1:
219
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
220
+ if (data.environmentArn != null) {
221
+ contents.environmentArn = __expectString(data.environmentArn);
222
+ }
223
+ if (data.environmentId != null) {
224
+ contents.environmentId = __expectString(data.environmentId);
225
+ }
226
+ if (data.environmentUrl != null) {
227
+ contents.environmentUrl = __expectString(data.environmentUrl);
228
+ }
229
+ return [2, contents];
230
+ }
177
231
  });
178
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
179
- if (data.environmentArn != null) {
180
- contents.environmentArn = __expectString(data.environmentArn);
181
- }
182
- if (data.environmentId != null) {
183
- contents.environmentId = __expectString(data.environmentId);
184
- }
185
- if (data.environmentUrl != null) {
186
- contents.environmentUrl = __expectString(data.environmentUrl);
187
- }
188
- return contents;
189
- };
190
- const deserializeAws_restJson1CreateEnvironmentCommandError = async (output, context) => {
191
- const parsedOutput = {
192
- ...output,
193
- body: await parseErrorBody(output.body, context),
194
- };
195
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
196
- switch (errorCode) {
197
- case "AccessDeniedException":
198
- case "com.amazonaws.finspace#AccessDeniedException":
199
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
200
- case "InternalServerException":
201
- case "com.amazonaws.finspace#InternalServerException":
202
- throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
203
- case "LimitExceededException":
204
- case "com.amazonaws.finspace#LimitExceededException":
205
- throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
206
- case "ServiceQuotaExceededException":
207
- case "com.amazonaws.finspace#ServiceQuotaExceededException":
208
- throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
209
- case "ThrottlingException":
210
- case "com.amazonaws.finspace#ThrottlingException":
211
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
212
- case "ValidationException":
213
- case "com.amazonaws.finspace#ValidationException":
214
- throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
215
- default:
216
- const parsedBody = parsedOutput.body;
217
- throwDefaultError({
218
- output,
219
- parsedBody,
220
- exceptionCtor: __BaseException,
221
- errorCode,
222
- });
223
- }
224
- };
225
- export const deserializeAws_restJson1DeleteEnvironmentCommand = async (output, context) => {
226
- if (output.statusCode !== 200 && output.statusCode >= 300) {
227
- return deserializeAws_restJson1DeleteEnvironmentCommandError(output, context);
228
- }
229
- const contents = map({
230
- $metadata: deserializeMetadata(output),
232
+ }); };
233
+ var deserializeAws_restJson1CreateEnvironmentCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
234
+ var parsedOutput, _a, errorCode, _b, parsedBody;
235
+ var _c;
236
+ return __generator(this, function (_d) {
237
+ switch (_d.label) {
238
+ case 0:
239
+ _a = [__assign({}, output)];
240
+ _c = {};
241
+ return [4, parseErrorBody(output.body, context)];
242
+ case 1:
243
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
244
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
245
+ _b = errorCode;
246
+ switch (_b) {
247
+ case "AccessDeniedException": return [3, 2];
248
+ case "com.amazonaws.finspace#AccessDeniedException": return [3, 2];
249
+ case "InternalServerException": return [3, 4];
250
+ case "com.amazonaws.finspace#InternalServerException": return [3, 4];
251
+ case "LimitExceededException": return [3, 6];
252
+ case "com.amazonaws.finspace#LimitExceededException": return [3, 6];
253
+ case "ServiceQuotaExceededException": return [3, 8];
254
+ case "com.amazonaws.finspace#ServiceQuotaExceededException": return [3, 8];
255
+ case "ThrottlingException": return [3, 10];
256
+ case "com.amazonaws.finspace#ThrottlingException": return [3, 10];
257
+ case "ValidationException": return [3, 12];
258
+ case "com.amazonaws.finspace#ValidationException": return [3, 12];
259
+ }
260
+ return [3, 14];
261
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
262
+ case 3: throw _d.sent();
263
+ case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
264
+ case 5: throw _d.sent();
265
+ case 6: return [4, deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)];
266
+ case 7: throw _d.sent();
267
+ case 8: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
268
+ case 9: throw _d.sent();
269
+ case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
270
+ case 11: throw _d.sent();
271
+ case 12: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
272
+ case 13: throw _d.sent();
273
+ case 14:
274
+ parsedBody = parsedOutput.body;
275
+ throwDefaultError({
276
+ output: output,
277
+ parsedBody: parsedBody,
278
+ exceptionCtor: __BaseException,
279
+ errorCode: errorCode,
280
+ });
281
+ _d.label = 15;
282
+ case 15: return [2];
283
+ }
231
284
  });
232
- await collectBody(output.body, context);
233
- return contents;
234
- };
235
- const deserializeAws_restJson1DeleteEnvironmentCommandError = async (output, context) => {
236
- const parsedOutput = {
237
- ...output,
238
- body: await parseErrorBody(output.body, context),
239
- };
240
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
241
- switch (errorCode) {
242
- case "AccessDeniedException":
243
- case "com.amazonaws.finspace#AccessDeniedException":
244
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
245
- case "InternalServerException":
246
- case "com.amazonaws.finspace#InternalServerException":
247
- throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
248
- case "ResourceNotFoundException":
249
- case "com.amazonaws.finspace#ResourceNotFoundException":
250
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
251
- case "ThrottlingException":
252
- case "com.amazonaws.finspace#ThrottlingException":
253
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
254
- case "ValidationException":
255
- case "com.amazonaws.finspace#ValidationException":
256
- throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
257
- default:
258
- const parsedBody = parsedOutput.body;
259
- throwDefaultError({
260
- output,
261
- parsedBody,
262
- exceptionCtor: __BaseException,
263
- errorCode,
264
- });
265
- }
266
- };
267
- export const deserializeAws_restJson1GetEnvironmentCommand = async (output, context) => {
268
- if (output.statusCode !== 200 && output.statusCode >= 300) {
269
- return deserializeAws_restJson1GetEnvironmentCommandError(output, context);
270
- }
271
- const contents = map({
272
- $metadata: deserializeMetadata(output),
285
+ }); };
286
+ export var deserializeAws_restJson1DeleteEnvironmentCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
287
+ var contents;
288
+ return __generator(this, function (_a) {
289
+ switch (_a.label) {
290
+ case 0:
291
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
292
+ return [2, deserializeAws_restJson1DeleteEnvironmentCommandError(output, context)];
293
+ }
294
+ contents = map({
295
+ $metadata: deserializeMetadata(output),
296
+ });
297
+ return [4, collectBody(output.body, context)];
298
+ case 1:
299
+ _a.sent();
300
+ return [2, contents];
301
+ }
273
302
  });
274
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
275
- if (data.environment != null) {
276
- contents.environment = deserializeAws_restJson1Environment(data.environment, context);
277
- }
278
- return contents;
279
- };
280
- const deserializeAws_restJson1GetEnvironmentCommandError = async (output, context) => {
281
- const parsedOutput = {
282
- ...output,
283
- body: await parseErrorBody(output.body, context),
284
- };
285
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
286
- switch (errorCode) {
287
- case "AccessDeniedException":
288
- case "com.amazonaws.finspace#AccessDeniedException":
289
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
290
- case "InternalServerException":
291
- case "com.amazonaws.finspace#InternalServerException":
292
- throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
293
- case "ResourceNotFoundException":
294
- case "com.amazonaws.finspace#ResourceNotFoundException":
295
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
296
- case "ValidationException":
297
- case "com.amazonaws.finspace#ValidationException":
298
- throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
299
- default:
300
- const parsedBody = parsedOutput.body;
301
- throwDefaultError({
302
- output,
303
- parsedBody,
304
- exceptionCtor: __BaseException,
305
- errorCode,
306
- });
307
- }
308
- };
309
- export const deserializeAws_restJson1ListEnvironmentsCommand = async (output, context) => {
310
- if (output.statusCode !== 200 && output.statusCode >= 300) {
311
- return deserializeAws_restJson1ListEnvironmentsCommandError(output, context);
312
- }
313
- const contents = map({
314
- $metadata: deserializeMetadata(output),
303
+ }); };
304
+ var deserializeAws_restJson1DeleteEnvironmentCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
305
+ var parsedOutput, _a, errorCode, _b, parsedBody;
306
+ var _c;
307
+ return __generator(this, function (_d) {
308
+ switch (_d.label) {
309
+ case 0:
310
+ _a = [__assign({}, output)];
311
+ _c = {};
312
+ return [4, parseErrorBody(output.body, context)];
313
+ case 1:
314
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
315
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
316
+ _b = errorCode;
317
+ switch (_b) {
318
+ case "AccessDeniedException": return [3, 2];
319
+ case "com.amazonaws.finspace#AccessDeniedException": return [3, 2];
320
+ case "InternalServerException": return [3, 4];
321
+ case "com.amazonaws.finspace#InternalServerException": return [3, 4];
322
+ case "ResourceNotFoundException": return [3, 6];
323
+ case "com.amazonaws.finspace#ResourceNotFoundException": return [3, 6];
324
+ case "ThrottlingException": return [3, 8];
325
+ case "com.amazonaws.finspace#ThrottlingException": return [3, 8];
326
+ case "ValidationException": return [3, 10];
327
+ case "com.amazonaws.finspace#ValidationException": return [3, 10];
328
+ }
329
+ return [3, 12];
330
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
331
+ case 3: throw _d.sent();
332
+ case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
333
+ case 5: throw _d.sent();
334
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
335
+ case 7: throw _d.sent();
336
+ case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
337
+ case 9: throw _d.sent();
338
+ case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
339
+ case 11: throw _d.sent();
340
+ case 12:
341
+ parsedBody = parsedOutput.body;
342
+ throwDefaultError({
343
+ output: output,
344
+ parsedBody: parsedBody,
345
+ exceptionCtor: __BaseException,
346
+ errorCode: errorCode,
347
+ });
348
+ _d.label = 13;
349
+ case 13: return [2];
350
+ }
315
351
  });
316
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
317
- if (data.environments != null) {
318
- contents.environments = deserializeAws_restJson1EnvironmentList(data.environments, context);
319
- }
320
- if (data.nextToken != null) {
321
- contents.nextToken = __expectString(data.nextToken);
322
- }
323
- return contents;
324
- };
325
- const deserializeAws_restJson1ListEnvironmentsCommandError = async (output, context) => {
326
- const parsedOutput = {
327
- ...output,
328
- body: await parseErrorBody(output.body, context),
329
- };
330
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
331
- switch (errorCode) {
332
- case "InternalServerException":
333
- case "com.amazonaws.finspace#InternalServerException":
334
- throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
335
- case "ValidationException":
336
- case "com.amazonaws.finspace#ValidationException":
337
- throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
338
- default:
339
- const parsedBody = parsedOutput.body;
340
- throwDefaultError({
341
- output,
342
- parsedBody,
343
- exceptionCtor: __BaseException,
344
- errorCode,
345
- });
346
- }
347
- };
348
- export const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
349
- if (output.statusCode !== 200 && output.statusCode >= 300) {
350
- return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
351
- }
352
- const contents = map({
353
- $metadata: deserializeMetadata(output),
352
+ }); };
353
+ export var deserializeAws_restJson1GetEnvironmentCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
354
+ var contents, data, _a, _b;
355
+ return __generator(this, function (_c) {
356
+ switch (_c.label) {
357
+ case 0:
358
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
359
+ return [2, deserializeAws_restJson1GetEnvironmentCommandError(output, context)];
360
+ }
361
+ contents = map({
362
+ $metadata: deserializeMetadata(output),
363
+ });
364
+ _a = __expectNonNull;
365
+ _b = __expectObject;
366
+ return [4, parseBody(output.body, context)];
367
+ case 1:
368
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
369
+ if (data.environment != null) {
370
+ contents.environment = deserializeAws_restJson1Environment(data.environment, context);
371
+ }
372
+ return [2, contents];
373
+ }
354
374
  });
355
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
356
- if (data.tags != null) {
357
- contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
358
- }
359
- return contents;
360
- };
361
- const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
362
- const parsedOutput = {
363
- ...output,
364
- body: await parseErrorBody(output.body, context),
365
- };
366
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
367
- switch (errorCode) {
368
- case "InternalServerException":
369
- case "com.amazonaws.finspace#InternalServerException":
370
- throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
371
- case "InvalidRequestException":
372
- case "com.amazonaws.finspace#InvalidRequestException":
373
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
374
- case "ResourceNotFoundException":
375
- case "com.amazonaws.finspace#ResourceNotFoundException":
376
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
377
- default:
378
- const parsedBody = parsedOutput.body;
379
- throwDefaultError({
380
- output,
381
- parsedBody,
382
- exceptionCtor: __BaseException,
383
- errorCode,
384
- });
385
- }
386
- };
387
- export const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
388
- if (output.statusCode !== 200 && output.statusCode >= 300) {
389
- return deserializeAws_restJson1TagResourceCommandError(output, context);
390
- }
391
- const contents = map({
392
- $metadata: deserializeMetadata(output),
375
+ }); };
376
+ var deserializeAws_restJson1GetEnvironmentCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
377
+ var parsedOutput, _a, errorCode, _b, parsedBody;
378
+ var _c;
379
+ return __generator(this, function (_d) {
380
+ switch (_d.label) {
381
+ case 0:
382
+ _a = [__assign({}, output)];
383
+ _c = {};
384
+ return [4, parseErrorBody(output.body, context)];
385
+ case 1:
386
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
387
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
388
+ _b = errorCode;
389
+ switch (_b) {
390
+ case "AccessDeniedException": return [3, 2];
391
+ case "com.amazonaws.finspace#AccessDeniedException": return [3, 2];
392
+ case "InternalServerException": return [3, 4];
393
+ case "com.amazonaws.finspace#InternalServerException": return [3, 4];
394
+ case "ResourceNotFoundException": return [3, 6];
395
+ case "com.amazonaws.finspace#ResourceNotFoundException": return [3, 6];
396
+ case "ValidationException": return [3, 8];
397
+ case "com.amazonaws.finspace#ValidationException": return [3, 8];
398
+ }
399
+ return [3, 10];
400
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
401
+ case 3: throw _d.sent();
402
+ case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
403
+ case 5: throw _d.sent();
404
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
405
+ case 7: throw _d.sent();
406
+ case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
407
+ case 9: throw _d.sent();
408
+ case 10:
409
+ parsedBody = parsedOutput.body;
410
+ throwDefaultError({
411
+ output: output,
412
+ parsedBody: parsedBody,
413
+ exceptionCtor: __BaseException,
414
+ errorCode: errorCode,
415
+ });
416
+ _d.label = 11;
417
+ case 11: return [2];
418
+ }
393
419
  });
394
- await collectBody(output.body, context);
395
- return contents;
396
- };
397
- const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
398
- const parsedOutput = {
399
- ...output,
400
- body: await parseErrorBody(output.body, context),
401
- };
402
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
403
- switch (errorCode) {
404
- case "InternalServerException":
405
- case "com.amazonaws.finspace#InternalServerException":
406
- throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
407
- case "InvalidRequestException":
408
- case "com.amazonaws.finspace#InvalidRequestException":
409
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
410
- case "ResourceNotFoundException":
411
- case "com.amazonaws.finspace#ResourceNotFoundException":
412
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
413
- default:
414
- const parsedBody = parsedOutput.body;
415
- throwDefaultError({
416
- output,
417
- parsedBody,
418
- exceptionCtor: __BaseException,
419
- errorCode,
420
- });
421
- }
422
- };
423
- export const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
424
- if (output.statusCode !== 200 && output.statusCode >= 300) {
425
- return deserializeAws_restJson1UntagResourceCommandError(output, context);
426
- }
427
- const contents = map({
428
- $metadata: deserializeMetadata(output),
420
+ }); };
421
+ export var deserializeAws_restJson1ListEnvironmentsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
422
+ var contents, data, _a, _b;
423
+ return __generator(this, function (_c) {
424
+ switch (_c.label) {
425
+ case 0:
426
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
427
+ return [2, deserializeAws_restJson1ListEnvironmentsCommandError(output, context)];
428
+ }
429
+ contents = map({
430
+ $metadata: deserializeMetadata(output),
431
+ });
432
+ _a = __expectNonNull;
433
+ _b = __expectObject;
434
+ return [4, parseBody(output.body, context)];
435
+ case 1:
436
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
437
+ if (data.environments != null) {
438
+ contents.environments = deserializeAws_restJson1EnvironmentList(data.environments, context);
439
+ }
440
+ if (data.nextToken != null) {
441
+ contents.nextToken = __expectString(data.nextToken);
442
+ }
443
+ return [2, contents];
444
+ }
429
445
  });
430
- await collectBody(output.body, context);
431
- return contents;
432
- };
433
- const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
434
- const parsedOutput = {
435
- ...output,
436
- body: await parseErrorBody(output.body, context),
437
- };
438
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
439
- switch (errorCode) {
440
- case "InternalServerException":
441
- case "com.amazonaws.finspace#InternalServerException":
442
- throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
443
- case "InvalidRequestException":
444
- case "com.amazonaws.finspace#InvalidRequestException":
445
- throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
446
- case "ResourceNotFoundException":
447
- case "com.amazonaws.finspace#ResourceNotFoundException":
448
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
449
- default:
450
- const parsedBody = parsedOutput.body;
451
- throwDefaultError({
452
- output,
453
- parsedBody,
454
- exceptionCtor: __BaseException,
455
- errorCode,
456
- });
457
- }
458
- };
459
- export const deserializeAws_restJson1UpdateEnvironmentCommand = async (output, context) => {
460
- if (output.statusCode !== 200 && output.statusCode >= 300) {
461
- return deserializeAws_restJson1UpdateEnvironmentCommandError(output, context);
462
- }
463
- const contents = map({
464
- $metadata: deserializeMetadata(output),
446
+ }); };
447
+ var deserializeAws_restJson1ListEnvironmentsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
448
+ var parsedOutput, _a, errorCode, _b, parsedBody;
449
+ var _c;
450
+ return __generator(this, function (_d) {
451
+ switch (_d.label) {
452
+ case 0:
453
+ _a = [__assign({}, output)];
454
+ _c = {};
455
+ return [4, parseErrorBody(output.body, context)];
456
+ case 1:
457
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
458
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
459
+ _b = errorCode;
460
+ switch (_b) {
461
+ case "InternalServerException": return [3, 2];
462
+ case "com.amazonaws.finspace#InternalServerException": return [3, 2];
463
+ case "ValidationException": return [3, 4];
464
+ case "com.amazonaws.finspace#ValidationException": return [3, 4];
465
+ }
466
+ return [3, 6];
467
+ case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
468
+ case 3: throw _d.sent();
469
+ case 4: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
470
+ case 5: throw _d.sent();
471
+ case 6:
472
+ parsedBody = parsedOutput.body;
473
+ throwDefaultError({
474
+ output: output,
475
+ parsedBody: parsedBody,
476
+ exceptionCtor: __BaseException,
477
+ errorCode: errorCode,
478
+ });
479
+ _d.label = 7;
480
+ case 7: return [2];
481
+ }
465
482
  });
466
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
467
- if (data.environment != null) {
468
- contents.environment = deserializeAws_restJson1Environment(data.environment, context);
469
- }
470
- return contents;
471
- };
472
- const deserializeAws_restJson1UpdateEnvironmentCommandError = async (output, context) => {
473
- const parsedOutput = {
474
- ...output,
475
- body: await parseErrorBody(output.body, context),
476
- };
477
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
478
- switch (errorCode) {
479
- case "AccessDeniedException":
480
- case "com.amazonaws.finspace#AccessDeniedException":
481
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
482
- case "InternalServerException":
483
- case "com.amazonaws.finspace#InternalServerException":
484
- throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
485
- case "ResourceNotFoundException":
486
- case "com.amazonaws.finspace#ResourceNotFoundException":
487
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
488
- case "ThrottlingException":
489
- case "com.amazonaws.finspace#ThrottlingException":
490
- throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
491
- case "ValidationException":
492
- case "com.amazonaws.finspace#ValidationException":
493
- throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
494
- default:
495
- const parsedBody = parsedOutput.body;
496
- throwDefaultError({
497
- output,
498
- parsedBody,
499
- exceptionCtor: __BaseException,
500
- errorCode,
501
- });
502
- }
503
- };
504
- const map = __map;
505
- const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
506
- const contents = map({});
507
- const data = parsedOutput.body;
508
- const exception = new AccessDeniedException({
509
- $metadata: deserializeMetadata(parsedOutput),
510
- ...contents,
511
- });
512
- return __decorateServiceException(exception, parsedOutput.body);
513
- };
514
- const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
515
- const contents = map({});
516
- const data = parsedOutput.body;
517
- if (data.message != null) {
518
- contents.message = __expectString(data.message);
519
- }
520
- const exception = new InternalServerException({
521
- $metadata: deserializeMetadata(parsedOutput),
522
- ...contents,
483
+ }); };
484
+ export var deserializeAws_restJson1ListTagsForResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
485
+ var contents, data, _a, _b;
486
+ return __generator(this, function (_c) {
487
+ switch (_c.label) {
488
+ case 0:
489
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
490
+ return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
491
+ }
492
+ contents = map({
493
+ $metadata: deserializeMetadata(output),
494
+ });
495
+ _a = __expectNonNull;
496
+ _b = __expectObject;
497
+ return [4, parseBody(output.body, context)];
498
+ case 1:
499
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
500
+ if (data.tags != null) {
501
+ contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
502
+ }
503
+ return [2, contents];
504
+ }
523
505
  });
524
- return __decorateServiceException(exception, parsedOutput.body);
525
- };
526
- const deserializeAws_restJson1InvalidRequestExceptionResponse = async (parsedOutput, context) => {
527
- const contents = map({});
528
- const data = parsedOutput.body;
529
- if (data.message != null) {
530
- contents.message = __expectString(data.message);
531
- }
532
- const exception = new InvalidRequestException({
533
- $metadata: deserializeMetadata(parsedOutput),
534
- ...contents,
506
+ }); };
507
+ var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
508
+ var parsedOutput, _a, errorCode, _b, parsedBody;
509
+ var _c;
510
+ return __generator(this, function (_d) {
511
+ switch (_d.label) {
512
+ case 0:
513
+ _a = [__assign({}, output)];
514
+ _c = {};
515
+ return [4, parseErrorBody(output.body, context)];
516
+ case 1:
517
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
518
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
519
+ _b = errorCode;
520
+ switch (_b) {
521
+ case "InternalServerException": return [3, 2];
522
+ case "com.amazonaws.finspace#InternalServerException": return [3, 2];
523
+ case "InvalidRequestException": return [3, 4];
524
+ case "com.amazonaws.finspace#InvalidRequestException": return [3, 4];
525
+ case "ResourceNotFoundException": return [3, 6];
526
+ case "com.amazonaws.finspace#ResourceNotFoundException": return [3, 6];
527
+ }
528
+ return [3, 8];
529
+ case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
530
+ case 3: throw _d.sent();
531
+ case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
532
+ case 5: throw _d.sent();
533
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
534
+ case 7: throw _d.sent();
535
+ case 8:
536
+ parsedBody = parsedOutput.body;
537
+ throwDefaultError({
538
+ output: output,
539
+ parsedBody: parsedBody,
540
+ exceptionCtor: __BaseException,
541
+ errorCode: errorCode,
542
+ });
543
+ _d.label = 9;
544
+ case 9: return [2];
545
+ }
535
546
  });
536
- return __decorateServiceException(exception, parsedOutput.body);
537
- };
538
- const deserializeAws_restJson1LimitExceededExceptionResponse = async (parsedOutput, context) => {
539
- const contents = map({});
540
- const data = parsedOutput.body;
541
- if (data.message != null) {
542
- contents.message = __expectString(data.message);
543
- }
544
- const exception = new LimitExceededException({
545
- $metadata: deserializeMetadata(parsedOutput),
546
- ...contents,
547
+ }); };
548
+ export var deserializeAws_restJson1TagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
549
+ var contents;
550
+ return __generator(this, function (_a) {
551
+ switch (_a.label) {
552
+ case 0:
553
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
554
+ return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
555
+ }
556
+ contents = map({
557
+ $metadata: deserializeMetadata(output),
558
+ });
559
+ return [4, collectBody(output.body, context)];
560
+ case 1:
561
+ _a.sent();
562
+ return [2, contents];
563
+ }
547
564
  });
548
- return __decorateServiceException(exception, parsedOutput.body);
549
- };
550
- const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
551
- const contents = map({});
552
- const data = parsedOutput.body;
553
- if (data.message != null) {
554
- contents.message = __expectString(data.message);
555
- }
556
- const exception = new ResourceNotFoundException({
557
- $metadata: deserializeMetadata(parsedOutput),
558
- ...contents,
565
+ }); };
566
+ var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
567
+ var parsedOutput, _a, errorCode, _b, parsedBody;
568
+ var _c;
569
+ return __generator(this, function (_d) {
570
+ switch (_d.label) {
571
+ case 0:
572
+ _a = [__assign({}, output)];
573
+ _c = {};
574
+ return [4, parseErrorBody(output.body, context)];
575
+ case 1:
576
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
577
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
578
+ _b = errorCode;
579
+ switch (_b) {
580
+ case "InternalServerException": return [3, 2];
581
+ case "com.amazonaws.finspace#InternalServerException": return [3, 2];
582
+ case "InvalidRequestException": return [3, 4];
583
+ case "com.amazonaws.finspace#InvalidRequestException": return [3, 4];
584
+ case "ResourceNotFoundException": return [3, 6];
585
+ case "com.amazonaws.finspace#ResourceNotFoundException": return [3, 6];
586
+ }
587
+ return [3, 8];
588
+ case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
589
+ case 3: throw _d.sent();
590
+ case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
591
+ case 5: throw _d.sent();
592
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
593
+ case 7: throw _d.sent();
594
+ case 8:
595
+ parsedBody = parsedOutput.body;
596
+ throwDefaultError({
597
+ output: output,
598
+ parsedBody: parsedBody,
599
+ exceptionCtor: __BaseException,
600
+ errorCode: errorCode,
601
+ });
602
+ _d.label = 9;
603
+ case 9: return [2];
604
+ }
559
605
  });
560
- return __decorateServiceException(exception, parsedOutput.body);
561
- };
562
- const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
563
- const contents = map({});
564
- const data = parsedOutput.body;
565
- if (data.message != null) {
566
- contents.message = __expectString(data.message);
567
- }
568
- const exception = new ServiceQuotaExceededException({
569
- $metadata: deserializeMetadata(parsedOutput),
570
- ...contents,
606
+ }); };
607
+ export var deserializeAws_restJson1UntagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
608
+ var contents;
609
+ return __generator(this, function (_a) {
610
+ switch (_a.label) {
611
+ case 0:
612
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
613
+ return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
614
+ }
615
+ contents = map({
616
+ $metadata: deserializeMetadata(output),
617
+ });
618
+ return [4, collectBody(output.body, context)];
619
+ case 1:
620
+ _a.sent();
621
+ return [2, contents];
622
+ }
571
623
  });
572
- return __decorateServiceException(exception, parsedOutput.body);
573
- };
574
- const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
575
- const contents = map({});
576
- const data = parsedOutput.body;
577
- const exception = new ThrottlingException({
578
- $metadata: deserializeMetadata(parsedOutput),
579
- ...contents,
580
- });
581
- return __decorateServiceException(exception, parsedOutput.body);
582
- };
583
- const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
584
- const contents = map({});
585
- const data = parsedOutput.body;
586
- if (data.message != null) {
587
- contents.message = __expectString(data.message);
588
- }
589
- const exception = new ValidationException({
590
- $metadata: deserializeMetadata(parsedOutput),
591
- ...contents,
624
+ }); };
625
+ var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
626
+ var parsedOutput, _a, errorCode, _b, parsedBody;
627
+ var _c;
628
+ return __generator(this, function (_d) {
629
+ switch (_d.label) {
630
+ case 0:
631
+ _a = [__assign({}, output)];
632
+ _c = {};
633
+ return [4, parseErrorBody(output.body, context)];
634
+ case 1:
635
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
636
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
637
+ _b = errorCode;
638
+ switch (_b) {
639
+ case "InternalServerException": return [3, 2];
640
+ case "com.amazonaws.finspace#InternalServerException": return [3, 2];
641
+ case "InvalidRequestException": return [3, 4];
642
+ case "com.amazonaws.finspace#InvalidRequestException": return [3, 4];
643
+ case "ResourceNotFoundException": return [3, 6];
644
+ case "com.amazonaws.finspace#ResourceNotFoundException": return [3, 6];
645
+ }
646
+ return [3, 8];
647
+ case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
648
+ case 3: throw _d.sent();
649
+ case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
650
+ case 5: throw _d.sent();
651
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
652
+ case 7: throw _d.sent();
653
+ case 8:
654
+ parsedBody = parsedOutput.body;
655
+ throwDefaultError({
656
+ output: output,
657
+ parsedBody: parsedBody,
658
+ exceptionCtor: __BaseException,
659
+ errorCode: errorCode,
660
+ });
661
+ _d.label = 9;
662
+ case 9: return [2];
663
+ }
592
664
  });
593
- return __decorateServiceException(exception, parsedOutput.body);
594
- };
595
- const serializeAws_restJson1AttributeMap = (input, context) => {
596
- return Object.entries(input).reduce((acc, [key, value]) => {
665
+ }); };
666
+ export var deserializeAws_restJson1UpdateEnvironmentCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
667
+ var contents, data, _a, _b;
668
+ return __generator(this, function (_c) {
669
+ switch (_c.label) {
670
+ case 0:
671
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
672
+ return [2, deserializeAws_restJson1UpdateEnvironmentCommandError(output, context)];
673
+ }
674
+ contents = map({
675
+ $metadata: deserializeMetadata(output),
676
+ });
677
+ _a = __expectNonNull;
678
+ _b = __expectObject;
679
+ return [4, parseBody(output.body, context)];
680
+ case 1:
681
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
682
+ if (data.environment != null) {
683
+ contents.environment = deserializeAws_restJson1Environment(data.environment, context);
684
+ }
685
+ return [2, contents];
686
+ }
687
+ });
688
+ }); };
689
+ var deserializeAws_restJson1UpdateEnvironmentCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
690
+ var parsedOutput, _a, errorCode, _b, parsedBody;
691
+ var _c;
692
+ return __generator(this, function (_d) {
693
+ switch (_d.label) {
694
+ case 0:
695
+ _a = [__assign({}, output)];
696
+ _c = {};
697
+ return [4, parseErrorBody(output.body, context)];
698
+ case 1:
699
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
700
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
701
+ _b = errorCode;
702
+ switch (_b) {
703
+ case "AccessDeniedException": return [3, 2];
704
+ case "com.amazonaws.finspace#AccessDeniedException": return [3, 2];
705
+ case "InternalServerException": return [3, 4];
706
+ case "com.amazonaws.finspace#InternalServerException": return [3, 4];
707
+ case "ResourceNotFoundException": return [3, 6];
708
+ case "com.amazonaws.finspace#ResourceNotFoundException": return [3, 6];
709
+ case "ThrottlingException": return [3, 8];
710
+ case "com.amazonaws.finspace#ThrottlingException": return [3, 8];
711
+ case "ValidationException": return [3, 10];
712
+ case "com.amazonaws.finspace#ValidationException": return [3, 10];
713
+ }
714
+ return [3, 12];
715
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
716
+ case 3: throw _d.sent();
717
+ case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
718
+ case 5: throw _d.sent();
719
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
720
+ case 7: throw _d.sent();
721
+ case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
722
+ case 9: throw _d.sent();
723
+ case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
724
+ case 11: throw _d.sent();
725
+ case 12:
726
+ parsedBody = parsedOutput.body;
727
+ throwDefaultError({
728
+ output: output,
729
+ parsedBody: parsedBody,
730
+ exceptionCtor: __BaseException,
731
+ errorCode: errorCode,
732
+ });
733
+ _d.label = 13;
734
+ case 13: return [2];
735
+ }
736
+ });
737
+ }); };
738
+ var map = __map;
739
+ var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
740
+ var contents, data, exception;
741
+ return __generator(this, function (_a) {
742
+ contents = map({});
743
+ data = parsedOutput.body;
744
+ exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
745
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
746
+ });
747
+ }); };
748
+ var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
749
+ var contents, data, exception;
750
+ return __generator(this, function (_a) {
751
+ contents = map({});
752
+ data = parsedOutput.body;
753
+ if (data.message != null) {
754
+ contents.message = __expectString(data.message);
755
+ }
756
+ exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
757
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
758
+ });
759
+ }); };
760
+ var deserializeAws_restJson1InvalidRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
761
+ var contents, data, exception;
762
+ return __generator(this, function (_a) {
763
+ contents = map({});
764
+ data = parsedOutput.body;
765
+ if (data.message != null) {
766
+ contents.message = __expectString(data.message);
767
+ }
768
+ exception = new InvalidRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
769
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
770
+ });
771
+ }); };
772
+ var deserializeAws_restJson1LimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
773
+ var contents, data, exception;
774
+ return __generator(this, function (_a) {
775
+ contents = map({});
776
+ data = parsedOutput.body;
777
+ if (data.message != null) {
778
+ contents.message = __expectString(data.message);
779
+ }
780
+ exception = new LimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
781
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
782
+ });
783
+ }); };
784
+ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
785
+ var contents, data, exception;
786
+ return __generator(this, function (_a) {
787
+ contents = map({});
788
+ data = parsedOutput.body;
789
+ if (data.message != null) {
790
+ contents.message = __expectString(data.message);
791
+ }
792
+ exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
793
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
794
+ });
795
+ }); };
796
+ var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
797
+ var contents, data, exception;
798
+ return __generator(this, function (_a) {
799
+ contents = map({});
800
+ data = parsedOutput.body;
801
+ if (data.message != null) {
802
+ contents.message = __expectString(data.message);
803
+ }
804
+ exception = new ServiceQuotaExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
805
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
806
+ });
807
+ }); };
808
+ var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
809
+ var contents, data, exception;
810
+ return __generator(this, function (_a) {
811
+ contents = map({});
812
+ data = parsedOutput.body;
813
+ exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
814
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
815
+ });
816
+ }); };
817
+ var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
818
+ var contents, data, exception;
819
+ return __generator(this, function (_a) {
820
+ contents = map({});
821
+ data = parsedOutput.body;
822
+ if (data.message != null) {
823
+ contents.message = __expectString(data.message);
824
+ }
825
+ exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
826
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
827
+ });
828
+ }); };
829
+ var serializeAws_restJson1AttributeMap = function (input, context) {
830
+ return Object.entries(input).reduce(function (acc, _a) {
831
+ var _b;
832
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
597
833
  if (value === null) {
598
834
  return acc;
599
835
  }
600
- return {
601
- ...acc,
602
- [key]: value,
603
- };
836
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
604
837
  }, {});
605
838
  };
606
- const serializeAws_restJson1DataBundleArns = (input, context) => {
839
+ var serializeAws_restJson1DataBundleArns = function (input, context) {
607
840
  return input
608
- .filter((e) => e != null)
609
- .map((entry) => {
841
+ .filter(function (e) { return e != null; })
842
+ .map(function (entry) {
610
843
  return entry;
611
844
  });
612
845
  };
613
- const serializeAws_restJson1FederationParameters = (input, context) => {
614
- return {
615
- ...(input.applicationCallBackURL != null && { applicationCallBackURL: input.applicationCallBackURL }),
616
- ...(input.attributeMap != null && {
617
- attributeMap: serializeAws_restJson1AttributeMap(input.attributeMap, context),
618
- }),
619
- ...(input.federationProviderName != null && { federationProviderName: input.federationProviderName }),
620
- ...(input.federationURN != null && { federationURN: input.federationURN }),
621
- ...(input.samlMetadataDocument != null && { samlMetadataDocument: input.samlMetadataDocument }),
622
- ...(input.samlMetadataURL != null && { samlMetadataURL: input.samlMetadataURL }),
623
- };
846
+ var serializeAws_restJson1FederationParameters = function (input, context) {
847
+ return __assign(__assign(__assign(__assign(__assign(__assign({}, (input.applicationCallBackURL != null && { applicationCallBackURL: input.applicationCallBackURL })), (input.attributeMap != null && {
848
+ attributeMap: serializeAws_restJson1AttributeMap(input.attributeMap, context),
849
+ })), (input.federationProviderName != null && { federationProviderName: input.federationProviderName })), (input.federationURN != null && { federationURN: input.federationURN })), (input.samlMetadataDocument != null && { samlMetadataDocument: input.samlMetadataDocument })), (input.samlMetadataURL != null && { samlMetadataURL: input.samlMetadataURL }));
624
850
  };
625
- const serializeAws_restJson1SuperuserParameters = (input, context) => {
626
- return {
627
- ...(input.emailAddress != null && { emailAddress: input.emailAddress }),
628
- ...(input.firstName != null && { firstName: input.firstName }),
629
- ...(input.lastName != null && { lastName: input.lastName }),
630
- };
851
+ var serializeAws_restJson1SuperuserParameters = function (input, context) {
852
+ return __assign(__assign(__assign({}, (input.emailAddress != null && { emailAddress: input.emailAddress })), (input.firstName != null && { firstName: input.firstName })), (input.lastName != null && { lastName: input.lastName }));
631
853
  };
632
- const serializeAws_restJson1TagMap = (input, context) => {
633
- return Object.entries(input).reduce((acc, [key, value]) => {
854
+ var serializeAws_restJson1TagMap = function (input, context) {
855
+ return Object.entries(input).reduce(function (acc, _a) {
856
+ var _b;
857
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
634
858
  if (value === null) {
635
859
  return acc;
636
860
  }
637
- return {
638
- ...acc,
639
- [key]: value,
640
- };
861
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
641
862
  }, {});
642
863
  };
643
- const deserializeAws_restJson1AttributeMap = (output, context) => {
644
- return Object.entries(output).reduce((acc, [key, value]) => {
864
+ var deserializeAws_restJson1AttributeMap = function (output, context) {
865
+ return Object.entries(output).reduce(function (acc, _a) {
866
+ var _b;
867
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
645
868
  if (value === null) {
646
869
  return acc;
647
870
  }
648
- return {
649
- ...acc,
650
- [key]: __expectString(value),
651
- };
871
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
652
872
  }, {});
653
873
  };
654
- const deserializeAws_restJson1Environment = (output, context) => {
874
+ var deserializeAws_restJson1Environment = function (output, context) {
655
875
  return {
656
876
  awsAccountId: __expectString(output.awsAccountId),
657
877
  dedicatedServiceAccountId: __expectString(output.dedicatedServiceAccountId),
@@ -669,10 +889,10 @@ const deserializeAws_restJson1Environment = (output, context) => {
669
889
  status: __expectString(output.status),
670
890
  };
671
891
  };
672
- const deserializeAws_restJson1EnvironmentList = (output, context) => {
673
- const retVal = (output || [])
674
- .filter((e) => e != null)
675
- .map((entry) => {
892
+ var deserializeAws_restJson1EnvironmentList = function (output, context) {
893
+ var retVal = (output || [])
894
+ .filter(function (e) { return e != null; })
895
+ .map(function (entry) {
676
896
  if (entry === null) {
677
897
  return null;
678
898
  }
@@ -680,7 +900,7 @@ const deserializeAws_restJson1EnvironmentList = (output, context) => {
680
900
  });
681
901
  return retVal;
682
902
  };
683
- const deserializeAws_restJson1FederationParameters = (output, context) => {
903
+ var deserializeAws_restJson1FederationParameters = function (output, context) {
684
904
  return {
685
905
  applicationCallBackURL: __expectString(output.applicationCallBackURL),
686
906
  attributeMap: output.attributeMap != null ? deserializeAws_restJson1AttributeMap(output.attributeMap, context) : undefined,
@@ -690,50 +910,67 @@ const deserializeAws_restJson1FederationParameters = (output, context) => {
690
910
  samlMetadataURL: __expectString(output.samlMetadataURL),
691
911
  };
692
912
  };
693
- const deserializeAws_restJson1TagMap = (output, context) => {
694
- return Object.entries(output).reduce((acc, [key, value]) => {
913
+ var deserializeAws_restJson1TagMap = function (output, context) {
914
+ return Object.entries(output).reduce(function (acc, _a) {
915
+ var _b;
916
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
695
917
  if (value === null) {
696
918
  return acc;
697
919
  }
698
- return {
699
- ...acc,
700
- [key]: __expectString(value),
701
- };
920
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
702
921
  }, {});
703
922
  };
704
- const deserializeMetadata = (output) => ({
705
- httpStatusCode: output.statusCode,
706
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
707
- extendedRequestId: output.headers["x-amz-id-2"],
708
- cfId: output.headers["x-amz-cf-id"],
709
- });
710
- const collectBody = (streamBody = new Uint8Array(), context) => {
923
+ var deserializeMetadata = function (output) {
924
+ var _a, _b;
925
+ return ({
926
+ httpStatusCode: output.statusCode,
927
+ requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"],
928
+ extendedRequestId: output.headers["x-amz-id-2"],
929
+ cfId: output.headers["x-amz-cf-id"],
930
+ });
931
+ };
932
+ var collectBody = function (streamBody, context) {
933
+ if (streamBody === void 0) { streamBody = new Uint8Array(); }
711
934
  if (streamBody instanceof Uint8Array) {
712
935
  return Promise.resolve(streamBody);
713
936
  }
714
937
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
715
938
  };
716
- const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
717
- const isSerializableHeaderValue = (value) => value !== undefined &&
718
- value !== null &&
719
- value !== "" &&
720
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
721
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
722
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
723
- if (encoded.length) {
724
- return JSON.parse(encoded);
725
- }
726
- return {};
727
- });
728
- const parseErrorBody = async (errorBody, context) => {
729
- const value = await parseBody(errorBody, context);
730
- value.message = value.message ?? value.Message;
731
- return value;
939
+ var collectBodyString = function (streamBody, context) {
940
+ return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
941
+ };
942
+ var isSerializableHeaderValue = function (value) {
943
+ return value !== undefined &&
944
+ value !== null &&
945
+ value !== "" &&
946
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
947
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
732
948
  };
733
- const loadRestJsonErrorCode = (output, data) => {
734
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
735
- const sanitizeErrorCode = (rawValue) => {
736
- let cleanValue = rawValue;
949
+ var parseBody = function (streamBody, context) {
950
+ return collectBodyString(streamBody, context).then(function (encoded) {
951
+ if (encoded.length) {
952
+ return JSON.parse(encoded);
953
+ }
954
+ return {};
955
+ });
956
+ };
957
+ var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
958
+ var value;
959
+ var _a;
960
+ return __generator(this, function (_b) {
961
+ switch (_b.label) {
962
+ case 0: return [4, parseBody(errorBody, context)];
963
+ case 1:
964
+ value = _b.sent();
965
+ value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
966
+ return [2, value];
967
+ }
968
+ });
969
+ }); };
970
+ var loadRestJsonErrorCode = function (output, data) {
971
+ var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
972
+ var sanitizeErrorCode = function (rawValue) {
973
+ var cleanValue = rawValue;
737
974
  if (typeof cleanValue === "number") {
738
975
  cleanValue = cleanValue.toString();
739
976
  }
@@ -748,7 +985,7 @@ const loadRestJsonErrorCode = (output, data) => {
748
985
  }
749
986
  return cleanValue;
750
987
  };
751
- const headerKey = findKey(output.headers, "x-amzn-errortype");
988
+ var headerKey = findKey(output.headers, "x-amzn-errortype");
752
989
  if (headerKey !== undefined) {
753
990
  return sanitizeErrorCode(output.headers[headerKey]);
754
991
  }