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

namespace Google\Ads\GoogleAds\V25\Enums\NonSkippableMaxDurationEnum;

use UnexpectedValueException;

/**
 * Enum describing the allowed maximum duration values for videos used in
 * non-skippable video responsive ads.
 *
 * Protobuf type <code>google.ads.googleads.v25.enums.NonSkippableMaxDurationEnum.NonSkippableMaxDuration</code>
 */
class NonSkippableMaxDuration
{
    /**
     * 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 most 15 seconds long.
     *
     * Generated from protobuf enum <code>MAX_DURATION_FIFTEEN_SECONDS = 2;</code>
     */
    const MAX_DURATION_FIFTEEN_SECONDS = 2;
    /**
     * Indicates that non-skippable ads must be at most 30 seconds long.
     *
     * Generated from protobuf enum <code>MAX_DURATION_THIRTY_SECONDS = 3;</code>
     */
    const MAX_DURATION_THIRTY_SECONDS = 3;
    /**
     * Indicates that non-skippable ads must be at most 60 seconds long.
     *
     * Generated from protobuf enum <code>MAX_DURATION_SIXTY_SECONDS = 4;</code>
     */
    const MAX_DURATION_SIXTY_SECONDS = 4;

    private static $valueToName = [
        self::UNSPECIFIED => 'UNSPECIFIED',
        self::UNKNOWN => 'UNKNOWN',
        self::MAX_DURATION_FIFTEEN_SECONDS => 'MAX_DURATION_FIFTEEN_SECONDS',
        self::MAX_DURATION_THIRTY_SECONDS => 'MAX_DURATION_THIRTY_SECONDS',
        self::MAX_DURATION_SIXTY_SECONDS => 'MAX_DURATION_SIXTY_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);
    }
}

