<?php

namespace EbaySdk\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for AddMemberMessagesAAQToBidderResponseType StructType
 * Meta information extracted from the WSDL
 * - documentation: Type defining the <b>AddMemberMessagesAAQToBidderResponseContainer</b> container, which consists of the <b>Ack</b> field (indicating the result of the send message operation) and the <b>CorrelationID</b> field (used to track multiple
 * send message operations performed in one call).
 * @subpackage Structs
 */
class AddMemberMessagesAAQToBidderResponseType extends AbstractResponseType
{
    /**
     * The AddMemberMessagesAAQToBidderResponseContainer
     * Meta information extracted from the WSDL
     * - documentation: Container consisting of the <b>Ack</b> field (indicating the result of the send message operation) and the <b>CorrelationID</b> field (used to track multiple send message operations performed in one call).
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \EbaySdk\StructType\AddMemberMessagesAAQToBidderResponseContainerType[]
     */
    public $AddMemberMessagesAAQToBidderResponseContainer;
    /**
     * Constructor method for AddMemberMessagesAAQToBidderResponseType
     * @uses AddMemberMessagesAAQToBidderResponseType::setAddMemberMessagesAAQToBidderResponseContainer()
     * @param \EbaySdk\StructType\AddMemberMessagesAAQToBidderResponseContainerType[] $addMemberMessagesAAQToBidderResponseContainer
     */
    public function __construct(array $addMemberMessagesAAQToBidderResponseContainer = array())
    {
        $this
            ->setAddMemberMessagesAAQToBidderResponseContainer($addMemberMessagesAAQToBidderResponseContainer);
    }
    /**
     * Get AddMemberMessagesAAQToBidderResponseContainer value
     * @return \EbaySdk\StructType\AddMemberMessagesAAQToBidderResponseContainerType[]|null
     */
    public function getAddMemberMessagesAAQToBidderResponseContainer()
    {
        return $this->AddMemberMessagesAAQToBidderResponseContainer;
    }
    /**
     * This method is responsible for validating the values passed to the setAddMemberMessagesAAQToBidderResponseContainer method
     * This method is willingly generated in order to preserve the one-line inline validation within the setAddMemberMessagesAAQToBidderResponseContainer method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateAddMemberMessagesAAQToBidderResponseContainerForArrayConstraintsFromSetAddMemberMessagesAAQToBidderResponseContainer(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $addMemberMessagesAAQToBidderResponseTypeAddMemberMessagesAAQToBidderResponseContainerItem) {
            // validation for constraint: itemType
            if (!$addMemberMessagesAAQToBidderResponseTypeAddMemberMessagesAAQToBidderResponseContainerItem instanceof \EbaySdk\StructType\AddMemberMessagesAAQToBidderResponseContainerType) {
                $invalidValues[] = is_object($addMemberMessagesAAQToBidderResponseTypeAddMemberMessagesAAQToBidderResponseContainerItem) ? get_class($addMemberMessagesAAQToBidderResponseTypeAddMemberMessagesAAQToBidderResponseContainerItem) : sprintf('%s(%s)', gettype($addMemberMessagesAAQToBidderResponseTypeAddMemberMessagesAAQToBidderResponseContainerItem), var_export($addMemberMessagesAAQToBidderResponseTypeAddMemberMessagesAAQToBidderResponseContainerItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The AddMemberMessagesAAQToBidderResponseContainer property can only contain items of type \EbaySdk\StructType\AddMemberMessagesAAQToBidderResponseContainerType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set AddMemberMessagesAAQToBidderResponseContainer value
     * @throws \InvalidArgumentException
     * @param \EbaySdk\StructType\AddMemberMessagesAAQToBidderResponseContainerType[] $addMemberMessagesAAQToBidderResponseContainer
     * @return \EbaySdk\StructType\AddMemberMessagesAAQToBidderResponseType
     */
    public function setAddMemberMessagesAAQToBidderResponseContainer(array $addMemberMessagesAAQToBidderResponseContainer = array())
    {
        // validation for constraint: array
        if ('' !== ($addMemberMessagesAAQToBidderResponseContainerArrayErrorMessage = self::validateAddMemberMessagesAAQToBidderResponseContainerForArrayConstraintsFromSetAddMemberMessagesAAQToBidderResponseContainer($addMemberMessagesAAQToBidderResponseContainer))) {
            throw new \InvalidArgumentException($addMemberMessagesAAQToBidderResponseContainerArrayErrorMessage, __LINE__);
        }
        $this->AddMemberMessagesAAQToBidderResponseContainer = $addMemberMessagesAAQToBidderResponseContainer;
        return $this;
    }
    /**
     * Add item to AddMemberMessagesAAQToBidderResponseContainer value
     * @throws \InvalidArgumentException
     * @param \EbaySdk\StructType\AddMemberMessagesAAQToBidderResponseContainerType $item
     * @return \EbaySdk\StructType\AddMemberMessagesAAQToBidderResponseType
     */
    public function addToAddMemberMessagesAAQToBidderResponseContainer(\EbaySdk\StructType\AddMemberMessagesAAQToBidderResponseContainerType $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \EbaySdk\StructType\AddMemberMessagesAAQToBidderResponseContainerType) {
            throw new \InvalidArgumentException(sprintf('The AddMemberMessagesAAQToBidderResponseContainer property can only contain items of type \EbaySdk\StructType\AddMemberMessagesAAQToBidderResponseContainerType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->AddMemberMessagesAAQToBidderResponseContainer[] = $item;
        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 \EbaySdk\StructType\AddMemberMessagesAAQToBidderResponseType
     */
    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__;
    }
}
