@scaleway/sdk 2.0.0-alpha.13 → 2.0.0-alpha.14

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