Skip to content
This repository has been archived by the owner on Jan 17, 2024. It is now read-only.

Commit

Permalink
docs: add generated snippets (#151)
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

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 Feb 11, 2022
1 parent 5a484df commit cfd3240
Show file tree
Hide file tree
Showing 2 changed files with 215 additions and 0 deletions.
Expand Up @@ -226,6 +226,30 @@ async def create_dashboard(
permissions, see `Cloud Identity and Access
Management <https://cloud.google.com/iam>`__.
.. code-block::
from google.monitoring import dashboard_v1
def sample_create_dashboard():
# Create a client
client = dashboard_v1.DashboardsServiceClient()
# Initialize request argument(s)
dashboard = dashboard_v1.Dashboard()
dashboard.display_name = "display_name_value"
request = dashboard_v1.CreateDashboardRequest(
parent="parent_value",
dashboard=dashboard,
)
# Make the request
response = client.create_dashboard(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.monitoring_dashboard_v1.types.CreateDashboardRequest, dict]):
The request object. The `CreateDashboard` request.
Expand Down Expand Up @@ -281,6 +305,27 @@ async def list_dashboards(
`Cloud Identity and Access
Management <https://cloud.google.com/iam>`__.
.. code-block::
from google.monitoring import dashboard_v1
def sample_list_dashboards():
# Create a client
client = dashboard_v1.DashboardsServiceClient()
# Initialize request argument(s)
request = dashboard_v1.ListDashboardsRequest(
parent="parent_value",
)
# Make the request
page_result = client.list_dashboards(request=request)
# Handle the response
for response in page_result:
print(response)
Args:
request (Union[google.cloud.monitoring_dashboard_v1.types.ListDashboardsRequest, dict]):
The request object. The `ListDashboards` request.
Expand Down Expand Up @@ -342,6 +387,26 @@ async def get_dashboard(
`Cloud Identity and Access
Management <https://cloud.google.com/iam>`__.
.. code-block::
from google.monitoring import dashboard_v1
def sample_get_dashboard():
# Create a client
client = dashboard_v1.DashboardsServiceClient()
# Initialize request argument(s)
request = dashboard_v1.GetDashboardRequest(
name="name_value",
)
# Make the request
response = client.get_dashboard(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.monitoring_dashboard_v1.types.GetDashboardRequest, dict]):
The request object. The `GetDashboard` request.
Expand Down Expand Up @@ -397,6 +462,23 @@ async def delete_dashboard(
`Cloud Identity and Access
Management <https://cloud.google.com/iam>`__.
.. code-block::
from google.monitoring import dashboard_v1
def sample_delete_dashboard():
# Create a client
client = dashboard_v1.DashboardsServiceClient()
# Initialize request argument(s)
request = dashboard_v1.DeleteDashboardRequest(
name="name_value",
)
# Make the request
client.delete_dashboard(request=request)
Args:
request (Union[google.cloud.monitoring_dashboard_v1.types.DeleteDashboardRequest, dict]):
The request object. The `DeleteDashboard` request.
Expand Down Expand Up @@ -443,6 +525,29 @@ async def update_dashboard(
`Cloud Identity and Access
Management <https://cloud.google.com/iam>`__.
.. code-block::
from google.monitoring import dashboard_v1
def sample_update_dashboard():
# Create a client
client = dashboard_v1.DashboardsServiceClient()
# Initialize request argument(s)
dashboard = dashboard_v1.Dashboard()
dashboard.display_name = "display_name_value"
request = dashboard_v1.UpdateDashboardRequest(
dashboard=dashboard,
)
# Make the request
response = client.update_dashboard(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.monitoring_dashboard_v1.types.UpdateDashboardRequest, dict]):
The request object. The `UpdateDashboard` request.
Expand Down
Expand Up @@ -433,6 +433,31 @@ def create_dashboard(
permissions, see `Cloud Identity and Access
Management <https://cloud.google.com/iam>`__.
.. code-block::
from google.monitoring import dashboard_v1
def sample_create_dashboard():
# Create a client
client = dashboard_v1.DashboardsServiceClient()
# Initialize request argument(s)
dashboard = dashboard_v1.Dashboard()
dashboard.display_name = "display_name_value"
request = dashboard_v1.CreateDashboardRequest(
parent="parent_value",
dashboard=dashboard,
)
# Make the request
response = client.create_dashboard(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.monitoring_dashboard_v1.types.CreateDashboardRequest, dict]):
The request object. The `CreateDashboard` request.
Expand Down Expand Up @@ -489,6 +514,28 @@ def list_dashboards(
`Cloud Identity and Access
Management <https://cloud.google.com/iam>`__.
.. code-block::
from google.monitoring import dashboard_v1
def sample_list_dashboards():
# Create a client
client = dashboard_v1.DashboardsServiceClient()
# Initialize request argument(s)
request = dashboard_v1.ListDashboardsRequest(
parent="parent_value",
)
# Make the request
page_result = client.list_dashboards(request=request)
# Handle the response
for response in page_result:
print(response)
Args:
request (Union[google.cloud.monitoring_dashboard_v1.types.ListDashboardsRequest, dict]):
The request object. The `ListDashboards` request.
Expand Down Expand Up @@ -551,6 +598,27 @@ def get_dashboard(
`Cloud Identity and Access
Management <https://cloud.google.com/iam>`__.
.. code-block::
from google.monitoring import dashboard_v1
def sample_get_dashboard():
# Create a client
client = dashboard_v1.DashboardsServiceClient()
# Initialize request argument(s)
request = dashboard_v1.GetDashboardRequest(
name="name_value",
)
# Make the request
response = client.get_dashboard(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.monitoring_dashboard_v1.types.GetDashboardRequest, dict]):
The request object. The `GetDashboard` request.
Expand Down Expand Up @@ -607,6 +675,24 @@ def delete_dashboard(
`Cloud Identity and Access
Management <https://cloud.google.com/iam>`__.
.. code-block::
from google.monitoring import dashboard_v1
def sample_delete_dashboard():
# Create a client
client = dashboard_v1.DashboardsServiceClient()
# Initialize request argument(s)
request = dashboard_v1.DeleteDashboardRequest(
name="name_value",
)
# Make the request
client.delete_dashboard(request=request)
Args:
request (Union[google.cloud.monitoring_dashboard_v1.types.DeleteDashboardRequest, dict]):
The request object. The `DeleteDashboard` request.
Expand Down Expand Up @@ -654,6 +740,30 @@ def update_dashboard(
`Cloud Identity and Access
Management <https://cloud.google.com/iam>`__.
.. code-block::
from google.monitoring import dashboard_v1
def sample_update_dashboard():
# Create a client
client = dashboard_v1.DashboardsServiceClient()
# Initialize request argument(s)
dashboard = dashboard_v1.Dashboard()
dashboard.display_name = "display_name_value"
request = dashboard_v1.UpdateDashboardRequest(
dashboard=dashboard,
)
# Make the request
response = client.update_dashboard(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.monitoring_dashboard_v1.types.UpdateDashboardRequest, dict]):
The request object. The `UpdateDashboard` request.
Expand Down

0 comments on commit cfd3240

Please sign in to comment.