@scaleway/sdk-ipam 2.2.1 → 2.3.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.
package/README.md CHANGED
@@ -83,6 +83,7 @@ const api = new Ipam.v1.API(client)
83
83
  ## Support
84
84
 
85
85
  We love feedback! Feel free to reach us on:
86
+
86
87
  - [Scaleway Slack community](https://slack.scaleway.com/) - Join us on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource)
87
88
  - [GitHub Issues](https://github.com/scaleway/scaleway-sdk-js/issues)
88
89
 
@@ -93,4 +94,3 @@ This repository is at its early stage and is still in active development. If you
93
94
  ## License
94
95
 
95
96
  This project is Apache 2.0 licensed. See the [LICENSE](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE) file for details.
96
-
@@ -0,0 +1,11 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __exportAll = (all, no_symbols) => {
3
+ let target = {};
4
+ for (var name in all) __defProp(target, name, {
5
+ get: all[name],
6
+ enumerable: true
7
+ });
8
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
9
+ return target;
10
+ };
11
+ export { __exportAll };
package/dist/index.gen.js CHANGED
@@ -1,4 +1,2 @@
1
- import * as index_gen from "./v1/index.gen.js";
2
- export {
3
- index_gen as Ipamv1
4
- };
1
+ import { index_gen_exports } from "./v1/index.gen.js";
2
+ export { index_gen_exports as Ipamv1 };
@@ -1,192 +1,136 @@
1
- import { API as API$1, toApiLocality, validatePathParam, urlParams, resolveOneOf, enrichForPagination } from "@scaleway/sdk-client";
2
- import { marshalBookIPRequest, unmarshalIP, marshalReleaseIPSetRequest, marshalUpdateIPRequest, unmarshalListIPsResponse, marshalAttachIPRequest, marshalDetachIPRequest, marshalMoveIPRequest } from "./marshalling.gen.js";
3
- const jsonContentHeaders = {
4
- "Content-Type": "application/json; charset=utf-8"
5
- };
6
- class API extends API$1 {
7
- /**
8
- * Locality of this API.
9
- * type {'zone','region','global','unspecified'}
10
- */
11
- static LOCALITY = toApiLocality({
12
- regions: [
13
- "fr-par",
14
- "nl-ams",
15
- "pl-waw"
16
- ]
17
- });
18
- /**
19
- * Reserve a new IP. Reserve a new IP from the specified source. Currently IPs can only be reserved from a Private Network.
20
- *
21
- * @param request - The request {@link BookIPRequest}
22
- * @returns A Promise of IP
23
- */
24
- bookIP = (request) => this.client.fetch(
25
- {
26
- body: JSON.stringify(
27
- marshalBookIPRequest(request, this.client.settings)
28
- ),
29
- headers: jsonContentHeaders,
30
- method: "POST",
31
- path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips`
32
- },
33
- unmarshalIP
34
- );
35
- /**
36
- * Release an IP. Release an IP not currently attached to a resource, and returns it to the available IP pool.
37
- *
38
- * @param request - The request {@link ReleaseIPRequest}
39
- */
40
- releaseIP = (request) => this.client.fetch(
41
- {
42
- body: "{}",
43
- headers: jsonContentHeaders,
44
- method: "DELETE",
45
- path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam("ipId", request.ipId)}`
46
- }
47
- );
48
- releaseIPSet = (request = {}) => this.client.fetch(
49
- {
50
- body: JSON.stringify(
51
- marshalReleaseIPSetRequest(request, this.client.settings)
52
- ),
53
- headers: jsonContentHeaders,
54
- method: "POST",
55
- path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ip-sets/release`
56
- }
57
- );
58
- /**
59
- * Get an IP. Retrieve details of an existing IP, specified by its IP ID.
60
- *
61
- * @param request - The request {@link GetIPRequest}
62
- * @returns A Promise of IP
63
- */
64
- getIP = (request) => this.client.fetch(
65
- {
66
- method: "GET",
67
- path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam("ipId", request.ipId)}`
68
- },
69
- unmarshalIP
70
- );
71
- /**
72
- * Update an IP. Update parameters including tags of the specified IP.
73
- *
74
- * @param request - The request {@link UpdateIPRequest}
75
- * @returns A Promise of IP
76
- */
77
- updateIP = (request) => this.client.fetch(
78
- {
79
- body: JSON.stringify(
80
- marshalUpdateIPRequest(request, this.client.settings)
81
- ),
82
- headers: jsonContentHeaders,
83
- method: "PATCH",
84
- path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam("ipId", request.ipId)}`
85
- },
86
- unmarshalIP
87
- );
88
- pageOfListIPs = (request = {}) => this.client.fetch(
89
- {
90
- method: "GET",
91
- path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips`,
92
- urlParams: urlParams(
93
- ["attached", request.attached],
94
- ["ip_ids", request.ipIds],
95
- ["is_ipv6", request.isIpv6],
96
- ["mac_address", request.macAddress],
97
- ["order_by", request.orderBy],
98
- ["organization_id", request.organizationId],
99
- ["page", request.page],
100
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
101
- ["project_id", request.projectId],
102
- ["resource_id", request.resourceId],
103
- ["resource_ids", request.resourceIds],
104
- ["resource_name", request.resourceName],
105
- ["resource_type", request.resourceType],
106
- ["resource_types", request.resourceTypes],
107
- ["tags", request.tags],
108
- ["vpc_id", request.vpcId],
109
- ...Object.entries(resolveOneOf([
110
- {
111
- param: "zonal",
112
- value: request.zonal
113
- },
114
- {
115
- param: "private_network_id",
116
- value: request.privateNetworkId
117
- },
118
- {
119
- param: "subnet_id",
120
- value: request.subnetId
121
- },
122
- {
123
- param: "source_vpc_id",
124
- value: request.sourceVpcId
125
- }
126
- ]))
127
- )
128
- },
129
- unmarshalListIPsResponse
130
- );
131
- /**
132
- * List existing IPs. List existing IPs in the specified region using various filters. For example, you can filter for IPs within a specified Private Network, or for public IPs within a specified Project. By default, the IPs returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field.
133
- *
134
- * @param request - The request {@link ListIPsRequest}
135
- * @returns A Promise of ListIPsResponse
136
- */
137
- listIPs = (request = {}) => enrichForPagination("ips", this.pageOfListIPs, request);
138
- /**
139
- * Attach IP to custom resource. Attach an existing reserved IP from a Private Network subnet to a custom, named resource via its MAC address. An example of a custom resource is a virtual machine hosted on an Elastic Metal server. Do not use this method for attaching IP addresses to standard Scaleway resources as it will fail - see the relevant product API for an equivalent method.
140
- *
141
- * @param request - The request {@link AttachIPRequest}
142
- * @returns A Promise of IP
143
- */
144
- attachIP = (request) => this.client.fetch(
145
- {
146
- body: JSON.stringify(
147
- marshalAttachIPRequest(request, this.client.settings)
148
- ),
149
- headers: jsonContentHeaders,
150
- method: "POST",
151
- path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam("ipId", request.ipId)}/attach`
152
- },
153
- unmarshalIP
154
- );
155
- /**
156
- * Detach IP from a custom resource. Detach a private IP from a custom resource. An example of a custom resource is a virtual machine hosted on an Elastic Metal server. Do not use this method for detaching IP addresses from standard Scaleway resources (e.g. Instances, Load Balancers) as it will fail - see the relevant product API for an equivalent method.
157
- *
158
- * @param request - The request {@link DetachIPRequest}
159
- * @returns A Promise of IP
160
- */
161
- detachIP = (request) => this.client.fetch(
162
- {
163
- body: JSON.stringify(
164
- marshalDetachIPRequest(request, this.client.settings)
165
- ),
166
- headers: jsonContentHeaders,
167
- method: "POST",
168
- path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam("ipId", request.ipId)}/detach`
169
- },
170
- unmarshalIP
171
- );
172
- /**
173
- * Move IP to a custom resource. Move an existing reserved private IP from one custom resource (e.g. a virtual machine hosted on an Elastic Metal server) to another custom resource. This will detach it from the first resource, and attach it to the second. Do not use this method for moving IP addresses between standard Scaleway resources (e.g. Instances, Load Balancers) as it will fail - see the relevant product API for an equivalent method.
174
- *
175
- * @param request - The request {@link MoveIPRequest}
176
- * @returns A Promise of IP
177
- */
178
- moveIP = (request) => this.client.fetch(
179
- {
180
- body: JSON.stringify(
181
- marshalMoveIPRequest(request, this.client.settings)
182
- ),
183
- headers: jsonContentHeaders,
184
- method: "POST",
185
- path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam("ipId", request.ipId)}/move`
186
- },
187
- unmarshalIP
188
- );
189
- }
190
- export {
191
- API
1
+ import { marshalAttachIPRequest, marshalBookIPRequest, marshalDetachIPRequest, marshalMoveIPRequest, marshalReleaseIPSetRequest, marshalUpdateIPRequest, unmarshalIP, unmarshalListIPsResponse } from "./marshalling.gen.js";
2
+ import { API, enrichForPagination, resolveOneOf, toApiLocality, urlParams, validatePathParam } from "@scaleway/sdk-client";
3
+ var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
4
+ /**
5
+ * IPAM API.
6
+
7
+ This API allows you to manage your Scaleway IP addresses with our IP Address Management tool.
8
+ */
9
+ var API$1 = class extends API {
10
+ /**
11
+ * Locality of this API.
12
+ * type ∈ {'zone','region','global','unspecified'}
13
+ */
14
+ static LOCALITY = toApiLocality({ regions: [
15
+ "fr-par",
16
+ "nl-ams",
17
+ "pl-waw"
18
+ ] });
19
+ /**
20
+ * Reserve a new IP. Reserve a new IP from the specified source. Currently IPs can only be reserved from a Private Network.
21
+ *
22
+ * @param request - The request {@link BookIPRequest}
23
+ * @returns A Promise of IP
24
+ */
25
+ bookIP = (request) => this.client.fetch({
26
+ body: JSON.stringify(marshalBookIPRequest(request, this.client.settings)),
27
+ headers: jsonContentHeaders,
28
+ method: "POST",
29
+ path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips`
30
+ }, unmarshalIP);
31
+ /**
32
+ * Release an IP. Release an IP not currently attached to a resource, and returns it to the available IP pool.
33
+ *
34
+ * @param request - The request {@link ReleaseIPRequest}
35
+ */
36
+ releaseIP = (request) => this.client.fetch({
37
+ body: "{}",
38
+ headers: jsonContentHeaders,
39
+ method: "DELETE",
40
+ path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam("ipId", request.ipId)}`
41
+ });
42
+ releaseIPSet = (request = {}) => this.client.fetch({
43
+ body: JSON.stringify(marshalReleaseIPSetRequest(request, this.client.settings)),
44
+ headers: jsonContentHeaders,
45
+ method: "POST",
46
+ path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ip-sets/release`
47
+ });
48
+ /**
49
+ * Get an IP. Retrieve details of an existing IP, specified by its IP ID.
50
+ *
51
+ * @param request - The request {@link GetIPRequest}
52
+ * @returns A Promise of IP
53
+ */
54
+ getIP = (request) => this.client.fetch({
55
+ method: "GET",
56
+ path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam("ipId", request.ipId)}`
57
+ }, unmarshalIP);
58
+ /**
59
+ * Update an IP. Update parameters including tags of the specified IP.
60
+ *
61
+ * @param request - The request {@link UpdateIPRequest}
62
+ * @returns A Promise of IP
63
+ */
64
+ updateIP = (request) => this.client.fetch({
65
+ body: JSON.stringify(marshalUpdateIPRequest(request, this.client.settings)),
66
+ headers: jsonContentHeaders,
67
+ method: "PATCH",
68
+ path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam("ipId", request.ipId)}`
69
+ }, unmarshalIP);
70
+ pageOfListIPs = (request = {}) => this.client.fetch({
71
+ method: "GET",
72
+ path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips`,
73
+ urlParams: urlParams(["attached", request.attached], ["ip_ids", request.ipIds], ["is_ipv6", request.isIpv6], ["mac_address", request.macAddress], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["resource_id", request.resourceId], ["resource_ids", request.resourceIds], ["resource_name", request.resourceName], ["resource_type", request.resourceType], ["resource_types", request.resourceTypes], ["tags", request.tags], ["vpc_id", request.vpcId], ...Object.entries(resolveOneOf([
74
+ {
75
+ param: "zonal",
76
+ value: request.zonal
77
+ },
78
+ {
79
+ param: "private_network_id",
80
+ value: request.privateNetworkId
81
+ },
82
+ {
83
+ param: "subnet_id",
84
+ value: request.subnetId
85
+ },
86
+ {
87
+ param: "source_vpc_id",
88
+ value: request.sourceVpcId
89
+ }
90
+ ])))
91
+ }, unmarshalListIPsResponse);
92
+ /**
93
+ * List existing IPs. List existing IPs in the specified region using various filters. For example, you can filter for IPs within a specified Private Network, or for public IPs within a specified Project. By default, the IPs returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field.
94
+ *
95
+ * @param request - The request {@link ListIPsRequest}
96
+ * @returns A Promise of ListIPsResponse
97
+ */
98
+ listIPs = (request = {}) => enrichForPagination("ips", this.pageOfListIPs, request);
99
+ /**
100
+ * Attach IP to custom resource. Attach an existing reserved IP from a Private Network subnet to a custom, named resource via its MAC address. An example of a custom resource is a virtual machine hosted on an Elastic Metal server. Do not use this method for attaching IP addresses to standard Scaleway resources as it will fail - see the relevant product API for an equivalent method.
101
+ *
102
+ * @param request - The request {@link AttachIPRequest}
103
+ * @returns A Promise of IP
104
+ */
105
+ attachIP = (request) => this.client.fetch({
106
+ body: JSON.stringify(marshalAttachIPRequest(request, this.client.settings)),
107
+ headers: jsonContentHeaders,
108
+ method: "POST",
109
+ path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam("ipId", request.ipId)}/attach`
110
+ }, unmarshalIP);
111
+ /**
112
+ * Detach IP from a custom resource. Detach a private IP from a custom resource. An example of a custom resource is a virtual machine hosted on an Elastic Metal server. Do not use this method for detaching IP addresses from standard Scaleway resources (e.g. Instances, Load Balancers) as it will fail - see the relevant product API for an equivalent method.
113
+ *
114
+ * @param request - The request {@link DetachIPRequest}
115
+ * @returns A Promise of IP
116
+ */
117
+ detachIP = (request) => this.client.fetch({
118
+ body: JSON.stringify(marshalDetachIPRequest(request, this.client.settings)),
119
+ headers: jsonContentHeaders,
120
+ method: "POST",
121
+ path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam("ipId", request.ipId)}/detach`
122
+ }, unmarshalIP);
123
+ /**
124
+ * Move IP to a custom resource. Move an existing reserved private IP from one custom resource (e.g. a virtual machine hosted on an Elastic Metal server) to another custom resource. This will detach it from the first resource, and attach it to the second. Do not use this method for moving IP addresses between standard Scaleway resources (e.g. Instances, Load Balancers) as it will fail - see the relevant product API for an equivalent method.
125
+ *
126
+ * @param request - The request {@link MoveIPRequest}
127
+ * @returns A Promise of IP
128
+ */
129
+ moveIP = (request) => this.client.fetch({
130
+ body: JSON.stringify(marshalMoveIPRequest(request, this.client.settings)),
131
+ headers: jsonContentHeaders,
132
+ method: "POST",
133
+ path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam("ipId", request.ipId)}/move`
134
+ }, unmarshalIP);
192
135
  };
136
+ export { API$1 as API };
@@ -1,15 +1,17 @@
1
- import { API } from "./api.gen.js";
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
2
  import { marshalAttachIPRequest, marshalBookIPRequest, marshalDetachIPRequest, marshalMoveIPRequest, marshalReleaseIPSetRequest, marshalUpdateIPRequest, unmarshalIP, unmarshalListIPsResponse } from "./marshalling.gen.js";
3
- import * as validationRules_gen from "./validation-rules.gen.js";
4
- export {
5
- API,
6
- validationRules_gen as ValidationRules,
7
- marshalAttachIPRequest,
8
- marshalBookIPRequest,
9
- marshalDetachIPRequest,
10
- marshalMoveIPRequest,
11
- marshalReleaseIPSetRequest,
12
- marshalUpdateIPRequest,
13
- unmarshalIP,
14
- unmarshalListIPsResponse
15
- };
3
+ import { API } from "./api.gen.js";
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
+ marshalAttachIPRequest: () => marshalAttachIPRequest,
9
+ marshalBookIPRequest: () => marshalBookIPRequest,
10
+ marshalDetachIPRequest: () => marshalDetachIPRequest,
11
+ marshalMoveIPRequest: () => marshalMoveIPRequest,
12
+ marshalReleaseIPSetRequest: () => marshalReleaseIPSetRequest,
13
+ marshalUpdateIPRequest: () => marshalUpdateIPRequest,
14
+ unmarshalIP: () => unmarshalIP,
15
+ unmarshalListIPsResponse: () => unmarshalListIPsResponse
16
+ });
17
+ export { index_gen_exports };
@@ -1,133 +1,96 @@
1
- import { resolveOneOf, isJSONObject, unmarshalDate, unmarshalArrayOfObject } from "@scaleway/sdk-client";
2
- const unmarshalResource = (data) => {
3
- if (!isJSONObject(data)) {
4
- throw new TypeError(
5
- `Unmarshalling the type 'Resource' failed as data isn't a dictionary.`
6
- );
7
- }
8
- return {
9
- id: data.id,
10
- macAddress: data.mac_address,
11
- name: data.name,
12
- type: data.type
13
- };
1
+ import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
2
+ var unmarshalResource = (data) => {
3
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Resource' failed as data isn't a dictionary.`);
4
+ return {
5
+ id: data.id,
6
+ macAddress: data.mac_address,
7
+ name: data.name,
8
+ type: data.type
9
+ };
14
10
  };
15
- const unmarshalReverse = (data) => {
16
- if (!isJSONObject(data)) {
17
- throw new TypeError(
18
- `Unmarshalling the type 'Reverse' failed as data isn't a dictionary.`
19
- );
20
- }
21
- return {
22
- address: data.address,
23
- hostname: data.hostname
24
- };
11
+ var unmarshalReverse = (data) => {
12
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Reverse' failed as data isn't a dictionary.`);
13
+ return {
14
+ address: data.address,
15
+ hostname: data.hostname
16
+ };
25
17
  };
26
- const unmarshalSource = (data) => {
27
- if (!isJSONObject(data)) {
28
- throw new TypeError(
29
- `Unmarshalling the type 'Source' failed as data isn't a dictionary.`
30
- );
31
- }
32
- return {
33
- privateNetworkId: data.private_network_id,
34
- subnetId: data.subnet_id,
35
- vpcId: data.vpc_id,
36
- zonal: data.zonal
37
- };
18
+ var unmarshalSource = (data) => {
19
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Source' failed as data isn't a dictionary.`);
20
+ return {
21
+ privateNetworkId: data.private_network_id,
22
+ subnetId: data.subnet_id,
23
+ vpcId: data.vpc_id,
24
+ zonal: data.zonal
25
+ };
38
26
  };
39
27
  const unmarshalIP = (data) => {
40
- if (!isJSONObject(data)) {
41
- throw new TypeError(
42
- `Unmarshalling the type 'IP' failed as data isn't a dictionary.`
43
- );
44
- }
45
- return {
46
- address: data.address,
47
- createdAt: unmarshalDate(data.created_at),
48
- id: data.id,
49
- isIpv6: data.is_ipv6,
50
- projectId: data.project_id,
51
- region: data.region,
52
- resource: data.resource ? unmarshalResource(data.resource) : void 0,
53
- reverses: unmarshalArrayOfObject(data.reverses, unmarshalReverse),
54
- source: data.source ? unmarshalSource(data.source) : void 0,
55
- tags: data.tags,
56
- updatedAt: unmarshalDate(data.updated_at),
57
- zone: data.zone
58
- };
28
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'IP' failed as data isn't a dictionary.`);
29
+ return {
30
+ address: data.address,
31
+ createdAt: unmarshalDate(data.created_at),
32
+ id: data.id,
33
+ isIpv6: data.is_ipv6,
34
+ projectId: data.project_id,
35
+ region: data.region,
36
+ resource: data.resource ? unmarshalResource(data.resource) : void 0,
37
+ reverses: unmarshalArrayOfObject(data.reverses, unmarshalReverse),
38
+ source: data.source ? unmarshalSource(data.source) : void 0,
39
+ tags: data.tags,
40
+ updatedAt: unmarshalDate(data.updated_at),
41
+ zone: data.zone
42
+ };
59
43
  };
60
44
  const unmarshalListIPsResponse = (data) => {
61
- if (!isJSONObject(data)) {
62
- throw new TypeError(
63
- `Unmarshalling the type 'ListIPsResponse' failed as data isn't a dictionary.`
64
- );
65
- }
66
- return {
67
- ips: unmarshalArrayOfObject(data.ips, unmarshalIP),
68
- totalCount: data.total_count
69
- };
45
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListIPsResponse' failed as data isn't a dictionary.`);
46
+ return {
47
+ ips: unmarshalArrayOfObject(data.ips, unmarshalIP),
48
+ totalCount: data.total_count
49
+ };
70
50
  };
71
- const marshalCustomResource = (request, defaults) => ({
72
- mac_address: request.macAddress,
73
- name: request.name
74
- });
75
- const marshalAttachIPRequest = (request, defaults) => ({
76
- resource: marshalCustomResource(request.resource)
77
- });
78
- const marshalSource = (request, defaults) => ({
79
- ...resolveOneOf([
80
- {
81
- param: "zonal",
82
- value: request.zonal
83
- },
84
- {
85
- param: "private_network_id",
86
- value: request.privateNetworkId
87
- },
88
- {
89
- param: "subnet_id",
90
- value: request.subnetId
91
- },
92
- {
93
- param: "vpc_id",
94
- value: request.vpcId
95
- }
96
- ])
51
+ var marshalCustomResource = (request, defaults) => ({
52
+ mac_address: request.macAddress,
53
+ name: request.name
97
54
  });
55
+ const marshalAttachIPRequest = (request, defaults) => ({ resource: marshalCustomResource(request.resource, defaults) });
56
+ var marshalSource = (request, defaults) => ({ ...resolveOneOf([
57
+ {
58
+ param: "zonal",
59
+ value: request.zonal
60
+ },
61
+ {
62
+ param: "private_network_id",
63
+ value: request.privateNetworkId
64
+ },
65
+ {
66
+ param: "subnet_id",
67
+ value: request.subnetId
68
+ },
69
+ {
70
+ param: "vpc_id",
71
+ value: request.vpcId
72
+ }
73
+ ]) });
98
74
  const marshalBookIPRequest = (request, defaults) => ({
99
- address: request.address,
100
- is_ipv6: request.isIpv6,
101
- project_id: request.projectId ?? defaults.defaultProjectId,
102
- resource: request.resource !== void 0 ? marshalCustomResource(request.resource) : void 0,
103
- source: marshalSource(request.source),
104
- tags: request.tags
105
- });
106
- const marshalDetachIPRequest = (request, defaults) => ({
107
- resource: marshalCustomResource(request.resource)
75
+ address: request.address,
76
+ is_ipv6: request.isIpv6,
77
+ project_id: request.projectId ?? defaults.defaultProjectId,
78
+ resource: request.resource !== void 0 ? marshalCustomResource(request.resource, defaults) : void 0,
79
+ source: marshalSource(request.source, defaults),
80
+ tags: request.tags
108
81
  });
82
+ const marshalDetachIPRequest = (request, defaults) => ({ resource: marshalCustomResource(request.resource, defaults) });
109
83
  const marshalMoveIPRequest = (request, defaults) => ({
110
- from_resource: marshalCustomResource(request.fromResource),
111
- to_resource: request.toResource !== void 0 ? marshalCustomResource(request.toResource) : void 0
84
+ from_resource: marshalCustomResource(request.fromResource, defaults),
85
+ to_resource: request.toResource !== void 0 ? marshalCustomResource(request.toResource, defaults) : void 0
112
86
  });
113
- const marshalReleaseIPSetRequest = (request, defaults) => ({
114
- ip_ids: request.ipIds
115
- });
116
- const marshalReverse = (request, defaults) => ({
117
- address: request.address,
118
- hostname: request.hostname
87
+ const marshalReleaseIPSetRequest = (request, defaults) => ({ ip_ids: request.ipIds });
88
+ var marshalReverse = (request, defaults) => ({
89
+ address: request.address,
90
+ hostname: request.hostname
119
91
  });
120
92
  const marshalUpdateIPRequest = (request, defaults) => ({
121
- reverses: request.reverses !== void 0 ? request.reverses.map((elt) => marshalReverse(elt)) : void 0,
122
- tags: request.tags
93
+ reverses: request.reverses !== void 0 ? request.reverses.map((elt) => marshalReverse(elt, defaults)) : void 0,
94
+ tags: request.tags
123
95
  });
124
- export {
125
- marshalAttachIPRequest,
126
- marshalBookIPRequest,
127
- marshalDetachIPRequest,
128
- marshalMoveIPRequest,
129
- marshalReleaseIPSetRequest,
130
- marshalUpdateIPRequest,
131
- unmarshalIP,
132
- unmarshalListIPsResponse
133
- };
96
+ export { marshalAttachIPRequest, marshalBookIPRequest, marshalDetachIPRequest, marshalMoveIPRequest, marshalReleaseIPSetRequest, marshalUpdateIPRequest, unmarshalIP, unmarshalListIPsResponse };
@@ -1,9 +1,7 @@
1
- const ListIPsRequest = {
2
- resourceName: {
3
- maxLength: 63,
4
- minLength: 2
5
- }
6
- };
7
- export {
8
- ListIPsRequest
9
- };
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
+ var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({ ListIPsRequest: () => ListIPsRequest });
3
+ const ListIPsRequest = { resourceName: {
4
+ maxLength: 63,
5
+ minLength: 2
6
+ } };
7
+ export { validation_rules_gen_exports };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-ipam",
3
- "version": "2.2.1",
3
+ "version": "2.3.0",
4
4
  "description": "Scaleway SDK ipam",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
@@ -27,13 +27,13 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@scaleway/random-name": "5.1.2",
30
- "@scaleway/sdk-std": "2.1.1"
30
+ "@scaleway/sdk-std": "2.2.0"
31
31
  },
32
32
  "peerDependencies": {
33
- "@scaleway/sdk-client": "^2.1.0"
33
+ "@scaleway/sdk-client": "^2.2.0"
34
34
  },
35
35
  "devDependencies": {
36
- "@scaleway/sdk-client": "^2.1.0"
36
+ "@scaleway/sdk-client": "^2.2.0"
37
37
  },
38
38
  "scripts": {
39
39
  "package:check": "pnpm publint",