<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for JP_Destination StructType
 * @subpackage Structs
 */
class JP_Destination extends AbstractStructBase
{
    /**
     * The Name
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var string
     */
    public $Name;
    /**
     * The Hotels
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \ArrayType\ArrayOfJP_HotelSimpleInfo
     */
    public $Hotels;
    /**
     * The Code
     * @var string
     */
    public $Code;
    /**
     * The JPDCode
     * @var string
     */
    public $JPDCode;
    /**
     * The Type
     * @var string
     */
    public $Type;
    /**
     * The Route
     * @var string
     */
    public $Route;
    /**
     * Constructor method for JP_Destination
     * @uses JP_Destination::setName()
     * @uses JP_Destination::setHotels()
     * @uses JP_Destination::setCode()
     * @uses JP_Destination::setJPDCode()
     * @uses JP_Destination::setType()
     * @uses JP_Destination::setRoute()
     * @param string $name
     * @param \ArrayType\ArrayOfJP_HotelSimpleInfo $hotels
     * @param string $code
     * @param string $jPDCode
     * @param string $type
     * @param string $route
     */
    public function __construct($name = null, \ArrayType\ArrayOfJP_HotelSimpleInfo $hotels = null, $code = null, $jPDCode = null, $type = null, $route = null)
    {
        $this
            ->setName($name)
            ->setHotels($hotels)
            ->setCode($code)
            ->setJPDCode($jPDCode)
            ->setType($type)
            ->setRoute($route);
    }
    /**
     * Get Name value
     * @return string|null
     */
    public function getName()
    {
        return $this->Name;
    }
    /**
     * Set Name value
     * @param string $name
     * @return \StructType\JP_Destination
     */
    public function setName($name = null)
    {
        // validation for constraint: string
        if (!is_null($name) && !is_string($name)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($name, true), gettype($name)), __LINE__);
        }
        $this->Name = $name;
        return $this;
    }
    /**
     * Get Hotels value
     * @return \ArrayType\ArrayOfJP_HotelSimpleInfo|null
     */
    public function getHotels()
    {
        return $this->Hotels;
    }
    /**
     * Set Hotels value
     * @param \ArrayType\ArrayOfJP_HotelSimpleInfo $hotels
     * @return \StructType\JP_Destination
     */
    public function setHotels(\ArrayType\ArrayOfJP_HotelSimpleInfo $hotels = null)
    {
        $this->Hotels = $hotels;
        return $this;
    }
    /**
     * Get Code value
     * @return string|null
     */
    public function getCode()
    {
        return $this->Code;
    }
    /**
     * Set Code value
     * @param string $code
     * @return \StructType\JP_Destination
     */
    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;
    }
    /**
     * Get JPDCode value
     * @return string|null
     */
    public function getJPDCode()
    {
        return $this->JPDCode;
    }
    /**
     * Set JPDCode value
     * @param string $jPDCode
     * @return \StructType\JP_Destination
     */
    public function setJPDCode($jPDCode = null)
    {
        // validation for constraint: string
        if (!is_null($jPDCode) && !is_string($jPDCode)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($jPDCode, true), gettype($jPDCode)), __LINE__);
        }
        $this->JPDCode = $jPDCode;
        return $this;
    }
    /**
     * Get Type value
     * @return string|null
     */
    public function getType()
    {
        return $this->Type;
    }
    /**
     * Set Type value
     * @param string $type
     * @return \StructType\JP_Destination
     */
    public function setType($type = null)
    {
        // validation for constraint: string
        if (!is_null($type) && !is_string($type)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($type, true), gettype($type)), __LINE__);
        }
        $this->Type = $type;
        return $this;
    }
    /**
     * Get Route value
     * @return string|null
     */
    public function getRoute()
    {
        return $this->Route;
    }
    /**
     * Set Route value
     * @uses \EnumType\JP_RouteType::valueIsValid()
     * @uses \EnumType\JP_RouteType::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $route
     * @return \StructType\JP_Destination
     */
    public function setRoute($route = null)
    {
        // validation for constraint: enumeration
        if (!\EnumType\JP_RouteType::valueIsValid($route)) {
            throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \EnumType\JP_RouteType', is_array($route) ? implode(', ', $route) : var_export($route, true), implode(', ', \EnumType\JP_RouteType::getValidValues())), __LINE__);
        }
        $this->Route = $route;
        return $this;
    }
}
