<?php
/**
 * Margin
 *
 * 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;

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerTypes = [
        'account' => 'int',
        'currency' => 'string',
        'risk_limit' => 'int',
        'state' => 'string',
        'amount' => 'int',
        'prev_realised_pnl' => 'int',
        'gross_comm' => 'int',
        'gross_open_cost' => 'int',
        'gross_open_premium' => 'int',
        'gross_exec_cost' => 'int',
        'gross_mark_value' => 'int',
        'risk_value' => 'int',
        'init_margin' => 'int',
        'maint_margin' => 'int',
        'target_excess_margin' => 'int',
        'realised_pnl' => 'int',
        'unrealised_pnl' => 'int',
        'wallet_balance' => 'int',
        'margin_balance' => 'int',
        'margin_leverage' => 'double',
        'margin_used_pcnt' => 'double',
        'excess_margin' => 'int',
        'available_margin' => 'int',
        'withdrawable_margin' => 'int',
        'maker_fee_discount' => 'double',
        'taker_fee_discount' => 'double',
        'timestamp' => '\DateTime'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerFormats = [
        'account' => 'int64',
        'currency' => null,
        'risk_limit' => 'int64',
        'state' => null,
        'amount' => 'int64',
        'prev_realised_pnl' => 'int64',
        'gross_comm' => 'int64',
        'gross_open_cost' => 'int64',
        'gross_open_premium' => 'int64',
        'gross_exec_cost' => 'int64',
        'gross_mark_value' => 'int64',
        'risk_value' => 'int64',
        'init_margin' => 'int64',
        'maint_margin' => 'int64',
        'target_excess_margin' => 'int64',
        'realised_pnl' => 'int64',
        'unrealised_pnl' => 'int64',
        'wallet_balance' => 'int64',
        'margin_balance' => 'int64',
        'margin_leverage' => 'double',
        'margin_used_pcnt' => 'double',
        'excess_margin' => 'int64',
        'available_margin' => 'int64',
        'withdrawable_margin' => 'int64',
        'maker_fee_discount' => 'double',
        'taker_fee_discount' => 'double',
        '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 = [
        'account' => 'account',
        'currency' => 'currency',
        'risk_limit' => 'riskLimit',
        'state' => 'state',
        'amount' => 'amount',
        'prev_realised_pnl' => 'prevRealisedPnl',
        'gross_comm' => 'grossComm',
        'gross_open_cost' => 'grossOpenCost',
        'gross_open_premium' => 'grossOpenPremium',
        'gross_exec_cost' => 'grossExecCost',
        'gross_mark_value' => 'grossMarkValue',
        'risk_value' => 'riskValue',
        'init_margin' => 'initMargin',
        'maint_margin' => 'maintMargin',
        'target_excess_margin' => 'targetExcessMargin',
        'realised_pnl' => 'realisedPnl',
        'unrealised_pnl' => 'unrealisedPnl',
        'wallet_balance' => 'walletBalance',
        'margin_balance' => 'marginBalance',
        'margin_leverage' => 'marginLeverage',
        'margin_used_pcnt' => 'marginUsedPcnt',
        'excess_margin' => 'excessMargin',
        'available_margin' => 'availableMargin',
        'withdrawable_margin' => 'withdrawableMargin',
        'maker_fee_discount' => 'makerFeeDiscount',
        'taker_fee_discount' => 'takerFeeDiscount',
        'timestamp' => 'timestamp'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'account' => 'setAccount',
        'currency' => 'setCurrency',
        'risk_limit' => 'setRiskLimit',
        'state' => 'setState',
        'amount' => 'setAmount',
        'prev_realised_pnl' => 'setPrevRealisedPnl',
        'gross_comm' => 'setGrossComm',
        'gross_open_cost' => 'setGrossOpenCost',
        'gross_open_premium' => 'setGrossOpenPremium',
        'gross_exec_cost' => 'setGrossExecCost',
        'gross_mark_value' => 'setGrossMarkValue',
        'risk_value' => 'setRiskValue',
        'init_margin' => 'setInitMargin',
        'maint_margin' => 'setMaintMargin',
        'target_excess_margin' => 'setTargetExcessMargin',
        'realised_pnl' => 'setRealisedPnl',
        'unrealised_pnl' => 'setUnrealisedPnl',
        'wallet_balance' => 'setWalletBalance',
        'margin_balance' => 'setMarginBalance',
        'margin_leverage' => 'setMarginLeverage',
        'margin_used_pcnt' => 'setMarginUsedPcnt',
        'excess_margin' => 'setExcessMargin',
        'available_margin' => 'setAvailableMargin',
        'withdrawable_margin' => 'setWithdrawableMargin',
        'maker_fee_discount' => 'setMakerFeeDiscount',
        'taker_fee_discount' => 'setTakerFeeDiscount',
        'timestamp' => 'setTimestamp'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'account' => 'getAccount',
        'currency' => 'getCurrency',
        'risk_limit' => 'getRiskLimit',
        'state' => 'getState',
        'amount' => 'getAmount',
        'prev_realised_pnl' => 'getPrevRealisedPnl',
        'gross_comm' => 'getGrossComm',
        'gross_open_cost' => 'getGrossOpenCost',
        'gross_open_premium' => 'getGrossOpenPremium',
        'gross_exec_cost' => 'getGrossExecCost',
        'gross_mark_value' => 'getGrossMarkValue',
        'risk_value' => 'getRiskValue',
        'init_margin' => 'getInitMargin',
        'maint_margin' => 'getMaintMargin',
        'target_excess_margin' => 'getTargetExcessMargin',
        'realised_pnl' => 'getRealisedPnl',
        'unrealised_pnl' => 'getUnrealisedPnl',
        'wallet_balance' => 'getWalletBalance',
        'margin_balance' => 'getMarginBalance',
        'margin_leverage' => 'getMarginLeverage',
        'margin_used_pcnt' => 'getMarginUsedPcnt',
        'excess_margin' => 'getExcessMargin',
        'available_margin' => 'getAvailableMargin',
        'withdrawable_margin' => 'getWithdrawableMargin',
        'maker_fee_discount' => 'getMakerFeeDiscount',
        'taker_fee_discount' => 'getTakerFeeDiscount',
        '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['account'] = isset($data['account']) ? $data['account'] : 0;
        $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null;
        $this->container['risk_limit'] = isset($data['risk_limit']) ? $data['risk_limit'] : 0;
        $this->container['state'] = isset($data['state']) ? $data['state'] : null;
        $this->container['amount'] = isset($data['amount']) ? $data['amount'] : 0;
        $this->container['prev_realised_pnl'] = isset($data['prev_realised_pnl']) ? $data['prev_realised_pnl'] : 0;
        $this->container['gross_comm'] = isset($data['gross_comm']) ? $data['gross_comm'] : 0;
        $this->container['gross_open_cost'] = isset($data['gross_open_cost']) ? $data['gross_open_cost'] : 0;
        $this->container['gross_open_premium'] = isset($data['gross_open_premium']) ? $data['gross_open_premium'] : 0;
        $this->container['gross_exec_cost'] = isset($data['gross_exec_cost']) ? $data['gross_exec_cost'] : 0;
        $this->container['gross_mark_value'] = isset($data['gross_mark_value']) ? $data['gross_mark_value'] : 0;
        $this->container['risk_value'] = isset($data['risk_value']) ? $data['risk_value'] : 0;
        $this->container['init_margin'] = isset($data['init_margin']) ? $data['init_margin'] : 0;
        $this->container['maint_margin'] = isset($data['maint_margin']) ? $data['maint_margin'] : 0;
        $this->container['target_excess_margin'] = isset($data['target_excess_margin']) ? $data['target_excess_margin'] : 0;
        $this->container['realised_pnl'] = isset($data['realised_pnl']) ? $data['realised_pnl'] : 0;
        $this->container['unrealised_pnl'] = isset($data['unrealised_pnl']) ? $data['unrealised_pnl'] : 0;
        $this->container['wallet_balance'] = isset($data['wallet_balance']) ? $data['wallet_balance'] : 0;
        $this->container['margin_balance'] = isset($data['margin_balance']) ? $data['margin_balance'] : 0;
        $this->container['margin_leverage'] = isset($data['margin_leverage']) ? $data['margin_leverage'] : 0.0;
        $this->container['margin_used_pcnt'] = isset($data['margin_used_pcnt']) ? $data['margin_used_pcnt'] : 0.0;
        $this->container['excess_margin'] = isset($data['excess_margin']) ? $data['excess_margin'] : 0;
        $this->container['available_margin'] = isset($data['available_margin']) ? $data['available_margin'] : 0;
        $this->container['withdrawable_margin'] = isset($data['withdrawable_margin']) ? $data['withdrawable_margin'] : 0;
        $this->container['maker_fee_discount'] = isset($data['maker_fee_discount']) ? $data['maker_fee_discount'] : 0.0;
        $this->container['taker_fee_discount'] = isset($data['taker_fee_discount']) ? $data['taker_fee_discount'] : 0.0;
        $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['account'] === null) {
            $invalidProperties[] = "'account' can't be null";
        }
        if ($this->container['currency'] === null) {
            $invalidProperties[] = "'currency' 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 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 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 risk_limit
     *
     * @return int
     */
    public function getRiskLimit()
    {
        return $this->container['risk_limit'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        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));
    }
}


