@@ -7,8 +7,11 @@ import {
77} from '@scaleway/sdk-client'
88import type {
99 AccountOrganizationInfo ,
10+ AccountProjectInfo ,
1011 AccountUserInfo ,
1112 AppleSiliconServerInfo ,
13+ BaremetalServerInfo ,
14+ BaremetalSettingInfo ,
1215 Event ,
1316 EventPrincipal ,
1417 InstanceServerInfo ,
@@ -38,6 +41,18 @@ const unmarshalAccountOrganizationInfo = (
3841 return { } as AccountOrganizationInfo
3942}
4043
44+ const unmarshalAccountProjectInfo = ( data : unknown ) : AccountProjectInfo => {
45+ if ( ! isJSONObject ( data ) ) {
46+ throw new TypeError (
47+ `Unmarshalling the type 'AccountProjectInfo' failed as data isn't a dictionary.` ,
48+ )
49+ }
50+
51+ return {
52+ description : data . description ,
53+ } as AccountProjectInfo
54+ }
55+
4156const unmarshalAccountUserInfo = ( data : unknown ) : AccountUserInfo => {
4257 if ( ! isJSONObject ( data ) ) {
4358 throw new TypeError (
@@ -66,6 +81,31 @@ const unmarshalAppleSiliconServerInfo = (
6681 } as AppleSiliconServerInfo
6782}
6883
84+ const unmarshalBaremetalServerInfo = ( data : unknown ) : BaremetalServerInfo => {
85+ if ( ! isJSONObject ( data ) ) {
86+ throw new TypeError (
87+ `Unmarshalling the type 'BaremetalServerInfo' failed as data isn't a dictionary.` ,
88+ )
89+ }
90+
91+ return {
92+ description : data . description ,
93+ tags : data . tags ,
94+ } as BaremetalServerInfo
95+ }
96+
97+ const unmarshalBaremetalSettingInfo = ( data : unknown ) : BaremetalSettingInfo => {
98+ if ( ! isJSONObject ( data ) ) {
99+ throw new TypeError (
100+ `Unmarshalling the type 'BaremetalSettingInfo' failed as data isn't a dictionary.` ,
101+ )
102+ }
103+
104+ return {
105+ type : data . type ,
106+ } as BaremetalSettingInfo
107+ }
108+
69109const unmarshalInstanceServerInfo = ( data : unknown ) : InstanceServerInfo => {
70110 if ( ! isJSONObject ( data ) ) {
71111 throw new TypeError (
@@ -188,12 +228,21 @@ export const unmarshalResource = (data: unknown): Resource => {
188228 accountOrganizationInfo : data . account_organization_info
189229 ? unmarshalAccountOrganizationInfo ( data . account_organization_info )
190230 : undefined ,
231+ accountProjectInfo : data . account_project_info
232+ ? unmarshalAccountProjectInfo ( data . account_project_info )
233+ : undefined ,
191234 accountUserInfo : data . account_user_info
192235 ? unmarshalAccountUserInfo ( data . account_user_info )
193236 : undefined ,
194237 appleSiliconServerInfo : data . apple_silicon_server_info
195238 ? unmarshalAppleSiliconServerInfo ( data . apple_silicon_server_info )
196239 : undefined ,
240+ baremetalServerInfo : data . baremetal_server_info
241+ ? unmarshalBaremetalServerInfo ( data . baremetal_server_info )
242+ : undefined ,
243+ baremetalSettingInfo : data . baremetal_setting_info
244+ ? unmarshalBaremetalSettingInfo ( data . baremetal_setting_info )
245+ : undefined ,
197246 createdAt : unmarshalDate ( data . created_at ) ,
198247 deletedAt : unmarshalDate ( data . deleted_at ) ,
199248 id : data . id ,
0 commit comments