# coding: utf-8

"""
    MailSlurp API

    MailSlurp is an API for sending and receiving emails and SMS from dynamically allocated email addresses and phone numbers. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more.  ## Resources  - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://docs.mailslurp.com/) - [Examples](https://github.com/mailslurp/examples) repository  # noqa: E501

    The version of the OpenAPI document: 6.5.2
    Contact: contact@mailslurp.dev
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from mailslurp_client.configuration import Configuration


class SearchEmailsOptions(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 = {
        'inbox_ids': 'list[str]',
        'page_index': 'int',
        'page_size': 'int',
        'sort_direction': 'str',
        'unread_only': 'bool',
        'search_filter': 'str',
        'since': 'datetime',
        'before': 'datetime'
    }

    attribute_map = {
        'inbox_ids': 'inboxIds',
        'page_index': 'pageIndex',
        'page_size': 'pageSize',
        'sort_direction': 'sortDirection',
        'unread_only': 'unreadOnly',
        'search_filter': 'searchFilter',
        'since': 'since',
        'before': 'before'
    }

    def __init__(self, inbox_ids=None, page_index=None, page_size=None, sort_direction=None, unread_only=None, search_filter=None, since=None, before=None, local_vars_configuration=None):  # noqa: E501
        """SearchEmailsOptions - 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._inbox_ids = None
        self._page_index = None
        self._page_size = None
        self._sort_direction = None
        self._unread_only = None
        self._search_filter = None
        self._since = None
        self._before = None
        self.discriminator = None

        if inbox_ids is not None:
            self.inbox_ids = inbox_ids
        if page_index is not None:
            self.page_index = page_index
        if page_size is not None:
            self.page_size = page_size
        if sort_direction is not None:
            self.sort_direction = sort_direction
        if unread_only is not None:
            self.unread_only = unread_only
        if search_filter is not None:
            self.search_filter = search_filter
        if since is not None:
            self.since = since
        if before is not None:
            self.before = before

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

        Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account.  # noqa: E501

        :return: The inbox_ids of this SearchEmailsOptions.  # noqa: E501
        :rtype: list[str]
        """
        return self._inbox_ids

    @inbox_ids.setter
    def inbox_ids(self, inbox_ids):
        """Sets the inbox_ids of this SearchEmailsOptions.

        Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account.  # noqa: E501

        :param inbox_ids: The inbox_ids of this SearchEmailsOptions.  # noqa: E501
        :type: list[str]
        """

        self._inbox_ids = inbox_ids

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

        Optional page index in email list pagination  # noqa: E501

        :return: The page_index of this SearchEmailsOptions.  # noqa: E501
        :rtype: int
        """
        return self._page_index

    @page_index.setter
    def page_index(self, page_index):
        """Sets the page_index of this SearchEmailsOptions.

        Optional page index in email list pagination  # noqa: E501

        :param page_index: The page_index of this SearchEmailsOptions.  # noqa: E501
        :type: int
        """

        self._page_index = page_index

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

        Optional page size in email list pagination. Maximum size is 100. Use page index and sort to page through larger results  # noqa: E501

        :return: The page_size of this SearchEmailsOptions.  # noqa: E501
        :rtype: int
        """
        return self._page_size

    @page_size.setter
    def page_size(self, page_size):
        """Sets the page_size of this SearchEmailsOptions.

        Optional page size in email list pagination. Maximum size is 100. Use page index and sort to page through larger results  # noqa: E501

        :param page_size: The page_size of this SearchEmailsOptions.  # noqa: E501
        :type: int
        """
        if (self.local_vars_configuration.client_side_validation and
                page_size is not None and page_size > 100):  # noqa: E501
            raise ValueError("Invalid value for `page_size`, must be a value less than or equal to `100`")  # noqa: E501

        self._page_size = page_size

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

        Optional createdAt sort direction ASC or DESC  # noqa: E501

        :return: The sort_direction of this SearchEmailsOptions.  # noqa: E501
        :rtype: str
        """
        return self._sort_direction

    @sort_direction.setter
    def sort_direction(self, sort_direction):
        """Sets the sort_direction of this SearchEmailsOptions.

        Optional createdAt sort direction ASC or DESC  # noqa: E501

        :param sort_direction: The sort_direction of this SearchEmailsOptions.  # noqa: E501
        :type: str
        """
        allowed_values = ["ASC", "DESC"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and sort_direction not in allowed_values:  # noqa: E501
            raise ValueError(
                "Invalid value for `sort_direction` ({0}), must be one of {1}"  # noqa: E501
                .format(sort_direction, allowed_values)
            )

        self._sort_direction = sort_direction

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

        Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly  # noqa: E501

        :return: The unread_only of this SearchEmailsOptions.  # noqa: E501
        :rtype: bool
        """
        return self._unread_only

    @unread_only.setter
    def unread_only(self, unread_only):
        """Sets the unread_only of this SearchEmailsOptions.

        Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly  # noqa: E501

        :param unread_only: The unread_only of this SearchEmailsOptions.  # noqa: E501
        :type: bool
        """

        self._unread_only = unread_only

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

        Optional search filter. Searches email recipients, sender, subject, email address and ID. Does not search email body  # noqa: E501

        :return: The search_filter of this SearchEmailsOptions.  # noqa: E501
        :rtype: str
        """
        return self._search_filter

    @search_filter.setter
    def search_filter(self, search_filter):
        """Sets the search_filter of this SearchEmailsOptions.

        Optional search filter. Searches email recipients, sender, subject, email address and ID. Does not search email body  # noqa: E501

        :param search_filter: The search_filter of this SearchEmailsOptions.  # noqa: E501
        :type: str
        """

        self._search_filter = search_filter

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

        Optional filter emails received after given date time  # noqa: E501

        :return: The since of this SearchEmailsOptions.  # noqa: E501
        :rtype: datetime
        """
        return self._since

    @since.setter
    def since(self, since):
        """Sets the since of this SearchEmailsOptions.

        Optional filter emails received after given date time  # noqa: E501

        :param since: The since of this SearchEmailsOptions.  # noqa: E501
        :type: datetime
        """

        self._since = since

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

        Optional filter emails received before given date time  # noqa: E501

        :return: The before of this SearchEmailsOptions.  # noqa: E501
        :rtype: datetime
        """
        return self._before

    @before.setter
    def before(self, before):
        """Sets the before of this SearchEmailsOptions.

        Optional filter emails received before given date time  # noqa: E501

        :param before: The before of this SearchEmailsOptions.  # noqa: E501
        :type: datetime
        """

        self._before = before

    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, SearchEmailsOptions):
            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, SearchEmailsOptions):
            return True

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