batchGet method
Get multiple hash lists at once.
It is very common for a client to need to get multiple hash lists. Using this method is preferred over using the regular Get method multiple times. This is a standard batch Get method as defined by https://google.aip.dev/231 and the HTTP method is also GET.
Request parameters:
names
- Required. The names of the particular hash lists. The list MAY
be a threat list, or it may be the Global Cache. The names MUST NOT
contain duplicates; if they did, the client will get an error.
sizeConstraints_maxDatabaseEntries
- Sets the maximum number of entries
that the client is willing to have in the local database for the list.
(The server MAY cause the client to store less than this number of
entries.) If omitted or zero, no database size limit is set.
sizeConstraints_maxUpdateEntries
- The maximum size in number of
entries. The update will not contain more entries than this value, but it
is possible that the update will contain fewer entries than this value.
This MUST be at least 1024. If omitted or zero, no update size limit is
set.
version
- The versions of the hash list that the client already has. If
this is the first time the client is fetching the hash lists, the field
should be left empty. Otherwise, the client should supply the versions
previously received from the server. The client MUST NOT manipulate those
bytes. The client need not send the versions in the same order as the
corresponding list names. The client may send fewer or more versions in a
request than there are names. However the client MUST NOT send multiple
versions that correspond to the same name; if it did, the client will get
an error. Historical note: in V4 of the API, this was called states
; it
is now renamed to version
for clarity.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a GoogleSecuritySafebrowsingV5BatchGetHashListsResponse.
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<GoogleSecuritySafebrowsingV5BatchGetHashListsResponse> batchGet({
core.List<core.String>? names,
core.int? sizeConstraints_maxDatabaseEntries,
core.int? sizeConstraints_maxUpdateEntries,
core.List<core.String>? version,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (names != null) 'names': names,
if (sizeConstraints_maxDatabaseEntries != null)
'sizeConstraints.maxDatabaseEntries': [
'${sizeConstraints_maxDatabaseEntries}',
],
if (sizeConstraints_maxUpdateEntries != null)
'sizeConstraints.maxUpdateEntries': [
'${sizeConstraints_maxUpdateEntries}',
],
if (version != null) 'version': version,
if ($fields != null) 'fields': [$fields],
};
const url_ = 'v5/hashLists:batchGet';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return GoogleSecuritySafebrowsingV5BatchGetHashListsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}