<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for BizAction.Sales.PayingForUnpaidItems.Request StructType
 * @subpackage Structs
 */
class BizAction_Sales_PayingForUnpaidItems_Request extends AnyEntity
{
    /**
     * The EditedTotalToPay
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var \patest\StructType\Money
     */
    public $EditedTotalToPay;
    /**
     * The ItemsToPay
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var \patest\StructType\RecordSetOfSales_FinancialJournalTargetSummary
     */
    public $ItemsToPay;
    /**
     * The TotalToPay
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var \patest\StructType\Money
     */
    public $TotalToPay;
    /**
     * The TransactionPurpose
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $TransactionPurpose;
    /**
     * Constructor method for BizAction.Sales.PayingForUnpaidItems.Request
     * @uses BizAction_Sales_PayingForUnpaidItems_Request::setEditedTotalToPay()
     * @uses BizAction_Sales_PayingForUnpaidItems_Request::setItemsToPay()
     * @uses BizAction_Sales_PayingForUnpaidItems_Request::setTotalToPay()
     * @uses BizAction_Sales_PayingForUnpaidItems_Request::setTransactionPurpose()
     * @param \patest\StructType\Money $editedTotalToPay
     * @param \patest\StructType\RecordSetOfSales_FinancialJournalTargetSummary $itemsToPay
     * @param \patest\StructType\Money $totalToPay
     * @param string $transactionPurpose
     */
    public function __construct(\patest\StructType\Money $editedTotalToPay = null, \patest\StructType\RecordSetOfSales_FinancialJournalTargetSummary $itemsToPay = null, \patest\StructType\Money $totalToPay = null, $transactionPurpose = null)
    {
        $this
            ->setEditedTotalToPay($editedTotalToPay)
            ->setItemsToPay($itemsToPay)
            ->setTotalToPay($totalToPay)
            ->setTransactionPurpose($transactionPurpose);
    }
    /**
     * Get EditedTotalToPay 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\Money|null
     */
    public function getEditedTotalToPay()
    {
        return isset($this->EditedTotalToPay) ? $this->EditedTotalToPay : null;
    }
    /**
     * Set EditedTotalToPay 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\Money $editedTotalToPay
     * @return \patest\StructType\BizAction_Sales_PayingForUnpaidItems_Request
     */
    public function setEditedTotalToPay(\patest\StructType\Money $editedTotalToPay = null)
    {
        if (is_null($editedTotalToPay) || (is_array($editedTotalToPay) && empty($editedTotalToPay))) {
            unset($this->EditedTotalToPay);
        } else {
            $this->EditedTotalToPay = $editedTotalToPay;
        }
        return $this;
    }
    /**
     * Get ItemsToPay 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\RecordSetOfSales_FinancialJournalTargetSummary|null
     */
    public function getItemsToPay()
    {
        return isset($this->ItemsToPay) ? $this->ItemsToPay : null;
    }
    /**
     * Set ItemsToPay 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\RecordSetOfSales_FinancialJournalTargetSummary $itemsToPay
     * @return \patest\StructType\BizAction_Sales_PayingForUnpaidItems_Request
     */
    public function setItemsToPay(\patest\StructType\RecordSetOfSales_FinancialJournalTargetSummary $itemsToPay = null)
    {
        if (is_null($itemsToPay) || (is_array($itemsToPay) && empty($itemsToPay))) {
            unset($this->ItemsToPay);
        } else {
            $this->ItemsToPay = $itemsToPay;
        }
        return $this;
    }
    /**
     * Get TotalToPay 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\Money|null
     */
    public function getTotalToPay()
    {
        return isset($this->TotalToPay) ? $this->TotalToPay : null;
    }
    /**
     * Set TotalToPay 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\Money $totalToPay
     * @return \patest\StructType\BizAction_Sales_PayingForUnpaidItems_Request
     */
    public function setTotalToPay(\patest\StructType\Money $totalToPay = null)
    {
        if (is_null($totalToPay) || (is_array($totalToPay) && empty($totalToPay))) {
            unset($this->TotalToPay);
        } else {
            $this->TotalToPay = $totalToPay;
        }
        return $this;
    }
    /**
     * Get TransactionPurpose 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 getTransactionPurpose()
    {
        return isset($this->TransactionPurpose) ? $this->TransactionPurpose : null;
    }
    /**
     * Set TransactionPurpose 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 $transactionPurpose
     * @return \patest\StructType\BizAction_Sales_PayingForUnpaidItems_Request
     */
    public function setTransactionPurpose($transactionPurpose = null)
    {
        // validation for constraint: string
        if (!is_null($transactionPurpose) && !is_string($transactionPurpose)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($transactionPurpose, true), gettype($transactionPurpose)), __LINE__);
        }
        if (is_null($transactionPurpose) || (is_array($transactionPurpose) && empty($transactionPurpose))) {
            unset($this->TransactionPurpose);
        } else {
            $this->TransactionPurpose = $transactionPurpose;
        }
        return $this;
    }
}
