o
    iB	                  	   @   sJ   d dl mZmZmZmZmZmZ d dlmZ G dd deeeeeeZ	dS )    )ActionAPIResourceCreateableAPIResourceCustomUpdatableAPIResourceDeletableAPIResourceGetableAPIResourceListableAPIResource)	APIClientc                       sD   e Zd ZdZdZdZe fddZedd Zedd	 Z	  Z
S )
Rolesz(
    A wrapper around Tag HTTP API.
    rolesv2c                    s"   i }t t| j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__ E/home/ubuntu/.local/lib/python3.10/site-packages/datadog/api/roles.pyr      s   	zRoles.updatec                 K   8   i }dj | j|d}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_versionr   r   r   assign_permission+      	zRoles.assign_permissionc                 K   r   )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#   r   r   r   unassign_permission:   r'   zRoles.unassign_permission)__name__
__module____qualname____doc__r    r   classmethodr   r&   r)   __classcell__r   r   r   r   r	      s    
r	   N)
datadog.api.resourcesr   r   r   r   r   r   datadog.api.api_clientr   r	   r   r   r   r   <module>   s    	
