<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for JPSOAP_hotelRatePlanRate StructType
 * @subpackage Structs
 */
class JPSOAP_hotelRatePlanRate extends AbstractStructBase
{
    /**
     * The StayDates
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \ArrayType\ArrayOfJPSOAP_DateIntervals
     */
    public $StayDates;
    /**
     * The RateDiscounts
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \StructType\JPSOAP_RateDiscounts
     */
    public $RateDiscounts;
    /**
     * The RatePrices
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \ArrayType\ArrayOfJPSOAP_RatePrice
     */
    public $RatePrices;
    /**
     * The Ages
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \StructType\JPSOAP_Ages
     */
    public $Ages;
    /**
     * The Code
     * @var string
     */
    public $Code;
    /**
     * Constructor method for JPSOAP_hotelRatePlanRate
     * @uses JPSOAP_hotelRatePlanRate::setStayDates()
     * @uses JPSOAP_hotelRatePlanRate::setRateDiscounts()
     * @uses JPSOAP_hotelRatePlanRate::setRatePrices()
     * @uses JPSOAP_hotelRatePlanRate::setAges()
     * @uses JPSOAP_hotelRatePlanRate::setCode()
     * @param \ArrayType\ArrayOfJPSOAP_DateIntervals $stayDates
     * @param \StructType\JPSOAP_RateDiscounts $rateDiscounts
     * @param \ArrayType\ArrayOfJPSOAP_RatePrice $ratePrices
     * @param \StructType\JPSOAP_Ages $ages
     * @param string $code
     */
    public function __construct(\ArrayType\ArrayOfJPSOAP_DateIntervals $stayDates = null, \StructType\JPSOAP_RateDiscounts $rateDiscounts = null, \ArrayType\ArrayOfJPSOAP_RatePrice $ratePrices = null, \StructType\JPSOAP_Ages $ages = null, $code = null)
    {
        $this
            ->setStayDates($stayDates)
            ->setRateDiscounts($rateDiscounts)
            ->setRatePrices($ratePrices)
            ->setAges($ages)
            ->setCode($code);
    }
    /**
     * Get StayDates value
     * @return \ArrayType\ArrayOfJPSOAP_DateIntervals|null
     */
    public function getStayDates()
    {
        return $this->StayDates;
    }
    /**
     * Set StayDates value
     * @param \ArrayType\ArrayOfJPSOAP_DateIntervals $stayDates
     * @return \StructType\JPSOAP_hotelRatePlanRate
     */
    public function setStayDates(\ArrayType\ArrayOfJPSOAP_DateIntervals $stayDates = null)
    {
        $this->StayDates = $stayDates;
        return $this;
    }
    /**
     * Get RateDiscounts value
     * @return \StructType\JPSOAP_RateDiscounts|null
     */
    public function getRateDiscounts()
    {
        return $this->RateDiscounts;
    }
    /**
     * Set RateDiscounts value
     * @param \StructType\JPSOAP_RateDiscounts $rateDiscounts
     * @return \StructType\JPSOAP_hotelRatePlanRate
     */
    public function setRateDiscounts(\StructType\JPSOAP_RateDiscounts $rateDiscounts = null)
    {
        $this->RateDiscounts = $rateDiscounts;
        return $this;
    }
    /**
     * Get RatePrices value
     * @return \ArrayType\ArrayOfJPSOAP_RatePrice|null
     */
    public function getRatePrices()
    {
        return $this->RatePrices;
    }
    /**
     * Set RatePrices value
     * @param \ArrayType\ArrayOfJPSOAP_RatePrice $ratePrices
     * @return \StructType\JPSOAP_hotelRatePlanRate
     */
    public function setRatePrices(\ArrayType\ArrayOfJPSOAP_RatePrice $ratePrices = null)
    {
        $this->RatePrices = $ratePrices;
        return $this;
    }
    /**
     * Get Ages value
     * @return \StructType\JPSOAP_Ages|null
     */
    public function getAges()
    {
        return $this->Ages;
    }
    /**
     * Set Ages value
     * @param \StructType\JPSOAP_Ages $ages
     * @return \StructType\JPSOAP_hotelRatePlanRate
     */
    public function setAges(\StructType\JPSOAP_Ages $ages = null)
    {
        $this->Ages = $ages;
        return $this;
    }
    /**
     * Get Code value
     * @return string|null
     */
    public function getCode()
    {
        return $this->Code;
    }
    /**
     * Set Code value
     * @param string $code
     * @return \StructType\JPSOAP_hotelRatePlanRate
     */
    public function setCode($code = null)
    {
        // validation for constraint: string
        if (!is_null($code) && !is_string($code)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($code, true), gettype($code)), __LINE__);
        }
        $this->Code = $code;
        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_hotelRatePlanRate
     */
    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__;
    }
}
