<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for JPSOAP_HotelAvailContract StructType
 * @subpackage Structs
 */
class JPSOAP_HotelAvailContract extends JPSOAP_Contract
{
    /**
     * The OnRequestAllowedWithoutAllotment
     * Meta information extracted from the WSDL
     * - use: required
     * @var bool
     */
    public $OnRequestAllowedWithoutAllotment;
    /**
     * The Allotments
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \ArrayType\ArrayOfJPSOAP_HotelAvailAllotment
     */
    public $Allotments;
    /**
     * The StopSales
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \ArrayType\ArrayOfJPSOAP_HotelAvailStopSale
     */
    public $StopSales;
    /**
     * The Releases
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \StructType\JPSOAP_HotelAvailReleases
     */
    public $Releases;
    /**
     * Constructor method for JPSOAP_HotelAvailContract
     * @uses JPSOAP_HotelAvailContract::setOnRequestAllowedWithoutAllotment()
     * @uses JPSOAP_HotelAvailContract::setAllotments()
     * @uses JPSOAP_HotelAvailContract::setStopSales()
     * @uses JPSOAP_HotelAvailContract::setReleases()
     * @param bool $onRequestAllowedWithoutAllotment
     * @param \ArrayType\ArrayOfJPSOAP_HotelAvailAllotment $allotments
     * @param \ArrayType\ArrayOfJPSOAP_HotelAvailStopSale $stopSales
     * @param \StructType\JPSOAP_HotelAvailReleases $releases
     */
    public function __construct($onRequestAllowedWithoutAllotment = null, \ArrayType\ArrayOfJPSOAP_HotelAvailAllotment $allotments = null, \ArrayType\ArrayOfJPSOAP_HotelAvailStopSale $stopSales = null, \StructType\JPSOAP_HotelAvailReleases $releases = null)
    {
        $this
            ->setOnRequestAllowedWithoutAllotment($onRequestAllowedWithoutAllotment)
            ->setAllotments($allotments)
            ->setStopSales($stopSales)
            ->setReleases($releases);
    }
    /**
     * Get OnRequestAllowedWithoutAllotment value
     * @return bool
     */
    public function getOnRequestAllowedWithoutAllotment()
    {
        return $this->OnRequestAllowedWithoutAllotment;
    }
    /**
     * Set OnRequestAllowedWithoutAllotment value
     * @param bool $onRequestAllowedWithoutAllotment
     * @return \StructType\JPSOAP_HotelAvailContract
     */
    public function setOnRequestAllowedWithoutAllotment($onRequestAllowedWithoutAllotment = null)
    {
        // validation for constraint: boolean
        if (!is_null($onRequestAllowedWithoutAllotment) && !is_bool($onRequestAllowedWithoutAllotment)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($onRequestAllowedWithoutAllotment, true), gettype($onRequestAllowedWithoutAllotment)), __LINE__);
        }
        $this->OnRequestAllowedWithoutAllotment = $onRequestAllowedWithoutAllotment;
        return $this;
    }
    /**
     * Get Allotments value
     * @return \ArrayType\ArrayOfJPSOAP_HotelAvailAllotment|null
     */
    public function getAllotments()
    {
        return $this->Allotments;
    }
    /**
     * Set Allotments value
     * @param \ArrayType\ArrayOfJPSOAP_HotelAvailAllotment $allotments
     * @return \StructType\JPSOAP_HotelAvailContract
     */
    public function setAllotments(\ArrayType\ArrayOfJPSOAP_HotelAvailAllotment $allotments = null)
    {
        $this->Allotments = $allotments;
        return $this;
    }
    /**
     * Get StopSales value
     * @return \ArrayType\ArrayOfJPSOAP_HotelAvailStopSale|null
     */
    public function getStopSales()
    {
        return $this->StopSales;
    }
    /**
     * Set StopSales value
     * @param \ArrayType\ArrayOfJPSOAP_HotelAvailStopSale $stopSales
     * @return \StructType\JPSOAP_HotelAvailContract
     */
    public function setStopSales(\ArrayType\ArrayOfJPSOAP_HotelAvailStopSale $stopSales = null)
    {
        $this->StopSales = $stopSales;
        return $this;
    }
    /**
     * Get Releases value
     * @return \StructType\JPSOAP_HotelAvailReleases|null
     */
    public function getReleases()
    {
        return $this->Releases;
    }
    /**
     * Set Releases value
     * @param \StructType\JPSOAP_HotelAvailReleases $releases
     * @return \StructType\JPSOAP_HotelAvailContract
     */
    public function setReleases(\StructType\JPSOAP_HotelAvailReleases $releases = null)
    {
        $this->Releases = $releases;
        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_HotelAvailContract
     */
    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__;
    }
}
