@scaleway/sdk 1.13.0 → 1.15.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 (50) hide show
  1. package/dist/api/account/v2/api.gen.js +77 -60
  2. package/dist/api/applesilicon/v1alpha1/api.gen.js +175 -173
  3. package/dist/api/baremetal/v1/api.gen.js +434 -378
  4. package/dist/api/baremetal/v1/api.utils.js +19 -22
  5. package/dist/api/billing/v2alpha1/api.gen.js +21 -17
  6. package/dist/api/cockpit/v1beta1/api.gen.js +308 -232
  7. package/dist/api/container/v1beta1/api.gen.js +384 -337
  8. package/dist/api/domain/v2beta1/api.gen.js +754 -668
  9. package/dist/api/flexibleip/v1alpha1/api.gen.js +164 -151
  10. package/dist/api/function/v1beta1/api.gen.js +467 -407
  11. package/dist/api/iam/v1alpha1/api.gen.js +641 -557
  12. package/dist/api/instance/v1/api.gen.js +802 -677
  13. package/dist/api/instance/v1/api.utils.js +337 -325
  14. package/dist/api/instance/v1/marshalling.gen.js +2 -1
  15. package/dist/api/iot/v1/api.gen.js +508 -452
  16. package/dist/api/ipfs/index.js +2 -0
  17. package/dist/api/ipfs/v1alpha1/api.gen.js +197 -0
  18. package/dist/api/ipfs/v1alpha1/content.gen.js +7 -0
  19. package/dist/api/ipfs/v1alpha1/index.gen.js +5 -0
  20. package/dist/api/ipfs/v1alpha1/marshalling.gen.js +125 -0
  21. package/dist/api/k8s/v1/api.gen.js +403 -342
  22. package/dist/api/k8s/v1/api.utils.js +7 -10
  23. package/dist/api/k8s/v1/marshalling.gen.js +19 -1
  24. package/dist/api/k8s/v1/validation-rules.gen.js +10 -1
  25. package/dist/api/lb/v1/api.gen.js +1501 -1363
  26. package/dist/api/lb/v1/api.utils.js +71 -75
  27. package/dist/api/lb/v1/marshalling.gen.js +6 -0
  28. package/dist/api/marketplace/v1/api.gen.js +35 -32
  29. package/dist/api/marketplace/v2/api.gen.js +117 -102
  30. package/dist/api/mnq/v1alpha1/api.gen.js +154 -137
  31. package/dist/api/rdb/v1/api.gen.js +897 -819
  32. package/dist/api/redis/v1/api.gen.js +358 -333
  33. package/dist/api/registry/v1/api.gen.js +211 -189
  34. package/dist/api/secret/v1alpha1/api.gen.js +265 -245
  35. package/dist/api/secret/v1alpha1/marshalling.gen.js +1 -0
  36. package/dist/api/tem/v1alpha1/api.gen.js +183 -156
  37. package/dist/api/tem/v1alpha1/marshalling.gen.js +32 -1
  38. package/dist/api/test/v1/api.gen.js +116 -104
  39. package/dist/api/vpc/v1/api.gen.js +74 -65
  40. package/dist/api/vpc/v2/api.gen.js +200 -178
  41. package/dist/api/vpc/v2/marshalling.gen.js +2 -0
  42. package/dist/api/vpcgw/v1/api.gen.js +575 -501
  43. package/dist/api/webhosting/v1alpha1/api.gen.js +127 -117
  44. package/dist/index.cjs +738 -343
  45. package/dist/index.d.ts +2067 -1592
  46. package/dist/index.js +28 -26
  47. package/dist/internal/logger/console-logger.js +4 -5
  48. package/dist/scw/constants.js +1 -1
  49. package/dist/scw/errors/scw-error.js +0 -1
  50. package/package.json +2 -2
@@ -15,18 +15,16 @@ const jsonContentHeaders = {
15
15
  * User related data. This API allows you to manage projects.
16
16
  */
17
17
  class API extends API$1 {
18
- constructor() {
19
- var _this;
20
- super(...arguments);
21
- _this = this;
22
- /**
23
- * Create a new Project for an Organization. Generate a new Project for an
24
- * Organization, specifying its configuration including name and description.
25
- *
26
- * @param request - The request {@link CreateProjectRequest}
27
- * @returns A Promise of Project
28
- */
29
- this.createProject = function (request) {
18
+ /**
19
+ * Create a new Project for an Organization. Generate a new Project for an
20
+ * Organization, specifying its configuration including name and description.
21
+ *
22
+ * @param request - The request {@link CreateProjectRequest}
23
+ * @returns A Promise of Project
24
+ */
25
+ createProject = (() => {
26
+ var _this = this;
27
+ return function (request) {
30
28
  if (request === void 0) {
31
29
  request = {};
32
30
  }
@@ -37,84 +35,103 @@ class API extends API$1 {
37
35
  path: `/account/v2/projects`
38
36
  }, unmarshalProject);
39
37
  };
40
- this.pageOfListProjects = function (request) {
38
+ })();
39
+ pageOfListProjects = (() => {
40
+ var _this2 = this;
41
+ return function (request) {
41
42
  if (request === void 0) {
42
43
  request = {};
43
44
  }
44
- return _this.client.fetch({
45
+ return _this2.client.fetch({
45
46
  method: 'GET',
46
47
  path: `/account/v2/projects`,
47
- urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_ids', request.projectIds])
48
+ urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? _this2.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this2.client.settings.defaultPageSize], ['project_ids', request.projectIds])
48
49
  }, unmarshalListProjectsResponse);
49
50
  };
50
- /**
51
- * List all Projects of an Organization. List all Projects of an Organization.
52
- * The response will include the total number of Projects as well as their
53
- * associated Organizations, names and IDs. Other information include the
54
- * creation and update date of the Project.
55
- *
56
- * @param request - The request {@link ListProjectsRequest}
57
- * @returns A Promise of ListProjectsResponse
58
- */
59
- this.listProjects = function (request) {
51
+ })();
52
+
53
+ /**
54
+ * List all Projects of an Organization. List all Projects of an Organization.
55
+ * The response will include the total number of Projects as well as their
56
+ * associated Organizations, names and IDs. Other information include the
57
+ * creation and update date of the Project.
58
+ *
59
+ * @param request - The request {@link ListProjectsRequest}
60
+ * @returns A Promise of ListProjectsResponse
61
+ */
62
+ listProjects = (() => {
63
+ var _this3 = this;
64
+ return function (request) {
60
65
  if (request === void 0) {
61
66
  request = {};
62
67
  }
63
- return enrichForPagination('projects', _this.pageOfListProjects, request);
68
+ return enrichForPagination('projects', _this3.pageOfListProjects, request);
64
69
  };
65
- /**
66
- * Get an existing Project. Retrieve information about an existing Project,
67
- * specified by its Project ID. Its full details, including ID, name and
68
- * description, are returned in the response object.
69
- *
70
- * @param request - The request {@link GetProjectRequest}
71
- * @returns A Promise of Project
72
- */
73
- this.getProject = function (request) {
70
+ })();
71
+
72
+ /**
73
+ * Get an existing Project. Retrieve information about an existing Project,
74
+ * specified by its Project ID. Its full details, including ID, name and
75
+ * description, are returned in the response object.
76
+ *
77
+ * @param request - The request {@link GetProjectRequest}
78
+ * @returns A Promise of Project
79
+ */
80
+ getProject = (() => {
81
+ var _this4 = this;
82
+ return function (request) {
74
83
  if (request === void 0) {
75
84
  request = {};
76
85
  }
77
- return _this.client.fetch({
86
+ return _this4.client.fetch({
78
87
  method: 'GET',
79
- path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? _this.client.settings.defaultProjectId)}`
88
+ path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? _this4.client.settings.defaultProjectId)}`
80
89
  }, unmarshalProject);
81
90
  };
82
- /**
83
- * Delete an existing Project. Delete an existing Project, specified by its
84
- * Project ID. The Project needs to be empty (meaning there are no resources
85
- * left in it) to be deleted effectively. Note that deleting a Project is
86
- * permanent, and cannot be undone.
87
- *
88
- * @param request - The request {@link DeleteProjectRequest}
89
- */
90
- this.deleteProject = function (request) {
91
+ })();
92
+
93
+ /**
94
+ * Delete an existing Project. Delete an existing Project, specified by its
95
+ * Project ID. The Project needs to be empty (meaning there are no resources
96
+ * left in it) to be deleted effectively. Note that deleting a Project is
97
+ * permanent, and cannot be undone.
98
+ *
99
+ * @param request - The request {@link DeleteProjectRequest}
100
+ */
101
+ deleteProject = (() => {
102
+ var _this5 = this;
103
+ return function (request) {
91
104
  if (request === void 0) {
92
105
  request = {};
93
106
  }
94
- return _this.client.fetch({
107
+ return _this5.client.fetch({
95
108
  method: 'DELETE',
96
- path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? _this.client.settings.defaultProjectId)}`
109
+ path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? _this5.client.settings.defaultProjectId)}`
97
110
  });
98
111
  };
99
- /**
100
- * Update Project. Update the parameters of an existing Project, specified by
101
- * its Project ID. These parameters include the name and description.
102
- *
103
- * @param request - The request {@link UpdateProjectRequest}
104
- * @returns A Promise of Project
105
- */
106
- this.updateProject = function (request) {
112
+ })();
113
+
114
+ /**
115
+ * Update Project. Update the parameters of an existing Project, specified by
116
+ * its Project ID. These parameters include the name and description.
117
+ *
118
+ * @param request - The request {@link UpdateProjectRequest}
119
+ * @returns A Promise of Project
120
+ */
121
+ updateProject = (() => {
122
+ var _this6 = this;
123
+ return function (request) {
107
124
  if (request === void 0) {
108
125
  request = {};
109
126
  }
110
- return _this.client.fetch({
111
- body: JSON.stringify(marshalUpdateProjectRequest(request, _this.client.settings)),
127
+ return _this6.client.fetch({
128
+ body: JSON.stringify(marshalUpdateProjectRequest(request, _this6.client.settings)),
112
129
  headers: jsonContentHeaders,
113
130
  method: 'PATCH',
114
- path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? _this.client.settings.defaultProjectId)}`
131
+ path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? _this6.client.settings.defaultProjectId)}`
115
132
  }, unmarshalProject);
116
133
  };
117
- }
134
+ })();
118
135
  }
119
136
 
120
137
  export { API };
@@ -11,41 +11,22 @@ const jsonContentHeaders = {
11
11
  'Content-Type': 'application/json; charset=utf-8'
12
12
  };
13
13
 
14
- /**
15
- * Apple silicon API.
16
- *
17
- * Apple Mac mini as a service. Scaleway Apple silicon as-a-Service is built
18
- * using the latest generation of Apple Mac mini hardware (fifth generation).
19
- *
20
- * These dedicated Mac mini M1s are designed for developing, building, testing,
21
- * and signing applications for Apple devices, including iPhones, iPads, Mac
22
- * computers and much more.
23
- *
24
- * Get set to explore, learn and build on a dedicated Mac mini M1 with more
25
- * performance and speed than you ever thought possible.
26
- *
27
- * _Apple silicon as a Service comes with a minimum allocation period of 24
28
- * hours_*.
29
- *
30
- * Mac mini and macOS are trademarks of Apple Inc., registered in the U.S. and
31
- * other countries and regions. IOS is a trademark or registered trademark of
32
- * Cisco in the U.S. and other countries and is used by Apple under license.
33
- * Scaleway is not affiliated with Apple Inc.
34
- */
14
+ /** Apple silicon API. */
35
15
  class API extends API$1 {
36
- constructor() {
37
- var _this;
38
- super(...arguments);
39
- _this = this;
40
- /**
41
- * List server types. List all technical details about Apple silicon server
42
- * types available in the specified zone. Since there is only one Availability
43
- * Zone for Apple silicon servers, the targeted value is `fr-par-3`.
44
- *
45
- * @param request - The request {@link ListServerTypesRequest}
46
- * @returns A Promise of ListServerTypesResponse
47
- */
48
- this.listServerTypes = function (request) {
16
+ /** Lists the available zones of the API. */
17
+ static LOCALITIES = ['fr-par-3'];
18
+
19
+ /**
20
+ * List server types. List all technical details about Apple silicon server
21
+ * types available in the specified zone. Since there is only one Availability
22
+ * Zone for Apple silicon servers, the targeted value is `fr-par-3`.
23
+ *
24
+ * @param request - The request {@link ListServerTypesRequest}
25
+ * @returns A Promise of ListServerTypesResponse
26
+ */
27
+ listServerTypes = (() => {
28
+ var _this = this;
29
+ return function (request) {
49
30
  if (request === void 0) {
50
31
  request = {};
51
32
  }
@@ -54,165 +35,186 @@ class API extends API$1 {
54
35
  path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/server-types`
55
36
  }, unmarshalListServerTypesResponse);
56
37
  };
57
- /**
58
- * Get a server type. Get technical details (CPU, disk size etc.) of a server
59
- * type.
60
- *
61
- * @param request - The request {@link GetServerTypeRequest}
62
- * @returns A Promise of ServerType
63
- */
64
- this.getServerType = request => this.client.fetch({
65
- method: 'GET',
66
- path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/server-type/${validatePathParam('serverType', request.serverType)}`
67
- }, unmarshalServerType);
68
- /**
69
- * Create a server. Create a new server in the targeted zone, specifying its
70
- * configuration including name and type.
71
- *
72
- * @param request - The request {@link CreateServerRequest}
73
- * @returns A Promise of Server
74
- */
75
- this.createServer = request => this.client.fetch({
76
- body: JSON.stringify(marshalCreateServerRequest(request, this.client.settings)),
77
- headers: jsonContentHeaders,
78
- method: 'POST',
79
- path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers`
80
- }, unmarshalServer);
81
- this.pageOfListServers = function (request) {
38
+ })();
39
+
40
+ /**
41
+ * Get a server type. Get technical details (CPU, disk size etc.) of a server
42
+ * type.
43
+ *
44
+ * @param request - The request {@link GetServerTypeRequest}
45
+ * @returns A Promise of ServerType
46
+ */
47
+ getServerType = request => this.client.fetch({
48
+ method: 'GET',
49
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/server-type/${validatePathParam('serverType', request.serverType)}`
50
+ }, unmarshalServerType);
51
+
52
+ /**
53
+ * Create a server. Create a new server in the targeted zone, specifying its
54
+ * configuration including name and type.
55
+ *
56
+ * @param request - The request {@link CreateServerRequest}
57
+ * @returns A Promise of Server
58
+ */
59
+ createServer = request => this.client.fetch({
60
+ body: JSON.stringify(marshalCreateServerRequest(request, this.client.settings)),
61
+ headers: jsonContentHeaders,
62
+ method: 'POST',
63
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers`
64
+ }, unmarshalServer);
65
+ pageOfListServers = (() => {
66
+ var _this2 = this;
67
+ return function (request) {
82
68
  if (request === void 0) {
83
69
  request = {};
84
70
  }
85
- return _this.client.fetch({
71
+ return _this2.client.fetch({
86
72
  method: 'GET',
87
- path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/servers`,
88
- urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId])
73
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? _this2.client.settings.defaultZone)}/servers`,
74
+ urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this2.client.settings.defaultPageSize], ['project_id', request.projectId])
89
75
  }, unmarshalListServersResponse);
90
76
  };
91
- /**
92
- * List all servers. List all servers in the specified zone. By default,
93
- * returned servers in the list are ordered by creation date in ascending
94
- * order, though this can be modified via the `order_by` field.
95
- *
96
- * @param request - The request {@link ListServersRequest}
97
- * @returns A Promise of ListServersResponse
98
- */
99
- this.listServers = function (request) {
77
+ })();
78
+
79
+ /**
80
+ * List all servers. List all servers in the specified zone. By default,
81
+ * returned servers in the list are ordered by creation date in ascending
82
+ * order, though this can be modified via the `order_by` field.
83
+ *
84
+ * @param request - The request {@link ListServersRequest}
85
+ * @returns A Promise of ListServersResponse
86
+ */
87
+ listServers = (() => {
88
+ var _this3 = this;
89
+ return function (request) {
100
90
  if (request === void 0) {
101
91
  request = {};
102
92
  }
103
- return enrichForPagination('servers', _this.pageOfListServers, request);
93
+ return enrichForPagination('servers', _this3.pageOfListServers, request);
104
94
  };
105
- this.pageOfListOS = function (request) {
95
+ })();
96
+ pageOfListOS = (() => {
97
+ var _this4 = this;
98
+ return function (request) {
106
99
  if (request === void 0) {
107
100
  request = {};
108
101
  }
109
- return _this.client.fetch({
102
+ return _this4.client.fetch({
110
103
  method: 'GET',
111
- path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/os`,
112
- urlParams: urlParams(['name', request.name], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['server_type', request.serverType])
104
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? _this4.client.settings.defaultZone)}/os`,
105
+ urlParams: urlParams(['name', request.name], ['page', request.page], ['page_size', request.pageSize ?? _this4.client.settings.defaultPageSize], ['server_type', request.serverType])
113
106
  }, unmarshalListOSResponse);
114
107
  };
115
- /**
116
- * List all Operating Systems (OS). List all Operating Systems (OS). The
117
- * response will include the total number of OS as well as their associated
118
- * IDs, names and labels.
119
- *
120
- * @param request - The request {@link ListOSRequest}
121
- * @returns A Promise of ListOSResponse
122
- */
123
- this.listOS = function (request) {
108
+ })();
109
+
110
+ /**
111
+ * List all Operating Systems (OS). List all Operating Systems (OS). The
112
+ * response will include the total number of OS as well as their associated
113
+ * IDs, names and labels.
114
+ *
115
+ * @param request - The request {@link ListOSRequest}
116
+ * @returns A Promise of ListOSResponse
117
+ */
118
+ listOS = (() => {
119
+ var _this5 = this;
120
+ return function (request) {
124
121
  if (request === void 0) {
125
122
  request = {};
126
123
  }
127
- return enrichForPagination('os', _this.pageOfListOS, request);
124
+ return enrichForPagination('os', _this5.pageOfListOS, request);
128
125
  };
129
- /**
130
- * Get an Operating System (OS). Get an Operating System (OS). The response
131
- * will include the OS's unique ID as well as its name and label.
132
- *
133
- * @param request - The request {@link GetOSRequest}
134
- * @returns A Promise of OS
135
- */
136
- this.getOS = request => this.client.fetch({
137
- method: 'GET',
138
- path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/os/${validatePathParam('osId', request.osId)}`
139
- }, unmarshalOS);
140
- /**
141
- * Get a server. Retrieve information about an existing Apple silicon server,
142
- * specified by its server ID. Its full details, including name, status and IP
143
- * address, are returned in the response object.
144
- *
145
- * @param request - The request {@link GetServerRequest}
146
- * @returns A Promise of Server
147
- */
148
- this.getServer = request => this.client.fetch({
149
- method: 'GET',
150
- path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
151
- }, unmarshalServer);
152
- /**
153
- * Waits for {@link Server} to be in a final state.
154
- *
155
- * @param request - The request {@link GetServerRequest}
156
- * @param options - The waiting options
157
- * @returns A Promise of Server
158
- */
159
- this.waitForServer = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!SERVER_TRANSIENT_STATUSES.includes(res.status))), this.getServer, request, options);
160
- /**
161
- * Update a server. Update the parameters of an existing Apple silicon server,
162
- * specified by its server ID.
163
- *
164
- * @param request - The request {@link UpdateServerRequest}
165
- * @returns A Promise of Server
166
- */
167
- this.updateServer = request => this.client.fetch({
168
- body: JSON.stringify(marshalUpdateServerRequest(request, this.client.settings)),
169
- headers: jsonContentHeaders,
170
- method: 'PATCH',
171
- path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
172
- }, unmarshalServer);
173
- /**
174
- * Delete a server. Delete an existing Apple silicon server, specified by its
175
- * server ID. Deleting a server is permanent, and cannot be undone. Note that
176
- * the minimum allocation period for Apple silicon-as-a-service is 24 hours,
177
- * meaning you cannot delete your server prior to that.
178
- *
179
- * @param request - The request {@link DeleteServerRequest}
180
- */
181
- this.deleteServer = request => this.client.fetch({
182
- method: 'DELETE',
183
- path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
184
- });
185
- /**
186
- * Reboot a server. Reboot an existing Apple silicon server, specified by its
187
- * server ID.
188
- *
189
- * @param request - The request {@link RebootServerRequest}
190
- * @returns A Promise of Server
191
- */
192
- this.rebootServer = request => this.client.fetch({
193
- body: '{}',
194
- headers: jsonContentHeaders,
195
- method: 'POST',
196
- path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reboot`
197
- }, unmarshalServer);
198
- /**
199
- * Reinstall a server. Reinstall an existing Apple silicon server (specified
200
- * by its server ID) from a new image (OS). All the data on the disk is
201
- * deleted and all configuration is reset to the defailt configuration values
202
- * of the image (OS).
203
- *
204
- * @param request - The request {@link ReinstallServerRequest}
205
- * @returns A Promise of Server
206
- */
207
- this.reinstallServer = request => this.client.fetch({
208
- body: '{}',
209
- headers: jsonContentHeaders,
210
- method: 'POST',
211
- path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reinstall`
212
- }, unmarshalServer);
213
- }
214
- /** Lists the available zones of the API. */
126
+ })();
127
+
128
+ /**
129
+ * Get an Operating System (OS). Get an Operating System (OS). The response
130
+ * will include the OS's unique ID as well as its name and label.
131
+ *
132
+ * @param request - The request {@link GetOSRequest}
133
+ * @returns A Promise of OS
134
+ */
135
+ getOS = request => this.client.fetch({
136
+ method: 'GET',
137
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/os/${validatePathParam('osId', request.osId)}`
138
+ }, unmarshalOS);
139
+
140
+ /**
141
+ * Get a server. Retrieve information about an existing Apple silicon server,
142
+ * specified by its server ID. Its full details, including name, status and IP
143
+ * address, are returned in the response object.
144
+ *
145
+ * @param request - The request {@link GetServerRequest}
146
+ * @returns A Promise of Server
147
+ */
148
+ getServer = request => this.client.fetch({
149
+ method: 'GET',
150
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
151
+ }, unmarshalServer);
152
+
153
+ /**
154
+ * Waits for {@link Server} to be in a final state.
155
+ *
156
+ * @param request - The request {@link GetServerRequest}
157
+ * @param options - The waiting options
158
+ * @returns A Promise of Server
159
+ */
160
+ waitForServer = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!SERVER_TRANSIENT_STATUSES.includes(res.status))), this.getServer, request, options);
161
+
162
+ /**
163
+ * Update a server. Update the parameters of an existing Apple silicon server,
164
+ * specified by its server ID.
165
+ *
166
+ * @param request - The request {@link UpdateServerRequest}
167
+ * @returns A Promise of Server
168
+ */
169
+ updateServer = request => this.client.fetch({
170
+ body: JSON.stringify(marshalUpdateServerRequest(request, this.client.settings)),
171
+ headers: jsonContentHeaders,
172
+ method: 'PATCH',
173
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
174
+ }, unmarshalServer);
175
+
176
+ /**
177
+ * Delete a server. Delete an existing Apple silicon server, specified by its
178
+ * server ID. Deleting a server is permanent, and cannot be undone. Note that
179
+ * the minimum allocation period for Apple silicon-as-a-service is 24 hours,
180
+ * meaning you cannot delete your server prior to that.
181
+ *
182
+ * @param request - The request {@link DeleteServerRequest}
183
+ */
184
+ deleteServer = request => this.client.fetch({
185
+ method: 'DELETE',
186
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
187
+ });
188
+
189
+ /**
190
+ * Reboot a server. Reboot an existing Apple silicon server, specified by its
191
+ * server ID.
192
+ *
193
+ * @param request - The request {@link RebootServerRequest}
194
+ * @returns A Promise of Server
195
+ */
196
+ rebootServer = request => this.client.fetch({
197
+ body: '{}',
198
+ headers: jsonContentHeaders,
199
+ method: 'POST',
200
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reboot`
201
+ }, unmarshalServer);
202
+
203
+ /**
204
+ * Reinstall a server. Reinstall an existing Apple silicon server (specified
205
+ * by its server ID) from a new image (OS). All the data on the disk is
206
+ * deleted and all configuration is reset to the defailt configuration values
207
+ * of the image (OS).
208
+ *
209
+ * @param request - The request {@link ReinstallServerRequest}
210
+ * @returns A Promise of Server
211
+ */
212
+ reinstallServer = request => this.client.fetch({
213
+ body: '{}',
214
+ headers: jsonContentHeaders,
215
+ method: 'POST',
216
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reinstall`
217
+ }, unmarshalServer);
215
218
  }
216
- API.LOCALITIES = ['fr-par-3'];
217
219
 
218
220
  export { API };