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

namespace Google\Ads\AdManager\V1\AdBreakStateEnum;

use UnexpectedValueException;

/**
 * Represents the state of an ad break
 *
 * Protobuf type <code>google.ads.admanager.v1.AdBreakStateEnum.AdBreakState</code>
 */
class AdBreakState
{
    /**
     * Default value. This value is unused.
     *
     * Generated from protobuf enum <code>AD_BREAK_STATE_UNSPECIFIED = 0;</code>
     */
    const AD_BREAK_STATE_UNSPECIFIED = 0;
    /**
     * The ad break's decisioning has finished. You can delete, but not update
     * the ad break.
     *
     * Generated from protobuf enum <code>DECISIONED = 1;</code>
     */
    const DECISIONED = 1;
    /**
     * The ad break has started serving to users. You cannot delete or update
     * the ad break.
     *
     * Generated from protobuf enum <code>COMPLETE = 2;</code>
     */
    const COMPLETE = 2;
    /**
     * The ad break is scheduled and decisioning will start later. You can
     * delete or update the ad break.
     *
     * Generated from protobuf enum <code>SCHEDULED = 3;</code>
     */
    const SCHEDULED = 3;

    private static $valueToName = [
        self::AD_BREAK_STATE_UNSPECIFIED => 'AD_BREAK_STATE_UNSPECIFIED',
        self::DECISIONED => 'DECISIONED',
        self::COMPLETE => 'COMPLETE',
        self::SCHEDULED => 'SCHEDULED',
    ];

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


