
                         J    S r SSKJr  SSKJr   " S S\R
                  5      rg)z?Client for interaction with Operations CRUD on API Gateway API.    )base)waiterc                   2    \ rS rSrSrSS jrS rS	S jrSrg)
OperationsClient   z6Client for operation objects on Cloud API Gateway API.Nc                     [         R                  R                  U USSS9  U R                  5         U R	                  SSS9  g )N%ApigatewayProjectsLocationsOperationsprojects_locations_operations)clientmessage_baseservice_name
operationsT)is_operations)r   
BaseClient__init__	DefineGet
DefineList)selfr   s     4lib/googlecloudsdk/api_lib/api_gateway/operations.pyr   OperationsClient.__init__   sA    OO<4	  6 	NNOOLO5    c                     U R                   R                  UR                  5       S9nU R                  R	                  U5      $ )zCancel an operation.

Args:
  operation_ref: The message to process (expected to be of type Operation)

Returns:
  (Empty) The response message.
)name)messages2ApigatewayProjectsLocationsOperationsCancelRequestRelativeNameserviceCancel)r   operation_refreqs      r   r   OperationsClient.Cancel$   sA     --
J
J'') K +C <<s##r   c                     Uc!  [         R                  " U R                  5      nO![         R                  " UU R                  5      nUc  SR	                  UR                  5       5      n[         R                  " XAU5      $ )a  Waits for the given google.longrunning.Operation to complete.

Args:
  operation_ref: The operation to poll.
  message: String to display for default progress_tracker.
  service: The service to get the resource after the long running operation
    completes.

Raises:
  apitools.base.py.HttpError: if the request returns an HTTP error

Returns:
  The Operation or the Resource the Operation is associated with.
z&Waiting for Operation [{}] to complete)r   CloudOperationPollerNoResourcesr   CloudOperationPollerformatr   WaitFor)r   r   messager   pollers        r   WaitForOperation!OperationsClient.WaitForOperation2   sr    0 55
,,f **

,,f 8??

$
$
&(g >>&99r    )N)NN)	__name__
__module____qualname____firstlineno____doc__r   r   r)   __static_attributes__r+   r   r   r   r      s    >6$$:r   r   N)r0   "googlecloudsdk.api_lib.api_gatewayr   googlecloudsdk.api_lib.utilr   r   r   r+   r   r   <module>r4      s#     F 4 .?:t ?:r   