# coding: utf-8

"""
    Yanport API

    ## À propos Voici quelques ressources qui vous aideront à explorer notre API, si vous avez des problèmes ou des demandes, veuillez contacter le [support](mailto:support@yanport.com). ## REST API Nos services webs utilisent le protocle **HTTPS** sur le port 443, tout accès en HTTP sur le port 80 est bloqué par notre pare-feu. Les échanges de données sont réalisés en **JSON**. ## Authentification Avant de commencer à explorer notre API, vous devez nous [contacter](https://www.yanport.com/contact) afin d'obtenir un [JSON Web Token](https://jwt.io) (**JWT**) qui vous permettra de vous identifier à chaque requêtes. ### JWT (header) La méthode privilégiée pour s'authentifier est de passer à chaque requêtes le token dans le header `Authorization: Bearer {{ JWT }}` en remplaçant `{{ JWT }}` par votre token. ### JWT (query param) Il est aussi possible de passer le token directement en query param de la requête `https://api.yanport.com/?token={{ JWT }}`. (_privilégié le passage par header en production._) ## Pour démarrer Lorsque vous disposez de votre token d'authentification, vous pouvez commencer à explorer notre API grâce au boutton  `Try it out` sur chacun de nos webs services. Mais au préalable, vous devez vous authentifier en cliquant sur le boutton `Authorize `, en remplissant l'input `api_key` avec `Bearer {{ JWT }}`.  **Exemple** `Bearer eyUEkiLCJh...CHCUiBfD63oxoo=` ## Limitation Toutes les requêtes à notre API sont loggées, c'est pourquoi vous devez respecter nos [CGU](https://dev.yanport.com/cgu) afin d'éviter tout usage abusif de notre API. 

    OpenAPI spec version: 1.0
    Contact: dev@yanport.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from pprint import pformat
from six import iteritems
import re


class City(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """


    """
    Attributes:
      swagger_types (dict): The key is attribute name
                            and the value is attribute type.
      attribute_map (dict): The key is attribute name
                            and the value is json key in definition.
    """
    swagger_types = {
        'id': 'int',
        'insee_code': 'str',
        'dept_code': 'str',
        'dept_name': 'str',
        'zip_codes': 'list[str]',
        'localities': 'list[str]',
        'name': 'str',
        'usage_name': 'str',
        'region_name': 'str',
        'population': 'float',
        'centroid': 'Location',
        'geometry': 'object'
    }

    attribute_map = {
        'id': 'id',
        'insee_code': 'inseeCode',
        'dept_code': 'deptCode',
        'dept_name': 'deptName',
        'zip_codes': 'zipCodes',
        'localities': 'localities',
        'name': 'name',
        'usage_name': 'usageName',
        'region_name': 'regionName',
        'population': 'population',
        'centroid': 'centroid',
        'geometry': 'geometry'
    }

    def __init__(self, id=None, insee_code=None, dept_code=None, dept_name=None, zip_codes=None, localities=None, name=None, usage_name=None, region_name=None, population=None, centroid=None, geometry=None):
        """
        City - a model defined in Swagger
        """

        self._id = None
        self._insee_code = None
        self._dept_code = None
        self._dept_name = None
        self._zip_codes = None
        self._localities = None
        self._name = None
        self._usage_name = None
        self._region_name = None
        self._population = None
        self._centroid = None
        self._geometry = None

        if id is not None:
          self.id = id
        if insee_code is not None:
          self.insee_code = insee_code
        if dept_code is not None:
          self.dept_code = dept_code
        if dept_name is not None:
          self.dept_name = dept_name
        if zip_codes is not None:
          self.zip_codes = zip_codes
        if localities is not None:
          self.localities = localities
        if name is not None:
          self.name = name
        if usage_name is not None:
          self.usage_name = usage_name
        if region_name is not None:
          self.region_name = region_name
        if population is not None:
          self.population = population
        if centroid is not None:
          self.centroid = centroid
        if geometry is not None:
          self.geometry = geometry

    @property
    def id(self):
        """
        Gets the id of this City.

        :return: The id of this City.
        :rtype: int
        """
        return self._id

    @id.setter
    def id(self, id):
        """
        Sets the id of this City.

        :param id: The id of this City.
        :type: int
        """

        self._id = id

    @property
    def insee_code(self):
        """
        Gets the insee_code of this City.

        :return: The insee_code of this City.
        :rtype: str
        """
        return self._insee_code

    @insee_code.setter
    def insee_code(self, insee_code):
        """
        Sets the insee_code of this City.

        :param insee_code: The insee_code of this City.
        :type: str
        """

        self._insee_code = insee_code

    @property
    def dept_code(self):
        """
        Gets the dept_code of this City.

        :return: The dept_code of this City.
        :rtype: str
        """
        return self._dept_code

    @dept_code.setter
    def dept_code(self, dept_code):
        """
        Sets the dept_code of this City.

        :param dept_code: The dept_code of this City.
        :type: str
        """

        self._dept_code = dept_code

    @property
    def dept_name(self):
        """
        Gets the dept_name of this City.

        :return: The dept_name of this City.
        :rtype: str
        """
        return self._dept_name

    @dept_name.setter
    def dept_name(self, dept_name):
        """
        Sets the dept_name of this City.

        :param dept_name: The dept_name of this City.
        :type: str
        """

        self._dept_name = dept_name

    @property
    def zip_codes(self):
        """
        Gets the zip_codes of this City.

        :return: The zip_codes of this City.
        :rtype: list[str]
        """
        return self._zip_codes

    @zip_codes.setter
    def zip_codes(self, zip_codes):
        """
        Sets the zip_codes of this City.

        :param zip_codes: The zip_codes of this City.
        :type: list[str]
        """

        self._zip_codes = zip_codes

    @property
    def localities(self):
        """
        Gets the localities of this City.

        :return: The localities of this City.
        :rtype: list[str]
        """
        return self._localities

    @localities.setter
    def localities(self, localities):
        """
        Sets the localities of this City.

        :param localities: The localities of this City.
        :type: list[str]
        """

        self._localities = localities

    @property
    def name(self):
        """
        Gets the name of this City.

        :return: The name of this City.
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """
        Sets the name of this City.

        :param name: The name of this City.
        :type: str
        """

        self._name = name

    @property
    def usage_name(self):
        """
        Gets the usage_name of this City.

        :return: The usage_name of this City.
        :rtype: str
        """
        return self._usage_name

    @usage_name.setter
    def usage_name(self, usage_name):
        """
        Sets the usage_name of this City.

        :param usage_name: The usage_name of this City.
        :type: str
        """

        self._usage_name = usage_name

    @property
    def region_name(self):
        """
        Gets the region_name of this City.

        :return: The region_name of this City.
        :rtype: str
        """
        return self._region_name

    @region_name.setter
    def region_name(self, region_name):
        """
        Sets the region_name of this City.

        :param region_name: The region_name of this City.
        :type: str
        """

        self._region_name = region_name

    @property
    def population(self):
        """
        Gets the population of this City.

        :return: The population of this City.
        :rtype: float
        """
        return self._population

    @population.setter
    def population(self, population):
        """
        Sets the population of this City.

        :param population: The population of this City.
        :type: float
        """

        self._population = population

    @property
    def centroid(self):
        """
        Gets the centroid of this City.

        :return: The centroid of this City.
        :rtype: Location
        """
        return self._centroid

    @centroid.setter
    def centroid(self, centroid):
        """
        Sets the centroid of this City.

        :param centroid: The centroid of this City.
        :type: Location
        """

        self._centroid = centroid

    @property
    def geometry(self):
        """
        Gets the geometry of this City.

        :return: The geometry of this City.
        :rtype: object
        """
        return self._geometry

    @geometry.setter
    def geometry(self, geometry):
        """
        Sets the geometry of this City.

        :param geometry: The geometry of this City.
        :type: object
        """

        self._geometry = geometry

    def to_dict(self):
        """
        Returns the model properties as a dict
        """
        result = {}

        for attr, _ in iteritems(self.swagger_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
                    value
                ))
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1].to_dict())
                    if hasattr(item[1], "to_dict") else item,
                    value.items()
                ))
            else:
                result[attr] = value

        return result

    def to_str(self):
        """
        Returns the string representation of the model
        """
        return pformat(self.to_dict())

    def __repr__(self):
        """
        For `print` and `pprint`
        """
        return self.to_str()

    def __eq__(self, other):
        """
        Returns true if both objects are equal
        """
        if not isinstance(other, City):
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        """
        Returns true if both objects are not equal
        """
        return not self == other
