|
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 |
|
@@ -507,6 +510,192 @@ def delete_spoke(
|
507 | 510 | def close(self):
|
508 | 511 | self.grpc_channel.close()
|
509 | 512 |
|
| 513 | + @property |
| 514 | + def delete_operation( |
| 515 | + self, |
| 516 | + ) -> Callable[[operations_pb2.DeleteOperationRequest], None]: |
| 517 | + r"""Return a callable for the delete_operation method over gRPC.""" |
| 518 | + # Generate a "stub function" on-the-fly which will actually make |
| 519 | + # the request. |
| 520 | + # gRPC handles serialization and deserialization, so we just need |
| 521 | + # to pass in the functions for each. |
| 522 | + if "delete_operation" not in self._stubs: |
| 523 | + self._stubs["delete_operation"] = self.grpc_channel.unary_unary( |
| 524 | + "/google.longrunning.Operations/DeleteOperation", |
| 525 | + request_serializer=operations_pb2.DeleteOperationRequest.SerializeToString, |
| 526 | + response_deserializer=None, |
| 527 | + ) |
| 528 | + return self._stubs["delete_operation"] |
| 529 | + |
| 530 | + @property |
| 531 | + def cancel_operation( |
| 532 | + self, |
| 533 | + ) -> Callable[[operations_pb2.CancelOperationRequest], None]: |
| 534 | + r"""Return a callable for the cancel_operation method over gRPC.""" |
| 535 | + # Generate a "stub function" on-the-fly which will actually make |
| 536 | + # the request. |
| 537 | + # gRPC handles serialization and deserialization, so we just need |
| 538 | + # to pass in the functions for each. |
| 539 | + if "cancel_operation" not in self._stubs: |
| 540 | + self._stubs["cancel_operation"] = self.grpc_channel.unary_unary( |
| 541 | + "/google.longrunning.Operations/CancelOperation", |
| 542 | + request_serializer=operations_pb2.CancelOperationRequest.SerializeToString, |
| 543 | + response_deserializer=None, |
| 544 | + ) |
| 545 | + return self._stubs["cancel_operation"] |
| 546 | + |
| 547 | + @property |
| 548 | + def get_operation( |
| 549 | + self, |
| 550 | + ) -> Callable[[operations_pb2.GetOperationRequest], operations_pb2.Operation]: |
| 551 | + r"""Return a callable for the get_operation method over gRPC.""" |
| 552 | + # Generate a "stub function" on-the-fly which will actually make |
| 553 | + # the request. |
| 554 | + # gRPC handles serialization and deserialization, so we just need |
| 555 | + # to pass in the functions for each. |
| 556 | + if "get_operation" not in self._stubs: |
| 557 | + self._stubs["get_operation"] = self.grpc_channel.unary_unary( |
| 558 | + "/google.longrunning.Operations/GetOperation", |
| 559 | + request_serializer=operations_pb2.GetOperationRequest.SerializeToString, |
| 560 | + response_deserializer=operations_pb2.Operation.FromString, |
| 561 | + ) |
| 562 | + return self._stubs["get_operation"] |
| 563 | + |
| 564 | + @property |
| 565 | + def list_operations( |
| 566 | + self, |
| 567 | + ) -> Callable[ |
| 568 | + [operations_pb2.ListOperationsRequest], operations_pb2.ListOperationsResponse |
| 569 | + ]: |
| 570 | + r"""Return a callable for the list_operations method over gRPC.""" |
| 571 | + # Generate a "stub function" on-the-fly which will actually make |
| 572 | + # the request. |
| 573 | + # gRPC handles serialization and deserialization, so we just need |
| 574 | + # to pass in the functions for each. |
| 575 | + if "list_operations" not in self._stubs: |
| 576 | + self._stubs["list_operations"] = self.grpc_channel.unary_unary( |
| 577 | + "/google.longrunning.Operations/ListOperations", |
| 578 | + request_serializer=operations_pb2.ListOperationsRequest.SerializeToString, |
| 579 | + response_deserializer=operations_pb2.ListOperationsResponse.FromString, |
| 580 | + ) |
| 581 | + return self._stubs["list_operations"] |
| 582 | + |
| 583 | + @property |
| 584 | + def list_locations( |
| 585 | + self, |
| 586 | + ) -> Callable[ |
| 587 | + [locations_pb2.ListLocationsRequest], locations_pb2.ListLocationsResponse |
| 588 | + ]: |
| 589 | + r"""Return a callable for the list locations method over gRPC.""" |
| 590 | + # Generate a "stub function" on-the-fly which will actually make |
| 591 | + # the request. |
| 592 | + # gRPC handles serialization and deserialization, so we just need |
| 593 | + # to pass in the functions for each. |
| 594 | + if "list_locations" not in self._stubs: |
| 595 | + self._stubs["list_locations"] = self.grpc_channel.unary_unary( |
| 596 | + "/google.cloud.location.Locations/ListLocations", |
| 597 | + request_serializer=locations_pb2.ListLocationsRequest.SerializeToString, |
| 598 | + response_deserializer=locations_pb2.ListLocationsResponse.FromString, |
| 599 | + ) |
| 600 | + return self._stubs["list_locations"] |
| 601 | + |
| 602 | + @property |
| 603 | + def get_location( |
| 604 | + self, |
| 605 | + ) -> Callable[[locations_pb2.GetLocationRequest], locations_pb2.Location]: |
| 606 | + r"""Return a callable for the list locations method over gRPC.""" |
| 607 | + # Generate a "stub function" on-the-fly which will actually make |
| 608 | + # the request. |
| 609 | + # gRPC handles serialization and deserialization, so we just need |
| 610 | + # to pass in the functions for each. |
| 611 | + if "get_location" not in self._stubs: |
| 612 | + self._stubs["get_location"] = self.grpc_channel.unary_unary( |
| 613 | + "/google.cloud.location.Locations/GetLocation", |
| 614 | + request_serializer=locations_pb2.GetLocationRequest.SerializeToString, |
| 615 | + response_deserializer=locations_pb2.Location.FromString, |
| 616 | + ) |
| 617 | + return self._stubs["get_location"] |
| 618 | + |
| 619 | + @property |
| 620 | + def set_iam_policy( |
| 621 | + self, |
| 622 | + ) -> Callable[[iam_policy_pb2.SetIamPolicyRequest], policy_pb2.Policy]: |
| 623 | + r"""Return a callable for the set iam policy method over gRPC. |
| 624 | + Sets the IAM access control policy on the specified |
| 625 | + function. Replaces any existing policy. |
| 626 | + Returns: |
| 627 | + Callable[[~.SetIamPolicyRequest], |
| 628 | + ~.Policy]: |
| 629 | + A function that, when called, will call the underlying RPC |
| 630 | + on the server. |
| 631 | + """ |
| 632 | + # Generate a "stub function" on-the-fly which will actually make |
| 633 | + # the request. |
| 634 | + # gRPC handles serialization and deserialization, so we just need |
| 635 | + # to pass in the functions for each. |
| 636 | + if "set_iam_policy" not in self._stubs: |
| 637 | + self._stubs["set_iam_policy"] = self.grpc_channel.unary_unary( |
| 638 | + "/google.iam.v1.IAMPolicy/SetIamPolicy", |
| 639 | + request_serializer=iam_policy_pb2.SetIamPolicyRequest.SerializeToString, |
| 640 | + response_deserializer=policy_pb2.Policy.FromString, |
| 641 | + ) |
| 642 | + return self._stubs["set_iam_policy"] |
| 643 | + |
| 644 | + @property |
| 645 | + def get_iam_policy( |
| 646 | + self, |
| 647 | + ) -> Callable[[iam_policy_pb2.GetIamPolicyRequest], policy_pb2.Policy]: |
| 648 | + r"""Return a callable for the get iam policy method over gRPC. |
| 649 | + Gets the IAM access control policy for a function. |
| 650 | + Returns an empty policy if the function exists and does |
| 651 | + not have a policy set. |
| 652 | + Returns: |
| 653 | + Callable[[~.GetIamPolicyRequest], |
| 654 | + ~.Policy]: |
| 655 | + A function that, when called, will call the underlying RPC |
| 656 | + on the server. |
| 657 | + """ |
| 658 | + # Generate a "stub function" on-the-fly which will actually make |
| 659 | + # the request. |
| 660 | + # gRPC handles serialization and deserialization, so we just need |
| 661 | + # to pass in the functions for each. |
| 662 | + if "get_iam_policy" not in self._stubs: |
| 663 | + self._stubs["get_iam_policy"] = self.grpc_channel.unary_unary( |
| 664 | + "/google.iam.v1.IAMPolicy/GetIamPolicy", |
| 665 | + request_serializer=iam_policy_pb2.GetIamPolicyRequest.SerializeToString, |
| 666 | + response_deserializer=policy_pb2.Policy.FromString, |
| 667 | + ) |
| 668 | + return self._stubs["get_iam_policy"] |
| 669 | + |
| 670 | + @property |
| 671 | + def test_iam_permissions( |
| 672 | + self, |
| 673 | + ) -> Callable[ |
| 674 | + [iam_policy_pb2.TestIamPermissionsRequest], |
| 675 | + iam_policy_pb2.TestIamPermissionsResponse, |
| 676 | + ]: |
| 677 | + r"""Return a callable for the test iam permissions method over gRPC. |
| 678 | + Tests the specified permissions against the IAM access control |
| 679 | + policy for a function. If the function does not exist, this will |
| 680 | + return an empty set of permissions, not a NOT_FOUND error. |
| 681 | + Returns: |
| 682 | + Callable[[~.TestIamPermissionsRequest], |
| 683 | + ~.TestIamPermissionsResponse]: |
| 684 | + A function that, when called, will call the underlying RPC |
| 685 | + on the server. |
| 686 | + """ |
| 687 | + # Generate a "stub function" on-the-fly which will actually make |
| 688 | + # the request. |
| 689 | + # gRPC handles serialization and deserialization, so we just need |
| 690 | + # to pass in the functions for each. |
| 691 | + if "test_iam_permissions" not in self._stubs: |
| 692 | + self._stubs["test_iam_permissions"] = self.grpc_channel.unary_unary( |
| 693 | + "/google.iam.v1.IAMPolicy/TestIamPermissions", |
| 694 | + request_serializer=iam_policy_pb2.TestIamPermissionsRequest.SerializeToString, |
| 695 | + response_deserializer=iam_policy_pb2.TestIamPermissionsResponse.FromString, |
| 696 | + ) |
| 697 | + return self._stubs["test_iam_permissions"] |
| 698 | + |
510 | 699 | @property
|
511 | 700 | def kind(self) -> str:
|
512 | 701 | return "grpc"
|
|
0 commit comments