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

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

use UnexpectedValueException;

/**
 * Enum describing possible times after starting a video ad sequence when a
 * user is eligible to repeat the sequence.
 *
 * Protobuf type <code>google.ads.googleads.v23.enums.VideoAdSequenceMinimumDurationEnum.VideoAdSequenceMinimumDuration</code>
 */
class VideoAdSequenceMinimumDuration
{
    /**
     * Not specified.
     *
     * Generated from protobuf enum <code>UNSPECIFIED = 0;</code>
     */
    const UNSPECIFIED = 0;
    /**
     * Used for return value only. Represents value unknown in this version.
     *
     * Generated from protobuf enum <code>UNKNOWN = 1;</code>
     */
    const UNKNOWN = 1;
    /**
     * Users are eligible to restart a sequence once they have completed the
     * sequence and at least 7 days have passed since sequence start.
     *
     * Generated from protobuf enum <code>WEEK = 2;</code>
     */
    const WEEK = 2;
    /**
     * Users are eligible to restart a sequence once at least 30 days have
     * passed since sequence start. Users are eligible to start the sequence
     * again even if they haven't completed the sequence.
     *
     * Generated from protobuf enum <code>MONTH = 3;</code>
     */
    const MONTH = 3;

    private static $valueToName = [
        self::UNSPECIFIED => 'UNSPECIFIED',
        self::UNKNOWN => 'UNKNOWN',
        self::WEEK => 'WEEK',
        self::MONTH => 'MONTH',
    ];

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

