search method

Future<SearchChainsResponse> search({
  1. String? chainName,
  2. int? pageSize,
  3. String? $fields,
})

Searches the chain based on chain name.

Request parameters:

chainName - Required. Search for a chain by its name. Exact/partial/fuzzy/related queries are supported. Examples: "walmart", "wal-mart", "walmmmart", "沃尔玛"

pageSize - The maximum number of matched chains to return from this query. The default is 10. The maximum possible value is 500.

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

Completes with a SearchChainsResponse.

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<SearchChainsResponse> search({
  core.String? chainName,
  core.int? pageSize,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (chainName != null) 'chainName': [chainName],
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if ($fields != null) 'fields': [$fields],
  };

  const url_ = 'v1/chains:search';

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return SearchChainsResponse.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}