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

namespace Google\Cloud\Compute\V1\VpnTunnel;

use UnexpectedValueException;

/**
 * [Output Only] The status of the VPN tunnel, which can be one of the following:
 * - PROVISIONING: Resource is being allocated for the VPN tunnel.
 * - WAITING_FOR_FULL_CONFIG: Waiting to receive all VPN-related configs from the user. Network, TargetVpnGateway, VpnTunnel, ForwardingRule, and Route resources are needed to setup the VPN tunnel.
 * - FIRST_HANDSHAKE: Successful first handshake with the peer VPN.
 * - ESTABLISHED: Secure session is successfully established with the peer VPN.
 * - NETWORK_ERROR: Deprecated, replaced by NO_INCOMING_PACKETS
 * - AUTHORIZATION_ERROR: Auth error (for example, bad shared secret).
 * - NEGOTIATION_FAILURE: Handshake failed.
 * - DEPROVISIONING: Resources are being deallocated for the VPN tunnel.
 * - FAILED: Tunnel creation has failed and the tunnel is not ready to be used.
 * - NO_INCOMING_PACKETS: No incoming packets from peer.
 * - REJECTED: Tunnel configuration was rejected, can be result of being blacklisted.
 * - ALLOCATING_RESOURCES: Cloud VPN is in the process of allocating all required resources.
 * - STOPPED: Tunnel is stopped due to its Forwarding Rules being deleted for Classic VPN tunnels or the project is in frozen state.
 * - PEER_IDENTITY_MISMATCH: Peer identity does not match peer IP, probably behind NAT.
 * - TS_NARROWING_NOT_ALLOWED: Traffic selector narrowing not allowed for an HA-VPN tunnel.
 *
 * Protobuf type <code>google.cloud.compute.v1.VpnTunnel.Status</code>
 */
class Status
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_STATUS = 0;</code>
     */
    const UNDEFINED_STATUS = 0;
    /**
     * Generated from protobuf enum <code>ALLOCATING_RESOURCES = 52487360;</code>
     */
    const ALLOCATING_RESOURCES = 52487360;
    /**
     * Generated from protobuf enum <code>AUTHORIZATION_ERROR = 23580290;</code>
     */
    const AUTHORIZATION_ERROR = 23580290;
    /**
     * Generated from protobuf enum <code>DEPROVISIONING = 160500206;</code>
     */
    const DEPROVISIONING = 160500206;
    /**
     * Generated from protobuf enum <code>ESTABLISHED = 88852344;</code>
     */
    const ESTABLISHED = 88852344;
    /**
     * Generated from protobuf enum <code>FAILED = 187271229;</code>
     */
    const FAILED = 187271229;
    /**
     * Generated from protobuf enum <code>FIRST_HANDSHAKE = 191393000;</code>
     */
    const FIRST_HANDSHAKE = 191393000;
    /**
     * Generated from protobuf enum <code>NEGOTIATION_FAILURE = 91890412;</code>
     */
    const NEGOTIATION_FAILURE = 91890412;
    /**
     * Generated from protobuf enum <code>NETWORK_ERROR = 193912951;</code>
     */
    const NETWORK_ERROR = 193912951;
    /**
     * Generated from protobuf enum <code>NO_INCOMING_PACKETS = 119983216;</code>
     */
    const NO_INCOMING_PACKETS = 119983216;
    /**
     * Generated from protobuf enum <code>PROVISIONING = 22461165;</code>
     */
    const PROVISIONING = 22461165;
    /**
     * Generated from protobuf enum <code>REJECTED = 174130302;</code>
     */
    const REJECTED = 174130302;
    /**
     * Generated from protobuf enum <code>STOPPED = 175840685;</code>
     */
    const STOPPED = 175840685;
    /**
     * Generated from protobuf enum <code>WAITING_FOR_FULL_CONFIG = 41640522;</code>
     */
    const WAITING_FOR_FULL_CONFIG = 41640522;

    private static $valueToName = [
        self::UNDEFINED_STATUS => 'UNDEFINED_STATUS',
        self::ALLOCATING_RESOURCES => 'ALLOCATING_RESOURCES',
        self::AUTHORIZATION_ERROR => 'AUTHORIZATION_ERROR',
        self::DEPROVISIONING => 'DEPROVISIONING',
        self::ESTABLISHED => 'ESTABLISHED',
        self::FAILED => 'FAILED',
        self::FIRST_HANDSHAKE => 'FIRST_HANDSHAKE',
        self::NEGOTIATION_FAILURE => 'NEGOTIATION_FAILURE',
        self::NETWORK_ERROR => 'NETWORK_ERROR',
        self::NO_INCOMING_PACKETS => 'NO_INCOMING_PACKETS',
        self::PROVISIONING => 'PROVISIONING',
        self::REJECTED => 'REJECTED',
        self::STOPPED => 'STOPPED',
        self::WAITING_FOR_FULL_CONFIG => 'WAITING_FOR_FULL_CONFIG',
    ];

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


