<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/video/stitcher/v1/sessions.proto

namespace Google\Cloud\Video\Stitcher\V1\ManifestOptions;

use UnexpectedValueException;

/**
 * Defines the ordering policy during manifest generation.
 *
 * Protobuf type <code>google.cloud.video.stitcher.v1.ManifestOptions.OrderPolicy</code>
 */
class OrderPolicy
{
    /**
     * Ordering policy is not specified.
     *
     * Generated from protobuf enum <code>ORDER_POLICY_UNSPECIFIED = 0;</code>
     */
    const ORDER_POLICY_UNSPECIFIED = 0;
    /**
     * Order by ascending.
     *
     * Generated from protobuf enum <code>ASCENDING = 1;</code>
     */
    const ASCENDING = 1;
    /**
     * Order by descending.
     *
     * Generated from protobuf enum <code>DESCENDING = 2;</code>
     */
    const DESCENDING = 2;

    private static $valueToName = [
        self::ORDER_POLICY_UNSPECIFIED => 'ORDER_POLICY_UNSPECIFIED',
        self::ASCENDING => 'ASCENDING',
        self::DESCENDING => 'DESCENDING',
    ];

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


