
    l                        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 e	j"                   e	j$                  e	j&                  j(                         G d de	j*                                      Ze	j"                   e	j$                  e	j&                  j.                         G d de                    Zy)z+Disable the version of the provided secret.    )absolute_import)division)unicode_literals)api)base)parser_arguments)parser_extensions)args)logc                   &    e Zd ZdZed        Zd Zy)Disablea}  Disable the version of the provided secret.

  Disable the version of the provided secret. It can be re-enabled with
  `{parent_command} enable`.

  ## EXAMPLES

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

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

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

    $ {command} 123 --secret=my-secret --etag=123
  c                     t        j                  | ddd       t        j                  | dd       t        j                  | d       y )N
to disableTpurpose
positionalrequiredFr   hiddendisabledactionsecrets_args
AddVersionAddLocationAddVersionEtagparsers    'lib/surface/secrets/versions/disable.pyArgszDisable.Args0   s=     V\%Hz:    c                 R   t        j                  | j                               }|j                  j                  j                         }t        j                  |      j                  ||j                  |j                        }t        j                         j                  |       |S )Napi_versionetagsecret_locationsecrets_apiGetApiFromTrackReleaseTrackCONCEPTSversionParseVersionsr   r'   locationsecrets_logDisabledselfr
   r%   version_refresults        r    RunzDisable.Run8   s    --d.?.?.ABK--''--/K!!k:BB$))T]] C F ##K0Mr"   N)__name__
__module____qualname____doc__staticmethodr!   r8    r"   r    r   r      s       ; ;r"   r   c                   r    e Zd ZdZedej                  fd       Zdej                  de
j                  fdZy)DisableBetaa  Disable the version of the provided secret.

  Disable the version of the provided secret. It can be re-enabled with
  `{parent_command} enable`.

  ## EXAMPLES

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

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

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

    $ {command} 123 --secret=my-secret --etag=123
  r   c                     t        j                  | ddd       t        j                  | dd       t        j                  | d       y)	zArgs is called by calliope to gather arguments for secrets versions disable command.

    Args:
      parser: An argparse parser that you can use to add arguments that will be
        available to this command.
    r   Tr   Fr   r   r   Nr   r   s    r    r!   zDisableBeta.ArgsU   s?      V\%Hz:r"   r
   returnc                 R   t        j                  | j                               }|j                  j                  j                         }t        j                  |      j                  ||j                  |j                        }t        j                         j                  |       |S )a  Run is called by calliope to implement the secret versions disable command.

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

    Returns:
      API call to invoke secret version disable.
    r$   r&   r)   r4   s        r    r8   zDisableBeta.Runc   s     --d.?.?.ABK--''--/K!!k:BB$))T]] C F ##K0Mr"   N)r9   r:   r;   r<   r=   r   ArgumentInterceptorr!   r	   	Namespacer*   r0   r8   r>   r"   r    r@   r@   B   sI      ;#77 ; ;'11 k6J6J r"   r@   N)r<   
__future__r   r   r   googlecloudsdk.api_lib.secretsr   r*   googlecloudsdk.callioper   r   r	   "googlecloudsdk.command_lib.secretsr
   r   r   r2   DefaultUniverseOnlyReleaseTracksr,   GADeleteCommandr   BETAr@   r>   r"   r    <module>rO      s    2 &  ' = ( 4 5 C A D%%(() d     *  F D%%**+/' / , /r"   