
    T                        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 e	j(                   e	j*                  e	j,                  j.                         G d de	j0                                      Ze	j(                   e	j*                  e	j,                  j4                         G d de                    Zy)zList all versions for a secret.    )absolute_import)division)unicode_literals)api)base)parser_arguments)parser_extensions)args)fmt)resource_expr_rewrite)resource_projection_specc                   r    e Zd ZdZedej                  fd       Zdej                  de
j                  fdZy)ListList all versions for a secret.

  List all versions and their status (For example: active/disabled/destroyed)
  for a secret.

  ## EXAMPLES

  List all versions for the secret named 'my-secret':

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

    Args:
      parser: An argparse parser that you can use to add arguments that will be
        available to this command.
    from which to list versionsTpurpose
positionalrequiredto create secretFr   hiddend   Nsecrets_args	AddSecretAddLocationr   PAGE_SIZE_FLAG
SetDefaultr   s    $lib/surface/secrets/versions/list.pyArgsz	List.Args.   sI     -	 V-?N""63/    r
   returnc                 z   t        j                  | j                               }|j                  j                  j                         }|j                  rt        j                  ||       nt        j                  ||       d}|j                  rot        j                         }|j                         }t        j                  |j                   |j"                        }|j%                  |j                  |      \  }}t        j&                  |      j)                  ||j*                  ||j                        S )a   Run is called by calliope to implement the secret versions list command.

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

    Returns:
      API call to invoke secret version list.
    api_versionNsymbolsaliasesdefaults
secret_reflimitrequest_filtersecret_locationsecrets_apiGetApiFromTrackReleaseTrackCONCEPTSsecretParselocationsecrets_fmt'RegionalSecretVersionTableUsingArgumentSecretVersionTableUsingArgumentfilterr   BackendGetDisplayInfor   ProjectionSpec
transformsr,   RewriteVersionsListWithPagerr1   	selfr
   r)   r0   server_filterrewriterdisplay_infor.   _s	            r#   RunzList.Run?   s    --d.?.?.ABK%%++-J}}99
K 11$KPM{{&..0h((*l)88))<3G3Gh "))$++)IaK8FFjj$	 G  r%   N)__name__
__module____qualname____doc__staticmethodr   ArgumentInterceptorr$   r	   	Namespacer5   rE   rM    r%   r#   r   r      sI    
 0#77 0 0  '11  k6J6J  r%   r   c                   &    e Zd ZdZed        Zd Zy)ListBetar   c                     t        j                  | ddd       t        j                  | dd       t        j                  j                  | d       y )Nr   Tr   r   Fr   r   r   r"   s    r#   r$   zListBeta.Argsq   sG    -	 V-?N""63/r%   c                 z   t        j                  | j                               }|j                  j                  j                         }|j                  rt        j                  ||       nt        j                  ||       d }|j                  rot        j                         }|j                         }t        j                  |j                   |j"                        }|j%                  |j                  |      \  }}t        j&                  |      j)                  ||j*                  ||j                        S )Nr(   r*   r-   r/   r4   rG   s	            r#   rM   zListBeta.Run|   s    --d.?.?.ABK%%++-J}}99
K 11$KPM{{&..0h((*l)88))<3G3Gh "))$++)IaK8FFjj$	 G  r%   N)rN   rO   rP   rQ   rR   r$   rM   rU   r%   r#   rW   rW   b   s     
 0 0r%   rW   N)rQ   
__future__r   r   r   googlecloudsdk.api_lib.secretsr   r5   googlecloudsdk.callioper   r   r	   "googlecloudsdk.command_lib.secretsr
   r   r   r<   googlecloudsdk.core.resourcer   r   DefaultUniverseOnlyReleaseTracksr7   GAListCommandr   BETArW   rU   r%   r#   <module>rd      s    & &  ' = ( 4 5 C A > A D%%(()>4 > * >B D%%**+/t / , /r%   