@aws-sdk/client-sso 3.180.0 → 3.183.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,61 +1,87 @@
1
- import { __assign, __extends } from "tslib";
2
1
  import { SENSITIVE_STRING } from "@aws-sdk/smithy-client";
3
2
  import { SSOServiceException as __BaseException } from "./SSOServiceException";
4
- var InvalidRequestException = (function (_super) {
5
- __extends(InvalidRequestException, _super);
6
- function InvalidRequestException(opts) {
7
- var _this = _super.call(this, __assign({ name: "InvalidRequestException", $fault: "client" }, opts)) || this;
8
- _this.name = "InvalidRequestException";
9
- _this.$fault = "client";
10
- Object.setPrototypeOf(_this, InvalidRequestException.prototype);
11
- return _this;
3
+ export class InvalidRequestException extends __BaseException {
4
+ constructor(opts) {
5
+ super({
6
+ name: "InvalidRequestException",
7
+ $fault: "client",
8
+ ...opts,
9
+ });
10
+ this.name = "InvalidRequestException";
11
+ this.$fault = "client";
12
+ Object.setPrototypeOf(this, InvalidRequestException.prototype);
12
13
  }
13
- return InvalidRequestException;
14
- }(__BaseException));
15
- export { InvalidRequestException };
16
- var ResourceNotFoundException = (function (_super) {
17
- __extends(ResourceNotFoundException, _super);
18
- function ResourceNotFoundException(opts) {
19
- var _this = _super.call(this, __assign({ name: "ResourceNotFoundException", $fault: "client" }, opts)) || this;
20
- _this.name = "ResourceNotFoundException";
21
- _this.$fault = "client";
22
- Object.setPrototypeOf(_this, ResourceNotFoundException.prototype);
23
- return _this;
14
+ }
15
+ export class ResourceNotFoundException extends __BaseException {
16
+ constructor(opts) {
17
+ super({
18
+ name: "ResourceNotFoundException",
19
+ $fault: "client",
20
+ ...opts,
21
+ });
22
+ this.name = "ResourceNotFoundException";
23
+ this.$fault = "client";
24
+ Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
24
25
  }
25
- return ResourceNotFoundException;
26
- }(__BaseException));
27
- export { ResourceNotFoundException };
28
- var TooManyRequestsException = (function (_super) {
29
- __extends(TooManyRequestsException, _super);
30
- function TooManyRequestsException(opts) {
31
- var _this = _super.call(this, __assign({ name: "TooManyRequestsException", $fault: "client" }, opts)) || this;
32
- _this.name = "TooManyRequestsException";
33
- _this.$fault = "client";
34
- Object.setPrototypeOf(_this, TooManyRequestsException.prototype);
35
- return _this;
26
+ }
27
+ export class TooManyRequestsException extends __BaseException {
28
+ constructor(opts) {
29
+ super({
30
+ name: "TooManyRequestsException",
31
+ $fault: "client",
32
+ ...opts,
33
+ });
34
+ this.name = "TooManyRequestsException";
35
+ this.$fault = "client";
36
+ Object.setPrototypeOf(this, TooManyRequestsException.prototype);
36
37
  }
37
- return TooManyRequestsException;
38
- }(__BaseException));
39
- export { TooManyRequestsException };
40
- var UnauthorizedException = (function (_super) {
41
- __extends(UnauthorizedException, _super);
42
- function UnauthorizedException(opts) {
43
- var _this = _super.call(this, __assign({ name: "UnauthorizedException", $fault: "client" }, opts)) || this;
44
- _this.name = "UnauthorizedException";
45
- _this.$fault = "client";
46
- Object.setPrototypeOf(_this, UnauthorizedException.prototype);
47
- return _this;
38
+ }
39
+ export class UnauthorizedException extends __BaseException {
40
+ constructor(opts) {
41
+ super({
42
+ name: "UnauthorizedException",
43
+ $fault: "client",
44
+ ...opts,
45
+ });
46
+ this.name = "UnauthorizedException";
47
+ this.$fault = "client";
48
+ Object.setPrototypeOf(this, UnauthorizedException.prototype);
48
49
  }
49
- return UnauthorizedException;
50
- }(__BaseException));
51
- export { UnauthorizedException };
52
- export var AccountInfoFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
53
- export var GetRoleCredentialsRequestFilterSensitiveLog = function (obj) { return (__assign(__assign({}, obj), (obj.accessToken && { accessToken: SENSITIVE_STRING }))); };
54
- export var RoleCredentialsFilterSensitiveLog = function (obj) { return (__assign(__assign(__assign({}, obj), (obj.secretAccessKey && { secretAccessKey: SENSITIVE_STRING })), (obj.sessionToken && { sessionToken: SENSITIVE_STRING }))); };
55
- export var GetRoleCredentialsResponseFilterSensitiveLog = function (obj) { return (__assign(__assign({}, obj), (obj.roleCredentials && { roleCredentials: RoleCredentialsFilterSensitiveLog(obj.roleCredentials) }))); };
56
- export var ListAccountRolesRequestFilterSensitiveLog = function (obj) { return (__assign(__assign({}, obj), (obj.accessToken && { accessToken: SENSITIVE_STRING }))); };
57
- export var RoleInfoFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
58
- export var ListAccountRolesResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
59
- export var ListAccountsRequestFilterSensitiveLog = function (obj) { return (__assign(__assign({}, obj), (obj.accessToken && { accessToken: SENSITIVE_STRING }))); };
60
- export var ListAccountsResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
61
- export var LogoutRequestFilterSensitiveLog = function (obj) { return (__assign(__assign({}, obj), (obj.accessToken && { accessToken: SENSITIVE_STRING }))); };
50
+ }
51
+ export const AccountInfoFilterSensitiveLog = (obj) => ({
52
+ ...obj,
53
+ });
54
+ export const GetRoleCredentialsRequestFilterSensitiveLog = (obj) => ({
55
+ ...obj,
56
+ ...(obj.accessToken && { accessToken: SENSITIVE_STRING }),
57
+ });
58
+ export const RoleCredentialsFilterSensitiveLog = (obj) => ({
59
+ ...obj,
60
+ ...(obj.secretAccessKey && { secretAccessKey: SENSITIVE_STRING }),
61
+ ...(obj.sessionToken && { sessionToken: SENSITIVE_STRING }),
62
+ });
63
+ export const GetRoleCredentialsResponseFilterSensitiveLog = (obj) => ({
64
+ ...obj,
65
+ ...(obj.roleCredentials && { roleCredentials: RoleCredentialsFilterSensitiveLog(obj.roleCredentials) }),
66
+ });
67
+ export const ListAccountRolesRequestFilterSensitiveLog = (obj) => ({
68
+ ...obj,
69
+ ...(obj.accessToken && { accessToken: SENSITIVE_STRING }),
70
+ });
71
+ export const RoleInfoFilterSensitiveLog = (obj) => ({
72
+ ...obj,
73
+ });
74
+ export const ListAccountRolesResponseFilterSensitiveLog = (obj) => ({
75
+ ...obj,
76
+ });
77
+ export const ListAccountsRequestFilterSensitiveLog = (obj) => ({
78
+ ...obj,
79
+ ...(obj.accessToken && { accessToken: SENSITIVE_STRING }),
80
+ });
81
+ export const ListAccountsResponseFilterSensitiveLog = (obj) => ({
82
+ ...obj,
83
+ });
84
+ export const LogoutRequestFilterSensitiveLog = (obj) => ({
85
+ ...obj,
86
+ ...(obj.accessToken && { accessToken: SENSITIVE_STRING }),
87
+ });
@@ -1,75 +1,32 @@
1
- import { __asyncGenerator, __await, __awaiter, __generator, __read, __spreadArray } from "tslib";
2
1
  import { ListAccountRolesCommand, } from "../commands/ListAccountRolesCommand";
3
2
  import { SSO } from "../SSO";
4
3
  import { SSOClient } from "../SSOClient";
5
- var makePagedClientRequest = function (client, input) {
6
- var args = [];
7
- for (var _i = 2; _i < arguments.length; _i++) {
8
- args[_i - 2] = arguments[_i];
9
- }
10
- return __awaiter(void 0, void 0, void 0, function () {
11
- return __generator(this, function (_a) {
12
- switch (_a.label) {
13
- case 0: return [4, client.send.apply(client, __spreadArray([new ListAccountRolesCommand(input)], __read(args), false))];
14
- case 1: return [2, _a.sent()];
15
- }
16
- });
17
- });
4
+ const makePagedClientRequest = async (client, input, ...args) => {
5
+ return await client.send(new ListAccountRolesCommand(input), ...args);
18
6
  };
19
- var makePagedRequest = function (client, input) {
20
- var args = [];
21
- for (var _i = 2; _i < arguments.length; _i++) {
22
- args[_i - 2] = arguments[_i];
23
- }
24
- return __awaiter(void 0, void 0, void 0, function () {
25
- return __generator(this, function (_a) {
26
- switch (_a.label) {
27
- case 0: return [4, client.listAccountRoles.apply(client, __spreadArray([input], __read(args), false))];
28
- case 1: return [2, _a.sent()];
29
- }
30
- });
31
- });
7
+ const makePagedRequest = async (client, input, ...args) => {
8
+ return await client.listAccountRoles(input, ...args);
32
9
  };
33
- export function paginateListAccountRoles(config, input) {
34
- var additionalArguments = [];
35
- for (var _i = 2; _i < arguments.length; _i++) {
36
- additionalArguments[_i - 2] = arguments[_i];
10
+ export async function* paginateListAccountRoles(config, input, ...additionalArguments) {
11
+ let token = config.startingToken || undefined;
12
+ let hasNext = true;
13
+ let page;
14
+ while (hasNext) {
15
+ input.nextToken = token;
16
+ input["maxResults"] = config.pageSize;
17
+ if (config.client instanceof SSO) {
18
+ page = await makePagedRequest(config.client, input, ...additionalArguments);
19
+ }
20
+ else if (config.client instanceof SSOClient) {
21
+ page = await makePagedClientRequest(config.client, input, ...additionalArguments);
22
+ }
23
+ else {
24
+ throw new Error("Invalid client, expected SSO | SSOClient");
25
+ }
26
+ yield page;
27
+ const prevToken = token;
28
+ token = page.nextToken;
29
+ hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
37
30
  }
38
- return __asyncGenerator(this, arguments, function paginateListAccountRoles_1() {
39
- var token, hasNext, page, prevToken;
40
- return __generator(this, function (_a) {
41
- switch (_a.label) {
42
- case 0:
43
- token = config.startingToken || undefined;
44
- hasNext = true;
45
- _a.label = 1;
46
- case 1:
47
- if (!hasNext) return [3, 9];
48
- input.nextToken = token;
49
- input["maxResults"] = config.pageSize;
50
- if (!(config.client instanceof SSO)) return [3, 3];
51
- return [4, __await(makePagedRequest.apply(void 0, __spreadArray([config.client, input], __read(additionalArguments), false)))];
52
- case 2:
53
- page = _a.sent();
54
- return [3, 6];
55
- case 3:
56
- if (!(config.client instanceof SSOClient)) return [3, 5];
57
- return [4, __await(makePagedClientRequest.apply(void 0, __spreadArray([config.client, input], __read(additionalArguments), false)))];
58
- case 4:
59
- page = _a.sent();
60
- return [3, 6];
61
- case 5: throw new Error("Invalid client, expected SSO | SSOClient");
62
- case 6: return [4, __await(page)];
63
- case 7: return [4, _a.sent()];
64
- case 8:
65
- _a.sent();
66
- prevToken = token;
67
- token = page.nextToken;
68
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
69
- return [3, 1];
70
- case 9: return [4, __await(undefined)];
71
- case 10: return [2, _a.sent()];
72
- }
73
- });
74
- });
31
+ return undefined;
75
32
  }
@@ -1,75 +1,32 @@
1
- import { __asyncGenerator, __await, __awaiter, __generator, __read, __spreadArray } from "tslib";
2
1
  import { ListAccountsCommand, } from "../commands/ListAccountsCommand";
3
2
  import { SSO } from "../SSO";
4
3
  import { SSOClient } from "../SSOClient";
5
- var makePagedClientRequest = function (client, input) {
6
- var args = [];
7
- for (var _i = 2; _i < arguments.length; _i++) {
8
- args[_i - 2] = arguments[_i];
9
- }
10
- return __awaiter(void 0, void 0, void 0, function () {
11
- return __generator(this, function (_a) {
12
- switch (_a.label) {
13
- case 0: return [4, client.send.apply(client, __spreadArray([new ListAccountsCommand(input)], __read(args), false))];
14
- case 1: return [2, _a.sent()];
15
- }
16
- });
17
- });
4
+ const makePagedClientRequest = async (client, input, ...args) => {
5
+ return await client.send(new ListAccountsCommand(input), ...args);
18
6
  };
19
- var makePagedRequest = function (client, input) {
20
- var args = [];
21
- for (var _i = 2; _i < arguments.length; _i++) {
22
- args[_i - 2] = arguments[_i];
23
- }
24
- return __awaiter(void 0, void 0, void 0, function () {
25
- return __generator(this, function (_a) {
26
- switch (_a.label) {
27
- case 0: return [4, client.listAccounts.apply(client, __spreadArray([input], __read(args), false))];
28
- case 1: return [2, _a.sent()];
29
- }
30
- });
31
- });
7
+ const makePagedRequest = async (client, input, ...args) => {
8
+ return await client.listAccounts(input, ...args);
32
9
  };
33
- export function paginateListAccounts(config, input) {
34
- var additionalArguments = [];
35
- for (var _i = 2; _i < arguments.length; _i++) {
36
- additionalArguments[_i - 2] = arguments[_i];
10
+ export async function* paginateListAccounts(config, input, ...additionalArguments) {
11
+ let token = config.startingToken || undefined;
12
+ let hasNext = true;
13
+ let page;
14
+ while (hasNext) {
15
+ input.nextToken = token;
16
+ input["maxResults"] = config.pageSize;
17
+ if (config.client instanceof SSO) {
18
+ page = await makePagedRequest(config.client, input, ...additionalArguments);
19
+ }
20
+ else if (config.client instanceof SSOClient) {
21
+ page = await makePagedClientRequest(config.client, input, ...additionalArguments);
22
+ }
23
+ else {
24
+ throw new Error("Invalid client, expected SSO | SSOClient");
25
+ }
26
+ yield page;
27
+ const prevToken = token;
28
+ token = page.nextToken;
29
+ hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
37
30
  }
38
- return __asyncGenerator(this, arguments, function paginateListAccounts_1() {
39
- var token, hasNext, page, prevToken;
40
- return __generator(this, function (_a) {
41
- switch (_a.label) {
42
- case 0:
43
- token = config.startingToken || undefined;
44
- hasNext = true;
45
- _a.label = 1;
46
- case 1:
47
- if (!hasNext) return [3, 9];
48
- input.nextToken = token;
49
- input["maxResults"] = config.pageSize;
50
- if (!(config.client instanceof SSO)) return [3, 3];
51
- return [4, __await(makePagedRequest.apply(void 0, __spreadArray([config.client, input], __read(additionalArguments), false)))];
52
- case 2:
53
- page = _a.sent();
54
- return [3, 6];
55
- case 3:
56
- if (!(config.client instanceof SSOClient)) return [3, 5];
57
- return [4, __await(makePagedClientRequest.apply(void 0, __spreadArray([config.client, input], __read(additionalArguments), false)))];
58
- case 4:
59
- page = _a.sent();
60
- return [3, 6];
61
- case 5: throw new Error("Invalid client, expected SSO | SSOClient");
62
- case 6: return [4, __await(page)];
63
- case 7: return [4, _a.sent()];
64
- case 8:
65
- _a.sent();
66
- prevToken = token;
67
- token = page.nextToken;
68
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
69
- return [3, 1];
70
- case 9: return [4, __await(undefined)];
71
- case 10: return [2, _a.sent()];
72
- }
73
- });
74
- });
31
+ return undefined;
75
32
  }