
                         V   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  \R                  " \R                  R                  \R                  R                  \R                  R                   5       " S S	\R"                  5      5       rS
SSR'                  SS5      S.\l        g)zAImplements the command to upload GooGet packages to a repository.    )transfer)apis)waiter)base)flags)	resourcesc                   .    \ rS rSrSr\S 5       rS rSrg)Upload   2Upload a GooGet package to an artifact repository.c                     [         R                  " 5       R                  U 5        [        R                  R                  U 5        U R                  SSSSS9  g)zPSet up arguements for this command.

Args:
  parser: An argparse.ArgumentPaser.
z--sourceSOURCETz,            The path of a package to upload.)metavarrequiredhelpN)r   GetRepoArgFromBetaAddToParserr   
ASYNC_FLAGadd_argument)parsers    &lib/surface/artifacts/googet/upload.pyArgsUpload.Args    sN     
**62OO'
0	  1    c                 h   [         R                  " SS5      nUR                  nSUR                  S'   UR                  R
                  R                  5       nUR                  UR                  5       S9n[        R                  R                  UR                  SS9nUR                  R                  XVS9nUR                  n[        R                   R#                  UR$                  S	S
9n	UR&                  (       a  U	$ [(        R*                  " [(        R,                  " UR.                  5      U	S5      n
U
$ )zRun package import command.artifactregistryv1	multipartzX-Goog-Upload-Protocol)parentzapplication/gzip)	mime_type)uploadz.artifactregistry.projects.locations.operations)
collectionzUploading package)r   GetClientInstanceMESSAGES_MODULEadditional_http_headersCONCEPTS
repositoryParseIArtifactregistryProjectsLocationsRepositoriesGoogetArtifactsUploadRequestRelativeNamer   r
   FromFilesource/projects_locations_repositories_googetArtifacts	operationr   REGISTRYParseRelativeNamenameasync_r   WaitForCloudOperationPollerNoResourcesprojects_locations_operations)selfargsclientmessagesrepo_refrequestr!   responseopop_refresults              r   Run
Upload.Run1   s   ##$6=F%%H?JF""#;<}}''--/H``$$& a (G __%%dkk=O%PFEELL M  H 
		B11
L 2 NF {{m~~

0
0224
%'f
 mr    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r@   __static_attributes__rB   r   r   r
   r
      s     ;1 1 r   r
   r   zX
      *{command}* uploads a GooGet package to the specified artifact repository.
      z
      To upload the package `my-package.goo` to `my-repo`, run:

        $ {0} my-repo --location=us-central1 --source={1}
    z	{command}zmy-package.goo)briefDESCRIPTIONEXAMPLESN)rG   apitools.base.pyr   googlecloudsdk.api_lib.utilr   r   googlecloudsdk.callioper   $googlecloudsdk.command_lib.artifactsr   googlecloudsdk.corer   ReleaseTracksReleaseTrackALPHABETAGACommandr
   formatdetailed_helprB   r   r   <module>rZ      s     H & , . ( 6 ) D%%++T->->-C-C%%((*1T\\ 1*1j B
 	{,-
 r   