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

namespace Google\Cloud\NetApp\V1\Replication;

use UnexpectedValueException;

/**
 * New enum values may be added in future to support different replication
 * topology.
 *
 * Protobuf type <code>google.cloud.netapp.v1.Replication.ReplicationRole</code>
 */
class ReplicationRole
{
    /**
     * Unspecified replication role
     *
     * Generated from protobuf enum <code>REPLICATION_ROLE_UNSPECIFIED = 0;</code>
     */
    const REPLICATION_ROLE_UNSPECIFIED = 0;
    /**
     * Indicates Source volume.
     *
     * Generated from protobuf enum <code>SOURCE = 1;</code>
     */
    const SOURCE = 1;
    /**
     * Indicates Destination volume.
     *
     * Generated from protobuf enum <code>DESTINATION = 2;</code>
     */
    const DESTINATION = 2;

    private static $valueToName = [
        self::REPLICATION_ROLE_UNSPECIFIED => 'REPLICATION_ROLE_UNSPECIFIED',
        self::SOURCE => 'SOURCE',
        self::DESTINATION => 'DESTINATION',
    ];

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


