
                         L    S r SSKJr  SSKJr  SSKJr  SSKJr       SS jrg)	z.Utilities for AI Platform operations commands.    )absolute_import)division)unicode_literals)logNc                     [         R                  [         R                  [         R                  S.nU(       a'  UR	                  U5      b  X   " UR
                  US9  U$ U R                  XXWS9R                  $ )aL  Waits for an operation if asynchronous flag is off.

Args:
  operations_client: api_lib.ai.operations.OperationsClient, the client via
    which to poll.
  op: Cloud AI Platform operation, the operation to poll.
  op_ref: The operation reference to the operation resource. It's the result
    by calling resources.REGISTRY.Parse
  asynchronous: bool, whether to wait for the operation or return immediately
  log_method: Logging method used for synchronous operation. If None, no log
  message: str, the message to display while waiting for the operation.
  kind: str, the resource kind (instance, cluster, project, etc.), which will
    be passed to logging function.
  max_wait_ms: int, number of ms to wait before raising WaitException.

Returns:
  The result of the operation if asynchronous is true, or the Operation
    message otherwise
)createdeleteupdate)kind)messagemax_wait_ms)r   CreatedResourceDeletedResourceUpdatedResourcegetnameWaitForOperationresponse)	operations_clientopop_refasynchronous
log_methodr   r   r   logging_functions	            4lib/googlecloudsdk/command_lib/ai/operations_util.pyWaitForOpMayber      su    < ######
 J'3"2776I		+	+' 
, 
H    )FNNNi@w )__doc__
__future__r   r   r   googlecloudsdk.corer   r    r   r   <module>r"      s,    5 &  ' # 	(r   