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

namespace Google\Cloud\Filestore\V1\Replication;

use UnexpectedValueException;

/**
 * Replication role.
 *
 * Protobuf type <code>google.cloud.filestore.v1.Replication.Role</code>
 */
class Role
{
    /**
     * Role not set.
     *
     * Generated from protobuf enum <code>ROLE_UNSPECIFIED = 0;</code>
     */
    const ROLE_UNSPECIFIED = 0;
    /**
     * The instance is the `ACTIVE` replication member, functions as
     * the replication source instance.
     *
     * Generated from protobuf enum <code>ACTIVE = 1;</code>
     */
    const ACTIVE = 1;
    /**
     * The instance is the `STANDBY` replication member, functions as
     * the replication destination instance.
     *
     * Generated from protobuf enum <code>STANDBY = 2;</code>
     */
    const STANDBY = 2;

    private static $valueToName = [
        self::ROLE_UNSPECIFIED => 'ROLE_UNSPECIFIED',
        self::ACTIVE => 'ACTIVE',
        self::STANDBY => 'STANDBY',
    ];

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


