<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: plugnmeet_common_api.proto

namespace Mynaparrot\PlugnmeetProto;

use UnexpectedValueException;

/**
 * Protobuf type <code>plugnmeet.StatusCode</code>
 */
class StatusCode
{
    /**
     * Generated from protobuf enum <code>UNKNOWN_STATUS = 0;</code>
     */
    const UNKNOWN_STATUS = 0;
    /**
     * Generated from protobuf enum <code>SUCCESS = 1;</code>
     */
    const SUCCESS = 1;
    /**
     * Generated from protobuf enum <code>PERMISSION_DENIED = 2;</code>
     */
    const PERMISSION_DENIED = 2;
    /**
     * Generated from protobuf enum <code>NOT_FOUND = 3;</code>
     */
    const NOT_FOUND = 3;
    /**
     * Generated from protobuf enum <code>CONFLICT = 4;</code>
     */
    const CONFLICT = 4;
    /**
     * Generated from protobuf enum <code>INVALID_TOKEN_OR_SIGNATURE = 5;</code>
     */
    const INVALID_TOKEN_OR_SIGNATURE = 5;
    /**
     * Generated from protobuf enum <code>INVALID_API_KEY = 6;</code>
     */
    const INVALID_API_KEY = 6;
    /**
     * Generated from protobuf enum <code>INTERNAL_SERVER_ERROR = 7;</code>
     */
    const INTERNAL_SERVER_ERROR = 7;
    /**
     * Generated from protobuf enum <code>INVALID_PARAMETERS = 8;</code>
     */
    const INVALID_PARAMETERS = 8;
    /**
     * Generated from protobuf enum <code>MISSING_REQUIRED_PARAMETER = 9;</code>
     */
    const MISSING_REQUIRED_PARAMETER = 9;
    /**
     * Generated from protobuf enum <code>ROOM_NOT_FOUND = 10;</code>
     */
    const ROOM_NOT_FOUND = 10;
    /**
     * Generated from protobuf enum <code>USER_NOT_FOUND = 11;</code>
     */
    const USER_NOT_FOUND = 11;
    /**
     * Generated from protobuf enum <code>USER_BLOCKED = 12;</code>
     */
    const USER_BLOCKED = 12;
    /**
     * Generated from protobuf enum <code>USER_NOT_ACTIVE = 13;</code>
     */
    const USER_NOT_ACTIVE = 13;

    private static $valueToName = [
        self::UNKNOWN_STATUS => 'UNKNOWN_STATUS',
        self::SUCCESS => 'SUCCESS',
        self::PERMISSION_DENIED => 'PERMISSION_DENIED',
        self::NOT_FOUND => 'NOT_FOUND',
        self::CONFLICT => 'CONFLICT',
        self::INVALID_TOKEN_OR_SIGNATURE => 'INVALID_TOKEN_OR_SIGNATURE',
        self::INVALID_API_KEY => 'INVALID_API_KEY',
        self::INTERNAL_SERVER_ERROR => 'INTERNAL_SERVER_ERROR',
        self::INVALID_PARAMETERS => 'INVALID_PARAMETERS',
        self::MISSING_REQUIRED_PARAMETER => 'MISSING_REQUIRED_PARAMETER',
        self::ROOM_NOT_FOUND => 'ROOM_NOT_FOUND',
        self::USER_NOT_FOUND => 'USER_NOT_FOUND',
        self::USER_BLOCKED => 'USER_BLOCKED',
        self::USER_NOT_ACTIVE => 'USER_NOT_ACTIVE',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }


    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}

