<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for CustomerSubsidiaryRelationship StructType
 * @subpackage Structs
 */
class CustomerSubsidiaryRelationship extends Record
{
    /**
     * The entity
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\RecordRef
     */
    public $entity;
    /**
     * The subsidiary
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\RecordRef
     */
    public $subsidiary;
    /**
     * The isPrimarySub
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var bool
     */
    public $isPrimarySub;
    /**
     * The primaryCurrency
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\RecordRef
     */
    public $primaryCurrency;
    /**
     * The customFieldList
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\CustomFieldList
     */
    public $customFieldList;
    /**
     * The internalId
     * @var string
     */
    public $internalId;
    /**
     * The externalId
     * @var string
     */
    public $externalId;
    /**
     * Constructor method for CustomerSubsidiaryRelationship
     * @uses CustomerSubsidiaryRelationship::setEntity()
     * @uses CustomerSubsidiaryRelationship::setSubsidiary()
     * @uses CustomerSubsidiaryRelationship::setIsPrimarySub()
     * @uses CustomerSubsidiaryRelationship::setPrimaryCurrency()
     * @uses CustomerSubsidiaryRelationship::setCustomFieldList()
     * @uses CustomerSubsidiaryRelationship::setInternalId()
     * @uses CustomerSubsidiaryRelationship::setExternalId()
     * @param \StructType\RecordRef $entity
     * @param \StructType\RecordRef $subsidiary
     * @param bool $isPrimarySub
     * @param \StructType\RecordRef $primaryCurrency
     * @param \StructType\CustomFieldList $customFieldList
     * @param string $internalId
     * @param string $externalId
     */
    public function __construct(\StructType\RecordRef $entity = null, \StructType\RecordRef $subsidiary = null, $isPrimarySub = null, \StructType\RecordRef $primaryCurrency = null, \StructType\CustomFieldList $customFieldList = null, $internalId = null, $externalId = null)
    {
        $this
            ->setEntity($entity)
            ->setSubsidiary($subsidiary)
            ->setIsPrimarySub($isPrimarySub)
            ->setPrimaryCurrency($primaryCurrency)
            ->setCustomFieldList($customFieldList)
            ->setInternalId($internalId)
            ->setExternalId($externalId);
    }
    /**
     * Get entity value
     * @return \StructType\RecordRef|null
     */
    public function getEntity()
    {
        return $this->entity;
    }
    /**
     * Set entity value
     * @param \StructType\RecordRef $entity
     * @return \StructType\CustomerSubsidiaryRelationship
     */
    public function setEntity(\StructType\RecordRef $entity = null)
    {
        $this->entity = $entity;
        return $this;
    }
    /**
     * Get subsidiary value
     * @return \StructType\RecordRef|null
     */
    public function getSubsidiary()
    {
        return $this->subsidiary;
    }
    /**
     * Set subsidiary value
     * @param \StructType\RecordRef $subsidiary
     * @return \StructType\CustomerSubsidiaryRelationship
     */
    public function setSubsidiary(\StructType\RecordRef $subsidiary = null)
    {
        $this->subsidiary = $subsidiary;
        return $this;
    }
    /**
     * Get isPrimarySub value
     * @return bool|null
     */
    public function getIsPrimarySub()
    {
        return $this->isPrimarySub;
    }
    /**
     * Set isPrimarySub value
     * @param bool $isPrimarySub
     * @return \StructType\CustomerSubsidiaryRelationship
     */
    public function setIsPrimarySub($isPrimarySub = null)
    {
        // validation for constraint: boolean
        if (!is_null($isPrimarySub) && !is_bool($isPrimarySub)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($isPrimarySub, true), gettype($isPrimarySub)), __LINE__);
        }
        $this->isPrimarySub = $isPrimarySub;
        return $this;
    }
    /**
     * Get primaryCurrency value
     * @return \StructType\RecordRef|null
     */
    public function getPrimaryCurrency()
    {
        return $this->primaryCurrency;
    }
    /**
     * Set primaryCurrency value
     * @param \StructType\RecordRef $primaryCurrency
     * @return \StructType\CustomerSubsidiaryRelationship
     */
    public function setPrimaryCurrency(\StructType\RecordRef $primaryCurrency = null)
    {
        $this->primaryCurrency = $primaryCurrency;
        return $this;
    }
    /**
     * Get customFieldList value
     * @return \StructType\CustomFieldList|null
     */
    public function getCustomFieldList()
    {
        return $this->customFieldList;
    }
    /**
     * Set customFieldList value
     * @param \StructType\CustomFieldList $customFieldList
     * @return \StructType\CustomerSubsidiaryRelationship
     */
    public function setCustomFieldList(\StructType\CustomFieldList $customFieldList = null)
    {
        $this->customFieldList = $customFieldList;
        return $this;
    }
    /**
     * Get internalId value
     * @return string|null
     */
    public function getInternalId()
    {
        return $this->internalId;
    }
    /**
     * Set internalId value
     * @param string $internalId
     * @return \StructType\CustomerSubsidiaryRelationship
     */
    public function setInternalId($internalId = null)
    {
        // validation for constraint: string
        if (!is_null($internalId) && !is_string($internalId)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($internalId, true), gettype($internalId)), __LINE__);
        }
        $this->internalId = $internalId;
        return $this;
    }
    /**
     * Get externalId value
     * @return string|null
     */
    public function getExternalId()
    {
        return $this->externalId;
    }
    /**
     * Set externalId value
     * @param string $externalId
     * @return \StructType\CustomerSubsidiaryRelationship
     */
    public function setExternalId($externalId = null)
    {
        // validation for constraint: string
        if (!is_null($externalId) && !is_string($externalId)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($externalId, true), gettype($externalId)), __LINE__);
        }
        $this->externalId = $externalId;
        return $this;
    }
}
