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

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

use UnexpectedValueException;

/**
 * Indicates how many of the companions should be displayed with the ad.
 *
 * Protobuf type <code>google.cloud.video.stitcher.v1.CompanionAds.DisplayRequirement</code>
 */
class DisplayRequirement
{
    /**
     * Required companions are not specified. The default is ALL.
     *
     * Generated from protobuf enum <code>DISPLAY_REQUIREMENT_UNSPECIFIED = 0;</code>
     */
    const DISPLAY_REQUIREMENT_UNSPECIFIED = 0;
    /**
     * All companions are required to be displayed.
     *
     * Generated from protobuf enum <code>ALL = 1;</code>
     */
    const ALL = 1;
    /**
     * At least one of companions needs to be displayed.
     *
     * Generated from protobuf enum <code>ANY = 2;</code>
     */
    const ANY = 2;
    /**
     * All companions are optional for display.
     *
     * Generated from protobuf enum <code>NONE = 3;</code>
     */
    const NONE = 3;

    private static $valueToName = [
        self::DISPLAY_REQUIREMENT_UNSPECIFIED => 'DISPLAY_REQUIREMENT_UNSPECIFIED',
        self::ALL => 'ALL',
        self::ANY => 'ANY',
        self::NONE => 'NONE',
    ];

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


