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

namespace Google\Cloud\AutoMl\V1\Model;

use UnexpectedValueException;

/**
 * Deployment state of the model.
 *
 * Protobuf type <code>google.cloud.automl.v1.Model.DeploymentState</code>
 */
class DeploymentState
{
    /**
     * Should not be used, an un-set enum has this value by default.
     *
     * Generated from protobuf enum <code>DEPLOYMENT_STATE_UNSPECIFIED = 0;</code>
     */
    const DEPLOYMENT_STATE_UNSPECIFIED = 0;
    /**
     * Model is deployed.
     *
     * Generated from protobuf enum <code>DEPLOYED = 1;</code>
     */
    const DEPLOYED = 1;
    /**
     * Model is not deployed.
     *
     * Generated from protobuf enum <code>UNDEPLOYED = 2;</code>
     */
    const UNDEPLOYED = 2;

    private static $valueToName = [
        self::DEPLOYMENT_STATE_UNSPECIFIED => 'DEPLOYMENT_STATE_UNSPECIFIED',
        self::DEPLOYED => 'DEPLOYED',
        self::UNDEPLOYED => 'UNDEPLOYED',
    ];

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

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(DeploymentState::class, \Google\Cloud\AutoMl\V1\Model_DeploymentState::class);

