<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for IdentifierUser StructType
 * @subpackage Structs
 */
class IdentifierUser extends AbstractStructBase
{
    /**
     * The IdentifierType
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 1
     * @var string
     */
    public $IdentifierType;
    /**
     * The Id
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var string
     */
    public $Id;
    /**
     * Constructor method for IdentifierUser
     * @uses IdentifierUser::setIdentifierType()
     * @uses IdentifierUser::setId()
     * @param string $identifierType
     * @param string $id
     */
    public function __construct($identifierType = null, $id = null)
    {
        $this
            ->setIdentifierType($identifierType)
            ->setId($id);
    }
    /**
     * Get IdentifierType value
     * @return string
     */
    public function getIdentifierType()
    {
        return $this->IdentifierType;
    }
    /**
     * Set IdentifierType value
     * @uses \EnumType\EnumIdentifierUserType::valueIsValid()
     * @uses \EnumType\EnumIdentifierUserType::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $identifierType
     * @return \StructType\IdentifierUser
     */
    public function setIdentifierType($identifierType = null)
    {
        // validation for constraint: enumeration
        if (!\EnumType\EnumIdentifierUserType::valueIsValid($identifierType)) {
            throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \EnumType\EnumIdentifierUserType', is_array($identifierType) ? implode(', ', $identifierType) : var_export($identifierType, true), implode(', ', \EnumType\EnumIdentifierUserType::getValidValues())), __LINE__);
        }
        $this->IdentifierType = $identifierType;
        return $this;
    }
    /**
     * Get Id value
     * @return string|null
     */
    public function getId()
    {
        return $this->Id;
    }
    /**
     * Set Id value
     * @param string $id
     * @return \StructType\IdentifierUser
     */
    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__);
        }
        $this->Id = $id;
        return $this;
    }
}
