
    
                         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                  ej                  j                         ej"                   G d
 dej$                                             Zy)z$Export an Artifact Registry version.    )absolute_import)division)unicode_literals)base)flags)requests)log)	resourcesc                   0    e Zd ZdZdddZed        Zd Zy)ExportzExport an Artifact Registry package version.

  Export files of an Artifact Registry package version to a Google Cloud Storage
  path.
  z{description}a        To export version `1.0.0` of package `my-pkg` to a Google Cloud Storage path `gs://my-bucket/sub-folder` under the current project, repository, and location, run:

          $ {command} 1.0.0 --package=my-pkg --gcs-destination=gs://my-bucket/sub-folder
  )DESCRIPTIONEXAMPLESc                 t    t        j                         j                  |        | j                  dddd       y)zTSet up arguments for this command.

    Args:
      parser: An argparse.Parser.
    z--gcs-destinationGCS_DESTINATIONTz4Google Cloud Storage path to export the artifact to.)metavarrequiredhelpN)r   GetRequiredVersionFlagAddToParseradd_argument)parsers    (lib/surface/artifacts/versions/export.pyArgszExport.Args/   s:     
  "..v6
!C	      c                    |j                   j                  j                         }|j                  j	                  d      }t        j                  |d|      }t        j                  j                  |j                  d      }t        j                  j                  dj                  |j                         |j                  |j                                      y)zRun the export command.zgs://Nz.artifactregistry.projects.locations.operations)
collectionz@Export request issued from [{}] to [{}].
Created operation [{}].)CONCEPTSversionParsegcs_destinationremoveprefixr   ExportArtifactr
   REGISTRYParseRelativeNamenamer	   statusPrintformatRelativeName)selfargsversion_refr    opop_refs         r   Runz
Export.Run>   s    --''--/K **77@O		 	 dO	DB11
L 2 F JJK	$$&  !

r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r/    r   r   r   r      s1     %-  r   r   N)r3   
__future__r   r   r   googlecloudsdk.callioper   $googlecloudsdk.command_lib.artifactsr   r   googlecloudsdk.corer	   r
   UniverseCompatibleReleaseTracksReleaseTrackGAHiddenCommandr   r6   r   r   <module>rA      st    + &  ' ( 6 9 # ) D%%(()0T\\ 0  * 0r   