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

/**
 * DefaultLedgerAccounts 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 DefaultLedgerAccounts implements ModelInterface, ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'bank_charges_ledger_account' => '\SageOne\Model\Base',
        'bank_interest_received_ledger_account' => '\SageOne\Model\Base',
        'bank_interest_charges_paid_ledger_account' => '\SageOne\Model\Base',
        'exchange_rate_gains_ledger_account' => '\SageOne\Model\Base',
        'exchange_rate_losses_ledger_account' => '\SageOne\Model\Base',
        'sales_ledger_account' => '\SageOne\Model\Base',
        'sales_discount_ledger_account' => '\SageOne\Model\Base',
        'purchase_ledger_account' => '\SageOne\Model\Base',
        'purchase_discount_ledger_account' => '\SageOne\Model\Base',
        'product_sales_ledger_account' => '\SageOne\Model\Base',
        'product_purchase_ledger_account' => '\SageOne\Model\Base',
        'service_sales_ledger_account' => '\SageOne\Model\Base',
        'service_purchase_ledger_account' => '\SageOne\Model\Base',
        'stock_purchase_ledger_account' => '\SageOne\Model\Base',
        'other_receipt_ledger_account' => '\SageOne\Model\Base',
        'other_payment_ledger_account' => '\SageOne\Model\Base',
        'customer_receipt_discount_ledger_account' => '\SageOne\Model\Base',
        'vendor_payment_discount_ledger_account' => '\SageOne\Model\Base',
        'carriage_ledger_account' => '\SageOne\Model\Base'
    ];

    /**
      * 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 = [
        'bank_charges_ledger_account' => null,
        'bank_interest_received_ledger_account' => null,
        'bank_interest_charges_paid_ledger_account' => null,
        'exchange_rate_gains_ledger_account' => null,
        'exchange_rate_losses_ledger_account' => null,
        'sales_ledger_account' => null,
        'sales_discount_ledger_account' => null,
        'purchase_ledger_account' => null,
        'purchase_discount_ledger_account' => null,
        'product_sales_ledger_account' => null,
        'product_purchase_ledger_account' => null,
        'service_sales_ledger_account' => null,
        'service_purchase_ledger_account' => null,
        'stock_purchase_ledger_account' => null,
        'other_receipt_ledger_account' => null,
        'other_payment_ledger_account' => null,
        'customer_receipt_discount_ledger_account' => null,
        'vendor_payment_discount_ledger_account' => null,
        'carriage_ledger_account' => null
    ];

    /**
     * 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 = [
        'bank_charges_ledger_account' => 'bank_charges_ledger_account',
        'bank_interest_received_ledger_account' => 'bank_interest_received_ledger_account',
        'bank_interest_charges_paid_ledger_account' => 'bank_interest_charges_paid_ledger_account',
        'exchange_rate_gains_ledger_account' => 'exchange_rate_gains_ledger_account',
        'exchange_rate_losses_ledger_account' => 'exchange_rate_losses_ledger_account',
        'sales_ledger_account' => 'sales_ledger_account',
        'sales_discount_ledger_account' => 'sales_discount_ledger_account',
        'purchase_ledger_account' => 'purchase_ledger_account',
        'purchase_discount_ledger_account' => 'purchase_discount_ledger_account',
        'product_sales_ledger_account' => 'product_sales_ledger_account',
        'product_purchase_ledger_account' => 'product_purchase_ledger_account',
        'service_sales_ledger_account' => 'service_sales_ledger_account',
        'service_purchase_ledger_account' => 'service_purchase_ledger_account',
        'stock_purchase_ledger_account' => 'stock_purchase_ledger_account',
        'other_receipt_ledger_account' => 'other_receipt_ledger_account',
        'other_payment_ledger_account' => 'other_payment_ledger_account',
        'customer_receipt_discount_ledger_account' => 'customer_receipt_discount_ledger_account',
        'vendor_payment_discount_ledger_account' => 'vendor_payment_discount_ledger_account',
        'carriage_ledger_account' => 'carriage_ledger_account'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'bank_charges_ledger_account' => 'setBankChargesLedgerAccount',
        'bank_interest_received_ledger_account' => 'setBankInterestReceivedLedgerAccount',
        'bank_interest_charges_paid_ledger_account' => 'setBankInterestChargesPaidLedgerAccount',
        'exchange_rate_gains_ledger_account' => 'setExchangeRateGainsLedgerAccount',
        'exchange_rate_losses_ledger_account' => 'setExchangeRateLossesLedgerAccount',
        'sales_ledger_account' => 'setSalesLedgerAccount',
        'sales_discount_ledger_account' => 'setSalesDiscountLedgerAccount',
        'purchase_ledger_account' => 'setPurchaseLedgerAccount',
        'purchase_discount_ledger_account' => 'setPurchaseDiscountLedgerAccount',
        'product_sales_ledger_account' => 'setProductSalesLedgerAccount',
        'product_purchase_ledger_account' => 'setProductPurchaseLedgerAccount',
        'service_sales_ledger_account' => 'setServiceSalesLedgerAccount',
        'service_purchase_ledger_account' => 'setServicePurchaseLedgerAccount',
        'stock_purchase_ledger_account' => 'setStockPurchaseLedgerAccount',
        'other_receipt_ledger_account' => 'setOtherReceiptLedgerAccount',
        'other_payment_ledger_account' => 'setOtherPaymentLedgerAccount',
        'customer_receipt_discount_ledger_account' => 'setCustomerReceiptDiscountLedgerAccount',
        'vendor_payment_discount_ledger_account' => 'setVendorPaymentDiscountLedgerAccount',
        'carriage_ledger_account' => 'setCarriageLedgerAccount'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'bank_charges_ledger_account' => 'getBankChargesLedgerAccount',
        'bank_interest_received_ledger_account' => 'getBankInterestReceivedLedgerAccount',
        'bank_interest_charges_paid_ledger_account' => 'getBankInterestChargesPaidLedgerAccount',
        'exchange_rate_gains_ledger_account' => 'getExchangeRateGainsLedgerAccount',
        'exchange_rate_losses_ledger_account' => 'getExchangeRateLossesLedgerAccount',
        'sales_ledger_account' => 'getSalesLedgerAccount',
        'sales_discount_ledger_account' => 'getSalesDiscountLedgerAccount',
        'purchase_ledger_account' => 'getPurchaseLedgerAccount',
        'purchase_discount_ledger_account' => 'getPurchaseDiscountLedgerAccount',
        'product_sales_ledger_account' => 'getProductSalesLedgerAccount',
        'product_purchase_ledger_account' => 'getProductPurchaseLedgerAccount',
        'service_sales_ledger_account' => 'getServiceSalesLedgerAccount',
        'service_purchase_ledger_account' => 'getServicePurchaseLedgerAccount',
        'stock_purchase_ledger_account' => 'getStockPurchaseLedgerAccount',
        'other_receipt_ledger_account' => 'getOtherReceiptLedgerAccount',
        'other_payment_ledger_account' => 'getOtherPaymentLedgerAccount',
        'customer_receipt_discount_ledger_account' => 'getCustomerReceiptDiscountLedgerAccount',
        'vendor_payment_discount_ledger_account' => 'getVendorPaymentDiscountLedgerAccount',
        'carriage_ledger_account' => 'getCarriageLedgerAccount'
    ];

    /**
     * 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['bank_charges_ledger_account'] = $data['bank_charges_ledger_account'] ?? null;
        $this->container['bank_interest_received_ledger_account'] = $data['bank_interest_received_ledger_account'] ?? null;
        $this->container['bank_interest_charges_paid_ledger_account'] = $data['bank_interest_charges_paid_ledger_account'] ?? null;
        $this->container['exchange_rate_gains_ledger_account'] = $data['exchange_rate_gains_ledger_account'] ?? null;
        $this->container['exchange_rate_losses_ledger_account'] = $data['exchange_rate_losses_ledger_account'] ?? null;
        $this->container['sales_ledger_account'] = $data['sales_ledger_account'] ?? null;
        $this->container['sales_discount_ledger_account'] = $data['sales_discount_ledger_account'] ?? null;
        $this->container['purchase_ledger_account'] = $data['purchase_ledger_account'] ?? null;
        $this->container['purchase_discount_ledger_account'] = $data['purchase_discount_ledger_account'] ?? null;
        $this->container['product_sales_ledger_account'] = $data['product_sales_ledger_account'] ?? null;
        $this->container['product_purchase_ledger_account'] = $data['product_purchase_ledger_account'] ?? null;
        $this->container['service_sales_ledger_account'] = $data['service_sales_ledger_account'] ?? null;
        $this->container['service_purchase_ledger_account'] = $data['service_purchase_ledger_account'] ?? null;
        $this->container['stock_purchase_ledger_account'] = $data['stock_purchase_ledger_account'] ?? null;
        $this->container['other_receipt_ledger_account'] = $data['other_receipt_ledger_account'] ?? null;
        $this->container['other_payment_ledger_account'] = $data['other_payment_ledger_account'] ?? null;
        $this->container['customer_receipt_discount_ledger_account'] = $data['customer_receipt_discount_ledger_account'] ?? null;
        $this->container['vendor_payment_discount_ledger_account'] = $data['vendor_payment_discount_ledger_account'] ?? null;
        $this->container['carriage_ledger_account'] = $data['carriage_ledger_account'] ?? 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 bank_charges_ledger_account
     *
     * @return \SageOne\Model\Base|null
     */
    public function getBankChargesLedgerAccount()
    {
        return $this->container['bank_charges_ledger_account'];
    }

    /**
     * Sets bank_charges_ledger_account
     *
     * @param \SageOne\Model\Base|null $bank_charges_ledger_account bank_charges_ledger_account
     *
     * @return self
     */
    public function setBankChargesLedgerAccount($bank_charges_ledger_account)
    {
        $this->container['bank_charges_ledger_account'] = $bank_charges_ledger_account;

        return $this;
    }

    /**
     * Gets bank_interest_received_ledger_account
     *
     * @return \SageOne\Model\Base|null
     */
    public function getBankInterestReceivedLedgerAccount()
    {
        return $this->container['bank_interest_received_ledger_account'];
    }

    /**
     * Sets bank_interest_received_ledger_account
     *
     * @param \SageOne\Model\Base|null $bank_interest_received_ledger_account bank_interest_received_ledger_account
     *
     * @return self
     */
    public function setBankInterestReceivedLedgerAccount($bank_interest_received_ledger_account)
    {
        $this->container['bank_interest_received_ledger_account'] = $bank_interest_received_ledger_account;

        return $this;
    }

    /**
     * Gets bank_interest_charges_paid_ledger_account
     *
     * @return \SageOne\Model\Base|null
     */
    public function getBankInterestChargesPaidLedgerAccount()
    {
        return $this->container['bank_interest_charges_paid_ledger_account'];
    }

    /**
     * Sets bank_interest_charges_paid_ledger_account
     *
     * @param \SageOne\Model\Base|null $bank_interest_charges_paid_ledger_account bank_interest_charges_paid_ledger_account
     *
     * @return self
     */
    public function setBankInterestChargesPaidLedgerAccount($bank_interest_charges_paid_ledger_account)
    {
        $this->container['bank_interest_charges_paid_ledger_account'] = $bank_interest_charges_paid_ledger_account;

        return $this;
    }

    /**
     * Gets exchange_rate_gains_ledger_account
     *
     * @return \SageOne\Model\Base|null
     */
    public function getExchangeRateGainsLedgerAccount()
    {
        return $this->container['exchange_rate_gains_ledger_account'];
    }

    /**
     * Sets exchange_rate_gains_ledger_account
     *
     * @param \SageOne\Model\Base|null $exchange_rate_gains_ledger_account exchange_rate_gains_ledger_account
     *
     * @return self
     */
    public function setExchangeRateGainsLedgerAccount($exchange_rate_gains_ledger_account)
    {
        $this->container['exchange_rate_gains_ledger_account'] = $exchange_rate_gains_ledger_account;

        return $this;
    }

    /**
     * Gets exchange_rate_losses_ledger_account
     *
     * @return \SageOne\Model\Base|null
     */
    public function getExchangeRateLossesLedgerAccount()
    {
        return $this->container['exchange_rate_losses_ledger_account'];
    }

    /**
     * Sets exchange_rate_losses_ledger_account
     *
     * @param \SageOne\Model\Base|null $exchange_rate_losses_ledger_account exchange_rate_losses_ledger_account
     *
     * @return self
     */
    public function setExchangeRateLossesLedgerAccount($exchange_rate_losses_ledger_account)
    {
        $this->container['exchange_rate_losses_ledger_account'] = $exchange_rate_losses_ledger_account;

        return $this;
    }

    /**
     * Gets sales_ledger_account
     *
     * @return \SageOne\Model\Base|null
     */
    public function getSalesLedgerAccount()
    {
        return $this->container['sales_ledger_account'];
    }

    /**
     * Sets sales_ledger_account
     *
     * @param \SageOne\Model\Base|null $sales_ledger_account sales_ledger_account
     *
     * @return self
     */
    public function setSalesLedgerAccount($sales_ledger_account)
    {
        $this->container['sales_ledger_account'] = $sales_ledger_account;

        return $this;
    }

    /**
     * Gets sales_discount_ledger_account
     *
     * @return \SageOne\Model\Base|null
     */
    public function getSalesDiscountLedgerAccount()
    {
        return $this->container['sales_discount_ledger_account'];
    }

    /**
     * Sets sales_discount_ledger_account
     *
     * @param \SageOne\Model\Base|null $sales_discount_ledger_account sales_discount_ledger_account
     *
     * @return self
     */
    public function setSalesDiscountLedgerAccount($sales_discount_ledger_account)
    {
        $this->container['sales_discount_ledger_account'] = $sales_discount_ledger_account;

        return $this;
    }

    /**
     * Gets purchase_ledger_account
     *
     * @return \SageOne\Model\Base|null
     */
    public function getPurchaseLedgerAccount()
    {
        return $this->container['purchase_ledger_account'];
    }

    /**
     * Sets purchase_ledger_account
     *
     * @param \SageOne\Model\Base|null $purchase_ledger_account purchase_ledger_account
     *
     * @return self
     */
    public function setPurchaseLedgerAccount($purchase_ledger_account)
    {
        $this->container['purchase_ledger_account'] = $purchase_ledger_account;

        return $this;
    }

    /**
     * Gets purchase_discount_ledger_account
     *
     * @return \SageOne\Model\Base|null
     */
    public function getPurchaseDiscountLedgerAccount()
    {
        return $this->container['purchase_discount_ledger_account'];
    }

    /**
     * Sets purchase_discount_ledger_account
     *
     * @param \SageOne\Model\Base|null $purchase_discount_ledger_account purchase_discount_ledger_account
     *
     * @return self
     */
    public function setPurchaseDiscountLedgerAccount($purchase_discount_ledger_account)
    {
        $this->container['purchase_discount_ledger_account'] = $purchase_discount_ledger_account;

        return $this;
    }

    /**
     * Gets product_sales_ledger_account
     *
     * @return \SageOne\Model\Base|null
     */
    public function getProductSalesLedgerAccount()
    {
        return $this->container['product_sales_ledger_account'];
    }

    /**
     * Sets product_sales_ledger_account
     *
     * @param \SageOne\Model\Base|null $product_sales_ledger_account product_sales_ledger_account
     *
     * @return self
     */
    public function setProductSalesLedgerAccount($product_sales_ledger_account)
    {
        $this->container['product_sales_ledger_account'] = $product_sales_ledger_account;

        return $this;
    }

    /**
     * Gets product_purchase_ledger_account
     *
     * @return \SageOne\Model\Base|null
     */
    public function getProductPurchaseLedgerAccount()
    {
        return $this->container['product_purchase_ledger_account'];
    }

    /**
     * Sets product_purchase_ledger_account
     *
     * @param \SageOne\Model\Base|null $product_purchase_ledger_account product_purchase_ledger_account
     *
     * @return self
     */
    public function setProductPurchaseLedgerAccount($product_purchase_ledger_account)
    {
        $this->container['product_purchase_ledger_account'] = $product_purchase_ledger_account;

        return $this;
    }

    /**
     * Gets service_sales_ledger_account
     *
     * @return \SageOne\Model\Base|null
     */
    public function getServiceSalesLedgerAccount()
    {
        return $this->container['service_sales_ledger_account'];
    }

    /**
     * Sets service_sales_ledger_account
     *
     * @param \SageOne\Model\Base|null $service_sales_ledger_account service_sales_ledger_account
     *
     * @return self
     */
    public function setServiceSalesLedgerAccount($service_sales_ledger_account)
    {
        $this->container['service_sales_ledger_account'] = $service_sales_ledger_account;

        return $this;
    }

    /**
     * Gets service_purchase_ledger_account
     *
     * @return \SageOne\Model\Base|null
     */
    public function getServicePurchaseLedgerAccount()
    {
        return $this->container['service_purchase_ledger_account'];
    }

    /**
     * Sets service_purchase_ledger_account
     *
     * @param \SageOne\Model\Base|null $service_purchase_ledger_account service_purchase_ledger_account
     *
     * @return self
     */
    public function setServicePurchaseLedgerAccount($service_purchase_ledger_account)
    {
        $this->container['service_purchase_ledger_account'] = $service_purchase_ledger_account;

        return $this;
    }

    /**
     * Gets stock_purchase_ledger_account
     *
     * @return \SageOne\Model\Base|null
     */
    public function getStockPurchaseLedgerAccount()
    {
        return $this->container['stock_purchase_ledger_account'];
    }

    /**
     * Sets stock_purchase_ledger_account
     *
     * @param \SageOne\Model\Base|null $stock_purchase_ledger_account stock_purchase_ledger_account
     *
     * @return self
     */
    public function setStockPurchaseLedgerAccount($stock_purchase_ledger_account)
    {
        $this->container['stock_purchase_ledger_account'] = $stock_purchase_ledger_account;

        return $this;
    }

    /**
     * Gets other_receipt_ledger_account
     *
     * @return \SageOne\Model\Base|null
     */
    public function getOtherReceiptLedgerAccount()
    {
        return $this->container['other_receipt_ledger_account'];
    }

    /**
     * Sets other_receipt_ledger_account
     *
     * @param \SageOne\Model\Base|null $other_receipt_ledger_account other_receipt_ledger_account
     *
     * @return self
     */
    public function setOtherReceiptLedgerAccount($other_receipt_ledger_account)
    {
        $this->container['other_receipt_ledger_account'] = $other_receipt_ledger_account;

        return $this;
    }

    /**
     * Gets other_payment_ledger_account
     *
     * @return \SageOne\Model\Base|null
     */
    public function getOtherPaymentLedgerAccount()
    {
        return $this->container['other_payment_ledger_account'];
    }

    /**
     * Sets other_payment_ledger_account
     *
     * @param \SageOne\Model\Base|null $other_payment_ledger_account other_payment_ledger_account
     *
     * @return self
     */
    public function setOtherPaymentLedgerAccount($other_payment_ledger_account)
    {
        $this->container['other_payment_ledger_account'] = $other_payment_ledger_account;

        return $this;
    }

    /**
     * Gets customer_receipt_discount_ledger_account
     *
     * @return \SageOne\Model\Base|null
     */
    public function getCustomerReceiptDiscountLedgerAccount()
    {
        return $this->container['customer_receipt_discount_ledger_account'];
    }

    /**
     * Sets customer_receipt_discount_ledger_account
     *
     * @param \SageOne\Model\Base|null $customer_receipt_discount_ledger_account customer_receipt_discount_ledger_account
     *
     * @return self
     */
    public function setCustomerReceiptDiscountLedgerAccount($customer_receipt_discount_ledger_account)
    {
        $this->container['customer_receipt_discount_ledger_account'] = $customer_receipt_discount_ledger_account;

        return $this;
    }

    /**
     * Gets vendor_payment_discount_ledger_account
     *
     * @return \SageOne\Model\Base|null
     */
    public function getVendorPaymentDiscountLedgerAccount()
    {
        return $this->container['vendor_payment_discount_ledger_account'];
    }

    /**
     * Sets vendor_payment_discount_ledger_account
     *
     * @param \SageOne\Model\Base|null $vendor_payment_discount_ledger_account vendor_payment_discount_ledger_account
     *
     * @return self
     */
    public function setVendorPaymentDiscountLedgerAccount($vendor_payment_discount_ledger_account)
    {
        $this->container['vendor_payment_discount_ledger_account'] = $vendor_payment_discount_ledger_account;

        return $this;
    }

    /**
     * Gets carriage_ledger_account
     *
     * @return \SageOne\Model\Base|null
     */
    public function getCarriageLedgerAccount()
    {
        return $this->container['carriage_ledger_account'];
    }

    /**
     * Sets carriage_ledger_account
     *
     * @param \SageOne\Model\Base|null $carriage_ledger_account carriage_ledger_account
     *
     * @return self
     */
    public function setCarriageLedgerAccount($carriage_ledger_account)
    {
        $this->container['carriage_ledger_account'] = $carriage_ledger_account;

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


