<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: deviceapis/device/v1/deviceapis_device_video_v1.proto

namespace Deviceapis\Device\V1\VideoChannel;

use UnexpectedValueException;

/**
 * Тип разрешения видео
 *
 * Protobuf type <code>deviceapis.device.v1.VideoChannel.ResolutionType</code>
 */
class ResolutionType
{
    /**
     * Значение не указано
     *
     * Generated from protobuf enum <code>RESOLUTION_TYPE_UNKNOWN = 0;</code>
     */
    const RESOLUTION_TYPE_UNKNOWN = 0;
    /**
     * Тип разрешения 2K 2560*1440
     *
     * Generated from protobuf enum <code>R2K = 1;</code>
     */
    const R2K = 1;
    /**
     * Тип разрешения FULLHD 1920*1080
     *
     * Generated from protobuf enum <code>FULLHD = 2;</code>
     */
    const FULLHD = 2;
    /**
     * Тип разрешения HD 1280*720
     *
     * Generated from protobuf enum <code>HD = 3;</code>
     */
    const HD = 3;
    /**
     * Тип разрешения SD 720*576
     *
     * Generated from protobuf enum <code>SD = 4;</code>
     */
    const SD = 4;
    /**
     * Тип разрешения 4CIF 704*576
     *
     * Generated from protobuf enum <code>R4CIF = 5;</code>
     */
    const R4CIF = 5;
    /**
     * Тип разрешения VGA 640*480
     *
     * Generated from protobuf enum <code>VGA = 6;</code>
     */
    const VGA = 6;

    private static $valueToName = [
        self::RESOLUTION_TYPE_UNKNOWN => 'RESOLUTION_TYPE_UNKNOWN',
        self::R2K => 'R2K',
        self::FULLHD => 'FULLHD',
        self::HD => 'HD',
        self::SD => 'SD',
        self::R4CIF => 'R4CIF',
        self::VGA => 'VGA',
    ];

    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);
    }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ResolutionType::class, \Deviceapis\Device\V1\VideoChannel_ResolutionType::class);

