<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Printing.PrintableItem.CouponPaymentItemForInvoice
 * StructType
 * @subpackage Structs
 */
class Printing_PrintableItem_CouponPaymentItemForInvoice extends Printing_PrintableItem_AnyPaymentRecord
{
    /**
     * The CouponDefinitionName
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $CouponDefinitionName;
    /**
     * The CouponNumber
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $CouponNumber;
    /**
     * Constructor method for Printing.PrintableItem.CouponPaymentItemForInvoice
     * @uses Printing_PrintableItem_CouponPaymentItemForInvoice::setCouponDefinitionName()
     * @uses Printing_PrintableItem_CouponPaymentItemForInvoice::setCouponNumber()
     * @param string $couponDefinitionName
     * @param string $couponNumber
     */
    public function __construct($couponDefinitionName = null, $couponNumber = null)
    {
        $this
            ->setCouponDefinitionName($couponDefinitionName)
            ->setCouponNumber($couponNumber);
    }
    /**
     * Get CouponDefinitionName 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 getCouponDefinitionName()
    {
        return isset($this->CouponDefinitionName) ? $this->CouponDefinitionName : null;
    }
    /**
     * Set CouponDefinitionName 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 $couponDefinitionName
     * @return \patest\StructType\Printing_PrintableItem_CouponPaymentItemForInvoice
     */
    public function setCouponDefinitionName($couponDefinitionName = null)
    {
        // validation for constraint: string
        if (!is_null($couponDefinitionName) && !is_string($couponDefinitionName)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($couponDefinitionName, true), gettype($couponDefinitionName)), __LINE__);
        }
        if (is_null($couponDefinitionName) || (is_array($couponDefinitionName) && empty($couponDefinitionName))) {
            unset($this->CouponDefinitionName);
        } else {
            $this->CouponDefinitionName = $couponDefinitionName;
        }
        return $this;
    }
    /**
     * Get CouponNumber 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 getCouponNumber()
    {
        return isset($this->CouponNumber) ? $this->CouponNumber : null;
    }
    /**
     * Set CouponNumber 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 $couponNumber
     * @return \patest\StructType\Printing_PrintableItem_CouponPaymentItemForInvoice
     */
    public function setCouponNumber($couponNumber = null)
    {
        // validation for constraint: string
        if (!is_null($couponNumber) && !is_string($couponNumber)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($couponNumber, true), gettype($couponNumber)), __LINE__);
        }
        if (is_null($couponNumber) || (is_array($couponNumber) && empty($couponNumber))) {
            unset($this->CouponNumber);
        } else {
            $this->CouponNumber = $couponNumber;
        }
        return $this;
    }
}
