
    6                         S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJ	r	  SSK
Jr   " S	 S
\	R                  5      rg)z!The configs waiters wait command.    )absolute_import)division)unicode_literals)util)arg_parsers)base)flagsc                   6    \ rS rSrSrSS0r\S 5       rS rSr	g)	Wait   zoWait for a waiter to end in success or failure.

This command waits for a waiter to end in success or failure.
EXAMPLESz
          To wait for a waiter named "my-waiter" within a configuration named
          "my-config", run:

            $ {command} my-waiter --config-name=my-config
          c           	          [         R                  " U 5        U R                  S[        R                  " SSR                  [        R                  5      S9SS9  U R                  SSS	9  g
)zArgs is called by calliope to gather arguments for this command.

Args:
  parser: An argparse parser that you can use to add arguments that go
      on the command line after this command. Positional arguments are
      allowed.
z
--max-wait1sz{0}s)lower_boundupper_boundz        The maximum amount of time to wait for a waiter to finish.
        See $ gcloud topic datetimes for information on duration formats.
        )typehelpnamezThe waiter name.)r   N)r	   AddRequiredConfigFlagadd_argumentr   Durationformatr   MAX_WAITER_TIMEOUT)parsers    2lib/surface/runtime_config/configs/waiters/wait.pyArgs	Wait.Args+   si     
'
!!d.4mm&*&=&=/?@   %78    c                     [         R                  " UR                  U5      n[         R                  " X!R                  S9n[         R
                  " U5      (       a  SU l        [         R                  " U5      $ )al  Run 'runtime-configs waiters wait'.

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

Returns:
  The requested waiter, after waiting for it to succeed or fail.

Raises:
  HttpException: An http error response was received while executing api
      request.
  OperationTimeoutError: If the waiter doesn't complete in time.
)max_wait   )r   ParseWaiterNamer   WaitForWaiterr    IsFailedWaiter	exit_codeFormatWaiter)selfargswaiter_resourceresults       r   RunWait.RunB   sW     **499d;O--HF6""dnV$$r   )r%   N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   r+   __static_attributes__ r   r   r   r      s1      - 9 9,%r   r   N)r1   
__future__r   r   r   %googlecloudsdk.api_lib.runtime_configr   googlecloudsdk.callioper   r   )googlecloudsdk.command_lib.runtime_configr	   Commandr   r5   r   r   <module>r;      s/     ( &  ' 6 / ( ;9%4<< 9%r   