<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for JP_PackageRequest StructType
 * @subpackage Structs
 */
class JP_PackageRequest extends AbstractStructBase
{
    /**
     * The SearchSegmentsPackages
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \StructType\JP_SearchSegmentsPackages
     */
    public $SearchSegmentsPackages;
    /**
     * The RelPaxesDist
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \ArrayType\ArrayOfJP_RelPaxDist
     */
    public $RelPaxesDist;
    /**
     * The RatePlanCode
     * @var string
     */
    public $RatePlanCode;
    /**
     * Constructor method for JP_PackageRequest
     * @uses JP_PackageRequest::setSearchSegmentsPackages()
     * @uses JP_PackageRequest::setRelPaxesDist()
     * @uses JP_PackageRequest::setRatePlanCode()
     * @param \StructType\JP_SearchSegmentsPackages $searchSegmentsPackages
     * @param \ArrayType\ArrayOfJP_RelPaxDist $relPaxesDist
     * @param string $ratePlanCode
     */
    public function __construct(\StructType\JP_SearchSegmentsPackages $searchSegmentsPackages = null, \ArrayType\ArrayOfJP_RelPaxDist $relPaxesDist = null, $ratePlanCode = null)
    {
        $this
            ->setSearchSegmentsPackages($searchSegmentsPackages)
            ->setRelPaxesDist($relPaxesDist)
            ->setRatePlanCode($ratePlanCode);
    }
    /**
     * Get SearchSegmentsPackages value
     * @return \StructType\JP_SearchSegmentsPackages|null
     */
    public function getSearchSegmentsPackages()
    {
        return $this->SearchSegmentsPackages;
    }
    /**
     * Set SearchSegmentsPackages value
     * @param \StructType\JP_SearchSegmentsPackages $searchSegmentsPackages
     * @return \StructType\JP_PackageRequest
     */
    public function setSearchSegmentsPackages(\StructType\JP_SearchSegmentsPackages $searchSegmentsPackages = null)
    {
        $this->SearchSegmentsPackages = $searchSegmentsPackages;
        return $this;
    }
    /**
     * Get RelPaxesDist value
     * @return \ArrayType\ArrayOfJP_RelPaxDist|null
     */
    public function getRelPaxesDist()
    {
        return $this->RelPaxesDist;
    }
    /**
     * Set RelPaxesDist value
     * @param \ArrayType\ArrayOfJP_RelPaxDist $relPaxesDist
     * @return \StructType\JP_PackageRequest
     */
    public function setRelPaxesDist(\ArrayType\ArrayOfJP_RelPaxDist $relPaxesDist = null)
    {
        $this->RelPaxesDist = $relPaxesDist;
        return $this;
    }
    /**
     * Get RatePlanCode value
     * @return string|null
     */
    public function getRatePlanCode()
    {
        return $this->RatePlanCode;
    }
    /**
     * Set RatePlanCode value
     * @param string $ratePlanCode
     * @return \StructType\JP_PackageRequest
     */
    public function setRatePlanCode($ratePlanCode = null)
    {
        // validation for constraint: string
        if (!is_null($ratePlanCode) && !is_string($ratePlanCode)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($ratePlanCode)), __LINE__);
        }
        $this->RatePlanCode = $ratePlanCode;
        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_PackageRequest
     */
    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__;
    }
}
