
                            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  ej                  dd       ej                   ej"                  j$                         G d dej&                                      Z ej                  dd       ej                   ej"                  j*                         G d de                    Zy)z%`gcloud tasks queues update` command.    )absolute_import)division)unicode_literals)GetApiAdapter)base)	constants)flags)parsers)logFzIThis command is deprecated. Use `gcloud beta tasks queues update` instead)
is_removedwarningc                   B     e Zd ZdZdddZ fdZed        Zd Z xZ	S )UpdateAppEnginezyUpdate a Cloud Tasks queue.

  The flags available to this command represent the fields of a queue that are
  mutable.
  "          {description}
          a            To update a Cloud Tasks queue:

              $ {command} my-queue
                --clear-max-attempts --clear-max-retry-duration
                --clear-max-doublings --clear-min-backoff
                --clear-max-backoff
                --clear-max-dispatches-per-second
                --clear-max-concurrent-dispatches
                --clear-routing-override
         DESCRIPTIONEXAMPLESc                 :    t        t        | 
  |i | d| _        y )NF)superr   __init__is_alphaselfargskwargs	__class__s      3lib/surface/tasks/queues/update_app_engine_queue.pyr   zUpdateAppEngine.__init__8   s    	/4)4:6:DM    c                     t        j                  | d       t        j                  |        t        j                  | t        j
                  j                  dd       y Nz	to updateTF)release_trackapp_engine_queue
http_queue)r	   AddQueueResourceArgAddLocationFlagAddUpdatePushQueueFlagsr   ReleaseTrackBETAparsers    r   ArgszUpdateAppEngine.Args<   sF    	fk2	&!	!!'',,	r   c                    t        j                  |t        j                  | j	                                t        | j	                               }|j                  }t        j                  |j                  |j                        }t        j                  |t        j                  |j                  d| j	                         d      }t        j                  |t        j                  | j	                               }| j                  sZ|j                  |j                  j                  nd }|j!                  |||j"                  |j$                  ||j&                        }nN|j(                  |j(                  j                  nd }|j!                  |||j"                  |j$                  |      }t*        j,                  j/                  dj1                  t        j2                  |j5                                            |S )N)r!   TF)	is_updater!   r#   )retry_configrate_limitsapp_engine_routing_overridestackdriver_logging_config)r.   r/   r0   zUpdated queue [{}].)r
   CheckUpdateArgsSpecifiedr   
PUSH_QUEUEr'   r   queues
ParseQueuequeuelocationParseCreateOrUpdateQueueArgsmessagesGetSpecifiedFieldsMaskr   appEngineHttpQueueappEngineRoutingOverridePatchretryConfig
rateLimitsstackdriverLoggingConfigappEngineHttpTargetr   statusPrintformatGetConsolePromptStringRelativeName)	r   r   apiqueues_client	queue_refqueue_configupdated_fieldsr0   update_responses	            r   RunzUpdateAppEngine.RunG   s   $$T%.%9%9373D3D3FH ))+
,CJJM""4::t}}=I77'')L 33i""$2C2C2EGN== ,,8 
)
)
B
B>B " &++

#//"--&A%1%J%J , Lo --9 
*
*
C
C?C " &++

#//"--&A , Co JJ*11&&y'='='?@B Cr   )
__name__
__module____qualname____doc__detailed_helpr   staticmethodr+   rM   __classcell__r   s   @r   r   r      s7    

	-"  (r   r   zJThis command is deprecated. Use `gcloud alpha tasks queues update` insteadc                   <     e Zd ZdZdddZ fdZed        Z xZS )AlphaUpdateAppEnginezUpdate a Cloud Tasks queue.

  The flags available to this command represent the fields of a queue that are
  mutable. Attempting to use this command on a different type of queue will
  result in an error.
  r   a            To update a Cloud Tasks queue:

              $ {command} my-queue
                --clear-max-attempts --clear-max-retry-duration
                --clear-max-doublings --clear-min-backoff
                --clear-max-backoff
                --clear-max-tasks-dispatched-per-second
                --clear-max-concurrent-tasks
                --clear-routing-override
         r   c                 :    t        t        | 
  |i | d| _        y )NT)r   rW   r   r   r   s      r   r   zAlphaUpdateAppEngine.__init__   s    	
.??DMr   c                     t        j                  | d       t        j                  |        t        j                  | t        j
                  j                  dd       y r    )r	   r$   r%   r&   r   r'   ALPHAr)   s    r   r+   zAlphaUpdateAppEngine.Args   sF    	fk2	&!	!!''--	r   )	rN   rO   rP   rQ   rR   r   rS   r+   rT   rU   s   @r   rW   rW   r   s2    

	-"  r   rW   N)rQ   
__future__r   r   r   googlecloudsdk.api_lib.tasksr   googlecloudsdk.callioper    googlecloudsdk.command_lib.tasksr   r	   r
   googlecloudsdk.corer   	DeprecateReleaseTracksr'   r(   UpdateCommandr   rZ   rW    r   r   <module>rd      s    , &  ' 6 ( 6 2 4 # 5HI D%%**+Nd(( N ,INb 5IJ D%%++,&? & -J&r   