
                         ,   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  ej                  ej                  j                  ej                  j                   ej                  j"                         G d	 d
ej$                               Zy)zCommand to update a folder.    )absolute_import)division)unicode_literals)folders)base)flags)logc                   &    e Zd ZdZed        Zd Zy)Updatea&  Update the display name of a folder.

  Updates the given folder with new folder name.

  This command can fail for the following reasons:
      * There is no folder with the given ID.
      * The active account does not have permission to update the given
        folder.
      * The new display name is taken by another folder under this folder's
        parent.

  ## EXAMPLES

  The following command updates a folder with the ID `123456789` to have
  the name "Foo Bar and Grill":

    $ {command} 123456789 --display-name="Foo Bar and Grill"
  c                 t    t        j                  d      j                  |        | j                  ddd       y )Nzyou want to update.z--display-nameTz?New display name for the folder (unique under the same parent).)requiredhelp)r   FolderIdArgAddToParseradd_argument)parsers    .lib/surface/resource_manager/folders/update.pyArgszUpdate.Args1   s9    	+,88@
N  P    c                 0   t        j                  |j                        }|j                  |_        t        j
                         j                  ||j                  d      }t        j                  t        j                         j                  |             y )Ndisplay_name)folder	foldersId
updateMask)r   	GetFolderidr   displayNameFoldersMessages'CloudresourcemanagerFoldersPatchRequestr	   UpdatedResourceFoldersServicePatch)selfargsr   requests       r   Runz
Update.Run9   sq    tww'F**F%%'OO^ P EG..066w?@r   N)__name__
__module____qualname____doc__staticmethodr   r&    r   r   r   r      s#    & P PAr   r   N)r*   
__future__r   r   r   'googlecloudsdk.api_lib.resource_managerr   googlecloudsdk.callioper   +googlecloudsdk.command_lib.resource_managerr   googlecloudsdk.corer	   ReleaseTracksReleaseTrackALPHABETAGAUpdateCommandr   r,   r   r   <module>r8      s{    " &  ' ; ( = # D%%++T->->-C-C%%((*!AT !A*!Ar   