@scaleway/sdk-s2s-vpn 2.9.1 → 2.9.2

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.
@@ -1,172 +0,0 @@
1
- import { VPN_GATEWAY_TRANSIENT_STATUSES } from "./content.gen.js";
2
- import { marshalChangeConnectionPskRequest, marshalCreateConnectionRequest, marshalCreateCustomerGatewayRequest, marshalCreateRoutingPolicyRequest, marshalCreateVpnGatewayRequest, marshalDetachRoutingPolicyRequest, marshalRenewConnectionPskRequest, marshalSetRoutingPolicyRequest, marshalUpdateConnectionRequest, marshalUpdateCustomerGatewayRequest, marshalUpdateRoutingPolicyRequest, marshalUpdateVpnGatewayRequest, unmarshalChangeConnectionPskResponse, unmarshalConnection, unmarshalCreateConnectionResponse, unmarshalCustomerGateway, unmarshalListConnectionsResponse, unmarshalListCustomerGatewaysResponse, unmarshalListRoutingPoliciesResponse, unmarshalListVpnGatewayTypesResponse, unmarshalListVpnGatewaysResponse, unmarshalRenewConnectionPskResponse, unmarshalRoutingPolicy, unmarshalVpnGateway } from "./marshalling.gen.js";
3
- import { API as API$1, enrichForPagination, toApiLocality, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
4
- //#region src/v1alpha1/api.gen.ts
5
- const jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
6
- /**
7
- * Site-to-Site VPN.
8
-
9
- This API allows you to manage your Site-to-Site VPN.
10
- */
11
- var API = class extends API$1 {
12
- constructor(..._args) {
13
- super(..._args);
14
- this.pageOfListVpnGatewayTypes = (request = {}) => this.client.fetch({
15
- method: "GET",
16
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpn-gateway-types`,
17
- urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
18
- }, unmarshalListVpnGatewayTypesResponse);
19
- this.listVpnGatewayTypes = (request = {}) => enrichForPagination("gatewayTypes", this.pageOfListVpnGatewayTypes, request);
20
- this.pageOfListVpnGateways = (request = {}) => this.client.fetch({
21
- method: "GET",
22
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpn-gateways`,
23
- urlParams: urlParams(["gateway_types", request.gatewayTypes], ["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], ["statuses", request.statuses], ["tags", request.tags])
24
- }, unmarshalListVpnGatewaysResponse);
25
- this.listVpnGateways = (request = {}) => enrichForPagination("gateways", this.pageOfListVpnGateways, request);
26
- this.getVpnGateway = (request) => this.client.fetch({
27
- method: "GET",
28
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpn-gateways/${validatePathParam("gatewayId", request.gatewayId)}`
29
- }, unmarshalVpnGateway);
30
- this.waitForVpnGateway = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!VPN_GATEWAY_TRANSIENT_STATUSES.includes(res.status))), this.getVpnGateway, request, options);
31
- this.createVpnGateway = (request) => this.client.fetch({
32
- body: JSON.stringify(marshalCreateVpnGatewayRequest(request, this.client.settings)),
33
- headers: jsonContentHeaders,
34
- method: "POST",
35
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpn-gateways`
36
- }, unmarshalVpnGateway);
37
- this.updateVpnGateway = (request) => this.client.fetch({
38
- body: JSON.stringify(marshalUpdateVpnGatewayRequest(request, this.client.settings)),
39
- headers: jsonContentHeaders,
40
- method: "PATCH",
41
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpn-gateways/${validatePathParam("gatewayId", request.gatewayId)}`
42
- }, unmarshalVpnGateway);
43
- this.deleteVpnGateway = (request) => this.client.fetch({
44
- method: "DELETE",
45
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpn-gateways/${validatePathParam("gatewayId", request.gatewayId)}`
46
- }, unmarshalVpnGateway);
47
- this.pageOfListConnections = (request = {}) => this.client.fetch({
48
- method: "GET",
49
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections`,
50
- urlParams: urlParams(["customer_gateway_ids", request.customerGatewayIds], ["is_ipv6", request.isIpv6], ["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["route_propagation_enabled", request.routePropagationEnabled], ["routing_policy_ids", request.routingPolicyIds], ["statuses", request.statuses], ["tags", request.tags], ["vpn_gateway_ids", request.vpnGatewayIds])
51
- }, unmarshalListConnectionsResponse);
52
- this.listConnections = (request = {}) => enrichForPagination("connections", this.pageOfListConnections, request);
53
- this.getConnection = (request) => this.client.fetch({
54
- method: "GET",
55
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam("connectionId", request.connectionId)}`
56
- }, unmarshalConnection);
57
- this.createConnection = (request) => this.client.fetch({
58
- body: JSON.stringify(marshalCreateConnectionRequest(request, this.client.settings)),
59
- headers: jsonContentHeaders,
60
- method: "POST",
61
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections`
62
- }, unmarshalCreateConnectionResponse);
63
- this.updateConnection = (request) => this.client.fetch({
64
- body: JSON.stringify(marshalUpdateConnectionRequest(request, this.client.settings)),
65
- headers: jsonContentHeaders,
66
- method: "PATCH",
67
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam("connectionId", request.connectionId)}`
68
- }, unmarshalConnection);
69
- this.deleteConnection = (request) => this.client.fetch({
70
- method: "DELETE",
71
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam("connectionId", request.connectionId)}`
72
- });
73
- this.renewConnectionPsk = (request) => this.client.fetch({
74
- body: JSON.stringify(marshalRenewConnectionPskRequest(request, this.client.settings)),
75
- headers: jsonContentHeaders,
76
- method: "POST",
77
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam("connectionId", request.connectionId)}/renew-psk`
78
- }, unmarshalRenewConnectionPskResponse);
79
- this.changeConnectionPsk = (request) => this.client.fetch({
80
- body: JSON.stringify(marshalChangeConnectionPskRequest(request, this.client.settings)),
81
- headers: jsonContentHeaders,
82
- method: "POST",
83
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam("connectionId", request.connectionId)}/change-psk`
84
- }, unmarshalChangeConnectionPskResponse);
85
- this.setRoutingPolicy = (request) => this.client.fetch({
86
- body: JSON.stringify(marshalSetRoutingPolicyRequest(request, this.client.settings)),
87
- headers: jsonContentHeaders,
88
- method: "POST",
89
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam("connectionId", request.connectionId)}/set-routing-policy`
90
- }, unmarshalConnection);
91
- this.detachRoutingPolicy = (request) => this.client.fetch({
92
- body: JSON.stringify(marshalDetachRoutingPolicyRequest(request, this.client.settings)),
93
- headers: jsonContentHeaders,
94
- method: "POST",
95
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam("connectionId", request.connectionId)}/detach-routing-policy`
96
- }, unmarshalConnection);
97
- this.enableRoutePropagation = (request) => this.client.fetch({
98
- body: "{}",
99
- headers: jsonContentHeaders,
100
- method: "POST",
101
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam("connectionId", request.connectionId)}/enable-route-propagation`
102
- }, unmarshalConnection);
103
- this.disableRoutePropagation = (request) => this.client.fetch({
104
- body: "{}",
105
- headers: jsonContentHeaders,
106
- method: "POST",
107
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam("connectionId", request.connectionId)}/disable-route-propagation`
108
- }, unmarshalConnection);
109
- this.pageOfListCustomerGateways = (request = {}) => this.client.fetch({
110
- method: "GET",
111
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/customer-gateways`,
112
- urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["tags", request.tags])
113
- }, unmarshalListCustomerGatewaysResponse);
114
- this.listCustomerGateways = (request = {}) => enrichForPagination("gateways", this.pageOfListCustomerGateways, request);
115
- this.getCustomerGateway = (request) => this.client.fetch({
116
- method: "GET",
117
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/customer-gateways/${validatePathParam("gatewayId", request.gatewayId)}`
118
- }, unmarshalCustomerGateway);
119
- this.createCustomerGateway = (request) => this.client.fetch({
120
- body: JSON.stringify(marshalCreateCustomerGatewayRequest(request, this.client.settings)),
121
- headers: jsonContentHeaders,
122
- method: "POST",
123
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/customer-gateways`
124
- }, unmarshalCustomerGateway);
125
- this.updateCustomerGateway = (request) => this.client.fetch({
126
- body: JSON.stringify(marshalUpdateCustomerGatewayRequest(request, this.client.settings)),
127
- headers: jsonContentHeaders,
128
- method: "PATCH",
129
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/customer-gateways/${validatePathParam("gatewayId", request.gatewayId)}`
130
- }, unmarshalCustomerGateway);
131
- this.deleteCustomerGateway = (request) => this.client.fetch({
132
- method: "DELETE",
133
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/customer-gateways/${validatePathParam("gatewayId", request.gatewayId)}`
134
- });
135
- this.pageOfListRoutingPolicies = (request = {}) => this.client.fetch({
136
- method: "GET",
137
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies`,
138
- urlParams: urlParams(["ipv6", request.ipv6], ["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["tags", request.tags])
139
- }, unmarshalListRoutingPoliciesResponse);
140
- this.listRoutingPolicies = (request = {}) => enrichForPagination("routingPolicies", this.pageOfListRoutingPolicies, request);
141
- this.getRoutingPolicy = (request) => this.client.fetch({
142
- method: "GET",
143
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${validatePathParam("routingPolicyId", request.routingPolicyId)}`
144
- }, unmarshalRoutingPolicy);
145
- this.createRoutingPolicy = (request) => this.client.fetch({
146
- body: JSON.stringify(marshalCreateRoutingPolicyRequest(request, this.client.settings)),
147
- headers: jsonContentHeaders,
148
- method: "POST",
149
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies`
150
- }, unmarshalRoutingPolicy);
151
- this.updateRoutingPolicy = (request) => this.client.fetch({
152
- body: JSON.stringify(marshalUpdateRoutingPolicyRequest(request, this.client.settings)),
153
- headers: jsonContentHeaders,
154
- method: "PATCH",
155
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${validatePathParam("routingPolicyId", request.routingPolicyId)}`
156
- }, unmarshalRoutingPolicy);
157
- this.deleteRoutingPolicy = (request) => this.client.fetch({
158
- method: "DELETE",
159
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${validatePathParam("routingPolicyId", request.routingPolicyId)}`
160
- });
161
- }
162
- static {
163
- this.LOCALITY = toApiLocality({ regions: [
164
- "fr-par",
165
- "it-mil",
166
- "nl-ams",
167
- "pl-waw"
168
- ] });
169
- }
170
- };
171
- //#endregion
172
- export { API };
@@ -1,3 +0,0 @@
1
- import type { VpnGatewayStatus } from './types.gen.js';
2
- /** Lists transient statutes of the enum {@link VpnGatewayStatus}. */
3
- export declare const VPN_GATEWAY_TRANSIENT_STATUSES: VpnGatewayStatus[];
@@ -1,9 +0,0 @@
1
- //#region src/v1alpha1/content.gen.ts
2
- /** Lists transient statutes of the enum {@link VpnGatewayStatus}. */
3
- const VPN_GATEWAY_TRANSIENT_STATUSES = [
4
- "configuring",
5
- "provisioning",
6
- "deprovisioning"
7
- ];
8
- //#endregion
9
- export { VPN_GATEWAY_TRANSIENT_STATUSES };
@@ -1,5 +0,0 @@
1
- export { API, } from './api.gen.js';
2
- export * from './content.gen.js';
3
- export * from './marshalling.gen.js';
4
- export type { BgpSession, BgpSessionStatus, ChangeConnectionPskRequest, ChangeConnectionPskRequestSecret, ChangeConnectionPskResponse, Connection, ConnectionCipher, ConnectionDhGroup, ConnectionEncryption, ConnectionInitiationPolicy, ConnectionIntegrity, ConnectionStatus, CreateConnectionRequest, CreateConnectionRequestBgpConfig, CreateConnectionRequestInitiationPolicy, CreateConnectionRequestSecret, CreateConnectionResponse, CreateCustomerGatewayRequest, CreateRoutingPolicyRequest, CreateVpnGatewayRequest, CreateVpnGatewayRequestDualIpTunnel, CreateVpnGatewayRequestPublicConfig, CreateVpnGatewayRequestPublicTunnelConfig, CreateVpnGatewayRequestSingleIpTunnel, CustomerGateway, DeleteConnectionRequest, DeleteCustomerGatewayRequest, DeleteRoutingPolicyRequest, DeleteVpnGatewayRequest, DetachRoutingPolicyRequest, DisableRoutePropagationRequest, EnableRoutePropagationRequest, GatewayType, GetConnectionRequest, GetCustomerGatewayRequest, GetRoutingPolicyRequest, GetVpnGatewayRequest, ListConnectionsRequest, ListConnectionsRequestOrderBy, ListConnectionsResponse, ListCustomerGatewaysRequest, ListCustomerGatewaysRequestOrderBy, ListCustomerGatewaysResponse, ListRoutingPoliciesRequest, ListRoutingPoliciesRequestOrderBy, ListRoutingPoliciesResponse, ListVpnGatewayTypesRequest, ListVpnGatewayTypesResponse, ListVpnGatewaysRequest, ListVpnGatewaysRequestOrderBy, ListVpnGatewaysResponse, RenewConnectionPskRequest, RenewConnectionPskResponse, RoutingPolicy, SetRoutingPolicyRequest, TunnelStatus, UpdateConnectionRequest, UpdateCustomerGatewayRequest, UpdateRoutingPolicyRequest, UpdateVpnGatewayRequest, VpnGateway, VpnGatewayPrivateConfig, VpnGatewayPublicConfig, VpnGatewayStatus, } from './types.gen.js';
5
- export * as ValidationRules from './validation-rules.gen.js';
@@ -1,37 +0,0 @@
1
- import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
- import { VPN_GATEWAY_TRANSIENT_STATUSES } from "./content.gen.js";
3
- import { marshalChangeConnectionPskRequest, marshalCreateConnectionRequest, marshalCreateCustomerGatewayRequest, marshalCreateRoutingPolicyRequest, marshalCreateVpnGatewayRequest, marshalDetachRoutingPolicyRequest, marshalRenewConnectionPskRequest, marshalSetRoutingPolicyRequest, marshalUpdateConnectionRequest, marshalUpdateCustomerGatewayRequest, marshalUpdateRoutingPolicyRequest, marshalUpdateVpnGatewayRequest, unmarshalChangeConnectionPskResponse, unmarshalConnection, unmarshalCreateConnectionResponse, unmarshalCustomerGateway, unmarshalListConnectionsResponse, unmarshalListCustomerGatewaysResponse, unmarshalListRoutingPoliciesResponse, unmarshalListVpnGatewayTypesResponse, unmarshalListVpnGatewaysResponse, unmarshalRenewConnectionPskResponse, unmarshalRoutingPolicy, unmarshalVpnGateway } from "./marshalling.gen.js";
4
- import { API } from "./api.gen.js";
5
- import { validation_rules_gen_exports } from "./validation-rules.gen.js";
6
- //#region src/v1alpha1/index.gen.ts
7
- var index_gen_exports = /* @__PURE__ */ __exportAll({
8
- API: () => API,
9
- VPN_GATEWAY_TRANSIENT_STATUSES: () => VPN_GATEWAY_TRANSIENT_STATUSES,
10
- ValidationRules: () => validation_rules_gen_exports,
11
- marshalChangeConnectionPskRequest: () => marshalChangeConnectionPskRequest,
12
- marshalCreateConnectionRequest: () => marshalCreateConnectionRequest,
13
- marshalCreateCustomerGatewayRequest: () => marshalCreateCustomerGatewayRequest,
14
- marshalCreateRoutingPolicyRequest: () => marshalCreateRoutingPolicyRequest,
15
- marshalCreateVpnGatewayRequest: () => marshalCreateVpnGatewayRequest,
16
- marshalDetachRoutingPolicyRequest: () => marshalDetachRoutingPolicyRequest,
17
- marshalRenewConnectionPskRequest: () => marshalRenewConnectionPskRequest,
18
- marshalSetRoutingPolicyRequest: () => marshalSetRoutingPolicyRequest,
19
- marshalUpdateConnectionRequest: () => marshalUpdateConnectionRequest,
20
- marshalUpdateCustomerGatewayRequest: () => marshalUpdateCustomerGatewayRequest,
21
- marshalUpdateRoutingPolicyRequest: () => marshalUpdateRoutingPolicyRequest,
22
- marshalUpdateVpnGatewayRequest: () => marshalUpdateVpnGatewayRequest,
23
- unmarshalChangeConnectionPskResponse: () => unmarshalChangeConnectionPskResponse,
24
- unmarshalConnection: () => unmarshalConnection,
25
- unmarshalCreateConnectionResponse: () => unmarshalCreateConnectionResponse,
26
- unmarshalCustomerGateway: () => unmarshalCustomerGateway,
27
- unmarshalListConnectionsResponse: () => unmarshalListConnectionsResponse,
28
- unmarshalListCustomerGatewaysResponse: () => unmarshalListCustomerGatewaysResponse,
29
- unmarshalListRoutingPoliciesResponse: () => unmarshalListRoutingPoliciesResponse,
30
- unmarshalListVpnGatewayTypesResponse: () => unmarshalListVpnGatewayTypesResponse,
31
- unmarshalListVpnGatewaysResponse: () => unmarshalListVpnGatewaysResponse,
32
- unmarshalRenewConnectionPskResponse: () => unmarshalRenewConnectionPskResponse,
33
- unmarshalRoutingPolicy: () => unmarshalRoutingPolicy,
34
- unmarshalVpnGateway: () => unmarshalVpnGateway
35
- });
36
- //#endregion
37
- export { API, VPN_GATEWAY_TRANSIENT_STATUSES, validation_rules_gen_exports as ValidationRules, index_gen_exports, marshalChangeConnectionPskRequest, marshalCreateConnectionRequest, marshalCreateCustomerGatewayRequest, marshalCreateRoutingPolicyRequest, marshalCreateVpnGatewayRequest, marshalDetachRoutingPolicyRequest, marshalRenewConnectionPskRequest, marshalSetRoutingPolicyRequest, marshalUpdateConnectionRequest, marshalUpdateCustomerGatewayRequest, marshalUpdateRoutingPolicyRequest, marshalUpdateVpnGatewayRequest, unmarshalChangeConnectionPskResponse, unmarshalConnection, unmarshalCreateConnectionResponse, unmarshalCustomerGateway, unmarshalListConnectionsResponse, unmarshalListCustomerGatewaysResponse, unmarshalListRoutingPoliciesResponse, unmarshalListVpnGatewayTypesResponse, unmarshalListVpnGatewaysResponse, unmarshalRenewConnectionPskResponse, unmarshalRoutingPolicy, unmarshalVpnGateway };
@@ -1,26 +0,0 @@
1
- import type { DefaultValues } from '@scaleway/sdk-client';
2
- import type { Connection, CustomerGateway, RoutingPolicy, VpnGateway, ChangeConnectionPskResponse, CreateConnectionResponse, ListConnectionsResponse, ListCustomerGatewaysResponse, ListRoutingPoliciesResponse, ListVpnGatewayTypesResponse, ListVpnGatewaysResponse, RenewConnectionPskResponse, ChangeConnectionPskRequest, CreateConnectionRequest, CreateCustomerGatewayRequest, CreateRoutingPolicyRequest, CreateVpnGatewayRequest, DetachRoutingPolicyRequest, RenewConnectionPskRequest, SetRoutingPolicyRequest, UpdateConnectionRequest, UpdateCustomerGatewayRequest, UpdateRoutingPolicyRequest, UpdateVpnGatewayRequest } from './types.gen.js';
3
- export declare const unmarshalConnection: (data: unknown) => Connection;
4
- export declare const unmarshalCustomerGateway: (data: unknown) => CustomerGateway;
5
- export declare const unmarshalRoutingPolicy: (data: unknown) => RoutingPolicy;
6
- export declare const unmarshalVpnGateway: (data: unknown) => VpnGateway;
7
- export declare const unmarshalChangeConnectionPskResponse: (data: unknown) => ChangeConnectionPskResponse;
8
- export declare const unmarshalCreateConnectionResponse: (data: unknown) => CreateConnectionResponse;
9
- export declare const unmarshalListConnectionsResponse: (data: unknown) => ListConnectionsResponse;
10
- export declare const unmarshalListCustomerGatewaysResponse: (data: unknown) => ListCustomerGatewaysResponse;
11
- export declare const unmarshalListRoutingPoliciesResponse: (data: unknown) => ListRoutingPoliciesResponse;
12
- export declare const unmarshalListVpnGatewayTypesResponse: (data: unknown) => ListVpnGatewayTypesResponse;
13
- export declare const unmarshalListVpnGatewaysResponse: (data: unknown) => ListVpnGatewaysResponse;
14
- export declare const unmarshalRenewConnectionPskResponse: (data: unknown) => RenewConnectionPskResponse;
15
- export declare const marshalChangeConnectionPskRequest: (request: ChangeConnectionPskRequest, defaults: DefaultValues) => Record<string, unknown>;
16
- export declare const marshalCreateConnectionRequest: (request: CreateConnectionRequest, defaults: DefaultValues) => Record<string, unknown>;
17
- export declare const marshalCreateCustomerGatewayRequest: (request: CreateCustomerGatewayRequest, defaults: DefaultValues) => Record<string, unknown>;
18
- export declare const marshalCreateRoutingPolicyRequest: (request: CreateRoutingPolicyRequest, defaults: DefaultValues) => Record<string, unknown>;
19
- export declare const marshalCreateVpnGatewayRequest: (request: CreateVpnGatewayRequest, defaults: DefaultValues) => Record<string, unknown>;
20
- export declare const marshalDetachRoutingPolicyRequest: (request: DetachRoutingPolicyRequest, defaults: DefaultValues) => Record<string, unknown>;
21
- export declare const marshalRenewConnectionPskRequest: (request: RenewConnectionPskRequest, defaults: DefaultValues) => Record<string, unknown>;
22
- export declare const marshalSetRoutingPolicyRequest: (request: SetRoutingPolicyRequest, defaults: DefaultValues) => Record<string, unknown>;
23
- export declare const marshalUpdateConnectionRequest: (request: UpdateConnectionRequest, defaults: DefaultValues) => Record<string, unknown>;
24
- export declare const marshalUpdateCustomerGatewayRequest: (request: UpdateCustomerGatewayRequest, defaults: DefaultValues) => Record<string, unknown>;
25
- export declare const marshalUpdateRoutingPolicyRequest: (request: UpdateRoutingPolicyRequest, defaults: DefaultValues) => Record<string, unknown>;
26
- export declare const marshalUpdateVpnGatewayRequest: (request: UpdateVpnGatewayRequest, defaults: DefaultValues) => Record<string, unknown>;
@@ -1,309 +0,0 @@
1
- import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
2
- //#region src/v1alpha1/marshalling.gen.ts
3
- const unmarshalBgpSession = (data) => {
4
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'BgpSession' failed as data isn't a dictionary.`);
5
- return {
6
- peerPrivateIp: data.peer_private_ip,
7
- privateIp: data.private_ip,
8
- routingPolicyId: data.routing_policy_id
9
- };
10
- };
11
- const unmarshalConnectionCipher = (data) => {
12
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ConnectionCipher' failed as data isn't a dictionary.`);
13
- return {
14
- dhGroup: data.dh_group ? data.dh_group : void 0,
15
- encryption: data.encryption,
16
- integrity: data.integrity ? data.integrity : void 0
17
- };
18
- };
19
- const unmarshalConnection = (data) => {
20
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Connection' failed as data isn't a dictionary.`);
21
- return {
22
- bgpSessionIpv4: data.bgp_session_ipv4 ? unmarshalBgpSession(data.bgp_session_ipv4) : void 0,
23
- bgpSessionIpv6: data.bgp_session_ipv6 ? unmarshalBgpSession(data.bgp_session_ipv6) : void 0,
24
- bgpStatusIpv4: data.bgp_status_ipv4,
25
- bgpStatusIpv6: data.bgp_status_ipv6,
26
- createdAt: unmarshalDate(data.created_at),
27
- customerGatewayId: data.customer_gateway_id,
28
- espCiphers: unmarshalArrayOfObject(data.esp_ciphers, unmarshalConnectionCipher),
29
- id: data.id,
30
- ikev2Ciphers: unmarshalArrayOfObject(data.ikev2_ciphers, unmarshalConnectionCipher),
31
- initiationPolicy: data.initiation_policy,
32
- isIpv6: data.is_ipv6,
33
- name: data.name,
34
- organizationId: data.organization_id,
35
- projectId: data.project_id,
36
- region: data.region,
37
- routePropagationEnabled: data.route_propagation_enabled,
38
- secretId: data.secret_id,
39
- secretRevision: data.secret_revision,
40
- status: data.status,
41
- tags: data.tags,
42
- tunnelStatus: data.tunnel_status,
43
- tunnelStatusIpv4: data.tunnel_status_ipv4 ? data.tunnel_status_ipv4 : void 0,
44
- tunnelStatusIpv6: data.tunnel_status_ipv6 ? data.tunnel_status_ipv6 : void 0,
45
- updatedAt: unmarshalDate(data.updated_at),
46
- vpnGatewayId: data.vpn_gateway_id
47
- };
48
- };
49
- const unmarshalCustomerGateway = (data) => {
50
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CustomerGateway' failed as data isn't a dictionary.`);
51
- return {
52
- asn: data.asn,
53
- connectionIds: data.connection_ids,
54
- createdAt: unmarshalDate(data.created_at),
55
- id: data.id,
56
- name: data.name,
57
- organizationId: data.organization_id,
58
- projectId: data.project_id,
59
- publicIpv4: data.public_ipv4,
60
- publicIpv6: data.public_ipv6,
61
- region: data.region,
62
- tags: data.tags,
63
- updatedAt: unmarshalDate(data.updated_at)
64
- };
65
- };
66
- const unmarshalRoutingPolicy = (data) => {
67
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'RoutingPolicy' failed as data isn't a dictionary.`);
68
- return {
69
- createdAt: unmarshalDate(data.created_at),
70
- id: data.id,
71
- isIpv6: data.is_ipv6,
72
- name: data.name,
73
- organizationId: data.organization_id,
74
- prefixFilterIn: data.prefix_filter_in,
75
- prefixFilterOut: data.prefix_filter_out,
76
- projectId: data.project_id,
77
- region: data.region,
78
- tags: data.tags,
79
- updatedAt: unmarshalDate(data.updated_at)
80
- };
81
- };
82
- const unmarshalVpnGatewayPrivateConfig = (data) => {
83
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VpnGatewayPrivateConfig' failed as data isn't a dictionary.`);
84
- return {};
85
- };
86
- const unmarshalVpnGatewayPublicConfig = (data) => {
87
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VpnGatewayPublicConfig' failed as data isn't a dictionary.`);
88
- return {
89
- ipamIpv4Id: data.ipam_ipv4_id,
90
- ipamIpv6Id: data.ipam_ipv6_id
91
- };
92
- };
93
- const unmarshalVpnGateway = (data) => {
94
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VpnGateway' failed as data isn't a dictionary.`);
95
- return {
96
- asn: data.asn,
97
- connectionIds: data.connection_ids,
98
- createdAt: unmarshalDate(data.created_at),
99
- gatewayType: data.gateway_type,
100
- id: data.id,
101
- ipamPrivateIpv4Id: data.ipam_private_ipv4_id,
102
- ipamPrivateIpv6Id: data.ipam_private_ipv6_id,
103
- name: data.name,
104
- organizationId: data.organization_id,
105
- privateConfig: data.private_config ? unmarshalVpnGatewayPrivateConfig(data.private_config) : void 0,
106
- privateNetworkId: data.private_network_id,
107
- projectId: data.project_id,
108
- publicConfig: data.public_config ? unmarshalVpnGatewayPublicConfig(data.public_config) : void 0,
109
- region: data.region,
110
- status: data.status,
111
- tags: data.tags,
112
- updatedAt: unmarshalDate(data.updated_at),
113
- zone: data.zone
114
- };
115
- };
116
- const unmarshalChangeConnectionPskResponse = (data) => {
117
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ChangeConnectionPskResponse' failed as data isn't a dictionary.`);
118
- return { connection: data.connection ? unmarshalConnection(data.connection) : void 0 };
119
- };
120
- const unmarshalCreateConnectionResponse = (data) => {
121
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CreateConnectionResponse' failed as data isn't a dictionary.`);
122
- return {
123
- connection: data.connection ? unmarshalConnection(data.connection) : void 0,
124
- preSharedKey: data.pre_shared_key
125
- };
126
- };
127
- const unmarshalListConnectionsResponse = (data) => {
128
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListConnectionsResponse' failed as data isn't a dictionary.`);
129
- return {
130
- connections: unmarshalArrayOfObject(data.connections, unmarshalConnection),
131
- totalCount: data.total_count
132
- };
133
- };
134
- const unmarshalListCustomerGatewaysResponse = (data) => {
135
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListCustomerGatewaysResponse' failed as data isn't a dictionary.`);
136
- return {
137
- gateways: unmarshalArrayOfObject(data.gateways, unmarshalCustomerGateway),
138
- totalCount: data.total_count
139
- };
140
- };
141
- const unmarshalListRoutingPoliciesResponse = (data) => {
142
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListRoutingPoliciesResponse' failed as data isn't a dictionary.`);
143
- return {
144
- routingPolicies: unmarshalArrayOfObject(data.routing_policies, unmarshalRoutingPolicy),
145
- totalCount: data.total_count
146
- };
147
- };
148
- const unmarshalGatewayType = (data) => {
149
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GatewayType' failed as data isn't a dictionary.`);
150
- return {
151
- allowedConnections: data.allowed_connections,
152
- bandwidth: data.bandwidth,
153
- name: data.name,
154
- region: data.region,
155
- zones: data.zones
156
- };
157
- };
158
- const unmarshalListVpnGatewayTypesResponse = (data) => {
159
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListVpnGatewayTypesResponse' failed as data isn't a dictionary.`);
160
- return {
161
- gatewayTypes: unmarshalArrayOfObject(data.gateway_types, unmarshalGatewayType),
162
- totalCount: data.total_count
163
- };
164
- };
165
- const unmarshalListVpnGatewaysResponse = (data) => {
166
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListVpnGatewaysResponse' failed as data isn't a dictionary.`);
167
- return {
168
- gateways: unmarshalArrayOfObject(data.gateways, unmarshalVpnGateway),
169
- totalCount: data.total_count
170
- };
171
- };
172
- const unmarshalRenewConnectionPskResponse = (data) => {
173
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'RenewConnectionPskResponse' failed as data isn't a dictionary.`);
174
- return {
175
- connection: data.connection ? unmarshalConnection(data.connection) : void 0,
176
- preSharedKey: data.pre_shared_key
177
- };
178
- };
179
- const marshalChangeConnectionPskRequestSecret = (request, defaults) => ({
180
- id: request.id,
181
- revision: request.revision
182
- });
183
- const marshalChangeConnectionPskRequest = (request, defaults) => ({ secret: marshalChangeConnectionPskRequestSecret(request.secret, defaults) });
184
- const marshalConnectionCipher = (request, defaults) => ({
185
- dh_group: request.dhGroup,
186
- encryption: request.encryption,
187
- integrity: request.integrity
188
- });
189
- const marshalCreateConnectionRequestBgpConfig = (request, defaults) => ({
190
- peer_private_ip: request.peerPrivateIp,
191
- private_ip: request.privateIp,
192
- routing_policy_id: request.routingPolicyId
193
- });
194
- const marshalCreateConnectionRequestSecret = (request, defaults) => ({
195
- id: request.id,
196
- revision: request.revision
197
- });
198
- const marshalCreateConnectionRequest = (request, defaults) => ({
199
- bgp_config_ipv4: request.bgpConfigIpv4 !== void 0 ? marshalCreateConnectionRequestBgpConfig(request.bgpConfigIpv4, defaults) : void 0,
200
- bgp_config_ipv6: request.bgpConfigIpv6 !== void 0 ? marshalCreateConnectionRequestBgpConfig(request.bgpConfigIpv6, defaults) : void 0,
201
- customer_gateway_id: request.customerGatewayId,
202
- enable_route_propagation: request.enableRoutePropagation,
203
- esp_ciphers: request.espCiphers.map((elt) => marshalConnectionCipher(elt, defaults)),
204
- ikev2_ciphers: request.ikev2Ciphers.map((elt) => marshalConnectionCipher(elt, defaults)),
205
- initiation_policy: request.initiationPolicy,
206
- is_ipv6: request.isIpv6,
207
- name: request.name,
208
- project_id: request.projectId ?? defaults.defaultProjectId,
209
- secret: request.secret !== void 0 ? marshalCreateConnectionRequestSecret(request.secret, defaults) : void 0,
210
- tags: request.tags,
211
- vpn_gateway_id: request.vpnGatewayId
212
- });
213
- const marshalCreateCustomerGatewayRequest = (request, defaults) => ({
214
- asn: request.asn,
215
- ipv4_public: request.ipv4Public,
216
- ipv6_public: request.ipv6Public,
217
- name: request.name,
218
- project_id: request.projectId ?? defaults.defaultProjectId,
219
- tags: request.tags
220
- });
221
- const marshalCreateRoutingPolicyRequest = (request, defaults) => ({
222
- is_ipv6: request.isIpv6,
223
- name: request.name,
224
- prefix_filter_in: request.prefixFilterIn,
225
- prefix_filter_out: request.prefixFilterOut,
226
- project_id: request.projectId ?? defaults.defaultProjectId,
227
- tags: request.tags
228
- });
229
- const marshalCreateVpnGatewayRequestDualIpTunnel = (request, defaults) => ({
230
- ipam_ipv4_id: request.ipamIpv4Id,
231
- ipam_ipv6_id: request.ipamIpv6Id
232
- });
233
- const marshalCreateVpnGatewayRequestSingleIpTunnel = (request, defaults) => ({ ipam_id: request.ipamId });
234
- const marshalCreateVpnGatewayRequestPublicConfig = (request, defaults) => ({
235
- ipam_ipv4_id: request.ipamIpv4Id,
236
- ipam_ipv6_id: request.ipamIpv6Id
237
- });
238
- const marshalCreateVpnGatewayRequestPublicTunnelConfig = (request, defaults) => ({ ...resolveOneOf([
239
- {
240
- param: "single_ipv4_tunnel",
241
- value: request.singleIpv4Tunnel !== void 0 ? marshalCreateVpnGatewayRequestSingleIpTunnel(request.singleIpv4Tunnel, defaults) : void 0
242
- },
243
- {
244
- param: "single_ipv6_tunnel",
245
- value: request.singleIpv6Tunnel !== void 0 ? marshalCreateVpnGatewayRequestSingleIpTunnel(request.singleIpv6Tunnel, defaults) : void 0
246
- },
247
- {
248
- param: "dual_ipv4v6_tunnel",
249
- value: request.dualIpv4V6Tunnel !== void 0 ? marshalCreateVpnGatewayRequestDualIpTunnel(request.dualIpv4V6Tunnel, defaults) : void 0
250
- }
251
- ]) });
252
- const marshalCreateVpnGatewayRequest = (request, defaults) => ({
253
- gateway_type: request.gatewayType,
254
- ipam_private_ipv4_id: request.ipamPrivateIpv4Id,
255
- ipam_private_ipv6_id: request.ipamPrivateIpv6Id,
256
- name: request.name,
257
- private_network_id: request.privateNetworkId,
258
- project_id: request.projectId ?? defaults.defaultProjectId,
259
- tags: request.tags,
260
- zone: request.zone ?? defaults.defaultZone,
261
- ...resolveOneOf([{
262
- param: "public_config",
263
- value: request.publicConfig !== void 0 ? marshalCreateVpnGatewayRequestPublicConfig(request.publicConfig, defaults) : void 0
264
- }, {
265
- param: "public_tunnel_config",
266
- value: request.publicTunnelConfig !== void 0 ? marshalCreateVpnGatewayRequestPublicTunnelConfig(request.publicTunnelConfig, defaults) : void 0
267
- }])
268
- });
269
- const marshalDetachRoutingPolicyRequest = (request, defaults) => ({ ...resolveOneOf([{
270
- param: "routing_policy_v4",
271
- value: request.routingPolicyV4
272
- }, {
273
- param: "routing_policy_v6",
274
- value: request.routingPolicyV6
275
- }]) });
276
- const marshalRenewConnectionPskRequest = (request, defaults) => ({ generate_revision: request.generateRevision });
277
- const marshalSetRoutingPolicyRequest = (request, defaults) => ({ ...resolveOneOf([{
278
- param: "routing_policy_v4",
279
- value: request.routingPolicyV4
280
- }, {
281
- param: "routing_policy_v6",
282
- value: request.routingPolicyV6
283
- }]) });
284
- const marshalUpdateConnectionRequest = (request, defaults) => ({
285
- esp_ciphers: request.espCiphers !== void 0 ? request.espCiphers.map((elt) => marshalConnectionCipher(elt, defaults)) : void 0,
286
- ikev2_ciphers: request.ikev2Ciphers !== void 0 ? request.ikev2Ciphers.map((elt) => marshalConnectionCipher(elt, defaults)) : void 0,
287
- initiation_policy: request.initiationPolicy,
288
- name: request.name,
289
- tags: request.tags
290
- });
291
- const marshalUpdateCustomerGatewayRequest = (request, defaults) => ({
292
- asn: request.asn,
293
- ipv4_public: request.ipv4Public,
294
- ipv6_public: request.ipv6Public,
295
- name: request.name,
296
- tags: request.tags
297
- });
298
- const marshalUpdateRoutingPolicyRequest = (request, defaults) => ({
299
- name: request.name,
300
- prefix_filter_in: request.prefixFilterIn,
301
- prefix_filter_out: request.prefixFilterOut,
302
- tags: request.tags
303
- });
304
- const marshalUpdateVpnGatewayRequest = (request, defaults) => ({
305
- name: request.name,
306
- tags: request.tags
307
- });
308
- //#endregion
309
- export { marshalChangeConnectionPskRequest, marshalCreateConnectionRequest, marshalCreateCustomerGatewayRequest, marshalCreateRoutingPolicyRequest, marshalCreateVpnGatewayRequest, marshalDetachRoutingPolicyRequest, marshalRenewConnectionPskRequest, marshalSetRoutingPolicyRequest, marshalUpdateConnectionRequest, marshalUpdateCustomerGatewayRequest, marshalUpdateRoutingPolicyRequest, marshalUpdateVpnGatewayRequest, unmarshalChangeConnectionPskResponse, unmarshalConnection, unmarshalCreateConnectionResponse, unmarshalCustomerGateway, unmarshalListConnectionsResponse, unmarshalListCustomerGatewaysResponse, unmarshalListRoutingPoliciesResponse, unmarshalListVpnGatewayTypesResponse, unmarshalListVpnGatewaysResponse, unmarshalRenewConnectionPskResponse, unmarshalRoutingPolicy, unmarshalVpnGateway };