@scaleway/sdk-webhosting 2.11.0 → 2.13.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.
@@ -1,55 +0,0 @@
1
- import type { DefaultValues } from '@scaleway/sdk-client';
2
- import type { Backup, DatabaseUser, Database, FtpAccount, HostingSummary, MailAccount, Website, CheckFreeDomainAvailabilityResponse, CheckUserOwnsDomainResponse, DnsRecords, Domain, Hosting, ListBackupItemsResponse, ListBackupsResponse, ListControlPanelsResponse, ListDatabaseUsersResponse, ListDatabasesResponse, ListFreeRootDomainsResponse, ListFtpAccountsResponse, ListHostingsResponse, ListMailAccountsResponse, ListOffersResponse, ListRecentProgressesResponse, ListWebsitesResponse, Progress, ResetHostingPasswordResponse, ResourceSummary, RestoreBackupItemsResponse, RestoreBackupResponse, SearchDomainsResponse, Session, BackupApiRestoreBackupItemsRequest, DatabaseApiAssignDatabaseUserRequest, DatabaseApiChangeDatabaseUserPasswordRequest, DatabaseApiCreateDatabaseRequest, DatabaseApiCreateDatabaseUserRequest, DatabaseApiUnassignDatabaseUserRequest, DnsApiCheckUserOwnsDomainRequest, DnsApiSyncDomainDnsRecordsRequest, FreeDomainApiCheckFreeDomainAvailabilityRequest, FtpAccountApiChangeFtpAccountPasswordRequest, FtpAccountApiCreateFtpAccountRequest, HostingApiAddCustomDomainRequest, HostingApiCreateHostingRequest, HostingApiDeleteHostingDomainsRequest, HostingApiMigrateControlPanelRequest, HostingApiRemoveCustomDomainRequest, HostingApiUpdateHostingFreeDomainRequest, HostingApiUpdateHostingRequest, MailAccountApiChangeMailAccountPasswordRequest, MailAccountApiCreateMailAccountRequest, MailAccountApiRemoveMailAccountRequest, WebsiteApiCreateWebsiteRequest } from './types.gen.js';
3
- export declare const unmarshalBackup: (data: unknown) => Backup;
4
- export declare const unmarshalDatabaseUser: (data: unknown) => DatabaseUser;
5
- export declare const unmarshalDatabase: (data: unknown) => Database;
6
- export declare const unmarshalFtpAccount: (data: unknown) => FtpAccount;
7
- export declare const unmarshalHostingSummary: (data: unknown) => HostingSummary;
8
- export declare const unmarshalMailAccount: (data: unknown) => MailAccount;
9
- export declare const unmarshalWebsite: (data: unknown) => Website;
10
- export declare const unmarshalCheckFreeDomainAvailabilityResponse: (data: unknown) => CheckFreeDomainAvailabilityResponse;
11
- export declare const unmarshalCheckUserOwnsDomainResponse: (data: unknown) => CheckUserOwnsDomainResponse;
12
- export declare const unmarshalDnsRecords: (data: unknown) => DnsRecords;
13
- export declare const unmarshalDomain: (data: unknown) => Domain;
14
- export declare const unmarshalHosting: (data: unknown) => Hosting;
15
- export declare const unmarshalListBackupItemsResponse: (data: unknown) => ListBackupItemsResponse;
16
- export declare const unmarshalListBackupsResponse: (data: unknown) => ListBackupsResponse;
17
- export declare const unmarshalListControlPanelsResponse: (data: unknown) => ListControlPanelsResponse;
18
- export declare const unmarshalListDatabaseUsersResponse: (data: unknown) => ListDatabaseUsersResponse;
19
- export declare const unmarshalListDatabasesResponse: (data: unknown) => ListDatabasesResponse;
20
- export declare const unmarshalListFreeRootDomainsResponse: (data: unknown) => ListFreeRootDomainsResponse;
21
- export declare const unmarshalListFtpAccountsResponse: (data: unknown) => ListFtpAccountsResponse;
22
- export declare const unmarshalListHostingsResponse: (data: unknown) => ListHostingsResponse;
23
- export declare const unmarshalListMailAccountsResponse: (data: unknown) => ListMailAccountsResponse;
24
- export declare const unmarshalListOffersResponse: (data: unknown) => ListOffersResponse;
25
- export declare const unmarshalListRecentProgressesResponse: (data: unknown) => ListRecentProgressesResponse;
26
- export declare const unmarshalListWebsitesResponse: (data: unknown) => ListWebsitesResponse;
27
- export declare const unmarshalProgress: (data: unknown) => Progress;
28
- export declare const unmarshalResetHostingPasswordResponse: (data: unknown) => ResetHostingPasswordResponse;
29
- export declare const unmarshalResourceSummary: (data: unknown) => ResourceSummary;
30
- export declare const unmarshalRestoreBackupItemsResponse: (data: unknown) => RestoreBackupItemsResponse;
31
- export declare const unmarshalRestoreBackupResponse: (data: unknown) => RestoreBackupResponse;
32
- export declare const unmarshalSearchDomainsResponse: (data: unknown) => SearchDomainsResponse;
33
- export declare const unmarshalSession: (data: unknown) => Session;
34
- export declare const marshalBackupApiRestoreBackupItemsRequest: (request: BackupApiRestoreBackupItemsRequest, defaults: DefaultValues) => Record<string, unknown>;
35
- export declare const marshalDatabaseApiAssignDatabaseUserRequest: (request: DatabaseApiAssignDatabaseUserRequest, defaults: DefaultValues) => Record<string, unknown>;
36
- export declare const marshalDatabaseApiChangeDatabaseUserPasswordRequest: (request: DatabaseApiChangeDatabaseUserPasswordRequest, defaults: DefaultValues) => Record<string, unknown>;
37
- export declare const marshalDatabaseApiCreateDatabaseRequest: (request: DatabaseApiCreateDatabaseRequest, defaults: DefaultValues) => Record<string, unknown>;
38
- export declare const marshalDatabaseApiCreateDatabaseUserRequest: (request: DatabaseApiCreateDatabaseUserRequest, defaults: DefaultValues) => Record<string, unknown>;
39
- export declare const marshalDatabaseApiUnassignDatabaseUserRequest: (request: DatabaseApiUnassignDatabaseUserRequest, defaults: DefaultValues) => Record<string, unknown>;
40
- export declare const marshalDnsApiCheckUserOwnsDomainRequest: (request: DnsApiCheckUserOwnsDomainRequest, defaults: DefaultValues) => Record<string, unknown>;
41
- export declare const marshalDnsApiSyncDomainDnsRecordsRequest: (request: DnsApiSyncDomainDnsRecordsRequest, defaults: DefaultValues) => Record<string, unknown>;
42
- export declare const marshalFreeDomainApiCheckFreeDomainAvailabilityRequest: (request: FreeDomainApiCheckFreeDomainAvailabilityRequest, defaults: DefaultValues) => Record<string, unknown>;
43
- export declare const marshalFtpAccountApiChangeFtpAccountPasswordRequest: (request: FtpAccountApiChangeFtpAccountPasswordRequest, defaults: DefaultValues) => Record<string, unknown>;
44
- export declare const marshalFtpAccountApiCreateFtpAccountRequest: (request: FtpAccountApiCreateFtpAccountRequest, defaults: DefaultValues) => Record<string, unknown>;
45
- export declare const marshalHostingApiAddCustomDomainRequest: (request: HostingApiAddCustomDomainRequest, defaults: DefaultValues) => Record<string, unknown>;
46
- export declare const marshalHostingApiCreateHostingRequest: (request: HostingApiCreateHostingRequest, defaults: DefaultValues) => Record<string, unknown>;
47
- export declare const marshalHostingApiDeleteHostingDomainsRequest: (request: HostingApiDeleteHostingDomainsRequest, defaults: DefaultValues) => Record<string, unknown>;
48
- export declare const marshalHostingApiMigrateControlPanelRequest: (request: HostingApiMigrateControlPanelRequest, defaults: DefaultValues) => Record<string, unknown>;
49
- export declare const marshalHostingApiRemoveCustomDomainRequest: (request: HostingApiRemoveCustomDomainRequest, defaults: DefaultValues) => Record<string, unknown>;
50
- export declare const marshalHostingApiUpdateHostingFreeDomainRequest: (request: HostingApiUpdateHostingFreeDomainRequest, defaults: DefaultValues) => Record<string, unknown>;
51
- export declare const marshalHostingApiUpdateHostingRequest: (request: HostingApiUpdateHostingRequest, defaults: DefaultValues) => Record<string, unknown>;
52
- export declare const marshalMailAccountApiChangeMailAccountPasswordRequest: (request: MailAccountApiChangeMailAccountPasswordRequest, defaults: DefaultValues) => Record<string, unknown>;
53
- export declare const marshalMailAccountApiCreateMailAccountRequest: (request: MailAccountApiCreateMailAccountRequest, defaults: DefaultValues) => Record<string, unknown>;
54
- export declare const marshalMailAccountApiRemoveMailAccountRequest: (request: MailAccountApiRemoveMailAccountRequest, defaults: DefaultValues) => Record<string, unknown>;
55
- export declare const marshalWebsiteApiCreateWebsiteRequest: (request: WebsiteApiCreateWebsiteRequest, defaults: DefaultValues) => Record<string, unknown>;
@@ -1,538 +0,0 @@
1
- import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, unmarshalMoney } from "@scaleway/sdk-client";
2
- //#region src/v1/marshalling.gen.ts
3
- const unmarshalBackup = (data) => {
4
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Backup' failed as data isn't a dictionary.`);
5
- return {
6
- createdAt: unmarshalDate(data.created_at),
7
- id: data.id,
8
- size: data.size,
9
- status: data.status,
10
- totalItems: data.total_items
11
- };
12
- };
13
- const unmarshalDatabaseUser = (data) => {
14
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DatabaseUser' failed as data isn't a dictionary.`);
15
- return {
16
- databases: data.databases,
17
- username: data.username
18
- };
19
- };
20
- const unmarshalDatabase = (data) => {
21
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Database' failed as data isn't a dictionary.`);
22
- return {
23
- databaseName: data.database_name,
24
- users: data.users
25
- };
26
- };
27
- const unmarshalFtpAccount = (data) => {
28
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'FtpAccount' failed as data isn't a dictionary.`);
29
- return {
30
- path: data.path,
31
- username: data.username
32
- };
33
- };
34
- const unmarshalAutoConfigDomainDns = (data) => {
35
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'AutoConfigDomainDns' failed as data isn't a dictionary.`);
36
- return {
37
- allRecords: data.all_records,
38
- mailRecords: data.mail_records,
39
- nameservers: data.nameservers,
40
- none: data.none,
41
- webRecords: data.web_records
42
- };
43
- };
44
- const unmarshalHostingDomainCustomDomain = (data) => {
45
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'HostingDomainCustomDomain' failed as data isn't a dictionary.`);
46
- return {
47
- autoConfigDomainDns: data.auto_config_domain_dns ? unmarshalAutoConfigDomainDns(data.auto_config_domain_dns) : void 0,
48
- dnsStatus: data.dns_status,
49
- domain: data.domain,
50
- domainStatus: data.domain_status
51
- };
52
- };
53
- const unmarshalHostingDomain = (data) => {
54
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'HostingDomain' failed as data isn't a dictionary.`);
55
- return {
56
- customDomain: data.custom_domain ? unmarshalHostingDomainCustomDomain(data.custom_domain) : void 0,
57
- subdomain: data.subdomain
58
- };
59
- };
60
- const unmarshalHostingSummary = (data) => {
61
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'HostingSummary' failed as data isn't a dictionary.`);
62
- return {
63
- createdAt: unmarshalDate(data.created_at),
64
- dnsStatus: data.dns_status ? data.dns_status : void 0,
65
- domain: data.domain,
66
- domainInfo: data.domain_info ? unmarshalHostingDomain(data.domain_info) : void 0,
67
- domainStatus: data.domain_status ? data.domain_status : void 0,
68
- id: data.id,
69
- offerName: data.offer_name,
70
- projectId: data.project_id,
71
- protected: data.protected,
72
- region: data.region,
73
- status: data.status,
74
- updatedAt: unmarshalDate(data.updated_at)
75
- };
76
- };
77
- const unmarshalMailAccount = (data) => {
78
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'MailAccount' failed as data isn't a dictionary.`);
79
- return {
80
- domain: data.domain,
81
- username: data.username
82
- };
83
- };
84
- const unmarshalWebsite = (data) => {
85
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Website' failed as data isn't a dictionary.`);
86
- return {
87
- domain: data.domain,
88
- path: data.path,
89
- sslStatus: data.ssl_status
90
- };
91
- };
92
- const unmarshalFreeDomain = (data) => {
93
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'FreeDomain' failed as data isn't a dictionary.`);
94
- return {
95
- rootDomain: data.root_domain,
96
- slug: data.slug
97
- };
98
- };
99
- const unmarshalCheckFreeDomainAvailabilityResponse = (data) => {
100
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CheckFreeDomainAvailabilityResponse' failed as data isn't a dictionary.`);
101
- return {
102
- freeDomain: data.free_domain ? unmarshalFreeDomain(data.free_domain) : void 0,
103
- isAvailable: data.is_available,
104
- reason: data.reason ? data.reason : void 0
105
- };
106
- };
107
- const unmarshalCheckUserOwnsDomainResponse = (data) => {
108
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CheckUserOwnsDomainResponse' failed as data isn't a dictionary.`);
109
- return { ownsDomain: data.owns_domain };
110
- };
111
- const unmarshalDnsRecord = (data) => {
112
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DnsRecord' failed as data isn't a dictionary.`);
113
- return {
114
- name: data.name,
115
- priority: data.priority,
116
- rawData: data.raw_data,
117
- status: data.status,
118
- ttl: data.ttl,
119
- type: data.type,
120
- value: data.value
121
- };
122
- };
123
- const unmarshalNameserver = (data) => {
124
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Nameserver' failed as data isn't a dictionary.`);
125
- return {
126
- hostname: data.hostname,
127
- isDefault: data.is_default,
128
- status: data.status
129
- };
130
- };
131
- const unmarshalDnsRecords = (data) => {
132
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DnsRecords' failed as data isn't a dictionary.`);
133
- return {
134
- autoConfigDomainDns: data.auto_config_domain_dns ? unmarshalAutoConfigDomainDns(data.auto_config_domain_dns) : void 0,
135
- dnsConfig: data.dns_config ? data.dns_config : void 0,
136
- nameServers: unmarshalArrayOfObject(data.name_servers, unmarshalNameserver),
137
- records: unmarshalArrayOfObject(data.records, unmarshalDnsRecord),
138
- status: data.status
139
- };
140
- };
141
- const unmarshalDomain = (data) => {
142
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Domain' failed as data isn't a dictionary.`);
143
- return {
144
- autoConfigDomainDns: data.auto_config_domain_dns ? unmarshalAutoConfigDomainDns(data.auto_config_domain_dns) : void 0,
145
- availableActions: data.available_actions,
146
- availableDnsActions: data.available_dns_actions ? data.available_dns_actions : void 0,
147
- name: data.name,
148
- owner: data.owner,
149
- status: data.status,
150
- zoneDomainName: data.zone_domain_name
151
- };
152
- };
153
- const unmarshalPlatformControlPanelUrls = (data) => {
154
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'PlatformControlPanelUrls' failed as data isn't a dictionary.`);
155
- return {
156
- dashboard: data.dashboard,
157
- webmail: data.webmail
158
- };
159
- };
160
- const unmarshalOfferCommitment = (data) => {
161
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'OfferCommitment' failed as data isn't a dictionary.`);
162
- return {
163
- billingMode: data.billing_mode,
164
- billingOperationPath: data.billing_operation_path,
165
- durationInMonth: data.duration_in_month,
166
- id: data.id,
167
- isDefault: data.is_default,
168
- next: data.next ? unmarshalOfferCommitment(data.next) : void 0,
169
- price: data.price ? unmarshalMoney(data.price) : void 0,
170
- type: data.type
171
- };
172
- };
173
- const unmarshalControlPanel = (data) => {
174
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ControlPanel' failed as data isn't a dictionary.`);
175
- return {
176
- available: data.available,
177
- availableLanguages: data.available_languages,
178
- logoUrl: data.logo_url,
179
- name: data.name
180
- };
181
- };
182
- const unmarshalOfferOption = (data) => {
183
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'OfferOption' failed as data isn't a dictionary.`);
184
- return {
185
- billingOperationPath: data.billing_operation_path,
186
- currentValue: data.current_value,
187
- id: data.id,
188
- maxValue: data.max_value,
189
- minValue: data.min_value,
190
- name: data.name,
191
- price: data.price ? unmarshalMoney(data.price) : void 0,
192
- quotaWarning: data.quota_warning
193
- };
194
- };
195
- const unmarshalPlatformControlPanel = (data) => {
196
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'PlatformControlPanel' failed as data isn't a dictionary.`);
197
- return {
198
- name: data.name,
199
- urls: data.urls ? unmarshalPlatformControlPanelUrls(data.urls) : void 0
200
- };
201
- };
202
- const unmarshalHostingCommitment = (data) => {
203
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'HostingCommitment' failed as data isn't a dictionary.`);
204
- return {
205
- deleteHostingAtEnd: data.delete_hosting_at_end,
206
- endAt: unmarshalDate(data.end_at),
207
- offerCommitment: data.offer_commitment ? unmarshalOfferCommitment(data.offer_commitment) : void 0,
208
- startAt: unmarshalDate(data.start_at)
209
- };
210
- };
211
- const unmarshalHostingUser = (data) => {
212
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'HostingUser' failed as data isn't a dictionary.`);
213
- return {
214
- contactEmail: data.contact_email,
215
- oneTimePassword: data.one_time_password,
216
- oneTimePasswordB64: data.one_time_password_b64,
217
- username: data.username
218
- };
219
- };
220
- const unmarshalOffer = (data) => {
221
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Offer' failed as data isn't a dictionary.`);
222
- return {
223
- available: data.available,
224
- billingOperationPath: data.billing_operation_path,
225
- commitments: unmarshalArrayOfObject(data.commitments, unmarshalOfferCommitment),
226
- controlPanelName: data.control_panel_name,
227
- controlPanels: unmarshalArrayOfObject(data.control_panels, unmarshalControlPanel),
228
- endOfLife: data.end_of_life,
229
- id: data.id,
230
- name: data.name,
231
- options: unmarshalArrayOfObject(data.options, unmarshalOfferOption),
232
- price: data.price ? unmarshalMoney(data.price) : void 0,
233
- quotaWarning: data.quota_warning,
234
- region: data.region
235
- };
236
- };
237
- const unmarshalPlatform = (data) => {
238
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Platform' failed as data isn't a dictionary.`);
239
- return {
240
- controlPanel: data.control_panel ? unmarshalPlatformControlPanel(data.control_panel) : void 0,
241
- groupName: data.group_name,
242
- hostname: data.hostname,
243
- ipv4: data.ipv4,
244
- ipv6: data.ipv6,
245
- number: data.number
246
- };
247
- };
248
- const unmarshalHosting = (data) => {
249
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Hosting' failed as data isn't a dictionary.`);
250
- return {
251
- commitment: data.commitment ? unmarshalHostingCommitment(data.commitment) : void 0,
252
- createdAt: unmarshalDate(data.created_at),
253
- dnsStatus: data.dns_status ? data.dns_status : void 0,
254
- domain: data.domain,
255
- domainInfo: data.domain_info ? unmarshalHostingDomain(data.domain_info) : void 0,
256
- domainStatus: data.domain_status ? data.domain_status : void 0,
257
- id: data.id,
258
- ipv4: data.ipv4,
259
- offer: data.offer ? unmarshalOffer(data.offer) : void 0,
260
- platform: data.platform ? unmarshalPlatform(data.platform) : void 0,
261
- projectId: data.project_id,
262
- protected: data.protected,
263
- provider: data.provider ? data.provider : void 0,
264
- region: data.region,
265
- status: data.status,
266
- tags: data.tags,
267
- updatedAt: unmarshalDate(data.updated_at),
268
- user: data.user ? unmarshalHostingUser(data.user) : void 0
269
- };
270
- };
271
- const unmarshalBackupItem = (data) => {
272
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'BackupItem' failed as data isn't a dictionary.`);
273
- return {
274
- createdAt: unmarshalDate(data.created_at),
275
- id: data.id,
276
- name: data.name,
277
- size: data.size,
278
- status: data.status,
279
- type: data.type
280
- };
281
- };
282
- const unmarshalBackupItemGroup = (data) => {
283
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'BackupItemGroup' failed as data isn't a dictionary.`);
284
- return {
285
- items: unmarshalArrayOfObject(data.items, unmarshalBackupItem),
286
- type: data.type
287
- };
288
- };
289
- const unmarshalListBackupItemsResponse = (data) => {
290
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListBackupItemsResponse' failed as data isn't a dictionary.`);
291
- return {
292
- groups: unmarshalArrayOfObject(data.groups, unmarshalBackupItemGroup),
293
- totalCount: data.total_count
294
- };
295
- };
296
- const unmarshalListBackupsResponse = (data) => {
297
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListBackupsResponse' failed as data isn't a dictionary.`);
298
- return {
299
- backups: unmarshalArrayOfObject(data.backups, unmarshalBackup),
300
- totalCount: data.total_count
301
- };
302
- };
303
- const unmarshalListControlPanelsResponse = (data) => {
304
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListControlPanelsResponse' failed as data isn't a dictionary.`);
305
- return {
306
- controlPanels: unmarshalArrayOfObject(data.control_panels, unmarshalControlPanel),
307
- totalCount: data.total_count
308
- };
309
- };
310
- const unmarshalListDatabaseUsersResponse = (data) => {
311
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDatabaseUsersResponse' failed as data isn't a dictionary.`);
312
- return {
313
- totalCount: data.total_count,
314
- users: unmarshalArrayOfObject(data.users, unmarshalDatabaseUser)
315
- };
316
- };
317
- const unmarshalListDatabasesResponse = (data) => {
318
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.`);
319
- return {
320
- databases: unmarshalArrayOfObject(data.databases, unmarshalDatabase),
321
- totalCount: data.total_count
322
- };
323
- };
324
- const unmarshalListFreeRootDomainsResponse = (data) => {
325
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListFreeRootDomainsResponse' failed as data isn't a dictionary.`);
326
- return {
327
- rootDomains: data.root_domains,
328
- totalCount: data.total_count
329
- };
330
- };
331
- const unmarshalListFtpAccountsResponse = (data) => {
332
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListFtpAccountsResponse' failed as data isn't a dictionary.`);
333
- return {
334
- ftpAccounts: unmarshalArrayOfObject(data.ftp_accounts, unmarshalFtpAccount),
335
- totalCount: data.total_count
336
- };
337
- };
338
- const unmarshalListHostingsResponse = (data) => {
339
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListHostingsResponse' failed as data isn't a dictionary.`);
340
- return {
341
- hostings: unmarshalArrayOfObject(data.hostings, unmarshalHostingSummary),
342
- totalCount: data.total_count
343
- };
344
- };
345
- const unmarshalListMailAccountsResponse = (data) => {
346
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListMailAccountsResponse' failed as data isn't a dictionary.`);
347
- return {
348
- mailAccounts: unmarshalArrayOfObject(data.mail_accounts, unmarshalMailAccount),
349
- totalCount: data.total_count
350
- };
351
- };
352
- const unmarshalListOffersResponse = (data) => {
353
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary.`);
354
- return {
355
- offers: unmarshalArrayOfObject(data.offers, unmarshalOffer),
356
- totalCount: data.total_count
357
- };
358
- };
359
- const unmarshalProgressSummary = (data) => {
360
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ProgressSummary' failed as data isn't a dictionary.`);
361
- return {
362
- backupItemsCount: data.backup_items_count,
363
- id: data.id,
364
- percentage: data.percentage,
365
- status: data.status
366
- };
367
- };
368
- const unmarshalListRecentProgressesResponse = (data) => {
369
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListRecentProgressesResponse' failed as data isn't a dictionary.`);
370
- return { progresses: unmarshalArrayOfObject(data.progresses, unmarshalProgressSummary) };
371
- };
372
- const unmarshalListWebsitesResponse = (data) => {
373
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListWebsitesResponse' failed as data isn't a dictionary.`);
374
- return {
375
- totalCount: data.total_count,
376
- websites: unmarshalArrayOfObject(data.websites, unmarshalWebsite)
377
- };
378
- };
379
- const unmarshalProgress = (data) => {
380
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Progress' failed as data isn't a dictionary.`);
381
- return {
382
- backupItemGroups: unmarshalArrayOfObject(data.backup_item_groups, unmarshalBackupItemGroup),
383
- id: data.id,
384
- percentage: data.percentage,
385
- status: data.status
386
- };
387
- };
388
- const unmarshalResetHostingPasswordResponse = (data) => {
389
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ResetHostingPasswordResponse' failed as data isn't a dictionary.`);
390
- return {
391
- oneTimePassword: data.one_time_password,
392
- oneTimePasswordB64: data.one_time_password_b64
393
- };
394
- };
395
- const unmarshalResourceSummary = (data) => {
396
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ResourceSummary' failed as data isn't a dictionary.`);
397
- return {
398
- databasesCount: data.databases_count,
399
- ftpAccountsCount: data.ftp_accounts_count,
400
- mailAccountsCount: data.mail_accounts_count,
401
- websitesCount: data.websites_count
402
- };
403
- };
404
- const unmarshalRestoreBackupItemsResponse = (data) => {
405
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'RestoreBackupItemsResponse' failed as data isn't a dictionary.`);
406
- return { progressId: data.progress_id };
407
- };
408
- const unmarshalRestoreBackupResponse = (data) => {
409
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'RestoreBackupResponse' failed as data isn't a dictionary.`);
410
- return { progressId: data.progress_id };
411
- };
412
- const unmarshalDomainAvailability = (data) => {
413
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DomainAvailability' failed as data isn't a dictionary.`);
414
- return {
415
- availableActions: data.available_actions,
416
- canCreateHosting: data.can_create_hosting,
417
- name: data.name,
418
- price: data.price ? unmarshalMoney(data.price) : void 0,
419
- status: data.status,
420
- zoneName: data.zone_name
421
- };
422
- };
423
- const unmarshalSearchDomainsResponse = (data) => {
424
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SearchDomainsResponse' failed as data isn't a dictionary.`);
425
- return { domainsAvailable: unmarshalArrayOfObject(data.domains_available, unmarshalDomainAvailability) };
426
- };
427
- const unmarshalSession = (data) => {
428
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Session' failed as data isn't a dictionary.`);
429
- return { url: data.url };
430
- };
431
- const marshalBackupApiRestoreBackupItemsRequest = (request, defaults) => ({ item_ids: request.itemIds });
432
- const marshalDatabaseApiAssignDatabaseUserRequest = (request, defaults) => ({ username: request.username });
433
- const marshalDatabaseApiChangeDatabaseUserPasswordRequest = (request, defaults) => ({ password: request.password });
434
- const marshalCreateDatabaseRequestUser = (request, defaults) => ({
435
- password: request.password,
436
- username: request.username
437
- });
438
- const marshalDatabaseApiCreateDatabaseRequest = (request, defaults) => ({
439
- database_name: request.databaseName,
440
- ...resolveOneOf([{
441
- param: "new_user",
442
- value: request.newUser !== void 0 ? marshalCreateDatabaseRequestUser(request.newUser, defaults) : void 0
443
- }, {
444
- param: "existing_username",
445
- value: request.existingUsername
446
- }])
447
- });
448
- const marshalDatabaseApiCreateDatabaseUserRequest = (request, defaults) => ({
449
- password: request.password,
450
- username: request.username
451
- });
452
- const marshalDatabaseApiUnassignDatabaseUserRequest = (request, defaults) => ({ username: request.username });
453
- const marshalDnsApiCheckUserOwnsDomainRequest = (request, defaults) => ({ project_id: request.projectId ?? defaults.defaultProjectId });
454
- const marshalAutoConfigDomainDns = (request, defaults) => ({
455
- all_records: request.allRecords,
456
- mail_records: request.mailRecords,
457
- nameservers: request.nameservers,
458
- none: request.none,
459
- web_records: request.webRecords
460
- });
461
- const marshalSyncDomainDnsRecordsRequestRecord = (request, defaults) => ({
462
- name: request.name,
463
- type: request.type
464
- });
465
- const marshalDnsApiSyncDomainDnsRecordsRequest = (request, defaults) => ({
466
- auto_config_domain_dns: request.autoConfigDomainDns !== void 0 ? marshalAutoConfigDomainDns(request.autoConfigDomainDns, defaults) : void 0,
467
- custom_records: request.customRecords !== void 0 ? request.customRecords.map((elt) => marshalSyncDomainDnsRecordsRequestRecord(elt, defaults)) : void 0,
468
- update_all_records: request.updateAllRecords,
469
- update_mail_records: request.updateMailRecords,
470
- update_nameservers: request.updateNameservers,
471
- update_web_records: request.updateWebRecords
472
- });
473
- const marshalFreeDomainApiCheckFreeDomainAvailabilityRequest = (request, defaults) => ({
474
- root_domain: request.rootDomain,
475
- slug: request.slug
476
- });
477
- const marshalFtpAccountApiChangeFtpAccountPasswordRequest = (request, defaults) => ({ password: request.password });
478
- const marshalFtpAccountApiCreateFtpAccountRequest = (request, defaults) => ({
479
- password: request.password,
480
- path: request.path,
481
- username: request.username
482
- });
483
- const marshalHostingApiAddCustomDomainRequest = (request, defaults) => ({ domain_name: request.domainName });
484
- const marshalCreateHostingRequestDomainConfiguration = (request, defaults) => ({
485
- update_all_records: request.updateAllRecords,
486
- update_mail_record: request.updateMailRecord,
487
- update_nameservers: request.updateNameservers,
488
- update_web_record: request.updateWebRecord
489
- });
490
- const marshalOfferOptionRequest = (request, defaults) => ({
491
- id: request.id,
492
- quantity: request.quantity
493
- });
494
- const marshalHostingApiCreateHostingRequest = (request, defaults) => ({
495
- auto_config_domain_dns: request.autoConfigDomainDns !== void 0 ? marshalAutoConfigDomainDns(request.autoConfigDomainDns, defaults) : void 0,
496
- domain: request.domain,
497
- domain_configuration: request.domainConfiguration !== void 0 ? marshalCreateHostingRequestDomainConfiguration(request.domainConfiguration, defaults) : void 0,
498
- email: request.email,
499
- language: request.language,
500
- offer_commitment_id: request.offerCommitmentId,
501
- offer_id: request.offerId,
502
- offer_options: request.offerOptions !== void 0 ? request.offerOptions.map((elt) => marshalOfferOptionRequest(elt, defaults)) : void 0,
503
- project_id: request.projectId ?? defaults.defaultProjectId,
504
- skip_welcome_email: request.skipWelcomeEmail,
505
- subdomain: request.subdomain,
506
- tags: request.tags
507
- });
508
- const marshalHostingApiDeleteHostingDomainsRequest = (request, defaults) => ({ domains: request.domains });
509
- const marshalHostingApiMigrateControlPanelRequest = (request, defaults) => ({
510
- control_panel_name: request.controlPanelName,
511
- offer_id: request.offerId
512
- });
513
- const marshalHostingApiRemoveCustomDomainRequest = (request, defaults) => ({ domain_name: request.domainName });
514
- const marshalHostingApiUpdateHostingFreeDomainRequest = (request, defaults) => ({ free_domain: request.freeDomain });
515
- const marshalHostingApiUpdateHostingRequest = (request, defaults) => ({
516
- email: request.email,
517
- offer_id: request.offerId,
518
- offer_options: request.offerOptions !== void 0 ? request.offerOptions.map((elt) => marshalOfferOptionRequest(elt, defaults)) : void 0,
519
- protected: request.protected,
520
- tags: request.tags
521
- });
522
- const marshalMailAccountApiChangeMailAccountPasswordRequest = (request, defaults) => ({
523
- domain: request.domain,
524
- password: request.password,
525
- username: request.username
526
- });
527
- const marshalMailAccountApiCreateMailAccountRequest = (request, defaults) => ({
528
- domain: request.domain,
529
- password: request.password,
530
- username: request.username
531
- });
532
- const marshalMailAccountApiRemoveMailAccountRequest = (request, defaults) => ({
533
- domain: request.domain,
534
- username: request.username
535
- });
536
- const marshalWebsiteApiCreateWebsiteRequest = (request, defaults) => ({ domain_name: request.domainName });
537
- //#endregion
538
- export { marshalBackupApiRestoreBackupItemsRequest, marshalDatabaseApiAssignDatabaseUserRequest, marshalDatabaseApiChangeDatabaseUserPasswordRequest, marshalDatabaseApiCreateDatabaseRequest, marshalDatabaseApiCreateDatabaseUserRequest, marshalDatabaseApiUnassignDatabaseUserRequest, marshalDnsApiCheckUserOwnsDomainRequest, marshalDnsApiSyncDomainDnsRecordsRequest, marshalFreeDomainApiCheckFreeDomainAvailabilityRequest, marshalFtpAccountApiChangeFtpAccountPasswordRequest, marshalFtpAccountApiCreateFtpAccountRequest, marshalHostingApiAddCustomDomainRequest, marshalHostingApiCreateHostingRequest, marshalHostingApiDeleteHostingDomainsRequest, marshalHostingApiMigrateControlPanelRequest, marshalHostingApiRemoveCustomDomainRequest, marshalHostingApiUpdateHostingFreeDomainRequest, marshalHostingApiUpdateHostingRequest, marshalMailAccountApiChangeMailAccountPasswordRequest, marshalMailAccountApiCreateMailAccountRequest, marshalMailAccountApiRemoveMailAccountRequest, marshalWebsiteApiCreateWebsiteRequest, unmarshalBackup, unmarshalCheckFreeDomainAvailabilityResponse, unmarshalCheckUserOwnsDomainResponse, unmarshalDatabase, unmarshalDatabaseUser, unmarshalDnsRecords, unmarshalDomain, unmarshalFtpAccount, unmarshalHosting, unmarshalHostingSummary, unmarshalListBackupItemsResponse, unmarshalListBackupsResponse, unmarshalListControlPanelsResponse, unmarshalListDatabaseUsersResponse, unmarshalListDatabasesResponse, unmarshalListFreeRootDomainsResponse, unmarshalListFtpAccountsResponse, unmarshalListHostingsResponse, unmarshalListMailAccountsResponse, unmarshalListOffersResponse, unmarshalListRecentProgressesResponse, unmarshalListWebsitesResponse, unmarshalMailAccount, unmarshalProgress, unmarshalResetHostingPasswordResponse, unmarshalResourceSummary, unmarshalRestoreBackupItemsResponse, unmarshalRestoreBackupResponse, unmarshalSearchDomainsResponse, unmarshalSession, unmarshalWebsite };