<?php

namespace CustomerManagement\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for EventRecord StructType
 * @subpackage Structs
 */
class EventRecord extends AbstractStructBase
{
    /**
     * The Error
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 1
     * @var bool
     */
    public $Error;
    /**
     * The ErrorMessage
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var string
     */
    public $ErrorMessage;
    /**
     * The History
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \CustomerManagement\ArrayType\ArrayOfEventRecordItem
     */
    public $History;
    /**
     * Constructor method for EventRecord
     * @uses EventRecord::setError()
     * @uses EventRecord::setErrorMessage()
     * @uses EventRecord::setHistory()
     * @param bool $error
     * @param string $errorMessage
     * @param \CustomerManagement\ArrayType\ArrayOfEventRecordItem $history
     */
    public function __construct($error = null, $errorMessage = null, \CustomerManagement\ArrayType\ArrayOfEventRecordItem $history = null)
    {
        $this
            ->setError($error)
            ->setErrorMessage($errorMessage)
            ->setHistory($history);
    }
    /**
     * Get Error value
     * @return bool
     */
    public function getError()
    {
        return $this->Error;
    }
    /**
     * Set Error value
     * @param bool $error
     * @return \CustomerManagement\StructType\EventRecord
     */
    public function setError($error = null)
    {
        // validation for constraint: boolean
        if (!is_null($error) && !is_bool($error)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($error, true), gettype($error)), __LINE__);
        }
        $this->Error = $error;
        return $this;
    }
    /**
     * Get ErrorMessage value
     * @return string|null
     */
    public function getErrorMessage()
    {
        return $this->ErrorMessage;
    }
    /**
     * Set ErrorMessage value
     * @param string $errorMessage
     * @return \CustomerManagement\StructType\EventRecord
     */
    public function setErrorMessage($errorMessage = null)
    {
        // validation for constraint: string
        if (!is_null($errorMessage) && !is_string($errorMessage)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($errorMessage, true), gettype($errorMessage)), __LINE__);
        }
        $this->ErrorMessage = $errorMessage;
        return $this;
    }
    /**
     * Get History value
     * @return \CustomerManagement\ArrayType\ArrayOfEventRecordItem|null
     */
    public function getHistory()
    {
        return $this->History;
    }
    /**
     * Set History value
     * @param \CustomerManagement\ArrayType\ArrayOfEventRecordItem $history
     * @return \CustomerManagement\StructType\EventRecord
     */
    public function setHistory(\CustomerManagement\ArrayType\ArrayOfEventRecordItem $history = null)
    {
        $this->History = $history;
        return $this;
    }
}
