
    V                        S r SSKrSSKJr  SSKJr  SSKJr  SSKJr  \R                  \R                  " \R                  R                  \R                  R                  5       " S S\R                  5      5       5       r\R                  " \R                  R                   5       " S	 S
\R                  5      5       rg)zservices list command.    N)services_util)serviceusage)base)common_flagsc                   .    \ rS rSrSr\S 5       rS rSrg)	ListAlpha   a  List services for a project, folder or organization.

This command lists the services that are enabled or available to be enabled
by a project, folder or organization. Service enablement and availability can
be inherited from
resource ancestors. A resource's enabled services include services that are
enabled on the resource itself and enabled on all resource ancestors.
services by using exactly one of the `--enabled` or `--available` flags.
`--enabled` is the default.

## EXAMPLES

To list the services the current project has enabled for consumption, run:

  $ {command} --enabled

To list the services the current project can enable for
consumption, run:

  $ {command} --available
c                 F   U R                  SS9nUR                  SSSS9  UR                  SSSS9  [        R                  " U 5        [        R
                  R                  U S	5        [        R                  R                  U 5        U R                  R                  S
5        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.
Frequired	--enabled
store_truezT(DEFAULT) Return the services which the project, folder or organization has enabled.actionhelp--availablezOReturn the services available to the project, folder or organization to enable.i  zV
        table(
            name:label=NAME:sort=1,
            title
        )
      N)add_mutually_exclusive_groupadd_argumentr   add_resource_argsr   PAGE_SIZE_FLAG
SetDefaultURI_FLAGRemoveFromParserdisplay_info	AddFormatparser
mode_groups     lib/surface/services/list.pyArgsListAlpha.Args4   s     44e4DJ)	   9	   ""6*""640 	MM""6*
!! #
     c           	      .   UR                   (       d  UR                  (       d  SUl         UR                  S5      (       a  UR                  nO [        R
                  " UR                  5      nUR                  S5      (       a  UR                  nOSnUR                  S5      (       a  UR                  nOSnUR                  S5      (       a  UR                  nO[        R                  n[        R                  " UUR                   UR                  UUUS9$ )zRun 'services list'.

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

Returns:
  The list of services for this project.
TprojectfolderNorganizationlimit)r%   r&   )enabled	availableIsSpecifiedr$   r   GetValidatedProjectr%   r&   r'   sysmaxsizer   ListServicesV2Beta	page_size)selfargsr$   r%   r&   r'   s         r   RunListAlpha.Run^   s     LLDNNdl	""g11$,,?g!!{{ff''&&ll  jjekke**! r"    N	__name__
__module____qualname____firstlineno____doc__staticmethodr    r2   __static_attributes__r4   r"   r   r   r      s!    , ' 'R'r"   r   c                   .    \ rS rSrSr\S 5       rS rSrg)List   a  List services for a project.

This command lists the services that are enabled or available to be enabled
by a project. You can choose the mode in which the command will list
services by using exactly one of the `--enabled` or `--available` flags.
`--enabled` is the default.

## EXAMPLES

To list the services for  the current project has enabled for consumption,
run:

  $ {command} --enabled

To list the services for the current project can enable for consumption, run:

  $ {command} --available

To list the services for project `my-project` has enabled for consumption,
run:

  $ {command} --enabled --project=my-project

To list the services the project `my-project` can enable for consumption, run:

  $ {command} --available --project=my-project
c                    U R                  SS9nUR                  SSSS9  UR                  SSSS9  [        R                  R	                  U S	5        [        R
                  R                  U 5        U R                  R                  S
5        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.
Fr   r   r   z<(DEFAULT) Return the services which the project has enabled.r   r   zReturn the services available to the project to enable. This list will include any services that the project has already enabled.   zj
          table(
            config.name:label=NAME:sort=1,
            config.title
          )
        N)	r   r   r   r   r   r   r   r   r   r   s     r   r    	List.Args   s     44e4DJ%  ' %  ' 	""63/ 	MM""6*
!! # r"   c                     UR                   (       d  UR                  (       d  SUl         [        R                  " UR                  5      n[
        R                  " X!R                   UR                  UR                  5      $ )zRun 'services list'.

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

Returns:
  The list of services for this project.
T)	r(   r)   r   r+   r$   r   ListServicesr/   r'   )r0   r1   r$   s      r   r2   List.Run   sR     LLDNNdl//=G$$t~~tzz r"   r4   Nr5   r4   r"   r   r>   r>      s!    8 " "Hr"   r>   )r:   r,   googlecloudsdk.api_lib.servicesr   r   googlecloudsdk.callioper   #googlecloudsdk.command_lib.servicesr   UniverseCompatibleReleaseTracksReleaseTrackALPHABETAListCommandr   GAr>   r4   r"   r   <module>rP      s      
 9 8 ( < D%%++T->->-C-CDh   h E hV D%%(()T4 T *Tr"   