search method

Future<GoogleCloudWebriskV1SearchHashesResponse> search({
  1. String? hashPrefix,
  2. List<String>? threatTypes,
  3. String? $fields,
})

Gets the full hashes that match the requested hash prefix.

This is used after a hash prefix is looked up in a threatList and there is a match. The client side threatList only holds partial hashes so the client must query this method to determine if there is a full hash match of a threat.

Request parameters:

hashPrefix - A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 hash. For JSON requests, this field is base64-encoded. Note that if this parameter is provided by a URI, it must be encoded using the web safe base64 variant (RFC 4648).

threatTypes - Required. The ThreatLists to search in. Multiple ThreatLists may be specified.

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

Completes with a GoogleCloudWebriskV1SearchHashesResponse.

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

  const url_ = 'v1/hashes:search';

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