
                  	           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
\R                  5      rSSSR                  SSSSS5      S.\l        g)z@Implements the command to import yum packages into a repository.    )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 RPM 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/yum/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)importYumArtifactsRequestparentz.artifactregistry.projects.locations.operations)
collectionzImporting package(s))r   GetClientInstanceapi_versionMESSAGES_MODULE
gcs_sourceendswithr   InvalidArgumentExceptionCONCEPTS
repositoryParseImportYumArtifactsGcsSourceImportYumArtifactsRequestFArtifactregistryProjectsLocationsRepositoriesYumArtifactsImportRequestRelativeName,projects_locations_repositories_yumArtifactsr   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.Run5   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   rG   __static_attributes__rI   r   r   r   r      s!    D+ &"r   r   r   zv
      *{command}* imports RPM packages from Google Cloud Storage into the specified
      artifact repository.
      a  
      To import the package `my-package.rpm` from Google Cloud Storage into
      `my-repo`, run:

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

      To import the packages `my-package.rpm` and `other-package.rpm` 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.rpmz(gs://my-bucket/path/to/other-package.rpmzgs://my-bucket/my-directory/*zgs://my-bucket/**)briefDESCRIPTIONEXAMPLESN)rN   googlecloudsdk.api_lib.utilr   r   googlecloudsdk.callioper   r   r   $googlecloudsdk.command_lib.artifactsr   googlecloudsdk.corer	   Commandr   formatdetailed_helprI   r   r   <module>r[      sg     G - . / ( . 6 );T\\ ;~ L
& 	{C9."	$3 r   