
                            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Z ej$                  ej&                  j(                         G d dej*                               Z ej$                  ej&                  j.                  ej&                  j0                         G d de             Zy)z5Command to delete a Persistent Resource in Vertex AI.    )absolute_import)division)unicode_literals)client)base)	constants)endpoint_util)flags)
validation)logzRequest to delete the PersistentResource [{name}] has been sent.

You may view the status of your persistent resource with the command

  $ {command_prefix} ai persistent-resources describe {name}
c                   D    e Zd ZdZej
                  Zed        Zd Z	d Z
y)DeleteGAB  Delete an active Persistent Resource.

  If the Persistent Resource is not in the active state,
  the command will not perform any operation.

  ## EXAMPLES

  To delete a persistent resource ``123'' under project ``example'' in region
  ``us-central1'', run:

    $ {command} 123 --project=example --region=us-central1
  c                 0    t        j                  | d       y )Nz	to delete)r
    AddPersistentResourceResourceArg)parsers    -lib/surface/ai/persistent_resources/delete.pyArgszDeleteGA.Args6   s    	**6;?    c                 ~    d}| j                         j                  r |d| j                         j                  z   z  }|S )Ngcloud )ReleaseTrackprefix)self
cmd_prefixs     r   _CommandPrefixzDeleteGA._CommandPrefix:   s=    J!!C$++-4444jr   c                    |j                   j                  j                         }|j                         d   }t	        j
                  |       t        j                  | j                  |      5  |j                         }t        j                  | j                        j                  |      }t        j                  j                  t         j#                  || j%                                      |cd d d        S # 1 sw Y   y xY w)NlocationsId)versionregion)r    )namecommand_prefix)CONCEPTSpersistent_resourceParseAsDictr   ValidateRegionr	   AiplatformEndpointOverrides_api_versionRelativeNamer   PersistentResourcesClientDeleter   statusPrint+_PERSISTENT_RESOURCE_DELETE_DISPLAY_MESSAGEformatr   )r   argspersistent_resource_refr!   resource_nameresponses         r   RunzDeleteGA.Run@   s    "mm??EEG$++-m<Ff%		2	2!!&
2-::<m11##%%+VM%: 	jj
5
<
< 1D1D1F = HI 
2 
2 
2s   .BC;;DN)__name__
__module____qualname____doc__r   
GA_VERSIONr*   staticmethodr   r   r6    r   r   r   r   &   s2     %%,@ @r   r   c                   (    e Zd ZdZej
                  Zy)DeletePreGAr   N)r7   r8   r9   r:   r   BETA_VERSIONr*   r=   r   r   r?   r?   P   s     '',r   r?   N)r:   
__future__r   r   r   .googlecloudsdk.api_lib.ai.persistent_resourcesr   googlecloudsdk.callioper   googlecloudsdk.command_lib.air   r	   2googlecloudsdk.command_lib.ai.persistent_resourcesr
   r   googlecloudsdk.corer   r0   ReleaseTracksr   GASilentCommandr   ALPHABETAr?   r=   r   r   <module>rL      s    < &  ' A ( 3 7 D I #/ + D%%(()&t!! & *&R D%%++T->->-C-CD(( ( E(r   