<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for JP_CancellationPolicyRules StructType
 * @subpackage Structs
 */
class JP_CancellationPolicyRules extends AbstractStructBase
{
    /**
     * The FirstDayCostCancellation
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \StructType\JP_FirstDayCostCancellation
     */
    public $FirstDayCostCancellation;
    /**
     * The Description
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var string
     */
    public $Description;
    /**
     * The PolicyRules
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \ArrayType\ArrayOfJP_Rule
     */
    public $PolicyRules;
    /**
     * The CurrencyCode
     * @var string
     */
    public $CurrencyCode;
    /**
     * Constructor method for JP_CancellationPolicyRules
     * @uses JP_CancellationPolicyRules::setFirstDayCostCancellation()
     * @uses JP_CancellationPolicyRules::setDescription()
     * @uses JP_CancellationPolicyRules::setPolicyRules()
     * @uses JP_CancellationPolicyRules::setCurrencyCode()
     * @param \StructType\JP_FirstDayCostCancellation $firstDayCostCancellation
     * @param string $description
     * @param \ArrayType\ArrayOfJP_Rule $policyRules
     * @param string $currencyCode
     */
    public function __construct(\StructType\JP_FirstDayCostCancellation $firstDayCostCancellation = null, $description = null, \ArrayType\ArrayOfJP_Rule $policyRules = null, $currencyCode = null)
    {
        $this
            ->setFirstDayCostCancellation($firstDayCostCancellation)
            ->setDescription($description)
            ->setPolicyRules($policyRules)
            ->setCurrencyCode($currencyCode);
    }
    /**
     * Get FirstDayCostCancellation value
     * @return \StructType\JP_FirstDayCostCancellation|null
     */
    public function getFirstDayCostCancellation()
    {
        return $this->FirstDayCostCancellation;
    }
    /**
     * Set FirstDayCostCancellation value
     * @param \StructType\JP_FirstDayCostCancellation $firstDayCostCancellation
     * @return \StructType\JP_CancellationPolicyRules
     */
    public function setFirstDayCostCancellation(\StructType\JP_FirstDayCostCancellation $firstDayCostCancellation = null)
    {
        $this->FirstDayCostCancellation = $firstDayCostCancellation;
        return $this;
    }
    /**
     * Get Description value
     * @return string|null
     */
    public function getDescription()
    {
        return $this->Description;
    }
    /**
     * Set Description value
     * @param string $description
     * @return \StructType\JP_CancellationPolicyRules
     */
    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 PolicyRules value
     * @return \ArrayType\ArrayOfJP_Rule|null
     */
    public function getPolicyRules()
    {
        return $this->PolicyRules;
    }
    /**
     * Set PolicyRules value
     * @param \ArrayType\ArrayOfJP_Rule $policyRules
     * @return \StructType\JP_CancellationPolicyRules
     */
    public function setPolicyRules(\ArrayType\ArrayOfJP_Rule $policyRules = null)
    {
        $this->PolicyRules = $policyRules;
        return $this;
    }
    /**
     * Get CurrencyCode value
     * @return string|null
     */
    public function getCurrencyCode()
    {
        return $this->CurrencyCode;
    }
    /**
     * Set CurrencyCode value
     * @param string $currencyCode
     * @return \StructType\JP_CancellationPolicyRules
     */
    public function setCurrencyCode($currencyCode = null)
    {
        // validation for constraint: string
        if (!is_null($currencyCode) && !is_string($currencyCode)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($currencyCode)), __LINE__);
        }
        $this->CurrencyCode = $currencyCode;
        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\JP_CancellationPolicyRules
     */
    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__;
    }
}
