search method

Future<GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse> search({
  1. String? languageCode,
  2. int? maxAgeDays,
  3. int? offset,
  4. int? pageSize,
  5. String? pageToken,
  6. String? query,
  7. String? reviewPublisherSiteFilter,
  8. String? $fields,
})

Search through fact-checked claims.

Request parameters:

languageCode - The BCP-47 language code, such as "en-US" or "sr-Latn". Can be used to restrict results by language, though we do not currently consider the region.

maxAgeDays - The maximum age of the returned search results, in days. Age is determined by either claim date or review date, whichever is newer.

offset - An integer that specifies the current offset (that is, starting result location) in search results. This field is only considered if page_token is unset. For example, 0 means to return results starting from the first matching result, and 10 means to return from the 11th result.

pageSize - The pagination size. We will return up to that many results. Defaults to 10 if not set.

pageToken - The pagination token. You may provide the next_page_token returned from a previous List request, if any, in order to get the next page. All other fields must have the same values as in the previous request.

query - Textual query string. Required unless review_publisher_site_filter is specified.

reviewPublisherSiteFilter - The review publisher site to filter results by, e.g. nytimes.com.

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

Completes with a GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse.

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<
        GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse>
    search({
  core.String? languageCode,
  core.int? maxAgeDays,
  core.int? offset,
  core.int? pageSize,
  core.String? pageToken,
  core.String? query,
  core.String? reviewPublisherSiteFilter,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (languageCode != null) 'languageCode': [languageCode],
    if (maxAgeDays != null) 'maxAgeDays': ['${maxAgeDays}'],
    if (offset != null) 'offset': ['${offset}'],
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (query != null) 'query': [query],
    if (reviewPublisherSiteFilter != null)
      'reviewPublisherSiteFilter': [reviewPublisherSiteFilter],
    if ($fields != null) 'fields': [$fields],
  };

  const url_ = 'v1alpha1/claims:search';

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