<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/ads/googleads/v23/enums/ad_sub_network_type.proto

namespace Google\Ads\GoogleAds\V23\Enums\AdSubNetworkTypeEnum;

use UnexpectedValueException;

/**
 * Enumerates Google Ads sub network types.
 *
 * Protobuf type <code>google.ads.googleads.v23.enums.AdSubNetworkTypeEnum.AdSubNetworkType</code>
 */
class AdSubNetworkType
{
    /**
     * Not specified.
     *
     * Generated from protobuf enum <code>UNSPECIFIED = 0;</code>
     */
    const UNSPECIFIED = 0;
    /**
     * Unknown.
     *
     * Generated from protobuf enum <code>UNKNOWN = 1;</code>
     */
    const UNKNOWN = 1;
    /**
     * The whole network without any sub network type segmentation.
     *
     * Generated from protobuf enum <code>UNSEGMENTED = 2;</code>
     */
    const UNSEGMENTED = 2;
    /**
     * Ads served in-stream of YouTube organic videos.
     *
     * Generated from protobuf enum <code>YOUTUBE_INSTREAM = 3;</code>
     */
    const YOUTUBE_INSTREAM = 3;
    /**
     * Ads served on YouTube feed surfaces, such as YouTube Home or Watch Next.
     *
     * Generated from protobuf enum <code>YOUTUBE_INFEED = 4;</code>
     */
    const YOUTUBE_INFEED = 4;
    /**
     * Ads served on the YouTube Shorts feed.
     *
     * Generated from protobuf enum <code>YOUTUBE_SHORTS = 5;</code>
     */
    const YOUTUBE_SHORTS = 5;

    private static $valueToName = [
        self::UNSPECIFIED => 'UNSPECIFIED',
        self::UNKNOWN => 'UNKNOWN',
        self::UNSEGMENTED => 'UNSEGMENTED',
        self::YOUTUBE_INSTREAM => 'YOUTUBE_INSTREAM',
        self::YOUTUBE_INFEED => 'YOUTUBE_INFEED',
        self::YOUTUBE_SHORTS => 'YOUTUBE_SHORTS',
    ];

    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(AdSubNetworkType::class, \Google\Ads\GoogleAds\V23\Enums\AdSubNetworkTypeEnum_AdSubNetworkType::class);

