@@ -36,6 +36,7 @@ import type {
3636 FtpAccountApiChangeFtpAccountPasswordRequest ,
3737 FtpAccountApiCreateFtpAccountRequest ,
3838 Hosting ,
39+ HostingApiAddCustomDomainRequest ,
3940 HostingApiCreateHostingRequest ,
4041 HostingApiUpdateHostingRequest ,
4142 HostingDomain ,
@@ -128,6 +129,81 @@ export const unmarshalFtpAccount = (data: unknown): FtpAccount => {
128129 } as FtpAccount
129130}
130131
132+ const unmarshalAutoConfigDomainDns = ( data : unknown ) : AutoConfigDomainDns => {
133+ if ( ! isJSONObject ( data ) ) {
134+ throw new TypeError (
135+ `Unmarshalling the type 'AutoConfigDomainDns' failed as data isn't a dictionary.` ,
136+ )
137+ }
138+
139+ return {
140+ allRecords : data . all_records ,
141+ mailRecords : data . mail_records ,
142+ nameservers : data . nameservers ,
143+ none : data . none ,
144+ webRecords : data . web_records ,
145+ } as AutoConfigDomainDns
146+ }
147+
148+ const unmarshalHostingDomainCustomDomain = (
149+ data : unknown ,
150+ ) : HostingDomainCustomDomain => {
151+ if ( ! isJSONObject ( data ) ) {
152+ throw new TypeError (
153+ `Unmarshalling the type 'HostingDomainCustomDomain' failed as data isn't a dictionary.` ,
154+ )
155+ }
156+
157+ return {
158+ autoConfigDomainDns : data . auto_config_domain_dns
159+ ? unmarshalAutoConfigDomainDns ( data . auto_config_domain_dns )
160+ : undefined ,
161+ dnsStatus : data . dns_status ,
162+ domain : data . domain ,
163+ domainStatus : data . domain_status ,
164+ } as HostingDomainCustomDomain
165+ }
166+
167+ const unmarshalHostingDomain = ( data : unknown ) : HostingDomain => {
168+ if ( ! isJSONObject ( data ) ) {
169+ throw new TypeError (
170+ `Unmarshalling the type 'HostingDomain' failed as data isn't a dictionary.` ,
171+ )
172+ }
173+
174+ return {
175+ customDomain : data . custom_domain
176+ ? unmarshalHostingDomainCustomDomain ( data . custom_domain )
177+ : undefined ,
178+ subdomain : data . subdomain ,
179+ } as HostingDomain
180+ }
181+
182+ export const unmarshalHostingSummary = ( data : unknown ) : HostingSummary => {
183+ if ( ! isJSONObject ( data ) ) {
184+ throw new TypeError (
185+ `Unmarshalling the type 'HostingSummary' failed as data isn't a dictionary.` ,
186+ )
187+ }
188+
189+ return {
190+ createdAt : unmarshalDate ( data . created_at ) ,
191+ dnsStatus : data . dns_status ? data . dns_status : undefined ,
192+ domain : data . domain ,
193+ domainInfo : data . domain_info
194+ ? unmarshalHostingDomain ( data . domain_info )
195+ : undefined ,
196+ domainStatus : data . domain_status ? data . domain_status : undefined ,
197+ id : data . id ,
198+ offerName : data . offer_name ,
199+ projectId : data . project_id ,
200+ protected : data . protected ,
201+ region : data . region ,
202+ status : data . status ,
203+ updatedAt : unmarshalDate ( data . updated_at ) ,
204+ } as HostingSummary
205+ }
206+
131207export const unmarshalMailAccount = ( data : unknown ) : MailAccount => {
132208 if ( ! isJSONObject ( data ) ) {
133209 throw new TypeError (
@@ -155,22 +231,6 @@ export const unmarshalCheckUserOwnsDomainResponse = (
155231 } as CheckUserOwnsDomainResponse
156232}
157233
158- const unmarshalAutoConfigDomainDns = ( data : unknown ) : AutoConfigDomainDns => {
159- if ( ! isJSONObject ( data ) ) {
160- throw new TypeError (
161- `Unmarshalling the type 'AutoConfigDomainDns' failed as data isn't a dictionary.` ,
162- )
163- }
164-
165- return {
166- allRecords : data . all_records ,
167- mailRecords : data . mail_records ,
168- nameservers : data . nameservers ,
169- none : data . none ,
170- webRecords : data . web_records ,
171- } as AutoConfigDomainDns
172- }
173-
174234const unmarshalDnsRecord = ( data : unknown ) : DnsRecord => {
175235 if ( ! isJSONObject ( data ) ) {
176236 throw new TypeError (
@@ -258,25 +318,6 @@ const unmarshalPlatformControlPanelUrls = (
258318 } as PlatformControlPanelUrls
259319}
260320
261- const unmarshalHostingDomainCustomDomain = (
262- data : unknown ,
263- ) : HostingDomainCustomDomain => {
264- if ( ! isJSONObject ( data ) ) {
265- throw new TypeError (
266- `Unmarshalling the type 'HostingDomainCustomDomain' failed as data isn't a dictionary.` ,
267- )
268- }
269-
270- return {
271- autoConfigDomainDns : data . auto_config_domain_dns
272- ? unmarshalAutoConfigDomainDns ( data . auto_config_domain_dns )
273- : undefined ,
274- dnsStatus : data . dns_status ,
275- domain : data . domain ,
276- domainStatus : data . domain_status ,
277- } as HostingDomainCustomDomain
278- }
279-
280321const unmarshalOfferOption = ( data : unknown ) : OfferOption => {
281322 if ( ! isJSONObject ( data ) ) {
282323 throw new TypeError (
@@ -309,21 +350,6 @@ const unmarshalPlatformControlPanel = (data: unknown): PlatformControlPanel => {
309350 } as PlatformControlPanel
310351}
311352
312- const unmarshalHostingDomain = ( data : unknown ) : HostingDomain => {
313- if ( ! isJSONObject ( data ) ) {
314- throw new TypeError (
315- `Unmarshalling the type 'HostingDomain' failed as data isn't a dictionary.` ,
316- )
317- }
318-
319- return {
320- customDomain : data . custom_domain
321- ? unmarshalHostingDomainCustomDomain ( data . custom_domain )
322- : undefined ,
323- subdomain : data . subdomain ,
324- } as HostingDomain
325- }
326-
327353const unmarshalHostingUser = ( data : unknown ) : HostingUser => {
328354 if ( ! isJSONObject ( data ) ) {
329355 throw new TypeError (
@@ -545,31 +571,6 @@ export const unmarshalListFtpAccountsResponse = (
545571 } as ListFtpAccountsResponse
546572}
547573
548- const unmarshalHostingSummary = ( data : unknown ) : HostingSummary => {
549- if ( ! isJSONObject ( data ) ) {
550- throw new TypeError (
551- `Unmarshalling the type 'HostingSummary' failed as data isn't a dictionary.` ,
552- )
553- }
554-
555- return {
556- createdAt : unmarshalDate ( data . created_at ) ,
557- dnsStatus : data . dns_status ? data . dns_status : undefined ,
558- domain : data . domain ,
559- domainInfo : data . domain_info
560- ? unmarshalHostingDomain ( data . domain_info )
561- : undefined ,
562- domainStatus : data . domain_status ? data . domain_status : undefined ,
563- id : data . id ,
564- offerName : data . offer_name ,
565- projectId : data . project_id ,
566- protected : data . protected ,
567- region : data . region ,
568- status : data . status ,
569- updatedAt : unmarshalDate ( data . updated_at ) ,
570- } as HostingSummary
571- }
572-
573574export const unmarshalListHostingsResponse = (
574575 data : unknown ,
575576) : ListHostingsResponse => {
@@ -870,6 +871,13 @@ export const marshalFtpAccountApiCreateFtpAccountRequest = (
870871 username : request . username ,
871872} )
872873
874+ export const marshalHostingApiAddCustomDomainRequest = (
875+ request : HostingApiAddCustomDomainRequest ,
876+ defaults : DefaultValues ,
877+ ) : Record < string , unknown > => ( {
878+ domain_name : request . domainName ,
879+ } )
880+
873881const marshalCreateHostingRequestDomainConfiguration = (
874882 request : CreateHostingRequestDomainConfiguration ,
875883 defaults : DefaultValues ,
0 commit comments