
                            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                  ej                   j"                         G d dej$                               Z ej                  ej                   j(                         G d de             Z ej                  ej                   j,                         G d de             Zy)z$`gcloud tasks queues create command.    )absolute_import)division)unicode_literals)GetApiAdapter)base)	constants)flags)parsers)logc                   0    e Zd ZdZdddZed        Zd Zy)CreateyCreate a Cloud Tasks queue.

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

              $ {command} my-queue
                --max-attempts=10 --max-retry-duration=5s
                --max-doublings=4 --min-backoff=1s
                --max-backoff=10s
                --max-dispatches-per-second=100
                --max-concurrent-dispatches=10
                --routing-override=service:abc
         DESCRIPTIONEXAMPLESc                     t        j                  | d       t        j                  |        t        j                  |        y )N	to create)r	   AddQueueResourceArgAddLocationFlagAddCreatePushQueueFlagsparsers    "lib/surface/tasks/queues/create.pyArgszCreate.Args6   s.    	fk2	&!	!!&)    c           
         | j                         t        j                   j                  k(  r|j                  }nt        j
                  }t        | j                               }|j                  }t        j                  |j                  |j                        }t        j                  |      }t        j                  |||j                  | j                               }| j                         t        j                   j                  k(  r@|j!                  |||j"                  |j$                  |j&                  |j(                        }n| j                         t        j                   j                  k(  rV|j!                  |||j"                  |j$                  |j*                  |j,                  |j(                  |j                        }nJ|j!                  |||j"                  |j$                  |j.                  |j(                  |j,                        }t1        j2                  t        j4                  |j7                               d       |S )Nrelease_track)retry_configrate_limitsapp_engine_http_targethttp_target)r!   r"   app_engine_http_queuestackdriver_logging_configr$   
queue_type)r!   r"   app_engine_routing_overrider$   r&   queue)ReleaseTrackr   BETAtyper   
PUSH_QUEUEr   queuesr
   
ParseQueuer)   locationExtractLocationRefFromQueueRefParseCreateOrUpdateQueueArgsmessagesALPHAr   retryConfig
rateLimitsappEngineHttpTarget
httpTargetappEngineHttpQueuestackdriverLoggingConfigappEngineRoutingOverrider   CreatedResourceGetConsolePromptStringRelativeName)	selfargsr'   apiqueues_client	queue_reflocation_refqueue_configcreate_responses	            r   Runz
Create.Run<   s   d//44499j''j
))+
,CJJM""4::t}}=I99)DL77j#,,'')+L d//555%,,

#//"--!-!A!A"-- - /o 
			 1 1 6 6	6%,,

#//"-- , ? ?%1%J%J"--!&& - 	o &,,

#//"--&2&K&K"--%1%J%J - Lo &&y'='='?@'Kr   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   rG    r   r   r   r      s1    
	-" * *
*r   r   c                   *    e Zd ZdZdddZed        Zy)
BetaCreater   r   r   r   c                     t        j                  | d       t        j                  |        t        j                  | t        j
                  j                         y Nr   r   )r	   r   r   r   r   r*   r+   r   s    r   r   zBetaCreate.Args   s<    	fk2	&!	!!&8I8I8N8NOr   NrH   rI   rJ   rK   rL   rM   r   rN   r   r   rP   rP   i   s.    
	-" P Pr   rP   c                   *    e Zd ZdZdddZed        Zy)AlphaCreater   r   au            To create a Cloud Tasks queue:

              $ {command} my-queue
                --max-attempts=10 --max-retry-duration=5s
                --max-doublings=4 --min-backoff=1s
                --max-backoff=10s
                --max-tasks-dispatched-per-second=100
                --max-concurrent-tasks=10
                --routing-override=service:abc
          r   c                     t        j                  | d       t        j                  |        t        j                  | t        j
                  j                         y rR   )r	   r   r   r   r   r*   r4   r   s    r   r   zAlphaCreate.Args   s<    	fk2	&!	!!&8I8I8O8OPr   NrS   rN   r   r   rU   rU      s.    
	-" Q Qr   rU   N)rK   
__future__r   r   r   googlecloudsdk.api_lib.tasksr   googlecloudsdk.callioper    googlecloudsdk.command_lib.tasksr   r	   r
   googlecloudsdk.corer   ReleaseTracksr*   GACreateCommandr   r+   rP   r4   rU   rN   r   r   <module>r_      s    + '  ' 6 ( 6 2 4 # D%%(()GT G *GT D%%**+P P ,P< D%%++,Q& Q -Qr   