<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for KeyValueOfintKeyValuePairOfstringstringtwCi8m_S7
 * StructType
 * @subpackage Structs
 */
class KeyValueOfintKeyValuePairOfstringstringtwCi8m_S7 extends AbstractStructBase
{
    /**
     * The Key
     * @var int
     */
    public $Key;
    /**
     * The Value
     * @var \patest\StructType\KeyValuePairOfstringstring
     */
    public $Value;
    /**
     * Constructor method for KeyValueOfintKeyValuePairOfstringstringtwCi8m_S7
     * @uses KeyValueOfintKeyValuePairOfstringstringtwCi8m_S7::setKey()
     * @uses KeyValueOfintKeyValuePairOfstringstringtwCi8m_S7::setValue()
     * @param int $key
     * @param \patest\StructType\KeyValuePairOfstringstring $value
     */
    public function __construct($key = null, \patest\StructType\KeyValuePairOfstringstring $value = null)
    {
        $this
            ->setKey($key)
            ->setValue($value);
    }
    /**
     * Get Key value
     * @return int|null
     */
    public function getKey()
    {
        return $this->Key;
    }
    /**
     * Set Key value
     * @param int $key
     * @return \patest\StructType\KeyValueOfintKeyValuePairOfstringstringtwCi8m_S7
     */
    public function setKey($key = null)
    {
        // validation for constraint: int
        if (!is_null($key) && !(is_int($key) || ctype_digit($key))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($key, true), gettype($key)), __LINE__);
        }
        $this->Key = $key;
        return $this;
    }
    /**
     * Get Value value
     * @return \patest\StructType\KeyValuePairOfstringstring|null
     */
    public function getValue()
    {
        return $this->Value;
    }
    /**
     * Set Value value
     * @param \patest\StructType\KeyValuePairOfstringstring $value
     * @return \patest\StructType\KeyValueOfintKeyValuePairOfstringstringtwCi8m_S7
     */
    public function setValue(\patest\StructType\KeyValuePairOfstringstring $value = null)
    {
        $this->Value = $value;
        return $this;
    }
}
