WebRiskServiceV1Beta1Client(
transport=None,
channel=None,
credentials=None,
client_config=None,
client_info=None,
client_options=None,
)
Web Risk v1beta1 API defines an interface to detect malicious URLs on your website and in client applications.
Methods
WebRiskServiceV1Beta1Client
WebRiskServiceV1Beta1Client(
transport=None,
channel=None,
credentials=None,
client_config=None,
client_info=None,
client_options=None,
)
Constructor.
Parameters | |
---|---|
Name | Description |
channel |
grpc.Channel
DEPRECATED. A |
credentials |
google.auth.credentials.Credentials
The authorization credentials to attach to requests. These credentials identify this application to the service. If none are specified, the client will attempt to ascertain the credentials from the environment. This argument is mutually exclusive with providing a transport instance to |
client_config |
dict
DEPRECATED. A dictionary of call options for each method. If not specified, the default configuration is used. |
client_info |
google.api_core.gapic_v1.client_info.ClientInfo
The client info used to send a user-agent string along with API requests. If |
client_options |
Union[dict, google.api_core.client_options.ClientOptions]
Client options used to set user options on the client. API Endpoint should be set through client_options. |
compute_threat_list_diff
compute_threat_list_diff(threat_type, constraints, version_token=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Gets the most recent threat list diffs.
.. rubric:: Example
from google.cloud import webrisk_v1beta1 from google.cloud.webrisk_v1beta1 import enums
client = webrisk_v1beta1.WebRiskServiceV1Beta1Client()
TODO: Initialize
threat_type
:threat_type = enums.ThreatType.THREAT_TYPE_UNSPECIFIED
TODO: Initialize
constraints
:constraints = {}
response = client.compute_threat_list_diff(threat_type, constraints)
Parameters | |
---|---|
Name | Description |
threat_type |
ThreatType
The ThreatList to update. |
constraints |
Union[dict, Constraints]
Required. The constraints associated with this request. If a dict is provided, it must be of the same form as the protobuf message Constraints |
version_token |
bytes
The current version token of the client for the requested list (the client version that was received from the last successful diff). |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
from_service_account_file
from_service_account_file(filename, *args, **kwargs)
Creates an instance of this client using the provided credentials file.
Parameter | |
---|---|
Name | Description |
filename |
str
The path to the service account private key json file. |
Returns | |
---|---|
Type | Description |
WebRiskServiceV1Beta1Client | The constructed client. |
from_service_account_json
from_service_account_json(filename, *args, **kwargs)
Creates an instance of this client using the provided credentials file.
Parameter | |
---|---|
Name | Description |
filename |
str
The path to the service account private key json file. |
Returns | |
---|---|
Type | Description |
WebRiskServiceV1Beta1Client | The constructed client. |
search_hashes
search_hashes(threat_types, hash_prefix=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
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.
.. rubric:: Example
from google.cloud import webrisk_v1beta1 from google.cloud.webrisk_v1beta1 import enums
client = webrisk_v1beta1.WebRiskServiceV1Beta1Client()
TODO: Initialize
threat_types
:threat_types = []
response = client.search_hashes(threat_types)
Parameters | |
---|---|
Name | Description |
threat_types |
list[ThreatType]
Required. The ThreatLists to search in. |
hash_prefix |
bytes
A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 hash. For JSON requests, this field is base64-encoded. |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
search_uris
search_uris(uri, threat_types, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
This method is used to check whether a URI is on a given threatList.
.. rubric:: Example
from google.cloud import webrisk_v1beta1 from google.cloud.webrisk_v1beta1 import enums
client = webrisk_v1beta1.WebRiskServiceV1Beta1Client()
TODO: Initialize
uri
:uri = ''
TODO: Initialize
threat_types
:threat_types = []
response = client.search_uris(uri, threat_types)
Parameters | |
---|---|
Name | Description |
uri |
str
Required. The URI to be checked for matches. |
threat_types |
list[ThreatType]
Required. The ThreatLists to search in. |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |