<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: keyapis/telemetry_alerting/v1/keyapis_telemetry_alerting_trigger_v1.proto

namespace Keyapis\TelemetryAlerting\V1\TriggerPaging;

use UnexpectedValueException;

/**
 * Справочник типов значений сортировки
 *
 * Protobuf type <code>keyapis.telemetry_alerting.v1.TriggerPaging.OrderByType</code>
 */
class OrderByType
{
    /**
     * Значение не указано
     *
     * Generated from protobuf enum <code>ORDER_BY_TYPE_UNKNOWN = 0;</code>
     */
    const ORDER_BY_TYPE_UNKNOWN = 0;
    /**
     * По идентификатору
     *
     * Generated from protobuf enum <code>ID = 1;</code>
     */
    const ID = 1;
    /**
     * По заголовку
     *
     * Generated from protobuf enum <code>TITLE = 2;</code>
     */
    const TITLE = 2;
    /**
     * По флагу активности
     *
     * Generated from protobuf enum <code>DISABLED = 3;</code>
     */
    const DISABLED = 3;
    /**
     * По Severity
     *
     * Generated from protobuf enum <code>SEVERITY = 4;</code>
     */
    const SEVERITY = 4;

    private static $valueToName = [
        self::ORDER_BY_TYPE_UNKNOWN => 'ORDER_BY_TYPE_UNKNOWN',
        self::ID => 'ID',
        self::TITLE => 'TITLE',
        self::DISABLED => 'DISABLED',
        self::SEVERITY => 'SEVERITY',
    ];

    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(OrderByType::class, \Keyapis\TelemetryAlerting\V1\TriggerPaging_OrderByType::class);

