<?php

/**
 * Adyen Payment API
 *
 * The version of the OpenAPI document: 68
 * 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\Payments;

use \ArrayAccess;
use Adyen\Model\Payments\ObjectSerializer;

/**
 * AdditionalDataRisk Class Doc Comment
 *
 * @category Class
 * @package  Adyen
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 * @implements \ArrayAccess<string, mixed>
 */
class AdditionalDataRisk implements ModelInterface, ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'riskdataCustomFieldName' => 'string',
        'riskdataBasketItemItemNrAmountPerItem' => 'string',
        'riskdataBasketItemItemNrBrand' => 'string',
        'riskdataBasketItemItemNrCategory' => 'string',
        'riskdataBasketItemItemNrColor' => 'string',
        'riskdataBasketItemItemNrCurrency' => 'string',
        'riskdataBasketItemItemNrItemID' => 'string',
        'riskdataBasketItemItemNrManufacturer' => 'string',
        'riskdataBasketItemItemNrProductTitle' => 'string',
        'riskdataBasketItemItemNrQuantity' => 'string',
        'riskdataBasketItemItemNrReceiverEmail' => 'string',
        'riskdataBasketItemItemNrSize' => 'string',
        'riskdataBasketItemItemNrSku' => 'string',
        'riskdataBasketItemItemNrUpc' => 'string',
        'riskdataPromotionsPromotionItemNrPromotionCode' => 'string',
        'riskdataPromotionsPromotionItemNrPromotionDiscountAmount' => 'string',
        'riskdataPromotionsPromotionItemNrPromotionDiscountCurrency' => 'string',
        'riskdataPromotionsPromotionItemNrPromotionDiscountPercentage' => 'string',
        'riskdataPromotionsPromotionItemNrPromotionName' => 'string',
        'riskdataRiskProfileReference' => 'string',
        'riskdataSkipRisk' => '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 = [
        'riskdataCustomFieldName' => null,
        'riskdataBasketItemItemNrAmountPerItem' => null,
        'riskdataBasketItemItemNrBrand' => null,
        'riskdataBasketItemItemNrCategory' => null,
        'riskdataBasketItemItemNrColor' => null,
        'riskdataBasketItemItemNrCurrency' => null,
        'riskdataBasketItemItemNrItemID' => null,
        'riskdataBasketItemItemNrManufacturer' => null,
        'riskdataBasketItemItemNrProductTitle' => null,
        'riskdataBasketItemItemNrQuantity' => null,
        'riskdataBasketItemItemNrReceiverEmail' => null,
        'riskdataBasketItemItemNrSize' => null,
        'riskdataBasketItemItemNrSku' => null,
        'riskdataBasketItemItemNrUpc' => null,
        'riskdataPromotionsPromotionItemNrPromotionCode' => null,
        'riskdataPromotionsPromotionItemNrPromotionDiscountAmount' => null,
        'riskdataPromotionsPromotionItemNrPromotionDiscountCurrency' => null,
        'riskdataPromotionsPromotionItemNrPromotionDiscountPercentage' => null,
        'riskdataPromotionsPromotionItemNrPromotionName' => null,
        'riskdataRiskProfileReference' => null,
        'riskdataSkipRisk' => null
    ];

    /**
      * Array of nullable properties. Used for (de)serialization
      *
      * @var boolean[]
      */
    protected static $openAPINullables = [
        'riskdataCustomFieldName' => false,
        'riskdataBasketItemItemNrAmountPerItem' => false,
        'riskdataBasketItemItemNrBrand' => false,
        'riskdataBasketItemItemNrCategory' => false,
        'riskdataBasketItemItemNrColor' => false,
        'riskdataBasketItemItemNrCurrency' => false,
        'riskdataBasketItemItemNrItemID' => false,
        'riskdataBasketItemItemNrManufacturer' => false,
        'riskdataBasketItemItemNrProductTitle' => false,
        'riskdataBasketItemItemNrQuantity' => false,
        'riskdataBasketItemItemNrReceiverEmail' => false,
        'riskdataBasketItemItemNrSize' => false,
        'riskdataBasketItemItemNrSku' => false,
        'riskdataBasketItemItemNrUpc' => false,
        'riskdataPromotionsPromotionItemNrPromotionCode' => false,
        'riskdataPromotionsPromotionItemNrPromotionDiscountAmount' => false,
        'riskdataPromotionsPromotionItemNrPromotionDiscountCurrency' => false,
        'riskdataPromotionsPromotionItemNrPromotionDiscountPercentage' => false,
        'riskdataPromotionsPromotionItemNrPromotionName' => false,
        'riskdataRiskProfileReference' => false,
        'riskdataSkipRisk' => 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 = [
        'riskdataCustomFieldName' => 'riskdata.[customFieldName]',
        'riskdataBasketItemItemNrAmountPerItem' => 'riskdata.basket.item[itemNr].amountPerItem',
        'riskdataBasketItemItemNrBrand' => 'riskdata.basket.item[itemNr].brand',
        'riskdataBasketItemItemNrCategory' => 'riskdata.basket.item[itemNr].category',
        'riskdataBasketItemItemNrColor' => 'riskdata.basket.item[itemNr].color',
        'riskdataBasketItemItemNrCurrency' => 'riskdata.basket.item[itemNr].currency',
        'riskdataBasketItemItemNrItemID' => 'riskdata.basket.item[itemNr].itemID',
        'riskdataBasketItemItemNrManufacturer' => 'riskdata.basket.item[itemNr].manufacturer',
        'riskdataBasketItemItemNrProductTitle' => 'riskdata.basket.item[itemNr].productTitle',
        'riskdataBasketItemItemNrQuantity' => 'riskdata.basket.item[itemNr].quantity',
        'riskdataBasketItemItemNrReceiverEmail' => 'riskdata.basket.item[itemNr].receiverEmail',
        'riskdataBasketItemItemNrSize' => 'riskdata.basket.item[itemNr].size',
        'riskdataBasketItemItemNrSku' => 'riskdata.basket.item[itemNr].sku',
        'riskdataBasketItemItemNrUpc' => 'riskdata.basket.item[itemNr].upc',
        'riskdataPromotionsPromotionItemNrPromotionCode' => 'riskdata.promotions.promotion[itemNr].promotionCode',
        'riskdataPromotionsPromotionItemNrPromotionDiscountAmount' => 'riskdata.promotions.promotion[itemNr].promotionDiscountAmount',
        'riskdataPromotionsPromotionItemNrPromotionDiscountCurrency' => 'riskdata.promotions.promotion[itemNr].promotionDiscountCurrency',
        'riskdataPromotionsPromotionItemNrPromotionDiscountPercentage' => 'riskdata.promotions.promotion[itemNr].promotionDiscountPercentage',
        'riskdataPromotionsPromotionItemNrPromotionName' => 'riskdata.promotions.promotion[itemNr].promotionName',
        'riskdataRiskProfileReference' => 'riskdata.riskProfileReference',
        'riskdataSkipRisk' => 'riskdata.skipRisk'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'riskdataCustomFieldName' => 'setRiskdataCustomFieldName',
        'riskdataBasketItemItemNrAmountPerItem' => 'setRiskdataBasketItemItemNrAmountPerItem',
        'riskdataBasketItemItemNrBrand' => 'setRiskdataBasketItemItemNrBrand',
        'riskdataBasketItemItemNrCategory' => 'setRiskdataBasketItemItemNrCategory',
        'riskdataBasketItemItemNrColor' => 'setRiskdataBasketItemItemNrColor',
        'riskdataBasketItemItemNrCurrency' => 'setRiskdataBasketItemItemNrCurrency',
        'riskdataBasketItemItemNrItemID' => 'setRiskdataBasketItemItemNrItemID',
        'riskdataBasketItemItemNrManufacturer' => 'setRiskdataBasketItemItemNrManufacturer',
        'riskdataBasketItemItemNrProductTitle' => 'setRiskdataBasketItemItemNrProductTitle',
        'riskdataBasketItemItemNrQuantity' => 'setRiskdataBasketItemItemNrQuantity',
        'riskdataBasketItemItemNrReceiverEmail' => 'setRiskdataBasketItemItemNrReceiverEmail',
        'riskdataBasketItemItemNrSize' => 'setRiskdataBasketItemItemNrSize',
        'riskdataBasketItemItemNrSku' => 'setRiskdataBasketItemItemNrSku',
        'riskdataBasketItemItemNrUpc' => 'setRiskdataBasketItemItemNrUpc',
        'riskdataPromotionsPromotionItemNrPromotionCode' => 'setRiskdataPromotionsPromotionItemNrPromotionCode',
        'riskdataPromotionsPromotionItemNrPromotionDiscountAmount' => 'setRiskdataPromotionsPromotionItemNrPromotionDiscountAmount',
        'riskdataPromotionsPromotionItemNrPromotionDiscountCurrency' => 'setRiskdataPromotionsPromotionItemNrPromotionDiscountCurrency',
        'riskdataPromotionsPromotionItemNrPromotionDiscountPercentage' => 'setRiskdataPromotionsPromotionItemNrPromotionDiscountPercentage',
        'riskdataPromotionsPromotionItemNrPromotionName' => 'setRiskdataPromotionsPromotionItemNrPromotionName',
        'riskdataRiskProfileReference' => 'setRiskdataRiskProfileReference',
        'riskdataSkipRisk' => 'setRiskdataSkipRisk'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'riskdataCustomFieldName' => 'getRiskdataCustomFieldName',
        'riskdataBasketItemItemNrAmountPerItem' => 'getRiskdataBasketItemItemNrAmountPerItem',
        'riskdataBasketItemItemNrBrand' => 'getRiskdataBasketItemItemNrBrand',
        'riskdataBasketItemItemNrCategory' => 'getRiskdataBasketItemItemNrCategory',
        'riskdataBasketItemItemNrColor' => 'getRiskdataBasketItemItemNrColor',
        'riskdataBasketItemItemNrCurrency' => 'getRiskdataBasketItemItemNrCurrency',
        'riskdataBasketItemItemNrItemID' => 'getRiskdataBasketItemItemNrItemID',
        'riskdataBasketItemItemNrManufacturer' => 'getRiskdataBasketItemItemNrManufacturer',
        'riskdataBasketItemItemNrProductTitle' => 'getRiskdataBasketItemItemNrProductTitle',
        'riskdataBasketItemItemNrQuantity' => 'getRiskdataBasketItemItemNrQuantity',
        'riskdataBasketItemItemNrReceiverEmail' => 'getRiskdataBasketItemItemNrReceiverEmail',
        'riskdataBasketItemItemNrSize' => 'getRiskdataBasketItemItemNrSize',
        'riskdataBasketItemItemNrSku' => 'getRiskdataBasketItemItemNrSku',
        'riskdataBasketItemItemNrUpc' => 'getRiskdataBasketItemItemNrUpc',
        'riskdataPromotionsPromotionItemNrPromotionCode' => 'getRiskdataPromotionsPromotionItemNrPromotionCode',
        'riskdataPromotionsPromotionItemNrPromotionDiscountAmount' => 'getRiskdataPromotionsPromotionItemNrPromotionDiscountAmount',
        'riskdataPromotionsPromotionItemNrPromotionDiscountCurrency' => 'getRiskdataPromotionsPromotionItemNrPromotionDiscountCurrency',
        'riskdataPromotionsPromotionItemNrPromotionDiscountPercentage' => 'getRiskdataPromotionsPromotionItemNrPromotionDiscountPercentage',
        'riskdataPromotionsPromotionItemNrPromotionName' => 'getRiskdataPromotionsPromotionItemNrPromotionName',
        'riskdataRiskProfileReference' => 'getRiskdataRiskProfileReference',
        'riskdataSkipRisk' => 'getRiskdataSkipRisk'
    ];

    /**
     * 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->setIfExists('riskdataCustomFieldName', $data ?? [], null);
        $this->setIfExists('riskdataBasketItemItemNrAmountPerItem', $data ?? [], null);
        $this->setIfExists('riskdataBasketItemItemNrBrand', $data ?? [], null);
        $this->setIfExists('riskdataBasketItemItemNrCategory', $data ?? [], null);
        $this->setIfExists('riskdataBasketItemItemNrColor', $data ?? [], null);
        $this->setIfExists('riskdataBasketItemItemNrCurrency', $data ?? [], null);
        $this->setIfExists('riskdataBasketItemItemNrItemID', $data ?? [], null);
        $this->setIfExists('riskdataBasketItemItemNrManufacturer', $data ?? [], null);
        $this->setIfExists('riskdataBasketItemItemNrProductTitle', $data ?? [], null);
        $this->setIfExists('riskdataBasketItemItemNrQuantity', $data ?? [], null);
        $this->setIfExists('riskdataBasketItemItemNrReceiverEmail', $data ?? [], null);
        $this->setIfExists('riskdataBasketItemItemNrSize', $data ?? [], null);
        $this->setIfExists('riskdataBasketItemItemNrSku', $data ?? [], null);
        $this->setIfExists('riskdataBasketItemItemNrUpc', $data ?? [], null);
        $this->setIfExists('riskdataPromotionsPromotionItemNrPromotionCode', $data ?? [], null);
        $this->setIfExists('riskdataPromotionsPromotionItemNrPromotionDiscountAmount', $data ?? [], null);
        $this->setIfExists('riskdataPromotionsPromotionItemNrPromotionDiscountCurrency', $data ?? [], null);
        $this->setIfExists('riskdataPromotionsPromotionItemNrPromotionDiscountPercentage', $data ?? [], null);
        $this->setIfExists('riskdataPromotionsPromotionItemNrPromotionName', $data ?? [], null);
        $this->setIfExists('riskdataRiskProfileReference', $data ?? [], null);
        $this->setIfExists('riskdataSkipRisk', $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 riskdataCustomFieldName
     *
     * @return string|null
     */
    public function getRiskdataCustomFieldName()
    {
        return $this->container['riskdataCustomFieldName'];
    }

    /**
     * Sets riskdataCustomFieldName
     *
     * @param string|null $riskdataCustomFieldName The data for your custom risk field. For more information, refer to [Create custom risk fields](https://docs.adyen.com/risk-management/configure-custom-risk-rules#step-1-create-custom-risk-fields).
     *
     * @return self
     */
    public function setRiskdataCustomFieldName($riskdataCustomFieldName)
    {
        $this->container['riskdataCustomFieldName'] = $riskdataCustomFieldName;

        return $this;
    }

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

    /**
     * Sets riskdataBasketItemItemNrAmountPerItem
     *
     * @param string|null $riskdataBasketItemItemNrAmountPerItem The price of item in the basket, represented in [minor units](https://docs.adyen.com/development-resources/currency-codes).
     *
     * @return self
     */
    public function setRiskdataBasketItemItemNrAmountPerItem($riskdataBasketItemItemNrAmountPerItem)
    {
        $this->container['riskdataBasketItemItemNrAmountPerItem'] = $riskdataBasketItemItemNrAmountPerItem;

        return $this;
    }

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

    /**
     * Sets riskdataBasketItemItemNrBrand
     *
     * @param string|null $riskdataBasketItemItemNrBrand Brand of the item.
     *
     * @return self
     */
    public function setRiskdataBasketItemItemNrBrand($riskdataBasketItemItemNrBrand)
    {
        $this->container['riskdataBasketItemItemNrBrand'] = $riskdataBasketItemItemNrBrand;

        return $this;
    }

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

    /**
     * Sets riskdataBasketItemItemNrCategory
     *
     * @param string|null $riskdataBasketItemItemNrCategory Category of the item.
     *
     * @return self
     */
    public function setRiskdataBasketItemItemNrCategory($riskdataBasketItemItemNrCategory)
    {
        $this->container['riskdataBasketItemItemNrCategory'] = $riskdataBasketItemItemNrCategory;

        return $this;
    }

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

    /**
     * Sets riskdataBasketItemItemNrColor
     *
     * @param string|null $riskdataBasketItemItemNrColor Color of the item.
     *
     * @return self
     */
    public function setRiskdataBasketItemItemNrColor($riskdataBasketItemItemNrColor)
    {
        $this->container['riskdataBasketItemItemNrColor'] = $riskdataBasketItemItemNrColor;

        return $this;
    }

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

    /**
     * Sets riskdataBasketItemItemNrCurrency
     *
     * @param string|null $riskdataBasketItemItemNrCurrency The three-character [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217).
     *
     * @return self
     */
    public function setRiskdataBasketItemItemNrCurrency($riskdataBasketItemItemNrCurrency)
    {
        $this->container['riskdataBasketItemItemNrCurrency'] = $riskdataBasketItemItemNrCurrency;

        return $this;
    }

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

    /**
     * Sets riskdataBasketItemItemNrItemID
     *
     * @param string|null $riskdataBasketItemItemNrItemID ID of the item.
     *
     * @return self
     */
    public function setRiskdataBasketItemItemNrItemID($riskdataBasketItemItemNrItemID)
    {
        $this->container['riskdataBasketItemItemNrItemID'] = $riskdataBasketItemItemNrItemID;

        return $this;
    }

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

    /**
     * Sets riskdataBasketItemItemNrManufacturer
     *
     * @param string|null $riskdataBasketItemItemNrManufacturer Manufacturer of the item.
     *
     * @return self
     */
    public function setRiskdataBasketItemItemNrManufacturer($riskdataBasketItemItemNrManufacturer)
    {
        $this->container['riskdataBasketItemItemNrManufacturer'] = $riskdataBasketItemItemNrManufacturer;

        return $this;
    }

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

    /**
     * Sets riskdataBasketItemItemNrProductTitle
     *
     * @param string|null $riskdataBasketItemItemNrProductTitle A text description of the product the invoice line refers to.
     *
     * @return self
     */
    public function setRiskdataBasketItemItemNrProductTitle($riskdataBasketItemItemNrProductTitle)
    {
        $this->container['riskdataBasketItemItemNrProductTitle'] = $riskdataBasketItemItemNrProductTitle;

        return $this;
    }

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

    /**
     * Sets riskdataBasketItemItemNrQuantity
     *
     * @param string|null $riskdataBasketItemItemNrQuantity Quantity of the item purchased.
     *
     * @return self
     */
    public function setRiskdataBasketItemItemNrQuantity($riskdataBasketItemItemNrQuantity)
    {
        $this->container['riskdataBasketItemItemNrQuantity'] = $riskdataBasketItemItemNrQuantity;

        return $this;
    }

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

    /**
     * Sets riskdataBasketItemItemNrReceiverEmail
     *
     * @param string|null $riskdataBasketItemItemNrReceiverEmail Email associated with the given product in the basket (usually in electronic gift cards).
     *
     * @return self
     */
    public function setRiskdataBasketItemItemNrReceiverEmail($riskdataBasketItemItemNrReceiverEmail)
    {
        $this->container['riskdataBasketItemItemNrReceiverEmail'] = $riskdataBasketItemItemNrReceiverEmail;

        return $this;
    }

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

    /**
     * Sets riskdataBasketItemItemNrSize
     *
     * @param string|null $riskdataBasketItemItemNrSize Size of the item.
     *
     * @return self
     */
    public function setRiskdataBasketItemItemNrSize($riskdataBasketItemItemNrSize)
    {
        $this->container['riskdataBasketItemItemNrSize'] = $riskdataBasketItemItemNrSize;

        return $this;
    }

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

    /**
     * Sets riskdataBasketItemItemNrSku
     *
     * @param string|null $riskdataBasketItemItemNrSku [Stock keeping unit](https://en.wikipedia.org/wiki/Stock_keeping_unit).
     *
     * @return self
     */
    public function setRiskdataBasketItemItemNrSku($riskdataBasketItemItemNrSku)
    {
        $this->container['riskdataBasketItemItemNrSku'] = $riskdataBasketItemItemNrSku;

        return $this;
    }

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

    /**
     * Sets riskdataBasketItemItemNrUpc
     *
     * @param string|null $riskdataBasketItemItemNrUpc [Universal Product Code](https://en.wikipedia.org/wiki/Universal_Product_Code).
     *
     * @return self
     */
    public function setRiskdataBasketItemItemNrUpc($riskdataBasketItemItemNrUpc)
    {
        $this->container['riskdataBasketItemItemNrUpc'] = $riskdataBasketItemItemNrUpc;

        return $this;
    }

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

    /**
     * Sets riskdataPromotionsPromotionItemNrPromotionCode
     *
     * @param string|null $riskdataPromotionsPromotionItemNrPromotionCode Code of the promotion.
     *
     * @return self
     */
    public function setRiskdataPromotionsPromotionItemNrPromotionCode($riskdataPromotionsPromotionItemNrPromotionCode)
    {
        $this->container['riskdataPromotionsPromotionItemNrPromotionCode'] = $riskdataPromotionsPromotionItemNrPromotionCode;

        return $this;
    }

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

    /**
     * Sets riskdataPromotionsPromotionItemNrPromotionDiscountAmount
     *
     * @param string|null $riskdataPromotionsPromotionItemNrPromotionDiscountAmount The discount amount of the promotion, represented in [minor units](https://docs.adyen.com/development-resources/currency-codes).
     *
     * @return self
     */
    public function setRiskdataPromotionsPromotionItemNrPromotionDiscountAmount($riskdataPromotionsPromotionItemNrPromotionDiscountAmount)
    {
        $this->container['riskdataPromotionsPromotionItemNrPromotionDiscountAmount'] = $riskdataPromotionsPromotionItemNrPromotionDiscountAmount;

        return $this;
    }

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

    /**
     * Sets riskdataPromotionsPromotionItemNrPromotionDiscountCurrency
     *
     * @param string|null $riskdataPromotionsPromotionItemNrPromotionDiscountCurrency The three-character [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217).
     *
     * @return self
     */
    public function setRiskdataPromotionsPromotionItemNrPromotionDiscountCurrency($riskdataPromotionsPromotionItemNrPromotionDiscountCurrency)
    {
        $this->container['riskdataPromotionsPromotionItemNrPromotionDiscountCurrency'] = $riskdataPromotionsPromotionItemNrPromotionDiscountCurrency;

        return $this;
    }

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

    /**
     * Sets riskdataPromotionsPromotionItemNrPromotionDiscountPercentage
     *
     * @param string|null $riskdataPromotionsPromotionItemNrPromotionDiscountPercentage Promotion's percentage discount. It is represented in percentage value and there is no need to include the '%' sign.  e.g. for a promotion discount of 30%, the value of the field should be 30.
     *
     * @return self
     */
    public function setRiskdataPromotionsPromotionItemNrPromotionDiscountPercentage($riskdataPromotionsPromotionItemNrPromotionDiscountPercentage)
    {
        $this->container['riskdataPromotionsPromotionItemNrPromotionDiscountPercentage'] = $riskdataPromotionsPromotionItemNrPromotionDiscountPercentage;

        return $this;
    }

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

    /**
     * Sets riskdataPromotionsPromotionItemNrPromotionName
     *
     * @param string|null $riskdataPromotionsPromotionItemNrPromotionName Name of the promotion.
     *
     * @return self
     */
    public function setRiskdataPromotionsPromotionItemNrPromotionName($riskdataPromotionsPromotionItemNrPromotionName)
    {
        $this->container['riskdataPromotionsPromotionItemNrPromotionName'] = $riskdataPromotionsPromotionItemNrPromotionName;

        return $this;
    }

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

    /**
     * Sets riskdataRiskProfileReference
     *
     * @param string|null $riskdataRiskProfileReference Reference number of the risk profile that you want to apply to the payment. If not provided or left blank, the merchant-level account's default risk profile will be applied to the payment. For more information, see [dynamically assign a risk profile to a payment](https://docs.adyen.com/risk-management/create-and-use-risk-profiles#dynamically-assign-a-risk-profile-to-a-payment).
     *
     * @return self
     */
    public function setRiskdataRiskProfileReference($riskdataRiskProfileReference)
    {
        $this->container['riskdataRiskProfileReference'] = $riskdataRiskProfileReference;

        return $this;
    }

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

    /**
     * Sets riskdataSkipRisk
     *
     * @param string|null $riskdataSkipRisk If this parameter is provided with the value **true**, risk checks for the payment request are skipped and the transaction will not get a risk score.
     *
     * @return self
     */
    public function setRiskdataSkipRisk($riskdataSkipRisk)
    {
        $this->container['riskdataSkipRisk'] = $riskdataSkipRisk;

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