<?php

declare(strict_types=1);

namespace Drupal\netforum\xWeb\Generated\StructType;

use InvalidArgumentException;
use WsdlToPhp\PackageBase\AbstractStructBase;

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