search method
This method is used to check whether a URI is on a given threatList.
Multiple threatLists may be searched in a single query. The response will list all requested threatLists the URI was found to match. If the URI is not found on any of the requested ThreatList an empty response will be returned.
Request parameters:
threatTypes
- Required. The ThreatLists to search in. Multiple
ThreatLists may be specified.
uri
- Required. The URI to be checked for matches.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a GoogleCloudWebriskV1SearchUrisResponse.
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<GoogleCloudWebriskV1SearchUrisResponse> search({
core.List<core.String>? threatTypes,
core.String? uri,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (threatTypes != null) 'threatTypes': threatTypes,
if (uri != null) 'uri': [uri],
if ($fields != null) 'fields': [$fields],
};
const url_ = 'v1/uris:search';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return GoogleCloudWebriskV1SearchUrisResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}