@scaleway/sdk 1.2.0 → 1.5.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.
Files changed (52) hide show
  1. package/dist/api/account/index.js +0 -2
  2. package/dist/api/account/v2/api.gen.js +16 -6
  3. package/dist/api/applesilicon/v1alpha1/api.gen.js +31 -13
  4. package/dist/api/baremetal/index.js +2 -2
  5. package/dist/api/baremetal/v1/api.gen.js +59 -45
  6. package/dist/api/billing/index.js +2 -0
  7. package/dist/api/billing/v2alpha1/api.gen.js +52 -0
  8. package/dist/api/billing/v2alpha1/index.gen.js +3 -0
  9. package/dist/api/billing/v2alpha1/marshalling.gen.js +52 -0
  10. package/dist/api/cockpit/v1beta1/api.gen.js +36 -23
  11. package/dist/api/cockpit/v1beta1/marshalling.gen.js +2 -1
  12. package/dist/api/container/v1beta1/api.gen.js +34 -27
  13. package/dist/api/domain/v2beta1/api.gen.js +89 -78
  14. package/dist/api/flexibleip/v1alpha1/api.gen.js +18 -11
  15. package/dist/api/function/v1beta1/api.gen.js +39 -30
  16. package/dist/api/function/v1beta1/marshalling.gen.js +3 -0
  17. package/dist/api/iam/v1alpha1/api.gen.js +147 -39
  18. package/dist/api/instance/index.js +2 -2
  19. package/dist/api/instance/v1/api.gen.js +72 -61
  20. package/dist/api/iot/v1/api.gen.js +37 -37
  21. package/dist/api/k8s/index.js +2 -2
  22. package/dist/api/k8s/v1/api.gen.js +65 -46
  23. package/dist/api/k8s/v1/marshalling.gen.js +6 -1
  24. package/dist/api/lb/index.js +2 -2
  25. package/dist/api/lb/v1/api.gen.js +231 -110
  26. package/dist/api/lb/v1/marshalling.gen.js +2 -2
  27. package/dist/api/marketplace/v1/api.gen.js +2 -2
  28. package/dist/api/marketplace/v2/api.gen.js +3 -3
  29. package/dist/api/mnq/v1alpha1/api.gen.js +11 -10
  30. package/dist/api/rdb/v1/api.gen.js +195 -63
  31. package/dist/api/rdb/v1/marshalling.gen.js +16 -2
  32. package/dist/api/redis/v1/api.gen.js +88 -25
  33. package/dist/api/registry/v1/api.gen.js +15 -13
  34. package/dist/api/secret/v1alpha1/api.gen.js +43 -18
  35. package/dist/api/tem/v1alpha1/api.gen.js +26 -14
  36. package/dist/api/tem/v1alpha1/marshalling.gen.js +2 -0
  37. package/dist/api/test/v1/api.gen.js +11 -10
  38. package/dist/api/vpc/v1/api.gen.js +5 -5
  39. package/dist/api/vpcgw/v1/api.gen.js +130 -41
  40. package/dist/api/vpcgw/v1/marshalling.gen.js +18 -15
  41. package/dist/api/webhosting/v1alpha1/api.gen.js +10 -9
  42. package/dist/api/webhosting/v1alpha1/marshalling.gen.js +3 -1
  43. package/dist/helpers/is-response.js +10 -0
  44. package/dist/index.cjs +1598 -928
  45. package/dist/index.d.ts +3970 -2960
  46. package/dist/index.js +44 -42
  47. package/dist/scw/constants.js +1 -1
  48. package/dist/scw/fetch/response-parser.js +2 -1
  49. package/package.json +2 -2
  50. package/dist/api/account/v2alpha1/api.gen.js +0 -85
  51. package/dist/api/account/v2alpha1/index.js +0 -1
  52. package/dist/api/account/v2alpha1/marshalling.gen.js +0 -57
@@ -1,4 +1,2 @@
1
- import * as index$1 from './v2alpha1/index.js';
2
- export { index$1 as v2alpha1 };
3
1
  import * as index_gen from './v2/index.gen.js';
4
2
  export { index_gen as v2 };
@@ -11,7 +11,7 @@ const jsonContentHeaders = {
11
11
  /**
12
12
  * Account API.
13
13
  *
14
- * This API allows you to manage projects.
14
+ * User related data. This API allows you to manage projects.
15
15
  */
16
16
  class API extends API$1 {
17
17
  constructor() {
@@ -19,7 +19,8 @@ class API extends API$1 {
19
19
  super(...arguments);
20
20
  _this = this;
21
21
  /**
22
- * Create project
22
+ * Create a new Project for an Organization. Generate a new Project for an
23
+ * Organization, specifying its configuration including name and description.
23
24
  *
24
25
  * @param request - The request {@link CreateProjectRequest}
25
26
  * @returns A Promise of Project
@@ -41,7 +42,10 @@ class API extends API$1 {
41
42
  }, unmarshalListProjectsResponse);
42
43
  };
43
44
  /**
44
- * List projects
45
+ * List all Projects of an Organization. List all Projects of an Organization.
46
+ * The response will include the total number of Projects as well as their
47
+ * associated Organizations, names and IDs. Other information include the
48
+ * creation and update date of the Project.
45
49
  *
46
50
  * @param request - The request {@link ListProjectsRequest}
47
51
  * @returns A Promise of ListProjectsResponse
@@ -53,7 +57,9 @@ class API extends API$1 {
53
57
  return enrichForPagination('projects', _this.pageOfListProjects, request);
54
58
  };
55
59
  /**
56
- * Get project
60
+ * Get an existing Project. Retrieve information about an existing Project,
61
+ * specified by its Project ID. Its full details, including ID, name and
62
+ * description, are returned in the response object.
57
63
  *
58
64
  * @param request - The request {@link GetProjectRequest}
59
65
  * @returns A Promise of Project
@@ -68,7 +74,10 @@ class API extends API$1 {
68
74
  }, unmarshalProject);
69
75
  };
70
76
  /**
71
- * Delete project
77
+ * Delete an existing Project. Delete an existing Project, specified by its
78
+ * Project ID. The Project needs to be empty (meaning there are no resources
79
+ * left in it) to be deleted effectively. Note that deleting a Project is
80
+ * permanent, and cannot be undone.
72
81
  *
73
82
  * @param request - The request {@link DeleteProjectRequest}
74
83
  */
@@ -82,7 +91,8 @@ class API extends API$1 {
82
91
  });
83
92
  };
84
93
  /**
85
- * Update project
94
+ * Update Project. Update the parameters of an existing Project, specified by
95
+ * its Project ID. These parameters include the name and description.
86
96
  *
87
97
  * @param request - The request {@link UpdateProjectRequest}
88
98
  * @returns A Promise of Project
@@ -13,8 +13,8 @@ const jsonContentHeaders = {
13
13
  /**
14
14
  * Apple silicon.
15
15
  *
16
- * Scaleway Apple silicon M1 as-a-Service is built using the latest generation
17
- * of Apple Mac mini hardware (fifth generation).
16
+ * Apple Mac mini as a service. Scaleway Apple silicon as-a-Service is built
17
+ * using the latest generation of Apple Mac mini hardware (fifth generation).
18
18
  *
19
19
  * These dedicated Mac mini M1s are designed for developing, building, testing,
20
20
  * and signing applications for Apple devices, including iPhones, iPads, Mac
@@ -37,7 +37,9 @@ class API extends API$1 {
37
37
  super(...arguments);
38
38
  _this = this;
39
39
  /**
40
- * List all server types technical details.
40
+ * List server types. List all technical details about Apple silicon server
41
+ * types available in the specified zone. Since there is only one Availability
42
+ * Zone for Apple silicon servers, the targeted value is `fr-par-3`.
41
43
  *
42
44
  * @param request - The request {@link ListServerTypesRequest}
43
45
  * @returns A Promise of ListServerTypesResponse
@@ -52,7 +54,7 @@ class API extends API$1 {
52
54
  }, unmarshalListServerTypesResponse);
53
55
  };
54
56
  /**
55
- * Get a server technical details.
57
+ * Get a server type. Get a server technical details.
56
58
  *
57
59
  * @param request - The request {@link GetServerTypeRequest}
58
60
  * @returns A Promise of ServerType
@@ -62,7 +64,8 @@ class API extends API$1 {
62
64
  path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/server-type/${validatePathParam('serverType', request.serverType)}`
63
65
  }, unmarshalServerType);
64
66
  /**
65
- * Create a server.
67
+ * Create a server. Create a new server in the targeted zone, specifying its
68
+ * configuration including name and type.
66
69
  *
67
70
  * @param request - The request {@link CreateServerRequest}
68
71
  * @returns A Promise of Server
@@ -84,7 +87,9 @@ class API extends API$1 {
84
87
  }, unmarshalListServersResponse);
85
88
  };
86
89
  /**
87
- * List all servers.
90
+ * List all servers. List all servers in the specified zone. By default,
91
+ * returned servers in the list are ordered by creation date in ascending
92
+ * order, though this can be modified via the `order_by` field.
88
93
  *
89
94
  * @param request - The request {@link ListServersRequest}
90
95
  * @returns A Promise of ListServersResponse
@@ -106,7 +111,9 @@ class API extends API$1 {
106
111
  }, unmarshalListOSResponse);
107
112
  };
108
113
  /**
109
- * List all Operating System (OS).
114
+ * List all Operating System (OS). List all Operating System (OS). The
115
+ * response will include the total number of OS as well as their associated
116
+ * IDs, names and labels.
110
117
  *
111
118
  * @param request - The request {@link ListOSRequest}
112
119
  * @returns A Promise of ListOSResponse
@@ -118,7 +125,8 @@ class API extends API$1 {
118
125
  return enrichForPagination('os', _this.pageOfListOS, request);
119
126
  };
120
127
  /**
121
- * Get an Operating System (OS).
128
+ * Get an Operating System (OS). Get an Operating System (OS). The response
129
+ * will include the OS's unique ID as well as its name and label.
122
130
  *
123
131
  * @param request - The request {@link GetOSRequest}
124
132
  * @returns A Promise of OS
@@ -128,7 +136,9 @@ class API extends API$1 {
128
136
  path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/os/${validatePathParam('osId', request.osId)}`
129
137
  }, unmarshalOS);
130
138
  /**
131
- * Get a server.
139
+ * Get a server. Retrieve information about an existing Apple silicon server,
140
+ * specified by its server ID. Its full details, including name, status and IP
141
+ * address, are returned in the response object.
132
142
  *
133
143
  * @param request - The request {@link GetServerRequest}
134
144
  * @returns A Promise of Server
@@ -146,7 +156,8 @@ class API extends API$1 {
146
156
  */
147
157
  this.waitForServer = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!SERVER_TRANSIENT_STATUSES.includes(res.status))), this.getServer, request, options);
148
158
  /**
149
- * Update a server.
159
+ * Update a server. Update the parameters of an existing Apple silicon server,
160
+ * specified by its server ID.
150
161
  *
151
162
  * @param request - The request {@link UpdateServerRequest}
152
163
  * @returns A Promise of Server
@@ -158,7 +169,10 @@ class API extends API$1 {
158
169
  path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
159
170
  }, unmarshalServer);
160
171
  /**
161
- * Delete a server.
172
+ * Delete a server. Delete an existing Apple silicon server, specified by its
173
+ * server ID. Deleting a server is permanent, and cannot be undone. Note that
174
+ * the minimum allocation period for Apple silicon-as-a-service is 24 hours,
175
+ * meaning you cannot delete your server prior to that.
162
176
  *
163
177
  * @param request - The request {@link DeleteServerRequest}
164
178
  */
@@ -167,7 +181,8 @@ class API extends API$1 {
167
181
  path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
168
182
  });
169
183
  /**
170
- * Reboot a server.
184
+ * Reboot a server. Reboot an existing Apple silicon server, specified by its
185
+ * server ID.
171
186
  *
172
187
  * @param request - The request {@link RebootServerRequest}
173
188
  * @returns A Promise of Server
@@ -179,7 +194,10 @@ class API extends API$1 {
179
194
  path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reboot`
180
195
  }, unmarshalServer);
181
196
  /**
182
- * Reinstall a server.
197
+ * Reinstall a server. Reinstall an existing Apple silicon server (specified
198
+ * by its server ID) from a new image (OS). All the data on the disk is
199
+ * deleted and all configuration is reset to the defailt configuration values
200
+ * of the image (OS).
183
201
  *
184
202
  * @param request - The request {@link ReinstallServerRequest}
185
203
  * @returns A Promise of Server
@@ -1,2 +1,2 @@
1
- import * as index$1 from './v1/index.js';
2
- export { index$1 as v1 };
1
+ import * as index from './v1/index.js';
2
+ export { index as v1 };
@@ -11,9 +11,9 @@ const jsonContentHeaders = {
11
11
  };
12
12
 
13
13
  /**
14
- * Elastic metal API.
14
+ * Elastic Metal API.
15
15
  *
16
- * This API allows to manage your Bare metal server.
16
+ * This API allows to manage your Elastic Metal server. Elastic Metal API.
17
17
  */
18
18
  class API extends API$1 {
19
19
  constructor() {
@@ -31,7 +31,8 @@ class API extends API$1 {
31
31
  }, unmarshalListServersResponse);
32
32
  };
33
33
  /**
34
- * List elastic metal servers for organization.
34
+ * List Elastic Metal servers for an organization. List Elastic Metal servers
35
+ * for a specific organization.
35
36
  *
36
37
  * @param request - The request {@link ListServersRequest}
37
38
  * @returns A Promise of ListServersResponse
@@ -43,7 +44,8 @@ class API extends API$1 {
43
44
  return enrichForPagination('servers', _this.pageOfListServers, request);
44
45
  };
45
46
  /**
46
- * Get the server associated with the given ID.
47
+ * Get a specific Elastic Metal server. Get full details of an existing
48
+ * Elastic Metal server associated with the ID.
47
49
  *
48
50
  * @param request - The request {@link GetServerRequest}
49
51
  * @returns A Promise of Server
@@ -61,8 +63,8 @@ class API extends API$1 {
61
63
  */
62
64
  this.waitForServer = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!SERVER_TRANSIENT_STATUSES.includes(res.status))), this.getServer, request, options);
63
65
  /**
64
- * Create a new elastic metal server. Once the server is created, you probably
65
- * want to install an OS.
66
+ * Create an Elastic Metal server. Create a new Elastic Metal server. Once the
67
+ * server is created, proceed with the [installation of an OS](#post-3e949e).
66
68
  *
67
69
  * @param request - The request {@link CreateServerRequest}
68
70
  * @returns A Promise of Server
@@ -74,7 +76,9 @@ class API extends API$1 {
74
76
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers`
75
77
  }, unmarshalServer);
76
78
  /**
77
- * Update the server associated with the given ID.
79
+ * Update an Elastic Metal server. Update the server associated with the ID.
80
+ * You can update parameters such as the server's name, tags and description.
81
+ * Any parameters left null in the request body are not updated.
78
82
  *
79
83
  * @param request - The request {@link UpdateServerRequest}
80
84
  * @returns A Promise of Server
@@ -86,7 +90,8 @@ class API extends API$1 {
86
90
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
87
91
  }, unmarshalServer);
88
92
  /**
89
- * Install an OS on the server associated with the given ID.
93
+ * Install an Elastic Metal server. Install an Operating System (OS) on the
94
+ * Elastic Metal server with a specific ID.
90
95
  *
91
96
  * @param request - The request {@link InstallServerRequest}
92
97
  * @returns A Promise of Server
@@ -98,7 +103,8 @@ class API extends API$1 {
98
103
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/install`
99
104
  }, unmarshalServer);
100
105
  /**
101
- * Give the ping status on the server associated with the given ID.
106
+ * Return server metrics. Get the ping status of the server associated with
107
+ * the ID.
102
108
  *
103
109
  * @param request - The request {@link GetServerMetricsRequest}
104
110
  * @returns A Promise of GetServerMetricsResponse
@@ -108,7 +114,7 @@ class API extends API$1 {
108
114
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/metrics`
109
115
  }, unmarshalGetServerMetricsResponse);
110
116
  /**
111
- * Delete the server associated with the given ID.
117
+ * Delete an Elastic Metal server. Delete the server associated with the ID.
112
118
  *
113
119
  * @param request - The request {@link DeleteServerRequest}
114
120
  * @returns A Promise of Server
@@ -118,8 +124,9 @@ class API extends API$1 {
118
124
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
119
125
  }, unmarshalServer);
120
126
  /**
121
- * Reboot the server associated with the given ID, use boot param to reboot in
122
- * rescue.
127
+ * Reboot an Elastic Metal server. Reboot the Elastic Metal server associated
128
+ * with the ID, use the `boot_type` `rescue` to reboot the server in rescue
129
+ * mode.
123
130
  *
124
131
  * @param request - The request {@link RebootServerRequest}
125
132
  * @returns A Promise of Server
@@ -131,7 +138,7 @@ class API extends API$1 {
131
138
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reboot`
132
139
  }, unmarshalServer);
133
140
  /**
134
- * Start the server associated with the given ID.
141
+ * Start an Elastic Metal server. Start the server associated with the ID.
135
142
  *
136
143
  * @param request - The request {@link StartServerRequest}
137
144
  * @returns A Promise of Server
@@ -143,7 +150,9 @@ class API extends API$1 {
143
150
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/start`
144
151
  }, unmarshalServer);
145
152
  /**
146
- * Stop the server associated with the given ID.
153
+ * Stop an Elastic Metal server. Stop the server associated with the ID. The
154
+ * server remains allocated to your account and all data remains on the local
155
+ * storage of the server.
147
156
  *
148
157
  * @param request - The request {@link StopServerRequest}
149
158
  * @returns A Promise of Server
@@ -160,24 +169,26 @@ class API extends API$1 {
160
169
  urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
161
170
  }, unmarshalListServerEventsResponse);
162
171
  /**
163
- * List events associated to the given server ID.
172
+ * List server events. List event (i.e. start/stop/reboot) associated to the
173
+ * server ID.
164
174
  *
165
175
  * @param request - The request {@link ListServerEventsRequest}
166
176
  * @returns A Promise of ListServerEventsResponse
167
177
  */
168
178
  this.listServerEvents = request => enrichForPagination('events', this.pageOfListServerEvents, request);
169
179
  /**
170
- * Start BMC (Baseboard Management Controller) access associated with the
171
- * given ID. The BMC (Baseboard Management Controller) access is available one
172
- * hour after the installation of the server. You need first to create an
173
- * option Remote Access. You will find the ID and the price with a call to
174
- * listOffers
180
+ * Start BMC access. Start BMC (Baseboard Management Controller) access
181
+ * associated with the ID. The BMC (Baseboard Management Controller) access is
182
+ * available one hour after the installation of the server. You need first to
183
+ * create an option Remote Access. You will find the ID and the price with a
184
+ * call to listOffers
175
185
  * (https://developers.scaleway.com/en/products/baremetal/api/#get-78db92).
176
- * Then you can add the option
177
- * https://developers.scaleway.com/en/products/baremetal/api/#post-b14abd. Do
178
- * not forget to delete the Option. After start BMC, you need to Get Remote
179
- * Access to get the login/password
180
- * https://developers.scaleway.com/en/products/baremetal/api/#get-cefc0f.
186
+ * Then add the option
187
+ * https://developers.scaleway.com/en/products/baremetal/api/#post-b14abd.
188
+ * After adding the BMC option, you need to Get Remote Access to get the
189
+ * login/password
190
+ * https://developers.scaleway.com/en/products/baremetal/api/#get-cefc0f. Do
191
+ * not forget to delete the Option after use.
181
192
  *
182
193
  * @param request - The request {@link StartBMCAccessRequest}
183
194
  * @returns A Promise of BMCAccess
@@ -189,8 +200,9 @@ class API extends API$1 {
189
200
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access`
190
201
  }, unmarshalBMCAccess);
191
202
  /**
192
- * Get the BMC (Baseboard Management Controller) access associated with the
193
- * given ID.
203
+ * Get BMC access. Get the BMC (Baseboard Management Controller) access
204
+ * associated with the ID, including the URL and login information needed to
205
+ * connect.
194
206
  *
195
207
  * @param request - The request {@link GetBMCAccessRequest}
196
208
  * @returns A Promise of BMCAccess
@@ -200,8 +212,8 @@ class API extends API$1 {
200
212
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access`
201
213
  }, unmarshalBMCAccess);
202
214
  /**
203
- * Stop BMC (Baseboard Management Controller) access associated with the given
204
- * ID.
215
+ * Stop BMC access. Stop BMC (Baseboard Management Controller) access
216
+ * associated with the ID.
205
217
  *
206
218
  * @param request - The request {@link StopBMCAccessRequest}
207
219
  */
@@ -210,8 +222,8 @@ class API extends API$1 {
210
222
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access`
211
223
  });
212
224
  /**
213
- * Configure ip associated with the given server ID and ipID. You can use this
214
- * method to set a reverse dns for an IP.
225
+ * Update IP. Configure the IP address associated with the server ID and IP
226
+ * ID. You can use this method to set a reverse DNS for an IP address.
215
227
  *
216
228
  * @param request - The request {@link UpdateIPRequest}
217
229
  * @returns A Promise of IP
@@ -223,7 +235,8 @@ class API extends API$1 {
223
235
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/ips/${validatePathParam('ipId', request.ipId)}`
224
236
  }, unmarshalIP);
225
237
  /**
226
- * Add an option to a specific server.
238
+ * Add server option. Add an option, such as Private Networks, to a specific
239
+ * server.
227
240
  *
228
241
  * @param request - The request {@link AddOptionServerRequest}
229
242
  * @returns A Promise of Server
@@ -235,7 +248,7 @@ class API extends API$1 {
235
248
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/options/${validatePathParam('optionId', request.optionId)}`
236
249
  }, unmarshalServer);
237
250
  /**
238
- * Delete an option from a specific server.
251
+ * Delete server option. Delete an option from a specific server.
239
252
  *
240
253
  * @param request - The request {@link DeleteOptionServerRequest}
241
254
  * @returns A Promise of Server
@@ -255,7 +268,7 @@ class API extends API$1 {
255
268
  }, unmarshalListOffersResponse);
256
269
  };
257
270
  /**
258
- * List all available server offers.
271
+ * List offers. List all available Elastic Metal server configurations.
259
272
  *
260
273
  * @param request - The request {@link ListOffersRequest}
261
274
  * @returns A Promise of ListOffersResponse
@@ -267,7 +280,7 @@ class API extends API$1 {
267
280
  return enrichForPagination('offers', _this.pageOfListOffers, request);
268
281
  };
269
282
  /**
270
- * Return specific offer for the given ID.
283
+ * Get offer. Get details of an offer identified by its offer ID.
271
284
  *
272
285
  * @param request - The request {@link GetOfferRequest}
273
286
  * @returns A Promise of Offer
@@ -277,7 +290,7 @@ class API extends API$1 {
277
290
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/offers/${validatePathParam('offerId', request.offerId)}`
278
291
  }, unmarshalOffer);
279
292
  /**
280
- * Return specific option for the given ID.
293
+ * Get option. Return specific option for the ID.
281
294
  *
282
295
  * @param request - The request {@link GetOptionRequest}
283
296
  * @returns A Promise of Option
@@ -297,7 +310,7 @@ class API extends API$1 {
297
310
  }, unmarshalListOptionsResponse);
298
311
  };
299
312
  /**
300
- * List all options matching with filters.
313
+ * List options. List all options matching with filters.
301
314
  *
302
315
  * @param request - The request {@link ListOptionsRequest}
303
316
  * @returns A Promise of ListOptionsResponse
@@ -319,7 +332,7 @@ class API extends API$1 {
319
332
  }, unmarshalListSettingsResponse);
320
333
  };
321
334
  /**
322
- * Return all settings for a project ID.
335
+ * List all settings. Return all settings for a project ID.
323
336
  *
324
337
  * @param request - The request {@link ListSettingsRequest}
325
338
  * @returns A Promise of ListSettingsResponse
@@ -331,7 +344,7 @@ class API extends API$1 {
331
344
  return enrichForPagination('settings', _this.pageOfListSettings, request);
332
345
  };
333
346
  /**
334
- * Update a setting for a project ID (enable or disable).
347
+ * Update setting. Update a setting for a project ID (enable or disable).
335
348
  *
336
349
  * @param request - The request {@link UpdateSettingRequest}
337
350
  * @returns A Promise of Setting
@@ -353,7 +366,8 @@ class API extends API$1 {
353
366
  }, unmarshalListOSResponse);
354
367
  };
355
368
  /**
356
- * List all available OS that can be install on an elastic metal server.
369
+ * List available OSes. List all OSes that are available for installation on
370
+ * Elastic Metal servers.
357
371
  *
358
372
  * @param request - The request {@link ListOSRequest}
359
373
  * @returns A Promise of ListOSResponse
@@ -365,7 +379,7 @@ class API extends API$1 {
365
379
  return enrichForPagination('os', _this.pageOfListOS, request);
366
380
  };
367
381
  /**
368
- * Return specific OS for the given ID.
382
+ * Get an OS with an ID. Return specific OS for the ID.
369
383
  *
370
384
  * @param request - The request {@link GetOSRequest}
371
385
  * @returns A Promise of OS
@@ -386,7 +400,7 @@ class PrivateNetworkAPI extends API$1 {
386
400
  super(...arguments);
387
401
  _this2 = this;
388
402
  /**
389
- * Add a server to a private network
403
+ * Add a server to a Private Network.
390
404
  *
391
405
  * @param request - The request
392
406
  * {@link PrivateNetworkApiAddServerPrivateNetworkRequest}
@@ -399,7 +413,7 @@ class PrivateNetworkAPI extends API$1 {
399
413
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks`
400
414
  }, unmarshalServerPrivateNetwork);
401
415
  /**
402
- * Set multiple private networks on a server
416
+ * Set multiple Private Networks on a server.
403
417
  *
404
418
  * @param request - The request
405
419
  * {@link PrivateNetworkApiSetServerPrivateNetworksRequest}
@@ -422,7 +436,7 @@ class PrivateNetworkAPI extends API$1 {
422
436
  }, unmarshalListServerPrivateNetworksResponse);
423
437
  };
424
438
  /**
425
- * List the private networks of a server
439
+ * List the Private Networks of a server.
426
440
  *
427
441
  * @param request - The request
428
442
  * {@link PrivateNetworkApiListServerPrivateNetworksRequest}
@@ -435,7 +449,7 @@ class PrivateNetworkAPI extends API$1 {
435
449
  return enrichForPagination('serverPrivateNetworks', _this2.pageOfListServerPrivateNetworks, request);
436
450
  };
437
451
  /**
438
- * Delete a private network
452
+ * Delete a Private Network.
439
453
  *
440
454
  * @param request - The request
441
455
  * {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest}
@@ -0,0 +1,2 @@
1
+ import * as index_gen from './v2alpha1/index.gen.js';
2
+ export { index_gen as v2alpha1 };
@@ -0,0 +1,52 @@
1
+ import { API as API$1 } from '../../../scw/api.js';
2
+ import { urlParams, validatePathParam } from '../../../helpers/marshalling.js';
3
+ import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
4
+ import { unmarshalGetConsumptionResponse, unmarshalListInvoicesResponse } from './marshalling.gen.js';
5
+
6
+ // This file was automatically generated. DO NOT EDIT.
7
+ /**
8
+ * Billing API.
9
+ *
10
+ * This API allows you to query your consumption. Billing API.
11
+ */
12
+ class API extends API$1 {
13
+ constructor() {
14
+ var _this;
15
+ super(...arguments);
16
+ _this = this;
17
+ this.getConsumption = function (request) {
18
+ if (request === void 0) {
19
+ request = {};
20
+ }
21
+ return _this.client.fetch({
22
+ method: 'GET',
23
+ path: `/billing/v2alpha1/consumption`,
24
+ urlParams: urlParams(['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId])
25
+ }, unmarshalGetConsumptionResponse);
26
+ };
27
+ this.pageOfListInvoices = function (request) {
28
+ if (request === void 0) {
29
+ request = {};
30
+ }
31
+ return _this.client.fetch({
32
+ method: 'GET',
33
+ path: `/billing/v2alpha1/invoices`,
34
+ urlParams: urlParams(['invoice_type', request.invoiceType ?? 'unknown_type'], ['order_by', request.orderBy ?? 'invoice_number_desc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['started_after', request.startedAfter], ['started_before', request.startedBefore])
35
+ }, unmarshalListInvoicesResponse);
36
+ };
37
+ this.listInvoices = function (request) {
38
+ if (request === void 0) {
39
+ request = {};
40
+ }
41
+ return enrichForPagination('invoices', _this.pageOfListInvoices, request);
42
+ };
43
+ this.downloadInvoice = request => this.client.fetch({
44
+ method: 'GET',
45
+ path: `/billing/v2alpha1/invoices/${validatePathParam('invoiceId', request.invoiceId)}/download`,
46
+ urlParams: urlParams(['dl', 1], ['file_type', request.fileType ?? 'pdf']),
47
+ responseType: 'blob'
48
+ });
49
+ }
50
+ }
51
+
52
+ export { API };
@@ -0,0 +1,3 @@
1
+ export { API } from './api.gen.js';
2
+
3
+ // This file was automatically generated. DO NOT EDIT.
@@ -0,0 +1,52 @@
1
+ import { isJSONObject } from '../../../helpers/json.js';
2
+ import { unmarshalMoney } from '../../../scw/custom-marshalling.js';
3
+ import { unmarshalArrayOfObject, unmarshalDate } from '../../../helpers/marshalling.js';
4
+
5
+ // This file was automatically generated. DO NOT EDIT.
6
+ const unmarshalGetConsumptionResponseConsumption = data => {
7
+ if (!isJSONObject(data)) {
8
+ throw new TypeError(`Unmarshalling the type 'GetConsumptionResponseConsumption' failed as data isn't a dictionary.`);
9
+ }
10
+ return {
11
+ category: data.category,
12
+ description: data.description,
13
+ operationPath: data.operation_path,
14
+ projectId: data.project_id,
15
+ value: data.value ? unmarshalMoney(data.value) : undefined
16
+ };
17
+ };
18
+ const unmarshalInvoice = data => {
19
+ if (!isJSONObject(data)) {
20
+ throw new TypeError(`Unmarshalling the type 'Invoice' failed as data isn't a dictionary.`);
21
+ }
22
+ return {
23
+ dueDate: unmarshalDate(data.due_date),
24
+ id: data.id,
25
+ invoiceType: data.invoice_type,
26
+ issuedDate: unmarshalDate(data.issued_date),
27
+ number: data.number,
28
+ startDate: unmarshalDate(data.start_date),
29
+ totalTaxed: data.total_taxed ? unmarshalMoney(data.total_taxed) : undefined,
30
+ totalUntaxed: data.total_untaxed ? unmarshalMoney(data.total_untaxed) : undefined
31
+ };
32
+ };
33
+ const unmarshalGetConsumptionResponse = data => {
34
+ if (!isJSONObject(data)) {
35
+ throw new TypeError(`Unmarshalling the type 'GetConsumptionResponse' failed as data isn't a dictionary.`);
36
+ }
37
+ return {
38
+ consumptions: unmarshalArrayOfObject(data.consumptions, unmarshalGetConsumptionResponseConsumption),
39
+ updatedAt: unmarshalDate(data.updated_at)
40
+ };
41
+ };
42
+ const unmarshalListInvoicesResponse = data => {
43
+ if (!isJSONObject(data)) {
44
+ throw new TypeError(`Unmarshalling the type 'ListInvoicesResponse' failed as data isn't a dictionary.`);
45
+ }
46
+ return {
47
+ invoices: unmarshalArrayOfObject(data.invoices, unmarshalInvoice),
48
+ totalCount: data.total_count
49
+ };
50
+ };
51
+
52
+ export { unmarshalGetConsumptionResponse, unmarshalListInvoicesResponse };