# 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 FilterParameters(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 = {
        "request_id": "str",
        "merchant_order_id": "str",
        "payment_method": "str",
        "start_time": "datetime",
        "end_time": "datetime",
        "max_count": "int",
        "sort_order": "str",
        "currency": "str",
    }

    attribute_map = {
        "request_id": "request_id",
        "merchant_order_id": "merchant_order_id",
        "payment_method": "payment_method",
        "start_time": "start_time",
        "end_time": "end_time",
        "max_count": "max_count",
        "sort_order": "sort_order",
        "currency": "currency",
    }

    def __init__(
        self,
        request_id=None,
        merchant_order_id=None,
        payment_method=None,
        start_time=None,
        end_time=None,
        max_count=None,
        sort_order=None,
        currency=None,
    ):  # noqa: E501
        """FilterParameters - a model defined in Swagger"""  # noqa: E501

        self._request_id = None
        self._merchant_order_id = None
        self._payment_method = None
        self._start_time = None
        self._end_time = None
        self._max_count = None
        self._sort_order = None
        self._currency = None
        self.discriminator = None

        self.request_id = request_id
        if merchant_order_id is not None:
            self.merchant_order_id = merchant_order_id
        if payment_method is not None:
            self.payment_method = payment_method
        if start_time is not None:
            self.start_time = start_time
        if end_time is not None:
            self.end_time = end_time
        if max_count is not None:
            self.max_count = max_count
        if sort_order is not None:
            self.sort_order = sort_order
        if currency is not None:
            self.currency = currency

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

        Request ID  # noqa: E501

        :return: The request_id of this FilterParameters.  # noqa: E501
        :rtype: str
        """
        return self._request_id

    @request_id.setter
    def request_id(self, request_id):
        """Sets the request_id of this FilterParameters.

        Request ID  # noqa: E501

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

        self._request_id = request_id

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

        Merchant order number from the merchant system  # noqa: E501

        :return: The merchant_order_id of this FilterParameters.  # noqa: E501
        :rtype: str
        """
        return self._merchant_order_id

    @merchant_order_id.setter
    def merchant_order_id(self, merchant_order_id):
        """Sets the merchant_order_id of this FilterParameters.

        Merchant order number from the merchant system  # noqa: E501

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

        self._merchant_order_id = merchant_order_id

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

        Used payment method type name from payment methods list  # noqa: E501

        :return: The payment_method of this FilterParameters.  # noqa: E501
        :rtype: str
        """
        return self._payment_method

    @payment_method.setter
    def payment_method(self, payment_method):
        """Sets the payment_method of this FilterParameters.

        Used payment method type name from payment methods list  # noqa: E501

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

        self._payment_method = payment_method

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

        Date and time up to milliseconds (in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format) when requested period starts (inclusive), UTC time, default is 24 hours before 'end_time' (format: yyyy-MM-dd'T'HH:mm:ss'Z')  # noqa: E501

        :return: The start_time of this FilterParameters.  # noqa: E501
        :rtype: datetime
        """
        return self._start_time

    @start_time.setter
    def start_time(self, start_time):
        """Sets the start_time of this FilterParameters.

        Date and time up to milliseconds (in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format) when requested period starts (inclusive), UTC time, default is 24 hours before 'end_time' (format: yyyy-MM-dd'T'HH:mm:ss'Z')  # noqa: E501

        :param start_time: The start_time of this FilterParameters.  # noqa: E501
        :type: datetime
        """

        self._start_time = start_time

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

        Date and time up to milliseconds (in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format) when requested period ends (not inclusive), UTC time, must be less than 7 days after 'start_time', default is current time (format: yyyy-MM-dd'T'HH:mm:ss'Z')  # noqa: E501

        :return: The end_time of this FilterParameters.  # noqa: E501
        :rtype: datetime
        """
        return self._end_time

    @end_time.setter
    def end_time(self, end_time):
        """Sets the end_time of this FilterParameters.

        Date and time up to milliseconds (in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format) when requested period ends (not inclusive), UTC time, must be less than 7 days after 'start_time', default is current time (format: yyyy-MM-dd'T'HH:mm:ss'Z')  # noqa: E501

        :param end_time: The end_time of this FilterParameters.  # noqa: E501
        :type: datetime
        """

        self._end_time = end_time

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

        Limit number of returned transactions (must be less than 10000, default is 1000)  # noqa: E501

        :return: The max_count of this FilterParameters.  # noqa: E501
        :rtype: int
        """
        return self._max_count

    @max_count.setter
    def max_count(self, max_count):
        """Sets the max_count of this FilterParameters.

        Limit number of returned transactions (must be less than 10000, default is 1000)  # noqa: E501

        :param max_count: The max_count of this FilterParameters.  # noqa: E501
        :type: int
        """
        if max_count is not None and max_count > 10000:  # noqa: E501
            raise ValueError(
                "Invalid value for `max_count`, must be a value less than or equal to `10000`"
            )  # noqa: E501

        self._max_count = max_count

    class SortOrder(object):
        ASC = "asc"
        DESC = "desc"

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

        Sort based on order of results. `asc` for ascending order or `desc` for descending order (default value)  # noqa: E501

        :return: The sort_order of this FilterParameters.  # noqa: E501
        :rtype: str
        """
        return self._sort_order

    @sort_order.setter
    def sort_order(self, sort_order):
        """Sets the sort_order of this FilterParameters.

        Sort based on order of results. `asc` for ascending order or `desc` for descending order (default value)  # noqa: E501

        :param sort_order: The sort_order of this FilterParameters.  # noqa: E501
        :type: str
        """
        allowed_values = ["asc", "desc"]  # noqa: E501
        if sort_order not in allowed_values:
            raise ValueError(
                "Invalid value for `sort_order` ({0}), must be one of {1}".format(  # noqa: E501
                    sort_order, allowed_values
                )
            )

        self._sort_order = sort_order

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

        [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of transactions currency  # noqa: E501

        :return: The currency of this FilterParameters.  # noqa: E501
        :rtype: str
        """
        return self._currency

    @currency.setter
    def currency(self, currency):
        """Sets the currency of this FilterParameters.

        [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of transactions currency  # noqa: E501

        :param currency: The currency of this FilterParameters.  # noqa: E501
        :type: str
        """

        self._currency = currency

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

        return self.__dict__ == other.__dict__

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