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.meetings;
017
018import com.fasterxml.jackson.annotation.JsonCreator;
019import com.fasterxml.jackson.annotation.JsonValue;
020
021/**
022 * Represents the language in {@link UISettings}. Default is English.
023 */
024public enum RoomLanguage {
025        /**
026         * English
027         */
028        EN,
029
030        /**
031         * Hebrew
032         */
033        HE,
034
035        /**
036         * Spanish
037         */
038        ES,
039
040        /**
041         * Brazilian Portuguese
042         *
043         * @since 7.10.0
044         */
045        PT_BR,
046
047        /**
048         * Italian
049         */
050        IT,
051
052        /**
053         * Catalan
054         */
055        CA,
056
057        /**
058         * French
059         */
060        FR,
061
062        /**
063         * German
064         */
065        DE,
066
067        /**
068         * Arabic
069         *
070         * @since 7.10.0
071         */
072        AR,
073
074        /**
075         * Chinese (Taiwan)
076         *
077         * @since 7.10.0
078         */
079        ZH_TW,
080
081        /**
082         * Chinese (Mainland)
083         *
084         * @since 7.10.0
085         */
086        ZH_CN;
087
088        @JsonCreator
089        public static RoomLanguage fromString(String value) {
090                try {
091                        return valueOf(value.toUpperCase().replace('-', '_'));
092                }
093                catch (NullPointerException | IllegalArgumentException ex) {
094                        return null;
095                }
096        }
097
098        @JsonValue
099        @Override
100        public String toString() {
101                return name().replace('_', '-');
102        }       
103}