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

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

use UnexpectedValueException;

/**
 * Possible states for managed ingestion from Event Hubs.
 *
 * Protobuf type <code>google.pubsub.v1.IngestionDataSourceSettings.AzureEventHubs.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 Event Hubs.
     * This can happen when `client_id`, or `tenant_id` are invalid. Or the
     * right permissions haven't been granted.
     *
     * Generated from protobuf enum <code>EVENT_HUBS_PERMISSION_DENIED = 2;</code>
     */
    const EVENT_HUBS_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 Event Hubs namespace couldn't be found.
     *
     * Generated from protobuf enum <code>NAMESPACE_NOT_FOUND = 4;</code>
     */
    const NAMESPACE_NOT_FOUND = 4;
    /**
     * The provided Event Hub couldn't be found.
     *
     * Generated from protobuf enum <code>EVENT_HUB_NOT_FOUND = 5;</code>
     */
    const EVENT_HUB_NOT_FOUND = 5;
    /**
     * The provided Event Hubs subscription couldn't be found.
     *
     * Generated from protobuf enum <code>SUBSCRIPTION_NOT_FOUND = 6;</code>
     */
    const SUBSCRIPTION_NOT_FOUND = 6;
    /**
     * The provided Event Hubs resource group couldn't be found.
     *
     * Generated from protobuf enum <code>RESOURCE_GROUP_NOT_FOUND = 7;</code>
     */
    const RESOURCE_GROUP_NOT_FOUND = 7;

    private static $valueToName = [
        self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED',
        self::ACTIVE => 'ACTIVE',
        self::EVENT_HUBS_PERMISSION_DENIED => 'EVENT_HUBS_PERMISSION_DENIED',
        self::PUBLISH_PERMISSION_DENIED => 'PUBLISH_PERMISSION_DENIED',
        self::NAMESPACE_NOT_FOUND => 'NAMESPACE_NOT_FOUND',
        self::EVENT_HUB_NOT_FOUND => 'EVENT_HUB_NOT_FOUND',
        self::SUBSCRIPTION_NOT_FOUND => 'SUBSCRIPTION_NOT_FOUND',
        self::RESOURCE_GROUP_NOT_FOUND => 'RESOURCE_GROUP_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);
    }
}


