
                         H   d Z ddlmZ ddlmZ ddlmZ ddl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iZ e
j&                  e
j(                  j*                  e
j(                  j,                  e
j(                  j.                         G d de
j0                               Zy)z!Export workflow template command.    )absolute_import)division)unicode_literalsN)dataproc)base)flags)util)filesEXAMPLESz      To export version 1.0 of workflow template for 'my-workflow-template' in region
      'us-central1' to template.yaml, run:

        $ {command} my-workflow-template --region=us-central1 --destination=path/to/template.yaml --version=1.0
      c                   *    e Zd ZdZeZed        Zd Zy)DescribezExport a workflow template.

  Exports a workflow template's configuration to a file.
  This configuration can be imported at a later time.
  c                     t        j                  | j                               }t        j                  |d|j
                         t        j                  |       t        j                  |       y )Nexport)	dpDataprocReleaseTrackr   AddTemplateResourceArgapi_versionexport_utilAddExportFlagsAddVersionFlag)clsparserr   s      1lib/surface/dataproc/workflow_templates/export.pyArgszDescribe.Args2   sM    {{3++-.H	  83G3GHv&	     c                 
   t        j                  | j                               }|j                  j                  j                         }|j                  ||j                        }d |_        d |_	        d |_        d |_
        d |_        |j                  r@t        j                  |j                        5 }t        j                   ||       d d d        y t        j                   |t"        j$                         y # 1 sw Y   y xY w)N)messagestream)r   r   r   CONCEPTStemplateParseGetRegionsWorkflowTemplateversionidname
createTime
updateTimedestinationr
   
FileWriterr   Exportsysstdout)selfargsr   template_refworkflow_templater   s         r   RunzDescribe.Run9   s    {{4,,./H==))//1L !;;dll$
  ! $#' #'  D,,-#4VD .- !23::F .-s   2C99DN)	__name__
__module____qualname____doc__DETAILED_HELPdetailed_helpclassmethodr   r2    r   r   r   r   '   s&      -! !Gr   r   )r6   
__future__r   r   r   r,   googlecloudsdk.api_lib.dataprocr   r   googlecloudsdk.callioper   #googlecloudsdk.command_lib.dataprocr   !googlecloudsdk.command_lib.exportr	   r   googlecloudsdk.core.utilr
   r7   ReleaseTracksr   ALPHABETAGADescribeCommandr   r:   r   r   <module>rF      s    ( &  ' 
 : ( 5 A * 	
 D%%++T->->-C-C%%((*-Gt## -G*-Gr   