@scaleway/sdk 0.1.0-beta.2 → 0.1.0-beta.20
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 +1 -1
- package/dist/api/account/v2/api.gen.js +2 -15
- package/dist/api/account/v2/marshalling.gen.js +0 -2
- package/dist/api/account/v2alpha1/api.gen.js +1 -11
- package/dist/api/account/v2alpha1/marshalling.gen.js +1 -6
- package/dist/api/applesilicon/v1alpha1/api.gen.js +3 -23
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +0 -13
- package/dist/api/baremetal/v1/api.gen.js +34 -46
- package/dist/api/baremetal/v1/api.utils.js +0 -5
- package/dist/api/baremetal/v1/content.gen.js +6 -3
- package/dist/api/baremetal/v1/index.js +1 -1
- package/dist/api/baremetal/v1/marshalling.gen.js +40 -43
- package/dist/api/container/v1beta1/api.gen.js +1 -47
- package/dist/api/container/v1beta1/content.gen.js +4 -4
- package/dist/api/container/v1beta1/marshalling.gen.js +3 -20
- package/dist/api/domain/v2beta1/api.gen.js +37 -68
- package/dist/api/domain/v2beta1/content.gen.js +4 -1
- package/dist/api/domain/v2beta1/index.js +1 -1
- package/dist/api/domain/v2beta1/marshalling.gen.js +89 -155
- package/dist/api/flexibleip/v1alpha1/api.gen.js +1 -18
- package/dist/api/flexibleip/v1alpha1/content.gen.js +1 -1
- package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +0 -7
- package/dist/api/function/v1beta1/api.gen.js +63 -53
- package/dist/api/function/v1beta1/content.gen.js +11 -5
- package/dist/api/function/v1beta1/index.js +1 -1
- package/dist/api/function/v1beta1/marshalling.gen.js +213 -27
- package/dist/api/iam/v1alpha1/api.gen.js +11 -58
- package/dist/api/iam/v1alpha1/marshalling.gen.js +10 -30
- package/dist/api/instance/v1/api.gen.js +8 -96
- package/dist/api/instance/v1/api.utils.js +24 -49
- package/dist/api/instance/v1/content.gen.js +7 -7
- package/dist/api/instance/v1/marshalling.gen.js +51 -148
- package/dist/api/iot/v1/api.gen.js +1 -52
- package/dist/api/iot/v1/marshalling.gen.js +1 -50
- package/dist/api/k8s/v1/api.gen.js +3 -35
- package/dist/api/k8s/v1/content.gen.js +2 -2
- package/dist/api/k8s/v1/marshalling.gen.js +2 -33
- package/dist/api/lb/v1/api.gen.js +2 -157
- package/dist/api/lb/v1/api.utils.js +0 -6
- package/dist/api/lb/v1/content.gen.js +3 -3
- package/dist/api/lb/v1/marshalling.gen.js +10 -83
- package/dist/api/marketplace/v1/api.gen.js +0 -10
- package/dist/api/marketplace/v1/marshalling.gen.js +1 -14
- package/dist/api/mnq/v1alpha1/api.gen.js +3 -21
- package/dist/api/mnq/v1alpha1/marshalling.gen.js +28 -21
- package/dist/api/rdb/v1/api.gen.js +29 -75
- package/dist/api/rdb/v1/content.gen.js +3 -3
- package/dist/api/rdb/v1/marshalling.gen.js +54 -89
- package/dist/api/redis/index.js +2 -0
- package/dist/api/redis/v1/api.gen.js +156 -0
- package/dist/api/redis/v1/content.gen.js +7 -0
- package/dist/api/redis/v1/index.js +2 -0
- package/dist/api/redis/v1/marshalling.gen.js +278 -0
- package/dist/api/redis/v1alpha1/api.gen.js +1 -32
- package/dist/api/redis/v1alpha1/content.gen.js +1 -1
- package/dist/api/redis/v1alpha1/marshalling.gen.js +5 -35
- package/dist/api/registry/v1/api.gen.js +1 -25
- package/dist/api/registry/v1/content.gen.js +2 -2
- package/dist/api/registry/v1/marshalling.gen.js +1 -7
- package/dist/api/tem/index.js +2 -0
- package/dist/api/tem/v1alpha1/api.gen.js +115 -0
- package/dist/api/tem/v1alpha1/index.js +1 -0
- package/dist/api/tem/v1alpha1/marshalling.gen.js +121 -0
- package/dist/api/test/v1/api.gen.js +3 -17
- package/dist/api/test/v1/marshalling.gen.js +1 -4
- package/dist/api/vpc/v1/api.gen.js +1 -12
- package/dist/api/vpc/v1/marshalling.gen.js +0 -2
- package/dist/api/vpcgw/v1/api.gen.js +1 -60
- package/dist/api/vpcgw/v1/content.gen.js +1 -1
- package/dist/api/vpcgw/v1/marshalling.gen.js +1 -22
- package/dist/helpers/json.js +5 -0
- package/dist/helpers/marshalling.js +7 -20
- package/dist/index.cjs +3133 -2360
- package/dist/index.d.ts +5101 -2636
- package/dist/index.js +8 -5
- package/dist/internal/async/interval-retrier.js +9 -16
- package/dist/internal/interceptors/request.js +1 -3
- package/dist/internal/logger/console-logger.js +0 -4
- package/dist/internal/logger/index.js +3 -5
- package/dist/internal/logger/level-resolver.js +0 -3
- package/dist/internal/validations/string-validation.js +8 -10
- package/dist/scw/api.js +1 -2
- package/dist/scw/auth.js +3 -5
- package/dist/scw/client-ini-factory.js +19 -14
- package/dist/scw/client-ini-profile.js +1 -1
- package/dist/scw/client-settings.js +14 -11
- package/dist/scw/client.js +3 -4
- package/dist/scw/constants.js +1 -1
- package/dist/scw/custom-marshalling.js +20 -22
- package/dist/scw/errors/error-parser.js +2 -21
- package/dist/scw/errors/non-standard/invalid-request-mapper.js +0 -2
- package/dist/scw/errors/non-standard/unknown-resource-mapper.js +2 -3
- package/dist/scw/errors/scw-error.js +5 -14
- package/dist/scw/errors/standard/already-exists-error.js +0 -3
- package/dist/scw/errors/standard/denied-authentication-error.js +1 -10
- package/dist/scw/errors/standard/invalid-arguments-error.js +1 -10
- package/dist/scw/errors/standard/out-of-stock-error.js +0 -3
- package/dist/scw/errors/standard/permissions-denied-error.js +1 -4
- package/dist/scw/errors/standard/precondition-failed-error.js +3 -26
- package/dist/scw/errors/standard/quotas-exceeded-error.js +1 -5
- package/dist/scw/errors/standard/resource-expired-error.js +0 -3
- package/dist/scw/errors/standard/resource-locked-error.js +0 -3
- package/dist/scw/errors/standard/resource-not-found-error.js +0 -3
- package/dist/scw/errors/standard/too-many-requests-error.js +3 -16
- package/dist/scw/errors/standard/transient-state-error.js +0 -3
- package/dist/scw/errors/types.js +0 -3
- package/dist/scw/fetch/build-fetcher.js +1 -9
- package/dist/scw/fetch/http-dumper.js +4 -7
- package/dist/scw/fetch/http-interceptors.js +3 -10
- package/dist/scw/fetch/resource-paginator.js +5 -11
- package/dist/scw/fetch/response-parser.js +13 -21
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
This SDK enables you to interact with Scaleway APIs.
|
|
4
4
|
|
|
5
5
|
**🔗 Important links:**
|
|
6
|
-
* Reference documentation
|
|
6
|
+
* [Reference documentation](https://scaleway.github.io/scaleway-sdk-js)
|
|
7
7
|
* [Example projects](https://github.com/scaleway/scaleway-sdk-js/tree/master/examples)
|
|
8
8
|
* [Developers website](https://developers.scaleway.com) (API documentation)
|
|
9
9
|
|
|
@@ -7,73 +7,61 @@ import { marshalCreateProjectRequest, unmarshalProject, unmarshalListProjectsRes
|
|
|
7
7
|
const jsonContentHeaders = {
|
|
8
8
|
'Content-Type': 'application/json; charset=utf-8'
|
|
9
9
|
};
|
|
10
|
+
|
|
10
11
|
/**
|
|
11
12
|
* Account API.
|
|
12
13
|
*
|
|
13
14
|
* This API allows you to manage projects.
|
|
14
15
|
*/
|
|
15
|
-
|
|
16
16
|
class AccountV2GenAPI extends API {
|
|
17
17
|
constructor() {
|
|
18
18
|
var _this;
|
|
19
|
-
|
|
20
19
|
super(...arguments);
|
|
21
20
|
_this = this;
|
|
22
|
-
|
|
23
21
|
this.createProject = request => this.client.fetch({
|
|
24
22
|
body: JSON.stringify(marshalCreateProjectRequest(request, this.client.settings)),
|
|
25
23
|
headers: jsonContentHeaders,
|
|
26
24
|
method: 'POST',
|
|
27
25
|
path: `/account/v2/projects`
|
|
28
26
|
}, unmarshalProject);
|
|
29
|
-
|
|
30
27
|
this.pageOfListProjects = function (request) {
|
|
31
28
|
if (request === void 0) {
|
|
32
29
|
request = {};
|
|
33
30
|
}
|
|
34
|
-
|
|
35
31
|
return _this.client.fetch({
|
|
36
32
|
method: 'GET',
|
|
37
33
|
path: `/account/v2/projects`,
|
|
38
|
-
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])
|
|
34
|
+
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])
|
|
39
35
|
}, unmarshalListProjectsResponse);
|
|
40
36
|
};
|
|
41
|
-
|
|
42
37
|
this.listProjects = function (request) {
|
|
43
38
|
if (request === void 0) {
|
|
44
39
|
request = {};
|
|
45
40
|
}
|
|
46
|
-
|
|
47
41
|
return enrichForPagination('projects', _this.pageOfListProjects, request);
|
|
48
42
|
};
|
|
49
|
-
|
|
50
43
|
this.getProject = function (request) {
|
|
51
44
|
if (request === void 0) {
|
|
52
45
|
request = {};
|
|
53
46
|
}
|
|
54
|
-
|
|
55
47
|
return _this.client.fetch({
|
|
56
48
|
method: 'GET',
|
|
57
49
|
path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? _this.client.settings.defaultProjectId)}`
|
|
58
50
|
}, unmarshalProject);
|
|
59
51
|
};
|
|
60
|
-
|
|
61
52
|
this.deleteProject = function (request) {
|
|
62
53
|
if (request === void 0) {
|
|
63
54
|
request = {};
|
|
64
55
|
}
|
|
65
|
-
|
|
66
56
|
return _this.client.fetch({
|
|
67
57
|
method: 'DELETE',
|
|
68
58
|
path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? _this.client.settings.defaultProjectId)}`
|
|
69
59
|
});
|
|
70
60
|
};
|
|
71
|
-
|
|
72
61
|
this.updateProject = function (request) {
|
|
73
62
|
if (request === void 0) {
|
|
74
63
|
request = {};
|
|
75
64
|
}
|
|
76
|
-
|
|
77
65
|
return _this.client.fetch({
|
|
78
66
|
body: JSON.stringify(marshalUpdateProjectRequest(request, _this.client.settings)),
|
|
79
67
|
headers: jsonContentHeaders,
|
|
@@ -82,7 +70,6 @@ class AccountV2GenAPI extends API {
|
|
|
82
70
|
}, unmarshalProject);
|
|
83
71
|
};
|
|
84
72
|
}
|
|
85
|
-
|
|
86
73
|
}
|
|
87
74
|
|
|
88
75
|
export { AccountV2GenAPI };
|
|
@@ -6,7 +6,6 @@ const unmarshalProject = data => {
|
|
|
6
6
|
if (!isJSONObject(data)) {
|
|
7
7
|
throw new TypeError(`Unmarshalling the type 'Project' failed as data isn't a dictionary.`);
|
|
8
8
|
}
|
|
9
|
-
|
|
10
9
|
return {
|
|
11
10
|
createdAt: unmarshalDate(data.created_at),
|
|
12
11
|
description: data.description,
|
|
@@ -20,7 +19,6 @@ const unmarshalListProjectsResponse = data => {
|
|
|
20
19
|
if (!isJSONObject(data)) {
|
|
21
20
|
throw new TypeError(`Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary.`);
|
|
22
21
|
}
|
|
23
|
-
|
|
24
22
|
return {
|
|
25
23
|
projects: unmarshalArrayOfObject(data.projects, unmarshalProject),
|
|
26
24
|
totalCount: data.total_count
|
|
@@ -7,60 +7,50 @@ import { unmarshalListSSHKeysResponse, marshalCreateSSHKeyRequest, unmarshalSSHK
|
|
|
7
7
|
const jsonContentHeaders = {
|
|
8
8
|
'Content-Type': 'application/json; charset=utf-8'
|
|
9
9
|
};
|
|
10
|
-
/** Account API. */
|
|
11
10
|
|
|
11
|
+
/** Account API. */
|
|
12
12
|
class AccountV2Alpha1GenAPI extends API {
|
|
13
13
|
constructor() {
|
|
14
14
|
var _this;
|
|
15
|
-
|
|
16
15
|
super(...arguments);
|
|
17
16
|
_this = this;
|
|
18
|
-
|
|
19
17
|
this.pageOfListSSHKeys = function (request) {
|
|
20
18
|
if (request === void 0) {
|
|
21
19
|
request = {};
|
|
22
20
|
}
|
|
23
|
-
|
|
24
21
|
return _this.client.fetch({
|
|
25
22
|
method: 'GET',
|
|
26
23
|
path: `/account/v2alpha1/ssh-keys`,
|
|
27
24
|
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_id', request.projectId ?? _this.client.settings.defaultProjectId])
|
|
28
25
|
}, unmarshalListSSHKeysResponse);
|
|
29
26
|
};
|
|
30
|
-
|
|
31
27
|
this.listSSHKeys = function (request) {
|
|
32
28
|
if (request === void 0) {
|
|
33
29
|
request = {};
|
|
34
30
|
}
|
|
35
|
-
|
|
36
31
|
return enrichForPagination('sshKeys', _this.pageOfListSSHKeys, request);
|
|
37
32
|
};
|
|
38
|
-
|
|
39
33
|
this.createSSHKey = request => this.client.fetch({
|
|
40
34
|
body: JSON.stringify(marshalCreateSSHKeyRequest(request, this.client.settings)),
|
|
41
35
|
headers: jsonContentHeaders,
|
|
42
36
|
method: 'POST',
|
|
43
37
|
path: `/account/v2alpha1/ssh-keys`
|
|
44
38
|
}, unmarshalSSHKey);
|
|
45
|
-
|
|
46
39
|
this.getSSHKey = request => this.client.fetch({
|
|
47
40
|
method: 'GET',
|
|
48
41
|
path: `/account/v2alpha1/ssh-key/${validatePathParam('sshKeyId', request.sshKeyId)}`
|
|
49
42
|
}, unmarshalSSHKey);
|
|
50
|
-
|
|
51
43
|
this.updateSSHKey = request => this.client.fetch({
|
|
52
44
|
body: JSON.stringify(marshalUpdateSSHKeyRequest(request, this.client.settings)),
|
|
53
45
|
headers: jsonContentHeaders,
|
|
54
46
|
method: 'PATCH',
|
|
55
47
|
path: `/account/v2alpha1/ssh-key/${validatePathParam('sshKeyId', request.sshKeyId)}`
|
|
56
48
|
}, unmarshalSSHKey);
|
|
57
|
-
|
|
58
49
|
this.deleteSSHKey = request => this.client.fetch({
|
|
59
50
|
method: 'DELETE',
|
|
60
51
|
path: `/account/v2alpha1/ssh-key/${validatePathParam('sshKeyId', request.sshKeyId)}`
|
|
61
52
|
});
|
|
62
53
|
}
|
|
63
|
-
|
|
64
54
|
}
|
|
65
55
|
|
|
66
56
|
export { AccountV2Alpha1GenAPI };
|
|
@@ -1,25 +1,21 @@
|
|
|
1
1
|
import { isJSONObject } from '../../../helpers/json.js';
|
|
2
|
-
import {
|
|
2
|
+
import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from '../../../helpers/marshalling.js';
|
|
3
3
|
|
|
4
4
|
// This file was automatically generated. DO NOT EDIT.
|
|
5
|
-
|
|
6
5
|
const unmarshalSSHKeyCreationInfo = data => {
|
|
7
6
|
if (!isJSONObject(data)) {
|
|
8
7
|
throw new TypeError(`Unmarshalling the type 'SSHKeyCreationInfo' failed as data isn't a dictionary.`);
|
|
9
8
|
}
|
|
10
|
-
|
|
11
9
|
return {
|
|
12
10
|
address: data.address,
|
|
13
11
|
countryCode: data.country_code,
|
|
14
12
|
userAgent: data.user_agent
|
|
15
13
|
};
|
|
16
14
|
};
|
|
17
|
-
|
|
18
15
|
const unmarshalSSHKey = data => {
|
|
19
16
|
if (!isJSONObject(data)) {
|
|
20
17
|
throw new TypeError(`Unmarshalling the type 'SSHKey' failed as data isn't a dictionary.`);
|
|
21
18
|
}
|
|
22
|
-
|
|
23
19
|
return {
|
|
24
20
|
createdAt: unmarshalDate(data.created_at),
|
|
25
21
|
creationInfo: data.creation_info ? unmarshalSSHKeyCreationInfo(data.creation_info) : undefined,
|
|
@@ -36,7 +32,6 @@ const unmarshalListSSHKeysResponse = data => {
|
|
|
36
32
|
if (!isJSONObject(data)) {
|
|
37
33
|
throw new TypeError(`Unmarshalling the type 'ListSSHKeysResponse' failed as data isn't a dictionary.`);
|
|
38
34
|
}
|
|
39
|
-
|
|
40
35
|
return {
|
|
41
36
|
sshKeys: unmarshalArrayOfObject(data.ssh_keys, unmarshalSSHKey),
|
|
42
37
|
totalCount: data.total_count
|
|
@@ -9,6 +9,7 @@ import { unmarshalListServerTypesResponse, unmarshalServerType, marshalCreateSer
|
|
|
9
9
|
const jsonContentHeaders = {
|
|
10
10
|
'Content-Type': 'application/json; charset=utf-8'
|
|
11
11
|
};
|
|
12
|
+
|
|
12
13
|
/**
|
|
13
14
|
* Apple silicon.
|
|
14
15
|
*
|
|
@@ -22,115 +23,95 @@ const jsonContentHeaders = {
|
|
|
22
23
|
* Get set to explore, learn and build on a dedicated Mac mini M1 with more
|
|
23
24
|
* performance and speed than you ever thought possible.
|
|
24
25
|
*
|
|
25
|
-
* _Apple silicon as a Service comes with a minimum allocation period of 24
|
|
26
|
+
* _Apple silicon as a Service comes with a minimum allocation period of 24
|
|
27
|
+
* hours_*.
|
|
26
28
|
*
|
|
27
29
|
* Mac mini and macOS are trademarks of Apple Inc., registered in the U.S. and
|
|
28
30
|
* other countries and regions. IOS is a trademark or registered trademark of
|
|
29
31
|
* Cisco in the U.S. and other countries and is used by Apple under license.
|
|
30
32
|
* Scaleway is not affiliated with Apple Inc.
|
|
31
33
|
*/
|
|
32
|
-
|
|
33
34
|
class ApplesiliconV1Alpha1GenAPI extends API {
|
|
34
35
|
constructor() {
|
|
35
36
|
var _this;
|
|
36
|
-
|
|
37
37
|
super(...arguments);
|
|
38
38
|
_this = this;
|
|
39
|
-
|
|
40
39
|
this.listServerTypes = function (request) {
|
|
41
40
|
if (request === void 0) {
|
|
42
41
|
request = {};
|
|
43
42
|
}
|
|
44
|
-
|
|
45
43
|
return _this.client.fetch({
|
|
46
44
|
method: 'GET',
|
|
47
45
|
path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/server-types`
|
|
48
46
|
}, unmarshalListServerTypesResponse);
|
|
49
47
|
};
|
|
50
|
-
|
|
51
48
|
this.getServerType = request => this.client.fetch({
|
|
52
49
|
method: 'GET',
|
|
53
50
|
path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/server-type/${validatePathParam('serverType', request.serverType)}`
|
|
54
51
|
}, unmarshalServerType);
|
|
55
|
-
|
|
56
52
|
this.createServer = request => this.client.fetch({
|
|
57
53
|
body: JSON.stringify(marshalCreateServerRequest(request, this.client.settings)),
|
|
58
54
|
headers: jsonContentHeaders,
|
|
59
55
|
method: 'POST',
|
|
60
56
|
path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers`
|
|
61
57
|
}, unmarshalServer);
|
|
62
|
-
|
|
63
58
|
this.pageOfListServers = function (request) {
|
|
64
59
|
if (request === void 0) {
|
|
65
60
|
request = {};
|
|
66
61
|
}
|
|
67
|
-
|
|
68
62
|
return _this.client.fetch({
|
|
69
63
|
method: 'GET',
|
|
70
64
|
path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/servers`,
|
|
71
65
|
urlParams: urlParams(['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_id', request.projectId ?? _this.client.settings.defaultProjectId])
|
|
72
66
|
}, unmarshalListServersResponse);
|
|
73
67
|
};
|
|
74
|
-
|
|
75
68
|
this.listServers = function (request) {
|
|
76
69
|
if (request === void 0) {
|
|
77
70
|
request = {};
|
|
78
71
|
}
|
|
79
|
-
|
|
80
72
|
return enrichForPagination('servers', _this.pageOfListServers, request);
|
|
81
73
|
};
|
|
82
|
-
|
|
83
74
|
this.pageOfListOS = function (request) {
|
|
84
75
|
if (request === void 0) {
|
|
85
76
|
request = {};
|
|
86
77
|
}
|
|
87
|
-
|
|
88
78
|
return _this.client.fetch({
|
|
89
79
|
method: 'GET',
|
|
90
80
|
path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/os`,
|
|
91
81
|
urlParams: urlParams(['name', request.name], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['server_type', request.serverType])
|
|
92
82
|
}, unmarshalListOSResponse);
|
|
93
83
|
};
|
|
94
|
-
|
|
95
84
|
this.listOS = function (request) {
|
|
96
85
|
if (request === void 0) {
|
|
97
86
|
request = {};
|
|
98
87
|
}
|
|
99
|
-
|
|
100
88
|
return enrichForPagination('os', _this.pageOfListOS, request);
|
|
101
89
|
};
|
|
102
|
-
|
|
103
90
|
this.getOS = request => this.client.fetch({
|
|
104
91
|
method: 'GET',
|
|
105
92
|
path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/os/${validatePathParam('osId', request.osId)}`
|
|
106
93
|
}, unmarshalOS);
|
|
107
|
-
|
|
108
94
|
this.getServer = request => this.client.fetch({
|
|
109
95
|
method: 'GET',
|
|
110
96
|
path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
|
|
111
97
|
}, unmarshalServer);
|
|
112
|
-
|
|
113
98
|
this.waitForServer = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!SERVER_TRANSIENT_STATUSES.includes(res.status))), this.getServer, request, options);
|
|
114
|
-
|
|
115
99
|
this.updateServer = request => this.client.fetch({
|
|
116
100
|
body: JSON.stringify(marshalUpdateServerRequest(request, this.client.settings)),
|
|
117
101
|
headers: jsonContentHeaders,
|
|
118
102
|
method: 'PATCH',
|
|
119
103
|
path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
|
|
120
104
|
}, unmarshalServer);
|
|
121
|
-
|
|
122
105
|
this.deleteServer = request => this.client.fetch({
|
|
123
106
|
method: 'DELETE',
|
|
124
107
|
path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
|
|
125
108
|
});
|
|
126
|
-
|
|
127
109
|
this.rebootServer = request => this.client.fetch({
|
|
128
110
|
body: '{}',
|
|
129
111
|
headers: jsonContentHeaders,
|
|
130
112
|
method: 'POST',
|
|
131
113
|
path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reboot`
|
|
132
114
|
}, unmarshalServer);
|
|
133
|
-
|
|
134
115
|
this.reinstallServer = request => this.client.fetch({
|
|
135
116
|
body: '{}',
|
|
136
117
|
headers: jsonContentHeaders,
|
|
@@ -138,7 +119,6 @@ class ApplesiliconV1Alpha1GenAPI extends API {
|
|
|
138
119
|
path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reinstall`
|
|
139
120
|
}, unmarshalServer);
|
|
140
121
|
}
|
|
141
|
-
|
|
142
122
|
}
|
|
143
123
|
ApplesiliconV1Alpha1GenAPI.LOCALITIES = ['fr-par-3'];
|
|
144
124
|
|
|
@@ -3,45 +3,37 @@ import { isJSONObject } from '../../../helpers/json.js';
|
|
|
3
3
|
import { unmarshalDate, unmarshalArrayOfObject } from '../../../helpers/marshalling.js';
|
|
4
4
|
|
|
5
5
|
// This file was automatically generated. DO NOT EDIT.
|
|
6
|
-
|
|
7
6
|
const unmarshalServerTypeCPU = data => {
|
|
8
7
|
if (!isJSONObject(data)) {
|
|
9
8
|
throw new TypeError(`Unmarshalling the type 'ServerTypeCPU' failed as data isn't a dictionary.`);
|
|
10
9
|
}
|
|
11
|
-
|
|
12
10
|
return {
|
|
13
11
|
coreCount: data.core_count,
|
|
14
12
|
name: data.name
|
|
15
13
|
};
|
|
16
14
|
};
|
|
17
|
-
|
|
18
15
|
const unmarshalServerTypeDisk = data => {
|
|
19
16
|
if (!isJSONObject(data)) {
|
|
20
17
|
throw new TypeError(`Unmarshalling the type 'ServerTypeDisk' failed as data isn't a dictionary.`);
|
|
21
18
|
}
|
|
22
|
-
|
|
23
19
|
return {
|
|
24
20
|
capacity: data.capacity,
|
|
25
21
|
type: data.type
|
|
26
22
|
};
|
|
27
23
|
};
|
|
28
|
-
|
|
29
24
|
const unmarshalServerTypeMemory = data => {
|
|
30
25
|
if (!isJSONObject(data)) {
|
|
31
26
|
throw new TypeError(`Unmarshalling the type 'ServerTypeMemory' failed as data isn't a dictionary.`);
|
|
32
27
|
}
|
|
33
|
-
|
|
34
28
|
return {
|
|
35
29
|
capacity: data.capacity,
|
|
36
30
|
type: data.type
|
|
37
31
|
};
|
|
38
32
|
};
|
|
39
|
-
|
|
40
33
|
const unmarshalOS = data => {
|
|
41
34
|
if (!isJSONObject(data)) {
|
|
42
35
|
throw new TypeError(`Unmarshalling the type 'OS' failed as data isn't a dictionary.`);
|
|
43
36
|
}
|
|
44
|
-
|
|
45
37
|
return {
|
|
46
38
|
compatibleServerTypes: data.compatible_server_types,
|
|
47
39
|
id: data.id,
|
|
@@ -54,7 +46,6 @@ const unmarshalServer = data => {
|
|
|
54
46
|
if (!isJSONObject(data)) {
|
|
55
47
|
throw new TypeError(`Unmarshalling the type 'Server' failed as data isn't a dictionary.`);
|
|
56
48
|
}
|
|
57
|
-
|
|
58
49
|
return {
|
|
59
50
|
createdAt: unmarshalDate(data.created_at),
|
|
60
51
|
deletableAt: unmarshalDate(data.deletable_at),
|
|
@@ -74,7 +65,6 @@ const unmarshalServerType = data => {
|
|
|
74
65
|
if (!isJSONObject(data)) {
|
|
75
66
|
throw new TypeError(`Unmarshalling the type 'ServerType' failed as data isn't a dictionary.`);
|
|
76
67
|
}
|
|
77
|
-
|
|
78
68
|
return {
|
|
79
69
|
cpu: data.cpu ? unmarshalServerTypeCPU(data.cpu) : undefined,
|
|
80
70
|
disk: data.disk ? unmarshalServerTypeDisk(data.disk) : undefined,
|
|
@@ -88,7 +78,6 @@ const unmarshalListOSResponse = data => {
|
|
|
88
78
|
if (!isJSONObject(data)) {
|
|
89
79
|
throw new TypeError(`Unmarshalling the type 'ListOSResponse' failed as data isn't a dictionary.`);
|
|
90
80
|
}
|
|
91
|
-
|
|
92
81
|
return {
|
|
93
82
|
os: unmarshalArrayOfObject(data.os, unmarshalOS),
|
|
94
83
|
totalCount: data.total_count
|
|
@@ -98,7 +87,6 @@ const unmarshalListServerTypesResponse = data => {
|
|
|
98
87
|
if (!isJSONObject(data)) {
|
|
99
88
|
throw new TypeError(`Unmarshalling the type 'ListServerTypesResponse' failed as data isn't a dictionary.`);
|
|
100
89
|
}
|
|
101
|
-
|
|
102
90
|
return {
|
|
103
91
|
serverTypes: unmarshalArrayOfObject(data.server_types, unmarshalServerType)
|
|
104
92
|
};
|
|
@@ -107,7 +95,6 @@ const unmarshalListServersResponse = data => {
|
|
|
107
95
|
if (!isJSONObject(data)) {
|
|
108
96
|
throw new TypeError(`Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`);
|
|
109
97
|
}
|
|
110
|
-
|
|
111
98
|
return {
|
|
112
99
|
servers: unmarshalArrayOfObject(data.servers, unmarshalServer),
|
|
113
100
|
totalCount: data.total_count
|