<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/privacy/dlp/v2/dlp.proto

namespace Google\Cloud\Dlp\V2\TransformationSummary;

use UnexpectedValueException;

/**
 * Possible outcomes of transformations.
 *
 * Protobuf type <code>google.privacy.dlp.v2.TransformationSummary.TransformationResultCode</code>
 */
class TransformationResultCode
{
    /**
     * Unused
     *
     * Generated from protobuf enum <code>TRANSFORMATION_RESULT_CODE_UNSPECIFIED = 0;</code>
     */
    const TRANSFORMATION_RESULT_CODE_UNSPECIFIED = 0;
    /**
     * Transformation completed without an error.
     *
     * Generated from protobuf enum <code>SUCCESS = 1;</code>
     */
    const SUCCESS = 1;
    /**
     * Transformation had an error.
     *
     * Generated from protobuf enum <code>ERROR = 2;</code>
     */
    const ERROR = 2;

    private static $valueToName = [
        self::TRANSFORMATION_RESULT_CODE_UNSPECIFIED => 'TRANSFORMATION_RESULT_CODE_UNSPECIFIED',
        self::SUCCESS => 'SUCCESS',
        self::ERROR => 'ERROR',
    ];

    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(TransformationResultCode::class, \Google\Cloud\Dlp\V2\TransformationSummary_TransformationResultCode::class);

