@@ -36,6 +36,7 @@ import type {
36
36
FtpAccountApiChangeFtpAccountPasswordRequest ,
37
37
FtpAccountApiCreateFtpAccountRequest ,
38
38
Hosting ,
39
+ HostingApiAddCustomDomainRequest ,
39
40
HostingApiCreateHostingRequest ,
40
41
HostingApiUpdateHostingRequest ,
41
42
HostingDomain ,
@@ -128,6 +129,81 @@ export const unmarshalFtpAccount = (data: unknown): FtpAccount => {
128
129
} as FtpAccount
129
130
}
130
131
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
+
131
207
export const unmarshalMailAccount = ( data : unknown ) : MailAccount => {
132
208
if ( ! isJSONObject ( data ) ) {
133
209
throw new TypeError (
@@ -155,22 +231,6 @@ export const unmarshalCheckUserOwnsDomainResponse = (
155
231
} as CheckUserOwnsDomainResponse
156
232
}
157
233
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
-
174
234
const unmarshalDnsRecord = ( data : unknown ) : DnsRecord => {
175
235
if ( ! isJSONObject ( data ) ) {
176
236
throw new TypeError (
@@ -258,25 +318,6 @@ const unmarshalPlatformControlPanelUrls = (
258
318
} as PlatformControlPanelUrls
259
319
}
260
320
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
-
280
321
const unmarshalOfferOption = ( data : unknown ) : OfferOption => {
281
322
if ( ! isJSONObject ( data ) ) {
282
323
throw new TypeError (
@@ -309,21 +350,6 @@ const unmarshalPlatformControlPanel = (data: unknown): PlatformControlPanel => {
309
350
} as PlatformControlPanel
310
351
}
311
352
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
-
327
353
const unmarshalHostingUser = ( data : unknown ) : HostingUser => {
328
354
if ( ! isJSONObject ( data ) ) {
329
355
throw new TypeError (
@@ -545,31 +571,6 @@ export const unmarshalListFtpAccountsResponse = (
545
571
} as ListFtpAccountsResponse
546
572
}
547
573
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
-
573
574
export const unmarshalListHostingsResponse = (
574
575
data : unknown ,
575
576
) : ListHostingsResponse => {
@@ -870,6 +871,13 @@ export const marshalFtpAccountApiCreateFtpAccountRequest = (
870
871
username : request . username ,
871
872
} )
872
873
874
+ export const marshalHostingApiAddCustomDomainRequest = (
875
+ request : HostingApiAddCustomDomainRequest ,
876
+ defaults : DefaultValues ,
877
+ ) : Record < string , unknown > => ( {
878
+ domain_name : request . domainName ,
879
+ } )
880
+
873
881
const marshalCreateHostingRequestDomainConfiguration = (
874
882
request : CreateHostingRequestDomainConfiguration ,
875
883
defaults : DefaultValues ,
0 commit comments