<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for JP_Payment StructType
 * @subpackage Structs
 */
class JP_Payment extends AbstractStructBase
{
    /**
     * The Price
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \StructType\JP_PaymentPrice
     */
    public $Price;
    /**
     * The CreditCard
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \StructType\JP_CreditCardInfo
     */
    public $CreditCard;
    /**
     * The Installments
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var int
     */
    public $Installments;
    /**
     * The AlternateReceiptCode
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var int
     */
    public $AlternateReceiptCode;
    /**
     * The ProductSubTypeId
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var int
     */
    public $ProductSubTypeId;
    /**
     * The Action
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var string
     */
    public $Action;
    /**
     * The PaymentType
     * @var string
     */
    public $PaymentType;
    /**
     * Constructor method for JP_Payment
     * @uses JP_Payment::setPrice()
     * @uses JP_Payment::setCreditCard()
     * @uses JP_Payment::setInstallments()
     * @uses JP_Payment::setAlternateReceiptCode()
     * @uses JP_Payment::setProductSubTypeId()
     * @uses JP_Payment::setAction()
     * @uses JP_Payment::setPaymentType()
     * @param \StructType\JP_PaymentPrice $price
     * @param \StructType\JP_CreditCardInfo $creditCard
     * @param int $installments
     * @param int $alternateReceiptCode
     * @param int $productSubTypeId
     * @param string $action
     * @param string $paymentType
     */
    public function __construct(\StructType\JP_PaymentPrice $price = null, \StructType\JP_CreditCardInfo $creditCard = null, $installments = null, $alternateReceiptCode = null, $productSubTypeId = null, $action = null, $paymentType = null)
    {
        $this
            ->setPrice($price)
            ->setCreditCard($creditCard)
            ->setInstallments($installments)
            ->setAlternateReceiptCode($alternateReceiptCode)
            ->setProductSubTypeId($productSubTypeId)
            ->setAction($action)
            ->setPaymentType($paymentType);
    }
    /**
     * Get Price value
     * @return \StructType\JP_PaymentPrice|null
     */
    public function getPrice()
    {
        return $this->Price;
    }
    /**
     * Set Price value
     * @param \StructType\JP_PaymentPrice $price
     * @return \StructType\JP_Payment
     */
    public function setPrice(\StructType\JP_PaymentPrice $price = null)
    {
        $this->Price = $price;
        return $this;
    }
    /**
     * Get CreditCard value
     * @return \StructType\JP_CreditCardInfo|null
     */
    public function getCreditCard()
    {
        return $this->CreditCard;
    }
    /**
     * Set CreditCard value
     * @param \StructType\JP_CreditCardInfo $creditCard
     * @return \StructType\JP_Payment
     */
    public function setCreditCard(\StructType\JP_CreditCardInfo $creditCard = null)
    {
        $this->CreditCard = $creditCard;
        return $this;
    }
    /**
     * Get Installments value
     * @return int|null
     */
    public function getInstallments()
    {
        return $this->Installments;
    }
    /**
     * Set Installments value
     * @param int $installments
     * @return \StructType\JP_Payment
     */
    public function setInstallments($installments = null)
    {
        // validation for constraint: int
        if (!is_null($installments) && !is_numeric($installments)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($installments)), __LINE__);
        }
        $this->Installments = $installments;
        return $this;
    }
    /**
     * Get AlternateReceiptCode value
     * @return int|null
     */
    public function getAlternateReceiptCode()
    {
        return $this->AlternateReceiptCode;
    }
    /**
     * Set AlternateReceiptCode value
     * @param int $alternateReceiptCode
     * @return \StructType\JP_Payment
     */
    public function setAlternateReceiptCode($alternateReceiptCode = null)
    {
        // validation for constraint: int
        if (!is_null($alternateReceiptCode) && !is_numeric($alternateReceiptCode)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($alternateReceiptCode)), __LINE__);
        }
        $this->AlternateReceiptCode = $alternateReceiptCode;
        return $this;
    }
    /**
     * Get ProductSubTypeId value
     * @return int|null
     */
    public function getProductSubTypeId()
    {
        return $this->ProductSubTypeId;
    }
    /**
     * Set ProductSubTypeId value
     * @param int $productSubTypeId
     * @return \StructType\JP_Payment
     */
    public function setProductSubTypeId($productSubTypeId = null)
    {
        // validation for constraint: int
        if (!is_null($productSubTypeId) && !is_numeric($productSubTypeId)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($productSubTypeId)), __LINE__);
        }
        $this->ProductSubTypeId = $productSubTypeId;
        return $this;
    }
    /**
     * Get Action value
     * @return string|null
     */
    public function getAction()
    {
        return $this->Action;
    }
    /**
     * Set Action value
     * @uses \EnumType\Action::valueIsValid()
     * @uses \EnumType\Action::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $action
     * @return \StructType\JP_Payment
     */
    public function setAction($action = null)
    {
        // validation for constraint: enumeration
        if (!\EnumType\Action::valueIsValid($action)) {
            throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $action, implode(', ', \EnumType\Action::getValidValues())), __LINE__);
        }
        $this->Action = $action;
        return $this;
    }
    /**
     * Get PaymentType value
     * @return string|null
     */
    public function getPaymentType()
    {
        return $this->PaymentType;
    }
    /**
     * Set PaymentType value
     * @param string $paymentType
     * @return \StructType\JP_Payment
     */
    public function setPaymentType($paymentType = null)
    {
        // validation for constraint: string
        if (!is_null($paymentType) && !is_string($paymentType)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($paymentType)), __LINE__);
        }
        $this->PaymentType = $paymentType;
        return $this;
    }
    /**
     * Method called when an object has been exported with var_export() functions
     * It allows to return an object instantiated with the values
     * @see AbstractStructBase::__set_state()
     * @uses AbstractStructBase::__set_state()
     * @param array $array the exported values
     * @return \StructType\JP_Payment
     */
    public static function __set_state(array $array)
    {
        return parent::__set_state($array);
    }
    /**
     * Method returning the class name
     * @return string __CLASS__
     */
    public function __toString()
    {
        return __CLASS__;
    }
}
