
                             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 dd
lmZ ddlmZ ddlmZ  G d de
j*                        Zy)zCommand to delete a project.    )absolute_import)division)unicode_literals)projects_api)smart_guardrails)base)flags)util)
completers)log)
console_ioc                   B    e Zd ZdZdej
                  iZed        Zd Z	y)Deletean  Delete a project.

  Deletes the project with the given project ID.

  This command can fail for the following reasons:
  * The project specified does not exist.
  * The active account does not have IAM role `role/owner` or another IAM role
    with the `resourcemanager.projects.delete` permission for the given project.

  See [Access control for projects using
  IAM](https://cloud.google.com/resource-manager/docs/access-control-proj) for
  more information.

  ## EXAMPLES

  The following command deletes the project with the ID `example-foo-bar-1`:

    $ {command} example-foo-bar-1

  ## SEE ALSO

  {see_also}
  see_alsoc                 <   t        j                  d      j                  |       | j                         t        j                  j
                  k7  r$t        j                  d      j                  |       |j                  j                  t        j                         y )Ndeletezproject deletion)r	   GetProjectIDNumberFlagAddToParserReleaseTrackr   GAGetRecommendFlagdisplay_infoAddCacheUpdaterr   ProjectCompleter)clsparsers     lib/surface/projects/delete.pyArgszDelete.Args;   sl    	  *66v>
T..111/0<<VD
''
(C(CD    c                    t        j                  |j                        }| j                         t        j                  j
                  k7  rq|j                  ret	        j                          t        j                  t        j                  j
                  |j                               }t	        j                          nd}t        j                  |      sy t        j                  |      }t!        j"                  |       t         j$                  j'                  dj)                  t*        j,                  |j                               |S )NzYour project will be deleted.zw
You can undo this operation for a limited period by running the command below.
    $ gcloud projects undelete {1}

{0})command_lib_utilParseProjectidr   r   r   	recommendEnableUserProjectQuotar   GetProjectDeletionRiskNameDisableUserProjectQuotar   PromptContinuer   r   r   DeletedResourcestatusPrintformatr	   SHUT_DOWN_PROJECTS)selfargsproject_refprompt_messageresults        r   Runz
Delete.RunD   s    "//8Kd//222t~~ !!#'>>








n ""$6n$$^4  -F$
 JJ	IIO$$dggJ/0 Mr   N)
__name__
__module____qualname____doc__r	   !CREATE_DELETE_IN_CONSOLE_SEE_ALSOdetailed_helpclassmethodr   r4    r   r   r   r       s2    0 uFFG-E Er   r   N)r8   
__future__r   r   r   +googlecloudsdk.api_lib.cloudresourcemanagerr   'googlecloudsdk.api_lib.smart_guardrailsr   googlecloudsdk.callioper   #googlecloudsdk.command_lib.projectsr	   r
   r!   +googlecloudsdk.command_lib.resource_managerr   googlecloudsdk.corer   googlecloudsdk.core.consoler   DeleteCommandr   r<   r   r   <module>rF      s=     # &  ' D D ( 5 H B # 2>T >r   