<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for JPSOAP_HotelRatePlanRestriction StructType
 * @subpackage Structs
 */
class JPSOAP_HotelRatePlanRestriction extends JPSOAP_BaseSupleOfferRest
{
    /**
     * The Type
     * Meta information extracted from the WSDL
     * - use: required
     * @var string
     */
    public $Type;
    /**
     * The Packaged
     * Meta information extracted from the WSDL
     * - use: required
     * @var bool
     */
    public $Packaged;
    /**
     * The ApplicationRules
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \StructType\JPSOAP_ApplicationRules
     */
    public $ApplicationRules;
    /**
     * Constructor method for JPSOAP_HotelRatePlanRestriction
     * @uses JPSOAP_HotelRatePlanRestriction::setType()
     * @uses JPSOAP_HotelRatePlanRestriction::setPackaged()
     * @uses JPSOAP_HotelRatePlanRestriction::setApplicationRules()
     * @param string $type
     * @param bool $packaged
     * @param \StructType\JPSOAP_ApplicationRules $applicationRules
     */
    public function __construct($type = null, $packaged = null, \StructType\JPSOAP_ApplicationRules $applicationRules = null)
    {
        $this
            ->setType($type)
            ->setPackaged($packaged)
            ->setApplicationRules($applicationRules);
    }
    /**
     * Get Type value
     * @return string
     */
    public function getType()
    {
        return $this->Type;
    }
    /**
     * Set Type value
     * @uses \EnumType\JPSOAP_RestrictionType::valueIsValid()
     * @uses \EnumType\JPSOAP_RestrictionType::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $type
     * @return \StructType\JPSOAP_HotelRatePlanRestriction
     */
    public function setType($type = null)
    {
        // validation for constraint: enumeration
        if (!\EnumType\JPSOAP_RestrictionType::valueIsValid($type)) {
            throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \EnumType\JPSOAP_RestrictionType', is_array($type) ? implode(', ', $type) : var_export($type, true), implode(', ', \EnumType\JPSOAP_RestrictionType::getValidValues())), __LINE__);
        }
        $this->Type = $type;
        return $this;
    }
    /**
     * Get Packaged value
     * @return bool
     */
    public function getPackaged()
    {
        return $this->Packaged;
    }
    /**
     * Set Packaged value
     * @param bool $packaged
     * @return \StructType\JPSOAP_HotelRatePlanRestriction
     */
    public function setPackaged($packaged = null)
    {
        // validation for constraint: boolean
        if (!is_null($packaged) && !is_bool($packaged)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($packaged, true), gettype($packaged)), __LINE__);
        }
        $this->Packaged = $packaged;
        return $this;
    }
    /**
     * Get ApplicationRules value
     * @return \StructType\JPSOAP_ApplicationRules|null
     */
    public function getApplicationRules()
    {
        return $this->ApplicationRules;
    }
    /**
     * Set ApplicationRules value
     * @param \StructType\JPSOAP_ApplicationRules $applicationRules
     * @return \StructType\JPSOAP_HotelRatePlanRestriction
     */
    public function setApplicationRules(\StructType\JPSOAP_ApplicationRules $applicationRules = null)
    {
        $this->ApplicationRules = $applicationRules;
        return $this;
    }
}
