<?php

namespace Model;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for ConsignmentActionResult Model
 * @subpackage Structs
 */
class ConsignmentActionResult extends AbstractStructBase
{
    /**
     * The consignmentCode
     * Meta informations extracted from the WSDL
     * - nillable: true
     * @var string
     */
    public $consignmentCode;
    /**
     * The errorCode
     * Meta informations extracted from the WSDL
     * - nillable: true
     * @var string
     */
    public $errorCode;
    /**
     * The reference
     * Meta informations extracted from the WSDL
     * - nillable: true
     * @var string
     */
    public $reference;
    /**
     * The text
     * Meta informations extracted from the WSDL
     * - nillable: true
     * @var string
     */
    public $text;
    /**
     * Constructor method for ConsignmentActionResult
     * @uses ConsignmentActionResult::setConsignmentCode()
     * @uses ConsignmentActionResult::setErrorCode()
     * @uses ConsignmentActionResult::setReference()
     * @uses ConsignmentActionResult::setText()
     * @param string $consignmentCode
     * @param string $errorCode
     * @param string $reference
     * @param string $text
     */
    public function __construct($consignmentCode = null, $errorCode = null, $reference = null, $text = null)
    {
        $this
            ->setConsignmentCode($consignmentCode)
            ->setErrorCode($errorCode)
            ->setReference($reference)
            ->setText($text);
    }
    /**
     * Get consignmentCode value
     * @return string|null
     */
    public function getConsignmentCode()
    {
        return $this->consignmentCode;
    }
    /**
     * Set consignmentCode value
     * @param string $consignmentCode
     * @return \Model\ConsignmentActionResult
     */
    public function setConsignmentCode($consignmentCode = null)
    {
        // validation for constraint: string
        if (!is_null($consignmentCode) && !is_string($consignmentCode)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($consignmentCode)), __LINE__);
        }
        $this->consignmentCode = $consignmentCode;
        return $this;
    }
    /**
     * Get errorCode value
     * @return string|null
     */
    public function getErrorCode()
    {
        return $this->errorCode;
    }
    /**
     * Set errorCode value
     * @param string $errorCode
     * @return \Model\ConsignmentActionResult
     */
    public function setErrorCode($errorCode = null)
    {
        // validation for constraint: string
        if (!is_null($errorCode) && !is_string($errorCode)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($errorCode)), __LINE__);
        }
        $this->errorCode = $errorCode;
        return $this;
    }
    /**
     * Get reference value
     * @return string|null
     */
    public function getReference()
    {
        return $this->reference;
    }
    /**
     * Set reference value
     * @param string $reference
     * @return \Model\ConsignmentActionResult
     */
    public function setReference($reference = null)
    {
        // validation for constraint: string
        if (!is_null($reference) && !is_string($reference)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($reference)), __LINE__);
        }
        $this->reference = $reference;
        return $this;
    }
    /**
     * Get text value
     * @return string|null
     */
    public function getText()
    {
        return $this->text;
    }
    /**
     * Set text value
     * @param string $text
     * @return \Model\ConsignmentActionResult
     */
    public function setText($text = null)
    {
        // validation for constraint: string
        if (!is_null($text) && !is_string($text)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($text)), __LINE__);
        }
        $this->text = $text;
        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 \Model\ConsignmentActionResult
     */
    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__;
    }
}
