<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for RequiredAmount StructType
 * Meta information extracted from the WSDL
 * - documentation: Redemption Amount required. It could be amount in money currency, percentage or miles.
 * @subpackage Structs
 */
class RequiredAmount extends AbstractStructBase
{
    /**
     * The Unit
     * Meta information extracted from the WSDL
     * - use: required
     * @var string
     */
    public $Unit;
    /**
     * The _
     * @var int
     */
    public $_;
    /**
     * Constructor method for RequiredAmount
     * @uses RequiredAmount::setUnit()
     * @uses RequiredAmount::set_()
     * @param string $unit
     * @param int $_
     */
    public function __construct($unit = null, $_ = null)
    {
        $this
            ->setUnit($unit)
            ->set_($_);
    }
    /**
     * Get Unit value
     * @return string
     */
    public function getUnit()
    {
        return $this->Unit;
    }
    /**
     * Set Unit value
     * @param string $unit
     * @return \StructType\RequiredAmount
     */
    public function setUnit($unit = null)
    {
        // validation for constraint: string
        if (!is_null($unit) && !is_string($unit)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($unit, true), gettype($unit)), __LINE__);
        }
        $this->Unit = $unit;
        return $this;
    }
    /**
     * Get _ value
     * @return int|null
     */
    public function get_()
    {
        return $this->_;
    }
    /**
     * Set _ value
     * @param int $_
     * @return \StructType\RequiredAmount
     */
    public function set_($_ = null)
    {
        // validation for constraint: int
        if (!is_null($_) && !(is_int($_) || ctype_digit($_))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($_, true), gettype($_)), __LINE__);
        }
        $this->_ = $_;
        return $this;
    }
}
