<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for OTA_VehRateRuleRSRateRulesCancelPenaltyInfo StructType
 * @package Dg
 * @subpackage Structs
 */
class DgOTA_VehRateRuleRSRateRulesCancelPenaltyInfo extends AbstractStructBase
{
    /**
     * The Deadline
     * Meta informations extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \dgsoft\StructType\DgOTA_VehRateRuleRSRateRulesCancelPenaltyInfoDeadline[]
     */
    public $Deadline;
    /**
     * The PenaltyFee
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \dgsoft\StructType\DgOTA_VehRateRuleRSRateRulesCancelPenaltyInfoPenaltyFee
     */
    public $PenaltyFee;
    /**
     * The Description
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \dgsoft\StructType\DgFormattedTextTextType
     */
    public $Description;
    /**
     * The GuaranteeRequiredInd
     * @var bool
     */
    public $GuaranteeRequiredInd;
    /**
     * The ModifyPenaltyInd
     * @var bool
     */
    public $ModifyPenaltyInd;
    /**
     * Constructor method for OTA_VehRateRuleRSRateRulesCancelPenaltyInfo
     * @uses DgOTA_VehRateRuleRSRateRulesCancelPenaltyInfo::setDeadline()
     * @uses DgOTA_VehRateRuleRSRateRulesCancelPenaltyInfo::setPenaltyFee()
     * @uses DgOTA_VehRateRuleRSRateRulesCancelPenaltyInfo::setDescription()
     * @uses DgOTA_VehRateRuleRSRateRulesCancelPenaltyInfo::setGuaranteeRequiredInd()
     * @uses DgOTA_VehRateRuleRSRateRulesCancelPenaltyInfo::setModifyPenaltyInd()
     * @param \dgsoft\StructType\DgOTA_VehRateRuleRSRateRulesCancelPenaltyInfoDeadline[] $deadline
     * @param \dgsoft\StructType\DgOTA_VehRateRuleRSRateRulesCancelPenaltyInfoPenaltyFee $penaltyFee
     * @param \dgsoft\StructType\DgFormattedTextTextType $description
     * @param bool $guaranteeRequiredInd
     * @param bool $modifyPenaltyInd
     */
    public function __construct(array $deadline = array(), \dgsoft\StructType\DgOTA_VehRateRuleRSRateRulesCancelPenaltyInfoPenaltyFee $penaltyFee = null, \dgsoft\StructType\DgFormattedTextTextType $description = null, $guaranteeRequiredInd = null, $modifyPenaltyInd = null)
    {
        $this
            ->setDeadline($deadline)
            ->setPenaltyFee($penaltyFee)
            ->setDescription($description)
            ->setGuaranteeRequiredInd($guaranteeRequiredInd)
            ->setModifyPenaltyInd($modifyPenaltyInd);
    }
    /**
     * Get Deadline value
     * @return \dgsoft\StructType\DgOTA_VehRateRuleRSRateRulesCancelPenaltyInfoDeadline[]|null
     */
    public function getDeadline()
    {
        return $this->Deadline;
    }
    /**
     * Set Deadline value
     * @throws \InvalidArgumentException
     * @param \dgsoft\StructType\DgOTA_VehRateRuleRSRateRulesCancelPenaltyInfoDeadline[] $deadline
     * @return \dgsoft\StructType\DgOTA_VehRateRuleRSRateRulesCancelPenaltyInfo
     */
    public function setDeadline(array $deadline = array())
    {
        foreach ($deadline as $oTA_VehRateRuleRSRateRulesCancelPenaltyInfoDeadlineItem) {
            // validation for constraint: itemType
            if (!$oTA_VehRateRuleRSRateRulesCancelPenaltyInfoDeadlineItem instanceof \dgsoft\StructType\DgOTA_VehRateRuleRSRateRulesCancelPenaltyInfoDeadline) {
                throw new \InvalidArgumentException(sprintf('The Deadline property can only contain items of \dgsoft\StructType\DgOTA_VehRateRuleRSRateRulesCancelPenaltyInfoDeadline, "%s" given', is_object($oTA_VehRateRuleRSRateRulesCancelPenaltyInfoDeadlineItem) ? get_class($oTA_VehRateRuleRSRateRulesCancelPenaltyInfoDeadlineItem) : gettype($oTA_VehRateRuleRSRateRulesCancelPenaltyInfoDeadlineItem)), __LINE__);
            }
        }
        $this->Deadline = $deadline;
        return $this;
    }
    /**
     * Add item to Deadline value
     * @throws \InvalidArgumentException
     * @param \dgsoft\StructType\DgOTA_VehRateRuleRSRateRulesCancelPenaltyInfoDeadline $item
     * @return \dgsoft\StructType\DgOTA_VehRateRuleRSRateRulesCancelPenaltyInfo
     */
    public function addToDeadline(\dgsoft\StructType\DgOTA_VehRateRuleRSRateRulesCancelPenaltyInfoDeadline $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \dgsoft\StructType\DgOTA_VehRateRuleRSRateRulesCancelPenaltyInfoDeadline) {
            throw new \InvalidArgumentException(sprintf('The Deadline property can only contain items of \dgsoft\StructType\DgOTA_VehRateRuleRSRateRulesCancelPenaltyInfoDeadline, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->Deadline[] = $item;
        return $this;
    }
    /**
     * Get PenaltyFee value
     * @return \dgsoft\StructType\DgOTA_VehRateRuleRSRateRulesCancelPenaltyInfoPenaltyFee|null
     */
    public function getPenaltyFee()
    {
        return $this->PenaltyFee;
    }
    /**
     * Set PenaltyFee value
     * @param \dgsoft\StructType\DgOTA_VehRateRuleRSRateRulesCancelPenaltyInfoPenaltyFee $penaltyFee
     * @return \dgsoft\StructType\DgOTA_VehRateRuleRSRateRulesCancelPenaltyInfo
     */
    public function setPenaltyFee(\dgsoft\StructType\DgOTA_VehRateRuleRSRateRulesCancelPenaltyInfoPenaltyFee $penaltyFee = null)
    {
        $this->PenaltyFee = $penaltyFee;
        return $this;
    }
    /**
     * Get Description value
     * @return \dgsoft\StructType\DgFormattedTextTextType|null
     */
    public function getDescription()
    {
        return $this->Description;
    }
    /**
     * Set Description value
     * @param \dgsoft\StructType\DgFormattedTextTextType $description
     * @return \dgsoft\StructType\DgOTA_VehRateRuleRSRateRulesCancelPenaltyInfo
     */
    public function setDescription(\dgsoft\StructType\DgFormattedTextTextType $description = null)
    {
        $this->Description = $description;
        return $this;
    }
    /**
     * Get GuaranteeRequiredInd value
     * @return bool|null
     */
    public function getGuaranteeRequiredInd()
    {
        return $this->GuaranteeRequiredInd;
    }
    /**
     * Set GuaranteeRequiredInd value
     * @param bool $guaranteeRequiredInd
     * @return \dgsoft\StructType\DgOTA_VehRateRuleRSRateRulesCancelPenaltyInfo
     */
    public function setGuaranteeRequiredInd($guaranteeRequiredInd = null)
    {
        // validation for constraint: boolean
        if (!is_null($guaranteeRequiredInd) && !is_bool($guaranteeRequiredInd)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($guaranteeRequiredInd)), __LINE__);
        }
        $this->GuaranteeRequiredInd = $guaranteeRequiredInd;
        return $this;
    }
    /**
     * Get ModifyPenaltyInd value
     * @return bool|null
     */
    public function getModifyPenaltyInd()
    {
        return $this->ModifyPenaltyInd;
    }
    /**
     * Set ModifyPenaltyInd value
     * @param bool $modifyPenaltyInd
     * @return \dgsoft\StructType\DgOTA_VehRateRuleRSRateRulesCancelPenaltyInfo
     */
    public function setModifyPenaltyInd($modifyPenaltyInd = null)
    {
        // validation for constraint: boolean
        if (!is_null($modifyPenaltyInd) && !is_bool($modifyPenaltyInd)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($modifyPenaltyInd)), __LINE__);
        }
        $this->ModifyPenaltyInd = $modifyPenaltyInd;
        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 \dgsoft\StructType\DgOTA_VehRateRuleRSRateRulesCancelPenaltyInfo
     */
    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__;
    }
}
