<?php
/**
 * Order
 *
 * PHP version 5
 *
 * @category Class
 * @package  Swagger\Client
 * @author   Swagger Codegen team
 * @link     https://github.com/swagger-api/swagger-codegen
 */

/**
 * BitMEX API
 *
 * ## REST API for the BitMEX Trading Platform  _If you are building automated tools, please subscribe to the_ _[BitMEX API RSS Feed](https://blog.bitmex.com/api_announcement/feed/) for changes. The feed will be updated_ _regularly and is the most reliable way to get downtime and update announcements._  [View Changelog](/app/apiChangelog)  -  #### Getting Started  Base URI: [https://www.bitmex.com/api/v1](/api/v1)  ##### Fetching Data  All REST endpoints are documented below. You can try out any query right from this interface.  Most table queries accept `count`, `start`, and `reverse` params. Set `reverse=true` to get rows newest-first.  Additional documentation regarding filters, timestamps, and authentication is available in [the main API documentation](/app/restAPI).  _All_ table data is available via the [Websocket](/app/wsAPI). We highly recommend using the socket if you want to have the quickest possible data without being subject to ratelimits.  ##### Return Types  By default, all data is returned as JSON. Send `?_format=csv` to get CSV data or `?_format=xml` to get XML data.  ##### Trade Data Queries  _This is only a small subset of what is available, to get you started._  Fill in the parameters and click the `Try it out!` button to try any of these queries.  - [Pricing Data](#!/Quote/Quote_get)  - [Trade Data](#!/Trade/Trade_get)  - [OrderBook Data](#!/OrderBook/OrderBook_getL2)  - [Settlement Data](#!/Settlement/Settlement_get)  - [Exchange Statistics](#!/Stats/Stats_history)  Every function of the BitMEX.com platform is exposed here and documented. Many more functions are available.  ##### Swagger Specification  [⇩ Download Swagger JSON](swagger.json)  -  ## All API Endpoints  Click to expand a section.
 *
 * OpenAPI spec version: 1.2.0
 * Contact: support@bitmex.com
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 * Swagger Codegen version: 2.4.42-SNAPSHOT
 */

/**
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen
 * Do not edit the class manually.
 */

namespace Swagger\Client\Model;

use \ArrayAccess;
use \Swagger\Client\ObjectSerializer;

/**
 * Order Class Doc Comment
 *
 * @category Class
 * @description Placement, Cancellation, Amending, and History
 * @package  Swagger\Client
 * @author   Swagger Codegen team
 * @link     https://github.com/swagger-api/swagger-codegen
 */
class Order implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

    /**
      * The original name of the model.
      *
      * @var string
      */
    protected static $swaggerModelName = 'Order';

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerTypes = [
        'order_id' => 'string',
        'cl_ord_id' => 'string',
        'cl_ord_link_id' => 'string',
        'account' => 'int',
        'symbol' => 'string',
        'side' => 'string',
        'order_qty' => 'int',
        'price' => 'double',
        'display_qty' => 'int',
        'stop_px' => 'double',
        'peg_offset_value' => 'double',
        'peg_price_type' => 'string',
        'currency' => 'string',
        'settl_currency' => 'string',
        'ord_type' => 'string',
        'time_in_force' => 'string',
        'exec_inst' => 'string',
        'contingency_type' => 'string',
        'ord_status' => 'string',
        'triggered' => 'string',
        'working_indicator' => 'bool',
        'ord_rej_reason' => 'string',
        'leaves_qty' => 'int',
        'cum_qty' => 'int',
        'avg_px' => 'double',
        'text' => 'string',
        'transact_time' => '\DateTime',
        'timestamp' => '\DateTime'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerFormats = [
        'order_id' => 'guid',
        'cl_ord_id' => null,
        'cl_ord_link_id' => null,
        'account' => 'int64',
        'symbol' => null,
        'side' => null,
        'order_qty' => 'int64',
        'price' => 'double',
        'display_qty' => 'int64',
        'stop_px' => 'double',
        'peg_offset_value' => 'double',
        'peg_price_type' => null,
        'currency' => null,
        'settl_currency' => null,
        'ord_type' => null,
        'time_in_force' => null,
        'exec_inst' => null,
        'contingency_type' => null,
        'ord_status' => null,
        'triggered' => null,
        'working_indicator' => null,
        'ord_rej_reason' => null,
        'leaves_qty' => 'int64',
        'cum_qty' => 'int64',
        'avg_px' => 'double',
        'text' => null,
        'transact_time' => 'date-time',
        'timestamp' => 'date-time'
    ];

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function swaggerTypes()
    {
        return self::$swaggerTypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function swaggerFormats()
    {
        return self::$swaggerFormats;
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'order_id' => 'orderID',
        'cl_ord_id' => 'clOrdID',
        'cl_ord_link_id' => 'clOrdLinkID',
        'account' => 'account',
        'symbol' => 'symbol',
        'side' => 'side',
        'order_qty' => 'orderQty',
        'price' => 'price',
        'display_qty' => 'displayQty',
        'stop_px' => 'stopPx',
        'peg_offset_value' => 'pegOffsetValue',
        'peg_price_type' => 'pegPriceType',
        'currency' => 'currency',
        'settl_currency' => 'settlCurrency',
        'ord_type' => 'ordType',
        'time_in_force' => 'timeInForce',
        'exec_inst' => 'execInst',
        'contingency_type' => 'contingencyType',
        'ord_status' => 'ordStatus',
        'triggered' => 'triggered',
        'working_indicator' => 'workingIndicator',
        'ord_rej_reason' => 'ordRejReason',
        'leaves_qty' => 'leavesQty',
        'cum_qty' => 'cumQty',
        'avg_px' => 'avgPx',
        'text' => 'text',
        'transact_time' => 'transactTime',
        'timestamp' => 'timestamp'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'order_id' => 'setOrderId',
        'cl_ord_id' => 'setClOrdId',
        'cl_ord_link_id' => 'setClOrdLinkId',
        'account' => 'setAccount',
        'symbol' => 'setSymbol',
        'side' => 'setSide',
        'order_qty' => 'setOrderQty',
        'price' => 'setPrice',
        'display_qty' => 'setDisplayQty',
        'stop_px' => 'setStopPx',
        'peg_offset_value' => 'setPegOffsetValue',
        'peg_price_type' => 'setPegPriceType',
        'currency' => 'setCurrency',
        'settl_currency' => 'setSettlCurrency',
        'ord_type' => 'setOrdType',
        'time_in_force' => 'setTimeInForce',
        'exec_inst' => 'setExecInst',
        'contingency_type' => 'setContingencyType',
        'ord_status' => 'setOrdStatus',
        'triggered' => 'setTriggered',
        'working_indicator' => 'setWorkingIndicator',
        'ord_rej_reason' => 'setOrdRejReason',
        'leaves_qty' => 'setLeavesQty',
        'cum_qty' => 'setCumQty',
        'avg_px' => 'setAvgPx',
        'text' => 'setText',
        'transact_time' => 'setTransactTime',
        'timestamp' => 'setTimestamp'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'order_id' => 'getOrderId',
        'cl_ord_id' => 'getClOrdId',
        'cl_ord_link_id' => 'getClOrdLinkId',
        'account' => 'getAccount',
        'symbol' => 'getSymbol',
        'side' => 'getSide',
        'order_qty' => 'getOrderQty',
        'price' => 'getPrice',
        'display_qty' => 'getDisplayQty',
        'stop_px' => 'getStopPx',
        'peg_offset_value' => 'getPegOffsetValue',
        'peg_price_type' => 'getPegPriceType',
        'currency' => 'getCurrency',
        'settl_currency' => 'getSettlCurrency',
        'ord_type' => 'getOrdType',
        'time_in_force' => 'getTimeInForce',
        'exec_inst' => 'getExecInst',
        'contingency_type' => 'getContingencyType',
        'ord_status' => 'getOrdStatus',
        'triggered' => 'getTriggered',
        'working_indicator' => 'getWorkingIndicator',
        'ord_rej_reason' => 'getOrdRejReason',
        'leaves_qty' => 'getLeavesQty',
        'cum_qty' => 'getCumQty',
        'avg_px' => 'getAvgPx',
        'text' => 'getText',
        'transact_time' => 'getTransactTime',
        'timestamp' => 'getTimestamp'
    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @return array
     */
    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @return array
     */
    public static function setters()
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @return array
     */
    public static function getters()
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName()
    {
        return self::$swaggerModelName;
    }

    

    

    /**
     * Associative array for storing property values
     *
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor
     *
     * @param mixed[] $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(array $data = null)
    {
        $this->container['order_id'] = isset($data['order_id']) ? $data['order_id'] : null;
        $this->container['cl_ord_id'] = isset($data['cl_ord_id']) ? $data['cl_ord_id'] : null;
        $this->container['cl_ord_link_id'] = isset($data['cl_ord_link_id']) ? $data['cl_ord_link_id'] : null;
        $this->container['account'] = isset($data['account']) ? $data['account'] : null;
        $this->container['symbol'] = isset($data['symbol']) ? $data['symbol'] : null;
        $this->container['side'] = isset($data['side']) ? $data['side'] : null;
        $this->container['order_qty'] = isset($data['order_qty']) ? $data['order_qty'] : null;
        $this->container['price'] = isset($data['price']) ? $data['price'] : null;
        $this->container['display_qty'] = isset($data['display_qty']) ? $data['display_qty'] : null;
        $this->container['stop_px'] = isset($data['stop_px']) ? $data['stop_px'] : null;
        $this->container['peg_offset_value'] = isset($data['peg_offset_value']) ? $data['peg_offset_value'] : null;
        $this->container['peg_price_type'] = isset($data['peg_price_type']) ? $data['peg_price_type'] : null;
        $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null;
        $this->container['settl_currency'] = isset($data['settl_currency']) ? $data['settl_currency'] : null;
        $this->container['ord_type'] = isset($data['ord_type']) ? $data['ord_type'] : null;
        $this->container['time_in_force'] = isset($data['time_in_force']) ? $data['time_in_force'] : null;
        $this->container['exec_inst'] = isset($data['exec_inst']) ? $data['exec_inst'] : null;
        $this->container['contingency_type'] = isset($data['contingency_type']) ? $data['contingency_type'] : null;
        $this->container['ord_status'] = isset($data['ord_status']) ? $data['ord_status'] : null;
        $this->container['triggered'] = isset($data['triggered']) ? $data['triggered'] : null;
        $this->container['working_indicator'] = isset($data['working_indicator']) ? $data['working_indicator'] : null;
        $this->container['ord_rej_reason'] = isset($data['ord_rej_reason']) ? $data['ord_rej_reason'] : null;
        $this->container['leaves_qty'] = isset($data['leaves_qty']) ? $data['leaves_qty'] : null;
        $this->container['cum_qty'] = isset($data['cum_qty']) ? $data['cum_qty'] : null;
        $this->container['avg_px'] = isset($data['avg_px']) ? $data['avg_px'] : null;
        $this->container['text'] = isset($data['text']) ? $data['text'] : null;
        $this->container['transact_time'] = isset($data['transact_time']) ? $data['transact_time'] : null;
        $this->container['timestamp'] = isset($data['timestamp']) ? $data['timestamp'] : null;
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalidProperties = [];

        if ($this->container['order_id'] === null) {
            $invalidProperties[] = "'order_id' can't be null";
        }
        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {
        return count($this->listInvalidProperties()) === 0;
    }


    /**
     * Gets order_id
     *
     * @return string
     */
    public function getOrderId()
    {
        return $this->container['order_id'];
    }

    /**
     * Sets order_id
     *
     * @param string $order_id order_id
     *
     * @return $this
     */
    public function setOrderId($order_id)
    {
        $this->container['order_id'] = $order_id;

        return $this;
    }

    /**
     * Gets cl_ord_id
     *
     * @return string
     */
    public function getClOrdId()
    {
        return $this->container['cl_ord_id'];
    }

    /**
     * Sets cl_ord_id
     *
     * @param string $cl_ord_id cl_ord_id
     *
     * @return $this
     */
    public function setClOrdId($cl_ord_id)
    {
        $this->container['cl_ord_id'] = $cl_ord_id;

        return $this;
    }

    /**
     * Gets cl_ord_link_id
     *
     * @return string
     */
    public function getClOrdLinkId()
    {
        return $this->container['cl_ord_link_id'];
    }

    /**
     * Sets cl_ord_link_id
     *
     * @param string $cl_ord_link_id cl_ord_link_id
     *
     * @return $this
     */
    public function setClOrdLinkId($cl_ord_link_id)
    {
        $this->container['cl_ord_link_id'] = $cl_ord_link_id;

        return $this;
    }

    /**
     * Gets account
     *
     * @return int
     */
    public function getAccount()
    {
        return $this->container['account'];
    }

    /**
     * Sets account
     *
     * @param int $account account
     *
     * @return $this
     */
    public function setAccount($account)
    {
        $this->container['account'] = $account;

        return $this;
    }

    /**
     * Gets symbol
     *
     * @return string
     */
    public function getSymbol()
    {
        return $this->container['symbol'];
    }

    /**
     * Sets symbol
     *
     * @param string $symbol symbol
     *
     * @return $this
     */
    public function setSymbol($symbol)
    {
        $this->container['symbol'] = $symbol;

        return $this;
    }

    /**
     * Gets side
     *
     * @return string
     */
    public function getSide()
    {
        return $this->container['side'];
    }

    /**
     * Sets side
     *
     * @param string $side side
     *
     * @return $this
     */
    public function setSide($side)
    {
        $this->container['side'] = $side;

        return $this;
    }

    /**
     * Gets order_qty
     *
     * @return int
     */
    public function getOrderQty()
    {
        return $this->container['order_qty'];
    }

    /**
     * Sets order_qty
     *
     * @param int $order_qty order_qty
     *
     * @return $this
     */
    public function setOrderQty($order_qty)
    {
        $this->container['order_qty'] = $order_qty;

        return $this;
    }

    /**
     * Gets price
     *
     * @return double
     */
    public function getPrice()
    {
        return $this->container['price'];
    }

    /**
     * Sets price
     *
     * @param double $price price
     *
     * @return $this
     */
    public function setPrice($price)
    {
        $this->container['price'] = $price;

        return $this;
    }

    /**
     * Gets display_qty
     *
     * @return int
     */
    public function getDisplayQty()
    {
        return $this->container['display_qty'];
    }

    /**
     * Sets display_qty
     *
     * @param int $display_qty display_qty
     *
     * @return $this
     */
    public function setDisplayQty($display_qty)
    {
        $this->container['display_qty'] = $display_qty;

        return $this;
    }

    /**
     * Gets stop_px
     *
     * @return double
     */
    public function getStopPx()
    {
        return $this->container['stop_px'];
    }

    /**
     * Sets stop_px
     *
     * @param double $stop_px stop_px
     *
     * @return $this
     */
    public function setStopPx($stop_px)
    {
        $this->container['stop_px'] = $stop_px;

        return $this;
    }

    /**
     * Gets peg_offset_value
     *
     * @return double
     */
    public function getPegOffsetValue()
    {
        return $this->container['peg_offset_value'];
    }

    /**
     * Sets peg_offset_value
     *
     * @param double $peg_offset_value peg_offset_value
     *
     * @return $this
     */
    public function setPegOffsetValue($peg_offset_value)
    {
        $this->container['peg_offset_value'] = $peg_offset_value;

        return $this;
    }

    /**
     * Gets peg_price_type
     *
     * @return string
     */
    public function getPegPriceType()
    {
        return $this->container['peg_price_type'];
    }

    /**
     * Sets peg_price_type
     *
     * @param string $peg_price_type peg_price_type
     *
     * @return $this
     */
    public function setPegPriceType($peg_price_type)
    {
        $this->container['peg_price_type'] = $peg_price_type;

        return $this;
    }

    /**
     * Gets currency
     *
     * @return string
     */
    public function getCurrency()
    {
        return $this->container['currency'];
    }

    /**
     * Sets currency
     *
     * @param string $currency currency
     *
     * @return $this
     */
    public function setCurrency($currency)
    {
        $this->container['currency'] = $currency;

        return $this;
    }

    /**
     * Gets settl_currency
     *
     * @return string
     */
    public function getSettlCurrency()
    {
        return $this->container['settl_currency'];
    }

    /**
     * Sets settl_currency
     *
     * @param string $settl_currency settl_currency
     *
     * @return $this
     */
    public function setSettlCurrency($settl_currency)
    {
        $this->container['settl_currency'] = $settl_currency;

        return $this;
    }

    /**
     * Gets ord_type
     *
     * @return string
     */
    public function getOrdType()
    {
        return $this->container['ord_type'];
    }

    /**
     * Sets ord_type
     *
     * @param string $ord_type ord_type
     *
     * @return $this
     */
    public function setOrdType($ord_type)
    {
        $this->container['ord_type'] = $ord_type;

        return $this;
    }

    /**
     * Gets time_in_force
     *
     * @return string
     */
    public function getTimeInForce()
    {
        return $this->container['time_in_force'];
    }

    /**
     * Sets time_in_force
     *
     * @param string $time_in_force time_in_force
     *
     * @return $this
     */
    public function setTimeInForce($time_in_force)
    {
        $this->container['time_in_force'] = $time_in_force;

        return $this;
    }

    /**
     * Gets exec_inst
     *
     * @return string
     */
    public function getExecInst()
    {
        return $this->container['exec_inst'];
    }

    /**
     * Sets exec_inst
     *
     * @param string $exec_inst exec_inst
     *
     * @return $this
     */
    public function setExecInst($exec_inst)
    {
        $this->container['exec_inst'] = $exec_inst;

        return $this;
    }

    /**
     * Gets contingency_type
     *
     * @return string
     */
    public function getContingencyType()
    {
        return $this->container['contingency_type'];
    }

    /**
     * Sets contingency_type
     *
     * @param string $contingency_type contingency_type
     *
     * @return $this
     */
    public function setContingencyType($contingency_type)
    {
        $this->container['contingency_type'] = $contingency_type;

        return $this;
    }

    /**
     * Gets ord_status
     *
     * @return string
     */
    public function getOrdStatus()
    {
        return $this->container['ord_status'];
    }

    /**
     * Sets ord_status
     *
     * @param string $ord_status ord_status
     *
     * @return $this
     */
    public function setOrdStatus($ord_status)
    {
        $this->container['ord_status'] = $ord_status;

        return $this;
    }

    /**
     * Gets triggered
     *
     * @return string
     */
    public function getTriggered()
    {
        return $this->container['triggered'];
    }

    /**
     * Sets triggered
     *
     * @param string $triggered triggered
     *
     * @return $this
     */
    public function setTriggered($triggered)
    {
        $this->container['triggered'] = $triggered;

        return $this;
    }

    /**
     * Gets working_indicator
     *
     * @return bool
     */
    public function getWorkingIndicator()
    {
        return $this->container['working_indicator'];
    }

    /**
     * Sets working_indicator
     *
     * @param bool $working_indicator working_indicator
     *
     * @return $this
     */
    public function setWorkingIndicator($working_indicator)
    {
        $this->container['working_indicator'] = $working_indicator;

        return $this;
    }

    /**
     * Gets ord_rej_reason
     *
     * @return string
     */
    public function getOrdRejReason()
    {
        return $this->container['ord_rej_reason'];
    }

    /**
     * Sets ord_rej_reason
     *
     * @param string $ord_rej_reason ord_rej_reason
     *
     * @return $this
     */
    public function setOrdRejReason($ord_rej_reason)
    {
        $this->container['ord_rej_reason'] = $ord_rej_reason;

        return $this;
    }

    /**
     * Gets leaves_qty
     *
     * @return int
     */
    public function getLeavesQty()
    {
        return $this->container['leaves_qty'];
    }

    /**
     * Sets leaves_qty
     *
     * @param int $leaves_qty leaves_qty
     *
     * @return $this
     */
    public function setLeavesQty($leaves_qty)
    {
        $this->container['leaves_qty'] = $leaves_qty;

        return $this;
    }

    /**
     * Gets cum_qty
     *
     * @return int
     */
    public function getCumQty()
    {
        return $this->container['cum_qty'];
    }

    /**
     * Sets cum_qty
     *
     * @param int $cum_qty cum_qty
     *
     * @return $this
     */
    public function setCumQty($cum_qty)
    {
        $this->container['cum_qty'] = $cum_qty;

        return $this;
    }

    /**
     * Gets avg_px
     *
     * @return double
     */
    public function getAvgPx()
    {
        return $this->container['avg_px'];
    }

    /**
     * Sets avg_px
     *
     * @param double $avg_px avg_px
     *
     * @return $this
     */
    public function setAvgPx($avg_px)
    {
        $this->container['avg_px'] = $avg_px;

        return $this;
    }

    /**
     * Gets text
     *
     * @return string
     */
    public function getText()
    {
        return $this->container['text'];
    }

    /**
     * Sets text
     *
     * @param string $text text
     *
     * @return $this
     */
    public function setText($text)
    {
        $this->container['text'] = $text;

        return $this;
    }

    /**
     * Gets transact_time
     *
     * @return \DateTime
     */
    public function getTransactTime()
    {
        return $this->container['transact_time'];
    }

    /**
     * Sets transact_time
     *
     * @param \DateTime $transact_time transact_time
     *
     * @return $this
     */
    public function setTransactTime($transact_time)
    {
        $this->container['transact_time'] = $transact_time;

        return $this;
    }

    /**
     * Gets timestamp
     *
     * @return \DateTime
     */
    public function getTimestamp()
    {
        return $this->container['timestamp'];
    }

    /**
     * Sets timestamp
     *
     * @param \DateTime $timestamp timestamp
     *
     * @return $this
     */
    public function setTimestamp($timestamp)
    {
        $this->container['timestamp'] = $timestamp;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param integer $offset Offset
     *
     * @return boolean
     */
    #[\ReturnTypeWillChange]
    public function offsetExists($offset)
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param integer $offset Offset
     *
     * @return mixed
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($offset)
    {
        return isset($this->container[$offset]) ? $this->container[$offset] : null;
    }

    /**
     * Sets value based on offset.
     *
     * @param integer $offset Offset
     * @param mixed   $value  Value to be set
     *
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetSet($offset, $value)
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param integer $offset Offset
     *
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetUnset($offset)
    {
        unset($this->container[$offset]);
    }

    /**
     * Gets the string presentation of the object
     *
     * @return string
     */
    public function __toString()
    {
        if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
            return json_encode(
                ObjectSerializer::sanitizeForSerialization($this),
                JSON_PRETTY_PRINT
            );
        }

        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }
}


