Skip to content
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.

Commit

Permalink
docs: add generated code snippets (#418)
Browse files Browse the repository at this point in the history
* docs: enable snippet generation for python-compute (#825)

Source-Link: googleapis/googleapis@8b152e0

Source-Link: googleapis/googleapis-gen@1a80194
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMWE4MDE5NDFlZDZhYzk0YTRkNDk1MjQyZDM5MWYwY2U5OWViZmJlNiJ9

* 🦉 Updates from OwlBot post-processor

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

* chore: Update gapic-generator-python to v1.11.1

PiperOrigin-RevId: 545769621

Source-Link: googleapis/googleapis@cc2f031

Source-Link: googleapis/googleapis-gen@1a46ae7
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMWE0NmFlNzY1MmVmOThhODZjMmJjMjMyYjZkYTA0MTJlOWYzMGJkYiJ9

* 🦉 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>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Jul 6, 2023
1 parent d31398f commit b5c4592
Show file tree
Hide file tree
Showing 789 changed files with 127,048 additions and 0 deletions.
83 changes: 83 additions & 0 deletions google/cloud/compute_v1/services/accelerator_types/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,33 @@ def aggregated_list(
) -> pagers.AggregatedListPager:
r"""Retrieves an aggregated list of accelerator types.
.. code-block:: python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import compute_v1
def sample_aggregated_list():
# Create a client
client = compute_v1.AcceleratorTypesClient()
# Initialize request argument(s)
request = compute_v1.AggregatedListAcceleratorTypesRequest(
project="project_value",
)
# Make the request
page_result = client.aggregated_list(request=request)
# Handle the response
for response in page_result:
print(response)
Args:
request (Union[google.cloud.compute_v1.types.AggregatedListAcceleratorTypesRequest, dict]):
The request object. A request message for
Expand Down Expand Up @@ -522,6 +549,34 @@ def get(
) -> compute.AcceleratorType:
r"""Returns the specified accelerator type.
.. code-block:: python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import compute_v1
def sample_get():
# Create a client
client = compute_v1.AcceleratorTypesClient()
# Initialize request argument(s)
request = compute_v1.GetAcceleratorTypeRequest(
accelerator_type="accelerator_type_value",
project="project_value",
zone="zone_value",
)
# Make the request
response = client.get(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.compute_v1.types.GetAcceleratorTypeRequest, dict]):
The request object. A request message for
Expand Down Expand Up @@ -629,6 +684,34 @@ def list(
r"""Retrieves a list of accelerator types that are
available to the specified project.
.. code-block:: python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import compute_v1
def sample_list():
# Create a client
client = compute_v1.AcceleratorTypesClient()
# Initialize request argument(s)
request = compute_v1.ListAcceleratorTypesRequest(
project="project_value",
zone="zone_value",
)
# Make the request
page_result = client.list(request=request)
# Handle the response
for response in page_result:
print(response)
Args:
request (Union[google.cloud.compute_v1.types.ListAcceleratorTypesRequest, dict]):
The request object. A request message for
Expand Down
Loading

0 comments on commit b5c4592

Please sign in to comment.