getDomainSearch method

Future<QuoteList?> getDomainSearch(
  1. String q, {
  2. String? tld,
})

Finds names built from the keyword q, plus the registrar's alternate-TLD suggestions, and answers a quote for each: the name, whether it is purchasable, whether it is premium, the first-term and renewal price in cents, and the TLD.

Finds names built from the keyword q, plus the registrar's alternate-TLD suggestions, and answers a quote for each: the name, whether it is purchasable, whether it is premium, the first-term and renewal price in cents, and the TLD. Prices are RETAIL — this deployment's markup is already applied and the wholesale cost is never on the wire. It requires a validated principal; 403 without one. Nothing is charged and nothing is held — a quote is not a reservation, and the price is re-quoted at purchase, so a name quoted here can be gone or dearer by the time you buy it. A deployment with no registrar credentials answers 503.

Parameters:

  • String q (required): Q is the keyword to build names from. It is required.

  • String tld: TLD narrows the search to a comma-separated set of top-level domains.

Implementation

Future<QuoteList?> getDomainSearch(String q, { String? tld, }) async {
  final response = await getDomainSearchWithHttpInfo(q,  tld: tld, );
  if (response.statusCode >= HttpStatus.badRequest) {
    throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  }
  // When a remote server returns no body with a status of 204, we shall not decode it.
  // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  // FormatException when trying to decode an empty string.
  if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
    return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'QuoteList',) as QuoteList;

  }
  return null;
}