
                             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 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,                   G d de
j.                               Zy)z$Command to update fleet information.    )absolute_import)division)unicode_literals)client)types)util)base)parser_arguments)parser_extensions)flags)update_mask)labels_util)logc                   r    e Zd ZdZedej                  fd       Zdej                  de
j                  fdZy)Updatea  Update a fleet.

  This command can fail for the following reasons:
  * The project specified does not exist.
  * The project specified already has a fleet.
  * The active account does not have permission to access the given project.

  ## EXAMPLES

  To update the display name of the fleet in project `example-foo-bar-1`
  to `updated-name`, run:

    $ {command} --display-name=updated-name --project=example-foo-bar-1
  parserc                     t        j                  |       }|j                          |j                          |j	                          t        j                  |        y )N)fleet_flags
FleetFlagsAddAsyncAddDisplayNameAddDefaultClusterConfigr   AddUpdateLabelsFlags)r   r   s     %lib/surface/container/fleet/update.pyArgszUpdate.Args4   sB    ""6*E	NN		!!#$$V,    argsreturnc                    t        j                  || j                               }d|j                         vr;|j	                         rt
        j                  |_        nt
        j                  |_        t        j                  | j                               }d}g }d}t        j                  j                  |      }|j                         st        j                   |      rg|j#                  |j%                               }|j'                  |j(                  j*                  j,                  |j.                        j1                         }|r|j3                  d       t        j4                  |      r$|j3                  t        j4                  |             |j+                  |      }||_        |j(                  j7                  |t9        j:                  |j%                               dj=                  |            }	|j?                  |	      }
t9        j@                  |j%                               }|j	                         r(tC        jD                  |d|j	                                |
S t        jF                  | j                               }t9        jH                  |
      }|jK                  |      }tC        jD                  |d|j	                                |S )	a  Runs the fleet update command.

    User specified --format takes the highest priority. If not specified, it
    returns the default format of long-running operation or fleet, depending on
    whether --async is specified.

    $ {command} --async
      The output is in default operation format.

    $ {command} --async --format
      The output is in user specified format.

    $ {command}
      The output is in default fleet format.

    $ {command} --format
      The output is in user specified format.

    Args:
      args: Arguments received from command line.

    Returns:
      A completed update operation; if `--async` is specified, return a
      long-running operation to be polled manually.
    z--formatNlabels,)fleetname
updateMaskzAnthos fleet)is_async)kindr%   )&r   FleetFlagParserReleaseTrackGetSpecifiedArgNamesAsync
fleet_utilOPERATION_FORMATformatFLEET_FORMATr   FleetClientr   DiffFromUpdateArgsMayHaveUpdatesr   HasBinauthzConfigGetFleetProjectApplymessagesFleetLabelsValuer    	GetOrNoneappendGetFleetUpdateMask)GkehubProjectsLocationsFleetsPatchRequestr   FleetResourceNamejoinUpdateFleetFleetRefr   UpdatedResourceOperationClientOperationRefWait)selfr   flag_parserfleetclient
new_labelsmaskcurrent_fleetlabels_diffr"   req	operation	fleet_refoperation_clientoperation_refcompleted_operations                  r   Runz
Update.Run<   sN   4 --dD4E4E4GHK2244				 11 --$$T%6%6%89K JD M""11$7K!!#{'D'DT'J!**;+>+>+@Am$$



$
$
0
0


 		  
kk(%%d+
kk+0067m,EEL



H
H##K$7$7$9:88D> I C '',Ik1134I	
^k.?.?.A --d.?.?.AB%%i0M*//>1B1B1D r   N)__name__
__module____qualname____doc__staticmethodr
   ArgumentInterceptorr   r   	Namespacer   	OperationrS    r   r   r   r   #   sJ     -#77 - -N'11 Neoo Nr   r   N)rW   
__future__r   r   r   &googlecloudsdk.api_lib.container.fleetr   r   r   googlecloudsdk.callioper	   r
   r   *googlecloudsdk.command_lib.container.fleetr   r   r   r+   $googlecloudsdk.command_lib.util.argsr   googlecloudsdk.corer   DefaultUniverseOnlyUpdateCommandr   r\   r   r   <module>re      s^     + &  ' 9 8 7 ( 4 5 K B I < # fT f fr   