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

Commit 47c99d0

Browse files
feat: Secret Manager integration fields 'secret_environment_variables' and 'secret_volumes' added (#130)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 407654258 Source-Link: googleapis/googleapis@09b2576 Source-Link: https://github.com/googleapis/googleapis-gen/commit/28d38540e7a574ce249f65ff0228533129cd120c Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjhkMzg1NDBlN2E1NzRjZTI0OWY2NWZmMDIyODUzMzEyOWNkMTIwYyJ9 feat: CMEK integration fields 'kms_key_name' and 'docker_repository' added
1 parent 9408cbb commit 47c99d0

File tree

8 files changed

+361
-18
lines changed

8 files changed

+361
-18
lines changed

google/cloud/functions/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
from google.cloud.functions_v1.types.functions import HttpsTrigger
3737
from google.cloud.functions_v1.types.functions import ListFunctionsRequest
3838
from google.cloud.functions_v1.types.functions import ListFunctionsResponse
39+
from google.cloud.functions_v1.types.functions import SecretEnvVar
40+
from google.cloud.functions_v1.types.functions import SecretVolume
3941
from google.cloud.functions_v1.types.functions import SourceRepository
4042
from google.cloud.functions_v1.types.functions import UpdateFunctionRequest
4143
from google.cloud.functions_v1.types.functions import CloudFunctionStatus
@@ -60,6 +62,8 @@
6062
"HttpsTrigger",
6163
"ListFunctionsRequest",
6264
"ListFunctionsResponse",
65+
"SecretEnvVar",
66+
"SecretVolume",
6367
"SourceRepository",
6468
"UpdateFunctionRequest",
6569
"CloudFunctionStatus",

google/cloud/functions_v1/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
from .types.functions import HttpsTrigger
3333
from .types.functions import ListFunctionsRequest
3434
from .types.functions import ListFunctionsResponse
35+
from .types.functions import SecretEnvVar
36+
from .types.functions import SecretVolume
3537
from .types.functions import SourceRepository
3638
from .types.functions import UpdateFunctionRequest
3739
from .types.functions import CloudFunctionStatus
@@ -59,6 +61,8 @@
5961
"ListFunctionsResponse",
6062
"OperationMetadataV1",
6163
"OperationType",
64+
"SecretEnvVar",
65+
"SecretVolume",
6266
"SourceRepository",
6367
"UpdateFunctionRequest",
6468
)

google/cloud/functions_v1/services/cloud_functions_service/async_client.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ class CloudFunctionsServiceAsyncClient:
5757
parse_cloud_function_path = staticmethod(
5858
CloudFunctionsServiceClient.parse_cloud_function_path
5959
)
60+
crypto_key_path = staticmethod(CloudFunctionsServiceClient.crypto_key_path)
61+
parse_crypto_key_path = staticmethod(
62+
CloudFunctionsServiceClient.parse_crypto_key_path
63+
)
64+
repository_path = staticmethod(CloudFunctionsServiceClient.repository_path)
65+
parse_repository_path = staticmethod(
66+
CloudFunctionsServiceClient.parse_repository_path
67+
)
6068
common_billing_account_path = staticmethod(
6169
CloudFunctionsServiceClient.common_billing_account_path
6270
)
@@ -281,6 +289,7 @@ async def get_function(
281289
contains user computation executed in
282290
response to an event. It encapsulate
283291
function and triggers configurations.
292+
Next tag: 36
284293
285294
"""
286295
# Create or coerce a protobuf request object.
@@ -373,7 +382,7 @@ async def create_function(
373382
374383
The result type for the operation will be :class:`google.cloud.functions_v1.types.CloudFunction` Describes a Cloud Function that contains user computation executed in
375384
response to an event. It encapsulate function and
376-
triggers configurations.
385+
triggers configurations. Next tag: 36
377386
378387
"""
379388
# Create or coerce a protobuf request object.
@@ -457,7 +466,7 @@ async def update_function(
457466
458467
The result type for the operation will be :class:`google.cloud.functions_v1.types.CloudFunction` Describes a Cloud Function that contains user computation executed in
459468
response to an event. It encapsulate function and
460-
triggers configurations.
469+
triggers configurations. Next tag: 36
461470
462471
"""
463472
# Create or coerce a protobuf request object.

google/cloud/functions_v1/services/cloud_functions_service/client.py

+40-2
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,43 @@ def parse_cloud_function_path(path: str) -> Dict[str, str]:
185185
)
186186
return m.groupdict() if m else {}
187187

188+
@staticmethod
189+
def crypto_key_path(
190+
project: str, location: str, key_ring: str, crypto_key: str,
191+
) -> str:
192+
"""Returns a fully-qualified crypto_key string."""
193+
return "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}".format(
194+
project=project,
195+
location=location,
196+
key_ring=key_ring,
197+
crypto_key=crypto_key,
198+
)
199+
200+
@staticmethod
201+
def parse_crypto_key_path(path: str) -> Dict[str, str]:
202+
"""Parses a crypto_key path into its component segments."""
203+
m = re.match(
204+
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/keyRings/(?P<key_ring>.+?)/cryptoKeys/(?P<crypto_key>.+?)$",
205+
path,
206+
)
207+
return m.groupdict() if m else {}
208+
209+
@staticmethod
210+
def repository_path(project: str, location: str, repository: str,) -> str:
211+
"""Returns a fully-qualified repository string."""
212+
return "projects/{project}/locations/{location}/repositories/{repository}".format(
213+
project=project, location=location, repository=repository,
214+
)
215+
216+
@staticmethod
217+
def parse_repository_path(path: str) -> Dict[str, str]:
218+
"""Parses a repository path into its component segments."""
219+
m = re.match(
220+
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/repositories/(?P<repository>.+?)$",
221+
path,
222+
)
223+
return m.groupdict() if m else {}
224+
188225
@staticmethod
189226
def common_billing_account_path(billing_account: str,) -> str:
190227
"""Returns a fully-qualified billing_account string."""
@@ -455,6 +492,7 @@ def get_function(
455492
contains user computation executed in
456493
response to an event. It encapsulate
457494
function and triggers configurations.
495+
Next tag: 36
458496
459497
"""
460498
# Create or coerce a protobuf request object.
@@ -537,7 +575,7 @@ def create_function(
537575
538576
The result type for the operation will be :class:`google.cloud.functions_v1.types.CloudFunction` Describes a Cloud Function that contains user computation executed in
539577
response to an event. It encapsulate function and
540-
triggers configurations.
578+
triggers configurations. Next tag: 36
541579
542580
"""
543581
# Create or coerce a protobuf request object.
@@ -621,7 +659,7 @@ def update_function(
621659
622660
The result type for the operation will be :class:`google.cloud.functions_v1.types.CloudFunction` Describes a Cloud Function that contains user computation executed in
623661
response to an event. It encapsulate function and
624-
triggers configurations.
662+
triggers configurations. Next tag: 36
625663
626664
"""
627665
# Create or coerce a protobuf request object.

google/cloud/functions_v1/types/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
HttpsTrigger,
3030
ListFunctionsRequest,
3131
ListFunctionsResponse,
32+
SecretEnvVar,
33+
SecretVolume,
3234
SourceRepository,
3335
UpdateFunctionRequest,
3436
CloudFunctionStatus,
@@ -54,6 +56,8 @@
5456
"HttpsTrigger",
5557
"ListFunctionsRequest",
5658
"ListFunctionsResponse",
59+
"SecretEnvVar",
60+
"SecretVolume",
5761
"SourceRepository",
5862
"UpdateFunctionRequest",
5963
"CloudFunctionStatus",

0 commit comments

Comments
 (0)