<?php

namespace Geniki\GenikiStruct;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for AuthenticateResult GenikiStruct
 * Meta information extracted from the WSDL
 * - nillable: true
 * - type: tns:AuthenticateResult
 * @package Geniki
 * @subpackage Structs
 */
class GenikiAuthenticateResult extends GenikiMethodResult
{
    /**
     * The Key
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var string
     */
    public $Key;
    /**
     * Constructor method for AuthenticateResult
     * @uses GenikiAuthenticateResult::setKey()
     * @param string $key
     */
    public function __construct($key = null)
    {
        $this
            ->setKey($key);
    }
    /**
     * Get Key value
     * @return string|null
     */
    public function getKey()
    {
        return $this->Key;
    }
    /**
     * Set Key value
     * @param string $key
     * @return \Geniki\GenikiStruct\GenikiAuthenticateResult
     */
    public function setKey($key = null)
    {
        // validation for constraint: string
        if (!is_null($key) && !is_string($key)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($key, true), gettype($key)), __LINE__);
        }
        $this->Key = $key;
        return $this;
    }
}
