
    <                     r   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  \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.    )projects_api)base)flags)util)labels_util)logc                   .    \ rS rSrSr\S 5       rS rSrg)UpdateAlpha   a  Update the name and/or labels of a project.

Update the name and/or labels of the given project.

This command can fail for the following reasons:
* There is no project with the given ID.
* The active account does not have Owner or Editor permissions for the
  given project.

## EXAMPLES

The following command updates a project with the ID
`example-foo-bar-1` to have the name `Foo Bar & Grill` and removes the
label `dive`:

  $ {command} example-foo-bar-1 --name="Foo Bar & Grill" --remove-labels=dive

The following command updates a project with the ID `example-foo-bar-1` to
have labels `foo` and `bar` with values of `abc` and `def`, respectively:

  $ {command} example-foo-bar-1 --update-labels="foo=abc,bar=def"
c                 ,   [         R                  " S5      R                  U 5        U R                  SS9nUR	                  SSS9  UR                  S5      n[
        R                  " U5        U R                  R                  [        R                  5        g )NupdateT)required--nameNew name for the project.)helpzLabels Flags)r   GetProjectIDNumberFlagAddToParser	add_groupadd_argumentr   AddUpdateLabelsFlagsdisplay_info	AddFormatcommand_lib_utilLIST_FORMAT)parserupdate_flagslabels_groups      lib/surface/projects/update.pyArgsUpdateAlpha.Args4   s{    	  *66v>##T#2Lh-HI)).9L$$\2
!!"2">">?    c                     [         R                  R                  U5      n[        R                  " UR
                  5      n[        R                  " X1R                  US9n[        R                  " U5        U$ N)namelabels_diff)r   DiffFromUpdateArgsr   ParseProjectidr   Updater$   r   UpdatedResource)selfargsr%   project_refresults        r   RunUpdateAlpha.Run>   sX    ""11$7K"//8K  99-8:F$Mr!    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r0   __static_attributes__r2   r!   r   r
   r
      s"    . @ @r!   r
   c                   4    \ rS rSrSrS r\S 5       rS rSr	g)r*   G   a  Update the name of a project.

Update the name of the given project.

This command can fail for the following reasons:
* There is no project with the given ID.
* The active account does not have Owner or Editor permissions for the
  given project.

## EXAMPLES

The following command updates a project with the ID
`example-foo-bar-1` to have the name `Foo Bar & Grill`:

  $ {command} example-foo-bar-1 --name="Foo Bar & Grill"
c                 "    [         R                  $ )N)r   ProjectsUriFunc)r,   s    r   
GetUriFuncUpdate.GetUriFuncZ   s    +++r!   c                 p    [         R                  " S5      R                  U 5        U R                  SSSS9  g )Nr   r   Tr   )r   r   )r   GetProjectFlagr   r   )r   s    r   r   Update.Args]   s5    	"..v6
48  :r!   c                     [         R                  " UR                  5      n[        R                  " X!R
                  [        R                  " 5       S9n[        R                  " U5        U$ r#   )
r   r(   r)   r   r*   r$   r   r&   r   r+   )r,   r-   r.   r/   s       r   r0   
Update.Runc   sL    "//8K  99-8-=-=-?AF$Mr!   r2   N)
r3   r4   r5   r6   r7   r>   r8   r   r0   r9   r2   r!   r   r*   r*   G   s%    ", : :
r!   r*   N)r7   +googlecloudsdk.api_lib.cloudresourcemanagerr   googlecloudsdk.callioper   #googlecloudsdk.command_lib.projectsr   r   r   $googlecloudsdk.command_lib.util.argsr   googlecloudsdk.corer   ReleaseTracksReleaseTrackALPHAUpdateCommandr
   BETAGAr*   r2   r!   r   <module>rP      s     ' E ( 5 H < # D%%++,($$$ ( -(V D%%**D,=,=,@,@A T   B r!   