
                  	          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  \
R                   " \
R"                  R$                  \
R"                  R&                  \
R"                  R(                  5       " S S\
R*                  5      5       rSSSR/                  SSSSS5      S.\l        g)zCImplements the command to import GooGet packages into a repository.    )absolute_import)division)unicode_literals)apis)waiter)arg_parsers)base)
exceptions)flags)	resourcesc                   .    \ rS rSrSr\S 5       rS rSrg)Import   ?Import one or more GooGet packages into an artifact repository.c                     [         R                  " 5       R                  U 5        [        R                  R                  U 5        U R                  SSS[        R                  " 5       SS9  g)zPSet up arguements for this command.

Args:
  parser: An argparse.ArgumentPaser.
z--gcs-source
GCS_SOURCETz            The Google Cloud Storage location of a package to import.
            Wildcards may be added at the end to import multiple packages.)metavarrequiredtypehelpN)r   GetRepoArgFromBetaAddToParserr	   
ASYNC_FLAGadd_argumentr   ArgList)parsers    &lib/surface/artifacts/googet/import.pyArgsImport.Args$   s\     
**62OO'
  "N  O    c           	         [         R                  " SS5      nUR                  nSnUR                   H:  nSU;   d  M  SnUR	                  S5      (       a  M%  [
        R                  " SS5      e   UR                  R                  R                  5       nUR                  UR                  UR                  UR                  US9S	9UR                  5       S
9nUR                  R                  U5      n[         R"                  R%                  UR&                  SS9n	UR(                  (       a  U	$ [*        R,                  " [*        R.                  " UR0                  5      U	S5      n
U
$ )zRun package import command.artifactregistryv1F*Tr   z-Wildcards must be at the end of the GCS path.)urisuseWildcards)	gcsSource)importGoogetArtifactsRequestparentz.artifactregistry.projects.locations.operations)
collectionzImporting package(s))r   GetClientInstanceMESSAGES_MODULE
gcs_sourceendswithr
   InvalidArgumentExceptionCONCEPTS
repositoryParseIArtifactregistryProjectsLocationsRepositoriesGoogetArtifactsImportRequestImportGoogetArtifactsRequestImportGoogetArtifactsGcsSourceRelativeName/projects_locations_repositories_googetArtifactsr   r   REGISTRYParseRelativeNamenameasync_r   WaitForCloudOperationPollerNoResourcesprojects_locations_operations)selfargsclientmessagesuse_wildcardr-   repo_refrequestopop_refresults              r   Run
Import.Run7   sY   ##$6=F%%HLoo
	
	""3''33KM M	 & }}''--/H``%-%J%J==__) >  &K &
 $$& a (G 
	?	?	F	Fw	OB11
L 2 NF {{m~~

0
0224
(*f
 mr     N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   rI   __static_attributes__rK   r    r   r   r      s!     HO O$%r    r   r   zy
      *{command}* imports GooGet packages from Google Cloud Storage into the specified
      artifact repository.
      a  
      To import the package `my-package.goo` from Google Cloud Storage into
      `my-repo`, run:

        $ {0} my-repo --location=us-central1 --gcs-source={1}

      To import the packages `my-package.goo` and `other-package.goo` into
      `my-repo`, run:

        $ {0} my-repo --location=us-central1 --gcs-source={1},{2}

      To import all packages from `my-directory` into `my-repo`, run:

        $ {0} my-repo --location=us-central1 --gcs-source={3}

      To import all packages in all subdirectories from a Google Cloud
      Storage bucket into `my-repo`, run:

        $ {0} my-repo --location=us-central1 --gcs-source={4}
    z	{command}z%gs://my-bucket/path/to/my-package.gooz(gs://my-bucket/path/to/other-package.goozgs://my-bucket/my-directory/*zgs://my-bucket/**)briefDESCRIPTIONEXAMPLESN)rP   
__future__r   r   r   googlecloudsdk.api_lib.utilr   r   googlecloudsdk.callioper   r	   r
   $googlecloudsdk.command_lib.artifactsr   googlecloudsdk.corer   ReleaseTracksReleaseTrackALPHABETAGACommandr   formatdetailed_helprK   r    r   <module>rc      s     J &  ' , . / ( . 6 ) D%%++T->->-C-C%%((*;T\\ ;*;~ O
& 	{C9."	$3 r    