
    9YfB	              
       P    d dl mZmZmZmZmZmZ d dlmZ  G d deeeeee      Z	y)    )ActionAPIResourceCreateableAPIResourceCustomUpdatableAPIResourceDeletableAPIResourceGetableAPIResourceListableAPIResource)	APIClientc                   T     e Zd ZdZdZdZe fd       Zed        Zed        Z	 xZ
S )Rolesz(
    A wrapper around Tag HTTP API.
    rolesv2c                 6    i }t        t        | 
  d|fd|i|S )z
        Update a role's attributes

        :param id: uuid of the role
        :param body: dict with type of the input, role `id`, and modified attributes
        :returns: Dictionary representing the API's JSON response
        PATCHparams)superr   update)clsidbodyr   	__class__s       Q/var/www/highfloat_scraper/venv/lib/python3.12/site-packages/datadog/api/roles.pyr   zRoles.update   s(     UC'KFKdKK    c                     i }dj                  | j                  |      }t        | dd      }t        j                  d|||fi |S )a  
        Assign permission to a role

        :param id: uuid of the role to assign permission to
        :param body: dict with "type": "permissions" and uuid of permission to assign
        :returns: Dictionary representing the API's JSON response
        ){resource_name}/{resource_id}/permissionsresource_nameresource_id_api_versionNPOSTformat_resource_namegetattrr	   submitr   r   r   r   pathapi_versions         r   assign_permissionzRoles.assign_permission+   sP     :AAPSPbPbprAsc>48k4J6JJr   c                     i }dj                  | j                  |      }t        | dd      }t        j                  d|||fi |S )a  
        Unassign permission from a role

        :param id: uuid of the role to unassign permission from
        :param body: dict with "type": "permissions" and uuid of permission to unassign
        :returns: Dictionary representing the API's JSON response
        r   r   r   NDELETEr    r%   s         r   unassign_permissionzRoles.unassign_permission:   sP     :AAPSPbPbprAsc>48$TLVLLr   )__name__
__module____qualname____doc__r"   r   classmethodr   r(   r+   __classcell__)r   s   @r   r   r      sT     NL	L 	L K K M Mr   r   N)
datadog.api.resourcesr   r   r   r   r   r   datadog.api.api_clientr	   r    r   r   <module>r5      s2     -7M7Mr   