<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for GerarReferenciaMBDocumento StructType
 * @subpackage Structs
 */
class GerarReferenciaMBDocumento extends AbstractStructBase
{
    /**
     * The documentoVenda
     * Meta informations extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var \StructType\CabecDocERP
     */
    public $documentoVenda;
    /**
     * The configuracaoEasyPay
     * Meta informations extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var \StructType\ConfigEasyPay
     */
    public $configuracaoEasyPay;
    /**
     * The atribuirReferenciaDocumento
     * Meta informations extracted from the WSDL
     * - minOccurs: 0
     * @var bool
     */
    public $atribuirReferenciaDocumento;
    /**
     * The forceUpdate
     * Meta informations extracted from the WSDL
     * - minOccurs: 0
     * @var bool
     */
    public $forceUpdate;
    /**
     * Constructor method for GerarReferenciaMBDocumento
     * @uses GerarReferenciaMBDocumento::setDocumentoVenda()
     * @uses GerarReferenciaMBDocumento::setConfiguracaoEasyPay()
     * @uses GerarReferenciaMBDocumento::setAtribuirReferenciaDocumento()
     * @uses GerarReferenciaMBDocumento::setForceUpdate()
     * @param \StructType\CabecDocERP $documentoVenda
     * @param \StructType\ConfigEasyPay $configuracaoEasyPay
     * @param bool $atribuirReferenciaDocumento
     * @param bool $forceUpdate
     */
    public function __construct(\StructType\CabecDocERP $documentoVenda = null, \StructType\ConfigEasyPay $configuracaoEasyPay = null, $atribuirReferenciaDocumento = null, $forceUpdate = null)
    {
        $this
            ->setDocumentoVenda($documentoVenda)
            ->setConfiguracaoEasyPay($configuracaoEasyPay)
            ->setAtribuirReferenciaDocumento($atribuirReferenciaDocumento)
            ->setForceUpdate($forceUpdate);
    }
    /**
     * Get documentoVenda 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 \StructType\CabecDocERP|null
     */
    public function getDocumentoVenda()
    {
        return isset($this->documentoVenda) ? $this->documentoVenda : null;
    }
    /**
     * Set documentoVenda 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 \StructType\CabecDocERP $documentoVenda
     * @return \StructType\GerarReferenciaMBDocumento
     */
    public function setDocumentoVenda(\StructType\CabecDocERP $documentoVenda = null)
    {
        if (is_null($documentoVenda) || (is_array($documentoVenda) && empty($documentoVenda))) {
            unset($this->documentoVenda);
        } else {
            $this->documentoVenda = $documentoVenda;
        }
        return $this;
    }
    /**
     * Get configuracaoEasyPay 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 \StructType\ConfigEasyPay|null
     */
    public function getConfiguracaoEasyPay()
    {
        return isset($this->configuracaoEasyPay) ? $this->configuracaoEasyPay : null;
    }
    /**
     * Set configuracaoEasyPay 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 \StructType\ConfigEasyPay $configuracaoEasyPay
     * @return \StructType\GerarReferenciaMBDocumento
     */
    public function setConfiguracaoEasyPay(\StructType\ConfigEasyPay $configuracaoEasyPay = null)
    {
        if (is_null($configuracaoEasyPay) || (is_array($configuracaoEasyPay) && empty($configuracaoEasyPay))) {
            unset($this->configuracaoEasyPay);
        } else {
            $this->configuracaoEasyPay = $configuracaoEasyPay;
        }
        return $this;
    }
    /**
     * Get atribuirReferenciaDocumento value
     * @return bool|null
     */
    public function getAtribuirReferenciaDocumento()
    {
        return $this->atribuirReferenciaDocumento;
    }
    /**
     * Set atribuirReferenciaDocumento value
     * @param bool $atribuirReferenciaDocumento
     * @return \StructType\GerarReferenciaMBDocumento
     */
    public function setAtribuirReferenciaDocumento($atribuirReferenciaDocumento = null)
    {
        // validation for constraint: boolean
        if (!is_null($atribuirReferenciaDocumento) && !is_bool($atribuirReferenciaDocumento)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($atribuirReferenciaDocumento)), __LINE__);
        }
        $this->atribuirReferenciaDocumento = $atribuirReferenciaDocumento;
        return $this;
    }
    /**
     * Get forceUpdate value
     * @return bool|null
     */
    public function getForceUpdate()
    {
        return $this->forceUpdate;
    }
    /**
     * Set forceUpdate value
     * @param bool $forceUpdate
     * @return \StructType\GerarReferenciaMBDocumento
     */
    public function setForceUpdate($forceUpdate = null)
    {
        // validation for constraint: boolean
        if (!is_null($forceUpdate) && !is_bool($forceUpdate)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($forceUpdate)), __LINE__);
        }
        $this->forceUpdate = $forceUpdate;
        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\GerarReferenciaMBDocumento
     */
    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__;
    }
}
