<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for JP_Request StructType
 * @subpackage Structs
 */
class JP_Request extends AbstractStructBase
{
    /**
     * The Fields
     * Meta information 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 %s, please provide a string, %s given', var_export($reservationLocator, true), gettype($reservationLocator)), __LINE__);
        }
        $this->ReservationLocator = $reservationLocator;
        return $this;
    }
}
