Skip to content

Commit

Permalink
docs: add generated snippets (#147)
Browse files Browse the repository at this point in the history
* chore: use gapic-generator-python 0.63.2
docs: add generated snippets

PiperOrigin-RevId: 427792504

Source-Link: googleapis/googleapis@55b9e1e

Source-Link: googleapis/googleapis-gen@bf4e86b
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmY0ZTg2Yjc1M2Y0MmNiMGVkYjFmZDUxZmJlODQwZDdkYTBhMWNkZSJ9

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* chore: use gapic-generator-python 0.63.4

chore: fix snippet region tag format
chore: fix docstring code block formatting
PiperOrigin-RevId: 430730865

Source-Link: googleapis/googleapis@ea58002

Source-Link: googleapis/googleapis-gen@ca893ff
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2E4OTNmZjhhZjI1ZmM3ZmUwMDFkZTE0MDVhNTE3ZDgwNDQ2ZWNjYSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

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>
Co-authored-by: Charles Engelke <github@engelke.com>
  • Loading branch information
3 people authored Feb 26, 2022
1 parent 71fa79f commit ebe951b
Show file tree
Hide file tree
Showing 59 changed files with 4,296 additions and 0 deletions.
267 changes: 267 additions & 0 deletions packages/grafeas/grafeas/grafeas_v1/services/grafeas/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,25 @@ async def get_occurrence(
) -> grafeas.Occurrence:
r"""Gets the specified occurrence.
.. code-block:: python
from grafeas import grafeas_v1
def sample_get_occurrence():
# Create a client
client = grafeas_v1.GrafeasClient()
# Initialize request argument(s)
request = grafeas_v1.GetOccurrenceRequest(
name="name_value",
)
# Make the request
response = client.get_occurrence(request=request)
# Handle the response
print(response)
Args:
request (Union[grafeas.grafeas_v1.types.GetOccurrenceRequest, dict]):
The request object. Request to get an occurrence.
Expand Down Expand Up @@ -231,6 +250,26 @@ async def list_occurrences(
) -> pagers.ListOccurrencesAsyncPager:
r"""Lists occurrences for the specified project.
.. code-block:: python
from grafeas import grafeas_v1
def sample_list_occurrences():
# Create a client
client = grafeas_v1.GrafeasClient()
# Initialize request argument(s)
request = grafeas_v1.ListOccurrencesRequest(
parent="parent_value",
)
# Make the request
page_result = client.list_occurrences(request=request)
# Handle the response
for response in page_result:
print(response)
Args:
request (Union[grafeas.grafeas_v1.types.ListOccurrencesRequest, dict]):
The request object. Request to list occurrences.
Expand Down Expand Up @@ -328,6 +367,23 @@ async def delete_occurrence(
this method to delete an occurrence when the occurrence
is no longer applicable for the given resource.
.. code-block:: python
from grafeas import grafeas_v1
def sample_delete_occurrence():
# Create a client
client = grafeas_v1.GrafeasClient()
# Initialize request argument(s)
request = grafeas_v1.DeleteOccurrenceRequest(
name="name_value",
)
# Make the request
client.delete_occurrence(request=request)
Args:
request (Union[grafeas.grafeas_v1.types.DeleteOccurrenceRequest, dict]):
The request object. Request to delete an occurrence.
Expand Down Expand Up @@ -402,6 +458,25 @@ async def create_occurrence(
) -> grafeas.Occurrence:
r"""Creates a new occurrence.
.. code-block:: python
from grafeas import grafeas_v1
def sample_create_occurrence():
# Create a client
client = grafeas_v1.GrafeasClient()
# Initialize request argument(s)
request = grafeas_v1.CreateOccurrenceRequest(
parent="parent_value",
)
# Make the request
response = client.create_occurrence(request=request)
# Handle the response
print(response)
Args:
request (Union[grafeas.grafeas_v1.types.CreateOccurrenceRequest, dict]):
The request object. Request to create a new occurrence.
Expand Down Expand Up @@ -481,6 +556,25 @@ async def batch_create_occurrences(
) -> grafeas.BatchCreateOccurrencesResponse:
r"""Creates new occurrences in batch.
.. code-block:: python
from grafeas import grafeas_v1
def sample_batch_create_occurrences():
# Create a client
client = grafeas_v1.GrafeasClient()
# Initialize request argument(s)
request = grafeas_v1.BatchCreateOccurrencesRequest(
parent="parent_value",
)
# Make the request
response = client.batch_create_occurrences(request=request)
# Handle the response
print(response)
Args:
request (Union[grafeas.grafeas_v1.types.BatchCreateOccurrencesRequest, dict]):
The request object. Request to create occurrences in
Expand Down Expand Up @@ -564,6 +658,25 @@ async def update_occurrence(
) -> grafeas.Occurrence:
r"""Updates the specified occurrence.
.. code-block:: python
from grafeas import grafeas_v1
def sample_update_occurrence():
# Create a client
client = grafeas_v1.GrafeasClient()
# Initialize request argument(s)
request = grafeas_v1.UpdateOccurrenceRequest(
name="name_value",
)
# Make the request
response = client.update_occurrence(request=request)
# Handle the response
print(response)
Args:
request (Union[grafeas.grafeas_v1.types.UpdateOccurrenceRequest, dict]):
The request object. Request to update an occurrence.
Expand Down Expand Up @@ -650,6 +763,26 @@ async def get_occurrence_note(
Consumer projects can use this method to get a note that
belongs to a provider project.
.. code-block:: python
from grafeas import grafeas_v1
def sample_get_occurrence_note():
# Create a client
client = grafeas_v1.GrafeasClient()
# Initialize request argument(s)
request = grafeas_v1.GetOccurrenceNoteRequest(
name="name_value",
)
# Make the request
response = client.get_occurrence_note(request=request)
# Handle the response
print(response)
Args:
request (Union[grafeas.grafeas_v1.types.GetOccurrenceNoteRequest, dict]):
The request object. Request to get the note to which the
Expand Down Expand Up @@ -731,6 +864,25 @@ async def get_note(
) -> grafeas.Note:
r"""Gets the specified note.
.. code-block:: python
from grafeas import grafeas_v1
def sample_get_note():
# Create a client
client = grafeas_v1.GrafeasClient()
# Initialize request argument(s)
request = grafeas_v1.GetNoteRequest(
name="name_value",
)
# Make the request
response = client.get_note(request=request)
# Handle the response
print(response)
Args:
request (Union[grafeas.grafeas_v1.types.GetNoteRequest, dict]):
The request object. Request to get a note.
Expand Down Expand Up @@ -812,6 +964,26 @@ async def list_notes(
) -> pagers.ListNotesAsyncPager:
r"""Lists notes for the specified project.
.. code-block:: python
from grafeas import grafeas_v1
def sample_list_notes():
# Create a client
client = grafeas_v1.GrafeasClient()
# Initialize request argument(s)
request = grafeas_v1.ListNotesRequest(
parent="parent_value",
)
# Make the request
page_result = client.list_notes(request=request)
# Handle the response
for response in page_result:
print(response)
Args:
request (Union[grafeas.grafeas_v1.types.ListNotesRequest, dict]):
The request object. Request to list notes.
Expand Down Expand Up @@ -907,6 +1079,22 @@ async def delete_note(
) -> None:
r"""Deletes the specified note.
.. code-block:: python
from grafeas import grafeas_v1
def sample_delete_note():
# Create a client
client = grafeas_v1.GrafeasClient()
# Initialize request argument(s)
request = grafeas_v1.DeleteNoteRequest(
name="name_value",
)
# Make the request
client.delete_note(request=request)
Args:
request (Union[grafeas.grafeas_v1.types.DeleteNoteRequest, dict]):
The request object. Request to delete a note.
Expand Down Expand Up @@ -982,6 +1170,26 @@ async def create_note(
) -> grafeas.Note:
r"""Creates a new note.
.. code-block:: python
from grafeas import grafeas_v1
def sample_create_note():
# Create a client
client = grafeas_v1.GrafeasClient()
# Initialize request argument(s)
request = grafeas_v1.CreateNoteRequest(
parent="parent_value",
note_id="note_id_value",
)
# Make the request
response = client.create_note(request=request)
# Handle the response
print(response)
Args:
request (Union[grafeas.grafeas_v1.types.CreateNoteRequest, dict]):
The request object. Request to create a new note.
Expand Down Expand Up @@ -1068,6 +1276,25 @@ async def batch_create_notes(
) -> grafeas.BatchCreateNotesResponse:
r"""Creates new notes in batch.
.. code-block:: python
from grafeas import grafeas_v1
def sample_batch_create_notes():
# Create a client
client = grafeas_v1.GrafeasClient()
# Initialize request argument(s)
request = grafeas_v1.BatchCreateNotesRequest(
parent="parent_value",
)
# Make the request
response = client.batch_create_notes(request=request)
# Handle the response
print(response)
Args:
request (Union[grafeas.grafeas_v1.types.BatchCreateNotesRequest, dict]):
The request object. Request to create notes in batch.
Expand Down Expand Up @@ -1149,6 +1376,25 @@ async def update_note(
) -> grafeas.Note:
r"""Updates the specified note.
.. code-block:: python
from grafeas import grafeas_v1
def sample_update_note():
# Create a client
client = grafeas_v1.GrafeasClient()
# Initialize request argument(s)
request = grafeas_v1.UpdateNoteRequest(
name="name_value",
)
# Make the request
response = client.update_note(request=request)
# Handle the response
print(response)
Args:
request (Union[grafeas.grafeas_v1.types.UpdateNoteRequest, dict]):
The request object. Request to update a note.
Expand Down Expand Up @@ -1237,6 +1483,27 @@ async def list_note_occurrences(
occurrences across consumer projects referencing the
specified note.
.. code-block:: python
from grafeas import grafeas_v1
def sample_list_note_occurrences():
# Create a client
client = grafeas_v1.GrafeasClient()
# Initialize request argument(s)
request = grafeas_v1.ListNoteOccurrencesRequest(
name="name_value",
)
# Make the request
page_result = client.list_note_occurrences(request=request)
# Handle the response
for response in page_result:
print(response)
Args:
request (Union[grafeas.grafeas_v1.types.ListNoteOccurrencesRequest, dict]):
The request object. Request to list occurrences for a
Expand Down
Loading

0 comments on commit ebe951b

Please sign in to comment.