<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Crm.DuplicationCheckLengthParameterSet StructType
 * @subpackage Structs
 */
class Crm_DuplicationCheckLengthParameterSet extends AnyEntity
{
    /**
     * The Id
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $Id;
    /**
     * The Parameters
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var \patest\StructType\RecordSetOfCrm_DuplicationCheckLengthParameter
     */
    public $Parameters;
    /**
     * Constructor method for Crm.DuplicationCheckLengthParameterSet
     * @uses Crm_DuplicationCheckLengthParameterSet::setId()
     * @uses Crm_DuplicationCheckLengthParameterSet::setParameters()
     * @param string $id
     * @param \patest\StructType\RecordSetOfCrm_DuplicationCheckLengthParameter $parameters
     */
    public function __construct($id = null, \patest\StructType\RecordSetOfCrm_DuplicationCheckLengthParameter $parameters = null)
    {
        $this
            ->setId($id)
            ->setParameters($parameters);
    }
    /**
     * Get Id 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 getId()
    {
        return isset($this->Id) ? $this->Id : null;
    }
    /**
     * Set Id 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 $id
     * @return \patest\StructType\Crm_DuplicationCheckLengthParameterSet
     */
    public function setId($id = null)
    {
        // validation for constraint: string
        if (!is_null($id) && !is_string($id)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($id, true), gettype($id)), __LINE__);
        }
        if (is_null($id) || (is_array($id) && empty($id))) {
            unset($this->Id);
        } else {
            $this->Id = $id;
        }
        return $this;
    }
    /**
     * Get Parameters 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\RecordSetOfCrm_DuplicationCheckLengthParameter|null
     */
    public function getParameters()
    {
        return isset($this->Parameters) ? $this->Parameters : null;
    }
    /**
     * Set Parameters 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\RecordSetOfCrm_DuplicationCheckLengthParameter $parameters
     * @return \patest\StructType\Crm_DuplicationCheckLengthParameterSet
     */
    public function setParameters(\patest\StructType\RecordSetOfCrm_DuplicationCheckLengthParameter $parameters = null)
    {
        if (is_null($parameters) || (is_array($parameters) && empty($parameters))) {
            unset($this->Parameters);
        } else {
            $this->Parameters = $parameters;
        }
        return $this;
    }
}
