<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for JP_TransportItem StructType
 * @subpackage Structs
 */
class JP_TransportItem extends JP_BaseItem
{
    /**
     * The Routes
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \StructType\JP_TransportRoutes
     */
    public $Routes;
    /**
     * The AdditionalElements
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \StructType\JP_AdditionalElements
     */
    public $AdditionalElements;
    /**
     * The RelPaxes
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \ArrayType\ArrayOfJP_RelPax
     */
    public $RelPaxes;
    /**
     * The Ticketing
     * @var bool
     */
    public $Ticketing;
    /**
     * The Direction
     * @var string
     */
    public $Direction;
    /**
     * Constructor method for JP_TransportItem
     * @uses JP_TransportItem::setRoutes()
     * @uses JP_TransportItem::setAdditionalElements()
     * @uses JP_TransportItem::setRelPaxes()
     * @uses JP_TransportItem::setTicketing()
     * @uses JP_TransportItem::setDirection()
     * @param \StructType\JP_TransportRoutes $routes
     * @param \StructType\JP_AdditionalElements $additionalElements
     * @param \ArrayType\ArrayOfJP_RelPax $relPaxes
     * @param bool $ticketing
     * @param string $direction
     */
    public function __construct(\StructType\JP_TransportRoutes $routes = null, \StructType\JP_AdditionalElements $additionalElements = null, \ArrayType\ArrayOfJP_RelPax $relPaxes = null, $ticketing = null, $direction = null)
    {
        $this
            ->setRoutes($routes)
            ->setAdditionalElements($additionalElements)
            ->setRelPaxes($relPaxes)
            ->setTicketing($ticketing)
            ->setDirection($direction);
    }
    /**
     * Get Routes value
     * @return \StructType\JP_TransportRoutes|null
     */
    public function getRoutes()
    {
        return $this->Routes;
    }
    /**
     * Set Routes value
     * @param \StructType\JP_TransportRoutes $routes
     * @return \StructType\JP_TransportItem
     */
    public function setRoutes(\StructType\JP_TransportRoutes $routes = null)
    {
        $this->Routes = $routes;
        return $this;
    }
    /**
     * Get AdditionalElements value
     * @return \StructType\JP_AdditionalElements|null
     */
    public function getAdditionalElements()
    {
        return $this->AdditionalElements;
    }
    /**
     * Set AdditionalElements value
     * @param \StructType\JP_AdditionalElements $additionalElements
     * @return \StructType\JP_TransportItem
     */
    public function setAdditionalElements(\StructType\JP_AdditionalElements $additionalElements = null)
    {
        $this->AdditionalElements = $additionalElements;
        return $this;
    }
    /**
     * Get RelPaxes value
     * @return \ArrayType\ArrayOfJP_RelPax|null
     */
    public function getRelPaxes()
    {
        return $this->RelPaxes;
    }
    /**
     * Set RelPaxes value
     * @param \ArrayType\ArrayOfJP_RelPax $relPaxes
     * @return \StructType\JP_TransportItem
     */
    public function setRelPaxes(\ArrayType\ArrayOfJP_RelPax $relPaxes = null)
    {
        $this->RelPaxes = $relPaxes;
        return $this;
    }
    /**
     * Get Ticketing value
     * @return bool|null
     */
    public function getTicketing()
    {
        return $this->Ticketing;
    }
    /**
     * Set Ticketing value
     * @param bool $ticketing
     * @return \StructType\JP_TransportItem
     */
    public function setTicketing($ticketing = null)
    {
        // validation for constraint: boolean
        if (!is_null($ticketing) && !is_bool($ticketing)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($ticketing, true), gettype($ticketing)), __LINE__);
        }
        $this->Ticketing = $ticketing;
        return $this;
    }
    /**
     * Get Direction value
     * @return string|null
     */
    public function getDirection()
    {
        return $this->Direction;
    }
    /**
     * Set Direction value
     * @param string $direction
     * @return \StructType\JP_TransportItem
     */
    public function setDirection($direction = null)
    {
        // validation for constraint: string
        if (!is_null($direction) && !is_string($direction)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($direction, true), gettype($direction)), __LINE__);
        }
        $this->Direction = $direction;
        return $this;
    }
}
