|
34 | 34 | fromgoogle.apiimportlaunch_stage_pb2# type: ignore |
35 | 35 | fromgoogle.api_coreimportoperation# type: ignore |
36 | 36 | fromgoogle.api_coreimportoperation_async# type: ignore |
| 37 | +fromgoogle.cloud.locationimportlocations_pb2# type: ignore |
37 | 38 | fromgoogle.cloud.run_v2.services.revisionsimportpagers |
38 | 39 | fromgoogle.cloud.run_v2.typesimportcondition |
39 | 40 | fromgoogle.cloud.run_v2.typesimportk8s_min |
40 | 41 | fromgoogle.cloud.run_v2.typesimportrevision |
41 | 42 | fromgoogle.cloud.run_v2.typesimportvendor_settings |
| 43 | +fromgoogle.longrunningimportoperations_pb2 |
42 | 44 | fromgoogle.protobufimportduration_pb2# type: ignore |
43 | 45 | fromgoogle.protobufimporttimestamp_pb2# type: ignore |
44 | 46 | from .transports.baseimportRevisionsTransport,DEFAULT_CLIENT_INFO |
@@ -559,6 +561,169 @@ async def sample_delete_revision(): |
559 | 561 | # Done; return the response. |
560 | 562 | returnresponse |
561 | 563 |
|
| 564 | +asyncdeflist_operations( |
| 565 | +self, |
| 566 | +request:operations_pb2.ListOperationsRequest=None, |
| 567 | +*, |
| 568 | +retry:OptionalRetry=gapic_v1.method.DEFAULT, |
| 569 | +timeout:float=None, |
| 570 | +metadata:Sequence[Tuple[str,str]]= (), |
| 571 | + )->operations_pb2.ListOperationsResponse: |
| 572 | +r"""Lists operations that match the specified filter in the request. |
| 573 | +
|
| 574 | + Args: |
| 575 | + request (:class:`~.operations_pb2.ListOperationsRequest`): |
| 576 | + The request object. Request message for |
| 577 | + `ListOperations` method. |
| 578 | + retry (google.api_core.retry.Retry): Designation of what errors, |
| 579 | + if any, should be retried. |
| 580 | + timeout (float): The timeout for this request. |
| 581 | + metadata (Sequence[Tuple[str, str]]): Strings which should be |
| 582 | + sent along with the request as metadata. |
| 583 | + Returns: |
| 584 | + ~.operations_pb2.ListOperationsResponse: |
| 585 | + Response message for ``ListOperations`` method. |
| 586 | + """ |
| 587 | +# Create or coerce a protobuf request object. |
| 588 | +# The request isn't a proto-plus wrapped type, |
| 589 | +# so it must be constructed via keyword expansion. |
| 590 | +ifisinstance(request,dict): |
| 591 | +request=operations_pb2.ListOperationsRequest(**request) |
| 592 | + |
| 593 | +# Wrap the RPC method; this adds retry and timeout information, |
| 594 | +# and friendly error handling. |
| 595 | +rpc=gapic_v1.method.wrap_method( |
| 596 | +self._client._transport.list_operations, |
| 597 | +default_timeout=None, |
| 598 | +client_info=DEFAULT_CLIENT_INFO, |
| 599 | + ) |
| 600 | + |
| 601 | +# Certain fields should be provided within the metadata header; |
| 602 | +# add these here. |
| 603 | +metadata=tuple(metadata)+ ( |
| 604 | +gapic_v1.routing_header.to_grpc_metadata((("name",request.name),)), |
| 605 | + ) |
| 606 | + |
| 607 | +# Send the request. |
| 608 | +response=awaitrpc( |
| 609 | +request, |
| 610 | +retry=retry, |
| 611 | +timeout=timeout, |
| 612 | +metadata=metadata, |
| 613 | + ) |
| 614 | + |
| 615 | +# Done; return the response. |
| 616 | +returnresponse |
| 617 | + |
| 618 | +asyncdefget_operation( |
| 619 | +self, |
| 620 | +request:operations_pb2.GetOperationRequest=None, |
| 621 | +*, |
| 622 | +retry:OptionalRetry=gapic_v1.method.DEFAULT, |
| 623 | +timeout:float=None, |
| 624 | +metadata:Sequence[Tuple[str,str]]= (), |
| 625 | + )->operations_pb2.Operation: |
| 626 | +r"""Gets the latest state of a long-running operation. |
| 627 | +
|
| 628 | + Args: |
| 629 | + request (:class:`~.operations_pb2.GetOperationRequest`): |
| 630 | + The request object. Request message for |
| 631 | + `GetOperation` method. |
| 632 | + retry (google.api_core.retry.Retry): Designation of what errors, |
| 633 | + if any, should be retried. |
| 634 | + timeout (float): The timeout for this request. |
| 635 | + metadata (Sequence[Tuple[str, str]]): Strings which should be |
| 636 | + sent along with the request as metadata. |
| 637 | + Returns: |
| 638 | + ~.operations_pb2.Operation: |
| 639 | + An ``Operation`` object. |
| 640 | + """ |
| 641 | +# Create or coerce a protobuf request object. |
| 642 | +# The request isn't a proto-plus wrapped type, |
| 643 | +# so it must be constructed via keyword expansion. |
| 644 | +ifisinstance(request,dict): |
| 645 | +request=operations_pb2.GetOperationRequest(**request) |
| 646 | + |
| 647 | +# Wrap the RPC method; this adds retry and timeout information, |
| 648 | +# and friendly error handling. |
| 649 | +rpc=gapic_v1.method.wrap_method( |
| 650 | +self._client._transport.get_operation, |
| 651 | +default_timeout=None, |
| 652 | +client_info=DEFAULT_CLIENT_INFO, |
| 653 | + ) |
| 654 | + |
| 655 | +# Certain fields should be provided within the metadata header; |
| 656 | +# add these here. |
| 657 | +metadata=tuple(metadata)+ ( |
| 658 | +gapic_v1.routing_header.to_grpc_metadata((("name",request.name),)), |
| 659 | + ) |
| 660 | + |
| 661 | +# Send the request. |
| 662 | +response=awaitrpc( |
| 663 | +request, |
| 664 | +retry=retry, |
| 665 | +timeout=timeout, |
| 666 | +metadata=metadata, |
| 667 | + ) |
| 668 | + |
| 669 | +# Done; return the response. |
| 670 | +returnresponse |
| 671 | + |
| 672 | +asyncdefdelete_operation( |
| 673 | +self, |
| 674 | +request:operations_pb2.DeleteOperationRequest=None, |
| 675 | +*, |
| 676 | +retry:OptionalRetry=gapic_v1.method.DEFAULT, |
| 677 | +timeout:float=None, |
| 678 | +metadata:Sequence[Tuple[str,str]]= (), |
| 679 | + )->None: |
| 680 | +r"""Deletes a long-running operation. |
| 681 | +
|
| 682 | + This method indicates that the client is no longer interested |
| 683 | + in the operation result. It does not cancel the operation. |
| 684 | + If the server doesn't support this method, it returns |
| 685 | + `google.rpc.Code.UNIMPLEMENTED`. |
| 686 | +
|
| 687 | + Args: |
| 688 | + request (:class:`~.operations_pb2.DeleteOperationRequest`): |
| 689 | + The request object. Request message for |
| 690 | + `DeleteOperation` method. |
| 691 | + retry (google.api_core.retry.Retry): Designation of what errors, |
| 692 | + if any, should be retried. |
| 693 | + timeout (float): The timeout for this request. |
| 694 | + metadata (Sequence[Tuple[str, str]]): Strings which should be |
| 695 | + sent along with the request as metadata. |
| 696 | + Returns: |
| 697 | + None |
| 698 | + """ |
| 699 | +# Create or coerce a protobuf request object. |
| 700 | +# The request isn't a proto-plus wrapped type, |
| 701 | +# so it must be constructed via keyword expansion. |
| 702 | +ifisinstance(request,dict): |
| 703 | +request=operations_pb2.DeleteOperationRequest(**request) |
| 704 | + |
| 705 | +# Wrap the RPC method; this adds retry and timeout information, |
| 706 | +# and friendly error handling. |
| 707 | +rpc=gapic_v1.method.wrap_method( |
| 708 | +self._client._transport.delete_operation, |
| 709 | +default_timeout=None, |
| 710 | +client_info=DEFAULT_CLIENT_INFO, |
| 711 | + ) |
| 712 | + |
| 713 | +# Certain fields should be provided within the metadata header; |
| 714 | +# add these here. |
| 715 | +metadata=tuple(metadata)+ ( |
| 716 | +gapic_v1.routing_header.to_grpc_metadata((("name",request.name),)), |
| 717 | + ) |
| 718 | + |
| 719 | +# Send the request. |
| 720 | +awaitrpc( |
| 721 | +request, |
| 722 | +retry=retry, |
| 723 | +timeout=timeout, |
| 724 | +metadata=metadata, |
| 725 | + ) |
| 726 | + |
562 | 727 | asyncdef__aenter__(self): |
563 | 728 | returnself |
564 | 729 |
|
|