
    	                     D   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dlm	Z	 ddlm
Z
 dd	lmZ dd
lmZ  e
j                  e
j                   j"                  e
j                   j$                  e
j                   j&                         G d de
j(                               Zy)z;Retrieves information about a Cloud SQL instance operation.    )absolute_import)division)unicode_literals)api_util)
operations)arg_parsers)base)flags)
propertiesc                   &    e Zd ZdZed        Zd Zy)Waitz-Waits for one or more operations to complete.c                     t        j                  |        | j                  dt        j                  dd      dd       | j
                  j                  t         j                         y )Nz	--timeoutr   T)lower_bound	unlimitedi,  zMaximum number of seconds to wait for an operation to complete. By default, wait for 300s. Set to *unlimited* to wait indefinitely.)typedefaulthelp)r
   AddOperationArgumentadd_argumentr   
BoundedIntdisplay_info	AddFormatOPERATION_FORMAT_BETA)parsers    "lib/surface/sql/operations/wait.pyArgsz	Wait.Args"   sZ    	v&
##TB	    !!%"="=>    c              #     K   t        j                  t         j                        }|j                  }|j                  D ]  }|j
                  j                  |ddt        j                  j                  j                  j                  i      }t        j                  j                  ||dj                  |      |j                           yw)zWait for a Cloud SQL instance operation.

    Args:
      args: argparse.Namespace, The arguments that this command was invoked
        with.

    Yields:
      Operations that were waited for.
    zsql.operationsproject)
collectionparamszWaiting for [{operation}])	operation)max_wait_secondsN)r   	SqlClientAPI_VERSION_DEFAULT
sql_clientr"   resource_parserParser   VALUEScorer   	GetOrFailr   OperationsV1Beta4WaitForOperationformattimeout)selfargsclientr&   opoperation_refs         r   RunzWait.Run.   s       < <=F""Jnn,,22
%Z..33;;EEF 3 Hm
 ((99


%
,
,}
,
E<<	 : ) ) s   CCN)__name__
__module____qualname____doc__staticmethodr   r5    r   r   r   r      s     6	? 	?)r   r   N)r9   
__future__r   r   r   googlecloudsdk.api_lib.sqlr   r   googlecloudsdk.callioper   r	   googlecloudsdk.command_lib.sqlr
   googlecloudsdk.corer   ReleaseTracksReleaseTrackGABETAALPHACommandr   r;   r   r   <module>rG      s}    B &  ' / 1 / ( 0 * D%%(($*;*;*@*@%%++-&)4<< &)-&)r   