<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for SettlementPaymentItem StructType
 * Meta information extracted from the WSDL
 * - nillable: true
 * - type: tns:SettlementPaymentItem
 * @subpackage Structs
 */
class SettlementPaymentItem extends AbstractPaymentItem
{
    /**
     * The Usage
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var string
     */
    public $Usage;
    /**
     * Constructor method for SettlementPaymentItem
     * @uses SettlementPaymentItem::setUsage()
     * @param string $usage
     */
    public function __construct($usage = null)
    {
        $this
            ->setUsage($usage);
    }
    /**
     * Get Usage value
     * @return string|null
     */
    public function getUsage()
    {
        return $this->Usage;
    }
    /**
     * Set Usage value
     * @uses \patest\EnumType\SettlementUsage::valueIsValid()
     * @uses \patest\EnumType\SettlementUsage::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $usage
     * @return \patest\StructType\SettlementPaymentItem
     */
    public function setUsage($usage = null)
    {
        // validation for constraint: enumeration
        if (!\patest\EnumType\SettlementUsage::valueIsValid($usage)) {
            throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \patest\EnumType\SettlementUsage', is_array($usage) ? implode(', ', $usage) : var_export($usage, true), implode(', ', \patest\EnumType\SettlementUsage::getValidValues())), __LINE__);
        }
        $this->Usage = $usage;
        return $this;
    }
}
