<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for HcmJobSearchRowBasic StructType
 * @subpackage Structs
 */
class HcmJobSearchRowBasic extends SearchRowBasic
{
    /**
     * The description
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnStringField[]
     */
    public $description;
    /**
     * The employmentCategory
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnSelectField[]
     */
    public $employmentCategory;
    /**
     * The externalId
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnSelectField[]
     */
    public $externalId;
    /**
     * The internalId
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnSelectField[]
     */
    public $internalId;
    /**
     * The isInactive
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnBooleanField[]
     */
    public $isInactive;
    /**
     * The jobId
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnStringField[]
     */
    public $jobId;
    /**
     * The title
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnStringField[]
     */
    public $title;
    /**
     * The customFieldList
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\SearchColumnCustomFieldList
     */
    public $customFieldList;
    /**
     * Constructor method for HcmJobSearchRowBasic
     * @uses HcmJobSearchRowBasic::setDescription()
     * @uses HcmJobSearchRowBasic::setEmploymentCategory()
     * @uses HcmJobSearchRowBasic::setExternalId()
     * @uses HcmJobSearchRowBasic::setInternalId()
     * @uses HcmJobSearchRowBasic::setIsInactive()
     * @uses HcmJobSearchRowBasic::setJobId()
     * @uses HcmJobSearchRowBasic::setTitle()
     * @uses HcmJobSearchRowBasic::setCustomFieldList()
     * @param \StructType\SearchColumnStringField[] $description
     * @param \StructType\SearchColumnSelectField[] $employmentCategory
     * @param \StructType\SearchColumnSelectField[] $externalId
     * @param \StructType\SearchColumnSelectField[] $internalId
     * @param \StructType\SearchColumnBooleanField[] $isInactive
     * @param \StructType\SearchColumnStringField[] $jobId
     * @param \StructType\SearchColumnStringField[] $title
     * @param \StructType\SearchColumnCustomFieldList $customFieldList
     */
    public function __construct(array $description = array(), array $employmentCategory = array(), array $externalId = array(), array $internalId = array(), array $isInactive = array(), array $jobId = array(), array $title = array(), \StructType\SearchColumnCustomFieldList $customFieldList = null)
    {
        $this
            ->setDescription($description)
            ->setEmploymentCategory($employmentCategory)
            ->setExternalId($externalId)
            ->setInternalId($internalId)
            ->setIsInactive($isInactive)
            ->setJobId($jobId)
            ->setTitle($title)
            ->setCustomFieldList($customFieldList);
    }
    /**
     * Get description value
     * @return \StructType\SearchColumnStringField[]|null
     */
    public function getDescription()
    {
        return $this->description;
    }
    /**
     * This method is responsible for validating the values passed to the setDescription method
     * This method is willingly generated in order to preserve the one-line inline validation within the setDescription method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateDescriptionForArrayConstraintsFromSetDescription(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $hcmJobSearchRowBasicDescriptionItem) {
            // validation for constraint: itemType
            if (!$hcmJobSearchRowBasicDescriptionItem instanceof \StructType\SearchColumnStringField) {
                $invalidValues[] = is_object($hcmJobSearchRowBasicDescriptionItem) ? get_class($hcmJobSearchRowBasicDescriptionItem) : sprintf('%s(%s)', gettype($hcmJobSearchRowBasicDescriptionItem), var_export($hcmJobSearchRowBasicDescriptionItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The description property can only contain items of type \StructType\SearchColumnStringField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set description value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField[] $description
     * @return \StructType\HcmJobSearchRowBasic
     */
    public function setDescription(array $description = array())
    {
        // validation for constraint: array
        if ('' !== ($descriptionArrayErrorMessage = self::validateDescriptionForArrayConstraintsFromSetDescription($description))) {
            throw new \InvalidArgumentException($descriptionArrayErrorMessage, __LINE__);
        }
        $this->description = $description;
        return $this;
    }
    /**
     * Add item to description value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField $item
     * @return \StructType\HcmJobSearchRowBasic
     */
    public function addToDescription(\StructType\SearchColumnStringField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnStringField) {
            throw new \InvalidArgumentException(sprintf('The description property can only contain items of type \StructType\SearchColumnStringField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->description[] = $item;
        return $this;
    }
    /**
     * Get employmentCategory value
     * @return \StructType\SearchColumnSelectField[]|null
     */
    public function getEmploymentCategory()
    {
        return $this->employmentCategory;
    }
    /**
     * This method is responsible for validating the values passed to the setEmploymentCategory method
     * This method is willingly generated in order to preserve the one-line inline validation within the setEmploymentCategory method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateEmploymentCategoryForArrayConstraintsFromSetEmploymentCategory(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $hcmJobSearchRowBasicEmploymentCategoryItem) {
            // validation for constraint: itemType
            if (!$hcmJobSearchRowBasicEmploymentCategoryItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($hcmJobSearchRowBasicEmploymentCategoryItem) ? get_class($hcmJobSearchRowBasicEmploymentCategoryItem) : sprintf('%s(%s)', gettype($hcmJobSearchRowBasicEmploymentCategoryItem), var_export($hcmJobSearchRowBasicEmploymentCategoryItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The employmentCategory property can only contain items of type \StructType\SearchColumnSelectField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set employmentCategory value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField[] $employmentCategory
     * @return \StructType\HcmJobSearchRowBasic
     */
    public function setEmploymentCategory(array $employmentCategory = array())
    {
        // validation for constraint: array
        if ('' !== ($employmentCategoryArrayErrorMessage = self::validateEmploymentCategoryForArrayConstraintsFromSetEmploymentCategory($employmentCategory))) {
            throw new \InvalidArgumentException($employmentCategoryArrayErrorMessage, __LINE__);
        }
        $this->employmentCategory = $employmentCategory;
        return $this;
    }
    /**
     * Add item to employmentCategory value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField $item
     * @return \StructType\HcmJobSearchRowBasic
     */
    public function addToEmploymentCategory(\StructType\SearchColumnSelectField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnSelectField) {
            throw new \InvalidArgumentException(sprintf('The employmentCategory property can only contain items of type \StructType\SearchColumnSelectField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->employmentCategory[] = $item;
        return $this;
    }
    /**
     * Get externalId value
     * @return \StructType\SearchColumnSelectField[]|null
     */
    public function getExternalId()
    {
        return $this->externalId;
    }
    /**
     * This method is responsible for validating the values passed to the setExternalId method
     * This method is willingly generated in order to preserve the one-line inline validation within the setExternalId method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateExternalIdForArrayConstraintsFromSetExternalId(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $hcmJobSearchRowBasicExternalIdItem) {
            // validation for constraint: itemType
            if (!$hcmJobSearchRowBasicExternalIdItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($hcmJobSearchRowBasicExternalIdItem) ? get_class($hcmJobSearchRowBasicExternalIdItem) : sprintf('%s(%s)', gettype($hcmJobSearchRowBasicExternalIdItem), var_export($hcmJobSearchRowBasicExternalIdItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The externalId property can only contain items of type \StructType\SearchColumnSelectField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set externalId value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField[] $externalId
     * @return \StructType\HcmJobSearchRowBasic
     */
    public function setExternalId(array $externalId = array())
    {
        // validation for constraint: array
        if ('' !== ($externalIdArrayErrorMessage = self::validateExternalIdForArrayConstraintsFromSetExternalId($externalId))) {
            throw new \InvalidArgumentException($externalIdArrayErrorMessage, __LINE__);
        }
        $this->externalId = $externalId;
        return $this;
    }
    /**
     * Add item to externalId value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField $item
     * @return \StructType\HcmJobSearchRowBasic
     */
    public function addToExternalId(\StructType\SearchColumnSelectField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnSelectField) {
            throw new \InvalidArgumentException(sprintf('The externalId property can only contain items of type \StructType\SearchColumnSelectField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->externalId[] = $item;
        return $this;
    }
    /**
     * Get internalId value
     * @return \StructType\SearchColumnSelectField[]|null
     */
    public function getInternalId()
    {
        return $this->internalId;
    }
    /**
     * This method is responsible for validating the values passed to the setInternalId method
     * This method is willingly generated in order to preserve the one-line inline validation within the setInternalId method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateInternalIdForArrayConstraintsFromSetInternalId(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $hcmJobSearchRowBasicInternalIdItem) {
            // validation for constraint: itemType
            if (!$hcmJobSearchRowBasicInternalIdItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($hcmJobSearchRowBasicInternalIdItem) ? get_class($hcmJobSearchRowBasicInternalIdItem) : sprintf('%s(%s)', gettype($hcmJobSearchRowBasicInternalIdItem), var_export($hcmJobSearchRowBasicInternalIdItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The internalId property can only contain items of type \StructType\SearchColumnSelectField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set internalId value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField[] $internalId
     * @return \StructType\HcmJobSearchRowBasic
     */
    public function setInternalId(array $internalId = array())
    {
        // validation for constraint: array
        if ('' !== ($internalIdArrayErrorMessage = self::validateInternalIdForArrayConstraintsFromSetInternalId($internalId))) {
            throw new \InvalidArgumentException($internalIdArrayErrorMessage, __LINE__);
        }
        $this->internalId = $internalId;
        return $this;
    }
    /**
     * Add item to internalId value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField $item
     * @return \StructType\HcmJobSearchRowBasic
     */
    public function addToInternalId(\StructType\SearchColumnSelectField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnSelectField) {
            throw new \InvalidArgumentException(sprintf('The internalId property can only contain items of type \StructType\SearchColumnSelectField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->internalId[] = $item;
        return $this;
    }
    /**
     * Get isInactive value
     * @return \StructType\SearchColumnBooleanField[]|null
     */
    public function getIsInactive()
    {
        return $this->isInactive;
    }
    /**
     * This method is responsible for validating the values passed to the setIsInactive method
     * This method is willingly generated in order to preserve the one-line inline validation within the setIsInactive method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateIsInactiveForArrayConstraintsFromSetIsInactive(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $hcmJobSearchRowBasicIsInactiveItem) {
            // validation for constraint: itemType
            if (!$hcmJobSearchRowBasicIsInactiveItem instanceof \StructType\SearchColumnBooleanField) {
                $invalidValues[] = is_object($hcmJobSearchRowBasicIsInactiveItem) ? get_class($hcmJobSearchRowBasicIsInactiveItem) : sprintf('%s(%s)', gettype($hcmJobSearchRowBasicIsInactiveItem), var_export($hcmJobSearchRowBasicIsInactiveItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The isInactive property can only contain items of type \StructType\SearchColumnBooleanField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set isInactive value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnBooleanField[] $isInactive
     * @return \StructType\HcmJobSearchRowBasic
     */
    public function setIsInactive(array $isInactive = array())
    {
        // validation for constraint: array
        if ('' !== ($isInactiveArrayErrorMessage = self::validateIsInactiveForArrayConstraintsFromSetIsInactive($isInactive))) {
            throw new \InvalidArgumentException($isInactiveArrayErrorMessage, __LINE__);
        }
        $this->isInactive = $isInactive;
        return $this;
    }
    /**
     * Add item to isInactive value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnBooleanField $item
     * @return \StructType\HcmJobSearchRowBasic
     */
    public function addToIsInactive(\StructType\SearchColumnBooleanField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnBooleanField) {
            throw new \InvalidArgumentException(sprintf('The isInactive property can only contain items of type \StructType\SearchColumnBooleanField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->isInactive[] = $item;
        return $this;
    }
    /**
     * Get jobId value
     * @return \StructType\SearchColumnStringField[]|null
     */
    public function getJobId()
    {
        return $this->jobId;
    }
    /**
     * This method is responsible for validating the values passed to the setJobId method
     * This method is willingly generated in order to preserve the one-line inline validation within the setJobId method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateJobIdForArrayConstraintsFromSetJobId(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $hcmJobSearchRowBasicJobIdItem) {
            // validation for constraint: itemType
            if (!$hcmJobSearchRowBasicJobIdItem instanceof \StructType\SearchColumnStringField) {
                $invalidValues[] = is_object($hcmJobSearchRowBasicJobIdItem) ? get_class($hcmJobSearchRowBasicJobIdItem) : sprintf('%s(%s)', gettype($hcmJobSearchRowBasicJobIdItem), var_export($hcmJobSearchRowBasicJobIdItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The jobId property can only contain items of type \StructType\SearchColumnStringField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set jobId value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField[] $jobId
     * @return \StructType\HcmJobSearchRowBasic
     */
    public function setJobId(array $jobId = array())
    {
        // validation for constraint: array
        if ('' !== ($jobIdArrayErrorMessage = self::validateJobIdForArrayConstraintsFromSetJobId($jobId))) {
            throw new \InvalidArgumentException($jobIdArrayErrorMessage, __LINE__);
        }
        $this->jobId = $jobId;
        return $this;
    }
    /**
     * Add item to jobId value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField $item
     * @return \StructType\HcmJobSearchRowBasic
     */
    public function addToJobId(\StructType\SearchColumnStringField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnStringField) {
            throw new \InvalidArgumentException(sprintf('The jobId property can only contain items of type \StructType\SearchColumnStringField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->jobId[] = $item;
        return $this;
    }
    /**
     * Get title value
     * @return \StructType\SearchColumnStringField[]|null
     */
    public function getTitle()
    {
        return $this->title;
    }
    /**
     * This method is responsible for validating the values passed to the setTitle method
     * This method is willingly generated in order to preserve the one-line inline validation within the setTitle method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateTitleForArrayConstraintsFromSetTitle(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $hcmJobSearchRowBasicTitleItem) {
            // validation for constraint: itemType
            if (!$hcmJobSearchRowBasicTitleItem instanceof \StructType\SearchColumnStringField) {
                $invalidValues[] = is_object($hcmJobSearchRowBasicTitleItem) ? get_class($hcmJobSearchRowBasicTitleItem) : sprintf('%s(%s)', gettype($hcmJobSearchRowBasicTitleItem), var_export($hcmJobSearchRowBasicTitleItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The title property can only contain items of type \StructType\SearchColumnStringField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set title value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField[] $title
     * @return \StructType\HcmJobSearchRowBasic
     */
    public function setTitle(array $title = array())
    {
        // validation for constraint: array
        if ('' !== ($titleArrayErrorMessage = self::validateTitleForArrayConstraintsFromSetTitle($title))) {
            throw new \InvalidArgumentException($titleArrayErrorMessage, __LINE__);
        }
        $this->title = $title;
        return $this;
    }
    /**
     * Add item to title value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField $item
     * @return \StructType\HcmJobSearchRowBasic
     */
    public function addToTitle(\StructType\SearchColumnStringField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnStringField) {
            throw new \InvalidArgumentException(sprintf('The title property can only contain items of type \StructType\SearchColumnStringField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->title[] = $item;
        return $this;
    }
    /**
     * Get customFieldList value
     * @return \StructType\SearchColumnCustomFieldList|null
     */
    public function getCustomFieldList()
    {
        return $this->customFieldList;
    }
    /**
     * Set customFieldList value
     * @param \StructType\SearchColumnCustomFieldList $customFieldList
     * @return \StructType\HcmJobSearchRowBasic
     */
    public function setCustomFieldList(\StructType\SearchColumnCustomFieldList $customFieldList = null)
    {
        $this->customFieldList = $customFieldList;
        return $this;
    }
}
