@scaleway/sdk-webhosting 1.0.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.
@@ -0,0 +1,747 @@
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 ControlPanelAPI extends sdkClient.API {
10
+ /** Lists the available regions of the API. */
11
+ static LOCALITIES = [
12
+ "fr-par",
13
+ "nl-ams",
14
+ "pl-waw"
15
+ ];
16
+ pageOfListControlPanels = (request = {}) => this.client.fetch(
17
+ {
18
+ method: "GET",
19
+ path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/control-panels`,
20
+ urlParams: sdkClient.urlParams(
21
+ ["page", request.page],
22
+ [
23
+ "page_size",
24
+ request.pageSize ?? this.client.settings.defaultPageSize
25
+ ]
26
+ )
27
+ },
28
+ marshalling_gen.unmarshalListControlPanelsResponse
29
+ );
30
+ /**
31
+ * "List the control panels type: cpanel or plesk.".
32
+ *
33
+ * @param request - The request {@link ControlPanelApiListControlPanelsRequest}
34
+ * @returns A Promise of ListControlPanelsResponse
35
+ */
36
+ listControlPanels = (request = {}) => sdkClient.enrichForPagination("controlPanels", this.pageOfListControlPanels, request);
37
+ }
38
+ class DatabaseAPI extends sdkClient.API {
39
+ /** Lists the available regions of the API. */
40
+ static LOCALITIES = [
41
+ "fr-par",
42
+ "nl-ams",
43
+ "pl-waw"
44
+ ];
45
+ /**
46
+ * "Create a new database within your hosting plan".
47
+ *
48
+ * @param request - The request {@link DatabaseApiCreateDatabaseRequest}
49
+ * @returns A Promise of Database
50
+ */
51
+ createDatabase = (request) => this.client.fetch(
52
+ {
53
+ body: JSON.stringify(
54
+ marshalling_gen.marshalDatabaseApiCreateDatabaseRequest(
55
+ request,
56
+ this.client.settings
57
+ )
58
+ ),
59
+ headers: jsonContentHeaders,
60
+ method: "POST",
61
+ path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/databases`
62
+ },
63
+ marshalling_gen.unmarshalDatabase
64
+ );
65
+ pageOfListDatabases = (request) => this.client.fetch(
66
+ {
67
+ method: "GET",
68
+ path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/databases`,
69
+ urlParams: sdkClient.urlParams(
70
+ ["order_by", request.orderBy],
71
+ ["page", request.page],
72
+ [
73
+ "page_size",
74
+ request.pageSize ?? this.client.settings.defaultPageSize
75
+ ]
76
+ )
77
+ },
78
+ marshalling_gen.unmarshalListDatabasesResponse
79
+ );
80
+ /**
81
+ * "List all databases within your hosting plan".
82
+ *
83
+ * @param request - The request {@link DatabaseApiListDatabasesRequest}
84
+ * @returns A Promise of ListDatabasesResponse
85
+ */
86
+ listDatabases = (request) => sdkClient.enrichForPagination("databases", this.pageOfListDatabases, request);
87
+ /**
88
+ * "Get details of a database within your hosting plan".
89
+ *
90
+ * @param request - The request {@link DatabaseApiGetDatabaseRequest}
91
+ * @returns A Promise of Database
92
+ */
93
+ getDatabase = (request) => this.client.fetch(
94
+ {
95
+ method: "GET",
96
+ 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)}`
97
+ },
98
+ marshalling_gen.unmarshalDatabase
99
+ );
100
+ /**
101
+ * "Delete a database within your hosting plan".
102
+ *
103
+ * @param request - The request {@link DatabaseApiDeleteDatabaseRequest}
104
+ * @returns A Promise of Database
105
+ */
106
+ deleteDatabase = (request) => this.client.fetch(
107
+ {
108
+ method: "DELETE",
109
+ 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)}`
110
+ },
111
+ marshalling_gen.unmarshalDatabase
112
+ );
113
+ /**
114
+ * "Create a new database user".
115
+ *
116
+ * @param request - The request {@link DatabaseApiCreateDatabaseUserRequest}
117
+ * @returns A Promise of DatabaseUser
118
+ */
119
+ createDatabaseUser = (request) => this.client.fetch(
120
+ {
121
+ body: JSON.stringify(
122
+ marshalling_gen.marshalDatabaseApiCreateDatabaseUserRequest(
123
+ request,
124
+ this.client.settings
125
+ )
126
+ ),
127
+ headers: jsonContentHeaders,
128
+ method: "POST",
129
+ path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/databases-users`
130
+ },
131
+ marshalling_gen.unmarshalDatabaseUser
132
+ );
133
+ pageOfListDatabaseUsers = (request) => this.client.fetch(
134
+ {
135
+ method: "GET",
136
+ path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/database-users`,
137
+ urlParams: sdkClient.urlParams(
138
+ ["order_by", request.orderBy],
139
+ ["page", request.page],
140
+ [
141
+ "page_size",
142
+ request.pageSize ?? this.client.settings.defaultPageSize
143
+ ]
144
+ )
145
+ },
146
+ marshalling_gen.unmarshalListDatabaseUsersResponse
147
+ );
148
+ /**
149
+ * "List all database users".
150
+ *
151
+ * @param request - The request {@link DatabaseApiListDatabaseUsersRequest}
152
+ * @returns A Promise of ListDatabaseUsersResponse
153
+ */
154
+ listDatabaseUsers = (request) => sdkClient.enrichForPagination("users", this.pageOfListDatabaseUsers, request);
155
+ /**
156
+ * "Get details of a database user".
157
+ *
158
+ * @param request - The request {@link DatabaseApiGetDatabaseUserRequest}
159
+ * @returns A Promise of DatabaseUser
160
+ */
161
+ getDatabaseUser = (request) => this.client.fetch(
162
+ {
163
+ method: "GET",
164
+ 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)}`
165
+ },
166
+ marshalling_gen.unmarshalDatabaseUser
167
+ );
168
+ /**
169
+ * "Delete a database user".
170
+ *
171
+ * @param request - The request {@link DatabaseApiDeleteDatabaseUserRequest}
172
+ * @returns A Promise of DatabaseUser
173
+ */
174
+ deleteDatabaseUser = (request) => this.client.fetch(
175
+ {
176
+ method: "DELETE",
177
+ 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)}`
178
+ },
179
+ marshalling_gen.unmarshalDatabaseUser
180
+ );
181
+ /**
182
+ * "Change the password of a database user".
183
+ *
184
+ * @param request - The request {@link DatabaseApiChangeDatabaseUserPasswordRequest}
185
+ * @returns A Promise of DatabaseUser
186
+ */
187
+ changeDatabaseUserPassword = (request) => this.client.fetch(
188
+ {
189
+ body: JSON.stringify(
190
+ marshalling_gen.marshalDatabaseApiChangeDatabaseUserPasswordRequest(
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-users/${sdkClient.validatePathParam("username", request.username)}/change-password`
198
+ },
199
+ marshalling_gen.unmarshalDatabaseUser
200
+ );
201
+ /**
202
+ * "Assign a database user to a database".
203
+ *
204
+ * @param request - The request {@link DatabaseApiAssignDatabaseUserRequest}
205
+ * @returns A Promise of DatabaseUser
206
+ */
207
+ assignDatabaseUser = (request) => this.client.fetch(
208
+ {
209
+ body: JSON.stringify(
210
+ marshalling_gen.marshalDatabaseApiAssignDatabaseUserRequest(
211
+ request,
212
+ this.client.settings
213
+ )
214
+ ),
215
+ headers: jsonContentHeaders,
216
+ method: "POST",
217
+ 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`
218
+ },
219
+ marshalling_gen.unmarshalDatabaseUser
220
+ );
221
+ /**
222
+ * "Unassign a database user from a database".
223
+ *
224
+ * @param request - The request {@link DatabaseApiUnassignDatabaseUserRequest}
225
+ * @returns A Promise of DatabaseUser
226
+ */
227
+ unassignDatabaseUser = (request) => this.client.fetch(
228
+ {
229
+ body: JSON.stringify(
230
+ marshalling_gen.marshalDatabaseApiUnassignDatabaseUserRequest(
231
+ request,
232
+ this.client.settings
233
+ )
234
+ ),
235
+ headers: jsonContentHeaders,
236
+ method: "POST",
237
+ 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`
238
+ },
239
+ marshalling_gen.unmarshalDatabaseUser
240
+ );
241
+ }
242
+ class DnsAPI extends sdkClient.API {
243
+ /** Lists the available regions of the API. */
244
+ static LOCALITIES = [
245
+ "fr-par",
246
+ "nl-ams",
247
+ "pl-waw"
248
+ ];
249
+ /**
250
+ * Get DNS records. Get the set of DNS records of a specified domain associated with a Web Hosting plan's domain.
251
+ *
252
+ * @param request - The request {@link DnsApiGetDomainDnsRecordsRequest}
253
+ * @returns A Promise of DnsRecords
254
+ */
255
+ getDomainDnsRecords = (request) => this.client.fetch(
256
+ {
257
+ method: "GET",
258
+ path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${sdkClient.validatePathParam("domain", request.domain)}/dns-records`
259
+ },
260
+ marshalling_gen.unmarshalDnsRecords
261
+ );
262
+ /**
263
+ * Check whether you own this domain or not.. Check whether you own this domain or not.
264
+ *
265
+ * @param request - The request {@link DnsApiCheckUserOwnsDomainRequest}
266
+ * @returns A Promise of CheckUserOwnsDomainResponse
267
+ */
268
+ checkUserOwnsDomain = (request) => this.client.fetch(
269
+ {
270
+ body: JSON.stringify(
271
+ marshalling_gen.marshalDnsApiCheckUserOwnsDomainRequest(
272
+ request,
273
+ this.client.settings
274
+ )
275
+ ),
276
+ headers: jsonContentHeaders,
277
+ method: "POST",
278
+ path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${sdkClient.validatePathParam("domain", request.domain)}/check-ownership`
279
+ },
280
+ marshalling_gen.unmarshalCheckUserOwnsDomainResponse
281
+ );
282
+ /**
283
+ * Synchronize your DNS records on the Elements Console and on cPanel.. Synchronize your DNS records on the Elements Console and on cPanel.
284
+ *
285
+ * @param request - The request {@link DnsApiSyncDomainDnsRecordsRequest}
286
+ * @returns A Promise of DnsRecords
287
+ */
288
+ syncDomainDnsRecords = (request) => this.client.fetch(
289
+ {
290
+ body: JSON.stringify(
291
+ marshalling_gen.marshalDnsApiSyncDomainDnsRecordsRequest(
292
+ request,
293
+ this.client.settings
294
+ )
295
+ ),
296
+ headers: jsonContentHeaders,
297
+ method: "POST",
298
+ path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${sdkClient.validatePathParam("domain", request.domain)}/sync-domain-dns-records`
299
+ },
300
+ marshalling_gen.unmarshalDnsRecords
301
+ );
302
+ /**
303
+ * Search for available domains based on domain name.. Search for available domains based on domain name.
304
+ *
305
+ * @param request - The request {@link DnsApiSearchDomainsRequest}
306
+ * @returns A Promise of SearchDomainsResponse
307
+ */
308
+ searchDomains = (request) => this.client.fetch(
309
+ {
310
+ method: "GET",
311
+ path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/search-domains`,
312
+ urlParams: sdkClient.urlParams(
313
+ ["domain_name", request.domainName],
314
+ [
315
+ "project_id",
316
+ request.projectId ?? this.client.settings.defaultProjectId
317
+ ]
318
+ )
319
+ },
320
+ marshalling_gen.unmarshalSearchDomainsResponse
321
+ );
322
+ /**
323
+ * 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.
324
+ *
325
+ * @param request - The request {@link DnsApiGetDomainRequest}
326
+ * @returns A Promise of Domain
327
+ */
328
+ getDomain = (request) => this.client.fetch(
329
+ {
330
+ method: "GET",
331
+ path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${sdkClient.validatePathParam("domainName", request.domainName)}`,
332
+ urlParams: sdkClient.urlParams([
333
+ "project_id",
334
+ request.projectId ?? this.client.settings.defaultProjectId
335
+ ])
336
+ },
337
+ marshalling_gen.unmarshalDomain
338
+ );
339
+ /**
340
+ * Waits for {@link Domain} to be in a final state.
341
+ *
342
+ * @param request - The request {@link DnsApiGetDomainRequest}
343
+ * @param options - The waiting options
344
+ * @returns A Promise of Domain
345
+ */
346
+ waitForDomain = (request, options) => sdkClient.waitForResource(
347
+ options?.stop ?? ((res) => Promise.resolve(
348
+ !content_gen.DOMAIN_TRANSIENT_STATUSES.includes(res.status)
349
+ )),
350
+ this.getDomain,
351
+ request,
352
+ options
353
+ );
354
+ }
355
+ class OfferAPI extends sdkClient.API {
356
+ /** Lists the available regions of the API. */
357
+ static LOCALITIES = [
358
+ "fr-par",
359
+ "nl-ams",
360
+ "pl-waw"
361
+ ];
362
+ pageOfListOffers = (request = {}) => this.client.fetch(
363
+ {
364
+ method: "GET",
365
+ path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/offers`,
366
+ urlParams: sdkClient.urlParams(
367
+ ["control_panels", request.controlPanels],
368
+ ["hosting_id", request.hostingId],
369
+ ["order_by", request.orderBy],
370
+ ["page", request.page],
371
+ [
372
+ "page_size",
373
+ request.pageSize ?? this.client.settings.defaultPageSize
374
+ ]
375
+ )
376
+ },
377
+ marshalling_gen.unmarshalListOffersResponse
378
+ );
379
+ /**
380
+ * List all available hosting offers along with their specific options.. List all available hosting offers along with their specific options.
381
+ *
382
+ * @param request - The request {@link OfferApiListOffersRequest}
383
+ * @returns A Promise of ListOffersResponse
384
+ */
385
+ listOffers = (request = {}) => sdkClient.enrichForPagination("offers", this.pageOfListOffers, request);
386
+ }
387
+ class HostingAPI extends sdkClient.API {
388
+ /** Lists the available regions of the API. */
389
+ static LOCALITIES = [
390
+ "fr-par",
391
+ "nl-ams",
392
+ "pl-waw"
393
+ ];
394
+ /**
395
+ * Order a Web Hosting plan. Order a Web Hosting plan, specifying the offer type required via the `offer_id` parameter.
396
+ *
397
+ * @param request - The request {@link HostingApiCreateHostingRequest}
398
+ * @returns A Promise of Hosting
399
+ */
400
+ createHosting = (request) => this.client.fetch(
401
+ {
402
+ body: JSON.stringify(
403
+ marshalling_gen.marshalHostingApiCreateHostingRequest(request, this.client.settings)
404
+ ),
405
+ headers: jsonContentHeaders,
406
+ method: "POST",
407
+ path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings`
408
+ },
409
+ marshalling_gen.unmarshalHosting
410
+ );
411
+ pageOfListHostings = (request = {}) => this.client.fetch(
412
+ {
413
+ method: "GET",
414
+ path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings`,
415
+ urlParams: sdkClient.urlParams(
416
+ ["control_panels", request.controlPanels],
417
+ ["domain", request.domain],
418
+ ["order_by", request.orderBy],
419
+ ["organization_id", request.organizationId],
420
+ ["page", request.page],
421
+ [
422
+ "page_size",
423
+ request.pageSize ?? this.client.settings.defaultPageSize
424
+ ],
425
+ ["project_id", request.projectId],
426
+ ["statuses", request.statuses],
427
+ ["tags", request.tags]
428
+ )
429
+ },
430
+ marshalling_gen.unmarshalListHostingsResponse
431
+ );
432
+ /**
433
+ * 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.
434
+ *
435
+ * @param request - The request {@link HostingApiListHostingsRequest}
436
+ * @returns A Promise of ListHostingsResponse
437
+ */
438
+ listHostings = (request = {}) => sdkClient.enrichForPagination("hostings", this.pageOfListHostings, request);
439
+ /**
440
+ * Get a Web Hosting plan. Get the details of one of your existing Web Hosting plans, specified by its `hosting_id`.
441
+ *
442
+ * @param request - The request {@link HostingApiGetHostingRequest}
443
+ * @returns A Promise of Hosting
444
+ */
445
+ getHosting = (request) => this.client.fetch(
446
+ {
447
+ method: "GET",
448
+ path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}`
449
+ },
450
+ marshalling_gen.unmarshalHosting
451
+ );
452
+ /**
453
+ * Waits for {@link Hosting} to be in a final state.
454
+ *
455
+ * @param request - The request {@link HostingApiGetHostingRequest}
456
+ * @param options - The waiting options
457
+ * @returns A Promise of Hosting
458
+ */
459
+ waitForHosting = (request, options) => sdkClient.waitForResource(
460
+ options?.stop ?? ((res) => Promise.resolve(
461
+ !content_gen.HOSTING_TRANSIENT_STATUSES.includes(res.status)
462
+ )),
463
+ this.getHosting,
464
+ request,
465
+ options
466
+ );
467
+ /**
468
+ * 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.
469
+ *
470
+ * @param request - The request {@link HostingApiUpdateHostingRequest}
471
+ * @returns A Promise of Hosting
472
+ */
473
+ updateHosting = (request) => this.client.fetch(
474
+ {
475
+ body: JSON.stringify(
476
+ marshalling_gen.marshalHostingApiUpdateHostingRequest(request, this.client.settings)
477
+ ),
478
+ headers: jsonContentHeaders,
479
+ method: "PATCH",
480
+ path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}`
481
+ },
482
+ marshalling_gen.unmarshalHosting
483
+ );
484
+ /**
485
+ * 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.
486
+ *
487
+ * @param request - The request {@link HostingApiDeleteHostingRequest}
488
+ * @returns A Promise of Hosting
489
+ */
490
+ deleteHosting = (request) => this.client.fetch(
491
+ {
492
+ method: "DELETE",
493
+ path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}`
494
+ },
495
+ marshalling_gen.unmarshalHosting
496
+ );
497
+ /**
498
+ * Create a user session.
499
+ *
500
+ * @param request - The request {@link HostingApiCreateSessionRequest}
501
+ * @returns A Promise of Session
502
+ */
503
+ createSession = (request) => this.client.fetch(
504
+ {
505
+ body: "{}",
506
+ headers: jsonContentHeaders,
507
+ method: "POST",
508
+ path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/sessions`
509
+ },
510
+ marshalling_gen.unmarshalSession
511
+ );
512
+ /**
513
+ * Reset a Web Hosting plan password.
514
+ *
515
+ * @param request - The request {@link HostingApiResetHostingPasswordRequest}
516
+ * @returns A Promise of ResetHostingPasswordResponse
517
+ */
518
+ resetHostingPassword = (request) => this.client.fetch(
519
+ {
520
+ body: "{}",
521
+ headers: jsonContentHeaders,
522
+ method: "POST",
523
+ path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/reset-password`
524
+ },
525
+ marshalling_gen.unmarshalResetHostingPasswordResponse
526
+ );
527
+ /**
528
+ * Get the total counts of websites, databases, email accounts, and FTP accounts of a Web Hosting plan.
529
+ *
530
+ * @param request - The request {@link HostingApiGetResourceSummaryRequest}
531
+ * @returns A Promise of ResourceSummary
532
+ */
533
+ getResourceSummary = (request) => this.client.fetch(
534
+ {
535
+ method: "GET",
536
+ path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/resource-summary`
537
+ },
538
+ marshalling_gen.unmarshalResourceSummary
539
+ );
540
+ }
541
+ class FtpAccountAPI extends sdkClient.API {
542
+ /** Lists the available regions of the API. */
543
+ static LOCALITIES = [
544
+ "fr-par",
545
+ "nl-ams",
546
+ "pl-waw"
547
+ ];
548
+ /**
549
+ * Create a new FTP account within your hosting plan.. Create a new FTP account within your hosting plan.
550
+ *
551
+ * @param request - The request {@link FtpAccountApiCreateFtpAccountRequest}
552
+ * @returns A Promise of FtpAccount
553
+ */
554
+ createFtpAccount = (request) => this.client.fetch(
555
+ {
556
+ body: JSON.stringify(
557
+ marshalling_gen.marshalFtpAccountApiCreateFtpAccountRequest(
558
+ request,
559
+ this.client.settings
560
+ )
561
+ ),
562
+ headers: jsonContentHeaders,
563
+ method: "POST",
564
+ path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/ftp-accounts`
565
+ },
566
+ marshalling_gen.unmarshalFtpAccount
567
+ );
568
+ pageOfListFtpAccounts = (request) => this.client.fetch(
569
+ {
570
+ method: "GET",
571
+ path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/ftp-accounts`,
572
+ urlParams: sdkClient.urlParams(
573
+ ["domain", request.domain],
574
+ ["order_by", request.orderBy],
575
+ ["page", request.page],
576
+ [
577
+ "page_size",
578
+ request.pageSize ?? this.client.settings.defaultPageSize
579
+ ]
580
+ )
581
+ },
582
+ marshalling_gen.unmarshalListFtpAccountsResponse
583
+ );
584
+ /**
585
+ * List all FTP accounts within your hosting plan.. List all FTP accounts within your hosting plan.
586
+ *
587
+ * @param request - The request {@link FtpAccountApiListFtpAccountsRequest}
588
+ * @returns A Promise of ListFtpAccountsResponse
589
+ */
590
+ listFtpAccounts = (request) => sdkClient.enrichForPagination("ftpAccounts", this.pageOfListFtpAccounts, request);
591
+ /**
592
+ * Delete a specific FTP account within your hosting plan.. Delete a specific FTP account within your hosting plan.
593
+ *
594
+ * @param request - The request {@link FtpAccountApiRemoveFtpAccountRequest}
595
+ * @returns A Promise of FtpAccount
596
+ */
597
+ removeFtpAccount = (request) => this.client.fetch(
598
+ {
599
+ method: "DELETE",
600
+ 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)}`
601
+ },
602
+ marshalling_gen.unmarshalFtpAccount
603
+ );
604
+ changeFtpAccountPassword = (request) => this.client.fetch(
605
+ {
606
+ body: JSON.stringify(
607
+ marshalling_gen.marshalFtpAccountApiChangeFtpAccountPasswordRequest(
608
+ request,
609
+ this.client.settings
610
+ )
611
+ ),
612
+ headers: jsonContentHeaders,
613
+ method: "POST",
614
+ 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`
615
+ },
616
+ marshalling_gen.unmarshalFtpAccount
617
+ );
618
+ }
619
+ class MailAccountAPI extends sdkClient.API {
620
+ /** Lists the available regions of the API. */
621
+ static LOCALITIES = [
622
+ "fr-par",
623
+ "nl-ams",
624
+ "pl-waw"
625
+ ];
626
+ /**
627
+ * Create a new mail account within your hosting plan.. Create a new mail account within your hosting plan.
628
+ *
629
+ * @param request - The request {@link MailAccountApiCreateMailAccountRequest}
630
+ * @returns A Promise of MailAccount
631
+ */
632
+ createMailAccount = (request) => this.client.fetch(
633
+ {
634
+ body: JSON.stringify(
635
+ marshalling_gen.marshalMailAccountApiCreateMailAccountRequest(
636
+ request,
637
+ this.client.settings
638
+ )
639
+ ),
640
+ headers: jsonContentHeaders,
641
+ method: "POST",
642
+ path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/mail-accounts`
643
+ },
644
+ marshalling_gen.unmarshalMailAccount
645
+ );
646
+ pageOfListMailAccounts = (request) => this.client.fetch(
647
+ {
648
+ method: "GET",
649
+ path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/mail-accounts`,
650
+ urlParams: sdkClient.urlParams(
651
+ ["domain", request.domain],
652
+ ["order_by", request.orderBy],
653
+ ["page", request.page],
654
+ [
655
+ "page_size",
656
+ request.pageSize ?? this.client.settings.defaultPageSize
657
+ ]
658
+ )
659
+ },
660
+ marshalling_gen.unmarshalListMailAccountsResponse
661
+ );
662
+ /**
663
+ * List all mail accounts within your hosting plan.. List all mail accounts within your hosting plan.
664
+ *
665
+ * @param request - The request {@link MailAccountApiListMailAccountsRequest}
666
+ * @returns A Promise of ListMailAccountsResponse
667
+ */
668
+ listMailAccounts = (request) => sdkClient.enrichForPagination("mailAccounts", this.pageOfListMailAccounts, request);
669
+ /**
670
+ * Delete a mail account within your hosting plan.. Delete a mail account within your hosting plan.
671
+ *
672
+ * @param request - The request {@link MailAccountApiRemoveMailAccountRequest}
673
+ * @returns A Promise of MailAccount
674
+ */
675
+ removeMailAccount = (request) => this.client.fetch(
676
+ {
677
+ body: JSON.stringify(
678
+ marshalling_gen.marshalMailAccountApiRemoveMailAccountRequest(
679
+ request,
680
+ this.client.settings
681
+ )
682
+ ),
683
+ headers: jsonContentHeaders,
684
+ method: "POST",
685
+ path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/remove-mail-account`
686
+ },
687
+ marshalling_gen.unmarshalMailAccount
688
+ );
689
+ /**
690
+ * Update the password of a mail account within your hosting plan.. Update the password of a mail account within your hosting plan.
691
+ *
692
+ * @param request - The request {@link MailAccountApiChangeMailAccountPasswordRequest}
693
+ * @returns A Promise of MailAccount
694
+ */
695
+ changeMailAccountPassword = (request) => this.client.fetch(
696
+ {
697
+ body: JSON.stringify(
698
+ marshalling_gen.marshalMailAccountApiChangeMailAccountPasswordRequest(
699
+ request,
700
+ this.client.settings
701
+ )
702
+ ),
703
+ headers: jsonContentHeaders,
704
+ method: "POST",
705
+ path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/change-mail-password`
706
+ },
707
+ marshalling_gen.unmarshalMailAccount
708
+ );
709
+ }
710
+ class WebsiteAPI extends sdkClient.API {
711
+ /** Lists the available regions of the API. */
712
+ static LOCALITIES = [
713
+ "fr-par",
714
+ "nl-ams",
715
+ "pl-waw"
716
+ ];
717
+ pageOfListWebsites = (request) => this.client.fetch(
718
+ {
719
+ method: "GET",
720
+ path: `/webhosting/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${sdkClient.validatePathParam("hostingId", request.hostingId)}/websites`,
721
+ urlParams: sdkClient.urlParams(
722
+ ["order_by", request.orderBy],
723
+ ["page", request.page],
724
+ [
725
+ "page_size",
726
+ request.pageSize ?? this.client.settings.defaultPageSize
727
+ ]
728
+ )
729
+ },
730
+ marshalling_gen.unmarshalListWebsitesResponse
731
+ );
732
+ /**
733
+ * List all websites for a specific hosting.. List all websites for a specific hosting.
734
+ *
735
+ * @param request - The request {@link WebsiteApiListWebsitesRequest}
736
+ * @returns A Promise of ListWebsitesResponse
737
+ */
738
+ listWebsites = (request) => sdkClient.enrichForPagination("websites", this.pageOfListWebsites, request);
739
+ }
740
+ exports.ControlPanelAPI = ControlPanelAPI;
741
+ exports.DatabaseAPI = DatabaseAPI;
742
+ exports.DnsAPI = DnsAPI;
743
+ exports.FtpAccountAPI = FtpAccountAPI;
744
+ exports.HostingAPI = HostingAPI;
745
+ exports.MailAccountAPI = MailAccountAPI;
746
+ exports.OfferAPI = OfferAPI;
747
+ exports.WebsiteAPI = WebsiteAPI;