@scaleway/sdk-vpcgw 2.8.2 → 2.10.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.
@@ -0,0 +1,3 @@
1
+ # Licenses
2
+
3
+ The app does not bundle any dependencies with licenses.
@@ -0,0 +1,13 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __exportAll = (all, no_symbols) => {
4
+ let target = {};
5
+ for (var name in all) __defProp(target, name, {
6
+ get: all[name],
7
+ enumerable: true
8
+ });
9
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
+ return target;
11
+ };
12
+ //#endregion
13
+ export { __exportAll };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file is automatically generated
3
+ * PLEASE DO NOT EDIT HERE
4
+ */
5
+ export * as Vpcgwv2 from './v2/index.gen.js';
@@ -0,0 +1,2 @@
1
+ import { index_gen_exports } from "./v2/index.gen.js";
2
+ export { index_gen_exports as Vpcgwv2 };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file is automatically generated
3
+ * PLEASE DO NOT EDIT HERE
4
+ */
5
+ export declare const pkgMetadata: {
6
+ readonly name: "@scaleway/sdk-vpcgw";
7
+ readonly namespace: "vpcgw";
8
+ readonly displayName: "Vpcgw";
9
+ readonly versions: readonly ["v2"];
10
+ };
11
+ export type Metadata = typeof pkgMetadata;
12
+ export default pkgMetadata;
@@ -0,0 +1,13 @@
1
+ //#region src/metadata.gen.ts
2
+ /**
3
+ * This file is automatically generated
4
+ * PLEASE DO NOT EDIT HERE
5
+ */
6
+ const pkgMetadata = {
7
+ name: "@scaleway/sdk-vpcgw",
8
+ namespace: "vpcgw",
9
+ displayName: "Vpcgw",
10
+ versions: ["v2"]
11
+ };
12
+ //#endregion
13
+ export { pkgMetadata as default, pkgMetadata };
@@ -0,0 +1,233 @@
1
+ import { API as ParentAPI } from '@scaleway/sdk-client';
2
+ import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client';
3
+ import type { AddBastionAllowedIPsRequest, AddBastionAllowedIPsResponse, CreateGatewayNetworkRequest, CreateGatewayRequest, CreateIPRequest, CreatePatRuleRequest, DeleteBastionAllowedIPsRequest, DeleteGatewayNetworkRequest, DeleteGatewayRequest, DeleteIPRequest, DeletePatRuleRequest, Gateway, GatewayNetwork, GetGatewayNetworkRequest, GetGatewayRequest, GetIPRequest, GetPatRuleRequest, IP, ListGatewayNetworksRequest, ListGatewayNetworksResponse, ListGatewayTypesRequest, ListGatewayTypesResponse, ListGatewaysRequest, ListGatewaysResponse, ListIPsRequest, ListIPsResponse, ListPatRulesRequest, ListPatRulesResponse, PatRule, RefreshSSHKeysRequest, SetBastionAllowedIPsRequest, SetBastionAllowedIPsResponse, SetPatRulesRequest, SetPatRulesResponse, UpdateGatewayNetworkRequest, UpdateGatewayRequest, UpdateIPRequest, UpdatePatRuleRequest, UpgradeGatewayRequest } from './types.gen.js';
4
+ /**
5
+ * Public Gateways API.
6
+
7
+ This API allows you to manage your Public Gateways.
8
+ */
9
+ export declare class API extends ParentAPI {
10
+ /**
11
+ * Locality of this API.
12
+ * type ∈ {'zone','region','global','unspecified'}
13
+ */
14
+ static readonly LOCALITY: ApiLocality;
15
+ protected pageOfListGateways: (request?: Readonly<ListGatewaysRequest>) => Promise<ListGatewaysResponse>;
16
+ /**
17
+ * List Public Gateways. List Public Gateways in a given Scaleway Organization or Project. By default, results are displayed in ascending order of creation date.
18
+ *
19
+ * @param request - The request {@link ListGatewaysRequest}
20
+ * @returns A Promise of ListGatewaysResponse
21
+ */
22
+ listGateways: (request?: Readonly<ListGatewaysRequest>) => Promise<ListGatewaysResponse> & {
23
+ all: () => Promise<Gateway[]>;
24
+ [Symbol.asyncIterator]: () => AsyncGenerator<Gateway[], void, void>;
25
+ };
26
+ /**
27
+ * Get a Public Gateway. Get details of a Public Gateway, specified by its gateway ID. The response object contains full details of the gateway, including its **name**, **type**, **status** and more.
28
+ *
29
+ * @param request - The request {@link GetGatewayRequest}
30
+ * @returns A Promise of Gateway
31
+ */
32
+ getGateway: (request: Readonly<GetGatewayRequest>) => Promise<Gateway>;
33
+ /**
34
+ * Waits for {@link Gateway} to be in a final state.
35
+ *
36
+ * @param request - The request {@link GetGatewayRequest}
37
+ * @param options - The waiting options
38
+ * @returns A Promise of Gateway
39
+ */
40
+ waitForGateway: (request: Readonly<GetGatewayRequest>, options?: Readonly<WaitForOptions<Gateway>>) => Promise<Gateway>;
41
+ /**
42
+ * Create a Public Gateway. Create a new Public Gateway in the specified Scaleway Project, defining its **name**, **type** and other configuration details such as whether to enable SSH bastion.
43
+ *
44
+ * @param request - The request {@link CreateGatewayRequest}
45
+ * @returns A Promise of Gateway
46
+ */
47
+ createGateway: (request: Readonly<CreateGatewayRequest>) => Promise<Gateway>;
48
+ /**
49
+ * Update a Public Gateway. Update the parameters of an existing Public Gateway, for example, its **name**, **tags**, **SSH bastion configuration**, and **DNS servers**.
50
+ *
51
+ * @param request - The request {@link UpdateGatewayRequest}
52
+ * @returns A Promise of Gateway
53
+ */
54
+ updateGateway: (request: Readonly<UpdateGatewayRequest>) => Promise<Gateway>;
55
+ /**
56
+ * Delete a Public Gateway. Delete an existing Public Gateway, specified by its gateway ID. This action is irreversible.
57
+ *
58
+ * @param request - The request {@link DeleteGatewayRequest}
59
+ * @returns A Promise of Gateway
60
+ */
61
+ deleteGateway: (request: Readonly<DeleteGatewayRequest>) => Promise<Gateway>;
62
+ /**
63
+ * Upgrade a Public Gateway to the latest version and/or to a different commercial offer type. Upgrade a given Public Gateway to the newest software version or to a different commercial offer type. This applies the latest bugfixes and features to your Public Gateway. Note that gateway service will be interrupted during the update.
64
+ *
65
+ * @param request - The request {@link UpgradeGatewayRequest}
66
+ * @returns A Promise of Gateway
67
+ */
68
+ upgradeGateway: (request: Readonly<UpgradeGatewayRequest>) => Promise<Gateway>;
69
+ protected pageOfListGatewayNetworks: (request?: Readonly<ListGatewayNetworksRequest>) => Promise<ListGatewayNetworksResponse>;
70
+ /**
71
+ * List Public Gateway connections to Private Networks. List the connections between Public Gateways and Private Networks (a connection = a GatewayNetwork). You can choose to filter by `gateway-id` to list all Private Networks attached to the specified Public Gateway, or by `private_network_id` to list all Public Gateways attached to the specified Private Network. Other query parameters are also available. The result is an array of GatewayNetwork objects, each giving details of the connection between a given Public Gateway and a given Private Network.
72
+ *
73
+ * @param request - The request {@link ListGatewayNetworksRequest}
74
+ * @returns A Promise of ListGatewayNetworksResponse
75
+ */
76
+ listGatewayNetworks: (request?: Readonly<ListGatewayNetworksRequest>) => Promise<ListGatewayNetworksResponse> & {
77
+ all: () => Promise<GatewayNetwork[]>;
78
+ [Symbol.asyncIterator]: () => AsyncGenerator<GatewayNetwork[], void, void>;
79
+ };
80
+ /**
81
+ * Get a Public Gateway connection to a Private Network. Get details of a given connection between a Public Gateway and a Private Network (this connection = a GatewayNetwork), specified by its `gateway_network_id`. The response object contains details of the connection including the IDs of the Public Gateway and Private Network, the dates the connection was created/updated and its configuration settings.
82
+ *
83
+ * @param request - The request {@link GetGatewayNetworkRequest}
84
+ * @returns A Promise of GatewayNetwork
85
+ */
86
+ getGatewayNetwork: (request: Readonly<GetGatewayNetworkRequest>) => Promise<GatewayNetwork>;
87
+ /**
88
+ * Waits for {@link GatewayNetwork} to be in a final state.
89
+ *
90
+ * @param request - The request {@link GetGatewayNetworkRequest}
91
+ * @param options - The waiting options
92
+ * @returns A Promise of GatewayNetwork
93
+ */
94
+ waitForGatewayNetwork: (request: Readonly<GetGatewayNetworkRequest>, options?: Readonly<WaitForOptions<GatewayNetwork>>) => Promise<GatewayNetwork>;
95
+ /**
96
+ * Attach a Public Gateway to a Private Network. Attach a specific Public Gateway to a specific Private Network (create a GatewayNetwork). You can configure parameters for the connection including whether to enable masquerade (dynamic NAT), and more.
97
+ *
98
+ * @param request - The request {@link CreateGatewayNetworkRequest}
99
+ * @returns A Promise of GatewayNetwork
100
+ */
101
+ createGatewayNetwork: (request: Readonly<CreateGatewayNetworkRequest>) => Promise<GatewayNetwork>;
102
+ /**
103
+ * Update a Public Gateway's connection to a Private Network. Update the configuration parameters of a connection between a given Public Gateway and Private Network (the connection = a GatewayNetwork). Updatable parameters include whether to enable traffic masquerade (dynamic NAT).
104
+ *
105
+ * @param request - The request {@link UpdateGatewayNetworkRequest}
106
+ * @returns A Promise of GatewayNetwork
107
+ */
108
+ updateGatewayNetwork: (request: Readonly<UpdateGatewayNetworkRequest>) => Promise<GatewayNetwork>;
109
+ /**
110
+ * Detach a Public Gateway from a Private Network. Detach a given Public Gateway from a given Private Network, i.e. delete a GatewayNetwork specified by a gateway_network_id.
111
+ *
112
+ * @param request - The request {@link DeleteGatewayNetworkRequest}
113
+ * @returns A Promise of GatewayNetwork
114
+ */
115
+ deleteGatewayNetwork: (request: Readonly<DeleteGatewayNetworkRequest>) => Promise<GatewayNetwork>;
116
+ protected pageOfListPatRules: (request?: Readonly<ListPatRulesRequest>) => Promise<ListPatRulesResponse>;
117
+ /**
118
+ * List PAT rules. List PAT rules. You can filter by gateway ID to list all PAT rules for a particular gateway, or filter for PAT rules targeting a specific IP address or using a specific protocol.
119
+ *
120
+ * @param request - The request {@link ListPatRulesRequest}
121
+ * @returns A Promise of ListPatRulesResponse
122
+ */
123
+ listPatRules: (request?: Readonly<ListPatRulesRequest>) => Promise<ListPatRulesResponse> & {
124
+ all: () => Promise<PatRule[]>;
125
+ [Symbol.asyncIterator]: () => AsyncGenerator<PatRule[], void, void>;
126
+ };
127
+ /**
128
+ * Get a PAT rule. Get a PAT rule, specified by its PAT rule ID. The response object gives full details of the PAT rule, including the Public Gateway it belongs to and the configuration settings in terms of public / private ports, private IP and protocol.
129
+ *
130
+ * @param request - The request {@link GetPatRuleRequest}
131
+ * @returns A Promise of PatRule
132
+ */
133
+ getPatRule: (request: Readonly<GetPatRuleRequest>) => Promise<PatRule>;
134
+ /**
135
+ * Create a PAT rule. Create a new PAT rule on a specified Public Gateway, defining the protocol to use, public port to listen on, and private port / IP address to map to.
136
+ *
137
+ * @param request - The request {@link CreatePatRuleRequest}
138
+ * @returns A Promise of PatRule
139
+ */
140
+ createPatRule: (request: Readonly<CreatePatRuleRequest>) => Promise<PatRule>;
141
+ /**
142
+ * Update a PAT rule. Update a PAT rule, specified by its PAT rule ID. Configuration settings including private/public port, private IP address and protocol can all be updated.
143
+ *
144
+ * @param request - The request {@link UpdatePatRuleRequest}
145
+ * @returns A Promise of PatRule
146
+ */
147
+ updatePatRule: (request: Readonly<UpdatePatRuleRequest>) => Promise<PatRule>;
148
+ /**
149
+ * Set all PAT rules. Set a definitive list of PAT rules attached to a Public Gateway. Each rule is identified by its public port and protocol. This will sync the current PAT rule list on the gateway with the new list, creating, updating or deleting PAT rules accordingly.
150
+ *
151
+ * @param request - The request {@link SetPatRulesRequest}
152
+ * @returns A Promise of SetPatRulesResponse
153
+ */
154
+ setPatRules: (request: Readonly<SetPatRulesRequest>) => Promise<SetPatRulesResponse>;
155
+ /**
156
+ * Delete a PAT rule. Delete a PAT rule, identified by its PAT rule ID. This action is irreversible.
157
+ *
158
+ * @param request - The request {@link DeletePatRuleRequest}
159
+ */
160
+ deletePatRule: (request: Readonly<DeletePatRuleRequest>) => Promise<void>;
161
+ /**
162
+ * List Public Gateway types. List the different Public Gateway commercial offer types available at Scaleway. The response is an array of objects describing the name and technical details of each available gateway type.
163
+ *
164
+ * @param request - The request {@link ListGatewayTypesRequest}
165
+ * @returns A Promise of ListGatewayTypesResponse
166
+ */
167
+ listGatewayTypes: (request?: Readonly<ListGatewayTypesRequest>) => Promise<ListGatewayTypesResponse>;
168
+ protected pageOfListIPs: (request?: Readonly<ListIPsRequest>) => Promise<ListIPsResponse>;
169
+ /**
170
+ * List IPs. List Public Gateway flexible IP addresses. A number of filter options are available for limiting results in the response.
171
+ *
172
+ * @param request - The request {@link ListIPsRequest}
173
+ * @returns A Promise of ListIPsResponse
174
+ */
175
+ listIPs: (request?: Readonly<ListIPsRequest>) => Promise<ListIPsResponse> & {
176
+ all: () => Promise<IP[]>;
177
+ [Symbol.asyncIterator]: () => AsyncGenerator<IP[], void, void>;
178
+ };
179
+ /**
180
+ * Get an IP. Get details of a Public Gateway flexible IP address, identified by its IP ID. The response object contains information including which (if any) Public Gateway using this IP address, the reverse and various other metadata.
181
+ *
182
+ * @param request - The request {@link GetIPRequest}
183
+ * @returns A Promise of IP
184
+ */
185
+ getIP: (request: Readonly<GetIPRequest>) => Promise<IP>;
186
+ /**
187
+ * Reserve an IP. Create (reserve) a new flexible IP address that can be used for a Public Gateway in a specified Scaleway Project.
188
+ *
189
+ * @param request - The request {@link CreateIPRequest}
190
+ * @returns A Promise of IP
191
+ */
192
+ createIP: (request?: Readonly<CreateIPRequest>) => Promise<IP>;
193
+ /**
194
+ * Update an IP. Update details of an existing flexible IP address, including its tags, reverse and the Public Gateway it is assigned to.
195
+ *
196
+ * @param request - The request {@link UpdateIPRequest}
197
+ * @returns A Promise of IP
198
+ */
199
+ updateIP: (request: Readonly<UpdateIPRequest>) => Promise<IP>;
200
+ /**
201
+ * Delete an IP. Delete a flexible IP address from your account. This action is irreversible.
202
+ *
203
+ * @param request - The request {@link DeleteIPRequest}
204
+ */
205
+ deleteIP: (request: Readonly<DeleteIPRequest>) => Promise<void>;
206
+ /**
207
+ * Refresh a Public Gateway's SSH keys. Refresh the SSH keys of a given Public Gateway, specified by its gateway ID. This adds any new SSH keys in the gateway's Scaleway Project to the gateway itself.
208
+ *
209
+ * @param request - The request {@link RefreshSSHKeysRequest}
210
+ * @returns A Promise of Gateway
211
+ */
212
+ refreshSSHKeys: (request: Readonly<RefreshSSHKeysRequest>) => Promise<Gateway>;
213
+ /**
214
+ * Add allowed IP range to SSH bastion. Add an IP range (in CIDR notation) to be allowed to connect to the SSH bastion.
215
+ *
216
+ * @param request - The request {@link AddBastionAllowedIPsRequest}
217
+ * @returns A Promise of AddBastionAllowedIPsResponse
218
+ */
219
+ addBastionAllowedIPs: (request: Readonly<AddBastionAllowedIPsRequest>) => Promise<AddBastionAllowedIPsResponse>;
220
+ /**
221
+ * Set all IP ranges allowed for SSH bastion. Set a definitive list of IP ranges (in CIDR notation) allowed to connect to the SSH bastion.
222
+ *
223
+ * @param request - The request {@link SetBastionAllowedIPsRequest}
224
+ * @returns A Promise of SetBastionAllowedIPsResponse
225
+ */
226
+ setBastionAllowedIPs: (request: Readonly<SetBastionAllowedIPsRequest>) => Promise<SetBastionAllowedIPsResponse>;
227
+ /**
228
+ * Delete allowed IP range from SSH bastion. Delete an IP range (defined in CIDR notation) from SSH bastion, so that it is no longer allowed to connect.
229
+ *
230
+ * @param request - The request {@link DeleteBastionAllowedIPsRequest}
231
+ */
232
+ deleteBastionAllowedIPs: (request: Readonly<DeleteBastionAllowedIPsRequest>) => Promise<void>;
233
+ }
@@ -0,0 +1,175 @@
1
+ import { GATEWAY_NETWORK_TRANSIENT_STATUSES, GATEWAY_TRANSIENT_STATUSES } from "./content.gen.js";
2
+ import { marshalAddBastionAllowedIPsRequest, marshalCreateGatewayNetworkRequest, marshalCreateGatewayRequest, marshalCreateIPRequest, marshalCreatePatRuleRequest, marshalSetBastionAllowedIPsRequest, marshalSetPatRulesRequest, marshalUpdateGatewayNetworkRequest, marshalUpdateGatewayRequest, marshalUpdateIPRequest, marshalUpdatePatRuleRequest, marshalUpgradeGatewayRequest, unmarshalAddBastionAllowedIPsResponse, unmarshalGateway, unmarshalGatewayNetwork, unmarshalIP, unmarshalListGatewayNetworksResponse, unmarshalListGatewayTypesResponse, unmarshalListGatewaysResponse, unmarshalListIPsResponse, unmarshalListPatRulesResponse, unmarshalPatRule, unmarshalSetBastionAllowedIPsResponse, unmarshalSetPatRulesResponse } from "./marshalling.gen.js";
3
+ import { API as API$1, enrichForPagination, toApiLocality, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
4
+ //#region src/v2/api.gen.ts
5
+ const jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
6
+ /**
7
+ * Public Gateways API.
8
+
9
+ This API allows you to manage your Public Gateways.
10
+ */
11
+ var API = class extends API$1 {
12
+ constructor(..._args) {
13
+ super(..._args);
14
+ this.pageOfListGateways = (request = {}) => this.client.fetch({
15
+ method: "GET",
16
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways`,
17
+ urlParams: urlParams(["include_legacy", request.includeLegacy], ["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["private_network_ids", request.privateNetworkIds], ["project_id", request.projectId], ["status", request.status], ["tags", request.tags], ["types", request.types])
18
+ }, unmarshalListGatewaysResponse);
19
+ this.listGateways = (request = {}) => enrichForPagination("gateways", this.pageOfListGateways, request);
20
+ this.getGateway = (request) => this.client.fetch({
21
+ method: "GET",
22
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}`
23
+ }, unmarshalGateway);
24
+ this.waitForGateway = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!GATEWAY_TRANSIENT_STATUSES.includes(res.status))), this.getGateway, request, options);
25
+ this.createGateway = (request) => this.client.fetch({
26
+ body: JSON.stringify(marshalCreateGatewayRequest(request, this.client.settings)),
27
+ headers: jsonContentHeaders,
28
+ method: "POST",
29
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways`
30
+ }, unmarshalGateway);
31
+ this.updateGateway = (request) => this.client.fetch({
32
+ body: JSON.stringify(marshalUpdateGatewayRequest(request, this.client.settings)),
33
+ headers: jsonContentHeaders,
34
+ method: "PATCH",
35
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}`
36
+ }, unmarshalGateway);
37
+ this.deleteGateway = (request) => this.client.fetch({
38
+ method: "DELETE",
39
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}`,
40
+ urlParams: urlParams(["delete_ip", request.deleteIp])
41
+ }, unmarshalGateway);
42
+ this.upgradeGateway = (request) => this.client.fetch({
43
+ body: JSON.stringify(marshalUpgradeGatewayRequest(request, this.client.settings)),
44
+ headers: jsonContentHeaders,
45
+ method: "POST",
46
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}/upgrade`
47
+ }, unmarshalGateway);
48
+ this.pageOfListGatewayNetworks = (request = {}) => this.client.fetch({
49
+ method: "GET",
50
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks`,
51
+ urlParams: urlParams(["gateway_ids", request.gatewayIds], ["masquerade_enabled", request.masqueradeEnabled], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["private_network_ids", request.privateNetworkIds], ["status", request.status])
52
+ }, unmarshalListGatewayNetworksResponse);
53
+ this.listGatewayNetworks = (request = {}) => enrichForPagination("gatewayNetworks", this.pageOfListGatewayNetworks, request);
54
+ this.getGatewayNetwork = (request) => this.client.fetch({
55
+ method: "GET",
56
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${validatePathParam("gatewayNetworkId", request.gatewayNetworkId)}`
57
+ }, unmarshalGatewayNetwork);
58
+ this.waitForGatewayNetwork = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!GATEWAY_NETWORK_TRANSIENT_STATUSES.includes(res.status))), this.getGatewayNetwork, request, options);
59
+ this.createGatewayNetwork = (request) => this.client.fetch({
60
+ body: JSON.stringify(marshalCreateGatewayNetworkRequest(request, this.client.settings)),
61
+ headers: jsonContentHeaders,
62
+ method: "POST",
63
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks`
64
+ }, unmarshalGatewayNetwork);
65
+ this.updateGatewayNetwork = (request) => this.client.fetch({
66
+ body: JSON.stringify(marshalUpdateGatewayNetworkRequest(request, this.client.settings)),
67
+ headers: jsonContentHeaders,
68
+ method: "PATCH",
69
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${validatePathParam("gatewayNetworkId", request.gatewayNetworkId)}`
70
+ }, unmarshalGatewayNetwork);
71
+ this.deleteGatewayNetwork = (request) => this.client.fetch({
72
+ method: "DELETE",
73
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${validatePathParam("gatewayNetworkId", request.gatewayNetworkId)}`
74
+ }, unmarshalGatewayNetwork);
75
+ this.pageOfListPatRules = (request = {}) => this.client.fetch({
76
+ method: "GET",
77
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules`,
78
+ urlParams: urlParams(["gateway_ids", request.gatewayIds], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["private_ips", request.privateIps], ["protocol", request.protocol])
79
+ }, unmarshalListPatRulesResponse);
80
+ this.listPatRules = (request = {}) => enrichForPagination("patRules", this.pageOfListPatRules, request);
81
+ this.getPatRule = (request) => this.client.fetch({
82
+ method: "GET",
83
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam("patRuleId", request.patRuleId)}`
84
+ }, unmarshalPatRule);
85
+ this.createPatRule = (request) => this.client.fetch({
86
+ body: JSON.stringify(marshalCreatePatRuleRequest(request, this.client.settings)),
87
+ headers: jsonContentHeaders,
88
+ method: "POST",
89
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules`
90
+ }, unmarshalPatRule);
91
+ this.updatePatRule = (request) => this.client.fetch({
92
+ body: JSON.stringify(marshalUpdatePatRuleRequest(request, this.client.settings)),
93
+ headers: jsonContentHeaders,
94
+ method: "PATCH",
95
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam("patRuleId", request.patRuleId)}`
96
+ }, unmarshalPatRule);
97
+ this.setPatRules = (request) => this.client.fetch({
98
+ body: JSON.stringify(marshalSetPatRulesRequest(request, this.client.settings)),
99
+ headers: jsonContentHeaders,
100
+ method: "PUT",
101
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules`
102
+ }, unmarshalSetPatRulesResponse);
103
+ this.deletePatRule = (request) => this.client.fetch({
104
+ method: "DELETE",
105
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam("patRuleId", request.patRuleId)}`
106
+ });
107
+ this.listGatewayTypes = (request = {}) => this.client.fetch({
108
+ method: "GET",
109
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-types`
110
+ }, unmarshalListGatewayTypesResponse);
111
+ this.pageOfListIPs = (request = {}) => this.client.fetch({
112
+ method: "GET",
113
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips`,
114
+ urlParams: urlParams(["is_free", request.isFree], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["reverse", request.reverse], ["tags", request.tags])
115
+ }, unmarshalListIPsResponse);
116
+ this.listIPs = (request = {}) => enrichForPagination("ips", this.pageOfListIPs, request);
117
+ this.getIP = (request) => this.client.fetch({
118
+ method: "GET",
119
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam("ipId", request.ipId)}`
120
+ }, unmarshalIP);
121
+ this.createIP = (request = {}) => this.client.fetch({
122
+ body: JSON.stringify(marshalCreateIPRequest(request, this.client.settings)),
123
+ headers: jsonContentHeaders,
124
+ method: "POST",
125
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips`
126
+ }, unmarshalIP);
127
+ this.updateIP = (request) => this.client.fetch({
128
+ body: JSON.stringify(marshalUpdateIPRequest(request, this.client.settings)),
129
+ headers: jsonContentHeaders,
130
+ method: "PATCH",
131
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam("ipId", request.ipId)}`
132
+ }, unmarshalIP);
133
+ this.deleteIP = (request) => this.client.fetch({
134
+ method: "DELETE",
135
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam("ipId", request.ipId)}`
136
+ });
137
+ this.refreshSSHKeys = (request) => this.client.fetch({
138
+ body: "{}",
139
+ headers: jsonContentHeaders,
140
+ method: "POST",
141
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}/refresh-ssh-keys`
142
+ }, unmarshalGateway);
143
+ this.addBastionAllowedIPs = (request) => this.client.fetch({
144
+ body: JSON.stringify(marshalAddBastionAllowedIPsRequest(request, this.client.settings)),
145
+ headers: jsonContentHeaders,
146
+ method: "POST",
147
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}/bastion-allowed-ips`
148
+ }, unmarshalAddBastionAllowedIPsResponse);
149
+ this.setBastionAllowedIPs = (request) => this.client.fetch({
150
+ body: JSON.stringify(marshalSetBastionAllowedIPsRequest(request, this.client.settings)),
151
+ headers: jsonContentHeaders,
152
+ method: "PUT",
153
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}/bastion-allowed-ips`
154
+ }, unmarshalSetBastionAllowedIPsResponse);
155
+ this.deleteBastionAllowedIPs = (request) => this.client.fetch({
156
+ method: "DELETE",
157
+ path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}/bastion-allowed-ips/${validatePathParam("ipRange", request.ipRange)}`
158
+ });
159
+ }
160
+ static {
161
+ this.LOCALITY = toApiLocality({ zones: [
162
+ "fr-par-1",
163
+ "fr-par-2",
164
+ "it-mil-1",
165
+ "nl-ams-1",
166
+ "nl-ams-2",
167
+ "nl-ams-3",
168
+ "pl-waw-1",
169
+ "pl-waw-2",
170
+ "pl-waw-3"
171
+ ] });
172
+ }
173
+ };
174
+ //#endregion
175
+ export { API };
@@ -0,0 +1,5 @@
1
+ import type { GatewayNetworkStatus, GatewayStatus } from './types.gen.js';
2
+ /** Lists transient statutes of the enum {@link GatewayNetworkStatus}. */
3
+ export declare const GATEWAY_NETWORK_TRANSIENT_STATUSES: GatewayNetworkStatus[];
4
+ /** Lists transient statutes of the enum {@link GatewayStatus}. */
5
+ export declare const GATEWAY_TRANSIENT_STATUSES: GatewayStatus[];
@@ -0,0 +1,16 @@
1
+ //#region src/v2/content.gen.ts
2
+ /** Lists transient statutes of the enum {@link GatewayNetworkStatus}. */
3
+ const GATEWAY_NETWORK_TRANSIENT_STATUSES = [
4
+ "attaching",
5
+ "configuring",
6
+ "detaching"
7
+ ];
8
+ /** Lists transient statutes of the enum {@link GatewayStatus}. */
9
+ const GATEWAY_TRANSIENT_STATUSES = [
10
+ "allocating",
11
+ "configuring",
12
+ "stopping",
13
+ "deleting"
14
+ ];
15
+ //#endregion
16
+ export { GATEWAY_NETWORK_TRANSIENT_STATUSES, GATEWAY_TRANSIENT_STATUSES };
@@ -0,0 +1,4 @@
1
+ export { API, } from './api.gen.js';
2
+ export * from './content.gen.js';
3
+ export * from './marshalling.gen.js';
4
+ export type { AddBastionAllowedIPsRequest, AddBastionAllowedIPsResponse, CreateGatewayNetworkRequest, CreateGatewayRequest, CreateIPRequest, CreatePatRuleRequest, DeleteBastionAllowedIPsRequest, DeleteGatewayNetworkRequest, DeleteGatewayRequest, DeleteIPRequest, DeletePatRuleRequest, Gateway, GatewayNetwork, GatewayNetworkStatus, GatewayStatus, GatewayType, GetGatewayNetworkRequest, GetGatewayRequest, GetIPRequest, GetPatRuleRequest, IP, ListGatewayNetworksRequest, ListGatewayNetworksRequestOrderBy, ListGatewayNetworksResponse, ListGatewayTypesRequest, ListGatewayTypesResponse, ListGatewaysRequest, ListGatewaysRequestOrderBy, ListGatewaysResponse, ListIPsRequest, ListIPsRequestOrderBy, ListIPsResponse, ListPatRulesRequest, ListPatRulesRequestOrderBy, ListPatRulesResponse, PatRule, PatRuleProtocol, RefreshSSHKeysRequest, SetBastionAllowedIPsRequest, SetBastionAllowedIPsResponse, SetPatRulesRequest, SetPatRulesRequestRule, SetPatRulesResponse, UpdateGatewayNetworkRequest, UpdateGatewayRequest, UpdateIPRequest, UpdatePatRuleRequest, UpgradeGatewayRequest, } from './types.gen.js';
@@ -0,0 +1,36 @@
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
+ import { GATEWAY_NETWORK_TRANSIENT_STATUSES, GATEWAY_TRANSIENT_STATUSES } from "./content.gen.js";
3
+ import { marshalAddBastionAllowedIPsRequest, marshalCreateGatewayNetworkRequest, marshalCreateGatewayRequest, marshalCreateIPRequest, marshalCreatePatRuleRequest, marshalSetBastionAllowedIPsRequest, marshalSetPatRulesRequest, marshalUpdateGatewayNetworkRequest, marshalUpdateGatewayRequest, marshalUpdateIPRequest, marshalUpdatePatRuleRequest, marshalUpgradeGatewayRequest, unmarshalAddBastionAllowedIPsResponse, unmarshalGateway, unmarshalGatewayNetwork, unmarshalIP, unmarshalListGatewayNetworksResponse, unmarshalListGatewayTypesResponse, unmarshalListGatewaysResponse, unmarshalListIPsResponse, unmarshalListPatRulesResponse, unmarshalPatRule, unmarshalSetBastionAllowedIPsResponse, unmarshalSetPatRulesResponse } from "./marshalling.gen.js";
4
+ import { API } from "./api.gen.js";
5
+ //#region src/v2/index.gen.ts
6
+ var index_gen_exports = /* @__PURE__ */ __exportAll({
7
+ API: () => API,
8
+ GATEWAY_NETWORK_TRANSIENT_STATUSES: () => GATEWAY_NETWORK_TRANSIENT_STATUSES,
9
+ GATEWAY_TRANSIENT_STATUSES: () => GATEWAY_TRANSIENT_STATUSES,
10
+ marshalAddBastionAllowedIPsRequest: () => marshalAddBastionAllowedIPsRequest,
11
+ marshalCreateGatewayNetworkRequest: () => marshalCreateGatewayNetworkRequest,
12
+ marshalCreateGatewayRequest: () => marshalCreateGatewayRequest,
13
+ marshalCreateIPRequest: () => marshalCreateIPRequest,
14
+ marshalCreatePatRuleRequest: () => marshalCreatePatRuleRequest,
15
+ marshalSetBastionAllowedIPsRequest: () => marshalSetBastionAllowedIPsRequest,
16
+ marshalSetPatRulesRequest: () => marshalSetPatRulesRequest,
17
+ marshalUpdateGatewayNetworkRequest: () => marshalUpdateGatewayNetworkRequest,
18
+ marshalUpdateGatewayRequest: () => marshalUpdateGatewayRequest,
19
+ marshalUpdateIPRequest: () => marshalUpdateIPRequest,
20
+ marshalUpdatePatRuleRequest: () => marshalUpdatePatRuleRequest,
21
+ marshalUpgradeGatewayRequest: () => marshalUpgradeGatewayRequest,
22
+ unmarshalAddBastionAllowedIPsResponse: () => unmarshalAddBastionAllowedIPsResponse,
23
+ unmarshalGateway: () => unmarshalGateway,
24
+ unmarshalGatewayNetwork: () => unmarshalGatewayNetwork,
25
+ unmarshalIP: () => unmarshalIP,
26
+ unmarshalListGatewayNetworksResponse: () => unmarshalListGatewayNetworksResponse,
27
+ unmarshalListGatewayTypesResponse: () => unmarshalListGatewayTypesResponse,
28
+ unmarshalListGatewaysResponse: () => unmarshalListGatewaysResponse,
29
+ unmarshalListIPsResponse: () => unmarshalListIPsResponse,
30
+ unmarshalListPatRulesResponse: () => unmarshalListPatRulesResponse,
31
+ unmarshalPatRule: () => unmarshalPatRule,
32
+ unmarshalSetBastionAllowedIPsResponse: () => unmarshalSetBastionAllowedIPsResponse,
33
+ unmarshalSetPatRulesResponse: () => unmarshalSetPatRulesResponse
34
+ });
35
+ //#endregion
36
+ export { API, GATEWAY_NETWORK_TRANSIENT_STATUSES, GATEWAY_TRANSIENT_STATUSES, index_gen_exports, marshalAddBastionAllowedIPsRequest, marshalCreateGatewayNetworkRequest, marshalCreateGatewayRequest, marshalCreateIPRequest, marshalCreatePatRuleRequest, marshalSetBastionAllowedIPsRequest, marshalSetPatRulesRequest, marshalUpdateGatewayNetworkRequest, marshalUpdateGatewayRequest, marshalUpdateIPRequest, marshalUpdatePatRuleRequest, marshalUpgradeGatewayRequest, unmarshalAddBastionAllowedIPsResponse, unmarshalGateway, unmarshalGatewayNetwork, unmarshalIP, unmarshalListGatewayNetworksResponse, unmarshalListGatewayTypesResponse, unmarshalListGatewaysResponse, unmarshalListIPsResponse, unmarshalListPatRulesResponse, unmarshalPatRule, unmarshalSetBastionAllowedIPsResponse, unmarshalSetPatRulesResponse };
@@ -0,0 +1,26 @@
1
+ import type { DefaultValues } from '@scaleway/sdk-client';
2
+ import type { GatewayNetwork, IP, Gateway, PatRule, AddBastionAllowedIPsResponse, ListGatewayNetworksResponse, ListGatewayTypesResponse, ListGatewaysResponse, ListIPsResponse, ListPatRulesResponse, SetBastionAllowedIPsResponse, SetPatRulesResponse, AddBastionAllowedIPsRequest, CreateGatewayNetworkRequest, CreateGatewayRequest, CreateIPRequest, CreatePatRuleRequest, SetBastionAllowedIPsRequest, SetPatRulesRequest, UpdateGatewayNetworkRequest, UpdateGatewayRequest, UpdateIPRequest, UpdatePatRuleRequest, UpgradeGatewayRequest } from './types.gen.js';
3
+ export declare const unmarshalGatewayNetwork: (data: unknown) => GatewayNetwork;
4
+ export declare const unmarshalIP: (data: unknown) => IP;
5
+ export declare const unmarshalGateway: (data: unknown) => Gateway;
6
+ export declare const unmarshalPatRule: (data: unknown) => PatRule;
7
+ export declare const unmarshalAddBastionAllowedIPsResponse: (data: unknown) => AddBastionAllowedIPsResponse;
8
+ export declare const unmarshalListGatewayNetworksResponse: (data: unknown) => ListGatewayNetworksResponse;
9
+ export declare const unmarshalListGatewayTypesResponse: (data: unknown) => ListGatewayTypesResponse;
10
+ export declare const unmarshalListGatewaysResponse: (data: unknown) => ListGatewaysResponse;
11
+ export declare const unmarshalListIPsResponse: (data: unknown) => ListIPsResponse;
12
+ export declare const unmarshalListPatRulesResponse: (data: unknown) => ListPatRulesResponse;
13
+ export declare const unmarshalSetBastionAllowedIPsResponse: (data: unknown) => SetBastionAllowedIPsResponse;
14
+ export declare const unmarshalSetPatRulesResponse: (data: unknown) => SetPatRulesResponse;
15
+ export declare const marshalAddBastionAllowedIPsRequest: (request: AddBastionAllowedIPsRequest, defaults: DefaultValues) => Record<string, unknown>;
16
+ export declare const marshalCreateGatewayNetworkRequest: (request: CreateGatewayNetworkRequest, defaults: DefaultValues) => Record<string, unknown>;
17
+ export declare const marshalCreateGatewayRequest: (request: CreateGatewayRequest, defaults: DefaultValues) => Record<string, unknown>;
18
+ export declare const marshalCreateIPRequest: (request: CreateIPRequest, defaults: DefaultValues) => Record<string, unknown>;
19
+ export declare const marshalCreatePatRuleRequest: (request: CreatePatRuleRequest, defaults: DefaultValues) => Record<string, unknown>;
20
+ export declare const marshalSetBastionAllowedIPsRequest: (request: SetBastionAllowedIPsRequest, defaults: DefaultValues) => Record<string, unknown>;
21
+ export declare const marshalSetPatRulesRequest: (request: SetPatRulesRequest, defaults: DefaultValues) => Record<string, unknown>;
22
+ export declare const marshalUpdateGatewayNetworkRequest: (request: UpdateGatewayNetworkRequest, defaults: DefaultValues) => Record<string, unknown>;
23
+ export declare const marshalUpdateGatewayRequest: (request: UpdateGatewayRequest, defaults: DefaultValues) => Record<string, unknown>;
24
+ export declare const marshalUpdateIPRequest: (request: UpdateIPRequest, defaults: DefaultValues) => Record<string, unknown>;
25
+ export declare const marshalUpdatePatRuleRequest: (request: UpdatePatRuleRequest, defaults: DefaultValues) => Record<string, unknown>;
26
+ export declare const marshalUpgradeGatewayRequest: (request: UpgradeGatewayRequest, defaults: DefaultValues) => Record<string, unknown>;