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

namespace Google\Cloud\Dialogflow\Cx\V3\RestoreAgentRequest;

use UnexpectedValueException;

/**
 * Restore option.
 *
 * Protobuf type <code>google.cloud.dialogflow.cx.v3.RestoreAgentRequest.RestoreOption</code>
 */
class RestoreOption
{
    /**
     * Unspecified. Treated as KEEP.
     *
     * Generated from protobuf enum <code>RESTORE_OPTION_UNSPECIFIED = 0;</code>
     */
    const RESTORE_OPTION_UNSPECIFIED = 0;
    /**
     * Always respect the settings from the exported agent file. It may cause
     * a restoration failure if some settings (e.g. model type) are not
     * supported in the target agent.
     *
     * Generated from protobuf enum <code>KEEP = 1;</code>
     */
    const KEEP = 1;
    /**
     * Fallback to default settings if some settings are not supported in the
     * target agent.
     *
     * Generated from protobuf enum <code>FALLBACK = 2;</code>
     */
    const FALLBACK = 2;

    private static $valueToName = [
        self::RESTORE_OPTION_UNSPECIFIED => 'RESTORE_OPTION_UNSPECIFIED',
        self::KEEP => 'KEEP',
        self::FALLBACK => 'FALLBACK',
    ];

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


