<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for InstanceFilter StructType
 * Meta information extracted from the WSDL
 * - nillable: true
 * - type: tns:InstanceFilter
 * @subpackage Structs
 */
class InstanceFilter extends AbstractStructBase
{
    /**
     * The Name1
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $Name1;
    /**
     * The Name2
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $Name2;
    /**
     * The Name3
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $Name3;
    /**
     * Constructor method for InstanceFilter
     * @uses InstanceFilter::setName1()
     * @uses InstanceFilter::setName2()
     * @uses InstanceFilter::setName3()
     * @param string $name1
     * @param string $name2
     * @param string $name3
     */
    public function __construct($name1 = null, $name2 = null, $name3 = null)
    {
        $this
            ->setName1($name1)
            ->setName2($name2)
            ->setName3($name3);
    }
    /**
     * Get Name1 value
     * An additional test has been added (isset) before returning the property value as
     * this property may have been unset before, due to the fact that this property is
     * removable from the request (nillable=true+minOccurs=0)
     * @return string|null
     */
    public function getName1()
    {
        return isset($this->Name1) ? $this->Name1 : null;
    }
    /**
     * Set Name1 value
     * This property is removable from request (nillable=true+minOccurs=0), therefore
     * if the value assigned to this property is null, it is removed from this object
     * @param string $name1
     * @return \patest\StructType\InstanceFilter
     */
    public function setName1($name1 = null)
    {
        // validation for constraint: string
        if (!is_null($name1) && !is_string($name1)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($name1, true), gettype($name1)), __LINE__);
        }
        if (is_null($name1) || (is_array($name1) && empty($name1))) {
            unset($this->Name1);
        } else {
            $this->Name1 = $name1;
        }
        return $this;
    }
    /**
     * Get Name2 value
     * An additional test has been added (isset) before returning the property value as
     * this property may have been unset before, due to the fact that this property is
     * removable from the request (nillable=true+minOccurs=0)
     * @return string|null
     */
    public function getName2()
    {
        return isset($this->Name2) ? $this->Name2 : null;
    }
    /**
     * Set Name2 value
     * This property is removable from request (nillable=true+minOccurs=0), therefore
     * if the value assigned to this property is null, it is removed from this object
     * @param string $name2
     * @return \patest\StructType\InstanceFilter
     */
    public function setName2($name2 = null)
    {
        // validation for constraint: string
        if (!is_null($name2) && !is_string($name2)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($name2, true), gettype($name2)), __LINE__);
        }
        if (is_null($name2) || (is_array($name2) && empty($name2))) {
            unset($this->Name2);
        } else {
            $this->Name2 = $name2;
        }
        return $this;
    }
    /**
     * Get Name3 value
     * An additional test has been added (isset) before returning the property value as
     * this property may have been unset before, due to the fact that this property is
     * removable from the request (nillable=true+minOccurs=0)
     * @return string|null
     */
    public function getName3()
    {
        return isset($this->Name3) ? $this->Name3 : null;
    }
    /**
     * Set Name3 value
     * This property is removable from request (nillable=true+minOccurs=0), therefore
     * if the value assigned to this property is null, it is removed from this object
     * @param string $name3
     * @return \patest\StructType\InstanceFilter
     */
    public function setName3($name3 = null)
    {
        // validation for constraint: string
        if (!is_null($name3) && !is_string($name3)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($name3, true), gettype($name3)), __LINE__);
        }
        if (is_null($name3) || (is_array($name3) && empty($name3))) {
            unset($this->Name3);
        } else {
            $this->Name3 = $name3;
        }
        return $this;
    }
}
