@@ -4,15 +4,15 @@ import randomName from '@scaleway/random-name'
44import { isJSONObject , resolveOneOf , unmarshalArrayOfObject , unmarshalDate , } from '@scaleway/sdk-client'
55import type { DefaultValues } from '@scaleway/sdk-client'
66import type {
7- PoolUpgradePolicy ,
8- Pool ,
97 Version ,
108 MaintenanceWindow ,
119 ClusterAutoUpgrade ,
1210 ClusterAutoscalerConfig ,
1311 ClusterOpenIDConnectConfig ,
1412 Cluster ,
1513 Node ,
14+ PoolUpgradePolicy ,
15+ Pool ,
1616 ACLRule ,
1717 AddClusterACLRulesResponse ,
1818 ExternalNodeCoreV1Taint ,
@@ -53,55 +53,6 @@ import type {
5353 UpgradePoolRequest ,
5454} from './types.gen.js'
5555
56- const unmarshalPoolUpgradePolicy = ( data : unknown ) : PoolUpgradePolicy => {
57- if ( ! isJSONObject ( data ) ) {
58- throw new TypeError (
59- `Unmarshalling the type 'PoolUpgradePolicy' failed as data isn't a dictionary.` ,
60- )
61- }
62-
63- return {
64- maxSurge : data . max_surge ,
65- maxUnavailable : data . max_unavailable ,
66- } as PoolUpgradePolicy
67- }
68-
69- export const unmarshalPool = ( data : unknown ) : Pool => {
70- if ( ! isJSONObject ( data ) ) {
71- throw new TypeError (
72- `Unmarshalling the type 'Pool' failed as data isn't a dictionary.` ,
73- )
74- }
75-
76- return {
77- autohealing : data . autohealing ,
78- autoscaling : data . autoscaling ,
79- clusterId : data . cluster_id ,
80- containerRuntime : data . container_runtime ,
81- createdAt : unmarshalDate ( data . created_at ) ,
82- id : data . id ,
83- kubeletArgs : data . kubelet_args ,
84- maxSize : data . max_size ,
85- minSize : data . min_size ,
86- name : data . name ,
87- newImagesEnabled : data . new_images_enabled ,
88- nodeType : data . node_type ,
89- placementGroupId : data . placement_group_id ,
90- publicIpDisabled : data . public_ip_disabled ,
91- region : data . region ,
92- rootVolumeSize : data . root_volume_size ,
93- rootVolumeType : data . root_volume_type ,
94- securityGroupId : data . security_group_id ,
95- size : data . size ,
96- status : data . status ,
97- tags : data . tags ,
98- updatedAt : unmarshalDate ( data . updated_at ) ,
99- upgradePolicy : data . upgrade_policy ? unmarshalPoolUpgradePolicy ( data . upgrade_policy ) : undefined ,
100- version : data . version ,
101- zone : data . zone ,
102- } as Pool
103- }
104-
10556export const unmarshalVersion = ( data : unknown ) : Version => {
10657 if ( ! isJSONObject ( data ) ) {
10758 throw new TypeError (
@@ -254,6 +205,55 @@ export const unmarshalNode = (data: unknown): Node => {
254205 } as Node
255206}
256207
208+ const unmarshalPoolUpgradePolicy = ( data : unknown ) : PoolUpgradePolicy => {
209+ if ( ! isJSONObject ( data ) ) {
210+ throw new TypeError (
211+ `Unmarshalling the type 'PoolUpgradePolicy' failed as data isn't a dictionary.` ,
212+ )
213+ }
214+
215+ return {
216+ maxSurge : data . max_surge ,
217+ maxUnavailable : data . max_unavailable ,
218+ } as PoolUpgradePolicy
219+ }
220+
221+ export const unmarshalPool = ( data : unknown ) : Pool => {
222+ if ( ! isJSONObject ( data ) ) {
223+ throw new TypeError (
224+ `Unmarshalling the type 'Pool' failed as data isn't a dictionary.` ,
225+ )
226+ }
227+
228+ return {
229+ autohealing : data . autohealing ,
230+ autoscaling : data . autoscaling ,
231+ clusterId : data . cluster_id ,
232+ containerRuntime : data . container_runtime ,
233+ createdAt : unmarshalDate ( data . created_at ) ,
234+ id : data . id ,
235+ kubeletArgs : data . kubelet_args ,
236+ maxSize : data . max_size ,
237+ minSize : data . min_size ,
238+ name : data . name ,
239+ newImagesEnabled : data . new_images_enabled ,
240+ nodeType : data . node_type ,
241+ placementGroupId : data . placement_group_id ,
242+ publicIpDisabled : data . public_ip_disabled ,
243+ region : data . region ,
244+ rootVolumeSize : data . root_volume_size ,
245+ rootVolumeType : data . root_volume_type ,
246+ securityGroupId : data . security_group_id ,
247+ size : data . size ,
248+ status : data . status ,
249+ tags : data . tags ,
250+ updatedAt : unmarshalDate ( data . updated_at ) ,
251+ upgradePolicy : data . upgrade_policy ? unmarshalPoolUpgradePolicy ( data . upgrade_policy ) : undefined ,
252+ version : data . version ,
253+ zone : data . zone ,
254+ } as Pool
255+ }
256+
257257const unmarshalACLRule = ( data : unknown ) : ACLRule => {
258258 if ( ! isJSONObject ( data ) ) {
259259 throw new TypeError (
0 commit comments