<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for JP_DocumentAdditional StructType
 * @subpackage Structs
 */
class JP_DocumentAdditional extends AbstractStructBase
{
    /**
     * The _
     * @var string
     */
    public $_;
    /**
     * The Type
     * @var string
     */
    public $Type;
    /**
     * The AllowedTypes
     * @var string
     */
    public $AllowedTypes;
    /**
     * Constructor method for JP_DocumentAdditional
     * @uses JP_DocumentAdditional::set_()
     * @uses JP_DocumentAdditional::setType()
     * @uses JP_DocumentAdditional::setAllowedTypes()
     * @param string $_
     * @param string $type
     * @param string $allowedTypes
     */
    public function __construct($_ = null, $type = null, $allowedTypes = null)
    {
        $this
            ->set_($_)
            ->setType($type)
            ->setAllowedTypes($allowedTypes);
    }
    /**
     * Get _ value
     * @return string|null
     */
    public function get_()
    {
        return $this->_;
    }
    /**
     * Set _ value
     * @param string $_
     * @return \StructType\JP_DocumentAdditional
     */
    public function set_($_ = null)
    {
        // validation for constraint: string
        if (!is_null($_) && !is_string($_)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($_, true), gettype($_)), __LINE__);
        }
        $this->_ = $_;
        return $this;
    }
    /**
     * Get Type value
     * @return string|null
     */
    public function getType()
    {
        return $this->Type;
    }
    /**
     * Set Type value
     * @uses \EnumType\JP_DocumentType::valueIsValid()
     * @uses \EnumType\JP_DocumentType::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $type
     * @return \StructType\JP_DocumentAdditional
     */
    public function setType($type = null)
    {
        // validation for constraint: enumeration
        if (!\EnumType\JP_DocumentType::valueIsValid($type)) {
            throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \EnumType\JP_DocumentType', is_array($type) ? implode(', ', $type) : var_export($type, true), implode(', ', \EnumType\JP_DocumentType::getValidValues())), __LINE__);
        }
        $this->Type = $type;
        return $this;
    }
    /**
     * Get AllowedTypes value
     * @return string|null
     */
    public function getAllowedTypes()
    {
        return $this->AllowedTypes;
    }
    /**
     * Set AllowedTypes value
     * @param string $allowedTypes
     * @return \StructType\JP_DocumentAdditional
     */
    public function setAllowedTypes($allowedTypes = null)
    {
        // validation for constraint: string
        if (!is_null($allowedTypes) && !is_string($allowedTypes)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($allowedTypes, true), gettype($allowedTypes)), __LINE__);
        }
        $this->AllowedTypes = $allowedTypes;
        return $this;
    }
}
