o
    Á¿iò  ã                   @   s&   d dl mZmZ G dd„ deeƒZdS )é    )ÚGetableAPIResourceÚUpdatableAPIResourcec                       s8   e Zd ZdZdZe‡ fdd„ƒZe‡ fdd„ƒZ‡  ZS )ÚMetadataz3
    A wrapper around Metric Metadata HTTP API
    Úmetricsc                    s   |st dƒ‚tt| ƒ |¡S )zÉ
        Get metadata information on an existing Datadog metric

        param metric_name: metric name (ex. system.cpu.idle)

        :returns: Dictionary representing the API's JSON response
        ú#'metric_name' parameter is required)ÚKeyErrorÚsuperr   Úget)ÚclsÚmetric_name©Ú	__class__© úH/home/ubuntu/.local/lib/python3.10/site-packages/datadog/api/metadata.pyr	      s   	zMetadata.getc                    s&   |st dƒ‚tt| ƒjdd|i|¤ŽS )aŒ  
        Update metadata fields for an existing Datadog metric.
        If the metadata does not exist for the metric it is created by
        the update.

        :param type: type of metric (ex. "gauge", "rate", etc.)
                            see http://docs.datadoghq.com/metrictypes/
        :type type: string

        :param description: description of the metric
        :type description: string

        :param short_name: short name of the metric
        :type short_name: string

        :param unit: unit type associated with the metric (ex. "byte", "operation")
                     see http://docs.datadoghq.com/units/ for full list
        :type unit: string

        :param per_unit: per unit type (ex. "second" as in "queries per second")
                         see http://docs.datadoghq.com/units/ for full list
        :type per_unit: string

        :param statsd_interval: statsd flush interval for metric in seconds (if applicable)
        :type statsd_interval: integer

        :returns: Dictionary representing the API's JSON response

        >>> api.Metadata.update(metric_name='api.requests.served', metric_type="counter")
        r   ÚidNr   )r   r   r   Úupdate)r
   r   Úparamsr   r   r   r      s    zMetadata.update)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú_resource_nameÚclassmethodr	   r   Ú__classcell__r   r   r   r   r      s    r   N)Údatadog.api.resourcesr   r   r   r   r   r   r   Ú<module>   s   