# coding: utf-8

"""
    Selling Partner API for Merchant Fulfillment

    The Selling Partner API for Merchant Fulfillment helps you build applications that let sellers purchase shipping for non-Prime and Prime orders using Amazon’s Buy Shipping Services.  # noqa: E501

    OpenAPI spec version: v0
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from src.api_models.mfn_api.swagger_client.configuration import Configuration


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 = {
        'name': 'AddressName',
        'address_line1': 'AddressLine1',
        'address_line2': 'AddressLine2',
        'address_line3': 'AddressLine3',
        'district_or_county': 'DistrictOrCounty',
        'email': 'EmailAddress',
        'city': 'City',
        'state_or_province_code': 'StateOrProvinceCode',
        'postal_code': 'PostalCode',
        'country_code': 'CountryCode',
        'phone': 'PhoneNumber'
    }

    attribute_map = {
        'name': 'Name',
        'address_line1': 'AddressLine1',
        'address_line2': 'AddressLine2',
        'address_line3': 'AddressLine3',
        'district_or_county': 'DistrictOrCounty',
        'email': 'Email',
        'city': 'City',
        'state_or_province_code': 'StateOrProvinceCode',
        'postal_code': 'PostalCode',
        'country_code': 'CountryCode',
        'phone': 'Phone'
    }

    def __init__(self, name=None, address_line1=None, address_line2=None, address_line3=None, district_or_county=None, email=None, city=None, state_or_province_code=None, postal_code=None, country_code=None, phone=None, _configuration=None):  # noqa: E501
        """Address - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._name = None
        self._address_line1 = None
        self._address_line2 = None
        self._address_line3 = None
        self._district_or_county = None
        self._email = None
        self._city = None
        self._state_or_province_code = None
        self._postal_code = None
        self._country_code = None
        self._phone = None
        self.discriminator = None

        self.name = name
        self.address_line1 = address_line1
        if address_line2 is not None:
            self.address_line2 = address_line2
        if address_line3 is not None:
            self.address_line3 = address_line3
        if district_or_county is not None:
            self.district_or_county = district_or_county
        self.email = email
        self.city = city
        if state_or_province_code is not None:
            self.state_or_province_code = state_or_province_code
        self.postal_code = postal_code
        self.country_code = country_code
        self.phone = phone

    @property
    def name(self):
        """Gets the name of this Address.  # noqa: E501


        :return: The name of this Address.  # noqa: E501
        :rtype: AddressName
        """
        return self._name

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


        :param name: The name of this Address.  # noqa: E501
        :type: AddressName
        """
        if self._configuration.client_side_validation and name is None:
            raise ValueError("Invalid value for `name`, must not be `None`")  # noqa: E501

        self._name = name

    @property
    def address_line1(self):
        """Gets the address_line1 of this Address.  # noqa: E501


        :return: The address_line1 of this Address.  # noqa: E501
        :rtype: AddressLine1
        """
        return self._address_line1

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


        :param address_line1: The address_line1 of this Address.  # noqa: E501
        :type: AddressLine1
        """
        if self._configuration.client_side_validation and address_line1 is None:
            raise ValueError("Invalid value for `address_line1`, must not be `None`")  # noqa: E501

        self._address_line1 = address_line1

    @property
    def address_line2(self):
        """Gets the address_line2 of this Address.  # noqa: E501


        :return: The address_line2 of this Address.  # noqa: E501
        :rtype: AddressLine2
        """
        return self._address_line2

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


        :param address_line2: The address_line2 of this Address.  # noqa: E501
        :type: AddressLine2
        """

        self._address_line2 = address_line2

    @property
    def address_line3(self):
        """Gets the address_line3 of this Address.  # noqa: E501


        :return: The address_line3 of this Address.  # noqa: E501
        :rtype: AddressLine3
        """
        return self._address_line3

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


        :param address_line3: The address_line3 of this Address.  # noqa: E501
        :type: AddressLine3
        """

        self._address_line3 = address_line3

    @property
    def district_or_county(self):
        """Gets the district_or_county of this Address.  # noqa: E501


        :return: The district_or_county of this Address.  # noqa: E501
        :rtype: DistrictOrCounty
        """
        return self._district_or_county

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


        :param district_or_county: The district_or_county of this Address.  # noqa: E501
        :type: DistrictOrCounty
        """

        self._district_or_county = district_or_county

    @property
    def email(self):
        """Gets the email of this Address.  # noqa: E501


        :return: The email of this Address.  # noqa: E501
        :rtype: EmailAddress
        """
        return self._email

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


        :param email: The email of this Address.  # noqa: E501
        :type: EmailAddress
        """
        if self._configuration.client_side_validation and email is None:
            raise ValueError("Invalid value for `email`, must not be `None`")  # noqa: E501

        self._email = email

    @property
    def city(self):
        """Gets the city of this Address.  # noqa: E501


        :return: The city of this Address.  # noqa: E501
        :rtype: City
        """
        return self._city

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


        :param city: The city of this Address.  # noqa: E501
        :type: City
        """
        if self._configuration.client_side_validation and city is None:
            raise ValueError("Invalid value for `city`, must not be `None`")  # noqa: E501

        self._city = city

    @property
    def state_or_province_code(self):
        """Gets the state_or_province_code of this Address.  # noqa: E501


        :return: The state_or_province_code of this Address.  # noqa: E501
        :rtype: StateOrProvinceCode
        """
        return self._state_or_province_code

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


        :param state_or_province_code: The state_or_province_code of this Address.  # noqa: E501
        :type: StateOrProvinceCode
        """

        self._state_or_province_code = state_or_province_code

    @property
    def postal_code(self):
        """Gets the postal_code of this Address.  # noqa: E501


        :return: The postal_code of this Address.  # noqa: E501
        :rtype: PostalCode
        """
        return self._postal_code

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


        :param postal_code: The postal_code of this Address.  # noqa: E501
        :type: PostalCode
        """
        if self._configuration.client_side_validation and postal_code is None:
            raise ValueError("Invalid value for `postal_code`, must not be `None`")  # noqa: E501

        self._postal_code = postal_code

    @property
    def country_code(self):
        """Gets the country_code of this Address.  # noqa: E501


        :return: The country_code of this Address.  # noqa: E501
        :rtype: CountryCode
        """
        return self._country_code

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


        :param country_code: The country_code of this Address.  # noqa: E501
        :type: CountryCode
        """
        if self._configuration.client_side_validation and country_code is None:
            raise ValueError("Invalid value for `country_code`, must not be `None`")  # noqa: E501

        self._country_code = country_code

    @property
    def phone(self):
        """Gets the phone of this Address.  # noqa: E501


        :return: The phone of this Address.  # noqa: E501
        :rtype: PhoneNumber
        """
        return self._phone

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


        :param phone: The phone of this Address.  # noqa: E501
        :type: PhoneNumber
        """
        if self._configuration.client_side_validation and phone is None:
            raise ValueError("Invalid value for `phone`, must not be `None`")  # noqa: E501

        self._phone = phone

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

        for attr, _ in six.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
        if issubclass(Address, dict):
            for key, value in self.items():
                result[key] = value

        return result

    def to_str(self):
        """Returns the string representation of the model"""
        return pprint.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.to_dict() == other.to_dict()

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

        return self.to_dict() != other.to_dict()
