<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/capacityplanner/v1beta/usage_service.proto

namespace Google\Cloud\CapacityPlanner\V1beta\Forecast;

use UnexpectedValueException;

/**
 * The prediction interval represented by a forecast.
 *
 * Protobuf type <code>google.cloud.capacityplanner.v1beta.Forecast.PredictionInterval</code>
 */
class PredictionInterval
{
    /**
     * No prediction interval is specified.
     *
     * Generated from protobuf enum <code>PREDICTION_INTERVAL_UNSPECIFIED = 0;</code>
     */
    const PREDICTION_INTERVAL_UNSPECIFIED = 0;
    /**
     * This represents a prediction interval that has 90% confidence. For
     * example, for a symmetric prediction interval, a `PredictionInterval`
     * of `PREDICTION_INTERVAL_90` means that the `UPPER_BOUND` will represent
     * the 95th precentile.
     *
     * Generated from protobuf enum <code>PREDICTION_INTERVAL_90 = 1;</code>
     */
    const PREDICTION_INTERVAL_90 = 1;
    /**
     * This represents a prediction interval that has 50% confidence. For
     * example, for a symmetric prediction interval, a `PredictionInterval`
     * of `PREDICTION_INTERVAL_50` means that the `UPPER_BOUND` will represent
     * the 75th precentile.
     *
     * Generated from protobuf enum <code>PREDICTION_INTERVAL_50 = 2;</code>
     */
    const PREDICTION_INTERVAL_50 = 2;

    private static $valueToName = [
        self::PREDICTION_INTERVAL_UNSPECIFIED => 'PREDICTION_INTERVAL_UNSPECIFIED',
        self::PREDICTION_INTERVAL_90 => 'PREDICTION_INTERVAL_90',
        self::PREDICTION_INTERVAL_50 => 'PREDICTION_INTERVAL_50',
    ];

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


