# coding: utf-8

"""
Copyright 2017 Square, Inc.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
"""


from pprint import pformat
from six import iteritems
import re


class SearchOrdersResponse(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self, order_entries=None, orders=None, cursor=None, errors=None, unconvertible_transaction_ids=None):
        """
        SearchOrdersResponse - a model defined in Swagger

        :param dict swaggerTypes: The key is attribute name
                                  and the value is attribute type.
        :param dict attributeMap: The key is attribute name
                                  and the value is json key in definition.
        """
        self.swagger_types = {
            'order_entries': 'list[OrderEntry]',
            'orders': 'list[Order]',
            'cursor': 'str',
            'errors': 'list[Error]',
            'unconvertible_transaction_ids': 'list[str]'
        }

        self.attribute_map = {
            'order_entries': 'order_entries',
            'orders': 'orders',
            'cursor': 'cursor',
            'errors': 'errors',
            'unconvertible_transaction_ids': 'unconvertible_transaction_ids'
        }

        self._order_entries = order_entries
        self._orders = orders
        self._cursor = cursor
        self._errors = errors
        self._unconvertible_transaction_ids = unconvertible_transaction_ids

    @property
    def order_entries(self):
        """
        Gets the order_entries of this SearchOrdersResponse.
        List of [OrderEntries](#type-orderentry) that fit the query conditions.  Populated only if `order_entries` was set to `true` in the request.

        :return: The order_entries of this SearchOrdersResponse.
        :rtype: list[OrderEntry]
        """
        return self._order_entries

    @order_entries.setter
    def order_entries(self, order_entries):
        """
        Sets the order_entries of this SearchOrdersResponse.
        List of [OrderEntries](#type-orderentry) that fit the query conditions.  Populated only if `order_entries` was set to `true` in the request.

        :param order_entries: The order_entries of this SearchOrdersResponse.
        :type: list[OrderEntry]
        """

        self._order_entries = order_entries

    @property
    def orders(self):
        """
        Gets the orders of this SearchOrdersResponse.
        List of [Orders](#type-order) that match query conditions. Populated only if `return_entries` in the request is set to `false`.

        :return: The orders of this SearchOrdersResponse.
        :rtype: list[Order]
        """
        return self._orders

    @orders.setter
    def orders(self, orders):
        """
        Sets the orders of this SearchOrdersResponse.
        List of [Orders](#type-order) that match query conditions. Populated only if `return_entries` in the request is set to `false`.

        :param orders: The orders of this SearchOrdersResponse.
        :type: list[Order]
        """

        self._orders = orders

    @property
    def cursor(self):
        """
        Gets the cursor of this SearchOrdersResponse.
        The pagination cursor to be used in a subsequent request. If unset, this is the final response. See [Pagination](/basics/api101/pagination) for more information.

        :return: The cursor of this SearchOrdersResponse.
        :rtype: str
        """
        return self._cursor

    @cursor.setter
    def cursor(self, cursor):
        """
        Sets the cursor of this SearchOrdersResponse.
        The pagination cursor to be used in a subsequent request. If unset, this is the final response. See [Pagination](/basics/api101/pagination) for more information.

        :param cursor: The cursor of this SearchOrdersResponse.
        :type: str
        """

        self._cursor = cursor

    @property
    def errors(self):
        """
        Gets the errors of this SearchOrdersResponse.
        [Errors](#type-error) encountered during the search.

        :return: The errors of this SearchOrdersResponse.
        :rtype: list[Error]
        """
        return self._errors

    @errors.setter
    def errors(self, errors):
        """
        Sets the errors of this SearchOrdersResponse.
        [Errors](#type-error) encountered during the search.

        :param errors: The errors of this SearchOrdersResponse.
        :type: list[Error]
        """

        self._errors = errors

    @property
    def unconvertible_transaction_ids(self):
        """
        Gets the unconvertible_transaction_ids of this SearchOrdersResponse.
        List of transaction IDs identifying transactions that could not be converted to an `Order`. Empty if `return_entries` is true, however, attempts to retrieve those orders may encounter subsequent `unconvertible_transcation_ids` Note that this field will not be present after SearchOrders moves from BETA to GA.

        :return: The unconvertible_transaction_ids of this SearchOrdersResponse.
        :rtype: list[str]
        """
        return self._unconvertible_transaction_ids

    @unconvertible_transaction_ids.setter
    def unconvertible_transaction_ids(self, unconvertible_transaction_ids):
        """
        Sets the unconvertible_transaction_ids of this SearchOrdersResponse.
        List of transaction IDs identifying transactions that could not be converted to an `Order`. Empty if `return_entries` is true, however, attempts to retrieve those orders may encounter subsequent `unconvertible_transcation_ids` Note that this field will not be present after SearchOrders moves from BETA to GA.

        :param unconvertible_transaction_ids: The unconvertible_transaction_ids of this SearchOrdersResponse.
        :type: list[str]
        """

        self._unconvertible_transaction_ids = unconvertible_transaction_ids

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

        for attr, _ in 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

        return result

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

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