o
    Á¿ig  ã                   @   s,   d dl mZ d dlmZ G dd„ deƒZdS )é    )Úformat_points)ÚSendableAPIResourcec                       s*   e Zd ZdZdZed‡ fdd„	ƒZ‡  ZS )	ÚDistributionz&A wrapper around Distribution HTTP APIÚdistribution_pointsNTFc                    sh   |r|D ]}t |tƒrt|d ƒ|d< qd|i}nt|d ƒ|d< d|gi}tt| ƒjd||dœ|¤ŽS )a°  
        Submit a distribution metric or a list of distribution metrics to the distribution metric
        API

        :param compress_payload: compress the payload using zlib
        :type compress_payload: bool
        :param metric: the name of the time series
        :type metric: string
        :param points: a (timestamp, [list of values]) pair or
        list of (timestamp, [list of values]) pairs
        :type points: list
        :param host: host name that produced the metric
        :type host: string
        :param tags:  list of tags associated with the metric.
        :type tags: string list
        :returns: Dictionary representing the API's JSON response
        ÚpointsÚseries)Úattach_host_nameÚcompress_payloadN© )Ú
isinstanceÚdictr   Úsuperr   Úsend)ÚclsÚdistributionsr   r	   ÚdistributionÚdÚseries_dict©Ú	__class__r
   úM/home/ubuntu/.local/lib/python3.10/site-packages/datadog/api/distributions.pyr      s   
€

ÿÿzDistribution.send)NTF)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú_resource_nameÚclassmethodr   Ú__classcell__r
   r
   r   r   r   	   s
    r   N)Údatadog.api.formatr   Údatadog.api.resourcesr   r   r
   r
   r
   r   Ú<module>   s   