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

namespace Google\Cloud\PubSub\V1\IngestionDataSourceSettings\ConfluentCloud;

use UnexpectedValueException;

/**
 * Possible states for managed ingestion from Confluent Cloud.
 *
 * Protobuf type <code>google.pubsub.v1.IngestionDataSourceSettings.ConfluentCloud.State</code>
 */
class State
{
    /**
     * Default value. This value is unused.
     *
     * Generated from protobuf enum <code>STATE_UNSPECIFIED = 0;</code>
     */
    const STATE_UNSPECIFIED = 0;
    /**
     * Ingestion is active.
     *
     * Generated from protobuf enum <code>ACTIVE = 1;</code>
     */
    const ACTIVE = 1;
    /**
     * Permission denied encountered while consuming data from Confluent
     * Cloud.
     *
     * Generated from protobuf enum <code>CONFLUENT_CLOUD_PERMISSION_DENIED = 2;</code>
     */
    const CONFLUENT_CLOUD_PERMISSION_DENIED = 2;
    /**
     * Permission denied encountered while publishing to the topic.
     *
     * Generated from protobuf enum <code>PUBLISH_PERMISSION_DENIED = 3;</code>
     */
    const PUBLISH_PERMISSION_DENIED = 3;
    /**
     * The provided bootstrap server address is unreachable.
     *
     * Generated from protobuf enum <code>UNREACHABLE_BOOTSTRAP_SERVER = 4;</code>
     */
    const UNREACHABLE_BOOTSTRAP_SERVER = 4;
    /**
     * The provided cluster wasn't found.
     *
     * Generated from protobuf enum <code>CLUSTER_NOT_FOUND = 5;</code>
     */
    const CLUSTER_NOT_FOUND = 5;
    /**
     * The provided topic wasn't found.
     *
     * Generated from protobuf enum <code>TOPIC_NOT_FOUND = 6;</code>
     */
    const TOPIC_NOT_FOUND = 6;

    private static $valueToName = [
        self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED',
        self::ACTIVE => 'ACTIVE',
        self::CONFLUENT_CLOUD_PERMISSION_DENIED => 'CONFLUENT_CLOUD_PERMISSION_DENIED',
        self::PUBLISH_PERMISSION_DENIED => 'PUBLISH_PERMISSION_DENIED',
        self::UNREACHABLE_BOOTSTRAP_SERVER => 'UNREACHABLE_BOOTSTRAP_SERVER',
        self::CLUSTER_NOT_FOUND => 'CLUSTER_NOT_FOUND',
        self::TOPIC_NOT_FOUND => 'TOPIC_NOT_FOUND',
    ];

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


