|
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 |
|
@@ -694,6 +697,192 @@ def delete_client_tls_policy( |
694 | 697 | def close(self): |
695 | 698 | self.grpc_channel.close() |
696 | 699 |
|
| 700 | + @property |
| 701 | + def delete_operation( |
| 702 | + self, |
| 703 | + ) -> Callable[[operations_pb2.DeleteOperationRequest], None]: |
| 704 | + r"""Return a callable for the delete_operation method over gRPC.""" |
| 705 | + # Generate a "stub function" on-the-fly which will actually make |
| 706 | + # the request. |
| 707 | + # gRPC handles serialization and deserialization, so we just need |
| 708 | + # to pass in the functions for each. |
| 709 | + if "delete_operation" not in self._stubs: |
| 710 | + self._stubs["delete_operation"] = self.grpc_channel.unary_unary( |
| 711 | + "/google.longrunning.Operations/DeleteOperation", |
| 712 | + request_serializer=operations_pb2.DeleteOperationRequest.SerializeToString, |
| 713 | + response_deserializer=None, |
| 714 | + ) |
| 715 | + return self._stubs["delete_operation"] |
| 716 | + |
| 717 | + @property |
| 718 | + def cancel_operation( |
| 719 | + self, |
| 720 | + ) -> Callable[[operations_pb2.CancelOperationRequest], None]: |
| 721 | + r"""Return a callable for the cancel_operation method over gRPC.""" |
| 722 | + # Generate a "stub function" on-the-fly which will actually make |
| 723 | + # the request. |
| 724 | + # gRPC handles serialization and deserialization, so we just need |
| 725 | + # to pass in the functions for each. |
| 726 | + if "cancel_operation" not in self._stubs: |
| 727 | + self._stubs["cancel_operation"] = self.grpc_channel.unary_unary( |
| 728 | + "/google.longrunning.Operations/CancelOperation", |
| 729 | + request_serializer=operations_pb2.CancelOperationRequest.SerializeToString, |
| 730 | + response_deserializer=None, |
| 731 | + ) |
| 732 | + return self._stubs["cancel_operation"] |
| 733 | + |
| 734 | + @property |
| 735 | + def get_operation( |
| 736 | + self, |
| 737 | + ) -> Callable[[operations_pb2.GetOperationRequest], operations_pb2.Operation]: |
| 738 | + r"""Return a callable for the get_operation method over gRPC.""" |
| 739 | + # Generate a "stub function" on-the-fly which will actually make |
| 740 | + # the request. |
| 741 | + # gRPC handles serialization and deserialization, so we just need |
| 742 | + # to pass in the functions for each. |
| 743 | + if "get_operation" not in self._stubs: |
| 744 | + self._stubs["get_operation"] = self.grpc_channel.unary_unary( |
| 745 | + "/google.longrunning.Operations/GetOperation", |
| 746 | + request_serializer=operations_pb2.GetOperationRequest.SerializeToString, |
| 747 | + response_deserializer=operations_pb2.Operation.FromString, |
| 748 | + ) |
| 749 | + return self._stubs["get_operation"] |
| 750 | + |
| 751 | + @property |
| 752 | + def list_operations( |
| 753 | + self, |
| 754 | + ) -> Callable[ |
| 755 | + [operations_pb2.ListOperationsRequest], operations_pb2.ListOperationsResponse |
| 756 | + ]: |
| 757 | + r"""Return a callable for the list_operations method over gRPC.""" |
| 758 | + # Generate a "stub function" on-the-fly which will actually make |
| 759 | + # the request. |
| 760 | + # gRPC handles serialization and deserialization, so we just need |
| 761 | + # to pass in the functions for each. |
| 762 | + if "list_operations" not in self._stubs: |
| 763 | + self._stubs["list_operations"] = self.grpc_channel.unary_unary( |
| 764 | + "/google.longrunning.Operations/ListOperations", |
| 765 | + request_serializer=operations_pb2.ListOperationsRequest.SerializeToString, |
| 766 | + response_deserializer=operations_pb2.ListOperationsResponse.FromString, |
| 767 | + ) |
| 768 | + return self._stubs["list_operations"] |
| 769 | + |
| 770 | + @property |
| 771 | + def list_locations( |
| 772 | + self, |
| 773 | + ) -> Callable[ |
| 774 | + [locations_pb2.ListLocationsRequest], locations_pb2.ListLocationsResponse |
| 775 | + ]: |
| 776 | + r"""Return a callable for the list locations method over gRPC.""" |
| 777 | + # Generate a "stub function" on-the-fly which will actually make |
| 778 | + # the request. |
| 779 | + # gRPC handles serialization and deserialization, so we just need |
| 780 | + # to pass in the functions for each. |
| 781 | + if "list_locations" not in self._stubs: |
| 782 | + self._stubs["list_locations"] = self.grpc_channel.unary_unary( |
| 783 | + "/google.cloud.location.Locations/ListLocations", |
| 784 | + request_serializer=locations_pb2.ListLocationsRequest.SerializeToString, |
| 785 | + response_deserializer=locations_pb2.ListLocationsResponse.FromString, |
| 786 | + ) |
| 787 | + return self._stubs["list_locations"] |
| 788 | + |
| 789 | + @property |
| 790 | + def get_location( |
| 791 | + self, |
| 792 | + ) -> Callable[[locations_pb2.GetLocationRequest], locations_pb2.Location]: |
| 793 | + r"""Return a callable for the list locations method over gRPC.""" |
| 794 | + # Generate a "stub function" on-the-fly which will actually make |
| 795 | + # the request. |
| 796 | + # gRPC handles serialization and deserialization, so we just need |
| 797 | + # to pass in the functions for each. |
| 798 | + if "get_location" not in self._stubs: |
| 799 | + self._stubs["get_location"] = self.grpc_channel.unary_unary( |
| 800 | + "/google.cloud.location.Locations/GetLocation", |
| 801 | + request_serializer=locations_pb2.GetLocationRequest.SerializeToString, |
| 802 | + response_deserializer=locations_pb2.Location.FromString, |
| 803 | + ) |
| 804 | + return self._stubs["get_location"] |
| 805 | + |
| 806 | + @property |
| 807 | + def set_iam_policy( |
| 808 | + self, |
| 809 | + ) -> Callable[[iam_policy_pb2.SetIamPolicyRequest], policy_pb2.Policy]: |
| 810 | + r"""Return a callable for the set iam policy method over gRPC. |
| 811 | + Sets the IAM access control policy on the specified |
| 812 | + function. Replaces any existing policy. |
| 813 | + Returns: |
| 814 | + Callable[[~.SetIamPolicyRequest], |
| 815 | + ~.Policy]: |
| 816 | + A function that, when called, will call the underlying RPC |
| 817 | + on the server. |
| 818 | + """ |
| 819 | + # Generate a "stub function" on-the-fly which will actually make |
| 820 | + # the request. |
| 821 | + # gRPC handles serialization and deserialization, so we just need |
| 822 | + # to pass in the functions for each. |
| 823 | + if "set_iam_policy" not in self._stubs: |
| 824 | + self._stubs["set_iam_policy"] = self.grpc_channel.unary_unary( |
| 825 | + "/google.iam.v1.IAMPolicy/SetIamPolicy", |
| 826 | + request_serializer=iam_policy_pb2.SetIamPolicyRequest.SerializeToString, |
| 827 | + response_deserializer=policy_pb2.Policy.FromString, |
| 828 | + ) |
| 829 | + return self._stubs["set_iam_policy"] |
| 830 | + |
| 831 | + @property |
| 832 | + def get_iam_policy( |
| 833 | + self, |
| 834 | + ) -> Callable[[iam_policy_pb2.GetIamPolicyRequest], policy_pb2.Policy]: |
| 835 | + r"""Return a callable for the get iam policy method over gRPC. |
| 836 | + Gets the IAM access control policy for a function. |
| 837 | + Returns an empty policy if the function exists and does |
| 838 | + not have a policy set. |
| 839 | + Returns: |
| 840 | + Callable[[~.GetIamPolicyRequest], |
| 841 | + ~.Policy]: |
| 842 | + A function that, when called, will call the underlying RPC |
| 843 | + on the server. |
| 844 | + """ |
| 845 | + # Generate a "stub function" on-the-fly which will actually make |
| 846 | + # the request. |
| 847 | + # gRPC handles serialization and deserialization, so we just need |
| 848 | + # to pass in the functions for each. |
| 849 | + if "get_iam_policy" not in self._stubs: |
| 850 | + self._stubs["get_iam_policy"] = self.grpc_channel.unary_unary( |
| 851 | + "/google.iam.v1.IAMPolicy/GetIamPolicy", |
| 852 | + request_serializer=iam_policy_pb2.GetIamPolicyRequest.SerializeToString, |
| 853 | + response_deserializer=policy_pb2.Policy.FromString, |
| 854 | + ) |
| 855 | + return self._stubs["get_iam_policy"] |
| 856 | + |
| 857 | + @property |
| 858 | + def test_iam_permissions( |
| 859 | + self, |
| 860 | + ) -> Callable[ |
| 861 | + [iam_policy_pb2.TestIamPermissionsRequest], |
| 862 | + iam_policy_pb2.TestIamPermissionsResponse, |
| 863 | + ]: |
| 864 | + r"""Return a callable for the test iam permissions method over gRPC. |
| 865 | + Tests the specified permissions against the IAM access control |
| 866 | + policy for a function. If the function does not exist, this will |
| 867 | + return an empty set of permissions, not a NOT_FOUND error. |
| 868 | + Returns: |
| 869 | + Callable[[~.TestIamPermissionsRequest], |
| 870 | + ~.TestIamPermissionsResponse]: |
| 871 | + A function that, when called, will call the underlying RPC |
| 872 | + on the server. |
| 873 | + """ |
| 874 | + # Generate a "stub function" on-the-fly which will actually make |
| 875 | + # the request. |
| 876 | + # gRPC handles serialization and deserialization, so we just need |
| 877 | + # to pass in the functions for each. |
| 878 | + if "test_iam_permissions" not in self._stubs: |
| 879 | + self._stubs["test_iam_permissions"] = self.grpc_channel.unary_unary( |
| 880 | + "/google.iam.v1.IAMPolicy/TestIamPermissions", |
| 881 | + request_serializer=iam_policy_pb2.TestIamPermissionsRequest.SerializeToString, |
| 882 | + response_deserializer=iam_policy_pb2.TestIamPermissionsResponse.FromString, |
| 883 | + ) |
| 884 | + return self._stubs["test_iam_permissions"] |
| 885 | + |
697 | 886 | @property |
698 | 887 | def kind(self) -> str: |
699 | 888 | return "grpc" |
|
0 commit comments