@scaleway/sdk 1.34.0 → 2.0.0-alpha.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.
- package/dist/api/account/v2/api.gen.js +1 -1
- package/dist/api/account/v3/api.gen.js +1 -1
- package/dist/api/applesilicon/v1alpha1/api.gen.js +1 -1
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +26 -26
- package/dist/api/baremetal/v1/api.gen.js +6 -6
- package/dist/api/baremetal/v1/marshalling.gen.js +109 -120
- package/dist/api/billing/v2alpha1/api.gen.js +3 -3
- package/dist/api/billing/v2alpha1/marshalling.gen.js +9 -9
- package/dist/api/cockpit/v1beta1/api.gen.js +47 -71
- package/dist/api/cockpit/v1beta1/marshalling.gen.js +43 -63
- package/dist/api/container/v1beta1/api.gen.js +11 -11
- package/dist/api/container/v1beta1/marshalling.gen.js +76 -102
- package/dist/api/document_db/v1beta1/api.gen.js +6 -6
- package/dist/api/document_db/v1beta1/marshalling.gen.js +169 -225
- package/dist/api/domain/v2beta1/api.gen.js +45 -38
- package/dist/api/domain/v2beta1/index.gen.js +2 -0
- package/dist/api/domain/v2beta1/marshalling.gen.js +361 -575
- package/dist/api/flexibleip/v1alpha1/api.gen.js +15 -7
- package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +2 -2
- package/dist/api/function/v1beta1/api.gen.js +11 -11
- package/dist/api/function/v1beta1/marshalling.gen.js +103 -129
- package/dist/api/iam/v1alpha1/api.gen.js +64 -32
- package/dist/api/iam/v1alpha1/marshalling.gen.js +68 -78
- package/dist/api/instance/v1/api.gen.js +1 -1
- package/dist/api/instance/v1/marshalling.gen.js +397 -602
- package/dist/api/iot/v1/api.gen.js +35 -27
- package/dist/api/iot/v1/marshalling.gen.js +111 -162
- package/dist/api/ipfs/v1alpha1/api.gen.js +2 -2
- package/dist/api/ipfs/v1alpha1/marshalling.gen.js +23 -27
- package/dist/api/k8s/v1/api.gen.js +3 -3
- package/dist/api/k8s/v1/marshalling.gen.js +109 -194
- package/dist/api/lb/v1/api.gen.js +583 -552
- package/dist/api/lb/v1/marshalling.gen.js +245 -361
- package/dist/api/marketplace/v1/marshalling.gen.js +11 -11
- package/dist/api/marketplace/v2/api.gen.js +6 -6
- package/dist/api/mnq/v1alpha1/api.gen.js +21 -14
- package/dist/api/mnq/v1alpha1/marshalling.gen.js +35 -40
- package/dist/api/rdb/v1/api.gen.js +7 -7
- package/dist/api/rdb/v1/marshalling.gen.js +184 -240
- package/dist/api/redis/v1/api.gen.js +1 -1
- package/dist/api/redis/v1/marshalling.gen.js +73 -97
- package/dist/api/registry/v1/api.gen.js +3 -3
- package/dist/api/registry/v1/marshalling.gen.js +5 -7
- package/dist/api/secret/v1alpha1/api.gen.js +2 -2
- package/dist/api/secret/v1alpha1/marshalling.gen.js +20 -30
- package/dist/api/tem/v1alpha1/api.gen.js +1 -1
- package/dist/api/tem/v1alpha1/marshalling.gen.js +52 -61
- package/dist/api/test/v1/api.gen.js +8 -25
- package/dist/api/test/v1/marshalling.gen.js +5 -7
- package/dist/api/vpc/v1/api.gen.js +1 -1
- package/dist/api/vpc/v2/api.gen.js +2 -2
- package/dist/api/vpc/v2/marshalling.gen.js +3 -5
- package/dist/api/vpcgw/v1/api.gen.js +6 -6
- package/dist/api/vpcgw/v1/marshalling.gen.js +36 -49
- package/dist/api/webhosting/v1alpha1/api.gen.js +56 -4
- package/dist/api/webhosting/v1alpha1/index.gen.js +1 -1
- package/dist/api/webhosting/v1alpha1/marshalling.gen.js +69 -42
- package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +10 -1
- package/dist/index.cjs +3127 -3989
- package/dist/index.d.ts +9658 -12221
- package/package.json +2 -2
|
@@ -47,7 +47,7 @@ class API extends API$1 {
|
|
|
47
47
|
return _this2.client.fetch({
|
|
48
48
|
method: 'GET',
|
|
49
49
|
path: `/account/v2/projects`,
|
|
50
|
-
urlParams: urlParams(['name', request.name], ['order_by', request.orderBy
|
|
50
|
+
urlParams: urlParams(['name', request.name], ['order_by', request.orderBy], ['organization_id', request.organizationId ?? _this2.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this2.client.settings.defaultPageSize], ['project_ids', request.projectIds])
|
|
51
51
|
}, unmarshalListProjectsResponse);
|
|
52
52
|
};
|
|
53
53
|
})();
|
|
@@ -37,7 +37,7 @@ class ProjectAPI extends API$1 {
|
|
|
37
37
|
return _this.client.fetch({
|
|
38
38
|
method: 'GET',
|
|
39
39
|
path: `/account/v3/projects`,
|
|
40
|
-
urlParams: urlParams(['name', request.name], ['order_by', request.orderBy
|
|
40
|
+
urlParams: urlParams(['name', request.name], ['order_by', request.orderBy], ['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_ids', request.projectIds])
|
|
41
41
|
}, unmarshalListProjectsResponse);
|
|
42
42
|
};
|
|
43
43
|
})();
|
|
@@ -71,7 +71,7 @@ class API extends API$1 {
|
|
|
71
71
|
return _this2.client.fetch({
|
|
72
72
|
method: 'GET',
|
|
73
73
|
path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? _this2.client.settings.defaultZone)}/servers`,
|
|
74
|
-
urlParams: urlParams(['order_by', request.orderBy
|
|
74
|
+
urlParams: urlParams(['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this2.client.settings.defaultPageSize], ['project_id', request.projectId])
|
|
75
75
|
}, unmarshalListServersResponse);
|
|
76
76
|
};
|
|
77
77
|
})();
|
|
@@ -4,45 +4,58 @@ import { unmarshalDate, unmarshalArrayOfObject } from '../../../helpers/marshall
|
|
|
4
4
|
|
|
5
5
|
// This file was automatically generated. DO NOT EDIT.
|
|
6
6
|
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
7
|
-
const
|
|
7
|
+
const unmarshalOS = data => {
|
|
8
8
|
if (!isJSONObject(data)) {
|
|
9
|
-
throw new TypeError(`Unmarshalling the type '
|
|
9
|
+
throw new TypeError(`Unmarshalling the type 'OS' failed as data isn't a dictionary.`);
|
|
10
10
|
}
|
|
11
11
|
return {
|
|
12
|
-
|
|
12
|
+
compatibleServerTypes: data.compatible_server_types,
|
|
13
|
+
id: data.id,
|
|
14
|
+
imageUrl: data.image_url,
|
|
15
|
+
label: data.label,
|
|
13
16
|
name: data.name
|
|
14
17
|
};
|
|
15
18
|
};
|
|
16
|
-
const
|
|
19
|
+
const unmarshalServerTypeMemory = data => {
|
|
17
20
|
if (!isJSONObject(data)) {
|
|
18
|
-
throw new TypeError(`Unmarshalling the type '
|
|
21
|
+
throw new TypeError(`Unmarshalling the type 'ServerTypeMemory' failed as data isn't a dictionary.`);
|
|
19
22
|
}
|
|
20
23
|
return {
|
|
21
24
|
capacity: data.capacity,
|
|
22
25
|
type: data.type
|
|
23
26
|
};
|
|
24
27
|
};
|
|
25
|
-
const
|
|
28
|
+
const unmarshalServerTypeDisk = data => {
|
|
26
29
|
if (!isJSONObject(data)) {
|
|
27
|
-
throw new TypeError(`Unmarshalling the type '
|
|
30
|
+
throw new TypeError(`Unmarshalling the type 'ServerTypeDisk' failed as data isn't a dictionary.`);
|
|
28
31
|
}
|
|
29
32
|
return {
|
|
30
33
|
capacity: data.capacity,
|
|
31
34
|
type: data.type
|
|
32
35
|
};
|
|
33
36
|
};
|
|
34
|
-
const
|
|
37
|
+
const unmarshalServerTypeCPU = data => {
|
|
35
38
|
if (!isJSONObject(data)) {
|
|
36
|
-
throw new TypeError(`Unmarshalling the type '
|
|
39
|
+
throw new TypeError(`Unmarshalling the type 'ServerTypeCPU' failed as data isn't a dictionary.`);
|
|
37
40
|
}
|
|
38
41
|
return {
|
|
39
|
-
|
|
40
|
-
id: data.id,
|
|
41
|
-
imageUrl: data.image_url,
|
|
42
|
-
label: data.label,
|
|
42
|
+
coreCount: data.core_count,
|
|
43
43
|
name: data.name
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
|
+
const unmarshalServerType = data => {
|
|
47
|
+
if (!isJSONObject(data)) {
|
|
48
|
+
throw new TypeError(`Unmarshalling the type 'ServerType' failed as data isn't a dictionary.`);
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
cpu: unmarshalServerTypeCPU(data.cpu),
|
|
52
|
+
disk: unmarshalServerTypeDisk(data.disk),
|
|
53
|
+
memory: unmarshalServerTypeMemory(data.memory),
|
|
54
|
+
minimumLeaseDuration: data.minimum_lease_duration ? data.minimum_lease_duration : undefined,
|
|
55
|
+
name: data.name,
|
|
56
|
+
stock: data.stock
|
|
57
|
+
};
|
|
58
|
+
};
|
|
46
59
|
const unmarshalServer = data => {
|
|
47
60
|
if (!isJSONObject(data)) {
|
|
48
61
|
throw new TypeError(`Unmarshalling the type 'Server' failed as data isn't a dictionary.`);
|
|
@@ -62,19 +75,6 @@ const unmarshalServer = data => {
|
|
|
62
75
|
zone: data.zone
|
|
63
76
|
};
|
|
64
77
|
};
|
|
65
|
-
const unmarshalServerType = data => {
|
|
66
|
-
if (!isJSONObject(data)) {
|
|
67
|
-
throw new TypeError(`Unmarshalling the type 'ServerType' failed as data isn't a dictionary.`);
|
|
68
|
-
}
|
|
69
|
-
return {
|
|
70
|
-
cpu: data.cpu ? unmarshalServerTypeCPU(data.cpu) : undefined,
|
|
71
|
-
disk: data.disk ? unmarshalServerTypeDisk(data.disk) : undefined,
|
|
72
|
-
memory: data.memory ? unmarshalServerTypeMemory(data.memory) : undefined,
|
|
73
|
-
minimumLeaseDuration: data.minimum_lease_duration,
|
|
74
|
-
name: data.name,
|
|
75
|
-
stock: data.stock
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
78
|
const unmarshalListOSResponse = data => {
|
|
79
79
|
if (!isJSONObject(data)) {
|
|
80
80
|
throw new TypeError(`Unmarshalling the type 'ListOSResponse' failed as data isn't a dictionary.`);
|
|
@@ -14,7 +14,7 @@ const jsonContentHeaders = {
|
|
|
14
14
|
/**
|
|
15
15
|
* Elastic Metal API.
|
|
16
16
|
*
|
|
17
|
-
* This API allows to manage your Elastic Metal server.
|
|
17
|
+
* This API allows to manage your Elastic Metal server.
|
|
18
18
|
*/
|
|
19
19
|
class API extends API$1 {
|
|
20
20
|
/** Lists the available zones of the API. */
|
|
@@ -28,7 +28,7 @@ class API extends API$1 {
|
|
|
28
28
|
return _this.client.fetch({
|
|
29
29
|
method: 'GET',
|
|
30
30
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/servers`,
|
|
31
|
-
urlParams: urlParams(['name', request.name], ['option_id', request.optionId], ['order_by', request.orderBy
|
|
31
|
+
urlParams: urlParams(['name', request.name], ['option_id', request.optionId], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId], ['status', request.status], ['tags', request.tags])
|
|
32
32
|
}, unmarshalListServersResponse);
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
@@ -182,7 +182,7 @@ class API extends API$1 {
|
|
|
182
182
|
pageOfListServerEvents = request => this.client.fetch({
|
|
183
183
|
method: 'GET',
|
|
184
184
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/events`,
|
|
185
|
-
urlParams: urlParams(['order_by', request.orderBy
|
|
185
|
+
urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
|
|
186
186
|
}, unmarshalListServerEventsResponse);
|
|
187
187
|
|
|
188
188
|
/**
|
|
@@ -289,7 +289,7 @@ class API extends API$1 {
|
|
|
289
289
|
return _this3.client.fetch({
|
|
290
290
|
method: 'GET',
|
|
291
291
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? _this3.client.settings.defaultZone)}/offers`,
|
|
292
|
-
urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize], ['subscription_period', request.subscriptionPeriod
|
|
292
|
+
urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize], ['subscription_period', request.subscriptionPeriod])
|
|
293
293
|
}, unmarshalListOffersResponse);
|
|
294
294
|
};
|
|
295
295
|
})();
|
|
@@ -369,7 +369,7 @@ class API extends API$1 {
|
|
|
369
369
|
return _this7.client.fetch({
|
|
370
370
|
method: 'GET',
|
|
371
371
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? _this7.client.settings.defaultZone)}/settings`,
|
|
372
|
-
urlParams: urlParams(['order_by', request.orderBy
|
|
372
|
+
urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this7.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this7.client.settings.defaultProjectId])
|
|
373
373
|
}, unmarshalListSettingsResponse);
|
|
374
374
|
};
|
|
375
375
|
})();
|
|
@@ -486,7 +486,7 @@ class PrivateNetworkAPI extends API$1 {
|
|
|
486
486
|
return _this11.client.fetch({
|
|
487
487
|
method: 'GET',
|
|
488
488
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? _this11.client.settings.defaultZone)}/server-private-networks`,
|
|
489
|
-
urlParams: urlParams(['order_by', request.orderBy
|
|
489
|
+
urlParams: urlParams(['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this11.client.settings.defaultPageSize], ['private_network_id', request.privateNetworkId], ['project_id', request.projectId], ['server_id', request.serverId])
|
|
490
490
|
}, unmarshalListServerPrivateNetworksResponse);
|
|
491
491
|
};
|
|
492
492
|
})();
|
|
@@ -4,27 +4,6 @@ import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from '../../../he
|
|
|
4
4
|
|
|
5
5
|
// This file was automatically generated. DO NOT EDIT.
|
|
6
6
|
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
7
|
-
const unmarshalCPU = data => {
|
|
8
|
-
if (!isJSONObject(data)) {
|
|
9
|
-
throw new TypeError(`Unmarshalling the type 'CPU' failed as data isn't a dictionary.`);
|
|
10
|
-
}
|
|
11
|
-
return {
|
|
12
|
-
benchmark: data.benchmark,
|
|
13
|
-
coreCount: data.core_count,
|
|
14
|
-
frequency: data.frequency,
|
|
15
|
-
name: data.name,
|
|
16
|
-
threadCount: data.thread_count
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
const unmarshalDisk = data => {
|
|
20
|
-
if (!isJSONObject(data)) {
|
|
21
|
-
throw new TypeError(`Unmarshalling the type 'Disk' failed as data isn't a dictionary.`);
|
|
22
|
-
}
|
|
23
|
-
return {
|
|
24
|
-
capacity: data.capacity,
|
|
25
|
-
type: data.type
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
7
|
const unmarshalIP = data => {
|
|
29
8
|
if (!isJSONObject(data)) {
|
|
30
9
|
throw new TypeError(`Unmarshalling the type 'IP' failed as data isn't a dictionary.`);
|
|
@@ -38,25 +17,33 @@ const unmarshalIP = data => {
|
|
|
38
17
|
version: data.version
|
|
39
18
|
};
|
|
40
19
|
};
|
|
41
|
-
const
|
|
20
|
+
const unmarshalOSOSField = data => {
|
|
42
21
|
if (!isJSONObject(data)) {
|
|
43
|
-
throw new TypeError(`Unmarshalling the type '
|
|
22
|
+
throw new TypeError(`Unmarshalling the type 'OSOSField' failed as data isn't a dictionary.`);
|
|
44
23
|
}
|
|
45
24
|
return {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
type: data.type
|
|
25
|
+
defaultValue: data.default_value ? data.default_value : undefined,
|
|
26
|
+
editable: data.editable,
|
|
27
|
+
required: data.required
|
|
50
28
|
};
|
|
51
29
|
};
|
|
52
|
-
const
|
|
30
|
+
const unmarshalOS = data => {
|
|
53
31
|
if (!isJSONObject(data)) {
|
|
54
|
-
throw new TypeError(`Unmarshalling the type '
|
|
32
|
+
throw new TypeError(`Unmarshalling the type 'OS' failed as data isn't a dictionary.`);
|
|
55
33
|
}
|
|
56
34
|
return {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
35
|
+
allowed: data.allowed,
|
|
36
|
+
enabled: data.enabled,
|
|
37
|
+
id: data.id,
|
|
38
|
+
licenseRequired: data.license_required,
|
|
39
|
+
logoUrl: data.logo_url,
|
|
40
|
+
name: data.name,
|
|
41
|
+
password: unmarshalOSOSField(data.password),
|
|
42
|
+
servicePassword: unmarshalOSOSField(data.service_password),
|
|
43
|
+
serviceUser: unmarshalOSOSField(data.service_user),
|
|
44
|
+
ssh: unmarshalOSOSField(data.ssh),
|
|
45
|
+
user: unmarshalOSOSField(data.user),
|
|
46
|
+
version: data.version
|
|
60
47
|
};
|
|
61
48
|
};
|
|
62
49
|
const unmarshalOfferOptionOffer = data => {
|
|
@@ -68,21 +55,11 @@ const unmarshalOfferOptionOffer = data => {
|
|
|
68
55
|
id: data.id,
|
|
69
56
|
manageable: data.manageable,
|
|
70
57
|
name: data.name,
|
|
71
|
-
osId: data.os_id,
|
|
58
|
+
osId: data.os_id ? data.os_id : undefined,
|
|
72
59
|
price: data.price ? unmarshalMoney(data.price) : undefined,
|
|
73
60
|
subscriptionPeriod: data.subscription_period
|
|
74
61
|
};
|
|
75
62
|
};
|
|
76
|
-
const unmarshalPersistentMemory = data => {
|
|
77
|
-
if (!isJSONObject(data)) {
|
|
78
|
-
throw new TypeError(`Unmarshalling the type 'PersistentMemory' failed as data isn't a dictionary.`);
|
|
79
|
-
}
|
|
80
|
-
return {
|
|
81
|
-
capacity: data.capacity,
|
|
82
|
-
frequency: data.frequency,
|
|
83
|
-
type: data.type
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
63
|
const unmarshalRaidController = data => {
|
|
87
64
|
if (!isJSONObject(data)) {
|
|
88
65
|
throw new TypeError(`Unmarshalling the type 'RaidController' failed as data isn't a dictionary.`);
|
|
@@ -92,58 +69,46 @@ const unmarshalRaidController = data => {
|
|
|
92
69
|
raidLevel: data.raid_level
|
|
93
70
|
};
|
|
94
71
|
};
|
|
95
|
-
const
|
|
72
|
+
const unmarshalPersistentMemory = data => {
|
|
96
73
|
if (!isJSONObject(data)) {
|
|
97
|
-
throw new TypeError(`Unmarshalling the type '
|
|
74
|
+
throw new TypeError(`Unmarshalling the type 'PersistentMemory' failed as data isn't a dictionary.`);
|
|
98
75
|
}
|
|
99
76
|
return {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
serviceUser: data.service_user,
|
|
104
|
-
sshKeyIds: data.ssh_key_ids,
|
|
105
|
-
status: data.status,
|
|
106
|
-
user: data.user
|
|
77
|
+
capacity: data.capacity,
|
|
78
|
+
frequency: data.frequency,
|
|
79
|
+
type: data.type
|
|
107
80
|
};
|
|
108
81
|
};
|
|
109
|
-
const
|
|
82
|
+
const unmarshalMemory = data => {
|
|
110
83
|
if (!isJSONObject(data)) {
|
|
111
|
-
throw new TypeError(`Unmarshalling the type '
|
|
84
|
+
throw new TypeError(`Unmarshalling the type 'Memory' failed as data isn't a dictionary.`);
|
|
112
85
|
}
|
|
113
86
|
return {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
status: data.status
|
|
87
|
+
capacity: data.capacity,
|
|
88
|
+
frequency: data.frequency,
|
|
89
|
+
isEcc: data.is_ecc,
|
|
90
|
+
type: data.type
|
|
119
91
|
};
|
|
120
92
|
};
|
|
121
|
-
const
|
|
93
|
+
const unmarshalCPU = data => {
|
|
122
94
|
if (!isJSONObject(data)) {
|
|
123
|
-
throw new TypeError(`Unmarshalling the type '
|
|
95
|
+
throw new TypeError(`Unmarshalling the type 'CPU' failed as data isn't a dictionary.`);
|
|
124
96
|
}
|
|
125
97
|
return {
|
|
126
|
-
|
|
127
|
-
|
|
98
|
+
benchmark: data.benchmark,
|
|
99
|
+
coreCount: data.core_count,
|
|
100
|
+
frequency: data.frequency,
|
|
101
|
+
name: data.name,
|
|
102
|
+
threadCount: data.thread_count
|
|
128
103
|
};
|
|
129
104
|
};
|
|
130
|
-
const
|
|
105
|
+
const unmarshalDisk = data => {
|
|
131
106
|
if (!isJSONObject(data)) {
|
|
132
|
-
throw new TypeError(`Unmarshalling the type '
|
|
107
|
+
throw new TypeError(`Unmarshalling the type 'Disk' failed as data isn't a dictionary.`);
|
|
133
108
|
}
|
|
134
109
|
return {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
id: data.id,
|
|
138
|
-
licenseRequired: data.license_required,
|
|
139
|
-
logoUrl: data.logo_url,
|
|
140
|
-
name: data.name,
|
|
141
|
-
password: data.password ? unmarshalOSOSField(data.password) : undefined,
|
|
142
|
-
servicePassword: data.service_password ? unmarshalOSOSField(data.service_password) : undefined,
|
|
143
|
-
serviceUser: data.service_user ? unmarshalOSOSField(data.service_user) : undefined,
|
|
144
|
-
ssh: data.ssh ? unmarshalOSOSField(data.ssh) : undefined,
|
|
145
|
-
user: data.user ? unmarshalOSOSField(data.user) : undefined,
|
|
146
|
-
version: data.version
|
|
110
|
+
capacity: data.capacity,
|
|
111
|
+
type: data.type
|
|
147
112
|
};
|
|
148
113
|
};
|
|
149
114
|
const unmarshalOffer = data => {
|
|
@@ -185,56 +150,80 @@ const unmarshalOption = data => {
|
|
|
185
150
|
name: data.name
|
|
186
151
|
};
|
|
187
152
|
};
|
|
188
|
-
const
|
|
153
|
+
const unmarshalServerPrivateNetwork = data => {
|
|
189
154
|
if (!isJSONObject(data)) {
|
|
190
|
-
throw new TypeError(`Unmarshalling the type '
|
|
155
|
+
throw new TypeError(`Unmarshalling the type 'ServerPrivateNetwork' failed as data isn't a dictionary.`);
|
|
191
156
|
}
|
|
192
157
|
return {
|
|
193
|
-
bootType: data.boot_type,
|
|
194
158
|
createdAt: unmarshalDate(data.created_at),
|
|
195
|
-
description: data.description,
|
|
196
|
-
domain: data.domain,
|
|
197
159
|
id: data.id,
|
|
198
|
-
|
|
199
|
-
ips: unmarshalArrayOfObject(data.ips, unmarshalIP),
|
|
200
|
-
name: data.name,
|
|
201
|
-
offerId: data.offer_id,
|
|
202
|
-
offerName: data.offer_name,
|
|
203
|
-
options: unmarshalArrayOfObject(data.options, unmarshalServerOption),
|
|
204
|
-
organizationId: data.organization_id,
|
|
205
|
-
pingStatus: data.ping_status,
|
|
160
|
+
privateNetworkId: data.private_network_id,
|
|
206
161
|
projectId: data.project_id,
|
|
207
|
-
|
|
162
|
+
serverId: data.server_id,
|
|
208
163
|
status: data.status,
|
|
209
|
-
tags: data.tags,
|
|
210
164
|
updatedAt: unmarshalDate(data.updated_at),
|
|
211
|
-
|
|
165
|
+
vlan: data.vlan ? data.vlan : undefined
|
|
212
166
|
};
|
|
213
167
|
};
|
|
214
|
-
const
|
|
168
|
+
const unmarshalServerRescueServer = data => {
|
|
215
169
|
if (!isJSONObject(data)) {
|
|
216
|
-
throw new TypeError(`Unmarshalling the type '
|
|
170
|
+
throw new TypeError(`Unmarshalling the type 'ServerRescueServer' failed as data isn't a dictionary.`);
|
|
217
171
|
}
|
|
218
172
|
return {
|
|
219
|
-
|
|
220
|
-
|
|
173
|
+
password: data.password,
|
|
174
|
+
user: data.user
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
const unmarshalServerOption = data => {
|
|
178
|
+
if (!isJSONObject(data)) {
|
|
179
|
+
throw new TypeError(`Unmarshalling the type 'ServerOption' failed as data isn't a dictionary.`);
|
|
180
|
+
}
|
|
181
|
+
return {
|
|
182
|
+
expiresAt: unmarshalDate(data.expires_at),
|
|
221
183
|
id: data.id,
|
|
222
|
-
|
|
184
|
+
manageable: data.manageable,
|
|
185
|
+
name: data.name,
|
|
186
|
+
status: data.status
|
|
223
187
|
};
|
|
224
188
|
};
|
|
225
|
-
const
|
|
189
|
+
const unmarshalServerInstall = data => {
|
|
226
190
|
if (!isJSONObject(data)) {
|
|
227
|
-
throw new TypeError(`Unmarshalling the type '
|
|
191
|
+
throw new TypeError(`Unmarshalling the type 'ServerInstall' failed as data isn't a dictionary.`);
|
|
192
|
+
}
|
|
193
|
+
return {
|
|
194
|
+
hostname: data.hostname,
|
|
195
|
+
osId: data.os_id,
|
|
196
|
+
serviceUrl: data.service_url,
|
|
197
|
+
serviceUser: data.service_user,
|
|
198
|
+
sshKeyIds: data.ssh_key_ids,
|
|
199
|
+
status: data.status,
|
|
200
|
+
user: data.user
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
const unmarshalServer = data => {
|
|
204
|
+
if (!isJSONObject(data)) {
|
|
205
|
+
throw new TypeError(`Unmarshalling the type 'Server' failed as data isn't a dictionary.`);
|
|
228
206
|
}
|
|
229
207
|
return {
|
|
208
|
+
bootType: data.boot_type,
|
|
230
209
|
createdAt: unmarshalDate(data.created_at),
|
|
210
|
+
description: data.description,
|
|
211
|
+
domain: data.domain,
|
|
231
212
|
id: data.id,
|
|
232
|
-
|
|
213
|
+
install: unmarshalServerInstall(data.install),
|
|
214
|
+
ips: unmarshalArrayOfObject(data.ips, unmarshalIP),
|
|
215
|
+
name: data.name,
|
|
216
|
+
offerId: data.offer_id,
|
|
217
|
+
offerName: data.offer_name,
|
|
218
|
+
options: unmarshalArrayOfObject(data.options, unmarshalServerOption),
|
|
219
|
+
organizationId: data.organization_id,
|
|
220
|
+
pingStatus: data.ping_status,
|
|
233
221
|
projectId: data.project_id,
|
|
234
|
-
|
|
222
|
+
rescueServer: unmarshalServerRescueServer(data.rescue_server),
|
|
235
223
|
status: data.status,
|
|
224
|
+
tags: data.tags,
|
|
236
225
|
updatedAt: unmarshalDate(data.updated_at),
|
|
237
|
-
|
|
226
|
+
zone: data.zone
|
|
238
227
|
};
|
|
239
228
|
};
|
|
240
229
|
const unmarshalSetting = data => {
|
|
@@ -294,6 +283,17 @@ const unmarshalListOptionsResponse = data => {
|
|
|
294
283
|
totalCount: data.total_count
|
|
295
284
|
};
|
|
296
285
|
};
|
|
286
|
+
const unmarshalServerEvent = data => {
|
|
287
|
+
if (!isJSONObject(data)) {
|
|
288
|
+
throw new TypeError(`Unmarshalling the type 'ServerEvent' failed as data isn't a dictionary.`);
|
|
289
|
+
}
|
|
290
|
+
return {
|
|
291
|
+
action: data.action,
|
|
292
|
+
createdAt: unmarshalDate(data.created_at),
|
|
293
|
+
id: data.id,
|
|
294
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
297
|
const unmarshalListServerEventsResponse = data => {
|
|
298
298
|
if (!isJSONObject(data)) {
|
|
299
299
|
throw new TypeError(`Unmarshalling the type 'ListServerEventsResponse' failed as data isn't a dictionary.`);
|
|
@@ -338,33 +338,22 @@ const unmarshalSetServerPrivateNetworksResponse = data => {
|
|
|
338
338
|
serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork)
|
|
339
339
|
};
|
|
340
340
|
};
|
|
341
|
-
const marshalCreateServerRequestInstall = (request, defaults) => ({
|
|
342
|
-
hostname: request.hostname,
|
|
343
|
-
os_id: request.osId,
|
|
344
|
-
password: request.password,
|
|
345
|
-
service_password: request.servicePassword,
|
|
346
|
-
service_user: request.serviceUser,
|
|
347
|
-
ssh_key_ids: request.sshKeyIds,
|
|
348
|
-
user: request.user
|
|
349
|
-
});
|
|
350
341
|
const marshalAddOptionServerRequest = (request, defaults) => ({
|
|
351
342
|
expires_at: request.expiresAt
|
|
352
343
|
});
|
|
353
344
|
const marshalCreateServerRequest = (request, defaults) => ({
|
|
354
345
|
description: request.description,
|
|
355
|
-
install: request.install
|
|
346
|
+
install: request.install,
|
|
356
347
|
name: request.name,
|
|
357
348
|
offer_id: request.offerId,
|
|
358
349
|
option_ids: request.optionIds,
|
|
359
350
|
tags: request.tags,
|
|
360
351
|
...resolveOneOf([{
|
|
361
|
-
default: defaults.defaultProjectId,
|
|
362
|
-
param: 'project_id',
|
|
363
|
-
value: request.projectId
|
|
364
|
-
}, {
|
|
365
|
-
default: defaults.defaultOrganizationId,
|
|
366
352
|
param: 'organization_id',
|
|
367
353
|
value: request.organizationId
|
|
354
|
+
}, {
|
|
355
|
+
param: 'project_id',
|
|
356
|
+
value: request.projectId
|
|
368
357
|
}])
|
|
369
358
|
});
|
|
370
359
|
const marshalInstallServerRequest = (request, defaults) => ({
|
|
@@ -383,13 +372,13 @@ const marshalPrivateNetworkApiSetServerPrivateNetworksRequest = (request, defaul
|
|
|
383
372
|
private_network_ids: request.privateNetworkIds
|
|
384
373
|
});
|
|
385
374
|
const marshalRebootServerRequest = (request, defaults) => ({
|
|
386
|
-
boot_type: request.bootType
|
|
375
|
+
boot_type: request.bootType
|
|
387
376
|
});
|
|
388
377
|
const marshalStartBMCAccessRequest = (request, defaults) => ({
|
|
389
378
|
ip: request.ip
|
|
390
379
|
});
|
|
391
380
|
const marshalStartServerRequest = (request, defaults) => ({
|
|
392
|
-
boot_type: request.bootType
|
|
381
|
+
boot_type: request.bootType
|
|
393
382
|
});
|
|
394
383
|
const marshalUpdateIPRequest = (request, defaults) => ({
|
|
395
384
|
reverse: request.reverse
|
|
@@ -8,7 +8,7 @@ import { unmarshalGetConsumptionResponse, unmarshalListInvoicesResponse } from '
|
|
|
8
8
|
/**
|
|
9
9
|
* Billing API.
|
|
10
10
|
*
|
|
11
|
-
* This API allows you to query your consumption.
|
|
11
|
+
* This API allows you to query your consumption.
|
|
12
12
|
*/
|
|
13
13
|
class API extends API$1 {
|
|
14
14
|
/**
|
|
@@ -41,7 +41,7 @@ class API extends API$1 {
|
|
|
41
41
|
return _this2.client.fetch({
|
|
42
42
|
method: 'GET',
|
|
43
43
|
path: `/billing/v2alpha1/invoices`,
|
|
44
|
-
urlParams: urlParams(['invoice_type', request.invoiceType
|
|
44
|
+
urlParams: urlParams(['invoice_type', request.invoiceType], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this2.client.settings.defaultPageSize], ['started_after', request.startedAfter], ['started_before', request.startedBefore])
|
|
45
45
|
}, unmarshalListInvoicesResponse);
|
|
46
46
|
};
|
|
47
47
|
})();
|
|
@@ -72,7 +72,7 @@ class API extends API$1 {
|
|
|
72
72
|
downloadInvoice = request => this.client.fetch({
|
|
73
73
|
method: 'GET',
|
|
74
74
|
path: `/billing/v2alpha1/invoices/${validatePathParam('invoiceId', request.invoiceId)}/download`,
|
|
75
|
-
urlParams: urlParams(['dl', 1], ['file_type', request.fileType
|
|
75
|
+
urlParams: urlParams(['dl', 1], ['file_type', request.fileType]),
|
|
76
76
|
responseType: 'blob'
|
|
77
77
|
});
|
|
78
78
|
}
|
|
@@ -16,6 +16,15 @@ const unmarshalGetConsumptionResponseConsumption = data => {
|
|
|
16
16
|
value: data.value ? unmarshalMoney(data.value) : undefined
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
+
const unmarshalGetConsumptionResponse = data => {
|
|
20
|
+
if (!isJSONObject(data)) {
|
|
21
|
+
throw new TypeError(`Unmarshalling the type 'GetConsumptionResponse' failed as data isn't a dictionary.`);
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
consumptions: unmarshalArrayOfObject(data.consumptions, unmarshalGetConsumptionResponseConsumption),
|
|
25
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
26
|
+
};
|
|
27
|
+
};
|
|
19
28
|
const unmarshalInvoice = data => {
|
|
20
29
|
if (!isJSONObject(data)) {
|
|
21
30
|
throw new TypeError(`Unmarshalling the type 'Invoice' failed as data isn't a dictionary.`);
|
|
@@ -31,15 +40,6 @@ const unmarshalInvoice = data => {
|
|
|
31
40
|
totalUntaxed: data.total_untaxed ? unmarshalMoney(data.total_untaxed) : undefined
|
|
32
41
|
};
|
|
33
42
|
};
|
|
34
|
-
const unmarshalGetConsumptionResponse = data => {
|
|
35
|
-
if (!isJSONObject(data)) {
|
|
36
|
-
throw new TypeError(`Unmarshalling the type 'GetConsumptionResponse' failed as data isn't a dictionary.`);
|
|
37
|
-
}
|
|
38
|
-
return {
|
|
39
|
-
consumptions: unmarshalArrayOfObject(data.consumptions, unmarshalGetConsumptionResponseConsumption),
|
|
40
|
-
updatedAt: unmarshalDate(data.updated_at)
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
43
|
const unmarshalListInvoicesResponse = data => {
|
|
44
44
|
if (!isJSONObject(data)) {
|
|
45
45
|
throw new TypeError(`Unmarshalling the type 'ListInvoicesResponse' failed as data isn't a dictionary.`);
|