<?php

declare(strict_types=1);

namespace Drupal\netforum\xWeb\Generated\StructType;

use InvalidArgumentException;
use WsdlToPhp\PackageBase\AbstractStructBase;

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