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

namespace Google\Cloud\Compute\V1\NetworkEndpointGroupPscData;

use UnexpectedValueException;

/**
 * [Output Only] The connection status of the PSC Forwarding Rule.
 *
 * Protobuf type <code>google.cloud.compute.v1.NetworkEndpointGroupPscData.PscConnectionStatus</code>
 */
class PscConnectionStatus
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_PSC_CONNECTION_STATUS = 0;</code>
     */
    const UNDEFINED_PSC_CONNECTION_STATUS = 0;
    /**
     * The connection has been accepted by the producer.
     *
     * Generated from protobuf enum <code>ACCEPTED = 246714279;</code>
     */
    const ACCEPTED = 246714279;
    /**
     * The connection has been closed by the producer and will not serve traffic going forward.
     *
     * Generated from protobuf enum <code>CLOSED = 380163436;</code>
     */
    const CLOSED = 380163436;
    /**
     * The connection has been accepted by the producer, but the producer needs to take further action before the forwarding rule can serve traffic.
     *
     * Generated from protobuf enum <code>NEEDS_ATTENTION = 344491452;</code>
     */
    const NEEDS_ATTENTION = 344491452;
    /**
     * The connection is pending acceptance by the producer.
     *
     * Generated from protobuf enum <code>PENDING = 35394935;</code>
     */
    const PENDING = 35394935;
    /**
     * The connection has been rejected by the producer.
     *
     * Generated from protobuf enum <code>REJECTED = 174130302;</code>
     */
    const REJECTED = 174130302;
    /**
     * Generated from protobuf enum <code>STATUS_UNSPECIFIED = 42133066;</code>
     */
    const STATUS_UNSPECIFIED = 42133066;

    private static $valueToName = [
        self::UNDEFINED_PSC_CONNECTION_STATUS => 'UNDEFINED_PSC_CONNECTION_STATUS',
        self::ACCEPTED => 'ACCEPTED',
        self::CLOSED => 'CLOSED',
        self::NEEDS_ATTENTION => 'NEEDS_ATTENTION',
        self::PENDING => 'PENDING',
        self::REJECTED => 'REJECTED',
        self::STATUS_UNSPECIFIED => 'STATUS_UNSPECIFIED',
    ];

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


