diff --git a/google/cloud/functions_v1/services/cloud_functions_service/transports/__init__.py b/google/cloud/functions_v1/services/cloud_functions_service/transports/__init__.py index b50e7d1..90fe312 100644 --- a/google/cloud/functions_v1/services/cloud_functions_service/transports/__init__.py +++ b/google/cloud/functions_v1/services/cloud_functions_service/transports/__init__.py @@ -30,7 +30,6 @@ _transport_registry["grpc"] = CloudFunctionsServiceGrpcTransport _transport_registry["grpc_asyncio"] = CloudFunctionsServiceGrpcAsyncIOTransport - __all__ = ( "CloudFunctionsServiceTransport", "CloudFunctionsServiceGrpcTransport", diff --git a/google/cloud/functions_v1/services/cloud_functions_service/transports/grpc.py b/google/cloud/functions_v1/services/cloud_functions_service/transports/grpc.py index 9507fc2..98571f8 100644 --- a/google/cloud/functions_v1/services/cloud_functions_service/transports/grpc.py +++ b/google/cloud/functions_v1/services/cloud_functions_service/transports/grpc.py @@ -151,6 +151,10 @@ def __init__( ssl_credentials=ssl_credentials, scopes=scopes or self.AUTH_SCOPES, quota_project_id=quota_project_id, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], ) self._ssl_channel_credentials = ssl_credentials else: @@ -169,9 +173,14 @@ def __init__( ssl_credentials=ssl_channel_credentials, scopes=scopes or self.AUTH_SCOPES, quota_project_id=quota_project_id, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], ) self._stubs = {} # type: Dict[str, Callable] + self._operations_client = None # Run the base constructor. super().__init__( @@ -195,7 +204,7 @@ def create_channel( ) -> grpc.Channel: """Create and return a gRPC channel object. Args: - address (Optionsl[str]): The host for the channel to use. + address (Optional[str]): The host for the channel to use. credentials (Optional[~.Credentials]): The authorization credentials to attach to requests. These credentials identify this application to the service. If @@ -242,13 +251,11 @@ def operations_client(self) -> operations_v1.OperationsClient: client. """ # Sanity check: Only create a new client if we do not already have one. - if "operations_client" not in self.__dict__: - self.__dict__["operations_client"] = operations_v1.OperationsClient( - self.grpc_channel - ) + if self._operations_client is None: + self._operations_client = operations_v1.OperationsClient(self.grpc_channel) # Return the client from cache. - return self.__dict__["operations_client"] + return self._operations_client @property def list_functions( diff --git a/google/cloud/functions_v1/services/cloud_functions_service/transports/grpc_asyncio.py b/google/cloud/functions_v1/services/cloud_functions_service/transports/grpc_asyncio.py index b292db3..6f4fe62 100644 --- a/google/cloud/functions_v1/services/cloud_functions_service/transports/grpc_asyncio.py +++ b/google/cloud/functions_v1/services/cloud_functions_service/transports/grpc_asyncio.py @@ -196,6 +196,10 @@ def __init__( ssl_credentials=ssl_credentials, scopes=scopes or self.AUTH_SCOPES, quota_project_id=quota_project_id, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], ) self._ssl_channel_credentials = ssl_credentials else: @@ -214,6 +218,10 @@ def __init__( ssl_credentials=ssl_channel_credentials, scopes=scopes or self.AUTH_SCOPES, quota_project_id=quota_project_id, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], ) # Run the base constructor. @@ -227,6 +235,7 @@ def __init__( ) self._stubs = {} + self._operations_client = None @property def grpc_channel(self) -> aio.Channel: @@ -246,13 +255,13 @@ def operations_client(self) -> operations_v1.OperationsAsyncClient: client. """ # Sanity check: Only create a new client if we do not already have one. - if "operations_client" not in self.__dict__: - self.__dict__["operations_client"] = operations_v1.OperationsAsyncClient( + if self._operations_client is None: + self._operations_client = operations_v1.OperationsAsyncClient( self.grpc_channel ) # Return the client from cache. - return self.__dict__["operations_client"] + return self._operations_client @property def list_functions( diff --git a/google/cloud/functions_v1/types/__init__.py b/google/cloud/functions_v1/types/__init__.py index eb2641b..de5cc1a 100644 --- a/google/cloud/functions_v1/types/__init__.py +++ b/google/cloud/functions_v1/types/__init__.py @@ -33,9 +33,12 @@ GenerateUploadUrlResponse, GenerateDownloadUrlRequest, GenerateDownloadUrlResponse, + CloudFunctionStatus, +) +from .operations import ( + OperationMetadataV1, + OperationType, ) -from .operations import OperationMetadataV1 - __all__ = ( "CloudFunction", @@ -55,5 +58,7 @@ "GenerateUploadUrlResponse", "GenerateDownloadUrlRequest", "GenerateDownloadUrlResponse", + "CloudFunctionStatus", "OperationMetadataV1", + "OperationType", ) diff --git a/synth.metadata b/synth.metadata index 176b08d..06215e2 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/python-functions.git", - "sha": "6ef79767921676ef825fbac52fee5fdbec75d5e1" + "sha": "bdb2f5093ed82a88ce769d72a1c6bc0643f3644c" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "3f87da2ed1ddc3566ef0810c4fc06a2682cc9f5f", - "internalRef": "343022252" + "sha": "dd372aa22ded7a8ba6f0e03a80e06358a3fa0907", + "internalRef": "347055288" } }, { diff --git a/tests/unit/gapic/functions_v1/test_cloud_functions_service.py b/tests/unit/gapic/functions_v1/test_cloud_functions_service.py index 0c2b31d..f462f62 100644 --- a/tests/unit/gapic/functions_v1/test_cloud_functions_service.py +++ b/tests/unit/gapic/functions_v1/test_cloud_functions_service.py @@ -2886,6 +2886,10 @@ def test_cloud_functions_service_transport_channel_mtls_with_client_cert_source( scopes=("https://www.googleapis.com/auth/cloud-platform",), ssl_credentials=mock_ssl_cred, quota_project_id=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], ) assert transport.grpc_channel == mock_grpc_channel assert transport._ssl_channel_credentials == mock_ssl_cred @@ -2927,6 +2931,10 @@ def test_cloud_functions_service_transport_channel_mtls_with_adc(transport_class scopes=("https://www.googleapis.com/auth/cloud-platform",), ssl_credentials=mock_ssl_cred, quota_project_id=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], ) assert transport.grpc_channel == mock_grpc_channel