<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for PaymentOptionSearchRowBasic StructType
 * @subpackage Structs
 */
class PaymentOptionSearchRowBasic extends SearchRowBasic
{
    /**
     * The internalId
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnSelectField[]
     */
    public $internalId;
    /**
     * The mask
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnStringField[]
     */
    public $mask;
    /**
     * The paymentInstrumentType
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnEnumSelectField[]
     */
    public $paymentInstrumentType;
    /**
     * The paymentMethod
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnSelectField[]
     */
    public $paymentMethod;
    /**
     * The preserveOnFile
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnStringField[]
     */
    public $preserveOnFile;
    /**
     * Constructor method for PaymentOptionSearchRowBasic
     * @uses PaymentOptionSearchRowBasic::setInternalId()
     * @uses PaymentOptionSearchRowBasic::setMask()
     * @uses PaymentOptionSearchRowBasic::setPaymentInstrumentType()
     * @uses PaymentOptionSearchRowBasic::setPaymentMethod()
     * @uses PaymentOptionSearchRowBasic::setPreserveOnFile()
     * @param \StructType\SearchColumnSelectField[] $internalId
     * @param \StructType\SearchColumnStringField[] $mask
     * @param \StructType\SearchColumnEnumSelectField[] $paymentInstrumentType
     * @param \StructType\SearchColumnSelectField[] $paymentMethod
     * @param \StructType\SearchColumnStringField[] $preserveOnFile
     */
    public function __construct(array $internalId = array(), array $mask = array(), array $paymentInstrumentType = array(), array $paymentMethod = array(), array $preserveOnFile = array())
    {
        $this
            ->setInternalId($internalId)
            ->setMask($mask)
            ->setPaymentInstrumentType($paymentInstrumentType)
            ->setPaymentMethod($paymentMethod)
            ->setPreserveOnFile($preserveOnFile);
    }
    /**
     * 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 $paymentOptionSearchRowBasicInternalIdItem) {
            // validation for constraint: itemType
            if (!$paymentOptionSearchRowBasicInternalIdItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($paymentOptionSearchRowBasicInternalIdItem) ? get_class($paymentOptionSearchRowBasicInternalIdItem) : sprintf('%s(%s)', gettype($paymentOptionSearchRowBasicInternalIdItem), var_export($paymentOptionSearchRowBasicInternalIdItem, 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\PaymentOptionSearchRowBasic
     */
    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\PaymentOptionSearchRowBasic
     */
    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 mask value
     * @return \StructType\SearchColumnStringField[]|null
     */
    public function getMask()
    {
        return $this->mask;
    }
    /**
     * This method is responsible for validating the values passed to the setMask method
     * This method is willingly generated in order to preserve the one-line inline validation within the setMask method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateMaskForArrayConstraintsFromSetMask(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $paymentOptionSearchRowBasicMaskItem) {
            // validation for constraint: itemType
            if (!$paymentOptionSearchRowBasicMaskItem instanceof \StructType\SearchColumnStringField) {
                $invalidValues[] = is_object($paymentOptionSearchRowBasicMaskItem) ? get_class($paymentOptionSearchRowBasicMaskItem) : sprintf('%s(%s)', gettype($paymentOptionSearchRowBasicMaskItem), var_export($paymentOptionSearchRowBasicMaskItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The mask 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 mask value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField[] $mask
     * @return \StructType\PaymentOptionSearchRowBasic
     */
    public function setMask(array $mask = array())
    {
        // validation for constraint: array
        if ('' !== ($maskArrayErrorMessage = self::validateMaskForArrayConstraintsFromSetMask($mask))) {
            throw new \InvalidArgumentException($maskArrayErrorMessage, __LINE__);
        }
        $this->mask = $mask;
        return $this;
    }
    /**
     * Add item to mask value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField $item
     * @return \StructType\PaymentOptionSearchRowBasic
     */
    public function addToMask(\StructType\SearchColumnStringField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnStringField) {
            throw new \InvalidArgumentException(sprintf('The mask 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->mask[] = $item;
        return $this;
    }
    /**
     * Get paymentInstrumentType value
     * @return \StructType\SearchColumnEnumSelectField[]|null
     */
    public function getPaymentInstrumentType()
    {
        return $this->paymentInstrumentType;
    }
    /**
     * This method is responsible for validating the values passed to the setPaymentInstrumentType method
     * This method is willingly generated in order to preserve the one-line inline validation within the setPaymentInstrumentType method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validatePaymentInstrumentTypeForArrayConstraintsFromSetPaymentInstrumentType(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $paymentOptionSearchRowBasicPaymentInstrumentTypeItem) {
            // validation for constraint: itemType
            if (!$paymentOptionSearchRowBasicPaymentInstrumentTypeItem instanceof \StructType\SearchColumnEnumSelectField) {
                $invalidValues[] = is_object($paymentOptionSearchRowBasicPaymentInstrumentTypeItem) ? get_class($paymentOptionSearchRowBasicPaymentInstrumentTypeItem) : sprintf('%s(%s)', gettype($paymentOptionSearchRowBasicPaymentInstrumentTypeItem), var_export($paymentOptionSearchRowBasicPaymentInstrumentTypeItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The paymentInstrumentType 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 paymentInstrumentType value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnEnumSelectField[] $paymentInstrumentType
     * @return \StructType\PaymentOptionSearchRowBasic
     */
    public function setPaymentInstrumentType(array $paymentInstrumentType = array())
    {
        // validation for constraint: array
        if ('' !== ($paymentInstrumentTypeArrayErrorMessage = self::validatePaymentInstrumentTypeForArrayConstraintsFromSetPaymentInstrumentType($paymentInstrumentType))) {
            throw new \InvalidArgumentException($paymentInstrumentTypeArrayErrorMessage, __LINE__);
        }
        $this->paymentInstrumentType = $paymentInstrumentType;
        return $this;
    }
    /**
     * Add item to paymentInstrumentType value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnEnumSelectField $item
     * @return \StructType\PaymentOptionSearchRowBasic
     */
    public function addToPaymentInstrumentType(\StructType\SearchColumnEnumSelectField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnEnumSelectField) {
            throw new \InvalidArgumentException(sprintf('The paymentInstrumentType 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->paymentInstrumentType[] = $item;
        return $this;
    }
    /**
     * Get paymentMethod value
     * @return \StructType\SearchColumnSelectField[]|null
     */
    public function getPaymentMethod()
    {
        return $this->paymentMethod;
    }
    /**
     * This method is responsible for validating the values passed to the setPaymentMethod method
     * This method is willingly generated in order to preserve the one-line inline validation within the setPaymentMethod method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validatePaymentMethodForArrayConstraintsFromSetPaymentMethod(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $paymentOptionSearchRowBasicPaymentMethodItem) {
            // validation for constraint: itemType
            if (!$paymentOptionSearchRowBasicPaymentMethodItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($paymentOptionSearchRowBasicPaymentMethodItem) ? get_class($paymentOptionSearchRowBasicPaymentMethodItem) : sprintf('%s(%s)', gettype($paymentOptionSearchRowBasicPaymentMethodItem), var_export($paymentOptionSearchRowBasicPaymentMethodItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The paymentMethod 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 paymentMethod value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField[] $paymentMethod
     * @return \StructType\PaymentOptionSearchRowBasic
     */
    public function setPaymentMethod(array $paymentMethod = array())
    {
        // validation for constraint: array
        if ('' !== ($paymentMethodArrayErrorMessage = self::validatePaymentMethodForArrayConstraintsFromSetPaymentMethod($paymentMethod))) {
            throw new \InvalidArgumentException($paymentMethodArrayErrorMessage, __LINE__);
        }
        $this->paymentMethod = $paymentMethod;
        return $this;
    }
    /**
     * Add item to paymentMethod value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField $item
     * @return \StructType\PaymentOptionSearchRowBasic
     */
    public function addToPaymentMethod(\StructType\SearchColumnSelectField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnSelectField) {
            throw new \InvalidArgumentException(sprintf('The paymentMethod 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->paymentMethod[] = $item;
        return $this;
    }
    /**
     * Get preserveOnFile value
     * @return \StructType\SearchColumnStringField[]|null
     */
    public function getPreserveOnFile()
    {
        return $this->preserveOnFile;
    }
    /**
     * This method is responsible for validating the values passed to the setPreserveOnFile method
     * This method is willingly generated in order to preserve the one-line inline validation within the setPreserveOnFile method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validatePreserveOnFileForArrayConstraintsFromSetPreserveOnFile(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $paymentOptionSearchRowBasicPreserveOnFileItem) {
            // validation for constraint: itemType
            if (!$paymentOptionSearchRowBasicPreserveOnFileItem instanceof \StructType\SearchColumnStringField) {
                $invalidValues[] = is_object($paymentOptionSearchRowBasicPreserveOnFileItem) ? get_class($paymentOptionSearchRowBasicPreserveOnFileItem) : sprintf('%s(%s)', gettype($paymentOptionSearchRowBasicPreserveOnFileItem), var_export($paymentOptionSearchRowBasicPreserveOnFileItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The preserveOnFile 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 preserveOnFile value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField[] $preserveOnFile
     * @return \StructType\PaymentOptionSearchRowBasic
     */
    public function setPreserveOnFile(array $preserveOnFile = array())
    {
        // validation for constraint: array
        if ('' !== ($preserveOnFileArrayErrorMessage = self::validatePreserveOnFileForArrayConstraintsFromSetPreserveOnFile($preserveOnFile))) {
            throw new \InvalidArgumentException($preserveOnFileArrayErrorMessage, __LINE__);
        }
        $this->preserveOnFile = $preserveOnFile;
        return $this;
    }
    /**
     * Add item to preserveOnFile value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField $item
     * @return \StructType\PaymentOptionSearchRowBasic
     */
    public function addToPreserveOnFile(\StructType\SearchColumnStringField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnStringField) {
            throw new \InvalidArgumentException(sprintf('The preserveOnFile 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->preserveOnFile[] = $item;
        return $this;
    }
}
