<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for UpdateExternalIdsRequest StructType
 * Meta information extracted from the WSDL
 * - nillable: true
 * - type: tns:UpdateExternalIdsRequest
 * @subpackage Structs
 */
class UpdateExternalIdsRequest extends AbstractStructBase
{
    /**
     * The SroGuidToExternalId
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var \patest\ArrayType\ArrayOfKeyValueOfguidstring
     */
    public $SroGuidToExternalId;
    /**
     * The WrapperEntityName
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $WrapperEntityName;
    /**
     * Constructor method for UpdateExternalIdsRequest
     * @uses UpdateExternalIdsRequest::setSroGuidToExternalId()
     * @uses UpdateExternalIdsRequest::setWrapperEntityName()
     * @param \patest\ArrayType\ArrayOfKeyValueOfguidstring $sroGuidToExternalId
     * @param string $wrapperEntityName
     */
    public function __construct(\patest\ArrayType\ArrayOfKeyValueOfguidstring $sroGuidToExternalId = null, $wrapperEntityName = null)
    {
        $this
            ->setSroGuidToExternalId($sroGuidToExternalId)
            ->setWrapperEntityName($wrapperEntityName);
    }
    /**
     * Get SroGuidToExternalId 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\ArrayType\ArrayOfKeyValueOfguidstring|null
     */
    public function getSroGuidToExternalId()
    {
        return isset($this->SroGuidToExternalId) ? $this->SroGuidToExternalId : null;
    }
    /**
     * Set SroGuidToExternalId 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\ArrayType\ArrayOfKeyValueOfguidstring $sroGuidToExternalId
     * @return \patest\StructType\UpdateExternalIdsRequest
     */
    public function setSroGuidToExternalId(\patest\ArrayType\ArrayOfKeyValueOfguidstring $sroGuidToExternalId = null)
    {
        if (is_null($sroGuidToExternalId) || (is_array($sroGuidToExternalId) && empty($sroGuidToExternalId))) {
            unset($this->SroGuidToExternalId);
        } else {
            $this->SroGuidToExternalId = $sroGuidToExternalId;
        }
        return $this;
    }
    /**
     * Get WrapperEntityName 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 getWrapperEntityName()
    {
        return isset($this->WrapperEntityName) ? $this->WrapperEntityName : null;
    }
    /**
     * Set WrapperEntityName 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 $wrapperEntityName
     * @return \patest\StructType\UpdateExternalIdsRequest
     */
    public function setWrapperEntityName($wrapperEntityName = null)
    {
        // validation for constraint: string
        if (!is_null($wrapperEntityName) && !is_string($wrapperEntityName)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($wrapperEntityName, true), gettype($wrapperEntityName)), __LINE__);
        }
        if (is_null($wrapperEntityName) || (is_array($wrapperEntityName) && empty($wrapperEntityName))) {
            unset($this->WrapperEntityName);
        } else {
            $this->WrapperEntityName = $wrapperEntityName;
        }
        return $this;
    }
}
