
    	                     Z    d Z ddlmZ ddlmZ ddZ G d de      Z G d d	e      Zd
 Z	y)z6Shared utilities to access the Google Model Armor API.    )apis)baseNc                 \    t        j                  d| xs t        j                  d            S )zGet the default client.
modelarmor)r   GetClientInstanceResolveVersionversions    -lib/googlecloudsdk/api_lib/model_armor/api.py	GetClientr      s*    			G@t22<@
     c                       e Zd ZdZddZy)ClientzBase class for all clients.Nc                 l    |xs t        |      | _        |xs | j                  j                  | _        y Nr	   )r   clientMESSAGES_MODULEmessages)selfr   r   api_versions       r   __init__zClient.__init__    s)    :Ik:DK; ; ;DMr   NNN)__name__
__module____qualname____doc__r    r   r   r   r      s
    #<r   r   c                   6     e Zd ZdZd fd	Zd Zd Zd Z xZS )FloorSettingsz%High-level client for floor-settings.c                     |xs t        |      }t        t        |   ||       | j                  j
                  | _        y r   )r   superr   r   r   projects_locationsservice)r   r   r   r   	__class__s       r   r   zFloorSettings.__init__(   s4    5y5F	-'9;;11DLr   c                     | j                   j                  | _        | j                  j	                  |      }| j                  j                  |      S )z*Get the floor-setting with the given name.)name)r   r"   r#   r   1ModelarmorProjectsLocationsGetFloorSettingRequestGetFloorSetting)r   r&   reqs      r   GetzFloorSettings.Get-   sG    ;;11DL
--
I
I J C <<'',,r   c                     | j                   j                  | _        | j                  j	                  ||dj                  |            }| j                  j                  |      S )z-Update the floor-setting with the given name.,)floorSettingr&   
updateMask)r   folders_locationsr#   r   3ModelarmorFoldersLocationsUpdateFloorSettingRequestjoinUpdateFloorSetting)r   r&   floor_settingupdate_maskr)   s        r   UpdatezFloorSettings.Update5   sV    ;;00DL
--
K
K"88K( L C
 <<**3//r   c                     | j                   S )z2Returns the messages module for the given version.)r   )r   s    r   GetMessageszFloorSettings.GetMessages?   s    ==r   r   )	r   r   r   r   r   r*   r5   r7   __classcell__)r$   s   @r   r   r   %   s    -2
-0r   r   c                     | t         j                  j                  k(  ry| t         j                  j                  k(  ry| t         j                  j                  k(  ryy)z'Returns api version based on the track.v1alphav1betav1N)r   ReleaseTrackALPHABETAGA)tracks    r   GetApiFromTrackrB   D   sL    
d%%%!!&&&!!$$$ %r   )N)
r   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper   r   objectr   r   rB   r   r   r   <module>rF      s4    = - (<V <F >r   