@aws-sdk/client-application-auto-scaling 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 (27) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist-cjs/protocols/Aws_json1_1.js +16 -10
  3. package/dist-es/ApplicationAutoScaling.js +42 -49
  4. package/dist-es/ApplicationAutoScalingClient.js +22 -28
  5. package/dist-es/commands/DeleteScalingPolicyCommand.js +21 -28
  6. package/dist-es/commands/DeleteScheduledActionCommand.js +21 -28
  7. package/dist-es/commands/DeregisterScalableTargetCommand.js +21 -28
  8. package/dist-es/commands/DescribeScalableTargetsCommand.js +21 -28
  9. package/dist-es/commands/DescribeScalingActivitiesCommand.js +21 -28
  10. package/dist-es/commands/DescribeScalingPoliciesCommand.js +21 -28
  11. package/dist-es/commands/DescribeScheduledActionsCommand.js +21 -28
  12. package/dist-es/commands/PutScalingPolicyCommand.js +21 -28
  13. package/dist-es/commands/PutScheduledActionCommand.js +21 -28
  14. package/dist-es/commands/RegisterScalableTargetCommand.js +21 -28
  15. package/dist-es/endpoints.js +8 -8
  16. package/dist-es/models/ApplicationAutoScalingServiceException.js +5 -10
  17. package/dist-es/models/models_0.js +183 -118
  18. package/dist-es/pagination/DescribeScalableTargetsPaginator.js +25 -68
  19. package/dist-es/pagination/DescribeScalingActivitiesPaginator.js +25 -68
  20. package/dist-es/pagination/DescribeScalingPoliciesPaginator.js +25 -68
  21. package/dist-es/pagination/DescribeScheduledActionsPaginator.js +25 -68
  22. package/dist-es/protocols/Aws_json1_1.js +848 -991
  23. package/dist-es/runtimeConfig.browser.js +26 -12
  24. package/dist-es/runtimeConfig.js +30 -12
  25. package/dist-es/runtimeConfig.native.js +8 -5
  26. package/dist-es/runtimeConfig.shared.js +8 -11
  27. package/package.json +33 -33
@@ -1,4 +1,3 @@
1
- import { __assign, __extends } from "tslib";
2
1
  import { ApplicationAutoScalingServiceException as __BaseException } from "./ApplicationAutoScalingServiceException";
3
2
  export var AdjustmentType;
4
3
  (function (AdjustmentType) {
@@ -6,19 +5,19 @@ export var AdjustmentType;
6
5
  AdjustmentType["ExactCapacity"] = "ExactCapacity";
7
6
  AdjustmentType["PercentChangeInCapacity"] = "PercentChangeInCapacity";
8
7
  })(AdjustmentType || (AdjustmentType = {}));
9
- var ConcurrentUpdateException = (function (_super) {
10
- __extends(ConcurrentUpdateException, _super);
11
- function ConcurrentUpdateException(opts) {
12
- var _this = _super.call(this, __assign({ name: "ConcurrentUpdateException", $fault: "server" }, opts)) || this;
13
- _this.name = "ConcurrentUpdateException";
14
- _this.$fault = "server";
15
- Object.setPrototypeOf(_this, ConcurrentUpdateException.prototype);
16
- _this.Message = opts.Message;
17
- return _this;
8
+ export class ConcurrentUpdateException extends __BaseException {
9
+ constructor(opts) {
10
+ super({
11
+ name: "ConcurrentUpdateException",
12
+ $fault: "server",
13
+ ...opts,
14
+ });
15
+ this.name = "ConcurrentUpdateException";
16
+ this.$fault = "server";
17
+ Object.setPrototypeOf(this, ConcurrentUpdateException.prototype);
18
+ this.Message = opts.Message;
18
19
  }
19
- return ConcurrentUpdateException;
20
- }(__BaseException));
21
- export { ConcurrentUpdateException };
20
+ }
22
21
  export var ScalableDimension;
23
22
  (function (ScalableDimension) {
24
23
  ScalableDimension["AppstreamFleetDesiredCapacity"] = "appstream:fleet:DesiredCapacity";
@@ -59,58 +58,58 @@ export var ServiceNamespace;
59
58
  ServiceNamespace["RDS"] = "rds";
60
59
  ServiceNamespace["SAGEMAKER"] = "sagemaker";
61
60
  })(ServiceNamespace || (ServiceNamespace = {}));
62
- var InternalServiceException = (function (_super) {
63
- __extends(InternalServiceException, _super);
64
- function InternalServiceException(opts) {
65
- var _this = _super.call(this, __assign({ name: "InternalServiceException", $fault: "server" }, opts)) || this;
66
- _this.name = "InternalServiceException";
67
- _this.$fault = "server";
68
- Object.setPrototypeOf(_this, InternalServiceException.prototype);
69
- _this.Message = opts.Message;
70
- return _this;
61
+ export class InternalServiceException extends __BaseException {
62
+ constructor(opts) {
63
+ super({
64
+ name: "InternalServiceException",
65
+ $fault: "server",
66
+ ...opts,
67
+ });
68
+ this.name = "InternalServiceException";
69
+ this.$fault = "server";
70
+ Object.setPrototypeOf(this, InternalServiceException.prototype);
71
+ this.Message = opts.Message;
71
72
  }
72
- return InternalServiceException;
73
- }(__BaseException));
74
- export { InternalServiceException };
75
- var ObjectNotFoundException = (function (_super) {
76
- __extends(ObjectNotFoundException, _super);
77
- function ObjectNotFoundException(opts) {
78
- var _this = _super.call(this, __assign({ name: "ObjectNotFoundException", $fault: "client" }, opts)) || this;
79
- _this.name = "ObjectNotFoundException";
80
- _this.$fault = "client";
81
- Object.setPrototypeOf(_this, ObjectNotFoundException.prototype);
82
- _this.Message = opts.Message;
83
- return _this;
73
+ }
74
+ export class ObjectNotFoundException extends __BaseException {
75
+ constructor(opts) {
76
+ super({
77
+ name: "ObjectNotFoundException",
78
+ $fault: "client",
79
+ ...opts,
80
+ });
81
+ this.name = "ObjectNotFoundException";
82
+ this.$fault = "client";
83
+ Object.setPrototypeOf(this, ObjectNotFoundException.prototype);
84
+ this.Message = opts.Message;
84
85
  }
85
- return ObjectNotFoundException;
86
- }(__BaseException));
87
- export { ObjectNotFoundException };
88
- var ValidationException = (function (_super) {
89
- __extends(ValidationException, _super);
90
- function ValidationException(opts) {
91
- var _this = _super.call(this, __assign({ name: "ValidationException", $fault: "client" }, opts)) || this;
92
- _this.name = "ValidationException";
93
- _this.$fault = "client";
94
- Object.setPrototypeOf(_this, ValidationException.prototype);
95
- _this.Message = opts.Message;
96
- return _this;
86
+ }
87
+ export class ValidationException extends __BaseException {
88
+ constructor(opts) {
89
+ super({
90
+ name: "ValidationException",
91
+ $fault: "client",
92
+ ...opts,
93
+ });
94
+ this.name = "ValidationException";
95
+ this.$fault = "client";
96
+ Object.setPrototypeOf(this, ValidationException.prototype);
97
+ this.Message = opts.Message;
97
98
  }
98
- return ValidationException;
99
- }(__BaseException));
100
- export { ValidationException };
101
- var InvalidNextTokenException = (function (_super) {
102
- __extends(InvalidNextTokenException, _super);
103
- function InvalidNextTokenException(opts) {
104
- var _this = _super.call(this, __assign({ name: "InvalidNextTokenException", $fault: "client" }, opts)) || this;
105
- _this.name = "InvalidNextTokenException";
106
- _this.$fault = "client";
107
- Object.setPrototypeOf(_this, InvalidNextTokenException.prototype);
108
- _this.Message = opts.Message;
109
- return _this;
99
+ }
100
+ export class InvalidNextTokenException extends __BaseException {
101
+ constructor(opts) {
102
+ super({
103
+ name: "InvalidNextTokenException",
104
+ $fault: "client",
105
+ ...opts,
106
+ });
107
+ this.name = "InvalidNextTokenException";
108
+ this.$fault = "client";
109
+ Object.setPrototypeOf(this, InvalidNextTokenException.prototype);
110
+ this.Message = opts.Message;
110
111
  }
111
- return InvalidNextTokenException;
112
- }(__BaseException));
113
- export { InvalidNextTokenException };
112
+ }
114
113
  export var ScalingActivityStatusCode;
115
114
  (function (ScalingActivityStatusCode) {
116
115
  ScalingActivityStatusCode["Failed"] = "Failed";
@@ -163,62 +162,128 @@ export var MetricType;
163
162
  MetricType["RDSReaderAverageDatabaseConnections"] = "RDSReaderAverageDatabaseConnections";
164
163
  MetricType["SageMakerVariantInvocationsPerInstance"] = "SageMakerVariantInvocationsPerInstance";
165
164
  })(MetricType || (MetricType = {}));
166
- var FailedResourceAccessException = (function (_super) {
167
- __extends(FailedResourceAccessException, _super);
168
- function FailedResourceAccessException(opts) {
169
- var _this = _super.call(this, __assign({ name: "FailedResourceAccessException", $fault: "client" }, opts)) || this;
170
- _this.name = "FailedResourceAccessException";
171
- _this.$fault = "client";
172
- Object.setPrototypeOf(_this, FailedResourceAccessException.prototype);
173
- _this.Message = opts.Message;
174
- return _this;
165
+ export class FailedResourceAccessException extends __BaseException {
166
+ constructor(opts) {
167
+ super({
168
+ name: "FailedResourceAccessException",
169
+ $fault: "client",
170
+ ...opts,
171
+ });
172
+ this.name = "FailedResourceAccessException";
173
+ this.$fault = "client";
174
+ Object.setPrototypeOf(this, FailedResourceAccessException.prototype);
175
+ this.Message = opts.Message;
175
176
  }
176
- return FailedResourceAccessException;
177
- }(__BaseException));
178
- export { FailedResourceAccessException };
179
- var LimitExceededException = (function (_super) {
180
- __extends(LimitExceededException, _super);
181
- function LimitExceededException(opts) {
182
- var _this = _super.call(this, __assign({ name: "LimitExceededException", $fault: "client" }, opts)) || this;
183
- _this.name = "LimitExceededException";
184
- _this.$fault = "client";
185
- Object.setPrototypeOf(_this, LimitExceededException.prototype);
186
- _this.Message = opts.Message;
187
- return _this;
177
+ }
178
+ export class LimitExceededException extends __BaseException {
179
+ constructor(opts) {
180
+ super({
181
+ name: "LimitExceededException",
182
+ $fault: "client",
183
+ ...opts,
184
+ });
185
+ this.name = "LimitExceededException";
186
+ this.$fault = "client";
187
+ Object.setPrototypeOf(this, LimitExceededException.prototype);
188
+ this.Message = opts.Message;
188
189
  }
189
- return LimitExceededException;
190
- }(__BaseException));
191
- export { LimitExceededException };
192
- export var AlarmFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
193
- export var DeleteScalingPolicyRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
194
- export var DeleteScalingPolicyResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
195
- export var DeleteScheduledActionRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
196
- export var DeleteScheduledActionResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
197
- export var DeregisterScalableTargetRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
198
- export var DeregisterScalableTargetResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
199
- export var DescribeScalableTargetsRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
200
- export var SuspendedStateFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
201
- export var ScalableTargetFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
202
- export var DescribeScalableTargetsResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
203
- export var DescribeScalingActivitiesRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
204
- export var ScalingActivityFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
205
- export var DescribeScalingActivitiesResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
206
- export var DescribeScalingPoliciesRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
207
- export var StepAdjustmentFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
208
- export var StepScalingPolicyConfigurationFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
209
- export var MetricDimensionFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
210
- export var CustomizedMetricSpecificationFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
211
- export var PredefinedMetricSpecificationFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
212
- export var TargetTrackingScalingPolicyConfigurationFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
213
- export var ScalingPolicyFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
214
- export var DescribeScalingPoliciesResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
215
- export var DescribeScheduledActionsRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
216
- export var ScalableTargetActionFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
217
- export var ScheduledActionFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
218
- export var DescribeScheduledActionsResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
219
- export var PutScalingPolicyRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
220
- export var PutScalingPolicyResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
221
- export var PutScheduledActionRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
222
- export var PutScheduledActionResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
223
- export var RegisterScalableTargetRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
224
- export var RegisterScalableTargetResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
190
+ }
191
+ export const AlarmFilterSensitiveLog = (obj) => ({
192
+ ...obj,
193
+ });
194
+ export const DeleteScalingPolicyRequestFilterSensitiveLog = (obj) => ({
195
+ ...obj,
196
+ });
197
+ export const DeleteScalingPolicyResponseFilterSensitiveLog = (obj) => ({
198
+ ...obj,
199
+ });
200
+ export const DeleteScheduledActionRequestFilterSensitiveLog = (obj) => ({
201
+ ...obj,
202
+ });
203
+ export const DeleteScheduledActionResponseFilterSensitiveLog = (obj) => ({
204
+ ...obj,
205
+ });
206
+ export const DeregisterScalableTargetRequestFilterSensitiveLog = (obj) => ({
207
+ ...obj,
208
+ });
209
+ export const DeregisterScalableTargetResponseFilterSensitiveLog = (obj) => ({
210
+ ...obj,
211
+ });
212
+ export const DescribeScalableTargetsRequestFilterSensitiveLog = (obj) => ({
213
+ ...obj,
214
+ });
215
+ export const SuspendedStateFilterSensitiveLog = (obj) => ({
216
+ ...obj,
217
+ });
218
+ export const ScalableTargetFilterSensitiveLog = (obj) => ({
219
+ ...obj,
220
+ });
221
+ export const DescribeScalableTargetsResponseFilterSensitiveLog = (obj) => ({
222
+ ...obj,
223
+ });
224
+ export const DescribeScalingActivitiesRequestFilterSensitiveLog = (obj) => ({
225
+ ...obj,
226
+ });
227
+ export const ScalingActivityFilterSensitiveLog = (obj) => ({
228
+ ...obj,
229
+ });
230
+ export const DescribeScalingActivitiesResponseFilterSensitiveLog = (obj) => ({
231
+ ...obj,
232
+ });
233
+ export const DescribeScalingPoliciesRequestFilterSensitiveLog = (obj) => ({
234
+ ...obj,
235
+ });
236
+ export const StepAdjustmentFilterSensitiveLog = (obj) => ({
237
+ ...obj,
238
+ });
239
+ export const StepScalingPolicyConfigurationFilterSensitiveLog = (obj) => ({
240
+ ...obj,
241
+ });
242
+ export const MetricDimensionFilterSensitiveLog = (obj) => ({
243
+ ...obj,
244
+ });
245
+ export const CustomizedMetricSpecificationFilterSensitiveLog = (obj) => ({
246
+ ...obj,
247
+ });
248
+ export const PredefinedMetricSpecificationFilterSensitiveLog = (obj) => ({
249
+ ...obj,
250
+ });
251
+ export const TargetTrackingScalingPolicyConfigurationFilterSensitiveLog = (obj) => ({
252
+ ...obj,
253
+ });
254
+ export const ScalingPolicyFilterSensitiveLog = (obj) => ({
255
+ ...obj,
256
+ });
257
+ export const DescribeScalingPoliciesResponseFilterSensitiveLog = (obj) => ({
258
+ ...obj,
259
+ });
260
+ export const DescribeScheduledActionsRequestFilterSensitiveLog = (obj) => ({
261
+ ...obj,
262
+ });
263
+ export const ScalableTargetActionFilterSensitiveLog = (obj) => ({
264
+ ...obj,
265
+ });
266
+ export const ScheduledActionFilterSensitiveLog = (obj) => ({
267
+ ...obj,
268
+ });
269
+ export const DescribeScheduledActionsResponseFilterSensitiveLog = (obj) => ({
270
+ ...obj,
271
+ });
272
+ export const PutScalingPolicyRequestFilterSensitiveLog = (obj) => ({
273
+ ...obj,
274
+ });
275
+ export const PutScalingPolicyResponseFilterSensitiveLog = (obj) => ({
276
+ ...obj,
277
+ });
278
+ export const PutScheduledActionRequestFilterSensitiveLog = (obj) => ({
279
+ ...obj,
280
+ });
281
+ export const PutScheduledActionResponseFilterSensitiveLog = (obj) => ({
282
+ ...obj,
283
+ });
284
+ export const RegisterScalableTargetRequestFilterSensitiveLog = (obj) => ({
285
+ ...obj,
286
+ });
287
+ export const RegisterScalableTargetResponseFilterSensitiveLog = (obj) => ({
288
+ ...obj,
289
+ });
@@ -1,75 +1,32 @@
1
- import { __asyncGenerator, __await, __awaiter, __generator, __read, __spreadArray } from "tslib";
2
1
  import { ApplicationAutoScaling } from "../ApplicationAutoScaling";
3
2
  import { ApplicationAutoScalingClient } from "../ApplicationAutoScalingClient";
4
3
  import { DescribeScalableTargetsCommand, } from "../commands/DescribeScalableTargetsCommand";
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 DescribeScalableTargetsCommand(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 DescribeScalableTargetsCommand(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.describeScalableTargets.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.describeScalableTargets(input, ...args);
32
9
  };
33
- export function paginateDescribeScalableTargets(config, input) {
34
- var additionalArguments = [];
35
- for (var _i = 2; _i < arguments.length; _i++) {
36
- additionalArguments[_i - 2] = arguments[_i];
10
+ export async function* paginateDescribeScalableTargets(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 ApplicationAutoScaling) {
18
+ page = await makePagedRequest(config.client, input, ...additionalArguments);
19
+ }
20
+ else if (config.client instanceof ApplicationAutoScalingClient) {
21
+ page = await makePagedClientRequest(config.client, input, ...additionalArguments);
22
+ }
23
+ else {
24
+ throw new Error("Invalid client, expected ApplicationAutoScaling | ApplicationAutoScalingClient");
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 paginateDescribeScalableTargets_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 ApplicationAutoScaling)) 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 ApplicationAutoScalingClient)) 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 ApplicationAutoScaling | ApplicationAutoScalingClient");
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 { ApplicationAutoScaling } from "../ApplicationAutoScaling";
3
2
  import { ApplicationAutoScalingClient } from "../ApplicationAutoScalingClient";
4
3
  import { DescribeScalingActivitiesCommand, } from "../commands/DescribeScalingActivitiesCommand";
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 DescribeScalingActivitiesCommand(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 DescribeScalingActivitiesCommand(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.describeScalingActivities.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.describeScalingActivities(input, ...args);
32
9
  };
33
- export function paginateDescribeScalingActivities(config, input) {
34
- var additionalArguments = [];
35
- for (var _i = 2; _i < arguments.length; _i++) {
36
- additionalArguments[_i - 2] = arguments[_i];
10
+ export async function* paginateDescribeScalingActivities(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 ApplicationAutoScaling) {
18
+ page = await makePagedRequest(config.client, input, ...additionalArguments);
19
+ }
20
+ else if (config.client instanceof ApplicationAutoScalingClient) {
21
+ page = await makePagedClientRequest(config.client, input, ...additionalArguments);
22
+ }
23
+ else {
24
+ throw new Error("Invalid client, expected ApplicationAutoScaling | ApplicationAutoScalingClient");
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 paginateDescribeScalingActivities_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 ApplicationAutoScaling)) 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 ApplicationAutoScalingClient)) 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 ApplicationAutoScaling | ApplicationAutoScalingClient");
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 { ApplicationAutoScaling } from "../ApplicationAutoScaling";
3
2
  import { ApplicationAutoScalingClient } from "../ApplicationAutoScalingClient";
4
3
  import { DescribeScalingPoliciesCommand, } from "../commands/DescribeScalingPoliciesCommand";
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 DescribeScalingPoliciesCommand(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 DescribeScalingPoliciesCommand(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.describeScalingPolicies.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.describeScalingPolicies(input, ...args);
32
9
  };
33
- export function paginateDescribeScalingPolicies(config, input) {
34
- var additionalArguments = [];
35
- for (var _i = 2; _i < arguments.length; _i++) {
36
- additionalArguments[_i - 2] = arguments[_i];
10
+ export async function* paginateDescribeScalingPolicies(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 ApplicationAutoScaling) {
18
+ page = await makePagedRequest(config.client, input, ...additionalArguments);
19
+ }
20
+ else if (config.client instanceof ApplicationAutoScalingClient) {
21
+ page = await makePagedClientRequest(config.client, input, ...additionalArguments);
22
+ }
23
+ else {
24
+ throw new Error("Invalid client, expected ApplicationAutoScaling | ApplicationAutoScalingClient");
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 paginateDescribeScalingPolicies_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 ApplicationAutoScaling)) 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 ApplicationAutoScalingClient)) 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 ApplicationAutoScaling | ApplicationAutoScalingClient");
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
  }