
    `                         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>Command to list all Project IDs linked with a billing account.    )absolute_import)division)unicode_literals)billing_client)base)flags)utilsc                   &    e Zd ZdZed        Zd Zy)Lista,  List all active projects associated with the specified billing account.

  *{command}* ACCOUNT_ID -- lists all active projects, for the specified
  billing account id.

  ## EXAMPLES

  To list projects linked to billing account `0X0X0X-0X0X0X-0X0X0X`, run:

      $ {command} 0X0X0X-0X0X0X-0X0X0X
  c                 b   | j                  d      }t        j                         j                  |       t        j                  d      j                  |       t
        j                  j                  |        | j                  j                  d       | j                  j                  d        y )NT)requiredF)
positionalz
          table(
            projectId,
            billingAccountName.basename():label=BILLING_ACCOUNT_ID,
            billingEnabled
          )
    )add_mutually_exclusive_groupr   GetOldAccountIdArgumentAddToParserGetAccountIdArgumentr   URI_FLAGRemoveFromParserdisplay_info	AddFormatAddCacheUpdater)parseraccount_args_groups     -lib/surface/billing/accounts/projects/list.pyArgsz	List.Args(   s    <<d<K	!!#//0BC	%0<<=OPMM""6*
!! # 	 ''-    c                     t        j                         }t        j                  |j                  xs |j
                        }|j                  ||j                        S )zRun the list command.)limit)r   ProjectsClientr	   ParseAccountidbilling_accountr   r   )selfargsclientaccount_refs       r   RunzList.Run9   sF    **,F$$TWW%D0D0DEK;;{$**;55r   N)__name__
__module____qualname____doc__staticmethodr   r'    r   r   r   r      s     
 . . 6r   r   N)r+   
__future__r   r   r   googlecloudsdk.api_lib.billingr   googlecloudsdk.callioper   "googlecloudsdk.command_lib.billingr   r	   ListCommandr   r-   r   r   <module>r3      s2    E &  ' 9 ( 4 4"64 "6r   