<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for BillingScheduleSearchRowBasic StructType
 * @subpackage Structs
 */
class BillingScheduleSearchRowBasic extends SearchRowBasic
{
    /**
     * The applyToSubtotal
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnBooleanField[]
     */
    public $applyToSubtotal;
    /**
     * The externalId
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnSelectField[]
     */
    public $externalId;
    /**
     * The frequency
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnEnumSelectField[]
     */
    public $frequency;
    /**
     * The inArrears
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnBooleanField[]
     */
    public $inArrears;
    /**
     * The initialAmount
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnStringField[]
     */
    public $initialAmount;
    /**
     * The initialTerms
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnStringField[]
     */
    public $initialTerms;
    /**
     * 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 isPublic
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnBooleanField[]
     */
    public $isPublic;
    /**
     * The name
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnStringField[]
     */
    public $name;
    /**
     * The recurrenceCount
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnLongField[]
     */
    public $recurrenceCount;
    /**
     * The recurrencePattern
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnEnumSelectField[]
     */
    public $recurrencePattern;
    /**
     * The recurrenceTerms
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnStringField[]
     */
    public $recurrenceTerms;
    /**
     * The repeatEvery
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnLongField[]
     */
    public $repeatEvery;
    /**
     * The type
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnEnumSelectField[]
     */
    public $type;
    /**
     * Constructor method for BillingScheduleSearchRowBasic
     * @uses BillingScheduleSearchRowBasic::setApplyToSubtotal()
     * @uses BillingScheduleSearchRowBasic::setExternalId()
     * @uses BillingScheduleSearchRowBasic::setFrequency()
     * @uses BillingScheduleSearchRowBasic::setInArrears()
     * @uses BillingScheduleSearchRowBasic::setInitialAmount()
     * @uses BillingScheduleSearchRowBasic::setInitialTerms()
     * @uses BillingScheduleSearchRowBasic::setInternalId()
     * @uses BillingScheduleSearchRowBasic::setIsInactive()
     * @uses BillingScheduleSearchRowBasic::setIsPublic()
     * @uses BillingScheduleSearchRowBasic::setName()
     * @uses BillingScheduleSearchRowBasic::setRecurrenceCount()
     * @uses BillingScheduleSearchRowBasic::setRecurrencePattern()
     * @uses BillingScheduleSearchRowBasic::setRecurrenceTerms()
     * @uses BillingScheduleSearchRowBasic::setRepeatEvery()
     * @uses BillingScheduleSearchRowBasic::setType()
     * @param \StructType\SearchColumnBooleanField[] $applyToSubtotal
     * @param \StructType\SearchColumnSelectField[] $externalId
     * @param \StructType\SearchColumnEnumSelectField[] $frequency
     * @param \StructType\SearchColumnBooleanField[] $inArrears
     * @param \StructType\SearchColumnStringField[] $initialAmount
     * @param \StructType\SearchColumnStringField[] $initialTerms
     * @param \StructType\SearchColumnSelectField[] $internalId
     * @param \StructType\SearchColumnBooleanField[] $isInactive
     * @param \StructType\SearchColumnBooleanField[] $isPublic
     * @param \StructType\SearchColumnStringField[] $name
     * @param \StructType\SearchColumnLongField[] $recurrenceCount
     * @param \StructType\SearchColumnEnumSelectField[] $recurrencePattern
     * @param \StructType\SearchColumnStringField[] $recurrenceTerms
     * @param \StructType\SearchColumnLongField[] $repeatEvery
     * @param \StructType\SearchColumnEnumSelectField[] $type
     */
    public function __construct(array $applyToSubtotal = array(), array $externalId = array(), array $frequency = array(), array $inArrears = array(), array $initialAmount = array(), array $initialTerms = array(), array $internalId = array(), array $isInactive = array(), array $isPublic = array(), array $name = array(), array $recurrenceCount = array(), array $recurrencePattern = array(), array $recurrenceTerms = array(), array $repeatEvery = array(), array $type = array())
    {
        $this
            ->setApplyToSubtotal($applyToSubtotal)
            ->setExternalId($externalId)
            ->setFrequency($frequency)
            ->setInArrears($inArrears)
            ->setInitialAmount($initialAmount)
            ->setInitialTerms($initialTerms)
            ->setInternalId($internalId)
            ->setIsInactive($isInactive)
            ->setIsPublic($isPublic)
            ->setName($name)
            ->setRecurrenceCount($recurrenceCount)
            ->setRecurrencePattern($recurrencePattern)
            ->setRecurrenceTerms($recurrenceTerms)
            ->setRepeatEvery($repeatEvery)
            ->setType($type);
    }
    /**
     * Get applyToSubtotal value
     * @return \StructType\SearchColumnBooleanField[]|null
     */
    public function getApplyToSubtotal()
    {
        return $this->applyToSubtotal;
    }
    /**
     * This method is responsible for validating the values passed to the setApplyToSubtotal method
     * This method is willingly generated in order to preserve the one-line inline validation within the setApplyToSubtotal method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateApplyToSubtotalForArrayConstraintsFromSetApplyToSubtotal(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $billingScheduleSearchRowBasicApplyToSubtotalItem) {
            // validation for constraint: itemType
            if (!$billingScheduleSearchRowBasicApplyToSubtotalItem instanceof \StructType\SearchColumnBooleanField) {
                $invalidValues[] = is_object($billingScheduleSearchRowBasicApplyToSubtotalItem) ? get_class($billingScheduleSearchRowBasicApplyToSubtotalItem) : sprintf('%s(%s)', gettype($billingScheduleSearchRowBasicApplyToSubtotalItem), var_export($billingScheduleSearchRowBasicApplyToSubtotalItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The applyToSubtotal 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 applyToSubtotal value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnBooleanField[] $applyToSubtotal
     * @return \StructType\BillingScheduleSearchRowBasic
     */
    public function setApplyToSubtotal(array $applyToSubtotal = array())
    {
        // validation for constraint: array
        if ('' !== ($applyToSubtotalArrayErrorMessage = self::validateApplyToSubtotalForArrayConstraintsFromSetApplyToSubtotal($applyToSubtotal))) {
            throw new \InvalidArgumentException($applyToSubtotalArrayErrorMessage, __LINE__);
        }
        $this->applyToSubtotal = $applyToSubtotal;
        return $this;
    }
    /**
     * Add item to applyToSubtotal value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnBooleanField $item
     * @return \StructType\BillingScheduleSearchRowBasic
     */
    public function addToApplyToSubtotal(\StructType\SearchColumnBooleanField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnBooleanField) {
            throw new \InvalidArgumentException(sprintf('The applyToSubtotal 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->applyToSubtotal[] = $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 $billingScheduleSearchRowBasicExternalIdItem) {
            // validation for constraint: itemType
            if (!$billingScheduleSearchRowBasicExternalIdItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($billingScheduleSearchRowBasicExternalIdItem) ? get_class($billingScheduleSearchRowBasicExternalIdItem) : sprintf('%s(%s)', gettype($billingScheduleSearchRowBasicExternalIdItem), var_export($billingScheduleSearchRowBasicExternalIdItem, 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\BillingScheduleSearchRowBasic
     */
    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\BillingScheduleSearchRowBasic
     */
    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 frequency value
     * @return \StructType\SearchColumnEnumSelectField[]|null
     */
    public function getFrequency()
    {
        return $this->frequency;
    }
    /**
     * This method is responsible for validating the values passed to the setFrequency method
     * This method is willingly generated in order to preserve the one-line inline validation within the setFrequency method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateFrequencyForArrayConstraintsFromSetFrequency(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $billingScheduleSearchRowBasicFrequencyItem) {
            // validation for constraint: itemType
            if (!$billingScheduleSearchRowBasicFrequencyItem instanceof \StructType\SearchColumnEnumSelectField) {
                $invalidValues[] = is_object($billingScheduleSearchRowBasicFrequencyItem) ? get_class($billingScheduleSearchRowBasicFrequencyItem) : sprintf('%s(%s)', gettype($billingScheduleSearchRowBasicFrequencyItem), var_export($billingScheduleSearchRowBasicFrequencyItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The frequency property can only contain items of type \StructType\SearchColumnEnumSelectField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set frequency value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnEnumSelectField[] $frequency
     * @return \StructType\BillingScheduleSearchRowBasic
     */
    public function setFrequency(array $frequency = array())
    {
        // validation for constraint: array
        if ('' !== ($frequencyArrayErrorMessage = self::validateFrequencyForArrayConstraintsFromSetFrequency($frequency))) {
            throw new \InvalidArgumentException($frequencyArrayErrorMessage, __LINE__);
        }
        $this->frequency = $frequency;
        return $this;
    }
    /**
     * Add item to frequency value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnEnumSelectField $item
     * @return \StructType\BillingScheduleSearchRowBasic
     */
    public function addToFrequency(\StructType\SearchColumnEnumSelectField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnEnumSelectField) {
            throw new \InvalidArgumentException(sprintf('The frequency property can only contain items of type \StructType\SearchColumnEnumSelectField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->frequency[] = $item;
        return $this;
    }
    /**
     * Get inArrears value
     * @return \StructType\SearchColumnBooleanField[]|null
     */
    public function getInArrears()
    {
        return $this->inArrears;
    }
    /**
     * This method is responsible for validating the values passed to the setInArrears method
     * This method is willingly generated in order to preserve the one-line inline validation within the setInArrears method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateInArrearsForArrayConstraintsFromSetInArrears(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $billingScheduleSearchRowBasicInArrearsItem) {
            // validation for constraint: itemType
            if (!$billingScheduleSearchRowBasicInArrearsItem instanceof \StructType\SearchColumnBooleanField) {
                $invalidValues[] = is_object($billingScheduleSearchRowBasicInArrearsItem) ? get_class($billingScheduleSearchRowBasicInArrearsItem) : sprintf('%s(%s)', gettype($billingScheduleSearchRowBasicInArrearsItem), var_export($billingScheduleSearchRowBasicInArrearsItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The inArrears 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 inArrears value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnBooleanField[] $inArrears
     * @return \StructType\BillingScheduleSearchRowBasic
     */
    public function setInArrears(array $inArrears = array())
    {
        // validation for constraint: array
        if ('' !== ($inArrearsArrayErrorMessage = self::validateInArrearsForArrayConstraintsFromSetInArrears($inArrears))) {
            throw new \InvalidArgumentException($inArrearsArrayErrorMessage, __LINE__);
        }
        $this->inArrears = $inArrears;
        return $this;
    }
    /**
     * Add item to inArrears value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnBooleanField $item
     * @return \StructType\BillingScheduleSearchRowBasic
     */
    public function addToInArrears(\StructType\SearchColumnBooleanField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnBooleanField) {
            throw new \InvalidArgumentException(sprintf('The inArrears 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->inArrears[] = $item;
        return $this;
    }
    /**
     * Get initialAmount value
     * @return \StructType\SearchColumnStringField[]|null
     */
    public function getInitialAmount()
    {
        return $this->initialAmount;
    }
    /**
     * This method is responsible for validating the values passed to the setInitialAmount method
     * This method is willingly generated in order to preserve the one-line inline validation within the setInitialAmount method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateInitialAmountForArrayConstraintsFromSetInitialAmount(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $billingScheduleSearchRowBasicInitialAmountItem) {
            // validation for constraint: itemType
            if (!$billingScheduleSearchRowBasicInitialAmountItem instanceof \StructType\SearchColumnStringField) {
                $invalidValues[] = is_object($billingScheduleSearchRowBasicInitialAmountItem) ? get_class($billingScheduleSearchRowBasicInitialAmountItem) : sprintf('%s(%s)', gettype($billingScheduleSearchRowBasicInitialAmountItem), var_export($billingScheduleSearchRowBasicInitialAmountItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The initialAmount 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 initialAmount value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField[] $initialAmount
     * @return \StructType\BillingScheduleSearchRowBasic
     */
    public function setInitialAmount(array $initialAmount = array())
    {
        // validation for constraint: array
        if ('' !== ($initialAmountArrayErrorMessage = self::validateInitialAmountForArrayConstraintsFromSetInitialAmount($initialAmount))) {
            throw new \InvalidArgumentException($initialAmountArrayErrorMessage, __LINE__);
        }
        $this->initialAmount = $initialAmount;
        return $this;
    }
    /**
     * Add item to initialAmount value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField $item
     * @return \StructType\BillingScheduleSearchRowBasic
     */
    public function addToInitialAmount(\StructType\SearchColumnStringField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnStringField) {
            throw new \InvalidArgumentException(sprintf('The initialAmount 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->initialAmount[] = $item;
        return $this;
    }
    /**
     * Get initialTerms value
     * @return \StructType\SearchColumnStringField[]|null
     */
    public function getInitialTerms()
    {
        return $this->initialTerms;
    }
    /**
     * This method is responsible for validating the values passed to the setInitialTerms method
     * This method is willingly generated in order to preserve the one-line inline validation within the setInitialTerms method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateInitialTermsForArrayConstraintsFromSetInitialTerms(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $billingScheduleSearchRowBasicInitialTermsItem) {
            // validation for constraint: itemType
            if (!$billingScheduleSearchRowBasicInitialTermsItem instanceof \StructType\SearchColumnStringField) {
                $invalidValues[] = is_object($billingScheduleSearchRowBasicInitialTermsItem) ? get_class($billingScheduleSearchRowBasicInitialTermsItem) : sprintf('%s(%s)', gettype($billingScheduleSearchRowBasicInitialTermsItem), var_export($billingScheduleSearchRowBasicInitialTermsItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The initialTerms 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 initialTerms value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField[] $initialTerms
     * @return \StructType\BillingScheduleSearchRowBasic
     */
    public function setInitialTerms(array $initialTerms = array())
    {
        // validation for constraint: array
        if ('' !== ($initialTermsArrayErrorMessage = self::validateInitialTermsForArrayConstraintsFromSetInitialTerms($initialTerms))) {
            throw new \InvalidArgumentException($initialTermsArrayErrorMessage, __LINE__);
        }
        $this->initialTerms = $initialTerms;
        return $this;
    }
    /**
     * Add item to initialTerms value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField $item
     * @return \StructType\BillingScheduleSearchRowBasic
     */
    public function addToInitialTerms(\StructType\SearchColumnStringField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnStringField) {
            throw new \InvalidArgumentException(sprintf('The initialTerms 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->initialTerms[] = $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 $billingScheduleSearchRowBasicInternalIdItem) {
            // validation for constraint: itemType
            if (!$billingScheduleSearchRowBasicInternalIdItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($billingScheduleSearchRowBasicInternalIdItem) ? get_class($billingScheduleSearchRowBasicInternalIdItem) : sprintf('%s(%s)', gettype($billingScheduleSearchRowBasicInternalIdItem), var_export($billingScheduleSearchRowBasicInternalIdItem, 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\BillingScheduleSearchRowBasic
     */
    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\BillingScheduleSearchRowBasic
     */
    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 $billingScheduleSearchRowBasicIsInactiveItem) {
            // validation for constraint: itemType
            if (!$billingScheduleSearchRowBasicIsInactiveItem instanceof \StructType\SearchColumnBooleanField) {
                $invalidValues[] = is_object($billingScheduleSearchRowBasicIsInactiveItem) ? get_class($billingScheduleSearchRowBasicIsInactiveItem) : sprintf('%s(%s)', gettype($billingScheduleSearchRowBasicIsInactiveItem), var_export($billingScheduleSearchRowBasicIsInactiveItem, 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\BillingScheduleSearchRowBasic
     */
    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\BillingScheduleSearchRowBasic
     */
    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 isPublic value
     * @return \StructType\SearchColumnBooleanField[]|null
     */
    public function getIsPublic()
    {
        return $this->isPublic;
    }
    /**
     * This method is responsible for validating the values passed to the setIsPublic method
     * This method is willingly generated in order to preserve the one-line inline validation within the setIsPublic method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateIsPublicForArrayConstraintsFromSetIsPublic(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $billingScheduleSearchRowBasicIsPublicItem) {
            // validation for constraint: itemType
            if (!$billingScheduleSearchRowBasicIsPublicItem instanceof \StructType\SearchColumnBooleanField) {
                $invalidValues[] = is_object($billingScheduleSearchRowBasicIsPublicItem) ? get_class($billingScheduleSearchRowBasicIsPublicItem) : sprintf('%s(%s)', gettype($billingScheduleSearchRowBasicIsPublicItem), var_export($billingScheduleSearchRowBasicIsPublicItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The isPublic 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 isPublic value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnBooleanField[] $isPublic
     * @return \StructType\BillingScheduleSearchRowBasic
     */
    public function setIsPublic(array $isPublic = array())
    {
        // validation for constraint: array
        if ('' !== ($isPublicArrayErrorMessage = self::validateIsPublicForArrayConstraintsFromSetIsPublic($isPublic))) {
            throw new \InvalidArgumentException($isPublicArrayErrorMessage, __LINE__);
        }
        $this->isPublic = $isPublic;
        return $this;
    }
    /**
     * Add item to isPublic value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnBooleanField $item
     * @return \StructType\BillingScheduleSearchRowBasic
     */
    public function addToIsPublic(\StructType\SearchColumnBooleanField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnBooleanField) {
            throw new \InvalidArgumentException(sprintf('The isPublic 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->isPublic[] = $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 $billingScheduleSearchRowBasicNameItem) {
            // validation for constraint: itemType
            if (!$billingScheduleSearchRowBasicNameItem instanceof \StructType\SearchColumnStringField) {
                $invalidValues[] = is_object($billingScheduleSearchRowBasicNameItem) ? get_class($billingScheduleSearchRowBasicNameItem) : sprintf('%s(%s)', gettype($billingScheduleSearchRowBasicNameItem), var_export($billingScheduleSearchRowBasicNameItem, 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\BillingScheduleSearchRowBasic
     */
    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\BillingScheduleSearchRowBasic
     */
    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 recurrenceCount value
     * @return \StructType\SearchColumnLongField[]|null
     */
    public function getRecurrenceCount()
    {
        return $this->recurrenceCount;
    }
    /**
     * This method is responsible for validating the values passed to the setRecurrenceCount method
     * This method is willingly generated in order to preserve the one-line inline validation within the setRecurrenceCount method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateRecurrenceCountForArrayConstraintsFromSetRecurrenceCount(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $billingScheduleSearchRowBasicRecurrenceCountItem) {
            // validation for constraint: itemType
            if (!$billingScheduleSearchRowBasicRecurrenceCountItem instanceof \StructType\SearchColumnLongField) {
                $invalidValues[] = is_object($billingScheduleSearchRowBasicRecurrenceCountItem) ? get_class($billingScheduleSearchRowBasicRecurrenceCountItem) : sprintf('%s(%s)', gettype($billingScheduleSearchRowBasicRecurrenceCountItem), var_export($billingScheduleSearchRowBasicRecurrenceCountItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The recurrenceCount property can only contain items of type \StructType\SearchColumnLongField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set recurrenceCount value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnLongField[] $recurrenceCount
     * @return \StructType\BillingScheduleSearchRowBasic
     */
    public function setRecurrenceCount(array $recurrenceCount = array())
    {
        // validation for constraint: array
        if ('' !== ($recurrenceCountArrayErrorMessage = self::validateRecurrenceCountForArrayConstraintsFromSetRecurrenceCount($recurrenceCount))) {
            throw new \InvalidArgumentException($recurrenceCountArrayErrorMessage, __LINE__);
        }
        $this->recurrenceCount = $recurrenceCount;
        return $this;
    }
    /**
     * Add item to recurrenceCount value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnLongField $item
     * @return \StructType\BillingScheduleSearchRowBasic
     */
    public function addToRecurrenceCount(\StructType\SearchColumnLongField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnLongField) {
            throw new \InvalidArgumentException(sprintf('The recurrenceCount property can only contain items of type \StructType\SearchColumnLongField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->recurrenceCount[] = $item;
        return $this;
    }
    /**
     * Get recurrencePattern value
     * @return \StructType\SearchColumnEnumSelectField[]|null
     */
    public function getRecurrencePattern()
    {
        return $this->recurrencePattern;
    }
    /**
     * This method is responsible for validating the values passed to the setRecurrencePattern method
     * This method is willingly generated in order to preserve the one-line inline validation within the setRecurrencePattern method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateRecurrencePatternForArrayConstraintsFromSetRecurrencePattern(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $billingScheduleSearchRowBasicRecurrencePatternItem) {
            // validation for constraint: itemType
            if (!$billingScheduleSearchRowBasicRecurrencePatternItem instanceof \StructType\SearchColumnEnumSelectField) {
                $invalidValues[] = is_object($billingScheduleSearchRowBasicRecurrencePatternItem) ? get_class($billingScheduleSearchRowBasicRecurrencePatternItem) : sprintf('%s(%s)', gettype($billingScheduleSearchRowBasicRecurrencePatternItem), var_export($billingScheduleSearchRowBasicRecurrencePatternItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The recurrencePattern property can only contain items of type \StructType\SearchColumnEnumSelectField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set recurrencePattern value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnEnumSelectField[] $recurrencePattern
     * @return \StructType\BillingScheduleSearchRowBasic
     */
    public function setRecurrencePattern(array $recurrencePattern = array())
    {
        // validation for constraint: array
        if ('' !== ($recurrencePatternArrayErrorMessage = self::validateRecurrencePatternForArrayConstraintsFromSetRecurrencePattern($recurrencePattern))) {
            throw new \InvalidArgumentException($recurrencePatternArrayErrorMessage, __LINE__);
        }
        $this->recurrencePattern = $recurrencePattern;
        return $this;
    }
    /**
     * Add item to recurrencePattern value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnEnumSelectField $item
     * @return \StructType\BillingScheduleSearchRowBasic
     */
    public function addToRecurrencePattern(\StructType\SearchColumnEnumSelectField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnEnumSelectField) {
            throw new \InvalidArgumentException(sprintf('The recurrencePattern property can only contain items of type \StructType\SearchColumnEnumSelectField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->recurrencePattern[] = $item;
        return $this;
    }
    /**
     * Get recurrenceTerms value
     * @return \StructType\SearchColumnStringField[]|null
     */
    public function getRecurrenceTerms()
    {
        return $this->recurrenceTerms;
    }
    /**
     * This method is responsible for validating the values passed to the setRecurrenceTerms method
     * This method is willingly generated in order to preserve the one-line inline validation within the setRecurrenceTerms method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateRecurrenceTermsForArrayConstraintsFromSetRecurrenceTerms(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $billingScheduleSearchRowBasicRecurrenceTermsItem) {
            // validation for constraint: itemType
            if (!$billingScheduleSearchRowBasicRecurrenceTermsItem instanceof \StructType\SearchColumnStringField) {
                $invalidValues[] = is_object($billingScheduleSearchRowBasicRecurrenceTermsItem) ? get_class($billingScheduleSearchRowBasicRecurrenceTermsItem) : sprintf('%s(%s)', gettype($billingScheduleSearchRowBasicRecurrenceTermsItem), var_export($billingScheduleSearchRowBasicRecurrenceTermsItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The recurrenceTerms 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 recurrenceTerms value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField[] $recurrenceTerms
     * @return \StructType\BillingScheduleSearchRowBasic
     */
    public function setRecurrenceTerms(array $recurrenceTerms = array())
    {
        // validation for constraint: array
        if ('' !== ($recurrenceTermsArrayErrorMessage = self::validateRecurrenceTermsForArrayConstraintsFromSetRecurrenceTerms($recurrenceTerms))) {
            throw new \InvalidArgumentException($recurrenceTermsArrayErrorMessage, __LINE__);
        }
        $this->recurrenceTerms = $recurrenceTerms;
        return $this;
    }
    /**
     * Add item to recurrenceTerms value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField $item
     * @return \StructType\BillingScheduleSearchRowBasic
     */
    public function addToRecurrenceTerms(\StructType\SearchColumnStringField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnStringField) {
            throw new \InvalidArgumentException(sprintf('The recurrenceTerms 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->recurrenceTerms[] = $item;
        return $this;
    }
    /**
     * Get repeatEvery value
     * @return \StructType\SearchColumnLongField[]|null
     */
    public function getRepeatEvery()
    {
        return $this->repeatEvery;
    }
    /**
     * This method is responsible for validating the values passed to the setRepeatEvery method
     * This method is willingly generated in order to preserve the one-line inline validation within the setRepeatEvery method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateRepeatEveryForArrayConstraintsFromSetRepeatEvery(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $billingScheduleSearchRowBasicRepeatEveryItem) {
            // validation for constraint: itemType
            if (!$billingScheduleSearchRowBasicRepeatEveryItem instanceof \StructType\SearchColumnLongField) {
                $invalidValues[] = is_object($billingScheduleSearchRowBasicRepeatEveryItem) ? get_class($billingScheduleSearchRowBasicRepeatEveryItem) : sprintf('%s(%s)', gettype($billingScheduleSearchRowBasicRepeatEveryItem), var_export($billingScheduleSearchRowBasicRepeatEveryItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The repeatEvery property can only contain items of type \StructType\SearchColumnLongField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set repeatEvery value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnLongField[] $repeatEvery
     * @return \StructType\BillingScheduleSearchRowBasic
     */
    public function setRepeatEvery(array $repeatEvery = array())
    {
        // validation for constraint: array
        if ('' !== ($repeatEveryArrayErrorMessage = self::validateRepeatEveryForArrayConstraintsFromSetRepeatEvery($repeatEvery))) {
            throw new \InvalidArgumentException($repeatEveryArrayErrorMessage, __LINE__);
        }
        $this->repeatEvery = $repeatEvery;
        return $this;
    }
    /**
     * Add item to repeatEvery value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnLongField $item
     * @return \StructType\BillingScheduleSearchRowBasic
     */
    public function addToRepeatEvery(\StructType\SearchColumnLongField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnLongField) {
            throw new \InvalidArgumentException(sprintf('The repeatEvery property can only contain items of type \StructType\SearchColumnLongField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->repeatEvery[] = $item;
        return $this;
    }
    /**
     * Get type value
     * @return \StructType\SearchColumnEnumSelectField[]|null
     */
    public function getType()
    {
        return $this->type;
    }
    /**
     * This method is responsible for validating the values passed to the setType method
     * This method is willingly generated in order to preserve the one-line inline validation within the setType method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateTypeForArrayConstraintsFromSetType(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $billingScheduleSearchRowBasicTypeItem) {
            // validation for constraint: itemType
            if (!$billingScheduleSearchRowBasicTypeItem instanceof \StructType\SearchColumnEnumSelectField) {
                $invalidValues[] = is_object($billingScheduleSearchRowBasicTypeItem) ? get_class($billingScheduleSearchRowBasicTypeItem) : sprintf('%s(%s)', gettype($billingScheduleSearchRowBasicTypeItem), var_export($billingScheduleSearchRowBasicTypeItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The type property can only contain items of type \StructType\SearchColumnEnumSelectField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set type value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnEnumSelectField[] $type
     * @return \StructType\BillingScheduleSearchRowBasic
     */
    public function setType(array $type = array())
    {
        // validation for constraint: array
        if ('' !== ($typeArrayErrorMessage = self::validateTypeForArrayConstraintsFromSetType($type))) {
            throw new \InvalidArgumentException($typeArrayErrorMessage, __LINE__);
        }
        $this->type = $type;
        return $this;
    }
    /**
     * Add item to type value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnEnumSelectField $item
     * @return \StructType\BillingScheduleSearchRowBasic
     */
    public function addToType(\StructType\SearchColumnEnumSelectField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnEnumSelectField) {
            throw new \InvalidArgumentException(sprintf('The type property can only contain items of type \StructType\SearchColumnEnumSelectField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->type[] = $item;
        return $this;
    }
}
