diff --git a/.changeset/sdk_capabilities.md b/.changeset/sdk_capabilities.md new file mode 100644 index 000000000..356e23dcf --- /dev/null +++ b/.changeset/sdk_capabilities.md @@ -0,0 +1,6 @@ +--- +livekit-api: patch +livekit-uniffi: patch +--- + +Add advertising of SDK client capabilities - #1022 (@chenosaurus) diff --git a/livekit-api/src/access_token.rs b/livekit-api/src/access_token.rs index 06bd289e8..96eb0ace8 100644 --- a/livekit-api/src/access_token.rs +++ b/livekit-api/src/access_token.rs @@ -336,6 +336,7 @@ mod tests { agents: vec![livekit_protocol::RoomAgentDispatch { agent_name: "test-agent".to_string(), metadata: "test-metadata".to_string(), + ..Default::default() }], ..Default::default() }; diff --git a/livekit-api/src/signal_client/mod.rs b/livekit-api/src/signal_client/mod.rs index 47c7a8519..55be8bdad 100644 --- a/livekit-api/src/signal_client/mod.rs +++ b/livekit-api/src/signal_client/mod.rs @@ -54,6 +54,10 @@ const REGION_FETCH_TIMEOUT: Duration = Duration::from_secs(3); const VALIDATE_TIMEOUT: Duration = Duration::from_secs(3); pub const PROTOCOL_VERSION: u32 = 17; +/// Capabilities the Rust SDK advertises to the SFU at connect time. +const CLIENT_CAPABILITIES: &[proto::client_info::Capability] = + &[proto::client_info::Capability::CapPacketTrailer]; + #[derive(Error, Debug)] pub enum SignalError { #[error("ws failure: {0}")] @@ -580,6 +584,7 @@ fn create_join_request_param( os, os_version, device_model, + capabilities: CLIENT_CAPABILITIES.iter().map(|c| *c as i32).collect(), ..Default::default() }; @@ -683,6 +688,13 @@ fn get_livekit_url( lk_url.query_pairs_mut().append_pair("version", sdk_version.as_str()); } + // parse client capabilities + if !CLIENT_CAPABILITIES.is_empty() { + let caps = + CLIENT_CAPABILITIES.iter().map(|c| c.as_str_name()).collect::>().join(","); + lk_url.query_pairs_mut().append_pair("capabilities", &caps); + } + // For reconnects in v0 path, add reconnect and sid as separate query parameters if reconnect { lk_url @@ -802,6 +814,24 @@ mod tests { assert_eq!(validate_url.scheme(), "https"); } + #[test] + fn livekit_url_includes_client_capabilities() { + let io = SignalOptions::default(); + let lk_url = get_livekit_url("wss://localhost:7880", &io, false, false, None, "").unwrap(); + + let capabilities = lk_url + .query_pairs() + .find_map(|(key, value)| (key == "capabilities").then(|| value.into_owned())) + .unwrap(); + let expected = CLIENT_CAPABILITIES + .iter() + .map(|capability| capability.as_str_name()) + .collect::>() + .join(","); + + assert_eq!(capabilities, expected); + } + /// Regression test for https://github.com/livekit/rust-sdks/issues/1042. /// /// Prior to the fix, `SignalInner::validate` issued an auth-less GET to diff --git a/livekit-protocol/protocol b/livekit-protocol/protocol index c5536cb98..a4ac2627b 160000 --- a/livekit-protocol/protocol +++ b/livekit-protocol/protocol @@ -1 +1 @@ -Subproject commit c5536cb98c1f32d7fd2dae384478d79fb2df5978 +Subproject commit a4ac2627b46a7d515005db589a4eda3100dc1b8a diff --git a/livekit-protocol/src/livekit.rs b/livekit-protocol/src/livekit.rs index 29f52480c..fa4885396 100644 --- a/livekit-protocol/src/livekit.rs +++ b/livekit-protocol/src/livekit.rs @@ -90,6 +90,10 @@ pub struct MetricsRecordingHeader { pub start_time: ::core::option::Option<::pbjson_types::Timestamp>, #[prost(map="string, string", tag="5")] pub room_tags: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, + #[prost(string, tag="6")] + pub room_name: ::prost::alloc::string::String, + #[prost(message, optional, tag="7")] + pub room_start_time: ::core::option::Option<::pbjson_types::Timestamp>, } // // Protocol used to record metrics for a specific session. @@ -1080,6 +1084,10 @@ pub struct ClientInfo { /// client protocol version #[prost(int32, tag="12")] pub client_protocol: i32, + /// capabilities the client advertises. Populated automatically by each SDK; + /// not a user-configurable setting. + #[prost(enumeration="client_info::Capability", repeated, tag="13")] + pub capabilities: ::prost::alloc::vec::Vec, } /// Nested message and enum types in `ClientInfo`. pub mod client_info { @@ -1148,6 +1156,36 @@ pub mod client_info { } } } + /// Optional capabilities advertised by the client at connect time. The SFU + /// uses these flags to decide whether to enable features that require + /// client-side support (e.g. passing RTP packet trailers through to the + /// subscriber instead of stripping them). + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + pub enum Capability { + CapUnused = 0, + CapPacketTrailer = 1, + } + impl Capability { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Capability::CapUnused => "CAP_UNUSED", + Capability::CapPacketTrailer => "CAP_PACKET_TRAILER", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "CAP_UNUSED" => Some(Self::CapUnused), + "CAP_PACKET_TRAILER" => Some(Self::CapPacketTrailer), + _ => None, + } + } + } } /// server provided client configuration #[allow(clippy::derive_partial_eq_without_eq)] @@ -2080,274 +2118,266 @@ impl PacketTrailerFeature { } } } -/// composite using a web browser +// --- Core Request --- + #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct RoomCompositeEgressRequest { - /// required +pub struct StartEgressRequest { #[prost(string, tag="1")] pub room_name: ::prost::alloc::string::String, - /// (optional) - #[prost(string, tag="2")] - pub layout: ::prost::alloc::string::String, - /// (default false) - #[prost(bool, tag="3")] - pub audio_only: bool, - /// only applies to audio_only egress (default DEFAULT_MIXING) - #[prost(enumeration="AudioMixing", tag="15")] - pub audio_mixing: i32, - /// (default false) - #[prost(bool, tag="4")] - pub video_only: bool, - /// template base url (default ) - #[prost(string, tag="5")] - pub custom_base_url: ::prost::alloc::string::String, - #[prost(message, repeated, tag="11")] - pub file_outputs: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="12")] - pub stream_outputs: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="13")] - pub segment_outputs: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="14")] - pub image_outputs: ::prost::alloc::vec::Vec, - /// extra webhooks to call for this request - #[prost(message, repeated, tag="16")] + /// At least one required + #[prost(message, repeated, tag="7")] + pub outputs: ::prost::alloc::vec::Vec, + /// Request-level storage default + #[prost(message, optional, tag="8")] + pub storage: ::core::option::Option, + /// Optional additional webhook config + #[prost(message, repeated, tag="9")] pub webhooks: ::prost::alloc::vec::Vec, - /// deprecated (use _output fields) - #[prost(oneof="room_composite_egress_request::Output", tags="6, 7, 10")] - pub output: ::core::option::Option, - #[prost(oneof="room_composite_egress_request::Options", tags="8, 9")] - pub options: ::core::option::Option, -} -/// Nested message and enum types in `RoomCompositeEgressRequest`. -pub mod room_composite_egress_request { - /// deprecated (use _output fields) + #[prost(oneof="start_egress_request::Source", tags="2, 3, 4")] + pub source: ::core::option::Option, + /// Optional — default H264_720P_30 + #[prost(oneof="start_egress_request::Encoding", tags="5, 6")] + pub encoding: ::core::option::Option, +} +/// Nested message and enum types in `StartEgressRequest`. +pub mod start_egress_request { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Output { - #[prost(message, tag="6")] - File(super::EncodedFileOutput), - #[prost(message, tag="7")] - Stream(super::StreamOutput), - #[prost(message, tag="10")] - Segments(super::SegmentedFileOutput), + pub enum Source { + #[prost(message, tag="2")] + Template(super::TemplateSource), + #[prost(message, tag="3")] + Web(super::WebSource), + #[prost(message, tag="4")] + Media(super::MediaSource), } + /// Optional — default H264_720P_30 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Options { - /// (default H264_720P_30) - #[prost(enumeration="super::EncodingOptionsPreset", tag="8")] + pub enum Encoding { + #[prost(enumeration="super::EncodingOptionsPreset", tag="5")] Preset(i32), - /// (optional) - #[prost(message, tag="9")] + #[prost(message, tag="6")] Advanced(super::EncodingOptions), } } -/// record any website +// --- Source Types --- + +/// Room composite recording via layout template. +/// Service generates token, constructs recorder URL, awaits start signal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct WebEgressRequest { +pub struct TemplateSource { + #[prost(string, tag="1")] + pub layout: ::prost::alloc::string::String, + #[prost(bool, tag="2")] + pub audio_only: bool, + #[prost(bool, tag="3")] + pub video_only: bool, + #[prost(string, tag="4")] + pub custom_base_url: ::prost::alloc::string::String, +} +/// Record a custom URL via headless browser. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct WebSource { #[prost(string, tag="1")] pub url: ::prost::alloc::string::String, #[prost(bool, tag="2")] pub audio_only: bool, #[prost(bool, tag="3")] pub video_only: bool, - #[prost(bool, tag="12")] + #[prost(bool, tag="4")] pub await_start_signal: bool, - #[prost(message, repeated, tag="9")] - pub file_outputs: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="10")] - pub stream_outputs: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="11")] - pub segment_outputs: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="13")] - pub image_outputs: ::prost::alloc::vec::Vec, - /// extra webhooks to call for this request - #[prost(message, repeated, tag="14")] - pub webhooks: ::prost::alloc::vec::Vec, - /// deprecated (use _output fields) - #[prost(oneof="web_egress_request::Output", tags="4, 5, 6")] - pub output: ::core::option::Option, - #[prost(oneof="web_egress_request::Options", tags="7, 8")] - pub options: ::core::option::Option, } -/// Nested message and enum types in `WebEgressRequest`. -pub mod web_egress_request { - /// deprecated (use _output fields) - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Output { - #[prost(message, tag="4")] - File(super::EncodedFileOutput), - #[prost(message, tag="5")] - Stream(super::StreamOutput), - #[prost(message, tag="6")] - Segments(super::SegmentedFileOutput), - } +/// Capture tracks directly from a room via SDK. +/// Unifies deprecated Participant, TrackComposite, and Track egress. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MediaSource { + #[prost(message, optional, tag="3")] + pub audio: ::core::option::Option, + #[prost(message, optional, tag="4")] + pub data: ::core::option::Option, + #[prost(oneof="media_source::Video", tags="1, 2")] + pub video: ::core::option::Option, +} +/// Nested message and enum types in `MediaSource`. +pub mod media_source { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Options { - #[prost(enumeration="super::EncodingOptionsPreset", tag="7")] - Preset(i32), - #[prost(message, tag="8")] - Advanced(super::EncodingOptions), + pub enum Video { + #[prost(string, tag="1")] + VideoTrackId(::prost::alloc::string::String), + #[prost(message, tag="2")] + ParticipantVideo(super::ParticipantVideo), } } -/// record audio and video from a single participant #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ParticipantEgressRequest { - /// required +pub struct ParticipantVideo { #[prost(string, tag="1")] - pub room_name: ::prost::alloc::string::String, - /// required - #[prost(string, tag="2")] pub identity: ::prost::alloc::string::String, - /// (default false) - #[prost(bool, tag="3")] - pub screen_share: bool, - #[prost(message, repeated, tag="6")] - pub file_outputs: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="7")] - pub stream_outputs: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="8")] - pub segment_outputs: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="9")] - pub image_outputs: ::prost::alloc::vec::Vec, - /// extra webhooks to call for this request - #[prost(message, repeated, tag="10")] - pub webhooks: ::prost::alloc::vec::Vec, - #[prost(oneof="participant_egress_request::Options", tags="4, 5")] - pub options: ::core::option::Option, + #[prost(bool, tag="2")] + pub prefer_screen_share: bool, } -/// Nested message and enum types in `ParticipantEgressRequest`. -pub mod participant_egress_request { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Options { - /// (default H264_720P_30) - #[prost(enumeration="super::EncodingOptionsPreset", tag="4")] - Preset(i32), - /// (optional) - #[prost(message, tag="5")] - Advanced(super::EncodingOptions), - } +// --- Audio Configuration --- + +/// Unified audio selection and channel routing. +/// Each route specifies both which audio to capture and which channel to output to. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AudioConfig { + /// If empty, all audio captured in both channels. + /// If non-empty, only matching audio is captured and routed. Unmatched is excluded. + #[prost(message, repeated, tag="1")] + pub routes: ::prost::alloc::vec::Vec, } -/// containerize up to one audio and one video track #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct TrackCompositeEgressRequest { - /// required - #[prost(string, tag="1")] - pub room_name: ::prost::alloc::string::String, - /// (optional) - #[prost(string, tag="2")] - pub audio_track_id: ::prost::alloc::string::String, - /// (optional) - #[prost(string, tag="3")] - pub video_track_id: ::prost::alloc::string::String, - #[prost(message, repeated, tag="11")] - pub file_outputs: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="12")] - pub stream_outputs: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="13")] - pub segment_outputs: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="14")] - pub image_outputs: ::prost::alloc::vec::Vec, - /// extra webhooks to call for this request - #[prost(message, repeated, tag="15")] - pub webhooks: ::prost::alloc::vec::Vec, - /// deprecated (use _output fields) - #[prost(oneof="track_composite_egress_request::Output", tags="4, 5, 8")] - pub output: ::core::option::Option, - #[prost(oneof="track_composite_egress_request::Options", tags="6, 7")] - pub options: ::core::option::Option, +pub struct AudioRoute { + #[prost(enumeration="AudioChannel", tag="4")] + pub channel: i32, + #[prost(oneof="audio_route::Match", tags="1, 2, 3")] + pub r#match: ::core::option::Option, } -/// Nested message and enum types in `TrackCompositeEgressRequest`. -pub mod track_composite_egress_request { - /// deprecated (use _output fields) - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Output { - #[prost(message, tag="4")] - File(super::EncodedFileOutput), - #[prost(message, tag="5")] - Stream(super::StreamOutput), - #[prost(message, tag="8")] - Segments(super::SegmentedFileOutput), - } +/// Nested message and enum types in `AudioRoute`. +pub mod audio_route { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Options { - /// (default H264_720P_30) - #[prost(enumeration="super::EncodingOptionsPreset", tag="6")] - Preset(i32), - /// (optional) - #[prost(message, tag="7")] - Advanced(super::EncodingOptions), + pub enum Match { + #[prost(string, tag="1")] + TrackId(::prost::alloc::string::String), + #[prost(string, tag="2")] + ParticipantIdentity(::prost::alloc::string::String), + #[prost(enumeration="super::participant_info::Kind", tag="3")] + ParticipantKind(i32), } } -/// record tracks individually, without transcoding +// --- Data Track Configuration --- + #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct TrackEgressRequest { - /// required - #[prost(string, tag="1")] - pub room_name: ::prost::alloc::string::String, - /// required - #[prost(string, tag="2")] - pub track_id: ::prost::alloc::string::String, - /// extra webhooks to call for this request - #[prost(message, repeated, tag="5")] - pub webhooks: ::prost::alloc::vec::Vec, - /// required - #[prost(oneof="track_egress_request::Output", tags="3, 4")] - pub output: ::core::option::Option, -} -/// Nested message and enum types in `TrackEgressRequest`. -pub mod track_egress_request { - /// required - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Output { - #[prost(message, tag="3")] - File(super::DirectFileOutput), - #[prost(string, tag="4")] - WebsocketUrl(::prost::alloc::string::String), - } +pub struct DataConfig { + /// If empty, all data tracks captured. + /// If non-empty, only matching data tracks are captured. + #[prost(message, repeated, tag="1")] + pub selectors: ::prost::alloc::vec::Vec, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct EncodedFileOutput { - /// (optional) - #[prost(enumeration="EncodedFileType", tag="1")] - pub file_type: i32, - /// see egress docs for templating (default {room_name}-{time}) - #[prost(string, tag="2")] - pub filepath: ::prost::alloc::string::String, - /// disable upload of manifest file (default false) - #[prost(bool, tag="6")] - pub disable_manifest: bool, - #[prost(oneof="encoded_file_output::Output", tags="3, 4, 5, 7")] - pub output: ::core::option::Option, +pub struct DataSelector { + #[prost(oneof="data_selector::Match", tags="1, 2, 3")] + pub r#match: ::core::option::Option, } -/// Nested message and enum types in `EncodedFileOutput`. -pub mod encoded_file_output { +/// Nested message and enum types in `DataSelector`. +pub mod data_selector { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Output { - #[prost(message, tag="3")] - S3(super::S3Upload), - #[prost(message, tag="4")] - Gcp(super::GcpUpload), - #[prost(message, tag="5")] - Azure(super::AzureBlobUpload), - #[prost(message, tag="7")] - AliOss(super::AliOssUpload), + pub enum Match { + #[prost(string, tag="1")] + TrackId(::prost::alloc::string::String), + #[prost(string, tag="2")] + ParticipantIdentity(::prost::alloc::string::String), + #[prost(string, tag="3")] + Topic(::prost::alloc::string::String), } } -/// Used to generate HLS segments or other kind of segmented output +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EncodingOptions { + /// (default 1920) + #[prost(int32, tag="1")] + pub width: i32, + /// (default 1080) + #[prost(int32, tag="2")] + pub height: i32, + /// (default 24) + #[prost(int32, tag="3")] + pub depth: i32, + /// (default 30) + #[prost(int32, tag="4")] + pub framerate: i32, + /// (default OPUS) + #[prost(enumeration="AudioCodec", tag="5")] + pub audio_codec: i32, + /// (default 128) + #[prost(int32, tag="6")] + pub audio_bitrate: i32, + /// (default 44100) + #[prost(int32, tag="7")] + pub audio_frequency: i32, + /// (default H264_MAIN) + #[prost(enumeration="VideoCodec", tag="8")] + pub video_codec: i32, + /// (default 4500) + #[prost(int32, tag="9")] + pub video_bitrate: i32, + /// in seconds (default 4s for streaming, segment duration for segmented output, encoder default for files) + #[prost(double, tag="10")] + pub key_frame_interval: f64, + /// --- Deprecated --- + /// + /// quality setting on audio encoder + #[deprecated] + #[prost(int32, tag="11")] + pub audio_quality: i32, + /// quality setting on video encoder + #[deprecated] + #[prost(int32, tag="12")] + pub video_quality: i32, +} +// --- Output Types --- + +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Output { + /// Per-output storage override (falls back to request, then server) + #[prost(message, optional, tag="6")] + pub storage: ::core::option::Option, + #[prost(oneof="output::Config", tags="1, 2, 3, 4")] + pub config: ::core::option::Option, +} +/// Nested message and enum types in `Output`. +pub mod output { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Config { + #[prost(message, tag="1")] + File(super::FileOutput), + #[prost(message, tag="2")] + Stream(super::StreamOutput), + #[prost(message, tag="3")] + Segments(super::SegmentedFileOutput), + /// 5 reserved for mcap; + #[prost(message, tag="4")] + Images(super::ImageOutput), + } +} +/// Unified file output — replaces v1 EncodedFileOutput and DirectFileOutput. +/// Whether transcoded depends on encoding options on the request. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FileOutput { + #[prost(enumeration="EncodedFileType", tag="1")] + pub file_type: i32, + #[prost(string, tag="2")] + pub filepath: ::prost::alloc::string::String, + #[prost(bool, tag="3")] + pub disable_manifest: bool, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct StreamOutput { + /// required + #[prost(enumeration="StreamProtocol", tag="1")] + pub protocol: i32, + /// required + #[prost(string, repeated, tag="2")] + pub urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// Used to generate HLS segments or other kind of segmented output #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SegmentedFileOutput { @@ -2372,13 +2402,11 @@ pub struct SegmentedFileOutput { /// disable upload of manifest file (default false) #[prost(bool, tag="8")] pub disable_manifest: bool, - /// required #[prost(oneof="segmented_file_output::Output", tags="5, 6, 7, 9")] pub output: ::core::option::Option, } /// Nested message and enum types in `SegmentedFileOutput`. pub mod segmented_file_output { - /// required #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Output { @@ -2392,33 +2420,7 @@ pub mod segmented_file_output { AliOss(super::AliOssUpload), } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DirectFileOutput { - /// see egress docs for templating (default {track_id}-{time}) - #[prost(string, tag="1")] - pub filepath: ::prost::alloc::string::String, - /// disable upload of manifest file (default false) - #[prost(bool, tag="5")] - pub disable_manifest: bool, - #[prost(oneof="direct_file_output::Output", tags="2, 3, 4, 6")] - pub output: ::core::option::Option, -} -/// Nested message and enum types in `DirectFileOutput`. -pub mod direct_file_output { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Output { - #[prost(message, tag="2")] - S3(super::S3Upload), - #[prost(message, tag="3")] - Gcp(super::GcpUpload), - #[prost(message, tag="4")] - Azure(super::AzureBlobUpload), - #[prost(message, tag="6")] - AliOss(super::AliOssUpload), - } -} +/// Capture images at a specified interval #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ImageOutput { @@ -2443,13 +2445,11 @@ pub struct ImageOutput { /// disable upload of manifest file (default false) #[prost(bool, tag="7")] pub disable_manifest: bool, - /// required #[prost(oneof="image_output::Output", tags="8, 9, 10, 11")] pub output: ::core::option::Option, } /// Nested message and enum types in `ImageOutput`. pub mod image_output { - /// required #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Output { @@ -2463,6 +2463,29 @@ pub mod image_output { AliOss(super::AliOssUpload), } } +// --- Storage --- + +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct StorageConfig { + #[prost(oneof="storage_config::Provider", tags="1, 2, 3, 4")] + pub provider: ::core::option::Option, +} +/// Nested message and enum types in `StorageConfig`. +pub mod storage_config { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Provider { + #[prost(message, tag="1")] + S3(super::S3Upload), + #[prost(message, tag="2")] + Gcp(super::GcpUpload), + #[prost(message, tag="3")] + Azure(super::AzureBlobUpload), + #[prost(message, tag="4")] + AliOss(super::AliOssUpload), + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct S3Upload { @@ -2541,74 +2564,8 @@ pub struct ProxyConfig { #[prost(string, tag="3")] pub password: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct StreamOutput { - /// required - #[prost(enumeration="StreamProtocol", tag="1")] - pub protocol: i32, - /// required - #[prost(string, repeated, tag="2")] - pub urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct EncodingOptions { - /// (default 1920) - #[prost(int32, tag="1")] - pub width: i32, - /// (default 1080) - #[prost(int32, tag="2")] - pub height: i32, - /// (default 24) - #[prost(int32, tag="3")] - pub depth: i32, - /// (default 30) - #[prost(int32, tag="4")] - pub framerate: i32, - /// (default OPUS) - #[prost(enumeration="AudioCodec", tag="5")] - pub audio_codec: i32, - /// (default 128) - #[prost(int32, tag="6")] - pub audio_bitrate: i32, - /// quality setting on audio encoder - #[prost(int32, tag="11")] - pub audio_quality: i32, - /// (default 44100) - #[prost(int32, tag="7")] - pub audio_frequency: i32, - /// (default H264_MAIN) - #[prost(enumeration="VideoCodec", tag="8")] - pub video_codec: i32, - /// (default 4500) - #[prost(int32, tag="9")] - pub video_bitrate: i32, - /// quality setting on video encoder - #[prost(int32, tag="12")] - pub video_quality: i32, - /// in seconds (default 4s for streaming, segment duration for segmented output, encoder default for files) - #[prost(double, tag="10")] - pub key_frame_interval: f64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateLayoutRequest { - #[prost(string, tag="1")] - pub egress_id: ::prost::alloc::string::String, - #[prost(string, tag="2")] - pub layout: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateStreamRequest { - #[prost(string, tag="1")] - pub egress_id: ::prost::alloc::string::String, - #[prost(string, repeated, tag="2")] - pub add_output_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(string, repeated, tag="3")] - pub remove_output_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} +// --- Control RPCs --- + #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListEgressRequest { @@ -2630,10 +2587,26 @@ pub struct ListEgressResponse { } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateEgressRequest { + #[prost(string, tag="1")] + pub egress_id: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub url: ::prost::alloc::string::String, + #[prost(string, tag="3")] + pub layout: ::prost::alloc::string::String, + #[prost(string, repeated, tag="4")] + pub add_stream_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(string, repeated, tag="5")] + pub remove_stream_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct StopEgressRequest { #[prost(string, tag="1")] pub egress_id: ::prost::alloc::string::String, } +// --- Egress Info --- + #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EgressInfo { @@ -2653,12 +2626,6 @@ pub struct EgressInfo { pub ended_at: i64, #[prost(int64, tag="18")] pub updated_at: i64, - #[prost(string, tag="21")] - pub details: ::prost::alloc::string::String, - #[prost(string, tag="9")] - pub error: ::prost::alloc::string::String, - #[prost(int32, tag="22")] - pub error_code: i32, #[prost(message, repeated, tag="15")] pub stream_results: ::prost::alloc::vec::Vec, #[prost(message, repeated, tag="16")] @@ -2667,16 +2634,23 @@ pub struct EgressInfo { pub segment_results: ::prost::alloc::vec::Vec, #[prost(message, repeated, tag="20")] pub image_results: ::prost::alloc::vec::Vec, + #[prost(string, tag="9")] + pub error: ::prost::alloc::string::String, + #[prost(int32, tag="22")] + pub error_code: i32, + #[prost(string, tag="21")] + pub details: ::prost::alloc::string::String, #[prost(string, tag="23")] pub manifest_location: ::prost::alloc::string::String, #[prost(bool, tag="25")] pub backup_storage_used: bool, - /// next ID: 28 #[prost(int32, tag="27")] pub retry_count: i32, - #[prost(oneof="egress_info::Request", tags="4, 14, 19, 5, 6")] + #[prost(oneof="egress_info::Request", tags="30, 4, 14, 19, 5, 6")] pub request: ::core::option::Option, - /// deprecated (use _result fields) + // next ID: 31 + + /// --- Deprecated --- #[prost(oneof="egress_info::Result", tags="7, 8, 12")] pub result: ::core::option::Option, } @@ -2685,6 +2659,9 @@ pub mod egress_info { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Request { + /// StartEgressRequest egress = 29; + #[prost(message, tag="30")] + Replay(super::ExportReplayRequest), #[prost(message, tag="4")] RoomComposite(super::RoomCompositeEgressRequest), #[prost(message, tag="14")] @@ -2696,7 +2673,9 @@ pub mod egress_info { #[prost(message, tag="6")] Track(super::TrackEgressRequest), } - /// deprecated (use _result fields) + // next ID: 31 + + /// --- Deprecated --- #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Result { @@ -2710,12 +2689,6 @@ pub mod egress_info { } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct StreamInfoList { - #[prost(message, repeated, tag="1")] - pub info: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] pub struct StreamInfo { #[prost(string, tag="1")] pub url: ::prost::alloc::string::String, @@ -2816,6 +2789,8 @@ pub struct ImagesInfo { #[prost(int64, tag="3")] pub ended_at: i64, } +// --- Auto Egress --- + #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AutoParticipantEgress { @@ -2839,31 +2814,434 @@ pub mod auto_participant_egress { Advanced(super::EncodingOptions), } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AutoTrackEgress { - /// see docs for templating (default {track_id}-{time}) - #[prost(string, tag="1")] - pub filepath: ::prost::alloc::string::String, - /// disables upload of json manifest file (default false) - #[prost(bool, tag="5")] - pub disable_manifest: bool, - #[prost(oneof="auto_track_egress::Output", tags="2, 3, 4, 6")] - pub output: ::core::option::Option, +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AutoTrackEgress { + /// see docs for templating (default {track_id}-{time}) + #[prost(string, tag="1")] + pub filepath: ::prost::alloc::string::String, + /// disables upload of json manifest file (default false) + #[prost(bool, tag="5")] + pub disable_manifest: bool, + #[prost(oneof="auto_track_egress::Output", tags="2, 3, 4, 6")] + pub output: ::core::option::Option, +} +/// Nested message and enum types in `AutoTrackEgress`. +pub mod auto_track_egress { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Output { + #[prost(message, tag="2")] + S3(super::S3Upload), + #[prost(message, tag="3")] + Gcp(super::GcpUpload), + #[prost(message, tag="4")] + Azure(super::AzureBlobUpload), + #[prost(message, tag="6")] + AliOss(super::AliOssUpload), + } +} +// --- Replay Export (message only — RPC defined in cloud_replay.proto) --- + +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ExportReplayRequest { + #[prost(string, tag="1")] + pub replay_id: ::prost::alloc::string::String, + #[prost(int64, tag="2")] + pub start_offset_ms: i64, + #[prost(int64, tag="3")] + pub end_offset_ms: i64, + #[prost(message, repeated, tag="9")] + pub outputs: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag="10")] + pub storage: ::core::option::Option, + #[prost(message, repeated, tag="11")] + pub webhooks: ::prost::alloc::vec::Vec, + #[prost(oneof="export_replay_request::Source", tags="4, 5, 6")] + pub source: ::core::option::Option, + #[prost(oneof="export_replay_request::Encoding", tags="7, 8")] + pub encoding: ::core::option::Option, +} +/// Nested message and enum types in `ExportReplayRequest`. +pub mod export_replay_request { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Source { + #[prost(message, tag="4")] + Template(super::TemplateSource), + #[prost(message, tag="5")] + Web(super::WebSource), + #[prost(message, tag="6")] + Media(super::MediaSource), + } + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Encoding { + #[prost(enumeration="super::EncodingOptionsPreset", tag="7")] + Preset(i32), + #[prost(message, tag="8")] + Advanced(super::EncodingOptions), + } +} +// --- V1 --- + +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RoomCompositeEgressRequest { + #[prost(string, tag="1")] + pub room_name: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub layout: ::prost::alloc::string::String, + #[prost(bool, tag="3")] + pub audio_only: bool, + #[prost(enumeration="AudioMixing", tag="15")] + pub audio_mixing: i32, + #[prost(bool, tag="4")] + pub video_only: bool, + #[prost(string, tag="5")] + pub custom_base_url: ::prost::alloc::string::String, + #[prost(message, repeated, tag="11")] + pub file_outputs: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="12")] + pub stream_outputs: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="13")] + pub segment_outputs: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="14")] + pub image_outputs: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="16")] + pub webhooks: ::prost::alloc::vec::Vec, + #[prost(oneof="room_composite_egress_request::Output", tags="6, 7, 10")] + pub output: ::core::option::Option, + #[prost(oneof="room_composite_egress_request::Options", tags="8, 9")] + pub options: ::core::option::Option, +} +/// Nested message and enum types in `RoomCompositeEgressRequest`. +pub mod room_composite_egress_request { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Output { + #[prost(message, tag="6")] + File(super::EncodedFileOutput), + #[prost(message, tag="7")] + Stream(super::StreamOutput), + #[prost(message, tag="10")] + Segments(super::SegmentedFileOutput), + } + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Options { + #[prost(enumeration="super::EncodingOptionsPreset", tag="8")] + Preset(i32), + #[prost(message, tag="9")] + Advanced(super::EncodingOptions), + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct WebEgressRequest { + #[prost(string, tag="1")] + pub url: ::prost::alloc::string::String, + #[prost(bool, tag="2")] + pub audio_only: bool, + #[prost(bool, tag="3")] + pub video_only: bool, + #[prost(bool, tag="12")] + pub await_start_signal: bool, + #[prost(message, repeated, tag="9")] + pub file_outputs: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="10")] + pub stream_outputs: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="11")] + pub segment_outputs: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="13")] + pub image_outputs: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="14")] + pub webhooks: ::prost::alloc::vec::Vec, + #[prost(oneof="web_egress_request::Output", tags="4, 5, 6")] + pub output: ::core::option::Option, + #[prost(oneof="web_egress_request::Options", tags="7, 8")] + pub options: ::core::option::Option, +} +/// Nested message and enum types in `WebEgressRequest`. +pub mod web_egress_request { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Output { + #[prost(message, tag="4")] + File(super::EncodedFileOutput), + #[prost(message, tag="5")] + Stream(super::StreamOutput), + #[prost(message, tag="6")] + Segments(super::SegmentedFileOutput), + } + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Options { + #[prost(enumeration="super::EncodingOptionsPreset", tag="7")] + Preset(i32), + #[prost(message, tag="8")] + Advanced(super::EncodingOptions), + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ParticipantEgressRequest { + #[prost(string, tag="1")] + pub room_name: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub identity: ::prost::alloc::string::String, + #[prost(bool, tag="3")] + pub screen_share: bool, + #[prost(message, repeated, tag="6")] + pub file_outputs: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="7")] + pub stream_outputs: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="8")] + pub segment_outputs: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="9")] + pub image_outputs: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="10")] + pub webhooks: ::prost::alloc::vec::Vec, + #[prost(oneof="participant_egress_request::Options", tags="4, 5")] + pub options: ::core::option::Option, +} +/// Nested message and enum types in `ParticipantEgressRequest`. +pub mod participant_egress_request { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Options { + #[prost(enumeration="super::EncodingOptionsPreset", tag="4")] + Preset(i32), + #[prost(message, tag="5")] + Advanced(super::EncodingOptions), + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TrackCompositeEgressRequest { + #[prost(string, tag="1")] + pub room_name: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub audio_track_id: ::prost::alloc::string::String, + #[prost(string, tag="3")] + pub video_track_id: ::prost::alloc::string::String, + #[prost(message, repeated, tag="11")] + pub file_outputs: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="12")] + pub stream_outputs: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="13")] + pub segment_outputs: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="14")] + pub image_outputs: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="15")] + pub webhooks: ::prost::alloc::vec::Vec, + #[prost(oneof="track_composite_egress_request::Output", tags="4, 5, 8")] + pub output: ::core::option::Option, + #[prost(oneof="track_composite_egress_request::Options", tags="6, 7")] + pub options: ::core::option::Option, +} +/// Nested message and enum types in `TrackCompositeEgressRequest`. +pub mod track_composite_egress_request { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Output { + #[prost(message, tag="4")] + File(super::EncodedFileOutput), + #[prost(message, tag="5")] + Stream(super::StreamOutput), + #[prost(message, tag="8")] + Segments(super::SegmentedFileOutput), + } + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Options { + #[prost(enumeration="super::EncodingOptionsPreset", tag="6")] + Preset(i32), + #[prost(message, tag="7")] + Advanced(super::EncodingOptions), + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TrackEgressRequest { + #[prost(string, tag="1")] + pub room_name: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub track_id: ::prost::alloc::string::String, + #[prost(message, repeated, tag="5")] + pub webhooks: ::prost::alloc::vec::Vec, + #[prost(oneof="track_egress_request::Output", tags="3, 4")] + pub output: ::core::option::Option, +} +/// Nested message and enum types in `TrackEgressRequest`. +pub mod track_egress_request { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Output { + #[prost(message, tag="3")] + File(super::DirectFileOutput), + #[prost(string, tag="4")] + WebsocketUrl(::prost::alloc::string::String), + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DirectFileOutput { + #[prost(string, tag="1")] + pub filepath: ::prost::alloc::string::String, + #[prost(bool, tag="5")] + pub disable_manifest: bool, + #[prost(oneof="direct_file_output::Output", tags="2, 3, 4, 6")] + pub output: ::core::option::Option, +} +/// Nested message and enum types in `DirectFileOutput`. +pub mod direct_file_output { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Output { + #[prost(message, tag="2")] + S3(super::S3Upload), + #[prost(message, tag="3")] + Gcp(super::GcpUpload), + #[prost(message, tag="4")] + Azure(super::AzureBlobUpload), + #[prost(message, tag="6")] + AliOss(super::AliOssUpload), + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EncodedFileOutput { + #[prost(enumeration="EncodedFileType", tag="1")] + pub file_type: i32, + #[prost(string, tag="2")] + pub filepath: ::prost::alloc::string::String, + #[prost(bool, tag="6")] + pub disable_manifest: bool, + #[prost(oneof="encoded_file_output::Output", tags="3, 4, 5, 7")] + pub output: ::core::option::Option, +} +/// Nested message and enum types in `EncodedFileOutput`. +pub mod encoded_file_output { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Output { + #[prost(message, tag="3")] + S3(super::S3Upload), + #[prost(message, tag="4")] + Gcp(super::GcpUpload), + #[prost(message, tag="5")] + Azure(super::AzureBlobUpload), + #[prost(message, tag="7")] + AliOss(super::AliOssUpload), + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateLayoutRequest { + #[prost(string, tag="1")] + pub egress_id: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub layout: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateStreamRequest { + #[prost(string, tag="1")] + pub egress_id: ::prost::alloc::string::String, + #[prost(string, repeated, tag="2")] + pub add_output_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(string, repeated, tag="3")] + pub remove_output_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct StreamInfoList { + #[prost(message, repeated, tag="1")] + pub info: ::prost::alloc::vec::Vec, +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum AudioChannel { + Both = 0, + Left = 1, + Right = 2, +} +impl AudioChannel { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + AudioChannel::Both => "AUDIO_CHANNEL_BOTH", + AudioChannel::Left => "AUDIO_CHANNEL_LEFT", + AudioChannel::Right => "AUDIO_CHANNEL_RIGHT", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "AUDIO_CHANNEL_BOTH" => Some(Self::Both), + "AUDIO_CHANNEL_LEFT" => Some(Self::Left), + "AUDIO_CHANNEL_RIGHT" => Some(Self::Right), + _ => None, + } + } +} +// --- Encoding --- + +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum EncodingOptionsPreset { + /// 1280x720, 30fps, 3000kpbs, H.264_MAIN / OPUS + H264720p30 = 0, + /// 1280x720, 60fps, 4500kbps, H.264_MAIN / OPUS + H264720p60 = 1, + /// 1920x1080, 30fps, 4500kbps, H.264_MAIN / OPUS + H2641080p30 = 2, + /// 1920x1080, 60fps, 6000kbps, H.264_MAIN / OPUS + H2641080p60 = 3, + /// 720x1280, 30fps, 3000kpbs, H.264_MAIN / OPUS + PortraitH264720p30 = 4, + /// 720x1280, 60fps, 4500kbps, H.264_MAIN / OPUS + PortraitH264720p60 = 5, + /// 1080x1920, 30fps, 4500kbps, H.264_MAIN / OPUS + PortraitH2641080p30 = 6, + /// 1080x1920, 60fps, 6000kbps, H.264_MAIN / OPUS + PortraitH2641080p60 = 7, } -/// Nested message and enum types in `AutoTrackEgress`. -pub mod auto_track_egress { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Output { - #[prost(message, tag="2")] - S3(super::S3Upload), - #[prost(message, tag="3")] - Gcp(super::GcpUpload), - #[prost(message, tag="4")] - Azure(super::AzureBlobUpload), - #[prost(message, tag="6")] - AliOss(super::AliOssUpload), +impl EncodingOptionsPreset { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + EncodingOptionsPreset::H264720p30 => "H264_720P_30", + EncodingOptionsPreset::H264720p60 => "H264_720P_60", + EncodingOptionsPreset::H2641080p30 => "H264_1080P_30", + EncodingOptionsPreset::H2641080p60 => "H264_1080P_60", + EncodingOptionsPreset::PortraitH264720p30 => "PORTRAIT_H264_720P_30", + EncodingOptionsPreset::PortraitH264720p60 => "PORTRAIT_H264_720P_60", + EncodingOptionsPreset::PortraitH2641080p30 => "PORTRAIT_H264_1080P_30", + EncodingOptionsPreset::PortraitH2641080p60 => "PORTRAIT_H264_1080P_60", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "H264_720P_30" => Some(Self::H264720p30), + "H264_720P_60" => Some(Self::H264720p60), + "H264_1080P_30" => Some(Self::H2641080p30), + "H264_1080P_60" => Some(Self::H2641080p60), + "PORTRAIT_H264_720P_30" => Some(Self::PortraitH264720p30), + "PORTRAIT_H264_720P_60" => Some(Self::PortraitH264720p60), + "PORTRAIT_H264_1080P_30" => Some(Self::PortraitH2641080p30), + "PORTRAIT_H264_1080P_60" => Some(Self::PortraitH2641080p60), + _ => None, + } } } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] @@ -2901,6 +3279,39 @@ impl EncodedFileType { } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] +pub enum StreamProtocol { + /// protocol chosen based on urls + DefaultProtocol = 0, + Rtmp = 1, + Srt = 2, + Websocket = 3, +} +impl StreamProtocol { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + StreamProtocol::DefaultProtocol => "DEFAULT_PROTOCOL", + StreamProtocol::Rtmp => "RTMP", + StreamProtocol::Srt => "SRT", + StreamProtocol::Websocket => "WEBSOCKET", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "DEFAULT_PROTOCOL" => Some(Self::DefaultProtocol), + "RTMP" => Some(Self::Rtmp), + "SRT" => Some(Self::Srt), + "WEBSOCKET" => Some(Self::Websocket), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] pub enum SegmentedFileProtocol { DefaultSegmentedFileProtocol = 0, HlsProtocol = 1, @@ -2983,114 +3394,26 @@ impl ImageFileSuffix { } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -pub enum StreamProtocol { - /// protocol chosen based on urls - DefaultProtocol = 0, - Rtmp = 1, - Srt = 2, -} -impl StreamProtocol { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - StreamProtocol::DefaultProtocol => "DEFAULT_PROTOCOL", - StreamProtocol::Rtmp => "RTMP", - StreamProtocol::Srt => "SRT", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "DEFAULT_PROTOCOL" => Some(Self::DefaultProtocol), - "RTMP" => Some(Self::Rtmp), - "SRT" => Some(Self::Srt), - _ => None, - } - } -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum AudioMixing { - /// all users are mixed together - DefaultMixing = 0, - /// agent audio in the left channel, all other audio in the right channel - DualChannelAgent = 1, - /// each new audio track alternates between left and right channels - DualChannelAlternate = 2, -} -impl AudioMixing { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - AudioMixing::DefaultMixing => "DEFAULT_MIXING", - AudioMixing::DualChannelAgent => "DUAL_CHANNEL_AGENT", - AudioMixing::DualChannelAlternate => "DUAL_CHANNEL_ALTERNATE", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "DEFAULT_MIXING" => Some(Self::DefaultMixing), - "DUAL_CHANNEL_AGENT" => Some(Self::DualChannelAgent), - "DUAL_CHANNEL_ALTERNATE" => Some(Self::DualChannelAlternate), - _ => None, - } - } -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum EncodingOptionsPreset { - /// 1280x720, 30fps, 3000kpbs, H.264_MAIN / OPUS - H264720p30 = 0, - /// 1280x720, 60fps, 4500kbps, H.264_MAIN / OPUS - H264720p60 = 1, - /// 1920x1080, 30fps, 4500kbps, H.264_MAIN / OPUS - H2641080p30 = 2, - /// 1920x1080, 60fps, 6000kbps, H.264_MAIN / OPUS - H2641080p60 = 3, - /// 720x1280, 30fps, 3000kpbs, H.264_MAIN / OPUS - PortraitH264720p30 = 4, - /// 720x1280, 60fps, 4500kbps, H.264_MAIN / OPUS - PortraitH264720p60 = 5, - /// 1080x1920, 30fps, 4500kbps, H.264_MAIN / OPUS - PortraitH2641080p30 = 6, - /// 1080x1920, 60fps, 6000kbps, H.264_MAIN / OPUS - PortraitH2641080p60 = 7, +pub enum EgressSourceType { + Web = 0, + Sdk = 1, } -impl EncodingOptionsPreset { +impl EgressSourceType { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - EncodingOptionsPreset::H264720p30 => "H264_720P_30", - EncodingOptionsPreset::H264720p60 => "H264_720P_60", - EncodingOptionsPreset::H2641080p30 => "H264_1080P_30", - EncodingOptionsPreset::H2641080p60 => "H264_1080P_60", - EncodingOptionsPreset::PortraitH264720p30 => "PORTRAIT_H264_720P_30", - EncodingOptionsPreset::PortraitH264720p60 => "PORTRAIT_H264_720P_60", - EncodingOptionsPreset::PortraitH2641080p30 => "PORTRAIT_H264_1080P_30", - EncodingOptionsPreset::PortraitH2641080p60 => "PORTRAIT_H264_1080P_60", + EgressSourceType::Web => "EGRESS_SOURCE_TYPE_WEB", + EgressSourceType::Sdk => "EGRESS_SOURCE_TYPE_SDK", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { - "H264_720P_30" => Some(Self::H264720p30), - "H264_720P_60" => Some(Self::H264720p60), - "H264_1080P_30" => Some(Self::H2641080p30), - "H264_1080P_60" => Some(Self::H2641080p60), - "PORTRAIT_H264_720P_30" => Some(Self::PortraitH264720p30), - "PORTRAIT_H264_720P_60" => Some(Self::PortraitH264720p60), - "PORTRAIT_H264_1080P_30" => Some(Self::PortraitH2641080p30), - "PORTRAIT_H264_1080P_60" => Some(Self::PortraitH2641080p60), + "EGRESS_SOURCE_TYPE_WEB" => Some(Self::Web), + "EGRESS_SOURCE_TYPE_SDK" => Some(Self::Sdk), _ => None, } } @@ -3138,26 +3461,29 @@ impl EgressStatus { } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -pub enum EgressSourceType { - Web = 0, - Sdk = 1, +pub enum AudioMixing { + DefaultMixing = 0, + DualChannelAgent = 1, + DualChannelAlternate = 2, } -impl EgressSourceType { +impl AudioMixing { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - EgressSourceType::Web => "EGRESS_SOURCE_TYPE_WEB", - EgressSourceType::Sdk => "EGRESS_SOURCE_TYPE_SDK", + AudioMixing::DefaultMixing => "DEFAULT_MIXING", + AudioMixing::DualChannelAgent => "DUAL_CHANNEL_AGENT", + AudioMixing::DualChannelAlternate => "DUAL_CHANNEL_ALTERNATE", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { - "EGRESS_SOURCE_TYPE_WEB" => Some(Self::Web), - "EGRESS_SOURCE_TYPE_SDK" => Some(Self::Sdk), + "DEFAULT_MIXING" => Some(Self::DefaultMixing), + "DUAL_CHANNEL_AGENT" => Some(Self::DualChannelAgent), + "DUAL_CHANNEL_ALTERNATE" => Some(Self::DualChannelAlternate), _ => None, } } @@ -4562,6 +4888,9 @@ pub struct CreateAgentDispatchRequest { pub room: ::prost::alloc::string::String, #[prost(string, tag="3")] pub metadata: ::prost::alloc::string::String, + /// cloud only + #[prost(enumeration="JobRestartPolicy", tag="4")] + pub restart_policy: i32, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -4570,6 +4899,9 @@ pub struct RoomAgentDispatch { pub agent_name: ::prost::alloc::string::String, #[prost(string, tag="2")] pub metadata: ::prost::alloc::string::String, + /// cloud only + #[prost(enumeration="JobRestartPolicy", tag="3")] + pub restart_policy: i32, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -4608,6 +4940,9 @@ pub struct AgentDispatch { pub metadata: ::prost::alloc::string::String, #[prost(message, optional, tag="5")] pub state: ::core::option::Option, + /// cloud only + #[prost(enumeration="JobRestartPolicy", tag="6")] + pub restart_policy: i32, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -4621,6 +4956,34 @@ pub struct AgentDispatchState { #[prost(int64, tag="3")] pub deleted_at: i64, } +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum JobRestartPolicy { + /// restart when the job fails (default) + JrpOnFailure = 0, + /// never restart + JrpNever = 1, +} +impl JobRestartPolicy { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + JobRestartPolicy::JrpOnFailure => "JRP_ON_FAILURE", + JobRestartPolicy::JrpNever => "JRP_NEVER", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "JRP_ON_FAILURE" => Some(Self::JrpOnFailure), + "JRP_NEVER" => Some(Self::JrpNever), + _ => None, + } + } +} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CreateRoomRequest { @@ -4645,6 +5008,9 @@ pub struct CreateRoomRequest { /// metadata of room #[prost(string, tag="5")] pub metadata: ::prost::alloc::string::String, + /// search tags + #[prost(map="string, string", tag="15")] + pub tags: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, /// auto-egress configurations #[prost(message, optional, tag="6")] pub egress: ::core::option::Option, @@ -4661,8 +5027,6 @@ pub struct CreateRoomRequest { #[prost(bool, tag="13")] pub replay_enabled: bool, /// Define agents that should be dispatched to this room - /// - /// NEXT-ID: 15 #[prost(message, repeated, tag="14")] pub agents: ::prost::alloc::vec::Vec, } @@ -4866,6 +5230,9 @@ pub struct RoomConfiguration { /// Define agents that should be dispatched to this room #[prost(message, repeated, tag="10")] pub agents: ::prost::alloc::vec::Vec, + /// Tags to attach to the room + #[prost(map="string, string", tag="12")] + pub tags: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/livekit-protocol/src/livekit.serde.rs b/livekit-protocol/src/livekit.serde.rs index 8c84d300c..67b0b2486 100644 --- a/livekit-protocol/src/livekit.serde.rs +++ b/livekit-protocol/src/livekit.serde.rs @@ -971,6 +971,9 @@ impl serde::Serialize for AgentDispatch { if self.state.is_some() { len += 1; } + if self.restart_policy != 0 { + len += 1; + } let mut struct_ser = serializer.serialize_struct("livekit.AgentDispatch", len)?; if !self.id.is_empty() { struct_ser.serialize_field("id", &self.id)?; @@ -987,6 +990,11 @@ impl serde::Serialize for AgentDispatch { if let Some(v) = self.state.as_ref() { struct_ser.serialize_field("state", v)?; } + if self.restart_policy != 0 { + let v = JobRestartPolicy::try_from(self.restart_policy) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.restart_policy)))?; + struct_ser.serialize_field("restartPolicy", &v)?; + } struct_ser.end() } } @@ -1003,6 +1011,8 @@ impl<'de> serde::Deserialize<'de> for AgentDispatch { "room", "metadata", "state", + "restart_policy", + "restartPolicy", ]; #[allow(clippy::enum_variant_names)] @@ -1012,6 +1022,7 @@ impl<'de> serde::Deserialize<'de> for AgentDispatch { Room, Metadata, State, + RestartPolicy, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -1039,6 +1050,7 @@ impl<'de> serde::Deserialize<'de> for AgentDispatch { "room" => Ok(GeneratedField::Room), "metadata" => Ok(GeneratedField::Metadata), "state" => Ok(GeneratedField::State), + "restartPolicy" | "restart_policy" => Ok(GeneratedField::RestartPolicy), _ => Ok(GeneratedField::__SkipField__), } } @@ -1063,6 +1075,7 @@ impl<'de> serde::Deserialize<'de> for AgentDispatch { let mut room__ = None; let mut metadata__ = None; let mut state__ = None; + let mut restart_policy__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Id => { @@ -1095,6 +1108,12 @@ impl<'de> serde::Deserialize<'de> for AgentDispatch { } state__ = map_.next_value()?; } + GeneratedField::RestartPolicy => { + if restart_policy__.is_some() { + return Err(serde::de::Error::duplicate_field("restartPolicy")); + } + restart_policy__ = Some(map_.next_value::()? as i32); + } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } @@ -1106,6 +1125,7 @@ impl<'de> serde::Deserialize<'de> for AgentDispatch { room: room__.unwrap_or_default(), metadata: metadata__.unwrap_or_default(), state: state__, + restart_policy: restart_policy__.unwrap_or_default(), }) } } @@ -1415,6 +1435,80 @@ impl<'de> serde::Deserialize<'de> for AliOssUpload { deserializer.deserialize_struct("livekit.AliOSSUpload", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for AudioChannel { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Both => "AUDIO_CHANNEL_BOTH", + Self::Left => "AUDIO_CHANNEL_LEFT", + Self::Right => "AUDIO_CHANNEL_RIGHT", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for AudioChannel { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "AUDIO_CHANNEL_BOTH", + "AUDIO_CHANNEL_LEFT", + "AUDIO_CHANNEL_RIGHT", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = AudioChannel; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "AUDIO_CHANNEL_BOTH" => Ok(AudioChannel::Both), + "AUDIO_CHANNEL_LEFT" => Ok(AudioChannel::Left), + "AUDIO_CHANNEL_RIGHT" => Ok(AudioChannel::Right), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} impl serde::Serialize for AudioCodec { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -1492,6 +1586,101 @@ impl<'de> serde::Deserialize<'de> for AudioCodec { deserializer.deserialize_any(GeneratedVisitor) } } +impl serde::Serialize for AudioConfig { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.routes.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.AudioConfig", len)?; + if !self.routes.is_empty() { + struct_ser.serialize_field("routes", &self.routes)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for AudioConfig { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "routes", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Routes, + __SkipField__, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "routes" => Ok(GeneratedField::Routes), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = AudioConfig; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.AudioConfig") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut routes__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Routes => { + if routes__.is_some() { + return Err(serde::de::Error::duplicate_field("routes")); + } + routes__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(AudioConfig { + routes: routes__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.AudioConfig", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for AudioMixing { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -1566,6 +1755,153 @@ impl<'de> serde::Deserialize<'de> for AudioMixing { deserializer.deserialize_any(GeneratedVisitor) } } +impl serde::Serialize for AudioRoute { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.channel != 0 { + len += 1; + } + if self.r#match.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.AudioRoute", len)?; + if self.channel != 0 { + let v = AudioChannel::try_from(self.channel) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.channel)))?; + struct_ser.serialize_field("channel", &v)?; + } + if let Some(v) = self.r#match.as_ref() { + match v { + audio_route::Match::TrackId(v) => { + struct_ser.serialize_field("trackId", v)?; + } + audio_route::Match::ParticipantIdentity(v) => { + struct_ser.serialize_field("participantIdentity", v)?; + } + audio_route::Match::ParticipantKind(v) => { + let v = participant_info::Kind::try_from(*v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("participantKind", &v)?; + } + } + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for AudioRoute { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "channel", + "track_id", + "trackId", + "participant_identity", + "participantIdentity", + "participant_kind", + "participantKind", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Channel, + TrackId, + ParticipantIdentity, + ParticipantKind, + __SkipField__, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "channel" => Ok(GeneratedField::Channel), + "trackId" | "track_id" => Ok(GeneratedField::TrackId), + "participantIdentity" | "participant_identity" => Ok(GeneratedField::ParticipantIdentity), + "participantKind" | "participant_kind" => Ok(GeneratedField::ParticipantKind), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = AudioRoute; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.AudioRoute") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut channel__ = None; + let mut r#match__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Channel => { + if channel__.is_some() { + return Err(serde::de::Error::duplicate_field("channel")); + } + channel__ = Some(map_.next_value::()? as i32); + } + GeneratedField::TrackId => { + if r#match__.is_some() { + return Err(serde::de::Error::duplicate_field("trackId")); + } + r#match__ = map_.next_value::<::std::option::Option<_>>()?.map(audio_route::Match::TrackId); + } + GeneratedField::ParticipantIdentity => { + if r#match__.is_some() { + return Err(serde::de::Error::duplicate_field("participantIdentity")); + } + r#match__ = map_.next_value::<::std::option::Option<_>>()?.map(audio_route::Match::ParticipantIdentity); + } + GeneratedField::ParticipantKind => { + if r#match__.is_some() { + return Err(serde::de::Error::duplicate_field("participantKind")); + } + r#match__ = map_.next_value::<::std::option::Option>()?.map(|x| audio_route::Match::ParticipantKind(x as i32)); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(AudioRoute { + channel: channel__.unwrap_or_default(), + r#match: r#match__, + }) + } + } + deserializer.deserialize_struct("livekit.AudioRoute", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for AudioTrackFeature { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -3067,6 +3403,9 @@ impl serde::Serialize for ClientInfo { if self.client_protocol != 0 { len += 1; } + if !self.capabilities.is_empty() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("livekit.ClientInfo", len)?; if self.sdk != 0 { let v = client_info::Sdk::try_from(self.sdk) @@ -3106,6 +3445,13 @@ impl serde::Serialize for ClientInfo { if self.client_protocol != 0 { struct_ser.serialize_field("clientProtocol", &self.client_protocol)?; } + if !self.capabilities.is_empty() { + let v = self.capabilities.iter().cloned().map(|v| { + client_info::Capability::try_from(v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", v))) + }).collect::, _>>()?; + struct_ser.serialize_field("capabilities", &v)?; + } struct_ser.end() } } @@ -3133,6 +3479,7 @@ impl<'de> serde::Deserialize<'de> for ClientInfo { "otherSdks", "client_protocol", "clientProtocol", + "capabilities", ]; #[allow(clippy::enum_variant_names)] @@ -3149,6 +3496,7 @@ impl<'de> serde::Deserialize<'de> for ClientInfo { Network, OtherSdks, ClientProtocol, + Capabilities, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -3183,6 +3531,7 @@ impl<'de> serde::Deserialize<'de> for ClientInfo { "network" => Ok(GeneratedField::Network), "otherSdks" | "other_sdks" => Ok(GeneratedField::OtherSdks), "clientProtocol" | "client_protocol" => Ok(GeneratedField::ClientProtocol), + "capabilities" => Ok(GeneratedField::Capabilities), _ => Ok(GeneratedField::__SkipField__), } } @@ -3214,6 +3563,7 @@ impl<'de> serde::Deserialize<'de> for ClientInfo { let mut network__ = None; let mut other_sdks__ = None; let mut client_protocol__ = None; + let mut capabilities__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Sdk => { @@ -3292,6 +3642,12 @@ impl<'de> serde::Deserialize<'de> for ClientInfo { Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } + GeneratedField::Capabilities => { + if capabilities__.is_some() { + return Err(serde::de::Error::duplicate_field("capabilities")); + } + capabilities__ = Some(map_.next_value::>()?.into_iter().map(|x| x as i32).collect()); + } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } @@ -3310,66 +3666,138 @@ impl<'de> serde::Deserialize<'de> for ClientInfo { network: network__.unwrap_or_default(), other_sdks: other_sdks__.unwrap_or_default(), client_protocol: client_protocol__.unwrap_or_default(), + capabilities: capabilities__.unwrap_or_default(), }) } } deserializer.deserialize_struct("livekit.ClientInfo", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for client_info::Sdk { +impl serde::Serialize for client_info::Capability { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { let variant = match self { - Self::Unknown => "UNKNOWN", - Self::Js => "JS", - Self::Swift => "SWIFT", - Self::Android => "ANDROID", - Self::Flutter => "FLUTTER", - Self::Go => "GO", - Self::Unity => "UNITY", - Self::ReactNative => "REACT_NATIVE", - Self::Rust => "RUST", - Self::Python => "PYTHON", - Self::Cpp => "CPP", - Self::UnityWeb => "UNITY_WEB", - Self::Node => "NODE", - Self::Unreal => "UNREAL", - Self::Esp32 => "ESP32", + Self::CapUnused => "CAP_UNUSED", + Self::CapPacketTrailer => "CAP_PACKET_TRAILER", }; serializer.serialize_str(variant) } } -impl<'de> serde::Deserialize<'de> for client_info::Sdk { +impl<'de> serde::Deserialize<'de> for client_info::Capability { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "UNKNOWN", - "JS", - "SWIFT", - "ANDROID", - "FLUTTER", - "GO", - "UNITY", - "REACT_NATIVE", - "RUST", - "PYTHON", - "CPP", - "UNITY_WEB", - "NODE", - "UNREAL", - "ESP32", + "CAP_UNUSED", + "CAP_PACKET_TRAILER", ]; struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = client_info::Sdk; + type Value = client_info::Capability; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "CAP_UNUSED" => Ok(client_info::Capability::CapUnused), + "CAP_PACKET_TRAILER" => Ok(client_info::Capability::CapPacketTrailer), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for client_info::Sdk { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unknown => "UNKNOWN", + Self::Js => "JS", + Self::Swift => "SWIFT", + Self::Android => "ANDROID", + Self::Flutter => "FLUTTER", + Self::Go => "GO", + Self::Unity => "UNITY", + Self::ReactNative => "REACT_NATIVE", + Self::Rust => "RUST", + Self::Python => "PYTHON", + Self::Cpp => "CPP", + Self::UnityWeb => "UNITY_WEB", + Self::Node => "NODE", + Self::Unreal => "UNREAL", + Self::Esp32 => "ESP32", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for client_info::Sdk { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "UNKNOWN", + "JS", + "SWIFT", + "ANDROID", + "FLUTTER", + "GO", + "UNITY", + "REACT_NATIVE", + "RUST", + "PYTHON", + "CPP", + "UNITY_WEB", + "NODE", + "UNREAL", + "ESP32", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = client_info::Sdk; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(formatter, "expected one of: {:?}", &FIELDS) @@ -4681,6 +5109,9 @@ impl serde::Serialize for CreateAgentDispatchRequest { if !self.metadata.is_empty() { len += 1; } + if self.restart_policy != 0 { + len += 1; + } let mut struct_ser = serializer.serialize_struct("livekit.CreateAgentDispatchRequest", len)?; if !self.agent_name.is_empty() { struct_ser.serialize_field("agentName", &self.agent_name)?; @@ -4691,6 +5122,11 @@ impl serde::Serialize for CreateAgentDispatchRequest { if !self.metadata.is_empty() { struct_ser.serialize_field("metadata", &self.metadata)?; } + if self.restart_policy != 0 { + let v = JobRestartPolicy::try_from(self.restart_policy) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.restart_policy)))?; + struct_ser.serialize_field("restartPolicy", &v)?; + } struct_ser.end() } } @@ -4705,6 +5141,8 @@ impl<'de> serde::Deserialize<'de> for CreateAgentDispatchRequest { "agentName", "room", "metadata", + "restart_policy", + "restartPolicy", ]; #[allow(clippy::enum_variant_names)] @@ -4712,6 +5150,7 @@ impl<'de> serde::Deserialize<'de> for CreateAgentDispatchRequest { AgentName, Room, Metadata, + RestartPolicy, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -4737,6 +5176,7 @@ impl<'de> serde::Deserialize<'de> for CreateAgentDispatchRequest { "agentName" | "agent_name" => Ok(GeneratedField::AgentName), "room" => Ok(GeneratedField::Room), "metadata" => Ok(GeneratedField::Metadata), + "restartPolicy" | "restart_policy" => Ok(GeneratedField::RestartPolicy), _ => Ok(GeneratedField::__SkipField__), } } @@ -4759,6 +5199,7 @@ impl<'de> serde::Deserialize<'de> for CreateAgentDispatchRequest { let mut agent_name__ = None; let mut room__ = None; let mut metadata__ = None; + let mut restart_policy__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::AgentName => { @@ -4779,6 +5220,12 @@ impl<'de> serde::Deserialize<'de> for CreateAgentDispatchRequest { } metadata__ = Some(map_.next_value()?); } + GeneratedField::RestartPolicy => { + if restart_policy__.is_some() { + return Err(serde::de::Error::duplicate_field("restartPolicy")); + } + restart_policy__ = Some(map_.next_value::()? as i32); + } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } @@ -4788,6 +5235,7 @@ impl<'de> serde::Deserialize<'de> for CreateAgentDispatchRequest { agent_name: agent_name__.unwrap_or_default(), room: room__.unwrap_or_default(), metadata: metadata__.unwrap_or_default(), + restart_policy: restart_policy__.unwrap_or_default(), }) } } @@ -5114,6 +5562,9 @@ impl serde::Serialize for CreateRoomRequest { if !self.metadata.is_empty() { len += 1; } + if !self.tags.is_empty() { + len += 1; + } if self.egress.is_some() { len += 1; } @@ -5154,6 +5605,9 @@ impl serde::Serialize for CreateRoomRequest { if !self.metadata.is_empty() { struct_ser.serialize_field("metadata", &self.metadata)?; } + if !self.tags.is_empty() { + struct_ser.serialize_field("tags", &self.tags)?; + } if let Some(v) = self.egress.as_ref() { struct_ser.serialize_field("egress", v)?; } @@ -5194,6 +5648,7 @@ impl<'de> serde::Deserialize<'de> for CreateRoomRequest { "node_id", "nodeId", "metadata", + "tags", "egress", "min_playout_delay", "minPlayoutDelay", @@ -5215,6 +5670,7 @@ impl<'de> serde::Deserialize<'de> for CreateRoomRequest { MaxParticipants, NodeId, Metadata, + Tags, Egress, MinPlayoutDelay, MaxPlayoutDelay, @@ -5250,6 +5706,7 @@ impl<'de> serde::Deserialize<'de> for CreateRoomRequest { "maxParticipants" | "max_participants" => Ok(GeneratedField::MaxParticipants), "nodeId" | "node_id" => Ok(GeneratedField::NodeId), "metadata" => Ok(GeneratedField::Metadata), + "tags" => Ok(GeneratedField::Tags), "egress" => Ok(GeneratedField::Egress), "minPlayoutDelay" | "min_playout_delay" => Ok(GeneratedField::MinPlayoutDelay), "maxPlayoutDelay" | "max_playout_delay" => Ok(GeneratedField::MaxPlayoutDelay), @@ -5282,6 +5739,7 @@ impl<'de> serde::Deserialize<'de> for CreateRoomRequest { let mut max_participants__ = None; let mut node_id__ = None; let mut metadata__ = None; + let mut tags__ = None; let mut egress__ = None; let mut min_playout_delay__ = None; let mut max_playout_delay__ = None; @@ -5338,6 +5796,14 @@ impl<'de> serde::Deserialize<'de> for CreateRoomRequest { } metadata__ = Some(map_.next_value()?); } + GeneratedField::Tags => { + if tags__.is_some() { + return Err(serde::de::Error::duplicate_field("tags")); + } + tags__ = Some( + map_.next_value::>()? + ); + } GeneratedField::Egress => { if egress__.is_some() { return Err(serde::de::Error::duplicate_field("egress")); @@ -5391,6 +5857,7 @@ impl<'de> serde::Deserialize<'de> for CreateRoomRequest { max_participants: max_participants__.unwrap_or_default(), node_id: node_id__.unwrap_or_default(), metadata: metadata__.unwrap_or_default(), + tags: tags__.unwrap_or_default(), egress: egress__, min_playout_delay: min_playout_delay__.unwrap_or_default(), max_playout_delay: max_playout_delay__.unwrap_or_default(), @@ -6850,6 +7317,101 @@ impl<'de> serde::Deserialize<'de> for DataChannelReceiveState { deserializer.deserialize_struct("livekit.DataChannelReceiveState", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for DataConfig { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.selectors.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.DataConfig", len)?; + if !self.selectors.is_empty() { + struct_ser.serialize_field("selectors", &self.selectors)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for DataConfig { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "selectors", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Selectors, + __SkipField__, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "selectors" => Ok(GeneratedField::Selectors), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = DataConfig; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.DataConfig") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut selectors__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Selectors => { + if selectors__.is_some() { + return Err(serde::de::Error::duplicate_field("selectors")); + } + selectors__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(DataConfig { + selectors: selectors__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.DataConfig", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for DataPacket { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -7278,109 +7840,234 @@ impl<'de> serde::Deserialize<'de> for data_packet::Kind { deserializer.deserialize_any(GeneratedVisitor) } } -impl serde::Serialize for DataStream { +impl serde::Serialize for DataSelector { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct("livekit.DataStream", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for DataStream { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - __SkipField__, + let mut len = 0; + if self.r#match.is_some() { + len += 1; } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - Ok(GeneratedField::__SkipField__) - } + let mut struct_ser = serializer.serialize_struct("livekit.DataSelector", len)?; + if let Some(v) = self.r#match.as_ref() { + match v { + data_selector::Match::TrackId(v) => { + struct_ser.serialize_field("trackId", v)?; } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = DataStream; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.DataStream") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; + data_selector::Match::ParticipantIdentity(v) => { + struct_ser.serialize_field("participantIdentity", v)?; + } + data_selector::Match::Topic(v) => { + struct_ser.serialize_field("topic", v)?; } - Ok(DataStream { - }) } } - deserializer.deserialize_struct("livekit.DataStream", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for data_stream::ByteHeader { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.name.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("livekit.DataStream.ByteHeader", len)?; - if !self.name.is_empty() { - struct_ser.serialize_field("name", &self.name)?; - } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for data_stream::ByteHeader { +impl<'de> serde::Deserialize<'de> for DataSelector { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "name", + "track_id", + "trackId", + "participant_identity", + "participantIdentity", + "topic", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Name, + TrackId, + ParticipantIdentity, + Topic, + __SkipField__, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "trackId" | "track_id" => Ok(GeneratedField::TrackId), + "participantIdentity" | "participant_identity" => Ok(GeneratedField::ParticipantIdentity), + "topic" => Ok(GeneratedField::Topic), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = DataSelector; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.DataSelector") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut r#match__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::TrackId => { + if r#match__.is_some() { + return Err(serde::de::Error::duplicate_field("trackId")); + } + r#match__ = map_.next_value::<::std::option::Option<_>>()?.map(data_selector::Match::TrackId); + } + GeneratedField::ParticipantIdentity => { + if r#match__.is_some() { + return Err(serde::de::Error::duplicate_field("participantIdentity")); + } + r#match__ = map_.next_value::<::std::option::Option<_>>()?.map(data_selector::Match::ParticipantIdentity); + } + GeneratedField::Topic => { + if r#match__.is_some() { + return Err(serde::de::Error::duplicate_field("topic")); + } + r#match__ = map_.next_value::<::std::option::Option<_>>()?.map(data_selector::Match::Topic); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(DataSelector { + r#match: r#match__, + }) + } + } + deserializer.deserialize_struct("livekit.DataSelector", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for DataStream { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("livekit.DataStream", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for DataStream { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + __SkipField__, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + Ok(GeneratedField::__SkipField__) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = DataStream; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.DataStream") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(DataStream { + }) + } + } + deserializer.deserialize_struct("livekit.DataStream", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for data_stream::ByteHeader { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.name.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.DataStream.ByteHeader", len)?; + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for data_stream::ByteHeader { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "name", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -10754,25 +11441,25 @@ impl serde::Serialize for EgressInfo { if self.updated_at != 0 { len += 1; } - if !self.details.is_empty() { + if !self.stream_results.is_empty() { len += 1; } - if !self.error.is_empty() { + if !self.file_results.is_empty() { len += 1; } - if self.error_code != 0 { + if !self.segment_results.is_empty() { len += 1; } - if !self.stream_results.is_empty() { + if !self.image_results.is_empty() { len += 1; } - if !self.file_results.is_empty() { + if !self.error.is_empty() { len += 1; } - if !self.segment_results.is_empty() { + if self.error_code != 0 { len += 1; } - if !self.image_results.is_empty() { + if !self.details.is_empty() { len += 1; } if !self.manifest_location.is_empty() { @@ -10825,15 +11512,6 @@ impl serde::Serialize for EgressInfo { #[allow(clippy::needless_borrows_for_generic_args)] struct_ser.serialize_field("updatedAt", ToString::to_string(&self.updated_at).as_str())?; } - if !self.details.is_empty() { - struct_ser.serialize_field("details", &self.details)?; - } - if !self.error.is_empty() { - struct_ser.serialize_field("error", &self.error)?; - } - if self.error_code != 0 { - struct_ser.serialize_field("errorCode", &self.error_code)?; - } if !self.stream_results.is_empty() { struct_ser.serialize_field("streamResults", &self.stream_results)?; } @@ -10846,6 +11524,15 @@ impl serde::Serialize for EgressInfo { if !self.image_results.is_empty() { struct_ser.serialize_field("imageResults", &self.image_results)?; } + if !self.error.is_empty() { + struct_ser.serialize_field("error", &self.error)?; + } + if self.error_code != 0 { + struct_ser.serialize_field("errorCode", &self.error_code)?; + } + if !self.details.is_empty() { + struct_ser.serialize_field("details", &self.details)?; + } if !self.manifest_location.is_empty() { struct_ser.serialize_field("manifestLocation", &self.manifest_location)?; } @@ -10857,6 +11544,9 @@ impl serde::Serialize for EgressInfo { } if let Some(v) = self.request.as_ref() { match v { + egress_info::Request::Replay(v) => { + struct_ser.serialize_field("replay", v)?; + } egress_info::Request::RoomComposite(v) => { struct_ser.serialize_field("roomComposite", v)?; } @@ -10912,10 +11602,6 @@ impl<'de> serde::Deserialize<'de> for EgressInfo { "endedAt", "updated_at", "updatedAt", - "details", - "error", - "error_code", - "errorCode", "stream_results", "streamResults", "file_results", @@ -10924,12 +11610,17 @@ impl<'de> serde::Deserialize<'de> for EgressInfo { "segmentResults", "image_results", "imageResults", + "error", + "error_code", + "errorCode", + "details", "manifest_location", "manifestLocation", "backup_storage_used", "backupStorageUsed", "retry_count", "retryCount", + "replay", "room_composite", "roomComposite", "web", @@ -10952,16 +11643,17 @@ impl<'de> serde::Deserialize<'de> for EgressInfo { StartedAt, EndedAt, UpdatedAt, - Details, - Error, - ErrorCode, StreamResults, FileResults, SegmentResults, ImageResults, + Error, + ErrorCode, + Details, ManifestLocation, BackupStorageUsed, RetryCount, + Replay, RoomComposite, Web, Participant, @@ -11000,16 +11692,17 @@ impl<'de> serde::Deserialize<'de> for EgressInfo { "startedAt" | "started_at" => Ok(GeneratedField::StartedAt), "endedAt" | "ended_at" => Ok(GeneratedField::EndedAt), "updatedAt" | "updated_at" => Ok(GeneratedField::UpdatedAt), - "details" => Ok(GeneratedField::Details), - "error" => Ok(GeneratedField::Error), - "errorCode" | "error_code" => Ok(GeneratedField::ErrorCode), "streamResults" | "stream_results" => Ok(GeneratedField::StreamResults), "fileResults" | "file_results" => Ok(GeneratedField::FileResults), "segmentResults" | "segment_results" => Ok(GeneratedField::SegmentResults), "imageResults" | "image_results" => Ok(GeneratedField::ImageResults), + "error" => Ok(GeneratedField::Error), + "errorCode" | "error_code" => Ok(GeneratedField::ErrorCode), + "details" => Ok(GeneratedField::Details), "manifestLocation" | "manifest_location" => Ok(GeneratedField::ManifestLocation), "backupStorageUsed" | "backup_storage_used" => Ok(GeneratedField::BackupStorageUsed), "retryCount" | "retry_count" => Ok(GeneratedField::RetryCount), + "replay" => Ok(GeneratedField::Replay), "roomComposite" | "room_composite" => Ok(GeneratedField::RoomComposite), "web" => Ok(GeneratedField::Web), "participant" => Ok(GeneratedField::Participant), @@ -11045,13 +11738,13 @@ impl<'de> serde::Deserialize<'de> for EgressInfo { let mut started_at__ = None; let mut ended_at__ = None; let mut updated_at__ = None; - let mut details__ = None; - let mut error__ = None; - let mut error_code__ = None; let mut stream_results__ = None; let mut file_results__ = None; let mut segment_results__ = None; let mut image_results__ = None; + let mut error__ = None; + let mut error_code__ = None; + let mut details__ = None; let mut manifest_location__ = None; let mut backup_storage_used__ = None; let mut retry_count__ = None; @@ -11113,26 +11806,6 @@ impl<'de> serde::Deserialize<'de> for EgressInfo { Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } - GeneratedField::Details => { - if details__.is_some() { - return Err(serde::de::Error::duplicate_field("details")); - } - details__ = Some(map_.next_value()?); - } - GeneratedField::Error => { - if error__.is_some() { - return Err(serde::de::Error::duplicate_field("error")); - } - error__ = Some(map_.next_value()?); - } - GeneratedField::ErrorCode => { - if error_code__.is_some() { - return Err(serde::de::Error::duplicate_field("errorCode")); - } - error_code__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } GeneratedField::StreamResults => { if stream_results__.is_some() { return Err(serde::de::Error::duplicate_field("streamResults")); @@ -11157,6 +11830,26 @@ impl<'de> serde::Deserialize<'de> for EgressInfo { } image_results__ = Some(map_.next_value()?); } + GeneratedField::Error => { + if error__.is_some() { + return Err(serde::de::Error::duplicate_field("error")); + } + error__ = Some(map_.next_value()?); + } + GeneratedField::ErrorCode => { + if error_code__.is_some() { + return Err(serde::de::Error::duplicate_field("errorCode")); + } + error_code__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Details => { + if details__.is_some() { + return Err(serde::de::Error::duplicate_field("details")); + } + details__ = Some(map_.next_value()?); + } GeneratedField::ManifestLocation => { if manifest_location__.is_some() { return Err(serde::de::Error::duplicate_field("manifestLocation")); @@ -11177,6 +11870,13 @@ impl<'de> serde::Deserialize<'de> for EgressInfo { Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } + GeneratedField::Replay => { + if request__.is_some() { + return Err(serde::de::Error::duplicate_field("replay")); + } + request__ = map_.next_value::<::std::option::Option<_>>()?.map(egress_info::Request::Replay) +; + } GeneratedField::RoomComposite => { if request__.is_some() { return Err(serde::de::Error::duplicate_field("roomComposite")); @@ -11247,13 +11947,13 @@ impl<'de> serde::Deserialize<'de> for EgressInfo { started_at: started_at__.unwrap_or_default(), ended_at: ended_at__.unwrap_or_default(), updated_at: updated_at__.unwrap_or_default(), - details: details__.unwrap_or_default(), - error: error__.unwrap_or_default(), - error_code: error_code__.unwrap_or_default(), stream_results: stream_results__.unwrap_or_default(), file_results: file_results__.unwrap_or_default(), segment_results: segment_results__.unwrap_or_default(), image_results: image_results__.unwrap_or_default(), + error: error__.unwrap_or_default(), + error_code: error_code__.unwrap_or_default(), + details: details__.unwrap_or_default(), manifest_location: manifest_location__.unwrap_or_default(), backup_storage_used: backup_storage_used__.unwrap_or_default(), retry_count: retry_count__.unwrap_or_default(), @@ -11719,9 +12419,6 @@ impl serde::Serialize for EncodingOptions { if self.audio_bitrate != 0 { len += 1; } - if self.audio_quality != 0 { - len += 1; - } if self.audio_frequency != 0 { len += 1; } @@ -11731,10 +12428,13 @@ impl serde::Serialize for EncodingOptions { if self.video_bitrate != 0 { len += 1; } - if self.video_quality != 0 { + if self.key_frame_interval != 0. { len += 1; } - if self.key_frame_interval != 0. { + if self.audio_quality != 0 { + len += 1; + } + if self.video_quality != 0 { len += 1; } let mut struct_ser = serializer.serialize_struct("livekit.EncodingOptions", len)?; @@ -11758,9 +12458,6 @@ impl serde::Serialize for EncodingOptions { if self.audio_bitrate != 0 { struct_ser.serialize_field("audioBitrate", &self.audio_bitrate)?; } - if self.audio_quality != 0 { - struct_ser.serialize_field("audioQuality", &self.audio_quality)?; - } if self.audio_frequency != 0 { struct_ser.serialize_field("audioFrequency", &self.audio_frequency)?; } @@ -11772,12 +12469,15 @@ impl serde::Serialize for EncodingOptions { if self.video_bitrate != 0 { struct_ser.serialize_field("videoBitrate", &self.video_bitrate)?; } - if self.video_quality != 0 { - struct_ser.serialize_field("videoQuality", &self.video_quality)?; - } if self.key_frame_interval != 0. { struct_ser.serialize_field("keyFrameInterval", &self.key_frame_interval)?; } + if self.audio_quality != 0 { + struct_ser.serialize_field("audioQuality", &self.audio_quality)?; + } + if self.video_quality != 0 { + struct_ser.serialize_field("videoQuality", &self.video_quality)?; + } struct_ser.end() } } @@ -11796,18 +12496,18 @@ impl<'de> serde::Deserialize<'de> for EncodingOptions { "audioCodec", "audio_bitrate", "audioBitrate", - "audio_quality", - "audioQuality", "audio_frequency", "audioFrequency", "video_codec", "videoCodec", "video_bitrate", "videoBitrate", - "video_quality", - "videoQuality", "key_frame_interval", "keyFrameInterval", + "audio_quality", + "audioQuality", + "video_quality", + "videoQuality", ]; #[allow(clippy::enum_variant_names)] @@ -11818,12 +12518,12 @@ impl<'de> serde::Deserialize<'de> for EncodingOptions { Framerate, AudioCodec, AudioBitrate, - AudioQuality, AudioFrequency, VideoCodec, VideoBitrate, - VideoQuality, KeyFrameInterval, + AudioQuality, + VideoQuality, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -11852,12 +12552,12 @@ impl<'de> serde::Deserialize<'de> for EncodingOptions { "framerate" => Ok(GeneratedField::Framerate), "audioCodec" | "audio_codec" => Ok(GeneratedField::AudioCodec), "audioBitrate" | "audio_bitrate" => Ok(GeneratedField::AudioBitrate), - "audioQuality" | "audio_quality" => Ok(GeneratedField::AudioQuality), "audioFrequency" | "audio_frequency" => Ok(GeneratedField::AudioFrequency), "videoCodec" | "video_codec" => Ok(GeneratedField::VideoCodec), "videoBitrate" | "video_bitrate" => Ok(GeneratedField::VideoBitrate), - "videoQuality" | "video_quality" => Ok(GeneratedField::VideoQuality), "keyFrameInterval" | "key_frame_interval" => Ok(GeneratedField::KeyFrameInterval), + "audioQuality" | "audio_quality" => Ok(GeneratedField::AudioQuality), + "videoQuality" | "video_quality" => Ok(GeneratedField::VideoQuality), _ => Ok(GeneratedField::__SkipField__), } } @@ -11883,12 +12583,12 @@ impl<'de> serde::Deserialize<'de> for EncodingOptions { let mut framerate__ = None; let mut audio_codec__ = None; let mut audio_bitrate__ = None; - let mut audio_quality__ = None; let mut audio_frequency__ = None; let mut video_codec__ = None; let mut video_bitrate__ = None; - let mut video_quality__ = None; let mut key_frame_interval__ = None; + let mut audio_quality__ = None; + let mut video_quality__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Width => { @@ -11937,14 +12637,6 @@ impl<'de> serde::Deserialize<'de> for EncodingOptions { Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } - GeneratedField::AudioQuality => { - if audio_quality__.is_some() { - return Err(serde::de::Error::duplicate_field("audioQuality")); - } - audio_quality__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } GeneratedField::AudioFrequency => { if audio_frequency__.is_some() { return Err(serde::de::Error::duplicate_field("audioFrequency")); @@ -11967,14 +12659,6 @@ impl<'de> serde::Deserialize<'de> for EncodingOptions { Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } - GeneratedField::VideoQuality => { - if video_quality__.is_some() { - return Err(serde::de::Error::duplicate_field("videoQuality")); - } - video_quality__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } GeneratedField::KeyFrameInterval => { if key_frame_interval__.is_some() { return Err(serde::de::Error::duplicate_field("keyFrameInterval")); @@ -11983,6 +12667,22 @@ impl<'de> serde::Deserialize<'de> for EncodingOptions { Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } + GeneratedField::AudioQuality => { + if audio_quality__.is_some() { + return Err(serde::de::Error::duplicate_field("audioQuality")); + } + audio_quality__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::VideoQuality => { + if video_quality__.is_some() { + return Err(serde::de::Error::duplicate_field("videoQuality")); + } + video_quality__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } @@ -11995,12 +12695,12 @@ impl<'de> serde::Deserialize<'de> for EncodingOptions { framerate: framerate__.unwrap_or_default(), audio_codec: audio_codec__.unwrap_or_default(), audio_bitrate: audio_bitrate__.unwrap_or_default(), - audio_quality: audio_quality__.unwrap_or_default(), audio_frequency: audio_frequency__.unwrap_or_default(), video_codec: video_codec__.unwrap_or_default(), video_bitrate: video_bitrate__.unwrap_or_default(), - video_quality: video_quality__.unwrap_or_default(), key_frame_interval: key_frame_interval__.unwrap_or_default(), + audio_quality: audio_quality__.unwrap_or_default(), + video_quality: video_quality__.unwrap_or_default(), }) } } @@ -12854,6 +13554,281 @@ impl<'de> serde::Deserialize<'de> for EventMetric { deserializer.deserialize_struct("livekit.EventMetric", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for ExportReplayRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.replay_id.is_empty() { + len += 1; + } + if self.start_offset_ms != 0 { + len += 1; + } + if self.end_offset_ms != 0 { + len += 1; + } + if !self.outputs.is_empty() { + len += 1; + } + if self.storage.is_some() { + len += 1; + } + if !self.webhooks.is_empty() { + len += 1; + } + if self.source.is_some() { + len += 1; + } + if self.encoding.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.ExportReplayRequest", len)?; + if !self.replay_id.is_empty() { + struct_ser.serialize_field("replayId", &self.replay_id)?; + } + if self.start_offset_ms != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("startOffsetMs", ToString::to_string(&self.start_offset_ms).as_str())?; + } + if self.end_offset_ms != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("endOffsetMs", ToString::to_string(&self.end_offset_ms).as_str())?; + } + if !self.outputs.is_empty() { + struct_ser.serialize_field("outputs", &self.outputs)?; + } + if let Some(v) = self.storage.as_ref() { + struct_ser.serialize_field("storage", v)?; + } + if !self.webhooks.is_empty() { + struct_ser.serialize_field("webhooks", &self.webhooks)?; + } + if let Some(v) = self.source.as_ref() { + match v { + export_replay_request::Source::Template(v) => { + struct_ser.serialize_field("template", v)?; + } + export_replay_request::Source::Web(v) => { + struct_ser.serialize_field("web", v)?; + } + export_replay_request::Source::Media(v) => { + struct_ser.serialize_field("media", v)?; + } + } + } + if let Some(v) = self.encoding.as_ref() { + match v { + export_replay_request::Encoding::Preset(v) => { + let v = EncodingOptionsPreset::try_from(*v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("preset", &v)?; + } + export_replay_request::Encoding::Advanced(v) => { + struct_ser.serialize_field("advanced", v)?; + } + } + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ExportReplayRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "replay_id", + "replayId", + "start_offset_ms", + "startOffsetMs", + "end_offset_ms", + "endOffsetMs", + "outputs", + "storage", + "webhooks", + "template", + "web", + "media", + "preset", + "advanced", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ReplayId, + StartOffsetMs, + EndOffsetMs, + Outputs, + Storage, + Webhooks, + Template, + Web, + Media, + Preset, + Advanced, + __SkipField__, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "replayId" | "replay_id" => Ok(GeneratedField::ReplayId), + "startOffsetMs" | "start_offset_ms" => Ok(GeneratedField::StartOffsetMs), + "endOffsetMs" | "end_offset_ms" => Ok(GeneratedField::EndOffsetMs), + "outputs" => Ok(GeneratedField::Outputs), + "storage" => Ok(GeneratedField::Storage), + "webhooks" => Ok(GeneratedField::Webhooks), + "template" => Ok(GeneratedField::Template), + "web" => Ok(GeneratedField::Web), + "media" => Ok(GeneratedField::Media), + "preset" => Ok(GeneratedField::Preset), + "advanced" => Ok(GeneratedField::Advanced), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ExportReplayRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.ExportReplayRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut replay_id__ = None; + let mut start_offset_ms__ = None; + let mut end_offset_ms__ = None; + let mut outputs__ = None; + let mut storage__ = None; + let mut webhooks__ = None; + let mut source__ = None; + let mut encoding__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ReplayId => { + if replay_id__.is_some() { + return Err(serde::de::Error::duplicate_field("replayId")); + } + replay_id__ = Some(map_.next_value()?); + } + GeneratedField::StartOffsetMs => { + if start_offset_ms__.is_some() { + return Err(serde::de::Error::duplicate_field("startOffsetMs")); + } + start_offset_ms__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::EndOffsetMs => { + if end_offset_ms__.is_some() { + return Err(serde::de::Error::duplicate_field("endOffsetMs")); + } + end_offset_ms__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Outputs => { + if outputs__.is_some() { + return Err(serde::de::Error::duplicate_field("outputs")); + } + outputs__ = Some(map_.next_value()?); + } + GeneratedField::Storage => { + if storage__.is_some() { + return Err(serde::de::Error::duplicate_field("storage")); + } + storage__ = map_.next_value()?; + } + GeneratedField::Webhooks => { + if webhooks__.is_some() { + return Err(serde::de::Error::duplicate_field("webhooks")); + } + webhooks__ = Some(map_.next_value()?); + } + GeneratedField::Template => { + if source__.is_some() { + return Err(serde::de::Error::duplicate_field("template")); + } + source__ = map_.next_value::<::std::option::Option<_>>()?.map(export_replay_request::Source::Template) +; + } + GeneratedField::Web => { + if source__.is_some() { + return Err(serde::de::Error::duplicate_field("web")); + } + source__ = map_.next_value::<::std::option::Option<_>>()?.map(export_replay_request::Source::Web) +; + } + GeneratedField::Media => { + if source__.is_some() { + return Err(serde::de::Error::duplicate_field("media")); + } + source__ = map_.next_value::<::std::option::Option<_>>()?.map(export_replay_request::Source::Media) +; + } + GeneratedField::Preset => { + if encoding__.is_some() { + return Err(serde::de::Error::duplicate_field("preset")); + } + encoding__ = map_.next_value::<::std::option::Option>()?.map(|x| export_replay_request::Encoding::Preset(x as i32)); + } + GeneratedField::Advanced => { + if encoding__.is_some() { + return Err(serde::de::Error::duplicate_field("advanced")); + } + encoding__ = map_.next_value::<::std::option::Option<_>>()?.map(export_replay_request::Encoding::Advanced) +; + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(ExportReplayRequest { + replay_id: replay_id__.unwrap_or_default(), + start_offset_ms: start_offset_ms__.unwrap_or_default(), + end_offset_ms: end_offset_ms__.unwrap_or_default(), + outputs: outputs__.unwrap_or_default(), + storage: storage__, + webhooks: webhooks__.unwrap_or_default(), + source: source__, + encoding: encoding__, + }) + } + } + deserializer.deserialize_struct("livekit.ExportReplayRequest", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for FileInfo { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -13052,6 +14027,139 @@ impl<'de> serde::Deserialize<'de> for FileInfo { deserializer.deserialize_struct("livekit.FileInfo", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for FileOutput { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.file_type != 0 { + len += 1; + } + if !self.filepath.is_empty() { + len += 1; + } + if self.disable_manifest { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.FileOutput", len)?; + if self.file_type != 0 { + let v = EncodedFileType::try_from(self.file_type) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.file_type)))?; + struct_ser.serialize_field("fileType", &v)?; + } + if !self.filepath.is_empty() { + struct_ser.serialize_field("filepath", &self.filepath)?; + } + if self.disable_manifest { + struct_ser.serialize_field("disableManifest", &self.disable_manifest)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for FileOutput { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "file_type", + "fileType", + "filepath", + "disable_manifest", + "disableManifest", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + FileType, + Filepath, + DisableManifest, + __SkipField__, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "fileType" | "file_type" => Ok(GeneratedField::FileType), + "filepath" => Ok(GeneratedField::Filepath), + "disableManifest" | "disable_manifest" => Ok(GeneratedField::DisableManifest), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = FileOutput; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.FileOutput") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut file_type__ = None; + let mut filepath__ = None; + let mut disable_manifest__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::FileType => { + if file_type__.is_some() { + return Err(serde::de::Error::duplicate_field("fileType")); + } + file_type__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Filepath => { + if filepath__.is_some() { + return Err(serde::de::Error::duplicate_field("filepath")); + } + filepath__ = Some(map_.next_value()?); + } + GeneratedField::DisableManifest => { + if disable_manifest__.is_some() { + return Err(serde::de::Error::duplicate_field("disableManifest")); + } + disable_manifest__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(FileOutput { + file_type: file_type__.unwrap_or_default(), + filepath: filepath__.unwrap_or_default(), + disable_manifest: disable_manifest__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.FileOutput", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for FilterParams { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -16835,6 +17943,77 @@ impl<'de> serde::Deserialize<'de> for JobAssignment { deserializer.deserialize_struct("livekit.JobAssignment", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for JobRestartPolicy { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::JrpOnFailure => "JRP_ON_FAILURE", + Self::JrpNever => "JRP_NEVER", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for JobRestartPolicy { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "JRP_ON_FAILURE", + "JRP_NEVER", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = JobRestartPolicy; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "JRP_ON_FAILURE" => Ok(JobRestartPolicy::JrpOnFailure), + "JRP_NEVER" => Ok(JobRestartPolicy::JrpNever), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} impl serde::Serialize for JobState { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -20345,6 +21524,154 @@ impl<'de> serde::Deserialize<'de> for MediaSectionsRequirement { deserializer.deserialize_struct("livekit.MediaSectionsRequirement", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for MediaSource { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.audio.is_some() { + len += 1; + } + if self.data.is_some() { + len += 1; + } + if self.video.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.MediaSource", len)?; + if let Some(v) = self.audio.as_ref() { + struct_ser.serialize_field("audio", v)?; + } + if let Some(v) = self.data.as_ref() { + struct_ser.serialize_field("data", v)?; + } + if let Some(v) = self.video.as_ref() { + match v { + media_source::Video::VideoTrackId(v) => { + struct_ser.serialize_field("videoTrackId", v)?; + } + media_source::Video::ParticipantVideo(v) => { + struct_ser.serialize_field("participantVideo", v)?; + } + } + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MediaSource { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "audio", + "data", + "video_track_id", + "videoTrackId", + "participant_video", + "participantVideo", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Audio, + Data, + VideoTrackId, + ParticipantVideo, + __SkipField__, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "audio" => Ok(GeneratedField::Audio), + "data" => Ok(GeneratedField::Data), + "videoTrackId" | "video_track_id" => Ok(GeneratedField::VideoTrackId), + "participantVideo" | "participant_video" => Ok(GeneratedField::ParticipantVideo), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MediaSource; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.MediaSource") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut audio__ = None; + let mut data__ = None; + let mut video__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Audio => { + if audio__.is_some() { + return Err(serde::de::Error::duplicate_field("audio")); + } + audio__ = map_.next_value()?; + } + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = map_.next_value()?; + } + GeneratedField::VideoTrackId => { + if video__.is_some() { + return Err(serde::de::Error::duplicate_field("videoTrackId")); + } + video__ = map_.next_value::<::std::option::Option<_>>()?.map(media_source::Video::VideoTrackId); + } + GeneratedField::ParticipantVideo => { + if video__.is_some() { + return Err(serde::de::Error::duplicate_field("participantVideo")); + } + video__ = map_.next_value::<::std::option::Option<_>>()?.map(media_source::Video::ParticipantVideo) +; + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(MediaSource { + audio: audio__, + data: data__, + video: video__, + }) + } + } + deserializer.deserialize_struct("livekit.MediaSource", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for MetricLabel { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -20801,6 +22128,12 @@ impl serde::Serialize for MetricsRecordingHeader { if !self.room_tags.is_empty() { len += 1; } + if !self.room_name.is_empty() { + len += 1; + } + if self.room_start_time.is_some() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("livekit.MetricsRecordingHeader", len)?; if !self.room_id.is_empty() { struct_ser.serialize_field("roomId", &self.room_id)?; @@ -20816,6 +22149,12 @@ impl serde::Serialize for MetricsRecordingHeader { if !self.room_tags.is_empty() { struct_ser.serialize_field("roomTags", &self.room_tags)?; } + if !self.room_name.is_empty() { + struct_ser.serialize_field("roomName", &self.room_name)?; + } + if let Some(v) = self.room_start_time.as_ref() { + struct_ser.serialize_field("roomStartTime", v)?; + } struct_ser.end() } } @@ -20833,6 +22172,10 @@ impl<'de> serde::Deserialize<'de> for MetricsRecordingHeader { "startTime", "room_tags", "roomTags", + "room_name", + "roomName", + "room_start_time", + "roomStartTime", ]; #[allow(clippy::enum_variant_names)] @@ -20841,6 +22184,8 @@ impl<'de> serde::Deserialize<'de> for MetricsRecordingHeader { Duration, StartTime, RoomTags, + RoomName, + RoomStartTime, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -20867,6 +22212,8 @@ impl<'de> serde::Deserialize<'de> for MetricsRecordingHeader { "duration" => Ok(GeneratedField::Duration), "startTime" | "start_time" => Ok(GeneratedField::StartTime), "roomTags" | "room_tags" => Ok(GeneratedField::RoomTags), + "roomName" | "room_name" => Ok(GeneratedField::RoomName), + "roomStartTime" | "room_start_time" => Ok(GeneratedField::RoomStartTime), _ => Ok(GeneratedField::__SkipField__), } } @@ -20890,6 +22237,8 @@ impl<'de> serde::Deserialize<'de> for MetricsRecordingHeader { let mut duration__ = None; let mut start_time__ = None; let mut room_tags__ = None; + let mut room_name__ = None; + let mut room_start_time__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::RoomId => { @@ -20920,6 +22269,18 @@ impl<'de> serde::Deserialize<'de> for MetricsRecordingHeader { map_.next_value::>()? ); } + GeneratedField::RoomName => { + if room_name__.is_some() { + return Err(serde::de::Error::duplicate_field("roomName")); + } + room_name__ = Some(map_.next_value()?); + } + GeneratedField::RoomStartTime => { + if room_start_time__.is_some() { + return Err(serde::de::Error::duplicate_field("roomStartTime")); + } + room_start_time__ = map_.next_value()?; + } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } @@ -20930,6 +22291,8 @@ impl<'de> serde::Deserialize<'de> for MetricsRecordingHeader { duration: duration__.unwrap_or_default(), start_time: start_time__, room_tags: room_tags__.unwrap_or_default(), + room_name: room_name__.unwrap_or_default(), + room_start_time: room_start_time__, }) } } @@ -21588,6 +22951,162 @@ impl<'de> serde::Deserialize<'de> for MuteTrackRequest { deserializer.deserialize_struct("livekit.MuteTrackRequest", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for Output { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.storage.is_some() { + len += 1; + } + if self.config.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.Output", len)?; + if let Some(v) = self.storage.as_ref() { + struct_ser.serialize_field("storage", v)?; + } + if let Some(v) = self.config.as_ref() { + match v { + output::Config::File(v) => { + struct_ser.serialize_field("file", v)?; + } + output::Config::Stream(v) => { + struct_ser.serialize_field("stream", v)?; + } + output::Config::Segments(v) => { + struct_ser.serialize_field("segments", v)?; + } + output::Config::Images(v) => { + struct_ser.serialize_field("images", v)?; + } + } + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Output { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "storage", + "file", + "stream", + "segments", + "images", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Storage, + File, + Stream, + Segments, + Images, + __SkipField__, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "storage" => Ok(GeneratedField::Storage), + "file" => Ok(GeneratedField::File), + "stream" => Ok(GeneratedField::Stream), + "segments" => Ok(GeneratedField::Segments), + "images" => Ok(GeneratedField::Images), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Output; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.Output") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut storage__ = None; + let mut config__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Storage => { + if storage__.is_some() { + return Err(serde::de::Error::duplicate_field("storage")); + } + storage__ = map_.next_value()?; + } + GeneratedField::File => { + if config__.is_some() { + return Err(serde::de::Error::duplicate_field("file")); + } + config__ = map_.next_value::<::std::option::Option<_>>()?.map(output::Config::File) +; + } + GeneratedField::Stream => { + if config__.is_some() { + return Err(serde::de::Error::duplicate_field("stream")); + } + config__ = map_.next_value::<::std::option::Option<_>>()?.map(output::Config::Stream) +; + } + GeneratedField::Segments => { + if config__.is_some() { + return Err(serde::de::Error::duplicate_field("segments")); + } + config__ = map_.next_value::<::std::option::Option<_>>()?.map(output::Config::Segments) +; + } + GeneratedField::Images => { + if config__.is_some() { + return Err(serde::de::Error::duplicate_field("images")); + } + config__ = map_.next_value::<::std::option::Option<_>>()?.map(output::Config::Images) +; + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(Output { + storage: storage__, + config: config__, + }) + } + } + deserializer.deserialize_struct("livekit.Output", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for PacketTrailerFeature { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -23156,7 +24675,7 @@ impl<'de> serde::Deserialize<'de> for ParticipantUpdate { deserializer.deserialize_struct("livekit.ParticipantUpdate", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for PerformRpcRequest { +impl serde::Serialize for ParticipantVideo { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -23164,63 +24683,38 @@ impl serde::Serialize for PerformRpcRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.room.is_empty() { - len += 1; - } - if !self.destination_identity.is_empty() { - len += 1; - } - if !self.method.is_empty() { - len += 1; - } - if !self.payload.is_empty() { + if !self.identity.is_empty() { len += 1; } - if self.response_timeout_ms != 0 { + if self.prefer_screen_share { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.PerformRpcRequest", len)?; - if !self.room.is_empty() { - struct_ser.serialize_field("room", &self.room)?; - } - if !self.destination_identity.is_empty() { - struct_ser.serialize_field("destinationIdentity", &self.destination_identity)?; + let mut struct_ser = serializer.serialize_struct("livekit.ParticipantVideo", len)?; + if !self.identity.is_empty() { + struct_ser.serialize_field("identity", &self.identity)?; } - if !self.method.is_empty() { - struct_ser.serialize_field("method", &self.method)?; - } - if !self.payload.is_empty() { - struct_ser.serialize_field("payload", &self.payload)?; - } - if self.response_timeout_ms != 0 { - struct_ser.serialize_field("responseTimeoutMs", &self.response_timeout_ms)?; + if self.prefer_screen_share { + struct_ser.serialize_field("preferScreenShare", &self.prefer_screen_share)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for PerformRpcRequest { +impl<'de> serde::Deserialize<'de> for ParticipantVideo { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "room", - "destination_identity", - "destinationIdentity", - "method", - "payload", - "response_timeout_ms", - "responseTimeoutMs", + "identity", + "prefer_screen_share", + "preferScreenShare", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Room, - DestinationIdentity, - Method, - Payload, - ResponseTimeoutMs, + Identity, + PreferScreenShare, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -23243,11 +24737,8 @@ impl<'de> serde::Deserialize<'de> for PerformRpcRequest { E: serde::de::Error, { match value { - "room" => Ok(GeneratedField::Room), - "destinationIdentity" | "destination_identity" => Ok(GeneratedField::DestinationIdentity), - "method" => Ok(GeneratedField::Method), - "payload" => Ok(GeneratedField::Payload), - "responseTimeoutMs" | "response_timeout_ms" => Ok(GeneratedField::ResponseTimeoutMs), + "identity" => Ok(GeneratedField::Identity), + "preferScreenShare" | "prefer_screen_share" => Ok(GeneratedField::PreferScreenShare), _ => Ok(GeneratedField::__SkipField__), } } @@ -23257,73 +24748,47 @@ impl<'de> serde::Deserialize<'de> for PerformRpcRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = PerformRpcRequest; + type Value = ParticipantVideo; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.PerformRpcRequest") + formatter.write_str("struct livekit.ParticipantVideo") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut room__ = None; - let mut destination_identity__ = None; - let mut method__ = None; - let mut payload__ = None; - let mut response_timeout_ms__ = None; + let mut identity__ = None; + let mut prefer_screen_share__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Room => { - if room__.is_some() { - return Err(serde::de::Error::duplicate_field("room")); - } - room__ = Some(map_.next_value()?); - } - GeneratedField::DestinationIdentity => { - if destination_identity__.is_some() { - return Err(serde::de::Error::duplicate_field("destinationIdentity")); - } - destination_identity__ = Some(map_.next_value()?); - } - GeneratedField::Method => { - if method__.is_some() { - return Err(serde::de::Error::duplicate_field("method")); + GeneratedField::Identity => { + if identity__.is_some() { + return Err(serde::de::Error::duplicate_field("identity")); } - method__ = Some(map_.next_value()?); + identity__ = Some(map_.next_value()?); } - GeneratedField::Payload => { - if payload__.is_some() { - return Err(serde::de::Error::duplicate_field("payload")); + GeneratedField::PreferScreenShare => { + if prefer_screen_share__.is_some() { + return Err(serde::de::Error::duplicate_field("preferScreenShare")); } - payload__ = Some(map_.next_value()?); - } - GeneratedField::ResponseTimeoutMs => { - if response_timeout_ms__.is_some() { - return Err(serde::de::Error::duplicate_field("responseTimeoutMs")); - } - response_timeout_ms__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + prefer_screen_share__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(PerformRpcRequest { - room: room__.unwrap_or_default(), - destination_identity: destination_identity__.unwrap_or_default(), - method: method__.unwrap_or_default(), - payload: payload__.unwrap_or_default(), - response_timeout_ms: response_timeout_ms__.unwrap_or_default(), + Ok(ParticipantVideo { + identity: identity__.unwrap_or_default(), + prefer_screen_share: prefer_screen_share__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.PerformRpcRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ParticipantVideo", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for PerformRpcResponse { +impl serde::Serialize for PerformRpcRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -23331,17 +24796,184 @@ impl serde::Serialize for PerformRpcResponse { { use serde::ser::SerializeStruct; let mut len = 0; + if !self.room.is_empty() { + len += 1; + } + if !self.destination_identity.is_empty() { + len += 1; + } + if !self.method.is_empty() { + len += 1; + } if !self.payload.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.PerformRpcResponse", len)?; + if self.response_timeout_ms != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.PerformRpcRequest", len)?; + if !self.room.is_empty() { + struct_ser.serialize_field("room", &self.room)?; + } + if !self.destination_identity.is_empty() { + struct_ser.serialize_field("destinationIdentity", &self.destination_identity)?; + } + if !self.method.is_empty() { + struct_ser.serialize_field("method", &self.method)?; + } if !self.payload.is_empty() { struct_ser.serialize_field("payload", &self.payload)?; } + if self.response_timeout_ms != 0 { + struct_ser.serialize_field("responseTimeoutMs", &self.response_timeout_ms)?; + } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for PerformRpcResponse { +impl<'de> serde::Deserialize<'de> for PerformRpcRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "room", + "destination_identity", + "destinationIdentity", + "method", + "payload", + "response_timeout_ms", + "responseTimeoutMs", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Room, + DestinationIdentity, + Method, + Payload, + ResponseTimeoutMs, + __SkipField__, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "room" => Ok(GeneratedField::Room), + "destinationIdentity" | "destination_identity" => Ok(GeneratedField::DestinationIdentity), + "method" => Ok(GeneratedField::Method), + "payload" => Ok(GeneratedField::Payload), + "responseTimeoutMs" | "response_timeout_ms" => Ok(GeneratedField::ResponseTimeoutMs), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = PerformRpcRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.PerformRpcRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut room__ = None; + let mut destination_identity__ = None; + let mut method__ = None; + let mut payload__ = None; + let mut response_timeout_ms__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Room => { + if room__.is_some() { + return Err(serde::de::Error::duplicate_field("room")); + } + room__ = Some(map_.next_value()?); + } + GeneratedField::DestinationIdentity => { + if destination_identity__.is_some() { + return Err(serde::de::Error::duplicate_field("destinationIdentity")); + } + destination_identity__ = Some(map_.next_value()?); + } + GeneratedField::Method => { + if method__.is_some() { + return Err(serde::de::Error::duplicate_field("method")); + } + method__ = Some(map_.next_value()?); + } + GeneratedField::Payload => { + if payload__.is_some() { + return Err(serde::de::Error::duplicate_field("payload")); + } + payload__ = Some(map_.next_value()?); + } + GeneratedField::ResponseTimeoutMs => { + if response_timeout_ms__.is_some() { + return Err(serde::de::Error::duplicate_field("responseTimeoutMs")); + } + response_timeout_ms__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(PerformRpcRequest { + room: room__.unwrap_or_default(), + destination_identity: destination_identity__.unwrap_or_default(), + method: method__.unwrap_or_default(), + payload: payload__.unwrap_or_default(), + response_timeout_ms: response_timeout_ms__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.PerformRpcRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for PerformRpcResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.payload.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.PerformRpcResponse", len)?; + if !self.payload.is_empty() { + struct_ser.serialize_field("payload", &self.payload)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for PerformRpcResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where @@ -27901,6 +29533,9 @@ impl serde::Serialize for RoomAgentDispatch { if !self.metadata.is_empty() { len += 1; } + if self.restart_policy != 0 { + len += 1; + } let mut struct_ser = serializer.serialize_struct("livekit.RoomAgentDispatch", len)?; if !self.agent_name.is_empty() { struct_ser.serialize_field("agentName", &self.agent_name)?; @@ -27908,6 +29543,11 @@ impl serde::Serialize for RoomAgentDispatch { if !self.metadata.is_empty() { struct_ser.serialize_field("metadata", &self.metadata)?; } + if self.restart_policy != 0 { + let v = JobRestartPolicy::try_from(self.restart_policy) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.restart_policy)))?; + struct_ser.serialize_field("restartPolicy", &v)?; + } struct_ser.end() } } @@ -27921,12 +29561,15 @@ impl<'de> serde::Deserialize<'de> for RoomAgentDispatch { "agent_name", "agentName", "metadata", + "restart_policy", + "restartPolicy", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { AgentName, Metadata, + RestartPolicy, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -27951,6 +29594,7 @@ impl<'de> serde::Deserialize<'de> for RoomAgentDispatch { match value { "agentName" | "agent_name" => Ok(GeneratedField::AgentName), "metadata" => Ok(GeneratedField::Metadata), + "restartPolicy" | "restart_policy" => Ok(GeneratedField::RestartPolicy), _ => Ok(GeneratedField::__SkipField__), } } @@ -27972,6 +29616,7 @@ impl<'de> serde::Deserialize<'de> for RoomAgentDispatch { { let mut agent_name__ = None; let mut metadata__ = None; + let mut restart_policy__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::AgentName => { @@ -27986,6 +29631,12 @@ impl<'de> serde::Deserialize<'de> for RoomAgentDispatch { } metadata__ = Some(map_.next_value()?); } + GeneratedField::RestartPolicy => { + if restart_policy__.is_some() { + return Err(serde::de::Error::duplicate_field("restartPolicy")); + } + restart_policy__ = Some(map_.next_value::()? as i32); + } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } @@ -27994,6 +29645,7 @@ impl<'de> serde::Deserialize<'de> for RoomAgentDispatch { Ok(RoomAgentDispatch { agent_name: agent_name__.unwrap_or_default(), metadata: metadata__.unwrap_or_default(), + restart_policy: restart_policy__.unwrap_or_default(), }) } } @@ -28398,6 +30050,9 @@ impl serde::Serialize for RoomConfiguration { if !self.agents.is_empty() { len += 1; } + if !self.tags.is_empty() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("livekit.RoomConfiguration", len)?; if !self.name.is_empty() { struct_ser.serialize_field("name", &self.name)?; @@ -28429,6 +30084,9 @@ impl serde::Serialize for RoomConfiguration { if !self.agents.is_empty() { struct_ser.serialize_field("agents", &self.agents)?; } + if !self.tags.is_empty() { + struct_ser.serialize_field("tags", &self.tags)?; + } struct_ser.end() } } @@ -28455,6 +30113,7 @@ impl<'de> serde::Deserialize<'de> for RoomConfiguration { "sync_streams", "syncStreams", "agents", + "tags", ]; #[allow(clippy::enum_variant_names)] @@ -28469,6 +30128,7 @@ impl<'de> serde::Deserialize<'de> for RoomConfiguration { MaxPlayoutDelay, SyncStreams, Agents, + Tags, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -28501,6 +30161,7 @@ impl<'de> serde::Deserialize<'de> for RoomConfiguration { "maxPlayoutDelay" | "max_playout_delay" => Ok(GeneratedField::MaxPlayoutDelay), "syncStreams" | "sync_streams" => Ok(GeneratedField::SyncStreams), "agents" => Ok(GeneratedField::Agents), + "tags" => Ok(GeneratedField::Tags), _ => Ok(GeneratedField::__SkipField__), } } @@ -28530,6 +30191,7 @@ impl<'de> serde::Deserialize<'de> for RoomConfiguration { let mut max_playout_delay__ = None; let mut sync_streams__ = None; let mut agents__ = None; + let mut tags__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Name => { @@ -28602,6 +30264,14 @@ impl<'de> serde::Deserialize<'de> for RoomConfiguration { } agents__ = Some(map_.next_value()?); } + GeneratedField::Tags => { + if tags__.is_some() { + return Err(serde::de::Error::duplicate_field("tags")); + } + tags__ = Some( + map_.next_value::>()? + ); + } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } @@ -28618,6 +30288,7 @@ impl<'de> serde::Deserialize<'de> for RoomConfiguration { max_playout_delay: max_playout_delay__.unwrap_or_default(), sync_streams: sync_streams__.unwrap_or_default(), agents: agents__.unwrap_or_default(), + tags: tags__.unwrap_or_default(), }) } } @@ -38415,7 +40086,451 @@ impl<'de> serde::Deserialize<'de> for SpeakersChanged { E: serde::de::Error, { match value { - "speakers" => Ok(GeneratedField::Speakers), + "speakers" => Ok(GeneratedField::Speakers), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SpeakersChanged; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.SpeakersChanged") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut speakers__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Speakers => { + if speakers__.is_some() { + return Err(serde::de::Error::duplicate_field("speakers")); + } + speakers__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(SpeakersChanged { + speakers: speakers__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.SpeakersChanged", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for StartEgressRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.room_name.is_empty() { + len += 1; + } + if !self.outputs.is_empty() { + len += 1; + } + if self.storage.is_some() { + len += 1; + } + if !self.webhooks.is_empty() { + len += 1; + } + if self.source.is_some() { + len += 1; + } + if self.encoding.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.StartEgressRequest", len)?; + if !self.room_name.is_empty() { + struct_ser.serialize_field("roomName", &self.room_name)?; + } + if !self.outputs.is_empty() { + struct_ser.serialize_field("outputs", &self.outputs)?; + } + if let Some(v) = self.storage.as_ref() { + struct_ser.serialize_field("storage", v)?; + } + if !self.webhooks.is_empty() { + struct_ser.serialize_field("webhooks", &self.webhooks)?; + } + if let Some(v) = self.source.as_ref() { + match v { + start_egress_request::Source::Template(v) => { + struct_ser.serialize_field("template", v)?; + } + start_egress_request::Source::Web(v) => { + struct_ser.serialize_field("web", v)?; + } + start_egress_request::Source::Media(v) => { + struct_ser.serialize_field("media", v)?; + } + } + } + if let Some(v) = self.encoding.as_ref() { + match v { + start_egress_request::Encoding::Preset(v) => { + let v = EncodingOptionsPreset::try_from(*v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("preset", &v)?; + } + start_egress_request::Encoding::Advanced(v) => { + struct_ser.serialize_field("advanced", v)?; + } + } + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for StartEgressRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "room_name", + "roomName", + "outputs", + "storage", + "webhooks", + "template", + "web", + "media", + "preset", + "advanced", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + RoomName, + Outputs, + Storage, + Webhooks, + Template, + Web, + Media, + Preset, + Advanced, + __SkipField__, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "roomName" | "room_name" => Ok(GeneratedField::RoomName), + "outputs" => Ok(GeneratedField::Outputs), + "storage" => Ok(GeneratedField::Storage), + "webhooks" => Ok(GeneratedField::Webhooks), + "template" => Ok(GeneratedField::Template), + "web" => Ok(GeneratedField::Web), + "media" => Ok(GeneratedField::Media), + "preset" => Ok(GeneratedField::Preset), + "advanced" => Ok(GeneratedField::Advanced), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = StartEgressRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.StartEgressRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut room_name__ = None; + let mut outputs__ = None; + let mut storage__ = None; + let mut webhooks__ = None; + let mut source__ = None; + let mut encoding__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::RoomName => { + if room_name__.is_some() { + return Err(serde::de::Error::duplicate_field("roomName")); + } + room_name__ = Some(map_.next_value()?); + } + GeneratedField::Outputs => { + if outputs__.is_some() { + return Err(serde::de::Error::duplicate_field("outputs")); + } + outputs__ = Some(map_.next_value()?); + } + GeneratedField::Storage => { + if storage__.is_some() { + return Err(serde::de::Error::duplicate_field("storage")); + } + storage__ = map_.next_value()?; + } + GeneratedField::Webhooks => { + if webhooks__.is_some() { + return Err(serde::de::Error::duplicate_field("webhooks")); + } + webhooks__ = Some(map_.next_value()?); + } + GeneratedField::Template => { + if source__.is_some() { + return Err(serde::de::Error::duplicate_field("template")); + } + source__ = map_.next_value::<::std::option::Option<_>>()?.map(start_egress_request::Source::Template) +; + } + GeneratedField::Web => { + if source__.is_some() { + return Err(serde::de::Error::duplicate_field("web")); + } + source__ = map_.next_value::<::std::option::Option<_>>()?.map(start_egress_request::Source::Web) +; + } + GeneratedField::Media => { + if source__.is_some() { + return Err(serde::de::Error::duplicate_field("media")); + } + source__ = map_.next_value::<::std::option::Option<_>>()?.map(start_egress_request::Source::Media) +; + } + GeneratedField::Preset => { + if encoding__.is_some() { + return Err(serde::de::Error::duplicate_field("preset")); + } + encoding__ = map_.next_value::<::std::option::Option>()?.map(|x| start_egress_request::Encoding::Preset(x as i32)); + } + GeneratedField::Advanced => { + if encoding__.is_some() { + return Err(serde::de::Error::duplicate_field("advanced")); + } + encoding__ = map_.next_value::<::std::option::Option<_>>()?.map(start_egress_request::Encoding::Advanced) +; + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(StartEgressRequest { + room_name: room_name__.unwrap_or_default(), + outputs: outputs__.unwrap_or_default(), + storage: storage__, + webhooks: webhooks__.unwrap_or_default(), + source: source__, + encoding: encoding__, + }) + } + } + deserializer.deserialize_struct("livekit.StartEgressRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for StopEgressRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.egress_id.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.StopEgressRequest", len)?; + if !self.egress_id.is_empty() { + struct_ser.serialize_field("egressId", &self.egress_id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for StopEgressRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "egress_id", + "egressId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + EgressId, + __SkipField__, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "egressId" | "egress_id" => Ok(GeneratedField::EgressId), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = StopEgressRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.StopEgressRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut egress_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::EgressId => { + if egress_id__.is_some() { + return Err(serde::de::Error::duplicate_field("egressId")); + } + egress_id__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(StopEgressRequest { + egress_id: egress_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.StopEgressRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for StorageConfig { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.provider.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.StorageConfig", len)?; + if let Some(v) = self.provider.as_ref() { + match v { + storage_config::Provider::S3(v) => { + struct_ser.serialize_field("s3", v)?; + } + storage_config::Provider::Gcp(v) => { + struct_ser.serialize_field("gcp", v)?; + } + storage_config::Provider::Azure(v) => { + struct_ser.serialize_field("azure", v)?; + } + storage_config::Provider::AliOss(v) => { + struct_ser.serialize_field("aliOSS", v)?; + } + } + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for StorageConfig { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "s3", + "gcp", + "azure", + "aliOSS", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + S3, + Gcp, + Azure, + AliOss, + __SkipField__, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "s3" => Ok(GeneratedField::S3), + "gcp" => Ok(GeneratedField::Gcp), + "azure" => Ok(GeneratedField::Azure), + "aliOSS" => Ok(GeneratedField::AliOss), _ => Ok(GeneratedField::__SkipField__), } } @@ -38425,132 +40540,58 @@ impl<'de> serde::Deserialize<'de> for SpeakersChanged { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SpeakersChanged; + type Value = StorageConfig; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SpeakersChanged") + formatter.write_str("struct livekit.StorageConfig") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut speakers__ = None; + let mut provider__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Speakers => { - if speakers__.is_some() { - return Err(serde::de::Error::duplicate_field("speakers")); + GeneratedField::S3 => { + if provider__.is_some() { + return Err(serde::de::Error::duplicate_field("s3")); } - speakers__ = Some(map_.next_value()?); + provider__ = map_.next_value::<::std::option::Option<_>>()?.map(storage_config::Provider::S3) +; } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; + GeneratedField::Gcp => { + if provider__.is_some() { + return Err(serde::de::Error::duplicate_field("gcp")); + } + provider__ = map_.next_value::<::std::option::Option<_>>()?.map(storage_config::Provider::Gcp) +; } - } - } - Ok(SpeakersChanged { - speakers: speakers__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("livekit.SpeakersChanged", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for StopEgressRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.egress_id.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("livekit.StopEgressRequest", len)?; - if !self.egress_id.is_empty() { - struct_ser.serialize_field("egressId", &self.egress_id)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for StopEgressRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "egress_id", - "egressId", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - EgressId, - __SkipField__, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "egressId" | "egress_id" => Ok(GeneratedField::EgressId), - _ => Ok(GeneratedField::__SkipField__), + GeneratedField::Azure => { + if provider__.is_some() { + return Err(serde::de::Error::duplicate_field("azure")); + } + provider__ = map_.next_value::<::std::option::Option<_>>()?.map(storage_config::Provider::Azure) +; } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = StopEgressRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.StopEgressRequest") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut egress_id__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::EgressId => { - if egress_id__.is_some() { - return Err(serde::de::Error::duplicate_field("egressId")); + GeneratedField::AliOss => { + if provider__.is_some() { + return Err(serde::de::Error::duplicate_field("aliOSS")); } - egress_id__ = Some(map_.next_value()?); + provider__ = map_.next_value::<::std::option::Option<_>>()?.map(storage_config::Provider::AliOss) +; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(StopEgressRequest { - egress_id: egress_id__.unwrap_or_default(), + Ok(StorageConfig { + provider: provider__, }) } } - deserializer.deserialize_struct("livekit.StopEgressRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.StorageConfig", FIELDS, GeneratedVisitor) } } impl serde::Serialize for StreamInfo { @@ -39083,6 +41124,7 @@ impl serde::Serialize for StreamProtocol { Self::DefaultProtocol => "DEFAULT_PROTOCOL", Self::Rtmp => "RTMP", Self::Srt => "SRT", + Self::Websocket => "WEBSOCKET", }; serializer.serialize_str(variant) } @@ -39097,6 +41139,7 @@ impl<'de> serde::Deserialize<'de> for StreamProtocol { "DEFAULT_PROTOCOL", "RTMP", "SRT", + "WEBSOCKET", ]; struct GeneratedVisitor; @@ -39140,6 +41183,7 @@ impl<'de> serde::Deserialize<'de> for StreamProtocol { "DEFAULT_PROTOCOL" => Ok(StreamProtocol::DefaultProtocol), "RTMP" => Ok(StreamProtocol::Rtmp), "SRT" => Ok(StreamProtocol::Srt), + "WEBSOCKET" => Ok(StreamProtocol::Websocket), _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } } @@ -40684,6 +42728,155 @@ impl<'de> serde::Deserialize<'de> for SyncState { deserializer.deserialize_struct("livekit.SyncState", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for TemplateSource { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.layout.is_empty() { + len += 1; + } + if self.audio_only { + len += 1; + } + if self.video_only { + len += 1; + } + if !self.custom_base_url.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.TemplateSource", len)?; + if !self.layout.is_empty() { + struct_ser.serialize_field("layout", &self.layout)?; + } + if self.audio_only { + struct_ser.serialize_field("audioOnly", &self.audio_only)?; + } + if self.video_only { + struct_ser.serialize_field("videoOnly", &self.video_only)?; + } + if !self.custom_base_url.is_empty() { + struct_ser.serialize_field("customBaseUrl", &self.custom_base_url)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for TemplateSource { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "layout", + "audio_only", + "audioOnly", + "video_only", + "videoOnly", + "custom_base_url", + "customBaseUrl", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Layout, + AudioOnly, + VideoOnly, + CustomBaseUrl, + __SkipField__, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "layout" => Ok(GeneratedField::Layout), + "audioOnly" | "audio_only" => Ok(GeneratedField::AudioOnly), + "videoOnly" | "video_only" => Ok(GeneratedField::VideoOnly), + "customBaseUrl" | "custom_base_url" => Ok(GeneratedField::CustomBaseUrl), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = TemplateSource; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.TemplateSource") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut layout__ = None; + let mut audio_only__ = None; + let mut video_only__ = None; + let mut custom_base_url__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Layout => { + if layout__.is_some() { + return Err(serde::de::Error::duplicate_field("layout")); + } + layout__ = Some(map_.next_value()?); + } + GeneratedField::AudioOnly => { + if audio_only__.is_some() { + return Err(serde::de::Error::duplicate_field("audioOnly")); + } + audio_only__ = Some(map_.next_value()?); + } + GeneratedField::VideoOnly => { + if video_only__.is_some() { + return Err(serde::de::Error::duplicate_field("videoOnly")); + } + video_only__ = Some(map_.next_value()?); + } + GeneratedField::CustomBaseUrl => { + if custom_base_url__.is_some() { + return Err(serde::de::Error::duplicate_field("customBaseUrl")); + } + custom_base_url__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(TemplateSource { + layout: layout__.unwrap_or_default(), + audio_only: audio_only__.unwrap_or_default(), + video_only: video_only__.unwrap_or_default(), + custom_base_url: custom_base_url__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.TemplateSource", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for TimeSeriesMetric { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -43668,6 +45861,172 @@ impl<'de> serde::Deserialize<'de> for update_data_subscription::Update { deserializer.deserialize_struct("livekit.UpdateDataSubscription.Update", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for UpdateEgressRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.egress_id.is_empty() { + len += 1; + } + if !self.url.is_empty() { + len += 1; + } + if !self.layout.is_empty() { + len += 1; + } + if !self.add_stream_urls.is_empty() { + len += 1; + } + if !self.remove_stream_urls.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.UpdateEgressRequest", len)?; + if !self.egress_id.is_empty() { + struct_ser.serialize_field("egressId", &self.egress_id)?; + } + if !self.url.is_empty() { + struct_ser.serialize_field("url", &self.url)?; + } + if !self.layout.is_empty() { + struct_ser.serialize_field("layout", &self.layout)?; + } + if !self.add_stream_urls.is_empty() { + struct_ser.serialize_field("addStreamUrls", &self.add_stream_urls)?; + } + if !self.remove_stream_urls.is_empty() { + struct_ser.serialize_field("removeStreamUrls", &self.remove_stream_urls)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for UpdateEgressRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "egress_id", + "egressId", + "url", + "layout", + "add_stream_urls", + "addStreamUrls", + "remove_stream_urls", + "removeStreamUrls", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + EgressId, + Url, + Layout, + AddStreamUrls, + RemoveStreamUrls, + __SkipField__, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "egressId" | "egress_id" => Ok(GeneratedField::EgressId), + "url" => Ok(GeneratedField::Url), + "layout" => Ok(GeneratedField::Layout), + "addStreamUrls" | "add_stream_urls" => Ok(GeneratedField::AddStreamUrls), + "removeStreamUrls" | "remove_stream_urls" => Ok(GeneratedField::RemoveStreamUrls), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = UpdateEgressRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.UpdateEgressRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut egress_id__ = None; + let mut url__ = None; + let mut layout__ = None; + let mut add_stream_urls__ = None; + let mut remove_stream_urls__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::EgressId => { + if egress_id__.is_some() { + return Err(serde::de::Error::duplicate_field("egressId")); + } + egress_id__ = Some(map_.next_value()?); + } + GeneratedField::Url => { + if url__.is_some() { + return Err(serde::de::Error::duplicate_field("url")); + } + url__ = Some(map_.next_value()?); + } + GeneratedField::Layout => { + if layout__.is_some() { + return Err(serde::de::Error::duplicate_field("layout")); + } + layout__ = Some(map_.next_value()?); + } + GeneratedField::AddStreamUrls => { + if add_stream_urls__.is_some() { + return Err(serde::de::Error::duplicate_field("addStreamUrls")); + } + add_stream_urls__ = Some(map_.next_value()?); + } + GeneratedField::RemoveStreamUrls => { + if remove_stream_urls__.is_some() { + return Err(serde::de::Error::duplicate_field("removeStreamUrls")); + } + remove_stream_urls__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(UpdateEgressRequest { + egress_id: egress_id__.unwrap_or_default(), + url: url__.unwrap_or_default(), + layout: layout__.unwrap_or_default(), + add_stream_urls: add_stream_urls__.unwrap_or_default(), + remove_stream_urls: remove_stream_urls__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.UpdateEgressRequest", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for UpdateIngressRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -47595,6 +49954,155 @@ impl<'de> serde::Deserialize<'de> for WebEgressRequest { deserializer.deserialize_struct("livekit.WebEgressRequest", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for WebSource { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.url.is_empty() { + len += 1; + } + if self.audio_only { + len += 1; + } + if self.video_only { + len += 1; + } + if self.await_start_signal { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.WebSource", len)?; + if !self.url.is_empty() { + struct_ser.serialize_field("url", &self.url)?; + } + if self.audio_only { + struct_ser.serialize_field("audioOnly", &self.audio_only)?; + } + if self.video_only { + struct_ser.serialize_field("videoOnly", &self.video_only)?; + } + if self.await_start_signal { + struct_ser.serialize_field("awaitStartSignal", &self.await_start_signal)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for WebSource { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "url", + "audio_only", + "audioOnly", + "video_only", + "videoOnly", + "await_start_signal", + "awaitStartSignal", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Url, + AudioOnly, + VideoOnly, + AwaitStartSignal, + __SkipField__, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "url" => Ok(GeneratedField::Url), + "audioOnly" | "audio_only" => Ok(GeneratedField::AudioOnly), + "videoOnly" | "video_only" => Ok(GeneratedField::VideoOnly), + "awaitStartSignal" | "await_start_signal" => Ok(GeneratedField::AwaitStartSignal), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = WebSource; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.WebSource") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut url__ = None; + let mut audio_only__ = None; + let mut video_only__ = None; + let mut await_start_signal__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Url => { + if url__.is_some() { + return Err(serde::de::Error::duplicate_field("url")); + } + url__ = Some(map_.next_value()?); + } + GeneratedField::AudioOnly => { + if audio_only__.is_some() { + return Err(serde::de::Error::duplicate_field("audioOnly")); + } + audio_only__ = Some(map_.next_value()?); + } + GeneratedField::VideoOnly => { + if video_only__.is_some() { + return Err(serde::de::Error::duplicate_field("videoOnly")); + } + video_only__ = Some(map_.next_value()?); + } + GeneratedField::AwaitStartSignal => { + if await_start_signal__.is_some() { + return Err(serde::de::Error::duplicate_field("awaitStartSignal")); + } + await_start_signal__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(WebSource { + url: url__.unwrap_or_default(), + audio_only: audio_only__.unwrap_or_default(), + video_only: video_only__.unwrap_or_default(), + await_start_signal: await_start_signal__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.WebSource", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for WebhookConfig { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result diff --git a/livekit-uniffi/src/access_token.rs b/livekit-uniffi/src/access_token.rs index f9d61fd58..531b5e525 100644 --- a/livekit-uniffi/src/access_token.rs +++ b/livekit-uniffi/src/access_token.rs @@ -69,6 +69,7 @@ pub struct SIPGrants { pub struct RoomAgentDispatch { pub agent_name: String, pub metadata: String, + pub restart_policy: i32, } /// Room configuration @@ -223,6 +224,7 @@ pub fn token_generate( sync_streams: room_configuration.sync_streams, agents: room_configuration.agents, egress: None, + tags: HashMap::default(), }; token = token.with_room_config(room_config); }