
    }              	           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   " S S\
R                   5      rSSSR%                  SSSSS5      S.\l        g)zCImplements the command to import Debian packages into a repository.    )absolute_import)division)unicode_literals)apis)waiter)arg_parsers)base)
exceptions)flags)	resourcesc                   2    \ rS rSrSrSr\S 5       rS rSr	g)Import   ?Import one or more Debian packages into an artifact repository.v1c                     [         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.
            To import multiple packages, use wildcards at the end of the path.
            )metavarrequiredtypehelpN)r   
GetRepoArgAddToParserr	   
ASYNC_FLAGadd_argumentr   ArgList)parsers    #lib/surface/artifacts/apt/import.pyArgsImport.Args$   sZ     
""6*OO'
  "      c                    [         R                  " SU R                  5      nUR                  nUR                   H8  nSU;   d  M  UR                  S5      (       a  M#  [        R                  " SS5      e   UR                  R                  R                  5       nUR                  UR                  SS9nUR                  US9nUR                  U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.                  " [,        R0                  " UR2                  5      U	S5      n
U
$ )zRun package import command.artifactregistry*r   z-Wildcards must be at the end of the GCS path.T)urisuseWildcards)	gcsSource)importAptArtifactsRequestparentz.artifactregistry.projects.locations.operations)
collectionzImporting package(s))r   GetClientInstanceapi_versionMESSAGES_MODULE
gcs_sourceendswithr
   InvalidArgumentExceptionCONCEPTS
repositoryParseImportAptArtifactsGcsSourceImportAptArtifactsRequestFArtifactregistryProjectsLocationsRepositoriesAptArtifactsImportRequestRelativeName,projects_locations_repositories_aptArtifactsr   r   REGISTRYParseRelativeNamenameasync_r   WaitForCloudOperationPollerNoResourcesprojects_locations_operations)selfargsclientmessagesr.   repo_refimport_requestrequestopop_refresults              r   Run
Import.Run8   s_   ##$68H8HIF%%Hoo
	
	:#6#6s#;#;11IK 	K &
 }}''--/H55__ 6 J 77 8 N ]]"0$$& ^ (G 
	<	<	C	CG	LB11
L 2 NF {{m~~

0
0224
(*f
 mr!    N)
__name__
__module____qualname____firstlineno____doc__r,   staticmethodr   rJ   __static_attributes__rL   r!   r   r   r      s!    G+ &"r!   r   r   zy
      *{command}* imports Debian packages from Google Cloud Storage into the specified
      artifact repository.
      a  
      To import the package `my-package.deb` from Google Cloud Storage into
      `my-repo`, run:

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

      To import the packages `my-package.deb` and `other-package.deb` 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.debz(gs://my-bucket/path/to/other-package.debzgs://my-bucket/my-directory/*zgs://my-bucket/**)briefDESCRIPTIONEXAMPLESN)rQ   
__future__r   r   r   googlecloudsdk.api_lib.utilr   r   googlecloudsdk.callioper   r	   r
   $googlecloudsdk.command_lib.artifactsr   googlecloudsdk.corer   Commandr   formatdetailed_helprL   r!   r   <module>r_      sn     J &  ' , . / ( . 6 );T\\ ;~ O
& 	{C9."	$3 r!   