<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for JP_Rate StructType
 * @subpackage Structs
 */
class JP_Rate extends AbstractStructBase
{
    /**
     * The Type
     * Meta information extracted from the WSDL
     * - use: required
     * @var string
     */
    public $Type;
    /**
     * Constructor method for JP_Rate
     * @uses JP_Rate::setType()
     * @param string $type
     */
    public function __construct($type = null)
    {
        $this
            ->setType($type);
    }
    /**
     * Get Type value
     * @return string
     */
    public function getType()
    {
        return $this->Type;
    }
    /**
     * Set Type value
     * @uses \EnumType\JP_RateType::valueIsValid()
     * @uses \EnumType\JP_RateType::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $type
     * @return \StructType\JP_Rate
     */
    public function setType($type = null)
    {
        // validation for constraint: enumeration
        if (!\EnumType\JP_RateType::valueIsValid($type)) {
            throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \EnumType\JP_RateType', is_array($type) ? implode(', ', $type) : var_export($type, true), implode(', ', \EnumType\JP_RateType::getValidValues())), __LINE__);
        }
        $this->Type = $type;
        return $this;
    }
}
