<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: core/Tron.proto

namespace Protocol;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * market
 *
 * Generated from protobuf message <code>protocol.MarketOrder</code>
 */
class MarketOrder extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>bytes order_id = 1;</code>
     */
    protected $order_id = '';
    /**
     * Generated from protobuf field <code>bytes owner_address = 2;</code>
     */
    protected $owner_address = '';
    /**
     * Generated from protobuf field <code>int64 create_time = 3;</code>
     */
    protected $create_time = 0;
    /**
     * Generated from protobuf field <code>bytes sell_token_id = 4;</code>
     */
    protected $sell_token_id = '';
    /**
     * Generated from protobuf field <code>int64 sell_token_quantity = 5;</code>
     */
    protected $sell_token_quantity = 0;
    /**
     * Generated from protobuf field <code>bytes buy_token_id = 6;</code>
     */
    protected $buy_token_id = '';
    /**
     * min to receive
     *
     * Generated from protobuf field <code>int64 buy_token_quantity = 7;</code>
     */
    protected $buy_token_quantity = 0;
    /**
     * Generated from protobuf field <code>int64 sell_token_quantity_remain = 9;</code>
     */
    protected $sell_token_quantity_remain = 0;
    /**
     * When state != ACTIVE and sell_token_quantity_return !=0,
     *it means that some sell tokens are returned to the account due to insufficient remaining amount
     *
     * Generated from protobuf field <code>int64 sell_token_quantity_return = 10;</code>
     */
    protected $sell_token_quantity_return = 0;
    /**
     * Generated from protobuf field <code>.protocol.MarketOrder.State state = 11;</code>
     */
    protected $state = 0;
    /**
     * Generated from protobuf field <code>bytes prev = 12;</code>
     */
    protected $prev = '';
    /**
     * Generated from protobuf field <code>bytes next = 13;</code>
     */
    protected $next = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $order_id
     *     @type string $owner_address
     *     @type int|string $create_time
     *     @type string $sell_token_id
     *     @type int|string $sell_token_quantity
     *     @type string $buy_token_id
     *     @type int|string $buy_token_quantity
     *           min to receive
     *     @type int|string $sell_token_quantity_remain
     *     @type int|string $sell_token_quantity_return
     *           When state != ACTIVE and sell_token_quantity_return !=0,
     *          it means that some sell tokens are returned to the account due to insufficient remaining amount
     *     @type int $state
     *     @type string $prev
     *     @type string $next
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Core\Tron::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>bytes order_id = 1;</code>
     * @return string
     */
    public function getOrderId()
    {
        return $this->order_id;
    }

    /**
     * Generated from protobuf field <code>bytes order_id = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setOrderId($var)
    {
        GPBUtil::checkString($var, False);
        $this->order_id = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>bytes owner_address = 2;</code>
     * @return string
     */
    public function getOwnerAddress()
    {
        return $this->owner_address;
    }

    /**
     * Generated from protobuf field <code>bytes owner_address = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setOwnerAddress($var)
    {
        GPBUtil::checkString($var, False);
        $this->owner_address = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>int64 create_time = 3;</code>
     * @return int|string
     */
    public function getCreateTime()
    {
        return $this->create_time;
    }

    /**
     * Generated from protobuf field <code>int64 create_time = 3;</code>
     * @param int|string $var
     * @return $this
     */
    public function setCreateTime($var)
    {
        GPBUtil::checkInt64($var);
        $this->create_time = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>bytes sell_token_id = 4;</code>
     * @return string
     */
    public function getSellTokenId()
    {
        return $this->sell_token_id;
    }

    /**
     * Generated from protobuf field <code>bytes sell_token_id = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setSellTokenId($var)
    {
        GPBUtil::checkString($var, False);
        $this->sell_token_id = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>int64 sell_token_quantity = 5;</code>
     * @return int|string
     */
    public function getSellTokenQuantity()
    {
        return $this->sell_token_quantity;
    }

    /**
     * Generated from protobuf field <code>int64 sell_token_quantity = 5;</code>
     * @param int|string $var
     * @return $this
     */
    public function setSellTokenQuantity($var)
    {
        GPBUtil::checkInt64($var);
        $this->sell_token_quantity = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>bytes buy_token_id = 6;</code>
     * @return string
     */
    public function getBuyTokenId()
    {
        return $this->buy_token_id;
    }

    /**
     * Generated from protobuf field <code>bytes buy_token_id = 6;</code>
     * @param string $var
     * @return $this
     */
    public function setBuyTokenId($var)
    {
        GPBUtil::checkString($var, False);
        $this->buy_token_id = $var;

        return $this;
    }

    /**
     * min to receive
     *
     * Generated from protobuf field <code>int64 buy_token_quantity = 7;</code>
     * @return int|string
     */
    public function getBuyTokenQuantity()
    {
        return $this->buy_token_quantity;
    }

    /**
     * min to receive
     *
     * Generated from protobuf field <code>int64 buy_token_quantity = 7;</code>
     * @param int|string $var
     * @return $this
     */
    public function setBuyTokenQuantity($var)
    {
        GPBUtil::checkInt64($var);
        $this->buy_token_quantity = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>int64 sell_token_quantity_remain = 9;</code>
     * @return int|string
     */
    public function getSellTokenQuantityRemain()
    {
        return $this->sell_token_quantity_remain;
    }

    /**
     * Generated from protobuf field <code>int64 sell_token_quantity_remain = 9;</code>
     * @param int|string $var
     * @return $this
     */
    public function setSellTokenQuantityRemain($var)
    {
        GPBUtil::checkInt64($var);
        $this->sell_token_quantity_remain = $var;

        return $this;
    }

    /**
     * When state != ACTIVE and sell_token_quantity_return !=0,
     *it means that some sell tokens are returned to the account due to insufficient remaining amount
     *
     * Generated from protobuf field <code>int64 sell_token_quantity_return = 10;</code>
     * @return int|string
     */
    public function getSellTokenQuantityReturn()
    {
        return $this->sell_token_quantity_return;
    }

    /**
     * When state != ACTIVE and sell_token_quantity_return !=0,
     *it means that some sell tokens are returned to the account due to insufficient remaining amount
     *
     * Generated from protobuf field <code>int64 sell_token_quantity_return = 10;</code>
     * @param int|string $var
     * @return $this
     */
    public function setSellTokenQuantityReturn($var)
    {
        GPBUtil::checkInt64($var);
        $this->sell_token_quantity_return = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.protocol.MarketOrder.State state = 11;</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * Generated from protobuf field <code>.protocol.MarketOrder.State state = 11;</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Protocol\MarketOrder\State::class);
        $this->state = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>bytes prev = 12;</code>
     * @return string
     */
    public function getPrev()
    {
        return $this->prev;
    }

    /**
     * Generated from protobuf field <code>bytes prev = 12;</code>
     * @param string $var
     * @return $this
     */
    public function setPrev($var)
    {
        GPBUtil::checkString($var, False);
        $this->prev = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>bytes next = 13;</code>
     * @return string
     */
    public function getNext()
    {
        return $this->next;
    }

    /**
     * Generated from protobuf field <code>bytes next = 13;</code>
     * @param string $var
     * @return $this
     */
    public function setNext($var)
    {
        GPBUtil::checkString($var, False);
        $this->next = $var;

        return $this;
    }

}

