<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for JP_Request StructType
 * @subpackage Structs
 */
class JP_Request extends AbstractStructBase
{
    /**
     * The Fields
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \ArrayType\ArrayOfJP_RequiredField
     */
    public $Fields;
    /**
     * The ReservationLocator
     * @var string
     */
    public $ReservationLocator;
    /**
     * Constructor method for JP_Request
     * @uses JP_Request::setFields()
     * @uses JP_Request::setReservationLocator()
     * @param \ArrayType\ArrayOfJP_RequiredField $fields
     * @param string $reservationLocator
     */
    public function __construct(\ArrayType\ArrayOfJP_RequiredField $fields = null, $reservationLocator = null)
    {
        $this
            ->setFields($fields)
            ->setReservationLocator($reservationLocator);
    }
    /**
     * Get Fields value
     * @return \ArrayType\ArrayOfJP_RequiredField|null
     */
    public function getFields()
    {
        return $this->Fields;
    }
    /**
     * Set Fields value
     * @param \ArrayType\ArrayOfJP_RequiredField $fields
     * @return \StructType\JP_Request
     */
    public function setFields(\ArrayType\ArrayOfJP_RequiredField $fields = null)
    {
        $this->Fields = $fields;
        return $this;
    }
    /**
     * Get ReservationLocator value
     * @return string|null
     */
    public function getReservationLocator()
    {
        return $this->ReservationLocator;
    }
    /**
     * Set ReservationLocator value
     * @param string $reservationLocator
     * @return \StructType\JP_Request
     */
    public function setReservationLocator($reservationLocator = null)
    {
        // validation for constraint: string
        if (!is_null($reservationLocator) && !is_string($reservationLocator)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($reservationLocator)), __LINE__);
        }
        $this->ReservationLocator = $reservationLocator;
        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_Request
     */
    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__;
    }
}
