<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for VehicleEngineInfo_V2 StructType
 * @subpackage Structs
 */
class VehicleEngineInfo_V2 extends VehicleEngineInfo
{
    /**
     * The MaxAllowedSpeed
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 1
     * - nillable: true
     * @var float
     */
    public $MaxAllowedSpeed;
    /**
     * Constructor method for VehicleEngineInfo_V2
     * @uses VehicleEngineInfo_V2::setMaxAllowedSpeed()
     * @param float $maxAllowedSpeed
     */
    public function __construct($maxAllowedSpeed = null)
    {
        $this
            ->setMaxAllowedSpeed($maxAllowedSpeed);
    }
    /**
     * Get MaxAllowedSpeed value
     * @return float
     */
    public function getMaxAllowedSpeed()
    {
        return $this->MaxAllowedSpeed;
    }
    /**
     * Set MaxAllowedSpeed value
     * @param float $maxAllowedSpeed
     * @return \StructType\VehicleEngineInfo_V2
     */
    public function setMaxAllowedSpeed($maxAllowedSpeed = null)
    {
        // validation for constraint: float
        if (!is_null($maxAllowedSpeed) && !(is_float($maxAllowedSpeed) || is_numeric($maxAllowedSpeed))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a float value, %s given', var_export($maxAllowedSpeed, true), gettype($maxAllowedSpeed)), __LINE__);
        }
        $this->MaxAllowedSpeed = $maxAllowedSpeed;
        return $this;
    }
}
