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.voice;
017
018import com.fasterxml.jackson.annotation.JsonIgnore;
019import com.fasterxml.jackson.annotation.JsonProperty;
020import com.fasterxml.jackson.annotation.JsonSubTypes;
021import com.fasterxml.jackson.annotation.JsonTypeInfo;
022
023@JsonTypeInfo(
024        use = JsonTypeInfo.Id.NAME,
025        include = JsonTypeInfo.As.EXISTING_PROPERTY,
026        property = "type"
027)
028@JsonSubTypes({
029        @JsonSubTypes.Type(value = PhoneEndpoint.class, name = "phone"),
030        @JsonSubTypes.Type(value = SipEndpoint.class, name = "sip"),
031        @JsonSubTypes.Type(value = WebSocketEndpoint.class, name = "websocket"),
032        @JsonSubTypes.Type(value = VbcEndpoint.class, name = "vbc"),
033        @JsonSubTypes.Type(value = AppEndpoint.class, name = "app")
034})
035public interface Endpoint {
036
037    /**
038     * Endpoint type name.
039     *
040     * @return The type of endpoint as a string.
041     */
042    @JsonProperty("type")
043    String getType();
044
045    /**
046     * Description of the endpoint.
047     *
048     * @return String representation of the object.
049     * @deprecated This method will be removed in the next major release.
050     */
051    @JsonIgnore
052    @Deprecated
053    String toLog();
054}