<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for ResolveCouponByNumber-Response StructType
 * Meta information extracted from the WSDL
 * - nillable: true
 * - type: tns:ResolveCouponByNumber-Response
 * @subpackage Structs
 */
class ResolveCouponByNumber_Response extends ExtensibleDataContract
{
    /**
     * The CouponIdentity
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var \patest\StructType\CouponIdentity
     */
    public $CouponIdentity;
    /**
     * The Description
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var \patest\StructType\CouponDescription
     */
    public $Description;
    /**
     * The ProductsHaveSpecialPricing
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var bool
     */
    public $ProductsHaveSpecialPricing;
    /**
     * Constructor method for ResolveCouponByNumber-Response
     * @uses ResolveCouponByNumber_Response::setCouponIdentity()
     * @uses ResolveCouponByNumber_Response::setDescription()
     * @uses ResolveCouponByNumber_Response::setProductsHaveSpecialPricing()
     * @param \patest\StructType\CouponIdentity $couponIdentity
     * @param \patest\StructType\CouponDescription $description
     * @param bool $productsHaveSpecialPricing
     */
    public function __construct(\patest\StructType\CouponIdentity $couponIdentity = null, \patest\StructType\CouponDescription $description = null, $productsHaveSpecialPricing = null)
    {
        $this
            ->setCouponIdentity($couponIdentity)
            ->setDescription($description)
            ->setProductsHaveSpecialPricing($productsHaveSpecialPricing);
    }
    /**
     * Get CouponIdentity 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 \patest\StructType\CouponIdentity|null
     */
    public function getCouponIdentity()
    {
        return isset($this->CouponIdentity) ? $this->CouponIdentity : null;
    }
    /**
     * Set CouponIdentity 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 \patest\StructType\CouponIdentity $couponIdentity
     * @return \patest\StructType\ResolveCouponByNumber_Response
     */
    public function setCouponIdentity(\patest\StructType\CouponIdentity $couponIdentity = null)
    {
        if (is_null($couponIdentity) || (is_array($couponIdentity) && empty($couponIdentity))) {
            unset($this->CouponIdentity);
        } else {
            $this->CouponIdentity = $couponIdentity;
        }
        return $this;
    }
    /**
     * Get Description 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 \patest\StructType\CouponDescription|null
     */
    public function getDescription()
    {
        return isset($this->Description) ? $this->Description : null;
    }
    /**
     * Set Description 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 \patest\StructType\CouponDescription $description
     * @return \patest\StructType\ResolveCouponByNumber_Response
     */
    public function setDescription(\patest\StructType\CouponDescription $description = null)
    {
        if (is_null($description) || (is_array($description) && empty($description))) {
            unset($this->Description);
        } else {
            $this->Description = $description;
        }
        return $this;
    }
    /**
     * Get ProductsHaveSpecialPricing value
     * @return bool|null
     */
    public function getProductsHaveSpecialPricing()
    {
        return $this->ProductsHaveSpecialPricing;
    }
    /**
     * Set ProductsHaveSpecialPricing value
     * @param bool $productsHaveSpecialPricing
     * @return \patest\StructType\ResolveCouponByNumber_Response
     */
    public function setProductsHaveSpecialPricing($productsHaveSpecialPricing = null)
    {
        // validation for constraint: boolean
        if (!is_null($productsHaveSpecialPricing) && !is_bool($productsHaveSpecialPricing)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($productsHaveSpecialPricing, true), gettype($productsHaveSpecialPricing)), __LINE__);
        }
        $this->ProductsHaveSpecialPricing = $productsHaveSpecialPricing;
        return $this;
    }
}
