
                         V   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                  j                   e	j                  j"                  e	j                  j$                        e	j&                   G d
 de	j(                                      Zy)z,Delete Google Cloud Platform git repository.    )absolute_import)division)unicode_literals)
sourcerepo)actions)base)log)
console_ioc                   &    e Zd ZdZed        Zd Zy)Deletea)  Delete a cloud source repository.

  This command deletes a named git repository from the currently
  active Google Cloud Platform project.

  ## EXAMPLES

  To delete a named repository in the current project issue the
  following commands:

    $ gcloud init

    $ {command} REPOSITORY_NAME

  c           	          | j                  dd       | j                  dt        j                  dddd      d	
       y )Nrepository_namezName of the repository.)helpz--forcezKThe {flag_name} option has been removed; use --quiet to suppress prompting.T
store_true)errorremovedactionz1If provided, skip the delete confirmation prompt.)r   r   )add_argumentr   DeprecationAction)parsers    "lib/surface/source/repos/delete.pyArgszDelete.Args1   sP    
)0IJ
((,! A  B    c                    t        j                  |j                        }dj                  |j	                               }dj                  |j	                         |j
                        }t        j                  ||d      rXt        j                         }|j                  |       t        j                  |j	                                |j	                         S y)a]  Delete a named GCP repository in the current project.

    Args:
      args: argparse.Namespace, the arguments this command is run with.

    Returns:
      The path to the deleted git repository.

    Raises:
      sourcerepo.RepoResourceError: on resource initialization errors.
      apitools.base.py.exceptions.HttpError: on request errors.
    zEIf {repo} is deleted, the name cannot be reused for up to seven days.)repoz"Delete "{repo}" in project "{prj}")r   prjT)messageprompt_stringdefaultN)r   	ParseRepor   formatName
projectsIdr
   PromptContinueSource
DeleteRepor	   DeletedResource)selfargsresdelete_warningr   sourcerepo_handlers         r   Runz
Delete.Run>   s     

t33
4C''-v388:v'> 9@@XXZS^^ A -M  mTK%,,. ##C(	#((*%XXZKr   N)__name__
__module____qualname____doc__staticmethodr   r-    r   r   r   r      s"    
  
B 
Br   r   N)r1   
__future__r   r   r   googlecloudsdk.api_lib.sourcer   googlecloudsdk.callioper   r   googlecloudsdk.corer	   googlecloudsdk.core.consoler
   ReleaseTracksReleaseTrackGAALPHABETADefaultUniverseOnlyDeleteCommandr   r3   r   r   <module>r@      s    3 &  ' 4 + ( # 2 $++1143D3D3I3I 7T 7 7r   