Skip to content

Commit ef27b2a

Browse files
authored
feat(domain): add unauthenticated_registrar_api yaml (scaleway#2648)
1 parent 184f780 commit ef27b2a

File tree

4 files changed

+66
-1
lines changed

4 files changed

+66
-1
lines changed

packages_generated/domain/src/v2beta1/api.gen.ts

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
import {
44
API as ParentAPI,
55
enrichForPagination,
6+
unmarshalServiceInfo,
67
urlParams,
78
validatePathParam,
89
waitForResource,
910
} from '@scaleway/sdk-client'
10-
import type { WaitForOptions, } from '@scaleway/sdk-client'
11+
import type { ServiceInfo, WaitForOptions, } from '@scaleway/sdk-client'
1112
import {DOMAIN_TRANSIENT_STATUSES as DOMAIN_TRANSIENT_STATUSES_DOMAIN,SSL_CERTIFICATE_TRANSIENT_STATUSES as SSL_CERTIFICATE_TRANSIENT_STATUSES_DOMAIN,} from './content.gen.js'
1213
import {
1314
unmarshalCheckContactsCompatibilityResponse,
@@ -61,6 +62,7 @@ import {
6162
unmarshalRestoreDNSZoneVersionResponse,
6263
unmarshalRetryInboundTransferResponse,
6364
unmarshalSSLCertificate,
65+
unmarshalSearchAvailableDomainsConsoleResponse,
6466
unmarshalSearchAvailableDomainsResponse,
6567
marshalUpdateDNSZoneNameserversRequest,
6668
unmarshalUpdateDNSZoneNameserversResponse,
@@ -153,7 +155,9 @@ import type {
153155
RestoreDNSZoneVersionResponse,
154156
RetryInboundTransferResponse,
155157
SSLCertificate,
158+
SearchAvailableDomainsConsoleResponse,
156159
SearchAvailableDomainsResponse,
160+
UnauthenticatedRegistrarApiSearchAvailableDomainsConsoleRequest,
157161
UpdateDNSZoneNameserversRequest,
158162
UpdateDNSZoneNameserversResponse,
159163
UpdateDNSZoneRecordsRequest,
@@ -1341,3 +1345,34 @@ If the TLD list is empty or not set, the search returns the results from the mos
13411345

13421346
}
13431347

1348+
/**
1349+
* Unauthenticated Domain search API.
1350+
*/
1351+
export class UnauthenticatedRegistrarAPI extends ParentAPI {
1352+
getServiceInfo = () =>
1353+
this.client.fetch<ServiceInfo>(
1354+
{
1355+
method: 'GET',
1356+
path: `/domain/v2beta1/search`,
1357+
},
1358+
unmarshalServiceInfo,
1359+
)
1360+
1361+
1362+
searchAvailableDomainsConsole = (request: Readonly<UnauthenticatedRegistrarApiSearchAvailableDomainsConsoleRequest>) =>
1363+
this.client.fetch<SearchAvailableDomainsConsoleResponse>(
1364+
{
1365+
method: 'GET',
1366+
path: `/domain/v2beta1/search-domains-console`,
1367+
urlParams: urlParams(
1368+
['domain', request.domain],
1369+
['strict_search', request.strictSearch],
1370+
['tlds', request.tlds],
1371+
),
1372+
},
1373+
unmarshalSearchAvailableDomainsConsoleResponse,
1374+
)
1375+
1376+
1377+
}
1378+

packages_generated/domain/src/v2beta1/index.gen.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
export {
44
API,
55
RegistrarAPI,
6+
UnauthenticatedRegistrarAPI,
67
} from './api.gen.js'
78
export * from './content.gen.js'
89
export * from './marshalling.gen.js'
@@ -160,13 +161,15 @@ export type {
160161
RetryInboundTransferResponse,
161162
SSLCertificate,
162163
SSLCertificateStatus,
164+
SearchAvailableDomainsConsoleResponse,
163165
SearchAvailableDomainsResponse,
164166
Task,
165167
TaskStatus,
166168
TaskType,
167169
Tld,
168170
TldOffer,
169171
TransferInDomainRequestTransferRequest,
172+
UnauthenticatedRegistrarApiSearchAvailableDomainsConsoleRequest,
170173
UpdateContactRequestQuestion,
171174
UpdateDNSZoneNameserversRequest,
172175
UpdateDNSZoneNameserversResponse,

packages_generated/domain/src/v2beta1/marshalling.gen.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ import type {
7676
RestoreDNSZoneVersionResponse,
7777
RetryInboundTransferResponse,
7878
AvailableDomain,
79+
SearchAvailableDomainsConsoleResponse,
7980
SearchAvailableDomainsResponse,
8081
UpdateDNSZoneNameserversResponse,
8182
UpdateDNSZoneRecordsResponse,
@@ -1177,6 +1178,19 @@ const unmarshalAvailableDomain = (data: unknown): AvailableDomain => {
11771178
} as AvailableDomain
11781179
}
11791180

1181+
export const unmarshalSearchAvailableDomainsConsoleResponse = (data: unknown): SearchAvailableDomainsConsoleResponse => {
1182+
if (!isJSONObject(data)) {
1183+
throw new TypeError(
1184+
`Unmarshalling the type 'SearchAvailableDomainsConsoleResponse' failed as data isn't a dictionary.`,
1185+
)
1186+
}
1187+
1188+
return {
1189+
availableDomains: unmarshalArrayOfObject(data.available_domains, unmarshalAvailableDomain),
1190+
exactMatchDomain: data.exact_match_domain ? unmarshalAvailableDomain(data.exact_match_domain) : undefined,
1191+
} as SearchAvailableDomainsConsoleResponse
1192+
}
1193+
11801194
export const unmarshalSearchAvailableDomainsResponse = (data: unknown): SearchAvailableDomainsResponse => {
11811195
if (!isJSONObject(data)) {
11821196
throw new TypeError(

packages_generated/domain/src/v2beta1/types.gen.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,6 +1775,12 @@ export interface RetryInboundTransferResponse {
17751775
}
17761776

17771777

1778+
export interface SearchAvailableDomainsConsoleResponse {
1779+
exactMatchDomain?: AvailableDomain
1780+
availableDomains: AvailableDomain[]
1781+
}
1782+
1783+
17781784
export interface SearchAvailableDomainsResponse {
17791785
/**
17801786
* Array of available domains.
@@ -1783,6 +1789,13 @@ export interface SearchAvailableDomainsResponse {
17831789
}
17841790

17851791

1792+
export type UnauthenticatedRegistrarApiSearchAvailableDomainsConsoleRequest = {
1793+
domain: string
1794+
tlds?: string[]
1795+
strictSearch: boolean
1796+
}
1797+
1798+
17861799
export type UpdateDNSZoneNameserversRequest = {
17871800
/**
17881801
* DNS zone in which to update the DNS zone name servers.

0 commit comments

Comments
 (0)