<?php

declare(strict_types=1);

namespace Drupal\netforum\xWeb\Generated\StructType;

use InvalidArgumentException;
use WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for EventsRegistrantSessionType 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 EventsRegistrantSessionType extends AbstractStructBase
{
    /**
     * The ev_registration_session
     * @var \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_registration_session_DataObjectType|null
     */
    protected ?\Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_registration_session_DataObjectType $ev_registration_session = null;
    /**
     * The ev_registration
     * @var \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_registration_DataObjectType|null
     */
    protected ?\Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_registration_DataObjectType $ev_registration = null;
    /**
     * The ev_session
     * @var \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_session_DataObjectType|null
     */
    protected ?\Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_session_DataObjectType $ev_session = null;
    /**
     * The ev_track
     * @var \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_track_DataObjectType|null
     */
    protected ?\Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_track_DataObjectType $ev_track = null;
    /**
     * The co_customer
     * @var \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_co_customer_DataObjectType|null
     */
    protected ?\Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_co_customer_DataObjectType $co_customer = null;
    /**
     * The ev_event
     * @var \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_event_DataObjectType|null
     */
    protected ?\Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_event_DataObjectType $ev_event = null;
    /**
     * The CurrentKey
     * Meta information extracted from the WSDL
     * - documentation: Unique Key.The current key is the record key for the object. This field must be set whenever updating an existing database record. | Avectra netForum defined simpleType.
     * - base: s:string
     * - maxOccurs: 1
     * - minOccurs: 0
     * - nillable: true
     * - pattern: [{]?[0-9a-fA-F]{8}[\-]?([0-9a-fA-F]{4}[\-]?){3}[0-9a-fA-F]{12}[}]?
     * @var string|null
     */
    protected ?string $CurrentKey = null;
    /**
     * Constructor method for EventsRegistrantSessionType
     * @uses EventsRegistrantSessionType::setEv_registration_session()
     * @uses EventsRegistrantSessionType::setEv_registration()
     * @uses EventsRegistrantSessionType::setEv_session()
     * @uses EventsRegistrantSessionType::setEv_track()
     * @uses EventsRegistrantSessionType::setCo_customer()
     * @uses EventsRegistrantSessionType::setEv_event()
     * @uses EventsRegistrantSessionType::setCurrentKey()
     * @param \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_registration_session_DataObjectType $ev_registration_session
     * @param \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_registration_DataObjectType $ev_registration
     * @param \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_session_DataObjectType $ev_session
     * @param \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_track_DataObjectType $ev_track
     * @param \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_co_customer_DataObjectType $co_customer
     * @param \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_event_DataObjectType $ev_event
     * @param string $currentKey
     */
    public function __construct(?\Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_registration_session_DataObjectType $ev_registration_session = null, ?\Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_registration_DataObjectType $ev_registration = null, ?\Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_session_DataObjectType $ev_session = null, ?\Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_track_DataObjectType $ev_track = null, ?\Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_co_customer_DataObjectType $co_customer = null, ?\Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_event_DataObjectType $ev_event = null, ?string $currentKey = null)
    {
        $this
            ->setEv_registration_session($ev_registration_session)
            ->setEv_registration($ev_registration)
            ->setEv_session($ev_session)
            ->setEv_track($ev_track)
            ->setCo_customer($co_customer)
            ->setEv_event($ev_event)
            ->setCurrentKey($currentKey);
    }
    /**
     * Get ev_registration_session value
     * @return \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_registration_session_DataObjectType|null
     */
    public function getEv_registration_session(): ?\Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_registration_session_DataObjectType
    {
        return $this->ev_registration_session;
    }
    /**
     * Set ev_registration_session value
     * @param \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_registration_session_DataObjectType $ev_registration_session
     * @return \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSessionType
     */
    public function setEv_registration_session(?\Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_registration_session_DataObjectType $ev_registration_session = null): self
    {
        $this->ev_registration_session = $ev_registration_session;
        
        return $this;
    }
    /**
     * Get ev_registration value
     * @return \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_registration_DataObjectType|null
     */
    public function getEv_registration(): ?\Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_registration_DataObjectType
    {
        return $this->ev_registration;
    }
    /**
     * Set ev_registration value
     * @param \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_registration_DataObjectType $ev_registration
     * @return \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSessionType
     */
    public function setEv_registration(?\Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_registration_DataObjectType $ev_registration = null): self
    {
        $this->ev_registration = $ev_registration;
        
        return $this;
    }
    /**
     * Get ev_session value
     * @return \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_session_DataObjectType|null
     */
    public function getEv_session(): ?\Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_session_DataObjectType
    {
        return $this->ev_session;
    }
    /**
     * Set ev_session value
     * @param \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_session_DataObjectType $ev_session
     * @return \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSessionType
     */
    public function setEv_session(?\Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_session_DataObjectType $ev_session = null): self
    {
        $this->ev_session = $ev_session;
        
        return $this;
    }
    /**
     * Get ev_track value
     * @return \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_track_DataObjectType|null
     */
    public function getEv_track(): ?\Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_track_DataObjectType
    {
        return $this->ev_track;
    }
    /**
     * Set ev_track value
     * @param \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_track_DataObjectType $ev_track
     * @return \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSessionType
     */
    public function setEv_track(?\Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_track_DataObjectType $ev_track = null): self
    {
        $this->ev_track = $ev_track;
        
        return $this;
    }
    /**
     * Get co_customer value
     * @return \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_co_customer_DataObjectType|null
     */
    public function getCo_customer(): ?\Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_co_customer_DataObjectType
    {
        return $this->co_customer;
    }
    /**
     * Set co_customer value
     * @param \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_co_customer_DataObjectType $co_customer
     * @return \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSessionType
     */
    public function setCo_customer(?\Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_co_customer_DataObjectType $co_customer = null): self
    {
        $this->co_customer = $co_customer;
        
        return $this;
    }
    /**
     * Get ev_event value
     * @return \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_event_DataObjectType|null
     */
    public function getEv_event(): ?\Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_event_DataObjectType
    {
        return $this->ev_event;
    }
    /**
     * Set ev_event value
     * @param \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_event_DataObjectType $ev_event
     * @return \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSessionType
     */
    public function setEv_event(?\Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSession_ev_event_DataObjectType $ev_event = null): self
    {
        $this->ev_event = $ev_event;
        
        return $this;
    }
    /**
     * Get CurrentKey value
     * An additional test has been added (isset) before returning the property value as
     * this property may have been unset before, due to the fact that this property is
     * removable from the request (nillable=true+minOccurs=0)
     * @return string|null
     */
    public function getCurrentKey(): ?string
    {
        return $this->CurrentKey ?? null;
    }
    /**
     * Set CurrentKey value
     * This property is removable from request (nillable=true+minOccurs=0), therefore
     * if the value assigned to this property is null, it is removed from this object
     * @param string $currentKey
     * @return \Drupal\netforum\xWeb\Generated\StructType\EventsRegistrantSessionType
     */
    public function setCurrentKey(?string $currentKey = null): self
    {
        // validation for constraint: string
        if (!is_null($currentKey) && !is_string($currentKey)) {
            throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($currentKey, true), gettype($currentKey)), __LINE__);
        }
        // validation for constraint: pattern([{]?[0-9a-fA-F]{8}[\-]?([0-9a-fA-F]{4}[\-]?){3}[0-9a-fA-F]{12}[}]?)
        if (!is_null($currentKey) && !preg_match('/[{]?[0-9a-fA-F]{8}[\\-]?([0-9a-fA-F]{4}[\\-]?){3}[0-9a-fA-F]{12}[}]?/', (string) $currentKey)) {
            throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a literal that is among the set of character sequences denoted by the regular expression /[{]?[0-9a-fA-F]{8}[\\-]?([0-9a-fA-F]{4}[\\-]?){3}[0-9a-fA-F]{12}[}]?/', var_export($currentKey, true)), __LINE__);
        }
        if (is_null($currentKey) || (is_array($currentKey) && empty($currentKey))) {
            unset($this->CurrentKey);
        } else {
            $this->CurrentKey = $currentKey;
        }
        
        return $this;
    }
}
