<?php

/**
 * Configuration webhooks
 *
 * The version of the OpenAPI document: 2
 * 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\ConfigurationWebhooks;

use ArrayAccess;
use Adyen\Model\ConfigurationWebhooks\ObjectSerializer;

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'accountScore' => 'string',
        'device' => '\Adyen\Model\ConfigurationWebhooks\Device',
        'deviceScore' => 'string',
        'provisioningMethod' => 'string',
        'recommendationReasons' => 'string[]',
        'type' => '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 = [
        'accountScore' => null,
        'device' => null,
        'deviceScore' => null,
        'provisioningMethod' => null,
        'recommendationReasons' => null,
        'type' => null
    ];

    /**
      * Array of nullable properties. Used for (de)serialization
      *
      * @var boolean[]
      */
    protected static $openAPINullables = [
        'accountScore' => false,
        'device' => false,
        'deviceScore' => false,
        'provisioningMethod' => false,
        'recommendationReasons' => false,
        'type' => 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 = [
        'accountScore' => 'accountScore',
        'device' => 'device',
        'deviceScore' => 'deviceScore',
        'provisioningMethod' => 'provisioningMethod',
        'recommendationReasons' => 'recommendationReasons',
        'type' => 'type'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'accountScore' => 'setAccountScore',
        'device' => 'setDevice',
        'deviceScore' => 'setDeviceScore',
        'provisioningMethod' => 'setProvisioningMethod',
        'recommendationReasons' => 'setRecommendationReasons',
        'type' => 'setType'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'accountScore' => 'getAccountScore',
        'device' => 'getDevice',
        'deviceScore' => 'getDeviceScore',
        'provisioningMethod' => 'getProvisioningMethod',
        'recommendationReasons' => 'getRecommendationReasons',
        'type' => 'getType'
    ];

    /**
     * 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 RECOMMENDATION_REASONS_ACCOUNT_CARD_TOO_NEW = 'accountCardTooNew';
    public const RECOMMENDATION_REASONS_ACCOUNT_HIGH_RISK = 'accountHighRisk';
    public const RECOMMENDATION_REASONS_ACCOUNT_RECENTLY_CHANGED = 'accountRecentlyChanged';
    public const RECOMMENDATION_REASONS_ACCOUNT_TOO_NEW = 'accountTooNew';
    public const RECOMMENDATION_REASONS_ACCOUNT_TOO_NEW_SINCE_LAUNCH = 'accountTooNewSinceLaunch';
    public const RECOMMENDATION_REASONS_CARDHOLDER_PAN_ASSOCIATED_TO_ACCOUNT_WITHIN_THRESHOLD_DAYS = 'cardholderPanAssociatedToAccountWithinThresholdDays';
    public const RECOMMENDATION_REASONS_CHANGES_MADE_TO_ACCOUNT_DATA_WITHIN_THRESHOLD_DAYS = 'changesMadeToAccountDataWithinThresholdDays';
    public const RECOMMENDATION_REASONS_DEVICE_PROVISIONING_LOCATION_OUTSIDE_OF_CARDHOLDERS_WALLET_ACCOUNT_HOME_COUNTRY = 'deviceProvisioningLocationOutsideOfCardholdersWalletAccountHomeCountry';
    public const RECOMMENDATION_REASONS_DEVICE_RECENTLY_LOST = 'deviceRecentlyLost';
    public const RECOMMENDATION_REASONS_ENCRYPTED_PAYMENT_INSTRUMENT_DATA_IS_BEING_PUSHED_BY_THE_ISSUER_TO_THE_SAME_DEVICE_THAT_ISSUER_APPLICATION_AUTHENTICATED_BUT_WITH_SUCCESSFUL_UPFRONT_AUTHENTICATION = 'encryptedPaymentInstrumentDataIsBeingPushedByTheIssuerToTheSameDeviceThatIssuerApplicationAuthenticatedButWithSuccessfulUpfrontAuthentication';
    public const RECOMMENDATION_REASONS_ENCRYPTED_PAYMENT_INSTRUMENT_DATA_IS_BEING_PUSHED_BY_THE_ISSUER_TO_THE_SAME_DEVICE_THAT_ISSUER_APPLICATION_AUTHENTICATED_BUT_WITHOUT_ANY_UPFRONT_AUTHENTICATION = 'encryptedPaymentInstrumentDataIsBeingPushedByTheIssuerToTheSameDeviceThatIssuerApplicationAuthenticatedButWithoutAnyUpfrontAuthentication';
    public const RECOMMENDATION_REASONS_ENCRYPTED_PAYMENT_INSTRUMENT_DATA_IS_PUSHED_TO_A_DIFFERENT_DEVICE_THAN_THE_ONE_THAT_ISSUER_APPLICATION_AUTHENTICATED = 'encryptedPaymentInstrumentDataIsPushedToADifferentDeviceThanTheOneThatIssuerApplicationAuthenticated';
    public const RECOMMENDATION_REASONS_ENCRYPTED_PAYMENT_INSTRUMENT_DATA_IS_PUSHED_TO_A_DIFFERENT_USER_THAN_THE_CARD_HOLDER = 'encryptedPaymentInstrumentDataIsPushedToADifferentUserThanTheCardHolder';
    public const RECOMMENDATION_REASONS_HAS_SUSPENDED_TOKENS = 'hasSuspendedTokens';
    public const RECOMMENDATION_REASONS_INACTIVE_ACCOUNT = 'inactiveAccount';
    public const RECOMMENDATION_REASONS_ISSUER_DEFERRED_IDV_DECISION = 'issuerDeferredIDVDecision';
    public const RECOMMENDATION_REASONS_ISSUER_ENCRYPTED_PAYMENT_INSTRUMENT_DATA_EXPIRED = 'issuerEncryptedPaymentInstrumentDataExpired';
    public const RECOMMENDATION_REASONS_LOW_ACCOUNT_SCORE = 'lowAccountScore';
    public const RECOMMENDATION_REASONS_LOW_DEVICE_SCORE = 'lowDeviceScore';
    public const RECOMMENDATION_REASONS_LOW_PHONE_NUMBER_SCORE = 'lowPhoneNumberScore';
    public const RECOMMENDATION_REASONS_NUMBER_OF_ACTIVE_TOKENS_GREATER_THAN_THRESHOLD = 'numberOfActiveTokensGreaterThanThreshold';
    public const RECOMMENDATION_REASONS_NUMBER_OF_ACTIVE_TOKENS_ON_ALL_DEVICES_IS_GREATER_THAN_THRESHOLD = 'numberOfActiveTokensOnAllDevicesIsGreaterThanThreshold';
    public const RECOMMENDATION_REASONS_NUMBER_OF_DAYS_SINCE_DEVICE_WAS_LAST_REPORTED_LOST_IS_LESS_THAN_THRESHOLD_DAYS = 'numberOfDaysSinceDeviceWasLastReportedLostIsLessThanThresholdDays';
    public const RECOMMENDATION_REASONS_NUMBER_OF_DEVICES_WITH_SAME_USERID_WITH_TOKEN_IS_GREATER_THAN_THRESHOLD = 'numberOfDevicesWithSameUseridWithTokenIsGreaterThanThreshold';
    public const RECOMMENDATION_REASONS_NUMBER_OF_TRANSACTIONS_IN_LAST12_MONTHS_LESS_THAN_THRESHOLD_NUMBER = 'numberOfTransactionsInLast12MonthsLessThanThresholdNumber';
    public const RECOMMENDATION_REASONS_OUT_SIDE_HOME_TERRITORY = 'outSideHomeTerritory';
    public const RECOMMENDATION_REASONS_SUSPENDED_CARDS_IN_THE_WALLET_ACCOUNT_IS_GREATER_THAN_THRESHOLD = 'suspendedCardsInTheWALLETAccountIsGreaterThanThreshold';
    public const RECOMMENDATION_REASONS_SUSPICIOUS_ACTIVITY = 'suspiciousActivity';
    public const RECOMMENDATION_REASONS_THE_NUMBER_OF_PROVISIONING_ATTEMPTS_ACROSS_ALL_CARDS_ON_THIS_DEVICE_IN_THE_LAST24_HOURS_EXCEEDS_THE_THRESHOLD = 'theNumberOfProvisioningAttemptsAcrossAllCardsOnThisDeviceInTheLast24HoursExceedsTheThreshold';
    public const RECOMMENDATION_REASONS_THE_WALLET_ACCOUNT_INTO_WHICH_THE_CARD_IS_BEING_PROVISIONED_CONTAIN_DISTINCT_NAMES_GREATER_THAN_THRESHOLD = 'theWALLETAccountIntoWhichTheCardIsBeingProvisionedContainDistinctNamesGreaterThanThreshold';
    public const RECOMMENDATION_REASONS_THIS_ACCOUNT_HAS_NOT_HAD_ACTIVITY_WITHIN_THRESHOLD_PERIOD = 'thisAccountHasNotHadActivityWithinThresholdPeriod';
    public const RECOMMENDATION_REASONS_TOO_MANY_DIFFERENT_CARDHOLDERS = 'tooManyDifferentCardholders';
    public const RECOMMENDATION_REASONS_TOO_MANY_RECENT_ATTEMPTS = 'tooManyRecentAttempts';
    public const RECOMMENDATION_REASONS_TOO_MANY_RECENT_TOKENS = 'tooManyRecentTokens';
    public const RECOMMENDATION_REASONS_UNABLE_TO_ASSESS = 'unableToAssess';
    public const RECOMMENDATION_REASONS_UNKNOWN = 'unknown';
    public const RECOMMENDATION_REASONS_USER_ACCOUNT_WAS_CREATED_WITHIN_THRESHOLD_DAYS = 'userAccountWasCreatedWithinThresholdDays';
    public const RECOMMENDATION_REASONS_USER_DEVICE_RECEIVING_ENCRYPTED_PAYMENT_INSTRUMENT_DATA_IS_DIFFERENT_THAN_THE_ONE_THAT_IS_PROVISIONING_THE_TOKEN = 'userDeviceReceivingEncryptedPaymentInstrumentDataIsDifferentThanTheOneThatIsProvisioningTheToken';
    public const RECOMMENDATION_REASONS_USERS_ACCOUNT_ON_DEVICE_LESS_THAN_THRESHOLD_DAYS = 'usersAccountOnDeviceLessThanThresholdDays';
    public const RECOMMENDATION_REASONS_WALLET_ACCOUNT_CREATED_WITHIN_THRESHOLD_DAYS = 'walletAccountCreatedWithinThresholdDays';
    public const RECOMMENDATION_REASONS_WALLET_ACCOUNT_HOLDER_NAME_ON_FILE_DOES_NOT_MATCH_CARDHOLDER_ENTERED_NAME = 'walletAccountHolderNameOnFileDoesNotMatchCardholderEnteredName';

    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getRecommendationReasonsAllowableValues()
    {
        return [
            self::RECOMMENDATION_REASONS_ACCOUNT_CARD_TOO_NEW,
            self::RECOMMENDATION_REASONS_ACCOUNT_HIGH_RISK,
            self::RECOMMENDATION_REASONS_ACCOUNT_RECENTLY_CHANGED,
            self::RECOMMENDATION_REASONS_ACCOUNT_TOO_NEW,
            self::RECOMMENDATION_REASONS_ACCOUNT_TOO_NEW_SINCE_LAUNCH,
            self::RECOMMENDATION_REASONS_CARDHOLDER_PAN_ASSOCIATED_TO_ACCOUNT_WITHIN_THRESHOLD_DAYS,
            self::RECOMMENDATION_REASONS_CHANGES_MADE_TO_ACCOUNT_DATA_WITHIN_THRESHOLD_DAYS,
            self::RECOMMENDATION_REASONS_DEVICE_PROVISIONING_LOCATION_OUTSIDE_OF_CARDHOLDERS_WALLET_ACCOUNT_HOME_COUNTRY,
            self::RECOMMENDATION_REASONS_DEVICE_RECENTLY_LOST,
            self::RECOMMENDATION_REASONS_ENCRYPTED_PAYMENT_INSTRUMENT_DATA_IS_BEING_PUSHED_BY_THE_ISSUER_TO_THE_SAME_DEVICE_THAT_ISSUER_APPLICATION_AUTHENTICATED_BUT_WITH_SUCCESSFUL_UPFRONT_AUTHENTICATION,
            self::RECOMMENDATION_REASONS_ENCRYPTED_PAYMENT_INSTRUMENT_DATA_IS_BEING_PUSHED_BY_THE_ISSUER_TO_THE_SAME_DEVICE_THAT_ISSUER_APPLICATION_AUTHENTICATED_BUT_WITHOUT_ANY_UPFRONT_AUTHENTICATION,
            self::RECOMMENDATION_REASONS_ENCRYPTED_PAYMENT_INSTRUMENT_DATA_IS_PUSHED_TO_A_DIFFERENT_DEVICE_THAN_THE_ONE_THAT_ISSUER_APPLICATION_AUTHENTICATED,
            self::RECOMMENDATION_REASONS_ENCRYPTED_PAYMENT_INSTRUMENT_DATA_IS_PUSHED_TO_A_DIFFERENT_USER_THAN_THE_CARD_HOLDER,
            self::RECOMMENDATION_REASONS_HAS_SUSPENDED_TOKENS,
            self::RECOMMENDATION_REASONS_INACTIVE_ACCOUNT,
            self::RECOMMENDATION_REASONS_ISSUER_DEFERRED_IDV_DECISION,
            self::RECOMMENDATION_REASONS_ISSUER_ENCRYPTED_PAYMENT_INSTRUMENT_DATA_EXPIRED,
            self::RECOMMENDATION_REASONS_LOW_ACCOUNT_SCORE,
            self::RECOMMENDATION_REASONS_LOW_DEVICE_SCORE,
            self::RECOMMENDATION_REASONS_LOW_PHONE_NUMBER_SCORE,
            self::RECOMMENDATION_REASONS_NUMBER_OF_ACTIVE_TOKENS_GREATER_THAN_THRESHOLD,
            self::RECOMMENDATION_REASONS_NUMBER_OF_ACTIVE_TOKENS_ON_ALL_DEVICES_IS_GREATER_THAN_THRESHOLD,
            self::RECOMMENDATION_REASONS_NUMBER_OF_DAYS_SINCE_DEVICE_WAS_LAST_REPORTED_LOST_IS_LESS_THAN_THRESHOLD_DAYS,
            self::RECOMMENDATION_REASONS_NUMBER_OF_DEVICES_WITH_SAME_USERID_WITH_TOKEN_IS_GREATER_THAN_THRESHOLD,
            self::RECOMMENDATION_REASONS_NUMBER_OF_TRANSACTIONS_IN_LAST12_MONTHS_LESS_THAN_THRESHOLD_NUMBER,
            self::RECOMMENDATION_REASONS_OUT_SIDE_HOME_TERRITORY,
            self::RECOMMENDATION_REASONS_SUSPENDED_CARDS_IN_THE_WALLET_ACCOUNT_IS_GREATER_THAN_THRESHOLD,
            self::RECOMMENDATION_REASONS_SUSPICIOUS_ACTIVITY,
            self::RECOMMENDATION_REASONS_THE_NUMBER_OF_PROVISIONING_ATTEMPTS_ACROSS_ALL_CARDS_ON_THIS_DEVICE_IN_THE_LAST24_HOURS_EXCEEDS_THE_THRESHOLD,
            self::RECOMMENDATION_REASONS_THE_WALLET_ACCOUNT_INTO_WHICH_THE_CARD_IS_BEING_PROVISIONED_CONTAIN_DISTINCT_NAMES_GREATER_THAN_THRESHOLD,
            self::RECOMMENDATION_REASONS_THIS_ACCOUNT_HAS_NOT_HAD_ACTIVITY_WITHIN_THRESHOLD_PERIOD,
            self::RECOMMENDATION_REASONS_TOO_MANY_DIFFERENT_CARDHOLDERS,
            self::RECOMMENDATION_REASONS_TOO_MANY_RECENT_ATTEMPTS,
            self::RECOMMENDATION_REASONS_TOO_MANY_RECENT_TOKENS,
            self::RECOMMENDATION_REASONS_UNABLE_TO_ASSESS,
            self::RECOMMENDATION_REASONS_UNKNOWN,
            self::RECOMMENDATION_REASONS_USER_ACCOUNT_WAS_CREATED_WITHIN_THRESHOLD_DAYS,
            self::RECOMMENDATION_REASONS_USER_DEVICE_RECEIVING_ENCRYPTED_PAYMENT_INSTRUMENT_DATA_IS_DIFFERENT_THAN_THE_ONE_THAT_IS_PROVISIONING_THE_TOKEN,
            self::RECOMMENDATION_REASONS_USERS_ACCOUNT_ON_DEVICE_LESS_THAN_THRESHOLD_DAYS,
            self::RECOMMENDATION_REASONS_WALLET_ACCOUNT_CREATED_WITHIN_THRESHOLD_DAYS,
            self::RECOMMENDATION_REASONS_WALLET_ACCOUNT_HOLDER_NAME_ON_FILE_DOES_NOT_MATCH_CARDHOLDER_ENTERED_NAME,
        ];
    }
    /**
     * 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('accountScore', $data ?? [], null);
        $this->setIfExists('device', $data ?? [], null);
        $this->setIfExists('deviceScore', $data ?? [], null);
        $this->setIfExists('provisioningMethod', $data ?? [], null);
        $this->setIfExists('recommendationReasons', $data ?? [], null);
        $this->setIfExists('type', $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 = [];

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

    /**
     * Sets accountScore
     *
     * @param string|null $accountScore The confidence score of the wallet account, calculated by the wallet provider.  A high score means that account is considered trustworthy. A low score means that the account is considered suspicious.  Possible values: **1** to **5**.
     *
     * @return self
     */
    public function setAccountScore($accountScore)
    {
        $this->container['accountScore'] = $accountScore;

        return $this;
    }

    /**
     * Gets device
     *
     * @return \Adyen\Model\ConfigurationWebhooks\Device|null
     */
    public function getDevice()
    {
        return $this->container['device'];
    }

    /**
     * Sets device
     *
     * @param \Adyen\Model\ConfigurationWebhooks\Device|null $device device
     *
     * @return self
     */
    public function setDevice($device)
    {
        $this->container['device'] = $device;

        return $this;
    }

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

    /**
     * Sets deviceScore
     *
     * @param string|null $deviceScore The confidence score of the device, calculated by the wallet provider.  A high score means that device is considered trustworthy. A low score means that the device is considered suspicious.  Possible values: **1** to **5**.
     *
     * @return self
     */
    public function setDeviceScore($deviceScore)
    {
        $this->container['deviceScore'] = $deviceScore;

        return $this;
    }

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

    /**
     * Sets provisioningMethod
     *
     * @param string|null $provisioningMethod The method used for provisioning the network token.  Possible values: **push**, **manual**, **cof**, **unknown**.
     *
     * @return self
     */
    public function setProvisioningMethod($provisioningMethod)
    {
        $this->container['provisioningMethod'] = $provisioningMethod;

        return $this;
    }

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

    /**
     * Sets recommendationReasons
     *
     * @param string[]|null $recommendationReasons A list of risk indicators triggered at the time of provisioning the network token.  Some example values of risk indicators are:  * **accountTooNewSinceLaunch** * **tooManyRecentAttempts** * **lowDeviceScore** * **lowAccountScore**
     *
     * @return self
     */
    public function setRecommendationReasons($recommendationReasons)
    {
        $allowedValues = $this->getRecommendationReasonsAllowableValues();
        if (array_diff($recommendationReasons, $allowedValues)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'recommendationReasons', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['recommendationReasons'] = $recommendationReasons;

        return $this;
    }

    /**
     * Gets type
     *
     * @return string|null
     * @deprecated since Configuration webhooks v2. "Use name of the `tokenRequestor` instead."
     */
    public function getType()
    {
        return $this->container['type'];
    }

    /**
     * Sets type
     *
     * @param string|null $type The type of wallet that the network token is associated with.  Possible values: **applePay**, **googlePay**, **garminPay**.
     *
     * @return self
     * @deprecated since Configuration webhooks v2. "Use name of the `tokenRequestor` instead."
     */
    public function setType($type)
    {
        $this->container['type'] = $type;

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