<?php
/**
 * PostMigrationTaxReturnsMigrationTaxReturnIe
 *
 * PHP version 7.4
 *
 * @category Class
 * @package  SageOne
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 */

/**
 * Sage Business Cloud Accounting - Accounts
 *
 * Documentation of the Sage Business Cloud Accounting API.
 *
 * The version of the OpenAPI document: 3.1
 * Generated by: https://openapi-generator.tech
 * OpenAPI Generator version: 6.0.0
 */

/**
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

namespace SageOne\Model;

use \ArrayAccess;
use \SageOne\ObjectSerializer;

/**
 * PostMigrationTaxReturnsMigrationTaxReturnIe Class Doc Comment
 *
 * @category Class
 * @package  SageOne
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 * @implements \ArrayAccess<TKey, TValue>
 * @template TKey int|null
 * @template TValue mixed|null
 */
class PostMigrationTaxReturnsMigrationTaxReturnIe implements ModelInterface, ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'box_t1' => 'double',
        'box_t2' => 'double',
        'box_t3' => 'double',
        'box_t4' => 'double',
        'box_e1' => 'double',
        'box_e2' => 'double',
        'box_es1' => 'double',
        'box_es2' => 'double'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      * @phpstan-var array<string, string|null>
      * @psalm-var array<string, string|null>
      */
    protected static $openAPIFormats = [
        'box_t1' => 'double',
        'box_t2' => 'double',
        'box_t3' => 'double',
        'box_t4' => 'double',
        'box_e1' => 'double',
        'box_e2' => 'double',
        'box_es1' => 'double',
        'box_es2' => 'double'
    ];

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

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

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'box_t1' => 'box_T1',
        'box_t2' => 'box_T2',
        'box_t3' => 'box_T3',
        'box_t4' => 'box_T4',
        'box_e1' => 'box_E1',
        'box_e2' => 'box_E2',
        'box_es1' => 'box_ES1',
        'box_es2' => 'box_ES2'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'box_t1' => 'setBoxT1',
        'box_t2' => 'setBoxT2',
        'box_t3' => 'setBoxT3',
        'box_t4' => 'setBoxT4',
        'box_e1' => 'setBoxE1',
        'box_e2' => 'setBoxE2',
        'box_es1' => 'setBoxEs1',
        'box_es2' => 'setBoxEs2'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'box_t1' => 'getBoxT1',
        'box_t2' => 'getBoxT2',
        'box_t3' => 'getBoxT3',
        'box_t4' => 'getBoxT4',
        'box_e1' => 'getBoxE1',
        'box_e2' => 'getBoxE2',
        'box_es1' => 'getBoxEs1',
        'box_es2' => 'getBoxEs2'
    ];

    /**
     * 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::$openAPIModelName;
    }


    /**
     * 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['box_t1'] = $data['box_t1'] ?? null;
        $this->container['box_t2'] = $data['box_t2'] ?? null;
        $this->container['box_t3'] = $data['box_t3'] ?? null;
        $this->container['box_t4'] = $data['box_t4'] ?? null;
        $this->container['box_e1'] = $data['box_e1'] ?? null;
        $this->container['box_e2'] = $data['box_e2'] ?? null;
        $this->container['box_es1'] = $data['box_es1'] ?? null;
        $this->container['box_es2'] = $data['box_es2'] ?? null;
    }

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

        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 box_t1
     *
     * @return double|null
     */
    public function getBoxT1()
    {
        return $this->container['box_t1'];
    }

    /**
     * Sets box_t1
     *
     * @param double|null $box_t1 The value of box T1
     *
     * @return self
     */
    public function setBoxT1($box_t1)
    {
        $this->container['box_t1'] = $box_t1;

        return $this;
    }

    /**
     * Gets box_t2
     *
     * @return double|null
     */
    public function getBoxT2()
    {
        return $this->container['box_t2'];
    }

    /**
     * Sets box_t2
     *
     * @param double|null $box_t2 The value of box T2
     *
     * @return self
     */
    public function setBoxT2($box_t2)
    {
        $this->container['box_t2'] = $box_t2;

        return $this;
    }

    /**
     * Gets box_t3
     *
     * @return double|null
     */
    public function getBoxT3()
    {
        return $this->container['box_t3'];
    }

    /**
     * Sets box_t3
     *
     * @param double|null $box_t3 The value of box T3
     *
     * @return self
     */
    public function setBoxT3($box_t3)
    {
        $this->container['box_t3'] = $box_t3;

        return $this;
    }

    /**
     * Gets box_t4
     *
     * @return double|null
     */
    public function getBoxT4()
    {
        return $this->container['box_t4'];
    }

    /**
     * Sets box_t4
     *
     * @param double|null $box_t4 The value of box T4
     *
     * @return self
     */
    public function setBoxT4($box_t4)
    {
        $this->container['box_t4'] = $box_t4;

        return $this;
    }

    /**
     * Gets box_e1
     *
     * @return double|null
     */
    public function getBoxE1()
    {
        return $this->container['box_e1'];
    }

    /**
     * Sets box_e1
     *
     * @param double|null $box_e1 The value of box E1
     *
     * @return self
     */
    public function setBoxE1($box_e1)
    {
        $this->container['box_e1'] = $box_e1;

        return $this;
    }

    /**
     * Gets box_e2
     *
     * @return double|null
     */
    public function getBoxE2()
    {
        return $this->container['box_e2'];
    }

    /**
     * Sets box_e2
     *
     * @param double|null $box_e2 The value of box E2
     *
     * @return self
     */
    public function setBoxE2($box_e2)
    {
        $this->container['box_e2'] = $box_e2;

        return $this;
    }

    /**
     * Gets box_es1
     *
     * @return double|null
     */
    public function getBoxEs1()
    {
        return $this->container['box_es1'];
    }

    /**
     * Sets box_es1
     *
     * @param double|null $box_es1 The value of box ES1
     *
     * @return self
     */
    public function setBoxEs1($box_es1)
    {
        $this->container['box_es1'] = $box_es1;

        return $this;
    }

    /**
     * Gets box_es2
     *
     * @return double|null
     */
    public function getBoxEs2()
    {
        return $this->container['box_es2'];
    }

    /**
     * Sets box_es2
     *
     * @param double|null $box_es2 The value of box ES2
     *
     * @return self
     */
    public function setBoxEs2($box_es2)
    {
        $this->container['box_es2'] = $box_es2;

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

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

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

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

    /**
     * Serializes the object to a value that can be serialized natively by json_encode().
     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
     *
     * @return mixed Returns data which can be serialized by json_encode(), which is a value
     * of any type other than a resource.
     */
    #[\ReturnTypeWillChange]
    public function jsonSerialize()
    {
       return ObjectSerializer::sanitizeForSerialization($this);
    }

    /**
     * Gets the string presentation of the object
     *
     * @return string
     */
    public function __toString()
    {
        return json_encode(
            ObjectSerializer::sanitizeForSerialization($this),
            JSON_PRETTY_PRINT
        );
    }

    /**
     * Gets a header-safe presentation of the object
     *
     * @return string
     */
    public function toHeaderValue()
    {
        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }
}


