<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for UsageSearchRowBasic StructType
 * @subpackage Structs
 */
class UsageSearchRowBasic extends SearchRowBasic
{
    /**
     * The customer
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnSelectField[]
     */
    public $customer;
    /**
     * The date
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnDateField[]
     */
    public $date;
    /**
     * 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 item
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnSelectField[]
     */
    public $item;
    /**
     * The memo
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnStringField[]
     */
    public $memo;
    /**
     * The quantity
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnDoubleField[]
     */
    public $quantity;
    /**
     * The subscription
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnSelectField[]
     */
    public $subscription;
    /**
     * The subscriptionLine
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnSelectField[]
     */
    public $subscriptionLine;
    /**
     * The subscriptionPlan
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnSelectField[]
     */
    public $subscriptionPlan;
    /**
     * Constructor method for UsageSearchRowBasic
     * @uses UsageSearchRowBasic::setCustomer()
     * @uses UsageSearchRowBasic::setDate()
     * @uses UsageSearchRowBasic::setExternalId()
     * @uses UsageSearchRowBasic::setInternalId()
     * @uses UsageSearchRowBasic::setItem()
     * @uses UsageSearchRowBasic::setMemo()
     * @uses UsageSearchRowBasic::setQuantity()
     * @uses UsageSearchRowBasic::setSubscription()
     * @uses UsageSearchRowBasic::setSubscriptionLine()
     * @uses UsageSearchRowBasic::setSubscriptionPlan()
     * @param \StructType\SearchColumnSelectField[] $customer
     * @param \StructType\SearchColumnDateField[] $date
     * @param \StructType\SearchColumnSelectField[] $externalId
     * @param \StructType\SearchColumnSelectField[] $internalId
     * @param \StructType\SearchColumnSelectField[] $item
     * @param \StructType\SearchColumnStringField[] $memo
     * @param \StructType\SearchColumnDoubleField[] $quantity
     * @param \StructType\SearchColumnSelectField[] $subscription
     * @param \StructType\SearchColumnSelectField[] $subscriptionLine
     * @param \StructType\SearchColumnSelectField[] $subscriptionPlan
     */
    public function __construct(array $customer = array(), array $date = array(), array $externalId = array(), array $internalId = array(), array $item = array(), array $memo = array(), array $quantity = array(), array $subscription = array(), array $subscriptionLine = array(), array $subscriptionPlan = array())
    {
        $this
            ->setCustomer($customer)
            ->setDate($date)
            ->setExternalId($externalId)
            ->setInternalId($internalId)
            ->setItem($item)
            ->setMemo($memo)
            ->setQuantity($quantity)
            ->setSubscription($subscription)
            ->setSubscriptionLine($subscriptionLine)
            ->setSubscriptionPlan($subscriptionPlan);
    }
    /**
     * Get customer value
     * @return \StructType\SearchColumnSelectField[]|null
     */
    public function getCustomer()
    {
        return $this->customer;
    }
    /**
     * This method is responsible for validating the values passed to the setCustomer method
     * This method is willingly generated in order to preserve the one-line inline validation within the setCustomer method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateCustomerForArrayConstraintsFromSetCustomer(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $usageSearchRowBasicCustomerItem) {
            // validation for constraint: itemType
            if (!$usageSearchRowBasicCustomerItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($usageSearchRowBasicCustomerItem) ? get_class($usageSearchRowBasicCustomerItem) : sprintf('%s(%s)', gettype($usageSearchRowBasicCustomerItem), var_export($usageSearchRowBasicCustomerItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The customer 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 customer value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField[] $customer
     * @return \StructType\UsageSearchRowBasic
     */
    public function setCustomer(array $customer = array())
    {
        // validation for constraint: array
        if ('' !== ($customerArrayErrorMessage = self::validateCustomerForArrayConstraintsFromSetCustomer($customer))) {
            throw new \InvalidArgumentException($customerArrayErrorMessage, __LINE__);
        }
        $this->customer = $customer;
        return $this;
    }
    /**
     * Add item to customer value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField $item
     * @return \StructType\UsageSearchRowBasic
     */
    public function addToCustomer(\StructType\SearchColumnSelectField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnSelectField) {
            throw new \InvalidArgumentException(sprintf('The customer 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->customer[] = $item;
        return $this;
    }
    /**
     * Get date value
     * @return \StructType\SearchColumnDateField[]|null
     */
    public function getDate()
    {
        return $this->date;
    }
    /**
     * This method is responsible for validating the values passed to the setDate method
     * This method is willingly generated in order to preserve the one-line inline validation within the setDate method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateDateForArrayConstraintsFromSetDate(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $usageSearchRowBasicDateItem) {
            // validation for constraint: itemType
            if (!$usageSearchRowBasicDateItem instanceof \StructType\SearchColumnDateField) {
                $invalidValues[] = is_object($usageSearchRowBasicDateItem) ? get_class($usageSearchRowBasicDateItem) : sprintf('%s(%s)', gettype($usageSearchRowBasicDateItem), var_export($usageSearchRowBasicDateItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The date property can only contain items of type \StructType\SearchColumnDateField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set date value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnDateField[] $date
     * @return \StructType\UsageSearchRowBasic
     */
    public function setDate(array $date = array())
    {
        // validation for constraint: array
        if ('' !== ($dateArrayErrorMessage = self::validateDateForArrayConstraintsFromSetDate($date))) {
            throw new \InvalidArgumentException($dateArrayErrorMessage, __LINE__);
        }
        $this->date = $date;
        return $this;
    }
    /**
     * Add item to date value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnDateField $item
     * @return \StructType\UsageSearchRowBasic
     */
    public function addToDate(\StructType\SearchColumnDateField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnDateField) {
            throw new \InvalidArgumentException(sprintf('The date property can only contain items of type \StructType\SearchColumnDateField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->date[] = $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 $usageSearchRowBasicExternalIdItem) {
            // validation for constraint: itemType
            if (!$usageSearchRowBasicExternalIdItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($usageSearchRowBasicExternalIdItem) ? get_class($usageSearchRowBasicExternalIdItem) : sprintf('%s(%s)', gettype($usageSearchRowBasicExternalIdItem), var_export($usageSearchRowBasicExternalIdItem, 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\UsageSearchRowBasic
     */
    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\UsageSearchRowBasic
     */
    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 $usageSearchRowBasicInternalIdItem) {
            // validation for constraint: itemType
            if (!$usageSearchRowBasicInternalIdItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($usageSearchRowBasicInternalIdItem) ? get_class($usageSearchRowBasicInternalIdItem) : sprintf('%s(%s)', gettype($usageSearchRowBasicInternalIdItem), var_export($usageSearchRowBasicInternalIdItem, 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\UsageSearchRowBasic
     */
    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\UsageSearchRowBasic
     */
    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 item value
     * @return \StructType\SearchColumnSelectField[]|null
     */
    public function getItem()
    {
        return $this->item;
    }
    /**
     * This method is responsible for validating the values passed to the setItem method
     * This method is willingly generated in order to preserve the one-line inline validation within the setItem method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateItemForArrayConstraintsFromSetItem(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $usageSearchRowBasicItemItem) {
            // validation for constraint: itemType
            if (!$usageSearchRowBasicItemItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($usageSearchRowBasicItemItem) ? get_class($usageSearchRowBasicItemItem) : sprintf('%s(%s)', gettype($usageSearchRowBasicItemItem), var_export($usageSearchRowBasicItemItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The item 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 item value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField[] $item
     * @return \StructType\UsageSearchRowBasic
     */
    public function setItem(array $item = array())
    {
        // validation for constraint: array
        if ('' !== ($itemArrayErrorMessage = self::validateItemForArrayConstraintsFromSetItem($item))) {
            throw new \InvalidArgumentException($itemArrayErrorMessage, __LINE__);
        }
        $this->item = $item;
        return $this;
    }
    /**
     * Add item to item value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField $item
     * @return \StructType\UsageSearchRowBasic
     */
    public function addToItem(\StructType\SearchColumnSelectField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnSelectField) {
            throw new \InvalidArgumentException(sprintf('The item 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->item[] = $item;
        return $this;
    }
    /**
     * Get memo value
     * @return \StructType\SearchColumnStringField[]|null
     */
    public function getMemo()
    {
        return $this->memo;
    }
    /**
     * This method is responsible for validating the values passed to the setMemo method
     * This method is willingly generated in order to preserve the one-line inline validation within the setMemo method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateMemoForArrayConstraintsFromSetMemo(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $usageSearchRowBasicMemoItem) {
            // validation for constraint: itemType
            if (!$usageSearchRowBasicMemoItem instanceof \StructType\SearchColumnStringField) {
                $invalidValues[] = is_object($usageSearchRowBasicMemoItem) ? get_class($usageSearchRowBasicMemoItem) : sprintf('%s(%s)', gettype($usageSearchRowBasicMemoItem), var_export($usageSearchRowBasicMemoItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The memo 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 memo value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField[] $memo
     * @return \StructType\UsageSearchRowBasic
     */
    public function setMemo(array $memo = array())
    {
        // validation for constraint: array
        if ('' !== ($memoArrayErrorMessage = self::validateMemoForArrayConstraintsFromSetMemo($memo))) {
            throw new \InvalidArgumentException($memoArrayErrorMessage, __LINE__);
        }
        $this->memo = $memo;
        return $this;
    }
    /**
     * Add item to memo value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField $item
     * @return \StructType\UsageSearchRowBasic
     */
    public function addToMemo(\StructType\SearchColumnStringField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnStringField) {
            throw new \InvalidArgumentException(sprintf('The memo 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->memo[] = $item;
        return $this;
    }
    /**
     * Get quantity value
     * @return \StructType\SearchColumnDoubleField[]|null
     */
    public function getQuantity()
    {
        return $this->quantity;
    }
    /**
     * This method is responsible for validating the values passed to the setQuantity method
     * This method is willingly generated in order to preserve the one-line inline validation within the setQuantity method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateQuantityForArrayConstraintsFromSetQuantity(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $usageSearchRowBasicQuantityItem) {
            // validation for constraint: itemType
            if (!$usageSearchRowBasicQuantityItem instanceof \StructType\SearchColumnDoubleField) {
                $invalidValues[] = is_object($usageSearchRowBasicQuantityItem) ? get_class($usageSearchRowBasicQuantityItem) : sprintf('%s(%s)', gettype($usageSearchRowBasicQuantityItem), var_export($usageSearchRowBasicQuantityItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The quantity property can only contain items of type \StructType\SearchColumnDoubleField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set quantity value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnDoubleField[] $quantity
     * @return \StructType\UsageSearchRowBasic
     */
    public function setQuantity(array $quantity = array())
    {
        // validation for constraint: array
        if ('' !== ($quantityArrayErrorMessage = self::validateQuantityForArrayConstraintsFromSetQuantity($quantity))) {
            throw new \InvalidArgumentException($quantityArrayErrorMessage, __LINE__);
        }
        $this->quantity = $quantity;
        return $this;
    }
    /**
     * Add item to quantity value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnDoubleField $item
     * @return \StructType\UsageSearchRowBasic
     */
    public function addToQuantity(\StructType\SearchColumnDoubleField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnDoubleField) {
            throw new \InvalidArgumentException(sprintf('The quantity property can only contain items of type \StructType\SearchColumnDoubleField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->quantity[] = $item;
        return $this;
    }
    /**
     * Get subscription value
     * @return \StructType\SearchColumnSelectField[]|null
     */
    public function getSubscription()
    {
        return $this->subscription;
    }
    /**
     * This method is responsible for validating the values passed to the setSubscription method
     * This method is willingly generated in order to preserve the one-line inline validation within the setSubscription method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateSubscriptionForArrayConstraintsFromSetSubscription(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $usageSearchRowBasicSubscriptionItem) {
            // validation for constraint: itemType
            if (!$usageSearchRowBasicSubscriptionItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($usageSearchRowBasicSubscriptionItem) ? get_class($usageSearchRowBasicSubscriptionItem) : sprintf('%s(%s)', gettype($usageSearchRowBasicSubscriptionItem), var_export($usageSearchRowBasicSubscriptionItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The subscription 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 subscription value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField[] $subscription
     * @return \StructType\UsageSearchRowBasic
     */
    public function setSubscription(array $subscription = array())
    {
        // validation for constraint: array
        if ('' !== ($subscriptionArrayErrorMessage = self::validateSubscriptionForArrayConstraintsFromSetSubscription($subscription))) {
            throw new \InvalidArgumentException($subscriptionArrayErrorMessage, __LINE__);
        }
        $this->subscription = $subscription;
        return $this;
    }
    /**
     * Add item to subscription value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField $item
     * @return \StructType\UsageSearchRowBasic
     */
    public function addToSubscription(\StructType\SearchColumnSelectField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnSelectField) {
            throw new \InvalidArgumentException(sprintf('The subscription 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->subscription[] = $item;
        return $this;
    }
    /**
     * Get subscriptionLine value
     * @return \StructType\SearchColumnSelectField[]|null
     */
    public function getSubscriptionLine()
    {
        return $this->subscriptionLine;
    }
    /**
     * This method is responsible for validating the values passed to the setSubscriptionLine method
     * This method is willingly generated in order to preserve the one-line inline validation within the setSubscriptionLine method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateSubscriptionLineForArrayConstraintsFromSetSubscriptionLine(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $usageSearchRowBasicSubscriptionLineItem) {
            // validation for constraint: itemType
            if (!$usageSearchRowBasicSubscriptionLineItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($usageSearchRowBasicSubscriptionLineItem) ? get_class($usageSearchRowBasicSubscriptionLineItem) : sprintf('%s(%s)', gettype($usageSearchRowBasicSubscriptionLineItem), var_export($usageSearchRowBasicSubscriptionLineItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The subscriptionLine 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 subscriptionLine value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField[] $subscriptionLine
     * @return \StructType\UsageSearchRowBasic
     */
    public function setSubscriptionLine(array $subscriptionLine = array())
    {
        // validation for constraint: array
        if ('' !== ($subscriptionLineArrayErrorMessage = self::validateSubscriptionLineForArrayConstraintsFromSetSubscriptionLine($subscriptionLine))) {
            throw new \InvalidArgumentException($subscriptionLineArrayErrorMessage, __LINE__);
        }
        $this->subscriptionLine = $subscriptionLine;
        return $this;
    }
    /**
     * Add item to subscriptionLine value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField $item
     * @return \StructType\UsageSearchRowBasic
     */
    public function addToSubscriptionLine(\StructType\SearchColumnSelectField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnSelectField) {
            throw new \InvalidArgumentException(sprintf('The subscriptionLine 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->subscriptionLine[] = $item;
        return $this;
    }
    /**
     * Get subscriptionPlan value
     * @return \StructType\SearchColumnSelectField[]|null
     */
    public function getSubscriptionPlan()
    {
        return $this->subscriptionPlan;
    }
    /**
     * This method is responsible for validating the values passed to the setSubscriptionPlan method
     * This method is willingly generated in order to preserve the one-line inline validation within the setSubscriptionPlan method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateSubscriptionPlanForArrayConstraintsFromSetSubscriptionPlan(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $usageSearchRowBasicSubscriptionPlanItem) {
            // validation for constraint: itemType
            if (!$usageSearchRowBasicSubscriptionPlanItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($usageSearchRowBasicSubscriptionPlanItem) ? get_class($usageSearchRowBasicSubscriptionPlanItem) : sprintf('%s(%s)', gettype($usageSearchRowBasicSubscriptionPlanItem), var_export($usageSearchRowBasicSubscriptionPlanItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The subscriptionPlan 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 subscriptionPlan value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField[] $subscriptionPlan
     * @return \StructType\UsageSearchRowBasic
     */
    public function setSubscriptionPlan(array $subscriptionPlan = array())
    {
        // validation for constraint: array
        if ('' !== ($subscriptionPlanArrayErrorMessage = self::validateSubscriptionPlanForArrayConstraintsFromSetSubscriptionPlan($subscriptionPlan))) {
            throw new \InvalidArgumentException($subscriptionPlanArrayErrorMessage, __LINE__);
        }
        $this->subscriptionPlan = $subscriptionPlan;
        return $this;
    }
    /**
     * Add item to subscriptionPlan value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField $item
     * @return \StructType\UsageSearchRowBasic
     */
    public function addToSubscriptionPlan(\StructType\SearchColumnSelectField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnSelectField) {
            throw new \InvalidArgumentException(sprintf('The subscriptionPlan 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->subscriptionPlan[] = $item;
        return $this;
    }
}
