
    		                         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  ej                  ej                  j                          G d
 dej"                               Zy)z#Export revision state file command.    )absolute_import)division)unicode_literals)configmanager_util)base)deploy_util)resource_args)concept_parsersc                   .    e Zd ZdZddiZed        Zd Zy)ExportStatefilezlExport a terraform state file.

  This command generates a signed url to download a terraform state file.
  EXAMPLESz
        Export state file for revision `projects/p1/locations/l1/deployments/d1/revisions/r-0`:

          $ {command} projects/p1/locations/l1/deployments/d1/revisions/r-0

      c                 t    t        j                  t        j                  d      g      j	                  |        y )Nz"the revision to be used as parent.)r
   ConceptParserr	   GetRevisionResourceArgSpecAddToParser)parsers    7lib/surface/infra_manager/revisions/export_statefile.pyArgszExportStatefile.Args*   s2    !!444	
 k&    c                     t        j                         }|j                  j                  j	                         }|j                         }t        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:
      The statefile containing signed url that can be used to upload state file.
    )r   GetMessagesModuleCONCEPTSrevisionParseRelativeNamer   ExportRevisionStateFile)selfargsmessagesrevision_refrevision_full_names        r   RunzExportStatefile.Run4   sR     "335H==))//1L%224.. 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	   (googlecloudsdk.command_lib.util.conceptsr
   ReleaseTracksReleaseTrackGACommandr   r)   r   r   <module>r3      sZ    * &  ' C ( @ B D D%%(()(dll ( *(r   