@scaleway/sdk-ipam 2.2.0 → 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,177 +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: ["fr-par", "nl-ams", "pl-waw"]
13
- });
14
- /**
15
- * Reserve a new IP. Reserve a new IP from the specified source. Currently IPs can only be reserved from a Private Network.
16
- *
17
- * @param request - The request {@link BookIPRequest}
18
- * @returns A Promise of IP
19
- */
20
- bookIP = (request) => this.client.fetch(
21
- {
22
- body: JSON.stringify(
23
- marshalBookIPRequest(request, this.client.settings)
24
- ),
25
- headers: jsonContentHeaders,
26
- method: "POST",
27
- path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips`
28
- },
29
- unmarshalIP
30
- );
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(
44
- marshalReleaseIPSetRequest(request, this.client.settings)
45
- ),
46
- headers: jsonContentHeaders,
47
- method: "POST",
48
- path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ip-sets/release`
49
- });
50
- /**
51
- * Get an IP. Retrieve details of an existing IP, specified by its IP ID.
52
- *
53
- * @param request - The request {@link GetIPRequest}
54
- * @returns A Promise of IP
55
- */
56
- getIP = (request) => this.client.fetch(
57
- {
58
- method: "GET",
59
- path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam("ipId", request.ipId)}`
60
- },
61
- unmarshalIP
62
- );
63
- /**
64
- * Update an IP. Update parameters including tags of the specified IP.
65
- *
66
- * @param request - The request {@link UpdateIPRequest}
67
- * @returns A Promise of IP
68
- */
69
- updateIP = (request) => this.client.fetch(
70
- {
71
- body: JSON.stringify(
72
- marshalUpdateIPRequest(request, this.client.settings)
73
- ),
74
- headers: jsonContentHeaders,
75
- method: "PATCH",
76
- path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam("ipId", request.ipId)}`
77
- },
78
- unmarshalIP
79
- );
80
- pageOfListIPs = (request = {}) => this.client.fetch(
81
- {
82
- method: "GET",
83
- path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips`,
84
- urlParams: urlParams(
85
- ["attached", request.attached],
86
- ["ip_ids", request.ipIds],
87
- ["is_ipv6", request.isIpv6],
88
- ["mac_address", request.macAddress],
89
- ["order_by", request.orderBy],
90
- ["organization_id", request.organizationId],
91
- ["page", request.page],
92
- [
93
- "page_size",
94
- request.pageSize ?? this.client.settings.defaultPageSize
95
- ],
96
- ["project_id", request.projectId],
97
- ["resource_id", request.resourceId],
98
- ["resource_ids", request.resourceIds],
99
- ["resource_name", request.resourceName],
100
- ["resource_type", request.resourceType],
101
- ["resource_types", request.resourceTypes],
102
- ["tags", request.tags],
103
- ["vpc_id", request.vpcId],
104
- ...Object.entries(
105
- resolveOneOf([
106
- { param: "zonal", value: request.zonal },
107
- { param: "private_network_id", value: request.privateNetworkId },
108
- { param: "subnet_id", value: request.subnetId },
109
- { param: "source_vpc_id", value: request.sourceVpcId }
110
- ])
111
- )
112
- )
113
- },
114
- unmarshalListIPsResponse
115
- );
116
- /**
117
- * 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.
118
- *
119
- * @param request - The request {@link ListIPsRequest}
120
- * @returns A Promise of ListIPsResponse
121
- */
122
- listIPs = (request = {}) => enrichForPagination("ips", this.pageOfListIPs, request);
123
- /**
124
- * 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.
125
- *
126
- * @param request - The request {@link AttachIPRequest}
127
- * @returns A Promise of IP
128
- */
129
- attachIP = (request) => this.client.fetch(
130
- {
131
- body: JSON.stringify(
132
- marshalAttachIPRequest(request, this.client.settings)
133
- ),
134
- headers: jsonContentHeaders,
135
- method: "POST",
136
- path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam("ipId", request.ipId)}/attach`
137
- },
138
- unmarshalIP
139
- );
140
- /**
141
- * 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.
142
- *
143
- * @param request - The request {@link DetachIPRequest}
144
- * @returns A Promise of IP
145
- */
146
- detachIP = (request) => this.client.fetch(
147
- {
148
- body: JSON.stringify(
149
- marshalDetachIPRequest(request, this.client.settings)
150
- ),
151
- headers: jsonContentHeaders,
152
- method: "POST",
153
- path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam("ipId", request.ipId)}/detach`
154
- },
155
- unmarshalIP
156
- );
157
- /**
158
- * 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.
159
- *
160
- * @param request - The request {@link MoveIPRequest}
161
- * @returns A Promise of IP
162
- */
163
- moveIP = (request) => this.client.fetch(
164
- {
165
- body: JSON.stringify(
166
- marshalMoveIPRequest(request, this.client.settings)
167
- ),
168
- headers: jsonContentHeaders,
169
- method: "POST",
170
- path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam("ipId", request.ipId)}/move`
171
- },
172
- unmarshalIP
173
- );
174
- }
175
- export {
176
- 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);
177
135
  };
136
+ export { API$1 as API };
@@ -1,4 +1,4 @@
1
- export { API } from './api.gen.js';
1
+ export { API, } from './api.gen.js';
2
2
  export * from './marshalling.gen.js';
3
3
  export type { AttachIPRequest, BookIPRequest, CustomResource, DetachIPRequest, GetIPRequest, IP, ListIPsRequest, ListIPsRequestOrderBy, ListIPsResponse, MoveIPRequest, ReleaseIPRequest, ReleaseIPSetRequest, Resource, ResourceType, Reverse, Source, UpdateIPRequest, } from './types.gen.js';
4
4
  export * as ValidationRules from './validation-rules.gen.js';
@@ -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,121 +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
- { param: "zonal", value: request.zonal },
81
- { param: "private_network_id", value: request.privateNetworkId },
82
- { param: "subnet_id", value: request.subnetId },
83
- { param: "vpc_id", value: request.vpcId }
84
- ])
51
+ var marshalCustomResource = (request, defaults) => ({
52
+ mac_address: request.macAddress,
53
+ name: request.name
85
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
+ ]) });
86
74
  const marshalBookIPRequest = (request, defaults) => ({
87
- address: request.address,
88
- is_ipv6: request.isIpv6,
89
- project_id: request.projectId ?? defaults.defaultProjectId,
90
- resource: request.resource !== void 0 ? marshalCustomResource(request.resource) : void 0,
91
- source: marshalSource(request.source),
92
- tags: request.tags
93
- });
94
- const marshalDetachIPRequest = (request, defaults) => ({
95
- 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
96
81
  });
82
+ const marshalDetachIPRequest = (request, defaults) => ({ resource: marshalCustomResource(request.resource, defaults) });
97
83
  const marshalMoveIPRequest = (request, defaults) => ({
98
- from_resource: marshalCustomResource(request.fromResource),
99
- 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
100
86
  });
101
- const marshalReleaseIPSetRequest = (request, defaults) => ({
102
- ip_ids: request.ipIds
103
- });
104
- const marshalReverse = (request, defaults) => ({
105
- address: request.address,
106
- 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
107
91
  });
108
92
  const marshalUpdateIPRequest = (request, defaults) => ({
109
- reverses: request.reverses !== void 0 ? request.reverses.map((elt) => marshalReverse(elt)) : void 0,
110
- tags: request.tags
93
+ reverses: request.reverses !== void 0 ? request.reverses.map((elt) => marshalReverse(elt, defaults)) : void 0,
94
+ tags: request.tags
111
95
  });
112
- export {
113
- marshalAttachIPRequest,
114
- marshalBookIPRequest,
115
- marshalDetachIPRequest,
116
- marshalMoveIPRequest,
117
- marshalReleaseIPSetRequest,
118
- marshalUpdateIPRequest,
119
- unmarshalIP,
120
- unmarshalListIPsResponse
121
- };
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.0",
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.0"
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",