<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for CustomerStatusSearchRowBasic StructType
 * @subpackage Structs
 */
class CustomerStatusSearchRowBasic extends SearchRowBasic
{
    /**
     * The description
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnStringField[]
     */
    public $description;
    /**
     * The externalId
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnSelectField[]
     */
    public $externalId;
    /**
     * The includeInLeadReports
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnBooleanField[]
     */
    public $includeInLeadReports;
    /**
     * 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 name
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnStringField[]
     */
    public $name;
    /**
     * The probability
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnStringField[]
     */
    public $probability;
    /**
     * Constructor method for CustomerStatusSearchRowBasic
     * @uses CustomerStatusSearchRowBasic::setDescription()
     * @uses CustomerStatusSearchRowBasic::setExternalId()
     * @uses CustomerStatusSearchRowBasic::setIncludeInLeadReports()
     * @uses CustomerStatusSearchRowBasic::setInternalId()
     * @uses CustomerStatusSearchRowBasic::setIsInactive()
     * @uses CustomerStatusSearchRowBasic::setName()
     * @uses CustomerStatusSearchRowBasic::setProbability()
     * @param \StructType\SearchColumnStringField[] $description
     * @param \StructType\SearchColumnSelectField[] $externalId
     * @param \StructType\SearchColumnBooleanField[] $includeInLeadReports
     * @param \StructType\SearchColumnSelectField[] $internalId
     * @param \StructType\SearchColumnBooleanField[] $isInactive
     * @param \StructType\SearchColumnStringField[] $name
     * @param \StructType\SearchColumnStringField[] $probability
     */
    public function __construct(array $description = array(), array $externalId = array(), array $includeInLeadReports = array(), array $internalId = array(), array $isInactive = array(), array $name = array(), array $probability = array())
    {
        $this
            ->setDescription($description)
            ->setExternalId($externalId)
            ->setIncludeInLeadReports($includeInLeadReports)
            ->setInternalId($internalId)
            ->setIsInactive($isInactive)
            ->setName($name)
            ->setProbability($probability);
    }
    /**
     * 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 $customerStatusSearchRowBasicDescriptionItem) {
            // validation for constraint: itemType
            if (!$customerStatusSearchRowBasicDescriptionItem instanceof \StructType\SearchColumnStringField) {
                $invalidValues[] = is_object($customerStatusSearchRowBasicDescriptionItem) ? get_class($customerStatusSearchRowBasicDescriptionItem) : sprintf('%s(%s)', gettype($customerStatusSearchRowBasicDescriptionItem), var_export($customerStatusSearchRowBasicDescriptionItem, 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\CustomerStatusSearchRowBasic
     */
    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\CustomerStatusSearchRowBasic
     */
    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 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 $customerStatusSearchRowBasicExternalIdItem) {
            // validation for constraint: itemType
            if (!$customerStatusSearchRowBasicExternalIdItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($customerStatusSearchRowBasicExternalIdItem) ? get_class($customerStatusSearchRowBasicExternalIdItem) : sprintf('%s(%s)', gettype($customerStatusSearchRowBasicExternalIdItem), var_export($customerStatusSearchRowBasicExternalIdItem, 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\CustomerStatusSearchRowBasic
     */
    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\CustomerStatusSearchRowBasic
     */
    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 includeInLeadReports value
     * @return \StructType\SearchColumnBooleanField[]|null
     */
    public function getIncludeInLeadReports()
    {
        return $this->includeInLeadReports;
    }
    /**
     * This method is responsible for validating the values passed to the setIncludeInLeadReports method
     * This method is willingly generated in order to preserve the one-line inline validation within the setIncludeInLeadReports method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateIncludeInLeadReportsForArrayConstraintsFromSetIncludeInLeadReports(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $customerStatusSearchRowBasicIncludeInLeadReportsItem) {
            // validation for constraint: itemType
            if (!$customerStatusSearchRowBasicIncludeInLeadReportsItem instanceof \StructType\SearchColumnBooleanField) {
                $invalidValues[] = is_object($customerStatusSearchRowBasicIncludeInLeadReportsItem) ? get_class($customerStatusSearchRowBasicIncludeInLeadReportsItem) : sprintf('%s(%s)', gettype($customerStatusSearchRowBasicIncludeInLeadReportsItem), var_export($customerStatusSearchRowBasicIncludeInLeadReportsItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The includeInLeadReports 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 includeInLeadReports value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnBooleanField[] $includeInLeadReports
     * @return \StructType\CustomerStatusSearchRowBasic
     */
    public function setIncludeInLeadReports(array $includeInLeadReports = array())
    {
        // validation for constraint: array
        if ('' !== ($includeInLeadReportsArrayErrorMessage = self::validateIncludeInLeadReportsForArrayConstraintsFromSetIncludeInLeadReports($includeInLeadReports))) {
            throw new \InvalidArgumentException($includeInLeadReportsArrayErrorMessage, __LINE__);
        }
        $this->includeInLeadReports = $includeInLeadReports;
        return $this;
    }
    /**
     * Add item to includeInLeadReports value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnBooleanField $item
     * @return \StructType\CustomerStatusSearchRowBasic
     */
    public function addToIncludeInLeadReports(\StructType\SearchColumnBooleanField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnBooleanField) {
            throw new \InvalidArgumentException(sprintf('The includeInLeadReports 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->includeInLeadReports[] = $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 $customerStatusSearchRowBasicInternalIdItem) {
            // validation for constraint: itemType
            if (!$customerStatusSearchRowBasicInternalIdItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($customerStatusSearchRowBasicInternalIdItem) ? get_class($customerStatusSearchRowBasicInternalIdItem) : sprintf('%s(%s)', gettype($customerStatusSearchRowBasicInternalIdItem), var_export($customerStatusSearchRowBasicInternalIdItem, 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\CustomerStatusSearchRowBasic
     */
    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\CustomerStatusSearchRowBasic
     */
    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 $customerStatusSearchRowBasicIsInactiveItem) {
            // validation for constraint: itemType
            if (!$customerStatusSearchRowBasicIsInactiveItem instanceof \StructType\SearchColumnBooleanField) {
                $invalidValues[] = is_object($customerStatusSearchRowBasicIsInactiveItem) ? get_class($customerStatusSearchRowBasicIsInactiveItem) : sprintf('%s(%s)', gettype($customerStatusSearchRowBasicIsInactiveItem), var_export($customerStatusSearchRowBasicIsInactiveItem, 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\CustomerStatusSearchRowBasic
     */
    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\CustomerStatusSearchRowBasic
     */
    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 name value
     * @return \StructType\SearchColumnStringField[]|null
     */
    public function getName()
    {
        return $this->name;
    }
    /**
     * This method is responsible for validating the values passed to the setName method
     * This method is willingly generated in order to preserve the one-line inline validation within the setName method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateNameForArrayConstraintsFromSetName(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $customerStatusSearchRowBasicNameItem) {
            // validation for constraint: itemType
            if (!$customerStatusSearchRowBasicNameItem instanceof \StructType\SearchColumnStringField) {
                $invalidValues[] = is_object($customerStatusSearchRowBasicNameItem) ? get_class($customerStatusSearchRowBasicNameItem) : sprintf('%s(%s)', gettype($customerStatusSearchRowBasicNameItem), var_export($customerStatusSearchRowBasicNameItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The name 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 name value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField[] $name
     * @return \StructType\CustomerStatusSearchRowBasic
     */
    public function setName(array $name = array())
    {
        // validation for constraint: array
        if ('' !== ($nameArrayErrorMessage = self::validateNameForArrayConstraintsFromSetName($name))) {
            throw new \InvalidArgumentException($nameArrayErrorMessage, __LINE__);
        }
        $this->name = $name;
        return $this;
    }
    /**
     * Add item to name value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField $item
     * @return \StructType\CustomerStatusSearchRowBasic
     */
    public function addToName(\StructType\SearchColumnStringField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnStringField) {
            throw new \InvalidArgumentException(sprintf('The name 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->name[] = $item;
        return $this;
    }
    /**
     * Get probability value
     * @return \StructType\SearchColumnStringField[]|null
     */
    public function getProbability()
    {
        return $this->probability;
    }
    /**
     * This method is responsible for validating the values passed to the setProbability method
     * This method is willingly generated in order to preserve the one-line inline validation within the setProbability method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateProbabilityForArrayConstraintsFromSetProbability(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $customerStatusSearchRowBasicProbabilityItem) {
            // validation for constraint: itemType
            if (!$customerStatusSearchRowBasicProbabilityItem instanceof \StructType\SearchColumnStringField) {
                $invalidValues[] = is_object($customerStatusSearchRowBasicProbabilityItem) ? get_class($customerStatusSearchRowBasicProbabilityItem) : sprintf('%s(%s)', gettype($customerStatusSearchRowBasicProbabilityItem), var_export($customerStatusSearchRowBasicProbabilityItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The probability 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 probability value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField[] $probability
     * @return \StructType\CustomerStatusSearchRowBasic
     */
    public function setProbability(array $probability = array())
    {
        // validation for constraint: array
        if ('' !== ($probabilityArrayErrorMessage = self::validateProbabilityForArrayConstraintsFromSetProbability($probability))) {
            throw new \InvalidArgumentException($probabilityArrayErrorMessage, __LINE__);
        }
        $this->probability = $probability;
        return $this;
    }
    /**
     * Add item to probability value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField $item
     * @return \StructType\CustomerStatusSearchRowBasic
     */
    public function addToProbability(\StructType\SearchColumnStringField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnStringField) {
            throw new \InvalidArgumentException(sprintf('The probability 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->probability[] = $item;
        return $this;
    }
}
