
    
                         d 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l	m
Z
 ddl	mZ dd	l	mZ dd
lmZ  ej                  ej                   j"                         G d dej$                               Zy)zExport preview results.    )absolute_import)division)unicode_literals)configmanager_util)base)deploy_util)flags)resource_args)concept_parsersc                   .    e Zd ZdZddiZed        Zd Zy)Exportz`Export preview results.

  This command generates a signed url to download a preview results.
  EXAMPLESz
        Export preview results for `my-preview`:

          $ {command} projects/p1/locations/us-central1/previews/my-preview

      c                     d}t        j                  | |       t        j                  t	        j
                  d      g      j                  |        y )Nal          File name for preview export artifacts. It is optional and it specifies
        the filename or complete path for the downloaded preview export
        artifacts. If only a file path is provided, the artifacts will be
        downloaded as "preview" within that directory. If a filename is
        included, the artifacts will be downloaded with that name.z!the preview to be used as parent.)r	   AddFileFlagr   ConceptParserr
   GetPreviewResourceArgSpecAddToParser)parserflag_help_texts     ,lib/surface/infra_manager/previews/export.pyArgszExport.Args+   sL    FN 
fn-!!333	
 k&    c                     t        j                         }|j                  j                  j	                         }|j                         }t        j                  |||j                        S )a.  This is what gets called when the user runs this command.

    Args:
      args: an argparse namespace. All the arguments that were provided to this
        command invocation.

    Returns:
      Preview results containing signed urls that can be used to download the
      binary and json plans.
    )	r   GetMessagesModuleCONCEPTSpreviewParseRelativeNamer   ExportPreviewResultfile)selfargsmessagespreview_refpreview_full_names        r   Runz
Export.Run<   sY     "335H--''--/K#002**		 r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r&    r   r   r   r      s1    
   
 -   r   r   N)r*   
__future__r   r   r   $googlecloudsdk.api_lib.infra_managerr   googlecloudsdk.callioper   (googlecloudsdk.command_lib.infra_managerr   r	   r
   (googlecloudsdk.command_lib.util.conceptsr   ReleaseTracksReleaseTrackGACommandr   r-   r   r   <module>r7      s]     &  ' C ( @ : B D D%%(()1T\\ 1 *1r   