use url::Url;
use crate::utils::ExampleData;
#[derive(Debug, Clone, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(
feature = "utoipa",
derive(utoipa::ToSchema),
schema(example = json!(StreamingLink::example_data()))
)]
#[cfg_attr(feature = "typescript", derive(ts_rs::TS), ts(export_to = "common/"))]
pub struct StreamingLink {
pub name: String,
pub url: Url,
}
impl ExampleData for StreamingLink {
fn example_data() -> Self {
Self {
name: "My OwnCast Stream".to_string(),
url: "https://owncast.example.com/mystream".parse().unwrap(),
}
}
}