
                             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  SSKJr  SSKJr  SSKJr  SSKJr  \R.                   " S S\R0                  5      5       rg)z)Command to update a Data Fusion instance.    )absolute_import)division)unicode_literals)encoding)
datafusion)waiter)arg_parsers)base)maintenance_utils)operation_poller)resource_args)labels_util)logc                   L    \ rS rSrSrSSS.rSrSrSrS	r	S
r
\S 5       rS rSrg)Update"   z%Updates a Cloud Data Fusion instance.z       If run asynchronously with `--async`, exits after printing an operation
       that can be used to poll the status of the creation operation via:

         {command} operations list
          a          To update instance 'my-instance' in project 'my-project' and location
        'my-location' to version `6.9.2`, run:

          $ {command} --project=my-project --location=my-location --version=6.9.2 my-instance

        To update instance 'my-instance' in project 'my-project' and location
        'my-location' to patch revision '6.9.2.1', run:

          $ {command} --project=my-project --location=my-location --version=6.9.2 --patch_revision=6.9.2.1 my-instance
          )DESCRIPTIONEXAMPLESoptions
enableRbacenableStackdriverLoggingenableStackdriverMonitoringmaintenancePolicyc                    [         R                  " U S5        [        R                  R	                  U 5        [
        R                  " U 5        U R                  SSSS9  U R                  SSSS9  U R                  SSS	S9  U R                  S
[        R                  " 5       SSS9  U R                  SSS9  U R                  SSS9  [        R                  " U 5        g )NzInstance to update.z--enable_stackdriver_logging
store_truez9Enable Stackdriver logging for this Data Fusion instance.)actionhelpz--enable_stackdriver_monitoringz<Enable Stackdriver monitoring for this Data Fusion instance.z--enable_rbaczHEnable granular role-based access control for this Data Fusion instance.z	--optionsz	KEY=VALUEzIOptions to use for instance update, specified as KEY1=VALUE1,KEY2=VALUE2.)typemetavarr   z	--versionz#Version of Datafusion to update to.)r   z--patch_revisionz9Patch revision version of Cloud Data Fusion to update to.)r   AddInstanceResourceArgr
   
ASYNC_FLAGAddToParserr   AddCreateLabelsFlagsadd_argumentr	   ArgDictr   UpdateArgumentsGroup)parsers    +lib/surface/data_fusion/instances/update.pyArgsUpdate.ArgsC   s    ((1FGOO'$$V,
&H  J )K  M W  
   "0	  1 *OP
*1lm**62    c                 (   [         R                  " 5       nUR                  R                  R	                  5       nUR
                  =(       d    0 nS nS nS n0 n/ n	UR                  S5      (       a'  UR                  nU	R                  U R                  5        UR                  S5      (       a'  U	R                  U R                  5        UR                  nUR                  S5      (       a'  U	R                  U R                  5        UR                  nUR                  S5      (       a'  U	R                  U R                  5        UR                  nUR                   n
UR"                  R%                  UR'                  5       U
UR(                  UUU[*        R,                  " XR"                  R$                  R.                  S5      [*        R,                  " XBR"                  R$                  R0                  S5      S9nUR                  S5      (       dB  UR                  S5      (       d,  UR                  S	5      (       d  UR                  S
5      (       a1  [2        R4                  " X5        U	R                  U R6                  5        UR"                  R9                  USR;                  U	5      UR'                  5       S9nUR<                  R>                  RA                  U5      nURB                  (       a&  [D        RF                  " UR'                  5       SSS9  U$ [H        RJ                  " [L        RN                  " 5       URP                  SRS                  URP                  5      [         RT                  S9  [D        RV                  " UR'                  5       SSS9  g )Nr   enable_rbacenable_stackdriver_loggingenable_stackdriver_monitoringT)nameversionpatchRevisionr   r   r   r   labelsclear_maintenance_windowmaintenance_window_startmaintenance_window_endmaintenance_window_recurrence,)instance
updateMaskr0   r9   )kindis_asyncz<Waiting for [{}] to complete. This may take several minutes.)wait_ceiling_msF),df
DatafusionCONCEPTSr9   Parser3   IsSpecifiedr   appendFIELD_PATH_OPTIONSFIELD_PATH_ENABLE_RBACr-   %FIELD_PATH_ENABLE_STACKDRIVER_LOGGINGr.   (FIELD_PATH_ENABLE_STACKDRIVER_MONITORINGr/   r1   messagesInstanceRelativeNamepatch_revisionr   DictToAdditionalPropertyMessageOptionsValueLabelsValuer   UpdateMaintenanceWindowFIELD_PATH_MAINTENANCE_POLICY0DatafusionProjectsLocationsInstancesPatchRequestjoinclientprojects_locations_instancesPatchasync_r   CreatedResourcer   WaitForr   OperationPollerr0   formatOPERATION_TIMEOUTUpdatedResource)selfargsr   instance_refr3   r.   r/   r-   r   fields_to_updater1   r9   request	operations                 r(   Run
Update.Run_   s   J==))//1L[[BF!%$(!KG	""gd556&&d99:$$k455dHHI#'#B#B 788dKKL&*&H&H#llG""++&&())!;$A88((11>>F77''00<<dD , 
EH 	344677455;<<//?d@@A!!RR88,-&&( S *G
 !!>>DDWMI{{	

#
#
%JGnn

*
*
,
..
H
O
Onn..0 


#
#
%JHr+    N)__name__
__module____qualname____firstlineno____doc__detailed_helprD   rE   rF   rG   rP   staticmethodr)   rc   __static_attributes__re   r+   r(   r   r   "   sP     /
-. !'*D'-J*"53 36?Hr+   r   N)rj   
__future__r   r   r   apitools.base.pyr   "googlecloudsdk.api_lib.data_fusionr   r>   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper	   r
   &googlecloudsdk.command_lib.data_fusionr   r   r   $googlecloudsdk.command_lib.util.argsr   googlecloudsdk.corer   DefaultUniverseOnlyUpdateCommandr   re   r+   r(   <module>rx      s^    0 &  ' % ? . / ( D C @ < # {HT {H {Hr+   