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

namespace Google\Cloud\Dialogflow\V2\ConversationModel;

use UnexpectedValueException;

/**
 * State of the model.
 *
 * Protobuf type <code>google.cloud.dialogflow.v2.ConversationModel.State</code>
 */
class State
{
    /**
     * Should not be used, an un-set enum has this value by default.
     *
     * Generated from protobuf enum <code>STATE_UNSPECIFIED = 0;</code>
     */
    const STATE_UNSPECIFIED = 0;
    /**
     * Model being created.
     *
     * Generated from protobuf enum <code>CREATING = 1;</code>
     */
    const CREATING = 1;
    /**
     * Model is not deployed but ready to deploy.
     *
     * Generated from protobuf enum <code>UNDEPLOYED = 2;</code>
     */
    const UNDEPLOYED = 2;
    /**
     * Model is deploying.
     *
     * Generated from protobuf enum <code>DEPLOYING = 3;</code>
     */
    const DEPLOYING = 3;
    /**
     * Model is deployed and ready to use.
     *
     * Generated from protobuf enum <code>DEPLOYED = 4;</code>
     */
    const DEPLOYED = 4;
    /**
     * Model is undeploying.
     *
     * Generated from protobuf enum <code>UNDEPLOYING = 5;</code>
     */
    const UNDEPLOYING = 5;
    /**
     * Model is deleting.
     *
     * Generated from protobuf enum <code>DELETING = 6;</code>
     */
    const DELETING = 6;
    /**
     * Model is in error state. Not ready to deploy and use.
     *
     * Generated from protobuf enum <code>FAILED = 7;</code>
     */
    const FAILED = 7;
    /**
     * Model is being created but the training has not started,
     * The model may remain in this state until there is enough capacity to
     * start training.
     *
     * Generated from protobuf enum <code>PENDING = 8;</code>
     */
    const PENDING = 8;

    private static $valueToName = [
        self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED',
        self::CREATING => 'CREATING',
        self::UNDEPLOYED => 'UNDEPLOYED',
        self::DEPLOYING => 'DEPLOYING',
        self::DEPLOYED => 'DEPLOYED',
        self::UNDEPLOYING => 'UNDEPLOYING',
        self::DELETING => 'DELETING',
        self::FAILED => 'FAILED',
        self::PENDING => 'PENDING',
    ];

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


