# 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 Address(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 = {
        'city_id': 'float',
        'street_number': 'str',
        'street': 'str',
        'zip_code': 'str',
        'dept_code': 'str',
        'country': 'str',
        'location': 'Location',
        'approximate_location': 'object'
    }

    attribute_map = {
        'city_id': 'cityId',
        'street_number': 'streetNumber',
        'street': 'street',
        'zip_code': 'zipCode',
        'dept_code': 'deptCode',
        'country': 'country',
        'location': 'location',
        'approximate_location': 'approximateLocation'
    }

    def __init__(self, city_id=None, street_number=None, street=None, zip_code=None, dept_code=None, country=None, location=None, approximate_location=None):
        """
        Address - a model defined in Swagger
        """

        self._city_id = None
        self._street_number = None
        self._street = None
        self._zip_code = None
        self._dept_code = None
        self._country = None
        self._location = None
        self._approximate_location = None

        if city_id is not None:
          self.city_id = city_id
        if street_number is not None:
          self.street_number = street_number
        if street is not None:
          self.street = street
        if zip_code is not None:
          self.zip_code = zip_code
        if dept_code is not None:
          self.dept_code = dept_code
        if country is not None:
          self.country = country
        if location is not None:
          self.location = location
        if approximate_location is not None:
          self.approximate_location = approximate_location

    @property
    def city_id(self):
        """
        Gets the city_id of this Address.

        :return: The city_id of this Address.
        :rtype: float
        """
        return self._city_id

    @city_id.setter
    def city_id(self, city_id):
        """
        Sets the city_id of this Address.

        :param city_id: The city_id of this Address.
        :type: float
        """
        if city_id is not None and city_id < 1:
            raise ValueError("Invalid value for `city_id`, must be a value greater than or equal to `1`")

        self._city_id = city_id

    @property
    def street_number(self):
        """
        Gets the street_number of this Address.

        :return: The street_number of this Address.
        :rtype: str
        """
        return self._street_number

    @street_number.setter
    def street_number(self, street_number):
        """
        Sets the street_number of this Address.

        :param street_number: The street_number of this Address.
        :type: str
        """

        self._street_number = street_number

    @property
    def street(self):
        """
        Gets the street of this Address.

        :return: The street of this Address.
        :rtype: str
        """
        return self._street

    @street.setter
    def street(self, street):
        """
        Sets the street of this Address.

        :param street: The street of this Address.
        :type: str
        """

        self._street = street

    @property
    def zip_code(self):
        """
        Gets the zip_code of this Address.

        :return: The zip_code of this Address.
        :rtype: str
        """
        return self._zip_code

    @zip_code.setter
    def zip_code(self, zip_code):
        """
        Sets the zip_code of this Address.

        :param zip_code: The zip_code of this Address.
        :type: str
        """

        self._zip_code = zip_code

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

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

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

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

        self._dept_code = dept_code

    @property
    def country(self):
        """
        Gets the country of this Address.

        :return: The country of this Address.
        :rtype: str
        """
        return self._country

    @country.setter
    def country(self, country):
        """
        Sets the country of this Address.

        :param country: The country of this Address.
        :type: str
        """

        self._country = country

    @property
    def location(self):
        """
        Gets the location of this Address.

        :return: The location of this Address.
        :rtype: Location
        """
        return self._location

    @location.setter
    def location(self, location):
        """
        Sets the location of this Address.

        :param location: The location of this Address.
        :type: Location
        """

        self._location = location

    @property
    def approximate_location(self):
        """
        Gets the approximate_location of this Address.

        :return: The approximate_location of this Address.
        :rtype: object
        """
        return self._approximate_location

    @approximate_location.setter
    def approximate_location(self, approximate_location):
        """
        Sets the approximate_location of this Address.

        :param approximate_location: The approximate_location of this Address.
        :type: object
        """

        self._approximate_location = approximate_location

    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, Address):
            return False

        return self.__dict__ == other.__dict__

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