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

namespace Google\Cloud\Video\Stitcher\V1;

use UnexpectedValueException;

/**
 * Determines the Ad tracking policy.
 *
 * Protobuf type <code>google.cloud.video.stitcher.v1.AdTracking</code>
 */
class AdTracking
{
    /**
     * The ad tracking policy is not specified.
     *
     * Generated from protobuf enum <code>AD_TRACKING_UNSPECIFIED = 0;</code>
     */
    const AD_TRACKING_UNSPECIFIED = 0;
    /**
     * Client side ad tracking is specified. The client player is expected to
     * trigger playback and activity events itself.
     *
     * Generated from protobuf enum <code>CLIENT = 1;</code>
     */
    const CLIENT = 1;
    /**
     * The Video Stitcher API will trigger playback events on behalf of
     * the client player.
     *
     * Generated from protobuf enum <code>SERVER = 2;</code>
     */
    const SERVER = 2;

    private static $valueToName = [
        self::AD_TRACKING_UNSPECIFIED => 'AD_TRACKING_UNSPECIFIED',
        self::CLIENT => 'CLIENT',
        self::SERVER => 'SERVER',
    ];

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

