
                            S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
  SSK	Jr  S	S
SS.rS r\R                  " \R                  R                   5       " S S\R"                  5      5       r\R                  " \R                  R&                  \R                  R(                  5       " S S\R"                  5      5       rg)z Command to update a new project.    )absolute_import)division)unicode_literals)billing_client)base)flags)utilsaV            This command sets or updates the billing account associated with a
          project.

          Billing is enabled on a project when the project is linked to a valid,
          active Cloud Billing account. The billing account accrues charges
          for the usage of resources in all of the linked projects. If the
          project is already linked to a billing account, this command moves
          the project to the billing account you specify, updating the billing
          account that is linked to the project.

          Note that associating a project with a closed billing account has the
          same effect as disabling billing on the project: any paid resources
          in use by the project are shut down, and your application stops
          functioning. Unless you want to disable billing, you should always
          specify a valid, active Cloud Billing account when you run this
          command. Learn how to confirm the status of a Cloud Billing account at
          https://cloud.google.com/billing/docs/how-to/verify-billing-enabled#billing_account_status
          z          To link a billing account `0X0X0X-0X0X0X-0X0X0X` with a project
          `my-project`, run:

            $ {command} my-project --billing-account=0X0X0X-0X0X0X-0X0X0X
          z          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
          )DESCRIPTIONEXAMPLESzAPI REFERENCEc                     [         R                  " 5       n[        R                  " U R                  5      n[        R
                  " U R                  5      nUR                  X#5      $ N)r   ProjectsClientr	   ParseProject
project_idParseAccountbilling_accountLink)argsclientproject_refaccount_refs       $lib/surface/billing/projects/link.py_RunLinkr   =   sI    ((*&""4??3+""4#7#78+	[	..    c                   2    \ rS rSrSr\r\S 5       rS r	Sr
g)	LinkAlphaD   &Link a project with a billing account.c                     U R                  SS9n[        R                  " SS9R                  U5        [        R                  " SS9R                  U5        [        R
                  " 5       R                  U 5        g )NT)requiredF)
positional)add_mutually_exclusive_groupr   GetOldAccountIdArgumentAddToParserGetAccountIdArgumentGetProjectIdArgument)parseraccount_args_groups     r   ArgsLinkAlpha.ArgsJ   sc    <<d<K	!!U3??	%0<<=OP	 ,,V4r   c                     [        U5      $ r   r   selfr   s     r   RunLinkAlpha.RunS       D>r    N__name__
__module____qualname____firstlineno____doc___DETAILED_HELPdetailed_helpstaticmethodr)   r/   __static_attributes__r2   r   r   r   r   D   s!    . -5 5r   r   c                   2    \ rS rSrSr\r\S 5       rS r	Sr
g)r   W   r   c                     [         R                  " SSS9R                  U 5        [         R                  " 5       R                  U 5        g )NFT)r!   r    )r   r%   r$   r&   )r'   s    r   r)   	Link.Args]   s6    	%(,..9k&.A	 ,,V4r   c                     [        U5      $ r   r,   r-   s     r   r/   Link.Runc   r1   r   r2   Nr3   r2   r   r   r   r   W   s!    . -5 5
r   r   N)r8   
__future__r   r   r   googlecloudsdk.api_lib.billingr   googlecloudsdk.callioper   "googlecloudsdk.command_lib.billingr   r	   r9   r   ReleaseTracksReleaseTrackALPHACommandr   BETAGAr   r2   r   r   <module>rM      s    ' &  ' 9 ( 4 4&5D/ D%%++,  -$ D%%**D,=,=,@,@A4<<  Br   