
                         z   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  SSKJr  \R(                  \R*                  " \R,                  R.                  \R,                  R0                  5      \R2                   " S S\R4                  5      5       5       5       rg)Create a PipelineRun/TaskRun.    )absolute_import)division)unicode_literals)cloudbuild_exceptions)client_util)
input_util)pipeline_input_util)waiter)base)	run_flags)log)	resourcesc                   .    \ rS rSrSr\S 5       rS rSrg)Create    r   c                 0    [         R                  " U 5      n 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.
N)r   AddsCreateFlags)parsers     lib/surface/builds/runs/apply.pyArgsCreate.Args&   s     &&v.F    c                 \   [         R                  " 5       n[         R                  " 5       n[        R                  " UR
                  5      nUR                  SS5      nU(       d  [        R                  " S5      eUR                  S0 5      R                  SS5      nU(       d  [        R                  " S5      eUR                  R                  R                  5       R                  5       nUS:X  Ga	  [        R                  " U5      nUR                  R!                  UR#                  UUUS95      n	[$        R&                  R)                  U	R*                  S	S
9n
[,        R.                  " [,        R0                  " UR                  UR2                  5      U
S5      n[$        R&                  R                  UR*                  S[         R4                  U R7                  5          S9n[8        R:                  " U5        U$ US:X  Ga	  [        R<                  " U5      nUR>                  R!                  URA                  UUUS95      n	[$        R&                  R)                  U	R*                  S	S
9n
[,        R.                  " [,        R0                  " UR>                  UR2                  5      U
S5      n[$        R&                  R                  UR*                  S[         R4                  U R7                  5          S9n[8        R:                  " U5        U$ [        R                  " SRC                  US95      e)z9This is what gets called when the user runs this command.kind zkind is requiredmetadatanamezmetadata.name is requiredPipelineRun)parentpipelineRunpipelineRunIdz(cloudbuild.projects.locations.operations)
collectionzCreating PipelineRunz*cloudbuild.projects.locations.pipelineRuns)r#   api_versionTaskRun)r    taskRun	taskRunIdzCreating TaskRunz&cloudbuild.projects.locations.taskRunsz)Requested resource type {r} not supported)r)"r   GetClientInstanceGetMessagesModuler	   LoadYamlFromPathfilegetr   InvalidYamlErrorCONCEPTSregionParseRelativeNamer
   TektonYamlDataToPipelineRunprojects_locations_pipelineRunsr   4CloudbuildProjectsLocationsPipelineRunsCreateRequestr   REGISTRYParseRelativeNamer   r   WaitForCloudOperationPollerprojects_locations_operationsRELEASE_TRACK_TO_API_VERSIONReleaseTrackr   CreatedResourceTektonYamlDataToTaskRunprojects_locations_taskRuns0CloudbuildProjectsLocationsTaskRunsCreateRequestformat)selfargsclientmessages	yaml_datarun_typerun_idr    pipeline_run	operationoperation_refcreated_pipeline_runpipeline_run_reftask_runcreated_task_runtask_run_refs                   r   Run
Create.Run0   s   **,F,,.H++DII6I}}VR(H!223EFF]]:r*..vr:F!223NOO]]!!'')668F= (DD
l88??

G
G&" H i  ((::
..%O ; Qm $^^

%
%f&L&L&,&J&JL
/1
 #++11

#
#A!>>!# 2  
*+!!	Y	$<<
h44;;

C
C D i  ((::
..%O ; Qm  

%
%f&H&H&,&J&JL
+-
 ''--


=!>>!# . l 
,'!22
5
<
<x
<
HJ Jr    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   rQ   __static_attributes__rS   r   r   r   r       s      &/ /GJr   r   N)rX   
__future__r   r   r   !googlecloudsdk.api_lib.cloudbuildr   $googlecloudsdk.api_lib.cloudbuild.v2r   r	   r
   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper   %googlecloudsdk.command_lib.cloudbuildr   googlecloudsdk.corer   r   HiddenReleaseTracksr<   ALPHABETAUniverseCompatibleCreateCommandr   rS   r   r   <module>rh      s    $ &  ' C < ; D . ( ; # ) D%%++T->->-C-CDTJT TJ  E TJr   