Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit 101d3fd

Browse files
docs: add generated snippets (#161)
* chore: use gapic-generator-python 0.63.2 docs: add generated snippets PiperOrigin-RevId: 427792504 Source-Link: googleapis/googleapis@55b9e1e Source-Link: https://github.com/googleapis/googleapis-gen/commit/bf4e86b753f42cb0edb1fd51fbe840d7da0a1cde Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmY0ZTg2Yjc1M2Y0MmNiMGVkYjFmZDUxZmJlODQwZDdkYTBhMWNkZSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 35d62de commit 101d3fd

20 files changed

+1570
-0
lines changed

google/cloud/webrisk_v1/services/web_risk_service/async_client.py

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,26 @@ async def compute_threat_list_diff(
222222
ThreatList databases, this method needs to be called
223223
once for each list.
224224
225+
226+
.. code-block::
227+
228+
from google.cloud import webrisk_v1
229+
230+
def sample_compute_threat_list_diff():
231+
# Create a client
232+
client = webrisk_v1.WebRiskServiceClient()
233+
234+
# Initialize request argument(s)
235+
request = webrisk_v1.ComputeThreatListDiffRequest(
236+
threat_type="UNWANTED_SOFTWARE",
237+
)
238+
239+
# Make the request
240+
response = client.compute_threat_list_diff(request=request)
241+
242+
# Handle the response
243+
print(response)
244+
225245
Args:
226246
request (Union[google.cloud.webrisk_v1.types.ComputeThreatListDiffRequest, dict]):
227247
The request object. Describes an API diff request.
@@ -326,6 +346,27 @@ async def search_uris(
326346
not found on any of the requested ThreatList an empty
327347
response will be returned.
328348
349+
350+
.. code-block::
351+
352+
from google.cloud import webrisk_v1
353+
354+
def sample_search_uris():
355+
# Create a client
356+
client = webrisk_v1.WebRiskServiceClient()
357+
358+
# Initialize request argument(s)
359+
request = webrisk_v1.SearchUrisRequest(
360+
uri="uri_value",
361+
threat_types="UNWANTED_SOFTWARE",
362+
)
363+
364+
# Make the request
365+
response = client.search_uris(request=request)
366+
367+
# Handle the response
368+
print(response)
369+
329370
Args:
330371
request (Union[google.cloud.webrisk_v1.types.SearchUrisRequest, dict]):
331372
The request object. Request to check URI entries against
@@ -415,6 +456,26 @@ async def search_hashes(
415456
query this method to determine if there is a full hash
416457
match of a threat.
417458
459+
460+
.. code-block::
461+
462+
from google.cloud import webrisk_v1
463+
464+
def sample_search_hashes():
465+
# Create a client
466+
client = webrisk_v1.WebRiskServiceClient()
467+
468+
# Initialize request argument(s)
469+
request = webrisk_v1.SearchHashesRequest(
470+
threat_types="UNWANTED_SOFTWARE",
471+
)
472+
473+
# Make the request
474+
response = client.search_hashes(request=request)
475+
476+
# Handle the response
477+
print(response)
478+
418479
Args:
419480
request (Union[google.cloud.webrisk_v1.types.SearchHashesRequest, dict]):
420481
The request object. Request to return full hashes
@@ -508,6 +569,30 @@ async def create_submission(
508569
in the future. Only projects with CREATE_SUBMISSION_USERS
509570
visibility can use this method.
510571
572+
573+
.. code-block::
574+
575+
from google.cloud import webrisk_v1
576+
577+
def sample_create_submission():
578+
# Create a client
579+
client = webrisk_v1.WebRiskServiceClient()
580+
581+
# Initialize request argument(s)
582+
submission = webrisk_v1.Submission()
583+
submission.uri = "uri_value"
584+
585+
request = webrisk_v1.CreateSubmissionRequest(
586+
parent="parent_value",
587+
submission=submission,
588+
)
589+
590+
# Make the request
591+
response = client.create_submission(request=request)
592+
593+
# Handle the response
594+
print(response)
595+
511596
Args:
512597
request (Union[google.cloud.webrisk_v1.types.CreateSubmissionRequest, dict]):
513598
The request object. Request to send a potentially phishy

google/cloud/webrisk_v1/services/web_risk_service/client.py

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,27 @@ def compute_threat_list_diff(
405405
ThreatList databases, this method needs to be called
406406
once for each list.
407407
408+
409+
410+
.. code-block::
411+
412+
from google.cloud import webrisk_v1
413+
414+
def sample_compute_threat_list_diff():
415+
# Create a client
416+
client = webrisk_v1.WebRiskServiceClient()
417+
418+
# Initialize request argument(s)
419+
request = webrisk_v1.ComputeThreatListDiffRequest(
420+
threat_type="UNWANTED_SOFTWARE",
421+
)
422+
423+
# Make the request
424+
response = client.compute_threat_list_diff(request=request)
425+
426+
# Handle the response
427+
print(response)
428+
408429
Args:
409430
request (Union[google.cloud.webrisk_v1.types.ComputeThreatListDiffRequest, dict]):
410431
The request object. Describes an API diff request.
@@ -499,6 +520,28 @@ def search_uris(
499520
not found on any of the requested ThreatList an empty
500521
response will be returned.
501522
523+
524+
525+
.. code-block::
526+
527+
from google.cloud import webrisk_v1
528+
529+
def sample_search_uris():
530+
# Create a client
531+
client = webrisk_v1.WebRiskServiceClient()
532+
533+
# Initialize request argument(s)
534+
request = webrisk_v1.SearchUrisRequest(
535+
uri="uri_value",
536+
threat_types="UNWANTED_SOFTWARE",
537+
)
538+
539+
# Make the request
540+
response = client.search_uris(request=request)
541+
542+
# Handle the response
543+
print(response)
544+
502545
Args:
503546
request (Union[google.cloud.webrisk_v1.types.SearchUrisRequest, dict]):
504547
The request object. Request to check URI entries against
@@ -578,6 +621,27 @@ def search_hashes(
578621
query this method to determine if there is a full hash
579622
match of a threat.
580623
624+
625+
626+
.. code-block::
627+
628+
from google.cloud import webrisk_v1
629+
630+
def sample_search_hashes():
631+
# Create a client
632+
client = webrisk_v1.WebRiskServiceClient()
633+
634+
# Initialize request argument(s)
635+
request = webrisk_v1.SearchHashesRequest(
636+
threat_types="UNWANTED_SOFTWARE",
637+
)
638+
639+
# Make the request
640+
response = client.search_hashes(request=request)
641+
642+
# Handle the response
643+
print(response)
644+
581645
Args:
582646
request (Union[google.cloud.webrisk_v1.types.SearchHashesRequest, dict]):
583647
The request object. Request to return full hashes
@@ -661,6 +725,31 @@ def create_submission(
661725
in the future. Only projects with CREATE_SUBMISSION_USERS
662726
visibility can use this method.
663727
728+
729+
730+
.. code-block::
731+
732+
from google.cloud import webrisk_v1
733+
734+
def sample_create_submission():
735+
# Create a client
736+
client = webrisk_v1.WebRiskServiceClient()
737+
738+
# Initialize request argument(s)
739+
submission = webrisk_v1.Submission()
740+
submission.uri = "uri_value"
741+
742+
request = webrisk_v1.CreateSubmissionRequest(
743+
parent="parent_value",
744+
submission=submission,
745+
)
746+
747+
# Make the request
748+
response = client.create_submission(request=request)
749+
750+
# Handle the response
751+
print(response)
752+
664753
Args:
665754
request (Union[google.cloud.webrisk_v1.types.CreateSubmissionRequest, dict]):
666755
The request object. Request to send a potentially phishy

google/cloud/webrisk_v1beta1/services/web_risk_service_v1_beta1/async_client.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,25 @@ async def compute_threat_list_diff(
218218
) -> webrisk.ComputeThreatListDiffResponse:
219219
r"""Gets the most recent threat list diffs.
220220
221+
.. code-block::
222+
223+
from google.cloud import webrisk_v1beta1
224+
225+
def sample_compute_threat_list_diff():
226+
# Create a client
227+
client = webrisk_v1beta1.WebRiskServiceV1Beta1Client()
228+
229+
# Initialize request argument(s)
230+
request = webrisk_v1beta1.ComputeThreatListDiffRequest(
231+
threat_type="UNWANTED_SOFTWARE",
232+
)
233+
234+
# Make the request
235+
response = client.compute_threat_list_diff(request=request)
236+
237+
# Handle the response
238+
print(response)
239+
221240
Args:
222241
request (Union[google.cloud.webrisk_v1beta1.types.ComputeThreatListDiffRequest, dict]):
223242
The request object. Describes an API diff request.
@@ -310,6 +329,27 @@ async def search_uris(
310329
r"""This method is used to check whether a URI is on a
311330
given threatList.
312331
332+
333+
.. code-block::
334+
335+
from google.cloud import webrisk_v1beta1
336+
337+
def sample_search_uris():
338+
# Create a client
339+
client = webrisk_v1beta1.WebRiskServiceV1Beta1Client()
340+
341+
# Initialize request argument(s)
342+
request = webrisk_v1beta1.SearchUrisRequest(
343+
uri="uri_value",
344+
threat_types="UNWANTED_SOFTWARE",
345+
)
346+
347+
# Make the request
348+
response = client.search_uris(request=request)
349+
350+
# Handle the response
351+
print(response)
352+
313353
Args:
314354
request (Union[google.cloud.webrisk_v1beta1.types.SearchUrisRequest, dict]):
315355
The request object. Request to check URI entries against
@@ -398,6 +438,26 @@ async def search_hashes(
398438
query this method to determine if there is a full hash
399439
match of a threat.
400440
441+
442+
.. code-block::
443+
444+
from google.cloud import webrisk_v1beta1
445+
446+
def sample_search_hashes():
447+
# Create a client
448+
client = webrisk_v1beta1.WebRiskServiceV1Beta1Client()
449+
450+
# Initialize request argument(s)
451+
request = webrisk_v1beta1.SearchHashesRequest(
452+
threat_types="UNWANTED_SOFTWARE",
453+
)
454+
455+
# Make the request
456+
response = client.search_hashes(request=request)
457+
458+
# Handle the response
459+
print(response)
460+
401461
Args:
402462
request (Union[google.cloud.webrisk_v1beta1.types.SearchHashesRequest, dict]):
403463
The request object. Request to return full hashes

google/cloud/webrisk_v1beta1/services/web_risk_service_v1_beta1/client.py

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,26 @@ def compute_threat_list_diff(
400400
) -> webrisk.ComputeThreatListDiffResponse:
401401
r"""Gets the most recent threat list diffs.
402402
403+
404+
.. code-block::
405+
406+
from google.cloud import webrisk_v1beta1
407+
408+
def sample_compute_threat_list_diff():
409+
# Create a client
410+
client = webrisk_v1beta1.WebRiskServiceV1Beta1Client()
411+
412+
# Initialize request argument(s)
413+
request = webrisk_v1beta1.ComputeThreatListDiffRequest(
414+
threat_type="UNWANTED_SOFTWARE",
415+
)
416+
417+
# Make the request
418+
response = client.compute_threat_list_diff(request=request)
419+
420+
# Handle the response
421+
print(response)
422+
403423
Args:
404424
request (Union[google.cloud.webrisk_v1beta1.types.ComputeThreatListDiffRequest, dict]):
405425
The request object. Describes an API diff request.
@@ -482,6 +502,28 @@ def search_uris(
482502
r"""This method is used to check whether a URI is on a
483503
given threatList.
484504
505+
506+
507+
.. code-block::
508+
509+
from google.cloud import webrisk_v1beta1
510+
511+
def sample_search_uris():
512+
# Create a client
513+
client = webrisk_v1beta1.WebRiskServiceV1Beta1Client()
514+
515+
# Initialize request argument(s)
516+
request = webrisk_v1beta1.SearchUrisRequest(
517+
uri="uri_value",
518+
threat_types="UNWANTED_SOFTWARE",
519+
)
520+
521+
# Make the request
522+
response = client.search_uris(request=request)
523+
524+
# Handle the response
525+
print(response)
526+
485527
Args:
486528
request (Union[google.cloud.webrisk_v1beta1.types.SearchUrisRequest, dict]):
487529
The request object. Request to check URI entries against
@@ -560,6 +602,27 @@ def search_hashes(
560602
query this method to determine if there is a full hash
561603
match of a threat.
562604
605+
606+
607+
.. code-block::
608+
609+
from google.cloud import webrisk_v1beta1
610+
611+
def sample_search_hashes():
612+
# Create a client
613+
client = webrisk_v1beta1.WebRiskServiceV1Beta1Client()
614+
615+
# Initialize request argument(s)
616+
request = webrisk_v1beta1.SearchHashesRequest(
617+
threat_types="UNWANTED_SOFTWARE",
618+
)
619+
620+
# Make the request
621+
response = client.search_hashes(request=request)
622+
623+
# Handle the response
624+
print(response)
625+
563626
Args:
564627
request (Union[google.cloud.webrisk_v1beta1.types.SearchHashesRequest, dict]):
565628
The request object. Request to return full hashes

0 commit comments

Comments
 (0)