o
    iO                     @   s8   d dl mZ d dlmZ d dlmZ G dd deZdS )    )CheckStatus)ApiError)ActionAPIResourcec                       s$   e Zd ZdZe fddZ  ZS )ServiceCheckz1
    A wrapper around ServiceCheck HTTP API.
    c                    s\   |  D ]\}}|dkr"|| tjvr"tdddd tjD  qtt| jd	i |S )
a  
        Post check statuses for use with monitors

        :param check: text for the message
        :type check: string

        :param host_name: name of the host submitting the check
        :type host_name: string

        :param status: integer for the status of the check
        :type status: Options: '0': OK, '1': WARNING, '2': CRITICAL, '3': UNKNOWN

        :param timestamp: timestamp of the event
        :type timestamp: POSIX timestamp

        :param message: description of why this status occurred
        :type message: string

        :param tags: list of tags for this check
        :type tags: string list

        :returns: Dictionary representing the API's JSON response
        statusz#Invalid status, expected one of: %sz, c                 s   s    | ]}t |V  qd S )N)str).0v r
   N/home/ubuntu/.local/lib/python3.10/site-packages/datadog/api/service_checks.py	<genexpr>+   s    z%ServiceCheck.check.<locals>.<genexpr>POST	check_runN)r   r   )itemsr   ALLr   joinsuperr   _trigger_action)clsbodyparamvalue	__class__r
   r   check   s
   zServiceCheck.check)__name__
__module____qualname____doc__classmethodr   __classcell__r
   r
   r   r   r   	   s    r   N)datadog.api.constantsr   datadog.api.exceptionsr   datadog.api.resourcesr   r   r
   r
   r
   r   <module>   s   