# coding: utf-8

"""
    OEML - REST API

    This section will provide necessary information about the `CoinAPI OEML REST API` protocol. This API is also available in the Postman application: <a href=\"https://postman.coinapi.io/\" target=\"_blank\">https://postman.coinapi.io/</a>         # noqa: E501

    The version of the OpenAPI document: v1
    Contact: support@coinapi.io
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from openapi_client.configuration import Configuration


class OrderExecutionReportAllOf(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 = {
        'client_order_id_format_exchange': 'str',
        'exchange_order_id': 'str',
        'amount_open': 'float',
        'amount_filled': 'float',
        'avg_px': 'float',
        'status': 'OrdStatus',
        'status_history': 'list[list[str]]',
        'error_message': 'str',
        'fills': 'list[Fills]'
    }

    attribute_map = {
        'client_order_id_format_exchange': 'client_order_id_format_exchange',
        'exchange_order_id': 'exchange_order_id',
        'amount_open': 'amount_open',
        'amount_filled': 'amount_filled',
        'avg_px': 'avg_px',
        'status': 'status',
        'status_history': 'status_history',
        'error_message': 'error_message',
        'fills': 'fills'
    }

    def __init__(self, client_order_id_format_exchange=None, exchange_order_id=None, amount_open=None, amount_filled=None, avg_px=None, status=None, status_history=None, error_message=None, fills=None, local_vars_configuration=None):  # noqa: E501
        """OrderExecutionReportAllOf - 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._client_order_id_format_exchange = None
        self._exchange_order_id = None
        self._amount_open = None
        self._amount_filled = None
        self._avg_px = None
        self._status = None
        self._status_history = None
        self._error_message = None
        self._fills = None
        self.discriminator = None

        self.client_order_id_format_exchange = client_order_id_format_exchange
        if exchange_order_id is not None:
            self.exchange_order_id = exchange_order_id
        self.amount_open = amount_open
        self.amount_filled = amount_filled
        if avg_px is not None:
            self.avg_px = avg_px
        self.status = status
        if status_history is not None:
            self.status_history = status_history
        if error_message is not None:
            self.error_message = error_message
        if fills is not None:
            self.fills = fills

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

        The unique identifier of the order assigned by the client converted to the exchange order tag format for the purpose of tracking it.  # noqa: E501

        :return: The client_order_id_format_exchange of this OrderExecutionReportAllOf.  # noqa: E501
        :rtype: str
        """
        return self._client_order_id_format_exchange

    @client_order_id_format_exchange.setter
    def client_order_id_format_exchange(self, client_order_id_format_exchange):
        """Sets the client_order_id_format_exchange of this OrderExecutionReportAllOf.

        The unique identifier of the order assigned by the client converted to the exchange order tag format for the purpose of tracking it.  # noqa: E501

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

        self._client_order_id_format_exchange = client_order_id_format_exchange

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

        Unique identifier of the order assigned by the exchange or executing system.  # noqa: E501

        :return: The exchange_order_id of this OrderExecutionReportAllOf.  # noqa: E501
        :rtype: str
        """
        return self._exchange_order_id

    @exchange_order_id.setter
    def exchange_order_id(self, exchange_order_id):
        """Sets the exchange_order_id of this OrderExecutionReportAllOf.

        Unique identifier of the order assigned by the exchange or executing system.  # noqa: E501

        :param exchange_order_id: The exchange_order_id of this OrderExecutionReportAllOf.  # noqa: E501
        :type: str
        """

        self._exchange_order_id = exchange_order_id

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

        Quantity open for further execution. `amount_open` = `amount_order` - `amount_filled`  # noqa: E501

        :return: The amount_open of this OrderExecutionReportAllOf.  # noqa: E501
        :rtype: float
        """
        return self._amount_open

    @amount_open.setter
    def amount_open(self, amount_open):
        """Sets the amount_open of this OrderExecutionReportAllOf.

        Quantity open for further execution. `amount_open` = `amount_order` - `amount_filled`  # noqa: E501

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

        self._amount_open = amount_open

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

        Total quantity filled.  # noqa: E501

        :return: The amount_filled of this OrderExecutionReportAllOf.  # noqa: E501
        :rtype: float
        """
        return self._amount_filled

    @amount_filled.setter
    def amount_filled(self, amount_filled):
        """Sets the amount_filled of this OrderExecutionReportAllOf.

        Total quantity filled.  # noqa: E501

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

        self._amount_filled = amount_filled

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

        Calculated average price of all fills on this order.  # noqa: E501

        :return: The avg_px of this OrderExecutionReportAllOf.  # noqa: E501
        :rtype: float
        """
        return self._avg_px

    @avg_px.setter
    def avg_px(self, avg_px):
        """Sets the avg_px of this OrderExecutionReportAllOf.

        Calculated average price of all fills on this order.  # noqa: E501

        :param avg_px: The avg_px of this OrderExecutionReportAllOf.  # noqa: E501
        :type: float
        """

        self._avg_px = avg_px

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


        :return: The status of this OrderExecutionReportAllOf.  # noqa: E501
        :rtype: OrdStatus
        """
        return self._status

    @status.setter
    def status(self, status):
        """Sets the status of this OrderExecutionReportAllOf.


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

        self._status = status

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

        Timestamped history of order status changes.  # noqa: E501

        :return: The status_history of this OrderExecutionReportAllOf.  # noqa: E501
        :rtype: list[list[str]]
        """
        return self._status_history

    @status_history.setter
    def status_history(self, status_history):
        """Sets the status_history of this OrderExecutionReportAllOf.

        Timestamped history of order status changes.  # noqa: E501

        :param status_history: The status_history of this OrderExecutionReportAllOf.  # noqa: E501
        :type: list[list[str]]
        """

        self._status_history = status_history

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

        Error message.  # noqa: E501

        :return: The error_message of this OrderExecutionReportAllOf.  # noqa: E501
        :rtype: str
        """
        return self._error_message

    @error_message.setter
    def error_message(self, error_message):
        """Sets the error_message of this OrderExecutionReportAllOf.

        Error message.  # noqa: E501

        :param error_message: The error_message of this OrderExecutionReportAllOf.  # noqa: E501
        :type: str
        """

        self._error_message = error_message

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

        Relay fill information on working orders.  # noqa: E501

        :return: The fills of this OrderExecutionReportAllOf.  # noqa: E501
        :rtype: list[Fills]
        """
        return self._fills

    @fills.setter
    def fills(self, fills):
        """Sets the fills of this OrderExecutionReportAllOf.

        Relay fill information on working orders.  # noqa: E501

        :param fills: The fills of this OrderExecutionReportAllOf.  # noqa: E501
        :type: list[Fills]
        """

        self._fills = fills

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

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