<?php

namespace CustomerManagement\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for GenerateLoginToken_v2 StructType
 * @subpackage Structs
 */
class GenerateLoginToken_v2 extends AbstractStructBase
{
    /**
     * The recordLoginasEvent
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 1
     * @var bool
     */
    public $recordLoginasEvent;
    /**
     * The loginName
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var string
     */
    public $loginName;
    /**
     * Constructor method for GenerateLoginToken_v2
     * @uses GenerateLoginToken_v2::setRecordLoginasEvent()
     * @uses GenerateLoginToken_v2::setLoginName()
     * @param bool $recordLoginasEvent
     * @param string $loginName
     */
    public function __construct($recordLoginasEvent = null, $loginName = null)
    {
        $this
            ->setRecordLoginasEvent($recordLoginasEvent)
            ->setLoginName($loginName);
    }
    /**
     * Get recordLoginasEvent value
     * @return bool
     */
    public function getRecordLoginasEvent()
    {
        return $this->recordLoginasEvent;
    }
    /**
     * Set recordLoginasEvent value
     * @param bool $recordLoginasEvent
     * @return \CustomerManagement\StructType\GenerateLoginToken_v2
     */
    public function setRecordLoginasEvent($recordLoginasEvent = null)
    {
        // validation for constraint: boolean
        if (!is_null($recordLoginasEvent) && !is_bool($recordLoginasEvent)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($recordLoginasEvent, true), gettype($recordLoginasEvent)), __LINE__);
        }
        $this->recordLoginasEvent = $recordLoginasEvent;
        return $this;
    }
    /**
     * Get loginName value
     * @return string|null
     */
    public function getLoginName()
    {
        return $this->loginName;
    }
    /**
     * Set loginName value
     * @param string $loginName
     * @return \CustomerManagement\StructType\GenerateLoginToken_v2
     */
    public function setLoginName($loginName = null)
    {
        // validation for constraint: string
        if (!is_null($loginName) && !is_string($loginName)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($loginName, true), gettype($loginName)), __LINE__);
        }
        $this->loginName = $loginName;
        return $this;
    }
}
