<?php

declare(strict_types=1);

namespace Drupal\netforum\xWeb\Generated\StructType;

use InvalidArgumentException;
use WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for WEBCentralizedShoppingCartGetEventListByName StructType
 * @subpackage Structs
 * @author Drupal NetForum xWeb PHP SDK Generator
 * @version 1.0.0
 * @license GPL-2.0-or-later https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * @see https://www.drupal.org/project/netforum
 * @generatedDate 2025-08-05
 * @generatedRelease Official
 * @generatedNetForumVersion 37
 */
#[\AllowDynamicProperties]
class WEBCentralizedShoppingCartGetEventListByName extends AbstractStructBase
{
    /**
     * The EventName
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var string|null
     */
    protected ?string $EventName = null;
    /**
     * Constructor method for WEBCentralizedShoppingCartGetEventListByName
     * @uses WEBCentralizedShoppingCartGetEventListByName::setEventName()
     * @param string $eventName
     */
    public function __construct(?string $eventName = null)
    {
        $this
            ->setEventName($eventName);
    }
    /**
     * Get EventName value
     * @return string|null
     */
    public function getEventName(): ?string
    {
        return $this->EventName;
    }
    /**
     * Set EventName value
     * @param string $eventName
     * @return \Drupal\netforum\xWeb\Generated\StructType\WEBCentralizedShoppingCartGetEventListByName
     */
    public function setEventName(?string $eventName = null): self
    {
        // validation for constraint: string
        if (!is_null($eventName) && !is_string($eventName)) {
            throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($eventName, true), gettype($eventName)), __LINE__);
        }
        $this->EventName = $eventName;
        
        return $this;
    }
}
