# coding: utf-8

"""
    Mail-in-a-Box

    Mail-in-a-Box API HTTP specification.  # noqa: E501

    The version of the OpenAPI document: 0.47.0
    Contact: contact@mailinabox.email
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from mailinabox_api.configuration import Configuration


class MailAlias(object):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    """
    Attributes:
      openapi_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.
    """
    openapi_types = {
        "address": "str",
        "address_display": "str",
        "forwards_to": "list[str]",
        "permitted_senders": "list[str]",
        "required": "bool",
    }

    attribute_map = {
        "address": "address",
        "address_display": "address_display",
        "forwards_to": "forwards_to",
        "permitted_senders": "permitted_senders",
        "required": "required",
    }

    def __init__(
        self,
        address=None,
        address_display=None,
        forwards_to=None,
        permitted_senders=None,
        required=None,
        local_vars_configuration=None,
    ):  # noqa: E501
        """MailAlias - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._address = None
        self._address_display = None
        self._forwards_to = None
        self._permitted_senders = None
        self._required = None
        self.discriminator = None

        self.address = address
        self.address_display = address_display
        self.forwards_to = forwards_to
        self.permitted_senders = permitted_senders
        self.required = required

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

        Email format.  # noqa: E501

        :return: The address of this MailAlias.  # noqa: E501
        :rtype: str
        """
        return self._address

    @address.setter
    def address(self, address):
        """Sets the address of this MailAlias.

        Email format.  # noqa: E501

        :param address: The address of this MailAlias.  # noqa: E501
        :type: str
        """
        if (
            self.local_vars_configuration.client_side_validation and address is None
        ):  # noqa: E501
            raise ValueError(
                "Invalid value for `address`, must not be `None`"
            )  # noqa: E501

        self._address = address

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

        Email format.  # noqa: E501

        :return: The address_display of this MailAlias.  # noqa: E501
        :rtype: str
        """
        return self._address_display

    @address_display.setter
    def address_display(self, address_display):
        """Sets the address_display of this MailAlias.

        Email format.  # noqa: E501

        :param address_display: The address_display of this MailAlias.  # noqa: E501
        :type: str
        """
        if (
            self.local_vars_configuration.client_side_validation
            and address_display is None
        ):  # noqa: E501
            raise ValueError(
                "Invalid value for `address_display`, must not be `None`"
            )  # noqa: E501

        self._address_display = address_display

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


        :return: The forwards_to of this MailAlias.  # noqa: E501
        :rtype: list[str]
        """
        return self._forwards_to

    @forwards_to.setter
    def forwards_to(self, forwards_to):
        """Sets the forwards_to of this MailAlias.


        :param forwards_to: The forwards_to of this MailAlias.  # noqa: E501
        :type: list[str]
        """
        if (
            self.local_vars_configuration.client_side_validation and forwards_to is None
        ):  # noqa: E501
            raise ValueError(
                "Invalid value for `forwards_to`, must not be `None`"
            )  # noqa: E501

        self._forwards_to = forwards_to

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


        :return: The permitted_senders of this MailAlias.  # noqa: E501
        :rtype: list[str]
        """
        return self._permitted_senders

    @permitted_senders.setter
    def permitted_senders(self, permitted_senders):
        """Sets the permitted_senders of this MailAlias.


        :param permitted_senders: The permitted_senders of this MailAlias.  # noqa: E501
        :type: list[str]
        """

        self._permitted_senders = permitted_senders

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


        :return: The required of this MailAlias.  # noqa: E501
        :rtype: bool
        """
        return self._required

    @required.setter
    def required(self, required):
        """Sets the required of this MailAlias.


        :param required: The required of this MailAlias.  # noqa: E501
        :type: bool
        """
        if (
            self.local_vars_configuration.client_side_validation and required is None
        ):  # noqa: E501
            raise ValueError(
                "Invalid value for `required`, must not be `None`"
            )  # noqa: E501

        self._required = required

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

        for attr, _ in six.iteritems(self.openapi_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 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, MailAlias):
            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, MailAlias):
            return True

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