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

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

use UnexpectedValueException;

/**
 * Merge option when display name conflicts exist during import.
 *
 * Protobuf type <code>google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.MergeOption</code>
 */
class MergeOption
{
    /**
     * Unspecified. If used, system uses REPORT_CONFLICT as default.
     *
     * Generated from protobuf enum <code>MERGE_OPTION_UNSPECIFIED = 0;</code>
     */
    const MERGE_OPTION_UNSPECIFIED = 0;
    /**
     * Replace the original entity type in the agent with the new entity type
     * when display name conflicts exist.
     *
     * Generated from protobuf enum <code>REPLACE = 1;</code>
     */
    const REPLACE = 1;
    /**
     * Merge the original entity type with the new entity type when display name
     * conflicts exist.
     *
     * Generated from protobuf enum <code>MERGE = 2;</code>
     */
    const MERGE = 2;
    /**
     * Create new entity types with new display names to differentiate them from
     * the existing entity types when display name conflicts exist.
     *
     * Generated from protobuf enum <code>RENAME = 3;</code>
     */
    const RENAME = 3;
    /**
     * Report conflict information if display names conflict is detected.
     * Otherwise, import entity types.
     *
     * Generated from protobuf enum <code>REPORT_CONFLICT = 4;</code>
     */
    const REPORT_CONFLICT = 4;
    /**
     * Keep the original entity type and discard the conflicting new entity type
     * when display name conflicts exist.
     *
     * Generated from protobuf enum <code>KEEP = 5;</code>
     */
    const KEEP = 5;

    private static $valueToName = [
        self::MERGE_OPTION_UNSPECIFIED => 'MERGE_OPTION_UNSPECIFIED',
        self::REPLACE => 'REPLACE',
        self::MERGE => 'MERGE',
        self::RENAME => 'RENAME',
        self::REPORT_CONFLICT => 'REPORT_CONFLICT',
        self::KEEP => 'KEEP',
    ];

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

