<?php

declare(strict_types=1);

namespace Drupal\netforum\xWeb\Generated\StructType;

use InvalidArgumentException;
use WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for InvoiceDetailCustomerType 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 InvoiceDetailCustomerType extends AbstractStructBase
{
    /**
     * The Invoice_Detail_Liability
     * @var \Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Invoice_Detail_Liability_DataObjectType|null
     */
    protected ?\Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Invoice_Detail_Liability_DataObjectType $Invoice_Detail_Liability = null;
    /**
     * The Invoice_Detail_Liability_View
     * @var \Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Invoice_Detail_Liability_View_DataObjectType|null
     */
    protected ?\Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Invoice_Detail_Liability_View_DataObjectType $Invoice_Detail_Liability_View = null;
    /**
     * The Invoice_Detail
     * @var \Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Invoice_Detail_DataObjectType|null
     */
    protected ?\Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Invoice_Detail_DataObjectType $Invoice_Detail = null;
    /**
     * The Price
     * @var \Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Price_DataObjectType|null
     */
    protected ?\Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Price_DataObjectType $Price = 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 InvoiceDetailCustomerType
     * @uses InvoiceDetailCustomerType::setInvoice_Detail_Liability()
     * @uses InvoiceDetailCustomerType::setInvoice_Detail_Liability_View()
     * @uses InvoiceDetailCustomerType::setInvoice_Detail()
     * @uses InvoiceDetailCustomerType::setPrice()
     * @uses InvoiceDetailCustomerType::setCurrentKey()
     * @param \Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Invoice_Detail_Liability_DataObjectType $invoice_Detail_Liability
     * @param \Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Invoice_Detail_Liability_View_DataObjectType $invoice_Detail_Liability_View
     * @param \Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Invoice_Detail_DataObjectType $invoice_Detail
     * @param \Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Price_DataObjectType $price
     * @param string $currentKey
     */
    public function __construct(?\Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Invoice_Detail_Liability_DataObjectType $invoice_Detail_Liability = null, ?\Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Invoice_Detail_Liability_View_DataObjectType $invoice_Detail_Liability_View = null, ?\Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Invoice_Detail_DataObjectType $invoice_Detail = null, ?\Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Price_DataObjectType $price = null, ?string $currentKey = null)
    {
        $this
            ->setInvoice_Detail_Liability($invoice_Detail_Liability)
            ->setInvoice_Detail_Liability_View($invoice_Detail_Liability_View)
            ->setInvoice_Detail($invoice_Detail)
            ->setPrice($price)
            ->setCurrentKey($currentKey);
    }
    /**
     * Get Invoice_Detail_Liability value
     * @return \Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Invoice_Detail_Liability_DataObjectType|null
     */
    public function getInvoice_Detail_Liability(): ?\Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Invoice_Detail_Liability_DataObjectType
    {
        return $this->Invoice_Detail_Liability;
    }
    /**
     * Set Invoice_Detail_Liability value
     * @param \Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Invoice_Detail_Liability_DataObjectType $invoice_Detail_Liability
     * @return \Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomerType
     */
    public function setInvoice_Detail_Liability(?\Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Invoice_Detail_Liability_DataObjectType $invoice_Detail_Liability = null): self
    {
        $this->Invoice_Detail_Liability = $invoice_Detail_Liability;
        
        return $this;
    }
    /**
     * Get Invoice_Detail_Liability_View value
     * @return \Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Invoice_Detail_Liability_View_DataObjectType|null
     */
    public function getInvoice_Detail_Liability_View(): ?\Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Invoice_Detail_Liability_View_DataObjectType
    {
        return $this->Invoice_Detail_Liability_View;
    }
    /**
     * Set Invoice_Detail_Liability_View value
     * @param \Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Invoice_Detail_Liability_View_DataObjectType $invoice_Detail_Liability_View
     * @return \Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomerType
     */
    public function setInvoice_Detail_Liability_View(?\Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Invoice_Detail_Liability_View_DataObjectType $invoice_Detail_Liability_View = null): self
    {
        $this->Invoice_Detail_Liability_View = $invoice_Detail_Liability_View;
        
        return $this;
    }
    /**
     * Get Invoice_Detail value
     * @return \Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Invoice_Detail_DataObjectType|null
     */
    public function getInvoice_Detail(): ?\Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Invoice_Detail_DataObjectType
    {
        return $this->Invoice_Detail;
    }
    /**
     * Set Invoice_Detail value
     * @param \Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Invoice_Detail_DataObjectType $invoice_Detail
     * @return \Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomerType
     */
    public function setInvoice_Detail(?\Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Invoice_Detail_DataObjectType $invoice_Detail = null): self
    {
        $this->Invoice_Detail = $invoice_Detail;
        
        return $this;
    }
    /**
     * Get Price value
     * @return \Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Price_DataObjectType|null
     */
    public function getPrice(): ?\Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Price_DataObjectType
    {
        return $this->Price;
    }
    /**
     * Set Price value
     * @param \Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Price_DataObjectType $price
     * @return \Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomerType
     */
    public function setPrice(?\Drupal\netforum\xWeb\Generated\StructType\InvoiceDetailCustomer_Price_DataObjectType $price = null): self
    {
        $this->Price = $price;
        
        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\InvoiceDetailCustomerType
     */
    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;
    }
}
