<?php

declare (strict_types=1);
namespace idoit\Module\JDisc\Graphql\Schema\Model;

use Axtiva\FlexibleGraphql\Generator\Exception\UnknownEnumValue;
use Axtiva\FlexibleGraphql\Type\EnumInterface;

/**
 * This code is @generated by axtiva/flexible-graphql-php
 * and will be regenerated. Do not edit it manually
 * PHP representation of graphql enum TcpConnectionState
 * The TCP connection state.
 */
final class TcpConnectionStateEnum implements EnumInterface
{
    public const closed = 'closed';
    public const listen = 'listen';
    public const synSent = 'synSent';
    public const synReceived = 'synReceived';
    public const established = 'established';
    public const finWait1 = 'finWait1';
    public const finWait2 = 'finWait2';
    public const closeWait = 'closeWait';
    public const lastAck = 'lastAck';
    public const closing = 'closing';
    public const timeWait = 'timeWait';
    public const deleteTCB = 'deleteTCB';
    public const bound = 'bound';
    public const idle = 'idle';
    public const deleteTcb = 'deleteTcb';
    public const unknown = 'unknown';
    public string $value;
    private static array $map = [
        self::closed => true,
        self::listen => true,
        self::synSent => true,
        self::synReceived => true,
        self::established => true,
        self::finWait1 => true,
        self::finWait2 => true,
        self::closeWait => true,
        self::lastAck => true,
        self::closing => true,
        self::timeWait => true,
        self::deleteTCB => true,
        self::bound => true,
        self::idle => true,
        self::deleteTcb => true,
        self::unknown => true,
    ];

    public function __construct($value)
    {
        if (!isset(self::$map[$value])) {
            throw new UnknownEnumValue(__CLASS__, $value);
        }
        $this->value = $value;
    }

    public function __toString(): string
    {
        return $this->value;
    }
}