@scaleway/sdk-flexibleip 1.1.0 → 2.1.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 ADDED
@@ -0,0 +1,96 @@
1
+ # @scaleway/sdk-flexibleip
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@scaleway/sdk-flexibleip.svg)](https://www.npmjs.com/package/@scaleway/sdk-flexibleip)
4
+ [![npm downloads](https://img.shields.io/npm/dm/@scaleway/sdk-flexibleip.svg)](https://www.npmjs.com/package/@scaleway/sdk-flexibleip)
5
+ [![license](https://img.shields.io/npm/l/@scaleway/sdk-flexibleip.svg)](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE)
6
+
7
+ Scaleway SDK for Flexibleip API.
8
+
9
+ > **Note**
10
+ > This is an automatically generated package that is part of the [Scaleway SDK for JavaScript](https://github.com/scaleway/scaleway-sdk-js).
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ npm install @scaleway/sdk-flexibleip @scaleway/sdk-client
16
+ ```
17
+
18
+ or with pnpm:
19
+
20
+ ```bash
21
+ pnpm add @scaleway/sdk-flexibleip @scaleway/sdk-client
22
+ ```
23
+
24
+ or with yarn:
25
+
26
+ ```bash
27
+ yarn add @scaleway/sdk-flexibleip @scaleway/sdk-client
28
+ ```
29
+
30
+ ## Getting Started
31
+
32
+ You'll need a pair of access and secret keys to connect to Scaleway API. Please check the [documentation](https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/) on how to retrieve them.
33
+
34
+ ### Basic Usage
35
+
36
+ ```typescript
37
+ import { createClient } from '@scaleway/sdk-client'
38
+ import { Flexibleip } from '@scaleway/sdk-flexibleip'
39
+
40
+ const client = createClient({
41
+ accessKey: 'SCWXXXXXXXXXXXXXXXXX',
42
+ secretKey: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
43
+ defaultProjectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
44
+ defaultRegion: 'fr-par',
45
+ defaultZone: 'fr-par-1',
46
+ })
47
+
48
+ const api = new Flexibleip.v1.API(client)
49
+
50
+ // Use the API
51
+ // Example: await api.listServers()
52
+ ```
53
+
54
+ ### Using Configuration Loader
55
+
56
+ For a simpler setup, you can load credentials from the configuration file or environment variables:
57
+
58
+ ```typescript
59
+ import { createClient } from '@scaleway/sdk-client'
60
+ import { loadProfileFromConfigurationFile } from '@scaleway/configuration-loader'
61
+ import { Flexibleip } from '@scaleway/sdk-flexibleip'
62
+
63
+ const profile = loadProfileFromConfigurationFile()
64
+ const client = createClient(profile)
65
+ const api = new Flexibleip.v1.API(client)
66
+ ```
67
+
68
+ ## Documentation
69
+
70
+ - 📚 [Scaleway SDK Reference Documentation](https://scaleway.github.io/scaleway-sdk-js)
71
+ - 🌐 [Scaleway Flexibleip API Documentation](https://www.scaleway.com/en/developers/api/flexibleip/)
72
+ - 📖 [Main Repository](https://github.com/scaleway/scaleway-sdk-js)
73
+ - 💡 [Example Projects](https://github.com/scaleway/scaleway-sdk-js/tree/master/examples)
74
+
75
+ ## Features
76
+
77
+ - ✅ Full TypeScript support with complete type definitions
78
+ - ✅ Promise-based API
79
+ - ✅ Automatic pagination helpers
80
+ - ✅ Built-in error handling
81
+ - ✅ Compatible with Node.js ≥ 20
82
+
83
+ ## Support
84
+
85
+ We love feedback! Feel free to reach us on:
86
+ - [Scaleway Slack community](https://slack.scaleway.com/) - Join us on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource)
87
+ - [GitHub Issues](https://github.com/scaleway/scaleway-sdk-js/issues)
88
+
89
+ ## Contributing
90
+
91
+ This repository is at its early stage and is still in active development. If you are looking for a way to contribute, please read [CONTRIBUTING.md](https://github.com/scaleway/scaleway-sdk-js/blob/master/CONTRIBUTING.md).
92
+
93
+ ## License
94
+
95
+ This project is Apache 2.0 licensed. See the [LICENSE](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE) file for details.
96
+
@@ -1,5 +1,5 @@
1
- import { API as ParentAPI } from '@scaleway/sdk-client';
2
1
  import type { ApiLocality, WaitForOptions } from '@scaleway/sdk-client';
2
+ import { API as ParentAPI } from '@scaleway/sdk-client';
3
3
  import type { AttachFlexibleIPRequest, AttachFlexibleIPsResponse, CreateFlexibleIPRequest, DeleteFlexibleIPRequest, DeleteMACAddrRequest, DetachFlexibleIPRequest, DetachFlexibleIPsResponse, DuplicateMACAddrRequest, FlexibleIP, GenerateMACAddrRequest, GetFlexibleIPRequest, ListFlexibleIPsRequest, ListFlexibleIPsResponse, MoveMACAddrRequest, UpdateFlexibleIPRequest } from './types.gen.js';
4
4
  /**
5
5
  * Elastic Metal - Flexible IP API.
@@ -57,9 +57,7 @@ class API extends API$1 {
57
57
  * @returns A Promise of FlexibleIP
58
58
  */
59
59
  waitForFlexibleIP = (request, options) => waitForResource(
60
- options?.stop ?? ((res) => Promise.resolve(
61
- !FLEXIBLE_IP_TRANSIENT_STATUSES.includes(res.status)
62
- )),
60
+ options?.stop ?? ((res) => Promise.resolve(!FLEXIBLE_IP_TRANSIENT_STATUSES.includes(res.status))),
63
61
  this.getFlexibleIP,
64
62
  request,
65
63
  options
@@ -72,10 +70,7 @@ class API extends API$1 {
72
70
  ["order_by", request.orderBy],
73
71
  ["organization_id", request.organizationId],
74
72
  ["page", request.page],
75
- [
76
- "page_size",
77
- request.pageSize ?? this.client.settings.defaultPageSize
78
- ],
73
+ ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
79
74
  ["project_id", request.projectId],
80
75
  ["server_ids", request.serverIds],
81
76
  ["status", request.status],
@@ -113,10 +108,12 @@ class API extends API$1 {
113
108
  *
114
109
  * @param request - The request {@link DeleteFlexibleIPRequest}
115
110
  */
116
- deleteFlexibleIP = (request) => this.client.fetch({
117
- method: "DELETE",
118
- path: `/flexible-ip/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/fips/${validatePathParam("fipId", request.fipId)}`
119
- });
111
+ deleteFlexibleIP = (request) => this.client.fetch(
112
+ {
113
+ method: "DELETE",
114
+ path: `/flexible-ip/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/fips/${validatePathParam("fipId", request.fipId)}`
115
+ }
116
+ );
120
117
  /**
121
118
  * Attach an existing flexible IP to a server. Attach an existing flexible IP to a specified Elastic Metal server.
122
119
  *
@@ -207,10 +204,12 @@ class API extends API$1 {
207
204
  *
208
205
  * @param request - The request {@link DeleteMACAddrRequest}
209
206
  */
210
- deleteMACAddr = (request) => this.client.fetch({
211
- method: "DELETE",
212
- path: `/flexible-ip/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/fips/${validatePathParam("fipId", request.fipId)}/mac`
213
- });
207
+ deleteMACAddr = (request) => this.client.fetch(
208
+ {
209
+ method: "DELETE",
210
+ path: `/flexible-ip/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/fips/${validatePathParam("fipId", request.fipId)}/mac`
211
+ }
212
+ );
214
213
  }
215
214
  export {
216
215
  API
@@ -1,4 +1,4 @@
1
- export { API } from './api.gen.js';
1
+ export { API, } from './api.gen.js';
2
2
  export * from './content.gen.js';
3
3
  export * from './marshalling.gen.js';
4
4
  export type { AttachFlexibleIPRequest, AttachFlexibleIPsResponse, CreateFlexibleIPRequest, DeleteFlexibleIPRequest, DeleteMACAddrRequest, DetachFlexibleIPRequest, DetachFlexibleIPsResponse, DuplicateMACAddrRequest, FlexibleIP, FlexibleIPStatus, GenerateMACAddrRequest, GetFlexibleIPRequest, ListFlexibleIPsRequest, ListFlexibleIPsRequestOrderBy, ListFlexibleIPsResponse, MACAddress, MACAddressStatus, MACAddressType, MoveMACAddrRequest, UpdateFlexibleIPRequest, } from './types.gen.js';
package/package.json CHANGED
@@ -1,23 +1,20 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-flexibleip",
3
- "version": "1.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "Scaleway SDK flexibleip",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
7
+ "README.md",
7
8
  "dist"
8
9
  ],
9
10
  "type": "module",
10
11
  "exports": {
11
12
  ".": {
12
13
  "types": "./dist/index.gen.d.ts",
13
- "import": "./dist/index.gen.js",
14
- "require": "./dist/index.gen.cjs",
15
14
  "default": "./dist/index.gen.js"
16
15
  },
17
16
  "./*": {
18
17
  "types": "./dist/*/index.gen.d.ts",
19
- "import": "./dist/*/index.gen.js",
20
- "require": "./dist/*/index.gen.cjs",
21
18
  "default": "./dist/*/index.gen.js"
22
19
  }
23
20
  },
@@ -26,17 +23,17 @@
26
23
  "directory": "packages_generated/flexibleip"
27
24
  },
28
25
  "engines": {
29
- "node": ">=20.19.4"
26
+ "node": ">=20.19.6"
30
27
  },
31
28
  "dependencies": {
32
29
  "@scaleway/random-name": "5.1.2",
33
- "@scaleway/sdk-std": "1.1.0"
30
+ "@scaleway/sdk-std": "2.1.0"
34
31
  },
35
32
  "peerDependencies": {
36
- "@scaleway/sdk-client": "^1.3.2"
33
+ "@scaleway/sdk-client": "^2.1.0"
37
34
  },
38
35
  "devDependencies": {
39
- "@scaleway/sdk-client": "^1.3.2"
36
+ "@scaleway/sdk-client": "^2.1.0"
40
37
  },
41
38
  "scripts": {
42
39
  "package:check": "pnpm publint",
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index_gen = require("./v1alpha1/index.gen.cjs");
4
- exports.Flexibleipv1alpha1 = index_gen;
@@ -1,217 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const sdkClient = require("@scaleway/sdk-client");
4
- const content_gen = require("./content.gen.cjs");
5
- const marshalling_gen = require("./marshalling.gen.cjs");
6
- const jsonContentHeaders = {
7
- "Content-Type": "application/json; charset=utf-8"
8
- };
9
- class API extends sdkClient.API {
10
- /**
11
- * Locality of this API.
12
- * type ∈ {'zone','region','global','unspecified'}
13
- */
14
- static LOCALITY = sdkClient.toApiLocality({
15
- zones: [
16
- "fr-par-1",
17
- "fr-par-2",
18
- "nl-ams-1",
19
- "nl-ams-2",
20
- "pl-waw-2",
21
- "pl-waw-3"
22
- ]
23
- });
24
- /**
25
- * Create a new flexible IP. Generate a new flexible IP within a given zone, specifying its configuration including Project ID and description.
26
- *
27
- * @param request - The request {@link CreateFlexibleIPRequest}
28
- * @returns A Promise of FlexibleIP
29
- */
30
- createFlexibleIP = (request) => this.client.fetch(
31
- {
32
- body: JSON.stringify(
33
- marshalling_gen.marshalCreateFlexibleIPRequest(request, this.client.settings)
34
- ),
35
- headers: jsonContentHeaders,
36
- method: "POST",
37
- path: `/flexible-ip/v1alpha1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/fips`
38
- },
39
- marshalling_gen.unmarshalFlexibleIP
40
- );
41
- /**
42
- * Get an existing flexible IP. Retrieve information about an existing flexible IP, specified by its ID and zone. Its full details, including Project ID, description and status, are returned in the response object.
43
- *
44
- * @param request - The request {@link GetFlexibleIPRequest}
45
- * @returns A Promise of FlexibleIP
46
- */
47
- getFlexibleIP = (request) => this.client.fetch(
48
- {
49
- method: "GET",
50
- path: `/flexible-ip/v1alpha1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/fips/${sdkClient.validatePathParam("fipId", request.fipId)}`
51
- },
52
- marshalling_gen.unmarshalFlexibleIP
53
- );
54
- /**
55
- * Waits for {@link FlexibleIP} to be in a final state.
56
- *
57
- * @param request - The request {@link GetFlexibleIPRequest}
58
- * @param options - The waiting options
59
- * @returns A Promise of FlexibleIP
60
- */
61
- waitForFlexibleIP = (request, options) => sdkClient.waitForResource(
62
- options?.stop ?? ((res) => Promise.resolve(
63
- !content_gen.FLEXIBLE_IP_TRANSIENT_STATUSES.includes(res.status)
64
- )),
65
- this.getFlexibleIP,
66
- request,
67
- options
68
- );
69
- pageOfListFlexibleIPs = (request = {}) => this.client.fetch(
70
- {
71
- method: "GET",
72
- path: `/flexible-ip/v1alpha1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/fips`,
73
- urlParams: sdkClient.urlParams(
74
- ["order_by", request.orderBy],
75
- ["organization_id", request.organizationId],
76
- ["page", request.page],
77
- [
78
- "page_size",
79
- request.pageSize ?? this.client.settings.defaultPageSize
80
- ],
81
- ["project_id", request.projectId],
82
- ["server_ids", request.serverIds],
83
- ["status", request.status],
84
- ["tags", request.tags]
85
- )
86
- },
87
- marshalling_gen.unmarshalListFlexibleIPsResponse
88
- );
89
- /**
90
- * List flexible IPs. List all flexible IPs within a given zone.
91
- *
92
- * @param request - The request {@link ListFlexibleIPsRequest}
93
- * @returns A Promise of ListFlexibleIPsResponse
94
- */
95
- listFlexibleIPs = (request = {}) => sdkClient.enrichForPagination("flexibleIps", this.pageOfListFlexibleIPs, request);
96
- /**
97
- * Update an existing flexible IP. Update the parameters of an existing flexible IP, specified by its ID and zone. These parameters include tags and description.
98
- *
99
- * @param request - The request {@link UpdateFlexibleIPRequest}
100
- * @returns A Promise of FlexibleIP
101
- */
102
- updateFlexibleIP = (request) => this.client.fetch(
103
- {
104
- body: JSON.stringify(
105
- marshalling_gen.marshalUpdateFlexibleIPRequest(request, this.client.settings)
106
- ),
107
- headers: jsonContentHeaders,
108
- method: "PATCH",
109
- path: `/flexible-ip/v1alpha1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/fips/${sdkClient.validatePathParam("fipId", request.fipId)}`
110
- },
111
- marshalling_gen.unmarshalFlexibleIP
112
- );
113
- /**
114
- * Delete an existing flexible IP. Delete an existing flexible IP, specified by its ID and zone. Note that deleting a flexible IP is permanent and cannot be undone.
115
- *
116
- * @param request - The request {@link DeleteFlexibleIPRequest}
117
- */
118
- deleteFlexibleIP = (request) => this.client.fetch({
119
- method: "DELETE",
120
- path: `/flexible-ip/v1alpha1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/fips/${sdkClient.validatePathParam("fipId", request.fipId)}`
121
- });
122
- /**
123
- * Attach an existing flexible IP to a server. Attach an existing flexible IP to a specified Elastic Metal server.
124
- *
125
- * @param request - The request {@link AttachFlexibleIPRequest}
126
- * @returns A Promise of AttachFlexibleIPsResponse
127
- */
128
- attachFlexibleIP = (request) => this.client.fetch(
129
- {
130
- body: JSON.stringify(
131
- marshalling_gen.marshalAttachFlexibleIPRequest(request, this.client.settings)
132
- ),
133
- headers: jsonContentHeaders,
134
- method: "POST",
135
- path: `/flexible-ip/v1alpha1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/fips/attach`
136
- },
137
- marshalling_gen.unmarshalAttachFlexibleIPsResponse
138
- );
139
- /**
140
- * Detach an existing flexible IP from a server. Detach an existing flexible IP from a specified Elastic Metal server.
141
- *
142
- * @param request - The request {@link DetachFlexibleIPRequest}
143
- * @returns A Promise of DetachFlexibleIPsResponse
144
- */
145
- detachFlexibleIP = (request) => this.client.fetch(
146
- {
147
- body: JSON.stringify(
148
- marshalling_gen.marshalDetachFlexibleIPRequest(request, this.client.settings)
149
- ),
150
- headers: jsonContentHeaders,
151
- method: "POST",
152
- path: `/flexible-ip/v1alpha1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/fips/detach`
153
- },
154
- marshalling_gen.unmarshalDetachFlexibleIPsResponse
155
- );
156
- /**
157
- * Generate a virtual MAC address on an existing flexible IP. Generate a virtual MAC (Media Access Control) address on an existing flexible IP.
158
- *
159
- * @param request - The request {@link GenerateMACAddrRequest}
160
- * @returns A Promise of FlexibleIP
161
- */
162
- generateMACAddr = (request) => this.client.fetch(
163
- {
164
- body: JSON.stringify(
165
- marshalling_gen.marshalGenerateMACAddrRequest(request, this.client.settings)
166
- ),
167
- headers: jsonContentHeaders,
168
- method: "POST",
169
- path: `/flexible-ip/v1alpha1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/fips/${sdkClient.validatePathParam("fipId", request.fipId)}/mac`
170
- },
171
- marshalling_gen.unmarshalFlexibleIP
172
- );
173
- /**
174
- * Duplicate a virtual MAC address to another flexible IP. Duplicate a virtual MAC address from a given flexible IP to another flexible IP attached to the same server.
175
- *
176
- * @param request - The request {@link DuplicateMACAddrRequest}
177
- * @returns A Promise of FlexibleIP
178
- */
179
- duplicateMACAddr = (request) => this.client.fetch(
180
- {
181
- body: JSON.stringify(
182
- marshalling_gen.marshalDuplicateMACAddrRequest(request, this.client.settings)
183
- ),
184
- headers: jsonContentHeaders,
185
- method: "POST",
186
- path: `/flexible-ip/v1alpha1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/fips/${sdkClient.validatePathParam("fipId", request.fipId)}/mac/duplicate`
187
- },
188
- marshalling_gen.unmarshalFlexibleIP
189
- );
190
- /**
191
- * Relocate an existing virtual MAC address to a different flexible IP. Relocate a virtual MAC (Media Access Control) address from an existing flexible IP to a different flexible IP.
192
- *
193
- * @param request - The request {@link MoveMACAddrRequest}
194
- * @returns A Promise of FlexibleIP
195
- */
196
- moveMACAddr = (request) => this.client.fetch(
197
- {
198
- body: JSON.stringify(
199
- marshalling_gen.marshalMoveMACAddrRequest(request, this.client.settings)
200
- ),
201
- headers: jsonContentHeaders,
202
- method: "POST",
203
- path: `/flexible-ip/v1alpha1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/fips/${sdkClient.validatePathParam("fipId", request.fipId)}/mac/move`
204
- },
205
- marshalling_gen.unmarshalFlexibleIP
206
- );
207
- /**
208
- * Detach a given virtual MAC address from an existing flexible IP. Detach a given MAC (Media Access Control) address from an existing flexible IP.
209
- *
210
- * @param request - The request {@link DeleteMACAddrRequest}
211
- */
212
- deleteMACAddr = (request) => this.client.fetch({
213
- method: "DELETE",
214
- path: `/flexible-ip/v1alpha1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/fips/${sdkClient.validatePathParam("fipId", request.fipId)}/mac`
215
- });
216
- }
217
- exports.API = API;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const FLEXIBLE_IP_TRANSIENT_STATUSES = [
4
- "updating",
5
- "detaching"
6
- ];
7
- const MAC_ADDRESS_TRANSIENT_STATUSES = [
8
- "updating",
9
- "deleting"
10
- ];
11
- exports.FLEXIBLE_IP_TRANSIENT_STATUSES = FLEXIBLE_IP_TRANSIENT_STATUSES;
12
- exports.MAC_ADDRESS_TRANSIENT_STATUSES = MAC_ADDRESS_TRANSIENT_STATUSES;
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const api_gen = require("./api.gen.cjs");
4
- const content_gen = require("./content.gen.cjs");
5
- const marshalling_gen = require("./marshalling.gen.cjs");
6
- const validationRules_gen = require("./validation-rules.gen.cjs");
7
- exports.API = api_gen.API;
8
- exports.FLEXIBLE_IP_TRANSIENT_STATUSES = content_gen.FLEXIBLE_IP_TRANSIENT_STATUSES;
9
- exports.MAC_ADDRESS_TRANSIENT_STATUSES = content_gen.MAC_ADDRESS_TRANSIENT_STATUSES;
10
- exports.marshalAttachFlexibleIPRequest = marshalling_gen.marshalAttachFlexibleIPRequest;
11
- exports.marshalCreateFlexibleIPRequest = marshalling_gen.marshalCreateFlexibleIPRequest;
12
- exports.marshalDetachFlexibleIPRequest = marshalling_gen.marshalDetachFlexibleIPRequest;
13
- exports.marshalDuplicateMACAddrRequest = marshalling_gen.marshalDuplicateMACAddrRequest;
14
- exports.marshalGenerateMACAddrRequest = marshalling_gen.marshalGenerateMACAddrRequest;
15
- exports.marshalMoveMACAddrRequest = marshalling_gen.marshalMoveMACAddrRequest;
16
- exports.marshalUpdateFlexibleIPRequest = marshalling_gen.marshalUpdateFlexibleIPRequest;
17
- exports.unmarshalAttachFlexibleIPsResponse = marshalling_gen.unmarshalAttachFlexibleIPsResponse;
18
- exports.unmarshalDetachFlexibleIPsResponse = marshalling_gen.unmarshalDetachFlexibleIPsResponse;
19
- exports.unmarshalFlexibleIP = marshalling_gen.unmarshalFlexibleIP;
20
- exports.unmarshalListFlexibleIPsResponse = marshalling_gen.unmarshalListFlexibleIPsResponse;
21
- exports.ValidationRules = validationRules_gen;
@@ -1,114 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const sdkClient = require("@scaleway/sdk-client");
4
- const unmarshalMACAddress = (data) => {
5
- if (!sdkClient.isJSONObject(data)) {
6
- throw new TypeError(
7
- `Unmarshalling the type 'MACAddress' failed as data isn't a dictionary.`
8
- );
9
- }
10
- return {
11
- createdAt: sdkClient.unmarshalDate(data.created_at),
12
- id: data.id,
13
- macAddress: data.mac_address,
14
- macType: data.mac_type,
15
- status: data.status,
16
- updatedAt: sdkClient.unmarshalDate(data.updated_at),
17
- zone: data.zone
18
- };
19
- };
20
- const unmarshalFlexibleIP = (data) => {
21
- if (!sdkClient.isJSONObject(data)) {
22
- throw new TypeError(
23
- `Unmarshalling the type 'FlexibleIP' failed as data isn't a dictionary.`
24
- );
25
- }
26
- return {
27
- createdAt: sdkClient.unmarshalDate(data.created_at),
28
- description: data.description,
29
- id: data.id,
30
- ipAddress: data.ip_address,
31
- macAddress: data.mac_address ? unmarshalMACAddress(data.mac_address) : void 0,
32
- organizationId: data.organization_id,
33
- projectId: data.project_id,
34
- reverse: data.reverse,
35
- serverId: data.server_id,
36
- status: data.status,
37
- tags: data.tags,
38
- updatedAt: sdkClient.unmarshalDate(data.updated_at),
39
- zone: data.zone
40
- };
41
- };
42
- const unmarshalAttachFlexibleIPsResponse = (data) => {
43
- if (!sdkClient.isJSONObject(data)) {
44
- throw new TypeError(
45
- `Unmarshalling the type 'AttachFlexibleIPsResponse' failed as data isn't a dictionary.`
46
- );
47
- }
48
- return {
49
- flexibleIps: sdkClient.unmarshalArrayOfObject(data.flexible_ips, unmarshalFlexibleIP),
50
- totalCount: data.total_count
51
- };
52
- };
53
- const unmarshalDetachFlexibleIPsResponse = (data) => {
54
- if (!sdkClient.isJSONObject(data)) {
55
- throw new TypeError(
56
- `Unmarshalling the type 'DetachFlexibleIPsResponse' failed as data isn't a dictionary.`
57
- );
58
- }
59
- return {
60
- flexibleIps: sdkClient.unmarshalArrayOfObject(data.flexible_ips, unmarshalFlexibleIP),
61
- totalCount: data.total_count
62
- };
63
- };
64
- const unmarshalListFlexibleIPsResponse = (data) => {
65
- if (!sdkClient.isJSONObject(data)) {
66
- throw new TypeError(
67
- `Unmarshalling the type 'ListFlexibleIPsResponse' failed as data isn't a dictionary.`
68
- );
69
- }
70
- return {
71
- flexibleIps: sdkClient.unmarshalArrayOfObject(data.flexible_ips, unmarshalFlexibleIP),
72
- totalCount: data.total_count
73
- };
74
- };
75
- const marshalAttachFlexibleIPRequest = (request, defaults) => ({
76
- fips_ids: request.fipsIds,
77
- server_id: request.serverId
78
- });
79
- const marshalCreateFlexibleIPRequest = (request, defaults) => ({
80
- description: request.description,
81
- is_ipv6: request.isIpv6,
82
- project_id: request.projectId ?? defaults.defaultProjectId,
83
- reverse: request.reverse,
84
- server_id: request.serverId,
85
- tags: request.tags
86
- });
87
- const marshalDetachFlexibleIPRequest = (request, defaults) => ({
88
- fips_ids: request.fipsIds
89
- });
90
- const marshalDuplicateMACAddrRequest = (request, defaults) => ({
91
- duplicate_from_fip_id: request.duplicateFromFipId
92
- });
93
- const marshalGenerateMACAddrRequest = (request, defaults) => ({
94
- mac_type: request.macType
95
- });
96
- const marshalMoveMACAddrRequest = (request, defaults) => ({
97
- dst_fip_id: request.dstFipId
98
- });
99
- const marshalUpdateFlexibleIPRequest = (request, defaults) => ({
100
- description: request.description,
101
- reverse: request.reverse,
102
- tags: request.tags
103
- });
104
- exports.marshalAttachFlexibleIPRequest = marshalAttachFlexibleIPRequest;
105
- exports.marshalCreateFlexibleIPRequest = marshalCreateFlexibleIPRequest;
106
- exports.marshalDetachFlexibleIPRequest = marshalDetachFlexibleIPRequest;
107
- exports.marshalDuplicateMACAddrRequest = marshalDuplicateMACAddrRequest;
108
- exports.marshalGenerateMACAddrRequest = marshalGenerateMACAddrRequest;
109
- exports.marshalMoveMACAddrRequest = marshalMoveMACAddrRequest;
110
- exports.marshalUpdateFlexibleIPRequest = marshalUpdateFlexibleIPRequest;
111
- exports.unmarshalAttachFlexibleIPsResponse = unmarshalAttachFlexibleIPsResponse;
112
- exports.unmarshalDetachFlexibleIPsResponse = unmarshalDetachFlexibleIPsResponse;
113
- exports.unmarshalFlexibleIP = unmarshalFlexibleIP;
114
- exports.unmarshalListFlexibleIPsResponse = unmarshalListFlexibleIPsResponse;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const ListFlexibleIPsRequest = {
4
- page: {
5
- greaterThan: 0
6
- },
7
- pageSize: {
8
- greaterThan: 0,
9
- lessThanOrEqual: 100
10
- }
11
- };
12
- exports.ListFlexibleIPsRequest = ListFlexibleIPsRequest;