001/* 002 * Copyright 2024 Vonage 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package com.vonage.client.video; 017 018import com.fasterxml.jackson.annotation.JsonValue; 019 020/** 021 * Defines values for the role parameter of the {@link TokenOptions.Builder#role(Role role)} method. 022 */ 023public enum Role { 024 025 /** 026 * A subscriber can only subscribe to streams. 027 */ 028 SUBSCRIBER, 029 030 /** 031 * A publisher can publish streams, subscribe to streams, and signal. This is the default value 032 * if you do not set a role by calling the {@link TokenOptions.Builder#role(Role role)} method. 033 */ 034 PUBLISHER, 035 036 /** 037 * In addition to the privileges granted to a publisher, a moderator can perform moderation functions, such as 038 * forcing clients to disconnect, to stop publishing streams, or to mute audio in published streams. See the 039 * <a href="https://tokbox.com/developer/guides/moderation/">Moderation developer guide</a>. 040 */ 041 MODERATOR, 042 043 /** 044 * A publisher-only role can publish streams, but not signal. 045 * 046 * @since 8.5.0 047 */ 048 PUBLISHER_ONLY; 049 050 @JsonValue 051 @Override 052 public String toString() { 053 return name().toLowerCase().replace("_", ""); 054 } 055}