
    rbi                     X    d Z ddlmZ ddlmZ  G d de          Z G d d          ZdS )	u3   Place Python model for the Météo-France REST API.    )Optional)	TypedDictc                       e Zd ZU dZee         ed<   eed<   eed<   eed<   eed<   eed<   ee         ed<   ee         ed	<   d
S )	PlaceDatazGDescribing the data structure of place object returned by the REST API.inseenamelatloncountryadminadmin2postCodeN)__name__
__module____qualname____doc__r   str__annotations__float     k/var/www/html/mdtn/previsions/meteo_cartes/venv/lib/python3.11/site-packages/meteofrance_api/model/place.pyr   r      su         QQC=
III	JJJ	JJJLLLJJJSMsmr   r   c                   J   e Zd ZdZdeddfdZdefdZdefdZe	de
e         fd            Ze	defd	            Ze	defd
            Ze	defd            Ze	defd            Ze	de
e         fd            Ze	de
e         fd            Ze	de
e         fd            ZdS )Placeu  Class to access the results of 'places' REST API request.

    Attributes:
        insee: A string corresponding to the INSEE ID of the place.
        name: Name of the place.
        lat: A float with the latitude in degree of the place.
        lon: A float with the longitude in degree of the place
        country: A string corresponding to the country code of the place.
        admin: A string with the name of the administrative area ('Département' for
            France and Region for other countries).
        admin2: A string corresponding to an administrative code ('Département' number
            for France)
        postCode: A string corresponding to the ZIP code of location.
    raw_datareturnNc                     || _         dS )zInitialize a Place object.

        Args:
            raw_data: A dictionary representing the JSON response from 'places' REST API
                request. The structure is described by the PlaceData class.
        Nr   )selfr   s     r   __init__zPlace.__init__$   s     !r   c                 d    d                     | j        j        | j        | j        | j                  S )u"  Return string representation of this class.

        Returns:
            A string to represent the instance of the Place class using the name,
            country and admin area of the location.

            Example: <Place(name=Montréal, country=FR, admin=Languedoc-Roussillon)>
        z#<{}(name={}, country={}, admin={})>)format	__class__r   r   r   r   r   s    r   __repr__zPlace.__repr__-   s0     5;;N#TYdj
 
 	
r   c                     | j         dk    r!| j         d| j         d| j         d| j          S | j         d| j         d| j          S )uQ  Provide an easy way to identify the Place.

        Returns:
            A string to represent a Place instance with city name, Region name,
            department ID and the country name.

            For Examples:
                `Marseille - Provence-Alpes-Côte d'Azur (13) - FR`
                or `Montréal - Quebec - CA`
        FRz - z (z) - )r   r   r   r   r$   s    r   __str__zPlace.__str__:   s_     <4iQQDJQQ$+QQ4<QQQ)==
==t|===r   c                 6    | j                             d          S )z!Return the INSEE ID of the place.r   r   getr$   s    r   r   zPlace.inseeJ        }  )))r   c                     | j         d         S )zReturn the name of the place.r   r   r$   s    r   r   z
Place.nameO   s     }V$$r   c                     | j         d         S )z!Return the latitude of the place.r	   r   r$   s    r   latitudezPlace.latitudeT        }U##r   c                     | j         d         S )z"Return the longitude of the place.r
   r   r$   s    r   	longitudezPlace.longitudeY   r0   r   c                     | j         d         S )z%Return the country code of the place.r   r   r$   s    r   r   zPlace.country^   s     }Y''r   c                 6    | j                             d          S )zReturn the admin of the place.r   r*   r$   s    r   r   zPlace.adminc   r,   r   c                 6    | j                             d          S )zReturn the admin2 of the place.r   r*   r$   s    r   r   zPlace.admin2h   s     }  ***r   c                 6    | j                             d          S )z$Return the postal code of the place.r   r*   r$   s    r   postal_codezPlace.postal_codem   s     }  ,,,r   )r   r   r   r   r   r    r   r%   r(   propertyr   r   r   r   r/   r2   r   r   r   r7   r   r   r   r   r      s        ! !t ! ! ! !
# 
 
 
 
> > > > >  *x} * * * X* %c % % % X% $% $ $ $ X$ $5 $ $ $ X$ ( ( ( ( X( *x} * * * X* + + + + X+ -Xc] - - - X- - -r   r   N)r   typingr   r   r   r   r   r   r   <module>r:      s    9 9            
 
 
 
 
	 
 
 
\- \- \- \- \- \- \- \- \- \-r   