<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for
 * Job_Requisition_Masking_Rule_Configuration_Response_DataType StructType
 * Meta information extracted from the WSDL
 * - documentation: Element containing data for the Masked Job Requisition Defaults.
 * @subpackage Structs
 */
class Job_Requisition_Masking_Rule_Configuration_Response_DataType extends AbstractStructBase
{
    /**
     * The Job_Requisition_Masking_Rule_Configuration
     * Meta information extracted from the WSDL
     * - documentation: Element containing data for the Masked Job Requisition Defaults.
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\Job_Requisition_Masking_Rule_ConfigurationType[]
     */
    public $Job_Requisition_Masking_Rule_Configuration;
    /**
     * Constructor method for
     * Job_Requisition_Masking_Rule_Configuration_Response_DataType
     * @uses Job_Requisition_Masking_Rule_Configuration_Response_DataType::setJob_Requisition_Masking_Rule_Configuration()
     * @param \StructType\Job_Requisition_Masking_Rule_ConfigurationType[] $job_Requisition_Masking_Rule_Configuration
     */
    public function __construct(array $job_Requisition_Masking_Rule_Configuration = array())
    {
        $this
            ->setJob_Requisition_Masking_Rule_Configuration($job_Requisition_Masking_Rule_Configuration);
    }
    /**
     * Get Job_Requisition_Masking_Rule_Configuration value
     * @return \StructType\Job_Requisition_Masking_Rule_ConfigurationType[]|null
     */
    public function getJob_Requisition_Masking_Rule_Configuration()
    {
        return $this->Job_Requisition_Masking_Rule_Configuration;
    }
    /**
     * This method is responsible for validating the values passed to the setJob_Requisition_Masking_Rule_Configuration method
     * This method is willingly generated in order to preserve the one-line inline validation within the setJob_Requisition_Masking_Rule_Configuration method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateJob_Requisition_Masking_Rule_ConfigurationForArrayConstraintsFromSetJob_Requisition_Masking_Rule_Configuration(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $job_Requisition_Masking_Rule_Configuration_Response_DataTypeJob_Requisition_Masking_Rule_ConfigurationItem) {
            // validation for constraint: itemType
            if (!$job_Requisition_Masking_Rule_Configuration_Response_DataTypeJob_Requisition_Masking_Rule_ConfigurationItem instanceof \StructType\Job_Requisition_Masking_Rule_ConfigurationType) {
                $invalidValues[] = is_object($job_Requisition_Masking_Rule_Configuration_Response_DataTypeJob_Requisition_Masking_Rule_ConfigurationItem) ? get_class($job_Requisition_Masking_Rule_Configuration_Response_DataTypeJob_Requisition_Masking_Rule_ConfigurationItem) : sprintf('%s(%s)', gettype($job_Requisition_Masking_Rule_Configuration_Response_DataTypeJob_Requisition_Masking_Rule_ConfigurationItem), var_export($job_Requisition_Masking_Rule_Configuration_Response_DataTypeJob_Requisition_Masking_Rule_ConfigurationItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The Job_Requisition_Masking_Rule_Configuration property can only contain items of type \StructType\Job_Requisition_Masking_Rule_ConfigurationType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set Job_Requisition_Masking_Rule_Configuration value
     * @throws \InvalidArgumentException
     * @param \StructType\Job_Requisition_Masking_Rule_ConfigurationType[] $job_Requisition_Masking_Rule_Configuration
     * @return \StructType\Job_Requisition_Masking_Rule_Configuration_Response_DataType
     */
    public function setJob_Requisition_Masking_Rule_Configuration(array $job_Requisition_Masking_Rule_Configuration = array())
    {
        // validation for constraint: array
        if ('' !== ($job_Requisition_Masking_Rule_ConfigurationArrayErrorMessage = self::validateJob_Requisition_Masking_Rule_ConfigurationForArrayConstraintsFromSetJob_Requisition_Masking_Rule_Configuration($job_Requisition_Masking_Rule_Configuration))) {
            throw new \InvalidArgumentException($job_Requisition_Masking_Rule_ConfigurationArrayErrorMessage, __LINE__);
        }
        $this->Job_Requisition_Masking_Rule_Configuration = $job_Requisition_Masking_Rule_Configuration;
        return $this;
    }
    /**
     * Add item to Job_Requisition_Masking_Rule_Configuration value
     * @throws \InvalidArgumentException
     * @param \StructType\Job_Requisition_Masking_Rule_ConfigurationType $item
     * @return \StructType\Job_Requisition_Masking_Rule_Configuration_Response_DataType
     */
    public function addToJob_Requisition_Masking_Rule_Configuration(\StructType\Job_Requisition_Masking_Rule_ConfigurationType $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\Job_Requisition_Masking_Rule_ConfigurationType) {
            throw new \InvalidArgumentException(sprintf('The Job_Requisition_Masking_Rule_Configuration property can only contain items of type \StructType\Job_Requisition_Masking_Rule_ConfigurationType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->Job_Requisition_Masking_Rule_Configuration[] = $item;
        return $this;
    }
}
