|
24 | 24 | import google.api_core.gapic_v1.config |
25 | 25 | import google.api_core.gapic_v1.method |
26 | 26 | import google.api_core.path_template |
| 27 | +import google.api_core.gapic_v1.routing_header |
27 | 28 | import google.api_core.grpc_helpers |
28 | 29 | import google.api_core.page_iterator |
29 | 30 | import google.api_core.path_template |
@@ -267,6 +268,19 @@ def create_topic( |
267 | 268 | request = pubsub_pb2.Topic( |
268 | 269 | name=name, labels=labels, message_storage_policy=message_storage_policy |
269 | 270 | ) |
| 271 | + if metadata is None: |
| 272 | + metadata = [] |
| 273 | + metadata = list(metadata) |
| 274 | + try: |
| 275 | + routing_header = [("name", name)] |
| 276 | + except AttributeError: |
| 277 | + pass |
| 278 | + else: |
| 279 | + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( |
| 280 | + routing_header |
| 281 | + ) |
| 282 | + metadata.append(routing_metadata) |
| 283 | + |
270 | 284 | return self._inner_api_calls["create_topic"]( |
271 | 285 | request, retry=retry, timeout=timeout, metadata=metadata |
272 | 286 | ) |
@@ -341,6 +355,19 @@ def update_topic( |
341 | 355 | ) |
342 | 356 |
|
343 | 357 | request = pubsub_pb2.UpdateTopicRequest(topic=topic, update_mask=update_mask) |
| 358 | + if metadata is None: |
| 359 | + metadata = [] |
| 360 | + metadata = list(metadata) |
| 361 | + try: |
| 362 | + routing_header = [("topic.name", topic.name)] |
| 363 | + except AttributeError: |
| 364 | + pass |
| 365 | + else: |
| 366 | + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( |
| 367 | + routing_header |
| 368 | + ) |
| 369 | + metadata.append(routing_metadata) |
| 370 | + |
344 | 371 | return self._inner_api_calls["update_topic"]( |
345 | 372 | request, retry=retry, timeout=timeout, metadata=metadata |
346 | 373 | ) |
@@ -407,6 +434,19 @@ def publish( |
407 | 434 | ) |
408 | 435 |
|
409 | 436 | request = pubsub_pb2.PublishRequest(topic=topic, messages=messages) |
| 437 | + if metadata is None: |
| 438 | + metadata = [] |
| 439 | + metadata = list(metadata) |
| 440 | + try: |
| 441 | + routing_header = [("topic", topic)] |
| 442 | + except AttributeError: |
| 443 | + pass |
| 444 | + else: |
| 445 | + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( |
| 446 | + routing_header |
| 447 | + ) |
| 448 | + metadata.append(routing_metadata) |
| 449 | + |
410 | 450 | return self._inner_api_calls["publish"]( |
411 | 451 | request, retry=retry, timeout=timeout, metadata=metadata |
412 | 452 | ) |
@@ -464,6 +504,19 @@ def get_topic( |
464 | 504 | ) |
465 | 505 |
|
466 | 506 | request = pubsub_pb2.GetTopicRequest(topic=topic) |
| 507 | + if metadata is None: |
| 508 | + metadata = [] |
| 509 | + metadata = list(metadata) |
| 510 | + try: |
| 511 | + routing_header = [("topic", topic)] |
| 512 | + except AttributeError: |
| 513 | + pass |
| 514 | + else: |
| 515 | + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( |
| 516 | + routing_header |
| 517 | + ) |
| 518 | + metadata.append(routing_metadata) |
| 519 | + |
467 | 520 | return self._inner_api_calls["get_topic"]( |
468 | 521 | request, retry=retry, timeout=timeout, metadata=metadata |
469 | 522 | ) |
@@ -542,6 +595,19 @@ def list_topics( |
542 | 595 | ) |
543 | 596 |
|
544 | 597 | request = pubsub_pb2.ListTopicsRequest(project=project, page_size=page_size) |
| 598 | + if metadata is None: |
| 599 | + metadata = [] |
| 600 | + metadata = list(metadata) |
| 601 | + try: |
| 602 | + routing_header = [("project", project)] |
| 603 | + except AttributeError: |
| 604 | + pass |
| 605 | + else: |
| 606 | + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( |
| 607 | + routing_header |
| 608 | + ) |
| 609 | + metadata.append(routing_metadata) |
| 610 | + |
545 | 611 | iterator = google.api_core.page_iterator.GRPCIterator( |
546 | 612 | client=None, |
547 | 613 | method=functools.partial( |
@@ -633,6 +699,19 @@ def list_topic_subscriptions( |
633 | 699 | request = pubsub_pb2.ListTopicSubscriptionsRequest( |
634 | 700 | topic=topic, page_size=page_size |
635 | 701 | ) |
| 702 | + if metadata is None: |
| 703 | + metadata = [] |
| 704 | + metadata = list(metadata) |
| 705 | + try: |
| 706 | + routing_header = [("topic", topic)] |
| 707 | + except AttributeError: |
| 708 | + pass |
| 709 | + else: |
| 710 | + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( |
| 711 | + routing_header |
| 712 | + ) |
| 713 | + metadata.append(routing_metadata) |
| 714 | + |
636 | 715 | iterator = google.api_core.page_iterator.GRPCIterator( |
637 | 716 | client=None, |
638 | 717 | method=functools.partial( |
@@ -703,6 +782,19 @@ def delete_topic( |
703 | 782 | ) |
704 | 783 |
|
705 | 784 | request = pubsub_pb2.DeleteTopicRequest(topic=topic) |
| 785 | + if metadata is None: |
| 786 | + metadata = [] |
| 787 | + metadata = list(metadata) |
| 788 | + try: |
| 789 | + routing_header = [("topic", topic)] |
| 790 | + except AttributeError: |
| 791 | + pass |
| 792 | + else: |
| 793 | + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( |
| 794 | + routing_header |
| 795 | + ) |
| 796 | + metadata.append(routing_metadata) |
| 797 | + |
706 | 798 | self._inner_api_calls["delete_topic"]( |
707 | 799 | request, retry=retry, timeout=timeout, metadata=metadata |
708 | 800 | ) |
@@ -773,6 +865,19 @@ def set_iam_policy( |
773 | 865 | ) |
774 | 866 |
|
775 | 867 | request = iam_policy_pb2.SetIamPolicyRequest(resource=resource, policy=policy) |
| 868 | + if metadata is None: |
| 869 | + metadata = [] |
| 870 | + metadata = list(metadata) |
| 871 | + try: |
| 872 | + routing_header = [("resource", resource)] |
| 873 | + except AttributeError: |
| 874 | + pass |
| 875 | + else: |
| 876 | + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( |
| 877 | + routing_header |
| 878 | + ) |
| 879 | + metadata.append(routing_metadata) |
| 880 | + |
776 | 881 | return self._inner_api_calls["set_iam_policy"]( |
777 | 882 | request, retry=retry, timeout=timeout, metadata=metadata |
778 | 883 | ) |
@@ -833,6 +938,19 @@ def get_iam_policy( |
833 | 938 | ) |
834 | 939 |
|
835 | 940 | request = iam_policy_pb2.GetIamPolicyRequest(resource=resource) |
| 941 | + if metadata is None: |
| 942 | + metadata = [] |
| 943 | + metadata = list(metadata) |
| 944 | + try: |
| 945 | + routing_header = [("resource", resource)] |
| 946 | + except AttributeError: |
| 947 | + pass |
| 948 | + else: |
| 949 | + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( |
| 950 | + routing_header |
| 951 | + ) |
| 952 | + metadata.append(routing_metadata) |
| 953 | + |
836 | 954 | return self._inner_api_calls["get_iam_policy"]( |
837 | 955 | request, retry=retry, timeout=timeout, metadata=metadata |
838 | 956 | ) |
@@ -903,6 +1021,19 @@ def test_iam_permissions( |
903 | 1021 | request = iam_policy_pb2.TestIamPermissionsRequest( |
904 | 1022 | resource=resource, permissions=permissions |
905 | 1023 | ) |
| 1024 | + if metadata is None: |
| 1025 | + metadata = [] |
| 1026 | + metadata = list(metadata) |
| 1027 | + try: |
| 1028 | + routing_header = [("resource", resource)] |
| 1029 | + except AttributeError: |
| 1030 | + pass |
| 1031 | + else: |
| 1032 | + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( |
| 1033 | + routing_header |
| 1034 | + ) |
| 1035 | + metadata.append(routing_metadata) |
| 1036 | + |
906 | 1037 | return self._inner_api_calls["test_iam_permissions"]( |
907 | 1038 | request, retry=retry, timeout=timeout, metadata=metadata |
908 | 1039 | ) |
0 commit comments