
    	                        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 dd	lmZ  e	j                  e	j                  j                   e	j                  j"                         G d
 de	j$                               Zy)z$Command to update fleet information.    )absolute_import)division)unicode_literals)client)util)base)	resources)	arg_utilsc                   &    e Zd ZdZed        Zd Zy)Updatea  Update a fleet namespace.

  This command can fail for the following reasons:
  * The project specified does not exist.
  * The fleet namespace does not exist in the project.
  * The caller does not have permission to access the project or namespace.

  ## EXAMPLES

  To update the namespace `NAMESPACE` in the active project:

    $ {command} NAMESPACE

  To update the namespace `NAMESPACE` in project `PROJECT_ID`:

    $ {command} NAMESPACE --project=PROJECT_ID
  c                     |j                  dt        d       t        j                  |dt        j
                  | j                            d       y )NNAMEz$Name of the namespace to be updated.)typehelpz--scopez9Name of the fleet scope to create the fleet namespace in.)
scope_help)add_argumentstrr	   AddScopeResourceArgr   VERSION_MAPReleaseTrack)clsparsers     0lib/surface/container/fleet/namespaces/update.pyArgszUpdate.Args0   sL    
SE  G!!))+,N	    c                    g }dD ]%  }|j                  |      s|j                  |       ' d }|j                  j                  j	                         }||j                         }t        j                  |dd      }t        j                  | j                               }|j                  |j                  ||dj                  |            S )N)scopez	--projectT)use_defaults)release_track,)mask)IsKnownAndSpecifiedappendCONCEPTSr   ParseRelativeNamer
   GetFromNamespacer   FleetClientr   UpdateNamespacer   join)selfargsr!   flagr   	scope_argprojectfleetclients           r   Runz
Update.Run;   s    D		!	!$	'D  E##))+I$$&e(({NG$$43D3D3FGK&&		5' '  r   N)__name__
__module____qualname____doc__classmethodr   r1    r   r   r   r      s     $  r   r   N)r5   
__future__r   r   r   &googlecloudsdk.api_lib.container.fleetr   r   googlecloudsdk.callioper   *googlecloudsdk.command_lib.container.fleetr	   $googlecloudsdk.command_lib.util.apisr
   ReleaseTracksr   ALPHABETAUpdateCommandr   r7   r   r   <module>rA      sk    + &  ' 9 7 ( @ : D%%++T->->-C-CD+T + E+r   