@scaleway/sdk-vpc 2.10.0 → 2.11.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.
@@ -1,189 +0,0 @@
1
- import { marshalCreateIngressRuleRequest, marshalCreatePrivateNetworkRequest, marshalCreateRouteRequest, marshalCreateVPCConnectorRequest, marshalCreateVPCRequest, marshalSetAclRequest, marshalUpdateIngressRuleRequest, marshalUpdatePrivateNetworkRequest, marshalUpdateRouteRequest, marshalUpdateVPCConnectorRequest, marshalUpdateVPCRequest, unmarshalGetAclResponse, unmarshalIngressRule, unmarshalListIngressRulesResponse, unmarshalListPrivateNetworksResponse, unmarshalListSubnetOverlapsResponse, unmarshalListSubnetsResponse, unmarshalListVPCConnectorsResponse, unmarshalListVPCsResponse, unmarshalPrivateNetwork, unmarshalRoute, unmarshalSetAclResponse, unmarshalVPC, unmarshalVPCConnector } from "./marshalling.gen.js";
2
- import { API as API$1, enrichForPagination, toApiLocality, urlParams, validatePathParam } from "@scaleway/sdk-client";
3
- //#region src/v2/api.gen.ts
4
- const jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
5
- /**
6
- * VPC API.
7
-
8
- This API allows you to manage your Virtual Private Clouds (VPCs) and Private Networks.
9
- */
10
- var API = class extends API$1 {
11
- constructor(..._args) {
12
- super(..._args);
13
- this.pageOfListVPCs = (request = {}) => this.client.fetch({
14
- method: "GET",
15
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs`,
16
- urlParams: urlParams(["is_default", request.isDefault], ["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], ["routing_enabled", request.routingEnabled], ["tags", request.tags])
17
- }, unmarshalListVPCsResponse);
18
- this.listVPCs = (request = {}) => enrichForPagination("vpcs", this.pageOfListVPCs, request);
19
- this.createVPC = (request) => this.client.fetch({
20
- body: JSON.stringify(marshalCreateVPCRequest(request, this.client.settings)),
21
- headers: jsonContentHeaders,
22
- method: "POST",
23
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs`
24
- }, unmarshalVPC);
25
- this.getVPC = (request) => this.client.fetch({
26
- method: "GET",
27
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}`
28
- }, unmarshalVPC);
29
- this.updateVPC = (request) => this.client.fetch({
30
- body: JSON.stringify(marshalUpdateVPCRequest(request, this.client.settings)),
31
- headers: jsonContentHeaders,
32
- method: "PATCH",
33
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}`
34
- }, unmarshalVPC);
35
- this.deleteVPC = (request) => this.client.fetch({
36
- method: "DELETE",
37
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}`
38
- });
39
- this.pageOfListPrivateNetworks = (request = {}) => this.client.fetch({
40
- method: "GET",
41
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks`,
42
- urlParams: urlParams(["dhcp_enabled", request.dhcpEnabled], ["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], ["tags", request.tags], ["vpc_id", request.vpcId])
43
- }, unmarshalListPrivateNetworksResponse);
44
- this.listPrivateNetworks = (request = {}) => enrichForPagination("privateNetworks", this.pageOfListPrivateNetworks, request);
45
- this.createPrivateNetwork = (request) => this.client.fetch({
46
- body: JSON.stringify(marshalCreatePrivateNetworkRequest(request, this.client.settings)),
47
- headers: jsonContentHeaders,
48
- method: "POST",
49
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks`
50
- }, unmarshalPrivateNetwork);
51
- this.getPrivateNetwork = (request) => this.client.fetch({
52
- method: "GET",
53
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
54
- }, unmarshalPrivateNetwork);
55
- this.updatePrivateNetwork = (request) => this.client.fetch({
56
- body: JSON.stringify(marshalUpdatePrivateNetworkRequest(request, this.client.settings)),
57
- headers: jsonContentHeaders,
58
- method: "PATCH",
59
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
60
- }, unmarshalPrivateNetwork);
61
- this.deletePrivateNetwork = (request) => this.client.fetch({
62
- method: "DELETE",
63
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
64
- });
65
- this.enableDHCP = (request) => this.client.fetch({
66
- body: "{}",
67
- headers: jsonContentHeaders,
68
- method: "POST",
69
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}/enable-dhcp`
70
- }, unmarshalPrivateNetwork);
71
- this.enableRouting = (request) => this.client.fetch({
72
- body: "{}",
73
- headers: jsonContentHeaders,
74
- method: "POST",
75
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}/enable-routing`
76
- }, unmarshalVPC);
77
- this.enableCustomRoutesPropagation = (request) => this.client.fetch({
78
- body: "{}",
79
- headers: jsonContentHeaders,
80
- method: "POST",
81
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}/enable-custom-routes-propagation`
82
- }, unmarshalVPC);
83
- this.pageOfListSubnets = (request = {}) => this.client.fetch({
84
- method: "GET",
85
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/subnets`,
86
- urlParams: urlParams(["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["subnet_ids", request.subnetIds], ["vpc_id", request.vpcId])
87
- }, unmarshalListSubnetsResponse);
88
- this.listSubnets = (request = {}) => enrichForPagination("subnets", this.pageOfListSubnets, request);
89
- this.createRoute = (request) => this.client.fetch({
90
- body: JSON.stringify(marshalCreateRouteRequest(request, this.client.settings)),
91
- headers: jsonContentHeaders,
92
- method: "POST",
93
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes`
94
- }, unmarshalRoute);
95
- this.getRoute = (request) => this.client.fetch({
96
- method: "GET",
97
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam("routeId", request.routeId)}`
98
- }, unmarshalRoute);
99
- this.updateRoute = (request) => this.client.fetch({
100
- body: JSON.stringify(marshalUpdateRouteRequest(request, this.client.settings)),
101
- headers: jsonContentHeaders,
102
- method: "PATCH",
103
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam("routeId", request.routeId)}`
104
- }, unmarshalRoute);
105
- this.deleteRoute = (request) => this.client.fetch({
106
- method: "DELETE",
107
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam("routeId", request.routeId)}`
108
- });
109
- this.getAcl = (request) => this.client.fetch({
110
- method: "GET",
111
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}/acl-rules`,
112
- urlParams: urlParams(["is_ipv6", request.isIpv6])
113
- }, unmarshalGetAclResponse);
114
- this.setAcl = (request) => this.client.fetch({
115
- body: JSON.stringify(marshalSetAclRequest(request, this.client.settings)),
116
- headers: jsonContentHeaders,
117
- method: "PUT",
118
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}/acl-rules`
119
- }, unmarshalSetAclResponse);
120
- this.pageOfListVPCConnectors = (request = {}) => this.client.fetch({
121
- method: "GET",
122
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpc-connectors`,
123
- 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], ["status", request.status], ["tags", request.tags], ["target_vpc_id", request.targetVpcId], ["vpc_id", request.vpcId])
124
- }, unmarshalListVPCConnectorsResponse);
125
- this.listVPCConnectors = (request = {}) => enrichForPagination("vpcConnectors", this.pageOfListVPCConnectors, request);
126
- this.createVPCConnector = (request) => this.client.fetch({
127
- body: JSON.stringify(marshalCreateVPCConnectorRequest(request, this.client.settings)),
128
- headers: jsonContentHeaders,
129
- method: "POST",
130
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpc-connectors`
131
- }, unmarshalVPCConnector);
132
- this.getVPCConnector = (request) => this.client.fetch({
133
- method: "GET",
134
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpc-connectors/${validatePathParam("vpcConnectorId", request.vpcConnectorId)}`
135
- }, unmarshalVPCConnector);
136
- this.updateVPCConnector = (request) => this.client.fetch({
137
- body: JSON.stringify(marshalUpdateVPCConnectorRequest(request, this.client.settings)),
138
- headers: jsonContentHeaders,
139
- method: "PATCH",
140
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpc-connectors/${validatePathParam("vpcConnectorId", request.vpcConnectorId)}`
141
- }, unmarshalVPCConnector);
142
- this.deleteVPCConnector = (request) => this.client.fetch({
143
- method: "DELETE",
144
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpc-connectors/${validatePathParam("vpcConnectorId", request.vpcConnectorId)}`
145
- });
146
- this.pageOfListSubnetOverlaps = (request) => this.client.fetch({
147
- method: "GET",
148
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpc-connectors/${validatePathParam("vpcConnectorId", request.vpcConnectorId)}/subnet-overlaps`,
149
- urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
150
- }, unmarshalListSubnetOverlapsResponse);
151
- this.listSubnetOverlaps = (request) => enrichForPagination("subnetOverlaps", this.pageOfListSubnetOverlaps, request);
152
- this.pageOfListIngressRules = (request = {}) => this.client.fetch({
153
- method: "GET",
154
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ingress-rules`,
155
- urlParams: urlParams(["is_ipv6", request.isIpv6], ["nexthop_private_network_id", request.nexthopPrivateNetworkId], ["nexthop_resource_ip", request.nexthopResourceIp], ["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], ["vpc_id", request.vpcId])
156
- }, unmarshalListIngressRulesResponse);
157
- this.listIngressRules = (request = {}) => enrichForPagination("rules", this.pageOfListIngressRules, request);
158
- this.createIngressRule = (request) => this.client.fetch({
159
- body: JSON.stringify(marshalCreateIngressRuleRequest(request, this.client.settings)),
160
- headers: jsonContentHeaders,
161
- method: "POST",
162
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ingress-rules`
163
- }, unmarshalIngressRule);
164
- this.getIngressRule = (request) => this.client.fetch({
165
- method: "GET",
166
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ingress-rules/${validatePathParam("ruleId", request.ruleId)}`
167
- }, unmarshalIngressRule);
168
- this.updateIngressRule = (request) => this.client.fetch({
169
- body: JSON.stringify(marshalUpdateIngressRuleRequest(request, this.client.settings)),
170
- headers: jsonContentHeaders,
171
- method: "PATCH",
172
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ingress-rules/${validatePathParam("ruleId", request.ruleId)}`
173
- }, unmarshalIngressRule);
174
- this.deleteIngressRule = (request) => this.client.fetch({
175
- method: "DELETE",
176
- path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ingress-rules/${validatePathParam("ruleId", request.ruleId)}`
177
- });
178
- }
179
- static {
180
- this.LOCALITY = toApiLocality({ regions: [
181
- "fr-par",
182
- "it-mil",
183
- "nl-ams",
184
- "pl-waw"
185
- ] });
186
- }
187
- };
188
- //#endregion
189
- export { API };
@@ -1,4 +0,0 @@
1
- export { API, } from './api.gen.js';
2
- export * from './marshalling.gen.js';
3
- export type { AclRule, AclRuleProtocol, Action, CreateIngressRuleRequest, CreatePrivateNetworkRequest, CreateRouteRequest, CreateVPCConnectorRequest, CreateVPCRequest, DeleteIngressRuleRequest, DeletePrivateNetworkRequest, DeleteRouteRequest, DeleteVPCConnectorRequest, DeleteVPCRequest, EnableCustomRoutesPropagationRequest, EnableDHCPRequest, EnableRoutingRequest, GetAclRequest, GetAclResponse, GetIngressRuleRequest, GetPrivateNetworkRequest, GetRouteRequest, GetVPCConnectorRequest, GetVPCRequest, IngressRule, ListIngressRulesRequest, ListIngressRulesRequestOrderBy, ListIngressRulesResponse, ListPrivateNetworksRequest, ListPrivateNetworksRequestOrderBy, ListPrivateNetworksResponse, ListSubnetOverlapsRequest, ListSubnetOverlapsRequestOrderBy, ListSubnetOverlapsResponse, ListSubnetOverlapsResponseSubnetOverlap, ListSubnetsRequest, ListSubnetsRequestOrderBy, ListSubnetsResponse, ListVPCConnectorsRequest, ListVPCConnectorsRequestOrderBy, ListVPCConnectorsResponse, ListVPCsRequest, ListVPCsRequestOrderBy, ListVPCsResponse, PrivateNetwork, Route, RouteType, SetAclRequest, SetAclResponse, Subnet, UpdateIngressRuleRequest, UpdatePrivateNetworkRequest, UpdateRouteRequest, UpdateVPCConnectorRequest, UpdateVPCRequest, VPC, VPCConnector, VPCConnectorPeerInfo, VPCConnectorStatus, } from './types.gen.js';
4
- export * as ValidationRules from './validation-rules.gen.js';
@@ -1,35 +0,0 @@
1
- import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
- import { marshalCreateIngressRuleRequest, marshalCreatePrivateNetworkRequest, marshalCreateRouteRequest, marshalCreateVPCConnectorRequest, marshalCreateVPCRequest, marshalSetAclRequest, marshalUpdateIngressRuleRequest, marshalUpdatePrivateNetworkRequest, marshalUpdateRouteRequest, marshalUpdateVPCConnectorRequest, marshalUpdateVPCRequest, unmarshalGetAclResponse, unmarshalIngressRule, unmarshalListIngressRulesResponse, unmarshalListPrivateNetworksResponse, unmarshalListSubnetOverlapsResponse, unmarshalListSubnetsResponse, unmarshalListVPCConnectorsResponse, unmarshalListVPCsResponse, unmarshalPrivateNetwork, unmarshalRoute, unmarshalSetAclResponse, unmarshalVPC, unmarshalVPCConnector } from "./marshalling.gen.js";
3
- import { API } from "./api.gen.js";
4
- import { validation_rules_gen_exports } from "./validation-rules.gen.js";
5
- //#region src/v2/index.gen.ts
6
- var index_gen_exports = /* @__PURE__ */ __exportAll({
7
- API: () => API,
8
- ValidationRules: () => validation_rules_gen_exports,
9
- marshalCreateIngressRuleRequest: () => marshalCreateIngressRuleRequest,
10
- marshalCreatePrivateNetworkRequest: () => marshalCreatePrivateNetworkRequest,
11
- marshalCreateRouteRequest: () => marshalCreateRouteRequest,
12
- marshalCreateVPCConnectorRequest: () => marshalCreateVPCConnectorRequest,
13
- marshalCreateVPCRequest: () => marshalCreateVPCRequest,
14
- marshalSetAclRequest: () => marshalSetAclRequest,
15
- marshalUpdateIngressRuleRequest: () => marshalUpdateIngressRuleRequest,
16
- marshalUpdatePrivateNetworkRequest: () => marshalUpdatePrivateNetworkRequest,
17
- marshalUpdateRouteRequest: () => marshalUpdateRouteRequest,
18
- marshalUpdateVPCConnectorRequest: () => marshalUpdateVPCConnectorRequest,
19
- marshalUpdateVPCRequest: () => marshalUpdateVPCRequest,
20
- unmarshalGetAclResponse: () => unmarshalGetAclResponse,
21
- unmarshalIngressRule: () => unmarshalIngressRule,
22
- unmarshalListIngressRulesResponse: () => unmarshalListIngressRulesResponse,
23
- unmarshalListPrivateNetworksResponse: () => unmarshalListPrivateNetworksResponse,
24
- unmarshalListSubnetOverlapsResponse: () => unmarshalListSubnetOverlapsResponse,
25
- unmarshalListSubnetsResponse: () => unmarshalListSubnetsResponse,
26
- unmarshalListVPCConnectorsResponse: () => unmarshalListVPCConnectorsResponse,
27
- unmarshalListVPCsResponse: () => unmarshalListVPCsResponse,
28
- unmarshalPrivateNetwork: () => unmarshalPrivateNetwork,
29
- unmarshalRoute: () => unmarshalRoute,
30
- unmarshalSetAclResponse: () => unmarshalSetAclResponse,
31
- unmarshalVPC: () => unmarshalVPC,
32
- unmarshalVPCConnector: () => unmarshalVPCConnector
33
- });
34
- //#endregion
35
- export { API, validation_rules_gen_exports as ValidationRules, index_gen_exports, marshalCreateIngressRuleRequest, marshalCreatePrivateNetworkRequest, marshalCreateRouteRequest, marshalCreateVPCConnectorRequest, marshalCreateVPCRequest, marshalSetAclRequest, marshalUpdateIngressRuleRequest, marshalUpdatePrivateNetworkRequest, marshalUpdateRouteRequest, marshalUpdateVPCConnectorRequest, marshalUpdateVPCRequest, unmarshalGetAclResponse, unmarshalIngressRule, unmarshalListIngressRulesResponse, unmarshalListPrivateNetworksResponse, unmarshalListSubnetOverlapsResponse, unmarshalListSubnetsResponse, unmarshalListVPCConnectorsResponse, unmarshalListVPCsResponse, unmarshalPrivateNetwork, unmarshalRoute, unmarshalSetAclResponse, unmarshalVPC, unmarshalVPCConnector };
@@ -1,26 +0,0 @@
1
- import type { DefaultValues } from '@scaleway/sdk-client';
2
- import type { PrivateNetwork, Route, IngressRule, VPCConnector, VPC, GetAclResponse, ListIngressRulesResponse, ListPrivateNetworksResponse, ListSubnetOverlapsResponse, ListSubnetsResponse, ListVPCConnectorsResponse, ListVPCsResponse, SetAclResponse, CreateIngressRuleRequest, CreatePrivateNetworkRequest, CreateRouteRequest, CreateVPCConnectorRequest, CreateVPCRequest, SetAclRequest, UpdateIngressRuleRequest, UpdatePrivateNetworkRequest, UpdateRouteRequest, UpdateVPCConnectorRequest, UpdateVPCRequest } from './types.gen.js';
3
- export declare const unmarshalPrivateNetwork: (data: unknown) => PrivateNetwork;
4
- export declare const unmarshalRoute: (data: unknown) => Route;
5
- export declare const unmarshalIngressRule: (data: unknown) => IngressRule;
6
- export declare const unmarshalVPCConnector: (data: unknown) => VPCConnector;
7
- export declare const unmarshalVPC: (data: unknown) => VPC;
8
- export declare const unmarshalGetAclResponse: (data: unknown) => GetAclResponse;
9
- export declare const unmarshalListIngressRulesResponse: (data: unknown) => ListIngressRulesResponse;
10
- export declare const unmarshalListPrivateNetworksResponse: (data: unknown) => ListPrivateNetworksResponse;
11
- export declare const unmarshalListSubnetOverlapsResponse: (data: unknown) => ListSubnetOverlapsResponse;
12
- export declare const unmarshalListSubnetsResponse: (data: unknown) => ListSubnetsResponse;
13
- export declare const unmarshalListVPCConnectorsResponse: (data: unknown) => ListVPCConnectorsResponse;
14
- export declare const unmarshalListVPCsResponse: (data: unknown) => ListVPCsResponse;
15
- export declare const unmarshalSetAclResponse: (data: unknown) => SetAclResponse;
16
- export declare const marshalCreateIngressRuleRequest: (request: CreateIngressRuleRequest, defaults: DefaultValues) => Record<string, unknown>;
17
- export declare const marshalCreatePrivateNetworkRequest: (request: CreatePrivateNetworkRequest, defaults: DefaultValues) => Record<string, unknown>;
18
- export declare const marshalCreateRouteRequest: (request: CreateRouteRequest, defaults: DefaultValues) => Record<string, unknown>;
19
- export declare const marshalCreateVPCConnectorRequest: (request: CreateVPCConnectorRequest, defaults: DefaultValues) => Record<string, unknown>;
20
- export declare const marshalCreateVPCRequest: (request: CreateVPCRequest, defaults: DefaultValues) => Record<string, unknown>;
21
- export declare const marshalSetAclRequest: (request: SetAclRequest, defaults: DefaultValues) => Record<string, unknown>;
22
- export declare const marshalUpdateIngressRuleRequest: (request: UpdateIngressRuleRequest, defaults: DefaultValues) => Record<string, unknown>;
23
- export declare const marshalUpdatePrivateNetworkRequest: (request: UpdatePrivateNetworkRequest, defaults: DefaultValues) => Record<string, unknown>;
24
- export declare const marshalUpdateRouteRequest: (request: UpdateRouteRequest, defaults: DefaultValues) => Record<string, unknown>;
25
- export declare const marshalUpdateVPCConnectorRequest: (request: UpdateVPCConnectorRequest, defaults: DefaultValues) => Record<string, unknown>;
26
- export declare const marshalUpdateVPCRequest: (request: UpdateVPCRequest, defaults: DefaultValues) => Record<string, unknown>;
@@ -1,275 +0,0 @@
1
- import { isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
2
- import randomName from "@scaleway/random-name";
3
- //#region src/v2/marshalling.gen.ts
4
- const unmarshalSubnet = (data) => {
5
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Subnet' failed as data isn't a dictionary.`);
6
- return {
7
- createdAt: unmarshalDate(data.created_at),
8
- id: data.id,
9
- privateNetworkId: data.private_network_id,
10
- projectId: data.project_id,
11
- region: data.region,
12
- subnet: data.subnet,
13
- updatedAt: unmarshalDate(data.updated_at),
14
- vpcId: data.vpc_id
15
- };
16
- };
17
- const unmarshalPrivateNetwork = (data) => {
18
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.`);
19
- return {
20
- createdAt: unmarshalDate(data.created_at),
21
- defaultRoutePropagationEnabled: data.default_route_propagation_enabled,
22
- dhcpEnabled: data.dhcp_enabled,
23
- id: data.id,
24
- name: data.name,
25
- organizationId: data.organization_id,
26
- projectId: data.project_id,
27
- region: data.region,
28
- subnets: unmarshalArrayOfObject(data.subnets, unmarshalSubnet),
29
- tags: data.tags,
30
- updatedAt: unmarshalDate(data.updated_at),
31
- vpcId: data.vpc_id
32
- };
33
- };
34
- const unmarshalRoute = (data) => {
35
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Route' failed as data isn't a dictionary.`);
36
- return {
37
- createdAt: unmarshalDate(data.created_at),
38
- description: data.description,
39
- destination: data.destination,
40
- id: data.id,
41
- isReadOnly: data.is_read_only,
42
- nexthopPrivateNetworkId: data.nexthop_private_network_id,
43
- nexthopResourceId: data.nexthop_resource_id,
44
- nexthopVpcConnectorId: data.nexthop_vpc_connector_id,
45
- region: data.region,
46
- tags: data.tags,
47
- type: data.type ? data.type : void 0,
48
- updatedAt: unmarshalDate(data.updated_at),
49
- vpcId: data.vpc_id
50
- };
51
- };
52
- const unmarshalIngressRule = (data) => {
53
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'IngressRule' failed as data isn't a dictionary.`);
54
- return {
55
- createdAt: unmarshalDate(data.created_at),
56
- description: data.description,
57
- id: data.id,
58
- isIpv6: data.is_ipv6,
59
- nexthopPrivateNetworkId: data.nexthop_private_network_id,
60
- nexthopResourceIp: data.nexthop_resource_ip,
61
- organizationId: data.organization_id,
62
- projectId: data.project_id,
63
- region: data.region,
64
- source: data.source,
65
- tags: data.tags,
66
- updatedAt: unmarshalDate(data.updated_at),
67
- vpcId: data.vpc_id
68
- };
69
- };
70
- const unmarshalVPCConnectorPeerInfo = (data) => {
71
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VPCConnectorPeerInfo' failed as data isn't a dictionary.`);
72
- return {
73
- organizationId: data.organization_id,
74
- projectId: data.project_id,
75
- vpcName: data.vpc_name
76
- };
77
- };
78
- const unmarshalVPCConnector = (data) => {
79
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VPCConnector' failed as data isn't a dictionary.`);
80
- return {
81
- createdAt: unmarshalDate(data.created_at),
82
- id: data.id,
83
- name: data.name,
84
- organizationId: data.organization_id,
85
- peerInfo: data.peer_info ? unmarshalVPCConnectorPeerInfo(data.peer_info) : void 0,
86
- projectId: data.project_id,
87
- region: data.region,
88
- status: data.status,
89
- tags: data.tags,
90
- targetVpcId: data.target_vpc_id,
91
- updatedAt: unmarshalDate(data.updated_at),
92
- vpcId: data.vpc_id
93
- };
94
- };
95
- const unmarshalVPC = (data) => {
96
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VPC' failed as data isn't a dictionary.`);
97
- return {
98
- createdAt: unmarshalDate(data.created_at),
99
- customRoutesPropagationEnabled: data.custom_routes_propagation_enabled,
100
- id: data.id,
101
- isDefault: data.is_default,
102
- name: data.name,
103
- organizationId: data.organization_id,
104
- privateNetworkCount: data.private_network_count,
105
- projectId: data.project_id,
106
- region: data.region,
107
- routingEnabled: data.routing_enabled,
108
- tags: data.tags,
109
- transitivityEnabled: data.transitivity_enabled,
110
- updatedAt: unmarshalDate(data.updated_at)
111
- };
112
- };
113
- const unmarshalAclRule = (data) => {
114
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'AclRule' failed as data isn't a dictionary.`);
115
- return {
116
- action: data.action,
117
- description: data.description,
118
- destination: data.destination,
119
- dstPortHigh: data.dst_port_high,
120
- dstPortLow: data.dst_port_low,
121
- protocol: data.protocol,
122
- source: data.source,
123
- srcPortHigh: data.src_port_high,
124
- srcPortLow: data.src_port_low
125
- };
126
- };
127
- const unmarshalGetAclResponse = (data) => {
128
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GetAclResponse' failed as data isn't a dictionary.`);
129
- return {
130
- defaultPolicy: data.default_policy,
131
- rules: unmarshalArrayOfObject(data.rules, unmarshalAclRule)
132
- };
133
- };
134
- const unmarshalListIngressRulesResponse = (data) => {
135
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListIngressRulesResponse' failed as data isn't a dictionary.`);
136
- return {
137
- rules: unmarshalArrayOfObject(data.rules, unmarshalIngressRule),
138
- totalCount: data.total_count
139
- };
140
- };
141
- const unmarshalListPrivateNetworksResponse = (data) => {
142
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListPrivateNetworksResponse' failed as data isn't a dictionary.`);
143
- return {
144
- privateNetworks: unmarshalArrayOfObject(data.private_networks, unmarshalPrivateNetwork),
145
- totalCount: data.total_count
146
- };
147
- };
148
- const unmarshalListSubnetOverlapsResponseSubnetOverlap = (data) => {
149
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListSubnetOverlapsResponseSubnetOverlap' failed as data isn't a dictionary.`);
150
- return {
151
- subnet: data.subnet,
152
- subnetId: data.subnet_id,
153
- targetSubnet: data.target_subnet,
154
- targetSubnetId: data.target_subnet_id
155
- };
156
- };
157
- const unmarshalListSubnetOverlapsResponse = (data) => {
158
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListSubnetOverlapsResponse' failed as data isn't a dictionary.`);
159
- return {
160
- subnetOverlaps: unmarshalArrayOfObject(data.subnet_overlaps, unmarshalListSubnetOverlapsResponseSubnetOverlap),
161
- totalCount: data.total_count
162
- };
163
- };
164
- const unmarshalListSubnetsResponse = (data) => {
165
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListSubnetsResponse' failed as data isn't a dictionary.`);
166
- return {
167
- subnets: unmarshalArrayOfObject(data.subnets, unmarshalSubnet),
168
- totalCount: data.total_count
169
- };
170
- };
171
- const unmarshalListVPCConnectorsResponse = (data) => {
172
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListVPCConnectorsResponse' failed as data isn't a dictionary.`);
173
- return {
174
- totalCount: data.total_count,
175
- vpcConnectors: unmarshalArrayOfObject(data.vpc_connectors, unmarshalVPCConnector)
176
- };
177
- };
178
- const unmarshalListVPCsResponse = (data) => {
179
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListVPCsResponse' failed as data isn't a dictionary.`);
180
- return {
181
- totalCount: data.total_count,
182
- vpcs: unmarshalArrayOfObject(data.vpcs, unmarshalVPC)
183
- };
184
- };
185
- const unmarshalSetAclResponse = (data) => {
186
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SetAclResponse' failed as data isn't a dictionary.`);
187
- return {
188
- defaultPolicy: data.default_policy,
189
- rules: unmarshalArrayOfObject(data.rules, unmarshalAclRule)
190
- };
191
- };
192
- const marshalCreateIngressRuleRequest = (request, defaults) => ({
193
- description: request.description,
194
- nexthop_private_network_id: request.nexthopPrivateNetworkId,
195
- nexthop_resource_ip: request.nexthopResourceIp,
196
- source: request.source,
197
- tags: request.tags,
198
- vpc_id: request.vpcId
199
- });
200
- const marshalCreatePrivateNetworkRequest = (request, defaults) => ({
201
- default_route_propagation_enabled: request.defaultRoutePropagationEnabled,
202
- name: request.name || randomName("pn"),
203
- project_id: request.projectId ?? defaults.defaultProjectId,
204
- subnets: request.subnets,
205
- tags: request.tags,
206
- vpc_id: request.vpcId
207
- });
208
- const marshalCreateRouteRequest = (request, defaults) => ({
209
- description: request.description,
210
- destination: request.destination,
211
- nexthop_private_network_id: request.nexthopPrivateNetworkId,
212
- nexthop_resource_id: request.nexthopResourceId,
213
- nexthop_vpc_connector_id: request.nexthopVpcConnectorId,
214
- tags: request.tags,
215
- vpc_id: request.vpcId
216
- });
217
- const marshalCreateVPCConnectorRequest = (request, defaults) => ({
218
- name: request.name || randomName("VPCConnector"),
219
- tags: request.tags,
220
- target_vpc_id: request.targetVpcId,
221
- vpc_id: request.vpcId
222
- });
223
- const marshalCreateVPCRequest = (request, defaults) => ({
224
- enable_routing: request.enableRouting,
225
- enable_transitivity: request.enableTransitivity,
226
- name: request.name || randomName("vpc"),
227
- project_id: request.projectId ?? defaults.defaultProjectId,
228
- tags: request.tags
229
- });
230
- const marshalAclRule = (request, defaults) => ({
231
- action: request.action,
232
- description: request.description,
233
- destination: request.destination,
234
- dst_port_high: request.dstPortHigh,
235
- dst_port_low: request.dstPortLow,
236
- protocol: request.protocol,
237
- source: request.source,
238
- src_port_high: request.srcPortHigh,
239
- src_port_low: request.srcPortLow
240
- });
241
- const marshalSetAclRequest = (request, defaults) => ({
242
- default_policy: request.defaultPolicy,
243
- is_ipv6: request.isIpv6,
244
- rules: request.rules.map((elt) => marshalAclRule(elt, defaults))
245
- });
246
- const marshalUpdateIngressRuleRequest = (request, defaults) => ({
247
- description: request.description,
248
- nexthop_private_network_id: request.nexthopPrivateNetworkId,
249
- nexthop_resource_ip: request.nexthopResourceIp,
250
- source: request.source,
251
- tags: request.tags
252
- });
253
- const marshalUpdatePrivateNetworkRequest = (request, defaults) => ({
254
- default_route_propagation_enabled: request.defaultRoutePropagationEnabled,
255
- name: request.name,
256
- tags: request.tags
257
- });
258
- const marshalUpdateRouteRequest = (request, defaults) => ({
259
- description: request.description,
260
- destination: request.destination,
261
- nexthop_private_network_id: request.nexthopPrivateNetworkId,
262
- nexthop_resource_id: request.nexthopResourceId,
263
- nexthop_vpc_connector_id: request.nexthopVpcConnectorId,
264
- tags: request.tags
265
- });
266
- const marshalUpdateVPCConnectorRequest = (request, defaults) => ({
267
- name: request.name,
268
- tags: request.tags
269
- });
270
- const marshalUpdateVPCRequest = (request, defaults) => ({
271
- name: request.name,
272
- tags: request.tags
273
- });
274
- //#endregion
275
- export { marshalCreateIngressRuleRequest, marshalCreatePrivateNetworkRequest, marshalCreateRouteRequest, marshalCreateVPCConnectorRequest, marshalCreateVPCRequest, marshalSetAclRequest, marshalUpdateIngressRuleRequest, marshalUpdatePrivateNetworkRequest, marshalUpdateRouteRequest, marshalUpdateVPCConnectorRequest, marshalUpdateVPCRequest, unmarshalGetAclResponse, unmarshalIngressRule, unmarshalListIngressRulesResponse, unmarshalListPrivateNetworksResponse, unmarshalListSubnetOverlapsResponse, unmarshalListSubnetsResponse, unmarshalListVPCConnectorsResponse, unmarshalListVPCsResponse, unmarshalPrivateNetwork, unmarshalRoute, unmarshalSetAclResponse, unmarshalVPC, unmarshalVPCConnector };