
                             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  G d	 d
e
j                        Zy)z!The configs waiters list command.    )absolute_import)division)unicode_literals)
list_pager)util)base)flagsc                   2    e Zd ZdZdZddiZed        Zd Zy)Listz}List waiter resources within a configuration.

  This command lists the waiter resources within a specified configuration.
  d   EXAMPLESa  
          To list all waiters within the configuration named "my-config", run:

            $ {command} --config-name=my-config

          The --filter parameter can be used to filter results based on content.
          For example, to list all waiters with names that begin with 'foo',
          run:

            $ {command} --config-name=my-config --filter='name=foo*'
          c                 d    t        j                  |        | j                  j                  d       y)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>table(name, createTime.date(), waiter_status(), error.message)N)r	   AddRequiredConfigFlagdisplay_info	AddFormat)parsers    2lib/surface/runtime_config/configs/waiters/list.pyArgsz	List.Args3   s*     
'
!!HJ    c              #     K   t        j                         }t        j                         }t        j                  t        j                  |            }|j                  |j                               }|j                  xs | j                  }t        j                  ||dd|j                  |      }|D ]  }t        j                  |        yw)a$  Run 'runtime-configs waiters list'.

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

    Yields:
      The list of waiters.

    Raises:
      HttpException: An http error response was received while executing api
          request.
    )parentwaiterspageSize)fieldbatch_size_attributelimit
batch_sizeN)r   WaiterClientMessagesParseConfigName
ConfigName.RuntimeconfigProjectsConfigsWaitersListRequestRelativeName	page_sizeDEFAULT_PAGE_SIZEr   YieldFromListr   FormatWaiter)	selfargswaiter_clientmessagesconfig_resourcerequestr$   resultsresults	            r   RunzList.Run@   s      %%'M}}H**4??4+@AOEE++- F G 8$"8"8I&&wi'tzzG f%% s   CCN)	__name__
__module____qualname____doc__r%   detailed_helpstaticmethodr   r0    r   r   r   r      s;    
   
- 
J 
J &r   r   N)r4   
__future__r   r   r   apitools.base.pyr   %googlecloudsdk.api_lib.runtime_configr   googlecloudsdk.callioper   )googlecloudsdk.command_lib.runtime_configr	   ListCommandr   r7   r   r   <module>r>      s3     ( &  ' ' 6 ( ;C&4 C&r   