<?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 informations extracted from the WSDL
     * - use: required
     * @var bool
     */
    public $ApplyAdditionals;
    /**
     * The ApplyChildren
     * Meta informations extracted from the WSDL
     * - use: required
     * @var bool
     */
    public $ApplyChildren;
    /**
     * The NonRefundable
     * Meta informations extracted from the WSDL
     * - use: required
     * @var bool
     */
    public $NonRefundable;
    /**
     * The ApplyWithOffers
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \ArrayType\ArrayOfJPSOAP_IntCodeAttr4
     */
    public $ApplyWithOffers;
    /**
     * The AlternateWithOffers
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \ArrayType\ArrayOfJPSOAP_IntCodeAttr4
     */
    public $AlternateWithOffers;
    /**
     * The MinAge
     * @var int
     */
    public $MinAge;
    /**
     * 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()
     * @param bool $applyAdditionals
     * @param bool $applyChildren
     * @param bool $nonRefundable
     * @param \ArrayType\ArrayOfJPSOAP_IntCodeAttr4 $applyWithOffers
     * @param \ArrayType\ArrayOfJPSOAP_IntCodeAttr4 $alternateWithOffers
     * @param int $minAge
     */
    public function __construct($applyAdditionals = null, $applyChildren = null, $nonRefundable = null, \ArrayType\ArrayOfJPSOAP_IntCodeAttr4 $applyWithOffers = null, \ArrayType\ArrayOfJPSOAP_IntCodeAttr4 $alternateWithOffers = null, $minAge = null)
    {
        $this
            ->setApplyAdditionals($applyAdditionals)
            ->setApplyChildren($applyChildren)
            ->setNonRefundable($nonRefundable)
            ->setApplyWithOffers($applyWithOffers)
            ->setAlternateWithOffers($alternateWithOffers)
            ->setMinAge($minAge);
    }
    /**
     * 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;
    }
    /**
     * 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 \StructType\JPSOAP_ApplicationRulesOffers
     */
    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__;
    }
}
