<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Masked_Recruiting_Configuration_Response_DataType
 * StructType
 * Meta information extracted from the WSDL
 * - documentation: Container for Masked Configurations Response Data
 * @subpackage Structs
 */
class Masked_Recruiting_Configuration_Response_DataType extends AbstractStructBase
{
    /**
     * The Masked_Recruiting_Configuration
     * Meta information extracted from the WSDL
     * - documentation: Container for Masked Configuration Data
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\Masked_Recruiting_ConfigurationType[]
     */
    public $Masked_Recruiting_Configuration;
    /**
     * Constructor method for Masked_Recruiting_Configuration_Response_DataType
     * @uses Masked_Recruiting_Configuration_Response_DataType::setMasked_Recruiting_Configuration()
     * @param \StructType\Masked_Recruiting_ConfigurationType[] $masked_Recruiting_Configuration
     */
    public function __construct(array $masked_Recruiting_Configuration = array())
    {
        $this
            ->setMasked_Recruiting_Configuration($masked_Recruiting_Configuration);
    }
    /**
     * Get Masked_Recruiting_Configuration value
     * @return \StructType\Masked_Recruiting_ConfigurationType[]|null
     */
    public function getMasked_Recruiting_Configuration()
    {
        return $this->Masked_Recruiting_Configuration;
    }
    /**
     * This method is responsible for validating the values passed to the setMasked_Recruiting_Configuration method
     * This method is willingly generated in order to preserve the one-line inline validation within the setMasked_Recruiting_Configuration method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateMasked_Recruiting_ConfigurationForArrayConstraintsFromSetMasked_Recruiting_Configuration(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $masked_Recruiting_Configuration_Response_DataTypeMasked_Recruiting_ConfigurationItem) {
            // validation for constraint: itemType
            if (!$masked_Recruiting_Configuration_Response_DataTypeMasked_Recruiting_ConfigurationItem instanceof \StructType\Masked_Recruiting_ConfigurationType) {
                $invalidValues[] = is_object($masked_Recruiting_Configuration_Response_DataTypeMasked_Recruiting_ConfigurationItem) ? get_class($masked_Recruiting_Configuration_Response_DataTypeMasked_Recruiting_ConfigurationItem) : sprintf('%s(%s)', gettype($masked_Recruiting_Configuration_Response_DataTypeMasked_Recruiting_ConfigurationItem), var_export($masked_Recruiting_Configuration_Response_DataTypeMasked_Recruiting_ConfigurationItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The Masked_Recruiting_Configuration property can only contain items of type \StructType\Masked_Recruiting_ConfigurationType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set Masked_Recruiting_Configuration value
     * @throws \InvalidArgumentException
     * @param \StructType\Masked_Recruiting_ConfigurationType[] $masked_Recruiting_Configuration
     * @return \StructType\Masked_Recruiting_Configuration_Response_DataType
     */
    public function setMasked_Recruiting_Configuration(array $masked_Recruiting_Configuration = array())
    {
        // validation for constraint: array
        if ('' !== ($masked_Recruiting_ConfigurationArrayErrorMessage = self::validateMasked_Recruiting_ConfigurationForArrayConstraintsFromSetMasked_Recruiting_Configuration($masked_Recruiting_Configuration))) {
            throw new \InvalidArgumentException($masked_Recruiting_ConfigurationArrayErrorMessage, __LINE__);
        }
        $this->Masked_Recruiting_Configuration = $masked_Recruiting_Configuration;
        return $this;
    }
    /**
     * Add item to Masked_Recruiting_Configuration value
     * @throws \InvalidArgumentException
     * @param \StructType\Masked_Recruiting_ConfigurationType $item
     * @return \StructType\Masked_Recruiting_Configuration_Response_DataType
     */
    public function addToMasked_Recruiting_Configuration(\StructType\Masked_Recruiting_ConfigurationType $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\Masked_Recruiting_ConfigurationType) {
            throw new \InvalidArgumentException(sprintf('The Masked_Recruiting_Configuration property can only contain items of type \StructType\Masked_Recruiting_ConfigurationType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->Masked_Recruiting_Configuration[] = $item;
        return $this;
    }
}
