
    )                     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
)zECommand to list all billing accounts associated with the active user.    )absolute_import)division)unicode_literals)billing_client)base)	resourcesc                   6    e Zd ZdZed        Zed        Zd Zy)Lista  List all active billing accounts.

  `{command}` lists all billing accounts and subaccounts owned by the currently
  authenticated user. Subaccounts have a non-empty MASTER_ACCOUNT_ID value.

  ## EXAMPLES

  To list only open billing accounts, run:

      $ {command} --filter=open=true

  ## API REFERENCE

  This command uses the *cloudbilling/v1* API. The full documentation for this
  API can be found at: https://cloud.google.com/billing/v1/getting-started
  c                 t    t         j                  j                  | j                  d      j	                         S )Nzcloudbilling.billingAccounts)
collection)r   REGISTRYParsenameSelfLink)accounts    $lib/surface/billing/accounts/list.py
ToSelfLinkzList.ToSelfLink,   s3    ##!? $ AAIL    c                     | j                   j                  d       | j                   j                  t        j                         y )Nz
          table(
            name.basename():label=ACCOUNT_ID,
            displayName:label=NAME,
            open,
            masterBillingAccount.basename():label=MASTER_ACCOUNT_ID
          )
    )display_info	AddFormat
AddUriFuncr
   r   )parsers    r   Argsz	List.Args1   s5    
!! # 	 ""4??3r   c                 b    t        j                         }|j                  |j                        S )zRun the list command.)limit)r   AccountsClientr
   r   )selfargsclients      r   RunzList.Run=   s%    **,F;;TZZ;((r   N)__name__
__module____qualname____doc__staticmethodr   r   r!    r   r   r
   r
      s6    " L L 	4 	4)r   r
   N)r%   
__future__r   r   r   googlecloudsdk.api_lib.billingr   googlecloudsdk.callioper   googlecloudsdk.corer   ListCommandr
   r'   r   r   <module>r-      s/    L &  ' 9 ( )&)4 &)r   