o
    i                  	   @   s>   d dl mZmZmZmZmZmZ G dd deeeeeeZdS )    )GetableAPIResourceCreateableAPIResourceUpdatableAPIResourceListableAPIResourceDeletableAPIResourceActionAPIResourcec                       s   e Zd ZdZdZe fddZe fddZe fddZe fd	d
Z	e fddZ
e fddZe fddZe fddZe fddZe fddZ  ZS )Monitorz,
    A wrapper around Monitor HTTP API.
    monitorc                    s@   d|v rt |d trd|d |d< tt| j|fi |S )a  
        Get monitor's details.

        :param id: monitor to retrieve
        :type id: id

        :param group_states: string list indicating what, if any, group states to include
        :type group_states: string list, strings are chosen from one or more         from 'all', 'alert', 'warn', or 'no data'

        :returns: Dictionary representing the API's JSON response
        group_states,)
isinstancelistjoinsuperr   get)clsidparams	__class__ H/home/ubuntu/.local/lib/python3.10/site-packages/datadog/api/monitors.pyr      s   zMonitor.getc                    sH   dD ]}||v rt || trd|| ||< qtt| jdi |S )a  
        Get all monitor details.

        :param group_states: string list indicating what, if any, group states to include
        :type group_states: string list, strings are chosen from one or more         from 'all', 'alert', 'warn', or 'no data'

        :param name: name to filter the list of monitors by
        :type name: string

        :param tags: tags to filter the list of monitors by scope
        :type tags: string list

        :param monitor_tags: list indicating what service and/or custom tags, if any,         should be used to filter the list of monitors
        :type monitor_tags: string list

        :returns: Dictionary representing the API's JSON response
        )r
   tagsmonitor_tagsr   Nr   )r   r   r   r   r   get_all)r   r   pr   r   r   r   /   s
   zMonitor.get_allc                       t t| jdd|fi |S )a  
        Mute a monitor.

        :param scope: scope to apply the mute
        :type scope: string

        :param end: timestamp for when the mute should end
        :type end: POSIX timestamp


        :returns: Dictionary representing the API's JSON response
        POSTmuter   r   _trigger_class_actionr   r   bodyr   r   r   r   J   s   zMonitor.mutec                    r   )a  
        Unmute a monitor.

        :param scope: scope to apply the unmute
        :type scope: string

        :param all_scopes: if True, clears mute settings for all scopes
        :type all_scopes: boolean

        :returns: Dictionary representing the API's JSON response
        r   unmuter   r!   r   r   r   r#   Z   s   zMonitor.unmutec                       t t| ddS )zl
        Globally mute monitors.

        :returns: Dictionary representing the API's JSON response
        r   mute_allr   r   r   r   r   r%   i      zMonitor.mute_allc                    r$   )z
        Cancel global monitor mute setting (does not remove mute settings for individual monitors).

        :returns: Dictionary representing the API's JSON response
        r   
unmute_allr   r&   r   r   r   r(   r   r'   zMonitor.unmute_allc                       t t| jdd|dS )ze
        Search monitors.

        :returns: Dictionary representing the API's JSON response
        GETsearchr   r   r   r   r   r   r   r+   {      zMonitor.searchc                    r)   )zk
        Search monitor groups.

        :returns: Dictionary representing the API's JSON response
        r*   zgroups/searchr,   r   r-   r   r   r   search_groups   r.   zMonitor.search_groupsc                    r)   )z
        Checks if the monitors corresponding to the monitor ids can be deleted.

        :returns: Dictionary representing the API's JSON response
        r*   
can_deleter,   r   r-   r   r   r   r0      r.   zMonitor.can_deletec                    s   t t| jdi |S )z
        Checks if the monitors definition is valid.

        :returns: Dictionary representing the API's JSON response
        r   validateN)r   r1   r   )r   r"   r   r   r   r1      r.   zMonitor.validate)__name__
__module____qualname____doc___resource_nameclassmethodr   r   r   r#   r%   r(   r+   r/   r0   r1   __classcell__r   r   r   r   r      s.    r   N)datadog.api.resourcesr   r   r   r   r   r   r   r   r   r   r   <module>   s    

