# coding: utf-8

"""
    CardPay REST API

    Welcome to the CardPay REST API. The CardPay API uses HTTP verbs and a [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) resources endpoint structure (see more info about REST). Request and response payloads are formatted as JSON. Merchant uses API to create payments, refunds, payouts or recurrings, check or update transaction status and get information about created transactions. In API authentication process based on [OAuth 2.0](https://oauth.net/2/) standard. For recent changes see changelog section.  # noqa: E501

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


import pprint
import re  # noqa: F401

import six


class BillingAddress(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': 'str',
        'country': 'str',
        'phone': 'str',
        'state': 'str',
        'street': 'str',
        'zip': 'str'
    }

    attribute_map = {
        'city': 'city',
        'country': 'country',
        'phone': 'phone',
        'state': 'state',
        'street': 'street',
        'zip': 'zip'
    }

    def __init__(self, city=None, country=None, phone=None, state=None, street=None, zip=None):  # noqa: E501
        """BillingAddress - a model defined in Swagger"""  # noqa: E501

        self._city = None
        self._country = None
        self._phone = None
        self._state = None
        self._street = None
        self._zip = None
        self.discriminator = None

        self.city = city
        self.country = country
        self.phone = phone
        if state is not None:
            self.state = state
        self.street = street
        self.zip = zip

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

        Billing city. May include whitespaces, hyphens, apostrophes, commas and dots  # noqa: E501

        :return: The city of this BillingAddress.  # noqa: E501
        :rtype: str
        """
        return self._city

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

        Billing city. May include whitespaces, hyphens, apostrophes, commas and dots  # noqa: E501

        :param city: The city of this BillingAddress.  # noqa: E501
        :type: str
        """
        if city is None:
            raise ValueError("Invalid value for `city`, must not be `None`")  # noqa: E501
        if city is not None and len(city) > 20:
            raise ValueError("Invalid value for `city`, length must be less than or equal to `20`")  # noqa: E501
        if city is not None and len(city) < 0:
            raise ValueError("Invalid value for `city`, length must be greater than or equal to `0`")  # noqa: E501

        self._city = city

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

        [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) code of billing country: 2 or 3 latin letters or numeric code   # noqa: E501

        :return: The country of this BillingAddress.  # noqa: E501
        :rtype: str
        """
        return self._country

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

        [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) code of billing country: 2 or 3 latin letters or numeric code   # noqa: E501

        :param country: The country of this BillingAddress.  # noqa: E501
        :type: str
        """
        if country is None:
            raise ValueError("Invalid value for `country`, must not be `None`")  # noqa: E501

        self._country = country

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

        Valid Customer phone number  # noqa: E501

        :return: The phone of this BillingAddress.  # noqa: E501
        :rtype: str
        """
        return self._phone

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

        Valid Customer phone number  # noqa: E501

        :param phone: The phone of this BillingAddress.  # noqa: E501
        :type: str
        """
        if phone is None:
            raise ValueError("Invalid value for `phone`, must not be `None`")  # noqa: E501
        if phone is not None and len(phone) > 20:
            raise ValueError("Invalid value for `phone`, length must be less than or equal to `20`")  # noqa: E501
        if phone is not None and len(phone) < 5:
            raise ValueError("Invalid value for `phone`, length must be greater than or equal to `5`")  # noqa: E501
        if phone is not None and not re.search(r'[0-9|+|\\-|w|p|(|)|\\s]+', phone):  # noqa: E501
            raise ValueError(r"Invalid value for `phone`, must be a follow pattern or equal to `/[0-9|+|\\-|w|p|(|)|\\s]+/`")  # noqa: E501

        self._phone = phone

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

        Billing state or province. May include whitespaces, hyphens, apostrophes, commas and dots  # noqa: E501

        :return: The state of this BillingAddress.  # noqa: E501
        :rtype: str
        """
        return self._state

    @state.setter
    def state(self, state):
        """Sets the state of this BillingAddress.

        Billing state or province. May include whitespaces, hyphens, apostrophes, commas and dots  # noqa: E501

        :param state: The state of this BillingAddress.  # noqa: E501
        :type: str
        """
        if state is not None and len(state) > 20:
            raise ValueError("Invalid value for `state`, length must be less than or equal to `20`")  # noqa: E501
        if state is not None and len(state) < 0:
            raise ValueError("Invalid value for `state`, length must be greater than or equal to `0`")  # noqa: E501

        self._state = state

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

        Billing street address. May include whitespaces, hyphens, apostrophes, commas, quotes, dots, slashes and semicolons  # noqa: E501

        :return: The street of this BillingAddress.  # noqa: E501
        :rtype: str
        """
        return self._street

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

        Billing street address. May include whitespaces, hyphens, apostrophes, commas, quotes, dots, slashes and semicolons  # noqa: E501

        :param street: The street of this BillingAddress.  # noqa: E501
        :type: str
        """
        if street is None:
            raise ValueError("Invalid value for `street`, must not be `None`")  # noqa: E501
        if street is not None and len(street) > 100:
            raise ValueError("Invalid value for `street`, length must be less than or equal to `100`")  # noqa: E501
        if street is not None and len(street) < 2:
            raise ValueError("Invalid value for `street`, length must be greater than or equal to `2`")  # noqa: E501

        self._street = street

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

        Billing postal code  # noqa: E501

        :return: The zip of this BillingAddress.  # noqa: E501
        :rtype: str
        """
        return self._zip

    @zip.setter
    def zip(self, zip):
        """Sets the zip of this BillingAddress.

        Billing postal code  # noqa: E501

        :param zip: The zip of this BillingAddress.  # noqa: E501
        :type: str
        """
        if zip is None:
            raise ValueError("Invalid value for `zip`, must not be `None`")  # noqa: E501
        if zip is not None and len(zip) > 12:
            raise ValueError("Invalid value for `zip`, length must be less than or equal to `12`")  # noqa: E501
        if zip is not None and len(zip) < 0:
            raise ValueError("Invalid value for `zip`, length must be greater than or equal to `0`")  # noqa: E501

        self._zip = zip

    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:
                if value is not None:
                    result[attr] = value
        if issubclass(BillingAddress, 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, BillingAddress):
            return False

        return self.__dict__ == other.__dict__

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