<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for JPSOAP_hotelRatePlanCancellationPolicyRule StructType
 * @subpackage Structs
 */
class JPSOAP_hotelRatePlanCancellationPolicyRule extends AbstractStructBase
{
    /**
     * The Type
     * Meta information extracted from the WSDL
     * - use: required
     * @var string
     */
    public $Type;
    /**
     * The ApplicationTypeNights
     * Meta information extracted from the WSDL
     * - use: required
     * @var string
     */
    public $ApplicationTypeNights;
    /**
     * The From
     * @var int
     */
    public $From;
    /**
     * The To
     * @var int
     */
    public $To;
    /**
     * The StayLengthFrom
     * @var int
     */
    public $StayLengthFrom;
    /**
     * The StayLengthTo
     * @var int
     */
    public $StayLengthTo;
    /**
     * The FixedPrice
     * @var float
     */
    public $FixedPrice;
    /**
     * The PercentPrice
     * @var float
     */
    public $PercentPrice;
    /**
     * The Nights
     * @var int
     */
    public $Nights;
    /**
     * Constructor method for JPSOAP_hotelRatePlanCancellationPolicyRule
     * @uses JPSOAP_hotelRatePlanCancellationPolicyRule::setType()
     * @uses JPSOAP_hotelRatePlanCancellationPolicyRule::setApplicationTypeNights()
     * @uses JPSOAP_hotelRatePlanCancellationPolicyRule::setFrom()
     * @uses JPSOAP_hotelRatePlanCancellationPolicyRule::setTo()
     * @uses JPSOAP_hotelRatePlanCancellationPolicyRule::setStayLengthFrom()
     * @uses JPSOAP_hotelRatePlanCancellationPolicyRule::setStayLengthTo()
     * @uses JPSOAP_hotelRatePlanCancellationPolicyRule::setFixedPrice()
     * @uses JPSOAP_hotelRatePlanCancellationPolicyRule::setPercentPrice()
     * @uses JPSOAP_hotelRatePlanCancellationPolicyRule::setNights()
     * @param string $type
     * @param string $applicationTypeNights
     * @param int $from
     * @param int $to
     * @param int $stayLengthFrom
     * @param int $stayLengthTo
     * @param float $fixedPrice
     * @param float $percentPrice
     * @param int $nights
     */
    public function __construct($type = null, $applicationTypeNights = null, $from = null, $to = null, $stayLengthFrom = null, $stayLengthTo = null, $fixedPrice = null, $percentPrice = null, $nights = null)
    {
        $this
            ->setType($type)
            ->setApplicationTypeNights($applicationTypeNights)
            ->setFrom($from)
            ->setTo($to)
            ->setStayLengthFrom($stayLengthFrom)
            ->setStayLengthTo($stayLengthTo)
            ->setFixedPrice($fixedPrice)
            ->setPercentPrice($percentPrice)
            ->setNights($nights);
    }
    /**
     * Get Type value
     * @return string
     */
    public function getType()
    {
        return $this->Type;
    }
    /**
     * Set Type value
     * @uses \EnumType\JPSOAP_CancellationPolicyRuleTypes::valueIsValid()
     * @uses \EnumType\JPSOAP_CancellationPolicyRuleTypes::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $type
     * @return \StructType\JPSOAP_hotelRatePlanCancellationPolicyRule
     */
    public function setType($type = null)
    {
        // validation for constraint: enumeration
        if (!\EnumType\JPSOAP_CancellationPolicyRuleTypes::valueIsValid($type)) {
            throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \EnumType\JPSOAP_CancellationPolicyRuleTypes', is_array($type) ? implode(', ', $type) : var_export($type, true), implode(', ', \EnumType\JPSOAP_CancellationPolicyRuleTypes::getValidValues())), __LINE__);
        }
        $this->Type = $type;
        return $this;
    }
    /**
     * Get ApplicationTypeNights value
     * @return string
     */
    public function getApplicationTypeNights()
    {
        return $this->ApplicationTypeNights;
    }
    /**
     * Set ApplicationTypeNights value
     * @uses \EnumType\JPSOAP_CancellationPolicyRuleQuotationType::valueIsValid()
     * @uses \EnumType\JPSOAP_CancellationPolicyRuleQuotationType::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $applicationTypeNights
     * @return \StructType\JPSOAP_hotelRatePlanCancellationPolicyRule
     */
    public function setApplicationTypeNights($applicationTypeNights = null)
    {
        // validation for constraint: enumeration
        if (!\EnumType\JPSOAP_CancellationPolicyRuleQuotationType::valueIsValid($applicationTypeNights)) {
            throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \EnumType\JPSOAP_CancellationPolicyRuleQuotationType', is_array($applicationTypeNights) ? implode(', ', $applicationTypeNights) : var_export($applicationTypeNights, true), implode(', ', \EnumType\JPSOAP_CancellationPolicyRuleQuotationType::getValidValues())), __LINE__);
        }
        $this->ApplicationTypeNights = $applicationTypeNights;
        return $this;
    }
    /**
     * Get From value
     * @return int|null
     */
    public function getFrom()
    {
        return $this->From;
    }
    /**
     * Set From value
     * @param int $from
     * @return \StructType\JPSOAP_hotelRatePlanCancellationPolicyRule
     */
    public function setFrom($from = null)
    {
        // validation for constraint: int
        if (!is_null($from) && !(is_int($from) || ctype_digit($from))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($from, true), gettype($from)), __LINE__);
        }
        $this->From = $from;
        return $this;
    }
    /**
     * Get To value
     * @return int|null
     */
    public function getTo()
    {
        return $this->To;
    }
    /**
     * Set To value
     * @param int $to
     * @return \StructType\JPSOAP_hotelRatePlanCancellationPolicyRule
     */
    public function setTo($to = null)
    {
        // validation for constraint: int
        if (!is_null($to) && !(is_int($to) || ctype_digit($to))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($to, true), gettype($to)), __LINE__);
        }
        $this->To = $to;
        return $this;
    }
    /**
     * Get StayLengthFrom value
     * @return int|null
     */
    public function getStayLengthFrom()
    {
        return $this->StayLengthFrom;
    }
    /**
     * Set StayLengthFrom value
     * @param int $stayLengthFrom
     * @return \StructType\JPSOAP_hotelRatePlanCancellationPolicyRule
     */
    public function setStayLengthFrom($stayLengthFrom = null)
    {
        // validation for constraint: int
        if (!is_null($stayLengthFrom) && !(is_int($stayLengthFrom) || ctype_digit($stayLengthFrom))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($stayLengthFrom, true), gettype($stayLengthFrom)), __LINE__);
        }
        $this->StayLengthFrom = $stayLengthFrom;
        return $this;
    }
    /**
     * Get StayLengthTo value
     * @return int|null
     */
    public function getStayLengthTo()
    {
        return $this->StayLengthTo;
    }
    /**
     * Set StayLengthTo value
     * @param int $stayLengthTo
     * @return \StructType\JPSOAP_hotelRatePlanCancellationPolicyRule
     */
    public function setStayLengthTo($stayLengthTo = null)
    {
        // validation for constraint: int
        if (!is_null($stayLengthTo) && !(is_int($stayLengthTo) || ctype_digit($stayLengthTo))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($stayLengthTo, true), gettype($stayLengthTo)), __LINE__);
        }
        $this->StayLengthTo = $stayLengthTo;
        return $this;
    }
    /**
     * Get FixedPrice value
     * @return float|null
     */
    public function getFixedPrice()
    {
        return $this->FixedPrice;
    }
    /**
     * Set FixedPrice value
     * @param float $fixedPrice
     * @return \StructType\JPSOAP_hotelRatePlanCancellationPolicyRule
     */
    public function setFixedPrice($fixedPrice = null)
    {
        // validation for constraint: float
        if (!is_null($fixedPrice) && !(is_float($fixedPrice) || is_numeric($fixedPrice))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a float value, %s given', var_export($fixedPrice, true), gettype($fixedPrice)), __LINE__);
        }
        $this->FixedPrice = $fixedPrice;
        return $this;
    }
    /**
     * Get PercentPrice value
     * @return float|null
     */
    public function getPercentPrice()
    {
        return $this->PercentPrice;
    }
    /**
     * Set PercentPrice value
     * @param float $percentPrice
     * @return \StructType\JPSOAP_hotelRatePlanCancellationPolicyRule
     */
    public function setPercentPrice($percentPrice = null)
    {
        // validation for constraint: float
        if (!is_null($percentPrice) && !(is_float($percentPrice) || is_numeric($percentPrice))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a float value, %s given', var_export($percentPrice, true), gettype($percentPrice)), __LINE__);
        }
        $this->PercentPrice = $percentPrice;
        return $this;
    }
    /**
     * Get Nights value
     * @return int|null
     */
    public function getNights()
    {
        return $this->Nights;
    }
    /**
     * Set Nights value
     * @param int $nights
     * @return \StructType\JPSOAP_hotelRatePlanCancellationPolicyRule
     */
    public function setNights($nights = null)
    {
        // validation for constraint: int
        if (!is_null($nights) && !(is_int($nights) || ctype_digit($nights))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($nights, true), gettype($nights)), __LINE__);
        }
        $this->Nights = $nights;
        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_hotelRatePlanCancellationPolicyRule
     */
    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__;
    }
}
