<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for
 * KeyValueOfSeatPropertyNamesSerializedSeatsPropertyValuesn51wGZ5l StructType
 * @subpackage Structs
 */
class KeyValueOfSeatPropertyNamesSerializedSeatsPropertyValuesn51wGZ5l extends AbstractStructBase
{
    /**
     * The Key
     * @var string
     */
    public $Key;
    /**
     * The Value
     * Meta information extracted from the WSDL
     * - nillable: true
     * @var \patest\StructType\SerializedSeatsPropertyValues
     */
    public $Value;
    /**
     * Constructor method for
     * KeyValueOfSeatPropertyNamesSerializedSeatsPropertyValuesn51wGZ5l
     * @uses KeyValueOfSeatPropertyNamesSerializedSeatsPropertyValuesn51wGZ5l::setKey()
     * @uses KeyValueOfSeatPropertyNamesSerializedSeatsPropertyValuesn51wGZ5l::setValue()
     * @param string $key
     * @param \patest\StructType\SerializedSeatsPropertyValues $value
     */
    public function __construct($key = null, \patest\StructType\SerializedSeatsPropertyValues $value = null)
    {
        $this
            ->setKey($key)
            ->setValue($value);
    }
    /**
     * Get Key value
     * @return string|null
     */
    public function getKey()
    {
        return $this->Key;
    }
    /**
     * Set Key value
     * @uses \patest\EnumType\SeatPropertyNames::valueIsValid()
     * @uses \patest\EnumType\SeatPropertyNames::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $key
     * @return \patest\StructType\KeyValueOfSeatPropertyNamesSerializedSeatsPropertyValuesn51wGZ5l
     */
    public function setKey($key = null)
    {
        // validation for constraint: enumeration
        if (!\patest\EnumType\SeatPropertyNames::valueIsValid($key)) {
            throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \patest\EnumType\SeatPropertyNames', is_array($key) ? implode(', ', $key) : var_export($key, true), implode(', ', \patest\EnumType\SeatPropertyNames::getValidValues())), __LINE__);
        }
        $this->Key = $key;
        return $this;
    }
    /**
     * Get Value value
     * @return \patest\StructType\SerializedSeatsPropertyValues|null
     */
    public function getValue()
    {
        return $this->Value;
    }
    /**
     * Set Value value
     * @param \patest\StructType\SerializedSeatsPropertyValues $value
     * @return \patest\StructType\KeyValueOfSeatPropertyNamesSerializedSeatsPropertyValuesn51wGZ5l
     */
    public function setValue(\patest\StructType\SerializedSeatsPropertyValues $value = null)
    {
        $this->Value = $value;
        return $this;
    }
}
