Skip to main content

nominal_api/conjure/objects/scout/video/api/
generate_whip_stream_response.rs

1/// Response with WHIP URL and ICE servers for publishing
2#[derive(
3    Debug,
4    Clone,
5    conjure_object::serde::Serialize,
6    conjure_object::serde::Deserialize,
7    PartialEq,
8    Eq,
9    PartialOrd,
10    Ord,
11    Hash
12)]
13#[serde(crate = "conjure_object::serde")]
14#[conjure_object::private::staged_builder::staged_builder]
15#[builder(crate = conjure_object::private::staged_builder, update, inline)]
16pub struct GenerateWhipStreamResponse {
17    #[builder(into)]
18    #[serde(rename = "streamId")]
19    stream_id: String,
20    #[builder(into)]
21    #[serde(rename = "whipUrl")]
22    whip_url: String,
23    #[builder(default, list(item(type = super::IceServer)))]
24    #[serde(rename = "iceServers", skip_serializing_if = "Vec::is_empty", default)]
25    ice_servers: Vec<super::IceServer>,
26}
27impl GenerateWhipStreamResponse {
28    /// Constructs a new instance of the type.
29    #[inline]
30    pub fn new(stream_id: impl Into<String>, whip_url: impl Into<String>) -> Self {
31        Self::builder().stream_id(stream_id).whip_url(whip_url).build()
32    }
33    #[inline]
34    pub fn stream_id(&self) -> &str {
35        &*self.stream_id
36    }
37    #[inline]
38    pub fn whip_url(&self) -> &str {
39        &*self.whip_url
40    }
41    #[inline]
42    pub fn ice_servers(&self) -> &[super::IceServer] {
43        &*self.ice_servers
44    }
45}