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

Commit

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

* 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: https://github.com/googleapis/googleapis-gen/commit/ca893ff8af25fc7fe001de1405a517d80446ecca
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: Anthonios Partheniou <[email protected]>
  • Loading branch information
3 people authored Feb 26, 2022
1 parent 9acb791 commit a84c252
Show file tree
Hide file tree
Showing 63 changed files with 4,635 additions and 0 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Generated code. DO NOT EDIT!
#
# Snippet for AccessSecretVersion
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
# python3 -m pip install google-cloud-secretmanager


# [START secretmanager_generated_secretmanager_v1_SecretManagerService_AccessSecretVersion_async]
from google.cloud import secretmanager_v1


async def sample_access_secret_version():
# Create a client
client = secretmanager_v1.SecretManagerServiceAsyncClient()

# Initialize request argument(s)
request = secretmanager_v1.AccessSecretVersionRequest(
name="name_value",
)

# Make the request
response = await client.access_secret_version(request=request)

# Handle the response
print(response)

# [END secretmanager_generated_secretmanager_v1_SecretManagerService_AccessSecretVersion_async]
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Generated code. DO NOT EDIT!
#
# Snippet for AccessSecretVersion
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
# python3 -m pip install google-cloud-secretmanager


# [START secretmanager_generated_secretmanager_v1_SecretManagerService_AccessSecretVersion_sync]
from google.cloud import secretmanager_v1


def sample_access_secret_version():
# Create a client
client = secretmanager_v1.SecretManagerServiceClient()

# Initialize request argument(s)
request = secretmanager_v1.AccessSecretVersionRequest(
name="name_value",
)

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

# Handle the response
print(response)

# [END secretmanager_generated_secretmanager_v1_SecretManagerService_AccessSecretVersion_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Generated code. DO NOT EDIT!
#
# Snippet for AddSecretVersion
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
# python3 -m pip install google-cloud-secretmanager


# [START secretmanager_generated_secretmanager_v1_SecretManagerService_AddSecretVersion_async]
from google.cloud import secretmanager_v1


async def sample_add_secret_version():
# Create a client
client = secretmanager_v1.SecretManagerServiceAsyncClient()

# Initialize request argument(s)
request = secretmanager_v1.AddSecretVersionRequest(
parent="parent_value",
)

# Make the request
response = await client.add_secret_version(request=request)

# Handle the response
print(response)

# [END secretmanager_generated_secretmanager_v1_SecretManagerService_AddSecretVersion_async]
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Generated code. DO NOT EDIT!
#
# Snippet for AddSecretVersion
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
# python3 -m pip install google-cloud-secretmanager


# [START secretmanager_generated_secretmanager_v1_SecretManagerService_AddSecretVersion_sync]
from google.cloud import secretmanager_v1


def sample_add_secret_version():
# Create a client
client = secretmanager_v1.SecretManagerServiceClient()

# Initialize request argument(s)
request = secretmanager_v1.AddSecretVersionRequest(
parent="parent_value",
)

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

# Handle the response
print(response)

# [END secretmanager_generated_secretmanager_v1_SecretManagerService_AddSecretVersion_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Generated code. DO NOT EDIT!
#
# Snippet for CreateSecret
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
# python3 -m pip install google-cloud-secretmanager


# [START secretmanager_generated_secretmanager_v1_SecretManagerService_CreateSecret_async]
from google.cloud import secretmanager_v1


async def sample_create_secret():
# Create a client
client = secretmanager_v1.SecretManagerServiceAsyncClient()

# Initialize request argument(s)
request = secretmanager_v1.CreateSecretRequest(
parent="parent_value",
secret_id="secret_id_value",
)

# Make the request
response = await client.create_secret(request=request)

# Handle the response
print(response)

# [END secretmanager_generated_secretmanager_v1_SecretManagerService_CreateSecret_async]
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Generated code. DO NOT EDIT!
#
# Snippet for CreateSecret
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
# python3 -m pip install google-cloud-secretmanager


# [START secretmanager_generated_secretmanager_v1_SecretManagerService_CreateSecret_sync]
from google.cloud import secretmanager_v1


def sample_create_secret():
# Create a client
client = secretmanager_v1.SecretManagerServiceClient()

# Initialize request argument(s)
request = secretmanager_v1.CreateSecretRequest(
parent="parent_value",
secret_id="secret_id_value",
)

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

# Handle the response
print(response)

# [END secretmanager_generated_secretmanager_v1_SecretManagerService_CreateSecret_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Generated code. DO NOT EDIT!
#
# Snippet for DeleteSecret
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
# python3 -m pip install google-cloud-secretmanager


# [START secretmanager_generated_secretmanager_v1_SecretManagerService_DeleteSecret_async]
from google.cloud import secretmanager_v1


async def sample_delete_secret():
# Create a client
client = secretmanager_v1.SecretManagerServiceAsyncClient()

# Initialize request argument(s)
request = secretmanager_v1.DeleteSecretRequest(
name="name_value",
)

# Make the request
await client.delete_secret(request=request)


# [END secretmanager_generated_secretmanager_v1_SecretManagerService_DeleteSecret_async]
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Generated code. DO NOT EDIT!
#
# Snippet for DeleteSecret
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
# python3 -m pip install google-cloud-secretmanager


# [START secretmanager_generated_secretmanager_v1_SecretManagerService_DeleteSecret_sync]
from google.cloud import secretmanager_v1


def sample_delete_secret():
# Create a client
client = secretmanager_v1.SecretManagerServiceClient()

# Initialize request argument(s)
request = secretmanager_v1.DeleteSecretRequest(
name="name_value",
)

# Make the request
client.delete_secret(request=request)


# [END secretmanager_generated_secretmanager_v1_SecretManagerService_DeleteSecret_sync]
Loading

0 comments on commit a84c252

Please sign in to comment.