<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for JP_FlightSupplier StructType
 * @subpackage Structs
 */
class JP_FlightSupplier extends AbstractStructBase
{
    /**
     * The FlightRates
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \ArrayType\ArrayOfJP_FlightRate
     */
    public $FlightRates;
    /**
     * The Code
     * @var string
     */
    public $Code;
    /**
     * Constructor method for JP_FlightSupplier
     * @uses JP_FlightSupplier::setFlightRates()
     * @uses JP_FlightSupplier::setCode()
     * @param \ArrayType\ArrayOfJP_FlightRate $flightRates
     * @param string $code
     */
    public function __construct(\ArrayType\ArrayOfJP_FlightRate $flightRates = null, $code = null)
    {
        $this
            ->setFlightRates($flightRates)
            ->setCode($code);
    }
    /**
     * Get FlightRates value
     * @return \ArrayType\ArrayOfJP_FlightRate|null
     */
    public function getFlightRates()
    {
        return $this->FlightRates;
    }
    /**
     * Set FlightRates value
     * @param \ArrayType\ArrayOfJP_FlightRate $flightRates
     * @return \StructType\JP_FlightSupplier
     */
    public function setFlightRates(\ArrayType\ArrayOfJP_FlightRate $flightRates = null)
    {
        $this->FlightRates = $flightRates;
        return $this;
    }
    /**
     * Get Code value
     * @return string|null
     */
    public function getCode()
    {
        return $this->Code;
    }
    /**
     * Set Code value
     * @param string $code
     * @return \StructType\JP_FlightSupplier
     */
    public function setCode($code = null)
    {
        // validation for constraint: string
        if (!is_null($code) && !is_string($code)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($code, true), gettype($code)), __LINE__);
        }
        $this->Code = $code;
        return $this;
    }
}
