@scaleway/sdk 1.14.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 (49) hide show
  1. package/dist/api/account/v2/api.gen.js +77 -60
  2. package/dist/api/applesilicon/v1alpha1/api.gen.js +174 -152
  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/tem/v1alpha1/api.gen.js +182 -147
  36. package/dist/api/tem/v1alpha1/marshalling.gen.js +32 -1
  37. package/dist/api/test/v1/api.gen.js +116 -104
  38. package/dist/api/vpc/v1/api.gen.js +74 -65
  39. package/dist/api/vpc/v2/api.gen.js +200 -178
  40. package/dist/api/vpc/v2/marshalling.gen.js +1 -0
  41. package/dist/api/vpcgw/v1/api.gen.js +575 -501
  42. package/dist/api/webhosting/v1alpha1/api.gen.js +127 -117
  43. package/dist/index.cjs +732 -311
  44. package/dist/index.d.ts +2040 -1540
  45. package/dist/index.js +28 -26
  46. package/dist/internal/logger/console-logger.js +4 -5
  47. package/dist/scw/constants.js +1 -1
  48. package/dist/scw/errors/scw-error.js +2 -2
  49. 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 };
@@ -13,19 +13,20 @@ const jsonContentHeaders = {
13
13
 
14
14
  /** Apple silicon API. */
15
15
  class API extends API$1 {
16
- constructor() {
17
- var _this;
18
- super(...arguments);
19
- _this = this;
20
- /**
21
- * List server types. List all technical details about Apple silicon server
22
- * types available in the specified zone. Since there is only one Availability
23
- * Zone for Apple silicon servers, the targeted value is `fr-par-3`.
24
- *
25
- * @param request - The request {@link ListServerTypesRequest}
26
- * @returns A Promise of ListServerTypesResponse
27
- */
28
- 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) {
29
30
  if (request === void 0) {
30
31
  request = {};
31
32
  }
@@ -34,165 +35,186 @@ class API extends API$1 {
34
35
  path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/server-types`
35
36
  }, unmarshalListServerTypesResponse);
36
37
  };
37
- /**
38
- * Get a server type. Get technical details (CPU, disk size etc.) of a server
39
- * type.
40
- *
41
- * @param request - The request {@link GetServerTypeRequest}
42
- * @returns A Promise of ServerType
43
- */
44
- this.getServerType = request => this.client.fetch({
45
- method: 'GET',
46
- path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/server-type/${validatePathParam('serverType', request.serverType)}`
47
- }, unmarshalServerType);
48
- /**
49
- * Create a server. Create a new server in the targeted zone, specifying its
50
- * configuration including name and type.
51
- *
52
- * @param request - The request {@link CreateServerRequest}
53
- * @returns A Promise of Server
54
- */
55
- this.createServer = request => this.client.fetch({
56
- body: JSON.stringify(marshalCreateServerRequest(request, this.client.settings)),
57
- headers: jsonContentHeaders,
58
- method: 'POST',
59
- path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers`
60
- }, unmarshalServer);
61
- 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) {
62
68
  if (request === void 0) {
63
69
  request = {};
64
70
  }
65
- return _this.client.fetch({
71
+ return _this2.client.fetch({
66
72
  method: 'GET',
67
- path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/servers`,
68
- 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])
69
75
  }, unmarshalListServersResponse);
70
76
  };
71
- /**
72
- * List all servers. List all servers in the specified zone. By default,
73
- * returned servers in the list are ordered by creation date in ascending
74
- * order, though this can be modified via the `order_by` field.
75
- *
76
- * @param request - The request {@link ListServersRequest}
77
- * @returns A Promise of ListServersResponse
78
- */
79
- 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) {
80
90
  if (request === void 0) {
81
91
  request = {};
82
92
  }
83
- return enrichForPagination('servers', _this.pageOfListServers, request);
93
+ return enrichForPagination('servers', _this3.pageOfListServers, request);
84
94
  };
85
- this.pageOfListOS = function (request) {
95
+ })();
96
+ pageOfListOS = (() => {
97
+ var _this4 = this;
98
+ return function (request) {
86
99
  if (request === void 0) {
87
100
  request = {};
88
101
  }
89
- return _this.client.fetch({
102
+ return _this4.client.fetch({
90
103
  method: 'GET',
91
- path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/os`,
92
- 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])
93
106
  }, unmarshalListOSResponse);
94
107
  };
95
- /**
96
- * List all Operating Systems (OS). List all Operating Systems (OS). The
97
- * response will include the total number of OS as well as their associated
98
- * IDs, names and labels.
99
- *
100
- * @param request - The request {@link ListOSRequest}
101
- * @returns A Promise of ListOSResponse
102
- */
103
- 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) {
104
121
  if (request === void 0) {
105
122
  request = {};
106
123
  }
107
- return enrichForPagination('os', _this.pageOfListOS, request);
124
+ return enrichForPagination('os', _this5.pageOfListOS, request);
108
125
  };
109
- /**
110
- * Get an Operating System (OS). Get an Operating System (OS). The response
111
- * will include the OS's unique ID as well as its name and label.
112
- *
113
- * @param request - The request {@link GetOSRequest}
114
- * @returns A Promise of OS
115
- */
116
- this.getOS = request => this.client.fetch({
117
- method: 'GET',
118
- path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/os/${validatePathParam('osId', request.osId)}`
119
- }, unmarshalOS);
120
- /**
121
- * Get a server. Retrieve information about an existing Apple silicon server,
122
- * specified by its server ID. Its full details, including name, status and IP
123
- * address, are returned in the response object.
124
- *
125
- * @param request - The request {@link GetServerRequest}
126
- * @returns A Promise of Server
127
- */
128
- this.getServer = request => this.client.fetch({
129
- method: 'GET',
130
- path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
131
- }, unmarshalServer);
132
- /**
133
- * Waits for {@link Server} to be in a final state.
134
- *
135
- * @param request - The request {@link GetServerRequest}
136
- * @param options - The waiting options
137
- * @returns A Promise of Server
138
- */
139
- this.waitForServer = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!SERVER_TRANSIENT_STATUSES.includes(res.status))), this.getServer, request, options);
140
- /**
141
- * Update a server. Update the parameters of an existing Apple silicon server,
142
- * specified by its server ID.
143
- *
144
- * @param request - The request {@link UpdateServerRequest}
145
- * @returns A Promise of Server
146
- */
147
- this.updateServer = request => this.client.fetch({
148
- body: JSON.stringify(marshalUpdateServerRequest(request, this.client.settings)),
149
- headers: jsonContentHeaders,
150
- method: 'PATCH',
151
- path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
152
- }, unmarshalServer);
153
- /**
154
- * Delete a server. Delete an existing Apple silicon server, specified by its
155
- * server ID. Deleting a server is permanent, and cannot be undone. Note that
156
- * the minimum allocation period for Apple silicon-as-a-service is 24 hours,
157
- * meaning you cannot delete your server prior to that.
158
- *
159
- * @param request - The request {@link DeleteServerRequest}
160
- */
161
- this.deleteServer = request => this.client.fetch({
162
- method: 'DELETE',
163
- path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
164
- });
165
- /**
166
- * Reboot a server. Reboot an existing Apple silicon server, specified by its
167
- * server ID.
168
- *
169
- * @param request - The request {@link RebootServerRequest}
170
- * @returns A Promise of Server
171
- */
172
- this.rebootServer = request => this.client.fetch({
173
- body: '{}',
174
- headers: jsonContentHeaders,
175
- method: 'POST',
176
- path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reboot`
177
- }, unmarshalServer);
178
- /**
179
- * Reinstall a server. Reinstall an existing Apple silicon server (specified
180
- * by its server ID) from a new image (OS). All the data on the disk is
181
- * deleted and all configuration is reset to the defailt configuration values
182
- * of the image (OS).
183
- *
184
- * @param request - The request {@link ReinstallServerRequest}
185
- * @returns A Promise of Server
186
- */
187
- this.reinstallServer = request => this.client.fetch({
188
- body: '{}',
189
- headers: jsonContentHeaders,
190
- method: 'POST',
191
- path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reinstall`
192
- }, unmarshalServer);
193
- }
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);
194
218
  }
195
- /** Lists the available zones of the API. */
196
- API.LOCALITIES = ['fr-par-3'];
197
219
 
198
220
  export { API };