
    E	                     z    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
  G d d	e
j                        Zy
)z service-management list command.    )absolute_import)division)unicode_literals)
list_pager)services_util)basec                   *    e Zd ZdZdZed        Zd Zy)ListzList services for a project.

  This command lists the services that are produced by a project.

  ## EXAMPLES

  To list the services the current project produces, run:

    $ {command}
  i  c                 x    t         j                  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.
    zj
          table(
            serviceName:label=NAME,
            serviceConfig.title
          )
        N)r   URI_FLAGRemoveFromParserdisplay_info	AddFormat)parsers    &lib/surface/endpoints/services/list.pyArgsz	List.Args*   s/     	MM""6*
!! #     c                     t        j                         }t        j                  |j                        }t        j                  |      }t        j                  |j                  ||j                  d|j                  xs | j                  d      S )zRun 'endpoints list'.

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

    Returns:
      The list of managed services for this project.
    pageSizeservices)limitbatch_size_attribute
batch_sizefield)r   GetClientInstanceGetValidatedProjectprojectGetProducedListRequestr   YieldFromListr   r   	page_size_DEFAULT_PAGE_SIZE)selfargsclientvalidated_projectrequests        r   RunzList.Run=   st     ,,.F%99$,,G223DEG##jj'>><T%<%< r   N)__name__
__module____qualname____doc__r!   staticmethodr   r'    r   r   r
   r
      s&    	  $r   r
   N)r+   
__future__r   r   r   apitools.base.pyr    googlecloudsdk.api_lib.endpointsr   googlecloudsdk.callioper   ListCommandr
   r-   r   r   <module>r3      s.     ' &  ' ' : (74 7r   