<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Put_External_Reference_RequestType StructType
 * Meta information extracted from the WSDL
 * - documentation: The external reference data you want to add or update.
 * @subpackage Structs
 */
class Put_External_Reference_RequestType extends AbstractStructBase
{
    /**
     * The External_Reference_Data
     * @var \StructType\External_Reference_DataType
     */
    public $External_Reference_Data;
    /**
     * The version
     * Meta information extracted from the WSDL
     * - ref: wd:version
     * @var string
     */
    public $version;
    /**
     * Constructor method for Put_External_Reference_RequestType
     * @uses Put_External_Reference_RequestType::setExternal_Reference_Data()
     * @uses Put_External_Reference_RequestType::setVersion()
     * @param \StructType\External_Reference_DataType $external_Reference_Data
     * @param string $version
     */
    public function __construct(\StructType\External_Reference_DataType $external_Reference_Data = null, $version = null)
    {
        $this
            ->setExternal_Reference_Data($external_Reference_Data)
            ->setVersion($version);
    }
    /**
     * Get External_Reference_Data value
     * @return \StructType\External_Reference_DataType|null
     */
    public function getExternal_Reference_Data()
    {
        return $this->External_Reference_Data;
    }
    /**
     * Set External_Reference_Data value
     * @param \StructType\External_Reference_DataType $external_Reference_Data
     * @return \StructType\Put_External_Reference_RequestType
     */
    public function setExternal_Reference_Data(\StructType\External_Reference_DataType $external_Reference_Data = null)
    {
        $this->External_Reference_Data = $external_Reference_Data;
        return $this;
    }
    /**
     * Get version value
     * @return string|null
     */
    public function getVersion()
    {
        return $this->version;
    }
    /**
     * Set version value
     * @param string $version
     * @return \StructType\Put_External_Reference_RequestType
     */
    public function setVersion($version = null)
    {
        // validation for constraint: string
        if (!is_null($version) && !is_string($version)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($version, true), gettype($version)), __LINE__);
        }
        $this->version = $version;
        return $this;
    }
}
