
    9Yf
                     \    d dl mZ d dlmZmZmZmZ  G d dee      Z G d deeee      Zy)    )urlparse)CreateableAPIResourceActionAPIResourceGetableAPIResourceListableAPIResourcec                   D     e Zd ZdZdZe fd       Ze fd       Z xZS )Graphz*
    A wrapper around Graph HTTP API.
    zgraph/snapshotc                 .    t        t        | 
  dddi|S )a  
        Take a snapshot of a graph, returning the full url to the snapshot.

        :param metric_query: metric query
        :type metric_query: string query

        :param start: query start timestamp
        :type start: POSIX timestamp

        :param end: query end timestamp
        :type end: POSIX timestamp

        :param event_query: a query that will add event bands to the graph
        :type event_query: string query

        :returns: Dictionary representing the API's JSON response
        methodGET )superr	   create)clsparams	__class__s     R/var/www/highfloat_scraper/venv/lib/python3.12/site-packages/datadog/api/graphs.pyr   zGraph.create   s    & UC'?u???    c                     t        |      j                  }|j                  d      d   j                  d      d   }dj                  |      }t        t
        |   d|      S )a  
        Returns the status code of snapshot. Can be used to know when the
        snapshot is ready for download.

        :param snapshot_url: snapshot URL to check
        :type snapshot_url: string url

        :returns: Dictionary representing the API's JSON response
        z/snapshot/view/   z.pngr   zgraph/snapshot_status/{0}r   )r   pathsplitformatr   r	   _trigger_action)r   snapshot_url	snap_pathsnapshot_status_urlr   s       r   statuszGraph.status$   s_     \*//	OO$56q9??GJ	9@@KUC08KLLr   )	__name__
__module____qualname____doc___resource_nameclassmethodr   r   __classcell__r   s   @r   r	   r	      s9     &N@ @( M Mr   r	   c                   D     e Zd ZdZdZe fd       Ze fd       Z xZS )Embedz*
    A wrapper around Embed HTTP API.
    zgraph/embedc                 0    t         t        |   d|d      S )z
        Enable a specified embed.

        :param embed_id: embed token
        :type embed_id: string embed token

        :returns: Dictionary representing the API's JSON response
        r   enableidaction_namer   r(   _trigger_class_actionr   embed_idr   s     r   r*   zEmbed.enable>        UC6uW_6``r   c                 0    t         t        |   d|d      S )z
        Revoke a specified embed.

        :param embed_id: embed token
        :type embed_id: string embed token

        :returns: Dictionary representing the API's JSON response
        r   revoker+   r.   r0   s     r   r4   zEmbed.revokeJ   r2   r   )	r   r    r!   r"   r#   r$   r*   r4   r%   r&   s   @r   r(   r(   7   s9     #N	a 	a 	a 	ar   r(   N)	datadog.util.compatr   datadog.api.resourcesr   r   r   r   r	   r(   r   r   r   <module>r7      s;    ) s s,M!#4 ,M^a!35FH] ar   