<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for JP_ModifyResults StructType
 * @subpackage Structs
 */
class JP_ModifyResults extends AbstractStructBase
{
    /**
     * The HotelModifyResult
     * Meta information extracted from the WSDL
     * - choice: HotelModifyResult | ServiceModifyResult | TransferModifyResult | VisaModifyResult
     * - choiceMaxOccurs: 1
     * - choiceMinOccurs: 1
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \StructType\JP_HotelResultModify
     */
    public $HotelModifyResult;
    /**
     * The ServiceModifyResult
     * Meta information extracted from the WSDL
     * - choice: HotelModifyResult | ServiceModifyResult | TransferModifyResult | VisaModifyResult
     * - choiceMaxOccurs: 1
     * - choiceMinOccurs: 1
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \StructType\JP_ServiceResultModify
     */
    public $ServiceModifyResult;
    /**
     * The TransferModifyResult
     * Meta information extracted from the WSDL
     * - choice: HotelModifyResult | ServiceModifyResult | TransferModifyResult | VisaModifyResult
     * - choiceMaxOccurs: 1
     * - choiceMinOccurs: 1
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \StructType\JP_TransferResultModify
     */
    public $TransferModifyResult;
    /**
     * The VisaModifyResult
     * Meta information extracted from the WSDL
     * - choice: HotelModifyResult | ServiceModifyResult | TransferModifyResult | VisaModifyResult
     * - choiceMaxOccurs: 1
     * - choiceMinOccurs: 1
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \StructType\JP_VisaResultModify
     */
    public $VisaModifyResult;
    /**
     * Constructor method for JP_ModifyResults
     * @uses JP_ModifyResults::setHotelModifyResult()
     * @uses JP_ModifyResults::setServiceModifyResult()
     * @uses JP_ModifyResults::setTransferModifyResult()
     * @uses JP_ModifyResults::setVisaModifyResult()
     * @param \StructType\JP_HotelResultModify $hotelModifyResult
     * @param \StructType\JP_ServiceResultModify $serviceModifyResult
     * @param \StructType\JP_TransferResultModify $transferModifyResult
     * @param \StructType\JP_VisaResultModify $visaModifyResult
     */
    public function __construct(\StructType\JP_HotelResultModify $hotelModifyResult = null, \StructType\JP_ServiceResultModify $serviceModifyResult = null, \StructType\JP_TransferResultModify $transferModifyResult = null, \StructType\JP_VisaResultModify $visaModifyResult = null)
    {
        $this
            ->setHotelModifyResult($hotelModifyResult)
            ->setServiceModifyResult($serviceModifyResult)
            ->setTransferModifyResult($transferModifyResult)
            ->setVisaModifyResult($visaModifyResult);
    }
    /**
     * Get HotelModifyResult value
     * @return \StructType\JP_HotelResultModify|null
     */
    public function getHotelModifyResult()
    {
        return isset($this->HotelModifyResult) ? $this->HotelModifyResult : null;
    }
    /**
     * This method is responsible for validating the value passed to the setHotelModifyResult method
     * This method is willingly generated in order to preserve the one-line inline validation within the setHotelModifyResult method
     * This has to validate that the property which is being set is the only one among the given choices
     * @param mixed $value
     * @return string A non-empty message if the values does not match the validation rules
     */
    public function validateHotelModifyResultForChoiceConstraintsFromSetHotelModifyResult($value)
    {
        $message = '';
        if (is_null($value)) {
            return $message;
        }
        $properties = [
            'ServiceModifyResult',
            'TransferModifyResult',
            'VisaModifyResult',
        ];
        try {
            foreach ($properties as $property) {
                if (isset($this->{$property})) {
                    throw new \InvalidArgumentException(sprintf('The property HotelModifyResult can\'t be set as the property %s is already set. Only one property must be set among these properties: HotelModifyResult, %s.', $property, implode(', ', $properties)), __LINE__);
                }
            }
        } catch (\InvalidArgumentException $e) {
            $message = $e->getMessage();
        }
        return $message;
    }
    /**
     * Set HotelModifyResult value
     * This property belongs to a choice that allows only one property to exist. It is
     * therefore removable from the request, consequently if the value assigned to this
     * property is null, the property is removed from this object
     * @throws \InvalidArgumentException
     * @param \StructType\JP_HotelResultModify $hotelModifyResult
     * @return \StructType\JP_ModifyResults
     */
    public function setHotelModifyResult(\StructType\JP_HotelResultModify $hotelModifyResult = null)
    {
        // validation for constraint: choice(HotelModifyResult, ServiceModifyResult, TransferModifyResult, VisaModifyResult)
        if ('' !== ($hotelModifyResultChoiceErrorMessage = self::validateHotelModifyResultForChoiceConstraintsFromSetHotelModifyResult($hotelModifyResult))) {
            throw new \InvalidArgumentException($hotelModifyResultChoiceErrorMessage, __LINE__);
        }
        if (is_null($hotelModifyResult) || (is_array($hotelModifyResult) && empty($hotelModifyResult))) {
            unset($this->HotelModifyResult);
        } else {
            $this->HotelModifyResult = $hotelModifyResult;
        }
        return $this;
    }
    /**
     * Get ServiceModifyResult value
     * @return \StructType\JP_ServiceResultModify|null
     */
    public function getServiceModifyResult()
    {
        return isset($this->ServiceModifyResult) ? $this->ServiceModifyResult : null;
    }
    /**
     * This method is responsible for validating the value passed to the setServiceModifyResult method
     * This method is willingly generated in order to preserve the one-line inline validation within the setServiceModifyResult method
     * This has to validate that the property which is being set is the only one among the given choices
     * @param mixed $value
     * @return string A non-empty message if the values does not match the validation rules
     */
    public function validateServiceModifyResultForChoiceConstraintsFromSetServiceModifyResult($value)
    {
        $message = '';
        if (is_null($value)) {
            return $message;
        }
        $properties = [
            'HotelModifyResult',
            'TransferModifyResult',
            'VisaModifyResult',
        ];
        try {
            foreach ($properties as $property) {
                if (isset($this->{$property})) {
                    throw new \InvalidArgumentException(sprintf('The property ServiceModifyResult can\'t be set as the property %s is already set. Only one property must be set among these properties: ServiceModifyResult, %s.', $property, implode(', ', $properties)), __LINE__);
                }
            }
        } catch (\InvalidArgumentException $e) {
            $message = $e->getMessage();
        }
        return $message;
    }
    /**
     * Set ServiceModifyResult value
     * This property belongs to a choice that allows only one property to exist. It is
     * therefore removable from the request, consequently if the value assigned to this
     * property is null, the property is removed from this object
     * @throws \InvalidArgumentException
     * @param \StructType\JP_ServiceResultModify $serviceModifyResult
     * @return \StructType\JP_ModifyResults
     */
    public function setServiceModifyResult(\StructType\JP_ServiceResultModify $serviceModifyResult = null)
    {
        // validation for constraint: choice(HotelModifyResult, ServiceModifyResult, TransferModifyResult, VisaModifyResult)
        if ('' !== ($serviceModifyResultChoiceErrorMessage = self::validateServiceModifyResultForChoiceConstraintsFromSetServiceModifyResult($serviceModifyResult))) {
            throw new \InvalidArgumentException($serviceModifyResultChoiceErrorMessage, __LINE__);
        }
        if (is_null($serviceModifyResult) || (is_array($serviceModifyResult) && empty($serviceModifyResult))) {
            unset($this->ServiceModifyResult);
        } else {
            $this->ServiceModifyResult = $serviceModifyResult;
        }
        return $this;
    }
    /**
     * Get TransferModifyResult value
     * @return \StructType\JP_TransferResultModify|null
     */
    public function getTransferModifyResult()
    {
        return isset($this->TransferModifyResult) ? $this->TransferModifyResult : null;
    }
    /**
     * This method is responsible for validating the value passed to the setTransferModifyResult method
     * This method is willingly generated in order to preserve the one-line inline validation within the setTransferModifyResult method
     * This has to validate that the property which is being set is the only one among the given choices
     * @param mixed $value
     * @return string A non-empty message if the values does not match the validation rules
     */
    public function validateTransferModifyResultForChoiceConstraintsFromSetTransferModifyResult($value)
    {
        $message = '';
        if (is_null($value)) {
            return $message;
        }
        $properties = [
            'HotelModifyResult',
            'ServiceModifyResult',
            'VisaModifyResult',
        ];
        try {
            foreach ($properties as $property) {
                if (isset($this->{$property})) {
                    throw new \InvalidArgumentException(sprintf('The property TransferModifyResult can\'t be set as the property %s is already set. Only one property must be set among these properties: TransferModifyResult, %s.', $property, implode(', ', $properties)), __LINE__);
                }
            }
        } catch (\InvalidArgumentException $e) {
            $message = $e->getMessage();
        }
        return $message;
    }
    /**
     * Set TransferModifyResult value
     * This property belongs to a choice that allows only one property to exist. It is
     * therefore removable from the request, consequently if the value assigned to this
     * property is null, the property is removed from this object
     * @throws \InvalidArgumentException
     * @param \StructType\JP_TransferResultModify $transferModifyResult
     * @return \StructType\JP_ModifyResults
     */
    public function setTransferModifyResult(\StructType\JP_TransferResultModify $transferModifyResult = null)
    {
        // validation for constraint: choice(HotelModifyResult, ServiceModifyResult, TransferModifyResult, VisaModifyResult)
        if ('' !== ($transferModifyResultChoiceErrorMessage = self::validateTransferModifyResultForChoiceConstraintsFromSetTransferModifyResult($transferModifyResult))) {
            throw new \InvalidArgumentException($transferModifyResultChoiceErrorMessage, __LINE__);
        }
        if (is_null($transferModifyResult) || (is_array($transferModifyResult) && empty($transferModifyResult))) {
            unset($this->TransferModifyResult);
        } else {
            $this->TransferModifyResult = $transferModifyResult;
        }
        return $this;
    }
    /**
     * Get VisaModifyResult value
     * @return \StructType\JP_VisaResultModify|null
     */
    public function getVisaModifyResult()
    {
        return isset($this->VisaModifyResult) ? $this->VisaModifyResult : null;
    }
    /**
     * This method is responsible for validating the value passed to the setVisaModifyResult method
     * This method is willingly generated in order to preserve the one-line inline validation within the setVisaModifyResult method
     * This has to validate that the property which is being set is the only one among the given choices
     * @param mixed $value
     * @return string A non-empty message if the values does not match the validation rules
     */
    public function validateVisaModifyResultForChoiceConstraintsFromSetVisaModifyResult($value)
    {
        $message = '';
        if (is_null($value)) {
            return $message;
        }
        $properties = [
            'HotelModifyResult',
            'ServiceModifyResult',
            'TransferModifyResult',
        ];
        try {
            foreach ($properties as $property) {
                if (isset($this->{$property})) {
                    throw new \InvalidArgumentException(sprintf('The property VisaModifyResult can\'t be set as the property %s is already set. Only one property must be set among these properties: VisaModifyResult, %s.', $property, implode(', ', $properties)), __LINE__);
                }
            }
        } catch (\InvalidArgumentException $e) {
            $message = $e->getMessage();
        }
        return $message;
    }
    /**
     * Set VisaModifyResult value
     * This property belongs to a choice that allows only one property to exist. It is
     * therefore removable from the request, consequently if the value assigned to this
     * property is null, the property is removed from this object
     * @throws \InvalidArgumentException
     * @param \StructType\JP_VisaResultModify $visaModifyResult
     * @return \StructType\JP_ModifyResults
     */
    public function setVisaModifyResult(\StructType\JP_VisaResultModify $visaModifyResult = null)
    {
        // validation for constraint: choice(HotelModifyResult, ServiceModifyResult, TransferModifyResult, VisaModifyResult)
        if ('' !== ($visaModifyResultChoiceErrorMessage = self::validateVisaModifyResultForChoiceConstraintsFromSetVisaModifyResult($visaModifyResult))) {
            throw new \InvalidArgumentException($visaModifyResultChoiceErrorMessage, __LINE__);
        }
        if (is_null($visaModifyResult) || (is_array($visaModifyResult) && empty($visaModifyResult))) {
            unset($this->VisaModifyResult);
        } else {
            $this->VisaModifyResult = $visaModifyResult;
        }
        return $this;
    }
}
