@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.
- package/README.md +1 -1
- package/dist/_virtual/_rolldown/runtime.js +11 -0
- package/dist/index.gen.js +2 -4
- package/dist/v2/api.gen.d.ts +1 -39
- package/dist/v2/api.gen.js +267 -464
- package/dist/v2/index.gen.d.ts +1 -1
- package/dist/v2/index.gen.js +29 -31
- package/dist/v2/marshalling.gen.d.ts +1 -5
- package/dist/v2/marshalling.gen.js +142 -278
- package/dist/v2/types.gen.d.ts +0 -167
- package/dist/v2/validation-rules.gen.js +12 -24
- package/package.json +4 -4
package/dist/v2/index.gen.d.ts
CHANGED
|
@@ -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,
|
|
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';
|
package/dist/v2/index.gen.js
CHANGED
|
@@ -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 {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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,
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
-
|
|
118
|
-
|
|
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
|
-
|
|
128
|
-
|
|
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
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
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
|
-
|
|
156
|
-
|
|
157
|
-
|
|
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
|
-
|
|
167
|
-
|
|
168
|
-
|
|
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
|
-
|
|
178
|
-
|
|
179
|
-
|
|
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
|
-
|
|
200
|
-
|
|
201
|
-
|
|
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
|
-
|
|
211
|
-
|
|
212
|
-
|
|
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
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
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
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
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
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
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
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
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
|
-
|
|
268
|
-
|
|
269
|
-
|
|
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
|
-
|
|
273
|
-
|
|
274
|
-
|
|
166
|
+
default_route_propagation_enabled: request.defaultRoutePropagationEnabled,
|
|
167
|
+
name: request.name,
|
|
168
|
+
tags: request.tags
|
|
275
169
|
});
|
|
276
170
|
const marshalUpdateRouteRequest = (request, defaults) => ({
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
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
|
-
|
|
290
|
-
|
|
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 };
|