
    
                     j    d 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      Z G d d	e      Z	d
 Z
y)zHBase classes for abstracting away common logic for web security scanner.    )absolute_import)division)unicode_literals)apisc                   >    e Zd ZdZ G d de      Z eddd      ZeZy)WebSecurityScannerApiVersionzAn enum representing the API version of Web Security Scanner.

  The WebSecurityScanner API version controls which version of WSS API to use
  for a certain command under certain release track.
  c                   "    e Zd ZdZd Zd Zd Zy)%WebSecurityScannerApiVersion._VERSIONz=An enum representing the API version of Web Security Manager.c                 .    || _         || _        || _        y N)idhelp_tag	help_note)selfr   r   r   s       ;lib/googlecloudsdk/api_lib/web_security_scanner/wss_base.py__init__z.WebSecurityScannerApiVersion._VERSION.__init__#   s    dgdm dn    c                     | j                   S r   r   r   s    r   __str__z-WebSecurityScannerApiVersion._VERSION.__str__(   s    WWnr   c                 4    | j                   |j                   k(  S r   r   )r   others     r   __eq__z,WebSecurityScannerApiVersion._VERSION.__eq__+   s    WW  r   N)__name__
__module____qualname____doc__r   r   r    r   r   _VERSIONr
      s    G!
!r   r    v1betaN)r   r   r   r   objectr    V1BETA_ALLr   r   r   r   r      s(    ! ! HdD)&
$r   r   c                   V    e Zd ZdZej
                  ZdZdZd Z	e
d        Ze
d        Zy)WebSecurityScannerCommandzLWebSecurityScannerCommand is a base class for web security scanner commands.Nc                      y r   r   r   s    r   r   z"WebSecurityScannerCommand.__init__:   s    r   c                     | j                   /t        j                  d| j                  j                        | _         | j                   S )z(Specifies the WebSecurityScanner client.websecurityscanner)_clientr   GetClientInstance_versionr   r   s    r   clientz WebSecurityScannerCommand.client=   s:     ||++,@,0MM,<,<>dl<<r   c                     | j                   /t        j                  d| j                  j                        | _         | j                   S )z*Specifies the WebSecurityScanner messages.r)   )	_messagesr   GetMessagesModuler,   r   r   s    r   messagesz"WebSecurityScannerCommand.messagesE   s;     ~~--.B.2mm.>.>@dn>>r   )r   r   r   r   r   r#   r,   r*   r/   r   propertyr-   r1   r   r   r   r&   r&   3   sG    T)00(')	    r   r&   c                       fd}|S )zMark this command class to use given Web Security Scanner API version.

  Args:
    api_version: Web Security Scanner API version to use for the command

  Returns:
    The decorator function
  c                     | _         | S )z#Wrapper function for the decorator.)_wss_version)	cmd_classapi_versions    r   InitApiHolderz/UseWebSecurityScannerApi.<locals>.InitApiHolderX   s     )Ir   r   )r7   r8   s   ` r   UseWebSecurityScannerApir9   N   s     
r   N)r   
__future__r   r   r   googlecloudsdk.api_lib.utilr   r"   r   r&   r9   r   r   r   <module>r<      s4    O &  ' ,6 6 6r   