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

namespace Google\Cloud\CloudDms\V1;

use UnexpectedValueException;

/**
 * The types of jobs that can be executed in the background.
 *
 * Protobuf type <code>google.cloud.clouddms.v1.BackgroundJobType</code>
 */
class BackgroundJobType
{
    /**
     * Unspecified background job type.
     *
     * Generated from protobuf enum <code>BACKGROUND_JOB_TYPE_UNSPECIFIED = 0;</code>
     */
    const BACKGROUND_JOB_TYPE_UNSPECIFIED = 0;
    /**
     * Job to seed from the source database.
     *
     * Generated from protobuf enum <code>BACKGROUND_JOB_TYPE_SOURCE_SEED = 1;</code>
     */
    const BACKGROUND_JOB_TYPE_SOURCE_SEED = 1;
    /**
     * Job to convert the source database into a draft of the destination
     * database.
     *
     * Generated from protobuf enum <code>BACKGROUND_JOB_TYPE_CONVERT = 2;</code>
     */
    const BACKGROUND_JOB_TYPE_CONVERT = 2;
    /**
     * Job to apply the draft tree onto the destination.
     *
     * Generated from protobuf enum <code>BACKGROUND_JOB_TYPE_APPLY_DESTINATION = 3;</code>
     */
    const BACKGROUND_JOB_TYPE_APPLY_DESTINATION = 3;
    /**
     * Job to import and convert mapping rules from an external source such as an
     * ora2pg config file.
     *
     * Generated from protobuf enum <code>BACKGROUND_JOB_TYPE_IMPORT_RULES_FILE = 5;</code>
     */
    const BACKGROUND_JOB_TYPE_IMPORT_RULES_FILE = 5;

    private static $valueToName = [
        self::BACKGROUND_JOB_TYPE_UNSPECIFIED => 'BACKGROUND_JOB_TYPE_UNSPECIFIED',
        self::BACKGROUND_JOB_TYPE_SOURCE_SEED => 'BACKGROUND_JOB_TYPE_SOURCE_SEED',
        self::BACKGROUND_JOB_TYPE_CONVERT => 'BACKGROUND_JOB_TYPE_CONVERT',
        self::BACKGROUND_JOB_TYPE_APPLY_DESTINATION => 'BACKGROUND_JOB_TYPE_APPLY_DESTINATION',
        self::BACKGROUND_JOB_TYPE_IMPORT_RULES_FILE => 'BACKGROUND_JOB_TYPE_IMPORT_RULES_FILE',
    ];

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

