
                            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	r\R                  \R                  " \R                   R"                  5       " S
 S\R$                  5      5       5       r\R                  " \R                   R(                  5       " S S\5      5       r\R                  " \R                   R,                  5       " S S\5      5       rg):Execute a workflow and wait for the execution to complete.    )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.CommonArgs1   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.Args6   sF    NN6		%%f-	%%f-$$V,r   c                     UR                   $ r   call_log_levelselfargss     r   CallLogLevelRun.CallLogLevel>       r   c                     UR                   $ r   )execution_history_levelr'   s     r   ExecutionHistoryLevelRun.ExecutionHistoryLevelA   s    '''r   c                 .    [         R                  " U5      $ r   )r   ParseExecutionLabelsr'   s     r   Labels
Run.LabelsD   s    %%d++r   c                     UR                   $ r   ),disable_concurrency_quota_overflow_bufferingr'   s     r   OverflowBufferingDisabledRun.OverflowBufferingDisabledG   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*   r/   r3   r7   r   cache_execution_idnamer
   REGISTRYParseEXECUTION_COLLECTIONWaitForExecution)r(   r)   api_versionworkflow_refclient	executionexecution_refs          r   r   Run.RunJ   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*   r/   r3   r7   r   __static_attributes__rN   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)BetaRun_   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.Argsn   s    NN6	F#r   c                     UR                   $ r   r%   r'   s     r   r*   BetaRun.CallLogLevels   r,   r   c                     g r   rN   r'   s     r   r/   BetaRun.ExecutionHistoryLevelv       r   c                     g r   rN   r'   s     r   r3   BetaRun.Labelsy   rb   r   c                     gNFrN   r'   s     r   r7   !BetaRun.OverflowBufferingDisabled|       r   rN   NrO   rP   rQ   rR   rS   rT   rU   r"   r*   r/   r3   r7   rV   rN   r   r   rX   rX   _   s>    B 		- $ $r   rX   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   rZ   r   c                 .    [         R                  U 5        g r   )r   r   r   s    r   r"   AlphaRun.Args   s    NN6r   c                     g r   rN   r'   s     r   r*   AlphaRun.CallLogLevel   rb   r   c                     g r   rN   r'   s     r   r/   AlphaRun.ExecutionHistoryLevel   rb   r   c                     g r   rN   r'   s     r   r3   AlphaRun.Labels   rb   r   c                     grf   rN   r'   s     r   r7   "AlphaRun.OverflowBufferingDisabled   rh   r   rN   Nri   rN   r   r   rk   rk      s>    B 		-  r   rk   N)rS    googlecloudsdk.api_lib.workflowsr   r   googlecloudsdk.callioper   $googlecloudsdk.command_lib.util.argsr   $googlecloudsdk.command_lib.workflowsr   r	   googlecloudsdk.corer
   rF   DefaultUniverseOnlyReleaseTracksr=   GADescribeCommandr   BETArX   ALPHArk   rN   r   r   <module>r      s    A 3 6 ( < 6 6 )S  D%%(()=2$

 =2 * =2@ D%%**+c  ,@ D%%++,s  -r   