@scaleway/sdk-domain 2.2.1 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1070 +1,695 @@
1
- import { API as API$1, urlParams, enrichForPagination, validatePathParam, waitForResource, unmarshalServiceInfo } from "@scaleway/sdk-client";
2
- import { SSL_CERTIFICATE_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES } from "./content.gen.js";
3
- import { unmarshalListDNSZonesResponse, marshalCreateDNSZoneRequest, unmarshalDNSZone, marshalUpdateDNSZoneRequest, marshalCloneDNSZoneRequest, unmarshalDeleteDNSZoneResponse, unmarshalListDNSZoneRecordsResponse, marshalUpdateDNSZoneRecordsRequest, unmarshalUpdateDNSZoneRecordsResponse, unmarshalListDNSZoneNameserversResponse, marshalUpdateDNSZoneNameserversRequest, unmarshalUpdateDNSZoneNameserversResponse, unmarshalClearDNSZoneRecordsResponse, marshalImportRawDNSZoneRequest, unmarshalImportRawDNSZoneResponse, marshalImportProviderDNSZoneRequest, unmarshalImportProviderDNSZoneResponse, marshalRefreshDNSZoneRequest, unmarshalRefreshDNSZoneResponse, unmarshalListDNSZoneVersionsResponse, unmarshalListDNSZoneVersionRecordsResponse, unmarshalGetDNSZoneVersionDiffResponse, unmarshalRestoreDNSZoneVersionResponse, unmarshalSSLCertificate, marshalCreateSSLCertificateRequest, unmarshalListSSLCertificatesResponse, unmarshalDeleteSSLCertificateResponse, unmarshalGetDNSZoneTsigKeyResponse, unmarshalListTasksResponse, unmarshalListInboundTransfersResponse, marshalRegistrarApiRetryInboundTransferRequest, unmarshalRetryInboundTransferResponse, marshalRegistrarApiBuyDomainsRequest, unmarshalOrderResponse, marshalRegistrarApiRenewDomainsRequest, marshalRegistrarApiTransferInDomainRequest, marshalRegistrarApiTradeDomainRequest, marshalRegistrarApiRegisterExternalDomainRequest, unmarshalRegisterExternalDomainResponse, unmarshalDeleteExternalDomainResponse, marshalRegistrarApiCheckContactsCompatibilityRequest, unmarshalCheckContactsCompatibilityResponse, unmarshalListContactsResponse, unmarshalContact, marshalRegistrarApiUpdateContactRequest, unmarshalListDomainsResponse, unmarshalListRenewableDomainsResponse, unmarshalDomain, marshalRegistrarApiUpdateDomainRequest, unmarshalGetDomainAuthCodeResponse, marshalRegistrarApiEnableDomainDNSSECRequest, unmarshalSearchAvailableDomainsResponse, unmarshalListTldsResponse, marshalRegistrarApiCreateDomainHostRequest, unmarshalHost, unmarshalListDomainHostsResponse, marshalRegistrarApiUpdateDomainHostRequest, unmarshalSearchAvailableDomainsConsoleResponse } from "./marshalling.gen.js";
4
- const jsonContentHeaders = {
5
- "Content-Type": "application/json; charset=utf-8"
1
+ import { DOMAIN_TRANSIENT_STATUSES, SSL_CERTIFICATE_TRANSIENT_STATUSES } from "./content.gen.js";
2
+ import { marshalCloneDNSZoneRequest, marshalCreateDNSZoneRequest, marshalCreateSSLCertificateRequest, marshalImportProviderDNSZoneRequest, marshalImportRawDNSZoneRequest, marshalRefreshDNSZoneRequest, marshalRegistrarApiBuyDomainsRequest, marshalRegistrarApiCheckContactsCompatibilityRequest, marshalRegistrarApiCreateDomainHostRequest, marshalRegistrarApiEnableDomainDNSSECRequest, marshalRegistrarApiRegisterExternalDomainRequest, marshalRegistrarApiRenewDomainsRequest, marshalRegistrarApiRetryInboundTransferRequest, marshalRegistrarApiTradeDomainRequest, marshalRegistrarApiTransferInDomainRequest, marshalRegistrarApiUpdateContactRequest, marshalRegistrarApiUpdateDomainHostRequest, marshalRegistrarApiUpdateDomainRequest, marshalUpdateDNSZoneNameserversRequest, marshalUpdateDNSZoneRecordsRequest, marshalUpdateDNSZoneRequest, unmarshalCheckContactsCompatibilityResponse, unmarshalClearDNSZoneRecordsResponse, unmarshalContact, unmarshalDNSZone, unmarshalDeleteDNSZoneResponse, unmarshalDeleteExternalDomainResponse, unmarshalDeleteSSLCertificateResponse, unmarshalDomain, unmarshalGetDNSZoneTsigKeyResponse, unmarshalGetDNSZoneVersionDiffResponse, unmarshalGetDomainAuthCodeResponse, unmarshalHost, unmarshalImportProviderDNSZoneResponse, unmarshalImportRawDNSZoneResponse, unmarshalListContactsResponse, unmarshalListDNSZoneNameserversResponse, unmarshalListDNSZoneRecordsResponse, unmarshalListDNSZoneVersionRecordsResponse, unmarshalListDNSZoneVersionsResponse, unmarshalListDNSZonesResponse, unmarshalListDomainHostsResponse, unmarshalListDomainsResponse, unmarshalListInboundTransfersResponse, unmarshalListRenewableDomainsResponse, unmarshalListSSLCertificatesResponse, unmarshalListTasksResponse, unmarshalListTldsResponse, unmarshalOrderResponse, unmarshalRefreshDNSZoneResponse, unmarshalRegisterExternalDomainResponse, unmarshalRestoreDNSZoneVersionResponse, unmarshalRetryInboundTransferResponse, unmarshalSSLCertificate, unmarshalSearchAvailableDomainsConsoleResponse, unmarshalSearchAvailableDomainsResponse, unmarshalUpdateDNSZoneNameserversResponse, unmarshalUpdateDNSZoneRecordsResponse } from "./marshalling.gen.js";
3
+ import { API, enrichForPagination, unmarshalServiceInfo, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
4
+ var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
5
+ /**
6
+ * Domains and DNS API.
7
+
8
+ This API allows you to manage your domains, DNS zones and records.
9
+ */
10
+ var API$1 = class extends API {
11
+ pageOfListDNSZones = (request) => this.client.fetch({
12
+ method: "GET",
13
+ path: `/domain/v2beta1/dns-zones`,
14
+ urlParams: urlParams(["created_after", request.createdAfter], ["created_before", request.createdBefore], ["dns_zone", request.dnsZone], ["dns_zones", request.dnsZones], ["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], ["updated_after", request.updatedAfter], ["updated_before", request.updatedBefore])
15
+ }, unmarshalListDNSZonesResponse);
16
+ /**
17
+ * List DNS zones. Retrieve the list of DNS zones you can manage and filter DNS zones associated with specific domain names.
18
+ *
19
+ * @param request - The request {@link ListDNSZonesRequest}
20
+ * @returns A Promise of ListDNSZonesResponse
21
+ */
22
+ listDNSZones = (request) => enrichForPagination("dnsZones", this.pageOfListDNSZones, request);
23
+ /**
24
+ * Create a DNS zone. Create a new DNS zone specified by the domain name, the subdomain and the Project ID.
25
+ *
26
+ * @param request - The request {@link CreateDNSZoneRequest}
27
+ * @returns A Promise of DNSZone
28
+ */
29
+ createDNSZone = (request) => this.client.fetch({
30
+ body: JSON.stringify(marshalCreateDNSZoneRequest(request, this.client.settings)),
31
+ headers: jsonContentHeaders,
32
+ method: "POST",
33
+ path: `/domain/v2beta1/dns-zones`
34
+ }, unmarshalDNSZone);
35
+ /**
36
+ * Update a DNS zone. Update the name and/or the Organizations for a DNS zone.
37
+ *
38
+ * @param request - The request {@link UpdateDNSZoneRequest}
39
+ * @returns A Promise of DNSZone
40
+ */
41
+ updateDNSZone = (request) => this.client.fetch({
42
+ body: JSON.stringify(marshalUpdateDNSZoneRequest(request, this.client.settings)),
43
+ headers: jsonContentHeaders,
44
+ method: "PATCH",
45
+ path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}`
46
+ }, unmarshalDNSZone);
47
+ /**
48
+ * Clone a DNS zone. Clone an existing DNS zone with all its records into a new DNS zone.
49
+ *
50
+ * @param request - The request {@link CloneDNSZoneRequest}
51
+ * @returns A Promise of DNSZone
52
+ */
53
+ cloneDNSZone = (request) => this.client.fetch({
54
+ body: JSON.stringify(marshalCloneDNSZoneRequest(request, this.client.settings)),
55
+ headers: jsonContentHeaders,
56
+ method: "POST",
57
+ path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/clone`
58
+ }, unmarshalDNSZone);
59
+ /**
60
+ * Delete a DNS zone. Delete a DNS zone and all its records.
61
+ *
62
+ * @param request - The request {@link DeleteDNSZoneRequest}
63
+ * @returns A Promise of DeleteDNSZoneResponse
64
+ */
65
+ deleteDNSZone = (request) => this.client.fetch({
66
+ method: "DELETE",
67
+ path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}`,
68
+ urlParams: urlParams(["project_id", request.projectId ?? this.client.settings.defaultProjectId])
69
+ }, unmarshalDeleteDNSZoneResponse);
70
+ pageOfListDNSZoneRecords = (request) => this.client.fetch({
71
+ method: "GET",
72
+ path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/records`,
73
+ urlParams: urlParams(["id", request.id], ["name", request.name], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["type", request.type])
74
+ }, unmarshalListDNSZoneRecordsResponse);
75
+ /**
76
+ * List records within a DNS zone. Retrieve a list of DNS records within a DNS zone that has default name servers.
77
+ You can filter records by type and name.
78
+ *
79
+ * @param request - The request {@link ListDNSZoneRecordsRequest}
80
+ * @returns A Promise of ListDNSZoneRecordsResponse
81
+ */
82
+ listDNSZoneRecords = (request) => enrichForPagination("records", this.pageOfListDNSZoneRecords, request);
83
+ /**
84
+ * Update records within a DNS zone. Update records within a DNS zone that has default name servers and perform several actions on your records.
85
+
86
+ Actions include:
87
+ - add: allows you to add a new record or add a new IP to an existing A record, for example
88
+ - set: allows you to edit a record or edit an IP from an existing A record, for example
89
+ - delete: allows you to delete a record or delete an IP from an existing A record, for example
90
+ - clear: allows you to delete all records from a DNS zone
91
+
92
+ All edits will be versioned.
93
+ *
94
+ * @param request - The request {@link UpdateDNSZoneRecordsRequest}
95
+ * @returns A Promise of UpdateDNSZoneRecordsResponse
96
+ */
97
+ updateDNSZoneRecords = (request) => this.client.fetch({
98
+ body: JSON.stringify(marshalUpdateDNSZoneRecordsRequest(request, this.client.settings)),
99
+ headers: jsonContentHeaders,
100
+ method: "PATCH",
101
+ path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/records`
102
+ }, unmarshalUpdateDNSZoneRecordsResponse);
103
+ /**
104
+ * List name servers within a DNS zone. Retrieve a list of name servers within a DNS zone and their optional glue records.
105
+ *
106
+ * @param request - The request {@link ListDNSZoneNameserversRequest}
107
+ * @returns A Promise of ListDNSZoneNameserversResponse
108
+ */
109
+ listDNSZoneNameservers = (request) => this.client.fetch({
110
+ method: "GET",
111
+ path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/nameservers`,
112
+ urlParams: urlParams(["project_id", request.projectId])
113
+ }, unmarshalListDNSZoneNameserversResponse);
114
+ /**
115
+ * Update name servers within a DNS zone. Update name servers within a DNS zone and set optional glue records.
116
+ *
117
+ * @param request - The request {@link UpdateDNSZoneNameserversRequest}
118
+ * @returns A Promise of UpdateDNSZoneNameserversResponse
119
+ */
120
+ updateDNSZoneNameservers = (request) => this.client.fetch({
121
+ body: JSON.stringify(marshalUpdateDNSZoneNameserversRequest(request, this.client.settings)),
122
+ headers: jsonContentHeaders,
123
+ method: "PUT",
124
+ path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/nameservers`
125
+ }, unmarshalUpdateDNSZoneNameserversResponse);
126
+ /**
127
+ * Clear records within a DNS zone. Delete all records within a DNS zone that has default name servers.<br/>
128
+ All edits will be versioned.
129
+ *
130
+ * @param request - The request {@link ClearDNSZoneRecordsRequest}
131
+ * @returns A Promise of ClearDNSZoneRecordsResponse
132
+ */
133
+ clearDNSZoneRecords = (request) => this.client.fetch({
134
+ method: "DELETE",
135
+ path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/records`
136
+ }, unmarshalClearDNSZoneRecordsResponse);
137
+ /**
138
+ * Export a raw DNS zone. Export a DNS zone with default name servers, in a specific format.
139
+ *
140
+ * @param request - The request {@link ExportRawDNSZoneRequest}
141
+ * @returns A Promise of Blob
142
+ */
143
+ exportRawDNSZone = (request) => this.client.fetch({
144
+ method: "GET",
145
+ path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/raw`,
146
+ urlParams: urlParams(["dl", 1], ["format", request.format]),
147
+ responseType: "blob"
148
+ });
149
+ /**
150
+ * Import a raw DNS zone. Import and replace the format of records from a given provider, with default name servers.
151
+ *
152
+ * @param request - The request {@link ImportRawDNSZoneRequest}
153
+ * @returns A Promise of ImportRawDNSZoneResponse
154
+ */
155
+ importRawDNSZone = (request) => this.client.fetch({
156
+ body: JSON.stringify(marshalImportRawDNSZoneRequest(request, this.client.settings)),
157
+ headers: jsonContentHeaders,
158
+ method: "POST",
159
+ path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/raw`
160
+ }, unmarshalImportRawDNSZoneResponse);
161
+ /**
162
+ * Import a DNS zone from another provider. Import and replace the format of records from a given provider, with default name servers.
163
+ *
164
+ * @param request - The request {@link ImportProviderDNSZoneRequest}
165
+ * @returns A Promise of ImportProviderDNSZoneResponse
166
+ */
167
+ importProviderDNSZone = (request) => this.client.fetch({
168
+ body: JSON.stringify(marshalImportProviderDNSZoneRequest(request, this.client.settings)),
169
+ headers: jsonContentHeaders,
170
+ method: "POST",
171
+ path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/import-provider`
172
+ }, unmarshalImportProviderDNSZoneResponse);
173
+ /**
174
+ * Refresh a DNS zone. Refresh an SOA DNS zone to reload the records in the DNS zone and update the SOA serial.
175
+ You can recreate the given DNS zone and its sub DNS zone if needed.
176
+ *
177
+ * @param request - The request {@link RefreshDNSZoneRequest}
178
+ * @returns A Promise of RefreshDNSZoneResponse
179
+ */
180
+ refreshDNSZone = (request) => this.client.fetch({
181
+ body: JSON.stringify(marshalRefreshDNSZoneRequest(request, this.client.settings)),
182
+ headers: jsonContentHeaders,
183
+ method: "POST",
184
+ path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/refresh`
185
+ }, unmarshalRefreshDNSZoneResponse);
186
+ pageOfListDNSZoneVersions = (request) => this.client.fetch({
187
+ method: "GET",
188
+ path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/versions`,
189
+ urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
190
+ }, unmarshalListDNSZoneVersionsResponse);
191
+ /**
192
+ * List versions of a DNS zone. Retrieve a list of a DNS zone's versions.<br/>
193
+ The maximum version count is 100. If the count reaches this limit, the oldest version will be deleted after each new modification.
194
+ *
195
+ * @param request - The request {@link ListDNSZoneVersionsRequest}
196
+ * @returns A Promise of ListDNSZoneVersionsResponse
197
+ */
198
+ listDNSZoneVersions = (request) => enrichForPagination("versions", this.pageOfListDNSZoneVersions, request);
199
+ pageOfListDNSZoneVersionRecords = (request) => this.client.fetch({
200
+ method: "GET",
201
+ path: `/domain/v2beta1/dns-zones/version/${validatePathParam("dnsZoneVersionId", request.dnsZoneVersionId)}`,
202
+ urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
203
+ }, unmarshalListDNSZoneVersionRecordsResponse);
204
+ /**
205
+ * List records from a given version of a specific DNS zone. Retrieve a list of records from a specific DNS zone version.
206
+ *
207
+ * @param request - The request {@link ListDNSZoneVersionRecordsRequest}
208
+ * @returns A Promise of ListDNSZoneVersionRecordsResponse
209
+ */
210
+ listDNSZoneVersionRecords = (request) => enrichForPagination("records", this.pageOfListDNSZoneVersionRecords, request);
211
+ /**
212
+ * Access differences from a specific DNS zone version. Access a previous DNS zone version to see the differences from another specific version.
213
+ *
214
+ * @param request - The request {@link GetDNSZoneVersionDiffRequest}
215
+ * @returns A Promise of GetDNSZoneVersionDiffResponse
216
+ */
217
+ getDNSZoneVersionDiff = (request) => this.client.fetch({
218
+ method: "GET",
219
+ path: `/domain/v2beta1/dns-zones/version/${validatePathParam("dnsZoneVersionId", request.dnsZoneVersionId)}/diff`
220
+ }, unmarshalGetDNSZoneVersionDiffResponse);
221
+ /**
222
+ * Restore a DNS zone version. Restore and activate a version of a specific DNS zone.
223
+ *
224
+ * @param request - The request {@link RestoreDNSZoneVersionRequest}
225
+ * @returns A Promise of RestoreDNSZoneVersionResponse
226
+ */
227
+ restoreDNSZoneVersion = (request) => this.client.fetch({
228
+ body: "{}",
229
+ headers: jsonContentHeaders,
230
+ method: "POST",
231
+ path: `/domain/v2beta1/dns-zones/version/${validatePathParam("dnsZoneVersionId", request.dnsZoneVersionId)}/restore`
232
+ }, unmarshalRestoreDNSZoneVersionResponse);
233
+ /**
234
+ * Get a DNS zone's TLS certificate. Get the DNS zone's TLS certificate. If you do not have a certificate, the output returns `no certificate found`.
235
+ *
236
+ * @param request - The request {@link GetSSLCertificateRequest}
237
+ * @returns A Promise of SSLCertificate
238
+ */
239
+ getSSLCertificate = (request) => this.client.fetch({
240
+ method: "GET",
241
+ path: `/domain/v2beta1/ssl-certificates/${validatePathParam("dnsZone", request.dnsZone)}`
242
+ }, unmarshalSSLCertificate);
243
+ /**
244
+ * Waits for {@link SSLCertificate} to be in a final state.
245
+ *
246
+ * @param request - The request {@link GetSSLCertificateRequest}
247
+ * @param options - The waiting options
248
+ * @returns A Promise of SSLCertificate
249
+ */
250
+ waitForSSLCertificate = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!SSL_CERTIFICATE_TRANSIENT_STATUSES.includes(res.status))), this.getSSLCertificate, request, options);
251
+ /**
252
+ * Create or get the DNS zone's TLS certificate. Create a new TLS certificate or retrieve information about an existing TLS certificate.
253
+ *
254
+ * @param request - The request {@link CreateSSLCertificateRequest}
255
+ * @returns A Promise of SSLCertificate
256
+ */
257
+ createSSLCertificate = (request) => this.client.fetch({
258
+ body: JSON.stringify(marshalCreateSSLCertificateRequest(request, this.client.settings)),
259
+ headers: jsonContentHeaders,
260
+ method: "POST",
261
+ path: `/domain/v2beta1/ssl-certificates`
262
+ }, unmarshalSSLCertificate);
263
+ pageOfListSSLCertificates = (request) => this.client.fetch({
264
+ method: "GET",
265
+ path: `/domain/v2beta1/ssl-certificates`,
266
+ urlParams: urlParams(["dns_zone", request.dnsZone], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
267
+ }, unmarshalListSSLCertificatesResponse);
268
+ /**
269
+ * List a user's TLS certificates. List all the TLS certificates a user has created, specified by the user's Project ID and the DNS zone.
270
+ *
271
+ * @param request - The request {@link ListSSLCertificatesRequest}
272
+ * @returns A Promise of ListSSLCertificatesResponse
273
+ */
274
+ listSSLCertificates = (request) => enrichForPagination("certificates", this.pageOfListSSLCertificates, request);
275
+ /**
276
+ * Delete a TLS certificate. Delete an existing TLS certificate specified by its DNS zone. Deleting a TLS certificate is permanent and cannot be undone.
277
+ *
278
+ * @param request - The request {@link DeleteSSLCertificateRequest}
279
+ * @returns A Promise of DeleteSSLCertificateResponse
280
+ */
281
+ deleteSSLCertificate = (request) => this.client.fetch({
282
+ method: "DELETE",
283
+ path: `/domain/v2beta1/ssl-certificates/${validatePathParam("dnsZone", request.dnsZone)}`
284
+ }, unmarshalDeleteSSLCertificateResponse);
285
+ /**
286
+ * Get the DNS zone's TSIG key. Retrieve information about the TSIG key of a given DNS zone to allow AXFR requests.
287
+ *
288
+ * @param request - The request {@link GetDNSZoneTsigKeyRequest}
289
+ * @returns A Promise of GetDNSZoneTsigKeyResponse
290
+ */
291
+ getDNSZoneTsigKey = (request) => this.client.fetch({
292
+ method: "GET",
293
+ path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/tsig-key`
294
+ }, unmarshalGetDNSZoneTsigKeyResponse);
295
+ /**
296
+ * Delete the DNS zone's TSIG key. Delete an existing TSIG key specified by its DNS zone. Deleting a TSIG key is permanent and cannot be undone.
297
+ *
298
+ * @param request - The request {@link DeleteDNSZoneTsigKeyRequest}
299
+ */
300
+ deleteDNSZoneTsigKey = (request) => this.client.fetch({
301
+ method: "DELETE",
302
+ path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/tsig-key`
303
+ });
6
304
  };
7
- class API extends API$1 {
8
- pageOfListDNSZones = (request) => this.client.fetch(
9
- {
10
- method: "GET",
11
- path: `/domain/v2beta1/dns-zones`,
12
- urlParams: urlParams(
13
- ["created_after", request.createdAfter],
14
- ["created_before", request.createdBefore],
15
- ["dns_zone", request.dnsZone],
16
- ["dns_zones", request.dnsZones],
17
- ["domain", request.domain],
18
- ["order_by", request.orderBy],
19
- ["organization_id", request.organizationId],
20
- ["page", request.page],
21
- [
22
- "page_size",
23
- request.pageSize ?? this.client.settings.defaultPageSize
24
- ],
25
- ["project_id", request.projectId],
26
- ["updated_after", request.updatedAfter],
27
- ["updated_before", request.updatedBefore]
28
- )
29
- },
30
- unmarshalListDNSZonesResponse
31
- );
32
- /**
33
- * List DNS zones. Retrieve the list of DNS zones you can manage and filter DNS zones associated with specific domain names.
34
- *
35
- * @param request - The request {@link ListDNSZonesRequest}
36
- * @returns A Promise of ListDNSZonesResponse
37
- */
38
- listDNSZones = (request) => enrichForPagination("dnsZones", this.pageOfListDNSZones, request);
39
- /**
40
- * Create a DNS zone. Create a new DNS zone specified by the domain name, the subdomain and the Project ID.
41
- *
42
- * @param request - The request {@link CreateDNSZoneRequest}
43
- * @returns A Promise of DNSZone
44
- */
45
- createDNSZone = (request) => this.client.fetch(
46
- {
47
- body: JSON.stringify(
48
- marshalCreateDNSZoneRequest(request, this.client.settings)
49
- ),
50
- headers: jsonContentHeaders,
51
- method: "POST",
52
- path: `/domain/v2beta1/dns-zones`
53
- },
54
- unmarshalDNSZone
55
- );
56
- /**
57
- * Update a DNS zone. Update the name and/or the Organizations for a DNS zone.
58
- *
59
- * @param request - The request {@link UpdateDNSZoneRequest}
60
- * @returns A Promise of DNSZone
61
- */
62
- updateDNSZone = (request) => this.client.fetch(
63
- {
64
- body: JSON.stringify(
65
- marshalUpdateDNSZoneRequest(request, this.client.settings)
66
- ),
67
- headers: jsonContentHeaders,
68
- method: "PATCH",
69
- path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}`
70
- },
71
- unmarshalDNSZone
72
- );
73
- /**
74
- * Clone a DNS zone. Clone an existing DNS zone with all its records into a new DNS zone.
75
- *
76
- * @param request - The request {@link CloneDNSZoneRequest}
77
- * @returns A Promise of DNSZone
78
- */
79
- cloneDNSZone = (request) => this.client.fetch(
80
- {
81
- body: JSON.stringify(
82
- marshalCloneDNSZoneRequest(request, this.client.settings)
83
- ),
84
- headers: jsonContentHeaders,
85
- method: "POST",
86
- path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/clone`
87
- },
88
- unmarshalDNSZone
89
- );
90
- /**
91
- * Delete a DNS zone. Delete a DNS zone and all its records.
92
- *
93
- * @param request - The request {@link DeleteDNSZoneRequest}
94
- * @returns A Promise of DeleteDNSZoneResponse
95
- */
96
- deleteDNSZone = (request) => this.client.fetch(
97
- {
98
- method: "DELETE",
99
- path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}`,
100
- urlParams: urlParams([
101
- "project_id",
102
- request.projectId ?? this.client.settings.defaultProjectId
103
- ])
104
- },
105
- unmarshalDeleteDNSZoneResponse
106
- );
107
- pageOfListDNSZoneRecords = (request) => this.client.fetch(
108
- {
109
- method: "GET",
110
- path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/records`,
111
- urlParams: urlParams(
112
- ["id", request.id],
113
- ["name", request.name],
114
- ["order_by", request.orderBy],
115
- ["page", request.page],
116
- [
117
- "page_size",
118
- request.pageSize ?? this.client.settings.defaultPageSize
119
- ],
120
- ["project_id", request.projectId],
121
- ["type", request.type]
122
- )
123
- },
124
- unmarshalListDNSZoneRecordsResponse
125
- );
126
- /**
127
- * List records within a DNS zone. Retrieve a list of DNS records within a DNS zone that has default name servers.
128
- You can filter records by type and name.
129
- *
130
- * @param request - The request {@link ListDNSZoneRecordsRequest}
131
- * @returns A Promise of ListDNSZoneRecordsResponse
132
- */
133
- listDNSZoneRecords = (request) => enrichForPagination("records", this.pageOfListDNSZoneRecords, request);
134
- /**
135
- * Update records within a DNS zone. Update records within a DNS zone that has default name servers and perform several actions on your records.
136
-
137
- Actions include:
138
- - add: allows you to add a new record or add a new IP to an existing A record, for example
139
- - set: allows you to edit a record or edit an IP from an existing A record, for example
140
- - delete: allows you to delete a record or delete an IP from an existing A record, for example
141
- - clear: allows you to delete all records from a DNS zone
142
-
143
- All edits will be versioned.
144
- *
145
- * @param request - The request {@link UpdateDNSZoneRecordsRequest}
146
- * @returns A Promise of UpdateDNSZoneRecordsResponse
147
- */
148
- updateDNSZoneRecords = (request) => this.client.fetch(
149
- {
150
- body: JSON.stringify(
151
- marshalUpdateDNSZoneRecordsRequest(request, this.client.settings)
152
- ),
153
- headers: jsonContentHeaders,
154
- method: "PATCH",
155
- path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/records`
156
- },
157
- unmarshalUpdateDNSZoneRecordsResponse
158
- );
159
- /**
160
- * List name servers within a DNS zone. Retrieve a list of name servers within a DNS zone and their optional glue records.
161
- *
162
- * @param request - The request {@link ListDNSZoneNameserversRequest}
163
- * @returns A Promise of ListDNSZoneNameserversResponse
164
- */
165
- listDNSZoneNameservers = (request) => this.client.fetch(
166
- {
167
- method: "GET",
168
- path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/nameservers`,
169
- urlParams: urlParams(["project_id", request.projectId])
170
- },
171
- unmarshalListDNSZoneNameserversResponse
172
- );
173
- /**
174
- * Update name servers within a DNS zone. Update name servers within a DNS zone and set optional glue records.
175
- *
176
- * @param request - The request {@link UpdateDNSZoneNameserversRequest}
177
- * @returns A Promise of UpdateDNSZoneNameserversResponse
178
- */
179
- updateDNSZoneNameservers = (request) => this.client.fetch(
180
- {
181
- body: JSON.stringify(
182
- marshalUpdateDNSZoneNameserversRequest(request, this.client.settings)
183
- ),
184
- headers: jsonContentHeaders,
185
- method: "PUT",
186
- path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/nameservers`
187
- },
188
- unmarshalUpdateDNSZoneNameserversResponse
189
- );
190
- /**
191
- * Clear records within a DNS zone. Delete all records within a DNS zone that has default name servers.<br/>
192
- All edits will be versioned.
193
- *
194
- * @param request - The request {@link ClearDNSZoneRecordsRequest}
195
- * @returns A Promise of ClearDNSZoneRecordsResponse
196
- */
197
- clearDNSZoneRecords = (request) => this.client.fetch(
198
- {
199
- method: "DELETE",
200
- path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/records`
201
- },
202
- unmarshalClearDNSZoneRecordsResponse
203
- );
204
- /**
205
- * Export a raw DNS zone. Export a DNS zone with default name servers, in a specific format.
206
- *
207
- * @param request - The request {@link ExportRawDNSZoneRequest}
208
- * @returns A Promise of Blob
209
- */
210
- exportRawDNSZone = (request) => this.client.fetch({
211
- method: "GET",
212
- path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/raw`,
213
- urlParams: urlParams(["dl", 1], ["format", request.format]),
214
- responseType: "blob"
215
- });
216
- /**
217
- * Import a raw DNS zone. Import and replace the format of records from a given provider, with default name servers.
218
- *
219
- * @param request - The request {@link ImportRawDNSZoneRequest}
220
- * @returns A Promise of ImportRawDNSZoneResponse
221
- */
222
- importRawDNSZone = (request) => this.client.fetch(
223
- {
224
- body: JSON.stringify(
225
- marshalImportRawDNSZoneRequest(request, this.client.settings)
226
- ),
227
- headers: jsonContentHeaders,
228
- method: "POST",
229
- path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/raw`
230
- },
231
- unmarshalImportRawDNSZoneResponse
232
- );
233
- /**
234
- * Import a DNS zone from another provider. Import and replace the format of records from a given provider, with default name servers.
235
- *
236
- * @param request - The request {@link ImportProviderDNSZoneRequest}
237
- * @returns A Promise of ImportProviderDNSZoneResponse
238
- */
239
- importProviderDNSZone = (request) => this.client.fetch(
240
- {
241
- body: JSON.stringify(
242
- marshalImportProviderDNSZoneRequest(request, this.client.settings)
243
- ),
244
- headers: jsonContentHeaders,
245
- method: "POST",
246
- path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/import-provider`
247
- },
248
- unmarshalImportProviderDNSZoneResponse
249
- );
250
- /**
251
- * Refresh a DNS zone. Refresh an SOA DNS zone to reload the records in the DNS zone and update the SOA serial.
252
- You can recreate the given DNS zone and its sub DNS zone if needed.
253
- *
254
- * @param request - The request {@link RefreshDNSZoneRequest}
255
- * @returns A Promise of RefreshDNSZoneResponse
256
- */
257
- refreshDNSZone = (request) => this.client.fetch(
258
- {
259
- body: JSON.stringify(
260
- marshalRefreshDNSZoneRequest(request, this.client.settings)
261
- ),
262
- headers: jsonContentHeaders,
263
- method: "POST",
264
- path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/refresh`
265
- },
266
- unmarshalRefreshDNSZoneResponse
267
- );
268
- pageOfListDNSZoneVersions = (request) => this.client.fetch(
269
- {
270
- method: "GET",
271
- path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/versions`,
272
- urlParams: urlParams(
273
- ["page", request.page],
274
- [
275
- "page_size",
276
- request.pageSize ?? this.client.settings.defaultPageSize
277
- ]
278
- )
279
- },
280
- unmarshalListDNSZoneVersionsResponse
281
- );
282
- /**
283
- * List versions of a DNS zone. Retrieve a list of a DNS zone's versions.<br/>
284
- The maximum version count is 100. If the count reaches this limit, the oldest version will be deleted after each new modification.
285
- *
286
- * @param request - The request {@link ListDNSZoneVersionsRequest}
287
- * @returns A Promise of ListDNSZoneVersionsResponse
288
- */
289
- listDNSZoneVersions = (request) => enrichForPagination("versions", this.pageOfListDNSZoneVersions, request);
290
- pageOfListDNSZoneVersionRecords = (request) => this.client.fetch(
291
- {
292
- method: "GET",
293
- path: `/domain/v2beta1/dns-zones/version/${validatePathParam("dnsZoneVersionId", request.dnsZoneVersionId)}`,
294
- urlParams: urlParams(
295
- ["page", request.page],
296
- [
297
- "page_size",
298
- request.pageSize ?? this.client.settings.defaultPageSize
299
- ]
300
- )
301
- },
302
- unmarshalListDNSZoneVersionRecordsResponse
303
- );
304
- /**
305
- * List records from a given version of a specific DNS zone. Retrieve a list of records from a specific DNS zone version.
306
- *
307
- * @param request - The request {@link ListDNSZoneVersionRecordsRequest}
308
- * @returns A Promise of ListDNSZoneVersionRecordsResponse
309
- */
310
- listDNSZoneVersionRecords = (request) => enrichForPagination(
311
- "records",
312
- this.pageOfListDNSZoneVersionRecords,
313
- request
314
- );
315
- /**
316
- * Access differences from a specific DNS zone version. Access a previous DNS zone version to see the differences from another specific version.
317
- *
318
- * @param request - The request {@link GetDNSZoneVersionDiffRequest}
319
- * @returns A Promise of GetDNSZoneVersionDiffResponse
320
- */
321
- getDNSZoneVersionDiff = (request) => this.client.fetch(
322
- {
323
- method: "GET",
324
- path: `/domain/v2beta1/dns-zones/version/${validatePathParam("dnsZoneVersionId", request.dnsZoneVersionId)}/diff`
325
- },
326
- unmarshalGetDNSZoneVersionDiffResponse
327
- );
328
- /**
329
- * Restore a DNS zone version. Restore and activate a version of a specific DNS zone.
330
- *
331
- * @param request - The request {@link RestoreDNSZoneVersionRequest}
332
- * @returns A Promise of RestoreDNSZoneVersionResponse
333
- */
334
- restoreDNSZoneVersion = (request) => this.client.fetch(
335
- {
336
- body: "{}",
337
- headers: jsonContentHeaders,
338
- method: "POST",
339
- path: `/domain/v2beta1/dns-zones/version/${validatePathParam("dnsZoneVersionId", request.dnsZoneVersionId)}/restore`
340
- },
341
- unmarshalRestoreDNSZoneVersionResponse
342
- );
343
- /**
344
- * Get a DNS zone's TLS certificate. Get the DNS zone's TLS certificate. If you do not have a certificate, the output returns `no certificate found`.
345
- *
346
- * @param request - The request {@link GetSSLCertificateRequest}
347
- * @returns A Promise of SSLCertificate
348
- */
349
- getSSLCertificate = (request) => this.client.fetch(
350
- {
351
- method: "GET",
352
- path: `/domain/v2beta1/ssl-certificates/${validatePathParam("dnsZone", request.dnsZone)}`
353
- },
354
- unmarshalSSLCertificate
355
- );
356
- /**
357
- * Waits for {@link SSLCertificate} to be in a final state.
358
- *
359
- * @param request - The request {@link GetSSLCertificateRequest}
360
- * @param options - The waiting options
361
- * @returns A Promise of SSLCertificate
362
- */
363
- waitForSSLCertificate = (request, options) => waitForResource(
364
- options?.stop ?? ((res) => Promise.resolve(
365
- !SSL_CERTIFICATE_TRANSIENT_STATUSES.includes(res.status)
366
- )),
367
- this.getSSLCertificate,
368
- request,
369
- options
370
- );
371
- /**
372
- * Create or get the DNS zone's TLS certificate. Create a new TLS certificate or retrieve information about an existing TLS certificate.
373
- *
374
- * @param request - The request {@link CreateSSLCertificateRequest}
375
- * @returns A Promise of SSLCertificate
376
- */
377
- createSSLCertificate = (request) => this.client.fetch(
378
- {
379
- body: JSON.stringify(
380
- marshalCreateSSLCertificateRequest(request, this.client.settings)
381
- ),
382
- headers: jsonContentHeaders,
383
- method: "POST",
384
- path: `/domain/v2beta1/ssl-certificates`
385
- },
386
- unmarshalSSLCertificate
387
- );
388
- pageOfListSSLCertificates = (request) => this.client.fetch(
389
- {
390
- method: "GET",
391
- path: `/domain/v2beta1/ssl-certificates`,
392
- urlParams: urlParams(
393
- ["dns_zone", request.dnsZone],
394
- ["page", request.page],
395
- [
396
- "page_size",
397
- request.pageSize ?? this.client.settings.defaultPageSize
398
- ],
399
- ["project_id", request.projectId]
400
- )
401
- },
402
- unmarshalListSSLCertificatesResponse
403
- );
404
- /**
405
- * List a user's TLS certificates. List all the TLS certificates a user has created, specified by the user's Project ID and the DNS zone.
406
- *
407
- * @param request - The request {@link ListSSLCertificatesRequest}
408
- * @returns A Promise of ListSSLCertificatesResponse
409
- */
410
- listSSLCertificates = (request) => enrichForPagination("certificates", this.pageOfListSSLCertificates, request);
411
- /**
412
- * Delete a TLS certificate. Delete an existing TLS certificate specified by its DNS zone. Deleting a TLS certificate is permanent and cannot be undone.
413
- *
414
- * @param request - The request {@link DeleteSSLCertificateRequest}
415
- * @returns A Promise of DeleteSSLCertificateResponse
416
- */
417
- deleteSSLCertificate = (request) => this.client.fetch(
418
- {
419
- method: "DELETE",
420
- path: `/domain/v2beta1/ssl-certificates/${validatePathParam("dnsZone", request.dnsZone)}`
421
- },
422
- unmarshalDeleteSSLCertificateResponse
423
- );
424
- /**
425
- * Get the DNS zone's TSIG key. Retrieve information about the TSIG key of a given DNS zone to allow AXFR requests.
426
- *
427
- * @param request - The request {@link GetDNSZoneTsigKeyRequest}
428
- * @returns A Promise of GetDNSZoneTsigKeyResponse
429
- */
430
- getDNSZoneTsigKey = (request) => this.client.fetch(
431
- {
432
- method: "GET",
433
- path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/tsig-key`
434
- },
435
- unmarshalGetDNSZoneTsigKeyResponse
436
- );
437
- /**
438
- * Delete the DNS zone's TSIG key. Delete an existing TSIG key specified by its DNS zone. Deleting a TSIG key is permanent and cannot be undone.
439
- *
440
- * @param request - The request {@link DeleteDNSZoneTsigKeyRequest}
441
- */
442
- deleteDNSZoneTsigKey = (request) => this.client.fetch({
443
- method: "DELETE",
444
- path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/tsig-key`
445
- });
446
- }
447
- class RegistrarAPI extends API$1 {
448
- pageOfListTasks = (request = {}) => this.client.fetch(
449
- {
450
- method: "GET",
451
- path: `/domain/v2beta1/tasks`,
452
- urlParams: urlParams(
453
- ["domain", request.domain],
454
- ["order_by", request.orderBy],
455
- ["organization_id", request.organizationId],
456
- ["page", request.page],
457
- [
458
- "page_size",
459
- request.pageSize ?? this.client.settings.defaultPageSize
460
- ],
461
- ["project_id", request.projectId],
462
- ["statuses", request.statuses],
463
- ["types", request.types]
464
- )
465
- },
466
- unmarshalListTasksResponse
467
- );
468
- /**
469
- * List tasks. List all operations performed on the account.
470
- You can filter the list of tasks by domain name.
471
- *
472
- * @param request - The request {@link RegistrarApiListTasksRequest}
473
- * @returns A Promise of ListTasksResponse
474
- */
475
- listTasks = (request = {}) => enrichForPagination("tasks", this.pageOfListTasks, request);
476
- pageOfListInboundTransfers = (request) => this.client.fetch(
477
- {
478
- method: "GET",
479
- path: `/domain/v2beta1/inbound-transfers`,
480
- urlParams: urlParams(
481
- ["domain", request.domain],
482
- [
483
- "organization_id",
484
- request.organizationId ?? this.client.settings.defaultOrganizationId
485
- ],
486
- ["page", request.page],
487
- [
488
- "page_size",
489
- request.pageSize ?? this.client.settings.defaultPageSize
490
- ],
491
- [
492
- "project_id",
493
- request.projectId ?? this.client.settings.defaultProjectId
494
- ]
495
- )
496
- },
497
- unmarshalListInboundTransfersResponse
498
- );
499
- /**
500
- * List inbound domain transfers. List all inbound transfer operations on the account.
501
- You can filter the list of inbound transfers by domain name.
502
- *
503
- * @param request - The request {@link RegistrarApiListInboundTransfersRequest}
504
- * @returns A Promise of ListInboundTransfersResponse
505
- */
506
- listInboundTransfers = (request) => enrichForPagination(
507
- "inboundTransfers",
508
- this.pageOfListInboundTransfers,
509
- request
510
- );
511
- /**
512
- * Retry the inbound transfer of a domain. Request a retry for the transfer of a domain from another registrar to Scaleway Domains and DNS.
513
- *
514
- * @param request - The request {@link RegistrarApiRetryInboundTransferRequest}
515
- * @returns A Promise of RetryInboundTransferResponse
516
- */
517
- retryInboundTransfer = (request) => this.client.fetch(
518
- {
519
- body: JSON.stringify(
520
- marshalRegistrarApiRetryInboundTransferRequest(
521
- request,
522
- this.client.settings
523
- )
524
- ),
525
- headers: jsonContentHeaders,
526
- method: "POST",
527
- path: `/domain/v2beta1/retry-inbound-transfer`
528
- },
529
- unmarshalRetryInboundTransferResponse
530
- );
531
- /**
532
- * Purchase domains. Request the registration of domain names.
533
- You can provide a domain's already existing contact or a new contact.
534
- *
535
- * @param request - The request {@link RegistrarApiBuyDomainsRequest}
536
- * @returns A Promise of OrderResponse
537
- */
538
- buyDomains = (request) => this.client.fetch(
539
- {
540
- body: JSON.stringify(
541
- marshalRegistrarApiBuyDomainsRequest(request, this.client.settings)
542
- ),
543
- headers: jsonContentHeaders,
544
- method: "POST",
545
- path: `/domain/v2beta1/buy-domains`
546
- },
547
- unmarshalOrderResponse
548
- );
549
- /**
550
- * Renew domains. Request the renewal of one or more domain names.
551
- *
552
- * @param request - The request {@link RegistrarApiRenewDomainsRequest}
553
- * @returns A Promise of OrderResponse
554
- */
555
- renewDomains = (request) => this.client.fetch(
556
- {
557
- body: JSON.stringify(
558
- marshalRegistrarApiRenewDomainsRequest(request, this.client.settings)
559
- ),
560
- headers: jsonContentHeaders,
561
- method: "POST",
562
- path: `/domain/v2beta1/renew-domains`
563
- },
564
- unmarshalOrderResponse
565
- );
566
- /**
567
- * Transfer a domain. Request the transfer of a domain from another registrar to Scaleway Domains and DNS.
568
- *
569
- * @param request - The request {@link RegistrarApiTransferInDomainRequest}
570
- * @returns A Promise of OrderResponse
571
- */
572
- transferInDomain = (request) => this.client.fetch(
573
- {
574
- body: JSON.stringify(
575
- marshalRegistrarApiTransferInDomainRequest(
576
- request,
577
- this.client.settings
578
- )
579
- ),
580
- headers: jsonContentHeaders,
581
- method: "POST",
582
- path: `/domain/v2beta1/domains/transfer-domains`
583
- },
584
- unmarshalOrderResponse
585
- );
586
- /**
587
- * Trade a domain's contact. Request to change a domain's contact owner.<br/>
588
- If you specify the `organization_id` of the domain's new owner, the contact will change from the current owner's Scaleway account to the new owner's Scaleway account.<br/>
589
- If the new owner's current contact information is not available, the first ever contact they have created for previous domains is taken into account to operate the change.<br/>
590
- If the new owner has never created a contact to register domains before, an error message displays.
591
- *
592
- * @param request - The request {@link RegistrarApiTradeDomainRequest}
593
- * @returns A Promise of OrderResponse
594
- */
595
- tradeDomain = (request) => this.client.fetch(
596
- {
597
- body: JSON.stringify(
598
- marshalRegistrarApiTradeDomainRequest(request, this.client.settings)
599
- ),
600
- headers: jsonContentHeaders,
601
- method: "POST",
602
- path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/trade`
603
- },
604
- unmarshalOrderResponse
605
- );
606
- /**
607
- * Register an external domain. Request the registration of an external domain name.
608
- *
609
- * @param request - The request {@link RegistrarApiRegisterExternalDomainRequest}
610
- * @returns A Promise of RegisterExternalDomainResponse
611
- */
612
- registerExternalDomain = (request) => this.client.fetch(
613
- {
614
- body: JSON.stringify(
615
- marshalRegistrarApiRegisterExternalDomainRequest(
616
- request,
617
- this.client.settings
618
- )
619
- ),
620
- headers: jsonContentHeaders,
621
- method: "POST",
622
- path: `/domain/v2beta1/external-domains`
623
- },
624
- unmarshalRegisterExternalDomainResponse
625
- );
626
- /**
627
- * Delete an external domain. Delete an external domain name.
628
- *
629
- * @param request - The request {@link RegistrarApiDeleteExternalDomainRequest}
630
- * @returns A Promise of DeleteExternalDomainResponse
631
- */
632
- deleteExternalDomain = (request) => this.client.fetch(
633
- {
634
- method: "DELETE",
635
- path: `/domain/v2beta1/external-domains/${validatePathParam("domain", request.domain)}`
636
- },
637
- unmarshalDeleteExternalDomainResponse
638
- );
639
- /**
640
- * Check if contacts are compatible with a domain or a TLD. Check whether contacts are compatible with a domain or a TLD.
641
- If contacts are not compatible with either the domain or the TLD, the information that needs to be corrected is returned.
642
- *
643
- * @param request - The request {@link RegistrarApiCheckContactsCompatibilityRequest}
644
- * @returns A Promise of CheckContactsCompatibilityResponse
645
- */
646
- checkContactsCompatibility = (request = {}) => this.client.fetch(
647
- {
648
- body: JSON.stringify(
649
- marshalRegistrarApiCheckContactsCompatibilityRequest(
650
- request,
651
- this.client.settings
652
- )
653
- ),
654
- headers: jsonContentHeaders,
655
- method: "POST",
656
- path: `/domain/v2beta1/check-contacts-compatibility`
657
- },
658
- unmarshalCheckContactsCompatibilityResponse
659
- );
660
- pageOfListContacts = (request = {}) => this.client.fetch(
661
- {
662
- method: "GET",
663
- path: `/domain/v2beta1/contacts`,
664
- urlParams: urlParams(
665
- ["domain", request.domain],
666
- ["email_status", request.emailStatus],
667
- ["organization_id", request.organizationId],
668
- ["page", request.page],
669
- [
670
- "page_size",
671
- request.pageSize ?? this.client.settings.defaultPageSize
672
- ],
673
- ["project_id", request.projectId],
674
- ["role", request.role]
675
- )
676
- },
677
- unmarshalListContactsResponse
678
- );
679
- /**
680
- * List contacts. Retrieve the list of contacts and their associated domains and roles.
681
- You can filter the list by domain name.
682
- *
683
- * @param request - The request {@link RegistrarApiListContactsRequest}
684
- * @returns A Promise of ListContactsResponse
685
- */
686
- listContacts = (request = {}) => enrichForPagination("contacts", this.pageOfListContacts, request);
687
- /**
688
- * Get a contact. Retrieve a contact's details from the registrar using the given contact's ID.
689
- *
690
- * @param request - The request {@link RegistrarApiGetContactRequest}
691
- * @returns A Promise of Contact
692
- */
693
- getContact = (request) => this.client.fetch(
694
- {
695
- method: "GET",
696
- path: `/domain/v2beta1/contacts/${validatePathParam("contactId", request.contactId)}`
697
- },
698
- unmarshalContact
699
- );
700
- /**
701
- * Update contact. Edit the contact's information.
702
- *
703
- * @param request - The request {@link RegistrarApiUpdateContactRequest}
704
- * @returns A Promise of Contact
705
- */
706
- updateContact = (request) => this.client.fetch(
707
- {
708
- body: JSON.stringify(
709
- marshalRegistrarApiUpdateContactRequest(
710
- request,
711
- this.client.settings
712
- )
713
- ),
714
- headers: jsonContentHeaders,
715
- method: "PATCH",
716
- path: `/domain/v2beta1/contacts/${validatePathParam("contactId", request.contactId)}`
717
- },
718
- unmarshalContact
719
- );
720
- pageOfListDomains = (request = {}) => this.client.fetch(
721
- {
722
- method: "GET",
723
- path: `/domain/v2beta1/domains`,
724
- urlParams: urlParams(
725
- ["domain", request.domain],
726
- ["is_external", request.isExternal],
727
- ["order_by", request.orderBy],
728
- ["organization_id", request.organizationId],
729
- ["page", request.page],
730
- [
731
- "page_size",
732
- request.pageSize ?? this.client.settings.defaultPageSize
733
- ],
734
- ["project_id", request.projectId],
735
- ["registrar", request.registrar],
736
- ["status", request.status]
737
- )
738
- },
739
- unmarshalListDomainsResponse
740
- );
741
- /**
742
- * List domains. Retrieve the list of domains you own.
743
- *
744
- * @param request - The request {@link RegistrarApiListDomainsRequest}
745
- * @returns A Promise of ListDomainsResponse
746
- */
747
- listDomains = (request = {}) => enrichForPagination("domains", this.pageOfListDomains, request);
748
- pageOfListRenewableDomains = (request = {}) => this.client.fetch(
749
- {
750
- method: "GET",
751
- path: `/domain/v2beta1/renewable-domains`,
752
- urlParams: urlParams(
753
- ["order_by", request.orderBy],
754
- ["organization_id", request.organizationId],
755
- ["page", request.page],
756
- [
757
- "page_size",
758
- request.pageSize ?? this.client.settings.defaultPageSize
759
- ],
760
- ["project_id", request.projectId]
761
- )
762
- },
763
- unmarshalListRenewableDomainsResponse
764
- );
765
- /**
766
- * List domains that can be renewed. Retrieve the list of domains you own that can be renewed. You can also see the maximum renewal duration in years for your domains that are renewable.
767
- *
768
- * @param request - The request {@link RegistrarApiListRenewableDomainsRequest}
769
- * @returns A Promise of ListRenewableDomainsResponse
770
- */
771
- listRenewableDomains = (request = {}) => enrichForPagination("domains", this.pageOfListRenewableDomains, request);
772
- /**
773
- * Get domain. Retrieve a specific domain and display the domain's information.
774
- *
775
- * @param request - The request {@link RegistrarApiGetDomainRequest}
776
- * @returns A Promise of Domain
777
- */
778
- getDomain = (request) => this.client.fetch(
779
- {
780
- method: "GET",
781
- path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}`
782
- },
783
- unmarshalDomain
784
- );
785
- /**
786
- * Waits for {@link Domain} to be in a final state.
787
- *
788
- * @param request - The request {@link RegistrarApiGetDomainRequest}
789
- * @param options - The waiting options
790
- * @returns A Promise of Domain
791
- */
792
- waitForDomain = (request, options) => waitForResource(
793
- options?.stop ?? ((res) => Promise.resolve(
794
- !DOMAIN_TRANSIENT_STATUSES.includes(res.status)
795
- )),
796
- this.getDomain,
797
- request,
798
- options
799
- );
800
- /**
801
- * Update a domain's contacts. Update contacts for a specific domain or create a new contact.<br/>
802
- If you add the same contact for multiple roles (owner, administrative, technical), only one ID will be created and used for all of the roles.
803
- *
804
- * @param request - The request {@link RegistrarApiUpdateDomainRequest}
805
- * @returns A Promise of Domain
806
- */
807
- updateDomain = (request) => this.client.fetch(
808
- {
809
- body: JSON.stringify(
810
- marshalRegistrarApiUpdateDomainRequest(request, this.client.settings)
811
- ),
812
- headers: jsonContentHeaders,
813
- method: "PATCH",
814
- path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}`
815
- },
816
- unmarshalDomain
817
- );
818
- /**
819
- * Lock the transfer of a domain. Lock the transfer of a domain. This means that the domain cannot be transferred and the authorization code cannot be requested to your current registrar.
820
- *
821
- * @param request - The request {@link RegistrarApiLockDomainTransferRequest}
822
- * @returns A Promise of Domain
823
- */
824
- lockDomainTransfer = (request) => this.client.fetch(
825
- {
826
- body: "{}",
827
- headers: jsonContentHeaders,
828
- method: "POST",
829
- path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/lock-transfer`
830
- },
831
- unmarshalDomain
832
- );
833
- /**
834
- * Unlock the transfer of a domain. Unlock the transfer of a domain. This means that the domain can be transferred and the authorization code can be requested to your current registrar.
835
- *
836
- * @param request - The request {@link RegistrarApiUnlockDomainTransferRequest}
837
- * @returns A Promise of Domain
838
- */
839
- unlockDomainTransfer = (request) => this.client.fetch(
840
- {
841
- body: "{}",
842
- headers: jsonContentHeaders,
843
- method: "POST",
844
- path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/unlock-transfer`
845
- },
846
- unmarshalDomain
847
- );
848
- /**
849
- * Enable auto renew. Enable the `auto renew` feature for a domain. This means the domain will be automatically renewed before its expiry date.
850
- *
851
- * @param request - The request {@link RegistrarApiEnableDomainAutoRenewRequest}
852
- * @returns A Promise of Domain
853
- */
854
- enableDomainAutoRenew = (request) => this.client.fetch(
855
- {
856
- body: "{}",
857
- headers: jsonContentHeaders,
858
- method: "POST",
859
- path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/enable-auto-renew`
860
- },
861
- unmarshalDomain
862
- );
863
- /**
864
- * Disable auto renew. Disable the `auto renew` feature for a domain. This means the domain will not be renewed before its expiry date.
865
- *
866
- * @param request - The request {@link RegistrarApiDisableDomainAutoRenewRequest}
867
- * @returns A Promise of Domain
868
- */
869
- disableDomainAutoRenew = (request) => this.client.fetch(
870
- {
871
- body: "{}",
872
- headers: jsonContentHeaders,
873
- method: "POST",
874
- path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/disable-auto-renew`
875
- },
876
- unmarshalDomain
877
- );
878
- /**
879
- * Get a domain's authorization code. Retrieve the authorization code to transfer an unlocked domain. The output returns an error if the domain is locked.
880
- Some TLDs may have a different procedure to retrieve the authorization code. In that case, the information displays in the message field.
881
- *
882
- * @param request - The request {@link RegistrarApiGetDomainAuthCodeRequest}
883
- * @returns A Promise of GetDomainAuthCodeResponse
884
- */
885
- getDomainAuthCode = (request) => this.client.fetch(
886
- {
887
- method: "GET",
888
- path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/auth-code`
889
- },
890
- unmarshalGetDomainAuthCodeResponse
891
- );
892
- /**
893
- * Update domain DNSSEC. If your domain uses another registrar and has the default Scaleway NS, you have to **update the DS record at your registrar**.
894
- *
895
- * @param request - The request {@link RegistrarApiEnableDomainDNSSECRequest}
896
- * @returns A Promise of Domain
897
- */
898
- enableDomainDNSSEC = (request) => this.client.fetch(
899
- {
900
- body: JSON.stringify(
901
- marshalRegistrarApiEnableDomainDNSSECRequest(
902
- request,
903
- this.client.settings
904
- )
905
- ),
906
- headers: jsonContentHeaders,
907
- method: "POST",
908
- path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/enable-dnssec`
909
- },
910
- unmarshalDomain
911
- );
912
- /**
913
- * Disable a domain's DNSSEC. Disable DNSSEC for a domain.
914
- *
915
- * @param request - The request {@link RegistrarApiDisableDomainDNSSECRequest}
916
- * @returns A Promise of Domain
917
- */
918
- disableDomainDNSSEC = (request) => this.client.fetch(
919
- {
920
- body: "{}",
921
- headers: jsonContentHeaders,
922
- method: "POST",
923
- path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/disable-dnssec`
924
- },
925
- unmarshalDomain
926
- );
927
- /**
928
- * Search available domains. Search a domain or a maximum of 10 domains that are available.
929
-
930
- If the TLD list is empty or not set, the search returns the results from the most popular TLDs.
931
- *
932
- * @param request - The request {@link RegistrarApiSearchAvailableDomainsRequest}
933
- * @returns A Promise of SearchAvailableDomainsResponse
934
- */
935
- searchAvailableDomains = (request) => this.client.fetch(
936
- {
937
- method: "GET",
938
- path: `/domain/v2beta1/search-domains`,
939
- urlParams: urlParams(
940
- ["domains", request.domains],
941
- ["strict_search", request.strictSearch],
942
- ["tlds", request.tlds]
943
- )
944
- },
945
- unmarshalSearchAvailableDomainsResponse
946
- );
947
- pageOfListTlds = (request = {}) => this.client.fetch(
948
- {
949
- method: "GET",
950
- path: `/domain/v2beta1/tlds`,
951
- urlParams: urlParams(
952
- ["order_by", request.orderBy],
953
- ["page", request.page],
954
- [
955
- "page_size",
956
- request.pageSize ?? this.client.settings.defaultPageSize
957
- ],
958
- ["tlds", request.tlds]
959
- )
960
- },
961
- unmarshalListTldsResponse
962
- );
963
- /**
964
- * List TLD offers. Retrieve the list of TLDs and offers associated with them.
965
- *
966
- * @param request - The request {@link RegistrarApiListTldsRequest}
967
- * @returns A Promise of ListTldsResponse
968
- */
969
- listTlds = (request = {}) => enrichForPagination("tlds", this.pageOfListTlds, request);
970
- /**
971
- * Create a hostname for a domain. Create a hostname for a domain with glue IPs.
972
- *
973
- * @param request - The request {@link RegistrarApiCreateDomainHostRequest}
974
- * @returns A Promise of Host
975
- */
976
- createDomainHost = (request) => this.client.fetch(
977
- {
978
- body: JSON.stringify(
979
- marshalRegistrarApiCreateDomainHostRequest(
980
- request,
981
- this.client.settings
982
- )
983
- ),
984
- headers: jsonContentHeaders,
985
- method: "POST",
986
- path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/hosts`
987
- },
988
- unmarshalHost
989
- );
990
- pageOfListDomainHosts = (request) => this.client.fetch(
991
- {
992
- method: "GET",
993
- path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/hosts`,
994
- urlParams: urlParams(
995
- ["page", request.page],
996
- [
997
- "page_size",
998
- request.pageSize ?? this.client.settings.defaultPageSize
999
- ]
1000
- )
1001
- },
1002
- unmarshalListDomainHostsResponse
1003
- );
1004
- /**
1005
- * List a domain's hostnames. List a domain's hostnames using their glue IPs.
1006
- *
1007
- * @param request - The request {@link RegistrarApiListDomainHostsRequest}
1008
- * @returns A Promise of ListDomainHostsResponse
1009
- */
1010
- listDomainHosts = (request) => enrichForPagination("hosts", this.pageOfListDomainHosts, request);
1011
- /**
1012
- * Update a domain's hostname. Update a domain's hostname with glue IPs.
1013
- *
1014
- * @param request - The request {@link RegistrarApiUpdateDomainHostRequest}
1015
- * @returns A Promise of Host
1016
- */
1017
- updateDomainHost = (request) => this.client.fetch(
1018
- {
1019
- body: JSON.stringify(
1020
- marshalRegistrarApiUpdateDomainHostRequest(
1021
- request,
1022
- this.client.settings
1023
- )
1024
- ),
1025
- headers: jsonContentHeaders,
1026
- method: "PATCH",
1027
- path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/hosts/${validatePathParam("name", request.name)}`
1028
- },
1029
- unmarshalHost
1030
- );
1031
- /**
1032
- * Delete a domain's hostname.
1033
- *
1034
- * @param request - The request {@link RegistrarApiDeleteDomainHostRequest}
1035
- * @returns A Promise of Host
1036
- */
1037
- deleteDomainHost = (request) => this.client.fetch(
1038
- {
1039
- method: "DELETE",
1040
- path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/hosts/${validatePathParam("name", request.name)}`
1041
- },
1042
- unmarshalHost
1043
- );
1044
- }
1045
- class UnauthenticatedRegistrarAPI extends API$1 {
1046
- getServiceInfo = () => this.client.fetch(
1047
- {
1048
- method: "GET",
1049
- path: `/domain/v2beta1/search`
1050
- },
1051
- unmarshalServiceInfo
1052
- );
1053
- searchAvailableDomainsConsole = (request) => this.client.fetch(
1054
- {
1055
- method: "GET",
1056
- path: `/domain/v2beta1/search-domains-console`,
1057
- urlParams: urlParams(
1058
- ["domain", request.domain],
1059
- ["strict_search", request.strictSearch],
1060
- ["tlds", request.tlds]
1061
- )
1062
- },
1063
- unmarshalSearchAvailableDomainsConsoleResponse
1064
- );
1065
- }
1066
- export {
1067
- API,
1068
- RegistrarAPI,
1069
- UnauthenticatedRegistrarAPI
305
+ /**
306
+ * Domains and DNS - Registrar API.
307
+
308
+ Manage your domains and contacts.
309
+ */
310
+ var RegistrarAPI = class extends API {
311
+ pageOfListTasks = (request = {}) => this.client.fetch({
312
+ method: "GET",
313
+ path: `/domain/v2beta1/tasks`,
314
+ urlParams: urlParams(["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], ["types", request.types])
315
+ }, unmarshalListTasksResponse);
316
+ /**
317
+ * List tasks. List all operations performed on the account.
318
+ You can filter the list of tasks by domain name.
319
+ *
320
+ * @param request - The request {@link RegistrarApiListTasksRequest}
321
+ * @returns A Promise of ListTasksResponse
322
+ */
323
+ listTasks = (request = {}) => enrichForPagination("tasks", this.pageOfListTasks, request);
324
+ pageOfListInboundTransfers = (request) => this.client.fetch({
325
+ method: "GET",
326
+ path: `/domain/v2beta1/inbound-transfers`,
327
+ urlParams: urlParams(["domain", request.domain], ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId ?? this.client.settings.defaultProjectId])
328
+ }, unmarshalListInboundTransfersResponse);
329
+ /**
330
+ * List inbound domain transfers. List all inbound transfer operations on the account.
331
+ You can filter the list of inbound transfers by domain name.
332
+ *
333
+ * @param request - The request {@link RegistrarApiListInboundTransfersRequest}
334
+ * @returns A Promise of ListInboundTransfersResponse
335
+ */
336
+ listInboundTransfers = (request) => enrichForPagination("inboundTransfers", this.pageOfListInboundTransfers, request);
337
+ /**
338
+ * Retry the inbound transfer of a domain. Request a retry for the transfer of a domain from another registrar to Scaleway Domains and DNS.
339
+ *
340
+ * @param request - The request {@link RegistrarApiRetryInboundTransferRequest}
341
+ * @returns A Promise of RetryInboundTransferResponse
342
+ */
343
+ retryInboundTransfer = (request) => this.client.fetch({
344
+ body: JSON.stringify(marshalRegistrarApiRetryInboundTransferRequest(request, this.client.settings)),
345
+ headers: jsonContentHeaders,
346
+ method: "POST",
347
+ path: `/domain/v2beta1/retry-inbound-transfer`
348
+ }, unmarshalRetryInboundTransferResponse);
349
+ /**
350
+ * Purchase domains. Request the registration of domain names.
351
+ You can provide a domain's already existing contact or a new contact.
352
+ *
353
+ * @param request - The request {@link RegistrarApiBuyDomainsRequest}
354
+ * @returns A Promise of OrderResponse
355
+ */
356
+ buyDomains = (request) => this.client.fetch({
357
+ body: JSON.stringify(marshalRegistrarApiBuyDomainsRequest(request, this.client.settings)),
358
+ headers: jsonContentHeaders,
359
+ method: "POST",
360
+ path: `/domain/v2beta1/buy-domains`
361
+ }, unmarshalOrderResponse);
362
+ /**
363
+ * Renew domains. Request the renewal of one or more domain names.
364
+ *
365
+ * @param request - The request {@link RegistrarApiRenewDomainsRequest}
366
+ * @returns A Promise of OrderResponse
367
+ */
368
+ renewDomains = (request) => this.client.fetch({
369
+ body: JSON.stringify(marshalRegistrarApiRenewDomainsRequest(request, this.client.settings)),
370
+ headers: jsonContentHeaders,
371
+ method: "POST",
372
+ path: `/domain/v2beta1/renew-domains`
373
+ }, unmarshalOrderResponse);
374
+ /**
375
+ * Transfer a domain. Request the transfer of a domain from another registrar to Scaleway Domains and DNS.
376
+ *
377
+ * @param request - The request {@link RegistrarApiTransferInDomainRequest}
378
+ * @returns A Promise of OrderResponse
379
+ */
380
+ transferInDomain = (request) => this.client.fetch({
381
+ body: JSON.stringify(marshalRegistrarApiTransferInDomainRequest(request, this.client.settings)),
382
+ headers: jsonContentHeaders,
383
+ method: "POST",
384
+ path: `/domain/v2beta1/domains/transfer-domains`
385
+ }, unmarshalOrderResponse);
386
+ /**
387
+ * Trade a domain's contact. Request to change a domain's contact owner.<br/>
388
+ If you specify the `organization_id` of the domain's new owner, the contact will change from the current owner's Scaleway account to the new owner's Scaleway account.<br/>
389
+ If the new owner's current contact information is not available, the first ever contact they have created for previous domains is taken into account to operate the change.<br/>
390
+ If the new owner has never created a contact to register domains before, an error message displays.
391
+ *
392
+ * @param request - The request {@link RegistrarApiTradeDomainRequest}
393
+ * @returns A Promise of OrderResponse
394
+ */
395
+ tradeDomain = (request) => this.client.fetch({
396
+ body: JSON.stringify(marshalRegistrarApiTradeDomainRequest(request, this.client.settings)),
397
+ headers: jsonContentHeaders,
398
+ method: "POST",
399
+ path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/trade`
400
+ }, unmarshalOrderResponse);
401
+ /**
402
+ * Register an external domain. Request the registration of an external domain name.
403
+ *
404
+ * @param request - The request {@link RegistrarApiRegisterExternalDomainRequest}
405
+ * @returns A Promise of RegisterExternalDomainResponse
406
+ */
407
+ registerExternalDomain = (request) => this.client.fetch({
408
+ body: JSON.stringify(marshalRegistrarApiRegisterExternalDomainRequest(request, this.client.settings)),
409
+ headers: jsonContentHeaders,
410
+ method: "POST",
411
+ path: `/domain/v2beta1/external-domains`
412
+ }, unmarshalRegisterExternalDomainResponse);
413
+ /**
414
+ * Delete an external domain. Delete an external domain name.
415
+ *
416
+ * @param request - The request {@link RegistrarApiDeleteExternalDomainRequest}
417
+ * @returns A Promise of DeleteExternalDomainResponse
418
+ */
419
+ deleteExternalDomain = (request) => this.client.fetch({
420
+ method: "DELETE",
421
+ path: `/domain/v2beta1/external-domains/${validatePathParam("domain", request.domain)}`
422
+ }, unmarshalDeleteExternalDomainResponse);
423
+ /**
424
+ * Check if contacts are compatible with a domain or a TLD. Check whether contacts are compatible with a domain or a TLD.
425
+ If contacts are not compatible with either the domain or the TLD, the information that needs to be corrected is returned.
426
+ *
427
+ * @param request - The request {@link RegistrarApiCheckContactsCompatibilityRequest}
428
+ * @returns A Promise of CheckContactsCompatibilityResponse
429
+ */
430
+ checkContactsCompatibility = (request = {}) => this.client.fetch({
431
+ body: JSON.stringify(marshalRegistrarApiCheckContactsCompatibilityRequest(request, this.client.settings)),
432
+ headers: jsonContentHeaders,
433
+ method: "POST",
434
+ path: `/domain/v2beta1/check-contacts-compatibility`
435
+ }, unmarshalCheckContactsCompatibilityResponse);
436
+ pageOfListContacts = (request = {}) => this.client.fetch({
437
+ method: "GET",
438
+ path: `/domain/v2beta1/contacts`,
439
+ urlParams: urlParams(["domain", request.domain], ["email_status", request.emailStatus], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["role", request.role])
440
+ }, unmarshalListContactsResponse);
441
+ /**
442
+ * List contacts. Retrieve the list of contacts and their associated domains and roles.
443
+ You can filter the list by domain name.
444
+ *
445
+ * @param request - The request {@link RegistrarApiListContactsRequest}
446
+ * @returns A Promise of ListContactsResponse
447
+ */
448
+ listContacts = (request = {}) => enrichForPagination("contacts", this.pageOfListContacts, request);
449
+ /**
450
+ * Get a contact. Retrieve a contact's details from the registrar using the given contact's ID.
451
+ *
452
+ * @param request - The request {@link RegistrarApiGetContactRequest}
453
+ * @returns A Promise of Contact
454
+ */
455
+ getContact = (request) => this.client.fetch({
456
+ method: "GET",
457
+ path: `/domain/v2beta1/contacts/${validatePathParam("contactId", request.contactId)}`
458
+ }, unmarshalContact);
459
+ /**
460
+ * Update contact. Edit the contact's information.
461
+ *
462
+ * @param request - The request {@link RegistrarApiUpdateContactRequest}
463
+ * @returns A Promise of Contact
464
+ */
465
+ updateContact = (request) => this.client.fetch({
466
+ body: JSON.stringify(marshalRegistrarApiUpdateContactRequest(request, this.client.settings)),
467
+ headers: jsonContentHeaders,
468
+ method: "PATCH",
469
+ path: `/domain/v2beta1/contacts/${validatePathParam("contactId", request.contactId)}`
470
+ }, unmarshalContact);
471
+ pageOfListDomains = (request = {}) => this.client.fetch({
472
+ method: "GET",
473
+ path: `/domain/v2beta1/domains`,
474
+ urlParams: urlParams(["domain", request.domain], ["is_external", request.isExternal], ["order_by", request.orderBy], ["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])
475
+ }, unmarshalListDomainsResponse);
476
+ /**
477
+ * List domains. Retrieve the list of domains you own.
478
+ *
479
+ * @param request - The request {@link RegistrarApiListDomainsRequest}
480
+ * @returns A Promise of ListDomainsResponse
481
+ */
482
+ listDomains = (request = {}) => enrichForPagination("domains", this.pageOfListDomains, request);
483
+ pageOfListRenewableDomains = (request = {}) => this.client.fetch({
484
+ method: "GET",
485
+ path: `/domain/v2beta1/renewable-domains`,
486
+ urlParams: urlParams(["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
487
+ }, unmarshalListRenewableDomainsResponse);
488
+ /**
489
+ * List domains that can be renewed. Retrieve the list of domains you own that can be renewed. You can also see the maximum renewal duration in years for your domains that are renewable.
490
+ *
491
+ * @param request - The request {@link RegistrarApiListRenewableDomainsRequest}
492
+ * @returns A Promise of ListRenewableDomainsResponse
493
+ */
494
+ listRenewableDomains = (request = {}) => enrichForPagination("domains", this.pageOfListRenewableDomains, request);
495
+ /**
496
+ * Get domain. Retrieve a specific domain and display the domain's information.
497
+ *
498
+ * @param request - The request {@link RegistrarApiGetDomainRequest}
499
+ * @returns A Promise of Domain
500
+ */
501
+ getDomain = (request) => this.client.fetch({
502
+ method: "GET",
503
+ path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}`
504
+ }, unmarshalDomain);
505
+ /**
506
+ * Waits for {@link Domain} to be in a final state.
507
+ *
508
+ * @param request - The request {@link RegistrarApiGetDomainRequest}
509
+ * @param options - The waiting options
510
+ * @returns A Promise of Domain
511
+ */
512
+ waitForDomain = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES.includes(res.status))), this.getDomain, request, options);
513
+ /**
514
+ * Update a domain's contacts. Update contacts for a specific domain or create a new contact.<br/>
515
+ If you add the same contact for multiple roles (owner, administrative, technical), only one ID will be created and used for all of the roles.
516
+ *
517
+ * @param request - The request {@link RegistrarApiUpdateDomainRequest}
518
+ * @returns A Promise of Domain
519
+ */
520
+ updateDomain = (request) => this.client.fetch({
521
+ body: JSON.stringify(marshalRegistrarApiUpdateDomainRequest(request, this.client.settings)),
522
+ headers: jsonContentHeaders,
523
+ method: "PATCH",
524
+ path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}`
525
+ }, unmarshalDomain);
526
+ /**
527
+ * Lock the transfer of a domain. Lock the transfer of a domain. This means that the domain cannot be transferred and the authorization code cannot be requested to your current registrar.
528
+ *
529
+ * @param request - The request {@link RegistrarApiLockDomainTransferRequest}
530
+ * @returns A Promise of Domain
531
+ */
532
+ lockDomainTransfer = (request) => this.client.fetch({
533
+ body: "{}",
534
+ headers: jsonContentHeaders,
535
+ method: "POST",
536
+ path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/lock-transfer`
537
+ }, unmarshalDomain);
538
+ /**
539
+ * Unlock the transfer of a domain. Unlock the transfer of a domain. This means that the domain can be transferred and the authorization code can be requested to your current registrar.
540
+ *
541
+ * @param request - The request {@link RegistrarApiUnlockDomainTransferRequest}
542
+ * @returns A Promise of Domain
543
+ */
544
+ unlockDomainTransfer = (request) => this.client.fetch({
545
+ body: "{}",
546
+ headers: jsonContentHeaders,
547
+ method: "POST",
548
+ path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/unlock-transfer`
549
+ }, unmarshalDomain);
550
+ /**
551
+ * Enable auto renew. Enable the `auto renew` feature for a domain. This means the domain will be automatically renewed before its expiry date.
552
+ *
553
+ * @param request - The request {@link RegistrarApiEnableDomainAutoRenewRequest}
554
+ * @returns A Promise of Domain
555
+ */
556
+ enableDomainAutoRenew = (request) => this.client.fetch({
557
+ body: "{}",
558
+ headers: jsonContentHeaders,
559
+ method: "POST",
560
+ path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/enable-auto-renew`
561
+ }, unmarshalDomain);
562
+ /**
563
+ * Disable auto renew. Disable the `auto renew` feature for a domain. This means the domain will not be renewed before its expiry date.
564
+ *
565
+ * @param request - The request {@link RegistrarApiDisableDomainAutoRenewRequest}
566
+ * @returns A Promise of Domain
567
+ */
568
+ disableDomainAutoRenew = (request) => this.client.fetch({
569
+ body: "{}",
570
+ headers: jsonContentHeaders,
571
+ method: "POST",
572
+ path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/disable-auto-renew`
573
+ }, unmarshalDomain);
574
+ /**
575
+ * Get a domain's authorization code. Retrieve the authorization code to transfer an unlocked domain. The output returns an error if the domain is locked.
576
+ Some TLDs may have a different procedure to retrieve the authorization code. In that case, the information displays in the message field.
577
+ *
578
+ * @param request - The request {@link RegistrarApiGetDomainAuthCodeRequest}
579
+ * @returns A Promise of GetDomainAuthCodeResponse
580
+ */
581
+ getDomainAuthCode = (request) => this.client.fetch({
582
+ method: "GET",
583
+ path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/auth-code`
584
+ }, unmarshalGetDomainAuthCodeResponse);
585
+ /**
586
+ * Update domain DNSSEC. If your domain uses another registrar and has the default Scaleway NS, you have to **update the DS record at your registrar**.
587
+ *
588
+ * @param request - The request {@link RegistrarApiEnableDomainDNSSECRequest}
589
+ * @returns A Promise of Domain
590
+ */
591
+ enableDomainDNSSEC = (request) => this.client.fetch({
592
+ body: JSON.stringify(marshalRegistrarApiEnableDomainDNSSECRequest(request, this.client.settings)),
593
+ headers: jsonContentHeaders,
594
+ method: "POST",
595
+ path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/enable-dnssec`
596
+ }, unmarshalDomain);
597
+ /**
598
+ * Disable a domain's DNSSEC. Disable DNSSEC for a domain.
599
+ *
600
+ * @param request - The request {@link RegistrarApiDisableDomainDNSSECRequest}
601
+ * @returns A Promise of Domain
602
+ */
603
+ disableDomainDNSSEC = (request) => this.client.fetch({
604
+ body: "{}",
605
+ headers: jsonContentHeaders,
606
+ method: "POST",
607
+ path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/disable-dnssec`
608
+ }, unmarshalDomain);
609
+ /**
610
+ * Search available domains. Search a domain or a maximum of 10 domains that are available.
611
+
612
+ If the TLD list is empty or not set, the search returns the results from the most popular TLDs.
613
+ *
614
+ * @param request - The request {@link RegistrarApiSearchAvailableDomainsRequest}
615
+ * @returns A Promise of SearchAvailableDomainsResponse
616
+ */
617
+ searchAvailableDomains = (request) => this.client.fetch({
618
+ method: "GET",
619
+ path: `/domain/v2beta1/search-domains`,
620
+ urlParams: urlParams(["domains", request.domains], ["strict_search", request.strictSearch], ["tlds", request.tlds])
621
+ }, unmarshalSearchAvailableDomainsResponse);
622
+ pageOfListTlds = (request = {}) => this.client.fetch({
623
+ method: "GET",
624
+ path: `/domain/v2beta1/tlds`,
625
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["tlds", request.tlds])
626
+ }, unmarshalListTldsResponse);
627
+ /**
628
+ * List TLD offers. Retrieve the list of TLDs and offers associated with them.
629
+ *
630
+ * @param request - The request {@link RegistrarApiListTldsRequest}
631
+ * @returns A Promise of ListTldsResponse
632
+ */
633
+ listTlds = (request = {}) => enrichForPagination("tlds", this.pageOfListTlds, request);
634
+ /**
635
+ * Create a hostname for a domain. Create a hostname for a domain with glue IPs.
636
+ *
637
+ * @param request - The request {@link RegistrarApiCreateDomainHostRequest}
638
+ * @returns A Promise of Host
639
+ */
640
+ createDomainHost = (request) => this.client.fetch({
641
+ body: JSON.stringify(marshalRegistrarApiCreateDomainHostRequest(request, this.client.settings)),
642
+ headers: jsonContentHeaders,
643
+ method: "POST",
644
+ path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/hosts`
645
+ }, unmarshalHost);
646
+ pageOfListDomainHosts = (request) => this.client.fetch({
647
+ method: "GET",
648
+ path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/hosts`,
649
+ urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
650
+ }, unmarshalListDomainHostsResponse);
651
+ /**
652
+ * List a domain's hostnames. List a domain's hostnames using their glue IPs.
653
+ *
654
+ * @param request - The request {@link RegistrarApiListDomainHostsRequest}
655
+ * @returns A Promise of ListDomainHostsResponse
656
+ */
657
+ listDomainHosts = (request) => enrichForPagination("hosts", this.pageOfListDomainHosts, request);
658
+ /**
659
+ * Update a domain's hostname. Update a domain's hostname with glue IPs.
660
+ *
661
+ * @param request - The request {@link RegistrarApiUpdateDomainHostRequest}
662
+ * @returns A Promise of Host
663
+ */
664
+ updateDomainHost = (request) => this.client.fetch({
665
+ body: JSON.stringify(marshalRegistrarApiUpdateDomainHostRequest(request, this.client.settings)),
666
+ headers: jsonContentHeaders,
667
+ method: "PATCH",
668
+ path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/hosts/${validatePathParam("name", request.name)}`
669
+ }, unmarshalHost);
670
+ /**
671
+ * Delete a domain's hostname.
672
+ *
673
+ * @param request - The request {@link RegistrarApiDeleteDomainHostRequest}
674
+ * @returns A Promise of Host
675
+ */
676
+ deleteDomainHost = (request) => this.client.fetch({
677
+ method: "DELETE",
678
+ path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/hosts/${validatePathParam("name", request.name)}`
679
+ }, unmarshalHost);
1070
680
  };
681
+ /**
682
+ * Unauthenticated Domain search API.
683
+ */
684
+ var UnauthenticatedRegistrarAPI = class extends API {
685
+ getServiceInfo = () => this.client.fetch({
686
+ method: "GET",
687
+ path: `/domain/v2beta1/search`
688
+ }, unmarshalServiceInfo);
689
+ searchAvailableDomainsConsole = (request) => this.client.fetch({
690
+ method: "GET",
691
+ path: `/domain/v2beta1/search-domains-console`,
692
+ urlParams: urlParams(["domain", request.domain], ["strict_search", request.strictSearch], ["tlds", request.tlds])
693
+ }, unmarshalSearchAvailableDomainsConsoleResponse);
694
+ };
695
+ export { API$1 as API, RegistrarAPI, UnauthenticatedRegistrarAPI };