
    i                        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r\	R$                  \	R&                  " \	R(                  R*                  5       " S S\	R,                  5      5       5       r\	R&                  " \	R(                  R0                  5       " S S\5      5       r\	R&                  " \	R(                  R4                  5       " S S\5      5       rg):Execute a workflow and wait for the execution to complete.    )absolute_import)division)unicode_literals)cache)	workflows)base)labels_util)flags)hooks)	resourcesz:workflowexecutions.projects.locations.workflows.executionsc                   `    \ rS rSrSrSSS.r\S 5       r\S 5       rS r	S	 r
S
 rS rS rSrg)Run    r   {description}a:          To execute a workflow named my-workflow with the data that will be passed to the workflow, run:

          $ {command} my-workflow `--data=my-data`

        To add two labels {foo: bar, baz: qux} to the execution, run:

          $ {command} my-workflow `--data=my-data` `--labels=foo=bar,baz=qux`
        DESCRIPTIONEXAMPLESc                 Z    [         R                  " U SS9  [         R                  " U 5        g )Nz
to execute)verb)r   AddWorkflowResourceArg
AddDataArgparsers    lib/surface/workflows/run.py
CommonArgsRun.CommonArgs4   s     	  l;	V    c                     [         R                  U 5        [        R                  " U 5        [        R                  " U 5        [        R
                  " U 5        [        R                  " U 5        g N)r   r   r   AddLoggingArgAddDisableOverflowBufferArgAddExecutionHistoryLevelArgr
   AddCreateLabelsFlagsr   s    r   ArgsRun.Args9   sF    NN6		%%f-	%%f-$$V,r   c                     UR                   $ r    call_log_levelselfargss     r   CallLogLevelRun.CallLogLevelA       r   c                     UR                   $ r    )execution_history_levelr*   s     r   ExecutionHistoryLevelRun.ExecutionHistoryLevelD   s    '''r   c                 .    [         R                  " U5      $ r    )r   ParseExecutionLabelsr*   s     r   Labels
Run.LabelsG   s    %%d++r   c                     UR                   $ r    ),disable_concurrency_quota_overflow_bufferingr*   s     r   OverflowBufferingDisabledRun.OverflowBufferingDisabledJ   s    <<<r   c           
      D   [         R                  " SUS5        [        R                  " U R	                  5       5      n[
        R                  " U5      n[        R                  " U5      nUR                  UUR                  U R                  U5      U R                  U5      U R                  U5      U R                  U5      5      n[        R                  " UR                   5        ["        R$                  R'                  UR                   [(        S9nUR+                  U5      $ )z@Execute a workflow and wait for the completion of the execution.N)
collection)r   print_default_location_warningr   ReleaseTrackToApiVersionReleaseTrackr   ParseWorkflowWorkflowExecutionClientCreatedatar-   r2   r6   r:   r   cache_execution_idnamer   REGISTRYParseEXECUTION_COLLECTIONWaitForExecution)r+   r,   api_versionworkflow_refclient	executionexecution_refs          r   r   Run.RunM   s    	((tT:44T5F5F5HIK&&t,L..{;F		$""4(D&&t,I 
Y^^,&&,,#7 - M ""=11r    N)__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   r%   r-   r2   r6   r:   r   __static_attributes__rQ   r   r   r   r       sZ     C 	-   - -(,=2r   r   c                   J    \ rS rSrSrSSS.r\S 5       rS rS r	S	 r
S
 rSrg)BetaRunb   r   r           To execute a workflow named my-workflow with the data that will be passed to the workflow, run:

          $ {command} my-workflow --data=my-data
        r   c                 Z    [         R                  U 5        [        R                  " U 5        g r    )r   r   r   AddBetaLoggingArgr   s    r   r%   BetaRun.Argsq   s    NN6	F#r   c                     UR                   $ r    r(   r*   s     r   r-   BetaRun.CallLogLevelv   r/   r   c                     g r    rQ   r*   s     r   r2   BetaRun.ExecutionHistoryLevely       r   c                     g r    rQ   r*   s     r   r6   BetaRun.Labels|   re   r   c                     gNFrQ   r*   s     r   r:   !BetaRun.OverflowBufferingDisabled       r   rQ   NrR   rS   rT   rU   rV   rW   rX   r%   r-   r2   r6   r:   rY   rQ   r   r   r[   r[   b   s>    B 		- $ $r   r[   c                   J    \ rS rSrSrSSS.r\S 5       rS rS r	S	 r
S
 rSrg)AlphaRun   r   r   r]   r   c                 .    [         R                  U 5        g r    )r   r   r   s    r   r%   AlphaRun.Args   s    NN6r   c                     g r    rQ   r*   s     r   r-   AlphaRun.CallLogLevel   re   r   c                     g r    rQ   r*   s     r   r2   AlphaRun.ExecutionHistoryLevel   re   r   c                     g r    rQ   r*   s     r   r6   AlphaRun.Labels   re   r   c                     gri   rQ   r*   s     r   r:   "AlphaRun.OverflowBufferingDisabled   rk   r   rQ   Nrl   rQ   r   r   rn   rn      s>    B 		-  r   rn   N)rV   
__future__r   r   r    googlecloudsdk.api_lib.workflowsr   r   googlecloudsdk.callioper	   $googlecloudsdk.command_lib.util.argsr
   $googlecloudsdk.command_lib.workflowsr   r   googlecloudsdk.corer   rI   DefaultUniverseOnlyReleaseTracksr@   GADescribeCommandr   BETAr[   ALPHArn   rQ   r   r   <module>r      s    A &  ' 2 6 ( < 6 6 )S  D%%(()=2$

 =2 * =2@ D%%**+c  ,@ D%%++,s  -r   