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.incoming;
017
018import com.fasterxml.jackson.annotation.JsonIgnore;
019import com.fasterxml.jackson.annotation.JsonProperty;
020import com.vonage.client.Jsonable;
021import java.util.Date;
022
023/**
024 * @deprecated Use {@link com.vonage.client.voice.EventWebhook}.
025 */
026@Deprecated
027public class CallEvent implements Jsonable {
028    private String conversationUuid, callUuid, from, to, uuid, detail;
029    private CallDirection direction;
030    private CallStatus status;
031    private Date timestamp;
032    private CallStatusDetail detailEnum;
033
034    @JsonProperty("conversation_uuid")
035    public String getConversationUuid() {
036        return conversationUuid;
037    }
038
039    @JsonProperty("call_uuid")
040    public String getCallUuid() {
041        return callUuid;
042    }
043
044    @JsonProperty("direction")
045    public CallDirection getDirection() {
046        return direction;
047    }
048
049    @JsonProperty("from")
050    public String getFrom() {
051        return from;
052    }
053
054    @JsonProperty("status")
055    public CallStatus getStatus() {
056        return status;
057    }
058
059    @JsonProperty("timestamp")
060    public Date getTimestamp() {
061        return timestamp;
062    }
063
064    @JsonProperty("to")
065    public String getTo() {
066        return to;
067    }
068
069    @JsonProperty("uuid")
070    public String getUuid() {
071        return uuid;
072    }
073
074    @JsonProperty("detail")
075    public String getDetail() {
076        return detail;
077    }
078
079    @JsonIgnore
080    public CallStatusDetail getDetailEnum() {
081        return CallStatusDetail.fromString(detail);
082    }
083
084    public static CallEvent fromJson(String json) {
085        return Jsonable.fromJson(json);
086    }
087}