
    P                     L    S r SSKJr  SSKJr   " S S\5      r " S S\5      rg)	z#Client class for Cloud Billing API.    )
list_pager)utilsc                   2    \ rS rSrSrSS jrS rS	S jrSrg)
AccountsClient   z/High-level client for billing accounts service.Nc                     U=(       d    [         R                  " 5       U l        U=(       d    U R                  R                  U l        U R                  R
                  U l        g N)r   	GetClientclientMESSAGES_MODULEmessagesbillingAccounts_serviceselfr   r   s      4lib/googlecloudsdk/api_lib/billing/billing_client.py__init__AccountsClient.__init__   s<    -EOO-DK; ; ;DMKK//DM    c                     U R                   R                  U R                  R                  UR	                  5       S95      $ Nname)r   Getr   %CloudbillingBillingAccountsGetRequestRelativeName)r   account_refs     r   r   AccountsClient.Get   s<    ==;;))+ 	< 	-. .r   c                 v    [         R                  " U R                  U R                  R	                  5       SSUS9$ )Nr   pageSizefieldbatch_size_attributelimit)r   YieldFromListr   r   &CloudbillingBillingAccountsListRequest)r   r$   s     r   ListAccountsClient.List$   s5    ##<<>' r   )r   r   r   NNr	   )	__name__
__module____qualname____firstlineno____doc__r   r   r'   __static_attributes__ r   r   r   r      s    70
.
r   r   c                   8    \ rS rSrSrS	S jrS rS rS
S jrSr	g)ProjectsClient.   z/High-level client for billing projects service.Nc                     U=(       d    [         R                  " 5       U l        U=(       d    U R                  R                  U l        g r	   )r   r
   r   r   r   r   s      r   r   ProjectsClient.__init__1   s+    -EOO-DK; ; ;DMr   c                     U R                   R                  R                  U R                  R	                  UR                  5       S95      $ r   )r   projectsGetBillingInfor   )CloudbillingProjectsGetBillingInfoRequestr   )r   project_refs     r   r   ProjectsClient.Get7   sC    ;;..??))+ 	@ 	
 r   c           	          U(       a  UR                  5       OSnU R                  R                  R                  U R                  R                  UR                  5       U R                  R                  US9S95      $ )a*  Link the given account to the given project.

Args:
  project_ref: a Resource reference to the project to be linked to
  account_ref: a Resource reference to the account to link, or None to
    unlink the project from its current account.

Returns:
  ProjectBillingInfo, the new ProjectBillingInfo
 )billingAccountName)r   projectBillingInfo)r   r   r7   UpdateBillingInfor   ,CloudbillingProjectsUpdateBillingInfoRequestProjectBillingInfo)r   r:   r   billing_account_names       r   LinkProjectsClient.Link>   st     :E;335";;11BB))+#}}??#7  @   	C 	
 r   c                     [         R                  " U R                  R                  U R                  R                  UR                  5       S9SSUS9$ )Nr   r?   r    r!   )r   r%   r   billingAccounts_projectsr   .CloudbillingBillingAccountsProjectsListRequestr   )r   r   r$   s      r   r'   ProjectsClient.ListS   sQ    ##,,DD))+ 	E 	
 #' r   )r   r   r)   r	   )
r*   r+   r,   r-   r.   r   r   rD   r'   r/   r0   r   r   r2   r2   .   s    7<*	r   r2   N)r.   apitools.base.pyr   googlecloudsdk.api_lib.billingr   objectr   r2   r0   r   r   <module>rM      s*    * ( 0V ..V .r   