§
    Òrbil  ã                   ón   — d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z	  G d	„ d
e¦  «        Z
dS )u1   Session managers for the MÃ©tÃ©o-France REST API.é    )ÚAny)ÚOptional)ÚResponse)ÚSessioné   )ÚMETEOFRANCE_API_TOKEN)ÚMETEOFRANCE_API_URLc            
       óf   ‡ — e Zd ZU dZeZeed<   ddee         ddfd„Z	deded	e
d
e
def
ˆ fd„Zˆ xZS )ÚMeteoFranceSessionu„   HTTP session manager for MÃ©tÃ©o-France.

    This session object allows to manage the authentication in the API using a token.
    ÚhostNÚaccess_tokenÚreturnc                 óJ   — |pt           | _        t          j        | ¦  «         dS )zInitialize the authentication.

        Args:
            access_token: a string containing the authentication token for the REST API.
        N)r   r   r   Ú__init__)Úselfr   s     úg/var/www/html/mdtn/previsions/meteo_cartes/venv/lib/python3.11/site-packages/meteofrance_api/session.pyr   zMeteoFranceSession.__init__   s)   € ð )ÐAÕ,AˆÔÝÔ˜ÑÔÐÐÐó    ÚmethodÚpathÚargsÚkwargsc                 óö   •— |                      dd¦  «        }d| j        i}|r|                     |¦  «         ||d<    t          ¦   «         j        || j        › d|› g|¢R i |¤Ž}|                     ¦   «          |S )az  Make a request using token authentication.

        Args:
            method: Method for the HTTP request (example "get").
            path: path of the REST API endpoint.
            args: all other non-keyword arguments.
            kwargs: all other keyword arguments.

        Returns:
            the Response object corresponding to the result of the API request.
        ÚparamsNÚtokenú/)Úpopr   ÚupdateÚsuperÚrequestr   Úraise_for_status)	r   r   r   r   r   Úparams_inputsr   ÚresponseÚ	__class__s	           €r   r   zMeteoFranceSession.request   s—   ø€ ð Ÿ
š
 8¨TÑ2Ô2ˆà˜4Ô,Ð-ˆØð 	)ØMŠM˜-Ñ(Ô(Ð(à!ˆˆxÑØ"•5‘7”7”? 6¨d¬iÐ+@Ð+@¸$Ð+@Ð+@ÐRÀ4ÐRÐRÐRÈ6ÐRÐRˆØ×!Ò!Ñ#Ô#Ð#àˆr   )N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r	   r   ÚstrÚ__annotations__r   r   r   r   r   Ú__classcell__)r#   s   @r   r   r      s®   ø€ € € € € € ðð ð
 $€Dˆ#Ð#Ð#Ñ#ðð  X¨c¤]ð ¸dð ð ð ð ðØðØ!$ðØ-0ðØ<?ðà	ðð ð ð ð ð ð ð ð ð r   r   N)r'   Útypingr   r   Úrequestsr   r   Úconstr   r	   r   © r   r   ú<module>r/      s«   ðØ 7Ð 7à Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð à Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð à (Ð (Ð (Ð (Ð (Ð (Ø &Ð &Ð &Ð &Ð &Ð &ð)ð )ð )ð )ð )˜ñ )ô )ð )ð )ð )r   