<?php

declare(strict_types=1);

namespace Drupal\netforum\xWeb\Generated\StructType;

use InvalidArgumentException;
use WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for MailingList 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 MailingList extends AbstractStructBase
{
    /**
     * The primary_key
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var string|null
     */
    protected ?string $primary_key = null;
    /**
     * The name
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var string|null
     */
    protected ?string $name = null;
    /**
     * The category
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var string|null
     */
    protected ?string $category = null;
    /**
     * Constructor method for MailingList
     * @uses MailingList::setPrimary_key()
     * @uses MailingList::setName()
     * @uses MailingList::setCategory()
     * @param string $primary_key
     * @param string $name
     * @param string $category
     */
    public function __construct(?string $primary_key = null, ?string $name = null, ?string $category = null)
    {
        $this
            ->setPrimary_key($primary_key)
            ->setName($name)
            ->setCategory($category);
    }
    /**
     * Get primary_key value
     * @return string|null
     */
    public function getPrimary_key(): ?string
    {
        return $this->primary_key;
    }
    /**
     * Set primary_key value
     * @param string $primary_key
     * @return \Drupal\netforum\xWeb\Generated\StructType\MailingList
     */
    public function setPrimary_key(?string $primary_key = null): self
    {
        // validation for constraint: string
        if (!is_null($primary_key) && !is_string($primary_key)) {
            throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($primary_key, true), gettype($primary_key)), __LINE__);
        }
        $this->primary_key = $primary_key;
        
        return $this;
    }
    /**
     * Get name value
     * @return string|null
     */
    public function getName(): ?string
    {
        return $this->name;
    }
    /**
     * Set name value
     * @param string $name
     * @return \Drupal\netforum\xWeb\Generated\StructType\MailingList
     */
    public function setName(?string $name = null): self
    {
        // validation for constraint: string
        if (!is_null($name) && !is_string($name)) {
            throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($name, true), gettype($name)), __LINE__);
        }
        $this->name = $name;
        
        return $this;
    }
    /**
     * Get category value
     * @return string|null
     */
    public function getCategory(): ?string
    {
        return $this->category;
    }
    /**
     * Set category value
     * @param string $category
     * @return \Drupal\netforum\xWeb\Generated\StructType\MailingList
     */
    public function setCategory(?string $category = null): self
    {
        // validation for constraint: string
        if (!is_null($category) && !is_string($category)) {
            throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($category, true), gettype($category)), __LINE__);
        }
        $this->category = $category;
        
        return $this;
    }
}
