@scaleway/sdk-webhosting 2.7.0 → 2.8.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.
@@ -2,107 +2,59 @@ import { BACKUP_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, HOSTING_TRANSIENT
2
2
  import { 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 } from "./marshalling.gen.js";
3
3
  import { API, enrichForPagination, toApiLocality, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
4
4
  //#region src/v1/api.gen.ts
5
- var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
5
+ const jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
6
6
  /**
7
7
  * Web Hosting backup API.
8
8
 
9
9
  This API allows you to list and restore backups for your cPanel and WordPress Web Hosting service.
10
10
  */
11
11
  var BackupAPI = class extends API {
12
- /**
13
- * Locality of this API.
14
- * type {'zone','region','global','unspecified'}
15
- */
16
- static LOCALITY = toApiLocality({ regions: [
17
- "fr-par",
18
- "nl-ams",
19
- "pl-waw"
20
- ] });
21
- pageOfListBackups = (request) => this.client.fetch({
22
- method: "GET",
23
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/backups`,
24
- urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
25
- }, unmarshalListBackupsResponse);
26
- /**
27
- * List all available backups for a hosting account.. List all available backups for a hosting account.
28
- *
29
- * @param request - The request {@link BackupApiListBackupsRequest}
30
- * @returns A Promise of ListBackupsResponse
31
- */
32
- listBackups = (request) => enrichForPagination("backups", this.pageOfListBackups, request);
33
- /**
34
- * Get info about a backup specified by the backup ID.. Get info about a backup specified by the backup ID.
35
- *
36
- * @param request - The request {@link BackupApiGetBackupRequest}
37
- * @returns A Promise of Backup
38
- */
39
- getBackup = (request) => this.client.fetch({
40
- method: "GET",
41
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/backups/${validatePathParam("backupId", request.backupId)}`
42
- }, unmarshalBackup);
43
- /**
44
- * Waits for {@link Backup} to be in a final state.
45
- *
46
- * @param request - The request {@link BackupApiGetBackupRequest}
47
- * @param options - The waiting options
48
- * @returns A Promise of Backup
49
- */
50
- waitForBackup = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!BACKUP_TRANSIENT_STATUSES.includes(res.status))), this.getBackup, request, options);
51
- /**
52
- * Restore an entire backup to your hosting environment.. Restore an entire backup to your hosting environment.
53
- *
54
- * @param request - The request {@link BackupApiRestoreBackupRequest}
55
- * @returns A Promise of RestoreBackupResponse
56
- */
57
- restoreBackup = (request) => this.client.fetch({
58
- body: "{}",
59
- headers: jsonContentHeaders,
60
- method: "POST",
61
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/backups/${validatePathParam("backupId", request.backupId)}/restore`
62
- }, unmarshalRestoreBackupResponse);
63
- /**
64
- * List items within a specific backup, grouped by type.. List items within a specific backup, grouped by type.
65
- *
66
- * @param request - The request {@link BackupApiListBackupItemsRequest}
67
- * @returns A Promise of ListBackupItemsResponse
68
- */
69
- listBackupItems = (request) => this.client.fetch({
70
- method: "GET",
71
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/backup-items`,
72
- urlParams: urlParams(["backup_id", request.backupId])
73
- }, unmarshalListBackupItemsResponse);
74
- /**
75
- * Restore specific items from a backup (e.g., a database or mailbox).. Restore specific items from a backup (e.g., a database or mailbox).
76
- *
77
- * @param request - The request {@link BackupApiRestoreBackupItemsRequest}
78
- * @returns A Promise of RestoreBackupItemsResponse
79
- */
80
- restoreBackupItems = (request) => this.client.fetch({
81
- body: JSON.stringify(marshalBackupApiRestoreBackupItemsRequest(request, this.client.settings)),
82
- headers: jsonContentHeaders,
83
- method: "POST",
84
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/restore-backup-items`
85
- }, unmarshalRestoreBackupItemsResponse);
86
- /**
87
- * Retrieve detailed information about a specific progress by its ID.. Retrieve detailed information about a specific progress by its ID.
88
- *
89
- * @param request - The request {@link BackupApiGetProgressRequest}
90
- * @returns A Promise of Progress
91
- */
92
- getProgress = (request) => this.client.fetch({
93
- method: "GET",
94
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/progresses/${validatePathParam("progressId", request.progressId)}`
95
- }, unmarshalProgress);
96
- /**
97
- * List recent progresses associated with a specific backup, grouped by type.. List recent progresses associated with a specific backup, grouped by type.
98
- *
99
- * @param request - The request {@link BackupApiListRecentProgressesRequest}
100
- * @returns A Promise of ListRecentProgressesResponse
101
- */
102
- listRecentProgresses = (request) => this.client.fetch({
103
- method: "GET",
104
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/progresses`
105
- }, unmarshalListRecentProgressesResponse);
12
+ constructor(..._args) {
13
+ super(..._args);
14
+ this.pageOfListBackups = (request) => this.client.fetch({
15
+ method: "GET",
16
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/backups`,
17
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
18
+ }, unmarshalListBackupsResponse);
19
+ this.listBackups = (request) => enrichForPagination("backups", this.pageOfListBackups, request);
20
+ this.getBackup = (request) => this.client.fetch({
21
+ method: "GET",
22
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/backups/${validatePathParam("backupId", request.backupId)}`
23
+ }, unmarshalBackup);
24
+ this.waitForBackup = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!BACKUP_TRANSIENT_STATUSES.includes(res.status))), this.getBackup, request, options);
25
+ this.restoreBackup = (request) => this.client.fetch({
26
+ body: "{}",
27
+ headers: jsonContentHeaders,
28
+ method: "POST",
29
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/backups/${validatePathParam("backupId", request.backupId)}/restore`
30
+ }, unmarshalRestoreBackupResponse);
31
+ this.listBackupItems = (request) => this.client.fetch({
32
+ method: "GET",
33
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/backup-items`,
34
+ urlParams: urlParams(["backup_id", request.backupId])
35
+ }, unmarshalListBackupItemsResponse);
36
+ this.restoreBackupItems = (request) => this.client.fetch({
37
+ body: JSON.stringify(marshalBackupApiRestoreBackupItemsRequest(request, this.client.settings)),
38
+ headers: jsonContentHeaders,
39
+ method: "POST",
40
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/restore-backup-items`
41
+ }, unmarshalRestoreBackupItemsResponse);
42
+ this.getProgress = (request) => this.client.fetch({
43
+ method: "GET",
44
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/progresses/${validatePathParam("progressId", request.progressId)}`
45
+ }, unmarshalProgress);
46
+ this.listRecentProgresses = (request) => this.client.fetch({
47
+ method: "GET",
48
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/progresses`
49
+ }, unmarshalListRecentProgressesResponse);
50
+ }
51
+ static {
52
+ this.LOCALITY = toApiLocality({ regions: [
53
+ "fr-par",
54
+ "nl-ams",
55
+ "pl-waw"
56
+ ] });
57
+ }
106
58
  };
107
59
  /**
108
60
  * Web Hosting Control Panel API.
@@ -110,27 +62,22 @@ var BackupAPI = class extends API {
110
62
  This API allows you to manage your Web Hosting services.
111
63
  */
112
64
  var ControlPanelAPI = class extends API {
113
- /**
114
- * Locality of this API.
115
- * type {'zone','region','global','unspecified'}
116
- */
117
- static LOCALITY = toApiLocality({ regions: [
118
- "fr-par",
119
- "nl-ams",
120
- "pl-waw"
121
- ] });
122
- pageOfListControlPanels = (request = {}) => this.client.fetch({
123
- method: "GET",
124
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/control-panels`,
125
- urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
126
- }, unmarshalListControlPanelsResponse);
127
- /**
128
- * "List the control panels type: cpanel or plesk.".
129
- *
130
- * @param request - The request {@link ControlPanelApiListControlPanelsRequest}
131
- * @returns A Promise of ListControlPanelsResponse
132
- */
133
- listControlPanels = (request = {}) => enrichForPagination("controlPanels", this.pageOfListControlPanels, request);
65
+ constructor(..._args2) {
66
+ super(..._args2);
67
+ this.pageOfListControlPanels = (request = {}) => this.client.fetch({
68
+ method: "GET",
69
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/control-panels`,
70
+ urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
71
+ }, unmarshalListControlPanelsResponse);
72
+ this.listControlPanels = (request = {}) => enrichForPagination("controlPanels", this.pageOfListControlPanels, request);
73
+ }
74
+ static {
75
+ this.LOCALITY = toApiLocality({ regions: [
76
+ "fr-par",
77
+ "nl-ams",
78
+ "pl-waw"
79
+ ] });
80
+ }
134
81
  };
135
82
  /**
136
83
  * Web Hosting Database API.
@@ -138,139 +85,74 @@ var ControlPanelAPI = class extends API {
138
85
  This API allows you to manage your databases and database users for your Web Hosting services.
139
86
  */
140
87
  var DatabaseAPI = class extends API {
141
- /**
142
- * Locality of this API.
143
- * type {'zone','region','global','unspecified'}
144
- */
145
- static LOCALITY = toApiLocality({ regions: [
146
- "fr-par",
147
- "nl-ams",
148
- "pl-waw"
149
- ] });
150
- /**
151
- * "Create a new database within your hosting plan".
152
- *
153
- * @param request - The request {@link DatabaseApiCreateDatabaseRequest}
154
- * @returns A Promise of Database
155
- */
156
- createDatabase = (request) => this.client.fetch({
157
- body: JSON.stringify(marshalDatabaseApiCreateDatabaseRequest(request, this.client.settings)),
158
- headers: jsonContentHeaders,
159
- method: "POST",
160
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/databases`
161
- }, unmarshalDatabase);
162
- pageOfListDatabases = (request) => this.client.fetch({
163
- method: "GET",
164
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/databases`,
165
- urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
166
- }, unmarshalListDatabasesResponse);
167
- /**
168
- * "List all databases within your hosting plan".
169
- *
170
- * @param request - The request {@link DatabaseApiListDatabasesRequest}
171
- * @returns A Promise of ListDatabasesResponse
172
- */
173
- listDatabases = (request) => enrichForPagination("databases", this.pageOfListDatabases, request);
174
- /**
175
- * "Get details of a database within your hosting plan".
176
- *
177
- * @param request - The request {@link DatabaseApiGetDatabaseRequest}
178
- * @returns A Promise of Database
179
- */
180
- getDatabase = (request) => this.client.fetch({
181
- method: "GET",
182
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/databases/${validatePathParam("databaseName", request.databaseName)}`
183
- }, unmarshalDatabase);
184
- /**
185
- * "Delete a database within your hosting plan".
186
- *
187
- * @param request - The request {@link DatabaseApiDeleteDatabaseRequest}
188
- * @returns A Promise of Database
189
- */
190
- deleteDatabase = (request) => this.client.fetch({
191
- method: "DELETE",
192
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/databases/${validatePathParam("databaseName", request.databaseName)}`
193
- }, unmarshalDatabase);
194
- /**
195
- * "Create a new database user".
196
- *
197
- * @param request - The request {@link DatabaseApiCreateDatabaseUserRequest}
198
- * @returns A Promise of DatabaseUser
199
- */
200
- createDatabaseUser = (request) => this.client.fetch({
201
- body: JSON.stringify(marshalDatabaseApiCreateDatabaseUserRequest(request, this.client.settings)),
202
- headers: jsonContentHeaders,
203
- method: "POST",
204
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/databases-users`
205
- }, unmarshalDatabaseUser);
206
- pageOfListDatabaseUsers = (request) => this.client.fetch({
207
- method: "GET",
208
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/database-users`,
209
- urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
210
- }, unmarshalListDatabaseUsersResponse);
211
- /**
212
- * "List all database users".
213
- *
214
- * @param request - The request {@link DatabaseApiListDatabaseUsersRequest}
215
- * @returns A Promise of ListDatabaseUsersResponse
216
- */
217
- listDatabaseUsers = (request) => enrichForPagination("users", this.pageOfListDatabaseUsers, request);
218
- /**
219
- * "Get details of a database user".
220
- *
221
- * @param request - The request {@link DatabaseApiGetDatabaseUserRequest}
222
- * @returns A Promise of DatabaseUser
223
- */
224
- getDatabaseUser = (request) => this.client.fetch({
225
- method: "GET",
226
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/databases-users/${validatePathParam("username", request.username)}`
227
- }, unmarshalDatabaseUser);
228
- /**
229
- * "Delete a database user".
230
- *
231
- * @param request - The request {@link DatabaseApiDeleteDatabaseUserRequest}
232
- * @returns A Promise of DatabaseUser
233
- */
234
- deleteDatabaseUser = (request) => this.client.fetch({
235
- method: "DELETE",
236
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/database-users/${validatePathParam("username", request.username)}`
237
- }, unmarshalDatabaseUser);
238
- /**
239
- * "Change the password of a database user".
240
- *
241
- * @param request - The request {@link DatabaseApiChangeDatabaseUserPasswordRequest}
242
- * @returns A Promise of DatabaseUser
243
- */
244
- changeDatabaseUserPassword = (request) => this.client.fetch({
245
- body: JSON.stringify(marshalDatabaseApiChangeDatabaseUserPasswordRequest(request, this.client.settings)),
246
- headers: jsonContentHeaders,
247
- method: "POST",
248
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/databases-users/${validatePathParam("username", request.username)}/change-password`
249
- }, unmarshalDatabaseUser);
250
- /**
251
- * "Assign a database user to a database".
252
- *
253
- * @param request - The request {@link DatabaseApiAssignDatabaseUserRequest}
254
- * @returns A Promise of DatabaseUser
255
- */
256
- assignDatabaseUser = (request) => this.client.fetch({
257
- body: JSON.stringify(marshalDatabaseApiAssignDatabaseUserRequest(request, this.client.settings)),
258
- headers: jsonContentHeaders,
259
- method: "POST",
260
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/databases/${validatePathParam("databaseName", request.databaseName)}/assign-user`
261
- }, unmarshalDatabaseUser);
262
- /**
263
- * "Unassign a database user from a database".
264
- *
265
- * @param request - The request {@link DatabaseApiUnassignDatabaseUserRequest}
266
- * @returns A Promise of DatabaseUser
267
- */
268
- unassignDatabaseUser = (request) => this.client.fetch({
269
- body: JSON.stringify(marshalDatabaseApiUnassignDatabaseUserRequest(request, this.client.settings)),
270
- headers: jsonContentHeaders,
271
- method: "POST",
272
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/databases/${validatePathParam("databaseName", request.databaseName)}/unassign-user`
273
- }, unmarshalDatabaseUser);
88
+ constructor(..._args3) {
89
+ super(..._args3);
90
+ this.createDatabase = (request) => this.client.fetch({
91
+ body: JSON.stringify(marshalDatabaseApiCreateDatabaseRequest(request, this.client.settings)),
92
+ headers: jsonContentHeaders,
93
+ method: "POST",
94
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/databases`
95
+ }, unmarshalDatabase);
96
+ this.pageOfListDatabases = (request) => this.client.fetch({
97
+ method: "GET",
98
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/databases`,
99
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
100
+ }, unmarshalListDatabasesResponse);
101
+ this.listDatabases = (request) => enrichForPagination("databases", this.pageOfListDatabases, request);
102
+ this.getDatabase = (request) => this.client.fetch({
103
+ method: "GET",
104
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/databases/${validatePathParam("databaseName", request.databaseName)}`
105
+ }, unmarshalDatabase);
106
+ this.deleteDatabase = (request) => this.client.fetch({
107
+ method: "DELETE",
108
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/databases/${validatePathParam("databaseName", request.databaseName)}`
109
+ }, unmarshalDatabase);
110
+ this.createDatabaseUser = (request) => this.client.fetch({
111
+ body: JSON.stringify(marshalDatabaseApiCreateDatabaseUserRequest(request, this.client.settings)),
112
+ headers: jsonContentHeaders,
113
+ method: "POST",
114
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/databases-users`
115
+ }, unmarshalDatabaseUser);
116
+ this.pageOfListDatabaseUsers = (request) => this.client.fetch({
117
+ method: "GET",
118
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/database-users`,
119
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
120
+ }, unmarshalListDatabaseUsersResponse);
121
+ this.listDatabaseUsers = (request) => enrichForPagination("users", this.pageOfListDatabaseUsers, request);
122
+ this.getDatabaseUser = (request) => this.client.fetch({
123
+ method: "GET",
124
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/databases-users/${validatePathParam("username", request.username)}`
125
+ }, unmarshalDatabaseUser);
126
+ this.deleteDatabaseUser = (request) => this.client.fetch({
127
+ method: "DELETE",
128
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/database-users/${validatePathParam("username", request.username)}`
129
+ }, unmarshalDatabaseUser);
130
+ this.changeDatabaseUserPassword = (request) => this.client.fetch({
131
+ body: JSON.stringify(marshalDatabaseApiChangeDatabaseUserPasswordRequest(request, this.client.settings)),
132
+ headers: jsonContentHeaders,
133
+ method: "POST",
134
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/databases-users/${validatePathParam("username", request.username)}/change-password`
135
+ }, unmarshalDatabaseUser);
136
+ this.assignDatabaseUser = (request) => this.client.fetch({
137
+ body: JSON.stringify(marshalDatabaseApiAssignDatabaseUserRequest(request, this.client.settings)),
138
+ headers: jsonContentHeaders,
139
+ method: "POST",
140
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/databases/${validatePathParam("databaseName", request.databaseName)}/assign-user`
141
+ }, unmarshalDatabaseUser);
142
+ this.unassignDatabaseUser = (request) => this.client.fetch({
143
+ body: JSON.stringify(marshalDatabaseApiUnassignDatabaseUserRequest(request, this.client.settings)),
144
+ headers: jsonContentHeaders,
145
+ method: "POST",
146
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/databases/${validatePathParam("databaseName", request.databaseName)}/unassign-user`
147
+ }, unmarshalDatabaseUser);
148
+ }
149
+ static {
150
+ this.LOCALITY = toApiLocality({ regions: [
151
+ "fr-par",
152
+ "nl-ams",
153
+ "pl-waw"
154
+ ] });
155
+ }
274
156
  };
275
157
  /**
276
158
  * Web Hosting Dns API.
@@ -278,80 +160,43 @@ var DatabaseAPI = class extends API {
278
160
  This API allows you to manage your Web Hosting services.
279
161
  */
280
162
  var DnsAPI = class extends API {
281
- /**
282
- * Locality of this API.
283
- * type {'zone','region','global','unspecified'}
284
- */
285
- static LOCALITY = toApiLocality({ regions: [
286
- "fr-par",
287
- "nl-ams",
288
- "pl-waw"
289
- ] });
290
- /**
291
- * Get DNS records. Get the set of DNS records of a specified domain associated with a Web Hosting plan's domain.
292
- *
293
- * @param request - The request {@link DnsApiGetDomainDnsRecordsRequest}
294
- * @returns A Promise of DnsRecords
295
- */
296
- getDomainDnsRecords = (request) => this.client.fetch({
297
- method: "GET",
298
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domain", request.domain)}/dns-records`
299
- }, unmarshalDnsRecords);
300
- /**
301
- * Check whether you own this domain or not.. Check whether you own this domain or not.
302
- *
303
- * @deprecated
304
- * @param request - The request {@link DnsApiCheckUserOwnsDomainRequest}
305
- * @returns A Promise of CheckUserOwnsDomainResponse
306
- */
307
- checkUserOwnsDomain = (request) => this.client.fetch({
308
- body: JSON.stringify(marshalDnsApiCheckUserOwnsDomainRequest(request, this.client.settings)),
309
- headers: jsonContentHeaders,
310
- method: "POST",
311
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domain", request.domain)}/check-ownership`
312
- }, unmarshalCheckUserOwnsDomainResponse);
313
- /**
314
- * Synchronize your DNS records on the Elements Console and on cPanel.. Synchronize your DNS records on the Elements Console and on cPanel.
315
- *
316
- * @param request - The request {@link DnsApiSyncDomainDnsRecordsRequest}
317
- * @returns A Promise of DnsRecords
318
- */
319
- syncDomainDnsRecords = (request) => this.client.fetch({
320
- body: JSON.stringify(marshalDnsApiSyncDomainDnsRecordsRequest(request, this.client.settings)),
321
- headers: jsonContentHeaders,
322
- method: "POST",
323
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domain", request.domain)}/sync-domain-dns-records`
324
- }, unmarshalDnsRecords);
325
- /**
326
- * Search for available domains based on domain name.. Search for available domains based on domain name.
327
- *
328
- * @param request - The request {@link DnsApiSearchDomainsRequest}
329
- * @returns A Promise of SearchDomainsResponse
330
- */
331
- searchDomains = (request) => this.client.fetch({
332
- method: "GET",
333
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/search-domains`,
334
- urlParams: urlParams(["domain_name", request.domainName], ["project_id", request.projectId ?? this.client.settings.defaultProjectId])
335
- }, unmarshalSearchDomainsResponse);
336
- /**
337
- * 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.
338
- *
339
- * @param request - The request {@link DnsApiGetDomainRequest}
340
- * @returns A Promise of Domain
341
- */
342
- getDomain = (request) => this.client.fetch({
343
- method: "GET",
344
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domainName", request.domainName)}`,
345
- urlParams: urlParams(["project_id", request.projectId ?? this.client.settings.defaultProjectId])
346
- }, unmarshalDomain);
347
- /**
348
- * Waits for {@link Domain} to be in a final state.
349
- *
350
- * @param request - The request {@link DnsApiGetDomainRequest}
351
- * @param options - The waiting options
352
- * @returns A Promise of Domain
353
- */
354
- waitForDomain = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES.includes(res.status))), this.getDomain, request, options);
163
+ constructor(..._args4) {
164
+ super(..._args4);
165
+ this.getDomainDnsRecords = (request) => this.client.fetch({
166
+ method: "GET",
167
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domain", request.domain)}/dns-records`
168
+ }, unmarshalDnsRecords);
169
+ this.checkUserOwnsDomain = (request) => this.client.fetch({
170
+ body: JSON.stringify(marshalDnsApiCheckUserOwnsDomainRequest(request, this.client.settings)),
171
+ headers: jsonContentHeaders,
172
+ method: "POST",
173
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domain", request.domain)}/check-ownership`
174
+ }, unmarshalCheckUserOwnsDomainResponse);
175
+ this.syncDomainDnsRecords = (request) => this.client.fetch({
176
+ body: JSON.stringify(marshalDnsApiSyncDomainDnsRecordsRequest(request, this.client.settings)),
177
+ headers: jsonContentHeaders,
178
+ method: "POST",
179
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domain", request.domain)}/sync-domain-dns-records`
180
+ }, unmarshalDnsRecords);
181
+ this.searchDomains = (request) => this.client.fetch({
182
+ method: "GET",
183
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/search-domains`,
184
+ urlParams: urlParams(["domain_name", request.domainName], ["project_id", request.projectId ?? this.client.settings.defaultProjectId])
185
+ }, unmarshalSearchDomainsResponse);
186
+ this.getDomain = (request) => this.client.fetch({
187
+ method: "GET",
188
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domainName", request.domainName)}`,
189
+ urlParams: urlParams(["project_id", request.projectId ?? this.client.settings.defaultProjectId])
190
+ }, unmarshalDomain);
191
+ this.waitForDomain = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES.includes(res.status))), this.getDomain, request, options);
192
+ }
193
+ static {
194
+ this.LOCALITY = toApiLocality({ regions: [
195
+ "fr-par",
196
+ "nl-ams",
197
+ "pl-waw"
198
+ ] });
199
+ }
355
200
  };
356
201
  /**
357
202
  * Web Hosting Offer API.
@@ -359,27 +204,22 @@ var DnsAPI = class extends API {
359
204
  This API allows you to manage your offer for your Web Hosting services.
360
205
  */
361
206
  var OfferAPI = class extends API {
362
- /**
363
- * Locality of this API.
364
- * type {'zone','region','global','unspecified'}
365
- */
366
- static LOCALITY = toApiLocality({ regions: [
367
- "fr-par",
368
- "nl-ams",
369
- "pl-waw"
370
- ] });
371
- pageOfListOffers = (request = {}) => this.client.fetch({
372
- method: "GET",
373
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/offers`,
374
- urlParams: urlParams(["control_panels", request.controlPanels], ["hosting_id", request.hostingId], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
375
- }, unmarshalListOffersResponse);
376
- /**
377
- * List all available hosting offers along with their specific options.. List all available hosting offers along with their specific options.
378
- *
379
- * @param request - The request {@link OfferApiListOffersRequest}
380
- * @returns A Promise of ListOffersResponse
381
- */
382
- listOffers = (request = {}) => enrichForPagination("offers", this.pageOfListOffers, request);
207
+ constructor(..._args5) {
208
+ super(..._args5);
209
+ this.pageOfListOffers = (request = {}) => this.client.fetch({
210
+ method: "GET",
211
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/offers`,
212
+ urlParams: urlParams(["control_panels", request.controlPanels], ["hosting_id", request.hostingId], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
213
+ }, unmarshalListOffersResponse);
214
+ this.listOffers = (request = {}) => enrichForPagination("offers", this.pageOfListOffers, request);
215
+ }
216
+ static {
217
+ this.LOCALITY = toApiLocality({ regions: [
218
+ "fr-par",
219
+ "nl-ams",
220
+ "pl-waw"
221
+ ] });
222
+ }
383
223
  };
384
224
  /**
385
225
  * Web Hosting API.
@@ -387,185 +227,95 @@ var OfferAPI = class extends API {
387
227
  This API allows you to manage your Web Hosting services.
388
228
  */
389
229
  var HostingAPI = class extends API {
390
- /**
391
- * Locality of this API.
392
- * type {'zone','region','global','unspecified'}
393
- */
394
- static LOCALITY = toApiLocality({ regions: [
395
- "fr-par",
396
- "nl-ams",
397
- "pl-waw"
398
- ] });
399
- /**
400
- * Order a Web Hosting plan. Order a Web Hosting plan, specifying the offer type required via the `offer_id` parameter.
401
- *
402
- * @param request - The request {@link HostingApiCreateHostingRequest}
403
- * @returns A Promise of Hosting
404
- */
405
- createHosting = (request) => this.client.fetch({
406
- body: JSON.stringify(marshalHostingApiCreateHostingRequest(request, this.client.settings)),
407
- headers: jsonContentHeaders,
408
- method: "POST",
409
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings`
410
- }, unmarshalHosting);
411
- pageOfListHostings = (request = {}) => this.client.fetch({
412
- method: "GET",
413
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings`,
414
- urlParams: urlParams(["control_panels", request.controlPanels], ["domain", request.domain], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["statuses", request.statuses], ["subdomain", request.subdomain], ["tags", request.tags])
415
- }, unmarshalListHostingsResponse);
416
- /**
417
- * 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.
418
- *
419
- * @param request - The request {@link HostingApiListHostingsRequest}
420
- * @returns A Promise of ListHostingsResponse
421
- */
422
- listHostings = (request = {}) => enrichForPagination("hostings", this.pageOfListHostings, request);
423
- /**
424
- * Get a Web Hosting plan. Get the details of one of your existing Web Hosting plans, specified by its `hosting_id`.
425
- *
426
- * @param request - The request {@link HostingApiGetHostingRequest}
427
- * @returns A Promise of Hosting
428
- */
429
- getHosting = (request) => this.client.fetch({
430
- method: "GET",
431
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}`
432
- }, unmarshalHosting);
433
- /**
434
- * Waits for {@link Hosting} to be in a final state.
435
- *
436
- * @param request - The request {@link HostingApiGetHostingRequest}
437
- * @param options - The waiting options
438
- * @returns A Promise of Hosting
439
- */
440
- waitForHosting = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!HOSTING_TRANSIENT_STATUSES.includes(res.status))), this.getHosting, request, options);
441
- /**
442
- * 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.
443
- *
444
- * @param request - The request {@link HostingApiUpdateHostingRequest}
445
- * @returns A Promise of Hosting
446
- */
447
- updateHosting = (request) => this.client.fetch({
448
- body: JSON.stringify(marshalHostingApiUpdateHostingRequest(request, this.client.settings)),
449
- headers: jsonContentHeaders,
450
- method: "PATCH",
451
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}`
452
- }, unmarshalHosting);
453
- /**
454
- * 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.
455
- *
456
- * @param request - The request {@link HostingApiDeleteHostingRequest}
457
- * @returns A Promise of Hosting
458
- */
459
- deleteHosting = (request) => this.client.fetch({
460
- method: "DELETE",
461
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}`
462
- }, unmarshalHosting);
463
- /**
464
- * Create a user session.
465
- *
466
- * @param request - The request {@link HostingApiCreateSessionRequest}
467
- * @returns A Promise of Session
468
- */
469
- createSession = (request) => this.client.fetch({
470
- body: "{}",
471
- headers: jsonContentHeaders,
472
- method: "POST",
473
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/sessions`
474
- }, unmarshalSession);
475
- /**
476
- * Reset a Web Hosting plan password.
477
- *
478
- * @param request - The request {@link HostingApiResetHostingPasswordRequest}
479
- * @returns A Promise of ResetHostingPasswordResponse
480
- */
481
- resetHostingPassword = (request) => this.client.fetch({
482
- body: "{}",
483
- headers: jsonContentHeaders,
484
- method: "POST",
485
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/reset-password`
486
- }, unmarshalResetHostingPasswordResponse);
487
- /**
488
- * Get the total counts of websites, databases, email accounts, and FTP accounts of a Web Hosting plan.
489
- *
490
- * @param request - The request {@link HostingApiGetResourceSummaryRequest}
491
- * @returns A Promise of ResourceSummary
492
- */
493
- getResourceSummary = (request) => this.client.fetch({
494
- method: "GET",
495
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/resource-summary`
496
- }, unmarshalResourceSummary);
497
- /**
498
- * Attach a custom domain to a webhosting as an alias to the main domain.
499
- *
500
- * @param request - The request {@link HostingApiAddCustomDomainRequest}
501
- * @returns A Promise of HostingSummary
502
- */
503
- addCustomDomain = (request) => this.client.fetch({
504
- body: JSON.stringify(marshalHostingApiAddCustomDomainRequest(request, this.client.settings)),
505
- headers: jsonContentHeaders,
506
- method: "POST",
507
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/add-custom-domain`
508
- }, unmarshalHostingSummary);
509
- /**
510
- * Detach a custom domain from a webhosting.
511
- *
512
- * @param request - The request {@link HostingApiRemoveCustomDomainRequest}
513
- * @returns A Promise of HostingSummary
514
- */
515
- removeCustomDomain = (request) => this.client.fetch({
516
- body: JSON.stringify(marshalHostingApiRemoveCustomDomainRequest(request, this.client.settings)),
517
- headers: jsonContentHeaders,
518
- method: "POST",
519
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/remove-custom-domain`
520
- }, unmarshalHostingSummary);
521
- /**
522
- * Migrate a hosting to a new control panel.. Migrate a hosting to a new control panel.
523
- *
524
- * @param request - The request {@link HostingApiMigrateControlPanelRequest}
525
- * @returns A Promise of HostingSummary
526
- */
527
- migrateControlPanel = (request) => this.client.fetch({
528
- body: JSON.stringify(marshalHostingApiMigrateControlPanelRequest(request, this.client.settings)),
529
- headers: jsonContentHeaders,
530
- method: "POST",
531
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/migrate-control-panel`
532
- }, unmarshalHostingSummary);
533
- /**
534
- * Reset a Web Hosting plan. Reset a Web Hosting plan to its initial state, specified by its `hosting_id`. This permanently deletes all hosting data including files, databases and emails. The hosting will be re-provisioned.
535
- *
536
- * @param request - The request {@link HostingApiResetHostingRequest}
537
- * @returns A Promise of Hosting
538
- */
539
- resetHosting = (request) => this.client.fetch({
540
- body: "{}",
541
- headers: jsonContentHeaders,
542
- method: "POST",
543
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/reset`
544
- }, unmarshalHosting);
545
- /**
546
- * Delete domains from a Web Hosting plan. Remove one or more domains from a Web Hosting plan, specified by its `hosting_id`. This permanently deletes the domains and all services tied to them, including mailboxes, FTP accounts and DNS zones.
547
- *
548
- * @param request - The request {@link HostingApiDeleteHostingDomainsRequest}
549
- * @returns A Promise of Hosting
550
- */
551
- deleteHostingDomains = (request) => this.client.fetch({
552
- body: JSON.stringify(marshalHostingApiDeleteHostingDomainsRequest(request, this.client.settings)),
553
- headers: jsonContentHeaders,
554
- method: "POST",
555
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/delete-domains`
556
- }, unmarshalHosting);
557
- /**
558
- * Update the free domain of a Web Hosting plan. Change the free domain associated with a Web Hosting plan, specified by its `hosting_id`.
559
- *
560
- * @param request - The request {@link HostingApiUpdateHostingFreeDomainRequest}
561
- * @returns A Promise of Hosting
562
- */
563
- updateHostingFreeDomain = (request) => this.client.fetch({
564
- body: JSON.stringify(marshalHostingApiUpdateHostingFreeDomainRequest(request, this.client.settings)),
565
- headers: jsonContentHeaders,
566
- method: "PATCH",
567
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/update-free-domain`
568
- }, unmarshalHosting);
230
+ constructor(..._args6) {
231
+ super(..._args6);
232
+ this.createHosting = (request) => this.client.fetch({
233
+ body: JSON.stringify(marshalHostingApiCreateHostingRequest(request, this.client.settings)),
234
+ headers: jsonContentHeaders,
235
+ method: "POST",
236
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings`
237
+ }, unmarshalHosting);
238
+ this.pageOfListHostings = (request = {}) => this.client.fetch({
239
+ method: "GET",
240
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings`,
241
+ urlParams: urlParams(["control_panels", request.controlPanels], ["domain", request.domain], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["statuses", request.statuses], ["subdomain", request.subdomain], ["tags", request.tags])
242
+ }, unmarshalListHostingsResponse);
243
+ this.listHostings = (request = {}) => enrichForPagination("hostings", this.pageOfListHostings, request);
244
+ this.getHosting = (request) => this.client.fetch({
245
+ method: "GET",
246
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}`
247
+ }, unmarshalHosting);
248
+ this.waitForHosting = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!HOSTING_TRANSIENT_STATUSES.includes(res.status))), this.getHosting, request, options);
249
+ this.updateHosting = (request) => this.client.fetch({
250
+ body: JSON.stringify(marshalHostingApiUpdateHostingRequest(request, this.client.settings)),
251
+ headers: jsonContentHeaders,
252
+ method: "PATCH",
253
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}`
254
+ }, unmarshalHosting);
255
+ this.deleteHosting = (request) => this.client.fetch({
256
+ method: "DELETE",
257
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}`
258
+ }, unmarshalHosting);
259
+ this.createSession = (request) => this.client.fetch({
260
+ body: "{}",
261
+ headers: jsonContentHeaders,
262
+ method: "POST",
263
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/sessions`
264
+ }, unmarshalSession);
265
+ this.resetHostingPassword = (request) => this.client.fetch({
266
+ body: "{}",
267
+ headers: jsonContentHeaders,
268
+ method: "POST",
269
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/reset-password`
270
+ }, unmarshalResetHostingPasswordResponse);
271
+ this.getResourceSummary = (request) => this.client.fetch({
272
+ method: "GET",
273
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/resource-summary`
274
+ }, unmarshalResourceSummary);
275
+ this.addCustomDomain = (request) => this.client.fetch({
276
+ body: JSON.stringify(marshalHostingApiAddCustomDomainRequest(request, this.client.settings)),
277
+ headers: jsonContentHeaders,
278
+ method: "POST",
279
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/add-custom-domain`
280
+ }, unmarshalHostingSummary);
281
+ this.removeCustomDomain = (request) => this.client.fetch({
282
+ body: JSON.stringify(marshalHostingApiRemoveCustomDomainRequest(request, this.client.settings)),
283
+ headers: jsonContentHeaders,
284
+ method: "POST",
285
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/remove-custom-domain`
286
+ }, unmarshalHostingSummary);
287
+ this.migrateControlPanel = (request) => this.client.fetch({
288
+ body: JSON.stringify(marshalHostingApiMigrateControlPanelRequest(request, this.client.settings)),
289
+ headers: jsonContentHeaders,
290
+ method: "POST",
291
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/migrate-control-panel`
292
+ }, unmarshalHostingSummary);
293
+ this.resetHosting = (request) => this.client.fetch({
294
+ body: "{}",
295
+ headers: jsonContentHeaders,
296
+ method: "POST",
297
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/reset`
298
+ }, unmarshalHosting);
299
+ this.deleteHostingDomains = (request) => this.client.fetch({
300
+ body: JSON.stringify(marshalHostingApiDeleteHostingDomainsRequest(request, this.client.settings)),
301
+ headers: jsonContentHeaders,
302
+ method: "POST",
303
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/delete-domains`
304
+ }, unmarshalHosting);
305
+ this.updateHostingFreeDomain = (request) => this.client.fetch({
306
+ body: JSON.stringify(marshalHostingApiUpdateHostingFreeDomainRequest(request, this.client.settings)),
307
+ headers: jsonContentHeaders,
308
+ method: "PATCH",
309
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/update-free-domain`
310
+ }, unmarshalHosting);
311
+ }
312
+ static {
313
+ this.LOCALITY = toApiLocality({ regions: [
314
+ "fr-par",
315
+ "nl-ams",
316
+ "pl-waw"
317
+ ] });
318
+ }
569
319
  };
570
320
  /**
571
321
  * Web Hosting free domain API.
@@ -573,39 +323,28 @@ var HostingAPI = class extends API {
573
323
  This API allows you to list and check a free domain's validity.
574
324
  */
575
325
  var FreeDomainAPI = class extends API {
576
- /**
577
- * Locality of this API.
578
- * type {'zone','region','global','unspecified'}
579
- */
580
- static LOCALITY = toApiLocality({ regions: [
581
- "fr-par",
582
- "nl-ams",
583
- "pl-waw"
584
- ] });
585
- /**
586
- * Check whether a given slug and free domain combination is available.. Check whether a given slug and free domain combination is available.
587
- *
588
- * @param request - The request {@link FreeDomainApiCheckFreeDomainAvailabilityRequest}
589
- * @returns A Promise of CheckFreeDomainAvailabilityResponse
590
- */
591
- checkFreeDomainAvailability = (request) => this.client.fetch({
592
- body: JSON.stringify(marshalFreeDomainApiCheckFreeDomainAvailabilityRequest(request, this.client.settings)),
593
- headers: jsonContentHeaders,
594
- method: "POST",
595
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/free-domains/check-availability`
596
- }, unmarshalCheckFreeDomainAvailabilityResponse);
597
- pageOfListFreeRootDomains = (request = {}) => this.client.fetch({
598
- method: "GET",
599
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/free-domains/root-domains`,
600
- urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
601
- }, unmarshalListFreeRootDomainsResponse);
602
- /**
603
- * Retrieve the list of free root domains available for a Web Hosting.. Retrieve the list of free root domains available for a Web Hosting.
604
- *
605
- * @param request - The request {@link FreeDomainApiListFreeRootDomainsRequest}
606
- * @returns A Promise of ListFreeRootDomainsResponse
607
- */
608
- listFreeRootDomains = (request = {}) => enrichForPagination("rootDomains", this.pageOfListFreeRootDomains, request);
326
+ constructor(..._args7) {
327
+ super(..._args7);
328
+ this.checkFreeDomainAvailability = (request) => this.client.fetch({
329
+ body: JSON.stringify(marshalFreeDomainApiCheckFreeDomainAvailabilityRequest(request, this.client.settings)),
330
+ headers: jsonContentHeaders,
331
+ method: "POST",
332
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/free-domains/check-availability`
333
+ }, unmarshalCheckFreeDomainAvailabilityResponse);
334
+ this.pageOfListFreeRootDomains = (request = {}) => this.client.fetch({
335
+ method: "GET",
336
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/free-domains/root-domains`,
337
+ urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
338
+ }, unmarshalListFreeRootDomainsResponse);
339
+ this.listFreeRootDomains = (request = {}) => enrichForPagination("rootDomains", this.pageOfListFreeRootDomains, request);
340
+ }
341
+ static {
342
+ this.LOCALITY = toApiLocality({ regions: [
343
+ "fr-par",
344
+ "nl-ams",
345
+ "pl-waw"
346
+ ] });
347
+ }
609
348
  };
610
349
  /**
611
350
  * Web Hosting FTP Account API.
@@ -613,55 +352,38 @@ var FreeDomainAPI = class extends API {
613
352
  This API allows you to manage your FTP accounts for your Web Hosting services.
614
353
  */
615
354
  var FtpAccountAPI = class extends API {
616
- /**
617
- * Locality of this API.
618
- * type {'zone','region','global','unspecified'}
619
- */
620
- static LOCALITY = toApiLocality({ regions: [
621
- "fr-par",
622
- "nl-ams",
623
- "pl-waw"
624
- ] });
625
- /**
626
- * Create a new FTP account within your hosting plan.. Create a new FTP account within your hosting plan.
627
- *
628
- * @param request - The request {@link FtpAccountApiCreateFtpAccountRequest}
629
- * @returns A Promise of FtpAccount
630
- */
631
- createFtpAccount = (request) => this.client.fetch({
632
- body: JSON.stringify(marshalFtpAccountApiCreateFtpAccountRequest(request, this.client.settings)),
633
- headers: jsonContentHeaders,
634
- method: "POST",
635
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/ftp-accounts`
636
- }, unmarshalFtpAccount);
637
- pageOfListFtpAccounts = (request) => this.client.fetch({
638
- method: "GET",
639
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/ftp-accounts`,
640
- urlParams: urlParams(["domain", request.domain], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
641
- }, unmarshalListFtpAccountsResponse);
642
- /**
643
- * List all FTP accounts within your hosting plan.. List all FTP accounts within your hosting plan.
644
- *
645
- * @param request - The request {@link FtpAccountApiListFtpAccountsRequest}
646
- * @returns A Promise of ListFtpAccountsResponse
647
- */
648
- listFtpAccounts = (request) => enrichForPagination("ftpAccounts", this.pageOfListFtpAccounts, request);
649
- /**
650
- * Delete a specific FTP account within your hosting plan.. Delete a specific FTP account within your hosting plan.
651
- *
652
- * @param request - The request {@link FtpAccountApiRemoveFtpAccountRequest}
653
- * @returns A Promise of FtpAccount
654
- */
655
- removeFtpAccount = (request) => this.client.fetch({
656
- method: "DELETE",
657
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/ftp-accounts/${validatePathParam("username", request.username)}`
658
- }, unmarshalFtpAccount);
659
- changeFtpAccountPassword = (request) => this.client.fetch({
660
- body: JSON.stringify(marshalFtpAccountApiChangeFtpAccountPasswordRequest(request, this.client.settings)),
661
- headers: jsonContentHeaders,
662
- method: "POST",
663
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/ftp-accounts/${validatePathParam("username", request.username)}/change-password`
664
- }, unmarshalFtpAccount);
355
+ constructor(..._args8) {
356
+ super(..._args8);
357
+ this.createFtpAccount = (request) => this.client.fetch({
358
+ body: JSON.stringify(marshalFtpAccountApiCreateFtpAccountRequest(request, this.client.settings)),
359
+ headers: jsonContentHeaders,
360
+ method: "POST",
361
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/ftp-accounts`
362
+ }, unmarshalFtpAccount);
363
+ this.pageOfListFtpAccounts = (request) => this.client.fetch({
364
+ method: "GET",
365
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/ftp-accounts`,
366
+ urlParams: urlParams(["domain", request.domain], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
367
+ }, unmarshalListFtpAccountsResponse);
368
+ this.listFtpAccounts = (request) => enrichForPagination("ftpAccounts", this.pageOfListFtpAccounts, request);
369
+ this.removeFtpAccount = (request) => this.client.fetch({
370
+ method: "DELETE",
371
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/ftp-accounts/${validatePathParam("username", request.username)}`
372
+ }, unmarshalFtpAccount);
373
+ this.changeFtpAccountPassword = (request) => this.client.fetch({
374
+ body: JSON.stringify(marshalFtpAccountApiChangeFtpAccountPasswordRequest(request, this.client.settings)),
375
+ headers: jsonContentHeaders,
376
+ method: "POST",
377
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/ftp-accounts/${validatePathParam("username", request.username)}/change-password`
378
+ }, unmarshalFtpAccount);
379
+ }
380
+ static {
381
+ this.LOCALITY = toApiLocality({ regions: [
382
+ "fr-par",
383
+ "nl-ams",
384
+ "pl-waw"
385
+ ] });
386
+ }
665
387
  };
666
388
  /**
667
389
  * Web Hosting Mail Account API.
@@ -669,63 +391,40 @@ var FtpAccountAPI = class extends API {
669
391
  This API allows you to manage your mail accounts for your Web Hosting services.
670
392
  */
671
393
  var MailAccountAPI = class extends API {
672
- /**
673
- * Locality of this API.
674
- * type {'zone','region','global','unspecified'}
675
- */
676
- static LOCALITY = toApiLocality({ regions: [
677
- "fr-par",
678
- "nl-ams",
679
- "pl-waw"
680
- ] });
681
- /**
682
- * Create a new mail account within your hosting plan.. Create a new mail account within your hosting plan.
683
- *
684
- * @param request - The request {@link MailAccountApiCreateMailAccountRequest}
685
- * @returns A Promise of MailAccount
686
- */
687
- createMailAccount = (request) => this.client.fetch({
688
- body: JSON.stringify(marshalMailAccountApiCreateMailAccountRequest(request, this.client.settings)),
689
- headers: jsonContentHeaders,
690
- method: "POST",
691
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/mail-accounts`
692
- }, unmarshalMailAccount);
693
- pageOfListMailAccounts = (request) => this.client.fetch({
694
- method: "GET",
695
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/mail-accounts`,
696
- urlParams: urlParams(["domain", request.domain], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
697
- }, unmarshalListMailAccountsResponse);
698
- /**
699
- * List all mail accounts within your hosting plan.. List all mail accounts within your hosting plan.
700
- *
701
- * @param request - The request {@link MailAccountApiListMailAccountsRequest}
702
- * @returns A Promise of ListMailAccountsResponse
703
- */
704
- listMailAccounts = (request) => enrichForPagination("mailAccounts", this.pageOfListMailAccounts, request);
705
- /**
706
- * Delete a mail account within your hosting plan.. Delete a mail account within your hosting plan.
707
- *
708
- * @param request - The request {@link MailAccountApiRemoveMailAccountRequest}
709
- * @returns A Promise of MailAccount
710
- */
711
- removeMailAccount = (request) => this.client.fetch({
712
- body: JSON.stringify(marshalMailAccountApiRemoveMailAccountRequest(request, this.client.settings)),
713
- headers: jsonContentHeaders,
714
- method: "POST",
715
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/remove-mail-account`
716
- }, unmarshalMailAccount);
717
- /**
718
- * Update the password of a mail account within your hosting plan.. Update the password of a mail account within your hosting plan.
719
- *
720
- * @param request - The request {@link MailAccountApiChangeMailAccountPasswordRequest}
721
- * @returns A Promise of MailAccount
722
- */
723
- changeMailAccountPassword = (request) => this.client.fetch({
724
- body: JSON.stringify(marshalMailAccountApiChangeMailAccountPasswordRequest(request, this.client.settings)),
725
- headers: jsonContentHeaders,
726
- method: "POST",
727
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/change-mail-password`
728
- }, unmarshalMailAccount);
394
+ constructor(..._args9) {
395
+ super(..._args9);
396
+ this.createMailAccount = (request) => this.client.fetch({
397
+ body: JSON.stringify(marshalMailAccountApiCreateMailAccountRequest(request, this.client.settings)),
398
+ headers: jsonContentHeaders,
399
+ method: "POST",
400
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/mail-accounts`
401
+ }, unmarshalMailAccount);
402
+ this.pageOfListMailAccounts = (request) => this.client.fetch({
403
+ method: "GET",
404
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/mail-accounts`,
405
+ urlParams: urlParams(["domain", request.domain], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
406
+ }, unmarshalListMailAccountsResponse);
407
+ this.listMailAccounts = (request) => enrichForPagination("mailAccounts", this.pageOfListMailAccounts, request);
408
+ this.removeMailAccount = (request) => this.client.fetch({
409
+ body: JSON.stringify(marshalMailAccountApiRemoveMailAccountRequest(request, this.client.settings)),
410
+ headers: jsonContentHeaders,
411
+ method: "POST",
412
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/remove-mail-account`
413
+ }, unmarshalMailAccount);
414
+ this.changeMailAccountPassword = (request) => this.client.fetch({
415
+ body: JSON.stringify(marshalMailAccountApiChangeMailAccountPasswordRequest(request, this.client.settings)),
416
+ headers: jsonContentHeaders,
417
+ method: "POST",
418
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/change-mail-password`
419
+ }, unmarshalMailAccount);
420
+ }
421
+ static {
422
+ this.LOCALITY = toApiLocality({ regions: [
423
+ "fr-par",
424
+ "nl-ams",
425
+ "pl-waw"
426
+ ] });
427
+ }
729
428
  };
730
429
  /**
731
430
  * Web Hosting Website API.
@@ -733,61 +432,38 @@ var MailAccountAPI = class extends API {
733
432
  This API allows you to manage your websites for your Web Hosting services.
734
433
  */
735
434
  var WebsiteAPI = class extends API {
736
- /**
737
- * Locality of this API.
738
- * type {'zone','region','global','unspecified'}
739
- */
740
- static LOCALITY = toApiLocality({ regions: [
741
- "fr-par",
742
- "nl-ams",
743
- "pl-waw"
744
- ] });
745
- pageOfListWebsites = (request) => this.client.fetch({
746
- method: "GET",
747
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/websites`,
748
- urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
749
- }, unmarshalListWebsitesResponse);
750
- /**
751
- * List all websites for a specific hosting.. List all websites for a specific hosting.
752
- *
753
- * @param request - The request {@link WebsiteApiListWebsitesRequest}
754
- * @returns A Promise of ListWebsitesResponse
755
- */
756
- listWebsites = (request) => enrichForPagination("websites", this.pageOfListWebsites, request);
757
- /**
758
- * Create a new website and attach it to a webhosting.
759
- *
760
- * @param request - The request {@link WebsiteApiCreateWebsiteRequest}
761
- * @returns A Promise of Website
762
- */
763
- createWebsite = (request) => this.client.fetch({
764
- body: JSON.stringify(marshalWebsiteApiCreateWebsiteRequest(request, this.client.settings)),
765
- headers: jsonContentHeaders,
766
- method: "POST",
767
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/websites`
768
- }, unmarshalWebsite);
769
- /**
770
- * Delete a website from a webhosting.
771
- *
772
- * @param request - The request {@link WebsiteApiDeleteWebsiteRequest}
773
- */
774
- deleteWebsite = (request) => this.client.fetch({
775
- method: "DELETE",
776
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/websites/${validatePathParam("domainName", request.domainName)}`
777
- });
778
- /**
779
- * Delete a website's content, all files and directories. This. Permanently deletes data including files and configurations. The
780
- website will display the default welcome page.
781
- *
782
- * @param request - The request {@link WebsiteApiResetWebsiteRequest}
783
- * @returns A Promise of Website
784
- */
785
- resetWebsite = (request) => this.client.fetch({
786
- body: "{}",
787
- headers: jsonContentHeaders,
788
- method: "POST",
789
- path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/websites/${validatePathParam("domainName", request.domainName)}/reset`
790
- }, unmarshalWebsite);
435
+ constructor(..._args10) {
436
+ super(..._args10);
437
+ this.pageOfListWebsites = (request) => this.client.fetch({
438
+ method: "GET",
439
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/websites`,
440
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
441
+ }, unmarshalListWebsitesResponse);
442
+ this.listWebsites = (request) => enrichForPagination("websites", this.pageOfListWebsites, request);
443
+ this.createWebsite = (request) => this.client.fetch({
444
+ body: JSON.stringify(marshalWebsiteApiCreateWebsiteRequest(request, this.client.settings)),
445
+ headers: jsonContentHeaders,
446
+ method: "POST",
447
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/websites`
448
+ }, unmarshalWebsite);
449
+ this.deleteWebsite = (request) => this.client.fetch({
450
+ method: "DELETE",
451
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/websites/${validatePathParam("domainName", request.domainName)}`
452
+ });
453
+ this.resetWebsite = (request) => this.client.fetch({
454
+ body: "{}",
455
+ headers: jsonContentHeaders,
456
+ method: "POST",
457
+ path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/websites/${validatePathParam("domainName", request.domainName)}/reset`
458
+ }, unmarshalWebsite);
459
+ }
460
+ static {
461
+ this.LOCALITY = toApiLocality({ regions: [
462
+ "fr-par",
463
+ "nl-ams",
464
+ "pl-waw"
465
+ ] });
466
+ }
791
467
  };
792
468
  //#endregion
793
469
  export { BackupAPI, ControlPanelAPI, DatabaseAPI, DnsAPI, FreeDomainAPI, FtpAccountAPI, HostingAPI, MailAccountAPI, OfferAPI, WebsiteAPI };