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.JsonProperty; 019import com.vonage.client.JsonableBaseObject; 020import java.util.Map; 021 022public class WebSocketEndpoint extends JsonableBaseObject implements Endpoint { 023 private String uri, contentType; 024 @JsonProperty("headers") private Map<String, Object> headers; 025 026 protected WebSocketEndpoint() { 027 } 028 029 public WebSocketEndpoint(String uri, String contentType, Map<String, Object> headers) { 030 this.uri = uri; 031 this.contentType = contentType; 032 this.headers = headers; 033 } 034 035 @Override 036 public String getType() { 037 return EndpointType.WEBSOCKET.toString(); 038 } 039 040 @Override 041 public String toLog() { 042 return "uri=" + uri + " content-type=" + contentType; 043 } 044 045 /** 046 * The URI to the websocket you are streaming to. 047 * 048 * @return The URI as a string. 049 */ 050 @JsonProperty("uri") 051 public String getUri() { 052 return uri; 053 } 054 055 /** 056 * 057 * @return The content type. 058 */ 059 @JsonProperty("content-type") 060 public String getContentType() { 061 return contentType; 062 } 063 064 @JsonProperty("headers") 065 public Map<String, ?> getHeadersMap() { 066 return headers; 067 } 068}