<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for JPSOAP_hotelRatePlanCancellationPolicy StructType
 * @subpackage Structs
 */
class JPSOAP_hotelRatePlanCancellationPolicy extends AbstractStructBase
{
    /**
     * The Code
     * Meta informations extracted from the WSDL
     * - use: required
     * @var int
     */
    public $Code;
    /**
     * The Priority
     * Meta informations extracted from the WSDL
     * - use: required
     * @var int
     */
    public $Priority;
    /**
     * The OnlyEarlyBooking
     * Meta informations extracted from the WSDL
     * - use: required
     * @var bool
     */
    public $OnlyEarlyBooking;
    /**
     * The NonRefundable
     * Meta informations extracted from the WSDL
     * - use: required
     * @var bool
     */
    public $NonRefundable;
    /**
     * The Name
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var string
     */
    public $Name;
    /**
     * The Description
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var string
     */
    public $Description;
    /**
     * The BookingDate
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \StructType\JPSOAP_DateIntervals
     */
    public $BookingDate;
    /**
     * The CheckInDates
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \StructType\JPSOAP_DateIntervalsGroupsStayDates
     */
    public $CheckInDates;
    /**
     * The Rules
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \ArrayType\ArrayOfJPSOAP_hotelRatePlanCancellationPolicyRule
     */
    public $Rules;
    /**
     * The Currency
     * @var string
     */
    public $Currency;
    /**
     * Constructor method for JPSOAP_hotelRatePlanCancellationPolicy
     * @uses JPSOAP_hotelRatePlanCancellationPolicy::setCode()
     * @uses JPSOAP_hotelRatePlanCancellationPolicy::setPriority()
     * @uses JPSOAP_hotelRatePlanCancellationPolicy::setOnlyEarlyBooking()
     * @uses JPSOAP_hotelRatePlanCancellationPolicy::setNonRefundable()
     * @uses JPSOAP_hotelRatePlanCancellationPolicy::setName()
     * @uses JPSOAP_hotelRatePlanCancellationPolicy::setDescription()
     * @uses JPSOAP_hotelRatePlanCancellationPolicy::setBookingDate()
     * @uses JPSOAP_hotelRatePlanCancellationPolicy::setCheckInDates()
     * @uses JPSOAP_hotelRatePlanCancellationPolicy::setRules()
     * @uses JPSOAP_hotelRatePlanCancellationPolicy::setCurrency()
     * @param int $code
     * @param int $priority
     * @param bool $onlyEarlyBooking
     * @param bool $nonRefundable
     * @param string $name
     * @param string $description
     * @param \StructType\JPSOAP_DateIntervals $bookingDate
     * @param \StructType\JPSOAP_DateIntervalsGroupsStayDates $checkInDates
     * @param \ArrayType\ArrayOfJPSOAP_hotelRatePlanCancellationPolicyRule $rules
     * @param string $currency
     */
    public function __construct($code = null, $priority = null, $onlyEarlyBooking = null, $nonRefundable = null, $name = null, $description = null, \StructType\JPSOAP_DateIntervals $bookingDate = null, \StructType\JPSOAP_DateIntervalsGroupsStayDates $checkInDates = null, \ArrayType\ArrayOfJPSOAP_hotelRatePlanCancellationPolicyRule $rules = null, $currency = null)
    {
        $this
            ->setCode($code)
            ->setPriority($priority)
            ->setOnlyEarlyBooking($onlyEarlyBooking)
            ->setNonRefundable($nonRefundable)
            ->setName($name)
            ->setDescription($description)
            ->setBookingDate($bookingDate)
            ->setCheckInDates($checkInDates)
            ->setRules($rules)
            ->setCurrency($currency);
    }
    /**
     * Get Code value
     * @return int
     */
    public function getCode()
    {
        return $this->Code;
    }
    /**
     * Set Code value
     * @param int $code
     * @return \StructType\JPSOAP_hotelRatePlanCancellationPolicy
     */
    public function setCode($code = null)
    {
        // validation for constraint: int
        if (!is_null($code) && !is_numeric($code)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($code)), __LINE__);
        }
        $this->Code = $code;
        return $this;
    }
    /**
     * Get Priority value
     * @return int
     */
    public function getPriority()
    {
        return $this->Priority;
    }
    /**
     * Set Priority value
     * @param int $priority
     * @return \StructType\JPSOAP_hotelRatePlanCancellationPolicy
     */
    public function setPriority($priority = null)
    {
        // validation for constraint: int
        if (!is_null($priority) && !is_numeric($priority)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($priority)), __LINE__);
        }
        $this->Priority = $priority;
        return $this;
    }
    /**
     * Get OnlyEarlyBooking value
     * @return bool
     */
    public function getOnlyEarlyBooking()
    {
        return $this->OnlyEarlyBooking;
    }
    /**
     * Set OnlyEarlyBooking value
     * @param bool $onlyEarlyBooking
     * @return \StructType\JPSOAP_hotelRatePlanCancellationPolicy
     */
    public function setOnlyEarlyBooking($onlyEarlyBooking = null)
    {
        // validation for constraint: boolean
        if (!is_null($onlyEarlyBooking) && !is_bool($onlyEarlyBooking)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($onlyEarlyBooking)), __LINE__);
        }
        $this->OnlyEarlyBooking = $onlyEarlyBooking;
        return $this;
    }
    /**
     * Get NonRefundable value
     * @return bool
     */
    public function getNonRefundable()
    {
        return $this->NonRefundable;
    }
    /**
     * Set NonRefundable value
     * @param bool $nonRefundable
     * @return \StructType\JPSOAP_hotelRatePlanCancellationPolicy
     */
    public function setNonRefundable($nonRefundable = null)
    {
        // validation for constraint: boolean
        if (!is_null($nonRefundable) && !is_bool($nonRefundable)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($nonRefundable)), __LINE__);
        }
        $this->NonRefundable = $nonRefundable;
        return $this;
    }
    /**
     * Get Name value
     * @return string|null
     */
    public function getName()
    {
        return $this->Name;
    }
    /**
     * Set Name value
     * @param string $name
     * @return \StructType\JPSOAP_hotelRatePlanCancellationPolicy
     */
    public function setName($name = null)
    {
        // validation for constraint: string
        if (!is_null($name) && !is_string($name)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($name)), __LINE__);
        }
        $this->Name = $name;
        return $this;
    }
    /**
     * Get Description value
     * @return string|null
     */
    public function getDescription()
    {
        return $this->Description;
    }
    /**
     * Set Description value
     * @param string $description
     * @return \StructType\JPSOAP_hotelRatePlanCancellationPolicy
     */
    public function setDescription($description = null)
    {
        // validation for constraint: string
        if (!is_null($description) && !is_string($description)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($description)), __LINE__);
        }
        $this->Description = $description;
        return $this;
    }
    /**
     * Get BookingDate value
     * @return \StructType\JPSOAP_DateIntervals|null
     */
    public function getBookingDate()
    {
        return $this->BookingDate;
    }
    /**
     * Set BookingDate value
     * @param \StructType\JPSOAP_DateIntervals $bookingDate
     * @return \StructType\JPSOAP_hotelRatePlanCancellationPolicy
     */
    public function setBookingDate(\StructType\JPSOAP_DateIntervals $bookingDate = null)
    {
        $this->BookingDate = $bookingDate;
        return $this;
    }
    /**
     * Get CheckInDates value
     * @return \StructType\JPSOAP_DateIntervalsGroupsStayDates|null
     */
    public function getCheckInDates()
    {
        return $this->CheckInDates;
    }
    /**
     * Set CheckInDates value
     * @param \StructType\JPSOAP_DateIntervalsGroupsStayDates $checkInDates
     * @return \StructType\JPSOAP_hotelRatePlanCancellationPolicy
     */
    public function setCheckInDates(\StructType\JPSOAP_DateIntervalsGroupsStayDates $checkInDates = null)
    {
        $this->CheckInDates = $checkInDates;
        return $this;
    }
    /**
     * Get Rules value
     * @return \ArrayType\ArrayOfJPSOAP_hotelRatePlanCancellationPolicyRule|null
     */
    public function getRules()
    {
        return $this->Rules;
    }
    /**
     * Set Rules value
     * @param \ArrayType\ArrayOfJPSOAP_hotelRatePlanCancellationPolicyRule $rules
     * @return \StructType\JPSOAP_hotelRatePlanCancellationPolicy
     */
    public function setRules(\ArrayType\ArrayOfJPSOAP_hotelRatePlanCancellationPolicyRule $rules = null)
    {
        $this->Rules = $rules;
        return $this;
    }
    /**
     * Get Currency value
     * @return string|null
     */
    public function getCurrency()
    {
        return $this->Currency;
    }
    /**
     * Set Currency value
     * @param string $currency
     * @return \StructType\JPSOAP_hotelRatePlanCancellationPolicy
     */
    public function setCurrency($currency = null)
    {
        // validation for constraint: string
        if (!is_null($currency) && !is_string($currency)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($currency)), __LINE__);
        }
        $this->Currency = $currency;
        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_hotelRatePlanCancellationPolicy
     */
    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__;
    }
}
