<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for ItemAccountingBookDetail StructType
 * @subpackage Structs
 */
class ItemAccountingBookDetail extends AbstractStructBase
{
    /**
     * The accountingBook
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\RecordRef
     */
    public $accountingBook;
    /**
     * The createRevenuePlansOn
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\RecordRef
     */
    public $createRevenuePlansOn;
    /**
     * The revenueRecognitionRule
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\RecordRef
     */
    public $revenueRecognitionRule;
    /**
     * The revRecForecastRule
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\RecordRef
     */
    public $revRecForecastRule;
    /**
     * The revRecSchedule
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\RecordRef
     */
    public $revRecSchedule;
    /**
     * The sameAsPrimaryRevRec
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var bool
     */
    public $sameAsPrimaryRevRec;
    /**
     * The amortizationTemplate
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\RecordRef
     */
    public $amortizationTemplate;
    /**
     * The sameAsPrimaryAmortization
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var bool
     */
    public $sameAsPrimaryAmortization;
    /**
     * Constructor method for ItemAccountingBookDetail
     * @uses ItemAccountingBookDetail::setAccountingBook()
     * @uses ItemAccountingBookDetail::setCreateRevenuePlansOn()
     * @uses ItemAccountingBookDetail::setRevenueRecognitionRule()
     * @uses ItemAccountingBookDetail::setRevRecForecastRule()
     * @uses ItemAccountingBookDetail::setRevRecSchedule()
     * @uses ItemAccountingBookDetail::setSameAsPrimaryRevRec()
     * @uses ItemAccountingBookDetail::setAmortizationTemplate()
     * @uses ItemAccountingBookDetail::setSameAsPrimaryAmortization()
     * @param \StructType\RecordRef $accountingBook
     * @param \StructType\RecordRef $createRevenuePlansOn
     * @param \StructType\RecordRef $revenueRecognitionRule
     * @param \StructType\RecordRef $revRecForecastRule
     * @param \StructType\RecordRef $revRecSchedule
     * @param bool $sameAsPrimaryRevRec
     * @param \StructType\RecordRef $amortizationTemplate
     * @param bool $sameAsPrimaryAmortization
     */
    public function __construct(\StructType\RecordRef $accountingBook = null, \StructType\RecordRef $createRevenuePlansOn = null, \StructType\RecordRef $revenueRecognitionRule = null, \StructType\RecordRef $revRecForecastRule = null, \StructType\RecordRef $revRecSchedule = null, $sameAsPrimaryRevRec = null, \StructType\RecordRef $amortizationTemplate = null, $sameAsPrimaryAmortization = null)
    {
        $this
            ->setAccountingBook($accountingBook)
            ->setCreateRevenuePlansOn($createRevenuePlansOn)
            ->setRevenueRecognitionRule($revenueRecognitionRule)
            ->setRevRecForecastRule($revRecForecastRule)
            ->setRevRecSchedule($revRecSchedule)
            ->setSameAsPrimaryRevRec($sameAsPrimaryRevRec)
            ->setAmortizationTemplate($amortizationTemplate)
            ->setSameAsPrimaryAmortization($sameAsPrimaryAmortization);
    }
    /**
     * Get accountingBook value
     * @return \StructType\RecordRef|null
     */
    public function getAccountingBook()
    {
        return $this->accountingBook;
    }
    /**
     * Set accountingBook value
     * @param \StructType\RecordRef $accountingBook
     * @return \StructType\ItemAccountingBookDetail
     */
    public function setAccountingBook(\StructType\RecordRef $accountingBook = null)
    {
        $this->accountingBook = $accountingBook;
        return $this;
    }
    /**
     * Get createRevenuePlansOn value
     * @return \StructType\RecordRef|null
     */
    public function getCreateRevenuePlansOn()
    {
        return $this->createRevenuePlansOn;
    }
    /**
     * Set createRevenuePlansOn value
     * @param \StructType\RecordRef $createRevenuePlansOn
     * @return \StructType\ItemAccountingBookDetail
     */
    public function setCreateRevenuePlansOn(\StructType\RecordRef $createRevenuePlansOn = null)
    {
        $this->createRevenuePlansOn = $createRevenuePlansOn;
        return $this;
    }
    /**
     * Get revenueRecognitionRule value
     * @return \StructType\RecordRef|null
     */
    public function getRevenueRecognitionRule()
    {
        return $this->revenueRecognitionRule;
    }
    /**
     * Set revenueRecognitionRule value
     * @param \StructType\RecordRef $revenueRecognitionRule
     * @return \StructType\ItemAccountingBookDetail
     */
    public function setRevenueRecognitionRule(\StructType\RecordRef $revenueRecognitionRule = null)
    {
        $this->revenueRecognitionRule = $revenueRecognitionRule;
        return $this;
    }
    /**
     * Get revRecForecastRule value
     * @return \StructType\RecordRef|null
     */
    public function getRevRecForecastRule()
    {
        return $this->revRecForecastRule;
    }
    /**
     * Set revRecForecastRule value
     * @param \StructType\RecordRef $revRecForecastRule
     * @return \StructType\ItemAccountingBookDetail
     */
    public function setRevRecForecastRule(\StructType\RecordRef $revRecForecastRule = null)
    {
        $this->revRecForecastRule = $revRecForecastRule;
        return $this;
    }
    /**
     * Get revRecSchedule value
     * @return \StructType\RecordRef|null
     */
    public function getRevRecSchedule()
    {
        return $this->revRecSchedule;
    }
    /**
     * Set revRecSchedule value
     * @param \StructType\RecordRef $revRecSchedule
     * @return \StructType\ItemAccountingBookDetail
     */
    public function setRevRecSchedule(\StructType\RecordRef $revRecSchedule = null)
    {
        $this->revRecSchedule = $revRecSchedule;
        return $this;
    }
    /**
     * Get sameAsPrimaryRevRec value
     * @return bool|null
     */
    public function getSameAsPrimaryRevRec()
    {
        return $this->sameAsPrimaryRevRec;
    }
    /**
     * Set sameAsPrimaryRevRec value
     * @param bool $sameAsPrimaryRevRec
     * @return \StructType\ItemAccountingBookDetail
     */
    public function setSameAsPrimaryRevRec($sameAsPrimaryRevRec = null)
    {
        // validation for constraint: boolean
        if (!is_null($sameAsPrimaryRevRec) && !is_bool($sameAsPrimaryRevRec)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($sameAsPrimaryRevRec, true), gettype($sameAsPrimaryRevRec)), __LINE__);
        }
        $this->sameAsPrimaryRevRec = $sameAsPrimaryRevRec;
        return $this;
    }
    /**
     * Get amortizationTemplate value
     * @return \StructType\RecordRef|null
     */
    public function getAmortizationTemplate()
    {
        return $this->amortizationTemplate;
    }
    /**
     * Set amortizationTemplate value
     * @param \StructType\RecordRef $amortizationTemplate
     * @return \StructType\ItemAccountingBookDetail
     */
    public function setAmortizationTemplate(\StructType\RecordRef $amortizationTemplate = null)
    {
        $this->amortizationTemplate = $amortizationTemplate;
        return $this;
    }
    /**
     * Get sameAsPrimaryAmortization value
     * @return bool|null
     */
    public function getSameAsPrimaryAmortization()
    {
        return $this->sameAsPrimaryAmortization;
    }
    /**
     * Set sameAsPrimaryAmortization value
     * @param bool $sameAsPrimaryAmortization
     * @return \StructType\ItemAccountingBookDetail
     */
    public function setSameAsPrimaryAmortization($sameAsPrimaryAmortization = null)
    {
        // validation for constraint: boolean
        if (!is_null($sameAsPrimaryAmortization) && !is_bool($sameAsPrimaryAmortization)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($sameAsPrimaryAmortization, true), gettype($sameAsPrimaryAmortization)), __LINE__);
        }
        $this->sameAsPrimaryAmortization = $sameAsPrimaryAmortization;
        return $this;
    }
}
