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

namespace Google\Cloud\Dataform\V1beta1\Repository\GitRemoteSettings;

use UnexpectedValueException;

/**
 * Indicates the status of a Git authentication token.
 *
 * Protobuf type <code>google.cloud.dataform.v1beta1.Repository.GitRemoteSettings.TokenStatus</code>
 */
class TokenStatus
{
    /**
     * Default value. This value is unused.
     *
     * Generated from protobuf enum <code>TOKEN_STATUS_UNSPECIFIED = 0;</code>
     */
    const TOKEN_STATUS_UNSPECIFIED = 0;
    /**
     * The token could not be found in Secret Manager (or the Dataform
     * Service Account did not have permission to access it).
     *
     * Generated from protobuf enum <code>NOT_FOUND = 1;</code>
     */
    const NOT_FOUND = 1;
    /**
     * The token could not be used to authenticate against the Git remote.
     *
     * Generated from protobuf enum <code>INVALID = 2;</code>
     */
    const INVALID = 2;
    /**
     * The token was used successfully to authenticate against the Git remote.
     *
     * Generated from protobuf enum <code>VALID = 3;</code>
     */
    const VALID = 3;

    private static $valueToName = [
        self::TOKEN_STATUS_UNSPECIFIED => 'TOKEN_STATUS_UNSPECIFIED',
        self::NOT_FOUND => 'NOT_FOUND',
        self::INVALID => 'INVALID',
        self::VALID => 'VALID',
    ];

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


