@scaleway/sdk-vpc 2.2.1 → 2.3.1

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,4 +1,4 @@
1
1
  export { API, } from './api.gen.js';
2
2
  export * from './marshalling.gen.js';
3
- export type { AclRule, AclRuleProtocol, Action, AddSubnetsRequest, AddSubnetsResponse, CreatePrivateNetworkRequest, CreateRouteRequest, CreateVPCConnectorRequest, CreateVPCRequest, DeletePrivateNetworkRequest, DeleteRouteRequest, DeleteSubnetsRequest, DeleteSubnetsResponse, DeleteVPCConnectorRequest, DeleteVPCRequest, EnableCustomRoutesPropagationRequest, EnableDHCPRequest, EnableRoutingRequest, GetAclRequest, GetAclResponse, GetPrivateNetworkRequest, GetRouteRequest, GetVPCConnectorRequest, GetVPCRequest, ListPrivateNetworksRequest, ListPrivateNetworksRequestOrderBy, ListPrivateNetworksResponse, ListSubnetsRequest, ListSubnetsRequestOrderBy, ListSubnetsResponse, ListVPCConnectorsRequest, ListVPCConnectorsRequestOrderBy, ListVPCConnectorsResponse, ListVPCsRequest, ListVPCsRequestOrderBy, ListVPCsResponse, PrivateNetwork, Route, RouteType, SetAclRequest, SetAclResponse, Subnet, UpdatePrivateNetworkRequest, UpdateRouteRequest, UpdateVPCConnectorRequest, UpdateVPCRequest, VPC, VPCConnector, VPCConnectorPeerInfo, VPCConnectorStatus, } from './types.gen.js';
3
+ export type { AclRule, AclRuleProtocol, Action, AddSubnetsRequest, AddSubnetsResponse, CreatePrivateNetworkRequest, CreateRouteRequest, CreateVPCRequest, DeletePrivateNetworkRequest, DeleteRouteRequest, DeleteSubnetsRequest, DeleteSubnetsResponse, DeleteVPCRequest, EnableCustomRoutesPropagationRequest, EnableDHCPRequest, EnableRoutingRequest, GetAclRequest, GetAclResponse, GetPrivateNetworkRequest, GetRouteRequest, GetVPCRequest, ListPrivateNetworksRequest, ListPrivateNetworksRequestOrderBy, ListPrivateNetworksResponse, ListSubnetsRequest, ListSubnetsRequestOrderBy, ListSubnetsResponse, ListVPCsRequest, ListVPCsRequestOrderBy, ListVPCsResponse, PrivateNetwork, Route, RouteType, SetAclRequest, SetAclResponse, Subnet, UpdatePrivateNetworkRequest, UpdateRouteRequest, UpdateVPCRequest, VPC, } from './types.gen.js';
4
4
  export * as ValidationRules from './validation-rules.gen.js';
@@ -1,32 +1,30 @@
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
+ import { marshalAclRule, marshalAddSubnetsRequest, marshalCreatePrivateNetworkRequest, marshalCreateRouteRequest, marshalCreateVPCRequest, marshalDeleteSubnetsRequest, marshalSetAclRequest, marshalUpdatePrivateNetworkRequest, marshalUpdateRouteRequest, marshalUpdateVPCRequest, unmarshalAclRule, unmarshalAddSubnetsResponse, unmarshalDeleteSubnetsResponse, unmarshalGetAclResponse, unmarshalListPrivateNetworksResponse, unmarshalListSubnetsResponse, unmarshalListVPCsResponse, unmarshalPrivateNetwork, unmarshalRoute, unmarshalSetAclResponse, unmarshalVPC } from "./marshalling.gen.js";
1
3
  import { API } from "./api.gen.js";
2
- import { marshalAclRule, marshalAddSubnetsRequest, marshalCreatePrivateNetworkRequest, marshalCreateRouteRequest, marshalCreateVPCConnectorRequest, marshalCreateVPCRequest, marshalDeleteSubnetsRequest, marshalSetAclRequest, marshalUpdatePrivateNetworkRequest, marshalUpdateRouteRequest, marshalUpdateVPCConnectorRequest, marshalUpdateVPCRequest, unmarshalAclRule, unmarshalAddSubnetsResponse, unmarshalDeleteSubnetsResponse, unmarshalGetAclResponse, unmarshalListPrivateNetworksResponse, unmarshalListSubnetsResponse, unmarshalListVPCConnectorsResponse, unmarshalListVPCsResponse, unmarshalPrivateNetwork, unmarshalRoute, unmarshalSetAclResponse, unmarshalVPC, unmarshalVPCConnector } from "./marshalling.gen.js";
3
- import * as validationRules_gen from "./validation-rules.gen.js";
4
- export {
5
- API,
6
- validationRules_gen as ValidationRules,
7
- marshalAclRule,
8
- marshalAddSubnetsRequest,
9
- marshalCreatePrivateNetworkRequest,
10
- marshalCreateRouteRequest,
11
- marshalCreateVPCConnectorRequest,
12
- marshalCreateVPCRequest,
13
- marshalDeleteSubnetsRequest,
14
- marshalSetAclRequest,
15
- marshalUpdatePrivateNetworkRequest,
16
- marshalUpdateRouteRequest,
17
- marshalUpdateVPCConnectorRequest,
18
- marshalUpdateVPCRequest,
19
- unmarshalAclRule,
20
- unmarshalAddSubnetsResponse,
21
- unmarshalDeleteSubnetsResponse,
22
- unmarshalGetAclResponse,
23
- unmarshalListPrivateNetworksResponse,
24
- unmarshalListSubnetsResponse,
25
- unmarshalListVPCConnectorsResponse,
26
- unmarshalListVPCsResponse,
27
- unmarshalPrivateNetwork,
28
- unmarshalRoute,
29
- unmarshalSetAclResponse,
30
- unmarshalVPC,
31
- unmarshalVPCConnector
32
- };
4
+ import { validation_rules_gen_exports } from "./validation-rules.gen.js";
5
+ var index_gen_exports = /* @__PURE__ */ __exportAll({
6
+ API: () => API,
7
+ ValidationRules: () => validation_rules_gen_exports,
8
+ marshalAclRule: () => marshalAclRule,
9
+ marshalAddSubnetsRequest: () => marshalAddSubnetsRequest,
10
+ marshalCreatePrivateNetworkRequest: () => marshalCreatePrivateNetworkRequest,
11
+ marshalCreateRouteRequest: () => marshalCreateRouteRequest,
12
+ marshalCreateVPCRequest: () => marshalCreateVPCRequest,
13
+ marshalDeleteSubnetsRequest: () => marshalDeleteSubnetsRequest,
14
+ marshalSetAclRequest: () => marshalSetAclRequest,
15
+ marshalUpdatePrivateNetworkRequest: () => marshalUpdatePrivateNetworkRequest,
16
+ marshalUpdateRouteRequest: () => marshalUpdateRouteRequest,
17
+ marshalUpdateVPCRequest: () => marshalUpdateVPCRequest,
18
+ unmarshalAclRule: () => unmarshalAclRule,
19
+ unmarshalAddSubnetsResponse: () => unmarshalAddSubnetsResponse,
20
+ unmarshalDeleteSubnetsResponse: () => unmarshalDeleteSubnetsResponse,
21
+ unmarshalGetAclResponse: () => unmarshalGetAclResponse,
22
+ unmarshalListPrivateNetworksResponse: () => unmarshalListPrivateNetworksResponse,
23
+ unmarshalListSubnetsResponse: () => unmarshalListSubnetsResponse,
24
+ unmarshalListVPCsResponse: () => unmarshalListVPCsResponse,
25
+ unmarshalPrivateNetwork: () => unmarshalPrivateNetwork,
26
+ unmarshalRoute: () => unmarshalRoute,
27
+ unmarshalSetAclResponse: () => unmarshalSetAclResponse,
28
+ unmarshalVPC: () => unmarshalVPC
29
+ });
30
+ export { index_gen_exports };
@@ -1,8 +1,7 @@
1
1
  import type { DefaultValues } from '@scaleway/sdk-client';
2
- import type { AclRule, AddSubnetsRequest, AddSubnetsResponse, CreatePrivateNetworkRequest, CreateRouteRequest, CreateVPCConnectorRequest, CreateVPCRequest, DeleteSubnetsRequest, DeleteSubnetsResponse, GetAclResponse, ListPrivateNetworksResponse, ListSubnetsResponse, ListVPCConnectorsResponse, ListVPCsResponse, PrivateNetwork, Route, SetAclRequest, SetAclResponse, UpdatePrivateNetworkRequest, UpdateRouteRequest, UpdateVPCConnectorRequest, UpdateVPCRequest, VPC, VPCConnector } from './types.gen.js';
2
+ import type { AclRule, AddSubnetsRequest, AddSubnetsResponse, CreatePrivateNetworkRequest, CreateRouteRequest, CreateVPCRequest, DeleteSubnetsRequest, DeleteSubnetsResponse, GetAclResponse, ListPrivateNetworksResponse, ListSubnetsResponse, ListVPCsResponse, PrivateNetwork, Route, SetAclRequest, SetAclResponse, UpdatePrivateNetworkRequest, UpdateRouteRequest, UpdateVPCRequest, VPC } from './types.gen.js';
3
3
  export declare const unmarshalPrivateNetwork: (data: unknown) => PrivateNetwork;
4
4
  export declare const unmarshalRoute: (data: unknown) => Route;
5
- export declare const unmarshalVPCConnector: (data: unknown) => VPCConnector;
6
5
  export declare const unmarshalVPC: (data: unknown) => VPC;
7
6
  export declare const unmarshalAddSubnetsResponse: (data: unknown) => AddSubnetsResponse;
8
7
  export declare const unmarshalDeleteSubnetsResponse: (data: unknown) => DeleteSubnetsResponse;
@@ -10,18 +9,15 @@ export declare const unmarshalAclRule: (data: unknown) => AclRule;
10
9
  export declare const unmarshalGetAclResponse: (data: unknown) => GetAclResponse;
11
10
  export declare const unmarshalListPrivateNetworksResponse: (data: unknown) => ListPrivateNetworksResponse;
12
11
  export declare const unmarshalListSubnetsResponse: (data: unknown) => ListSubnetsResponse;
13
- export declare const unmarshalListVPCConnectorsResponse: (data: unknown) => ListVPCConnectorsResponse;
14
12
  export declare const unmarshalListVPCsResponse: (data: unknown) => ListVPCsResponse;
15
13
  export declare const unmarshalSetAclResponse: (data: unknown) => SetAclResponse;
16
14
  export declare const marshalAddSubnetsRequest: (request: AddSubnetsRequest, defaults: DefaultValues) => Record<string, unknown>;
17
15
  export declare const marshalCreatePrivateNetworkRequest: (request: CreatePrivateNetworkRequest, defaults: DefaultValues) => Record<string, unknown>;
18
16
  export declare const marshalCreateRouteRequest: (request: CreateRouteRequest, defaults: DefaultValues) => Record<string, unknown>;
19
- export declare const marshalCreateVPCConnectorRequest: (request: CreateVPCConnectorRequest, defaults: DefaultValues) => Record<string, unknown>;
20
17
  export declare const marshalCreateVPCRequest: (request: CreateVPCRequest, defaults: DefaultValues) => Record<string, unknown>;
21
18
  export declare const marshalDeleteSubnetsRequest: (request: DeleteSubnetsRequest, defaults: DefaultValues) => Record<string, unknown>;
22
19
  export declare const marshalAclRule: (request: AclRule, defaults: DefaultValues) => Record<string, unknown>;
23
20
  export declare const marshalSetAclRequest: (request: SetAclRequest, defaults: DefaultValues) => Record<string, unknown>;
24
21
  export declare const marshalUpdatePrivateNetworkRequest: (request: UpdatePrivateNetworkRequest, defaults: DefaultValues) => Record<string, unknown>;
25
22
  export declare const marshalUpdateRouteRequest: (request: UpdateRouteRequest, defaults: DefaultValues) => Record<string, unknown>;
26
- export declare const marshalUpdateVPCConnectorRequest: (request: UpdateVPCConnectorRequest, defaults: DefaultValues) => Record<string, unknown>;
27
23
  export declare const marshalUpdateVPCRequest: (request: UpdateVPCRequest, defaults: DefaultValues) => Record<string, unknown>;
@@ -1,318 +1,182 @@
1
- import randomName from "@scaleway/random-name";
2
1
  import { isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
3
- const unmarshalSubnet = (data) => {
4
- if (!isJSONObject(data)) {
5
- throw new TypeError(
6
- `Unmarshalling the type 'Subnet' failed as data isn't a dictionary.`
7
- );
8
- }
9
- return {
10
- createdAt: unmarshalDate(data.created_at),
11
- id: data.id,
12
- privateNetworkId: data.private_network_id,
13
- projectId: data.project_id,
14
- subnet: data.subnet,
15
- updatedAt: unmarshalDate(data.updated_at),
16
- vpcId: data.vpc_id
17
- };
2
+ import randomName from "@scaleway/random-name";
3
+ var unmarshalSubnet = (data) => {
4
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Subnet' failed as data isn't a dictionary.`);
5
+ return {
6
+ createdAt: unmarshalDate(data.created_at),
7
+ id: data.id,
8
+ privateNetworkId: data.private_network_id,
9
+ projectId: data.project_id,
10
+ subnet: data.subnet,
11
+ updatedAt: unmarshalDate(data.updated_at),
12
+ vpcId: data.vpc_id
13
+ };
18
14
  };
19
15
  const unmarshalPrivateNetwork = (data) => {
20
- if (!isJSONObject(data)) {
21
- throw new TypeError(
22
- `Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.`
23
- );
24
- }
25
- return {
26
- createdAt: unmarshalDate(data.created_at),
27
- defaultRoutePropagationEnabled: data.default_route_propagation_enabled,
28
- dhcpEnabled: data.dhcp_enabled,
29
- id: data.id,
30
- name: data.name,
31
- organizationId: data.organization_id,
32
- projectId: data.project_id,
33
- region: data.region,
34
- subnets: unmarshalArrayOfObject(data.subnets, unmarshalSubnet),
35
- tags: data.tags,
36
- updatedAt: unmarshalDate(data.updated_at),
37
- vpcId: data.vpc_id
38
- };
16
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.`);
17
+ return {
18
+ createdAt: unmarshalDate(data.created_at),
19
+ defaultRoutePropagationEnabled: data.default_route_propagation_enabled,
20
+ dhcpEnabled: data.dhcp_enabled,
21
+ id: data.id,
22
+ name: data.name,
23
+ organizationId: data.organization_id,
24
+ projectId: data.project_id,
25
+ region: data.region,
26
+ subnets: unmarshalArrayOfObject(data.subnets, unmarshalSubnet),
27
+ tags: data.tags,
28
+ updatedAt: unmarshalDate(data.updated_at),
29
+ vpcId: data.vpc_id
30
+ };
39
31
  };
40
32
  const unmarshalRoute = (data) => {
41
- if (!isJSONObject(data)) {
42
- throw new TypeError(
43
- `Unmarshalling the type 'Route' failed as data isn't a dictionary.`
44
- );
45
- }
46
- return {
47
- createdAt: unmarshalDate(data.created_at),
48
- description: data.description,
49
- destination: data.destination,
50
- id: data.id,
51
- isReadOnly: data.is_read_only,
52
- nexthopPrivateNetworkId: data.nexthop_private_network_id,
53
- nexthopResourceId: data.nexthop_resource_id,
54
- nexthopVpcConnectorId: data.nexthop_vpc_connector_id,
55
- region: data.region,
56
- tags: data.tags,
57
- type: data.type ? data.type : void 0,
58
- updatedAt: unmarshalDate(data.updated_at),
59
- vpcId: data.vpc_id
60
- };
61
- };
62
- const unmarshalVPCConnectorPeerInfo = (data) => {
63
- if (!isJSONObject(data)) {
64
- throw new TypeError(
65
- `Unmarshalling the type 'VPCConnectorPeerInfo' failed as data isn't a dictionary.`
66
- );
67
- }
68
- return {
69
- organizationId: data.organization_id,
70
- projectId: data.project_id,
71
- vpcName: data.vpc_name
72
- };
73
- };
74
- const unmarshalVPCConnector = (data) => {
75
- if (!isJSONObject(data)) {
76
- throw new TypeError(
77
- `Unmarshalling the type 'VPCConnector' failed as data isn't a dictionary.`
78
- );
79
- }
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
- };
33
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Route' failed as data isn't a dictionary.`);
34
+ return {
35
+ createdAt: unmarshalDate(data.created_at),
36
+ description: data.description,
37
+ destination: data.destination,
38
+ id: data.id,
39
+ isReadOnly: data.is_read_only,
40
+ nexthopPrivateNetworkId: data.nexthop_private_network_id,
41
+ nexthopResourceId: data.nexthop_resource_id,
42
+ nexthopVpcConnectorId: data.nexthop_vpc_connector_id,
43
+ region: data.region,
44
+ tags: data.tags,
45
+ type: data.type ? data.type : void 0,
46
+ updatedAt: unmarshalDate(data.updated_at),
47
+ vpcId: data.vpc_id
48
+ };
94
49
  };
95
50
  const unmarshalVPC = (data) => {
96
- if (!isJSONObject(data)) {
97
- throw new TypeError(
98
- `Unmarshalling the type 'VPC' failed as data isn't a dictionary.`
99
- );
100
- }
101
- return {
102
- createdAt: unmarshalDate(data.created_at),
103
- customRoutesPropagationEnabled: data.custom_routes_propagation_enabled,
104
- id: data.id,
105
- isDefault: data.is_default,
106
- name: data.name,
107
- organizationId: data.organization_id,
108
- privateNetworkCount: data.private_network_count,
109
- projectId: data.project_id,
110
- region: data.region,
111
- routingEnabled: data.routing_enabled,
112
- tags: data.tags,
113
- updatedAt: unmarshalDate(data.updated_at)
114
- };
51
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VPC' failed as data isn't a dictionary.`);
52
+ return {
53
+ createdAt: unmarshalDate(data.created_at),
54
+ customRoutesPropagationEnabled: data.custom_routes_propagation_enabled,
55
+ id: data.id,
56
+ isDefault: data.is_default,
57
+ name: data.name,
58
+ organizationId: data.organization_id,
59
+ privateNetworkCount: data.private_network_count,
60
+ projectId: data.project_id,
61
+ region: data.region,
62
+ routingEnabled: data.routing_enabled,
63
+ tags: data.tags,
64
+ updatedAt: unmarshalDate(data.updated_at)
65
+ };
115
66
  };
116
67
  const unmarshalAddSubnetsResponse = (data) => {
117
- if (!isJSONObject(data)) {
118
- throw new TypeError(
119
- `Unmarshalling the type 'AddSubnetsResponse' failed as data isn't a dictionary.`
120
- );
121
- }
122
- return {
123
- subnets: data.subnets
124
- };
68
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'AddSubnetsResponse' failed as data isn't a dictionary.`);
69
+ return { subnets: data.subnets };
125
70
  };
126
71
  const unmarshalDeleteSubnetsResponse = (data) => {
127
- if (!isJSONObject(data)) {
128
- throw new TypeError(
129
- `Unmarshalling the type 'DeleteSubnetsResponse' failed as data isn't a dictionary.`
130
- );
131
- }
132
- return {
133
- subnets: data.subnets
134
- };
72
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DeleteSubnetsResponse' failed as data isn't a dictionary.`);
73
+ return { subnets: data.subnets };
135
74
  };
136
75
  const unmarshalAclRule = (data) => {
137
- if (!isJSONObject(data)) {
138
- throw new TypeError(
139
- `Unmarshalling the type 'AclRule' failed as data isn't a dictionary.`
140
- );
141
- }
142
- return {
143
- action: data.action,
144
- description: data.description,
145
- destination: data.destination,
146
- dstPortHigh: data.dst_port_high,
147
- dstPortLow: data.dst_port_low,
148
- protocol: data.protocol,
149
- source: data.source,
150
- srcPortHigh: data.src_port_high,
151
- srcPortLow: data.src_port_low
152
- };
76
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'AclRule' failed as data isn't a dictionary.`);
77
+ return {
78
+ action: data.action,
79
+ description: data.description,
80
+ destination: data.destination,
81
+ dstPortHigh: data.dst_port_high,
82
+ dstPortLow: data.dst_port_low,
83
+ protocol: data.protocol,
84
+ source: data.source,
85
+ srcPortHigh: data.src_port_high,
86
+ srcPortLow: data.src_port_low
87
+ };
153
88
  };
154
89
  const unmarshalGetAclResponse = (data) => {
155
- if (!isJSONObject(data)) {
156
- throw new TypeError(
157
- `Unmarshalling the type 'GetAclResponse' failed as data isn't a dictionary.`
158
- );
159
- }
160
- return {
161
- defaultPolicy: data.default_policy,
162
- rules: unmarshalArrayOfObject(data.rules, unmarshalAclRule)
163
- };
90
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GetAclResponse' failed as data isn't a dictionary.`);
91
+ return {
92
+ defaultPolicy: data.default_policy,
93
+ rules: unmarshalArrayOfObject(data.rules, unmarshalAclRule)
94
+ };
164
95
  };
165
96
  const unmarshalListPrivateNetworksResponse = (data) => {
166
- if (!isJSONObject(data)) {
167
- throw new TypeError(
168
- `Unmarshalling the type 'ListPrivateNetworksResponse' failed as data isn't a dictionary.`
169
- );
170
- }
171
- return {
172
- privateNetworks: unmarshalArrayOfObject(data.private_networks, unmarshalPrivateNetwork),
173
- totalCount: data.total_count
174
- };
97
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListPrivateNetworksResponse' failed as data isn't a dictionary.`);
98
+ return {
99
+ privateNetworks: unmarshalArrayOfObject(data.private_networks, unmarshalPrivateNetwork),
100
+ totalCount: data.total_count
101
+ };
175
102
  };
176
103
  const unmarshalListSubnetsResponse = (data) => {
177
- if (!isJSONObject(data)) {
178
- throw new TypeError(
179
- `Unmarshalling the type 'ListSubnetsResponse' failed as data isn't a dictionary.`
180
- );
181
- }
182
- return {
183
- subnets: unmarshalArrayOfObject(data.subnets, unmarshalSubnet),
184
- totalCount: data.total_count
185
- };
186
- };
187
- const unmarshalListVPCConnectorsResponse = (data) => {
188
- if (!isJSONObject(data)) {
189
- throw new TypeError(
190
- `Unmarshalling the type 'ListVPCConnectorsResponse' failed as data isn't a dictionary.`
191
- );
192
- }
193
- return {
194
- totalCount: data.total_count,
195
- vpcConnectors: unmarshalArrayOfObject(data.vpc_connectors, unmarshalVPCConnector)
196
- };
104
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListSubnetsResponse' failed as data isn't a dictionary.`);
105
+ return {
106
+ subnets: unmarshalArrayOfObject(data.subnets, unmarshalSubnet),
107
+ totalCount: data.total_count
108
+ };
197
109
  };
198
110
  const unmarshalListVPCsResponse = (data) => {
199
- if (!isJSONObject(data)) {
200
- throw new TypeError(
201
- `Unmarshalling the type 'ListVPCsResponse' failed as data isn't a dictionary.`
202
- );
203
- }
204
- return {
205
- totalCount: data.total_count,
206
- vpcs: unmarshalArrayOfObject(data.vpcs, unmarshalVPC)
207
- };
111
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListVPCsResponse' failed as data isn't a dictionary.`);
112
+ return {
113
+ totalCount: data.total_count,
114
+ vpcs: unmarshalArrayOfObject(data.vpcs, unmarshalVPC)
115
+ };
208
116
  };
209
117
  const unmarshalSetAclResponse = (data) => {
210
- if (!isJSONObject(data)) {
211
- throw new TypeError(
212
- `Unmarshalling the type 'SetAclResponse' failed as data isn't a dictionary.`
213
- );
214
- }
215
- return {
216
- defaultPolicy: data.default_policy,
217
- rules: unmarshalArrayOfObject(data.rules, unmarshalAclRule)
218
- };
118
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SetAclResponse' failed as data isn't a dictionary.`);
119
+ return {
120
+ defaultPolicy: data.default_policy,
121
+ rules: unmarshalArrayOfObject(data.rules, unmarshalAclRule)
122
+ };
219
123
  };
220
- const marshalAddSubnetsRequest = (request, defaults) => ({
221
- subnets: request.subnets
222
- });
124
+ const marshalAddSubnetsRequest = (request, defaults) => ({ subnets: request.subnets });
223
125
  const marshalCreatePrivateNetworkRequest = (request, defaults) => ({
224
- default_route_propagation_enabled: request.defaultRoutePropagationEnabled,
225
- name: request.name || randomName("pn"),
226
- project_id: request.projectId ?? defaults.defaultProjectId,
227
- subnets: request.subnets,
228
- tags: request.tags,
229
- vpc_id: request.vpcId
126
+ default_route_propagation_enabled: request.defaultRoutePropagationEnabled,
127
+ name: request.name || randomName("pn"),
128
+ project_id: request.projectId ?? defaults.defaultProjectId,
129
+ subnets: request.subnets,
130
+ tags: request.tags,
131
+ vpc_id: request.vpcId
230
132
  });
231
133
  const marshalCreateRouteRequest = (request, defaults) => ({
232
- description: request.description,
233
- destination: request.destination,
234
- nexthop_private_network_id: request.nexthopPrivateNetworkId,
235
- nexthop_resource_id: request.nexthopResourceId,
236
- nexthop_vpc_connector_id: request.nexthopVpcConnectorId,
237
- tags: request.tags,
238
- vpc_id: request.vpcId
239
- });
240
- const marshalCreateVPCConnectorRequest = (request, defaults) => ({
241
- name: request.name || randomName("VPCConnector"),
242
- tags: request.tags,
243
- target_vpc_id: request.targetVpcId,
244
- vpc_id: request.vpcId
134
+ description: request.description,
135
+ destination: request.destination,
136
+ nexthop_private_network_id: request.nexthopPrivateNetworkId,
137
+ nexthop_resource_id: request.nexthopResourceId,
138
+ nexthop_vpc_connector_id: request.nexthopVpcConnectorId,
139
+ tags: request.tags,
140
+ vpc_id: request.vpcId
245
141
  });
246
142
  const marshalCreateVPCRequest = (request, defaults) => ({
247
- enable_routing: request.enableRouting,
248
- name: request.name || randomName("vpc"),
249
- project_id: request.projectId ?? defaults.defaultProjectId,
250
- tags: request.tags
251
- });
252
- const marshalDeleteSubnetsRequest = (request, defaults) => ({
253
- subnets: request.subnets
143
+ enable_routing: request.enableRouting,
144
+ name: request.name || randomName("vpc"),
145
+ project_id: request.projectId ?? defaults.defaultProjectId,
146
+ tags: request.tags
254
147
  });
148
+ const marshalDeleteSubnetsRequest = (request, defaults) => ({ subnets: request.subnets });
255
149
  const marshalAclRule = (request, defaults) => ({
256
- action: request.action,
257
- description: request.description,
258
- destination: request.destination,
259
- dst_port_high: request.dstPortHigh,
260
- dst_port_low: request.dstPortLow,
261
- protocol: request.protocol,
262
- source: request.source,
263
- src_port_high: request.srcPortHigh,
264
- src_port_low: request.srcPortLow
150
+ action: request.action,
151
+ description: request.description,
152
+ destination: request.destination,
153
+ dst_port_high: request.dstPortHigh,
154
+ dst_port_low: request.dstPortLow,
155
+ protocol: request.protocol,
156
+ source: request.source,
157
+ src_port_high: request.srcPortHigh,
158
+ src_port_low: request.srcPortLow
265
159
  });
266
160
  const marshalSetAclRequest = (request, defaults) => ({
267
- default_policy: request.defaultPolicy,
268
- is_ipv6: request.isIpv6,
269
- rules: request.rules.map((elt) => marshalAclRule(elt))
161
+ default_policy: request.defaultPolicy,
162
+ is_ipv6: request.isIpv6,
163
+ rules: request.rules.map((elt) => marshalAclRule(elt, defaults))
270
164
  });
271
165
  const marshalUpdatePrivateNetworkRequest = (request, defaults) => ({
272
- default_route_propagation_enabled: request.defaultRoutePropagationEnabled,
273
- name: request.name,
274
- tags: request.tags
166
+ default_route_propagation_enabled: request.defaultRoutePropagationEnabled,
167
+ name: request.name,
168
+ tags: request.tags
275
169
  });
276
170
  const marshalUpdateRouteRequest = (request, defaults) => ({
277
- description: request.description,
278
- destination: request.destination,
279
- nexthop_private_network_id: request.nexthopPrivateNetworkId,
280
- nexthop_resource_id: request.nexthopResourceId,
281
- nexthop_vpc_connector_id: request.nexthopVpcConnectorId,
282
- tags: request.tags
283
- });
284
- const marshalUpdateVPCConnectorRequest = (request, defaults) => ({
285
- name: request.name,
286
- tags: request.tags
171
+ description: request.description,
172
+ destination: request.destination,
173
+ nexthop_private_network_id: request.nexthopPrivateNetworkId,
174
+ nexthop_resource_id: request.nexthopResourceId,
175
+ nexthop_vpc_connector_id: request.nexthopVpcConnectorId,
176
+ tags: request.tags
287
177
  });
288
178
  const marshalUpdateVPCRequest = (request, defaults) => ({
289
- name: request.name,
290
- tags: request.tags
179
+ name: request.name,
180
+ tags: request.tags
291
181
  });
292
- export {
293
- marshalAclRule,
294
- marshalAddSubnetsRequest,
295
- marshalCreatePrivateNetworkRequest,
296
- marshalCreateRouteRequest,
297
- marshalCreateVPCConnectorRequest,
298
- marshalCreateVPCRequest,
299
- marshalDeleteSubnetsRequest,
300
- marshalSetAclRequest,
301
- marshalUpdatePrivateNetworkRequest,
302
- marshalUpdateRouteRequest,
303
- marshalUpdateVPCConnectorRequest,
304
- marshalUpdateVPCRequest,
305
- unmarshalAclRule,
306
- unmarshalAddSubnetsResponse,
307
- unmarshalDeleteSubnetsResponse,
308
- unmarshalGetAclResponse,
309
- unmarshalListPrivateNetworksResponse,
310
- unmarshalListSubnetsResponse,
311
- unmarshalListVPCConnectorsResponse,
312
- unmarshalListVPCsResponse,
313
- unmarshalPrivateNetwork,
314
- unmarshalRoute,
315
- unmarshalSetAclResponse,
316
- unmarshalVPC,
317
- unmarshalVPCConnector
318
- };
182
+ export { marshalAclRule, marshalAddSubnetsRequest, marshalCreatePrivateNetworkRequest, marshalCreateRouteRequest, marshalCreateVPCRequest, marshalDeleteSubnetsRequest, marshalSetAclRequest, marshalUpdatePrivateNetworkRequest, marshalUpdateRouteRequest, marshalUpdateVPCRequest, unmarshalAclRule, unmarshalAddSubnetsResponse, unmarshalDeleteSubnetsResponse, unmarshalGetAclResponse, unmarshalListPrivateNetworksResponse, unmarshalListSubnetsResponse, unmarshalListVPCsResponse, unmarshalPrivateNetwork, unmarshalRoute, unmarshalSetAclResponse, unmarshalVPC };