
                         n   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  \R$                  \R&                  " \R(                  R*                  \R(                  R,                  5      \R.                   " S S\R0                  5      5       5       5       rg)Run a Workflow.    )absolute_import)division)unicode_literals)client_util)waiter)arg_parsers)base)	run_flags)log)
properties)	resourcesc                   .    \ rS rSrSr\S 5       rS rSrg)Create   r   c                     U R                  SSS9  U R                  SS[        R                  " 5       SS9  [        R                  " U 5        g)	zRegister flags for this command.

Args:
  parser: An argparse.ArgumentParser-like object. It is mocked out in order
    to capture some information, but behaves like an ArgumentParser.
WORKFLOW_IDzThe ID of the Workflow.)helpz--paramsz	KEY=VALUEzParams to run Workflow with.)metavartyper   N)add_argumentr	   ArgDictr   AddsRegionResourceArg)parsers    #lib/surface/builds/workflows/run.pyArgsCreate.Args%   sP     ,EF
  "+	  -
 ##F+    c           
      
   [         R                  " 5       n[         R                  " 5       nUR                  R                  R                  5       nUR                  5       nU< SUR                  < 3nUR                  5       nUR                  (       as  / nUR                  R                  5        HM  u  pUR                  U	UR                  UR                  R                  S5      U
S9S9nUR                  U5        MO     Xl	        UR                  R!                  UR#                  UUS95      nUR$                  n[&        R(                  R+                  USS9n[,        R.                  " [,        R0                  " UR                  UR2                  5      USR5                  U5      5        UR2                  R7                  UR9                  US	95      nS
nUR:                  R<                   H+  nUR>                  S:X  d  M  UR@                  RB                  nM-     [D        RF                  RI                  SR5                  URK                  5       U[L        RN                  RP                  RR                  R7                  SS9S95        U$ )z9This is what gets called when the user runs this command.z/workflows/STRING)r   	stringVal)namevalue)r"   runWorkflowRequestz(cloudbuild.projects.locations.operations)
collectionzRunning workflow {})r"    pipelineRunIdz\View run: https://console.cloud.google.com/cloud-build/runs/{region}/{run}?project={project}T)required)regionrunproject)*r   GetClientInstanceGetMessagesModuleCONCEPTSr)   ParseRelativeNamer   RunWorkflowRequestparamsitemsParam
ParamValueTypeValueValuesEnumappendprojects_locations_workflowsRun.CloudbuildProjectsLocationsWorkflowsRunRequestr"   r   REGISTRYParseRelativeNamer   WaitForCloudOperationPollerprojects_locations_operationsformatGet/CloudbuildProjectsLocationsOperationsGetRequestmetadataadditionalPropertieskeyr#   string_valuer   statusPrintNamer   VALUEScorer+   )selfargsclientmessages
region_refparentworkflow_namerun_workflow_reqr2   rE   r#   paramrun_workflow_operationrun_workflow_operation_namerun_workflow_operation_refrun_workflow_operation_donepipeline_run_idadditional_propertys                     r   r9   
Create.Run5   sS   **,F,,.H%%++-J$$&F)/1A1ABM224 {{f))+*#%%((<<XF &    	e , !' $@@DD??/ 	@ 	

 #9"="=!*!3!3!E!E#= "F "? NN##F$G$G$*$H$H	J"$9$@$@$OQ #)"F"F"J"J@@, 	A 	.#/
 O:CCXX		 	 O	3-33@@  Y
 JJ	^	??$%%**22666E 
 

 '&r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r9   __static_attributes__r\   r   r   r   r      s     , ,@'r   r   N)ra   
__future__r   r   r   $googlecloudsdk.api_lib.cloudbuild.v2r   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper	   r
   %googlecloudsdk.command_lib.cloudbuildr   googlecloudsdk.corer   r   r   HiddenReleaseTracksReleaseTrackALPHABETAUniverseCompatibleCreateCommandr   r\   r   r   <module>rq      s     &  ' < . / ( ; # * ) D%%++T->->-C-CDS'T S'  E S'r   