@aws-sdk/client-health 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.
Files changed (33) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist-cjs/protocols/Aws_json1_1.js +19 -13
  3. package/dist-es/Health.js +54 -61
  4. package/dist-es/HealthClient.js +22 -28
  5. package/dist-es/commands/DescribeAffectedAccountsForOrganizationCommand.js +21 -28
  6. package/dist-es/commands/DescribeAffectedEntitiesCommand.js +21 -28
  7. package/dist-es/commands/DescribeAffectedEntitiesForOrganizationCommand.js +21 -28
  8. package/dist-es/commands/DescribeEntityAggregatesCommand.js +21 -28
  9. package/dist-es/commands/DescribeEventAggregatesCommand.js +21 -28
  10. package/dist-es/commands/DescribeEventDetailsCommand.js +21 -28
  11. package/dist-es/commands/DescribeEventDetailsForOrganizationCommand.js +21 -28
  12. package/dist-es/commands/DescribeEventTypesCommand.js +21 -28
  13. package/dist-es/commands/DescribeEventsCommand.js +21 -28
  14. package/dist-es/commands/DescribeEventsForOrganizationCommand.js +21 -28
  15. package/dist-es/commands/DescribeHealthServiceStatusForOrganizationCommand.js +22 -29
  16. package/dist-es/commands/DisableHealthServiceAccessForOrganizationCommand.js +23 -30
  17. package/dist-es/commands/EnableHealthServiceAccessForOrganizationCommand.js +23 -30
  18. package/dist-es/endpoints.js +8 -8
  19. package/dist-es/models/HealthServiceException.js +5 -10
  20. package/dist-es/models/models_0.js +150 -73
  21. package/dist-es/pagination/DescribeAffectedAccountsForOrganizationPaginator.js +25 -68
  22. package/dist-es/pagination/DescribeAffectedEntitiesForOrganizationPaginator.js +25 -68
  23. package/dist-es/pagination/DescribeAffectedEntitiesPaginator.js +25 -68
  24. package/dist-es/pagination/DescribeEventAggregatesPaginator.js +25 -68
  25. package/dist-es/pagination/DescribeEventTypesPaginator.js +25 -68
  26. package/dist-es/pagination/DescribeEventsForOrganizationPaginator.js +25 -68
  27. package/dist-es/pagination/DescribeEventsPaginator.js +25 -68
  28. package/dist-es/protocols/Aws_json1_1.js +908 -1097
  29. package/dist-es/runtimeConfig.browser.js +26 -12
  30. package/dist-es/runtimeConfig.js +30 -12
  31. package/dist-es/runtimeConfig.native.js +8 -5
  32. package/dist-es/runtimeConfig.shared.js +8 -11
  33. package/package.json +33 -33
@@ -1,38 +1,31 @@
1
- import { __extends } from "tslib";
2
1
  import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3
2
  import { Command as $Command } from "@aws-sdk/smithy-client";
4
3
  import { deserializeAws_json1_1EnableHealthServiceAccessForOrganizationCommand, serializeAws_json1_1EnableHealthServiceAccessForOrganizationCommand, } from "../protocols/Aws_json1_1";
5
- var EnableHealthServiceAccessForOrganizationCommand = (function (_super) {
6
- __extends(EnableHealthServiceAccessForOrganizationCommand, _super);
7
- function EnableHealthServiceAccessForOrganizationCommand(input) {
8
- var _this = _super.call(this) || this;
9
- _this.input = input;
10
- return _this;
4
+ export class EnableHealthServiceAccessForOrganizationCommand extends $Command {
5
+ constructor(input) {
6
+ super();
7
+ this.input = input;
11
8
  }
12
- EnableHealthServiceAccessForOrganizationCommand.prototype.resolveMiddleware = function (clientStack, configuration, options) {
9
+ resolveMiddleware(clientStack, configuration, options) {
13
10
  this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
14
- var stack = clientStack.concat(this.middlewareStack);
15
- var logger = configuration.logger;
16
- var clientName = "HealthClient";
17
- var commandName = "EnableHealthServiceAccessForOrganizationCommand";
18
- var handlerExecutionContext = {
19
- logger: logger,
20
- clientName: clientName,
21
- commandName: commandName,
22
- inputFilterSensitiveLog: function (input) { return input; },
23
- outputFilterSensitiveLog: function (output) { return output; },
11
+ const stack = clientStack.concat(this.middlewareStack);
12
+ const { logger } = configuration;
13
+ const clientName = "HealthClient";
14
+ const commandName = "EnableHealthServiceAccessForOrganizationCommand";
15
+ const handlerExecutionContext = {
16
+ logger,
17
+ clientName,
18
+ commandName,
19
+ inputFilterSensitiveLog: (input) => input,
20
+ outputFilterSensitiveLog: (output) => output,
24
21
  };
25
- var requestHandler = configuration.requestHandler;
26
- return stack.resolve(function (request) {
27
- return requestHandler.handle(request.request, options || {});
28
- }, handlerExecutionContext);
29
- };
30
- EnableHealthServiceAccessForOrganizationCommand.prototype.serialize = function (input, context) {
22
+ const { requestHandler } = configuration;
23
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
24
+ }
25
+ serialize(input, context) {
31
26
  return serializeAws_json1_1EnableHealthServiceAccessForOrganizationCommand(input, context);
32
- };
33
- EnableHealthServiceAccessForOrganizationCommand.prototype.deserialize = function (output, context) {
27
+ }
28
+ deserialize(output, context) {
34
29
  return deserializeAws_json1_1EnableHealthServiceAccessForOrganizationCommand(output, context);
35
- };
36
- return EnableHealthServiceAccessForOrganizationCommand;
37
- }($Command));
38
- export { EnableHealthServiceAccessForOrganizationCommand };
30
+ }
31
+ }
@@ -1,6 +1,5 @@
1
- import { __assign, __awaiter, __generator } from "tslib";
2
1
  import { getRegionInfo } from "@aws-sdk/config-resolver";
3
- var regionHash = {
2
+ const regionHash = {
4
3
  "aws-cn-global": {
5
4
  variants: [
6
5
  {
@@ -20,7 +19,7 @@ var regionHash = {
20
19
  signingRegion: "us-east-1",
21
20
  },
22
21
  };
23
- var partitionHash = {
22
+ const partitionHash = {
24
23
  aws: {
25
24
  regions: [
26
25
  "af-south-1",
@@ -144,8 +143,9 @@ var partitionHash = {
144
143
  ],
145
144
  },
146
145
  };
147
- export var defaultRegionInfoProvider = function (region, options) { return __awaiter(void 0, void 0, void 0, function () {
148
- return __generator(this, function (_a) {
149
- return [2, getRegionInfo(region, __assign(__assign({}, options), { signingService: "health", regionHash: regionHash, partitionHash: partitionHash }))];
150
- });
151
- }); };
146
+ export const defaultRegionInfoProvider = async (region, options) => getRegionInfo(region, {
147
+ ...options,
148
+ signingService: "health",
149
+ regionHash,
150
+ partitionHash,
151
+ });
@@ -1,12 +1,7 @@
1
- import { __extends } from "tslib";
2
1
  import { ServiceException as __ServiceException, } from "@aws-sdk/smithy-client";
3
- var HealthServiceException = (function (_super) {
4
- __extends(HealthServiceException, _super);
5
- function HealthServiceException(options) {
6
- var _this = _super.call(this, options) || this;
7
- Object.setPrototypeOf(_this, HealthServiceException.prototype);
8
- return _this;
2
+ export class HealthServiceException extends __ServiceException {
3
+ constructor(options) {
4
+ super(options);
5
+ Object.setPrototypeOf(this, HealthServiceException.prototype);
9
6
  }
10
- return HealthServiceException;
11
- }(__ServiceException));
12
- export { HealthServiceException };
7
+ }
@@ -1,4 +1,3 @@
1
- import { __assign, __extends } from "tslib";
2
1
  import { HealthServiceException as __BaseException } from "./HealthServiceException";
3
2
  export var EntityStatusCode;
4
3
  (function (EntityStatusCode) {
@@ -12,30 +11,30 @@ export var EventScopeCode;
12
11
  EventScopeCode["NONE"] = "NONE";
13
12
  EventScopeCode["PUBLIC"] = "PUBLIC";
14
13
  })(EventScopeCode || (EventScopeCode = {}));
15
- var InvalidPaginationToken = (function (_super) {
16
- __extends(InvalidPaginationToken, _super);
17
- function InvalidPaginationToken(opts) {
18
- var _this = _super.call(this, __assign({ name: "InvalidPaginationToken", $fault: "client" }, opts)) || this;
19
- _this.name = "InvalidPaginationToken";
20
- _this.$fault = "client";
21
- Object.setPrototypeOf(_this, InvalidPaginationToken.prototype);
22
- return _this;
14
+ export class InvalidPaginationToken extends __BaseException {
15
+ constructor(opts) {
16
+ super({
17
+ name: "InvalidPaginationToken",
18
+ $fault: "client",
19
+ ...opts,
20
+ });
21
+ this.name = "InvalidPaginationToken";
22
+ this.$fault = "client";
23
+ Object.setPrototypeOf(this, InvalidPaginationToken.prototype);
23
24
  }
24
- return InvalidPaginationToken;
25
- }(__BaseException));
26
- export { InvalidPaginationToken };
27
- var UnsupportedLocale = (function (_super) {
28
- __extends(UnsupportedLocale, _super);
29
- function UnsupportedLocale(opts) {
30
- var _this = _super.call(this, __assign({ name: "UnsupportedLocale", $fault: "client" }, opts)) || this;
31
- _this.name = "UnsupportedLocale";
32
- _this.$fault = "client";
33
- Object.setPrototypeOf(_this, UnsupportedLocale.prototype);
34
- return _this;
25
+ }
26
+ export class UnsupportedLocale extends __BaseException {
27
+ constructor(opts) {
28
+ super({
29
+ name: "UnsupportedLocale",
30
+ $fault: "client",
31
+ ...opts,
32
+ });
33
+ this.name = "UnsupportedLocale";
34
+ this.$fault = "client";
35
+ Object.setPrototypeOf(this, UnsupportedLocale.prototype);
35
36
  }
36
- return UnsupportedLocale;
37
- }(__BaseException));
38
- export { UnsupportedLocale };
37
+ }
39
38
  export var EventAggregateField;
40
39
  (function (EventAggregateField) {
41
40
  EventAggregateField["EventTypeCategory"] = "eventTypeCategory";
@@ -53,54 +52,132 @@ export var EventTypeCategory;
53
52
  EventTypeCategory["ISSUE"] = "issue";
54
53
  EventTypeCategory["SCHEDULED_CHANGE"] = "scheduledChange";
55
54
  })(EventTypeCategory || (EventTypeCategory = {}));
56
- var ConcurrentModificationException = (function (_super) {
57
- __extends(ConcurrentModificationException, _super);
58
- function ConcurrentModificationException(opts) {
59
- var _this = _super.call(this, __assign({ name: "ConcurrentModificationException", $fault: "client" }, opts)) || this;
60
- _this.name = "ConcurrentModificationException";
61
- _this.$fault = "client";
62
- Object.setPrototypeOf(_this, ConcurrentModificationException.prototype);
63
- return _this;
55
+ export class ConcurrentModificationException extends __BaseException {
56
+ constructor(opts) {
57
+ super({
58
+ name: "ConcurrentModificationException",
59
+ $fault: "client",
60
+ ...opts,
61
+ });
62
+ this.name = "ConcurrentModificationException";
63
+ this.$fault = "client";
64
+ Object.setPrototypeOf(this, ConcurrentModificationException.prototype);
64
65
  }
65
- return ConcurrentModificationException;
66
- }(__BaseException));
67
- export { ConcurrentModificationException };
68
- export var AffectedEntityFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
69
- export var DescribeAffectedAccountsForOrganizationRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
70
- export var DescribeAffectedAccountsForOrganizationResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
71
- export var DateTimeRangeFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
72
- export var EntityFilterFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
73
- export var DescribeAffectedEntitiesRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
74
- export var DescribeAffectedEntitiesResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
75
- export var EventAccountFilterFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
76
- export var DescribeAffectedEntitiesForOrganizationRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
77
- export var OrganizationAffectedEntitiesErrorItemFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
78
- export var DescribeAffectedEntitiesForOrganizationResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
79
- export var DescribeEntityAggregatesRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
80
- export var EntityAggregateFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
81
- export var DescribeEntityAggregatesResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
82
- export var EventFilterFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
83
- export var DescribeEventAggregatesRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
84
- export var EventAggregateFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
85
- export var DescribeEventAggregatesResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
86
- export var DescribeEventDetailsRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
87
- export var EventDetailsErrorItemFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
88
- export var EventFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
89
- export var EventDescriptionFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
90
- export var EventDetailsFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
91
- export var DescribeEventDetailsResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
92
- export var DescribeEventDetailsForOrganizationRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
93
- export var OrganizationEventDetailsErrorItemFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
94
- export var OrganizationEventDetailsFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
95
- export var DescribeEventDetailsForOrganizationResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
96
- export var DescribeEventsRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
97
- export var DescribeEventsResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
98
- export var OrganizationEventFilterFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
99
- export var DescribeEventsForOrganizationRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
100
- export var OrganizationEventFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
101
- export var DescribeEventsForOrganizationResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
102
- export var EventTypeFilterFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
103
- export var DescribeEventTypesRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
104
- export var EventTypeFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
105
- export var DescribeEventTypesResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
106
- export var DescribeHealthServiceStatusForOrganizationResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
66
+ }
67
+ export const AffectedEntityFilterSensitiveLog = (obj) => ({
68
+ ...obj,
69
+ });
70
+ export const DescribeAffectedAccountsForOrganizationRequestFilterSensitiveLog = (obj) => ({
71
+ ...obj,
72
+ });
73
+ export const DescribeAffectedAccountsForOrganizationResponseFilterSensitiveLog = (obj) => ({
74
+ ...obj,
75
+ });
76
+ export const DateTimeRangeFilterSensitiveLog = (obj) => ({
77
+ ...obj,
78
+ });
79
+ export const EntityFilterFilterSensitiveLog = (obj) => ({
80
+ ...obj,
81
+ });
82
+ export const DescribeAffectedEntitiesRequestFilterSensitiveLog = (obj) => ({
83
+ ...obj,
84
+ });
85
+ export const DescribeAffectedEntitiesResponseFilterSensitiveLog = (obj) => ({
86
+ ...obj,
87
+ });
88
+ export const EventAccountFilterFilterSensitiveLog = (obj) => ({
89
+ ...obj,
90
+ });
91
+ export const DescribeAffectedEntitiesForOrganizationRequestFilterSensitiveLog = (obj) => ({
92
+ ...obj,
93
+ });
94
+ export const OrganizationAffectedEntitiesErrorItemFilterSensitiveLog = (obj) => ({
95
+ ...obj,
96
+ });
97
+ export const DescribeAffectedEntitiesForOrganizationResponseFilterSensitiveLog = (obj) => ({
98
+ ...obj,
99
+ });
100
+ export const DescribeEntityAggregatesRequestFilterSensitiveLog = (obj) => ({
101
+ ...obj,
102
+ });
103
+ export const EntityAggregateFilterSensitiveLog = (obj) => ({
104
+ ...obj,
105
+ });
106
+ export const DescribeEntityAggregatesResponseFilterSensitiveLog = (obj) => ({
107
+ ...obj,
108
+ });
109
+ export const EventFilterFilterSensitiveLog = (obj) => ({
110
+ ...obj,
111
+ });
112
+ export const DescribeEventAggregatesRequestFilterSensitiveLog = (obj) => ({
113
+ ...obj,
114
+ });
115
+ export const EventAggregateFilterSensitiveLog = (obj) => ({
116
+ ...obj,
117
+ });
118
+ export const DescribeEventAggregatesResponseFilterSensitiveLog = (obj) => ({
119
+ ...obj,
120
+ });
121
+ export const DescribeEventDetailsRequestFilterSensitiveLog = (obj) => ({
122
+ ...obj,
123
+ });
124
+ export const EventDetailsErrorItemFilterSensitiveLog = (obj) => ({
125
+ ...obj,
126
+ });
127
+ export const EventFilterSensitiveLog = (obj) => ({
128
+ ...obj,
129
+ });
130
+ export const EventDescriptionFilterSensitiveLog = (obj) => ({
131
+ ...obj,
132
+ });
133
+ export const EventDetailsFilterSensitiveLog = (obj) => ({
134
+ ...obj,
135
+ });
136
+ export const DescribeEventDetailsResponseFilterSensitiveLog = (obj) => ({
137
+ ...obj,
138
+ });
139
+ export const DescribeEventDetailsForOrganizationRequestFilterSensitiveLog = (obj) => ({
140
+ ...obj,
141
+ });
142
+ export const OrganizationEventDetailsErrorItemFilterSensitiveLog = (obj) => ({
143
+ ...obj,
144
+ });
145
+ export const OrganizationEventDetailsFilterSensitiveLog = (obj) => ({
146
+ ...obj,
147
+ });
148
+ export const DescribeEventDetailsForOrganizationResponseFilterSensitiveLog = (obj) => ({
149
+ ...obj,
150
+ });
151
+ export const DescribeEventsRequestFilterSensitiveLog = (obj) => ({
152
+ ...obj,
153
+ });
154
+ export const DescribeEventsResponseFilterSensitiveLog = (obj) => ({
155
+ ...obj,
156
+ });
157
+ export const OrganizationEventFilterFilterSensitiveLog = (obj) => ({
158
+ ...obj,
159
+ });
160
+ export const DescribeEventsForOrganizationRequestFilterSensitiveLog = (obj) => ({
161
+ ...obj,
162
+ });
163
+ export const OrganizationEventFilterSensitiveLog = (obj) => ({
164
+ ...obj,
165
+ });
166
+ export const DescribeEventsForOrganizationResponseFilterSensitiveLog = (obj) => ({
167
+ ...obj,
168
+ });
169
+ export const EventTypeFilterFilterSensitiveLog = (obj) => ({
170
+ ...obj,
171
+ });
172
+ export const DescribeEventTypesRequestFilterSensitiveLog = (obj) => ({
173
+ ...obj,
174
+ });
175
+ export const EventTypeFilterSensitiveLog = (obj) => ({
176
+ ...obj,
177
+ });
178
+ export const DescribeEventTypesResponseFilterSensitiveLog = (obj) => ({
179
+ ...obj,
180
+ });
181
+ export const DescribeHealthServiceStatusForOrganizationResponseFilterSensitiveLog = (obj) => ({
182
+ ...obj,
183
+ });
@@ -1,75 +1,32 @@
1
- import { __asyncGenerator, __await, __awaiter, __generator, __read, __spreadArray } from "tslib";
2
1
  import { DescribeAffectedAccountsForOrganizationCommand, } from "../commands/DescribeAffectedAccountsForOrganizationCommand";
3
2
  import { Health } from "../Health";
4
3
  import { HealthClient } from "../HealthClient";
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 DescribeAffectedAccountsForOrganizationCommand(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 DescribeAffectedAccountsForOrganizationCommand(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.describeAffectedAccountsForOrganization.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.describeAffectedAccountsForOrganization(input, ...args);
32
9
  };
33
- export function paginateDescribeAffectedAccountsForOrganization(config, input) {
34
- var additionalArguments = [];
35
- for (var _i = 2; _i < arguments.length; _i++) {
36
- additionalArguments[_i - 2] = arguments[_i];
10
+ export async function* paginateDescribeAffectedAccountsForOrganization(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 Health) {
18
+ page = await makePagedRequest(config.client, input, ...additionalArguments);
19
+ }
20
+ else if (config.client instanceof HealthClient) {
21
+ page = await makePagedClientRequest(config.client, input, ...additionalArguments);
22
+ }
23
+ else {
24
+ throw new Error("Invalid client, expected Health | HealthClient");
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 paginateDescribeAffectedAccountsForOrganization_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 Health)) 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 HealthClient)) 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 Health | HealthClient");
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 { DescribeAffectedEntitiesForOrganizationCommand, } from "../commands/DescribeAffectedEntitiesForOrganizationCommand";
3
2
  import { Health } from "../Health";
4
3
  import { HealthClient } from "../HealthClient";
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 DescribeAffectedEntitiesForOrganizationCommand(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 DescribeAffectedEntitiesForOrganizationCommand(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.describeAffectedEntitiesForOrganization.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.describeAffectedEntitiesForOrganization(input, ...args);
32
9
  };
33
- export function paginateDescribeAffectedEntitiesForOrganization(config, input) {
34
- var additionalArguments = [];
35
- for (var _i = 2; _i < arguments.length; _i++) {
36
- additionalArguments[_i - 2] = arguments[_i];
10
+ export async function* paginateDescribeAffectedEntitiesForOrganization(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 Health) {
18
+ page = await makePagedRequest(config.client, input, ...additionalArguments);
19
+ }
20
+ else if (config.client instanceof HealthClient) {
21
+ page = await makePagedClientRequest(config.client, input, ...additionalArguments);
22
+ }
23
+ else {
24
+ throw new Error("Invalid client, expected Health | HealthClient");
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 paginateDescribeAffectedEntitiesForOrganization_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 Health)) 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 HealthClient)) 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 Health | HealthClient");
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
  }