
                             d Z ddlmZ ddlmZ ddlmZ ddlZddlmZ ddlm	Z	 ddl
mZ d	d
dZ e	j                  e	j                  j                         G d de	j                                Zee_        y)z'ids operations wait' command.    )absolute_import)division)unicode_literalsN)ids_api)base)flagsz?
          Wait for a Cloud IDS operation to complete.
        aA  
          To get a description of an operation called `my-operation` in
          project `my-project` and zone `us-central1-a`, run:

          $ {command} my-operation --project=my-project --zone=us-central1-a

          OR

          $ {command} projects/myproject/locations/us-central1-a/operations/my-operation
    )DESCRIPTIONEXAMPLESc                   &    e Zd ZdZed        Zd Zy)Waitz+Wait for a Cloud IDS operation to complete.c                 Z    t        j                  |        t        j                  | d       y )N60m)r   AddOperationResource
AddMaxWait)parsers    "lib/surface/ids/operations/wait.pyArgsz	Wait.Args1   s     	v&	VU#    c                     |j                   j                  j                         }t        j                  |j
                        }t        j                  | j                               }|j                  |dd|      S )N)secondsz!Waiting for operation to completeF)operation_refmessage
has_resultmax_wait)
CONCEPTS	operationParsedatetime	timedeltar   r   ClientReleaseTrackWaitForOperation)selfargsr   r   clients        r   RunzWait.Run6   si    ''--/I!!$--8H^^D--/0F""3	 #  r   N)__name__
__module____qualname____doc__staticmethodr   r&    r   r   r   r   -   s    3$ $	r   r   )r*   
__future__r   r   r   r   googlecloudsdk.api_lib.idsr   googlecloudsdk.callioper   googlecloudsdk.command_lib.idsr   DETAILED_HELPReleaseTracksr!   ALPHACommandr   detailed_helpr,   r   r   <module>r6      sr    % &  '  . ( 0			& D%%++,4<<  -( # r   