<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for TDU_TipoDocIdentificacaoERP StructType
 * Meta informations extracted from the WSDL
 * - nillable: true
 * - type: tns:TDU_TipoDocIdentificacaoERP
 * @subpackage Structs
 */
class TDU_TipoDocIdentificacaoERP extends AbstractStructBase
{
    /**
     * The CDU_Codigo
     * Meta informations extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $CDU_Codigo;
    /**
     * The CDU_Descricao
     * Meta informations extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $CDU_Descricao;
    /**
     * The Protegida
     * Meta informations extracted from the WSDL
     * - minOccurs: 0
     * @var bool
     */
    public $Protegida;
    /**
     * Constructor method for TDU_TipoDocIdentificacaoERP
     * @uses TDU_TipoDocIdentificacaoERP::setCDU_Codigo()
     * @uses TDU_TipoDocIdentificacaoERP::setCDU_Descricao()
     * @uses TDU_TipoDocIdentificacaoERP::setProtegida()
     * @param string $cDU_Codigo
     * @param string $cDU_Descricao
     * @param bool $protegida
     */
    public function __construct($cDU_Codigo = null, $cDU_Descricao = null, $protegida = null)
    {
        $this
            ->setCDU_Codigo($cDU_Codigo)
            ->setCDU_Descricao($cDU_Descricao)
            ->setProtegida($protegida);
    }
    /**
     * Get CDU_Codigo 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 getCDU_Codigo()
    {
        return isset($this->CDU_Codigo) ? $this->CDU_Codigo : null;
    }
    /**
     * Set CDU_Codigo 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 $cDU_Codigo
     * @return \StructType\TDU_TipoDocIdentificacaoERP
     */
    public function setCDU_Codigo($cDU_Codigo = null)
    {
        // validation for constraint: string
        if (!is_null($cDU_Codigo) && !is_string($cDU_Codigo)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cDU_Codigo)), __LINE__);
        }
        if (is_null($cDU_Codigo) || (is_array($cDU_Codigo) && empty($cDU_Codigo))) {
            unset($this->CDU_Codigo);
        } else {
            $this->CDU_Codigo = $cDU_Codigo;
        }
        return $this;
    }
    /**
     * Get CDU_Descricao 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 getCDU_Descricao()
    {
        return isset($this->CDU_Descricao) ? $this->CDU_Descricao : null;
    }
    /**
     * Set CDU_Descricao 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 $cDU_Descricao
     * @return \StructType\TDU_TipoDocIdentificacaoERP
     */
    public function setCDU_Descricao($cDU_Descricao = null)
    {
        // validation for constraint: string
        if (!is_null($cDU_Descricao) && !is_string($cDU_Descricao)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cDU_Descricao)), __LINE__);
        }
        if (is_null($cDU_Descricao) || (is_array($cDU_Descricao) && empty($cDU_Descricao))) {
            unset($this->CDU_Descricao);
        } else {
            $this->CDU_Descricao = $cDU_Descricao;
        }
        return $this;
    }
    /**
     * Get Protegida value
     * @return bool|null
     */
    public function getProtegida()
    {
        return $this->Protegida;
    }
    /**
     * Set Protegida value
     * @param bool $protegida
     * @return \StructType\TDU_TipoDocIdentificacaoERP
     */
    public function setProtegida($protegida = null)
    {
        // validation for constraint: boolean
        if (!is_null($protegida) && !is_bool($protegida)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($protegida)), __LINE__);
        }
        $this->Protegida = $protegida;
        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 \StructType\TDU_TipoDocIdentificacaoERP
     */
    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__;
    }
}
