|
20 | 20 | import google.auth # type: ignore
|
21 | 21 | from google.auth import credentials as ga_credentials # type: ignore
|
22 | 22 | from google.auth.transport.grpc import SslCredentials # type: ignore
|
| 23 | +from google.cloud.location import locations_pb2 # type: ignore |
| 24 | +from google.iam.v1 import iam_policy_pb2 # type: ignore |
| 25 | +from google.iam.v1 import policy_pb2 # type: ignore |
23 | 26 | from google.longrunning import operations_pb2 # type: ignore
|
24 | 27 | import grpc # type: ignore
|
25 | 28 |
|
@@ -884,6 +887,192 @@ def get_volume_restore(
|
884 | 887 | def close(self):
|
885 | 888 | self.grpc_channel.close()
|
886 | 889 |
|
| 890 | + @property |
| 891 | + def delete_operation( |
| 892 | + self, |
| 893 | + ) -> Callable[[operations_pb2.DeleteOperationRequest], None]: |
| 894 | + r"""Return a callable for the delete_operation method over gRPC.""" |
| 895 | + # Generate a "stub function" on-the-fly which will actually make |
| 896 | + # the request. |
| 897 | + # gRPC handles serialization and deserialization, so we just need |
| 898 | + # to pass in the functions for each. |
| 899 | + if "delete_operation" not in self._stubs: |
| 900 | + self._stubs["delete_operation"] = self.grpc_channel.unary_unary( |
| 901 | + "/google.longrunning.Operations/DeleteOperation", |
| 902 | + request_serializer=operations_pb2.DeleteOperationRequest.SerializeToString, |
| 903 | + response_deserializer=None, |
| 904 | + ) |
| 905 | + return self._stubs["delete_operation"] |
| 906 | + |
| 907 | + @property |
| 908 | + def cancel_operation( |
| 909 | + self, |
| 910 | + ) -> Callable[[operations_pb2.CancelOperationRequest], None]: |
| 911 | + r"""Return a callable for the cancel_operation method over gRPC.""" |
| 912 | + # Generate a "stub function" on-the-fly which will actually make |
| 913 | + # the request. |
| 914 | + # gRPC handles serialization and deserialization, so we just need |
| 915 | + # to pass in the functions for each. |
| 916 | + if "cancel_operation" not in self._stubs: |
| 917 | + self._stubs["cancel_operation"] = self.grpc_channel.unary_unary( |
| 918 | + "/google.longrunning.Operations/CancelOperation", |
| 919 | + request_serializer=operations_pb2.CancelOperationRequest.SerializeToString, |
| 920 | + response_deserializer=None, |
| 921 | + ) |
| 922 | + return self._stubs["cancel_operation"] |
| 923 | + |
| 924 | + @property |
| 925 | + def get_operation( |
| 926 | + self, |
| 927 | + ) -> Callable[[operations_pb2.GetOperationRequest], operations_pb2.Operation]: |
| 928 | + r"""Return a callable for the get_operation method over gRPC.""" |
| 929 | + # Generate a "stub function" on-the-fly which will actually make |
| 930 | + # the request. |
| 931 | + # gRPC handles serialization and deserialization, so we just need |
| 932 | + # to pass in the functions for each. |
| 933 | + if "get_operation" not in self._stubs: |
| 934 | + self._stubs["get_operation"] = self.grpc_channel.unary_unary( |
| 935 | + "/google.longrunning.Operations/GetOperation", |
| 936 | + request_serializer=operations_pb2.GetOperationRequest.SerializeToString, |
| 937 | + response_deserializer=operations_pb2.Operation.FromString, |
| 938 | + ) |
| 939 | + return self._stubs["get_operation"] |
| 940 | + |
| 941 | + @property |
| 942 | + def list_operations( |
| 943 | + self, |
| 944 | + ) -> Callable[ |
| 945 | + [operations_pb2.ListOperationsRequest], operations_pb2.ListOperationsResponse |
| 946 | + ]: |
| 947 | + r"""Return a callable for the list_operations method over gRPC.""" |
| 948 | + # Generate a "stub function" on-the-fly which will actually make |
| 949 | + # the request. |
| 950 | + # gRPC handles serialization and deserialization, so we just need |
| 951 | + # to pass in the functions for each. |
| 952 | + if "list_operations" not in self._stubs: |
| 953 | + self._stubs["list_operations"] = self.grpc_channel.unary_unary( |
| 954 | + "/google.longrunning.Operations/ListOperations", |
| 955 | + request_serializer=operations_pb2.ListOperationsRequest.SerializeToString, |
| 956 | + response_deserializer=operations_pb2.ListOperationsResponse.FromString, |
| 957 | + ) |
| 958 | + return self._stubs["list_operations"] |
| 959 | + |
| 960 | + @property |
| 961 | + def list_locations( |
| 962 | + self, |
| 963 | + ) -> Callable[ |
| 964 | + [locations_pb2.ListLocationsRequest], locations_pb2.ListLocationsResponse |
| 965 | + ]: |
| 966 | + r"""Return a callable for the list locations method over gRPC.""" |
| 967 | + # Generate a "stub function" on-the-fly which will actually make |
| 968 | + # the request. |
| 969 | + # gRPC handles serialization and deserialization, so we just need |
| 970 | + # to pass in the functions for each. |
| 971 | + if "list_locations" not in self._stubs: |
| 972 | + self._stubs["list_locations"] = self.grpc_channel.unary_unary( |
| 973 | + "/google.cloud.location.Locations/ListLocations", |
| 974 | + request_serializer=locations_pb2.ListLocationsRequest.SerializeToString, |
| 975 | + response_deserializer=locations_pb2.ListLocationsResponse.FromString, |
| 976 | + ) |
| 977 | + return self._stubs["list_locations"] |
| 978 | + |
| 979 | + @property |
| 980 | + def get_location( |
| 981 | + self, |
| 982 | + ) -> Callable[[locations_pb2.GetLocationRequest], locations_pb2.Location]: |
| 983 | + r"""Return a callable for the list locations method over gRPC.""" |
| 984 | + # Generate a "stub function" on-the-fly which will actually make |
| 985 | + # the request. |
| 986 | + # gRPC handles serialization and deserialization, so we just need |
| 987 | + # to pass in the functions for each. |
| 988 | + if "get_location" not in self._stubs: |
| 989 | + self._stubs["get_location"] = self.grpc_channel.unary_unary( |
| 990 | + "/google.cloud.location.Locations/GetLocation", |
| 991 | + request_serializer=locations_pb2.GetLocationRequest.SerializeToString, |
| 992 | + response_deserializer=locations_pb2.Location.FromString, |
| 993 | + ) |
| 994 | + return self._stubs["get_location"] |
| 995 | + |
| 996 | + @property |
| 997 | + def set_iam_policy( |
| 998 | + self, |
| 999 | + ) -> Callable[[iam_policy_pb2.SetIamPolicyRequest], policy_pb2.Policy]: |
| 1000 | + r"""Return a callable for the set iam policy method over gRPC. |
| 1001 | + Sets the IAM access control policy on the specified |
| 1002 | + function. Replaces any existing policy. |
| 1003 | + Returns: |
| 1004 | + Callable[[~.SetIamPolicyRequest], |
| 1005 | + ~.Policy]: |
| 1006 | + A function that, when called, will call the underlying RPC |
| 1007 | + on the server. |
| 1008 | + """ |
| 1009 | + # Generate a "stub function" on-the-fly which will actually make |
| 1010 | + # the request. |
| 1011 | + # gRPC handles serialization and deserialization, so we just need |
| 1012 | + # to pass in the functions for each. |
| 1013 | + if "set_iam_policy" not in self._stubs: |
| 1014 | + self._stubs["set_iam_policy"] = self.grpc_channel.unary_unary( |
| 1015 | + "/google.iam.v1.IAMPolicy/SetIamPolicy", |
| 1016 | + request_serializer=iam_policy_pb2.SetIamPolicyRequest.SerializeToString, |
| 1017 | + response_deserializer=policy_pb2.Policy.FromString, |
| 1018 | + ) |
| 1019 | + return self._stubs["set_iam_policy"] |
| 1020 | + |
| 1021 | + @property |
| 1022 | + def get_iam_policy( |
| 1023 | + self, |
| 1024 | + ) -> Callable[[iam_policy_pb2.GetIamPolicyRequest], policy_pb2.Policy]: |
| 1025 | + r"""Return a callable for the get iam policy method over gRPC. |
| 1026 | + Gets the IAM access control policy for a function. |
| 1027 | + Returns an empty policy if the function exists and does |
| 1028 | + not have a policy set. |
| 1029 | + Returns: |
| 1030 | + Callable[[~.GetIamPolicyRequest], |
| 1031 | + ~.Policy]: |
| 1032 | + A function that, when called, will call the underlying RPC |
| 1033 | + on the server. |
| 1034 | + """ |
| 1035 | + # Generate a "stub function" on-the-fly which will actually make |
| 1036 | + # the request. |
| 1037 | + # gRPC handles serialization and deserialization, so we just need |
| 1038 | + # to pass in the functions for each. |
| 1039 | + if "get_iam_policy" not in self._stubs: |
| 1040 | + self._stubs["get_iam_policy"] = self.grpc_channel.unary_unary( |
| 1041 | + "/google.iam.v1.IAMPolicy/GetIamPolicy", |
| 1042 | + request_serializer=iam_policy_pb2.GetIamPolicyRequest.SerializeToString, |
| 1043 | + response_deserializer=policy_pb2.Policy.FromString, |
| 1044 | + ) |
| 1045 | + return self._stubs["get_iam_policy"] |
| 1046 | + |
| 1047 | + @property |
| 1048 | + def test_iam_permissions( |
| 1049 | + self, |
| 1050 | + ) -> Callable[ |
| 1051 | + [iam_policy_pb2.TestIamPermissionsRequest], |
| 1052 | + iam_policy_pb2.TestIamPermissionsResponse, |
| 1053 | + ]: |
| 1054 | + r"""Return a callable for the test iam permissions method over gRPC. |
| 1055 | + Tests the specified permissions against the IAM access control |
| 1056 | + policy for a function. If the function does not exist, this will |
| 1057 | + return an empty set of permissions, not a NOT_FOUND error. |
| 1058 | + Returns: |
| 1059 | + Callable[[~.TestIamPermissionsRequest], |
| 1060 | + ~.TestIamPermissionsResponse]: |
| 1061 | + A function that, when called, will call the underlying RPC |
| 1062 | + on the server. |
| 1063 | + """ |
| 1064 | + # Generate a "stub function" on-the-fly which will actually make |
| 1065 | + # the request. |
| 1066 | + # gRPC handles serialization and deserialization, so we just need |
| 1067 | + # to pass in the functions for each. |
| 1068 | + if "test_iam_permissions" not in self._stubs: |
| 1069 | + self._stubs["test_iam_permissions"] = self.grpc_channel.unary_unary( |
| 1070 | + "/google.iam.v1.IAMPolicy/TestIamPermissions", |
| 1071 | + request_serializer=iam_policy_pb2.TestIamPermissionsRequest.SerializeToString, |
| 1072 | + response_deserializer=iam_policy_pb2.TestIamPermissionsResponse.FromString, |
| 1073 | + ) |
| 1074 | + return self._stubs["test_iam_permissions"] |
| 1075 | + |
887 | 1076 | @property
|
888 | 1077 | def kind(self) -> str:
|
889 | 1078 | return "grpc"
|
|
0 commit comments