Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions google/cloud/webrisk_v1/services/web_risk_service/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,26 @@ async def compute_threat_list_diff(
ThreatList databases, this method needs to be called
once for each list.


.. code-block::

from google.cloud import webrisk_v1

def sample_compute_threat_list_diff():
# Create a client
client = webrisk_v1.WebRiskServiceClient()

# Initialize request argument(s)
request = webrisk_v1.ComputeThreatListDiffRequest(
threat_type="UNWANTED_SOFTWARE",
)

# Make the request
response = client.compute_threat_list_diff(request=request)

# Handle the response
print(response)

Args:
request (Union[google.cloud.webrisk_v1.types.ComputeThreatListDiffRequest, dict]):
The request object. Describes an API diff request.
Expand Down Expand Up @@ -326,6 +346,27 @@ async def search_uris(
not found on any of the requested ThreatList an empty
response will be returned.


.. code-block::

from google.cloud import webrisk_v1

def sample_search_uris():
# Create a client
client = webrisk_v1.WebRiskServiceClient()

# Initialize request argument(s)
request = webrisk_v1.SearchUrisRequest(
uri="uri_value",
threat_types="UNWANTED_SOFTWARE",
)

# Make the request
response = client.search_uris(request=request)

# Handle the response
print(response)

Args:
request (Union[google.cloud.webrisk_v1.types.SearchUrisRequest, dict]):
The request object. Request to check URI entries against
Expand Down Expand Up @@ -415,6 +456,26 @@ async def search_hashes(
query this method to determine if there is a full hash
match of a threat.


.. code-block::

from google.cloud import webrisk_v1

def sample_search_hashes():
# Create a client
client = webrisk_v1.WebRiskServiceClient()

# Initialize request argument(s)
request = webrisk_v1.SearchHashesRequest(
threat_types="UNWANTED_SOFTWARE",
)

# Make the request
response = client.search_hashes(request=request)

# Handle the response
print(response)

Args:
request (Union[google.cloud.webrisk_v1.types.SearchHashesRequest, dict]):
The request object. Request to return full hashes
Expand Down Expand Up @@ -508,6 +569,30 @@ async def create_submission(
in the future. Only projects with CREATE_SUBMISSION_USERS
visibility can use this method.


.. code-block::

from google.cloud import webrisk_v1

def sample_create_submission():
# Create a client
client = webrisk_v1.WebRiskServiceClient()

# Initialize request argument(s)
submission = webrisk_v1.Submission()
submission.uri = "uri_value"

request = webrisk_v1.CreateSubmissionRequest(
parent="parent_value",
submission=submission,
)

# Make the request
response = client.create_submission(request=request)

# Handle the response
print(response)

Args:
request (Union[google.cloud.webrisk_v1.types.CreateSubmissionRequest, dict]):
The request object. Request to send a potentially phishy
Expand Down
89 changes: 89 additions & 0 deletions google/cloud/webrisk_v1/services/web_risk_service/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,27 @@ def compute_threat_list_diff(
ThreatList databases, this method needs to be called
once for each list.



.. code-block::

from google.cloud import webrisk_v1

def sample_compute_threat_list_diff():
# Create a client
client = webrisk_v1.WebRiskServiceClient()

# Initialize request argument(s)
request = webrisk_v1.ComputeThreatListDiffRequest(
threat_type="UNWANTED_SOFTWARE",
)

# Make the request
response = client.compute_threat_list_diff(request=request)

# Handle the response
print(response)

Args:
request (Union[google.cloud.webrisk_v1.types.ComputeThreatListDiffRequest, dict]):
The request object. Describes an API diff request.
Expand Down Expand Up @@ -499,6 +520,28 @@ def search_uris(
not found on any of the requested ThreatList an empty
response will be returned.



.. code-block::

from google.cloud import webrisk_v1

def sample_search_uris():
# Create a client
client = webrisk_v1.WebRiskServiceClient()

# Initialize request argument(s)
request = webrisk_v1.SearchUrisRequest(
uri="uri_value",
threat_types="UNWANTED_SOFTWARE",
)

# Make the request
response = client.search_uris(request=request)

# Handle the response
print(response)

Args:
request (Union[google.cloud.webrisk_v1.types.SearchUrisRequest, dict]):
The request object. Request to check URI entries against
Expand Down Expand Up @@ -578,6 +621,27 @@ def search_hashes(
query this method to determine if there is a full hash
match of a threat.



.. code-block::

from google.cloud import webrisk_v1

def sample_search_hashes():
# Create a client
client = webrisk_v1.WebRiskServiceClient()

# Initialize request argument(s)
request = webrisk_v1.SearchHashesRequest(
threat_types="UNWANTED_SOFTWARE",
)

# Make the request
response = client.search_hashes(request=request)

# Handle the response
print(response)

Args:
request (Union[google.cloud.webrisk_v1.types.SearchHashesRequest, dict]):
The request object. Request to return full hashes
Expand Down Expand Up @@ -661,6 +725,31 @@ def create_submission(
in the future. Only projects with CREATE_SUBMISSION_USERS
visibility can use this method.



.. code-block::

from google.cloud import webrisk_v1

def sample_create_submission():
# Create a client
client = webrisk_v1.WebRiskServiceClient()

# Initialize request argument(s)
submission = webrisk_v1.Submission()
submission.uri = "uri_value"

request = webrisk_v1.CreateSubmissionRequest(
parent="parent_value",
submission=submission,
)

# Make the request
response = client.create_submission(request=request)

# Handle the response
print(response)

Args:
request (Union[google.cloud.webrisk_v1.types.CreateSubmissionRequest, dict]):
The request object. Request to send a potentially phishy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,25 @@ async def compute_threat_list_diff(
) -> webrisk.ComputeThreatListDiffResponse:
r"""Gets the most recent threat list diffs.

.. code-block::

from google.cloud import webrisk_v1beta1

def sample_compute_threat_list_diff():
# Create a client
client = webrisk_v1beta1.WebRiskServiceV1Beta1Client()

# Initialize request argument(s)
request = webrisk_v1beta1.ComputeThreatListDiffRequest(
threat_type="UNWANTED_SOFTWARE",
)

# Make the request
response = client.compute_threat_list_diff(request=request)

# Handle the response
print(response)

Args:
request (Union[google.cloud.webrisk_v1beta1.types.ComputeThreatListDiffRequest, dict]):
The request object. Describes an API diff request.
Expand Down Expand Up @@ -310,6 +329,27 @@ async def search_uris(
r"""This method is used to check whether a URI is on a
given threatList.


.. code-block::

from google.cloud import webrisk_v1beta1

def sample_search_uris():
# Create a client
client = webrisk_v1beta1.WebRiskServiceV1Beta1Client()

# Initialize request argument(s)
request = webrisk_v1beta1.SearchUrisRequest(
uri="uri_value",
threat_types="UNWANTED_SOFTWARE",
)

# Make the request
response = client.search_uris(request=request)

# Handle the response
print(response)

Args:
request (Union[google.cloud.webrisk_v1beta1.types.SearchUrisRequest, dict]):
The request object. Request to check URI entries against
Expand Down Expand Up @@ -398,6 +438,26 @@ async def search_hashes(
query this method to determine if there is a full hash
match of a threat.


.. code-block::

from google.cloud import webrisk_v1beta1

def sample_search_hashes():
# Create a client
client = webrisk_v1beta1.WebRiskServiceV1Beta1Client()

# Initialize request argument(s)
request = webrisk_v1beta1.SearchHashesRequest(
threat_types="UNWANTED_SOFTWARE",
)

# Make the request
response = client.search_hashes(request=request)

# Handle the response
print(response)

Args:
request (Union[google.cloud.webrisk_v1beta1.types.SearchHashesRequest, dict]):
The request object. Request to return full hashes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,26 @@ def compute_threat_list_diff(
) -> webrisk.ComputeThreatListDiffResponse:
r"""Gets the most recent threat list diffs.


.. code-block::

from google.cloud import webrisk_v1beta1

def sample_compute_threat_list_diff():
# Create a client
client = webrisk_v1beta1.WebRiskServiceV1Beta1Client()

# Initialize request argument(s)
request = webrisk_v1beta1.ComputeThreatListDiffRequest(
threat_type="UNWANTED_SOFTWARE",
)

# Make the request
response = client.compute_threat_list_diff(request=request)

# Handle the response
print(response)

Args:
request (Union[google.cloud.webrisk_v1beta1.types.ComputeThreatListDiffRequest, dict]):
The request object. Describes an API diff request.
Expand Down Expand Up @@ -482,6 +502,28 @@ def search_uris(
r"""This method is used to check whether a URI is on a
given threatList.



.. code-block::

from google.cloud import webrisk_v1beta1

def sample_search_uris():
# Create a client
client = webrisk_v1beta1.WebRiskServiceV1Beta1Client()

# Initialize request argument(s)
request = webrisk_v1beta1.SearchUrisRequest(
uri="uri_value",
threat_types="UNWANTED_SOFTWARE",
)

# Make the request
response = client.search_uris(request=request)

# Handle the response
print(response)

Args:
request (Union[google.cloud.webrisk_v1beta1.types.SearchUrisRequest, dict]):
The request object. Request to check URI entries against
Expand Down Expand Up @@ -560,6 +602,27 @@ def search_hashes(
query this method to determine if there is a full hash
match of a threat.



.. code-block::

from google.cloud import webrisk_v1beta1

def sample_search_hashes():
# Create a client
client = webrisk_v1beta1.WebRiskServiceV1Beta1Client()

# Initialize request argument(s)
request = webrisk_v1beta1.SearchHashesRequest(
threat_types="UNWANTED_SOFTWARE",
)

# Make the request
response = client.search_hashes(request=request)

# Handle the response
print(response)

Args:
request (Union[google.cloud.webrisk_v1beta1.types.SearchHashesRequest, dict]):
The request object. Request to return full hashes
Expand Down
Loading