<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for getNumDevicesResponse StructType
 * @subpackage Structs
 */
class GetNumDevicesResponse extends GetNumDevicesRes
{
    /**
     * The class
     * Meta informations extracted from the WSDL
     * - use: optional
     * - maxLength: 128
     * @var string
     */
    public $class;
    /**
     * Constructor method for getNumDevicesResponse
     * @uses GetNumDevicesResponse::setClass()
     * @param string $class
     */
    public function __construct($class = null)
    {
        $this
            ->setClass($class);
    }
    /**
     * Get class value
     * @return string|null
     */
    public function getClass()
    {
        return $this->class;
    }
    /**
     * Set class value
     * @param string $class
     * @return GetNumDevicesResponse
     */
    public function setClass($class = null)
    {
        // validation for constraint: maxLength
        if ((is_scalar($class) && strlen($class) > 128) || (is_array($class) && count($class) > 128)) {
            throw new \InvalidArgumentException(sprintf('Invalid length, please provide an array with 128 element(s) or a scalar of 128 character(s) at most, "%d" length given', is_scalar($class) ? strlen($class) : count($class)), __LINE__);
        }
        // validation for constraint: string
        if (!is_null($class) && !is_string($class)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($class)), __LINE__);
        }
        $this->class = $class;
        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 GetNumDevicesResponse
     */
    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__;
    }
}
