|
7 | 7 | from scaleway_core.api import API |
8 | 8 | from scaleway_core.bridge import ( |
9 | 9 | ScwFile, |
| 10 | + ServiceInfo, |
10 | 11 | unmarshal_ScwFile, |
| 12 | + unmarshal_ServiceInfo, |
11 | 13 | ) |
12 | 14 | from scaleway_core.utils import ( |
13 | 15 | WaitForOptions, |
|
96 | 98 | RestoreDNSZoneVersionResponse, |
97 | 99 | RetryInboundTransferResponse, |
98 | 100 | SSLCertificate, |
| 101 | + SearchAvailableDomainsConsoleResponse, |
99 | 102 | SearchAvailableDomainsResponse, |
100 | 103 | Task, |
101 | 104 | Tld, |
|
145 | 148 | unmarshal_RegisterExternalDomainResponse, |
146 | 149 | unmarshal_RestoreDNSZoneVersionResponse, |
147 | 150 | unmarshal_RetryInboundTransferResponse, |
| 151 | + unmarshal_SearchAvailableDomainsConsoleResponse, |
148 | 152 | unmarshal_SearchAvailableDomainsResponse, |
149 | 153 | unmarshal_UpdateDNSZoneNameserversResponse, |
150 | 154 | unmarshal_UpdateDNSZoneRecordsResponse, |
@@ -2977,3 +2981,65 @@ async def delete_domain_host( |
2977 | 2981 |
|
2978 | 2982 | self._throw_on_error(res) |
2979 | 2983 | return unmarshal_Host(res.json()) |
| 2984 | + |
| 2985 | + |
| 2986 | +class DomainV2Beta1UnauthenticatedRegistrarAPI(API): |
| 2987 | + """ |
| 2988 | + Unauthenticated Domain search API. |
| 2989 | + """ |
| 2990 | + |
| 2991 | + async def get_service_info( |
| 2992 | + self, |
| 2993 | + ) -> ServiceInfo: |
| 2994 | + """ |
| 2995 | +
|
| 2996 | + :return: :class:`ServiceInfo <ServiceInfo>` |
| 2997 | +
|
| 2998 | + Usage: |
| 2999 | + :: |
| 3000 | +
|
| 3001 | + result = await api.get_service_info() |
| 3002 | + """ |
| 3003 | + |
| 3004 | + res = self._request( |
| 3005 | + "GET", |
| 3006 | + "/domain/v2beta1/search", |
| 3007 | + ) |
| 3008 | + |
| 3009 | + self._throw_on_error(res) |
| 3010 | + return unmarshal_ServiceInfo(res.json()) |
| 3011 | + |
| 3012 | + async def search_available_domains_console( |
| 3013 | + self, |
| 3014 | + *, |
| 3015 | + domain: str, |
| 3016 | + strict_search: bool, |
| 3017 | + tlds: Optional[list[str]] = None, |
| 3018 | + ) -> SearchAvailableDomainsConsoleResponse: |
| 3019 | + """ |
| 3020 | + :param domain: |
| 3021 | + :param strict_search: |
| 3022 | + :param tlds: |
| 3023 | + :return: :class:`SearchAvailableDomainsConsoleResponse <SearchAvailableDomainsConsoleResponse>` |
| 3024 | +
|
| 3025 | + Usage: |
| 3026 | + :: |
| 3027 | +
|
| 3028 | + result = await api.search_available_domains_console( |
| 3029 | + domain="example", |
| 3030 | + strict_search=False, |
| 3031 | + ) |
| 3032 | + """ |
| 3033 | + |
| 3034 | + res = self._request( |
| 3035 | + "GET", |
| 3036 | + "/domain/v2beta1/search-domains-console", |
| 3037 | + params={ |
| 3038 | + "domain": domain, |
| 3039 | + "strict_search": strict_search, |
| 3040 | + "tlds": tlds, |
| 3041 | + }, |
| 3042 | + ) |
| 3043 | + |
| 3044 | + self._throw_on_error(res) |
| 3045 | + return unmarshal_SearchAvailableDomainsConsoleResponse(res.json()) |
0 commit comments