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_ = 'v1/' +
      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>);
}