@scaleway/sdk-webhosting 1.3.0 → 2.1.1

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,983 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const sdkClient = require("@scaleway/sdk-client");
4
- const content_gen = require("./content.gen.cjs");
5
- const marshalling_gen = require("./marshalling.gen.cjs");
6
- const jsonContentHeaders = {
7
- "Content-Type": "application/json; charset=utf-8"
8
- };
9
- class BackupAPI extends sdkClient.API {
10
- /**
11
- * Locality of this API.
12
- * type ∈ {'zone','region','global','unspecified'}
13
- */
14
- static LOCALITY = sdkClient.toApiLocality({
15
- regions: ["fr-par", "nl-ams", "pl-waw"]
16
- });
17
- pageOfListBackups = (request) => this.client.fetch(
18
- {
19
- method: "GET",
20
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/backups`,
21
- urlParams: sdkClient.urlParams(
22
- ["order_by", request.orderBy],
23
- ["page", request.page],
24
- [
25
- "page_size",
26
- request.pageSize ?? this.client.settings.defaultPageSize
27
- ]
28
- )
29
- },
30
- marshalling_gen.unmarshalListBackupsResponse
31
- );
32
- /**
33
- * List all available backups for a hosting account.. List all available backups for a hosting account.
34
- *
35
- * @param request - The request {@link BackupApiListBackupsRequest}
36
- * @returns A Promise of ListBackupsResponse
37
- */
38
- listBackups = (request) => sdkClient.enrichForPagination("backups", this.pageOfListBackups, request);
39
- /**
40
- * Get info about a backup specified by the backup ID.. Get info about a backup specified by the backup ID.
41
- *
42
- * @param request - The request {@link BackupApiGetBackupRequest}
43
- * @returns A Promise of Backup
44
- */
45
- getBackup = (request) => this.client.fetch(
46
- {
47
- method: "GET",
48
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/backups/${sdkClient.validatePathParam("backupId", request.backupId)}`
49
- },
50
- marshalling_gen.unmarshalBackup
51
- );
52
- /**
53
- * Waits for {@link Backup} to be in a final state.
54
- *
55
- * @param request - The request {@link BackupApiGetBackupRequest}
56
- * @param options - The waiting options
57
- * @returns A Promise of Backup
58
- */
59
- waitForBackup = (request, options) => sdkClient.waitForResource(
60
- options?.stop ?? ((res) => Promise.resolve(
61
- !content_gen.BACKUP_TRANSIENT_STATUSES.includes(res.status)
62
- )),
63
- this.getBackup,
64
- request,
65
- options
66
- );
67
- /**
68
- * Restore an entire backup to your hosting environment.. Restore an entire backup to your hosting environment.
69
- *
70
- * @param request - The request {@link BackupApiRestoreBackupRequest}
71
- * @returns A Promise of RestoreBackupResponse
72
- */
73
- restoreBackup = (request) => this.client.fetch(
74
- {
75
- body: "{}",
76
- headers: jsonContentHeaders,
77
- method: "POST",
78
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/backups/${sdkClient.validatePathParam("backupId", request.backupId)}/restore`
79
- },
80
- marshalling_gen.unmarshalRestoreBackupResponse
81
- );
82
- /**
83
- * List items within a specific backup, grouped by type.. List items within a specific backup, grouped by type.
84
- *
85
- * @param request - The request {@link BackupApiListBackupItemsRequest}
86
- * @returns A Promise of ListBackupItemsResponse
87
- */
88
- listBackupItems = (request) => this.client.fetch(
89
- {
90
- method: "GET",
91
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/backup-items`,
92
- urlParams: sdkClient.urlParams(["backup_id", request.backupId])
93
- },
94
- marshalling_gen.unmarshalListBackupItemsResponse
95
- );
96
- /**
97
- * Restore specific items from a backup (e.g., a database or mailbox).. Restore specific items from a backup (e.g., a database or mailbox).
98
- *
99
- * @param request - The request {@link BackupApiRestoreBackupItemsRequest}
100
- * @returns A Promise of RestoreBackupItemsResponse
101
- */
102
- restoreBackupItems = (request) => this.client.fetch(
103
- {
104
- body: JSON.stringify(
105
- marshalling_gen.marshalBackupApiRestoreBackupItemsRequest(
106
- request,
107
- this.client.settings
108
- )
109
- ),
110
- headers: jsonContentHeaders,
111
- method: "POST",
112
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/restore-backup-items`
113
- },
114
- marshalling_gen.unmarshalRestoreBackupItemsResponse
115
- );
116
- /**
117
- * Retrieve detailed information about a specific progress by its ID.. Retrieve detailed information about a specific progress by its ID.
118
- *
119
- * @param request - The request {@link BackupApiGetProgressRequest}
120
- * @returns A Promise of Progress
121
- */
122
- getProgress = (request) => this.client.fetch(
123
- {
124
- method: "GET",
125
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/progresses/${sdkClient.validatePathParam("progressId", request.progressId)}`
126
- },
127
- marshalling_gen.unmarshalProgress
128
- );
129
- /**
130
- * List recent progresses associated with a specific backup, grouped by type.. List recent progresses associated with a specific backup, grouped by type.
131
- *
132
- * @param request - The request {@link BackupApiListRecentProgressesRequest}
133
- * @returns A Promise of ListRecentProgressesResponse
134
- */
135
- listRecentProgresses = (request) => this.client.fetch(
136
- {
137
- method: "GET",
138
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/progresses`
139
- },
140
- marshalling_gen.unmarshalListRecentProgressesResponse
141
- );
142
- }
143
- class ControlPanelAPI extends sdkClient.API {
144
- /**
145
- * Locality of this API.
146
- * type ∈ {'zone','region','global','unspecified'}
147
- */
148
- static LOCALITY = sdkClient.toApiLocality({
149
- regions: ["fr-par", "nl-ams", "pl-waw"]
150
- });
151
- pageOfListControlPanels = (request = {}) => this.client.fetch(
152
- {
153
- method: "GET",
154
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/control-panels`,
155
- urlParams: sdkClient.urlParams(
156
- ["page", request.page],
157
- [
158
- "page_size",
159
- request.pageSize ?? this.client.settings.defaultPageSize
160
- ]
161
- )
162
- },
163
- marshalling_gen.unmarshalListControlPanelsResponse
164
- );
165
- /**
166
- * "List the control panels type: cpanel or plesk.".
167
- *
168
- * @param request - The request {@link ControlPanelApiListControlPanelsRequest}
169
- * @returns A Promise of ListControlPanelsResponse
170
- */
171
- listControlPanels = (request = {}) => sdkClient.enrichForPagination("controlPanels", this.pageOfListControlPanels, request);
172
- }
173
- class DatabaseAPI extends sdkClient.API {
174
- /**
175
- * Locality of this API.
176
- * type ∈ {'zone','region','global','unspecified'}
177
- */
178
- static LOCALITY = sdkClient.toApiLocality({
179
- regions: ["fr-par", "nl-ams", "pl-waw"]
180
- });
181
- /**
182
- * "Create a new database within your hosting plan".
183
- *
184
- * @param request - The request {@link DatabaseApiCreateDatabaseRequest}
185
- * @returns A Promise of Database
186
- */
187
- createDatabase = (request) => this.client.fetch(
188
- {
189
- body: JSON.stringify(
190
- marshalling_gen.marshalDatabaseApiCreateDatabaseRequest(
191
- request,
192
- this.client.settings
193
- )
194
- ),
195
- headers: jsonContentHeaders,
196
- method: "POST",
197
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/databases`
198
- },
199
- marshalling_gen.unmarshalDatabase
200
- );
201
- pageOfListDatabases = (request) => this.client.fetch(
202
- {
203
- method: "GET",
204
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/databases`,
205
- urlParams: sdkClient.urlParams(
206
- ["order_by", request.orderBy],
207
- ["page", request.page],
208
- [
209
- "page_size",
210
- request.pageSize ?? this.client.settings.defaultPageSize
211
- ]
212
- )
213
- },
214
- marshalling_gen.unmarshalListDatabasesResponse
215
- );
216
- /**
217
- * "List all databases within your hosting plan".
218
- *
219
- * @param request - The request {@link DatabaseApiListDatabasesRequest}
220
- * @returns A Promise of ListDatabasesResponse
221
- */
222
- listDatabases = (request) => sdkClient.enrichForPagination("databases", this.pageOfListDatabases, request);
223
- /**
224
- * "Get details of a database within your hosting plan".
225
- *
226
- * @param request - The request {@link DatabaseApiGetDatabaseRequest}
227
- * @returns A Promise of Database
228
- */
229
- getDatabase = (request) => this.client.fetch(
230
- {
231
- method: "GET",
232
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/databases/${sdkClient.validatePathParam("databaseName", request.databaseName)}`
233
- },
234
- marshalling_gen.unmarshalDatabase
235
- );
236
- /**
237
- * "Delete a database within your hosting plan".
238
- *
239
- * @param request - The request {@link DatabaseApiDeleteDatabaseRequest}
240
- * @returns A Promise of Database
241
- */
242
- deleteDatabase = (request) => this.client.fetch(
243
- {
244
- method: "DELETE",
245
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/databases/${sdkClient.validatePathParam("databaseName", request.databaseName)}`
246
- },
247
- marshalling_gen.unmarshalDatabase
248
- );
249
- /**
250
- * "Create a new database user".
251
- *
252
- * @param request - The request {@link DatabaseApiCreateDatabaseUserRequest}
253
- * @returns A Promise of DatabaseUser
254
- */
255
- createDatabaseUser = (request) => this.client.fetch(
256
- {
257
- body: JSON.stringify(
258
- marshalling_gen.marshalDatabaseApiCreateDatabaseUserRequest(
259
- request,
260
- this.client.settings
261
- )
262
- ),
263
- headers: jsonContentHeaders,
264
- method: "POST",
265
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/databases-users`
266
- },
267
- marshalling_gen.unmarshalDatabaseUser
268
- );
269
- pageOfListDatabaseUsers = (request) => this.client.fetch(
270
- {
271
- method: "GET",
272
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/database-users`,
273
- urlParams: sdkClient.urlParams(
274
- ["order_by", request.orderBy],
275
- ["page", request.page],
276
- [
277
- "page_size",
278
- request.pageSize ?? this.client.settings.defaultPageSize
279
- ]
280
- )
281
- },
282
- marshalling_gen.unmarshalListDatabaseUsersResponse
283
- );
284
- /**
285
- * "List all database users".
286
- *
287
- * @param request - The request {@link DatabaseApiListDatabaseUsersRequest}
288
- * @returns A Promise of ListDatabaseUsersResponse
289
- */
290
- listDatabaseUsers = (request) => sdkClient.enrichForPagination("users", this.pageOfListDatabaseUsers, request);
291
- /**
292
- * "Get details of a database user".
293
- *
294
- * @param request - The request {@link DatabaseApiGetDatabaseUserRequest}
295
- * @returns A Promise of DatabaseUser
296
- */
297
- getDatabaseUser = (request) => this.client.fetch(
298
- {
299
- method: "GET",
300
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/databases-users/${sdkClient.validatePathParam("username", request.username)}`
301
- },
302
- marshalling_gen.unmarshalDatabaseUser
303
- );
304
- /**
305
- * "Delete a database user".
306
- *
307
- * @param request - The request {@link DatabaseApiDeleteDatabaseUserRequest}
308
- * @returns A Promise of DatabaseUser
309
- */
310
- deleteDatabaseUser = (request) => this.client.fetch(
311
- {
312
- method: "DELETE",
313
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/database-users/${sdkClient.validatePathParam("username", request.username)}`
314
- },
315
- marshalling_gen.unmarshalDatabaseUser
316
- );
317
- /**
318
- * "Change the password of a database user".
319
- *
320
- * @param request - The request {@link DatabaseApiChangeDatabaseUserPasswordRequest}
321
- * @returns A Promise of DatabaseUser
322
- */
323
- changeDatabaseUserPassword = (request) => this.client.fetch(
324
- {
325
- body: JSON.stringify(
326
- marshalling_gen.marshalDatabaseApiChangeDatabaseUserPasswordRequest(
327
- request,
328
- this.client.settings
329
- )
330
- ),
331
- headers: jsonContentHeaders,
332
- method: "POST",
333
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/databases-users/${sdkClient.validatePathParam("username", request.username)}/change-password`
334
- },
335
- marshalling_gen.unmarshalDatabaseUser
336
- );
337
- /**
338
- * "Assign a database user to a database".
339
- *
340
- * @param request - The request {@link DatabaseApiAssignDatabaseUserRequest}
341
- * @returns A Promise of DatabaseUser
342
- */
343
- assignDatabaseUser = (request) => this.client.fetch(
344
- {
345
- body: JSON.stringify(
346
- marshalling_gen.marshalDatabaseApiAssignDatabaseUserRequest(
347
- request,
348
- this.client.settings
349
- )
350
- ),
351
- headers: jsonContentHeaders,
352
- method: "POST",
353
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/databases/${sdkClient.validatePathParam("databaseName", request.databaseName)}/assign-user`
354
- },
355
- marshalling_gen.unmarshalDatabaseUser
356
- );
357
- /**
358
- * "Unassign a database user from a database".
359
- *
360
- * @param request - The request {@link DatabaseApiUnassignDatabaseUserRequest}
361
- * @returns A Promise of DatabaseUser
362
- */
363
- unassignDatabaseUser = (request) => this.client.fetch(
364
- {
365
- body: JSON.stringify(
366
- marshalling_gen.marshalDatabaseApiUnassignDatabaseUserRequest(
367
- request,
368
- this.client.settings
369
- )
370
- ),
371
- headers: jsonContentHeaders,
372
- method: "POST",
373
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/databases/${sdkClient.validatePathParam("databaseName", request.databaseName)}/unassign-user`
374
- },
375
- marshalling_gen.unmarshalDatabaseUser
376
- );
377
- }
378
- class DnsAPI extends sdkClient.API {
379
- /**
380
- * Locality of this API.
381
- * type ∈ {'zone','region','global','unspecified'}
382
- */
383
- static LOCALITY = sdkClient.toApiLocality({
384
- regions: ["fr-par", "nl-ams", "pl-waw"]
385
- });
386
- /**
387
- * Get DNS records. Get the set of DNS records of a specified domain associated with a Web Hosting plan's domain.
388
- *
389
- * @param request - The request {@link DnsApiGetDomainDnsRecordsRequest}
390
- * @returns A Promise of DnsRecords
391
- */
392
- getDomainDnsRecords = (request) => this.client.fetch(
393
- {
394
- method: "GET",
395
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${sdkClient.validatePathParam("domain", request.domain)}/dns-records`
396
- },
397
- marshalling_gen.unmarshalDnsRecords
398
- );
399
- /**
400
- * Check whether you own this domain or not.. Check whether you own this domain or not.
401
- *
402
- * @deprecated
403
- * @param request - The request {@link DnsApiCheckUserOwnsDomainRequest}
404
- * @returns A Promise of CheckUserOwnsDomainResponse
405
- */
406
- checkUserOwnsDomain = (request) => this.client.fetch(
407
- {
408
- body: JSON.stringify(
409
- marshalling_gen.marshalDnsApiCheckUserOwnsDomainRequest(
410
- request,
411
- this.client.settings
412
- )
413
- ),
414
- headers: jsonContentHeaders,
415
- method: "POST",
416
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${sdkClient.validatePathParam("domain", request.domain)}/check-ownership`
417
- },
418
- marshalling_gen.unmarshalCheckUserOwnsDomainResponse
419
- );
420
- /**
421
- * Synchronize your DNS records on the Elements Console and on cPanel.. Synchronize your DNS records on the Elements Console and on cPanel.
422
- *
423
- * @param request - The request {@link DnsApiSyncDomainDnsRecordsRequest}
424
- * @returns A Promise of DnsRecords
425
- */
426
- syncDomainDnsRecords = (request) => this.client.fetch(
427
- {
428
- body: JSON.stringify(
429
- marshalling_gen.marshalDnsApiSyncDomainDnsRecordsRequest(
430
- request,
431
- this.client.settings
432
- )
433
- ),
434
- headers: jsonContentHeaders,
435
- method: "POST",
436
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${sdkClient.validatePathParam("domain", request.domain)}/sync-domain-dns-records`
437
- },
438
- marshalling_gen.unmarshalDnsRecords
439
- );
440
- /**
441
- * Search for available domains based on domain name.. Search for available domains based on domain name.
442
- *
443
- * @param request - The request {@link DnsApiSearchDomainsRequest}
444
- * @returns A Promise of SearchDomainsResponse
445
- */
446
- searchDomains = (request) => this.client.fetch(
447
- {
448
- method: "GET",
449
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/search-domains`,
450
- urlParams: sdkClient.urlParams(
451
- ["domain_name", request.domainName],
452
- [
453
- "project_id",
454
- request.projectId ?? this.client.settings.defaultProjectId
455
- ]
456
- )
457
- },
458
- marshalling_gen.unmarshalSearchDomainsResponse
459
- );
460
- /**
461
- * Retrieve detailed information about a specific domain, including its status, DNS configuration, and ownership.. Retrieve detailed information about a specific domain, including its status, DNS configuration, and ownership.
462
- *
463
- * @param request - The request {@link DnsApiGetDomainRequest}
464
- * @returns A Promise of Domain
465
- */
466
- getDomain = (request) => this.client.fetch(
467
- {
468
- method: "GET",
469
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${sdkClient.validatePathParam("domainName", request.domainName)}`,
470
- urlParams: sdkClient.urlParams([
471
- "project_id",
472
- request.projectId ?? this.client.settings.defaultProjectId
473
- ])
474
- },
475
- marshalling_gen.unmarshalDomain
476
- );
477
- /**
478
- * Waits for {@link Domain} to be in a final state.
479
- *
480
- * @param request - The request {@link DnsApiGetDomainRequest}
481
- * @param options - The waiting options
482
- * @returns A Promise of Domain
483
- */
484
- waitForDomain = (request, options) => sdkClient.waitForResource(
485
- options?.stop ?? ((res) => Promise.resolve(
486
- !content_gen.DOMAIN_TRANSIENT_STATUSES.includes(res.status)
487
- )),
488
- this.getDomain,
489
- request,
490
- options
491
- );
492
- }
493
- class OfferAPI extends sdkClient.API {
494
- /**
495
- * Locality of this API.
496
- * type ∈ {'zone','region','global','unspecified'}
497
- */
498
- static LOCALITY = sdkClient.toApiLocality({
499
- regions: ["fr-par", "nl-ams", "pl-waw"]
500
- });
501
- pageOfListOffers = (request = {}) => this.client.fetch(
502
- {
503
- method: "GET",
504
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/offers`,
505
- urlParams: sdkClient.urlParams(
506
- ["control_panels", request.controlPanels],
507
- ["hosting_id", request.hostingId],
508
- ["order_by", request.orderBy],
509
- ["page", request.page],
510
- [
511
- "page_size",
512
- request.pageSize ?? this.client.settings.defaultPageSize
513
- ]
514
- )
515
- },
516
- marshalling_gen.unmarshalListOffersResponse
517
- );
518
- /**
519
- * List all available hosting offers along with their specific options.. List all available hosting offers along with their specific options.
520
- *
521
- * @param request - The request {@link OfferApiListOffersRequest}
522
- * @returns A Promise of ListOffersResponse
523
- */
524
- listOffers = (request = {}) => sdkClient.enrichForPagination("offers", this.pageOfListOffers, request);
525
- }
526
- class HostingAPI extends sdkClient.API {
527
- /**
528
- * Locality of this API.
529
- * type ∈ {'zone','region','global','unspecified'}
530
- */
531
- static LOCALITY = sdkClient.toApiLocality({
532
- regions: ["fr-par", "nl-ams", "pl-waw"]
533
- });
534
- /**
535
- * Order a Web Hosting plan. Order a Web Hosting plan, specifying the offer type required via the `offer_id` parameter.
536
- *
537
- * @param request - The request {@link HostingApiCreateHostingRequest}
538
- * @returns A Promise of Hosting
539
- */
540
- createHosting = (request) => this.client.fetch(
541
- {
542
- body: JSON.stringify(
543
- marshalling_gen.marshalHostingApiCreateHostingRequest(request, this.client.settings)
544
- ),
545
- headers: jsonContentHeaders,
546
- method: "POST",
547
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings`
548
- },
549
- marshalling_gen.unmarshalHosting
550
- );
551
- pageOfListHostings = (request = {}) => this.client.fetch(
552
- {
553
- method: "GET",
554
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings`,
555
- urlParams: sdkClient.urlParams(
556
- ["control_panels", request.controlPanels],
557
- ["domain", request.domain],
558
- ["order_by", request.orderBy],
559
- ["organization_id", request.organizationId],
560
- ["page", request.page],
561
- [
562
- "page_size",
563
- request.pageSize ?? this.client.settings.defaultPageSize
564
- ],
565
- ["project_id", request.projectId],
566
- ["statuses", request.statuses],
567
- ["subdomain", request.subdomain],
568
- ["tags", request.tags]
569
- )
570
- },
571
- marshalling_gen.unmarshalListHostingsResponse
572
- );
573
- /**
574
- * List all Web Hosting plans. List all of your existing Web Hosting plans. Various filters are available to limit the results, including filtering by domain, status, tag and Project ID.
575
- *
576
- * @param request - The request {@link HostingApiListHostingsRequest}
577
- * @returns A Promise of ListHostingsResponse
578
- */
579
- listHostings = (request = {}) => sdkClient.enrichForPagination("hostings", this.pageOfListHostings, request);
580
- /**
581
- * Get a Web Hosting plan. Get the details of one of your existing Web Hosting plans, specified by its `hosting_id`.
582
- *
583
- * @param request - The request {@link HostingApiGetHostingRequest}
584
- * @returns A Promise of Hosting
585
- */
586
- getHosting = (request) => this.client.fetch(
587
- {
588
- method: "GET",
589
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}`
590
- },
591
- marshalling_gen.unmarshalHosting
592
- );
593
- /**
594
- * Waits for {@link Hosting} to be in a final state.
595
- *
596
- * @param request - The request {@link HostingApiGetHostingRequest}
597
- * @param options - The waiting options
598
- * @returns A Promise of Hosting
599
- */
600
- waitForHosting = (request, options) => sdkClient.waitForResource(
601
- options?.stop ?? ((res) => Promise.resolve(
602
- !content_gen.HOSTING_TRANSIENT_STATUSES.includes(res.status)
603
- )),
604
- this.getHosting,
605
- request,
606
- options
607
- );
608
- /**
609
- * Update a Web Hosting plan. Update the details of one of your existing Web Hosting plans, specified by its `hosting_id`. You can update parameters including the contact email address, tags, options and offer.
610
- *
611
- * @param request - The request {@link HostingApiUpdateHostingRequest}
612
- * @returns A Promise of Hosting
613
- */
614
- updateHosting = (request) => this.client.fetch(
615
- {
616
- body: JSON.stringify(
617
- marshalling_gen.marshalHostingApiUpdateHostingRequest(request, this.client.settings)
618
- ),
619
- headers: jsonContentHeaders,
620
- method: "PATCH",
621
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}`
622
- },
623
- marshalling_gen.unmarshalHosting
624
- );
625
- /**
626
- * Delete a Web Hosting plan. Delete a Web Hosting plan, specified by its `hosting_id`. Note that deletion is not immediate: it will take place at the end of the calendar month, after which time your Web Hosting plan and all its data (files and emails) will be irreversibly lost.
627
- *
628
- * @param request - The request {@link HostingApiDeleteHostingRequest}
629
- * @returns A Promise of Hosting
630
- */
631
- deleteHosting = (request) => this.client.fetch(
632
- {
633
- method: "DELETE",
634
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}`
635
- },
636
- marshalling_gen.unmarshalHosting
637
- );
638
- /**
639
- * Create a user session.
640
- *
641
- * @param request - The request {@link HostingApiCreateSessionRequest}
642
- * @returns A Promise of Session
643
- */
644
- createSession = (request) => this.client.fetch(
645
- {
646
- body: "{}",
647
- headers: jsonContentHeaders,
648
- method: "POST",
649
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/sessions`
650
- },
651
- marshalling_gen.unmarshalSession
652
- );
653
- /**
654
- * Reset a Web Hosting plan password.
655
- *
656
- * @param request - The request {@link HostingApiResetHostingPasswordRequest}
657
- * @returns A Promise of ResetHostingPasswordResponse
658
- */
659
- resetHostingPassword = (request) => this.client.fetch(
660
- {
661
- body: "{}",
662
- headers: jsonContentHeaders,
663
- method: "POST",
664
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/reset-password`
665
- },
666
- marshalling_gen.unmarshalResetHostingPasswordResponse
667
- );
668
- /**
669
- * Get the total counts of websites, databases, email accounts, and FTP accounts of a Web Hosting plan.
670
- *
671
- * @param request - The request {@link HostingApiGetResourceSummaryRequest}
672
- * @returns A Promise of ResourceSummary
673
- */
674
- getResourceSummary = (request) => this.client.fetch(
675
- {
676
- method: "GET",
677
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/resource-summary`
678
- },
679
- marshalling_gen.unmarshalResourceSummary
680
- );
681
- /**
682
- * Attach a custom domain to a webhosting.
683
- *
684
- * @param request - The request {@link HostingApiAddCustomDomainRequest}
685
- * @returns A Promise of HostingSummary
686
- */
687
- addCustomDomain = (request) => this.client.fetch(
688
- {
689
- body: JSON.stringify(
690
- marshalling_gen.marshalHostingApiAddCustomDomainRequest(
691
- request,
692
- this.client.settings
693
- )
694
- ),
695
- headers: jsonContentHeaders,
696
- method: "POST",
697
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/add-custom-domain`
698
- },
699
- marshalling_gen.unmarshalHostingSummary
700
- );
701
- /**
702
- * Detach a custom domain from a webhosting.
703
- *
704
- * @param request - The request {@link HostingApiRemoveCustomDomainRequest}
705
- * @returns A Promise of HostingSummary
706
- */
707
- removeCustomDomain = (request) => this.client.fetch(
708
- {
709
- body: JSON.stringify(
710
- marshalling_gen.marshalHostingApiRemoveCustomDomainRequest(
711
- request,
712
- this.client.settings
713
- )
714
- ),
715
- headers: jsonContentHeaders,
716
- method: "POST",
717
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/remove-custom-domain`
718
- },
719
- marshalling_gen.unmarshalHostingSummary
720
- );
721
- }
722
- class FreeDomainAPI extends sdkClient.API {
723
- /**
724
- * Locality of this API.
725
- * type ∈ {'zone','region','global','unspecified'}
726
- */
727
- static LOCALITY = sdkClient.toApiLocality({
728
- regions: ["fr-par", "nl-ams", "pl-waw"]
729
- });
730
- /**
731
- * Check whether a given slug and free domain combination is available.. Check whether a given slug and free domain combination is available.
732
- *
733
- * @param request - The request {@link FreeDomainApiCheckFreeDomainAvailabilityRequest}
734
- * @returns A Promise of CheckFreeDomainAvailabilityResponse
735
- */
736
- checkFreeDomainAvailability = (request) => this.client.fetch(
737
- {
738
- body: JSON.stringify(
739
- marshalling_gen.marshalFreeDomainApiCheckFreeDomainAvailabilityRequest(
740
- request,
741
- this.client.settings
742
- )
743
- ),
744
- headers: jsonContentHeaders,
745
- method: "POST",
746
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/free-domains/check-availability`
747
- },
748
- marshalling_gen.unmarshalCheckFreeDomainAvailabilityResponse
749
- );
750
- pageOfListFreeRootDomains = (request = {}) => this.client.fetch(
751
- {
752
- method: "GET",
753
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/free-domains/root-domains`,
754
- urlParams: sdkClient.urlParams(
755
- ["page", request.page],
756
- [
757
- "page_size",
758
- request.pageSize ?? this.client.settings.defaultPageSize
759
- ]
760
- )
761
- },
762
- marshalling_gen.unmarshalListFreeRootDomainsResponse
763
- );
764
- /**
765
- * Retrieve the list of free root domains available for a Web Hosting.. Retrieve the list of free root domains available for a Web Hosting.
766
- *
767
- * @param request - The request {@link FreeDomainApiListFreeRootDomainsRequest}
768
- * @returns A Promise of ListFreeRootDomainsResponse
769
- */
770
- listFreeRootDomains = (request = {}) => sdkClient.enrichForPagination("rootDomains", this.pageOfListFreeRootDomains, request);
771
- }
772
- class FtpAccountAPI extends sdkClient.API {
773
- /**
774
- * Locality of this API.
775
- * type ∈ {'zone','region','global','unspecified'}
776
- */
777
- static LOCALITY = sdkClient.toApiLocality({
778
- regions: ["fr-par", "nl-ams", "pl-waw"]
779
- });
780
- /**
781
- * Create a new FTP account within your hosting plan.. Create a new FTP account within your hosting plan.
782
- *
783
- * @param request - The request {@link FtpAccountApiCreateFtpAccountRequest}
784
- * @returns A Promise of FtpAccount
785
- */
786
- createFtpAccount = (request) => this.client.fetch(
787
- {
788
- body: JSON.stringify(
789
- marshalling_gen.marshalFtpAccountApiCreateFtpAccountRequest(
790
- request,
791
- this.client.settings
792
- )
793
- ),
794
- headers: jsonContentHeaders,
795
- method: "POST",
796
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/ftp-accounts`
797
- },
798
- marshalling_gen.unmarshalFtpAccount
799
- );
800
- pageOfListFtpAccounts = (request) => this.client.fetch(
801
- {
802
- method: "GET",
803
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/ftp-accounts`,
804
- urlParams: sdkClient.urlParams(
805
- ["domain", request.domain],
806
- ["order_by", request.orderBy],
807
- ["page", request.page],
808
- [
809
- "page_size",
810
- request.pageSize ?? this.client.settings.defaultPageSize
811
- ]
812
- )
813
- },
814
- marshalling_gen.unmarshalListFtpAccountsResponse
815
- );
816
- /**
817
- * List all FTP accounts within your hosting plan.. List all FTP accounts within your hosting plan.
818
- *
819
- * @param request - The request {@link FtpAccountApiListFtpAccountsRequest}
820
- * @returns A Promise of ListFtpAccountsResponse
821
- */
822
- listFtpAccounts = (request) => sdkClient.enrichForPagination("ftpAccounts", this.pageOfListFtpAccounts, request);
823
- /**
824
- * Delete a specific FTP account within your hosting plan.. Delete a specific FTP account within your hosting plan.
825
- *
826
- * @param request - The request {@link FtpAccountApiRemoveFtpAccountRequest}
827
- * @returns A Promise of FtpAccount
828
- */
829
- removeFtpAccount = (request) => this.client.fetch(
830
- {
831
- method: "DELETE",
832
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/ftp-accounts/${sdkClient.validatePathParam("username", request.username)}`
833
- },
834
- marshalling_gen.unmarshalFtpAccount
835
- );
836
- changeFtpAccountPassword = (request) => this.client.fetch(
837
- {
838
- body: JSON.stringify(
839
- marshalling_gen.marshalFtpAccountApiChangeFtpAccountPasswordRequest(
840
- request,
841
- this.client.settings
842
- )
843
- ),
844
- headers: jsonContentHeaders,
845
- method: "POST",
846
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/ftp-accounts/${sdkClient.validatePathParam("username", request.username)}/change-password`
847
- },
848
- marshalling_gen.unmarshalFtpAccount
849
- );
850
- }
851
- class MailAccountAPI extends sdkClient.API {
852
- /**
853
- * Locality of this API.
854
- * type ∈ {'zone','region','global','unspecified'}
855
- */
856
- static LOCALITY = sdkClient.toApiLocality({
857
- regions: ["fr-par", "nl-ams", "pl-waw"]
858
- });
859
- /**
860
- * Create a new mail account within your hosting plan.. Create a new mail account within your hosting plan.
861
- *
862
- * @param request - The request {@link MailAccountApiCreateMailAccountRequest}
863
- * @returns A Promise of MailAccount
864
- */
865
- createMailAccount = (request) => this.client.fetch(
866
- {
867
- body: JSON.stringify(
868
- marshalling_gen.marshalMailAccountApiCreateMailAccountRequest(
869
- request,
870
- this.client.settings
871
- )
872
- ),
873
- headers: jsonContentHeaders,
874
- method: "POST",
875
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/mail-accounts`
876
- },
877
- marshalling_gen.unmarshalMailAccount
878
- );
879
- pageOfListMailAccounts = (request) => this.client.fetch(
880
- {
881
- method: "GET",
882
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/mail-accounts`,
883
- urlParams: sdkClient.urlParams(
884
- ["domain", request.domain],
885
- ["order_by", request.orderBy],
886
- ["page", request.page],
887
- [
888
- "page_size",
889
- request.pageSize ?? this.client.settings.defaultPageSize
890
- ]
891
- )
892
- },
893
- marshalling_gen.unmarshalListMailAccountsResponse
894
- );
895
- /**
896
- * List all mail accounts within your hosting plan.. List all mail accounts within your hosting plan.
897
- *
898
- * @param request - The request {@link MailAccountApiListMailAccountsRequest}
899
- * @returns A Promise of ListMailAccountsResponse
900
- */
901
- listMailAccounts = (request) => sdkClient.enrichForPagination("mailAccounts", this.pageOfListMailAccounts, request);
902
- /**
903
- * Delete a mail account within your hosting plan.. Delete a mail account within your hosting plan.
904
- *
905
- * @param request - The request {@link MailAccountApiRemoveMailAccountRequest}
906
- * @returns A Promise of MailAccount
907
- */
908
- removeMailAccount = (request) => this.client.fetch(
909
- {
910
- body: JSON.stringify(
911
- marshalling_gen.marshalMailAccountApiRemoveMailAccountRequest(
912
- request,
913
- this.client.settings
914
- )
915
- ),
916
- headers: jsonContentHeaders,
917
- method: "POST",
918
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/remove-mail-account`
919
- },
920
- marshalling_gen.unmarshalMailAccount
921
- );
922
- /**
923
- * Update the password of a mail account within your hosting plan.. Update the password of a mail account within your hosting plan.
924
- *
925
- * @param request - The request {@link MailAccountApiChangeMailAccountPasswordRequest}
926
- * @returns A Promise of MailAccount
927
- */
928
- changeMailAccountPassword = (request) => this.client.fetch(
929
- {
930
- body: JSON.stringify(
931
- marshalling_gen.marshalMailAccountApiChangeMailAccountPasswordRequest(
932
- request,
933
- this.client.settings
934
- )
935
- ),
936
- headers: jsonContentHeaders,
937
- method: "POST",
938
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/change-mail-password`
939
- },
940
- marshalling_gen.unmarshalMailAccount
941
- );
942
- }
943
- class WebsiteAPI extends sdkClient.API {
944
- /**
945
- * Locality of this API.
946
- * type ∈ {'zone','region','global','unspecified'}
947
- */
948
- static LOCALITY = sdkClient.toApiLocality({
949
- regions: ["fr-par", "nl-ams", "pl-waw"]
950
- });
951
- pageOfListWebsites = (request) => this.client.fetch(
952
- {
953
- method: "GET",
954
- path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/websites`,
955
- urlParams: sdkClient.urlParams(
956
- ["order_by", request.orderBy],
957
- ["page", request.page],
958
- [
959
- "page_size",
960
- request.pageSize ?? this.client.settings.defaultPageSize
961
- ]
962
- )
963
- },
964
- marshalling_gen.unmarshalListWebsitesResponse
965
- );
966
- /**
967
- * List all websites for a specific hosting.. List all websites for a specific hosting.
968
- *
969
- * @param request - The request {@link WebsiteApiListWebsitesRequest}
970
- * @returns A Promise of ListWebsitesResponse
971
- */
972
- listWebsites = (request) => sdkClient.enrichForPagination("websites", this.pageOfListWebsites, request);
973
- }
974
- exports.BackupAPI = BackupAPI;
975
- exports.ControlPanelAPI = ControlPanelAPI;
976
- exports.DatabaseAPI = DatabaseAPI;
977
- exports.DnsAPI = DnsAPI;
978
- exports.FreeDomainAPI = FreeDomainAPI;
979
- exports.FtpAccountAPI = FtpAccountAPI;
980
- exports.HostingAPI = HostingAPI;
981
- exports.MailAccountAPI = MailAccountAPI;
982
- exports.OfferAPI = OfferAPI;
983
- exports.WebsiteAPI = WebsiteAPI;