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

namespace Google\Ads\GoogleAds\V21\Enums\NonSkippableMinDurationEnum;

use UnexpectedValueException;

/**
 * Enum describing the allowed minimum duration values for videos used in
 * non-skippable video responsive ads.
 *
 * Protobuf type <code>google.ads.googleads.v21.enums.NonSkippableMinDurationEnum.NonSkippableMinDuration</code>
 */
class NonSkippableMinDuration
{
    /**
     * 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;
    /**
     * Indicates that non-skippable ads must be at least 5 seconds long.
     *
     * Generated from protobuf enum <code>MIN_DURATION_FIVE_SECONDS = 2;</code>
     */
    const MIN_DURATION_FIVE_SECONDS = 2;
    /**
     * Indicates that non-skippable ads must be at least 7 seconds long.
     *
     * Generated from protobuf enum <code>MIN_DURATION_SEVEN_SECONDS = 3;</code>
     */
    const MIN_DURATION_SEVEN_SECONDS = 3;
    /**
     * Indicates that non-skippable ads must be at least 16 seconds long.
     *
     * Generated from protobuf enum <code>MIN_DURATION_SIXTEEN_SECONDS = 4;</code>
     */
    const MIN_DURATION_SIXTEEN_SECONDS = 4;
    /**
     * Indicates that non-skippable ads must be at least 31 seconds long.
     *
     * Generated from protobuf enum <code>MIN_DURATION_THIRTY_ONE_SECONDS = 5;</code>
     */
    const MIN_DURATION_THIRTY_ONE_SECONDS = 5;

    private static $valueToName = [
        self::UNSPECIFIED => 'UNSPECIFIED',
        self::UNKNOWN => 'UNKNOWN',
        self::MIN_DURATION_FIVE_SECONDS => 'MIN_DURATION_FIVE_SECONDS',
        self::MIN_DURATION_SEVEN_SECONDS => 'MIN_DURATION_SEVEN_SECONDS',
        self::MIN_DURATION_SIXTEEN_SECONDS => 'MIN_DURATION_SIXTEEN_SECONDS',
        self::MIN_DURATION_THIRTY_ONE_SECONDS => 'MIN_DURATION_THIRTY_ONE_SECONDS',
    ];

    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(NonSkippableMinDuration::class, \Google\Ads\GoogleAds\V21\Enums\NonSkippableMinDurationEnum_NonSkippableMinDuration::class);

