<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/dataflow/v1beta3/snapshots.proto

namespace Google\Cloud\Dataflow\V1beta3;

use UnexpectedValueException;

/**
 * Snapshot state.
 *
 * Protobuf type <code>google.dataflow.v1beta3.SnapshotState</code>
 */
class SnapshotState
{
    /**
     * Unknown state.
     *
     * Generated from protobuf enum <code>UNKNOWN_SNAPSHOT_STATE = 0;</code>
     */
    const UNKNOWN_SNAPSHOT_STATE = 0;
    /**
     * Snapshot intent to create has been persisted, snapshotting of state has not
     * yet started.
     *
     * Generated from protobuf enum <code>PENDING = 1;</code>
     */
    const PENDING = 1;
    /**
     * Snapshotting is being performed.
     *
     * Generated from protobuf enum <code>RUNNING = 2;</code>
     */
    const RUNNING = 2;
    /**
     * Snapshot has been created and is ready to be used.
     *
     * Generated from protobuf enum <code>READY = 3;</code>
     */
    const READY = 3;
    /**
     * Snapshot failed to be created.
     *
     * Generated from protobuf enum <code>FAILED = 4;</code>
     */
    const FAILED = 4;
    /**
     * Snapshot has been deleted.
     *
     * Generated from protobuf enum <code>DELETED = 5;</code>
     */
    const DELETED = 5;

    private static $valueToName = [
        self::UNKNOWN_SNAPSHOT_STATE => 'UNKNOWN_SNAPSHOT_STATE',
        self::PENDING => 'PENDING',
        self::RUNNING => 'RUNNING',
        self::READY => 'READY',
        self::FAILED => 'FAILED',
        self::DELETED => 'DELETED',
    ];

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

