<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for OTA_AirSeatMapRSSeatMapResponsesSeatMapResponse StructType
 * @package Dg
 * @subpackage Structs
 */
class DgOTA_AirSeatMapRSSeatMapResponsesSeatMapResponse extends AbstractStructBase
{
    /**
     * The FlightSegmentInfo
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesSeatMapResponseFlightSegmentInfo
     */
    public $FlightSegmentInfo;
    /**
     * The SeatMapDetails
     * Meta informations extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \dgsoft\StructType\DgSeatMapDetailsType[]
     */
    public $SeatMapDetails;
    /**
     * The BookingReferenceID
     * Meta informations extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \dgsoft\StructType\DgUniqueID_Type[]
     */
    public $BookingReferenceID;
    /**
     * The SeatMapJSONResponse
     * @var string
     */
    public $SeatMapJSONResponse;
    /**
     * The SeatUpgradeApplied
     * Meta informations extracted from the WSDL
     * - default: false
     * @var bool
     */
    public $SeatUpgradeApplied;
    /**
     * Constructor method for OTA_AirSeatMapRSSeatMapResponsesSeatMapResponse
     * @uses DgOTA_AirSeatMapRSSeatMapResponsesSeatMapResponse::setFlightSegmentInfo()
     * @uses DgOTA_AirSeatMapRSSeatMapResponsesSeatMapResponse::setSeatMapDetails()
     * @uses DgOTA_AirSeatMapRSSeatMapResponsesSeatMapResponse::setBookingReferenceID()
     * @uses DgOTA_AirSeatMapRSSeatMapResponsesSeatMapResponse::setSeatMapJSONResponse()
     * @uses DgOTA_AirSeatMapRSSeatMapResponsesSeatMapResponse::setSeatUpgradeApplied()
     * @param \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesSeatMapResponseFlightSegmentInfo $flightSegmentInfo
     * @param \dgsoft\StructType\DgSeatMapDetailsType[] $seatMapDetails
     * @param \dgsoft\StructType\DgUniqueID_Type[] $bookingReferenceID
     * @param string $seatMapJSONResponse
     * @param bool $seatUpgradeApplied
     */
    public function __construct(\dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesSeatMapResponseFlightSegmentInfo $flightSegmentInfo = null, array $seatMapDetails = array(), array $bookingReferenceID = array(), $seatMapJSONResponse = null, $seatUpgradeApplied = false)
    {
        $this
            ->setFlightSegmentInfo($flightSegmentInfo)
            ->setSeatMapDetails($seatMapDetails)
            ->setBookingReferenceID($bookingReferenceID)
            ->setSeatMapJSONResponse($seatMapJSONResponse)
            ->setSeatUpgradeApplied($seatUpgradeApplied);
    }
    /**
     * Get FlightSegmentInfo value
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesSeatMapResponseFlightSegmentInfo|null
     */
    public function getFlightSegmentInfo()
    {
        return $this->FlightSegmentInfo;
    }
    /**
     * Set FlightSegmentInfo value
     * @param \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesSeatMapResponseFlightSegmentInfo $flightSegmentInfo
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesSeatMapResponse
     */
    public function setFlightSegmentInfo(\dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesSeatMapResponseFlightSegmentInfo $flightSegmentInfo = null)
    {
        $this->FlightSegmentInfo = $flightSegmentInfo;
        return $this;
    }
    /**
     * Get SeatMapDetails value
     * @return \dgsoft\StructType\DgSeatMapDetailsType[]|null
     */
    public function getSeatMapDetails()
    {
        return $this->SeatMapDetails;
    }
    /**
     * Set SeatMapDetails value
     * @throws \InvalidArgumentException
     * @param \dgsoft\StructType\DgSeatMapDetailsType[] $seatMapDetails
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesSeatMapResponse
     */
    public function setSeatMapDetails(array $seatMapDetails = array())
    {
        foreach ($seatMapDetails as $oTA_AirSeatMapRSSeatMapResponsesSeatMapResponseSeatMapDetailsItem) {
            // validation for constraint: itemType
            if (!$oTA_AirSeatMapRSSeatMapResponsesSeatMapResponseSeatMapDetailsItem instanceof \dgsoft\StructType\DgSeatMapDetailsType) {
                throw new \InvalidArgumentException(sprintf('The SeatMapDetails property can only contain items of \dgsoft\StructType\DgSeatMapDetailsType, "%s" given', is_object($oTA_AirSeatMapRSSeatMapResponsesSeatMapResponseSeatMapDetailsItem) ? get_class($oTA_AirSeatMapRSSeatMapResponsesSeatMapResponseSeatMapDetailsItem) : gettype($oTA_AirSeatMapRSSeatMapResponsesSeatMapResponseSeatMapDetailsItem)), __LINE__);
            }
        }
        $this->SeatMapDetails = $seatMapDetails;
        return $this;
    }
    /**
     * Add item to SeatMapDetails value
     * @throws \InvalidArgumentException
     * @param \dgsoft\StructType\DgSeatMapDetailsType $item
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesSeatMapResponse
     */
    public function addToSeatMapDetails(\dgsoft\StructType\DgSeatMapDetailsType $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \dgsoft\StructType\DgSeatMapDetailsType) {
            throw new \InvalidArgumentException(sprintf('The SeatMapDetails property can only contain items of \dgsoft\StructType\DgSeatMapDetailsType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->SeatMapDetails[] = $item;
        return $this;
    }
    /**
     * Get BookingReferenceID value
     * @return \dgsoft\StructType\DgUniqueID_Type[]|null
     */
    public function getBookingReferenceID()
    {
        return $this->BookingReferenceID;
    }
    /**
     * Set BookingReferenceID value
     * @throws \InvalidArgumentException
     * @param \dgsoft\StructType\DgUniqueID_Type[] $bookingReferenceID
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesSeatMapResponse
     */
    public function setBookingReferenceID(array $bookingReferenceID = array())
    {
        foreach ($bookingReferenceID as $oTA_AirSeatMapRSSeatMapResponsesSeatMapResponseBookingReferenceIDItem) {
            // validation for constraint: itemType
            if (!$oTA_AirSeatMapRSSeatMapResponsesSeatMapResponseBookingReferenceIDItem instanceof \dgsoft\StructType\DgUniqueID_Type) {
                throw new \InvalidArgumentException(sprintf('The BookingReferenceID property can only contain items of \dgsoft\StructType\DgUniqueID_Type, "%s" given', is_object($oTA_AirSeatMapRSSeatMapResponsesSeatMapResponseBookingReferenceIDItem) ? get_class($oTA_AirSeatMapRSSeatMapResponsesSeatMapResponseBookingReferenceIDItem) : gettype($oTA_AirSeatMapRSSeatMapResponsesSeatMapResponseBookingReferenceIDItem)), __LINE__);
            }
        }
        $this->BookingReferenceID = $bookingReferenceID;
        return $this;
    }
    /**
     * Add item to BookingReferenceID value
     * @throws \InvalidArgumentException
     * @param \dgsoft\StructType\DgUniqueID_Type $item
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesSeatMapResponse
     */
    public function addToBookingReferenceID(\dgsoft\StructType\DgUniqueID_Type $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \dgsoft\StructType\DgUniqueID_Type) {
            throw new \InvalidArgumentException(sprintf('The BookingReferenceID property can only contain items of \dgsoft\StructType\DgUniqueID_Type, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->BookingReferenceID[] = $item;
        return $this;
    }
    /**
     * Get SeatMapJSONResponse value
     * @return string|null
     */
    public function getSeatMapJSONResponse()
    {
        return $this->SeatMapJSONResponse;
    }
    /**
     * Set SeatMapJSONResponse value
     * @param string $seatMapJSONResponse
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesSeatMapResponse
     */
    public function setSeatMapJSONResponse($seatMapJSONResponse = null)
    {
        // validation for constraint: string
        if (!is_null($seatMapJSONResponse) && !is_string($seatMapJSONResponse)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($seatMapJSONResponse)), __LINE__);
        }
        $this->SeatMapJSONResponse = $seatMapJSONResponse;
        return $this;
    }
    /**
     * Get SeatUpgradeApplied value
     * @return bool|null
     */
    public function getSeatUpgradeApplied()
    {
        return $this->SeatUpgradeApplied;
    }
    /**
     * Set SeatUpgradeApplied value
     * @param bool $seatUpgradeApplied
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesSeatMapResponse
     */
    public function setSeatUpgradeApplied($seatUpgradeApplied = false)
    {
        // validation for constraint: boolean
        if (!is_null($seatUpgradeApplied) && !is_bool($seatUpgradeApplied)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($seatUpgradeApplied)), __LINE__);
        }
        $this->SeatUpgradeApplied = $seatUpgradeApplied;
        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 \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesSeatMapResponse
     */
    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__;
    }
}
