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

Commit

Permalink
feat: Secret Manager integration fields 'secret_environment_variables…
Browse files Browse the repository at this point in the history
…' and 'secret_volumes' added (#130)

- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 407654258

Source-Link: googleapis/googleapis@09b2576

Source-Link: googleapis/googleapis-gen@28d3854
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjhkMzg1NDBlN2E1NzRjZTI0OWY2NWZmMDIyODUzMzEyOWNkMTIwYyJ9

feat: CMEK integration fields 'kms_key_name' and 'docker_repository' added
  • Loading branch information
gcf-owl-bot[bot] committed Nov 5, 2021
1 parent 9408cbb commit 47c99d0
Show file tree
Hide file tree
Showing 8 changed files with 361 additions and 18 deletions.
4 changes: 4 additions & 0 deletions google/cloud/functions/__init__.py
Expand Up @@ -36,6 +36,8 @@
from google.cloud.functions_v1.types.functions import HttpsTrigger
from google.cloud.functions_v1.types.functions import ListFunctionsRequest
from google.cloud.functions_v1.types.functions import ListFunctionsResponse
from google.cloud.functions_v1.types.functions import SecretEnvVar
from google.cloud.functions_v1.types.functions import SecretVolume
from google.cloud.functions_v1.types.functions import SourceRepository
from google.cloud.functions_v1.types.functions import UpdateFunctionRequest
from google.cloud.functions_v1.types.functions import CloudFunctionStatus
Expand All @@ -60,6 +62,8 @@
"HttpsTrigger",
"ListFunctionsRequest",
"ListFunctionsResponse",
"SecretEnvVar",
"SecretVolume",
"SourceRepository",
"UpdateFunctionRequest",
"CloudFunctionStatus",
Expand Down
4 changes: 4 additions & 0 deletions google/cloud/functions_v1/__init__.py
Expand Up @@ -32,6 +32,8 @@
from .types.functions import HttpsTrigger
from .types.functions import ListFunctionsRequest
from .types.functions import ListFunctionsResponse
from .types.functions import SecretEnvVar
from .types.functions import SecretVolume
from .types.functions import SourceRepository
from .types.functions import UpdateFunctionRequest
from .types.functions import CloudFunctionStatus
Expand Down Expand Up @@ -59,6 +61,8 @@
"ListFunctionsResponse",
"OperationMetadataV1",
"OperationType",
"SecretEnvVar",
"SecretVolume",
"SourceRepository",
"UpdateFunctionRequest",
)
Expand Up @@ -57,6 +57,14 @@ class CloudFunctionsServiceAsyncClient:
parse_cloud_function_path = staticmethod(
CloudFunctionsServiceClient.parse_cloud_function_path
)
crypto_key_path = staticmethod(CloudFunctionsServiceClient.crypto_key_path)
parse_crypto_key_path = staticmethod(
CloudFunctionsServiceClient.parse_crypto_key_path
)
repository_path = staticmethod(CloudFunctionsServiceClient.repository_path)
parse_repository_path = staticmethod(
CloudFunctionsServiceClient.parse_repository_path
)
common_billing_account_path = staticmethod(
CloudFunctionsServiceClient.common_billing_account_path
)
Expand Down Expand Up @@ -281,6 +289,7 @@ async def get_function(
contains user computation executed in
response to an event. It encapsulate
function and triggers configurations.
Next tag: 36
"""
# Create or coerce a protobuf request object.
Expand Down Expand Up @@ -373,7 +382,7 @@ async def create_function(
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
response to an event. It encapsulate function and
triggers configurations.
triggers configurations. Next tag: 36
"""
# Create or coerce a protobuf request object.
Expand Down Expand Up @@ -457,7 +466,7 @@ async def update_function(
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
response to an event. It encapsulate function and
triggers configurations.
triggers configurations. Next tag: 36
"""
# Create or coerce a protobuf request object.
Expand Down
Expand Up @@ -185,6 +185,43 @@ def parse_cloud_function_path(path: str) -> Dict[str, str]:
)
return m.groupdict() if m else {}

@staticmethod
def crypto_key_path(
project: str, location: str, key_ring: str, crypto_key: str,
) -> str:
"""Returns a fully-qualified crypto_key string."""
return "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}".format(
project=project,
location=location,
key_ring=key_ring,
crypto_key=crypto_key,
)

@staticmethod
def parse_crypto_key_path(path: str) -> Dict[str, str]:
"""Parses a crypto_key path into its component segments."""
m = re.match(
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/keyRings/(?P<key_ring>.+?)/cryptoKeys/(?P<crypto_key>.+?)$",
path,
)
return m.groupdict() if m else {}

@staticmethod
def repository_path(project: str, location: str, repository: str,) -> str:
"""Returns a fully-qualified repository string."""
return "projects/{project}/locations/{location}/repositories/{repository}".format(
project=project, location=location, repository=repository,
)

@staticmethod
def parse_repository_path(path: str) -> Dict[str, str]:
"""Parses a repository path into its component segments."""
m = re.match(
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/repositories/(?P<repository>.+?)$",
path,
)
return m.groupdict() if m else {}

@staticmethod
def common_billing_account_path(billing_account: str,) -> str:
"""Returns a fully-qualified billing_account string."""
Expand Down Expand Up @@ -455,6 +492,7 @@ def get_function(
contains user computation executed in
response to an event. It encapsulate
function and triggers configurations.
Next tag: 36
"""
# Create or coerce a protobuf request object.
Expand Down Expand Up @@ -537,7 +575,7 @@ def create_function(
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
response to an event. It encapsulate function and
triggers configurations.
triggers configurations. Next tag: 36
"""
# Create or coerce a protobuf request object.
Expand Down Expand Up @@ -621,7 +659,7 @@ def update_function(
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
response to an event. It encapsulate function and
triggers configurations.
triggers configurations. Next tag: 36
"""
# Create or coerce a protobuf request object.
Expand Down
4 changes: 4 additions & 0 deletions google/cloud/functions_v1/types/__init__.py
Expand Up @@ -29,6 +29,8 @@
HttpsTrigger,
ListFunctionsRequest,
ListFunctionsResponse,
SecretEnvVar,
SecretVolume,
SourceRepository,
UpdateFunctionRequest,
CloudFunctionStatus,
Expand All @@ -54,6 +56,8 @@
"HttpsTrigger",
"ListFunctionsRequest",
"ListFunctionsResponse",
"SecretEnvVar",
"SecretVolume",
"SourceRepository",
"UpdateFunctionRequest",
"CloudFunctionStatus",
Expand Down

0 comments on commit 47c99d0

Please sign in to comment.