<?php
/**
 * InvoiceResponseReasons
 *
 * PHP version 7.2
 *
 * @category Class
 * @package  EConnect\Psb
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 */

/**
 * PSB API 1.0
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0
 * Contact: techsupport@econnect.eu
 * Generated by: https://openapi-generator.tech
 * OpenAPI Generator version: 5.2.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 EConnect\Psb\Model;

use \ArrayAccess;
use \EConnect\Psb\ObjectSerializer;

/**
 * InvoiceResponseReasons Class Doc Comment
 *
 * @category Class
 * @description Depending on the status code, a clarification may be needed to state the buyer’s reason for the status.                [NON] No Issue. Indicates that receiver of the documents sends the message just to update the status and there are no problems with document processing.    [REF] References incorrect. Indicates that the received document did not contain references as required by the receiver for correctly routing the document for approval or processing.    [LEG] Legal information incorrect. Information in the received document is not according to legal requirements.    [REC] Receiver unknown. The party to which the document is addressed is not known.    [QUA] Item quality insufficient. Unacceptable or incorrect quality.    [DEL] Delivery issues. Delivery proposed or provided is not acceptable.    [PRI] Prices incorrect. Prices not according to previous expectation.    [QTY] Quantity incorrect. Quantity not according to previous expectation.     [ITM] Items incorrect. Items not according to previous expectation.    [PAY] Payment terms incorrect. Payment terms not according to previous expectation.     [UNR] Not recognized. Commercial transaction not recognized.    [FIN] Finance incorrect. Finance terms not according to previous expectation.    [PPD] Partially Paid. Payment is partially but not fully paid.     [OTH] Other. Reason for status is not defined by code.                  Status Clarification Reason list:  ./misc/codeList.html#status-clarification-reason
 * @package  EConnect\Psb
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 * @implements \ArrayAccess<TKey, TValue>
 * @template TKey int|null
 * @template TValue mixed|null
 */
class InvoiceResponseReasons implements ModelInterface, ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'non' => 'string',
        'ref' => 'string',
        'leg' => 'string',
        'cnf' => 'string',
        'rec' => 'string',
        'qua' => 'string',
        'del' => 'string',
        'pri' => 'string',
        'qty' => 'string',
        'itm' => 'string',
        'pay' => 'string',
        'unr' => 'string',
        'fin' => 'string',
        'ppd' => 'string',
        'oth' => 'string'
    ];

    /**
      * 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 = [
        'non' => null,
        'ref' => null,
        'leg' => null,
        'cnf' => null,
        'rec' => null,
        'qua' => null,
        'del' => null,
        'pri' => null,
        'qty' => null,
        'itm' => null,
        'pay' => null,
        'unr' => null,
        'fin' => null,
        'ppd' => null,
        'oth' => 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 = [
        'non' => 'NON',
        'ref' => 'REF',
        'leg' => 'LEG',
        'cnf' => 'CNF',
        'rec' => 'REC',
        'qua' => 'QUA',
        'del' => 'DEL',
        'pri' => 'PRI',
        'qty' => 'QTY',
        'itm' => 'ITM',
        'pay' => 'PAY',
        'unr' => 'UNR',
        'fin' => 'FIN',
        'ppd' => 'PPD',
        'oth' => 'OTH'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'non' => 'setNon',
        'ref' => 'setRef',
        'leg' => 'setLeg',
        'cnf' => 'setCnf',
        'rec' => 'setRec',
        'qua' => 'setQua',
        'del' => 'setDel',
        'pri' => 'setPri',
        'qty' => 'setQty',
        'itm' => 'setItm',
        'pay' => 'setPay',
        'unr' => 'setUnr',
        'fin' => 'setFin',
        'ppd' => 'setPpd',
        'oth' => 'setOth'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'non' => 'getNon',
        'ref' => 'getRef',
        'leg' => 'getLeg',
        'cnf' => 'getCnf',
        'rec' => 'getRec',
        'qua' => 'getQua',
        'del' => 'getDel',
        'pri' => 'getPri',
        'qty' => 'getQty',
        'itm' => 'getItm',
        'pay' => 'getPay',
        'unr' => 'getUnr',
        'fin' => 'getFin',
        'ppd' => 'getPpd',
        'oth' => 'getOth'
    ];

    /**
     * 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['non'] = $data['non'] ?? null;
        $this->container['ref'] = $data['ref'] ?? null;
        $this->container['leg'] = $data['leg'] ?? null;
        $this->container['cnf'] = $data['cnf'] ?? null;
        $this->container['rec'] = $data['rec'] ?? null;
        $this->container['qua'] = $data['qua'] ?? null;
        $this->container['del'] = $data['del'] ?? null;
        $this->container['pri'] = $data['pri'] ?? null;
        $this->container['qty'] = $data['qty'] ?? null;
        $this->container['itm'] = $data['itm'] ?? null;
        $this->container['pay'] = $data['pay'] ?? null;
        $this->container['unr'] = $data['unr'] ?? null;
        $this->container['fin'] = $data['fin'] ?? null;
        $this->container['ppd'] = $data['ppd'] ?? null;
        $this->container['oth'] = $data['oth'] ?? 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 non
     *
     * @return string|null
     */
    public function getNon()
    {
        return $this->container['non'];
    }

    /**
     * Sets non
     *
     * @param string|null $non non
     *
     * @return self
     */
    public function setNon($non)
    {
        $this->container['non'] = $non;

        return $this;
    }

    /**
     * Gets ref
     *
     * @return string|null
     */
    public function getRef()
    {
        return $this->container['ref'];
    }

    /**
     * Sets ref
     *
     * @param string|null $ref ref
     *
     * @return self
     */
    public function setRef($ref)
    {
        $this->container['ref'] = $ref;

        return $this;
    }

    /**
     * Gets leg
     *
     * @return string|null
     */
    public function getLeg()
    {
        return $this->container['leg'];
    }

    /**
     * Sets leg
     *
     * @param string|null $leg leg
     *
     * @return self
     */
    public function setLeg($leg)
    {
        $this->container['leg'] = $leg;

        return $this;
    }

    /**
     * Gets cnf
     *
     * @return string|null
     */
    public function getCnf()
    {
        return $this->container['cnf'];
    }

    /**
     * Sets cnf
     *
     * @param string|null $cnf cnf
     *
     * @return self
     */
    public function setCnf($cnf)
    {
        $this->container['cnf'] = $cnf;

        return $this;
    }

    /**
     * Gets rec
     *
     * @return string|null
     */
    public function getRec()
    {
        return $this->container['rec'];
    }

    /**
     * Sets rec
     *
     * @param string|null $rec rec
     *
     * @return self
     */
    public function setRec($rec)
    {
        $this->container['rec'] = $rec;

        return $this;
    }

    /**
     * Gets qua
     *
     * @return string|null
     */
    public function getQua()
    {
        return $this->container['qua'];
    }

    /**
     * Sets qua
     *
     * @param string|null $qua qua
     *
     * @return self
     */
    public function setQua($qua)
    {
        $this->container['qua'] = $qua;

        return $this;
    }

    /**
     * Gets del
     *
     * @return string|null
     */
    public function getDel()
    {
        return $this->container['del'];
    }

    /**
     * Sets del
     *
     * @param string|null $del del
     *
     * @return self
     */
    public function setDel($del)
    {
        $this->container['del'] = $del;

        return $this;
    }

    /**
     * Gets pri
     *
     * @return string|null
     */
    public function getPri()
    {
        return $this->container['pri'];
    }

    /**
     * Sets pri
     *
     * @param string|null $pri pri
     *
     * @return self
     */
    public function setPri($pri)
    {
        $this->container['pri'] = $pri;

        return $this;
    }

    /**
     * Gets qty
     *
     * @return string|null
     */
    public function getQty()
    {
        return $this->container['qty'];
    }

    /**
     * Sets qty
     *
     * @param string|null $qty qty
     *
     * @return self
     */
    public function setQty($qty)
    {
        $this->container['qty'] = $qty;

        return $this;
    }

    /**
     * Gets itm
     *
     * @return string|null
     */
    public function getItm()
    {
        return $this->container['itm'];
    }

    /**
     * Sets itm
     *
     * @param string|null $itm itm
     *
     * @return self
     */
    public function setItm($itm)
    {
        $this->container['itm'] = $itm;

        return $this;
    }

    /**
     * Gets pay
     *
     * @return string|null
     */
    public function getPay()
    {
        return $this->container['pay'];
    }

    /**
     * Sets pay
     *
     * @param string|null $pay pay
     *
     * @return self
     */
    public function setPay($pay)
    {
        $this->container['pay'] = $pay;

        return $this;
    }

    /**
     * Gets unr
     *
     * @return string|null
     */
    public function getUnr()
    {
        return $this->container['unr'];
    }

    /**
     * Sets unr
     *
     * @param string|null $unr unr
     *
     * @return self
     */
    public function setUnr($unr)
    {
        $this->container['unr'] = $unr;

        return $this;
    }

    /**
     * Gets fin
     *
     * @return string|null
     */
    public function getFin()
    {
        return $this->container['fin'];
    }

    /**
     * Sets fin
     *
     * @param string|null $fin fin
     *
     * @return self
     */
    public function setFin($fin)
    {
        $this->container['fin'] = $fin;

        return $this;
    }

    /**
     * Gets ppd
     *
     * @return string|null
     */
    public function getPpd()
    {
        return $this->container['ppd'];
    }

    /**
     * Sets ppd
     *
     * @param string|null $ppd ppd
     *
     * @return self
     */
    public function setPpd($ppd)
    {
        $this->container['ppd'] = $ppd;

        return $this;
    }

    /**
     * Gets oth
     *
     * @return string|null
     */
    public function getOth()
    {
        return $this->container['oth'];
    }

    /**
     * Sets oth
     *
     * @param string|null $oth oth
     *
     * @return self
     */
    public function setOth($oth)
    {
        $this->container['oth'] = $oth;

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

    /**
     * Gets offset.
     *
     * @param integer $offset Offset
     *
     * @return mixed|null
     */
    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)
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param integer $offset Offset
     *
     * @return void
     */
    public function offsetUnset($offset)
    {
        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.
     */
    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));
    }
}


