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

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

use UnexpectedValueException;

/**
 * Describes which direction a trend is moving.
 *
 * Protobuf type <code>google.ads.googleads.v23.enums.InsightsTrendEnum.InsightsTrend</code>
 */
class InsightsTrend
{
    /**
     * Not specified.
     *
     * Generated from protobuf enum <code>UNSPECIFIED = 0;</code>
     */
    const UNSPECIFIED = 0;
    /**
     * The value is unknown in this version.
     *
     * Generated from protobuf enum <code>UNKNOWN = 1;</code>
     */
    const UNKNOWN = 1;
    /**
     * This is a new trend.
     *
     * Generated from protobuf enum <code>EMERGING = 2;</code>
     */
    const EMERGING = 2;
    /**
     * This trend has increased recently.
     *
     * Generated from protobuf enum <code>RISING = 3;</code>
     */
    const RISING = 3;
    /**
     * This trend has remained stable.
     *
     * Generated from protobuf enum <code>SUSTAINED = 4;</code>
     */
    const SUSTAINED = 4;
    /**
     * This trend is declining.
     *
     * Generated from protobuf enum <code>DECLINING = 5;</code>
     */
    const DECLINING = 5;

    private static $valueToName = [
        self::UNSPECIFIED => 'UNSPECIFIED',
        self::UNKNOWN => 'UNKNOWN',
        self::EMERGING => 'EMERGING',
        self::RISING => 'RISING',
        self::SUSTAINED => 'SUSTAINED',
        self::DECLINING => 'DECLINING',
    ];

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

