<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/channel/v1/reports_service.proto

namespace Google\Cloud\Channel\V1\ReportStatus;

use UnexpectedValueException;

/**
 * Available states of report generation.
 *
 * Protobuf type <code>google.cloud.channel.v1.ReportStatus.State</code>
 */
class State
{
    /**
     * Not used.
     *
     * Generated from protobuf enum <code>STATE_UNSPECIFIED = 0;</code>
     */
    const STATE_UNSPECIFIED = 0;
    /**
     * Report processing started.
     *
     * Generated from protobuf enum <code>STARTED = 1;</code>
     */
    const STARTED = 1;
    /**
     * Data generated from the report is being staged.
     *
     * Generated from protobuf enum <code>WRITING = 2;</code>
     */
    const WRITING = 2;
    /**
     * Report data is available for access.
     *
     * Generated from protobuf enum <code>AVAILABLE = 3;</code>
     */
    const AVAILABLE = 3;
    /**
     * Report failed.
     *
     * Generated from protobuf enum <code>FAILED = 4;</code>
     */
    const FAILED = 4;

    private static $valueToName = [
        self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED',
        self::STARTED => 'STARTED',
        self::WRITING => 'WRITING',
        self::AVAILABLE => 'AVAILABLE',
        self::FAILED => 'FAILED',
    ];

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


