<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Crm.CustomerExternalManipulations.ColumnMapping StructType
 * @subpackage Structs
 */
class Crm_CustomerExternalManipulations_ColumnMapping extends AnyEntity
{
    /**
     * The Index
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var int
     */
    public $Index;
    /**
     * The OriginalColumnName
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $OriginalColumnName;
    /**
     * The TargetPropertyName
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $TargetPropertyName;
    /**
     * Constructor method for Crm.CustomerExternalManipulations.ColumnMapping
     * @uses Crm_CustomerExternalManipulations_ColumnMapping::setIndex()
     * @uses Crm_CustomerExternalManipulations_ColumnMapping::setOriginalColumnName()
     * @uses Crm_CustomerExternalManipulations_ColumnMapping::setTargetPropertyName()
     * @param int $index
     * @param string $originalColumnName
     * @param string $targetPropertyName
     */
    public function __construct($index = null, $originalColumnName = null, $targetPropertyName = null)
    {
        $this
            ->setIndex($index)
            ->setOriginalColumnName($originalColumnName)
            ->setTargetPropertyName($targetPropertyName);
    }
    /**
     * Get Index 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 int|null
     */
    public function getIndex()
    {
        return isset($this->Index) ? $this->Index : null;
    }
    /**
     * Set Index 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 int $index
     * @return \patest\StructType\Crm_CustomerExternalManipulations_ColumnMapping
     */
    public function setIndex($index = null)
    {
        // validation for constraint: int
        if (!is_null($index) && !(is_int($index) || ctype_digit($index))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($index, true), gettype($index)), __LINE__);
        }
        if (is_null($index) || (is_array($index) && empty($index))) {
            unset($this->Index);
        } else {
            $this->Index = $index;
        }
        return $this;
    }
    /**
     * Get OriginalColumnName 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 getOriginalColumnName()
    {
        return isset($this->OriginalColumnName) ? $this->OriginalColumnName : null;
    }
    /**
     * Set OriginalColumnName 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 $originalColumnName
     * @return \patest\StructType\Crm_CustomerExternalManipulations_ColumnMapping
     */
    public function setOriginalColumnName($originalColumnName = null)
    {
        // validation for constraint: string
        if (!is_null($originalColumnName) && !is_string($originalColumnName)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($originalColumnName, true), gettype($originalColumnName)), __LINE__);
        }
        if (is_null($originalColumnName) || (is_array($originalColumnName) && empty($originalColumnName))) {
            unset($this->OriginalColumnName);
        } else {
            $this->OriginalColumnName = $originalColumnName;
        }
        return $this;
    }
    /**
     * Get TargetPropertyName 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 getTargetPropertyName()
    {
        return isset($this->TargetPropertyName) ? $this->TargetPropertyName : null;
    }
    /**
     * Set TargetPropertyName 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 $targetPropertyName
     * @return \patest\StructType\Crm_CustomerExternalManipulations_ColumnMapping
     */
    public function setTargetPropertyName($targetPropertyName = null)
    {
        // validation for constraint: string
        if (!is_null($targetPropertyName) && !is_string($targetPropertyName)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($targetPropertyName, true), gettype($targetPropertyName)), __LINE__);
        }
        if (is_null($targetPropertyName) || (is_array($targetPropertyName) && empty($targetPropertyName))) {
            unset($this->TargetPropertyName);
        } else {
            $this->TargetPropertyName = $targetPropertyName;
        }
        return $this;
    }
}
