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

namespace Google\Ads\AdManager\V1\LineItemTypeEnum;

use UnexpectedValueException;

/**
 * Indicates the priority of a LineItem, determined by the way in which
 * impressions are reserved to be served for it.
 *
 * Protobuf type <code>google.ads.admanager.v1.LineItemTypeEnum.LineItemType</code>
 */
class LineItemType
{
    /**
     * Not specified value.
     *
     * Generated from protobuf enum <code>LINE_ITEM_TYPE_UNSPECIFIED = 0;</code>
     */
    const LINE_ITEM_TYPE_UNSPECIFIED = 0;
    /**
     * The type of LineItem for which a percentage of all the impressions that
     * are being sold are reserved.
     *
     * Generated from protobuf enum <code>SPONSORSHIP = 12;</code>
     */
    const SPONSORSHIP = 12;
    /**
     * The type of LineItem for which a fixed quantity of impressions or
     * clicks are reserved.
     *
     * Generated from protobuf enum <code>STANDARD = 13;</code>
     */
    const STANDARD = 13;
    /**
     * The type of LineItem most commonly used to fill a site's unsold
     * inventory if not contractually obligated to deliver a requested number
     * of impressions. Uses daily percentage of unsold impressions or clicks.
     *
     * Generated from protobuf enum <code>NETWORK = 9;</code>
     */
    const NETWORK = 9;
    /**
     * The type of LineItem for which a fixed quantity of impressions or
     * clicks will be delivered at a priority lower than the STANDARD type.
     *
     * Generated from protobuf enum <code>BULK = 4;</code>
     */
    const BULK = 4;
    /**
     * The type of LineItem most commonly used to fill a site's unsold
     * inventory if not contractually obligated to deliver a requested number
     * of impressions. Uses fixed quantity percentage of unsold impressions or
     * clicks.
     *
     * Generated from protobuf enum <code>PRICE_PRIORITY = 11;</code>
     */
    const PRICE_PRIORITY = 11;
    /**
     * The type of LineItem typically used for ads that promote products and
     * services chosen by the publisher.
     *
     * Generated from protobuf enum <code>HOUSE = 7;</code>
     */
    const HOUSE = 7;
    /**
     * The type of LineItem used for ads that track ads being served
     * externally of Ad Manager.
     *
     * Generated from protobuf enum <code>CLICK_TRACKING = 6;</code>
     */
    const CLICK_TRACKING = 6;
    /**
     * Targets the LineItem to specific inventory available to AdSense buyers.
     *
     * Generated from protobuf enum <code>ADSENSE = 2;</code>
     */
    const ADSENSE = 2;
    /**
     * Targets the LineItem to specific inventory available to Authorized Buyers
     * and the Open Auction.
     *
     * Generated from protobuf enum <code>AD_EXCHANGE = 3;</code>
     */
    const AD_EXCHANGE = 3;
    /**
     * Represents a non-monetizable video LineItem that targets one or more
     * bumper positions, which are short house video messages used by
     * publishers to separate content from ad breaks.
     *
     * Generated from protobuf enum <code>BUMPER = 5;</code>
     */
    const BUMPER = 5;
    /**
     * The type of LineItem for which there are no impressions reserved, and
     * will serve for a second price bid.
     *
     * Generated from protobuf enum <code>PREFERRED_DEAL = 10;</code>
     */
    const PREFERRED_DEAL = 10;
    /**
     * The type of LineItem used for configuring audience extension campaigns.
     *
     * Generated from protobuf enum <code>AUDIENCE_EXTENSION = 14;</code>
     */
    const AUDIENCE_EXTENSION = 14;

    private static $valueToName = [
        self::LINE_ITEM_TYPE_UNSPECIFIED => 'LINE_ITEM_TYPE_UNSPECIFIED',
        self::SPONSORSHIP => 'SPONSORSHIP',
        self::STANDARD => 'STANDARD',
        self::NETWORK => 'NETWORK',
        self::BULK => 'BULK',
        self::PRICE_PRIORITY => 'PRICE_PRIORITY',
        self::HOUSE => 'HOUSE',
        self::CLICK_TRACKING => 'CLICK_TRACKING',
        self::ADSENSE => 'ADSENSE',
        self::AD_EXCHANGE => 'AD_EXCHANGE',
        self::BUMPER => 'BUMPER',
        self::PREFERRED_DEAL => 'PREFERRED_DEAL',
        self::AUDIENCE_EXTENSION => 'AUDIENCE_EXTENSION',
    ];

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


