@scaleway/sdk-domain 2.6.0 → 2.7.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.
@@ -2,306 +2,147 @@ import { DOMAIN_TRANSIENT_STATUSES, SSL_CERTIFICATE_TRANSIENT_STATUSES } from ".
2
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
3
  import { API as API$1, enrichForPagination, unmarshalServiceInfo, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
4
4
  //#region src/v2beta1/api.gen.ts
5
- var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
5
+ const jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
6
6
  /**
7
7
  * Domains and DNS API.
8
8
 
9
9
  This API allows you to manage your domains, DNS zones and records.
10
10
  */
11
11
  var API = class extends API$1 {
12
- pageOfListDNSZones = (request) => this.client.fetch({
13
- method: "GET",
14
- path: `/domain/v2beta1/dns-zones`,
15
- 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])
16
- }, unmarshalListDNSZonesResponse);
17
- /**
18
- * List DNS zones. Retrieve the list of DNS zones you can manage and filter DNS zones associated with specific domain names.
19
- *
20
- * @param request - The request {@link ListDNSZonesRequest}
21
- * @returns A Promise of ListDNSZonesResponse
22
- */
23
- listDNSZones = (request) => enrichForPagination("dnsZones", this.pageOfListDNSZones, request);
24
- /**
25
- * Create a DNS zone. Create a new DNS zone specified by the domain name, the subdomain and the Project ID.
26
- *
27
- * @param request - The request {@link CreateDNSZoneRequest}
28
- * @returns A Promise of DNSZone
29
- */
30
- createDNSZone = (request) => this.client.fetch({
31
- body: JSON.stringify(marshalCreateDNSZoneRequest(request, this.client.settings)),
32
- headers: jsonContentHeaders,
33
- method: "POST",
34
- path: `/domain/v2beta1/dns-zones`
35
- }, unmarshalDNSZone);
36
- /**
37
- * Update a DNS zone. Update the name and/or the Organizations for a DNS zone.
38
- *
39
- * @param request - The request {@link UpdateDNSZoneRequest}
40
- * @returns A Promise of DNSZone
41
- */
42
- updateDNSZone = (request) => this.client.fetch({
43
- body: JSON.stringify(marshalUpdateDNSZoneRequest(request, this.client.settings)),
44
- headers: jsonContentHeaders,
45
- method: "PATCH",
46
- path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}`
47
- }, unmarshalDNSZone);
48
- /**
49
- * Clone a DNS zone. Clone an existing DNS zone with all its records into a new DNS zone.
50
- *
51
- * @param request - The request {@link CloneDNSZoneRequest}
52
- * @returns A Promise of DNSZone
53
- */
54
- cloneDNSZone = (request) => this.client.fetch({
55
- body: JSON.stringify(marshalCloneDNSZoneRequest(request, this.client.settings)),
56
- headers: jsonContentHeaders,
57
- method: "POST",
58
- path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/clone`
59
- }, unmarshalDNSZone);
60
- /**
61
- * Delete a DNS zone. Delete a DNS zone and all its records.
62
- *
63
- * @param request - The request {@link DeleteDNSZoneRequest}
64
- * @returns A Promise of DeleteDNSZoneResponse
65
- */
66
- deleteDNSZone = (request) => this.client.fetch({
67
- method: "DELETE",
68
- path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}`,
69
- urlParams: urlParams(["project_id", request.projectId ?? this.client.settings.defaultProjectId])
70
- }, unmarshalDeleteDNSZoneResponse);
71
- pageOfListDNSZoneRecords = (request) => this.client.fetch({
72
- method: "GET",
73
- path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/records`,
74
- 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])
75
- }, unmarshalListDNSZoneRecordsResponse);
76
- /**
77
- * List records within a DNS zone. Retrieve a list of DNS records within a DNS zone that has default name servers.
78
- You can filter records by type and name.
79
- *
80
- * @param request - The request {@link ListDNSZoneRecordsRequest}
81
- * @returns A Promise of ListDNSZoneRecordsResponse
82
- */
83
- listDNSZoneRecords = (request) => enrichForPagination("records", this.pageOfListDNSZoneRecords, request);
84
- /**
85
- * Update records within a DNS zone. Update records within a DNS zone that has default name servers and perform several actions on your records.
86
-
87
- Actions include:
88
- - add: allows you to add a new record or add a new IP to an existing A record, for example
89
- - set: allows you to edit a record or edit an IP from an existing A record, for example
90
- - delete: allows you to delete a record or delete an IP from an existing A record, for example
91
- - clear: allows you to delete all records from a DNS zone
92
-
93
- All edits will be versioned.
94
- *
95
- * @param request - The request {@link UpdateDNSZoneRecordsRequest}
96
- * @returns A Promise of UpdateDNSZoneRecordsResponse
97
- */
98
- updateDNSZoneRecords = (request) => this.client.fetch({
99
- body: JSON.stringify(marshalUpdateDNSZoneRecordsRequest(request, this.client.settings)),
100
- headers: jsonContentHeaders,
101
- method: "PATCH",
102
- path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/records`
103
- }, unmarshalUpdateDNSZoneRecordsResponse);
104
- /**
105
- * List name servers within a DNS zone. Retrieve a list of name servers within a DNS zone and their optional glue records.
106
- *
107
- * @param request - The request {@link ListDNSZoneNameserversRequest}
108
- * @returns A Promise of ListDNSZoneNameserversResponse
109
- */
110
- listDNSZoneNameservers = (request) => this.client.fetch({
111
- method: "GET",
112
- path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/nameservers`,
113
- urlParams: urlParams(["project_id", request.projectId])
114
- }, unmarshalListDNSZoneNameserversResponse);
115
- /**
116
- * Update name servers within a DNS zone. Update name servers within a DNS zone and set optional glue records.
117
- *
118
- * @param request - The request {@link UpdateDNSZoneNameserversRequest}
119
- * @returns A Promise of UpdateDNSZoneNameserversResponse
120
- */
121
- updateDNSZoneNameservers = (request) => this.client.fetch({
122
- body: JSON.stringify(marshalUpdateDNSZoneNameserversRequest(request, this.client.settings)),
123
- headers: jsonContentHeaders,
124
- method: "PUT",
125
- path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/nameservers`
126
- }, unmarshalUpdateDNSZoneNameserversResponse);
127
- /**
128
- * Clear records within a DNS zone. Delete all records within a DNS zone that has default name servers.<br/>
129
- All edits will be versioned.
130
- *
131
- * @param request - The request {@link ClearDNSZoneRecordsRequest}
132
- * @returns A Promise of ClearDNSZoneRecordsResponse
133
- */
134
- clearDNSZoneRecords = (request) => this.client.fetch({
135
- method: "DELETE",
136
- path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/records`
137
- }, unmarshalClearDNSZoneRecordsResponse);
138
- /**
139
- * Export a raw DNS zone. Export a DNS zone with default name servers, in a specific format.
140
- *
141
- * @param request - The request {@link ExportRawDNSZoneRequest}
142
- * @returns A Promise of Blob
143
- */
144
- exportRawDNSZone = (request) => this.client.fetch({
145
- method: "GET",
146
- path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/raw`,
147
- urlParams: urlParams(["dl", 1], ["format", request.format]),
148
- responseType: "blob"
149
- });
150
- /**
151
- * Import a raw DNS zone. Import and replace the format of records from a given provider, with default name servers.
152
- *
153
- * @param request - The request {@link ImportRawDNSZoneRequest}
154
- * @returns A Promise of ImportRawDNSZoneResponse
155
- */
156
- importRawDNSZone = (request) => this.client.fetch({
157
- body: JSON.stringify(marshalImportRawDNSZoneRequest(request, this.client.settings)),
158
- headers: jsonContentHeaders,
159
- method: "POST",
160
- path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/raw`
161
- }, unmarshalImportRawDNSZoneResponse);
162
- /**
163
- * Import a DNS zone from another provider. Import and replace the format of records from a given provider, with default name servers.
164
- *
165
- * @param request - The request {@link ImportProviderDNSZoneRequest}
166
- * @returns A Promise of ImportProviderDNSZoneResponse
167
- */
168
- importProviderDNSZone = (request) => this.client.fetch({
169
- body: JSON.stringify(marshalImportProviderDNSZoneRequest(request, this.client.settings)),
170
- headers: jsonContentHeaders,
171
- method: "POST",
172
- path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/import-provider`
173
- }, unmarshalImportProviderDNSZoneResponse);
174
- /**
175
- * Refresh a DNS zone. Refresh an SOA DNS zone to reload the records in the DNS zone and update the SOA serial.
176
- You can recreate the given DNS zone and its sub DNS zone if needed.
177
- *
178
- * @param request - The request {@link RefreshDNSZoneRequest}
179
- * @returns A Promise of RefreshDNSZoneResponse
180
- */
181
- refreshDNSZone = (request) => this.client.fetch({
182
- body: JSON.stringify(marshalRefreshDNSZoneRequest(request, this.client.settings)),
183
- headers: jsonContentHeaders,
184
- method: "POST",
185
- path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/refresh`
186
- }, unmarshalRefreshDNSZoneResponse);
187
- pageOfListDNSZoneVersions = (request) => this.client.fetch({
188
- method: "GET",
189
- path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/versions`,
190
- urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
191
- }, unmarshalListDNSZoneVersionsResponse);
192
- /**
193
- * List versions of a DNS zone. Retrieve a list of a DNS zone's versions.<br/>
194
- The maximum version count is 100. If the count reaches this limit, the oldest version will be deleted after each new modification.
195
- *
196
- * @param request - The request {@link ListDNSZoneVersionsRequest}
197
- * @returns A Promise of ListDNSZoneVersionsResponse
198
- */
199
- listDNSZoneVersions = (request) => enrichForPagination("versions", this.pageOfListDNSZoneVersions, request);
200
- pageOfListDNSZoneVersionRecords = (request) => this.client.fetch({
201
- method: "GET",
202
- path: `/domain/v2beta1/dns-zones/version/${validatePathParam("dnsZoneVersionId", request.dnsZoneVersionId)}`,
203
- urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
204
- }, unmarshalListDNSZoneVersionRecordsResponse);
205
- /**
206
- * List records from a given version of a specific DNS zone. Retrieve a list of records from a specific DNS zone version.
207
- *
208
- * @param request - The request {@link ListDNSZoneVersionRecordsRequest}
209
- * @returns A Promise of ListDNSZoneVersionRecordsResponse
210
- */
211
- listDNSZoneVersionRecords = (request) => enrichForPagination("records", this.pageOfListDNSZoneVersionRecords, request);
212
- /**
213
- * Access differences from a specific DNS zone version. Access a previous DNS zone version to see the differences from another specific version.
214
- *
215
- * @param request - The request {@link GetDNSZoneVersionDiffRequest}
216
- * @returns A Promise of GetDNSZoneVersionDiffResponse
217
- */
218
- getDNSZoneVersionDiff = (request) => this.client.fetch({
219
- method: "GET",
220
- path: `/domain/v2beta1/dns-zones/version/${validatePathParam("dnsZoneVersionId", request.dnsZoneVersionId)}/diff`
221
- }, unmarshalGetDNSZoneVersionDiffResponse);
222
- /**
223
- * Restore a DNS zone version. Restore and activate a version of a specific DNS zone.
224
- *
225
- * @param request - The request {@link RestoreDNSZoneVersionRequest}
226
- * @returns A Promise of RestoreDNSZoneVersionResponse
227
- */
228
- restoreDNSZoneVersion = (request) => this.client.fetch({
229
- body: "{}",
230
- headers: jsonContentHeaders,
231
- method: "POST",
232
- path: `/domain/v2beta1/dns-zones/version/${validatePathParam("dnsZoneVersionId", request.dnsZoneVersionId)}/restore`
233
- }, unmarshalRestoreDNSZoneVersionResponse);
234
- /**
235
- * 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`.
236
- *
237
- * @param request - The request {@link GetSSLCertificateRequest}
238
- * @returns A Promise of SSLCertificate
239
- */
240
- getSSLCertificate = (request) => this.client.fetch({
241
- method: "GET",
242
- path: `/domain/v2beta1/ssl-certificates/${validatePathParam("dnsZone", request.dnsZone)}`
243
- }, unmarshalSSLCertificate);
244
- /**
245
- * Waits for {@link SSLCertificate} to be in a final state.
246
- *
247
- * @param request - The request {@link GetSSLCertificateRequest}
248
- * @param options - The waiting options
249
- * @returns A Promise of SSLCertificate
250
- */
251
- waitForSSLCertificate = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!SSL_CERTIFICATE_TRANSIENT_STATUSES.includes(res.status))), this.getSSLCertificate, request, options);
252
- /**
253
- * Create or get the DNS zone's TLS certificate. Create a new TLS certificate or retrieve information about an existing TLS certificate.
254
- *
255
- * @param request - The request {@link CreateSSLCertificateRequest}
256
- * @returns A Promise of SSLCertificate
257
- */
258
- createSSLCertificate = (request) => this.client.fetch({
259
- body: JSON.stringify(marshalCreateSSLCertificateRequest(request, this.client.settings)),
260
- headers: jsonContentHeaders,
261
- method: "POST",
262
- path: `/domain/v2beta1/ssl-certificates`
263
- }, unmarshalSSLCertificate);
264
- pageOfListSSLCertificates = (request) => this.client.fetch({
265
- method: "GET",
266
- path: `/domain/v2beta1/ssl-certificates`,
267
- urlParams: urlParams(["dns_zone", request.dnsZone], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
268
- }, unmarshalListSSLCertificatesResponse);
269
- /**
270
- * 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.
271
- *
272
- * @param request - The request {@link ListSSLCertificatesRequest}
273
- * @returns A Promise of ListSSLCertificatesResponse
274
- */
275
- listSSLCertificates = (request) => enrichForPagination("certificates", this.pageOfListSSLCertificates, request);
276
- /**
277
- * Delete a TLS certificate. Delete an existing TLS certificate specified by its DNS zone. Deleting a TLS certificate is permanent and cannot be undone.
278
- *
279
- * @param request - The request {@link DeleteSSLCertificateRequest}
280
- * @returns A Promise of DeleteSSLCertificateResponse
281
- */
282
- deleteSSLCertificate = (request) => this.client.fetch({
283
- method: "DELETE",
284
- path: `/domain/v2beta1/ssl-certificates/${validatePathParam("dnsZone", request.dnsZone)}`
285
- }, unmarshalDeleteSSLCertificateResponse);
286
- /**
287
- * Get the DNS zone's TSIG key. Retrieve information about the TSIG key of a given DNS zone to allow AXFR requests.
288
- *
289
- * @param request - The request {@link GetDNSZoneTsigKeyRequest}
290
- * @returns A Promise of GetDNSZoneTsigKeyResponse
291
- */
292
- getDNSZoneTsigKey = (request) => this.client.fetch({
293
- method: "GET",
294
- path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/tsig-key`
295
- }, unmarshalGetDNSZoneTsigKeyResponse);
296
- /**
297
- * 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.
298
- *
299
- * @param request - The request {@link DeleteDNSZoneTsigKeyRequest}
300
- */
301
- deleteDNSZoneTsigKey = (request) => this.client.fetch({
302
- method: "DELETE",
303
- path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/tsig-key`
304
- });
12
+ constructor(..._args) {
13
+ super(..._args);
14
+ this.pageOfListDNSZones = (request) => this.client.fetch({
15
+ method: "GET",
16
+ path: `/domain/v2beta1/dns-zones`,
17
+ 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])
18
+ }, unmarshalListDNSZonesResponse);
19
+ this.listDNSZones = (request) => enrichForPagination("dnsZones", this.pageOfListDNSZones, request);
20
+ this.createDNSZone = (request) => this.client.fetch({
21
+ body: JSON.stringify(marshalCreateDNSZoneRequest(request, this.client.settings)),
22
+ headers: jsonContentHeaders,
23
+ method: "POST",
24
+ path: `/domain/v2beta1/dns-zones`
25
+ }, unmarshalDNSZone);
26
+ this.updateDNSZone = (request) => this.client.fetch({
27
+ body: JSON.stringify(marshalUpdateDNSZoneRequest(request, this.client.settings)),
28
+ headers: jsonContentHeaders,
29
+ method: "PATCH",
30
+ path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}`
31
+ }, unmarshalDNSZone);
32
+ this.cloneDNSZone = (request) => this.client.fetch({
33
+ body: JSON.stringify(marshalCloneDNSZoneRequest(request, this.client.settings)),
34
+ headers: jsonContentHeaders,
35
+ method: "POST",
36
+ path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/clone`
37
+ }, unmarshalDNSZone);
38
+ this.deleteDNSZone = (request) => this.client.fetch({
39
+ method: "DELETE",
40
+ path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}`,
41
+ urlParams: urlParams(["project_id", request.projectId ?? this.client.settings.defaultProjectId])
42
+ }, unmarshalDeleteDNSZoneResponse);
43
+ this.pageOfListDNSZoneRecords = (request) => this.client.fetch({
44
+ method: "GET",
45
+ path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/records`,
46
+ 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])
47
+ }, unmarshalListDNSZoneRecordsResponse);
48
+ this.listDNSZoneRecords = (request) => enrichForPagination("records", this.pageOfListDNSZoneRecords, request);
49
+ this.updateDNSZoneRecords = (request) => this.client.fetch({
50
+ body: JSON.stringify(marshalUpdateDNSZoneRecordsRequest(request, this.client.settings)),
51
+ headers: jsonContentHeaders,
52
+ method: "PATCH",
53
+ path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/records`
54
+ }, unmarshalUpdateDNSZoneRecordsResponse);
55
+ this.listDNSZoneNameservers = (request) => this.client.fetch({
56
+ method: "GET",
57
+ path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/nameservers`,
58
+ urlParams: urlParams(["project_id", request.projectId])
59
+ }, unmarshalListDNSZoneNameserversResponse);
60
+ this.updateDNSZoneNameservers = (request) => this.client.fetch({
61
+ body: JSON.stringify(marshalUpdateDNSZoneNameserversRequest(request, this.client.settings)),
62
+ headers: jsonContentHeaders,
63
+ method: "PUT",
64
+ path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/nameservers`
65
+ }, unmarshalUpdateDNSZoneNameserversResponse);
66
+ this.clearDNSZoneRecords = (request) => this.client.fetch({
67
+ method: "DELETE",
68
+ path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/records`
69
+ }, unmarshalClearDNSZoneRecordsResponse);
70
+ this.exportRawDNSZone = (request) => this.client.fetch({
71
+ method: "GET",
72
+ path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/raw`,
73
+ urlParams: urlParams(["dl", 1], ["format", request.format]),
74
+ responseType: "blob"
75
+ });
76
+ this.importRawDNSZone = (request) => this.client.fetch({
77
+ body: JSON.stringify(marshalImportRawDNSZoneRequest(request, this.client.settings)),
78
+ headers: jsonContentHeaders,
79
+ method: "POST",
80
+ path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/raw`
81
+ }, unmarshalImportRawDNSZoneResponse);
82
+ this.importProviderDNSZone = (request) => this.client.fetch({
83
+ body: JSON.stringify(marshalImportProviderDNSZoneRequest(request, this.client.settings)),
84
+ headers: jsonContentHeaders,
85
+ method: "POST",
86
+ path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/import-provider`
87
+ }, unmarshalImportProviderDNSZoneResponse);
88
+ this.refreshDNSZone = (request) => this.client.fetch({
89
+ body: JSON.stringify(marshalRefreshDNSZoneRequest(request, this.client.settings)),
90
+ headers: jsonContentHeaders,
91
+ method: "POST",
92
+ path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/refresh`
93
+ }, unmarshalRefreshDNSZoneResponse);
94
+ this.pageOfListDNSZoneVersions = (request) => this.client.fetch({
95
+ method: "GET",
96
+ path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/versions`,
97
+ urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
98
+ }, unmarshalListDNSZoneVersionsResponse);
99
+ this.listDNSZoneVersions = (request) => enrichForPagination("versions", this.pageOfListDNSZoneVersions, request);
100
+ this.pageOfListDNSZoneVersionRecords = (request) => this.client.fetch({
101
+ method: "GET",
102
+ path: `/domain/v2beta1/dns-zones/version/${validatePathParam("dnsZoneVersionId", request.dnsZoneVersionId)}`,
103
+ urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
104
+ }, unmarshalListDNSZoneVersionRecordsResponse);
105
+ this.listDNSZoneVersionRecords = (request) => enrichForPagination("records", this.pageOfListDNSZoneVersionRecords, request);
106
+ this.getDNSZoneVersionDiff = (request) => this.client.fetch({
107
+ method: "GET",
108
+ path: `/domain/v2beta1/dns-zones/version/${validatePathParam("dnsZoneVersionId", request.dnsZoneVersionId)}/diff`
109
+ }, unmarshalGetDNSZoneVersionDiffResponse);
110
+ this.restoreDNSZoneVersion = (request) => this.client.fetch({
111
+ body: "{}",
112
+ headers: jsonContentHeaders,
113
+ method: "POST",
114
+ path: `/domain/v2beta1/dns-zones/version/${validatePathParam("dnsZoneVersionId", request.dnsZoneVersionId)}/restore`
115
+ }, unmarshalRestoreDNSZoneVersionResponse);
116
+ this.getSSLCertificate = (request) => this.client.fetch({
117
+ method: "GET",
118
+ path: `/domain/v2beta1/ssl-certificates/${validatePathParam("dnsZone", request.dnsZone)}`
119
+ }, unmarshalSSLCertificate);
120
+ this.waitForSSLCertificate = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!SSL_CERTIFICATE_TRANSIENT_STATUSES.includes(res.status))), this.getSSLCertificate, request, options);
121
+ this.createSSLCertificate = (request) => this.client.fetch({
122
+ body: JSON.stringify(marshalCreateSSLCertificateRequest(request, this.client.settings)),
123
+ headers: jsonContentHeaders,
124
+ method: "POST",
125
+ path: `/domain/v2beta1/ssl-certificates`
126
+ }, unmarshalSSLCertificate);
127
+ this.pageOfListSSLCertificates = (request) => this.client.fetch({
128
+ method: "GET",
129
+ path: `/domain/v2beta1/ssl-certificates`,
130
+ urlParams: urlParams(["dns_zone", request.dnsZone], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
131
+ }, unmarshalListSSLCertificatesResponse);
132
+ this.listSSLCertificates = (request) => enrichForPagination("certificates", this.pageOfListSSLCertificates, request);
133
+ this.deleteSSLCertificate = (request) => this.client.fetch({
134
+ method: "DELETE",
135
+ path: `/domain/v2beta1/ssl-certificates/${validatePathParam("dnsZone", request.dnsZone)}`
136
+ }, unmarshalDeleteSSLCertificateResponse);
137
+ this.getDNSZoneTsigKey = (request) => this.client.fetch({
138
+ method: "GET",
139
+ path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/tsig-key`
140
+ }, unmarshalGetDNSZoneTsigKeyResponse);
141
+ this.deleteDNSZoneTsigKey = (request) => this.client.fetch({
142
+ method: "DELETE",
143
+ path: `/domain/v2beta1/dns-zones/${validatePathParam("dnsZone", request.dnsZone)}/tsig-key`
144
+ });
145
+ }
305
146
  };
306
147
  /**
307
148
  * Domains and DNS - Registrar API.
@@ -309,389 +150,196 @@ var API = class extends API$1 {
309
150
  Manage your domains and contacts.
310
151
  */
311
152
  var RegistrarAPI = class extends API$1 {
312
- pageOfListTasks = (request = {}) => this.client.fetch({
313
- method: "GET",
314
- path: `/domain/v2beta1/tasks`,
315
- 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])
316
- }, unmarshalListTasksResponse);
317
- /**
318
- * List tasks. List all operations performed on the account.
319
- You can filter the list of tasks by domain name.
320
- *
321
- * @param request - The request {@link RegistrarApiListTasksRequest}
322
- * @returns A Promise of ListTasksResponse
323
- */
324
- listTasks = (request = {}) => enrichForPagination("tasks", this.pageOfListTasks, request);
325
- pageOfListInboundTransfers = (request) => this.client.fetch({
326
- method: "GET",
327
- path: `/domain/v2beta1/inbound-transfers`,
328
- 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])
329
- }, unmarshalListInboundTransfersResponse);
330
- /**
331
- * List inbound domain transfers. List all inbound transfer operations on the account.
332
- You can filter the list of inbound transfers by domain name.
333
- *
334
- * @param request - The request {@link RegistrarApiListInboundTransfersRequest}
335
- * @returns A Promise of ListInboundTransfersResponse
336
- */
337
- listInboundTransfers = (request) => enrichForPagination("inboundTransfers", this.pageOfListInboundTransfers, request);
338
- /**
339
- * Retry the inbound transfer of a domain. Request a retry for the transfer of a domain from another registrar to Scaleway Domains and DNS.
340
- *
341
- * @param request - The request {@link RegistrarApiRetryInboundTransferRequest}
342
- * @returns A Promise of RetryInboundTransferResponse
343
- */
344
- retryInboundTransfer = (request) => this.client.fetch({
345
- body: JSON.stringify(marshalRegistrarApiRetryInboundTransferRequest(request, this.client.settings)),
346
- headers: jsonContentHeaders,
347
- method: "POST",
348
- path: `/domain/v2beta1/retry-inbound-transfer`
349
- }, unmarshalRetryInboundTransferResponse);
350
- /**
351
- * Purchase domains. Request the registration of domain names.
352
- You can provide a domain's already existing contact or a new contact.
353
- *
354
- * @param request - The request {@link RegistrarApiBuyDomainsRequest}
355
- * @returns A Promise of OrderResponse
356
- */
357
- buyDomains = (request) => this.client.fetch({
358
- body: JSON.stringify(marshalRegistrarApiBuyDomainsRequest(request, this.client.settings)),
359
- headers: jsonContentHeaders,
360
- method: "POST",
361
- path: `/domain/v2beta1/buy-domains`
362
- }, unmarshalOrderResponse);
363
- /**
364
- * Renew domains. Request the renewal of one or more domain names.
365
- *
366
- * @param request - The request {@link RegistrarApiRenewDomainsRequest}
367
- * @returns A Promise of OrderResponse
368
- */
369
- renewDomains = (request) => this.client.fetch({
370
- body: JSON.stringify(marshalRegistrarApiRenewDomainsRequest(request, this.client.settings)),
371
- headers: jsonContentHeaders,
372
- method: "POST",
373
- path: `/domain/v2beta1/renew-domains`
374
- }, unmarshalOrderResponse);
375
- /**
376
- * Transfer a domain. Request the transfer of a domain from another registrar to Scaleway Domains and DNS.
377
- *
378
- * @param request - The request {@link RegistrarApiTransferInDomainRequest}
379
- * @returns A Promise of OrderResponse
380
- */
381
- transferInDomain = (request) => this.client.fetch({
382
- body: JSON.stringify(marshalRegistrarApiTransferInDomainRequest(request, this.client.settings)),
383
- headers: jsonContentHeaders,
384
- method: "POST",
385
- path: `/domain/v2beta1/domains/transfer-domains`
386
- }, unmarshalOrderResponse);
387
- /**
388
- * Trade a domain's contact. Request to change a domain's contact owner.<br/>
389
- 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/>
390
- 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/>
391
- If the new owner has never created a contact to register domains before, an error message displays.
392
- *
393
- * @param request - The request {@link RegistrarApiTradeDomainRequest}
394
- * @returns A Promise of OrderResponse
395
- */
396
- tradeDomain = (request) => this.client.fetch({
397
- body: JSON.stringify(marshalRegistrarApiTradeDomainRequest(request, this.client.settings)),
398
- headers: jsonContentHeaders,
399
- method: "POST",
400
- path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/trade`
401
- }, unmarshalOrderResponse);
402
- /**
403
- * Register an external domain. Request the registration of an external domain name.
404
- *
405
- * @param request - The request {@link RegistrarApiRegisterExternalDomainRequest}
406
- * @returns A Promise of RegisterExternalDomainResponse
407
- */
408
- registerExternalDomain = (request) => this.client.fetch({
409
- body: JSON.stringify(marshalRegistrarApiRegisterExternalDomainRequest(request, this.client.settings)),
410
- headers: jsonContentHeaders,
411
- method: "POST",
412
- path: `/domain/v2beta1/external-domains`
413
- }, unmarshalRegisterExternalDomainResponse);
414
- /**
415
- * Delete an external domain. Delete an external domain name.
416
- *
417
- * @param request - The request {@link RegistrarApiDeleteExternalDomainRequest}
418
- * @returns A Promise of DeleteExternalDomainResponse
419
- */
420
- deleteExternalDomain = (request) => this.client.fetch({
421
- method: "DELETE",
422
- path: `/domain/v2beta1/external-domains/${validatePathParam("domain", request.domain)}`
423
- }, unmarshalDeleteExternalDomainResponse);
424
- /**
425
- * Check if contacts are compatible with a domain or a TLD. Check whether contacts are compatible with a domain or a TLD.
426
- If contacts are not compatible with either the domain or the TLD, the information that needs to be corrected is returned.
427
- *
428
- * @param request - The request {@link RegistrarApiCheckContactsCompatibilityRequest}
429
- * @returns A Promise of CheckContactsCompatibilityResponse
430
- */
431
- checkContactsCompatibility = (request = {}) => this.client.fetch({
432
- body: JSON.stringify(marshalRegistrarApiCheckContactsCompatibilityRequest(request, this.client.settings)),
433
- headers: jsonContentHeaders,
434
- method: "POST",
435
- path: `/domain/v2beta1/check-contacts-compatibility`
436
- }, unmarshalCheckContactsCompatibilityResponse);
437
- pageOfListContacts = (request = {}) => this.client.fetch({
438
- method: "GET",
439
- path: `/domain/v2beta1/contacts`,
440
- 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])
441
- }, unmarshalListContactsResponse);
442
- /**
443
- * List contacts. Retrieve the list of contacts and their associated domains and roles.
444
- You can filter the list by domain name.
445
- *
446
- * @param request - The request {@link RegistrarApiListContactsRequest}
447
- * @returns A Promise of ListContactsResponse
448
- */
449
- listContacts = (request = {}) => enrichForPagination("contacts", this.pageOfListContacts, request);
450
- /**
451
- * Get a contact. Retrieve a contact's details from the registrar using the given contact's ID.
452
- *
453
- * @param request - The request {@link RegistrarApiGetContactRequest}
454
- * @returns A Promise of Contact
455
- */
456
- getContact = (request) => this.client.fetch({
457
- method: "GET",
458
- path: `/domain/v2beta1/contacts/${validatePathParam("contactId", request.contactId)}`
459
- }, unmarshalContact);
460
- /**
461
- * Update contact. Edit the contact's information.
462
- *
463
- * @param request - The request {@link RegistrarApiUpdateContactRequest}
464
- * @returns A Promise of Contact
465
- */
466
- updateContact = (request) => this.client.fetch({
467
- body: JSON.stringify(marshalRegistrarApiUpdateContactRequest(request, this.client.settings)),
468
- headers: jsonContentHeaders,
469
- method: "PATCH",
470
- path: `/domain/v2beta1/contacts/${validatePathParam("contactId", request.contactId)}`
471
- }, unmarshalContact);
472
- pageOfListDomains = (request = {}) => this.client.fetch({
473
- method: "GET",
474
- path: `/domain/v2beta1/domains`,
475
- 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])
476
- }, unmarshalListDomainsResponse);
477
- /**
478
- * List domains. Retrieve the list of domains you own.
479
- *
480
- * @param request - The request {@link RegistrarApiListDomainsRequest}
481
- * @returns A Promise of ListDomainsResponse
482
- */
483
- listDomains = (request = {}) => enrichForPagination("domains", this.pageOfListDomains, request);
484
- pageOfListRenewableDomains = (request = {}) => this.client.fetch({
485
- method: "GET",
486
- path: `/domain/v2beta1/renewable-domains`,
487
- 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])
488
- }, unmarshalListRenewableDomainsResponse);
489
- /**
490
- * 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.
491
- *
492
- * @param request - The request {@link RegistrarApiListRenewableDomainsRequest}
493
- * @returns A Promise of ListRenewableDomainsResponse
494
- */
495
- listRenewableDomains = (request = {}) => enrichForPagination("domains", this.pageOfListRenewableDomains, request);
496
- /**
497
- * Get domain. Retrieve a specific domain and display the domain's information.
498
- *
499
- * @param request - The request {@link RegistrarApiGetDomainRequest}
500
- * @returns A Promise of Domain
501
- */
502
- getDomain = (request) => this.client.fetch({
503
- method: "GET",
504
- path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}`
505
- }, unmarshalDomain);
506
- /**
507
- * Waits for {@link Domain} to be in a final state.
508
- *
509
- * @param request - The request {@link RegistrarApiGetDomainRequest}
510
- * @param options - The waiting options
511
- * @returns A Promise of Domain
512
- */
513
- waitForDomain = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES.includes(res.status))), this.getDomain, request, options);
514
- /**
515
- * Update a domain's contacts. Update contacts for a specific domain or create a new contact.<br/>
516
- 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.
517
- *
518
- * @param request - The request {@link RegistrarApiUpdateDomainRequest}
519
- * @returns A Promise of Domain
520
- */
521
- updateDomain = (request) => this.client.fetch({
522
- body: JSON.stringify(marshalRegistrarApiUpdateDomainRequest(request, this.client.settings)),
523
- headers: jsonContentHeaders,
524
- method: "PATCH",
525
- path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}`
526
- }, unmarshalDomain);
527
- /**
528
- * 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.
529
- *
530
- * @param request - The request {@link RegistrarApiLockDomainTransferRequest}
531
- * @returns A Promise of Domain
532
- */
533
- lockDomainTransfer = (request) => this.client.fetch({
534
- body: "{}",
535
- headers: jsonContentHeaders,
536
- method: "POST",
537
- path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/lock-transfer`
538
- }, unmarshalDomain);
539
- /**
540
- * 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.
541
- *
542
- * @param request - The request {@link RegistrarApiUnlockDomainTransferRequest}
543
- * @returns A Promise of Domain
544
- */
545
- unlockDomainTransfer = (request) => this.client.fetch({
546
- body: "{}",
547
- headers: jsonContentHeaders,
548
- method: "POST",
549
- path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/unlock-transfer`
550
- }, unmarshalDomain);
551
- /**
552
- * Enable auto renew. Enable the `auto renew` feature for a domain. This means the domain will be automatically renewed before its expiry date.
553
- *
554
- * @param request - The request {@link RegistrarApiEnableDomainAutoRenewRequest}
555
- * @returns A Promise of Domain
556
- */
557
- enableDomainAutoRenew = (request) => this.client.fetch({
558
- body: "{}",
559
- headers: jsonContentHeaders,
560
- method: "POST",
561
- path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/enable-auto-renew`
562
- }, unmarshalDomain);
563
- /**
564
- * Disable auto renew. Disable the `auto renew` feature for a domain. This means the domain will not be renewed before its expiry date.
565
- *
566
- * @param request - The request {@link RegistrarApiDisableDomainAutoRenewRequest}
567
- * @returns A Promise of Domain
568
- */
569
- disableDomainAutoRenew = (request) => this.client.fetch({
570
- body: "{}",
571
- headers: jsonContentHeaders,
572
- method: "POST",
573
- path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/disable-auto-renew`
574
- }, unmarshalDomain);
575
- /**
576
- * 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.
577
- Some TLDs may have a different procedure to retrieve the authorization code. In that case, the information displays in the message field.
578
- *
579
- * @param request - The request {@link RegistrarApiGetDomainAuthCodeRequest}
580
- * @returns A Promise of GetDomainAuthCodeResponse
581
- */
582
- getDomainAuthCode = (request) => this.client.fetch({
583
- method: "GET",
584
- path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/auth-code`
585
- }, unmarshalGetDomainAuthCodeResponse);
586
- /**
587
- * 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**.
588
- *
589
- * @param request - The request {@link RegistrarApiEnableDomainDNSSECRequest}
590
- * @returns A Promise of Domain
591
- */
592
- enableDomainDNSSEC = (request) => this.client.fetch({
593
- body: JSON.stringify(marshalRegistrarApiEnableDomainDNSSECRequest(request, this.client.settings)),
594
- headers: jsonContentHeaders,
595
- method: "POST",
596
- path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/enable-dnssec`
597
- }, unmarshalDomain);
598
- /**
599
- * Disable a domain's DNSSEC. Disable DNSSEC for a domain.
600
- *
601
- * @param request - The request {@link RegistrarApiDisableDomainDNSSECRequest}
602
- * @returns A Promise of Domain
603
- */
604
- disableDomainDNSSEC = (request) => this.client.fetch({
605
- body: "{}",
606
- headers: jsonContentHeaders,
607
- method: "POST",
608
- path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/disable-dnssec`
609
- }, unmarshalDomain);
610
- /**
611
- * Search available domains. Search a domain or a maximum of 10 domains that are available.
612
-
613
- If the TLD list is empty or not set, the search returns the results from the most popular TLDs.
614
- *
615
- * @param request - The request {@link RegistrarApiSearchAvailableDomainsRequest}
616
- * @returns A Promise of SearchAvailableDomainsResponse
617
- */
618
- searchAvailableDomains = (request) => this.client.fetch({
619
- method: "GET",
620
- path: `/domain/v2beta1/search-domains`,
621
- urlParams: urlParams(["domains", request.domains], ["include_exact_match", request.includeExactMatch], ["strict_search", request.strictSearch], ["tlds", request.tlds])
622
- }, unmarshalSearchAvailableDomainsResponse);
623
- pageOfListTlds = (request = {}) => this.client.fetch({
624
- method: "GET",
625
- path: `/domain/v2beta1/tlds`,
626
- urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["tlds", request.tlds])
627
- }, unmarshalListTldsResponse);
628
- /**
629
- * List TLD offers. Retrieve the list of TLDs and offers associated with them.
630
- *
631
- * @param request - The request {@link RegistrarApiListTldsRequest}
632
- * @returns A Promise of ListTldsResponse
633
- */
634
- listTlds = (request = {}) => enrichForPagination("tlds", this.pageOfListTlds, request);
635
- /**
636
- * Create a hostname for a domain. Create a hostname for a domain with glue IPs.
637
- *
638
- * @param request - The request {@link RegistrarApiCreateDomainHostRequest}
639
- * @returns A Promise of Host
640
- */
641
- createDomainHost = (request) => this.client.fetch({
642
- body: JSON.stringify(marshalRegistrarApiCreateDomainHostRequest(request, this.client.settings)),
643
- headers: jsonContentHeaders,
644
- method: "POST",
645
- path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/hosts`
646
- }, unmarshalHost);
647
- pageOfListDomainHosts = (request) => this.client.fetch({
648
- method: "GET",
649
- path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/hosts`,
650
- urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
651
- }, unmarshalListDomainHostsResponse);
652
- /**
653
- * List a domain's hostnames. List a domain's hostnames using their glue IPs.
654
- *
655
- * @param request - The request {@link RegistrarApiListDomainHostsRequest}
656
- * @returns A Promise of ListDomainHostsResponse
657
- */
658
- listDomainHosts = (request) => enrichForPagination("hosts", this.pageOfListDomainHosts, request);
659
- /**
660
- * Update a domain's hostname. Update a domain's hostname with glue IPs.
661
- *
662
- * @param request - The request {@link RegistrarApiUpdateDomainHostRequest}
663
- * @returns A Promise of Host
664
- */
665
- updateDomainHost = (request) => this.client.fetch({
666
- body: JSON.stringify(marshalRegistrarApiUpdateDomainHostRequest(request, this.client.settings)),
667
- headers: jsonContentHeaders,
668
- method: "PATCH",
669
- path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/hosts/${validatePathParam("name", request.name)}`
670
- }, unmarshalHost);
671
- /**
672
- * Delete a domain's hostname.
673
- *
674
- * @param request - The request {@link RegistrarApiDeleteDomainHostRequest}
675
- * @returns A Promise of Host
676
- */
677
- deleteDomainHost = (request) => this.client.fetch({
678
- method: "DELETE",
679
- path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/hosts/${validatePathParam("name", request.name)}`
680
- }, unmarshalHost);
153
+ constructor(..._args2) {
154
+ super(..._args2);
155
+ this.pageOfListTasks = (request = {}) => this.client.fetch({
156
+ method: "GET",
157
+ path: `/domain/v2beta1/tasks`,
158
+ 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])
159
+ }, unmarshalListTasksResponse);
160
+ this.listTasks = (request = {}) => enrichForPagination("tasks", this.pageOfListTasks, request);
161
+ this.pageOfListInboundTransfers = (request) => this.client.fetch({
162
+ method: "GET",
163
+ path: `/domain/v2beta1/inbound-transfers`,
164
+ 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])
165
+ }, unmarshalListInboundTransfersResponse);
166
+ this.listInboundTransfers = (request) => enrichForPagination("inboundTransfers", this.pageOfListInboundTransfers, request);
167
+ this.retryInboundTransfer = (request) => this.client.fetch({
168
+ body: JSON.stringify(marshalRegistrarApiRetryInboundTransferRequest(request, this.client.settings)),
169
+ headers: jsonContentHeaders,
170
+ method: "POST",
171
+ path: `/domain/v2beta1/retry-inbound-transfer`
172
+ }, unmarshalRetryInboundTransferResponse);
173
+ this.buyDomains = (request) => this.client.fetch({
174
+ body: JSON.stringify(marshalRegistrarApiBuyDomainsRequest(request, this.client.settings)),
175
+ headers: jsonContentHeaders,
176
+ method: "POST",
177
+ path: `/domain/v2beta1/buy-domains`
178
+ }, unmarshalOrderResponse);
179
+ this.renewDomains = (request) => this.client.fetch({
180
+ body: JSON.stringify(marshalRegistrarApiRenewDomainsRequest(request, this.client.settings)),
181
+ headers: jsonContentHeaders,
182
+ method: "POST",
183
+ path: `/domain/v2beta1/renew-domains`
184
+ }, unmarshalOrderResponse);
185
+ this.transferInDomain = (request) => this.client.fetch({
186
+ body: JSON.stringify(marshalRegistrarApiTransferInDomainRequest(request, this.client.settings)),
187
+ headers: jsonContentHeaders,
188
+ method: "POST",
189
+ path: `/domain/v2beta1/domains/transfer-domains`
190
+ }, unmarshalOrderResponse);
191
+ this.tradeDomain = (request) => this.client.fetch({
192
+ body: JSON.stringify(marshalRegistrarApiTradeDomainRequest(request, this.client.settings)),
193
+ headers: jsonContentHeaders,
194
+ method: "POST",
195
+ path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/trade`
196
+ }, unmarshalOrderResponse);
197
+ this.registerExternalDomain = (request) => this.client.fetch({
198
+ body: JSON.stringify(marshalRegistrarApiRegisterExternalDomainRequest(request, this.client.settings)),
199
+ headers: jsonContentHeaders,
200
+ method: "POST",
201
+ path: `/domain/v2beta1/external-domains`
202
+ }, unmarshalRegisterExternalDomainResponse);
203
+ this.deleteExternalDomain = (request) => this.client.fetch({
204
+ method: "DELETE",
205
+ path: `/domain/v2beta1/external-domains/${validatePathParam("domain", request.domain)}`
206
+ }, unmarshalDeleteExternalDomainResponse);
207
+ this.checkContactsCompatibility = (request = {}) => this.client.fetch({
208
+ body: JSON.stringify(marshalRegistrarApiCheckContactsCompatibilityRequest(request, this.client.settings)),
209
+ headers: jsonContentHeaders,
210
+ method: "POST",
211
+ path: `/domain/v2beta1/check-contacts-compatibility`
212
+ }, unmarshalCheckContactsCompatibilityResponse);
213
+ this.pageOfListContacts = (request = {}) => this.client.fetch({
214
+ method: "GET",
215
+ path: `/domain/v2beta1/contacts`,
216
+ 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])
217
+ }, unmarshalListContactsResponse);
218
+ this.listContacts = (request = {}) => enrichForPagination("contacts", this.pageOfListContacts, request);
219
+ this.getContact = (request) => this.client.fetch({
220
+ method: "GET",
221
+ path: `/domain/v2beta1/contacts/${validatePathParam("contactId", request.contactId)}`
222
+ }, unmarshalContact);
223
+ this.updateContact = (request) => this.client.fetch({
224
+ body: JSON.stringify(marshalRegistrarApiUpdateContactRequest(request, this.client.settings)),
225
+ headers: jsonContentHeaders,
226
+ method: "PATCH",
227
+ path: `/domain/v2beta1/contacts/${validatePathParam("contactId", request.contactId)}`
228
+ }, unmarshalContact);
229
+ this.pageOfListDomains = (request = {}) => this.client.fetch({
230
+ method: "GET",
231
+ path: `/domain/v2beta1/domains`,
232
+ 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])
233
+ }, unmarshalListDomainsResponse);
234
+ this.listDomains = (request = {}) => enrichForPagination("domains", this.pageOfListDomains, request);
235
+ this.pageOfListRenewableDomains = (request = {}) => this.client.fetch({
236
+ method: "GET",
237
+ path: `/domain/v2beta1/renewable-domains`,
238
+ 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])
239
+ }, unmarshalListRenewableDomainsResponse);
240
+ this.listRenewableDomains = (request = {}) => enrichForPagination("domains", this.pageOfListRenewableDomains, request);
241
+ this.getDomain = (request) => this.client.fetch({
242
+ method: "GET",
243
+ path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}`
244
+ }, unmarshalDomain);
245
+ this.waitForDomain = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES.includes(res.status))), this.getDomain, request, options);
246
+ this.updateDomain = (request) => this.client.fetch({
247
+ body: JSON.stringify(marshalRegistrarApiUpdateDomainRequest(request, this.client.settings)),
248
+ headers: jsonContentHeaders,
249
+ method: "PATCH",
250
+ path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}`
251
+ }, unmarshalDomain);
252
+ this.lockDomainTransfer = (request) => this.client.fetch({
253
+ body: "{}",
254
+ headers: jsonContentHeaders,
255
+ method: "POST",
256
+ path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/lock-transfer`
257
+ }, unmarshalDomain);
258
+ this.unlockDomainTransfer = (request) => this.client.fetch({
259
+ body: "{}",
260
+ headers: jsonContentHeaders,
261
+ method: "POST",
262
+ path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/unlock-transfer`
263
+ }, unmarshalDomain);
264
+ this.enableDomainAutoRenew = (request) => this.client.fetch({
265
+ body: "{}",
266
+ headers: jsonContentHeaders,
267
+ method: "POST",
268
+ path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/enable-auto-renew`
269
+ }, unmarshalDomain);
270
+ this.disableDomainAutoRenew = (request) => this.client.fetch({
271
+ body: "{}",
272
+ headers: jsonContentHeaders,
273
+ method: "POST",
274
+ path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/disable-auto-renew`
275
+ }, unmarshalDomain);
276
+ this.getDomainAuthCode = (request) => this.client.fetch({
277
+ method: "GET",
278
+ path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/auth-code`
279
+ }, unmarshalGetDomainAuthCodeResponse);
280
+ this.enableDomainDNSSEC = (request) => this.client.fetch({
281
+ body: JSON.stringify(marshalRegistrarApiEnableDomainDNSSECRequest(request, this.client.settings)),
282
+ headers: jsonContentHeaders,
283
+ method: "POST",
284
+ path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/enable-dnssec`
285
+ }, unmarshalDomain);
286
+ this.disableDomainDNSSEC = (request) => this.client.fetch({
287
+ body: "{}",
288
+ headers: jsonContentHeaders,
289
+ method: "POST",
290
+ path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/disable-dnssec`
291
+ }, unmarshalDomain);
292
+ this.searchAvailableDomains = (request) => this.client.fetch({
293
+ method: "GET",
294
+ path: `/domain/v2beta1/search-domains`,
295
+ urlParams: urlParams(["domains", request.domains], ["include_exact_match", request.includeExactMatch], ["strict_search", request.strictSearch], ["tlds", request.tlds])
296
+ }, unmarshalSearchAvailableDomainsResponse);
297
+ this.pageOfListTlds = (request = {}) => this.client.fetch({
298
+ method: "GET",
299
+ path: `/domain/v2beta1/tlds`,
300
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["tlds", request.tlds])
301
+ }, unmarshalListTldsResponse);
302
+ this.listTlds = (request = {}) => enrichForPagination("tlds", this.pageOfListTlds, request);
303
+ this.createDomainHost = (request) => this.client.fetch({
304
+ body: JSON.stringify(marshalRegistrarApiCreateDomainHostRequest(request, this.client.settings)),
305
+ headers: jsonContentHeaders,
306
+ method: "POST",
307
+ path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/hosts`
308
+ }, unmarshalHost);
309
+ this.pageOfListDomainHosts = (request) => this.client.fetch({
310
+ method: "GET",
311
+ path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/hosts`,
312
+ urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
313
+ }, unmarshalListDomainHostsResponse);
314
+ this.listDomainHosts = (request) => enrichForPagination("hosts", this.pageOfListDomainHosts, request);
315
+ this.updateDomainHost = (request) => this.client.fetch({
316
+ body: JSON.stringify(marshalRegistrarApiUpdateDomainHostRequest(request, this.client.settings)),
317
+ headers: jsonContentHeaders,
318
+ method: "PATCH",
319
+ path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/hosts/${validatePathParam("name", request.name)}`
320
+ }, unmarshalHost);
321
+ this.deleteDomainHost = (request) => this.client.fetch({
322
+ method: "DELETE",
323
+ path: `/domain/v2beta1/domains/${validatePathParam("domain", request.domain)}/hosts/${validatePathParam("name", request.name)}`
324
+ }, unmarshalHost);
325
+ }
681
326
  };
682
327
  /**
683
328
  * Unauthenticated Domain search API.
684
329
  */
685
330
  var UnauthenticatedRegistrarAPI = class extends API$1 {
686
- getServiceInfo = () => this.client.fetch({
687
- method: "GET",
688
- path: `/domain/v2beta1/search`
689
- }, unmarshalServiceInfo);
690
- searchAvailableDomainsConsole = (request) => this.client.fetch({
691
- method: "GET",
692
- path: `/domain/v2beta1/search-domains-console`,
693
- urlParams: urlParams(["domain", request.domain], ["strict_search", request.strictSearch], ["tlds", request.tlds])
694
- }, unmarshalSearchAvailableDomainsConsoleResponse);
331
+ constructor(..._args3) {
332
+ super(..._args3);
333
+ this.getServiceInfo = () => this.client.fetch({
334
+ method: "GET",
335
+ path: `/domain/v2beta1/search`
336
+ }, unmarshalServiceInfo);
337
+ this.searchAvailableDomainsConsole = (request) => this.client.fetch({
338
+ method: "GET",
339
+ path: `/domain/v2beta1/search-domains-console`,
340
+ urlParams: urlParams(["domain", request.domain], ["strict_search", request.strictSearch], ["tlds", request.tlds])
341
+ }, unmarshalSearchAvailableDomainsConsoleResponse);
342
+ }
695
343
  };
696
344
  //#endregion
697
345
  export { API, RegistrarAPI, UnauthenticatedRegistrarAPI };