<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for JPSOAP_ApplicationRulesOffers StructType
 * @subpackage Structs
 */
class JPSOAP_ApplicationRulesOffers extends JPSOAP_ApplicationRules
{
    /**
     * The ApplyAdditionals
     * Meta information extracted from the WSDL
     * - use: required
     * @var bool
     */
    public $ApplyAdditionals;
    /**
     * The ApplyChildren
     * Meta information extracted from the WSDL
     * - use: required
     * @var bool
     */
    public $ApplyChildren;
    /**
     * The NonRefundable
     * Meta information extracted from the WSDL
     * - use: required
     * @var bool
     */
    public $NonRefundable;
    /**
     * The ApplyWithOffers
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \ArrayType\ArrayOfJPSOAP_IntCodeAttr4
     */
    public $ApplyWithOffers;
    /**
     * The AlternateWithOffers
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \ArrayType\ArrayOfJPSOAP_IntCodeAttr4
     */
    public $AlternateWithOffers;
    /**
     * The MinAge
     * @var int
     */
    public $MinAge;
    /**
     * The CalculationBySeason
     * @var string
     */
    public $CalculationBySeason;
    /**
     * Constructor method for JPSOAP_ApplicationRulesOffers
     * @uses JPSOAP_ApplicationRulesOffers::setApplyAdditionals()
     * @uses JPSOAP_ApplicationRulesOffers::setApplyChildren()
     * @uses JPSOAP_ApplicationRulesOffers::setNonRefundable()
     * @uses JPSOAP_ApplicationRulesOffers::setApplyWithOffers()
     * @uses JPSOAP_ApplicationRulesOffers::setAlternateWithOffers()
     * @uses JPSOAP_ApplicationRulesOffers::setMinAge()
     * @uses JPSOAP_ApplicationRulesOffers::setCalculationBySeason()
     * @param bool $applyAdditionals
     * @param bool $applyChildren
     * @param bool $nonRefundable
     * @param \ArrayType\ArrayOfJPSOAP_IntCodeAttr4 $applyWithOffers
     * @param \ArrayType\ArrayOfJPSOAP_IntCodeAttr4 $alternateWithOffers
     * @param int $minAge
     * @param string $calculationBySeason
     */
    public function __construct($applyAdditionals = null, $applyChildren = null, $nonRefundable = null, \ArrayType\ArrayOfJPSOAP_IntCodeAttr4 $applyWithOffers = null, \ArrayType\ArrayOfJPSOAP_IntCodeAttr4 $alternateWithOffers = null, $minAge = null, $calculationBySeason = null)
    {
        $this
            ->setApplyAdditionals($applyAdditionals)
            ->setApplyChildren($applyChildren)
            ->setNonRefundable($nonRefundable)
            ->setApplyWithOffers($applyWithOffers)
            ->setAlternateWithOffers($alternateWithOffers)
            ->setMinAge($minAge)
            ->setCalculationBySeason($calculationBySeason);
    }
    /**
     * Get ApplyAdditionals value
     * @return bool
     */
    public function getApplyAdditionals()
    {
        return $this->ApplyAdditionals;
    }
    /**
     * Set ApplyAdditionals value
     * @param bool $applyAdditionals
     * @return \StructType\JPSOAP_ApplicationRulesOffers
     */
    public function setApplyAdditionals($applyAdditionals = null)
    {
        // validation for constraint: boolean
        if (!is_null($applyAdditionals) && !is_bool($applyAdditionals)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($applyAdditionals, true), gettype($applyAdditionals)), __LINE__);
        }
        $this->ApplyAdditionals = $applyAdditionals;
        return $this;
    }
    /**
     * Get ApplyChildren value
     * @return bool
     */
    public function getApplyChildren()
    {
        return $this->ApplyChildren;
    }
    /**
     * Set ApplyChildren value
     * @param bool $applyChildren
     * @return \StructType\JPSOAP_ApplicationRulesOffers
     */
    public function setApplyChildren($applyChildren = null)
    {
        // validation for constraint: boolean
        if (!is_null($applyChildren) && !is_bool($applyChildren)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($applyChildren, true), gettype($applyChildren)), __LINE__);
        }
        $this->ApplyChildren = $applyChildren;
        return $this;
    }
    /**
     * Get NonRefundable value
     * @return bool
     */
    public function getNonRefundable()
    {
        return $this->NonRefundable;
    }
    /**
     * Set NonRefundable value
     * @param bool $nonRefundable
     * @return \StructType\JPSOAP_ApplicationRulesOffers
     */
    public function setNonRefundable($nonRefundable = null)
    {
        // validation for constraint: boolean
        if (!is_null($nonRefundable) && !is_bool($nonRefundable)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($nonRefundable, true), gettype($nonRefundable)), __LINE__);
        }
        $this->NonRefundable = $nonRefundable;
        return $this;
    }
    /**
     * Get ApplyWithOffers value
     * @return \ArrayType\ArrayOfJPSOAP_IntCodeAttr4|null
     */
    public function getApplyWithOffers()
    {
        return $this->ApplyWithOffers;
    }
    /**
     * Set ApplyWithOffers value
     * @param \ArrayType\ArrayOfJPSOAP_IntCodeAttr4 $applyWithOffers
     * @return \StructType\JPSOAP_ApplicationRulesOffers
     */
    public function setApplyWithOffers(\ArrayType\ArrayOfJPSOAP_IntCodeAttr4 $applyWithOffers = null)
    {
        $this->ApplyWithOffers = $applyWithOffers;
        return $this;
    }
    /**
     * Get AlternateWithOffers value
     * @return \ArrayType\ArrayOfJPSOAP_IntCodeAttr4|null
     */
    public function getAlternateWithOffers()
    {
        return $this->AlternateWithOffers;
    }
    /**
     * Set AlternateWithOffers value
     * @param \ArrayType\ArrayOfJPSOAP_IntCodeAttr4 $alternateWithOffers
     * @return \StructType\JPSOAP_ApplicationRulesOffers
     */
    public function setAlternateWithOffers(\ArrayType\ArrayOfJPSOAP_IntCodeAttr4 $alternateWithOffers = null)
    {
        $this->AlternateWithOffers = $alternateWithOffers;
        return $this;
    }
    /**
     * Get MinAge value
     * @return int|null
     */
    public function getMinAge()
    {
        return $this->MinAge;
    }
    /**
     * Set MinAge value
     * @param int $minAge
     * @return \StructType\JPSOAP_ApplicationRulesOffers
     */
    public function setMinAge($minAge = null)
    {
        // validation for constraint: int
        if (!is_null($minAge) && !(is_int($minAge) || ctype_digit($minAge))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($minAge, true), gettype($minAge)), __LINE__);
        }
        $this->MinAge = $minAge;
        return $this;
    }
    /**
     * Get CalculationBySeason value
     * @return string|null
     */
    public function getCalculationBySeason()
    {
        return $this->CalculationBySeason;
    }
    /**
     * Set CalculationBySeason value
     * @uses \EnumType\JPSOAP_CalculationBySeason::valueIsValid()
     * @uses \EnumType\JPSOAP_CalculationBySeason::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $calculationBySeason
     * @return \StructType\JPSOAP_ApplicationRulesOffers
     */
    public function setCalculationBySeason($calculationBySeason = null)
    {
        // validation for constraint: enumeration
        if (!\EnumType\JPSOAP_CalculationBySeason::valueIsValid($calculationBySeason)) {
            throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \EnumType\JPSOAP_CalculationBySeason', is_array($calculationBySeason) ? implode(', ', $calculationBySeason) : var_export($calculationBySeason, true), implode(', ', \EnumType\JPSOAP_CalculationBySeason::getValidValues())), __LINE__);
        }
        $this->CalculationBySeason = $calculationBySeason;
        return $this;
    }
}
