§
    ÒrbiÒ  ã                   óœ   — d Z ddlmZ ddlmZ ddlmZ  G d„ de¦  «        Z G d„ de¦  «        Z G d	„ d
e¦  «        Z G d„ d¦  «        ZdS )u8   Dictionary Python model for the MÃ©tÃ©o-France REST API.é    )ÚList)ÚOptional)Ú	TypedDictc                   ó(   — e Zd ZU dZeed<   eed<   dS )ÚPhenomenonDictionaryEntryz×Represents a single meteorological phenomenon entry.

    Attributes:
        id: An integer representing the unique identifier of the phenomenon.
        name: A string representing the name of the phenomenon.
    ÚidÚnameN©Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚintÚ__annotations__Ústr© ó    úp/var/www/html/mdtn/previsions/meteo_cartes/venv/lib/python3.11/site-packages/meteofrance_api/model/dictionary.pyr   r      s.   € € € € € € ðð ð 	€G€GGØ
€I€II€I€Ir   r   c                   ó<   — e Zd ZU dZeed<   eed<   eed<   eed<   dS )ÚColorDictionaryEntryay  Represents a single color entry used in meteorological warnings.

    Attributes:
        id: An integer representing the unique identifier of the color.
        level: An integer representing the severity level associated with the color.
        name: A string representing the name of the color.
        hexaCode: A string representing the hexadecimal code of the color.
    r   Úlevelr	   ÚhexaCodeNr
   r   r   r   r   r      s@   € € € € € € ðð ð 	€G€GGØ€J€JJØ
€I€IIØ€M€MM€M€Mr   r   c                   ó@   — e Zd ZU dZee         ed<   ee         ed<   dS )ÚWarningDictionaryDatazÏStructured data representing the meteorological dictionary.

    Attributes:
        phenomenons: A list of PhenomenonDictionaryEntry instances.
        colors: A list of ColorDictionaryEntry instances.
    ÚphenomenonsÚcolorsN)r   r   r   r   r   r   r   r   r   r   r   r   r   $   sB   € € € € € € ðð ð Ð/Ô0Ð0Ð0Ñ0ØÐ%Ô&Ð&Ð&Ñ&Ð&Ð&r   r   c                   ó’   — e Zd ZdZdeddfd„Zdedee         fd„Z	dedee
         fd„Zd	edee         fd
„Zd	edee
         fd„ZdS )ÚWarningDictionaryu:  A class to represent and manipulate the MÃ©tÃ©o-France meteorological dictionary data.

    Methods:
        get_phenomenon_name_by_id(phenomenon_id: int): Returns the name of the
        phenomenon for the given ID.
        get_color_name_by_id(color_id: int): Returns the name of the color for the given ID.
    Úraw_dataÚreturnNc                 ó   — || _         dS )u²   Initializes the WarningDictionary with raw dictionary data.

        Args:
            raw_data: A dictionary representing the JSON response from the MÃ©tÃ©o-France API.
        N©r   )Úselfr   s     r   Ú__init__zWarningDictionary.__init__9   s   € ð !ˆŒˆˆr   Úphenomenon_idc                 óF   — | j         d         D ]}|d         |k    r|c S ŒdS )záRetrieves a meteorological phenomenon based on its ID.

        Args:
            phenomenon_id: The ID of the meteorological phenomenon.

        Returns:
            The phenomenon if found, otherwise returns None.
        r   r   Nr"   ©r#   r%   Ú
phenomenons      r   Úget_phenomenon_by_idz&WarningDictionary.get_phenomenon_by_idA   s@   € ð œ-¨Ô6ð 	"ð 	"ˆJØ˜$Ô =Ò0Ð0Ø!Ð!Ð!Ð!ð 1àˆtr   c                 óD   — |                       |¦  «        }||d         S dS )zùRetrieves the name of a meteorological phenomenon based on its ID.

        Args:
            phenomenon_id: The ID of the meteorological phenomenon.

        Returns:
            The name of the phenomenon if found, otherwise returns None.
        Nr	   )r)   r'   s      r   Úget_phenomenon_name_by_idz+WarningDictionary.get_phenomenon_name_by_idQ   s-   € ð ×.Ò.¨}Ñ=Ô=ˆ
ØÐ!Ø˜fÔ%Ð%Øˆtr   Úcolor_idc                 óF   — | j         d         D ]}|d         |k    r|c S ŒdS )zÂRetrieves a warning color based on its ID.

        Args:
            color_id: The ID of the color.

        Returns:
            The the color object if found, otherwise returns None.
        r   r   Nr"   ©r#   r,   Úcolors      r   Úget_color_by_idz!WarningDictionary.get_color_by_id_   s<   € ð ”] 8Ô,ð 	ð 	ˆEØTŒ{˜hÒ&Ð&Øð 'àˆtr   c                 óD   — |                       |¦  «        }||d         S dS )zÏRetrieves the name of a warning color based on its ID.

        Args:
            color_id: The ID of the color.

        Returns:
            The name of the color if found, otherwise returns None.
        Nr	   )r0   r.   s      r   Úget_color_name_by_idz&WarningDictionary.get_color_name_by_idm   s,   € ð ×$Ò$ XÑ.Ô.ˆØÐØ˜”=Ð Øˆtr   )r   r   r   r   r   r$   r   r   r   r)   r   r+   r   r0   r2   r   r   r   r   r   0   sß   € € € € € ðð ð!Ð!6ð !¸4ð !ð !ð !ð !ðØ ðà	Ð+Ô	,ðð ð ð ð °sð ¸xÈ¼}ð ð ð ð ð¨ð °Ð9MÔ0Nð ð ð ð ð¨Sð °X¸c´]ð ð ð ð ð ð r   r   N)	r   Útypingr   r   r   r   r   r   r   r   r   r   ú<module>r4      sû   ðØ >Ð >à Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð ð	ð 	ð 	ð 	ð 	 	ñ 	ô 	ð 	ðð ð ð ð ˜9ñ ô ð ð 	'ð 	'ð 	'ð 	'ð 	'˜Iñ 	'ô 	'ð 	'ðIð Ið Ið Ið Iñ Iô Ið Ið Ið Ir   