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.JsonProperty; 019import com.vonage.client.Jsonable; 020 021/** 022 * Represents details of a stream, as returned from {@link VideoClient#getStream(String, String)}. 023 */ 024public class GetStreamResponse extends SessionStream { 025 private VideoType videoType; 026 private String name; 027 028 protected GetStreamResponse() { 029 } 030 031 /** 032 * @return The video source for the stream. 033 */ 034 @JsonProperty("videoType") 035 public VideoType getVideoType() { 036 return videoType; 037 } 038 039 /** 040 * @return The name of the stream (if one was set when the client published the stream). 041 */ 042 @JsonProperty("name") 043 public String getName() { 044 return name; 045 } 046 047 /** 048 * Creates an instance of this class from a JSON payload. 049 * 050 * @param json The JSON string to parse. 051 * @return An instance of this class with the fields populated, if present. 052 */ 053 public static GetStreamResponse fromJson(String json) { 054 return Jsonable.fromJson(json); 055 } 056}