@aws-sdk/client-backup-gateway 3.186.0 → 3.188.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist-es/BackupGateway.js +78 -85
- package/dist-es/BackupGatewayClient.js +22 -28
- package/dist-es/commands/AssociateGatewayToServerCommand.js +21 -28
- package/dist-es/commands/CreateGatewayCommand.js +21 -28
- package/dist-es/commands/DeleteGatewayCommand.js +21 -28
- package/dist-es/commands/DeleteHypervisorCommand.js +21 -28
- package/dist-es/commands/DisassociateGatewayFromServerCommand.js +21 -28
- package/dist-es/commands/GetGatewayCommand.js +21 -28
- package/dist-es/commands/GetVirtualMachineCommand.js +21 -28
- package/dist-es/commands/ImportHypervisorConfigurationCommand.js +21 -28
- package/dist-es/commands/ListGatewaysCommand.js +21 -28
- package/dist-es/commands/ListHypervisorsCommand.js +21 -28
- package/dist-es/commands/ListTagsForResourceCommand.js +21 -28
- package/dist-es/commands/ListVirtualMachinesCommand.js +21 -28
- package/dist-es/commands/PutMaintenanceStartTimeCommand.js +21 -28
- package/dist-es/commands/TagResourceCommand.js +21 -28
- package/dist-es/commands/TestHypervisorConfigurationCommand.js +21 -28
- package/dist-es/commands/UntagResourceCommand.js +21 -28
- package/dist-es/commands/UpdateGatewayInformationCommand.js +21 -28
- package/dist-es/commands/UpdateGatewaySoftwareNowCommand.js +21 -28
- package/dist-es/commands/UpdateHypervisorCommand.js +21 -28
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/BackupGatewayServiceException.js +5 -10
- package/dist-es/models/models_0.js +219 -124
- package/dist-es/pagination/ListGatewaysPaginator.js +25 -68
- package/dist-es/pagination/ListHypervisorsPaginator.js +25 -68
- package/dist-es/pagination/ListVirtualMachinesPaginator.js +25 -68
- package/dist-es/protocols/Aws_json1_0.js +1232 -1627
- package/dist-es/runtimeConfig.browser.js +26 -12
- package/dist-es/runtimeConfig.js +30 -12
- package/dist-es/runtimeConfig.native.js +8 -5
- package/dist-es/runtimeConfig.shared.js +8 -11
- 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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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
|
-
|
|
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
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
export
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
export
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
export
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
export
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
export
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
export
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
export
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
export
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
export
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
export
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
export
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
export
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
export
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
export
|
|
142
|
-
|
|
143
|
-
|
|
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
|
-
|
|
6
|
-
|
|
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
|
-
|
|
20
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
|
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
|
-
|
|
6
|
-
|
|
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
|
-
|
|
20
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
|
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
|
}
|