<?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\ArrayOfATSReportItem
     */
    public $FailureHistory;
    /**
     * Constructor method for ATSFailure
     * @uses ATSFailure::setHasTroubleCondition()
     * @uses ATSFailure::setFailureHistory()
     * @param bool $hasTroubleCondition
     * @param \CustomerManagement\ArrayType\ArrayOfATSReportItem $failureHistory
     */
    public function __construct($hasTroubleCondition = null, \CustomerManagement\ArrayType\ArrayOfATSReportItem $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\ArrayOfATSReportItem|null
     */
    public function getFailureHistory()
    {
        return $this->FailureHistory;
    }
    /**
     * Set FailureHistory value
     * @param \CustomerManagement\ArrayType\ArrayOfATSReportItem $failureHistory
     * @return \CustomerManagement\StructType\ATSFailure
     */
    public function setFailureHistory(\CustomerManagement\ArrayType\ArrayOfATSReportItem $failureHistory = null)
    {
        $this->FailureHistory = $failureHistory;
        return $this;
    }
}
