<?php

/**
 * Authorization webhooks
 *
 * The version of the OpenAPI document: 4
 * Generated by: https://openapi-generator.tech
 * OpenAPI Generator version: 6.0.1
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


namespace Adyen\Model\RelayedAuthorizationWebhooks;

use ArrayAccess;
use Adyen\Model\RelayedAuthorizationWebhooks\ObjectSerializer;

/**
 * RelayedAuthorisationRequest Class Doc Comment
 *
 * @package  Adyen
 * @implements ArrayAccess<string, mixed>
 */
class RelayedAuthorisationRequest implements ModelInterface, ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'accountHolder' => '\Adyen\Model\RelayedAuthorizationWebhooks\ResourceReference',
        'amount' => '\Adyen\Model\RelayedAuthorizationWebhooks\Amount',
        'amountAdjustments' => '\Adyen\Model\RelayedAuthorizationWebhooks\AmountAdjustment[]',
        'authCode' => 'string',
        'authorisationDecision' => '\Adyen\Model\RelayedAuthorizationWebhooks\AuthorisationDecisionRequest',
        'authorisationType' => 'string',
        'balanceAccount' => '\Adyen\Model\RelayedAuthorizationWebhooks\ResourceReference',
        'balanceMutations' => '\Adyen\Model\RelayedAuthorizationWebhooks\BalanceMutation[]',
        'balancePlatform' => 'string',
        'entryMode' => 'string',
        'environment' => 'string',
        'id' => 'string',
        'merchantData' => '\Adyen\Model\RelayedAuthorizationWebhooks\MerchantData',
        'originalAmount' => '\Adyen\Model\RelayedAuthorizationWebhooks\Amount',
        'paymentInstrument' => '\Adyen\Model\RelayedAuthorizationWebhooks\PaymentInstrument',
        'processingType' => 'string',
        'reference' => 'string',
        'schemeRiskScore' => 'int',
        'schemeTraceId' => 'string',
        'schemeUniqueTransactionId' => 'string',
        'scores' => '\Adyen\Model\RelayedAuthorizationWebhooks\TransactionScoring[]',
        'threeDSecure' => '\Adyen\Model\RelayedAuthorizationWebhooks\ThreeDSecure',
        'transactionRulesResult' => '\Adyen\Model\RelayedAuthorizationWebhooks\TransactionRulesResult',
        'type' => 'string',
        'validationResult' => '\Adyen\Model\RelayedAuthorizationWebhooks\ValidationResult[]'
    ];

    /**
      * 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 = [
        'accountHolder' => null,
        'amount' => null,
        'amountAdjustments' => null,
        'authCode' => null,
        'authorisationDecision' => null,
        'authorisationType' => null,
        'balanceAccount' => null,
        'balanceMutations' => null,
        'balancePlatform' => null,
        'entryMode' => null,
        'environment' => null,
        'id' => null,
        'merchantData' => null,
        'originalAmount' => null,
        'paymentInstrument' => null,
        'processingType' => null,
        'reference' => null,
        'schemeRiskScore' => 'int32',
        'schemeTraceId' => null,
        'schemeUniqueTransactionId' => null,
        'scores' => null,
        'threeDSecure' => null,
        'transactionRulesResult' => null,
        'type' => null,
        'validationResult' => null
    ];

    /**
      * Array of nullable properties. Used for (de)serialization
      *
      * @var boolean[]
      */
    protected static $openAPINullables = [
        'accountHolder' => false,
        'amount' => false,
        'amountAdjustments' => false,
        'authCode' => false,
        'authorisationDecision' => false,
        'authorisationType' => false,
        'balanceAccount' => false,
        'balanceMutations' => false,
        'balancePlatform' => false,
        'entryMode' => false,
        'environment' => false,
        'id' => false,
        'merchantData' => false,
        'originalAmount' => false,
        'paymentInstrument' => false,
        'processingType' => false,
        'reference' => false,
        'schemeRiskScore' => true,
        'schemeTraceId' => false,
        'schemeUniqueTransactionId' => false,
        'scores' => false,
        'threeDSecure' => false,
        'transactionRulesResult' => false,
        'type' => false,
        'validationResult' => false
    ];

    /**
      * If a nullable field gets set to null, insert it here
      *
      * @var boolean[]
      */
    protected $openAPINullablesSetToNull = [];

    /**
     * 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 nullable properties
     *
     * @return array
     */
    protected static function openAPINullables(): array
    {
        return self::$openAPINullables;
    }

    /**
     * Array of nullable field names deliberately set to null
     *
     * @return boolean[]
     */
    private function getOpenAPINullablesSetToNull(): array
    {
        return $this->openAPINullablesSetToNull;
    }

    /**
     * Setter - Array of nullable field names deliberately set to null
     *
     * @param boolean[] $openAPINullablesSetToNull
     */
    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
    {
        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
    }

    /**
     * Checks if a property is nullable
     *
     * @param string $property
     * @return bool
     */
    public static function isNullable(string $property): bool
    {
        return self::openAPINullables()[$property] ?? false;
    }

    /**
     * Checks if a nullable property is set to null.
     *
     * @param string $property
     * @return bool
     */
    public function isNullableSetToNull(string $property): bool
    {
        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'accountHolder' => 'accountHolder',
        'amount' => 'amount',
        'amountAdjustments' => 'amountAdjustments',
        'authCode' => 'authCode',
        'authorisationDecision' => 'authorisationDecision',
        'authorisationType' => 'authorisationType',
        'balanceAccount' => 'balanceAccount',
        'balanceMutations' => 'balanceMutations',
        'balancePlatform' => 'balancePlatform',
        'entryMode' => 'entryMode',
        'environment' => 'environment',
        'id' => 'id',
        'merchantData' => 'merchantData',
        'originalAmount' => 'originalAmount',
        'paymentInstrument' => 'paymentInstrument',
        'processingType' => 'processingType',
        'reference' => 'reference',
        'schemeRiskScore' => 'schemeRiskScore',
        'schemeTraceId' => 'schemeTraceId',
        'schemeUniqueTransactionId' => 'schemeUniqueTransactionId',
        'scores' => 'scores',
        'threeDSecure' => 'threeDSecure',
        'transactionRulesResult' => 'transactionRulesResult',
        'type' => 'type',
        'validationResult' => 'validationResult'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'accountHolder' => 'setAccountHolder',
        'amount' => 'setAmount',
        'amountAdjustments' => 'setAmountAdjustments',
        'authCode' => 'setAuthCode',
        'authorisationDecision' => 'setAuthorisationDecision',
        'authorisationType' => 'setAuthorisationType',
        'balanceAccount' => 'setBalanceAccount',
        'balanceMutations' => 'setBalanceMutations',
        'balancePlatform' => 'setBalancePlatform',
        'entryMode' => 'setEntryMode',
        'environment' => 'setEnvironment',
        'id' => 'setId',
        'merchantData' => 'setMerchantData',
        'originalAmount' => 'setOriginalAmount',
        'paymentInstrument' => 'setPaymentInstrument',
        'processingType' => 'setProcessingType',
        'reference' => 'setReference',
        'schemeRiskScore' => 'setSchemeRiskScore',
        'schemeTraceId' => 'setSchemeTraceId',
        'schemeUniqueTransactionId' => 'setSchemeUniqueTransactionId',
        'scores' => 'setScores',
        'threeDSecure' => 'setThreeDSecure',
        'transactionRulesResult' => 'setTransactionRulesResult',
        'type' => 'setType',
        'validationResult' => 'setValidationResult'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'accountHolder' => 'getAccountHolder',
        'amount' => 'getAmount',
        'amountAdjustments' => 'getAmountAdjustments',
        'authCode' => 'getAuthCode',
        'authorisationDecision' => 'getAuthorisationDecision',
        'authorisationType' => 'getAuthorisationType',
        'balanceAccount' => 'getBalanceAccount',
        'balanceMutations' => 'getBalanceMutations',
        'balancePlatform' => 'getBalancePlatform',
        'entryMode' => 'getEntryMode',
        'environment' => 'getEnvironment',
        'id' => 'getId',
        'merchantData' => 'getMerchantData',
        'originalAmount' => 'getOriginalAmount',
        'paymentInstrument' => 'getPaymentInstrument',
        'processingType' => 'getProcessingType',
        'reference' => 'getReference',
        'schemeRiskScore' => 'getSchemeRiskScore',
        'schemeTraceId' => 'getSchemeTraceId',
        'schemeUniqueTransactionId' => 'getSchemeUniqueTransactionId',
        'scores' => 'getScores',
        'threeDSecure' => 'getThreeDSecure',
        'transactionRulesResult' => 'getTransactionRulesResult',
        'type' => 'getType',
        'validationResult' => 'getValidationResult'
    ];

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

    public const TYPE_BALANCE_PLATFORM_AUTHORISATION_RELAYED = 'balancePlatform.authorisation.relayed';

    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getTypeAllowableValues()
    {
        return [
            self::TYPE_BALANCE_PLATFORM_AUTHORISATION_RELAYED,
        ];
    }
    /**
     * 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->setIfExists('accountHolder', $data ?? [], null);
        $this->setIfExists('amount', $data ?? [], null);
        $this->setIfExists('amountAdjustments', $data ?? [], null);
        $this->setIfExists('authCode', $data ?? [], null);
        $this->setIfExists('authorisationDecision', $data ?? [], null);
        $this->setIfExists('authorisationType', $data ?? [], null);
        $this->setIfExists('balanceAccount', $data ?? [], null);
        $this->setIfExists('balanceMutations', $data ?? [], null);
        $this->setIfExists('balancePlatform', $data ?? [], null);
        $this->setIfExists('entryMode', $data ?? [], null);
        $this->setIfExists('environment', $data ?? [], null);
        $this->setIfExists('id', $data ?? [], null);
        $this->setIfExists('merchantData', $data ?? [], null);
        $this->setIfExists('originalAmount', $data ?? [], null);
        $this->setIfExists('paymentInstrument', $data ?? [], null);
        $this->setIfExists('processingType', $data ?? [], null);
        $this->setIfExists('reference', $data ?? [], null);
        $this->setIfExists('schemeRiskScore', $data ?? [], null);
        $this->setIfExists('schemeTraceId', $data ?? [], null);
        $this->setIfExists('schemeUniqueTransactionId', $data ?? [], null);
        $this->setIfExists('scores', $data ?? [], null);
        $this->setIfExists('threeDSecure', $data ?? [], null);
        $this->setIfExists('transactionRulesResult', $data ?? [], null);
        $this->setIfExists('type', $data ?? [], null);
        $this->setIfExists('validationResult', $data ?? [], null);
    }

    /**
    * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
    * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
    * $this->openAPINullablesSetToNull array
    *
    * @param string $variableName
    * @param array  $fields
    * @param mixed  $defaultValue
    */
    private function setIfExists(string $variableName, array $fields, $defaultValue): void
    {
        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
            $this->openAPINullablesSetToNull[] = $variableName;
        }

        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
    }

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

        $allowedValues = $this->getTypeAllowableValues();
        if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {
            $invalidProperties[] = sprintf(
                "invalid value '%s' for 'type', must be one of '%s'",
                $this->container['type'],
                implode("', '", $allowedValues)
            );
        }

        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 accountHolder
     *
     * @return \Adyen\Model\RelayedAuthorizationWebhooks\ResourceReference|null
     */
    public function getAccountHolder()
    {
        return $this->container['accountHolder'];
    }

    /**
     * Sets accountHolder
     *
     * @param \Adyen\Model\RelayedAuthorizationWebhooks\ResourceReference|null $accountHolder accountHolder
     *
     * @return self
     */
    public function setAccountHolder($accountHolder)
    {
        $this->container['accountHolder'] = $accountHolder;

        return $this;
    }

    /**
     * Gets amount
     *
     * @return \Adyen\Model\RelayedAuthorizationWebhooks\Amount|null
     */
    public function getAmount()
    {
        return $this->container['amount'];
    }

    /**
     * Sets amount
     *
     * @param \Adyen\Model\RelayedAuthorizationWebhooks\Amount|null $amount amount
     *
     * @return self
     */
    public function setAmount($amount)
    {
        $this->container['amount'] = $amount;

        return $this;
    }

    /**
     * Gets amountAdjustments
     *
     * @return \Adyen\Model\RelayedAuthorizationWebhooks\AmountAdjustment[]|null
     */
    public function getAmountAdjustments()
    {
        return $this->container['amountAdjustments'];
    }

    /**
     * Sets amountAdjustments
     *
     * @param \Adyen\Model\RelayedAuthorizationWebhooks\AmountAdjustment[]|null $amountAdjustments The amount adjustments in the transaction.
     *
     * @return self
     */
    public function setAmountAdjustments($amountAdjustments)
    {
        $this->container['amountAdjustments'] = $amountAdjustments;

        return $this;
    }

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

    /**
     * Sets authCode
     *
     * @param string|null $authCode The authorization code for the payment.
     *
     * @return self
     */
    public function setAuthCode($authCode)
    {
        $this->container['authCode'] = $authCode;

        return $this;
    }

    /**
     * Gets authorisationDecision
     *
     * @return \Adyen\Model\RelayedAuthorizationWebhooks\AuthorisationDecisionRequest|null
     */
    public function getAuthorisationDecision()
    {
        return $this->container['authorisationDecision'];
    }

    /**
     * Sets authorisationDecision
     *
     * @param \Adyen\Model\RelayedAuthorizationWebhooks\AuthorisationDecisionRequest|null $authorisationDecision authorisationDecision
     *
     * @return self
     */
    public function setAuthorisationDecision($authorisationDecision)
    {
        $this->container['authorisationDecision'] = $authorisationDecision;

        return $this;
    }

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

    /**
     * Sets authorisationType
     *
     * @param string|null $authorisationType The authorization type.  Possible values: * **finalAuthorisation** * **preAuthorisation** * **defaultAuthorisation**
     *
     * @return self
     */
    public function setAuthorisationType($authorisationType)
    {
        $this->container['authorisationType'] = $authorisationType;

        return $this;
    }

    /**
     * Gets balanceAccount
     *
     * @return \Adyen\Model\RelayedAuthorizationWebhooks\ResourceReference|null
     */
    public function getBalanceAccount()
    {
        return $this->container['balanceAccount'];
    }

    /**
     * Sets balanceAccount
     *
     * @param \Adyen\Model\RelayedAuthorizationWebhooks\ResourceReference|null $balanceAccount balanceAccount
     *
     * @return self
     */
    public function setBalanceAccount($balanceAccount)
    {
        $this->container['balanceAccount'] = $balanceAccount;

        return $this;
    }

    /**
     * Gets balanceMutations
     *
     * @return \Adyen\Model\RelayedAuthorizationWebhooks\BalanceMutation[]|null
     */
    public function getBalanceMutations()
    {
        return $this->container['balanceMutations'];
    }

    /**
     * Sets balanceMutations
     *
     * @param \Adyen\Model\RelayedAuthorizationWebhooks\BalanceMutation[]|null $balanceMutations The list of balance mutations per event.
     *
     * @return self
     */
    public function setBalanceMutations($balanceMutations)
    {
        $this->container['balanceMutations'] = $balanceMutations;

        return $this;
    }

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

    /**
     * Sets balancePlatform
     *
     * @param string|null $balancePlatform The unique identifier of the balance platform.
     *
     * @return self
     */
    public function setBalancePlatform($balancePlatform)
    {
        $this->container['balancePlatform'] = $balancePlatform;

        return $this;
    }

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

    /**
     * Sets entryMode
     *
     * @param string|null $entryMode The entry mode of the information of the payment instrument. For example: **contactless**, **chip**, **magstripe**.
     *
     * @return self
     */
    public function setEntryMode($entryMode)
    {
        $this->container['entryMode'] = $entryMode;

        return $this;
    }

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

    /**
     * Sets environment
     *
     * @param string|null $environment The environment from which the webhook originated. Possible values: **test**, **live**.
     *
     * @return self
     */
    public function setEnvironment($environment)
    {
        $this->container['environment'] = $environment;

        return $this;
    }

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

    /**
     * Sets id
     *
     * @param string|null $id The unique identifier of the transfer.
     *
     * @return self
     */
    public function setId($id)
    {
        $this->container['id'] = $id;

        return $this;
    }

    /**
     * Gets merchantData
     *
     * @return \Adyen\Model\RelayedAuthorizationWebhooks\MerchantData|null
     */
    public function getMerchantData()
    {
        return $this->container['merchantData'];
    }

    /**
     * Sets merchantData
     *
     * @param \Adyen\Model\RelayedAuthorizationWebhooks\MerchantData|null $merchantData merchantData
     *
     * @return self
     */
    public function setMerchantData($merchantData)
    {
        $this->container['merchantData'] = $merchantData;

        return $this;
    }

    /**
     * Gets originalAmount
     *
     * @return \Adyen\Model\RelayedAuthorizationWebhooks\Amount|null
     */
    public function getOriginalAmount()
    {
        return $this->container['originalAmount'];
    }

    /**
     * Sets originalAmount
     *
     * @param \Adyen\Model\RelayedAuthorizationWebhooks\Amount|null $originalAmount originalAmount
     *
     * @return self
     */
    public function setOriginalAmount($originalAmount)
    {
        $this->container['originalAmount'] = $originalAmount;

        return $this;
    }

    /**
     * Gets paymentInstrument
     *
     * @return \Adyen\Model\RelayedAuthorizationWebhooks\PaymentInstrument|null
     */
    public function getPaymentInstrument()
    {
        return $this->container['paymentInstrument'];
    }

    /**
     * Sets paymentInstrument
     *
     * @param \Adyen\Model\RelayedAuthorizationWebhooks\PaymentInstrument|null $paymentInstrument paymentInstrument
     *
     * @return self
     */
    public function setPaymentInstrument($paymentInstrument)
    {
        $this->container['paymentInstrument'] = $paymentInstrument;

        return $this;
    }

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

    /**
     * Sets processingType
     *
     * @param string|null $processingType The processing type used for this payment. For example: **ecommerce**, **pos**, **moto**.
     *
     * @return self
     */
    public function setProcessingType($processingType)
    {
        $this->container['processingType'] = $processingType;

        return $this;
    }

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

    /**
     * Sets reference
     *
     * @param string|null $reference The reference of the payment.
     *
     * @return self
     */
    public function setReference($reference)
    {
        $this->container['reference'] = $reference;

        return $this;
    }

    /**
     * Gets schemeRiskScore
     *
     * @return int|null
     */
    public function getSchemeRiskScore()
    {
        return $this->container['schemeRiskScore'];
    }

    /**
     * Sets schemeRiskScore
     *
     * @param int|null $schemeRiskScore The risk score provided by the card schemes.
     *
     * @return self
     */
    public function setSchemeRiskScore($schemeRiskScore)
    {
        $this->container['schemeRiskScore'] = $schemeRiskScore;

        return $this;
    }

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

    /**
     * Sets schemeTraceId
     *
     * @param string|null $schemeTraceId The identifier of the original payment. This ID is provided by the scheme and can be alphanumeric or numeric, depending on the scheme.
     *
     * @return self
     */
    public function setSchemeTraceId($schemeTraceId)
    {
        $this->container['schemeTraceId'] = $schemeTraceId;

        return $this;
    }

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

    /**
     * Sets schemeUniqueTransactionId
     *
     * @param string|null $schemeUniqueTransactionId The unique identifier created by the scheme. This ID can be alphanumeric or numeric depending on the scheme.
     *
     * @return self
     */
    public function setSchemeUniqueTransactionId($schemeUniqueTransactionId)
    {
        $this->container['schemeUniqueTransactionId'] = $schemeUniqueTransactionId;

        return $this;
    }

    /**
     * Gets scores
     *
     * @return \Adyen\Model\RelayedAuthorizationWebhooks\TransactionScoring[]|null
     */
    public function getScores()
    {
        return $this->container['scores'];
    }

    /**
     * Sets scores
     *
     * @param \Adyen\Model\RelayedAuthorizationWebhooks\TransactionScoring[]|null $scores The list of transaction scores.
     *
     * @return self
     */
    public function setScores($scores)
    {
        $this->container['scores'] = $scores;

        return $this;
    }

    /**
     * Gets threeDSecure
     *
     * @return \Adyen\Model\RelayedAuthorizationWebhooks\ThreeDSecure|null
     */
    public function getThreeDSecure()
    {
        return $this->container['threeDSecure'];
    }

    /**
     * Sets threeDSecure
     *
     * @param \Adyen\Model\RelayedAuthorizationWebhooks\ThreeDSecure|null $threeDSecure threeDSecure
     *
     * @return self
     */
    public function setThreeDSecure($threeDSecure)
    {
        $this->container['threeDSecure'] = $threeDSecure;

        return $this;
    }

    /**
     * Gets transactionRulesResult
     *
     * @return \Adyen\Model\RelayedAuthorizationWebhooks\TransactionRulesResult|null
     */
    public function getTransactionRulesResult()
    {
        return $this->container['transactionRulesResult'];
    }

    /**
     * Sets transactionRulesResult
     *
     * @param \Adyen\Model\RelayedAuthorizationWebhooks\TransactionRulesResult|null $transactionRulesResult transactionRulesResult
     *
     * @return self
     */
    public function setTransactionRulesResult($transactionRulesResult)
    {
        $this->container['transactionRulesResult'] = $transactionRulesResult;

        return $this;
    }

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

    /**
     * Sets type
     *
     * @param string|null $type Type of notification.
     *
     * @return self
     */
    public function setType($type)
    {
        $allowedValues = $this->getTypeAllowableValues();
        if (!in_array($type, $allowedValues, true)) {
            error_log(
                sprintf(
                    "type: unexpected enum value '%s' - Supported values are [%s]",
                    $type,
                    implode(', ', $allowedValues)
                )
            );
        }
        $this->container['type'] = $type;

        return $this;
    }

    /**
     * Gets validationResult
     *
     * @return \Adyen\Model\RelayedAuthorizationWebhooks\ValidationResult[]|null
     */
    public function getValidationResult()
    {
        return $this->container['validationResult'];
    }

    /**
     * Sets validationResult
     *
     * @param \Adyen\Model\RelayedAuthorizationWebhooks\ValidationResult[]|null $validationResult Contains the checks that Adyen performed to validate the payment and the result of each.
     *
     * @return self
     */
    public function setValidationResult($validationResult)
    {
        $this->container['validationResult'] = $validationResult;

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

    public function toArray(): array
    {
        $array = [];
        foreach (self::$openAPITypes as $propertyName => $propertyType) {
            $propertyValue = $this[$propertyName];
            if ($propertyValue !== null) {
                // Check if the property value is an object and has a toArray() method
                if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) {
                    $array[$propertyName] = $propertyValue->toArray();
                // Check if it's type datetime
                } elseif ($propertyValue instanceof \DateTime) {
                    $array[$propertyName] = $propertyValue->format(DATE_ATOM);
                // If it's an array type we should check whether it contains objects and if so call toArray method
                } elseif (is_array($propertyValue)) {
                    $array[$propertyName] = array_map(function ($item) {
                        return $item instanceof ModelInterface ? $item->toArray() : $item;
                    }, $propertyValue);
                } else {
                    // Otherwise, directly assign the property value to the array
                    $array[$propertyName] = $propertyValue;
                }
            }
        }
        return $array;
    }

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