<filename>powerbot/models/own_order.py
# coding: utf-8

"""
    Powerbot Server

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # noqa: E501

    OpenAPI spec version: 1.0.5
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six


class OwnOrder(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 = {
        'order_id': 'int',
        'api_timestamp': 'datetime',
        'state': 'str',
        'delivery_area': 'str',
        'last_change_timestamp': 'datetime',
        'buy': 'bool',
        'sell': 'bool',
        'side': 'str',
        'contract_id': 'int',
        'contract_name': 'str',
        'delivery_start': 'datetime',
        'delivery_end': 'datetime',
        'cl_ordr_id': 'str',
        'txt': 'str',
        'price': 'float',
        'quantity': 'float',
        'action': 'str',
        'details': 'object'
    }

    attribute_map = {
        'order_id': 'order_id',
        'api_timestamp': 'api_timestamp',
        'state': 'state',
        'delivery_area': 'delivery_area',
        'last_change_timestamp': 'last_change_timestamp',
        'buy': 'buy',
        'sell': 'sell',
        'side': 'side',
        'contract_id': 'contract_id',
        'contract_name': 'contract_name',
        'delivery_start': 'delivery_start',
        'delivery_end': 'delivery_end',
        'cl_ordr_id': 'clOrdrId',
        'txt': 'txt',
        'price': 'price',
        'quantity': 'quantity',
        'action': 'action',
        'details': 'details'
    }

    def __init__(self, order_id=None, api_timestamp=None, state=None, delivery_area=None, last_change_timestamp=None, buy=None, sell=None, side=None, contract_id=None, contract_name=None, delivery_start=None, delivery_end=None, cl_ordr_id=None, txt=None, price=None, quantity=None, action=None, details=None):  # noqa: E501
        """OwnOrder - a model defined in Swagger"""  # noqa: E501

        self._order_id = None
        self._api_timestamp = None
        self._state = None
        self._delivery_area = None
        self._last_change_timestamp = None
        self._buy = None
        self._sell = None
        self._side = None
        self._contract_id = None
        self._contract_name = None
        self._delivery_start = None
        self._delivery_end = None
        self._cl_ordr_id = None
        self._txt = None
        self._price = None
        self._quantity = None
        self._action = None
        self._details = None
        self.discriminator = None

        if order_id is not None:
            self.order_id = order_id
        if api_timestamp is not None:
            self.api_timestamp = api_timestamp
        if state is not None:
            self.state = state
        if delivery_area is not None:
            self.delivery_area = delivery_area
        if last_change_timestamp is not None:
            self.last_change_timestamp = last_change_timestamp
        if buy is not None:
            self.buy = buy
        if sell is not None:
            self.sell = sell
        if side is not None:
            self.side = side
        if contract_id is not None:
            self.contract_id = contract_id
        if contract_name is not None:
            self.contract_name = contract_name
        if delivery_start is not None:
            self.delivery_start = delivery_start
        if delivery_end is not None:
            self.delivery_end = delivery_end
        if cl_ordr_id is not None:
            self.cl_ordr_id = cl_ordr_id
        if txt is not None:
            self.txt = txt
        if price is not None:
            self.price = price
        if quantity is not None:
            self.quantity = quantity
        if action is not None:
            self.action = action
        if details is not None:
            self.details = details

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


        :return: The order_id of this OwnOrder.  # noqa: E501
        :rtype: int
        """
        return self._order_id

    @order_id.setter
    def order_id(self, order_id):
        """Sets the order_id of this OwnOrder.


        :param order_id: The order_id of this OwnOrder.  # noqa: E501
        :type: int
        """

        self._order_id = order_id

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


        :return: The api_timestamp of this OwnOrder.  # noqa: E501
        :rtype: datetime
        """
        return self._api_timestamp

    @api_timestamp.setter
    def api_timestamp(self, api_timestamp):
        """Sets the api_timestamp of this OwnOrder.


        :param api_timestamp: The api_timestamp of this OwnOrder.  # noqa: E501
        :type: datetime
        """

        self._api_timestamp = api_timestamp

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


        :return: The state of this OwnOrder.  # noqa: E501
        :rtype: str
        """
        return self._state

    @state.setter
    def state(self, state):
        """Sets the state of this OwnOrder.


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

        self._state = state

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


        :return: The delivery_area of this OwnOrder.  # noqa: E501
        :rtype: str
        """
        return self._delivery_area

    @delivery_area.setter
    def delivery_area(self, delivery_area):
        """Sets the delivery_area of this OwnOrder.


        :param delivery_area: The delivery_area of this OwnOrder.  # noqa: E501
        :type: str
        """

        self._delivery_area = delivery_area

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


        :return: The last_change_timestamp of this OwnOrder.  # noqa: E501
        :rtype: datetime
        """
        return self._last_change_timestamp

    @last_change_timestamp.setter
    def last_change_timestamp(self, last_change_timestamp):
        """Sets the last_change_timestamp of this OwnOrder.


        :param last_change_timestamp: The last_change_timestamp of this OwnOrder.  # noqa: E501
        :type: datetime
        """

        self._last_change_timestamp = last_change_timestamp

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


        :return: The buy of this OwnOrder.  # noqa: E501
        :rtype: bool
        """
        return self._buy

    @buy.setter
    def buy(self, buy):
        """Sets the buy of this OwnOrder.


        :param buy: The buy of this OwnOrder.  # noqa: E501
        :type: bool
        """

        self._buy = buy

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


        :return: The sell of this OwnOrder.  # noqa: E501
        :rtype: bool
        """
        return self._sell

    @sell.setter
    def sell(self, sell):
        """Sets the sell of this OwnOrder.


        :param sell: The sell of this OwnOrder.  # noqa: E501
        :type: bool
        """

        self._sell = sell

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


        :return: The side of this OwnOrder.  # noqa: E501
        :rtype: str
        """
        return self._side

    @side.setter
    def side(self, side):
        """Sets the side of this OwnOrder.


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

        self._side = side

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


        :return: The contract_id of this OwnOrder.  # noqa: E501
        :rtype: int
        """
        return self._contract_id

    @contract_id.setter
    def contract_id(self, contract_id):
        """Sets the contract_id of this OwnOrder.


        :param contract_id: The contract_id of this OwnOrder.  # noqa: E501
        :type: int
        """

        self._contract_id = contract_id

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


        :return: The contract_name of this OwnOrder.  # noqa: E501
        :rtype: str
        """
        return self._contract_name

    @contract_name.setter
    def contract_name(self, contract_name):
        """Sets the contract_name of this OwnOrder.


        :param contract_name: The contract_name of this OwnOrder.  # noqa: E501
        :type: str
        """

        self._contract_name = contract_name

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


        :return: The delivery_start of this OwnOrder.  # noqa: E501
        :rtype: datetime
        """
        return self._delivery_start

    @delivery_start.setter
    def delivery_start(self, delivery_start):
        """Sets the delivery_start of this OwnOrder.


        :param delivery_start: The delivery_start of this OwnOrder.  # noqa: E501
        :type: datetime
        """

        self._delivery_start = delivery_start

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


        :return: The delivery_end of this OwnOrder.  # noqa: E501
        :rtype: datetime
        """
        return self._delivery_end

    @delivery_end.setter
    def delivery_end(self, delivery_end):
        """Sets the delivery_end of this OwnOrder.


        :param delivery_end: The delivery_end of this OwnOrder.  # noqa: E501
        :type: datetime
        """

        self._delivery_end = delivery_end

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


        :return: The cl_ordr_id of this OwnOrder.  # noqa: E501
        :rtype: str
        """
        return self._cl_ordr_id

    @cl_ordr_id.setter
    def cl_ordr_id(self, cl_ordr_id):
        """Sets the cl_ordr_id of this OwnOrder.


        :param cl_ordr_id: The cl_ordr_id of this OwnOrder.  # noqa: E501
        :type: str
        """

        self._cl_ordr_id = cl_ordr_id

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


        :return: The txt of this OwnOrder.  # noqa: E501
        :rtype: str
        """
        return self._txt

    @txt.setter
    def txt(self, txt):
        """Sets the txt of this OwnOrder.


        :param txt: The txt of this OwnOrder.  # noqa: E501
        :type: str
        """

        self._txt = txt

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


        :return: The price of this OwnOrder.  # noqa: E501
        :rtype: float
        """
        return self._price

    @price.setter
    def price(self, price):
        """Sets the price of this OwnOrder.


        :param price: The price of this OwnOrder.  # noqa: E501
        :type: float
        """

        self._price = price

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


        :return: The quantity of this OwnOrder.  # noqa: E501
        :rtype: float
        """
        return self._quantity

    @quantity.setter
    def quantity(self, quantity):
        """Sets the quantity of this OwnOrder.


        :param quantity: The quantity of this OwnOrder.  # noqa: E501
        :type: float
        """

        self._quantity = quantity

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


        :return: The action of this OwnOrder.  # noqa: E501
        :rtype: str
        """
        return self._action

    @action.setter
    def action(self, action):
        """Sets the action of this OwnOrder.


        :param action: The action of this OwnOrder.  # noqa: E501
        :type: str
        """

        self._action = action

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


        :return: The details of this OwnOrder.  # noqa: E501
        :rtype: object
        """
        return self._details

    @details.setter
    def details(self, details):
        """Sets the details of this OwnOrder.


        :param details: The details of this OwnOrder.  # noqa: E501
        :type: object
        """

        self._details = details

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

        return self.__dict__ == other.__dict__

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