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

namespace Google\Cloud\ContactCenterInsights\V1\IssueModel;

use UnexpectedValueException;

/**
 * State of the model.
 *
 * Protobuf type <code>google.cloud.contactcenterinsights.v1.IssueModel.State</code>
 */
class State
{
    /**
     * Unspecified.
     *
     * Generated from protobuf enum <code>STATE_UNSPECIFIED = 0;</code>
     */
    const STATE_UNSPECIFIED = 0;
    /**
     * Model is not deployed but is ready to deploy.
     *
     * Generated from protobuf enum <code>UNDEPLOYED = 1;</code>
     */
    const UNDEPLOYED = 1;
    /**
     * Model is being deployed.
     *
     * Generated from protobuf enum <code>DEPLOYING = 2;</code>
     */
    const DEPLOYING = 2;
    /**
     * Model is deployed and is ready to be used. A model can only be used in
     * analysis if it's in this state.
     *
     * Generated from protobuf enum <code>DEPLOYED = 3;</code>
     */
    const DEPLOYED = 3;
    /**
     * Model is being undeployed.
     *
     * Generated from protobuf enum <code>UNDEPLOYING = 4;</code>
     */
    const UNDEPLOYING = 4;
    /**
     * Model is being deleted.
     *
     * Generated from protobuf enum <code>DELETING = 5;</code>
     */
    const DELETING = 5;

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

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


