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

namespace Google\Cloud\OracleDatabase\V1\CloudVmClusterProperties;

use UnexpectedValueException;

/**
 * Types of disk redundancy provided by Oracle.
 *
 * Protobuf type <code>google.cloud.oracledatabase.v1.CloudVmClusterProperties.DiskRedundancy</code>
 */
class DiskRedundancy
{
    /**
     * Unspecified.
     *
     * Generated from protobuf enum <code>DISK_REDUNDANCY_UNSPECIFIED = 0;</code>
     */
    const DISK_REDUNDANCY_UNSPECIFIED = 0;
    /**
     * High -  3 way mirror.
     *
     * Generated from protobuf enum <code>HIGH = 1;</code>
     */
    const HIGH = 1;
    /**
     * Normal - 2 way mirror.
     *
     * Generated from protobuf enum <code>NORMAL = 2;</code>
     */
    const NORMAL = 2;

    private static $valueToName = [
        self::DISK_REDUNDANCY_UNSPECIFIED => 'DISK_REDUNDANCY_UNSPECIFIED',
        self::HIGH => 'HIGH',
        self::NORMAL => 'NORMAL',
    ];

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


