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

namespace Google\Cloud\Dataplex\V1\MetadataJob\ImportJobSpec;

use UnexpectedValueException;

/**
 * Specifies how the entries and aspects in a metadata import job are
 * updated. For more information, see [Sync
 * mode](https://cloud.google.com/dataplex/docs/import-metadata#sync-mode).
 *
 * Protobuf type <code>google.cloud.dataplex.v1.MetadataJob.ImportJobSpec.SyncMode</code>
 */
class SyncMode
{
    /**
     * Sync mode unspecified.
     *
     * Generated from protobuf enum <code>SYNC_MODE_UNSPECIFIED = 0;</code>
     */
    const SYNC_MODE_UNSPECIFIED = 0;
    /**
     * All resources in the job's scope are modified. If a resource exists in
     * Dataplex but isn't included in the metadata import file, the resource
     * is deleted when you run the metadata job. Use this mode to perform a
     * full sync of the set of entries in the job scope.
     * This sync mode is supported for entries.
     *
     * Generated from protobuf enum <code>FULL = 1;</code>
     */
    const FULL = 1;
    /**
     * Only the resources that are explicitly included in the
     * metadata import file are modified. Use this mode to modify a subset of
     * resources while leaving unreferenced resources unchanged.
     * This sync mode is supported for aspects.
     *
     * Generated from protobuf enum <code>INCREMENTAL = 2;</code>
     */
    const INCREMENTAL = 2;
    /**
     * If entry sync mode is `NONE`, then aspects are modified according
     * to the aspect sync mode. Other metadata that belongs to entries in the
     * job's scope isn't modified.
     * This sync mode is supported for entries.
     *
     * Generated from protobuf enum <code>NONE = 3;</code>
     */
    const NONE = 3;

    private static $valueToName = [
        self::SYNC_MODE_UNSPECIFIED => 'SYNC_MODE_UNSPECIFIED',
        self::FULL => 'FULL',
        self::INCREMENTAL => 'INCREMENTAL',
        self::NONE => 'NONE',
    ];

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


