<?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 FailureHistory
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \CustomerManagement\ArrayType\ArrayOfEventDatetimePair
     */
    public $FailureHistory;
    /**
     * Constructor method for ATSFailure
     * @uses ATSFailure::setHasTroubleCondition()
     * @uses ATSFailure::setFailureHistory()
     * @param bool $hasTroubleCondition
     * @param \CustomerManagement\ArrayType\ArrayOfEventDatetimePair $failureHistory
     */
    public function __construct($hasTroubleCondition = null, \CustomerManagement\ArrayType\ArrayOfEventDatetimePair $failureHistory = null)
    {
        $this
            ->setHasTroubleCondition($hasTroubleCondition)
            ->setFailureHistory($failureHistory);
    }
    /**
     * 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 FailureHistory value
     * @return \CustomerManagement\ArrayType\ArrayOfEventDatetimePair|null
     */
    public function getFailureHistory()
    {
        return $this->FailureHistory;
    }
    /**
     * Set FailureHistory value
     * @param \CustomerManagement\ArrayType\ArrayOfEventDatetimePair $failureHistory
     * @return \CustomerManagement\StructType\ATSFailure
     */
    public function setFailureHistory(\CustomerManagement\ArrayType\ArrayOfEventDatetimePair $failureHistory = null)
    {
        $this->FailureHistory = $failureHistory;
        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__;
    }
}
