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

Commit a84c252

Browse files
docs: add generated snippets (#247)
* 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 <partheniou@google.com>
1 parent 9acb791 commit a84c252

File tree

63 files changed

+4635
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+4635
-0
lines changed

google/cloud/secretmanager_v1/services/secret_manager_service/async_client.py

Lines changed: 298 additions & 0 deletions
Large diffs are not rendered by default.

google/cloud/secretmanager_v1/services/secret_manager_service/client.py

Lines changed: 298 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2020 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for AccessSecretVersion
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-secretmanager
24+
25+
26+
# [START secretmanager_generated_secretmanager_v1_SecretManagerService_AccessSecretVersion_async]
27+
from google.cloud import secretmanager_v1
28+
29+
30+
async def sample_access_secret_version():
31+
# Create a client
32+
client = secretmanager_v1.SecretManagerServiceAsyncClient()
33+
34+
# Initialize request argument(s)
35+
request = secretmanager_v1.AccessSecretVersionRequest(
36+
name="name_value",
37+
)
38+
39+
# Make the request
40+
response = await client.access_secret_version(request=request)
41+
42+
# Handle the response
43+
print(response)
44+
45+
# [END secretmanager_generated_secretmanager_v1_SecretManagerService_AccessSecretVersion_async]
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2020 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for AccessSecretVersion
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-secretmanager
24+
25+
26+
# [START secretmanager_generated_secretmanager_v1_SecretManagerService_AccessSecretVersion_sync]
27+
from google.cloud import secretmanager_v1
28+
29+
30+
def sample_access_secret_version():
31+
# Create a client
32+
client = secretmanager_v1.SecretManagerServiceClient()
33+
34+
# Initialize request argument(s)
35+
request = secretmanager_v1.AccessSecretVersionRequest(
36+
name="name_value",
37+
)
38+
39+
# Make the request
40+
response = client.access_secret_version(request=request)
41+
42+
# Handle the response
43+
print(response)
44+
45+
# [END secretmanager_generated_secretmanager_v1_SecretManagerService_AccessSecretVersion_sync]
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2020 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for AddSecretVersion
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-secretmanager
24+
25+
26+
# [START secretmanager_generated_secretmanager_v1_SecretManagerService_AddSecretVersion_async]
27+
from google.cloud import secretmanager_v1
28+
29+
30+
async def sample_add_secret_version():
31+
# Create a client
32+
client = secretmanager_v1.SecretManagerServiceAsyncClient()
33+
34+
# Initialize request argument(s)
35+
request = secretmanager_v1.AddSecretVersionRequest(
36+
parent="parent_value",
37+
)
38+
39+
# Make the request
40+
response = await client.add_secret_version(request=request)
41+
42+
# Handle the response
43+
print(response)
44+
45+
# [END secretmanager_generated_secretmanager_v1_SecretManagerService_AddSecretVersion_async]
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2020 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for AddSecretVersion
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-secretmanager
24+
25+
26+
# [START secretmanager_generated_secretmanager_v1_SecretManagerService_AddSecretVersion_sync]
27+
from google.cloud import secretmanager_v1
28+
29+
30+
def sample_add_secret_version():
31+
# Create a client
32+
client = secretmanager_v1.SecretManagerServiceClient()
33+
34+
# Initialize request argument(s)
35+
request = secretmanager_v1.AddSecretVersionRequest(
36+
parent="parent_value",
37+
)
38+
39+
# Make the request
40+
response = client.add_secret_version(request=request)
41+
42+
# Handle the response
43+
print(response)
44+
45+
# [END secretmanager_generated_secretmanager_v1_SecretManagerService_AddSecretVersion_sync]
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2020 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for CreateSecret
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-secretmanager
24+
25+
26+
# [START secretmanager_generated_secretmanager_v1_SecretManagerService_CreateSecret_async]
27+
from google.cloud import secretmanager_v1
28+
29+
30+
async def sample_create_secret():
31+
# Create a client
32+
client = secretmanager_v1.SecretManagerServiceAsyncClient()
33+
34+
# Initialize request argument(s)
35+
request = secretmanager_v1.CreateSecretRequest(
36+
parent="parent_value",
37+
secret_id="secret_id_value",
38+
)
39+
40+
# Make the request
41+
response = await client.create_secret(request=request)
42+
43+
# Handle the response
44+
print(response)
45+
46+
# [END secretmanager_generated_secretmanager_v1_SecretManagerService_CreateSecret_async]
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2020 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for CreateSecret
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-secretmanager
24+
25+
26+
# [START secretmanager_generated_secretmanager_v1_SecretManagerService_CreateSecret_sync]
27+
from google.cloud import secretmanager_v1
28+
29+
30+
def sample_create_secret():
31+
# Create a client
32+
client = secretmanager_v1.SecretManagerServiceClient()
33+
34+
# Initialize request argument(s)
35+
request = secretmanager_v1.CreateSecretRequest(
36+
parent="parent_value",
37+
secret_id="secret_id_value",
38+
)
39+
40+
# Make the request
41+
response = client.create_secret(request=request)
42+
43+
# Handle the response
44+
print(response)
45+
46+
# [END secretmanager_generated_secretmanager_v1_SecretManagerService_CreateSecret_sync]
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2020 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for DeleteSecret
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-secretmanager
24+
25+
26+
# [START secretmanager_generated_secretmanager_v1_SecretManagerService_DeleteSecret_async]
27+
from google.cloud import secretmanager_v1
28+
29+
30+
async def sample_delete_secret():
31+
# Create a client
32+
client = secretmanager_v1.SecretManagerServiceAsyncClient()
33+
34+
# Initialize request argument(s)
35+
request = secretmanager_v1.DeleteSecretRequest(
36+
name="name_value",
37+
)
38+
39+
# Make the request
40+
await client.delete_secret(request=request)
41+
42+
43+
# [END secretmanager_generated_secretmanager_v1_SecretManagerService_DeleteSecret_async]
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2020 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for DeleteSecret
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-secretmanager
24+
25+
26+
# [START secretmanager_generated_secretmanager_v1_SecretManagerService_DeleteSecret_sync]
27+
from google.cloud import secretmanager_v1
28+
29+
30+
def sample_delete_secret():
31+
# Create a client
32+
client = secretmanager_v1.SecretManagerServiceClient()
33+
34+
# Initialize request argument(s)
35+
request = secretmanager_v1.DeleteSecretRequest(
36+
name="name_value",
37+
)
38+
39+
# Make the request
40+
client.delete_secret(request=request)
41+
42+
43+
# [END secretmanager_generated_secretmanager_v1_SecretManagerService_DeleteSecret_sync]

0 commit comments

Comments
 (0)