<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for GetAllBundleElementsAvailableProductsResponse StructType
 * Meta information extracted from the WSDL
 * - nillable: true
 * - type: tns:GetAllBundleElementsAvailableProductsResponse
 * @subpackage Structs
 */
class GetAllBundleElementsAvailableProductsResponse extends ExtensibleDataContract
{
    /**
     * The ItemsByElementId
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var \patest\ArrayType\ArrayOfKeyValueOfguidArrayOfBundleElementAvailableProductsItemhpjoQDea
     */
    public $ItemsByElementId;
    /**
     * The NearestDate
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $NearestDate;
    /**
     * The ErrorMessages
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var \patest\ArrayType\ArrayOfstring
     */
    public $ErrorMessages;
    /**
     * Constructor method for GetAllBundleElementsAvailableProductsResponse
     * @uses GetAllBundleElementsAvailableProductsResponse::setItemsByElementId()
     * @uses GetAllBundleElementsAvailableProductsResponse::setNearestDate()
     * @uses GetAllBundleElementsAvailableProductsResponse::setErrorMessages()
     * @param \patest\ArrayType\ArrayOfKeyValueOfguidArrayOfBundleElementAvailableProductsItemhpjoQDea $itemsByElementId
     * @param string $nearestDate
     * @param \patest\ArrayType\ArrayOfstring $errorMessages
     */
    public function __construct(\patest\ArrayType\ArrayOfKeyValueOfguidArrayOfBundleElementAvailableProductsItemhpjoQDea $itemsByElementId = null, $nearestDate = null, \patest\ArrayType\ArrayOfstring $errorMessages = null)
    {
        $this
            ->setItemsByElementId($itemsByElementId)
            ->setNearestDate($nearestDate)
            ->setErrorMessages($errorMessages);
    }
    /**
     * Get ItemsByElementId 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 \patest\ArrayType\ArrayOfKeyValueOfguidArrayOfBundleElementAvailableProductsItemhpjoQDea|null
     */
    public function getItemsByElementId()
    {
        return isset($this->ItemsByElementId) ? $this->ItemsByElementId : null;
    }
    /**
     * Set ItemsByElementId 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 \patest\ArrayType\ArrayOfKeyValueOfguidArrayOfBundleElementAvailableProductsItemhpjoQDea $itemsByElementId
     * @return \patest\StructType\GetAllBundleElementsAvailableProductsResponse
     */
    public function setItemsByElementId(\patest\ArrayType\ArrayOfKeyValueOfguidArrayOfBundleElementAvailableProductsItemhpjoQDea $itemsByElementId = null)
    {
        if (is_null($itemsByElementId) || (is_array($itemsByElementId) && empty($itemsByElementId))) {
            unset($this->ItemsByElementId);
        } else {
            $this->ItemsByElementId = $itemsByElementId;
        }
        return $this;
    }
    /**
     * Get NearestDate 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 getNearestDate()
    {
        return isset($this->NearestDate) ? $this->NearestDate : null;
    }
    /**
     * Set NearestDate 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 $nearestDate
     * @return \patest\StructType\GetAllBundleElementsAvailableProductsResponse
     */
    public function setNearestDate($nearestDate = null)
    {
        // validation for constraint: string
        if (!is_null($nearestDate) && !is_string($nearestDate)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($nearestDate, true), gettype($nearestDate)), __LINE__);
        }
        if (is_null($nearestDate) || (is_array($nearestDate) && empty($nearestDate))) {
            unset($this->NearestDate);
        } else {
            $this->NearestDate = $nearestDate;
        }
        return $this;
    }
    /**
     * Get ErrorMessages 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 \patest\ArrayType\ArrayOfstring|null
     */
    public function getErrorMessages()
    {
        return isset($this->ErrorMessages) ? $this->ErrorMessages : null;
    }
    /**
     * Set ErrorMessages 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 \patest\ArrayType\ArrayOfstring $errorMessages
     * @return \patest\StructType\GetAllBundleElementsAvailableProductsResponse
     */
    public function setErrorMessages(\patest\ArrayType\ArrayOfstring $errorMessages = null)
    {
        if (is_null($errorMessages) || (is_array($errorMessages) && empty($errorMessages))) {
            unset($this->ErrorMessages);
        } else {
            $this->ErrorMessages = $errorMessages;
        }
        return $this;
    }
}
