
                            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 e	j&                   e	j(                  e	j*                  j,                         G d de	j.                                      Ze	j&                   e	j(                  e	j*                  j2                         G d de                    Zy)z4Destroy a secret version's metadata and secret data.    )absolute_import)division)unicode_literals)api)base)parser_arguments)parser_extensions)args)log)
console_ioc                   v    e Zd ZdZdZedej                  fd       Zde	j                  dej                  fdZy)	Destroyaw  Destroy a secret version's metadata and secret data.

  Destroy a secret version's metadata and secret data. This action is
  irreversible.

  ## EXAMPLES

  Destroy version `123` of the secret named `my-secret`:

    $ {command} 123 --secret=my-secret

  Destroy version `123` of the secret named `my-secret` using etag:

    $ {command} 123 --secret=my-secret --etag=123
  zfYou are about to destroy version [{version}] of the secret [{secret}]. This action cannot be reversed.parserc                     t        j                  | ddd       t        j                  | dd       t        j                  | d       y	)
zArgs is called by calliope to gather arguments for secrets versions destroy command.

    Args:
      parser: An argparse parser that you can use to add arguments that will be
        available to this command.
    
to destroyTpurpose
positionalrequiredto destroy Fr   hidden	destroyedactionNsecrets_args
AddVersionAddLocationAddVersionEtagr   s    'lib/surface/secrets/versions/destroy.pyArgszDestroy.Args5   s?      V]5I{;    r
   returnc                    t        j                  | j                               }|j                  j                  j                         }t        j                  | j                  j                  |j                         |j                         j                               dd       t        j                  |      j                  ||j                  |j                        }|j                   %t#        j                         j%                  |       |S t#        j                         j'                  |j                   |       |S )a  Run is called by calliope to implement the secret versions destroy command.

    Args:
      args: an argparse namespace, all the arguments that were provided to this
        command invocation.

    Returns:
      API call to invoke secret version destroy.
    versionsecretTthrow_if_unattendedcancel_on_noapi_versionetagsecret_locationsecrets_apiGetApiFromTrackReleaseTrackCONCEPTSr(   Parser   PromptContinueCONFIRM_DESTROY_MESSAGEformatNameParentVersionsr   r0   locationscheduledDestroyTimesecrets_log	DestroyedScheduledDestroyselfr
   r.   version_refresults        r"   RunzDestroy.RunC   s    --d.?.?.ABK--''--/K$$++$$&{/A/A/C/H/H/J 	, 	
 ! !!k:BB$))T]] C F ""*&&{3
 M --

%
%{ Mr$   N)__name__
__module____qualname____doc__r9   staticmethodr   ArgumentInterceptorr#   r	   	Namespacer3   r=   rG    r$   r"   r   r      sS    "(  <#77 < <'11 k6J6J r$   r   c                   &    e Zd ZdZed        Zd Zy)DestroyBetaaz  Destroy a secret version's metadata and secret data.

  Destroy a secret version's metadata and secret data. This action is
  irreversible.

  ## EXAMPLES

  Destroy version `123` of the secret named `my-secret`:

    $ {command} 123 --secret=my-secret

  Destroy version `123` of the secret named `my-secret` using an etag:

    $ {command} 123 --secret=my-secret --etag=123
  c                     t        j                  | ddd       t        j                  | dd       t        j                  | d       y )	Nr   Tr   r   Fr   r   r   r   r!   s    r"   r#   zDestroyBeta.Argsv   s=     V]5I{;r$   c                    t        j                  | j                               }|j                  j                  j                         }t        j                  | j                  j                  |j                         |j                         j                               dd       t        j                  |      j                  ||j                  |j                        }|j                   %t#        j                         j%                  |       |S t#        j                         j'                  |j                   |       |S )Nr'   Tr*   r-   r/   r2   rC   s        r"   rG   zDestroyBeta.Run~   s   --d.?.?.ABK--''--/K$$++$$&{/A/A/C/H/H/J 	, 	
 ! !!k:BB$))T]] C F ""*&&{3
 M --

%
%{ Mr$   N)rH   rI   rJ   rK   rL   r#   rG   rO   r$   r"   rQ   rQ   c   s       < <r$   rQ   N)rK   
__future__r   r   r   googlecloudsdk.api_lib.secretsr   r3   googlecloudsdk.callioper   r   r	   "googlecloudsdk.command_lib.secretsr
   r   r   r@   googlecloudsdk.core.consoler   DefaultUniverseOnlyReleaseTracksr5   GADeleteCommandr   BETArQ   rO   r$   r"   <module>r^      s    ; &  ' = ( 4 5 C A 2 D%%(()@d   @ * @F D%%**+-' - , -r$   