<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/ads/admanager/v1/ad_unit_enums.proto

namespace Google\Ads\AdManager\V1\TargetWindowEnum;

use UnexpectedValueException;

/**
 * Corresponds to an HTML link's target attribute.
 * See http://www.w3.org/TR/html401/present/frames.html#adef-target
 *
 * Protobuf type <code>google.ads.admanager.v1.TargetWindowEnum.TargetWindow</code>
 */
class TargetWindow
{
    /**
     * Default value. This value is unused.
     *
     * Generated from protobuf enum <code>TARGET_WINDOW_UNSPECIFIED = 0;</code>
     */
    const TARGET_WINDOW_UNSPECIFIED = 0;
    /**
     * Specifies that the link should open in the full body of the page.
     *
     * Generated from protobuf enum <code>TOP = 1;</code>
     */
    const TOP = 1;
    /**
     * Specifies that the link should open in a new window.
     *
     * Generated from protobuf enum <code>BLANK = 2;</code>
     */
    const BLANK = 2;

    private static $valueToName = [
        self::TARGET_WINDOW_UNSPECIFIED => 'TARGET_WINDOW_UNSPECIFIED',
        self::TOP => 'TOP',
        self::BLANK => 'BLANK',
    ];

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


