|
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 |
|
@@ -660,6 +663,175 @@ def delete_backup(
|
660 | 663 | def close(self):
|
661 | 664 | self.grpc_channel.close()
|
662 | 665 |
|
| 666 | + @property |
| 667 | + def delete_operation( |
| 668 | + self, |
| 669 | + ) -> Callable[[operations_pb2.DeleteOperationRequest], None]: |
| 670 | + r"""Return a callable for the delete_operation method over gRPC.""" |
| 671 | + # Generate a "stub function" on-the-fly which will actually make |
| 672 | + # the request. |
| 673 | + # gRPC handles serialization and deserialization, so we just need |
| 674 | + # to pass in the functions for each. |
| 675 | + if "delete_operation" not in self._stubs: |
| 676 | + self._stubs["delete_operation"] = self.grpc_channel.unary_unary( |
| 677 | + "/google.longrunning.Operations/DeleteOperation", |
| 678 | + request_serializer=operations_pb2.DeleteOperationRequest.SerializeToString, |
| 679 | + response_deserializer=None, |
| 680 | + ) |
| 681 | + return self._stubs["delete_operation"] |
| 682 | + |
| 683 | + @property |
| 684 | + def get_operation( |
| 685 | + self, |
| 686 | + ) -> Callable[[operations_pb2.GetOperationRequest], operations_pb2.Operation]: |
| 687 | + r"""Return a callable for the get_operation method over gRPC.""" |
| 688 | + # Generate a "stub function" on-the-fly which will actually make |
| 689 | + # the request. |
| 690 | + # gRPC handles serialization and deserialization, so we just need |
| 691 | + # to pass in the functions for each. |
| 692 | + if "get_operation" not in self._stubs: |
| 693 | + self._stubs["get_operation"] = self.grpc_channel.unary_unary( |
| 694 | + "/google.longrunning.Operations/GetOperation", |
| 695 | + request_serializer=operations_pb2.GetOperationRequest.SerializeToString, |
| 696 | + response_deserializer=operations_pb2.Operation.FromString, |
| 697 | + ) |
| 698 | + return self._stubs["get_operation"] |
| 699 | + |
| 700 | + @property |
| 701 | + def list_operations( |
| 702 | + self, |
| 703 | + ) -> Callable[ |
| 704 | + [operations_pb2.ListOperationsRequest], operations_pb2.ListOperationsResponse |
| 705 | + ]: |
| 706 | + r"""Return a callable for the list_operations method over gRPC.""" |
| 707 | + # Generate a "stub function" on-the-fly which will actually make |
| 708 | + # the request. |
| 709 | + # gRPC handles serialization and deserialization, so we just need |
| 710 | + # to pass in the functions for each. |
| 711 | + if "list_operations" not in self._stubs: |
| 712 | + self._stubs["list_operations"] = self.grpc_channel.unary_unary( |
| 713 | + "/google.longrunning.Operations/ListOperations", |
| 714 | + request_serializer=operations_pb2.ListOperationsRequest.SerializeToString, |
| 715 | + response_deserializer=operations_pb2.ListOperationsResponse.FromString, |
| 716 | + ) |
| 717 | + return self._stubs["list_operations"] |
| 718 | + |
| 719 | + @property |
| 720 | + def list_locations( |
| 721 | + self, |
| 722 | + ) -> Callable[ |
| 723 | + [locations_pb2.ListLocationsRequest], locations_pb2.ListLocationsResponse |
| 724 | + ]: |
| 725 | + r"""Return a callable for the list locations method over gRPC.""" |
| 726 | + # Generate a "stub function" on-the-fly which will actually make |
| 727 | + # the request. |
| 728 | + # gRPC handles serialization and deserialization, so we just need |
| 729 | + # to pass in the functions for each. |
| 730 | + if "list_locations" not in self._stubs: |
| 731 | + self._stubs["list_locations"] = self.grpc_channel.unary_unary( |
| 732 | + "/google.cloud.location.Locations/ListLocations", |
| 733 | + request_serializer=locations_pb2.ListLocationsRequest.SerializeToString, |
| 734 | + response_deserializer=locations_pb2.ListLocationsResponse.FromString, |
| 735 | + ) |
| 736 | + return self._stubs["list_locations"] |
| 737 | + |
| 738 | + @property |
| 739 | + def get_location( |
| 740 | + self, |
| 741 | + ) -> Callable[[locations_pb2.GetLocationRequest], locations_pb2.Location]: |
| 742 | + r"""Return a callable for the list locations method over gRPC.""" |
| 743 | + # Generate a "stub function" on-the-fly which will actually make |
| 744 | + # the request. |
| 745 | + # gRPC handles serialization and deserialization, so we just need |
| 746 | + # to pass in the functions for each. |
| 747 | + if "get_location" not in self._stubs: |
| 748 | + self._stubs["get_location"] = self.grpc_channel.unary_unary( |
| 749 | + "/google.cloud.location.Locations/GetLocation", |
| 750 | + request_serializer=locations_pb2.GetLocationRequest.SerializeToString, |
| 751 | + response_deserializer=locations_pb2.Location.FromString, |
| 752 | + ) |
| 753 | + return self._stubs["get_location"] |
| 754 | + |
| 755 | + @property |
| 756 | + def set_iam_policy( |
| 757 | + self, |
| 758 | + ) -> Callable[[iam_policy_pb2.SetIamPolicyRequest], policy_pb2.Policy]: |
| 759 | + r"""Return a callable for the set iam policy method over gRPC. |
| 760 | + Sets the IAM access control policy on the specified |
| 761 | + function. Replaces any existing policy. |
| 762 | + Returns: |
| 763 | + Callable[[~.SetIamPolicyRequest], |
| 764 | + ~.Policy]: |
| 765 | + A function that, when called, will call the underlying RPC |
| 766 | + on the server. |
| 767 | + """ |
| 768 | + # Generate a "stub function" on-the-fly which will actually make |
| 769 | + # the request. |
| 770 | + # gRPC handles serialization and deserialization, so we just need |
| 771 | + # to pass in the functions for each. |
| 772 | + if "set_iam_policy" not in self._stubs: |
| 773 | + self._stubs["set_iam_policy"] = self.grpc_channel.unary_unary( |
| 774 | + "/google.iam.v1.IAMPolicy/SetIamPolicy", |
| 775 | + request_serializer=iam_policy_pb2.SetIamPolicyRequest.SerializeToString, |
| 776 | + response_deserializer=policy_pb2.Policy.FromString, |
| 777 | + ) |
| 778 | + return self._stubs["set_iam_policy"] |
| 779 | + |
| 780 | + @property |
| 781 | + def get_iam_policy( |
| 782 | + self, |
| 783 | + ) -> Callable[[iam_policy_pb2.GetIamPolicyRequest], policy_pb2.Policy]: |
| 784 | + r"""Return a callable for the get iam policy method over gRPC. |
| 785 | + Gets the IAM access control policy for a function. |
| 786 | + Returns an empty policy if the function exists and does |
| 787 | + not have a policy set. |
| 788 | + Returns: |
| 789 | + Callable[[~.GetIamPolicyRequest], |
| 790 | + ~.Policy]: |
| 791 | + A function that, when called, will call the underlying RPC |
| 792 | + on the server. |
| 793 | + """ |
| 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_iam_policy" not in self._stubs: |
| 799 | + self._stubs["get_iam_policy"] = self.grpc_channel.unary_unary( |
| 800 | + "/google.iam.v1.IAMPolicy/GetIamPolicy", |
| 801 | + request_serializer=iam_policy_pb2.GetIamPolicyRequest.SerializeToString, |
| 802 | + response_deserializer=policy_pb2.Policy.FromString, |
| 803 | + ) |
| 804 | + return self._stubs["get_iam_policy"] |
| 805 | + |
| 806 | + @property |
| 807 | + def test_iam_permissions( |
| 808 | + self, |
| 809 | + ) -> Callable[ |
| 810 | + [iam_policy_pb2.TestIamPermissionsRequest], |
| 811 | + iam_policy_pb2.TestIamPermissionsResponse, |
| 812 | + ]: |
| 813 | + r"""Return a callable for the test iam permissions method over gRPC. |
| 814 | + Tests the specified permissions against the IAM access control |
| 815 | + policy for a function. If the function does not exist, this will |
| 816 | + return an empty set of permissions, not a NOT_FOUND error. |
| 817 | + Returns: |
| 818 | + Callable[[~.TestIamPermissionsRequest], |
| 819 | + ~.TestIamPermissionsResponse]: |
| 820 | + A function that, when called, will call the underlying RPC |
| 821 | + on the server. |
| 822 | + """ |
| 823 | + # Generate a "stub function" on-the-fly which will actually make |
| 824 | + # the request. |
| 825 | + # gRPC handles serialization and deserialization, so we just need |
| 826 | + # to pass in the functions for each. |
| 827 | + if "test_iam_permissions" not in self._stubs: |
| 828 | + self._stubs["test_iam_permissions"] = self.grpc_channel.unary_unary( |
| 829 | + "/google.iam.v1.IAMPolicy/TestIamPermissions", |
| 830 | + request_serializer=iam_policy_pb2.TestIamPermissionsRequest.SerializeToString, |
| 831 | + response_deserializer=iam_policy_pb2.TestIamPermissionsResponse.FromString, |
| 832 | + ) |
| 833 | + return self._stubs["test_iam_permissions"] |
| 834 | + |
663 | 835 | @property
|
664 | 836 | def kind(self) -> str:
|
665 | 837 | return "grpc"
|
|
0 commit comments