<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for JP_SearchSegmentItinerary StructType
 * @subpackage Structs
 */
class JP_SearchSegmentItinerary extends AbstractStructBase
{
    /**
     * The CountryOfResidence
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var string
     */
    public $CountryOfResidence;
    /**
     * The ShipCode
     * @var string
     */
    public $ShipCode;
    /**
     * The Zone
     * @var int
     */
    public $Zone;
    /**
     * The Start
     * @var string
     */
    public $Start;
    /**
     * The End
     * @var string
     */
    public $End;
    /**
     * The Duration
     * @var string
     */
    public $Duration;
    /**
     * The CruiseCode
     * @var string
     */
    public $CruiseCode;
    /**
     * The ItineraryCode
     * @var string
     */
    public $ItineraryCode;
    /**
     * Constructor method for JP_SearchSegmentItinerary
     * @uses JP_SearchSegmentItinerary::setCountryOfResidence()
     * @uses JP_SearchSegmentItinerary::setShipCode()
     * @uses JP_SearchSegmentItinerary::setZone()
     * @uses JP_SearchSegmentItinerary::setStart()
     * @uses JP_SearchSegmentItinerary::setEnd()
     * @uses JP_SearchSegmentItinerary::setDuration()
     * @uses JP_SearchSegmentItinerary::setCruiseCode()
     * @uses JP_SearchSegmentItinerary::setItineraryCode()
     * @param string $countryOfResidence
     * @param string $shipCode
     * @param int $zone
     * @param string $start
     * @param string $end
     * @param string $duration
     * @param string $cruiseCode
     * @param string $itineraryCode
     */
    public function __construct($countryOfResidence = null, $shipCode = null, $zone = null, $start = null, $end = null, $duration = null, $cruiseCode = null, $itineraryCode = null)
    {
        $this
            ->setCountryOfResidence($countryOfResidence)
            ->setShipCode($shipCode)
            ->setZone($zone)
            ->setStart($start)
            ->setEnd($end)
            ->setDuration($duration)
            ->setCruiseCode($cruiseCode)
            ->setItineraryCode($itineraryCode);
    }
    /**
     * Get CountryOfResidence value
     * @return string|null
     */
    public function getCountryOfResidence()
    {
        return $this->CountryOfResidence;
    }
    /**
     * Set CountryOfResidence value
     * @param string $countryOfResidence
     * @return \StructType\JP_SearchSegmentItinerary
     */
    public function setCountryOfResidence($countryOfResidence = null)
    {
        // validation for constraint: string
        if (!is_null($countryOfResidence) && !is_string($countryOfResidence)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($countryOfResidence)), __LINE__);
        }
        $this->CountryOfResidence = $countryOfResidence;
        return $this;
    }
    /**
     * Get ShipCode value
     * @return string|null
     */
    public function getShipCode()
    {
        return $this->ShipCode;
    }
    /**
     * Set ShipCode value
     * @param string $shipCode
     * @return \StructType\JP_SearchSegmentItinerary
     */
    public function setShipCode($shipCode = null)
    {
        // validation for constraint: string
        if (!is_null($shipCode) && !is_string($shipCode)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($shipCode)), __LINE__);
        }
        $this->ShipCode = $shipCode;
        return $this;
    }
    /**
     * Get Zone value
     * @return int|null
     */
    public function getZone()
    {
        return $this->Zone;
    }
    /**
     * Set Zone value
     * @param int $zone
     * @return \StructType\JP_SearchSegmentItinerary
     */
    public function setZone($zone = null)
    {
        // validation for constraint: int
        if (!is_null($zone) && !is_numeric($zone)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($zone)), __LINE__);
        }
        $this->Zone = $zone;
        return $this;
    }
    /**
     * Get Start value
     * @return string|null
     */
    public function getStart()
    {
        return $this->Start;
    }
    /**
     * Set Start value
     * @param string $start
     * @return \StructType\JP_SearchSegmentItinerary
     */
    public function setStart($start = null)
    {
        // validation for constraint: string
        if (!is_null($start) && !is_string($start)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($start)), __LINE__);
        }
        $this->Start = $start;
        return $this;
    }
    /**
     * Get End value
     * @return string|null
     */
    public function getEnd()
    {
        return $this->End;
    }
    /**
     * Set End value
     * @param string $end
     * @return \StructType\JP_SearchSegmentItinerary
     */
    public function setEnd($end = null)
    {
        // validation for constraint: string
        if (!is_null($end) && !is_string($end)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($end)), __LINE__);
        }
        $this->End = $end;
        return $this;
    }
    /**
     * Get Duration value
     * @return string|null
     */
    public function getDuration()
    {
        return $this->Duration;
    }
    /**
     * Set Duration value
     * @uses \EnumType\JP_CruiseDuration::valueIsValid()
     * @uses \EnumType\JP_CruiseDuration::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $duration
     * @return \StructType\JP_SearchSegmentItinerary
     */
    public function setDuration($duration = null)
    {
        // validation for constraint: enumeration
        if (!\EnumType\JP_CruiseDuration::valueIsValid($duration)) {
            throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $duration, implode(', ', \EnumType\JP_CruiseDuration::getValidValues())), __LINE__);
        }
        $this->Duration = $duration;
        return $this;
    }
    /**
     * Get CruiseCode value
     * @return string|null
     */
    public function getCruiseCode()
    {
        return $this->CruiseCode;
    }
    /**
     * Set CruiseCode value
     * @param string $cruiseCode
     * @return \StructType\JP_SearchSegmentItinerary
     */
    public function setCruiseCode($cruiseCode = null)
    {
        // validation for constraint: string
        if (!is_null($cruiseCode) && !is_string($cruiseCode)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cruiseCode)), __LINE__);
        }
        $this->CruiseCode = $cruiseCode;
        return $this;
    }
    /**
     * Get ItineraryCode value
     * @return string|null
     */
    public function getItineraryCode()
    {
        return $this->ItineraryCode;
    }
    /**
     * Set ItineraryCode value
     * @param string $itineraryCode
     * @return \StructType\JP_SearchSegmentItinerary
     */
    public function setItineraryCode($itineraryCode = null)
    {
        // validation for constraint: string
        if (!is_null($itineraryCode) && !is_string($itineraryCode)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($itineraryCode)), __LINE__);
        }
        $this->ItineraryCode = $itineraryCode;
        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_SearchSegmentItinerary
     */
    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__;
    }
}
