
    	                     Z    d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ d Z	 	 	 	 d
d	Z	y)z<Utilities for interacting with Cloud API Gateway operations.    )absolute_import)division)unicode_literals)log)	resourcesc                 ~    t         j                  j                  dj                  || j	                                      y)zPrints the operation result with wait epilogue.

  Args:
    operation_ref: Resource reference for the operation
    result: Epiloque string to be printed
  za{}. Use the following command to wait for its completion:

gcloud api-gateway operations wait {}
N)r   statusPrintformatRelativeName)operation_refresults     =lib/googlecloudsdk/command_lib/api_gateway/operations_util.py$PrintOperationResultWithWaitEpiloguer      s2     **  F6=--/0	2    Nc                     t         j                  j                  | d      }|rt        ||       y|j	                  |||      S )a  Prints results for an operation.

  Args:
    op_name: name of the operation.
    op_client: client for accessing operation data.
    service: the service which operation result can be grabbed.
    wait_string: string to use while waiting for polling operation
    async_string: string to print out for operation waiting
    is_async: whether to wait for aync operations or not.

  Returns:
    The object which is returned by the service if async is false,
    otherwise null
  z(apigateway.projects.locations.operations)
collectionN)r   REGISTRYParser   WaitForOperation)op_name	op_clientservicewait_stringasync_stringis_asyncr   s          r   PrintOperationResultr   )   sI    & $$**; + =- (E%%m['JJr   )Nz"Waiting for long running operationz%Asynchronous operation is in progressF)
__doc__
__future__r   r   r   googlecloudsdk.corer   r   r   r    r   r   <module>r"      s3     C &  ' # )2 6:%I&M"'Kr   