
                         ~   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  ej                  ej                  j                         G d	 d
ej                               Z ej                  ej                  j"                  ej                  j$                         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                   6    e Zd ZdZed        Zed        Zd Zy)	ListAlphaa  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

  ## 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                 ~   | j                  d      }t        j                         j                  |       t        j                  d      j                  |       t
        j                  j                  |        | j                  j                  d       | j                  j                  t        j                         y )NT)requiredF)
positional
          table(
            projectId,
            billingAccountName.basename():label=BILLING_ACCOUNT_ID,
            billingEnabled
          )
    )add_mutually_exclusive_groupr   GetOldAccountIdArgumentAddToParserGetAccountIdArgumentr   URI_FLAGRemoveFromParserdisplay_info	AddFormatAddCacheUpdaterBillingAccountsCompleter)parseraccount_args_groups     $lib/surface/billing/projects/list.pyArgszListAlpha.Args.   s    <<d<K	!!#//0BC	%0<<=OPMM""6*
!! # 	 ''(F(FG    c                       yzNo resource URIs.N r!   r   r   GetUriCacheUpdateOpzListAlpha.GetUriCacheUpdateOp>        r   c                     t        j                         }t        j                  |j                  xs |j
                        }|j                  ||j                        S zRun the list command.)limit)r   ProjectsClientr	   ParseAccountidbilling_accountListr&   selfargsclientaccount_refs       r   RunzListAlpha.RunC   sF    **,F$$TWW%D0D0DEK;;{$**;55r   N__name__
__module____qualname____doc__staticmethodr   r"   r1   r!   r   r   r   r      s6    " H H  6r   r   c                   6    e Zd ZdZed        Zed        Zd Zy)r+   a>  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} --billing-account=0X0X0X-0X0X0X-0X0X0X
  c                     t        j                  dd      j                  |        t        j                  j                  |        | j                  j                  d       y )NFT)r   r   r   )r   r   r   r   r   r   r   r   )r   s    r   r   z	List.ArgsX   sJ    	%(,..9k&.AMM""6*
!! # 	r   c                       yr    r!   r!   r   r   r"   zList.GetUriCacheUpdateOpe   r#   r   c                     t        j                         }t        j                  |j                        }|j                  ||j                        S r%   )r   r'   r	   r(   r*   r+   r&   r,   s       r   r1   zList.Runj   s=    **,F$$T%9%9:K;;{$**;55r   Nr2   r!   r   r   r+   r+   J   s4    
 
	 
	  6r   r+   N)r6   
__future__r   r   r   googlecloudsdk.api_lib.billingr   googlecloudsdk.callioper   "googlecloudsdk.command_lib.billingr   r	   ReleaseTracksReleaseTrackALPHAListCommandr   BETAGAr+   r!   r   r   <module>rF      s    E &  ' 9 ( 4 4 D%%++,+6   +6 -+6\ D%%**D,=,=,@,@A#64 #6 B#6r   