<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Crm.LoginDetail StructType
 * @subpackage Structs
 */
class Crm_LoginDetail extends AnyEntity
{
    /**
     * The ForceCreateLoginName
     * Meta information extracted from the WSDL
     * - documentation: Calculated.
     * - minOccurs: 0
     * - nillable: true
     * @var bool
     */
    public $ForceCreateLoginName;
    /**
     * The Name
     * Meta information extracted from the WSDL
     * - documentation: Calculated.
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $Name;
    /**
     * The Password
     * Meta information extracted from the WSDL
     * - documentation: Calculated.
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $Password;
    /**
     * The PasswordExpiresOn
     * Meta information extracted from the WSDL
     * - documentation: Calculated.
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $PasswordExpiresOn;
    /**
     * Constructor method for Crm.LoginDetail
     * @uses Crm_LoginDetail::setForceCreateLoginName()
     * @uses Crm_LoginDetail::setName()
     * @uses Crm_LoginDetail::setPassword()
     * @uses Crm_LoginDetail::setPasswordExpiresOn()
     * @param bool $forceCreateLoginName
     * @param string $name
     * @param string $password
     * @param string $passwordExpiresOn
     */
    public function __construct($forceCreateLoginName = null, $name = null, $password = null, $passwordExpiresOn = null)
    {
        $this
            ->setForceCreateLoginName($forceCreateLoginName)
            ->setName($name)
            ->setPassword($password)
            ->setPasswordExpiresOn($passwordExpiresOn);
    }
    /**
     * Get ForceCreateLoginName 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 bool|null
     */
    public function getForceCreateLoginName()
    {
        return isset($this->ForceCreateLoginName) ? $this->ForceCreateLoginName : null;
    }
    /**
     * Set ForceCreateLoginName 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 bool $forceCreateLoginName
     * @return \patest\StructType\Crm_LoginDetail
     */
    public function setForceCreateLoginName($forceCreateLoginName = null)
    {
        // validation for constraint: boolean
        if (!is_null($forceCreateLoginName) && !is_bool($forceCreateLoginName)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($forceCreateLoginName, true), gettype($forceCreateLoginName)), __LINE__);
        }
        if (is_null($forceCreateLoginName) || (is_array($forceCreateLoginName) && empty($forceCreateLoginName))) {
            unset($this->ForceCreateLoginName);
        } else {
            $this->ForceCreateLoginName = $forceCreateLoginName;
        }
        return $this;
    }
    /**
     * Get Name 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 getName()
    {
        return isset($this->Name) ? $this->Name : null;
    }
    /**
     * Set Name 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 $name
     * @return \patest\StructType\Crm_LoginDetail
     */
    public function setName($name = null)
    {
        // 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__);
        }
        if (is_null($name) || (is_array($name) && empty($name))) {
            unset($this->Name);
        } else {
            $this->Name = $name;
        }
        return $this;
    }
    /**
     * Get Password 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 getPassword()
    {
        return isset($this->Password) ? $this->Password : null;
    }
    /**
     * Set Password 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 $password
     * @return \patest\StructType\Crm_LoginDetail
     */
    public function setPassword($password = null)
    {
        // validation for constraint: string
        if (!is_null($password) && !is_string($password)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($password, true), gettype($password)), __LINE__);
        }
        if (is_null($password) || (is_array($password) && empty($password))) {
            unset($this->Password);
        } else {
            $this->Password = $password;
        }
        return $this;
    }
    /**
     * Get PasswordExpiresOn 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 getPasswordExpiresOn()
    {
        return isset($this->PasswordExpiresOn) ? $this->PasswordExpiresOn : null;
    }
    /**
     * Set PasswordExpiresOn 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 $passwordExpiresOn
     * @return \patest\StructType\Crm_LoginDetail
     */
    public function setPasswordExpiresOn($passwordExpiresOn = null)
    {
        // validation for constraint: string
        if (!is_null($passwordExpiresOn) && !is_string($passwordExpiresOn)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($passwordExpiresOn, true), gettype($passwordExpiresOn)), __LINE__);
        }
        if (is_null($passwordExpiresOn) || (is_array($passwordExpiresOn) && empty($passwordExpiresOn))) {
            unset($this->PasswordExpiresOn);
        } else {
            $this->PasswordExpiresOn = $passwordExpiresOn;
        }
        return $this;
    }
}
