@aws-sdk/client-sso 3.141.0 → 3.142.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.142.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.141.0...v3.142.0) (2022-08-02)
7
+
8
+
9
+ ### Features
10
+
11
+ * **codegen:** general data mapping function ([#3830](https://github.com/aws/aws-sdk-js-v3/issues/3830)) ([9417eae](https://github.com/aws/aws-sdk-js-v3/commit/9417eae722806799fb4c15c07921574268c1165c))
12
+
13
+
14
+
15
+
16
+
6
17
  # [3.141.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.140.0...v3.141.0) (2022-08-01)
7
18
 
8
19
 
@@ -7,14 +7,14 @@ const models_0_1 = require("../models/models_0");
7
7
  const SSOServiceException_1 = require("../models/SSOServiceException");
8
8
  const serializeAws_restJson1GetRoleCredentialsCommand = async (input, context) => {
9
9
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
10
- const headers = {
11
- ...(isSerializableHeaderValue(input.accessToken) && { "x-amz-sso_bearer_token": input.accessToken }),
12
- };
10
+ const headers = map({}, isSerializableHeaderValue, {
11
+ "x-amz-sso_bearer_token": input.accessToken,
12
+ });
13
13
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/federation/credentials";
14
- const query = {
15
- ...(input.roleName !== undefined && { role_name: input.roleName }),
16
- ...(input.accountId !== undefined && { account_id: input.accountId }),
17
- };
14
+ const query = map({
15
+ role_name: [, input.roleName],
16
+ account_id: [, input.accountId],
17
+ });
18
18
  let body;
19
19
  return new protocol_http_1.HttpRequest({
20
20
  protocol,
@@ -30,15 +30,15 @@ const serializeAws_restJson1GetRoleCredentialsCommand = async (input, context) =
30
30
  exports.serializeAws_restJson1GetRoleCredentialsCommand = serializeAws_restJson1GetRoleCredentialsCommand;
31
31
  const serializeAws_restJson1ListAccountRolesCommand = async (input, context) => {
32
32
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
33
- const headers = {
34
- ...(isSerializableHeaderValue(input.accessToken) && { "x-amz-sso_bearer_token": input.accessToken }),
35
- };
33
+ const headers = map({}, isSerializableHeaderValue, {
34
+ "x-amz-sso_bearer_token": input.accessToken,
35
+ });
36
36
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/assignment/roles";
37
- const query = {
38
- ...(input.nextToken !== undefined && { next_token: input.nextToken }),
39
- ...(input.maxResults !== undefined && { max_result: input.maxResults.toString() }),
40
- ...(input.accountId !== undefined && { account_id: input.accountId }),
41
- };
37
+ const query = map({
38
+ next_token: [, input.nextToken],
39
+ max_result: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
40
+ account_id: [, input.accountId],
41
+ });
42
42
  let body;
43
43
  return new protocol_http_1.HttpRequest({
44
44
  protocol,
@@ -54,14 +54,14 @@ const serializeAws_restJson1ListAccountRolesCommand = async (input, context) =>
54
54
  exports.serializeAws_restJson1ListAccountRolesCommand = serializeAws_restJson1ListAccountRolesCommand;
55
55
  const serializeAws_restJson1ListAccountsCommand = async (input, context) => {
56
56
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
57
- const headers = {
58
- ...(isSerializableHeaderValue(input.accessToken) && { "x-amz-sso_bearer_token": input.accessToken }),
59
- };
57
+ const headers = map({}, isSerializableHeaderValue, {
58
+ "x-amz-sso_bearer_token": input.accessToken,
59
+ });
60
60
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/assignment/accounts";
61
- const query = {
62
- ...(input.nextToken !== undefined && { next_token: input.nextToken }),
63
- ...(input.maxResults !== undefined && { max_result: input.maxResults.toString() }),
64
- };
61
+ const query = map({
62
+ next_token: [, input.nextToken],
63
+ max_result: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
64
+ });
65
65
  let body;
66
66
  return new protocol_http_1.HttpRequest({
67
67
  protocol,
@@ -77,9 +77,9 @@ const serializeAws_restJson1ListAccountsCommand = async (input, context) => {
77
77
  exports.serializeAws_restJson1ListAccountsCommand = serializeAws_restJson1ListAccountsCommand;
78
78
  const serializeAws_restJson1LogoutCommand = async (input, context) => {
79
79
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
80
- const headers = {
81
- ...(isSerializableHeaderValue(input.accessToken) && { "x-amz-sso_bearer_token": input.accessToken }),
82
- };
80
+ const headers = map({}, isSerializableHeaderValue, {
81
+ "x-amz-sso_bearer_token": input.accessToken,
82
+ });
83
83
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/logout";
84
84
  let body;
85
85
  return new protocol_http_1.HttpRequest({
@@ -97,15 +97,14 @@ const deserializeAws_restJson1GetRoleCredentialsCommand = async (output, context
97
97
  if (output.statusCode !== 200 && output.statusCode >= 300) {
98
98
  return deserializeAws_restJson1GetRoleCredentialsCommandError(output, context);
99
99
  }
100
- const contents = {
100
+ const contents = map({
101
101
  $metadata: deserializeMetadata(output),
102
- roleCredentials: undefined,
103
- };
102
+ });
104
103
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
105
- if (data.roleCredentials !== undefined && data.roleCredentials !== null) {
104
+ if (data.roleCredentials != null) {
106
105
  contents.roleCredentials = deserializeAws_restJson1RoleCredentials(data.roleCredentials, context);
107
106
  }
108
- return Promise.resolve(contents);
107
+ return contents;
109
108
  };
110
109
  exports.deserializeAws_restJson1GetRoleCredentialsCommand = deserializeAws_restJson1GetRoleCredentialsCommand;
111
110
  const deserializeAws_restJson1GetRoleCredentialsCommandError = async (output, context) => {
@@ -113,7 +112,6 @@ const deserializeAws_restJson1GetRoleCredentialsCommandError = async (output, co
113
112
  ...output,
114
113
  body: await parseBody(output.body, context),
115
114
  };
116
- let response;
117
115
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
118
116
  switch (errorCode) {
119
117
  case "InvalidRequestException":
@@ -130,33 +128,29 @@ const deserializeAws_restJson1GetRoleCredentialsCommandError = async (output, co
130
128
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
131
129
  default:
132
130
  const parsedBody = parsedOutput.body;
133
- const $metadata = deserializeMetadata(output);
134
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
135
- response = new SSOServiceException_1.SSOServiceException({
136
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
137
- $fault: "client",
138
- $metadata,
131
+ (0, smithy_client_1.throwDefaultError)({
132
+ output,
133
+ parsedBody,
134
+ exceptionCtor: SSOServiceException_1.SSOServiceException,
135
+ errorCode,
139
136
  });
140
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
141
137
  }
142
138
  };
143
139
  const deserializeAws_restJson1ListAccountRolesCommand = async (output, context) => {
144
140
  if (output.statusCode !== 200 && output.statusCode >= 300) {
145
141
  return deserializeAws_restJson1ListAccountRolesCommandError(output, context);
146
142
  }
147
- const contents = {
143
+ const contents = map({
148
144
  $metadata: deserializeMetadata(output),
149
- nextToken: undefined,
150
- roleList: undefined,
151
- };
145
+ });
152
146
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
153
- if (data.nextToken !== undefined && data.nextToken !== null) {
147
+ if (data.nextToken != null) {
154
148
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
155
149
  }
156
- if (data.roleList !== undefined && data.roleList !== null) {
150
+ if (data.roleList != null) {
157
151
  contents.roleList = deserializeAws_restJson1RoleListType(data.roleList, context);
158
152
  }
159
- return Promise.resolve(contents);
153
+ return contents;
160
154
  };
161
155
  exports.deserializeAws_restJson1ListAccountRolesCommand = deserializeAws_restJson1ListAccountRolesCommand;
162
156
  const deserializeAws_restJson1ListAccountRolesCommandError = async (output, context) => {
@@ -164,7 +158,6 @@ const deserializeAws_restJson1ListAccountRolesCommandError = async (output, cont
164
158
  ...output,
165
159
  body: await parseBody(output.body, context),
166
160
  };
167
- let response;
168
161
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
169
162
  switch (errorCode) {
170
163
  case "InvalidRequestException":
@@ -181,33 +174,29 @@ const deserializeAws_restJson1ListAccountRolesCommandError = async (output, cont
181
174
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
182
175
  default:
183
176
  const parsedBody = parsedOutput.body;
184
- const $metadata = deserializeMetadata(output);
185
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
186
- response = new SSOServiceException_1.SSOServiceException({
187
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
188
- $fault: "client",
189
- $metadata,
177
+ (0, smithy_client_1.throwDefaultError)({
178
+ output,
179
+ parsedBody,
180
+ exceptionCtor: SSOServiceException_1.SSOServiceException,
181
+ errorCode,
190
182
  });
191
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
192
183
  }
193
184
  };
194
185
  const deserializeAws_restJson1ListAccountsCommand = async (output, context) => {
195
186
  if (output.statusCode !== 200 && output.statusCode >= 300) {
196
187
  return deserializeAws_restJson1ListAccountsCommandError(output, context);
197
188
  }
198
- const contents = {
189
+ const contents = map({
199
190
  $metadata: deserializeMetadata(output),
200
- accountList: undefined,
201
- nextToken: undefined,
202
- };
191
+ });
203
192
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
204
- if (data.accountList !== undefined && data.accountList !== null) {
193
+ if (data.accountList != null) {
205
194
  contents.accountList = deserializeAws_restJson1AccountListType(data.accountList, context);
206
195
  }
207
- if (data.nextToken !== undefined && data.nextToken !== null) {
196
+ if (data.nextToken != null) {
208
197
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
209
198
  }
210
- return Promise.resolve(contents);
199
+ return contents;
211
200
  };
212
201
  exports.deserializeAws_restJson1ListAccountsCommand = deserializeAws_restJson1ListAccountsCommand;
213
202
  const deserializeAws_restJson1ListAccountsCommandError = async (output, context) => {
@@ -215,7 +204,6 @@ const deserializeAws_restJson1ListAccountsCommandError = async (output, context)
215
204
  ...output,
216
205
  body: await parseBody(output.body, context),
217
206
  };
218
- let response;
219
207
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
220
208
  switch (errorCode) {
221
209
  case "InvalidRequestException":
@@ -232,25 +220,23 @@ const deserializeAws_restJson1ListAccountsCommandError = async (output, context)
232
220
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
233
221
  default:
234
222
  const parsedBody = parsedOutput.body;
235
- const $metadata = deserializeMetadata(output);
236
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
237
- response = new SSOServiceException_1.SSOServiceException({
238
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
239
- $fault: "client",
240
- $metadata,
223
+ (0, smithy_client_1.throwDefaultError)({
224
+ output,
225
+ parsedBody,
226
+ exceptionCtor: SSOServiceException_1.SSOServiceException,
227
+ errorCode,
241
228
  });
242
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
243
229
  }
244
230
  };
245
231
  const deserializeAws_restJson1LogoutCommand = async (output, context) => {
246
232
  if (output.statusCode !== 200 && output.statusCode >= 300) {
247
233
  return deserializeAws_restJson1LogoutCommandError(output, context);
248
234
  }
249
- const contents = {
235
+ const contents = map({
250
236
  $metadata: deserializeMetadata(output),
251
- };
237
+ });
252
238
  await collectBody(output.body, context);
253
- return Promise.resolve(contents);
239
+ return contents;
254
240
  };
255
241
  exports.deserializeAws_restJson1LogoutCommand = deserializeAws_restJson1LogoutCommand;
256
242
  const deserializeAws_restJson1LogoutCommandError = async (output, context) => {
@@ -258,7 +244,6 @@ const deserializeAws_restJson1LogoutCommandError = async (output, context) => {
258
244
  ...output,
259
245
  body: await parseBody(output.body, context),
260
246
  };
261
- let response;
262
247
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
263
248
  switch (errorCode) {
264
249
  case "InvalidRequestException":
@@ -272,20 +257,19 @@ const deserializeAws_restJson1LogoutCommandError = async (output, context) => {
272
257
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
273
258
  default:
274
259
  const parsedBody = parsedOutput.body;
275
- const $metadata = deserializeMetadata(output);
276
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
277
- response = new SSOServiceException_1.SSOServiceException({
278
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
279
- $fault: "client",
280
- $metadata,
260
+ (0, smithy_client_1.throwDefaultError)({
261
+ output,
262
+ parsedBody,
263
+ exceptionCtor: SSOServiceException_1.SSOServiceException,
264
+ errorCode,
281
265
  });
282
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
283
266
  }
284
267
  };
268
+ const map = smithy_client_1.map;
285
269
  const deserializeAws_restJson1InvalidRequestExceptionResponse = async (parsedOutput, context) => {
286
- const contents = {};
270
+ const contents = map({});
287
271
  const data = parsedOutput.body;
288
- if (data.message !== undefined && data.message !== null) {
272
+ if (data.message != null) {
289
273
  contents.message = (0, smithy_client_1.expectString)(data.message);
290
274
  }
291
275
  const exception = new models_0_1.InvalidRequestException({
@@ -295,9 +279,9 @@ const deserializeAws_restJson1InvalidRequestExceptionResponse = async (parsedOut
295
279
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
296
280
  };
297
281
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
298
- const contents = {};
282
+ const contents = map({});
299
283
  const data = parsedOutput.body;
300
- if (data.message !== undefined && data.message !== null) {
284
+ if (data.message != null) {
301
285
  contents.message = (0, smithy_client_1.expectString)(data.message);
302
286
  }
303
287
  const exception = new models_0_1.ResourceNotFoundException({
@@ -307,9 +291,9 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedO
307
291
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
308
292
  };
309
293
  const deserializeAws_restJson1TooManyRequestsExceptionResponse = async (parsedOutput, context) => {
310
- const contents = {};
294
+ const contents = map({});
311
295
  const data = parsedOutput.body;
312
- if (data.message !== undefined && data.message !== null) {
296
+ if (data.message != null) {
313
297
  contents.message = (0, smithy_client_1.expectString)(data.message);
314
298
  }
315
299
  const exception = new models_0_1.TooManyRequestsException({
@@ -319,9 +303,9 @@ const deserializeAws_restJson1TooManyRequestsExceptionResponse = async (parsedOu
319
303
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
320
304
  };
321
305
  const deserializeAws_restJson1UnauthorizedExceptionResponse = async (parsedOutput, context) => {
322
- const contents = {};
306
+ const contents = map({});
323
307
  const data = parsedOutput.body;
324
- if (data.message !== undefined && data.message !== null) {
308
+ if (data.message != null) {
325
309
  contents.message = (0, smithy_client_1.expectString)(data.message);
326
310
  }
327
311
  const exception = new models_0_1.UnauthorizedException({
@@ -1,6 +1,6 @@
1
1
  import { __assign, __awaiter, __generator } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, throwDefaultError, } from "@aws-sdk/smithy-client";
4
4
  import { InvalidRequestException, ResourceNotFoundException, TooManyRequestsException, UnauthorizedException, } from "../models/models_0";
5
5
  import { SSOServiceException as __BaseException } from "../models/SSOServiceException";
6
6
  export var serializeAws_restJson1GetRoleCredentialsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
@@ -10,9 +10,14 @@ export var serializeAws_restJson1GetRoleCredentialsCommand = function (input, co
10
10
  case 0: return [4, context.endpoint()];
11
11
  case 1:
12
12
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
13
- headers = __assign({}, (isSerializableHeaderValue(input.accessToken) && { "x-amz-sso_bearer_token": input.accessToken }));
13
+ headers = map({}, isSerializableHeaderValue, {
14
+ "x-amz-sso_bearer_token": input.accessToken,
15
+ });
14
16
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/federation/credentials";
15
- query = __assign(__assign({}, (input.roleName !== undefined && { role_name: input.roleName })), (input.accountId !== undefined && { account_id: input.accountId }));
17
+ query = map({
18
+ role_name: [, input.roleName],
19
+ account_id: [, input.accountId],
20
+ });
16
21
  return [2, new __HttpRequest({
17
22
  protocol: protocol,
18
23
  hostname: hostname,
@@ -33,9 +38,15 @@ export var serializeAws_restJson1ListAccountRolesCommand = function (input, cont
33
38
  case 0: return [4, context.endpoint()];
34
39
  case 1:
35
40
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
36
- headers = __assign({}, (isSerializableHeaderValue(input.accessToken) && { "x-amz-sso_bearer_token": input.accessToken }));
41
+ headers = map({}, isSerializableHeaderValue, {
42
+ "x-amz-sso_bearer_token": input.accessToken,
43
+ });
37
44
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/assignment/roles";
38
- query = __assign(__assign(__assign({}, (input.nextToken !== undefined && { next_token: input.nextToken })), (input.maxResults !== undefined && { max_result: input.maxResults.toString() })), (input.accountId !== undefined && { account_id: input.accountId }));
45
+ query = map({
46
+ next_token: [, input.nextToken],
47
+ max_result: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
48
+ account_id: [, input.accountId],
49
+ });
39
50
  return [2, new __HttpRequest({
40
51
  protocol: protocol,
41
52
  hostname: hostname,
@@ -56,9 +67,14 @@ export var serializeAws_restJson1ListAccountsCommand = function (input, context)
56
67
  case 0: return [4, context.endpoint()];
57
68
  case 1:
58
69
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
59
- headers = __assign({}, (isSerializableHeaderValue(input.accessToken) && { "x-amz-sso_bearer_token": input.accessToken }));
70
+ headers = map({}, isSerializableHeaderValue, {
71
+ "x-amz-sso_bearer_token": input.accessToken,
72
+ });
60
73
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/assignment/accounts";
61
- query = __assign(__assign({}, (input.nextToken !== undefined && { next_token: input.nextToken })), (input.maxResults !== undefined && { max_result: input.maxResults.toString() }));
74
+ query = map({
75
+ next_token: [, input.nextToken],
76
+ max_result: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
77
+ });
62
78
  return [2, new __HttpRequest({
63
79
  protocol: protocol,
64
80
  hostname: hostname,
@@ -79,7 +95,9 @@ export var serializeAws_restJson1LogoutCommand = function (input, context) { ret
79
95
  case 0: return [4, context.endpoint()];
80
96
  case 1:
81
97
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
82
- headers = __assign({}, (isSerializableHeaderValue(input.accessToken) && { "x-amz-sso_bearer_token": input.accessToken }));
98
+ headers = map({}, isSerializableHeaderValue, {
99
+ "x-amz-sso_bearer_token": input.accessToken,
100
+ });
83
101
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/logout";
84
102
  return [2, new __HttpRequest({
85
103
  protocol: protocol,
@@ -101,24 +119,23 @@ export var deserializeAws_restJson1GetRoleCredentialsCommand = function (output,
101
119
  if (output.statusCode !== 200 && output.statusCode >= 300) {
102
120
  return [2, deserializeAws_restJson1GetRoleCredentialsCommandError(output, context)];
103
121
  }
104
- contents = {
122
+ contents = map({
105
123
  $metadata: deserializeMetadata(output),
106
- roleCredentials: undefined,
107
- };
124
+ });
108
125
  _a = __expectNonNull;
109
126
  _b = __expectObject;
110
127
  return [4, parseBody(output.body, context)];
111
128
  case 1:
112
129
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
113
- if (data.roleCredentials !== undefined && data.roleCredentials !== null) {
130
+ if (data.roleCredentials != null) {
114
131
  contents.roleCredentials = deserializeAws_restJson1RoleCredentials(data.roleCredentials, context);
115
132
  }
116
- return [2, Promise.resolve(contents)];
133
+ return [2, contents];
117
134
  }
118
135
  });
119
136
  }); };
120
137
  var deserializeAws_restJson1GetRoleCredentialsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
121
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
138
+ var parsedOutput, _a, errorCode, _b, parsedBody;
122
139
  var _c;
123
140
  return __generator(this, function (_d) {
124
141
  switch (_d.label) {
@@ -151,14 +168,14 @@ var deserializeAws_restJson1GetRoleCredentialsCommandError = function (output, c
151
168
  case 9: throw _d.sent();
152
169
  case 10:
153
170
  parsedBody = parsedOutput.body;
154
- $metadata = deserializeMetadata(output);
155
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
156
- response = new __BaseException({
157
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
158
- $fault: "client",
159
- $metadata: $metadata,
171
+ throwDefaultError({
172
+ output: output,
173
+ parsedBody: parsedBody,
174
+ exceptionCtor: __BaseException,
175
+ errorCode: errorCode,
160
176
  });
161
- throw __decorateServiceException(response, parsedBody);
177
+ _d.label = 11;
178
+ case 11: return [2];
162
179
  }
163
180
  });
164
181
  }); };
@@ -170,28 +187,26 @@ export var deserializeAws_restJson1ListAccountRolesCommand = function (output, c
170
187
  if (output.statusCode !== 200 && output.statusCode >= 300) {
171
188
  return [2, deserializeAws_restJson1ListAccountRolesCommandError(output, context)];
172
189
  }
173
- contents = {
190
+ contents = map({
174
191
  $metadata: deserializeMetadata(output),
175
- nextToken: undefined,
176
- roleList: undefined,
177
- };
192
+ });
178
193
  _a = __expectNonNull;
179
194
  _b = __expectObject;
180
195
  return [4, parseBody(output.body, context)];
181
196
  case 1:
182
197
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
183
- if (data.nextToken !== undefined && data.nextToken !== null) {
198
+ if (data.nextToken != null) {
184
199
  contents.nextToken = __expectString(data.nextToken);
185
200
  }
186
- if (data.roleList !== undefined && data.roleList !== null) {
201
+ if (data.roleList != null) {
187
202
  contents.roleList = deserializeAws_restJson1RoleListType(data.roleList, context);
188
203
  }
189
- return [2, Promise.resolve(contents)];
204
+ return [2, contents];
190
205
  }
191
206
  });
192
207
  }); };
193
208
  var deserializeAws_restJson1ListAccountRolesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
194
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
209
+ var parsedOutput, _a, errorCode, _b, parsedBody;
195
210
  var _c;
196
211
  return __generator(this, function (_d) {
197
212
  switch (_d.label) {
@@ -224,14 +239,14 @@ var deserializeAws_restJson1ListAccountRolesCommandError = function (output, con
224
239
  case 9: throw _d.sent();
225
240
  case 10:
226
241
  parsedBody = parsedOutput.body;
227
- $metadata = deserializeMetadata(output);
228
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
229
- response = new __BaseException({
230
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
231
- $fault: "client",
232
- $metadata: $metadata,
242
+ throwDefaultError({
243
+ output: output,
244
+ parsedBody: parsedBody,
245
+ exceptionCtor: __BaseException,
246
+ errorCode: errorCode,
233
247
  });
234
- throw __decorateServiceException(response, parsedBody);
248
+ _d.label = 11;
249
+ case 11: return [2];
235
250
  }
236
251
  });
237
252
  }); };
@@ -243,28 +258,26 @@ export var deserializeAws_restJson1ListAccountsCommand = function (output, conte
243
258
  if (output.statusCode !== 200 && output.statusCode >= 300) {
244
259
  return [2, deserializeAws_restJson1ListAccountsCommandError(output, context)];
245
260
  }
246
- contents = {
261
+ contents = map({
247
262
  $metadata: deserializeMetadata(output),
248
- accountList: undefined,
249
- nextToken: undefined,
250
- };
263
+ });
251
264
  _a = __expectNonNull;
252
265
  _b = __expectObject;
253
266
  return [4, parseBody(output.body, context)];
254
267
  case 1:
255
268
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
256
- if (data.accountList !== undefined && data.accountList !== null) {
269
+ if (data.accountList != null) {
257
270
  contents.accountList = deserializeAws_restJson1AccountListType(data.accountList, context);
258
271
  }
259
- if (data.nextToken !== undefined && data.nextToken !== null) {
272
+ if (data.nextToken != null) {
260
273
  contents.nextToken = __expectString(data.nextToken);
261
274
  }
262
- return [2, Promise.resolve(contents)];
275
+ return [2, contents];
263
276
  }
264
277
  });
265
278
  }); };
266
279
  var deserializeAws_restJson1ListAccountsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
267
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
280
+ var parsedOutput, _a, errorCode, _b, parsedBody;
268
281
  var _c;
269
282
  return __generator(this, function (_d) {
270
283
  switch (_d.label) {
@@ -297,14 +310,14 @@ var deserializeAws_restJson1ListAccountsCommandError = function (output, context
297
310
  case 9: throw _d.sent();
298
311
  case 10:
299
312
  parsedBody = parsedOutput.body;
300
- $metadata = deserializeMetadata(output);
301
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
302
- response = new __BaseException({
303
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
304
- $fault: "client",
305
- $metadata: $metadata,
313
+ throwDefaultError({
314
+ output: output,
315
+ parsedBody: parsedBody,
316
+ exceptionCtor: __BaseException,
317
+ errorCode: errorCode,
306
318
  });
307
- throw __decorateServiceException(response, parsedBody);
319
+ _d.label = 11;
320
+ case 11: return [2];
308
321
  }
309
322
  });
310
323
  }); };
@@ -316,18 +329,18 @@ export var deserializeAws_restJson1LogoutCommand = function (output, context) {
316
329
  if (output.statusCode !== 200 && output.statusCode >= 300) {
317
330
  return [2, deserializeAws_restJson1LogoutCommandError(output, context)];
318
331
  }
319
- contents = {
332
+ contents = map({
320
333
  $metadata: deserializeMetadata(output),
321
- };
334
+ });
322
335
  return [4, collectBody(output.body, context)];
323
336
  case 1:
324
337
  _a.sent();
325
- return [2, Promise.resolve(contents)];
338
+ return [2, contents];
326
339
  }
327
340
  });
328
341
  }); };
329
342
  var deserializeAws_restJson1LogoutCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
330
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
343
+ var parsedOutput, _a, errorCode, _b, parsedBody;
331
344
  var _c;
332
345
  return __generator(this, function (_d) {
333
346
  switch (_d.label) {
@@ -356,23 +369,24 @@ var deserializeAws_restJson1LogoutCommandError = function (output, context) { re
356
369
  case 7: throw _d.sent();
357
370
  case 8:
358
371
  parsedBody = parsedOutput.body;
359
- $metadata = deserializeMetadata(output);
360
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
361
- response = new __BaseException({
362
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
363
- $fault: "client",
364
- $metadata: $metadata,
372
+ throwDefaultError({
373
+ output: output,
374
+ parsedBody: parsedBody,
375
+ exceptionCtor: __BaseException,
376
+ errorCode: errorCode,
365
377
  });
366
- throw __decorateServiceException(response, parsedBody);
378
+ _d.label = 9;
379
+ case 9: return [2];
367
380
  }
368
381
  });
369
382
  }); };
383
+ var map = __map;
370
384
  var deserializeAws_restJson1InvalidRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
371
385
  var contents, data, exception;
372
386
  return __generator(this, function (_a) {
373
- contents = {};
387
+ contents = map({});
374
388
  data = parsedOutput.body;
375
- if (data.message !== undefined && data.message !== null) {
389
+ if (data.message != null) {
376
390
  contents.message = __expectString(data.message);
377
391
  }
378
392
  exception = new InvalidRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -382,9 +396,9 @@ var deserializeAws_restJson1InvalidRequestExceptionResponse = function (parsedOu
382
396
  var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
383
397
  var contents, data, exception;
384
398
  return __generator(this, function (_a) {
385
- contents = {};
399
+ contents = map({});
386
400
  data = parsedOutput.body;
387
- if (data.message !== undefined && data.message !== null) {
401
+ if (data.message != null) {
388
402
  contents.message = __expectString(data.message);
389
403
  }
390
404
  exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -394,9 +408,9 @@ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsed
394
408
  var deserializeAws_restJson1TooManyRequestsExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
395
409
  var contents, data, exception;
396
410
  return __generator(this, function (_a) {
397
- contents = {};
411
+ contents = map({});
398
412
  data = parsedOutput.body;
399
- if (data.message !== undefined && data.message !== null) {
413
+ if (data.message != null) {
400
414
  contents.message = __expectString(data.message);
401
415
  }
402
416
  exception = new TooManyRequestsException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -406,9 +420,9 @@ var deserializeAws_restJson1TooManyRequestsExceptionResponse = function (parsedO
406
420
  var deserializeAws_restJson1UnauthorizedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
407
421
  var contents, data, exception;
408
422
  return __generator(this, function (_a) {
409
- contents = {};
423
+ contents = map({});
410
424
  data = parsedOutput.body;
411
- if (data.message !== undefined && data.message !== null) {
425
+ if (data.message != null) {
412
426
  contents.message = __expectString(data.message);
413
427
  }
414
428
  exception = new UnauthorizedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-sso",
3
3
  "description": "AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native",
4
- "version": "3.141.0",
4
+ "version": "3.142.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -33,15 +33,15 @@
33
33
  "@aws-sdk/node-config-provider": "3.127.0",
34
34
  "@aws-sdk/node-http-handler": "3.127.0",
35
35
  "@aws-sdk/protocol-http": "3.127.0",
36
- "@aws-sdk/smithy-client": "3.137.0",
36
+ "@aws-sdk/smithy-client": "3.142.0",
37
37
  "@aws-sdk/types": "3.127.0",
38
38
  "@aws-sdk/url-parser": "3.127.0",
39
39
  "@aws-sdk/util-base64-browser": "3.109.0",
40
40
  "@aws-sdk/util-base64-node": "3.55.0",
41
41
  "@aws-sdk/util-body-length-browser": "3.55.0",
42
42
  "@aws-sdk/util-body-length-node": "3.55.0",
43
- "@aws-sdk/util-defaults-mode-browser": "3.137.0",
44
- "@aws-sdk/util-defaults-mode-node": "3.137.0",
43
+ "@aws-sdk/util-defaults-mode-browser": "3.142.0",
44
+ "@aws-sdk/util-defaults-mode-node": "3.142.0",
45
45
  "@aws-sdk/util-user-agent-browser": "3.127.0",
46
46
  "@aws-sdk/util-user-agent-node": "3.127.0",
47
47
  "@aws-sdk/util-utf8-browser": "3.109.0",