@scaleway/sdk 1.14.0 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/api/account/v2/api.gen.js +77 -60
  2. package/dist/api/applesilicon/v1alpha1/api.gen.js +174 -152
  3. package/dist/api/baremetal/v1/api.gen.js +434 -378
  4. package/dist/api/baremetal/v1/api.utils.js +19 -22
  5. package/dist/api/billing/v2alpha1/api.gen.js +21 -17
  6. package/dist/api/cockpit/v1beta1/api.gen.js +308 -232
  7. package/dist/api/container/v1beta1/api.gen.js +384 -337
  8. package/dist/api/domain/v2beta1/api.gen.js +754 -668
  9. package/dist/api/flexibleip/v1alpha1/api.gen.js +164 -151
  10. package/dist/api/function/v1beta1/api.gen.js +467 -407
  11. package/dist/api/iam/v1alpha1/api.gen.js +641 -557
  12. package/dist/api/instance/v1/api.gen.js +802 -677
  13. package/dist/api/instance/v1/api.utils.js +337 -325
  14. package/dist/api/instance/v1/marshalling.gen.js +2 -1
  15. package/dist/api/iot/v1/api.gen.js +508 -452
  16. package/dist/api/ipfs/index.js +2 -0
  17. package/dist/api/ipfs/v1alpha1/api.gen.js +197 -0
  18. package/dist/api/ipfs/v1alpha1/content.gen.js +7 -0
  19. package/dist/api/ipfs/v1alpha1/index.gen.js +5 -0
  20. package/dist/api/ipfs/v1alpha1/marshalling.gen.js +125 -0
  21. package/dist/api/k8s/v1/api.gen.js +403 -342
  22. package/dist/api/k8s/v1/api.utils.js +7 -10
  23. package/dist/api/k8s/v1/marshalling.gen.js +19 -1
  24. package/dist/api/k8s/v1/validation-rules.gen.js +10 -1
  25. package/dist/api/lb/v1/api.gen.js +1501 -1363
  26. package/dist/api/lb/v1/api.utils.js +71 -75
  27. package/dist/api/lb/v1/marshalling.gen.js +6 -0
  28. package/dist/api/marketplace/v1/api.gen.js +35 -32
  29. package/dist/api/marketplace/v2/api.gen.js +117 -102
  30. package/dist/api/mnq/v1alpha1/api.gen.js +154 -137
  31. package/dist/api/rdb/v1/api.gen.js +897 -819
  32. package/dist/api/redis/v1/api.gen.js +358 -333
  33. package/dist/api/registry/v1/api.gen.js +211 -189
  34. package/dist/api/secret/v1alpha1/api.gen.js +265 -245
  35. package/dist/api/tem/v1alpha1/api.gen.js +182 -147
  36. package/dist/api/tem/v1alpha1/marshalling.gen.js +32 -1
  37. package/dist/api/test/v1/api.gen.js +116 -104
  38. package/dist/api/vpc/v1/api.gen.js +74 -65
  39. package/dist/api/vpc/v2/api.gen.js +200 -178
  40. package/dist/api/vpc/v2/marshalling.gen.js +1 -0
  41. package/dist/api/vpcgw/v1/api.gen.js +575 -501
  42. package/dist/api/webhosting/v1alpha1/api.gen.js +127 -117
  43. package/dist/index.cjs +732 -311
  44. package/dist/index.d.ts +2040 -1540
  45. package/dist/index.js +28 -26
  46. package/dist/internal/logger/console-logger.js +4 -5
  47. package/dist/scw/constants.js +1 -1
  48. package/dist/scw/errors/scw-error.js +2 -2
  49. package/package.json +2 -2
@@ -18,328 +18,350 @@ const jsonContentHeaders = {
18
18
  * Domains and DNS API.
19
19
  */
20
20
  class API extends API$1 {
21
- constructor() {
22
- super(...arguments);
23
- this.pageOfListDNSZones = request => this.client.fetch({
24
- method: 'GET',
25
- path: `/domain/v2beta1/dns-zones`,
26
- urlParams: urlParams(['dns_zone', request.dnsZone], ['domain', request.domain], ['order_by', request.orderBy ?? 'domain_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])
27
- }, unmarshalListDNSZonesResponse);
28
- /**
29
- * List DNS zones. Retrieve the list of DNS zones you can manage and filter
30
- * DNS zones associated with specific domain names.
31
- *
32
- * @param request - The request {@link ListDNSZonesRequest}
33
- * @returns A Promise of ListDNSZonesResponse
34
- */
35
- this.listDNSZones = request => enrichForPagination('dnsZones', this.pageOfListDNSZones, request);
36
- /**
37
- * Create a DNS zone. Create a new DNS zone specified by the domain name, the
38
- * subdomain and the Project ID.
39
- *
40
- * @param request - The request {@link CreateDNSZoneRequest}
41
- * @returns A Promise of DNSZone
42
- */
43
- this.createDNSZone = request => this.client.fetch({
44
- body: JSON.stringify(marshalCreateDNSZoneRequest(request, this.client.settings)),
45
- headers: jsonContentHeaders,
46
- method: 'POST',
47
- path: `/domain/v2beta1/dns-zones`
48
- }, unmarshalDNSZone);
49
- /**
50
- * Update a DNS zone. Update the name and/or the Organizations for a DNS zone.
51
- *
52
- * @param request - The request {@link UpdateDNSZoneRequest}
53
- * @returns A Promise of DNSZone
54
- */
55
- this.updateDNSZone = request => this.client.fetch({
56
- body: JSON.stringify(marshalUpdateDNSZoneRequest(request, this.client.settings)),
57
- headers: jsonContentHeaders,
58
- method: 'PATCH',
59
- path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}`
60
- }, unmarshalDNSZone);
61
- /**
62
- * Clone a DNS zone. Clone an existing DNS zone with all its records into a
63
- * new DNS zone.
64
- *
65
- * @param request - The request {@link CloneDNSZoneRequest}
66
- * @returns A Promise of DNSZone
67
- */
68
- this.cloneDNSZone = request => this.client.fetch({
69
- body: JSON.stringify(marshalCloneDNSZoneRequest(request, this.client.settings)),
70
- headers: jsonContentHeaders,
71
- method: 'POST',
72
- path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/clone`
73
- }, unmarshalDNSZone);
74
- /**
75
- * Delete a DNS zone. Delete a DNS zone and all its records.
76
- *
77
- * @param request - The request {@link DeleteDNSZoneRequest}
78
- * @returns A Promise of DeleteDNSZoneResponse
79
- */
80
- this.deleteDNSZone = request => this.client.fetch({
81
- method: 'DELETE',
82
- path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}`,
83
- urlParams: urlParams(['project_id', request.projectId ?? this.client.settings.defaultProjectId])
84
- }, unmarshalDeleteDNSZoneResponse);
85
- this.pageOfListDNSZoneRecords = request => this.client.fetch({
86
- method: 'GET',
87
- path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/records`,
88
- urlParams: urlParams(['id', request.id], ['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['type', request.type ?? 'unknown'])
89
- }, unmarshalListDNSZoneRecordsResponse);
90
- /**
91
- * List records within a DNS zone. Retrieve a list of DNS records within a DNS
92
- * zone that has default name servers. You can filter records by type and
93
- * name.
94
- *
95
- * @param request - The request {@link ListDNSZoneRecordsRequest}
96
- * @returns A Promise of ListDNSZoneRecordsResponse
97
- */
98
- this.listDNSZoneRecords = request => enrichForPagination('records', this.pageOfListDNSZoneRecords, request);
99
- /**
100
- * Update records within a DNS zone. Update records within a DNS zone that has
101
- * default name servers and perform several actions on your records.
102
- *
103
- * Actions include:
104
- *
105
- * - Add: allows you to add a new record or add a new IP to an existing A
106
- * record, for example
107
- * - Set: allows you to edit a record or edit an IP from an existing A record,
108
- * for example
109
- * - Delete: allows you to delete a record or delete an IP from an existing A
110
- * record, for example
111
- * - Clear: allows you to delete all records from a DNS zone
112
- *
113
- * All edits will be versioned.
114
- *
115
- * @param request - The request {@link UpdateDNSZoneRecordsRequest}
116
- * @returns A Promise of UpdateDNSZoneRecordsResponse
117
- */
118
- this.updateDNSZoneRecords = request => this.client.fetch({
119
- body: JSON.stringify(marshalUpdateDNSZoneRecordsRequest(request, this.client.settings)),
120
- headers: jsonContentHeaders,
121
- method: 'PATCH',
122
- path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/records`
123
- }, unmarshalUpdateDNSZoneRecordsResponse);
124
- /**
125
- * List name servers within a DNS zone. Retrieve a list of name servers within
126
- * a DNS zone and their optional glue records.
127
- *
128
- * @param request - The request {@link ListDNSZoneNameserversRequest}
129
- * @returns A Promise of ListDNSZoneNameserversResponse
130
- */
131
- this.listDNSZoneNameservers = request => this.client.fetch({
132
- method: 'GET',
133
- path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/nameservers`,
134
- urlParams: urlParams(['project_id', request.projectId])
135
- }, unmarshalListDNSZoneNameserversResponse);
136
- /**
137
- * Update name servers within a DNS zone. Update name servers within a DNS
138
- * zone and set optional glue records.
139
- *
140
- * @param request - The request {@link UpdateDNSZoneNameserversRequest}
141
- * @returns A Promise of UpdateDNSZoneNameserversResponse
142
- */
143
- this.updateDNSZoneNameservers = request => this.client.fetch({
144
- body: JSON.stringify(marshalUpdateDNSZoneNameserversRequest(request, this.client.settings)),
145
- headers: jsonContentHeaders,
146
- method: 'PUT',
147
- path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/nameservers`
148
- }, unmarshalUpdateDNSZoneNameserversResponse);
149
- /**
150
- * Clear records within a DNS zone. Delete all records within a DNS zone that
151
- * has default name servers.<br/> All edits will be versioned.
152
- *
153
- * @param request - The request {@link ClearDNSZoneRecordsRequest}
154
- * @returns A Promise of ClearDNSZoneRecordsResponse
155
- */
156
- this.clearDNSZoneRecords = request => this.client.fetch({
157
- method: 'DELETE',
158
- path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/records`
159
- }, unmarshalClearDNSZoneRecordsResponse);
160
- /**
161
- * Export a raw DNS zone. Export a DNS zone with default name servers, in a
162
- * specific format.
163
- *
164
- * @param request - The request {@link ExportRawDNSZoneRequest}
165
- * @returns A Promise of Blob
166
- */
167
- this.exportRawDNSZone = request => this.client.fetch({
168
- method: 'GET',
169
- path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/raw`,
170
- urlParams: urlParams(['dl', 1], ['format', request.format ?? 'unknown_raw_format']),
171
- responseType: 'blob'
172
- });
173
- /**
174
- * Import a raw DNS zone. Import and replace the format of records from a
175
- * given provider, with default name servers.
176
- *
177
- * @param request - The request {@link ImportRawDNSZoneRequest}
178
- * @returns A Promise of ImportRawDNSZoneResponse
179
- */
180
- this.importRawDNSZone = request => this.client.fetch({
181
- body: JSON.stringify(marshalImportRawDNSZoneRequest(request, this.client.settings)),
182
- headers: jsonContentHeaders,
183
- method: 'POST',
184
- path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/raw`
185
- }, unmarshalImportRawDNSZoneResponse);
186
- /**
187
- * Import a DNS zone from another provider. Import and replace the format of
188
- * records from a given provider, with default name servers.
189
- *
190
- * @param request - The request {@link ImportProviderDNSZoneRequest}
191
- * @returns A Promise of ImportProviderDNSZoneResponse
192
- */
193
- this.importProviderDNSZone = request => this.client.fetch({
194
- body: JSON.stringify(marshalImportProviderDNSZoneRequest(request, this.client.settings)),
195
- headers: jsonContentHeaders,
196
- method: 'POST',
197
- path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/import-provider`
198
- }, unmarshalImportProviderDNSZoneResponse);
199
- /**
200
- * Refresh a DNS zone. Refresh an SOA DNS zone to reload the records in the
201
- * DNS zone and update the SOA serial. You can recreate the given DNS zone and
202
- * its sub DNS zone if needed.
203
- *
204
- * @param request - The request {@link RefreshDNSZoneRequest}
205
- * @returns A Promise of RefreshDNSZoneResponse
206
- */
207
- this.refreshDNSZone = request => this.client.fetch({
208
- body: JSON.stringify(marshalRefreshDNSZoneRequest(request, this.client.settings)),
209
- headers: jsonContentHeaders,
210
- method: 'POST',
211
- path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/refresh`
212
- }, unmarshalRefreshDNSZoneResponse);
213
- this.pageOfListDNSZoneVersions = request => this.client.fetch({
214
- method: 'GET',
215
- path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/versions`,
216
- urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
217
- }, unmarshalListDNSZoneVersionsResponse);
218
- /**
219
- * List versions of a DNS zone. Retrieve a list of a DNS zone's versions.<br/>
220
- * The maximum version count is 100. If the count reaches this limit, the
221
- * oldest version will be deleted after each new modification.
222
- *
223
- * @param request - The request {@link ListDNSZoneVersionsRequest}
224
- * @returns A Promise of ListDNSZoneVersionsResponse
225
- */
226
- this.listDNSZoneVersions = request => enrichForPagination('versions', this.pageOfListDNSZoneVersions, request);
227
- this.pageOfListDNSZoneVersionRecords = request => this.client.fetch({
228
- method: 'GET',
229
- path: `/domain/v2beta1/dns-zones/version/${validatePathParam('dnsZoneVersionId', request.dnsZoneVersionId)}`,
230
- urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
231
- }, unmarshalListDNSZoneVersionRecordsResponse);
232
- /**
233
- * List records from a given version of a specific DNS zone. Retrieve a list
234
- * of records from a specific DNS zone version.
235
- *
236
- * @param request - The request {@link ListDNSZoneVersionRecordsRequest}
237
- * @returns A Promise of ListDNSZoneVersionRecordsResponse
238
- */
239
- this.listDNSZoneVersionRecords = request => enrichForPagination('records', this.pageOfListDNSZoneVersionRecords, request);
240
- /**
241
- * Access differences from a specific DNS zone version. Access a previous DNS
242
- * zone version to see the differences from another specific version.
243
- *
244
- * @param request - The request {@link GetDNSZoneVersionDiffRequest}
245
- * @returns A Promise of GetDNSZoneVersionDiffResponse
246
- */
247
- this.getDNSZoneVersionDiff = request => this.client.fetch({
248
- method: 'GET',
249
- path: `/domain/v2beta1/dns-zones/version/${validatePathParam('dnsZoneVersionId', request.dnsZoneVersionId)}/diff`
250
- }, unmarshalGetDNSZoneVersionDiffResponse);
251
- /**
252
- * Restore a DNS zone version. Restore and activate a version of a specific
253
- * DNS zone.
254
- *
255
- * @param request - The request {@link RestoreDNSZoneVersionRequest}
256
- * @returns A Promise of RestoreDNSZoneVersionResponse
257
- */
258
- this.restoreDNSZoneVersion = request => this.client.fetch({
259
- body: '{}',
260
- headers: jsonContentHeaders,
261
- method: 'POST',
262
- path: `/domain/v2beta1/dns-zones/version/${validatePathParam('dnsZoneVersionId', request.dnsZoneVersionId)}/restore`
263
- }, unmarshalRestoreDNSZoneVersionResponse);
264
- /**
265
- * Get a DNS zone's TLS certificate. Get the DNS zone's TLS certificate. If
266
- * you do not have a certificate, the ouptut returns `no certificate found`.
267
- *
268
- * @param request - The request {@link GetSSLCertificateRequest}
269
- * @returns A Promise of SSLCertificate
270
- */
271
- this.getSSLCertificate = request => this.client.fetch({
272
- method: 'GET',
273
- path: `/domain/v2beta1/ssl-certificates/${validatePathParam('dnsZone', request.dnsZone)}`
274
- }, unmarshalSSLCertificate);
275
- /**
276
- * Waits for {@link SSLCertificate} to be in a final state.
277
- *
278
- * @param request - The request {@link GetSSLCertificateRequest}
279
- * @param options - The waiting options
280
- * @returns A Promise of SSLCertificate
281
- */
282
- this.waitForSSLCertificate = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!SSL_CERTIFICATE_TRANSIENT_STATUSES.includes(res.status))), this.getSSLCertificate, request, options);
283
- /**
284
- * Create or get the DNS zone's TLS certificate. Create a new TLS certificate
285
- * or retrieve information about an existing TLS certificate.
286
- *
287
- * @param request - The request {@link CreateSSLCertificateRequest}
288
- * @returns A Promise of SSLCertificate
289
- */
290
- this.createSSLCertificate = request => this.client.fetch({
291
- body: JSON.stringify(marshalCreateSSLCertificateRequest(request, this.client.settings)),
292
- headers: jsonContentHeaders,
293
- method: 'POST',
294
- path: `/domain/v2beta1/ssl-certificates`
295
- }, unmarshalSSLCertificate);
296
- this.pageOfListSSLCertificates = request => this.client.fetch({
297
- method: 'GET',
298
- path: `/domain/v2beta1/ssl-certificates`,
299
- urlParams: urlParams(['dns_zone', request.dnsZone], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])
300
- }, unmarshalListSSLCertificatesResponse);
301
- /**
302
- * List a user's TLS certificates. List all the TLS certificates a user has
303
- * created, specified by the user's Project ID and the DNS zone.
304
- *
305
- * @param request - The request {@link ListSSLCertificatesRequest}
306
- * @returns A Promise of ListSSLCertificatesResponse
307
- */
308
- this.listSSLCertificates = request => enrichForPagination('certificates', this.pageOfListSSLCertificates, request);
309
- /**
310
- * Delete a TLS certificate. Delete an existing TLS certificate specified by
311
- * its DNS zone. Deleting a TLS certificate is permanent and cannot be
312
- * undone.
313
- *
314
- * @param request - The request {@link DeleteSSLCertificateRequest}
315
- * @returns A Promise of DeleteSSLCertificateResponse
316
- */
317
- this.deleteSSLCertificate = request => this.client.fetch({
318
- method: 'DELETE',
319
- path: `/domain/v2beta1/ssl-certificates/${validatePathParam('dnsZone', request.dnsZone)}`
320
- }, unmarshalDeleteSSLCertificateResponse);
321
- /**
322
- * Get the DNS zone's TSIG key. Retrieve information about the TSIG key of a
323
- * given DNS zone to allow AXFR requests.
324
- *
325
- * @param request - The request {@link GetDNSZoneTsigKeyRequest}
326
- * @returns A Promise of GetDNSZoneTsigKeyResponse
327
- */
328
- this.getDNSZoneTsigKey = request => this.client.fetch({
329
- method: 'GET',
330
- path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/tsig-key`
331
- }, unmarshalGetDNSZoneTsigKeyResponse);
332
- /**
333
- * Delete the DNS zone's TSIG key. Delete an existing TSIG key specified by
334
- * its DNS zone. Deleting a TSIG key is permanent and cannot be undone.
335
- *
336
- * @param request - The request {@link DeleteDNSZoneTsigKeyRequest}
337
- */
338
- this.deleteDNSZoneTsigKey = request => this.client.fetch({
339
- method: 'DELETE',
340
- path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/tsig-key`
341
- });
342
- }
21
+ pageOfListDNSZones = request => this.client.fetch({
22
+ method: 'GET',
23
+ path: `/domain/v2beta1/dns-zones`,
24
+ urlParams: urlParams(['dns_zone', request.dnsZone], ['domain', request.domain], ['order_by', request.orderBy ?? 'domain_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])
25
+ }, unmarshalListDNSZonesResponse);
26
+
27
+ /**
28
+ * List DNS zones. Retrieve the list of DNS zones you can manage and filter
29
+ * DNS zones associated with specific domain names.
30
+ *
31
+ * @param request - The request {@link ListDNSZonesRequest}
32
+ * @returns A Promise of ListDNSZonesResponse
33
+ */
34
+ listDNSZones = request => enrichForPagination('dnsZones', this.pageOfListDNSZones, request);
35
+
36
+ /**
37
+ * Create a DNS zone. Create a new DNS zone specified by the domain name, the
38
+ * subdomain and the Project ID.
39
+ *
40
+ * @param request - The request {@link CreateDNSZoneRequest}
41
+ * @returns A Promise of DNSZone
42
+ */
43
+ createDNSZone = request => this.client.fetch({
44
+ body: JSON.stringify(marshalCreateDNSZoneRequest(request, this.client.settings)),
45
+ headers: jsonContentHeaders,
46
+ method: 'POST',
47
+ path: `/domain/v2beta1/dns-zones`
48
+ }, unmarshalDNSZone);
49
+
50
+ /**
51
+ * Update a DNS zone. Update the name and/or the Organizations for a DNS zone.
52
+ *
53
+ * @param request - The request {@link UpdateDNSZoneRequest}
54
+ * @returns A Promise of DNSZone
55
+ */
56
+ updateDNSZone = request => this.client.fetch({
57
+ body: JSON.stringify(marshalUpdateDNSZoneRequest(request, this.client.settings)),
58
+ headers: jsonContentHeaders,
59
+ method: 'PATCH',
60
+ path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}`
61
+ }, unmarshalDNSZone);
62
+
63
+ /**
64
+ * Clone a DNS zone. Clone an existing DNS zone with all its records into a
65
+ * new DNS zone.
66
+ *
67
+ * @param request - The request {@link CloneDNSZoneRequest}
68
+ * @returns A Promise of DNSZone
69
+ */
70
+ cloneDNSZone = request => this.client.fetch({
71
+ body: JSON.stringify(marshalCloneDNSZoneRequest(request, this.client.settings)),
72
+ headers: jsonContentHeaders,
73
+ method: 'POST',
74
+ path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/clone`
75
+ }, unmarshalDNSZone);
76
+
77
+ /**
78
+ * Delete a DNS zone. Delete a DNS zone and all its records.
79
+ *
80
+ * @param request - The request {@link DeleteDNSZoneRequest}
81
+ * @returns A Promise of DeleteDNSZoneResponse
82
+ */
83
+ deleteDNSZone = request => this.client.fetch({
84
+ method: 'DELETE',
85
+ path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}`,
86
+ urlParams: urlParams(['project_id', request.projectId ?? this.client.settings.defaultProjectId])
87
+ }, unmarshalDeleteDNSZoneResponse);
88
+ pageOfListDNSZoneRecords = request => this.client.fetch({
89
+ method: 'GET',
90
+ path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/records`,
91
+ urlParams: urlParams(['id', request.id], ['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['type', request.type ?? 'unknown'])
92
+ }, unmarshalListDNSZoneRecordsResponse);
93
+
94
+ /**
95
+ * List records within a DNS zone. Retrieve a list of DNS records within a DNS
96
+ * zone that has default name servers. You can filter records by type and
97
+ * name.
98
+ *
99
+ * @param request - The request {@link ListDNSZoneRecordsRequest}
100
+ * @returns A Promise of ListDNSZoneRecordsResponse
101
+ */
102
+ listDNSZoneRecords = request => enrichForPagination('records', this.pageOfListDNSZoneRecords, request);
103
+
104
+ /**
105
+ * Update records within a DNS zone. Update records within a DNS zone that has
106
+ * default name servers and perform several actions on your records.
107
+ *
108
+ * Actions include:
109
+ *
110
+ * - Add: allows you to add a new record or add a new IP to an existing A
111
+ * record, for example
112
+ * - Set: allows you to edit a record or edit an IP from an existing A record,
113
+ * for example
114
+ * - Delete: allows you to delete a record or delete an IP from an existing A
115
+ * record, for example
116
+ * - Clear: allows you to delete all records from a DNS zone
117
+ *
118
+ * All edits will be versioned.
119
+ *
120
+ * @param request - The request {@link UpdateDNSZoneRecordsRequest}
121
+ * @returns A Promise of UpdateDNSZoneRecordsResponse
122
+ */
123
+ updateDNSZoneRecords = request => this.client.fetch({
124
+ body: JSON.stringify(marshalUpdateDNSZoneRecordsRequest(request, this.client.settings)),
125
+ headers: jsonContentHeaders,
126
+ method: 'PATCH',
127
+ path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/records`
128
+ }, unmarshalUpdateDNSZoneRecordsResponse);
129
+
130
+ /**
131
+ * List name servers within a DNS zone. Retrieve a list of name servers within
132
+ * a DNS zone and their optional glue records.
133
+ *
134
+ * @param request - The request {@link ListDNSZoneNameserversRequest}
135
+ * @returns A Promise of ListDNSZoneNameserversResponse
136
+ */
137
+ listDNSZoneNameservers = request => this.client.fetch({
138
+ method: 'GET',
139
+ path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/nameservers`,
140
+ urlParams: urlParams(['project_id', request.projectId])
141
+ }, unmarshalListDNSZoneNameserversResponse);
142
+
143
+ /**
144
+ * Update name servers within a DNS zone. Update name servers within a DNS
145
+ * zone and set optional glue records.
146
+ *
147
+ * @param request - The request {@link UpdateDNSZoneNameserversRequest}
148
+ * @returns A Promise of UpdateDNSZoneNameserversResponse
149
+ */
150
+ updateDNSZoneNameservers = request => this.client.fetch({
151
+ body: JSON.stringify(marshalUpdateDNSZoneNameserversRequest(request, this.client.settings)),
152
+ headers: jsonContentHeaders,
153
+ method: 'PUT',
154
+ path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/nameservers`
155
+ }, unmarshalUpdateDNSZoneNameserversResponse);
156
+
157
+ /**
158
+ * Clear records within a DNS zone. Delete all records within a DNS zone that
159
+ * has default name servers.<br/> All edits will be versioned.
160
+ *
161
+ * @param request - The request {@link ClearDNSZoneRecordsRequest}
162
+ * @returns A Promise of ClearDNSZoneRecordsResponse
163
+ */
164
+ clearDNSZoneRecords = request => this.client.fetch({
165
+ method: 'DELETE',
166
+ path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/records`
167
+ }, unmarshalClearDNSZoneRecordsResponse);
168
+
169
+ /**
170
+ * Export a raw DNS zone. Export a DNS zone with default name servers, in a
171
+ * specific format.
172
+ *
173
+ * @param request - The request {@link ExportRawDNSZoneRequest}
174
+ * @returns A Promise of Blob
175
+ */
176
+ exportRawDNSZone = request => this.client.fetch({
177
+ method: 'GET',
178
+ path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/raw`,
179
+ urlParams: urlParams(['dl', 1], ['format', request.format ?? 'unknown_raw_format']),
180
+ responseType: 'blob'
181
+ });
182
+
183
+ /**
184
+ * Import a raw DNS zone. Import and replace the format of records from a
185
+ * given provider, with default name servers.
186
+ *
187
+ * @param request - The request {@link ImportRawDNSZoneRequest}
188
+ * @returns A Promise of ImportRawDNSZoneResponse
189
+ */
190
+ importRawDNSZone = request => this.client.fetch({
191
+ body: JSON.stringify(marshalImportRawDNSZoneRequest(request, this.client.settings)),
192
+ headers: jsonContentHeaders,
193
+ method: 'POST',
194
+ path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/raw`
195
+ }, unmarshalImportRawDNSZoneResponse);
196
+
197
+ /**
198
+ * Import a DNS zone from another provider. Import and replace the format of
199
+ * records from a given provider, with default name servers.
200
+ *
201
+ * @param request - The request {@link ImportProviderDNSZoneRequest}
202
+ * @returns A Promise of ImportProviderDNSZoneResponse
203
+ */
204
+ importProviderDNSZone = request => this.client.fetch({
205
+ body: JSON.stringify(marshalImportProviderDNSZoneRequest(request, this.client.settings)),
206
+ headers: jsonContentHeaders,
207
+ method: 'POST',
208
+ path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/import-provider`
209
+ }, unmarshalImportProviderDNSZoneResponse);
210
+
211
+ /**
212
+ * Refresh a DNS zone. Refresh an SOA DNS zone to reload the records in the
213
+ * DNS zone and update the SOA serial. You can recreate the given DNS zone and
214
+ * its sub DNS zone if needed.
215
+ *
216
+ * @param request - The request {@link RefreshDNSZoneRequest}
217
+ * @returns A Promise of RefreshDNSZoneResponse
218
+ */
219
+ refreshDNSZone = request => this.client.fetch({
220
+ body: JSON.stringify(marshalRefreshDNSZoneRequest(request, this.client.settings)),
221
+ headers: jsonContentHeaders,
222
+ method: 'POST',
223
+ path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/refresh`
224
+ }, unmarshalRefreshDNSZoneResponse);
225
+ pageOfListDNSZoneVersions = request => this.client.fetch({
226
+ method: 'GET',
227
+ path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/versions`,
228
+ urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
229
+ }, unmarshalListDNSZoneVersionsResponse);
230
+
231
+ /**
232
+ * List versions of a DNS zone. Retrieve a list of a DNS zone's versions.<br/>
233
+ * The maximum version count is 100. If the count reaches this limit, the
234
+ * oldest version will be deleted after each new modification.
235
+ *
236
+ * @param request - The request {@link ListDNSZoneVersionsRequest}
237
+ * @returns A Promise of ListDNSZoneVersionsResponse
238
+ */
239
+ listDNSZoneVersions = request => enrichForPagination('versions', this.pageOfListDNSZoneVersions, request);
240
+ pageOfListDNSZoneVersionRecords = request => this.client.fetch({
241
+ method: 'GET',
242
+ path: `/domain/v2beta1/dns-zones/version/${validatePathParam('dnsZoneVersionId', request.dnsZoneVersionId)}`,
243
+ urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
244
+ }, unmarshalListDNSZoneVersionRecordsResponse);
245
+
246
+ /**
247
+ * List records from a given version of a specific DNS zone. Retrieve a list
248
+ * of records from a specific DNS zone version.
249
+ *
250
+ * @param request - The request {@link ListDNSZoneVersionRecordsRequest}
251
+ * @returns A Promise of ListDNSZoneVersionRecordsResponse
252
+ */
253
+ listDNSZoneVersionRecords = request => enrichForPagination('records', this.pageOfListDNSZoneVersionRecords, request);
254
+
255
+ /**
256
+ * Access differences from a specific DNS zone version. Access a previous DNS
257
+ * zone version to see the differences from another specific version.
258
+ *
259
+ * @param request - The request {@link GetDNSZoneVersionDiffRequest}
260
+ * @returns A Promise of GetDNSZoneVersionDiffResponse
261
+ */
262
+ getDNSZoneVersionDiff = request => this.client.fetch({
263
+ method: 'GET',
264
+ path: `/domain/v2beta1/dns-zones/version/${validatePathParam('dnsZoneVersionId', request.dnsZoneVersionId)}/diff`
265
+ }, unmarshalGetDNSZoneVersionDiffResponse);
266
+
267
+ /**
268
+ * Restore a DNS zone version. Restore and activate a version of a specific
269
+ * DNS zone.
270
+ *
271
+ * @param request - The request {@link RestoreDNSZoneVersionRequest}
272
+ * @returns A Promise of RestoreDNSZoneVersionResponse
273
+ */
274
+ restoreDNSZoneVersion = request => this.client.fetch({
275
+ body: '{}',
276
+ headers: jsonContentHeaders,
277
+ method: 'POST',
278
+ path: `/domain/v2beta1/dns-zones/version/${validatePathParam('dnsZoneVersionId', request.dnsZoneVersionId)}/restore`
279
+ }, unmarshalRestoreDNSZoneVersionResponse);
280
+
281
+ /**
282
+ * Get a DNS zone's TLS certificate. Get the DNS zone's TLS certificate. If
283
+ * you do not have a certificate, the ouptut returns `no certificate found`.
284
+ *
285
+ * @param request - The request {@link GetSSLCertificateRequest}
286
+ * @returns A Promise of SSLCertificate
287
+ */
288
+ getSSLCertificate = request => this.client.fetch({
289
+ method: 'GET',
290
+ path: `/domain/v2beta1/ssl-certificates/${validatePathParam('dnsZone', request.dnsZone)}`
291
+ }, unmarshalSSLCertificate);
292
+
293
+ /**
294
+ * Waits for {@link SSLCertificate} to be in a final state.
295
+ *
296
+ * @param request - The request {@link GetSSLCertificateRequest}
297
+ * @param options - The waiting options
298
+ * @returns A Promise of SSLCertificate
299
+ */
300
+ waitForSSLCertificate = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!SSL_CERTIFICATE_TRANSIENT_STATUSES.includes(res.status))), this.getSSLCertificate, request, options);
301
+
302
+ /**
303
+ * Create or get the DNS zone's TLS certificate. Create a new TLS certificate
304
+ * or retrieve information about an existing TLS certificate.
305
+ *
306
+ * @param request - The request {@link CreateSSLCertificateRequest}
307
+ * @returns A Promise of SSLCertificate
308
+ */
309
+ createSSLCertificate = request => this.client.fetch({
310
+ body: JSON.stringify(marshalCreateSSLCertificateRequest(request, this.client.settings)),
311
+ headers: jsonContentHeaders,
312
+ method: 'POST',
313
+ path: `/domain/v2beta1/ssl-certificates`
314
+ }, unmarshalSSLCertificate);
315
+ pageOfListSSLCertificates = request => this.client.fetch({
316
+ method: 'GET',
317
+ path: `/domain/v2beta1/ssl-certificates`,
318
+ urlParams: urlParams(['dns_zone', request.dnsZone], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])
319
+ }, unmarshalListSSLCertificatesResponse);
320
+
321
+ /**
322
+ * List a user's TLS certificates. List all the TLS certificates a user has
323
+ * created, specified by the user's Project ID and the DNS zone.
324
+ *
325
+ * @param request - The request {@link ListSSLCertificatesRequest}
326
+ * @returns A Promise of ListSSLCertificatesResponse
327
+ */
328
+ listSSLCertificates = request => enrichForPagination('certificates', this.pageOfListSSLCertificates, request);
329
+
330
+ /**
331
+ * Delete a TLS certificate. Delete an existing TLS certificate specified by
332
+ * its DNS zone. Deleting a TLS certificate is permanent and cannot be
333
+ * undone.
334
+ *
335
+ * @param request - The request {@link DeleteSSLCertificateRequest}
336
+ * @returns A Promise of DeleteSSLCertificateResponse
337
+ */
338
+ deleteSSLCertificate = request => this.client.fetch({
339
+ method: 'DELETE',
340
+ path: `/domain/v2beta1/ssl-certificates/${validatePathParam('dnsZone', request.dnsZone)}`
341
+ }, unmarshalDeleteSSLCertificateResponse);
342
+
343
+ /**
344
+ * Get the DNS zone's TSIG key. Retrieve information about the TSIG key of a
345
+ * given DNS zone to allow AXFR requests.
346
+ *
347
+ * @param request - The request {@link GetDNSZoneTsigKeyRequest}
348
+ * @returns A Promise of GetDNSZoneTsigKeyResponse
349
+ */
350
+ getDNSZoneTsigKey = request => this.client.fetch({
351
+ method: 'GET',
352
+ path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/tsig-key`
353
+ }, unmarshalGetDNSZoneTsigKeyResponse);
354
+
355
+ /**
356
+ * Delete the DNS zone's TSIG key. Delete an existing TSIG key specified by
357
+ * its DNS zone. Deleting a TSIG key is permanent and cannot be undone.
358
+ *
359
+ * @param request - The request {@link DeleteDNSZoneTsigKeyRequest}
360
+ */
361
+ deleteDNSZoneTsigKey = request => this.client.fetch({
362
+ method: 'DELETE',
363
+ path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/tsig-key`
364
+ });
343
365
  }
344
366
 
345
367
  /**
@@ -348,11 +370,9 @@ class API extends API$1 {
348
370
  * Domains and DNS - Registrar API. Manage your domains and contacts.
349
371
  */
350
372
  class RegistrarAPI extends API$1 {
351
- constructor() {
352
- var _this;
353
- super(...arguments);
354
- _this = this;
355
- this.pageOfListTasks = function (request) {
373
+ pageOfListTasks = (() => {
374
+ var _this = this;
375
+ return function (request) {
356
376
  if (request === void 0) {
357
377
  request = {};
358
378
  }
@@ -362,392 +382,458 @@ class RegistrarAPI extends API$1 {
362
382
  urlParams: urlParams(['domain', request.domain], ['order_by', request.orderBy ?? 'domain_desc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId], ['statuses', request.statuses], ['types', request.types])
363
383
  }, unmarshalListTasksResponse);
364
384
  };
365
- /**
366
- * List tasks. List all account tasks. You can filter the list by domain name.
367
- *
368
- * @param request - The request {@link RegistrarApiListTasksRequest}
369
- * @returns A Promise of ListTasksResponse
370
- */
371
- this.listTasks = function (request) {
385
+ })();
386
+
387
+ /**
388
+ * List tasks. List all operations performed on the account. You can filter
389
+ * the list of tasks by domain name.
390
+ *
391
+ * @param request - The request {@link RegistrarApiListTasksRequest}
392
+ * @returns A Promise of ListTasksResponse
393
+ */
394
+ listTasks = (() => {
395
+ var _this2 = this;
396
+ return function (request) {
372
397
  if (request === void 0) {
373
398
  request = {};
374
399
  }
375
- return enrichForPagination('tasks', _this.pageOfListTasks, request);
400
+ return enrichForPagination('tasks', _this2.pageOfListTasks, request);
376
401
  };
377
- /**
378
- * Buy one or more domains. Request the registration of domain names. You can
379
- * provide an already existing domain's contact or a new contact.
380
- *
381
- * @param request - The request {@link RegistrarApiBuyDomainsRequest}
382
- * @returns A Promise of OrderResponse
383
- */
384
- this.buyDomains = request => this.client.fetch({
385
- body: JSON.stringify(marshalRegistrarApiBuyDomainsRequest(request, this.client.settings)),
386
- headers: jsonContentHeaders,
387
- method: 'POST',
388
- path: `/domain/v2beta1/buy-domains`
389
- }, unmarshalOrderResponse);
390
- /**
391
- * Renew one or more domains. Request the renewal of domain names.
392
- *
393
- * @param request - The request {@link RegistrarApiRenewDomainsRequest}
394
- * @returns A Promise of OrderResponse
395
- */
396
- this.renewDomains = request => this.client.fetch({
397
- body: JSON.stringify(marshalRegistrarApiRenewDomainsRequest(request, this.client.settings)),
398
- headers: jsonContentHeaders,
399
- method: 'POST',
400
- path: `/domain/v2beta1/renew-domains`
401
- }, unmarshalOrderResponse);
402
- /**
403
- * Transfer a domain. Request the transfer from another registrar domain to
404
- * Scaleway.
405
- *
406
- * @param request - The request {@link RegistrarApiTransferInDomainRequest}
407
- * @returns A Promise of OrderResponse
408
- */
409
- this.transferInDomain = request => this.client.fetch({
410
- body: JSON.stringify(marshalRegistrarApiTransferInDomainRequest(request, this.client.settings)),
411
- headers: jsonContentHeaders,
412
- method: 'POST',
413
- path: `/domain/v2beta1/domains/transfer-domains`
414
- }, unmarshalOrderResponse);
415
- /**
416
- * Trade a domain contact. Request a trade for the contact owner.<br/> If an
417
- * `organization_id` is given, the change is from the current Scaleway account
418
- * to another Scaleway account.<br/> If no contact is given, the first contact
419
- * of the other Scaleway account is taken.<br/> If the other Scaleway account
420
- * has no contact. An error occurs.
421
- *
422
- * @param request - The request {@link RegistrarApiTradeDomainRequest}
423
- * @returns A Promise of OrderResponse
424
- */
425
- this.tradeDomain = request => this.client.fetch({
426
- body: JSON.stringify(marshalRegistrarApiTradeDomainRequest(request, this.client.settings)),
427
- headers: jsonContentHeaders,
428
- method: 'POST',
429
- path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/trade`
430
- }, unmarshalOrderResponse);
431
- /**
432
- * Register an external domain. Request the registration of an external domain
433
- * name.
434
- *
435
- * @param request - The request
436
- * {@link RegistrarApiRegisterExternalDomainRequest}
437
- * @returns A Promise of RegisterExternalDomainResponse
438
- */
439
- this.registerExternalDomain = request => this.client.fetch({
440
- body: JSON.stringify(marshalRegistrarApiRegisterExternalDomainRequest(request, this.client.settings)),
441
- headers: jsonContentHeaders,
442
- method: 'POST',
443
- path: `/domain/v2beta1/external-domains`
444
- }, unmarshalRegisterExternalDomainResponse);
445
- /**
446
- * Delete an external domain. Delete an external domain name.
447
- *
448
- * @param request - The request {@link RegistrarApiDeleteExternalDomainRequest}
449
- * @returns A Promise of DeleteExternalDomainResponse
450
- */
451
- this.deleteExternalDomain = request => this.client.fetch({
452
- method: 'DELETE',
453
- path: `/domain/v2beta1/external-domains/${validatePathParam('domain', request.domain)}`
454
- }, unmarshalDeleteExternalDomainResponse);
455
- /**
456
- * Check if contacts are compatible against a domain or a tld. Check if
457
- * contacts are compatible against a domain or a tld. If not, it will return
458
- * the information requiring a correction.
459
- *
460
- * @param request - The request
461
- * {@link RegistrarApiCheckContactsCompatibilityRequest}
462
- * @returns A Promise of CheckContactsCompatibilityResponse
463
- */
464
- this.checkContactsCompatibility = function (request) {
402
+ })();
403
+
404
+ /**
405
+ * Purchase domains. Request the registration of domain names. You can provide
406
+ * a domain's already existing contact or a new contact.
407
+ *
408
+ * @param request - The request {@link RegistrarApiBuyDomainsRequest}
409
+ * @returns A Promise of OrderResponse
410
+ */
411
+ buyDomains = request => this.client.fetch({
412
+ body: JSON.stringify(marshalRegistrarApiBuyDomainsRequest(request, this.client.settings)),
413
+ headers: jsonContentHeaders,
414
+ method: 'POST',
415
+ path: `/domain/v2beta1/buy-domains`
416
+ }, unmarshalOrderResponse);
417
+
418
+ /**
419
+ * Renew domains. Request the renewal of one or more domain names.
420
+ *
421
+ * @param request - The request {@link RegistrarApiRenewDomainsRequest}
422
+ * @returns A Promise of OrderResponse
423
+ */
424
+ renewDomains = request => this.client.fetch({
425
+ body: JSON.stringify(marshalRegistrarApiRenewDomainsRequest(request, this.client.settings)),
426
+ headers: jsonContentHeaders,
427
+ method: 'POST',
428
+ path: `/domain/v2beta1/renew-domains`
429
+ }, unmarshalOrderResponse);
430
+
431
+ /**
432
+ * Transfer a domain. Request the transfer of a domain from another registrar
433
+ * to Scaleway Domains and DNS.
434
+ *
435
+ * @param request - The request {@link RegistrarApiTransferInDomainRequest}
436
+ * @returns A Promise of OrderResponse
437
+ */
438
+ transferInDomain = request => this.client.fetch({
439
+ body: JSON.stringify(marshalRegistrarApiTransferInDomainRequest(request, this.client.settings)),
440
+ headers: jsonContentHeaders,
441
+ method: 'POST',
442
+ path: `/domain/v2beta1/domains/transfer-domains`
443
+ }, unmarshalOrderResponse);
444
+
445
+ /**
446
+ * Trade a domain's contact. Request to change a domain's contact owner.<br/>
447
+ * If you specify the `organization_id` of the domain's new owner, the contact
448
+ * will change from the current owner's Scaleway account to the new owner's
449
+ * Scaleway account.<br/> If the new owner's current contact information is
450
+ * not available, the first ever contact they have created for previous
451
+ * domains is taken into account to operate the change.<br/> If the new owner
452
+ * has never created a contact to register domains before, an error message
453
+ * displays.
454
+ *
455
+ * @param request - The request {@link RegistrarApiTradeDomainRequest}
456
+ * @returns A Promise of OrderResponse
457
+ */
458
+ tradeDomain = request => this.client.fetch({
459
+ body: JSON.stringify(marshalRegistrarApiTradeDomainRequest(request, this.client.settings)),
460
+ headers: jsonContentHeaders,
461
+ method: 'POST',
462
+ path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/trade`
463
+ }, unmarshalOrderResponse);
464
+
465
+ /**
466
+ * Register an external domain. Request the registration of an external domain
467
+ * name.
468
+ *
469
+ * @param request - The request
470
+ * {@link RegistrarApiRegisterExternalDomainRequest}
471
+ * @returns A Promise of RegisterExternalDomainResponse
472
+ */
473
+ registerExternalDomain = request => this.client.fetch({
474
+ body: JSON.stringify(marshalRegistrarApiRegisterExternalDomainRequest(request, this.client.settings)),
475
+ headers: jsonContentHeaders,
476
+ method: 'POST',
477
+ path: `/domain/v2beta1/external-domains`
478
+ }, unmarshalRegisterExternalDomainResponse);
479
+
480
+ /**
481
+ * Delete an external domain. Delete an external domain name.
482
+ *
483
+ * @param request - The request {@link RegistrarApiDeleteExternalDomainRequest}
484
+ * @returns A Promise of DeleteExternalDomainResponse
485
+ */
486
+ deleteExternalDomain = request => this.client.fetch({
487
+ method: 'DELETE',
488
+ path: `/domain/v2beta1/external-domains/${validatePathParam('domain', request.domain)}`
489
+ }, unmarshalDeleteExternalDomainResponse);
490
+
491
+ /**
492
+ * Check if contacts are compatible with a domain or a TLD. Check whether
493
+ * contacts are compatible with a domain or a TLD. If contacts are not
494
+ * compatible with either the domain or the TLD, the information that needs to
495
+ * be corrected is returned.
496
+ *
497
+ * @param request - The request
498
+ * {@link RegistrarApiCheckContactsCompatibilityRequest}
499
+ * @returns A Promise of CheckContactsCompatibilityResponse
500
+ */
501
+ checkContactsCompatibility = (() => {
502
+ var _this3 = this;
503
+ return function (request) {
465
504
  if (request === void 0) {
466
505
  request = {};
467
506
  }
468
- return _this.client.fetch({
469
- body: JSON.stringify(marshalRegistrarApiCheckContactsCompatibilityRequest(request, _this.client.settings)),
507
+ return _this3.client.fetch({
508
+ body: JSON.stringify(marshalRegistrarApiCheckContactsCompatibilityRequest(request, _this3.client.settings)),
470
509
  headers: jsonContentHeaders,
471
510
  method: 'POST',
472
511
  path: `/domain/v2beta1/check-contacts-compatibility`
473
512
  }, unmarshalCheckContactsCompatibilityResponse);
474
513
  };
475
- this.pageOfListContacts = function (request) {
514
+ })();
515
+ pageOfListContacts = (() => {
516
+ var _this4 = this;
517
+ return function (request) {
476
518
  if (request === void 0) {
477
519
  request = {};
478
520
  }
479
- return _this.client.fetch({
521
+ return _this4.client.fetch({
480
522
  method: 'GET',
481
523
  path: `/domain/v2beta1/contacts`,
482
- urlParams: urlParams(['domain', request.domain], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId])
524
+ urlParams: urlParams(['domain', request.domain], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this4.client.settings.defaultPageSize], ['project_id', request.projectId])
483
525
  }, unmarshalListContactsResponse);
484
526
  };
485
- /**
486
- * List contacts. Return a list of contacts with their domains and roles. You
487
- * can filter the list by domain name.
488
- *
489
- * @param request - The request {@link RegistrarApiListContactsRequest}
490
- * @returns A Promise of ListContactsResponse
491
- */
492
- this.listContacts = function (request) {
527
+ })();
528
+
529
+ /**
530
+ * List contacts. Retrieve the list of contacts and their associated domains
531
+ * and roles. You can filter the list by domain name.
532
+ *
533
+ * @param request - The request {@link RegistrarApiListContactsRequest}
534
+ * @returns A Promise of ListContactsResponse
535
+ */
536
+ listContacts = (() => {
537
+ var _this5 = this;
538
+ return function (request) {
493
539
  if (request === void 0) {
494
540
  request = {};
495
541
  }
496
- return enrichForPagination('contacts', _this.pageOfListContacts, request);
542
+ return enrichForPagination('contacts', _this5.pageOfListContacts, request);
497
543
  };
498
- /**
499
- * Get a contact. Return a contact details retrieved from the registrar using
500
- * a given contact ID.
501
- *
502
- * @param request - The request {@link RegistrarApiGetContactRequest}
503
- * @returns A Promise of Contact
504
- */
505
- this.getContact = request => this.client.fetch({
506
- method: 'GET',
507
- path: `/domain/v2beta1/contacts/${validatePathParam('contactId', request.contactId)}`
508
- }, unmarshalContact);
509
- /**
510
- * Update contact. You can edit the contact coordinates.
511
- *
512
- * @param request - The request {@link RegistrarApiUpdateContactRequest}
513
- * @returns A Promise of Contact
514
- */
515
- this.updateContact = request => this.client.fetch({
516
- body: JSON.stringify(marshalRegistrarApiUpdateContactRequest(request, this.client.settings)),
517
- headers: jsonContentHeaders,
518
- method: 'PATCH',
519
- path: `/domain/v2beta1/contacts/${validatePathParam('contactId', request.contactId)}`
520
- }, unmarshalContact);
521
- this.pageOfListDomains = function (request) {
544
+ })();
545
+
546
+ /**
547
+ * Get a contact. Retrieve a contact's details from the registrar using the
548
+ * given contact's ID.
549
+ *
550
+ * @param request - The request {@link RegistrarApiGetContactRequest}
551
+ * @returns A Promise of Contact
552
+ */
553
+ getContact = request => this.client.fetch({
554
+ method: 'GET',
555
+ path: `/domain/v2beta1/contacts/${validatePathParam('contactId', request.contactId)}`
556
+ }, unmarshalContact);
557
+
558
+ /**
559
+ * Update contact. Edit the contact's information.
560
+ *
561
+ * @param request - The request {@link RegistrarApiUpdateContactRequest}
562
+ * @returns A Promise of Contact
563
+ */
564
+ updateContact = request => this.client.fetch({
565
+ body: JSON.stringify(marshalRegistrarApiUpdateContactRequest(request, this.client.settings)),
566
+ headers: jsonContentHeaders,
567
+ method: 'PATCH',
568
+ path: `/domain/v2beta1/contacts/${validatePathParam('contactId', request.contactId)}`
569
+ }, unmarshalContact);
570
+ pageOfListDomains = (() => {
571
+ var _this6 = this;
572
+ return function (request) {
522
573
  if (request === void 0) {
523
574
  request = {};
524
575
  }
525
- return _this.client.fetch({
576
+ return _this6.client.fetch({
526
577
  method: 'GET',
527
578
  path: `/domain/v2beta1/domains`,
528
- urlParams: urlParams(['domain', request.domain], ['is_external', request.isExternal], ['order_by', request.orderBy ?? 'domain_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId], ['registrar', request.registrar], ['status', request.status ?? 'status_unknown'])
579
+ urlParams: urlParams(['domain', request.domain], ['is_external', request.isExternal], ['order_by', request.orderBy ?? 'domain_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this6.client.settings.defaultPageSize], ['project_id', request.projectId], ['registrar', request.registrar], ['status', request.status ?? 'status_unknown'])
529
580
  }, unmarshalListDomainsResponse);
530
581
  };
531
- /**
532
- * List domains. Returns a list of domains owned by the user.
533
- *
534
- * @param request - The request {@link RegistrarApiListDomainsRequest}
535
- * @returns A Promise of ListDomainsResponse
536
- */
537
- this.listDomains = function (request) {
582
+ })();
583
+
584
+ /**
585
+ * List domains. Retrieve the list of domains you own.
586
+ *
587
+ * @param request - The request {@link RegistrarApiListDomainsRequest}
588
+ * @returns A Promise of ListDomainsResponse
589
+ */
590
+ listDomains = (() => {
591
+ var _this7 = this;
592
+ return function (request) {
538
593
  if (request === void 0) {
539
594
  request = {};
540
595
  }
541
- return enrichForPagination('domains', _this.pageOfListDomains, request);
596
+ return enrichForPagination('domains', _this7.pageOfListDomains, request);
542
597
  };
543
- this.pageOfListRenewableDomains = function (request) {
598
+ })();
599
+ pageOfListRenewableDomains = (() => {
600
+ var _this8 = this;
601
+ return function (request) {
544
602
  if (request === void 0) {
545
603
  request = {};
546
604
  }
547
- return _this.client.fetch({
605
+ return _this8.client.fetch({
548
606
  method: 'GET',
549
607
  path: `/domain/v2beta1/renewable-domains`,
550
- urlParams: urlParams(['order_by', request.orderBy ?? 'domain_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId])
608
+ urlParams: urlParams(['order_by', request.orderBy ?? 'domain_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this8.client.settings.defaultPageSize], ['project_id', request.projectId])
551
609
  }, unmarshalListRenewableDomainsResponse);
552
610
  };
553
- /**
554
- * List scaleway domains that can or not be renewed. Returns a list of domains
555
- * owned by the user with a renew status and if renewable, the maximum renew
556
- * duration in years.
557
- *
558
- * @param request - The request {@link RegistrarApiListRenewableDomainsRequest}
559
- * @returns A Promise of ListRenewableDomainsResponse
560
- */
561
- this.listRenewableDomains = function (request) {
611
+ })();
612
+
613
+ /**
614
+ * List domains that can be renewed. Retrieve the list of domains you own that
615
+ * can be renewed. You can also see the maximum renewal duration in years for
616
+ * your domains that are renewable.
617
+ *
618
+ * @param request - The request {@link RegistrarApiListRenewableDomainsRequest}
619
+ * @returns A Promise of ListRenewableDomainsResponse
620
+ */
621
+ listRenewableDomains = (() => {
622
+ var _this9 = this;
623
+ return function (request) {
562
624
  if (request === void 0) {
563
625
  request = {};
564
626
  }
565
- return enrichForPagination('domains', _this.pageOfListRenewableDomains, request);
627
+ return enrichForPagination('domains', _this9.pageOfListRenewableDomains, request);
566
628
  };
567
- /**
568
- * Get domain. Returns a the domain with more informations.
569
- *
570
- * @param request - The request {@link RegistrarApiGetDomainRequest}
571
- * @returns A Promise of Domain
572
- */
573
- this.getDomain = request => this.client.fetch({
574
- method: 'GET',
575
- path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}`
576
- }, unmarshalDomain);
577
- /**
578
- * Waits for {@link Domain} to be in a final state.
579
- *
580
- * @param request - The request {@link GetDomainRequest}
581
- * @param options - The waiting options
582
- * @returns A Promise of Domain
583
- */
584
- this.waitForDomain = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES.includes(res.status))), this.getDomain, request, options);
585
- /**
586
- * Update a domain. Update the domain contacts or create a new one.<br/> If
587
- * you add the same contact for multiple roles. Only one ID will be created
588
- * and used for all of them.
589
- *
590
- * @param request - The request {@link RegistrarApiUpdateDomainRequest}
591
- * @returns A Promise of Domain
592
- */
593
- this.updateDomain = request => this.client.fetch({
594
- body: JSON.stringify(marshalRegistrarApiUpdateDomainRequest(request, this.client.settings)),
595
- headers: jsonContentHeaders,
596
- method: 'PATCH',
597
- path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}`
598
- }, unmarshalDomain);
599
- /**
600
- * Lock domain transfer. Lock domain transfer. A locked domain transfer can't
601
- * be transferred and the auth code can't be requested.
602
- *
603
- * @param request - The request {@link RegistrarApiLockDomainTransferRequest}
604
- * @returns A Promise of Domain
605
- */
606
- this.lockDomainTransfer = request => this.client.fetch({
607
- body: '{}',
608
- headers: jsonContentHeaders,
609
- method: 'POST',
610
- path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/lock-transfer`
611
- }, unmarshalDomain);
612
- /**
613
- * Unlock domain transfer. Unlock domain transfer. An unlocked domain can be
614
- * transferred and the auth code can be requested for this.
615
- *
616
- * @param request - The request {@link RegistrarApiUnlockDomainTransferRequest}
617
- * @returns A Promise of Domain
618
- */
619
- this.unlockDomainTransfer = request => this.client.fetch({
620
- body: '{}',
621
- headers: jsonContentHeaders,
622
- method: 'POST',
623
- path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/unlock-transfer`
624
- }, unmarshalDomain);
625
- /**
626
- * Enable domain auto renew.
627
- *
628
- * @param request - The request
629
- * {@link RegistrarApiEnableDomainAutoRenewRequest}
630
- * @returns A Promise of Domain
631
- */
632
- this.enableDomainAutoRenew = request => this.client.fetch({
633
- body: '{}',
634
- headers: jsonContentHeaders,
635
- method: 'POST',
636
- path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/enable-auto-renew`
637
- }, unmarshalDomain);
638
- /**
639
- * Disable domain auto renew.
640
- *
641
- * @param request - The request
642
- * {@link RegistrarApiDisableDomainAutoRenewRequest}
643
- * @returns A Promise of Domain
644
- */
645
- this.disableDomainAutoRenew = request => this.client.fetch({
646
- body: '{}',
647
- headers: jsonContentHeaders,
648
- method: 'POST',
649
- path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/disable-auto-renew`
650
- }, unmarshalDomain);
651
- /**
652
- * Return domain auth code. If possible, return the auth code for an unlocked
653
- * domain transfer, or an error if the domain is locked. Some TLD may have a
654
- * different procedure to retrieve the auth code, in that case, the
655
- * information is given in the message field.
656
- *
657
- * @param request - The request {@link RegistrarApiGetDomainAuthCodeRequest}
658
- * @returns A Promise of GetDomainAuthCodeResponse
659
- */
660
- this.getDomainAuthCode = request => this.client.fetch({
661
- method: 'GET',
662
- path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/auth-code`
663
- }, unmarshalGetDomainAuthCodeResponse);
664
- /**
665
- * Update domain DNSSEC. If your domain has the default Scaleway NS and uses
666
- * another registrar, you have to update the DS record manually.
667
- *
668
- * @param request - The request {@link RegistrarApiEnableDomainDNSSECRequest}
669
- * @returns A Promise of Domain
670
- */
671
- this.enableDomainDNSSEC = request => this.client.fetch({
672
- body: JSON.stringify(marshalRegistrarApiEnableDomainDNSSECRequest(request, this.client.settings)),
673
- headers: jsonContentHeaders,
674
- method: 'POST',
675
- path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/enable-dnssec`
676
- }, unmarshalDomain);
677
- /**
678
- * Disable domain DNSSEC.
679
- *
680
- * @param request - The request {@link RegistrarApiDisableDomainDNSSECRequest}
681
- * @returns A Promise of Domain
682
- */
683
- this.disableDomainDNSSEC = request => this.client.fetch({
684
- body: '{}',
685
- headers: jsonContentHeaders,
686
- method: 'POST',
687
- path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/disable-dnssec`
688
- }, unmarshalDomain);
689
- /**
690
- * Search available domains. Search a domain (or at maximum, 10 domains).
691
- *
692
- * If the TLD list is empty or not set the search returns the results from the
693
- * most popular TLDs.
694
- *
695
- * @param request - The request
696
- * {@link RegistrarApiSearchAvailableDomainsRequest}
697
- * @returns A Promise of SearchAvailableDomainsResponse
698
- */
699
- this.searchAvailableDomains = request => this.client.fetch({
700
- method: 'GET',
701
- path: `/domain/v2beta1/search-domains`,
702
- urlParams: urlParams(['domains', request.domains], ['strict_search', request.strictSearch], ['tlds', request.tlds])
703
- }, unmarshalSearchAvailableDomainsResponse);
704
- /**
705
- * Create domain hostname with glue IPs.
706
- *
707
- * @param request - The request {@link RegistrarApiCreateDomainHostRequest}
708
- * @returns A Promise of Host
709
- */
710
- this.createDomainHost = request => this.client.fetch({
711
- body: JSON.stringify(marshalRegistrarApiCreateDomainHostRequest(request, this.client.settings)),
712
- headers: jsonContentHeaders,
713
- method: 'POST',
714
- path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/hosts`
715
- }, unmarshalHost);
716
- this.pageOfListDomainHosts = request => this.client.fetch({
717
- method: 'GET',
718
- path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/hosts`,
719
- urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
720
- }, unmarshalListDomainHostsResponse);
721
- /**
722
- * List domain hostnames with they glue IPs.
723
- *
724
- * @param request - The request {@link RegistrarApiListDomainHostsRequest}
725
- * @returns A Promise of ListDomainHostsResponse
726
- */
727
- this.listDomainHosts = request => enrichForPagination('hosts', this.pageOfListDomainHosts, request);
728
- /**
729
- * Update domain hostname with glue IPs.
730
- *
731
- * @param request - The request {@link RegistrarApiUpdateDomainHostRequest}
732
- * @returns A Promise of Host
733
- */
734
- this.updateDomainHost = request => this.client.fetch({
735
- body: JSON.stringify(marshalRegistrarApiUpdateDomainHostRequest(request, this.client.settings)),
736
- headers: jsonContentHeaders,
737
- method: 'PATCH',
738
- path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/hosts/${validatePathParam('name', request.name)}`
739
- }, unmarshalHost);
740
- /**
741
- * Delete domain hostname.
742
- *
743
- * @param request - The request {@link RegistrarApiDeleteDomainHostRequest}
744
- * @returns A Promise of Host
745
- */
746
- this.deleteDomainHost = request => this.client.fetch({
747
- method: 'DELETE',
748
- path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/hosts/${validatePathParam('name', request.name)}`
749
- }, unmarshalHost);
750
- }
629
+ })();
630
+
631
+ /**
632
+ * Get domain. Retrieve a specific domain and display the domain's
633
+ * information.
634
+ *
635
+ * @param request - The request {@link RegistrarApiGetDomainRequest}
636
+ * @returns A Promise of Domain
637
+ */
638
+ getDomain = request => this.client.fetch({
639
+ method: 'GET',
640
+ path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}`
641
+ }, unmarshalDomain);
642
+
643
+ /**
644
+ * Waits for {@link Domain} to be in a final state.
645
+ *
646
+ * @param request - The request {@link GetDomainRequest}
647
+ * @param options - The waiting options
648
+ * @returns A Promise of Domain
649
+ */
650
+ waitForDomain = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES.includes(res.status))), this.getDomain, request, options);
651
+
652
+ /**
653
+ * Update a domain's contacts. Update contacts for a specific domain or create
654
+ * a new contact.<br/> If you add the same contact for multiple roles (owner,
655
+ * administrative, technical), only one ID will be created and used for all of
656
+ * the roles.
657
+ *
658
+ * @param request - The request {@link RegistrarApiUpdateDomainRequest}
659
+ * @returns A Promise of Domain
660
+ */
661
+ updateDomain = request => this.client.fetch({
662
+ body: JSON.stringify(marshalRegistrarApiUpdateDomainRequest(request, this.client.settings)),
663
+ headers: jsonContentHeaders,
664
+ method: 'PATCH',
665
+ path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}`
666
+ }, unmarshalDomain);
667
+
668
+ /**
669
+ * Lock the transfer of a domain. Lock the transfer of a domain. This means
670
+ * that the domain cannot be transferred and the authorization code cannot be
671
+ * requested to your current registrar.
672
+ *
673
+ * @param request - The request {@link RegistrarApiLockDomainTransferRequest}
674
+ * @returns A Promise of Domain
675
+ */
676
+ lockDomainTransfer = request => this.client.fetch({
677
+ body: '{}',
678
+ headers: jsonContentHeaders,
679
+ method: 'POST',
680
+ path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/lock-transfer`
681
+ }, unmarshalDomain);
682
+
683
+ /**
684
+ * Unlock the transfer of a domain. Unlock the transfer of a domain. This
685
+ * means that the domain can be transferred and the authorization code can be
686
+ * requested to your current registrar.
687
+ *
688
+ * @param request - The request {@link RegistrarApiUnlockDomainTransferRequest}
689
+ * @returns A Promise of Domain
690
+ */
691
+ unlockDomainTransfer = request => this.client.fetch({
692
+ body: '{}',
693
+ headers: jsonContentHeaders,
694
+ method: 'POST',
695
+ path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/unlock-transfer`
696
+ }, unmarshalDomain);
697
+
698
+ /**
699
+ * Enable auto renew. Enable the `auto renew` feature for a domain. This means
700
+ * the domain will be automatically renewed before its expiry date.
701
+ *
702
+ * @param request - The request
703
+ * {@link RegistrarApiEnableDomainAutoRenewRequest}
704
+ * @returns A Promise of Domain
705
+ */
706
+ enableDomainAutoRenew = request => this.client.fetch({
707
+ body: '{}',
708
+ headers: jsonContentHeaders,
709
+ method: 'POST',
710
+ path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/enable-auto-renew`
711
+ }, unmarshalDomain);
712
+
713
+ /**
714
+ * Disable auto renew. Disable the `auto renew` feature for a domain. This
715
+ * means the domain will not be renewed before its expiry date.
716
+ *
717
+ * @param request - The request
718
+ * {@link RegistrarApiDisableDomainAutoRenewRequest}
719
+ * @returns A Promise of Domain
720
+ */
721
+ disableDomainAutoRenew = request => this.client.fetch({
722
+ body: '{}',
723
+ headers: jsonContentHeaders,
724
+ method: 'POST',
725
+ path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/disable-auto-renew`
726
+ }, unmarshalDomain);
727
+
728
+ /**
729
+ * Get a domain's authorization code. Retrieve the authorization code to
730
+ * tranfer an unlocked domain. The output returns an error if the domain is
731
+ * locked. Some TLDs may have a different procedure to retrieve the
732
+ * authorization code. In that case, the information displays in the message
733
+ * field.
734
+ *
735
+ * @param request - The request {@link RegistrarApiGetDomainAuthCodeRequest}
736
+ * @returns A Promise of GetDomainAuthCodeResponse
737
+ */
738
+ getDomainAuthCode = request => this.client.fetch({
739
+ method: 'GET',
740
+ path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/auth-code`
741
+ }, unmarshalGetDomainAuthCodeResponse);
742
+
743
+ /**
744
+ * Update domain DNSSEC. If your domain has the default Scaleway NS and uses
745
+ * another registrar, you have to update the DS record manually.
746
+ *
747
+ * @param request - The request {@link RegistrarApiEnableDomainDNSSECRequest}
748
+ * @returns A Promise of Domain
749
+ */
750
+ enableDomainDNSSEC = request => this.client.fetch({
751
+ body: JSON.stringify(marshalRegistrarApiEnableDomainDNSSECRequest(request, this.client.settings)),
752
+ headers: jsonContentHeaders,
753
+ method: 'POST',
754
+ path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/enable-dnssec`
755
+ }, unmarshalDomain);
756
+
757
+ /**
758
+ * Disable a domain's DNSSEC. Disable DNSSEC for a domain.
759
+ *
760
+ * @param request - The request {@link RegistrarApiDisableDomainDNSSECRequest}
761
+ * @returns A Promise of Domain
762
+ */
763
+ disableDomainDNSSEC = request => this.client.fetch({
764
+ body: '{}',
765
+ headers: jsonContentHeaders,
766
+ method: 'POST',
767
+ path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/disable-dnssec`
768
+ }, unmarshalDomain);
769
+
770
+ /**
771
+ * Search available domains. Search a domain or a maximum of 10 domains that
772
+ * are available.
773
+ *
774
+ * If the TLD list is empty or not set, the search returns the results from
775
+ * the most popular TLDs.
776
+ *
777
+ * @param request - The request
778
+ * {@link RegistrarApiSearchAvailableDomainsRequest}
779
+ * @returns A Promise of SearchAvailableDomainsResponse
780
+ */
781
+ searchAvailableDomains = request => this.client.fetch({
782
+ method: 'GET',
783
+ path: `/domain/v2beta1/search-domains`,
784
+ urlParams: urlParams(['domains', request.domains], ['strict_search', request.strictSearch], ['tlds', request.tlds])
785
+ }, unmarshalSearchAvailableDomainsResponse);
786
+
787
+ /**
788
+ * Create a hostname for a domain. Create a hostname for a domain with glue
789
+ * IPs.
790
+ *
791
+ * @param request - The request {@link RegistrarApiCreateDomainHostRequest}
792
+ * @returns A Promise of Host
793
+ */
794
+ createDomainHost = request => this.client.fetch({
795
+ body: JSON.stringify(marshalRegistrarApiCreateDomainHostRequest(request, this.client.settings)),
796
+ headers: jsonContentHeaders,
797
+ method: 'POST',
798
+ path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/hosts`
799
+ }, unmarshalHost);
800
+ pageOfListDomainHosts = request => this.client.fetch({
801
+ method: 'GET',
802
+ path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/hosts`,
803
+ urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
804
+ }, unmarshalListDomainHostsResponse);
805
+
806
+ /**
807
+ * List a domain's hostnames. List a domain's hostnames using their glue IPs.
808
+ *
809
+ * @param request - The request {@link RegistrarApiListDomainHostsRequest}
810
+ * @returns A Promise of ListDomainHostsResponse
811
+ */
812
+ listDomainHosts = request => enrichForPagination('hosts', this.pageOfListDomainHosts, request);
813
+
814
+ /**
815
+ * Update a domain's hostname. Update a domain's hostname with glue IPs.
816
+ *
817
+ * @param request - The request {@link RegistrarApiUpdateDomainHostRequest}
818
+ * @returns A Promise of Host
819
+ */
820
+ updateDomainHost = request => this.client.fetch({
821
+ body: JSON.stringify(marshalRegistrarApiUpdateDomainHostRequest(request, this.client.settings)),
822
+ headers: jsonContentHeaders,
823
+ method: 'PATCH',
824
+ path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/hosts/${validatePathParam('name', request.name)}`
825
+ }, unmarshalHost);
826
+
827
+ /**
828
+ * Delete a domain's hostname. Delete a domain's hostname.
829
+ *
830
+ * @param request - The request {@link RegistrarApiDeleteDomainHostRequest}
831
+ * @returns A Promise of Host
832
+ */
833
+ deleteDomainHost = request => this.client.fetch({
834
+ method: 'DELETE',
835
+ path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/hosts/${validatePathParam('name', request.name)}`
836
+ }, unmarshalHost);
751
837
  }
752
838
 
753
839
  export { API, RegistrarAPI };