
                            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	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.    )absolute_import)division)unicode_literals)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.Args7   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.RunA   sX    ""11$7K"//8K  99-8:F$Mr$    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr"   r3   __static_attributes__r5   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-   J   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.GetUriFunc]   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/   r0   r1   r2   s       r!   r3   
Update.Runf   sL    "//8K  99-8-=-=-?AF$Mr$   r5   N)
r6   r7   r8   r9   r:   rA   r;   r"   r3   r<   r5   r$   r!   r-   r-   J   s%    ", : :
r$   r-   N)r:   
__future__r   r   r   +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-   r5   r$   r!   <module>rT      s     ' &  ' D ( 5 H < # D%%++,($$$ ( -(V D%%**D,=,=,@,@A T   B r$   