<?php

namespace CustomerManagement\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for ATSFailure StructType
 * @subpackage Structs
 */
class ATSFailure extends AbstractStructBase
{
    /**
     * The HasTroubleCondition
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 1
     * @var bool
     */
    public $HasTroubleCondition;
    /**
     * The History
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \CustomerManagement\ArrayType\ArrayOfEventDatetimePair
     */
    public $History;
    /**
     * Constructor method for ATSFailure
     * @uses ATSFailure::setHasTroubleCondition()
     * @uses ATSFailure::setHistory()
     * @param bool $hasTroubleCondition
     * @param \CustomerManagement\ArrayType\ArrayOfEventDatetimePair $history
     */
    public function __construct($hasTroubleCondition = null, \CustomerManagement\ArrayType\ArrayOfEventDatetimePair $history = null)
    {
        $this
            ->setHasTroubleCondition($hasTroubleCondition)
            ->setHistory($history);
    }
    /**
     * Get HasTroubleCondition value
     * @return bool
     */
    public function getHasTroubleCondition()
    {
        return $this->HasTroubleCondition;
    }
    /**
     * Set HasTroubleCondition value
     * @param bool $hasTroubleCondition
     * @return \CustomerManagement\StructType\ATSFailure
     */
    public function setHasTroubleCondition($hasTroubleCondition = null)
    {
        // validation for constraint: boolean
        if (!is_null($hasTroubleCondition) && !is_bool($hasTroubleCondition)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($hasTroubleCondition, true), gettype($hasTroubleCondition)), __LINE__);
        }
        $this->HasTroubleCondition = $hasTroubleCondition;
        return $this;
    }
    /**
     * Get History value
     * @return \CustomerManagement\ArrayType\ArrayOfEventDatetimePair|null
     */
    public function getHistory()
    {
        return $this->History;
    }
    /**
     * Set History value
     * @param \CustomerManagement\ArrayType\ArrayOfEventDatetimePair $history
     * @return \CustomerManagement\StructType\ATSFailure
     */
    public function setHistory(\CustomerManagement\ArrayType\ArrayOfEventDatetimePair $history = null)
    {
        $this->History = $history;
        return $this;
    }
    /**
     * Method called when an object has been exported with var_export() functions
     * It allows to return an object instantiated with the values
     * @see AbstractStructBase::__set_state()
     * @uses AbstractStructBase::__set_state()
     * @param array $array the exported values
     * @return \CustomerManagement\StructType\ATSFailure
     */
    public static function __set_state(array $array)
    {
        return parent::__set_state($array);
    }
    /**
     * Method returning the class name
     * @return string __CLASS__
     */
    public function __toString()
    {
        return __CLASS__;
    }
}
