
                             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 update a new project.    )absolute_import)division)unicode_literals)billing_client)base)flags)utilsc                   0    e Zd ZdZdddZed        Zd Zy)Linkz&Link a project with a billing account.z          This command links a billing account to a project.

          If the specified billing account is open, this enables billing on the
          project.
          z          To link a billing account `0X0X0X-0X0X0X-0X0X0X` with a project
          `my-project`, run:

            $ {command} my-project --billing-account=0X0X0X-0X0X0X-0X0X0X
          )DESCRIPTIONEXAMPLESc                    | j                  d      }t        j                  d      j                  |       t        j                  d      j                  |       t        j
                         j                  |        y )NT)requiredF)
positional)add_mutually_exclusive_groupr   GetOldAccountIdArgumentAddToParserGetAccountIdArgumentGetProjectIdArgument)parseraccount_args_groups     -lib/surface/billing/accounts/projects/link.pyArgsz	Link.Args-   sc    <<d<K	!!U3??	%0<<=OP	 ,,V4    c                     t        j                         }t        j                  |j                        }t        j
                  |j                        }|j                  ||      S )N)r   ProjectsClientr	   ParseProject
project_idParseAccountbilling_accountr   )selfargsclientproject_refaccount_refs        r   RunzLink.Run6   sK    **,F$$T__5K$$T%9%9:K;;{K00r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r&    r   r   r   r      s/    .- 5 51r   r   N)r*   
__future__r   r   r   googlecloudsdk.api_lib.billingr   googlecloudsdk.callioper   "googlecloudsdk.command_lib.billingr   r	   Commandr   r-   r   r   <module>r3      s/    ' &  ' 9 ( 4 414<< 1r   