@aws-sdk/client-backup-gateway 3.181.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 (34) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist-es/BackupGateway.js +78 -85
  3. package/dist-es/BackupGatewayClient.js +22 -28
  4. package/dist-es/commands/AssociateGatewayToServerCommand.js +21 -28
  5. package/dist-es/commands/CreateGatewayCommand.js +21 -28
  6. package/dist-es/commands/DeleteGatewayCommand.js +21 -28
  7. package/dist-es/commands/DeleteHypervisorCommand.js +21 -28
  8. package/dist-es/commands/DisassociateGatewayFromServerCommand.js +21 -28
  9. package/dist-es/commands/GetGatewayCommand.js +21 -28
  10. package/dist-es/commands/GetVirtualMachineCommand.js +21 -28
  11. package/dist-es/commands/ImportHypervisorConfigurationCommand.js +21 -28
  12. package/dist-es/commands/ListGatewaysCommand.js +21 -28
  13. package/dist-es/commands/ListHypervisorsCommand.js +21 -28
  14. package/dist-es/commands/ListTagsForResourceCommand.js +21 -28
  15. package/dist-es/commands/ListVirtualMachinesCommand.js +21 -28
  16. package/dist-es/commands/PutMaintenanceStartTimeCommand.js +21 -28
  17. package/dist-es/commands/TagResourceCommand.js +21 -28
  18. package/dist-es/commands/TestHypervisorConfigurationCommand.js +21 -28
  19. package/dist-es/commands/UntagResourceCommand.js +21 -28
  20. package/dist-es/commands/UpdateGatewayInformationCommand.js +21 -28
  21. package/dist-es/commands/UpdateGatewaySoftwareNowCommand.js +21 -28
  22. package/dist-es/commands/UpdateHypervisorCommand.js +21 -28
  23. package/dist-es/endpoints.js +8 -8
  24. package/dist-es/models/BackupGatewayServiceException.js +5 -10
  25. package/dist-es/models/models_0.js +219 -124
  26. package/dist-es/pagination/ListGatewaysPaginator.js +25 -68
  27. package/dist-es/pagination/ListHypervisorsPaginator.js +25 -68
  28. package/dist-es/pagination/ListVirtualMachinesPaginator.js +25 -68
  29. package/dist-es/protocols/Aws_json1_0.js +1232 -1627
  30. package/dist-es/runtimeConfig.browser.js +26 -12
  31. package/dist-es/runtimeConfig.js +30 -12
  32. package/dist-es/runtimeConfig.native.js +8 -5
  33. package/dist-es/runtimeConfig.shared.js +8 -11
  34. package/package.json +33 -33
@@ -1,94 +1,93 @@
1
- import { __assign, __extends } from "tslib";
2
1
  import { SENSITIVE_STRING } from "@aws-sdk/smithy-client";
3
2
  import { BackupGatewayServiceException as __BaseException } from "./BackupGatewayServiceException";
4
- var AccessDeniedException = (function (_super) {
5
- __extends(AccessDeniedException, _super);
6
- function AccessDeniedException(opts) {
7
- var _this = _super.call(this, __assign({ name: "AccessDeniedException", $fault: "client" }, opts)) || this;
8
- _this.name = "AccessDeniedException";
9
- _this.$fault = "client";
10
- Object.setPrototypeOf(_this, AccessDeniedException.prototype);
11
- _this.ErrorCode = opts.ErrorCode;
12
- _this.Message = opts.Message;
13
- return _this;
3
+ export class AccessDeniedException extends __BaseException {
4
+ constructor(opts) {
5
+ super({
6
+ name: "AccessDeniedException",
7
+ $fault: "client",
8
+ ...opts,
9
+ });
10
+ this.name = "AccessDeniedException";
11
+ this.$fault = "client";
12
+ Object.setPrototypeOf(this, AccessDeniedException.prototype);
13
+ this.ErrorCode = opts.ErrorCode;
14
+ this.Message = opts.Message;
14
15
  }
15
- return AccessDeniedException;
16
- }(__BaseException));
17
- export { AccessDeniedException };
18
- var ConflictException = (function (_super) {
19
- __extends(ConflictException, _super);
20
- function ConflictException(opts) {
21
- var _this = _super.call(this, __assign({ name: "ConflictException", $fault: "client" }, opts)) || this;
22
- _this.name = "ConflictException";
23
- _this.$fault = "client";
24
- Object.setPrototypeOf(_this, ConflictException.prototype);
25
- _this.ErrorCode = opts.ErrorCode;
26
- _this.Message = opts.Message;
27
- return _this;
16
+ }
17
+ export class ConflictException extends __BaseException {
18
+ constructor(opts) {
19
+ super({
20
+ name: "ConflictException",
21
+ $fault: "client",
22
+ ...opts,
23
+ });
24
+ this.name = "ConflictException";
25
+ this.$fault = "client";
26
+ Object.setPrototypeOf(this, ConflictException.prototype);
27
+ this.ErrorCode = opts.ErrorCode;
28
+ this.Message = opts.Message;
28
29
  }
29
- return ConflictException;
30
- }(__BaseException));
31
- export { ConflictException };
32
- var InternalServerException = (function (_super) {
33
- __extends(InternalServerException, _super);
34
- function InternalServerException(opts) {
35
- var _this = _super.call(this, __assign({ name: "InternalServerException", $fault: "server" }, opts)) || this;
36
- _this.name = "InternalServerException";
37
- _this.$fault = "server";
38
- Object.setPrototypeOf(_this, InternalServerException.prototype);
39
- _this.ErrorCode = opts.ErrorCode;
40
- _this.Message = opts.Message;
41
- return _this;
30
+ }
31
+ export class InternalServerException extends __BaseException {
32
+ constructor(opts) {
33
+ super({
34
+ name: "InternalServerException",
35
+ $fault: "server",
36
+ ...opts,
37
+ });
38
+ this.name = "InternalServerException";
39
+ this.$fault = "server";
40
+ Object.setPrototypeOf(this, InternalServerException.prototype);
41
+ this.ErrorCode = opts.ErrorCode;
42
+ this.Message = opts.Message;
42
43
  }
43
- return InternalServerException;
44
- }(__BaseException));
45
- export { InternalServerException };
46
- var ThrottlingException = (function (_super) {
47
- __extends(ThrottlingException, _super);
48
- function ThrottlingException(opts) {
49
- var _this = _super.call(this, __assign({ name: "ThrottlingException", $fault: "client" }, opts)) || this;
50
- _this.name = "ThrottlingException";
51
- _this.$fault = "client";
52
- Object.setPrototypeOf(_this, ThrottlingException.prototype);
53
- _this.ErrorCode = opts.ErrorCode;
54
- _this.Message = opts.Message;
55
- return _this;
44
+ }
45
+ export class ThrottlingException extends __BaseException {
46
+ constructor(opts) {
47
+ super({
48
+ name: "ThrottlingException",
49
+ $fault: "client",
50
+ ...opts,
51
+ });
52
+ this.name = "ThrottlingException";
53
+ this.$fault = "client";
54
+ Object.setPrototypeOf(this, ThrottlingException.prototype);
55
+ this.ErrorCode = opts.ErrorCode;
56
+ this.Message = opts.Message;
56
57
  }
57
- return ThrottlingException;
58
- }(__BaseException));
59
- export { ThrottlingException };
60
- var ValidationException = (function (_super) {
61
- __extends(ValidationException, _super);
62
- function ValidationException(opts) {
63
- var _this = _super.call(this, __assign({ name: "ValidationException", $fault: "client" }, opts)) || this;
64
- _this.name = "ValidationException";
65
- _this.$fault = "client";
66
- Object.setPrototypeOf(_this, ValidationException.prototype);
67
- _this.ErrorCode = opts.ErrorCode;
68
- _this.Message = opts.Message;
69
- return _this;
58
+ }
59
+ export class ValidationException extends __BaseException {
60
+ constructor(opts) {
61
+ super({
62
+ name: "ValidationException",
63
+ $fault: "client",
64
+ ...opts,
65
+ });
66
+ this.name = "ValidationException";
67
+ this.$fault = "client";
68
+ Object.setPrototypeOf(this, ValidationException.prototype);
69
+ this.ErrorCode = opts.ErrorCode;
70
+ this.Message = opts.Message;
70
71
  }
71
- return ValidationException;
72
- }(__BaseException));
73
- export { ValidationException };
72
+ }
74
73
  export var GatewayType;
75
74
  (function (GatewayType) {
76
75
  GatewayType["BACKUP_VM"] = "BACKUP_VM";
77
76
  })(GatewayType || (GatewayType = {}));
78
- var ResourceNotFoundException = (function (_super) {
79
- __extends(ResourceNotFoundException, _super);
80
- function ResourceNotFoundException(opts) {
81
- var _this = _super.call(this, __assign({ name: "ResourceNotFoundException", $fault: "client" }, opts)) || this;
82
- _this.name = "ResourceNotFoundException";
83
- _this.$fault = "client";
84
- Object.setPrototypeOf(_this, ResourceNotFoundException.prototype);
85
- _this.ErrorCode = opts.ErrorCode;
86
- _this.Message = opts.Message;
87
- return _this;
77
+ export class ResourceNotFoundException extends __BaseException {
78
+ constructor(opts) {
79
+ super({
80
+ name: "ResourceNotFoundException",
81
+ $fault: "client",
82
+ ...opts,
83
+ });
84
+ this.name = "ResourceNotFoundException";
85
+ this.$fault = "client";
86
+ Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
87
+ this.ErrorCode = opts.ErrorCode;
88
+ this.Message = opts.Message;
88
89
  }
89
- return ResourceNotFoundException;
90
- }(__BaseException));
91
- export { ResourceNotFoundException };
90
+ }
92
91
  export var HypervisorState;
93
92
  (function (HypervisorState) {
94
93
  HypervisorState["ERROR"] = "ERROR";
@@ -96,48 +95,144 @@ export var HypervisorState;
96
95
  HypervisorState["ONLINE"] = "ONLINE";
97
96
  HypervisorState["PENDING"] = "PENDING";
98
97
  })(HypervisorState || (HypervisorState = {}));
99
- export var AssociateGatewayToServerInputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
100
- export var AssociateGatewayToServerOutputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
101
- export var TagFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
102
- export var CreateGatewayInputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
103
- export var CreateGatewayOutputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
104
- export var DeleteGatewayInputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
105
- export var DeleteGatewayOutputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
106
- export var DisassociateGatewayFromServerInputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
107
- export var DisassociateGatewayFromServerOutputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
108
- export var GetGatewayInputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
109
- export var MaintenanceStartTimeFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
110
- export var GatewayDetailsFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
111
- export var GetGatewayOutputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
112
- export var ListGatewaysInputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
113
- export var GatewayFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
114
- export var ListGatewaysOutputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
115
- export var PutMaintenanceStartTimeInputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
116
- export var PutMaintenanceStartTimeOutputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
117
- export var TestHypervisorConfigurationInputFilterSensitiveLog = function (obj) { return (__assign(__assign(__assign({}, obj), (obj.Username && { Username: SENSITIVE_STRING })), (obj.Password && { Password: SENSITIVE_STRING }))); };
118
- export var TestHypervisorConfigurationOutputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
119
- export var UpdateGatewayInformationInputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
120
- export var UpdateGatewayInformationOutputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
121
- export var UpdateGatewaySoftwareNowInputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
122
- export var UpdateGatewaySoftwareNowOutputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
123
- export var DeleteHypervisorInputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
124
- export var DeleteHypervisorOutputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
125
- export var ImportHypervisorConfigurationInputFilterSensitiveLog = function (obj) { return (__assign(__assign(__assign({}, obj), (obj.Username && { Username: SENSITIVE_STRING })), (obj.Password && { Password: SENSITIVE_STRING }))); };
126
- export var ImportHypervisorConfigurationOutputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
127
- export var ListHypervisorsInputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
128
- export var HypervisorFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
129
- export var ListHypervisorsOutputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
130
- export var UpdateHypervisorInputFilterSensitiveLog = function (obj) { return (__assign(__assign(__assign({}, obj), (obj.Username && { Username: SENSITIVE_STRING })), (obj.Password && { Password: SENSITIVE_STRING }))); };
131
- export var UpdateHypervisorOutputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
132
- export var ListTagsForResourceInputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
133
- export var ListTagsForResourceOutputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
134
- export var TagResourceInputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
135
- export var TagResourceOutputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
136
- export var UntagResourceInputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
137
- export var UntagResourceOutputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
138
- export var GetVirtualMachineInputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
139
- export var VirtualMachineDetailsFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
140
- export var GetVirtualMachineOutputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
141
- export var ListVirtualMachinesInputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
142
- export var VirtualMachineFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
143
- export var ListVirtualMachinesOutputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
98
+ export const AssociateGatewayToServerInputFilterSensitiveLog = (obj) => ({
99
+ ...obj,
100
+ });
101
+ export const AssociateGatewayToServerOutputFilterSensitiveLog = (obj) => ({
102
+ ...obj,
103
+ });
104
+ export const TagFilterSensitiveLog = (obj) => ({
105
+ ...obj,
106
+ });
107
+ export const CreateGatewayInputFilterSensitiveLog = (obj) => ({
108
+ ...obj,
109
+ });
110
+ export const CreateGatewayOutputFilterSensitiveLog = (obj) => ({
111
+ ...obj,
112
+ });
113
+ export const DeleteGatewayInputFilterSensitiveLog = (obj) => ({
114
+ ...obj,
115
+ });
116
+ export const DeleteGatewayOutputFilterSensitiveLog = (obj) => ({
117
+ ...obj,
118
+ });
119
+ export const DisassociateGatewayFromServerInputFilterSensitiveLog = (obj) => ({
120
+ ...obj,
121
+ });
122
+ export const DisassociateGatewayFromServerOutputFilterSensitiveLog = (obj) => ({
123
+ ...obj,
124
+ });
125
+ export const GetGatewayInputFilterSensitiveLog = (obj) => ({
126
+ ...obj,
127
+ });
128
+ export const MaintenanceStartTimeFilterSensitiveLog = (obj) => ({
129
+ ...obj,
130
+ });
131
+ export const GatewayDetailsFilterSensitiveLog = (obj) => ({
132
+ ...obj,
133
+ });
134
+ export const GetGatewayOutputFilterSensitiveLog = (obj) => ({
135
+ ...obj,
136
+ });
137
+ export const ListGatewaysInputFilterSensitiveLog = (obj) => ({
138
+ ...obj,
139
+ });
140
+ export const GatewayFilterSensitiveLog = (obj) => ({
141
+ ...obj,
142
+ });
143
+ export const ListGatewaysOutputFilterSensitiveLog = (obj) => ({
144
+ ...obj,
145
+ });
146
+ export const PutMaintenanceStartTimeInputFilterSensitiveLog = (obj) => ({
147
+ ...obj,
148
+ });
149
+ export const PutMaintenanceStartTimeOutputFilterSensitiveLog = (obj) => ({
150
+ ...obj,
151
+ });
152
+ export const TestHypervisorConfigurationInputFilterSensitiveLog = (obj) => ({
153
+ ...obj,
154
+ ...(obj.Username && { Username: SENSITIVE_STRING }),
155
+ ...(obj.Password && { Password: SENSITIVE_STRING }),
156
+ });
157
+ export const TestHypervisorConfigurationOutputFilterSensitiveLog = (obj) => ({
158
+ ...obj,
159
+ });
160
+ export const UpdateGatewayInformationInputFilterSensitiveLog = (obj) => ({
161
+ ...obj,
162
+ });
163
+ export const UpdateGatewayInformationOutputFilterSensitiveLog = (obj) => ({
164
+ ...obj,
165
+ });
166
+ export const UpdateGatewaySoftwareNowInputFilterSensitiveLog = (obj) => ({
167
+ ...obj,
168
+ });
169
+ export const UpdateGatewaySoftwareNowOutputFilterSensitiveLog = (obj) => ({
170
+ ...obj,
171
+ });
172
+ export const DeleteHypervisorInputFilterSensitiveLog = (obj) => ({
173
+ ...obj,
174
+ });
175
+ export const DeleteHypervisorOutputFilterSensitiveLog = (obj) => ({
176
+ ...obj,
177
+ });
178
+ export const ImportHypervisorConfigurationInputFilterSensitiveLog = (obj) => ({
179
+ ...obj,
180
+ ...(obj.Username && { Username: SENSITIVE_STRING }),
181
+ ...(obj.Password && { Password: SENSITIVE_STRING }),
182
+ });
183
+ export const ImportHypervisorConfigurationOutputFilterSensitiveLog = (obj) => ({
184
+ ...obj,
185
+ });
186
+ export const ListHypervisorsInputFilterSensitiveLog = (obj) => ({
187
+ ...obj,
188
+ });
189
+ export const HypervisorFilterSensitiveLog = (obj) => ({
190
+ ...obj,
191
+ });
192
+ export const ListHypervisorsOutputFilterSensitiveLog = (obj) => ({
193
+ ...obj,
194
+ });
195
+ export const UpdateHypervisorInputFilterSensitiveLog = (obj) => ({
196
+ ...obj,
197
+ ...(obj.Username && { Username: SENSITIVE_STRING }),
198
+ ...(obj.Password && { Password: SENSITIVE_STRING }),
199
+ });
200
+ export const UpdateHypervisorOutputFilterSensitiveLog = (obj) => ({
201
+ ...obj,
202
+ });
203
+ export const ListTagsForResourceInputFilterSensitiveLog = (obj) => ({
204
+ ...obj,
205
+ });
206
+ export const ListTagsForResourceOutputFilterSensitiveLog = (obj) => ({
207
+ ...obj,
208
+ });
209
+ export const TagResourceInputFilterSensitiveLog = (obj) => ({
210
+ ...obj,
211
+ });
212
+ export const TagResourceOutputFilterSensitiveLog = (obj) => ({
213
+ ...obj,
214
+ });
215
+ export const UntagResourceInputFilterSensitiveLog = (obj) => ({
216
+ ...obj,
217
+ });
218
+ export const UntagResourceOutputFilterSensitiveLog = (obj) => ({
219
+ ...obj,
220
+ });
221
+ export const GetVirtualMachineInputFilterSensitiveLog = (obj) => ({
222
+ ...obj,
223
+ });
224
+ export const VirtualMachineDetailsFilterSensitiveLog = (obj) => ({
225
+ ...obj,
226
+ });
227
+ export const GetVirtualMachineOutputFilterSensitiveLog = (obj) => ({
228
+ ...obj,
229
+ });
230
+ export const ListVirtualMachinesInputFilterSensitiveLog = (obj) => ({
231
+ ...obj,
232
+ });
233
+ export const VirtualMachineFilterSensitiveLog = (obj) => ({
234
+ ...obj,
235
+ });
236
+ export const ListVirtualMachinesOutputFilterSensitiveLog = (obj) => ({
237
+ ...obj,
238
+ });
@@ -1,75 +1,32 @@
1
- import { __asyncGenerator, __await, __awaiter, __generator, __read, __spreadArray } from "tslib";
2
1
  import { BackupGateway } from "../BackupGateway";
3
2
  import { BackupGatewayClient } from "../BackupGatewayClient";
4
3
  import { ListGatewaysCommand, } from "../commands/ListGatewaysCommand";
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 ListGatewaysCommand(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 ListGatewaysCommand(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.listGateways.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.listGateways(input, ...args);
32
9
  };
33
- export function paginateListGateways(config, input) {
34
- var additionalArguments = [];
35
- for (var _i = 2; _i < arguments.length; _i++) {
36
- additionalArguments[_i - 2] = arguments[_i];
10
+ export async function* paginateListGateways(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 BackupGateway) {
18
+ page = await makePagedRequest(config.client, input, ...additionalArguments);
19
+ }
20
+ else if (config.client instanceof BackupGatewayClient) {
21
+ page = await makePagedClientRequest(config.client, input, ...additionalArguments);
22
+ }
23
+ else {
24
+ throw new Error("Invalid client, expected BackupGateway | BackupGatewayClient");
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 paginateListGateways_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 BackupGateway)) 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 BackupGatewayClient)) 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 BackupGateway | BackupGatewayClient");
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 { BackupGateway } from "../BackupGateway";
3
2
  import { BackupGatewayClient } from "../BackupGatewayClient";
4
3
  import { ListHypervisorsCommand, } from "../commands/ListHypervisorsCommand";
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 ListHypervisorsCommand(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 ListHypervisorsCommand(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.listHypervisors.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.listHypervisors(input, ...args);
32
9
  };
33
- export function paginateListHypervisors(config, input) {
34
- var additionalArguments = [];
35
- for (var _i = 2; _i < arguments.length; _i++) {
36
- additionalArguments[_i - 2] = arguments[_i];
10
+ export async function* paginateListHypervisors(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 BackupGateway) {
18
+ page = await makePagedRequest(config.client, input, ...additionalArguments);
19
+ }
20
+ else if (config.client instanceof BackupGatewayClient) {
21
+ page = await makePagedClientRequest(config.client, input, ...additionalArguments);
22
+ }
23
+ else {
24
+ throw new Error("Invalid client, expected BackupGateway | BackupGatewayClient");
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 paginateListHypervisors_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 BackupGateway)) 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 BackupGatewayClient)) 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 BackupGateway | BackupGatewayClient");
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
  }