diff --git a/google/cloud/functions_v1/services/cloud_functions_service/transports/rest.py b/google/cloud/functions_v1/services/cloud_functions_service/transports/rest.py index 1308f5f..f859bbf 100644 --- a/google/cloud/functions_v1/services/cloud_functions_service/transports/rest.py +++ b/google/cloud/functions_v1/services/cloud_functions_service/transports/rest.py @@ -17,7 +17,7 @@ import dataclasses import json # type: ignore import re -from typing import Callable, Dict, List, Optional, Sequence, Tuple, Union +from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union import warnings from google.api_core import ( @@ -557,7 +557,7 @@ class _CallFunction(CloudFunctionsServiceRestStub): def __hash__(self): return hash("CallFunction") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -652,7 +652,7 @@ class _CreateFunction(CloudFunctionsServiceRestStub): def __hash__(self): return hash("CreateFunction") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -748,7 +748,7 @@ class _DeleteFunction(CloudFunctionsServiceRestStub): def __hash__(self): return hash("DeleteFunction") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -1007,7 +1007,7 @@ class _GetFunction(CloudFunctionsServiceRestStub): def __hash__(self): return hash("GetFunction") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -1097,7 +1097,7 @@ class _GetIamPolicy(CloudFunctionsServiceRestStub): def __hash__(self): return hash("GetIamPolicy") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -1332,7 +1332,7 @@ class _SetIamPolicy(CloudFunctionsServiceRestStub): def __hash__(self): return hash("SetIamPolicy") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -1501,7 +1501,7 @@ class _TestIamPermissions(CloudFunctionsServiceRestStub): def __hash__(self): return hash("TestIamPermissions") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -1598,7 +1598,7 @@ class _UpdateFunction(CloudFunctionsServiceRestStub): def __hash__(self): return hash("UpdateFunction") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): diff --git a/google/cloud/functions_v1/types/functions.py b/google/cloud/functions_v1/types/functions.py index 87110d3..e55ff91 100644 --- a/google/cloud/functions_v1/types/functions.py +++ b/google/cloud/functions_v1/types/functions.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from __future__ import annotations + from typing import MutableMapping, MutableSequence from google.protobuf import duration_pb2 # type: ignore diff --git a/google/cloud/functions_v1/types/operations.py b/google/cloud/functions_v1/types/operations.py index d8ff803..0b3f565 100644 --- a/google/cloud/functions_v1/types/operations.py +++ b/google/cloud/functions_v1/types/operations.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from __future__ import annotations + from typing import MutableMapping, MutableSequence from google.protobuf import any_pb2 # type: ignore diff --git a/google/cloud/functions_v2/services/function_service/transports/rest.py b/google/cloud/functions_v2/services/function_service/transports/rest.py index 8ffa475..2500123 100644 --- a/google/cloud/functions_v2/services/function_service/transports/rest.py +++ b/google/cloud/functions_v2/services/function_service/transports/rest.py @@ -17,7 +17,7 @@ import dataclasses import json # type: ignore import re -from typing import Callable, Dict, List, Optional, Sequence, Tuple, Union +from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union import warnings from google.api_core import ( @@ -329,7 +329,7 @@ def pre_list_locations( self, request: locations_pb2.ListLocationsRequest, metadata: Sequence[Tuple[str, str]], - ) -> locations_pb2.ListLocationsResponse: + ) -> Tuple[locations_pb2.ListLocationsRequest, Sequence[Tuple[str, str]]]: """Pre-rpc interceptor for list_locations Override in a subclass to manipulate the request or metadata @@ -338,7 +338,7 @@ def pre_list_locations( return request, metadata def post_list_locations( - self, response: locations_pb2.ListLocationsRequest + self, response: locations_pb2.ListLocationsResponse ) -> locations_pb2.ListLocationsResponse: """Post-rpc interceptor for list_locations @@ -352,7 +352,7 @@ def pre_get_iam_policy( self, request: iam_policy_pb2.GetIamPolicyRequest, metadata: Sequence[Tuple[str, str]], - ) -> policy_pb2.Policy: + ) -> Tuple[iam_policy_pb2.GetIamPolicyRequest, Sequence[Tuple[str, str]]]: """Pre-rpc interceptor for get_iam_policy Override in a subclass to manipulate the request or metadata @@ -360,9 +360,7 @@ def pre_get_iam_policy( """ return request, metadata - def post_get_iam_policy( - self, response: iam_policy_pb2.GetIamPolicyRequest - ) -> policy_pb2.Policy: + def post_get_iam_policy(self, response: policy_pb2.Policy) -> policy_pb2.Policy: """Post-rpc interceptor for get_iam_policy Override in a subclass to manipulate the response @@ -375,7 +373,7 @@ def pre_set_iam_policy( self, request: iam_policy_pb2.SetIamPolicyRequest, metadata: Sequence[Tuple[str, str]], - ) -> policy_pb2.Policy: + ) -> Tuple[iam_policy_pb2.SetIamPolicyRequest, Sequence[Tuple[str, str]]]: """Pre-rpc interceptor for set_iam_policy Override in a subclass to manipulate the request or metadata @@ -383,9 +381,7 @@ def pre_set_iam_policy( """ return request, metadata - def post_set_iam_policy( - self, response: iam_policy_pb2.SetIamPolicyRequest - ) -> policy_pb2.Policy: + def post_set_iam_policy(self, response: policy_pb2.Policy) -> policy_pb2.Policy: """Post-rpc interceptor for set_iam_policy Override in a subclass to manipulate the response @@ -398,7 +394,7 @@ def pre_test_iam_permissions( self, request: iam_policy_pb2.TestIamPermissionsRequest, metadata: Sequence[Tuple[str, str]], - ) -> iam_policy_pb2.TestIamPermissionsResponse: + ) -> Tuple[iam_policy_pb2.TestIamPermissionsRequest, Sequence[Tuple[str, str]]]: """Pre-rpc interceptor for test_iam_permissions Override in a subclass to manipulate the request or metadata @@ -407,7 +403,7 @@ def pre_test_iam_permissions( return request, metadata def post_test_iam_permissions( - self, response: iam_policy_pb2.TestIamPermissionsRequest + self, response: iam_policy_pb2.TestIamPermissionsResponse ) -> iam_policy_pb2.TestIamPermissionsResponse: """Post-rpc interceptor for test_iam_permissions @@ -421,7 +417,7 @@ def pre_get_operation( self, request: operations_pb2.GetOperationRequest, metadata: Sequence[Tuple[str, str]], - ) -> operations_pb2.Operation: + ) -> Tuple[operations_pb2.GetOperationRequest, Sequence[Tuple[str, str]]]: """Pre-rpc interceptor for get_operation Override in a subclass to manipulate the request or metadata @@ -430,7 +426,7 @@ def pre_get_operation( return request, metadata def post_get_operation( - self, response: operations_pb2.GetOperationRequest + self, response: operations_pb2.Operation ) -> operations_pb2.Operation: """Post-rpc interceptor for get_operation @@ -444,7 +440,7 @@ def pre_list_operations( self, request: operations_pb2.ListOperationsRequest, metadata: Sequence[Tuple[str, str]], - ) -> operations_pb2.ListOperationsResponse: + ) -> Tuple[operations_pb2.ListOperationsRequest, Sequence[Tuple[str, str]]]: """Pre-rpc interceptor for list_operations Override in a subclass to manipulate the request or metadata @@ -453,7 +449,7 @@ def pre_list_operations( return request, metadata def post_list_operations( - self, response: operations_pb2.ListOperationsRequest + self, response: operations_pb2.ListOperationsResponse ) -> operations_pb2.ListOperationsResponse: """Post-rpc interceptor for list_operations @@ -610,7 +606,7 @@ class _CreateFunction(FunctionServiceRestStub): def __hash__(self): return hash("CreateFunction") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -706,7 +702,7 @@ class _DeleteFunction(FunctionServiceRestStub): def __hash__(self): return hash("DeleteFunction") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -793,7 +789,7 @@ class _GenerateDownloadUrl(FunctionServiceRestStub): def __hash__(self): return hash("GenerateDownloadUrl") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -890,7 +886,7 @@ class _GenerateUploadUrl(FunctionServiceRestStub): def __hash__(self): return hash("GenerateUploadUrl") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -987,7 +983,7 @@ class _GetFunction(FunctionServiceRestStub): def __hash__(self): return hash("GetFunction") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -1077,7 +1073,7 @@ class _ListFunctions(FunctionServiceRestStub): def __hash__(self): return hash("ListFunctions") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -1163,7 +1159,7 @@ class _ListRuntimes(FunctionServiceRestStub): def __hash__(self): return hash("ListRuntimes") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -1249,7 +1245,7 @@ class _UpdateFunction(FunctionServiceRestStub): def __hash__(self): return hash("UpdateFunction") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): diff --git a/google/cloud/functions_v2/types/functions.py b/google/cloud/functions_v2/types/functions.py index bd848b3..6729cd7 100644 --- a/google/cloud/functions_v2/types/functions.py +++ b/google/cloud/functions_v2/types/functions.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from __future__ import annotations + from typing import MutableMapping, MutableSequence from google.protobuf import any_pb2 # type: ignore diff --git a/samples/generated_samples/snippet_metadata_google.cloud.functions.v1.json b/samples/generated_samples/snippet_metadata_google.cloud.functions.v1.json index 43e22c7..3a16e5f 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.functions.v1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.functions.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-functions", - "version": "1.11.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.functions.v2.json b/samples/generated_samples/snippet_metadata_google.cloud.functions.v2.json index 8d633e2..0dbb0a2 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.functions.v2.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.functions.v2.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-functions", - "version": "1.11.0" + "version": "0.1.0" }, "snippets": [ {