<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for GiftVoucher.CouponFilter StructType
 * @subpackage Structs
 */
class GiftVoucher_CouponFilter extends FilterEntity
{
    /**
     * The FullyRedeemed
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var bool
     */
    public $FullyRedeemed;
    /**
     * The Number
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $Number;
    /**
     * Constructor method for GiftVoucher.CouponFilter
     * @uses GiftVoucher_CouponFilter::setFullyRedeemed()
     * @uses GiftVoucher_CouponFilter::setNumber()
     * @param bool $fullyRedeemed
     * @param string $number
     */
    public function __construct($fullyRedeemed = null, $number = null)
    {
        $this
            ->setFullyRedeemed($fullyRedeemed)
            ->setNumber($number);
    }
    /**
     * Get FullyRedeemed value
     * An additional test has been added (isset) before returning the property value as
     * this property may have been unset before, due to the fact that this property is
     * removable from the request (nillable=true+minOccurs=0)
     * @return bool|null
     */
    public function getFullyRedeemed()
    {
        return isset($this->FullyRedeemed) ? $this->FullyRedeemed : null;
    }
    /**
     * Set FullyRedeemed value
     * This property is removable from request (nillable=true+minOccurs=0), therefore
     * if the value assigned to this property is null, it is removed from this object
     * @param bool $fullyRedeemed
     * @return \patest\StructType\GiftVoucher_CouponFilter
     */
    public function setFullyRedeemed($fullyRedeemed = null)
    {
        // validation for constraint: boolean
        if (!is_null($fullyRedeemed) && !is_bool($fullyRedeemed)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($fullyRedeemed, true), gettype($fullyRedeemed)), __LINE__);
        }
        if (is_null($fullyRedeemed) || (is_array($fullyRedeemed) && empty($fullyRedeemed))) {
            unset($this->FullyRedeemed);
        } else {
            $this->FullyRedeemed = $fullyRedeemed;
        }
        return $this;
    }
    /**
     * Get Number value
     * An additional test has been added (isset) before returning the property value as
     * this property may have been unset before, due to the fact that this property is
     * removable from the request (nillable=true+minOccurs=0)
     * @return string|null
     */
    public function getNumber()
    {
        return isset($this->Number) ? $this->Number : null;
    }
    /**
     * Set Number value
     * This property is removable from request (nillable=true+minOccurs=0), therefore
     * if the value assigned to this property is null, it is removed from this object
     * @param string $number
     * @return \patest\StructType\GiftVoucher_CouponFilter
     */
    public function setNumber($number = null)
    {
        // validation for constraint: string
        if (!is_null($number) && !is_string($number)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($number, true), gettype($number)), __LINE__);
        }
        if (is_null($number) || (is_array($number) && empty($number))) {
            unset($this->Number);
        } else {
            $this->Number = $number;
        }
        return $this;
    }
}
