searchDomains method

Future<SearchDomainsResponse> searchDomains(
  1. String location, {
  2. String? query,
  3. String? $fields,
})

Searches for available domain names similar to the provided query.

Availability results from this method are approximate; call RetrieveRegisterParameters on a domain before registering to confirm availability.

Request parameters:

location - Required. The location. Must be in the format projects / * /locations / * . Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+$.

query - Required. String used to search for available domain names.

$fields - Selector specifying which fields to include in a partial response.

Completes with a SearchDomainsResponse.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<SearchDomainsResponse> searchDomains(
  core.String location, {
  core.String? query,
  core.String? $fields,
}) async {
  final _queryParams = <core.String, core.List<core.String>>{
    if (query != null) 'query': [query],
    if ($fields != null) 'fields': [$fields],
  };

  final _url = 'v1beta1/' +
      core.Uri.encodeFull('$location') +
      '/registrations:searchDomains';

  final _response = await _requester.request(
    _url,
    'GET',
    queryParams: _queryParams,
  );
  return SearchDomainsResponse.fromJson(
      _response as core.Map<core.String, core.dynamic>);
}