From 8afcb52c9a2c9054867e1396eed4434542d04d44 Mon Sep 17 00:00:00 2001 From: Ben Cherry Date: Thu, 3 Oct 2024 16:06:47 -0700 Subject: [PATCH] Update to livekit-protocol v1.23.0 (Stubs only), fix tests (#458) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * proto * generated protobuf * stubs * Fix datatype * Fix tests * file tweak * diag * diag * synthetic * fmt * Cleanup * 3s * doc * Default::default(), * comma * Update livekit/src/rtc_engine/rtc_session.rs Co-authored-by: Théo Monnom --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Théo Monnom --- .gitignore | 5 +- examples/play_from_disk/change-sophie.wav | 4 +- livekit-api/src/services/sip.rs | 6 + livekit-protocol/protocol | 2 +- livekit-protocol/src/livekit.rs | 370 +- livekit-protocol/src/livekit.serde.rs | 9297 +++++++++++++-------- livekit/src/rtc_engine/rtc_session.rs | 1 + soxr-sys/src/lib.rs | 63 +- 8 files changed, 6428 insertions(+), 3320 deletions(-) diff --git a/.gitignore b/.gitignore index 3d98c20c8..b37534470 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ target -/.idea \ No newline at end of file +/.idea +soxr-sys/test-input.wav +soxr-sys/test-output.wav +.DS_Store \ No newline at end of file diff --git a/examples/play_from_disk/change-sophie.wav b/examples/play_from_disk/change-sophie.wav index 80a9c6af9..f4f760c72 100644 --- a/examples/play_from_disk/change-sophie.wav +++ b/examples/play_from_disk/change-sophie.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:16a978d4be2506cca5e25c5b7aa5b0e53451049d979684d9168c1a81beb4babd -size 570264 +oid sha256:d55ab1ab891488d129ab94ddc4ea567a5e297cc183f84a7d98c6741070334fb6 +size 570298 diff --git a/livekit-api/src/services/sip.rs b/livekit-api/src/services/sip.rs index 55ddf30ad..aaf796f5d 100644 --- a/livekit-api/src/services/sip.rs +++ b/livekit-api/src/services/sip.rs @@ -200,6 +200,9 @@ impl SIPClient { allowed_addresses: options.allowed_addresses.to_owned(), auth_username: options.auth_username.to_owned(), auth_password: options.auth_password.to_owned(), + + headers: Default::default(), + headers_to_attributes: Default::default(), }), }, self.base.auth_header( @@ -233,6 +236,9 @@ impl SIPClient { auth_username: options.auth_username.to_owned(), auth_password: options.auth_password.to_owned(), + + headers: Default::default(), + headers_to_attributes: Default::default(), }), }, self.base.auth_header( diff --git a/livekit-protocol/protocol b/livekit-protocol/protocol index 5c7350d25..a601adc5e 160000 --- a/livekit-protocol/protocol +++ b/livekit-protocol/protocol @@ -1 +1 @@ -Subproject commit 5c7350d25904ed8fd8163e91ff47f0577ca6afad +Subproject commit a601adc5e9027820857a6d445b32a868b19d4184 diff --git a/livekit-protocol/src/livekit.rs b/livekit-protocol/src/livekit.rs index 39426bdef..19181c255 100644 --- a/livekit-protocol/src/livekit.rs +++ b/livekit-protocol/src/livekit.rs @@ -2,6 +2,184 @@ // This file is @generated by prost-build. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] +pub struct MetricsBatch { + /// time at which this batch is sent based on a monotonic clock (millisecond resolution) + #[prost(int64, tag="1")] + pub timestamp_ms: i64, + #[prost(message, optional, tag="2")] + pub normalized_timestamp: ::core::option::Option<::pbjson_types::Timestamp>, + /// To avoid repeating string values, we store them in a separate list and reference them by index + /// This is useful for storing participant identities, track names, etc. + /// There is also a predefined list of labels that can be used to reference common metrics. + /// They have reserved indices from 0 to (METRIC_LABEL_PREDEFINED_MAX_VALUE - 1). + /// Indexes pointing at str_data should start from METRIC_LABEL_PREDEFINED_MAX_VALUE, + /// such that str_data\[0\] == index of METRIC_LABEL_PREDEFINED_MAX_VALUE. + #[prost(string, repeated, tag="3")] + pub str_data: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(message, repeated, tag="4")] + pub time_series: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="5")] + pub events: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TimeSeriesMetric { + /// Metric name e.g "speech_probablity". The string value is not directly stored in the message, but referenced by index + /// in the `str_data` field of `MetricsBatch` + #[prost(uint32, tag="1")] + pub label: u32, + /// index into `str_data` + #[prost(uint32, tag="2")] + pub participant_identity: u32, + /// index into `str_data` + #[prost(uint32, tag="3")] + pub track_sid: u32, + #[prost(message, repeated, tag="4")] + pub samples: ::prost::alloc::vec::Vec, + /// index into 'str_data' + #[prost(uint32, tag="5")] + pub rid: u32, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MetricSample { + /// time of metric based on a monotonic clock (in milliseconds) + #[prost(int64, tag="1")] + pub timestamp_ms: i64, + #[prost(message, optional, tag="2")] + pub normalized_timestamp: ::core::option::Option<::pbjson_types::Timestamp>, + #[prost(float, tag="3")] + pub value: f32, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EventMetric { + #[prost(uint32, tag="1")] + pub label: u32, + /// index into `str_data` + #[prost(uint32, tag="2")] + pub participant_identity: u32, + /// index into `str_data` + #[prost(uint32, tag="3")] + pub track_sid: u32, + /// start time of event based on a monotonic clock (in milliseconds) + #[prost(int64, tag="4")] + pub start_timestamp_ms: i64, + /// end time of event based on a monotonic clock (in milliseconds), if needed + #[prost(int64, optional, tag="5")] + pub end_timestamp_ms: ::core::option::Option, + #[prost(message, optional, tag="6")] + pub normalized_start_timestamp: ::core::option::Option<::pbjson_types::Timestamp>, + #[prost(message, optional, tag="7")] + pub normalized_end_timestamp: ::core::option::Option<::pbjson_types::Timestamp>, + #[prost(string, tag="8")] + pub metadata: ::prost::alloc::string::String, + /// index into 'str_data' + #[prost(uint32, tag="9")] + pub rid: u32, +} +// +// Protocol used to record metrics for a specific session. +// +// Clients send their timestamp in their own monotonically increasing time (e.g `performance.now` on JS). +// These timestamps are then augmented by the SFU to its time base. +// +// A metric can be linked to a specific track by setting `track_sid`. + +/// index from [0: MAX_LABEL_PREDEFINED_MAX_VALUE) are for predefined labels (`MetricLabel`) +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum MetricLabel { + /// time to first token from LLM + AgentsLlmTtft = 0, + /// time to final transcription + AgentsSttTtft = 1, + /// time to first byte + AgentsTtsTtfb = 2, + /// Number of video freezes + ClientVideoSubscriberFreezeCount = 3, + /// total duration of freezes + ClientVideoSubscriberTotalFreezeDuration = 4, + /// number of video pauses + ClientVideoSubscriberPauseCount = 5, + /// total duration of pauses + ClientVideoSubscriberTotalPausesDuration = 6, + /// number of concealed (synthesized) audio samples + ClientAudioSubscriberConcealedSamples = 7, + /// number of silent concealed samples + ClientAudioSubscriberSilentConcealedSamples = 8, + /// number of concealment events + ClientAudioSubscriberConcealmentEvents = 9, + /// number of interruptions + ClientAudioSubscriberInterruptionCount = 10, + /// total duration of interruptions + ClientAudioSubscriberTotalInterruptionDuration = 11, + /// total time spent in jitter buffer + ClientSubscriberJitterBufferDelay = 12, + /// total time spent in jitter buffer + ClientSubscriberJitterBufferEmittedCount = 13, + /// total duration spent in bandwidth quality limitation + ClientVideoPublisherQualityLimitationDurationBandwidth = 14, + /// total duration spent in cpu quality limitation + ClientVideoPublisherQualityLimitationDurationCpu = 15, + /// total duration spent in other quality limitation + ClientVideoPublisherQualityLimitationDurationOther = 16, + PredefinedMaxValue = 4096, +} +impl MetricLabel { + /// 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 { + MetricLabel::AgentsLlmTtft => "AGENTS_LLM_TTFT", + MetricLabel::AgentsSttTtft => "AGENTS_STT_TTFT", + MetricLabel::AgentsTtsTtfb => "AGENTS_TTS_TTFB", + MetricLabel::ClientVideoSubscriberFreezeCount => "CLIENT_VIDEO_SUBSCRIBER_FREEZE_COUNT", + MetricLabel::ClientVideoSubscriberTotalFreezeDuration => "CLIENT_VIDEO_SUBSCRIBER_TOTAL_FREEZE_DURATION", + MetricLabel::ClientVideoSubscriberPauseCount => "CLIENT_VIDEO_SUBSCRIBER_PAUSE_COUNT", + MetricLabel::ClientVideoSubscriberTotalPausesDuration => "CLIENT_VIDEO_SUBSCRIBER_TOTAL_PAUSES_DURATION", + MetricLabel::ClientAudioSubscriberConcealedSamples => "CLIENT_AUDIO_SUBSCRIBER_CONCEALED_SAMPLES", + MetricLabel::ClientAudioSubscriberSilentConcealedSamples => "CLIENT_AUDIO_SUBSCRIBER_SILENT_CONCEALED_SAMPLES", + MetricLabel::ClientAudioSubscriberConcealmentEvents => "CLIENT_AUDIO_SUBSCRIBER_CONCEALMENT_EVENTS", + MetricLabel::ClientAudioSubscriberInterruptionCount => "CLIENT_AUDIO_SUBSCRIBER_INTERRUPTION_COUNT", + MetricLabel::ClientAudioSubscriberTotalInterruptionDuration => "CLIENT_AUDIO_SUBSCRIBER_TOTAL_INTERRUPTION_DURATION", + MetricLabel::ClientSubscriberJitterBufferDelay => "CLIENT_SUBSCRIBER_JITTER_BUFFER_DELAY", + MetricLabel::ClientSubscriberJitterBufferEmittedCount => "CLIENT_SUBSCRIBER_JITTER_BUFFER_EMITTED_COUNT", + MetricLabel::ClientVideoPublisherQualityLimitationDurationBandwidth => "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_BANDWIDTH", + MetricLabel::ClientVideoPublisherQualityLimitationDurationCpu => "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_CPU", + MetricLabel::ClientVideoPublisherQualityLimitationDurationOther => "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_OTHER", + MetricLabel::PredefinedMaxValue => "METRIC_LABEL_PREDEFINED_MAX_VALUE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "AGENTS_LLM_TTFT" => Some(Self::AgentsLlmTtft), + "AGENTS_STT_TTFT" => Some(Self::AgentsSttTtft), + "AGENTS_TTS_TTFB" => Some(Self::AgentsTtsTtfb), + "CLIENT_VIDEO_SUBSCRIBER_FREEZE_COUNT" => Some(Self::ClientVideoSubscriberFreezeCount), + "CLIENT_VIDEO_SUBSCRIBER_TOTAL_FREEZE_DURATION" => Some(Self::ClientVideoSubscriberTotalFreezeDuration), + "CLIENT_VIDEO_SUBSCRIBER_PAUSE_COUNT" => Some(Self::ClientVideoSubscriberPauseCount), + "CLIENT_VIDEO_SUBSCRIBER_TOTAL_PAUSES_DURATION" => Some(Self::ClientVideoSubscriberTotalPausesDuration), + "CLIENT_AUDIO_SUBSCRIBER_CONCEALED_SAMPLES" => Some(Self::ClientAudioSubscriberConcealedSamples), + "CLIENT_AUDIO_SUBSCRIBER_SILENT_CONCEALED_SAMPLES" => Some(Self::ClientAudioSubscriberSilentConcealedSamples), + "CLIENT_AUDIO_SUBSCRIBER_CONCEALMENT_EVENTS" => Some(Self::ClientAudioSubscriberConcealmentEvents), + "CLIENT_AUDIO_SUBSCRIBER_INTERRUPTION_COUNT" => Some(Self::ClientAudioSubscriberInterruptionCount), + "CLIENT_AUDIO_SUBSCRIBER_TOTAL_INTERRUPTION_DURATION" => Some(Self::ClientAudioSubscriberTotalInterruptionDuration), + "CLIENT_SUBSCRIBER_JITTER_BUFFER_DELAY" => Some(Self::ClientSubscriberJitterBufferDelay), + "CLIENT_SUBSCRIBER_JITTER_BUFFER_EMITTED_COUNT" => Some(Self::ClientSubscriberJitterBufferEmittedCount), + "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_BANDWIDTH" => Some(Self::ClientVideoPublisherQualityLimitationDurationBandwidth), + "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_CPU" => Some(Self::ClientVideoPublisherQualityLimitationDurationCpu), + "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_OTHER" => Some(Self::ClientVideoPublisherQualityLimitationDurationOther), + "METRIC_LABEL_PREDEFINED_MAX_VALUE" => Some(Self::PredefinedMaxValue), + _ => None, + } + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct Room { #[prost(string, tag="1")] pub sid: ::prost::alloc::string::String, @@ -79,6 +257,9 @@ pub struct ParticipantPermission { #[deprecated] #[prost(bool, tag="11")] pub agent: bool, + /// if a participant can subscribe to metrics + #[prost(bool, tag="12")] + pub can_subscribe_metrics: bool, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -322,7 +503,7 @@ pub struct DataPacket { /// identities of participants who will receive the message (sent to all by default) #[prost(string, repeated, tag="5")] pub destination_identities: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(oneof="data_packet::Value", tags="2, 3, 6, 7")] + #[prost(oneof="data_packet::Value", tags="2, 3, 6, 7, 8, 9, 10, 11, 12")] pub value: ::core::option::Option, } /// Nested message and enum types in `DataPacket`. @@ -364,6 +545,16 @@ pub mod data_packet { SipDtmf(super::SipDtmf), #[prost(message, tag="7")] Transcription(super::Transcription), + #[prost(message, tag="8")] + Metrics(super::MetricsBatch), + #[prost(message, tag="9")] + ChatMessage(super::ChatMessage), + #[prost(message, tag="10")] + RpcRequest(super::RpcRequest), + #[prost(message, tag="11")] + RpcAck(super::RpcAck), + #[prost(message, tag="12")] + RpcResponse(super::RpcResponse), } } #[allow(clippy::derive_partial_eq_without_eq)] @@ -454,6 +645,75 @@ pub struct TranscriptionSegment { } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] +pub struct ChatMessage { + /// uuid + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, + #[prost(int64, tag="2")] + pub timestamp: i64, + /// populated only if the intent is to edit/update an existing message + #[prost(int64, optional, tag="3")] + pub edit_timestamp: ::core::option::Option, + #[prost(string, tag="4")] + pub message: ::prost::alloc::string::String, + /// true to remove message + #[prost(bool, tag="5")] + pub deleted: bool, + /// true if the chat message has been generated by an agent from a participant's audio transcription + #[prost(bool, tag="6")] + pub generated: bool, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RpcRequest { + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub method: ::prost::alloc::string::String, + #[prost(string, tag="3")] + pub payload: ::prost::alloc::string::String, + #[prost(uint32, tag="4")] + pub response_timeout_ms: u32, + #[prost(uint32, tag="5")] + pub version: u32, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RpcAck { + #[prost(string, tag="1")] + pub request_id: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RpcResponse { + #[prost(string, tag="1")] + pub request_id: ::prost::alloc::string::String, + #[prost(oneof="rpc_response::Value", tags="2, 3")] + pub value: ::core::option::Option, +} +/// Nested message and enum types in `RpcResponse`. +pub mod rpc_response { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Value { + #[prost(string, tag="2")] + Payload(::prost::alloc::string::String), + #[prost(message, tag="3")] + Error(super::RpcError), + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RpcError { + #[prost(uint32, tag="1")] + pub code: u32, + #[prost(string, tag="2")] + pub message: ::prost::alloc::string::String, + #[prost(string, tag="3")] + pub data: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct ParticipantTracks { /// participant ID of participant to whom the tracks belong #[prost(string, tag="1")] @@ -535,6 +795,10 @@ pub struct ClientInfo { /// wifi, wired, cellular, vpn, empty if not known #[prost(string, tag="10")] pub network: ::prost::alloc::string::String, + /// comma separated list of additional LiveKit SDKs in use of this client, with versions + /// e.g. "components-js:1.2.3,track-processors-js:1.2.3" + #[prost(string, tag="11")] + pub other_sdks: ::prost::alloc::string::String, } /// Nested message and enum types in `ClientInfo`. pub mod client_info { @@ -552,6 +816,8 @@ pub mod client_info { Rust = 8, Python = 9, Cpp = 10, + UnityWeb = 11, + Node = 12, } impl Sdk { /// String value of the enum field names used in the ProtoBuf definition. @@ -571,6 +837,8 @@ pub mod client_info { Sdk::Rust => "RUST", Sdk::Python => "PYTHON", Sdk::Cpp => "CPP", + Sdk::UnityWeb => "UNITY_WEB", + Sdk::Node => "NODE", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -587,6 +855,8 @@ pub mod client_info { "RUST" => Some(Self::Rust), "PYTHON" => Some(Self::Python), "CPP" => Some(Self::Cpp), + "UNITY_WEB" => Some(Self::UnityWeb), + "NODE" => Some(Self::Node), _ => None, } } @@ -733,10 +1003,31 @@ pub struct RtpStats { #[prost(message, optional, tag="44")] pub packet_drift: ::core::option::Option, #[prost(message, optional, tag="45")] - pub report_drift: ::core::option::Option, - /// NEXT_ID: 47 + pub ntp_report_drift: ::core::option::Option, #[prost(message, optional, tag="46")] pub rebased_report_drift: ::core::option::Option, + /// NEXT_ID: 48 + #[prost(message, optional, tag="47")] + pub received_report_drift: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RtcpSenderReportState { + #[prost(uint32, tag="1")] + pub rtp_timestamp: u32, + #[prost(uint64, tag="2")] + pub rtp_timestamp_ext: u64, + #[prost(uint64, tag="3")] + pub ntp_timestamp: u64, + /// time at which this happened + #[prost(int64, tag="4")] + pub at: i64, + #[prost(int64, tag="5")] + pub at_adjusted: i64, + #[prost(uint32, tag="6")] + pub packets: u32, + #[prost(uint64, tag="7")] + pub octets: u64, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -753,6 +1044,8 @@ pub struct RtpForwarderState { pub dummy_start_timestamp_offset: u64, #[prost(message, optional, tag="6")] pub rtp_munger: ::core::option::Option, + #[prost(message, repeated, tag="8")] + pub sender_report_state: ::prost::alloc::vec::Vec, #[prost(oneof="rtp_forwarder_state::CodecMunger", tags="7")] pub codec_munger: ::core::option::Option, } @@ -2448,6 +2741,11 @@ pub struct JoinResponse { /// Server-Injected-Frame byte trailer, used to identify unencrypted frames when e2ee is enabled #[prost(bytes="vec", tag="13")] pub sif_trailer: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="14")] + pub enabled_publish_codecs: ::prost::alloc::vec::Vec, + /// when set, client should attempt to establish publish peer connection when joining room to speed up publishing + #[prost(bool, tag="15")] + pub fast_publish: bool, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -4165,6 +4463,12 @@ pub struct SipInboundTrunkInfo { pub auth_username: ::prost::alloc::string::String, #[prost(string, tag="8")] pub auth_password: ::prost::alloc::string::String, + /// Include these SIP X-* headers in 200 OK responses. + #[prost(map="string, string", tag="9")] + pub headers: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, + /// Map SIP X-* headers from INVITE to SIP participant attributes. + #[prost(map="string, string", tag="10")] + pub headers_to_attributes: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -4200,6 +4504,38 @@ pub struct SipOutboundTrunkInfo { pub auth_username: ::prost::alloc::string::String, #[prost(string, tag="8")] pub auth_password: ::prost::alloc::string::String, + /// Include these SIP X-* headers in INVITE request. + /// These headers are sent as-is and may help identify this call as coming from LiveKit for the other SIP endpoint. + #[prost(map="string, string", tag="9")] + pub headers: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, + /// Map SIP X-* headers from 200 OK to SIP participant attributes. + /// Keys are the names of X-* headers and values are the names of attributes they will be mapped to. + #[prost(map="string, string", tag="10")] + pub headers_to_attributes: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetSipInboundTrunkRequest { + #[prost(string, tag="1")] + pub sip_trunk_id: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetSipInboundTrunkResponse { + #[prost(message, optional, tag="1")] + pub trunk: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetSipOutboundTrunkRequest { + #[prost(string, tag="1")] + pub sip_trunk_id: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetSipOutboundTrunkResponse { + #[prost(message, optional, tag="1")] + pub trunk: ::core::option::Option, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -4259,8 +4595,21 @@ pub struct SipDispatchRuleIndividual { } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] +pub struct SipDispatchRuleCallee { + /// Prefix used on new room name + #[prost(string, tag="1")] + pub room_prefix: ::prost::alloc::string::String, + /// Optional pin required to enter room + #[prost(string, tag="2")] + pub pin: ::prost::alloc::string::String, + /// Optionally append random suffix + #[prost(bool, tag="3")] + pub randomize: bool, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct SipDispatchRule { - #[prost(oneof="sip_dispatch_rule::Rule", tags="1, 2")] + #[prost(oneof="sip_dispatch_rule::Rule", tags="1, 2, 3")] pub rule: ::core::option::Option, } /// Nested message and enum types in `SIPDispatchRule`. @@ -4276,6 +4625,9 @@ pub mod sip_dispatch_rule { /// SIPDispatchRuleIndividual is a `SIP Dispatch Rule` that creates a new room for each caller. #[prost(message, tag="2")] DispatchRuleIndividual(super::SipDispatchRuleIndividual), + /// SIPDispatchRuleCallee is a `SIP Dispatch Rule` that creates a new room for each callee. + #[prost(message, tag="3")] + DispatchRuleCallee(super::SipDispatchRuleCallee), } } #[allow(clippy::derive_partial_eq_without_eq)] @@ -4398,6 +4750,16 @@ pub struct SipParticipantInfo { #[prost(string, tag="4")] pub sip_call_id: ::prost::alloc::string::String, } +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TransferSipParticipantRequest { + #[prost(string, tag="1")] + pub participant_identity: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub room_name: ::prost::alloc::string::String, + #[prost(string, tag="3")] + pub transfer_to: ::prost::alloc::string::String, +} #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum SipTransport { diff --git a/livekit-protocol/src/livekit.serde.rs b/livekit-protocol/src/livekit.serde.rs index 62e7c6904..4e6a0fb03 100644 --- a/livekit-protocol/src/livekit.serde.rs +++ b/livekit-protocol/src/livekit.serde.rs @@ -1911,6 +1911,195 @@ impl<'de> serde::Deserialize<'de> for CandidateProtocol { deserializer.deserialize_any(GeneratedVisitor) } } +impl serde::Serialize for ChatMessage { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.id.is_empty() { + len += 1; + } + if self.timestamp != 0 { + len += 1; + } + if self.edit_timestamp.is_some() { + len += 1; + } + if !self.message.is_empty() { + len += 1; + } + if self.deleted { + len += 1; + } + if self.generated { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.ChatMessage", len)?; + if !self.id.is_empty() { + struct_ser.serialize_field("id", &self.id)?; + } + if self.timestamp != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; + } + if let Some(v) = self.edit_timestamp.as_ref() { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("editTimestamp", ToString::to_string(&v).as_str())?; + } + if !self.message.is_empty() { + struct_ser.serialize_field("message", &self.message)?; + } + if self.deleted { + struct_ser.serialize_field("deleted", &self.deleted)?; + } + if self.generated { + struct_ser.serialize_field("generated", &self.generated)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ChatMessage { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "id", + "timestamp", + "edit_timestamp", + "editTimestamp", + "message", + "deleted", + "generated", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Id, + Timestamp, + EditTimestamp, + Message, + Deleted, + Generated, + __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 { + "id" => Ok(GeneratedField::Id), + "timestamp" => Ok(GeneratedField::Timestamp), + "editTimestamp" | "edit_timestamp" => Ok(GeneratedField::EditTimestamp), + "message" => Ok(GeneratedField::Message), + "deleted" => Ok(GeneratedField::Deleted), + "generated" => Ok(GeneratedField::Generated), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ChatMessage; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.ChatMessage") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut id__ = None; + let mut timestamp__ = None; + let mut edit_timestamp__ = None; + let mut message__ = None; + let mut deleted__ = None; + let mut generated__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Id => { + if id__.is_some() { + return Err(serde::de::Error::duplicate_field("id")); + } + id__ = Some(map_.next_value()?); + } + GeneratedField::Timestamp => { + if timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timestamp")); + } + timestamp__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::EditTimestamp => { + if edit_timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("editTimestamp")); + } + edit_timestamp__ = + map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0) + ; + } + GeneratedField::Message => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("message")); + } + message__ = Some(map_.next_value()?); + } + GeneratedField::Deleted => { + if deleted__.is_some() { + return Err(serde::de::Error::duplicate_field("deleted")); + } + deleted__ = Some(map_.next_value()?); + } + GeneratedField::Generated => { + if generated__.is_some() { + return Err(serde::de::Error::duplicate_field("generated")); + } + generated__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(ChatMessage { + id: id__.unwrap_or_default(), + timestamp: timestamp__.unwrap_or_default(), + edit_timestamp: edit_timestamp__, + message: message__.unwrap_or_default(), + deleted: deleted__.unwrap_or_default(), + generated: generated__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.ChatMessage", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for ClientConfigSetting { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -2193,6 +2382,9 @@ impl serde::Serialize for ClientInfo { if !self.network.is_empty() { len += 1; } + if !self.other_sdks.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) @@ -2226,6 +2418,9 @@ impl serde::Serialize for ClientInfo { if !self.network.is_empty() { struct_ser.serialize_field("network", &self.network)?; } + if !self.other_sdks.is_empty() { + struct_ser.serialize_field("otherSdks", &self.other_sdks)?; + } struct_ser.end() } } @@ -2249,6 +2444,8 @@ impl<'de> serde::Deserialize<'de> for ClientInfo { "browserVersion", "address", "network", + "other_sdks", + "otherSdks", ]; #[allow(clippy::enum_variant_names)] @@ -2263,6 +2460,7 @@ impl<'de> serde::Deserialize<'de> for ClientInfo { BrowserVersion, Address, Network, + OtherSdks, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -2295,6 +2493,7 @@ impl<'de> serde::Deserialize<'de> for ClientInfo { "browserVersion" | "browser_version" => Ok(GeneratedField::BrowserVersion), "address" => Ok(GeneratedField::Address), "network" => Ok(GeneratedField::Network), + "otherSdks" | "other_sdks" => Ok(GeneratedField::OtherSdks), _ => Ok(GeneratedField::__SkipField__), } } @@ -2324,6 +2523,7 @@ impl<'de> serde::Deserialize<'de> for ClientInfo { let mut browser_version__ = None; let mut address__ = None; let mut network__ = None; + let mut other_sdks__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Sdk => { @@ -2388,6 +2588,12 @@ impl<'de> serde::Deserialize<'de> for ClientInfo { } network__ = Some(map_.next_value()?); } + GeneratedField::OtherSdks => { + if other_sdks__.is_some() { + return Err(serde::de::Error::duplicate_field("otherSdks")); + } + other_sdks__ = Some(map_.next_value()?); + } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } @@ -2404,6 +2610,7 @@ impl<'de> serde::Deserialize<'de> for ClientInfo { browser_version: browser_version__.unwrap_or_default(), address: address__.unwrap_or_default(), network: network__.unwrap_or_default(), + other_sdks: other_sdks__.unwrap_or_default(), }) } } @@ -2428,6 +2635,8 @@ impl serde::Serialize for client_info::Sdk { Self::Rust => "RUST", Self::Python => "PYTHON", Self::Cpp => "CPP", + Self::UnityWeb => "UNITY_WEB", + Self::Node => "NODE", }; serializer.serialize_str(variant) } @@ -2450,6 +2659,8 @@ impl<'de> serde::Deserialize<'de> for client_info::Sdk { "RUST", "PYTHON", "CPP", + "UNITY_WEB", + "NODE", ]; struct GeneratedVisitor; @@ -2501,6 +2712,8 @@ impl<'de> serde::Deserialize<'de> for client_info::Sdk { "RUST" => Ok(client_info::Sdk::Rust), "PYTHON" => Ok(client_info::Sdk::Python), "CPP" => Ok(client_info::Sdk::Cpp), + "UNITY_WEB" => Ok(client_info::Sdk::UnityWeb), + "NODE" => Ok(client_info::Sdk::Node), _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } } @@ -4753,6 +4966,21 @@ impl serde::Serialize for DataPacket { data_packet::Value::Transcription(v) => { struct_ser.serialize_field("transcription", v)?; } + data_packet::Value::Metrics(v) => { + struct_ser.serialize_field("metrics", v)?; + } + data_packet::Value::ChatMessage(v) => { + struct_ser.serialize_field("chatMessage", v)?; + } + data_packet::Value::RpcRequest(v) => { + struct_ser.serialize_field("rpcRequest", v)?; + } + data_packet::Value::RpcAck(v) => { + struct_ser.serialize_field("rpcAck", v)?; + } + data_packet::Value::RpcResponse(v) => { + struct_ser.serialize_field("rpcResponse", v)?; + } } } struct_ser.end() @@ -4775,6 +5003,15 @@ impl<'de> serde::Deserialize<'de> for DataPacket { "sip_dtmf", "sipDtmf", "transcription", + "metrics", + "chat_message", + "chatMessage", + "rpc_request", + "rpcRequest", + "rpc_ack", + "rpcAck", + "rpc_response", + "rpcResponse", ]; #[allow(clippy::enum_variant_names)] @@ -4786,6 +5023,11 @@ impl<'de> serde::Deserialize<'de> for DataPacket { Speaker, SipDtmf, Transcription, + Metrics, + ChatMessage, + RpcRequest, + RpcAck, + RpcResponse, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -4815,6 +5057,11 @@ impl<'de> serde::Deserialize<'de> for DataPacket { "speaker" => Ok(GeneratedField::Speaker), "sipDtmf" | "sip_dtmf" => Ok(GeneratedField::SipDtmf), "transcription" => Ok(GeneratedField::Transcription), + "metrics" => Ok(GeneratedField::Metrics), + "chatMessage" | "chat_message" => Ok(GeneratedField::ChatMessage), + "rpcRequest" | "rpc_request" => Ok(GeneratedField::RpcRequest), + "rpcAck" | "rpc_ack" => Ok(GeneratedField::RpcAck), + "rpcResponse" | "rpc_response" => Ok(GeneratedField::RpcResponse), _ => Ok(GeneratedField::__SkipField__), } } @@ -4884,6 +5131,41 @@ impl<'de> serde::Deserialize<'de> for DataPacket { return Err(serde::de::Error::duplicate_field("transcription")); } value__ = map_.next_value::<::std::option::Option<_>>()?.map(data_packet::Value::Transcription) +; + } + GeneratedField::Metrics => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("metrics")); + } + value__ = map_.next_value::<::std::option::Option<_>>()?.map(data_packet::Value::Metrics) +; + } + GeneratedField::ChatMessage => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("chatMessage")); + } + value__ = map_.next_value::<::std::option::Option<_>>()?.map(data_packet::Value::ChatMessage) +; + } + GeneratedField::RpcRequest => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("rpcRequest")); + } + value__ = map_.next_value::<::std::option::Option<_>>()?.map(data_packet::Value::RpcRequest) +; + } + GeneratedField::RpcAck => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("rpcAck")); + } + value__ = map_.next_value::<::std::option::Option<_>>()?.map(data_packet::Value::RpcAck) +; + } + GeneratedField::RpcResponse => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("rpcResponse")); + } + value__ = map_.next_value::<::std::option::Option<_>>()?.map(data_packet::Value::RpcResponse) ; } GeneratedField::__SkipField__ => { @@ -7295,7 +7577,7 @@ impl<'de> serde::Deserialize<'de> for encryption::Type { deserializer.deserialize_any(GeneratedVisitor) } } -impl serde::Serialize for FileInfo { +impl serde::Serialize for EventMetric { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -7303,79 +7585,103 @@ impl serde::Serialize for FileInfo { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.filename.is_empty() { + if self.label != 0 { len += 1; } - if self.started_at != 0 { + if self.participant_identity != 0 { len += 1; } - if self.ended_at != 0 { + if self.track_sid != 0 { len += 1; } - if self.duration != 0 { + if self.start_timestamp_ms != 0 { len += 1; } - if self.size != 0 { + if self.end_timestamp_ms.is_some() { len += 1; } - if !self.location.is_empty() { + if self.normalized_start_timestamp.is_some() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.FileInfo", len)?; - if !self.filename.is_empty() { - struct_ser.serialize_field("filename", &self.filename)?; + if self.normalized_end_timestamp.is_some() { + len += 1; } - if self.started_at != 0 { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("startedAt", ToString::to_string(&self.started_at).as_str())?; + if !self.metadata.is_empty() { + len += 1; } - if self.ended_at != 0 { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("endedAt", ToString::to_string(&self.ended_at).as_str())?; + if self.rid != 0 { + len += 1; } - if self.duration != 0 { + let mut struct_ser = serializer.serialize_struct("livekit.EventMetric", len)?; + if self.label != 0 { + struct_ser.serialize_field("label", &self.label)?; + } + if self.participant_identity != 0 { + struct_ser.serialize_field("participantIdentity", &self.participant_identity)?; + } + if self.track_sid != 0 { + struct_ser.serialize_field("trackSid", &self.track_sid)?; + } + if self.start_timestamp_ms != 0 { #[allow(clippy::needless_borrow)] #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("duration", ToString::to_string(&self.duration).as_str())?; + struct_ser.serialize_field("startTimestampMs", ToString::to_string(&self.start_timestamp_ms).as_str())?; } - if self.size != 0 { + if let Some(v) = self.end_timestamp_ms.as_ref() { #[allow(clippy::needless_borrow)] #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("size", ToString::to_string(&self.size).as_str())?; + struct_ser.serialize_field("endTimestampMs", ToString::to_string(&v).as_str())?; } - if !self.location.is_empty() { - struct_ser.serialize_field("location", &self.location)?; + if let Some(v) = self.normalized_start_timestamp.as_ref() { + struct_ser.serialize_field("normalizedStartTimestamp", v)?; + } + if let Some(v) = self.normalized_end_timestamp.as_ref() { + struct_ser.serialize_field("normalizedEndTimestamp", v)?; + } + if !self.metadata.is_empty() { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + if self.rid != 0 { + struct_ser.serialize_field("rid", &self.rid)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for FileInfo { +impl<'de> serde::Deserialize<'de> for EventMetric { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "filename", - "started_at", - "startedAt", - "ended_at", - "endedAt", - "duration", - "size", - "location", + "label", + "participant_identity", + "participantIdentity", + "track_sid", + "trackSid", + "start_timestamp_ms", + "startTimestampMs", + "end_timestamp_ms", + "endTimestampMs", + "normalized_start_timestamp", + "normalizedStartTimestamp", + "normalized_end_timestamp", + "normalizedEndTimestamp", + "metadata", + "rid", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Filename, - StartedAt, - EndedAt, - Duration, - Size, - Location, + Label, + ParticipantIdentity, + TrackSid, + StartTimestampMs, + EndTimestampMs, + NormalizedStartTimestamp, + NormalizedEndTimestamp, + Metadata, + Rid, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -7398,12 +7704,15 @@ impl<'de> serde::Deserialize<'de> for FileInfo { E: serde::de::Error, { match value { - "filename" => Ok(GeneratedField::Filename), - "startedAt" | "started_at" => Ok(GeneratedField::StartedAt), - "endedAt" | "ended_at" => Ok(GeneratedField::EndedAt), - "duration" => Ok(GeneratedField::Duration), - "size" => Ok(GeneratedField::Size), - "location" => Ok(GeneratedField::Location), + "label" => Ok(GeneratedField::Label), + "participantIdentity" | "participant_identity" => Ok(GeneratedField::ParticipantIdentity), + "trackSid" | "track_sid" => Ok(GeneratedField::TrackSid), + "startTimestampMs" | "start_timestamp_ms" => Ok(GeneratedField::StartTimestampMs), + "endTimestampMs" | "end_timestamp_ms" => Ok(GeneratedField::EndTimestampMs), + "normalizedStartTimestamp" | "normalized_start_timestamp" => Ok(GeneratedField::NormalizedStartTimestamp), + "normalizedEndTimestamp" | "normalized_end_timestamp" => Ok(GeneratedField::NormalizedEndTimestamp), + "metadata" => Ok(GeneratedField::Metadata), + "rid" => Ok(GeneratedField::Rid), _ => Ok(GeneratedField::__SkipField__), } } @@ -7413,21 +7722,247 @@ impl<'de> serde::Deserialize<'de> for FileInfo { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = FileInfo; + type Value = EventMetric; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.FileInfo") + formatter.write_str("struct livekit.EventMetric") } - 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 filename__ = None; - let mut started_at__ = None; - let mut ended_at__ = None; - let mut duration__ = None; - let mut size__ = None; + let mut label__ = None; + let mut participant_identity__ = None; + let mut track_sid__ = None; + let mut start_timestamp_ms__ = None; + let mut end_timestamp_ms__ = None; + let mut normalized_start_timestamp__ = None; + let mut normalized_end_timestamp__ = None; + let mut metadata__ = None; + let mut rid__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Label => { + if label__.is_some() { + return Err(serde::de::Error::duplicate_field("label")); + } + label__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::ParticipantIdentity => { + if participant_identity__.is_some() { + return Err(serde::de::Error::duplicate_field("participantIdentity")); + } + participant_identity__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::TrackSid => { + if track_sid__.is_some() { + return Err(serde::de::Error::duplicate_field("trackSid")); + } + track_sid__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::StartTimestampMs => { + if start_timestamp_ms__.is_some() { + return Err(serde::de::Error::duplicate_field("startTimestampMs")); + } + start_timestamp_ms__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::EndTimestampMs => { + if end_timestamp_ms__.is_some() { + return Err(serde::de::Error::duplicate_field("endTimestampMs")); + } + end_timestamp_ms__ = + map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0) + ; + } + GeneratedField::NormalizedStartTimestamp => { + if normalized_start_timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("normalizedStartTimestamp")); + } + normalized_start_timestamp__ = map_.next_value()?; + } + GeneratedField::NormalizedEndTimestamp => { + if normalized_end_timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("normalizedEndTimestamp")); + } + normalized_end_timestamp__ = map_.next_value()?; + } + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = Some(map_.next_value()?); + } + GeneratedField::Rid => { + if rid__.is_some() { + return Err(serde::de::Error::duplicate_field("rid")); + } + rid__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(EventMetric { + label: label__.unwrap_or_default(), + participant_identity: participant_identity__.unwrap_or_default(), + track_sid: track_sid__.unwrap_or_default(), + start_timestamp_ms: start_timestamp_ms__.unwrap_or_default(), + end_timestamp_ms: end_timestamp_ms__, + normalized_start_timestamp: normalized_start_timestamp__, + normalized_end_timestamp: normalized_end_timestamp__, + metadata: metadata__.unwrap_or_default(), + rid: rid__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.EventMetric", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for FileInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.filename.is_empty() { + len += 1; + } + if self.started_at != 0 { + len += 1; + } + if self.ended_at != 0 { + len += 1; + } + if self.duration != 0 { + len += 1; + } + if self.size != 0 { + len += 1; + } + if !self.location.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.FileInfo", len)?; + if !self.filename.is_empty() { + struct_ser.serialize_field("filename", &self.filename)?; + } + if self.started_at != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("startedAt", ToString::to_string(&self.started_at).as_str())?; + } + if self.ended_at != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("endedAt", ToString::to_string(&self.ended_at).as_str())?; + } + if self.duration != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("duration", ToString::to_string(&self.duration).as_str())?; + } + if self.size != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("size", ToString::to_string(&self.size).as_str())?; + } + if !self.location.is_empty() { + struct_ser.serialize_field("location", &self.location)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for FileInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "filename", + "started_at", + "startedAt", + "ended_at", + "endedAt", + "duration", + "size", + "location", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Filename, + StartedAt, + EndedAt, + Duration, + Size, + Location, + __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 { + "filename" => Ok(GeneratedField::Filename), + "startedAt" | "started_at" => Ok(GeneratedField::StartedAt), + "endedAt" | "ended_at" => Ok(GeneratedField::EndedAt), + "duration" => Ok(GeneratedField::Duration), + "size" => Ok(GeneratedField::Size), + "location" => Ok(GeneratedField::Location), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = FileInfo; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.FileInfo") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut filename__ = None; + let mut started_at__ = None; + let mut ended_at__ = None; + let mut duration__ = None; + let mut size__ = None; let mut location__ = None; while let Some(k) = map_.next_key()? { match k { @@ -7622,7 +8157,7 @@ impl<'de> serde::Deserialize<'de> for GcpUpload { deserializer.deserialize_struct("livekit.GCPUpload", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for IceServer { +impl serde::Serialize for GetSipInboundTrunkRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -7630,45 +8165,30 @@ impl serde::Serialize for IceServer { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.urls.is_empty() { - len += 1; - } - if !self.username.is_empty() { - len += 1; - } - if !self.credential.is_empty() { + if !self.sip_trunk_id.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.ICEServer", len)?; - if !self.urls.is_empty() { - struct_ser.serialize_field("urls", &self.urls)?; - } - if !self.username.is_empty() { - struct_ser.serialize_field("username", &self.username)?; - } - if !self.credential.is_empty() { - struct_ser.serialize_field("credential", &self.credential)?; + let mut struct_ser = serializer.serialize_struct("livekit.GetSIPInboundTrunkRequest", len)?; + if !self.sip_trunk_id.is_empty() { + struct_ser.serialize_field("sipTrunkId", &self.sip_trunk_id)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for IceServer { +impl<'de> serde::Deserialize<'de> for GetSipInboundTrunkRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "urls", - "username", - "credential", + "sip_trunk_id", + "sipTrunkId", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Urls, - Username, - Credential, + SipTrunkId, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -7691,9 +8211,7 @@ impl<'de> serde::Deserialize<'de> for IceServer { E: serde::de::Error, { match value { - "urls" => Ok(GeneratedField::Urls), - "username" => Ok(GeneratedField::Username), - "credential" => Ok(GeneratedField::Credential), + "sipTrunkId" | "sip_trunk_id" => Ok(GeneratedField::SipTrunkId), _ => Ok(GeneratedField::__SkipField__), } } @@ -7703,197 +8221,230 @@ impl<'de> serde::Deserialize<'de> for IceServer { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = IceServer; + type Value = GetSipInboundTrunkRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ICEServer") + formatter.write_str("struct livekit.GetSIPInboundTrunkRequest") } - 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 urls__ = None; - let mut username__ = None; - let mut credential__ = None; + let mut sip_trunk_id__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Urls => { - if urls__.is_some() { - return Err(serde::de::Error::duplicate_field("urls")); + GeneratedField::SipTrunkId => { + if sip_trunk_id__.is_some() { + return Err(serde::de::Error::duplicate_field("sipTrunkId")); } - urls__ = Some(map_.next_value()?); + sip_trunk_id__ = Some(map_.next_value()?); } - GeneratedField::Username => { - if username__.is_some() { - return Err(serde::de::Error::duplicate_field("username")); - } - username__ = Some(map_.next_value()?); - } - GeneratedField::Credential => { - if credential__.is_some() { - return Err(serde::de::Error::duplicate_field("credential")); - } - credential__ = Some(map_.next_value()?); - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; } } } - Ok(IceServer { - urls: urls__.unwrap_or_default(), - username: username__.unwrap_or_default(), - credential: credential__.unwrap_or_default(), + Ok(GetSipInboundTrunkRequest { + sip_trunk_id: sip_trunk_id__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.ICEServer", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.GetSIPInboundTrunkRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ImageCodec { +impl serde::Serialize for GetSipInboundTrunkResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { - let variant = match self { - Self::IcDefault => "IC_DEFAULT", - Self::IcJpeg => "IC_JPEG", - }; - serializer.serialize_str(variant) + use serde::ser::SerializeStruct; + let mut len = 0; + if self.trunk.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.GetSIPInboundTrunkResponse", len)?; + if let Some(v) = self.trunk.as_ref() { + struct_ser.serialize_field("trunk", v)?; + } + struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for ImageCodec { +impl<'de> serde::Deserialize<'de> for GetSipInboundTrunkResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "IC_DEFAULT", - "IC_JPEG", + "trunk", ]; - struct GeneratedVisitor; + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Trunk, + __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 = ImageCodec; + 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) - } + 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) - }) + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "trunk" => Ok(GeneratedField::Trunk), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GetSipInboundTrunkResponse; - 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 expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.GetSIPInboundTrunkResponse") } - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, { - match value { - "IC_DEFAULT" => Ok(ImageCodec::IcDefault), - "IC_JPEG" => Ok(ImageCodec::IcJpeg), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + let mut trunk__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Trunk => { + if trunk__.is_some() { + return Err(serde::de::Error::duplicate_field("trunk")); + } + trunk__ = map_.next_value()?; + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } } + Ok(GetSipInboundTrunkResponse { + trunk: trunk__, + }) } } - deserializer.deserialize_any(GeneratedVisitor) + deserializer.deserialize_struct("livekit.GetSIPInboundTrunkResponse", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ImageFileSuffix { +impl serde::Serialize for GetSipOutboundTrunkRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { - let variant = match self { - Self::ImageSuffixIndex => "IMAGE_SUFFIX_INDEX", - Self::ImageSuffixTimestamp => "IMAGE_SUFFIX_TIMESTAMP", - }; - serializer.serialize_str(variant) + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.sip_trunk_id.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.GetSIPOutboundTrunkRequest", len)?; + if !self.sip_trunk_id.is_empty() { + struct_ser.serialize_field("sipTrunkId", &self.sip_trunk_id)?; + } + struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for ImageFileSuffix { +impl<'de> serde::Deserialize<'de> for GetSipOutboundTrunkRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "IMAGE_SUFFIX_INDEX", - "IMAGE_SUFFIX_TIMESTAMP", + "sip_trunk_id", + "sipTrunkId", ]; - struct GeneratedVisitor; + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + SipTrunkId, + __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 = ImageFileSuffix; + 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) - } + 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) - }) + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "sipTrunkId" | "sip_trunk_id" => Ok(GeneratedField::SipTrunkId), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GetSipOutboundTrunkRequest; - 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 expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.GetSIPOutboundTrunkRequest") } - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, { - match value { - "IMAGE_SUFFIX_INDEX" => Ok(ImageFileSuffix::ImageSuffixIndex), - "IMAGE_SUFFIX_TIMESTAMP" => Ok(ImageFileSuffix::ImageSuffixTimestamp), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + let mut sip_trunk_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::SipTrunkId => { + if sip_trunk_id__.is_some() { + return Err(serde::de::Error::duplicate_field("sipTrunkId")); + } + sip_trunk_id__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } } + Ok(GetSipOutboundTrunkRequest { + sip_trunk_id: sip_trunk_id__.unwrap_or_default(), + }) } } - deserializer.deserialize_any(GeneratedVisitor) + deserializer.deserialize_struct("livekit.GetSIPOutboundTrunkRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ImageOutput { +impl serde::Serialize for GetSipOutboundTrunkResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -7901,114 +8452,30 @@ impl serde::Serialize for ImageOutput { { use serde::ser::SerializeStruct; let mut len = 0; - if self.capture_interval != 0 { - len += 1; - } - if self.width != 0 { - len += 1; - } - if self.height != 0 { - len += 1; - } - if !self.filename_prefix.is_empty() { - len += 1; - } - if self.filename_suffix != 0 { - len += 1; - } - if self.image_codec != 0 { + if self.trunk.is_some() { len += 1; } - if self.disable_manifest { - len += 1; + let mut struct_ser = serializer.serialize_struct("livekit.GetSIPOutboundTrunkResponse", len)?; + if let Some(v) = self.trunk.as_ref() { + struct_ser.serialize_field("trunk", v)?; } - if self.output.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("livekit.ImageOutput", len)?; - if self.capture_interval != 0 { - struct_ser.serialize_field("captureInterval", &self.capture_interval)?; - } - if self.width != 0 { - struct_ser.serialize_field("width", &self.width)?; - } - if self.height != 0 { - struct_ser.serialize_field("height", &self.height)?; - } - if !self.filename_prefix.is_empty() { - struct_ser.serialize_field("filenamePrefix", &self.filename_prefix)?; - } - if self.filename_suffix != 0 { - let v = ImageFileSuffix::try_from(self.filename_suffix) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.filename_suffix)))?; - struct_ser.serialize_field("filenameSuffix", &v)?; - } - if self.image_codec != 0 { - let v = ImageCodec::try_from(self.image_codec) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.image_codec)))?; - struct_ser.serialize_field("imageCodec", &v)?; - } - if self.disable_manifest { - struct_ser.serialize_field("disableManifest", &self.disable_manifest)?; - } - if let Some(v) = self.output.as_ref() { - match v { - image_output::Output::S3(v) => { - struct_ser.serialize_field("s3", v)?; - } - image_output::Output::Gcp(v) => { - struct_ser.serialize_field("gcp", v)?; - } - image_output::Output::Azure(v) => { - struct_ser.serialize_field("azure", v)?; - } - image_output::Output::AliOss(v) => { - struct_ser.serialize_field("aliOSS", v)?; - } - } - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ImageOutput { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "capture_interval", - "captureInterval", - "width", - "height", - "filename_prefix", - "filenamePrefix", - "filename_suffix", - "filenameSuffix", - "image_codec", - "imageCodec", - "disable_manifest", - "disableManifest", - "s3", - "gcp", - "azure", - "aliOSS", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - CaptureInterval, - Width, - Height, - FilenamePrefix, - FilenameSuffix, - ImageCodec, - DisableManifest, - S3, - Gcp, - Azure, - AliOss, - __SkipField__, + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GetSipOutboundTrunkResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "trunk", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Trunk, + __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -8030,17 +8497,7 @@ impl<'de> serde::Deserialize<'de> for ImageOutput { E: serde::de::Error, { match value { - "captureInterval" | "capture_interval" => Ok(GeneratedField::CaptureInterval), - "width" => Ok(GeneratedField::Width), - "height" => Ok(GeneratedField::Height), - "filenamePrefix" | "filename_prefix" => Ok(GeneratedField::FilenamePrefix), - "filenameSuffix" | "filename_suffix" => Ok(GeneratedField::FilenameSuffix), - "imageCodec" | "image_codec" => Ok(GeneratedField::ImageCodec), - "disableManifest" | "disable_manifest" => Ok(GeneratedField::DisableManifest), - "s3" => Ok(GeneratedField::S3), - "gcp" => Ok(GeneratedField::Gcp), - "azure" => Ok(GeneratedField::Azure), - "aliOSS" => Ok(GeneratedField::AliOss), + "trunk" => Ok(GeneratedField::Trunk), _ => Ok(GeneratedField::__SkipField__), } } @@ -8050,123 +8507,39 @@ impl<'de> serde::Deserialize<'de> for ImageOutput { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ImageOutput; + type Value = GetSipOutboundTrunkResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ImageOutput") + formatter.write_str("struct livekit.GetSIPOutboundTrunkResponse") } - 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 capture_interval__ = None; - let mut width__ = None; - let mut height__ = None; - let mut filename_prefix__ = None; - let mut filename_suffix__ = None; - let mut image_codec__ = None; - let mut disable_manifest__ = None; - let mut output__ = None; + let mut trunk__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::CaptureInterval => { - if capture_interval__.is_some() { - return Err(serde::de::Error::duplicate_field("captureInterval")); - } - capture_interval__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Width => { - if width__.is_some() { - return Err(serde::de::Error::duplicate_field("width")); - } - width__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Height => { - if height__.is_some() { - return Err(serde::de::Error::duplicate_field("height")); - } - height__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::FilenamePrefix => { - if filename_prefix__.is_some() { - return Err(serde::de::Error::duplicate_field("filenamePrefix")); - } - filename_prefix__ = Some(map_.next_value()?); - } - GeneratedField::FilenameSuffix => { - if filename_suffix__.is_some() { - return Err(serde::de::Error::duplicate_field("filenameSuffix")); - } - filename_suffix__ = Some(map_.next_value::()? as i32); - } - GeneratedField::ImageCodec => { - if image_codec__.is_some() { - return Err(serde::de::Error::duplicate_field("imageCodec")); - } - image_codec__ = Some(map_.next_value::()? as i32); - } - GeneratedField::DisableManifest => { - if disable_manifest__.is_some() { - return Err(serde::de::Error::duplicate_field("disableManifest")); - } - disable_manifest__ = Some(map_.next_value()?); - } - GeneratedField::S3 => { - if output__.is_some() { - return Err(serde::de::Error::duplicate_field("s3")); - } - output__ = map_.next_value::<::std::option::Option<_>>()?.map(image_output::Output::S3) -; - } - GeneratedField::Gcp => { - if output__.is_some() { - return Err(serde::de::Error::duplicate_field("gcp")); - } - output__ = map_.next_value::<::std::option::Option<_>>()?.map(image_output::Output::Gcp) -; - } - GeneratedField::Azure => { - if output__.is_some() { - return Err(serde::de::Error::duplicate_field("azure")); - } - output__ = map_.next_value::<::std::option::Option<_>>()?.map(image_output::Output::Azure) -; - } - GeneratedField::AliOss => { - if output__.is_some() { - return Err(serde::de::Error::duplicate_field("aliOSS")); + GeneratedField::Trunk => { + if trunk__.is_some() { + return Err(serde::de::Error::duplicate_field("trunk")); } - output__ = map_.next_value::<::std::option::Option<_>>()?.map(image_output::Output::AliOss) -; + trunk__ = map_.next_value()?; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(ImageOutput { - capture_interval: capture_interval__.unwrap_or_default(), - width: width__.unwrap_or_default(), - height: height__.unwrap_or_default(), - filename_prefix: filename_prefix__.unwrap_or_default(), - filename_suffix: filename_suffix__.unwrap_or_default(), - image_codec: image_codec__.unwrap_or_default(), - disable_manifest: disable_manifest__.unwrap_or_default(), - output: output__, + Ok(GetSipOutboundTrunkResponse { + trunk: trunk__, }) } } - deserializer.deserialize_struct("livekit.ImageOutput", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.GetSIPOutboundTrunkResponse", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ImagesInfo { +impl serde::Serialize for IceServer { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -8174,63 +8547,45 @@ impl serde::Serialize for ImagesInfo { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.filename_prefix.is_empty() { - len += 1; - } - if self.image_count != 0 { + if !self.urls.is_empty() { len += 1; } - if self.started_at != 0 { + if !self.username.is_empty() { len += 1; } - if self.ended_at != 0 { + if !self.credential.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.ImagesInfo", len)?; - if !self.filename_prefix.is_empty() { - struct_ser.serialize_field("filenamePrefix", &self.filename_prefix)?; - } - if self.image_count != 0 { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("imageCount", ToString::to_string(&self.image_count).as_str())?; + let mut struct_ser = serializer.serialize_struct("livekit.ICEServer", len)?; + if !self.urls.is_empty() { + struct_ser.serialize_field("urls", &self.urls)?; } - if self.started_at != 0 { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("startedAt", ToString::to_string(&self.started_at).as_str())?; + if !self.username.is_empty() { + struct_ser.serialize_field("username", &self.username)?; } - if self.ended_at != 0 { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("endedAt", ToString::to_string(&self.ended_at).as_str())?; + if !self.credential.is_empty() { + struct_ser.serialize_field("credential", &self.credential)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for ImagesInfo { +impl<'de> serde::Deserialize<'de> for IceServer { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "filename_prefix", - "filenamePrefix", - "image_count", - "imageCount", - "started_at", - "startedAt", - "ended_at", - "endedAt", + "urls", + "username", + "credential", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - FilenamePrefix, - ImageCount, - StartedAt, - EndedAt, + Urls, + Username, + Credential, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -8253,10 +8608,9 @@ impl<'de> serde::Deserialize<'de> for ImagesInfo { E: serde::de::Error, { match value { - "filenamePrefix" | "filename_prefix" => Ok(GeneratedField::FilenamePrefix), - "imageCount" | "image_count" => Ok(GeneratedField::ImageCount), - "startedAt" | "started_at" => Ok(GeneratedField::StartedAt), - "endedAt" | "ended_at" => Ok(GeneratedField::EndedAt), + "urls" => Ok(GeneratedField::Urls), + "username" => Ok(GeneratedField::Username), + "credential" => Ok(GeneratedField::Credential), _ => Ok(GeneratedField::__SkipField__), } } @@ -8266,250 +8620,153 @@ impl<'de> serde::Deserialize<'de> for ImagesInfo { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ImagesInfo; + type Value = IceServer; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ImagesInfo") + formatter.write_str("struct livekit.ICEServer") } - 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 filename_prefix__ = None; - let mut image_count__ = None; - let mut started_at__ = None; - let mut ended_at__ = None; + let mut urls__ = None; + let mut username__ = None; + let mut credential__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::FilenamePrefix => { - if filename_prefix__.is_some() { - return Err(serde::de::Error::duplicate_field("filenamePrefix")); - } - filename_prefix__ = Some(map_.next_value()?); - } - GeneratedField::ImageCount => { - if image_count__.is_some() { - return Err(serde::de::Error::duplicate_field("imageCount")); + GeneratedField::Urls => { + if urls__.is_some() { + return Err(serde::de::Error::duplicate_field("urls")); } - image_count__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + urls__ = Some(map_.next_value()?); } - GeneratedField::StartedAt => { - if started_at__.is_some() { - return Err(serde::de::Error::duplicate_field("startedAt")); + GeneratedField::Username => { + if username__.is_some() { + return Err(serde::de::Error::duplicate_field("username")); } - started_at__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + username__ = Some(map_.next_value()?); } - GeneratedField::EndedAt => { - if ended_at__.is_some() { - return Err(serde::de::Error::duplicate_field("endedAt")); + GeneratedField::Credential => { + if credential__.is_some() { + return Err(serde::de::Error::duplicate_field("credential")); } - ended_at__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + credential__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(ImagesInfo { - filename_prefix: filename_prefix__.unwrap_or_default(), - image_count: image_count__.unwrap_or_default(), - started_at: started_at__.unwrap_or_default(), - ended_at: ended_at__.unwrap_or_default(), + Ok(IceServer { + urls: urls__.unwrap_or_default(), + username: username__.unwrap_or_default(), + credential: credential__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.ImagesInfo", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ICEServer", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for IngressAudioEncodingOptions { +impl serde::Serialize for ImageCodec { #[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_codec != 0 { - len += 1; - } - if self.bitrate != 0 { - len += 1; - } - if self.disable_dtx { - len += 1; - } - if self.channels != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("livekit.IngressAudioEncodingOptions", len)?; - if self.audio_codec != 0 { - let v = AudioCodec::try_from(self.audio_codec) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.audio_codec)))?; - struct_ser.serialize_field("audioCodec", &v)?; - } - if self.bitrate != 0 { - struct_ser.serialize_field("bitrate", &self.bitrate)?; - } - if self.disable_dtx { - struct_ser.serialize_field("disableDtx", &self.disable_dtx)?; - } - if self.channels != 0 { - struct_ser.serialize_field("channels", &self.channels)?; - } - struct_ser.end() + let variant = match self { + Self::IcDefault => "IC_DEFAULT", + Self::IcJpeg => "IC_JPEG", + }; + serializer.serialize_str(variant) } } -impl<'de> serde::Deserialize<'de> for IngressAudioEncodingOptions { +impl<'de> serde::Deserialize<'de> for ImageCodec { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "audio_codec", - "audioCodec", - "bitrate", - "disable_dtx", - "disableDtx", - "channels", + "IC_DEFAULT", + "IC_JPEG", ]; - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - AudioCodec, - Bitrate, - DisableDtx, - Channels, - __SkipField__, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; + struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ImageCodec; - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } + 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 { - "audioCodec" | "audio_codec" => Ok(GeneratedField::AudioCodec), - "bitrate" => Ok(GeneratedField::Bitrate), - "disableDtx" | "disable_dtx" => Ok(GeneratedField::DisableDtx), - "channels" => Ok(GeneratedField::Channels), - _ => Ok(GeneratedField::__SkipField__), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) + 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) + }) } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = IngressAudioEncodingOptions; - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.IngressAudioEncodingOptions") + 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_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, { - let mut audio_codec__ = None; - let mut bitrate__ = None; - let mut disable_dtx__ = None; - let mut channels__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::AudioCodec => { - if audio_codec__.is_some() { - return Err(serde::de::Error::duplicate_field("audioCodec")); - } - audio_codec__ = Some(map_.next_value::()? as i32); - } - GeneratedField::Bitrate => { - if bitrate__.is_some() { - return Err(serde::de::Error::duplicate_field("bitrate")); - } - bitrate__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::DisableDtx => { - if disable_dtx__.is_some() { - return Err(serde::de::Error::duplicate_field("disableDtx")); - } - disable_dtx__ = Some(map_.next_value()?); - } - GeneratedField::Channels => { - if channels__.is_some() { - return Err(serde::de::Error::duplicate_field("channels")); - } - channels__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; - } - } + match value { + "IC_DEFAULT" => Ok(ImageCodec::IcDefault), + "IC_JPEG" => Ok(ImageCodec::IcJpeg), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } - Ok(IngressAudioEncodingOptions { - audio_codec: audio_codec__.unwrap_or_default(), - bitrate: bitrate__.unwrap_or_default(), - disable_dtx: disable_dtx__.unwrap_or_default(), - channels: channels__.unwrap_or_default(), - }) } } - deserializer.deserialize_struct("livekit.IngressAudioEncodingOptions", FIELDS, GeneratedVisitor) + deserializer.deserialize_any(GeneratedVisitor) } } -impl serde::Serialize for IngressAudioEncodingPreset { +impl serde::Serialize for ImageFileSuffix { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { let variant = match self { - Self::OpusStereo96kbps => "OPUS_STEREO_96KBPS", - Self::OpusMono64kbs => "OPUS_MONO_64KBS", + Self::ImageSuffixIndex => "IMAGE_SUFFIX_INDEX", + Self::ImageSuffixTimestamp => "IMAGE_SUFFIX_TIMESTAMP", }; serializer.serialize_str(variant) } } -impl<'de> serde::Deserialize<'de> for IngressAudioEncodingPreset { +impl<'de> serde::Deserialize<'de> for ImageFileSuffix { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "OPUS_STEREO_96KBPS", - "OPUS_MONO_64KBS", + "IMAGE_SUFFIX_INDEX", + "IMAGE_SUFFIX_TIMESTAMP", ]; struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = IngressAudioEncodingPreset; + type Value = ImageFileSuffix; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(formatter, "expected one of: {:?}", &FIELDS) @@ -8544,8 +8801,8 @@ impl<'de> serde::Deserialize<'de> for IngressAudioEncodingPreset { E: serde::de::Error, { match value { - "OPUS_STEREO_96KBPS" => Ok(IngressAudioEncodingPreset::OpusStereo96kbps), - "OPUS_MONO_64KBS" => Ok(IngressAudioEncodingPreset::OpusMono64kbs), + "IMAGE_SUFFIX_INDEX" => Ok(ImageFileSuffix::ImageSuffixIndex), + "IMAGE_SUFFIX_TIMESTAMP" => Ok(ImageFileSuffix::ImageSuffixTimestamp), _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } } @@ -8553,7 +8810,7 @@ impl<'de> serde::Deserialize<'de> for IngressAudioEncodingPreset { deserializer.deserialize_any(GeneratedVisitor) } } -impl serde::Serialize for IngressAudioOptions { +impl serde::Serialize for ImageOutput { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -8561,58 +8818,113 @@ impl serde::Serialize for IngressAudioOptions { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.name.is_empty() { + if self.capture_interval != 0 { len += 1; } - if self.source != 0 { + if self.width != 0 { len += 1; } - if self.encoding_options.is_some() { + if self.height != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.IngressAudioOptions", len)?; - if !self.name.is_empty() { - struct_ser.serialize_field("name", &self.name)?; + if !self.filename_prefix.is_empty() { + len += 1; } - if self.source != 0 { - let v = TrackSource::try_from(self.source) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.source)))?; - struct_ser.serialize_field("source", &v)?; + if self.filename_suffix != 0 { + len += 1; } - if let Some(v) = self.encoding_options.as_ref() { + if self.image_codec != 0 { + len += 1; + } + if self.disable_manifest { + len += 1; + } + if self.output.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.ImageOutput", len)?; + if self.capture_interval != 0 { + struct_ser.serialize_field("captureInterval", &self.capture_interval)?; + } + if self.width != 0 { + struct_ser.serialize_field("width", &self.width)?; + } + if self.height != 0 { + struct_ser.serialize_field("height", &self.height)?; + } + if !self.filename_prefix.is_empty() { + struct_ser.serialize_field("filenamePrefix", &self.filename_prefix)?; + } + if self.filename_suffix != 0 { + let v = ImageFileSuffix::try_from(self.filename_suffix) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.filename_suffix)))?; + struct_ser.serialize_field("filenameSuffix", &v)?; + } + if self.image_codec != 0 { + let v = ImageCodec::try_from(self.image_codec) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.image_codec)))?; + struct_ser.serialize_field("imageCodec", &v)?; + } + if self.disable_manifest { + struct_ser.serialize_field("disableManifest", &self.disable_manifest)?; + } + if let Some(v) = self.output.as_ref() { match v { - ingress_audio_options::EncodingOptions::Preset(v) => { - let v = IngressAudioEncodingPreset::try_from(*v) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; - struct_ser.serialize_field("preset", &v)?; + image_output::Output::S3(v) => { + struct_ser.serialize_field("s3", v)?; } - ingress_audio_options::EncodingOptions::Options(v) => { - struct_ser.serialize_field("options", v)?; + image_output::Output::Gcp(v) => { + struct_ser.serialize_field("gcp", v)?; + } + image_output::Output::Azure(v) => { + struct_ser.serialize_field("azure", v)?; + } + image_output::Output::AliOss(v) => { + struct_ser.serialize_field("aliOSS", v)?; } } } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for IngressAudioOptions { +impl<'de> serde::Deserialize<'de> for ImageOutput { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "name", - "source", - "preset", - "options", + "capture_interval", + "captureInterval", + "width", + "height", + "filename_prefix", + "filenamePrefix", + "filename_suffix", + "filenameSuffix", + "image_codec", + "imageCodec", + "disable_manifest", + "disableManifest", + "s3", + "gcp", + "azure", + "aliOSS", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Name, - Source, - Preset, - Options, + CaptureInterval, + Width, + Height, + FilenamePrefix, + FilenameSuffix, + ImageCodec, + DisableManifest, + S3, + Gcp, + Azure, + AliOss, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -8635,10 +8947,17 @@ impl<'de> serde::Deserialize<'de> for IngressAudioOptions { E: serde::de::Error, { match value { - "name" => Ok(GeneratedField::Name), - "source" => Ok(GeneratedField::Source), - "preset" => Ok(GeneratedField::Preset), - "options" => Ok(GeneratedField::Options), + "captureInterval" | "capture_interval" => Ok(GeneratedField::CaptureInterval), + "width" => Ok(GeneratedField::Width), + "height" => Ok(GeneratedField::Height), + "filenamePrefix" | "filename_prefix" => Ok(GeneratedField::FilenamePrefix), + "filenameSuffix" | "filename_suffix" => Ok(GeneratedField::FilenameSuffix), + "imageCodec" | "image_codec" => Ok(GeneratedField::ImageCodec), + "disableManifest" | "disable_manifest" => Ok(GeneratedField::DisableManifest), + "s3" => Ok(GeneratedField::S3), + "gcp" => Ok(GeneratedField::Gcp), + "azure" => Ok(GeneratedField::Azure), + "aliOSS" => Ok(GeneratedField::AliOss), _ => Ok(GeneratedField::__SkipField__), } } @@ -8648,44 +8967,100 @@ impl<'de> serde::Deserialize<'de> for IngressAudioOptions { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = IngressAudioOptions; + type Value = ImageOutput; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.IngressAudioOptions") + formatter.write_str("struct livekit.ImageOutput") } - 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 name__ = None; - let mut source__ = None; - let mut encoding_options__ = None; + let mut capture_interval__ = None; + let mut width__ = None; + let mut height__ = None; + let mut filename_prefix__ = None; + let mut filename_suffix__ = None; + let mut image_codec__ = None; + let mut disable_manifest__ = None; + let mut output__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); + GeneratedField::CaptureInterval => { + if capture_interval__.is_some() { + return Err(serde::de::Error::duplicate_field("captureInterval")); } - name__ = Some(map_.next_value()?); + capture_interval__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } - GeneratedField::Source => { - if source__.is_some() { - return Err(serde::de::Error::duplicate_field("source")); + GeneratedField::Width => { + if width__.is_some() { + return Err(serde::de::Error::duplicate_field("width")); } - source__ = Some(map_.next_value::()? as i32); + width__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } - GeneratedField::Preset => { - if encoding_options__.is_some() { - return Err(serde::de::Error::duplicate_field("preset")); + GeneratedField::Height => { + if height__.is_some() { + return Err(serde::de::Error::duplicate_field("height")); } - encoding_options__ = map_.next_value::<::std::option::Option>()?.map(|x| ingress_audio_options::EncodingOptions::Preset(x as i32)); + height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } - GeneratedField::Options => { - if encoding_options__.is_some() { - return Err(serde::de::Error::duplicate_field("options")); + GeneratedField::FilenamePrefix => { + if filename_prefix__.is_some() { + return Err(serde::de::Error::duplicate_field("filenamePrefix")); } - encoding_options__ = map_.next_value::<::std::option::Option<_>>()?.map(ingress_audio_options::EncodingOptions::Options) + filename_prefix__ = Some(map_.next_value()?); + } + GeneratedField::FilenameSuffix => { + if filename_suffix__.is_some() { + return Err(serde::de::Error::duplicate_field("filenameSuffix")); + } + filename_suffix__ = Some(map_.next_value::()? as i32); + } + GeneratedField::ImageCodec => { + if image_codec__.is_some() { + return Err(serde::de::Error::duplicate_field("imageCodec")); + } + image_codec__ = Some(map_.next_value::()? as i32); + } + GeneratedField::DisableManifest => { + if disable_manifest__.is_some() { + return Err(serde::de::Error::duplicate_field("disableManifest")); + } + disable_manifest__ = Some(map_.next_value()?); + } + GeneratedField::S3 => { + if output__.is_some() { + return Err(serde::de::Error::duplicate_field("s3")); + } + output__ = map_.next_value::<::std::option::Option<_>>()?.map(image_output::Output::S3) +; + } + GeneratedField::Gcp => { + if output__.is_some() { + return Err(serde::de::Error::duplicate_field("gcp")); + } + output__ = map_.next_value::<::std::option::Option<_>>()?.map(image_output::Output::Gcp) +; + } + GeneratedField::Azure => { + if output__.is_some() { + return Err(serde::de::Error::duplicate_field("azure")); + } + output__ = map_.next_value::<::std::option::Option<_>>()?.map(image_output::Output::Azure) +; + } + GeneratedField::AliOss => { + if output__.is_some() { + return Err(serde::de::Error::duplicate_field("aliOSS")); + } + output__ = map_.next_value::<::std::option::Option<_>>()?.map(image_output::Output::AliOss) ; } GeneratedField::__SkipField__ => { @@ -8693,17 +9068,22 @@ impl<'de> serde::Deserialize<'de> for IngressAudioOptions { } } } - Ok(IngressAudioOptions { - name: name__.unwrap_or_default(), - source: source__.unwrap_or_default(), - encoding_options: encoding_options__, + Ok(ImageOutput { + capture_interval: capture_interval__.unwrap_or_default(), + width: width__.unwrap_or_default(), + height: height__.unwrap_or_default(), + filename_prefix: filename_prefix__.unwrap_or_default(), + filename_suffix: filename_suffix__.unwrap_or_default(), + image_codec: image_codec__.unwrap_or_default(), + disable_manifest: disable_manifest__.unwrap_or_default(), + output: output__, }) } } - deserializer.deserialize_struct("livekit.IngressAudioOptions", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ImageOutput", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for IngressInfo { +impl serde::Serialize for ImagesInfo { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -8711,152 +9091,63 @@ impl serde::Serialize for IngressInfo { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.ingress_id.is_empty() { + if !self.filename_prefix.is_empty() { len += 1; } - if !self.name.is_empty() { + if self.image_count != 0 { len += 1; } - if !self.stream_key.is_empty() { + if self.started_at != 0 { len += 1; } - if !self.url.is_empty() { + if self.ended_at != 0 { len += 1; } - if self.input_type != 0 { - len += 1; + let mut struct_ser = serializer.serialize_struct("livekit.ImagesInfo", len)?; + if !self.filename_prefix.is_empty() { + struct_ser.serialize_field("filenamePrefix", &self.filename_prefix)?; } - if self.bypass_transcoding { - len += 1; + if self.image_count != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("imageCount", ToString::to_string(&self.image_count).as_str())?; } - if self.enable_transcoding.is_some() { - len += 1; - } - if self.audio.is_some() { - len += 1; - } - if self.video.is_some() { - len += 1; - } - if !self.room_name.is_empty() { - len += 1; - } - if !self.participant_identity.is_empty() { - len += 1; - } - if !self.participant_name.is_empty() { - len += 1; - } - if !self.participant_metadata.is_empty() { - len += 1; - } - if self.reusable { - len += 1; - } - if self.state.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("livekit.IngressInfo", len)?; - if !self.ingress_id.is_empty() { - struct_ser.serialize_field("ingressId", &self.ingress_id)?; - } - if !self.name.is_empty() { - struct_ser.serialize_field("name", &self.name)?; - } - if !self.stream_key.is_empty() { - struct_ser.serialize_field("streamKey", &self.stream_key)?; - } - if !self.url.is_empty() { - struct_ser.serialize_field("url", &self.url)?; - } - if self.input_type != 0 { - let v = IngressInput::try_from(self.input_type) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.input_type)))?; - struct_ser.serialize_field("inputType", &v)?; - } - if self.bypass_transcoding { - struct_ser.serialize_field("bypassTranscoding", &self.bypass_transcoding)?; - } - if let Some(v) = self.enable_transcoding.as_ref() { - struct_ser.serialize_field("enableTranscoding", v)?; - } - if let Some(v) = self.audio.as_ref() { - struct_ser.serialize_field("audio", v)?; - } - if let Some(v) = self.video.as_ref() { - struct_ser.serialize_field("video", v)?; - } - if !self.room_name.is_empty() { - struct_ser.serialize_field("roomName", &self.room_name)?; - } - if !self.participant_identity.is_empty() { - struct_ser.serialize_field("participantIdentity", &self.participant_identity)?; - } - if !self.participant_name.is_empty() { - struct_ser.serialize_field("participantName", &self.participant_name)?; - } - if !self.participant_metadata.is_empty() { - struct_ser.serialize_field("participantMetadata", &self.participant_metadata)?; - } - if self.reusable { - struct_ser.serialize_field("reusable", &self.reusable)?; + if self.started_at != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("startedAt", ToString::to_string(&self.started_at).as_str())?; } - if let Some(v) = self.state.as_ref() { - struct_ser.serialize_field("state", v)?; + if self.ended_at != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("endedAt", ToString::to_string(&self.ended_at).as_str())?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for IngressInfo { +impl<'de> serde::Deserialize<'de> for ImagesInfo { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "ingress_id", - "ingressId", - "name", - "stream_key", - "streamKey", - "url", - "input_type", - "inputType", - "bypass_transcoding", - "bypassTranscoding", - "enable_transcoding", - "enableTranscoding", - "audio", - "video", - "room_name", - "roomName", - "participant_identity", - "participantIdentity", - "participant_name", - "participantName", - "participant_metadata", - "participantMetadata", - "reusable", - "state", + "filename_prefix", + "filenamePrefix", + "image_count", + "imageCount", + "started_at", + "startedAt", + "ended_at", + "endedAt", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - IngressId, - Name, - StreamKey, - Url, - InputType, - BypassTranscoding, - EnableTranscoding, - Audio, - Video, - RoomName, - ParticipantIdentity, - ParticipantName, - ParticipantMetadata, - Reusable, - State, + FilenamePrefix, + ImageCount, + StartedAt, + EndedAt, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -8879,21 +9170,10 @@ impl<'de> serde::Deserialize<'de> for IngressInfo { E: serde::de::Error, { match value { - "ingressId" | "ingress_id" => Ok(GeneratedField::IngressId), - "name" => Ok(GeneratedField::Name), - "streamKey" | "stream_key" => Ok(GeneratedField::StreamKey), - "url" => Ok(GeneratedField::Url), - "inputType" | "input_type" => Ok(GeneratedField::InputType), - "bypassTranscoding" | "bypass_transcoding" => Ok(GeneratedField::BypassTranscoding), - "enableTranscoding" | "enable_transcoding" => Ok(GeneratedField::EnableTranscoding), - "audio" => Ok(GeneratedField::Audio), - "video" => Ok(GeneratedField::Video), - "roomName" | "room_name" => Ok(GeneratedField::RoomName), - "participantIdentity" | "participant_identity" => Ok(GeneratedField::ParticipantIdentity), - "participantName" | "participant_name" => Ok(GeneratedField::ParticipantName), - "participantMetadata" | "participant_metadata" => Ok(GeneratedField::ParticipantMetadata), - "reusable" => Ok(GeneratedField::Reusable), - "state" => Ok(GeneratedField::State), + "filenamePrefix" | "filename_prefix" => Ok(GeneratedField::FilenamePrefix), + "imageCount" | "image_count" => Ok(GeneratedField::ImageCount), + "startedAt" | "started_at" => Ok(GeneratedField::StartedAt), + "endedAt" | "ended_at" => Ok(GeneratedField::EndedAt), _ => Ok(GeneratedField::__SkipField__), } } @@ -8903,180 +9183,250 @@ impl<'de> serde::Deserialize<'de> for IngressInfo { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = IngressInfo; + type Value = ImagesInfo; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.IngressInfo") + formatter.write_str("struct livekit.ImagesInfo") } - 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 ingress_id__ = None; - let mut name__ = None; - let mut stream_key__ = None; - let mut url__ = None; - let mut input_type__ = None; - let mut bypass_transcoding__ = None; - let mut enable_transcoding__ = None; - let mut audio__ = None; - let mut video__ = None; - let mut room_name__ = None; - let mut participant_identity__ = None; - let mut participant_name__ = None; - let mut participant_metadata__ = None; - let mut reusable__ = None; - let mut state__ = None; + let mut filename_prefix__ = None; + let mut image_count__ = None; + let mut started_at__ = None; + let mut ended_at__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::IngressId => { - if ingress_id__.is_some() { - return Err(serde::de::Error::duplicate_field("ingressId")); - } - ingress_id__ = Some(map_.next_value()?); - } - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); - } - name__ = Some(map_.next_value()?); - } - GeneratedField::StreamKey => { - if stream_key__.is_some() { - return Err(serde::de::Error::duplicate_field("streamKey")); - } - stream_key__ = Some(map_.next_value()?); - } - GeneratedField::Url => { - if url__.is_some() { - return Err(serde::de::Error::duplicate_field("url")); - } - url__ = Some(map_.next_value()?); - } - GeneratedField::InputType => { - if input_type__.is_some() { - return Err(serde::de::Error::duplicate_field("inputType")); - } - input_type__ = Some(map_.next_value::()? as i32); - } - GeneratedField::BypassTranscoding => { - if bypass_transcoding__.is_some() { - return Err(serde::de::Error::duplicate_field("bypassTranscoding")); + GeneratedField::FilenamePrefix => { + if filename_prefix__.is_some() { + return Err(serde::de::Error::duplicate_field("filenamePrefix")); } - bypass_transcoding__ = Some(map_.next_value()?); + filename_prefix__ = Some(map_.next_value()?); } - GeneratedField::EnableTranscoding => { - if enable_transcoding__.is_some() { - return Err(serde::de::Error::duplicate_field("enableTranscoding")); + GeneratedField::ImageCount => { + if image_count__.is_some() { + return Err(serde::de::Error::duplicate_field("imageCount")); } - enable_transcoding__ = map_.next_value()?; + image_count__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } - GeneratedField::Audio => { - if audio__.is_some() { - return Err(serde::de::Error::duplicate_field("audio")); + GeneratedField::StartedAt => { + if started_at__.is_some() { + return Err(serde::de::Error::duplicate_field("startedAt")); } - audio__ = map_.next_value()?; + started_at__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } - GeneratedField::Video => { - if video__.is_some() { - return Err(serde::de::Error::duplicate_field("video")); + GeneratedField::EndedAt => { + if ended_at__.is_some() { + return Err(serde::de::Error::duplicate_field("endedAt")); } - video__ = map_.next_value()?; + ended_at__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } - GeneratedField::RoomName => { - if room_name__.is_some() { - return Err(serde::de::Error::duplicate_field("roomName")); - } - room_name__ = Some(map_.next_value()?); + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; } - GeneratedField::ParticipantIdentity => { - if participant_identity__.is_some() { - return Err(serde::de::Error::duplicate_field("participantIdentity")); - } - participant_identity__ = Some(map_.next_value()?); + } + } + Ok(ImagesInfo { + filename_prefix: filename_prefix__.unwrap_or_default(), + image_count: image_count__.unwrap_or_default(), + started_at: started_at__.unwrap_or_default(), + ended_at: ended_at__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.ImagesInfo", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for IngressAudioEncodingOptions { + #[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_codec != 0 { + len += 1; + } + if self.bitrate != 0 { + len += 1; + } + if self.disable_dtx { + len += 1; + } + if self.channels != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.IngressAudioEncodingOptions", len)?; + if self.audio_codec != 0 { + let v = AudioCodec::try_from(self.audio_codec) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.audio_codec)))?; + struct_ser.serialize_field("audioCodec", &v)?; + } + if self.bitrate != 0 { + struct_ser.serialize_field("bitrate", &self.bitrate)?; + } + if self.disable_dtx { + struct_ser.serialize_field("disableDtx", &self.disable_dtx)?; + } + if self.channels != 0 { + struct_ser.serialize_field("channels", &self.channels)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for IngressAudioEncodingOptions { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "audio_codec", + "audioCodec", + "bitrate", + "disable_dtx", + "disableDtx", + "channels", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AudioCodec, + Bitrate, + DisableDtx, + Channels, + __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 { + "audioCodec" | "audio_codec" => Ok(GeneratedField::AudioCodec), + "bitrate" => Ok(GeneratedField::Bitrate), + "disableDtx" | "disable_dtx" => Ok(GeneratedField::DisableDtx), + "channels" => Ok(GeneratedField::Channels), + _ => Ok(GeneratedField::__SkipField__), } - GeneratedField::ParticipantName => { - if participant_name__.is_some() { - return Err(serde::de::Error::duplicate_field("participantName")); + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = IngressAudioEncodingOptions; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.IngressAudioEncodingOptions") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut audio_codec__ = None; + let mut bitrate__ = None; + let mut disable_dtx__ = None; + let mut channels__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::AudioCodec => { + if audio_codec__.is_some() { + return Err(serde::de::Error::duplicate_field("audioCodec")); } - participant_name__ = Some(map_.next_value()?); + audio_codec__ = Some(map_.next_value::()? as i32); } - GeneratedField::ParticipantMetadata => { - if participant_metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("participantMetadata")); + GeneratedField::Bitrate => { + if bitrate__.is_some() { + return Err(serde::de::Error::duplicate_field("bitrate")); } - participant_metadata__ = Some(map_.next_value()?); + bitrate__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } - GeneratedField::Reusable => { - if reusable__.is_some() { - return Err(serde::de::Error::duplicate_field("reusable")); + GeneratedField::DisableDtx => { + if disable_dtx__.is_some() { + return Err(serde::de::Error::duplicate_field("disableDtx")); } - reusable__ = Some(map_.next_value()?); + disable_dtx__ = Some(map_.next_value()?); } - GeneratedField::State => { - if state__.is_some() { - return Err(serde::de::Error::duplicate_field("state")); + GeneratedField::Channels => { + if channels__.is_some() { + return Err(serde::de::Error::duplicate_field("channels")); } - state__ = map_.next_value()?; + channels__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(IngressInfo { - ingress_id: ingress_id__.unwrap_or_default(), - name: name__.unwrap_or_default(), - stream_key: stream_key__.unwrap_or_default(), - url: url__.unwrap_or_default(), - input_type: input_type__.unwrap_or_default(), - bypass_transcoding: bypass_transcoding__.unwrap_or_default(), - enable_transcoding: enable_transcoding__, - audio: audio__, - video: video__, - room_name: room_name__.unwrap_or_default(), - participant_identity: participant_identity__.unwrap_or_default(), - participant_name: participant_name__.unwrap_or_default(), - participant_metadata: participant_metadata__.unwrap_or_default(), - reusable: reusable__.unwrap_or_default(), - state: state__, + Ok(IngressAudioEncodingOptions { + audio_codec: audio_codec__.unwrap_or_default(), + bitrate: bitrate__.unwrap_or_default(), + disable_dtx: disable_dtx__.unwrap_or_default(), + channels: channels__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.IngressInfo", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.IngressAudioEncodingOptions", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for IngressInput { +impl serde::Serialize for IngressAudioEncodingPreset { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { let variant = match self { - Self::RtmpInput => "RTMP_INPUT", - Self::WhipInput => "WHIP_INPUT", - Self::UrlInput => "URL_INPUT", + Self::OpusStereo96kbps => "OPUS_STEREO_96KBPS", + Self::OpusMono64kbs => "OPUS_MONO_64KBS", }; serializer.serialize_str(variant) } } -impl<'de> serde::Deserialize<'de> for IngressInput { +impl<'de> serde::Deserialize<'de> for IngressAudioEncodingPreset { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "RTMP_INPUT", - "WHIP_INPUT", - "URL_INPUT", + "OPUS_STEREO_96KBPS", + "OPUS_MONO_64KBS", ]; struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = IngressInput; + type Value = IngressAudioEncodingPreset; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(formatter, "expected one of: {:?}", &FIELDS) @@ -9111,9 +9461,8 @@ impl<'de> serde::Deserialize<'de> for IngressInput { E: serde::de::Error, { match value { - "RTMP_INPUT" => Ok(IngressInput::RtmpInput), - "WHIP_INPUT" => Ok(IngressInput::WhipInput), - "URL_INPUT" => Ok(IngressInput::UrlInput), + "OPUS_STEREO_96KBPS" => Ok(IngressAudioEncodingPreset::OpusStereo96kbps), + "OPUS_MONO_64KBS" => Ok(IngressAudioEncodingPreset::OpusMono64kbs), _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } } @@ -9121,7 +9470,7 @@ impl<'de> serde::Deserialize<'de> for IngressInput { deserializer.deserialize_any(GeneratedVisitor) } } -impl serde::Serialize for IngressState { +impl serde::Serialize for IngressAudioOptions { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -9129,114 +9478,58 @@ impl serde::Serialize for IngressState { { use serde::ser::SerializeStruct; let mut len = 0; - if self.status != 0 { - len += 1; - } - if !self.error.is_empty() { - len += 1; - } - if self.video.is_some() { - len += 1; - } - if self.audio.is_some() { - len += 1; - } - if !self.room_id.is_empty() { - len += 1; - } - if self.started_at != 0 { - len += 1; - } - if self.ended_at != 0 { + if !self.name.is_empty() { len += 1; } - if self.updated_at != 0 { + if self.source != 0 { len += 1; } - if !self.resource_id.is_empty() { + if self.encoding_options.is_some() { len += 1; } - if !self.tracks.is_empty() { - len += 1; + let mut struct_ser = serializer.serialize_struct("livekit.IngressAudioOptions", len)?; + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; } - let mut struct_ser = serializer.serialize_struct("livekit.IngressState", len)?; - if self.status != 0 { - let v = ingress_state::Status::try_from(self.status) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.status)))?; - struct_ser.serialize_field("status", &v)?; + if self.source != 0 { + let v = TrackSource::try_from(self.source) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.source)))?; + struct_ser.serialize_field("source", &v)?; } - if !self.error.is_empty() { - struct_ser.serialize_field("error", &self.error)?; - } - if let Some(v) = self.video.as_ref() { - struct_ser.serialize_field("video", v)?; - } - if let Some(v) = self.audio.as_ref() { - struct_ser.serialize_field("audio", v)?; - } - if !self.room_id.is_empty() { - struct_ser.serialize_field("roomId", &self.room_id)?; - } - if self.started_at != 0 { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("startedAt", ToString::to_string(&self.started_at).as_str())?; - } - if self.ended_at != 0 { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("endedAt", ToString::to_string(&self.ended_at).as_str())?; - } - if self.updated_at != 0 { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("updatedAt", ToString::to_string(&self.updated_at).as_str())?; - } - if !self.resource_id.is_empty() { - struct_ser.serialize_field("resourceId", &self.resource_id)?; - } - if !self.tracks.is_empty() { - struct_ser.serialize_field("tracks", &self.tracks)?; + if let Some(v) = self.encoding_options.as_ref() { + match v { + ingress_audio_options::EncodingOptions::Preset(v) => { + let v = IngressAudioEncodingPreset::try_from(*v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("preset", &v)?; + } + ingress_audio_options::EncodingOptions::Options(v) => { + struct_ser.serialize_field("options", v)?; + } + } } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for IngressState { +impl<'de> serde::Deserialize<'de> for IngressAudioOptions { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "status", - "error", - "video", - "audio", - "room_id", - "roomId", - "started_at", - "startedAt", - "ended_at", - "endedAt", - "updated_at", - "updatedAt", - "resource_id", - "resourceId", - "tracks", + "name", + "source", + "preset", + "options", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Status, - Error, - Video, - Audio, - RoomId, - StartedAt, - EndedAt, - UpdatedAt, - ResourceId, - Tracks, + Name, + Source, + Preset, + Options, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -9259,16 +9552,10 @@ impl<'de> serde::Deserialize<'de> for IngressState { E: serde::de::Error, { match value { - "status" => Ok(GeneratedField::Status), - "error" => Ok(GeneratedField::Error), - "video" => Ok(GeneratedField::Video), - "audio" => Ok(GeneratedField::Audio), - "roomId" | "room_id" => Ok(GeneratedField::RoomId), - "startedAt" | "started_at" => Ok(GeneratedField::StartedAt), - "endedAt" | "ended_at" => Ok(GeneratedField::EndedAt), - "updatedAt" | "updated_at" => Ok(GeneratedField::UpdatedAt), - "resourceId" | "resource_id" => Ok(GeneratedField::ResourceId), - "tracks" => Ok(GeneratedField::Tracks), + "name" => Ok(GeneratedField::Name), + "source" => Ok(GeneratedField::Source), + "preset" => Ok(GeneratedField::Preset), + "options" => Ok(GeneratedField::Options), _ => Ok(GeneratedField::__SkipField__), } } @@ -9278,197 +9565,62 @@ impl<'de> serde::Deserialize<'de> for IngressState { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = IngressState; + type Value = IngressAudioOptions; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.IngressState") + formatter.write_str("struct livekit.IngressAudioOptions") } - 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 status__ = None; - let mut error__ = None; - let mut video__ = None; - let mut audio__ = None; - let mut room_id__ = None; - let mut started_at__ = None; - let mut ended_at__ = None; - let mut updated_at__ = None; - let mut resource_id__ = None; - let mut tracks__ = None; + let mut name__ = None; + let mut source__ = None; + let mut encoding_options__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Status => { - if status__.is_some() { - return Err(serde::de::Error::duplicate_field("status")); - } - status__ = Some(map_.next_value::()? as i32); - } - GeneratedField::Error => { - if error__.is_some() { - return Err(serde::de::Error::duplicate_field("error")); - } - error__ = Some(map_.next_value()?); - } - GeneratedField::Video => { - if video__.is_some() { - return Err(serde::de::Error::duplicate_field("video")); - } - video__ = map_.next_value()?; - } - GeneratedField::Audio => { - if audio__.is_some() { - return Err(serde::de::Error::duplicate_field("audio")); - } - audio__ = map_.next_value()?; - } - GeneratedField::RoomId => { - if room_id__.is_some() { - return Err(serde::de::Error::duplicate_field("roomId")); - } - room_id__ = Some(map_.next_value()?); - } - GeneratedField::StartedAt => { - if started_at__.is_some() { - return Err(serde::de::Error::duplicate_field("startedAt")); - } - started_at__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::EndedAt => { - if ended_at__.is_some() { - return Err(serde::de::Error::duplicate_field("endedAt")); + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); } - ended_at__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + name__ = Some(map_.next_value()?); } - GeneratedField::UpdatedAt => { - if updated_at__.is_some() { - return Err(serde::de::Error::duplicate_field("updatedAt")); + GeneratedField::Source => { + if source__.is_some() { + return Err(serde::de::Error::duplicate_field("source")); } - updated_at__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + source__ = Some(map_.next_value::()? as i32); } - GeneratedField::ResourceId => { - if resource_id__.is_some() { - return Err(serde::de::Error::duplicate_field("resourceId")); + GeneratedField::Preset => { + if encoding_options__.is_some() { + return Err(serde::de::Error::duplicate_field("preset")); } - resource_id__ = Some(map_.next_value()?); + encoding_options__ = map_.next_value::<::std::option::Option>()?.map(|x| ingress_audio_options::EncodingOptions::Preset(x as i32)); } - GeneratedField::Tracks => { - if tracks__.is_some() { - return Err(serde::de::Error::duplicate_field("tracks")); + GeneratedField::Options => { + if encoding_options__.is_some() { + return Err(serde::de::Error::duplicate_field("options")); } - tracks__ = Some(map_.next_value()?); + encoding_options__ = map_.next_value::<::std::option::Option<_>>()?.map(ingress_audio_options::EncodingOptions::Options) +; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(IngressState { - status: status__.unwrap_or_default(), - error: error__.unwrap_or_default(), - video: video__, - audio: audio__, - room_id: room_id__.unwrap_or_default(), - started_at: started_at__.unwrap_or_default(), - ended_at: ended_at__.unwrap_or_default(), - updated_at: updated_at__.unwrap_or_default(), - resource_id: resource_id__.unwrap_or_default(), - tracks: tracks__.unwrap_or_default(), + Ok(IngressAudioOptions { + name: name__.unwrap_or_default(), + source: source__.unwrap_or_default(), + encoding_options: encoding_options__, }) } } - deserializer.deserialize_struct("livekit.IngressState", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.IngressAudioOptions", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ingress_state::Status { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::EndpointInactive => "ENDPOINT_INACTIVE", - Self::EndpointBuffering => "ENDPOINT_BUFFERING", - Self::EndpointPublishing => "ENDPOINT_PUBLISHING", - Self::EndpointError => "ENDPOINT_ERROR", - Self::EndpointComplete => "ENDPOINT_COMPLETE", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for ingress_state::Status { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "ENDPOINT_INACTIVE", - "ENDPOINT_BUFFERING", - "ENDPOINT_PUBLISHING", - "ENDPOINT_ERROR", - "ENDPOINT_COMPLETE", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ingress_state::Status; - - 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 { - "ENDPOINT_INACTIVE" => Ok(ingress_state::Status::EndpointInactive), - "ENDPOINT_BUFFERING" => Ok(ingress_state::Status::EndpointBuffering), - "ENDPOINT_PUBLISHING" => Ok(ingress_state::Status::EndpointPublishing), - "ENDPOINT_ERROR" => Ok(ingress_state::Status::EndpointError), - "ENDPOINT_COMPLETE" => Ok(ingress_state::Status::EndpointComplete), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for IngressVideoEncodingOptions { +impl serde::Serialize for IngressInfo { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -9476,49 +9628,152 @@ impl serde::Serialize for IngressVideoEncodingOptions { { use serde::ser::SerializeStruct; let mut len = 0; - if self.video_codec != 0 { + if !self.ingress_id.is_empty() { len += 1; } - if self.frame_rate != 0. { + if !self.name.is_empty() { len += 1; } - if !self.layers.is_empty() { + if !self.stream_key.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.IngressVideoEncodingOptions", len)?; - if self.video_codec != 0 { - let v = VideoCodec::try_from(self.video_codec) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.video_codec)))?; - struct_ser.serialize_field("videoCodec", &v)?; + if !self.url.is_empty() { + len += 1; } - if self.frame_rate != 0. { - struct_ser.serialize_field("frameRate", &self.frame_rate)?; + if self.input_type != 0 { + len += 1; } - if !self.layers.is_empty() { - struct_ser.serialize_field("layers", &self.layers)?; + if self.bypass_transcoding { + len += 1; + } + if self.enable_transcoding.is_some() { + len += 1; + } + if self.audio.is_some() { + len += 1; + } + if self.video.is_some() { + len += 1; + } + if !self.room_name.is_empty() { + len += 1; + } + if !self.participant_identity.is_empty() { + len += 1; + } + if !self.participant_name.is_empty() { + len += 1; + } + if !self.participant_metadata.is_empty() { + len += 1; + } + if self.reusable { + len += 1; + } + if self.state.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.IngressInfo", len)?; + if !self.ingress_id.is_empty() { + struct_ser.serialize_field("ingressId", &self.ingress_id)?; + } + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if !self.stream_key.is_empty() { + struct_ser.serialize_field("streamKey", &self.stream_key)?; + } + if !self.url.is_empty() { + struct_ser.serialize_field("url", &self.url)?; + } + if self.input_type != 0 { + let v = IngressInput::try_from(self.input_type) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.input_type)))?; + struct_ser.serialize_field("inputType", &v)?; + } + if self.bypass_transcoding { + struct_ser.serialize_field("bypassTranscoding", &self.bypass_transcoding)?; + } + if let Some(v) = self.enable_transcoding.as_ref() { + struct_ser.serialize_field("enableTranscoding", v)?; + } + if let Some(v) = self.audio.as_ref() { + struct_ser.serialize_field("audio", v)?; + } + if let Some(v) = self.video.as_ref() { + struct_ser.serialize_field("video", v)?; + } + if !self.room_name.is_empty() { + struct_ser.serialize_field("roomName", &self.room_name)?; + } + if !self.participant_identity.is_empty() { + struct_ser.serialize_field("participantIdentity", &self.participant_identity)?; + } + if !self.participant_name.is_empty() { + struct_ser.serialize_field("participantName", &self.participant_name)?; + } + if !self.participant_metadata.is_empty() { + struct_ser.serialize_field("participantMetadata", &self.participant_metadata)?; + } + if self.reusable { + struct_ser.serialize_field("reusable", &self.reusable)?; + } + if let Some(v) = self.state.as_ref() { + struct_ser.serialize_field("state", v)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for IngressVideoEncodingOptions { +impl<'de> serde::Deserialize<'de> for IngressInfo { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "video_codec", - "videoCodec", - "frame_rate", - "frameRate", - "layers", + "ingress_id", + "ingressId", + "name", + "stream_key", + "streamKey", + "url", + "input_type", + "inputType", + "bypass_transcoding", + "bypassTranscoding", + "enable_transcoding", + "enableTranscoding", + "audio", + "video", + "room_name", + "roomName", + "participant_identity", + "participantIdentity", + "participant_name", + "participantName", + "participant_metadata", + "participantMetadata", + "reusable", + "state", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - VideoCodec, - FrameRate, - Layers, + IngressId, + Name, + StreamKey, + Url, + InputType, + BypassTranscoding, + EnableTranscoding, + Audio, + Video, + RoomName, + ParticipantIdentity, + ParticipantName, + ParticipantMetadata, + Reusable, + State, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -9541,9 +9796,21 @@ impl<'de> serde::Deserialize<'de> for IngressVideoEncodingOptions { E: serde::de::Error, { match value { - "videoCodec" | "video_codec" => Ok(GeneratedField::VideoCodec), - "frameRate" | "frame_rate" => Ok(GeneratedField::FrameRate), - "layers" => Ok(GeneratedField::Layers), + "ingressId" | "ingress_id" => Ok(GeneratedField::IngressId), + "name" => Ok(GeneratedField::Name), + "streamKey" | "stream_key" => Ok(GeneratedField::StreamKey), + "url" => Ok(GeneratedField::Url), + "inputType" | "input_type" => Ok(GeneratedField::InputType), + "bypassTranscoding" | "bypass_transcoding" => Ok(GeneratedField::BypassTranscoding), + "enableTranscoding" | "enable_transcoding" => Ok(GeneratedField::EnableTranscoding), + "audio" => Ok(GeneratedField::Audio), + "video" => Ok(GeneratedField::Video), + "roomName" | "room_name" => Ok(GeneratedField::RoomName), + "participantIdentity" | "participant_identity" => Ok(GeneratedField::ParticipantIdentity), + "participantName" | "participant_name" => Ok(GeneratedField::ParticipantName), + "participantMetadata" | "participant_metadata" => Ok(GeneratedField::ParticipantMetadata), + "reusable" => Ok(GeneratedField::Reusable), + "state" => Ok(GeneratedField::State), _ => Ok(GeneratedField::__SkipField__), } } @@ -9553,100 +9820,180 @@ impl<'de> serde::Deserialize<'de> for IngressVideoEncodingOptions { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = IngressVideoEncodingOptions; + type Value = IngressInfo; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.IngressVideoEncodingOptions") + formatter.write_str("struct livekit.IngressInfo") } - 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 video_codec__ = None; - let mut frame_rate__ = None; - let mut layers__ = None; + let mut ingress_id__ = None; + let mut name__ = None; + let mut stream_key__ = None; + let mut url__ = None; + let mut input_type__ = None; + let mut bypass_transcoding__ = None; + let mut enable_transcoding__ = None; + let mut audio__ = None; + let mut video__ = None; + let mut room_name__ = None; + let mut participant_identity__ = None; + let mut participant_name__ = None; + let mut participant_metadata__ = None; + let mut reusable__ = None; + let mut state__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::VideoCodec => { - if video_codec__.is_some() { - return Err(serde::de::Error::duplicate_field("videoCodec")); + GeneratedField::IngressId => { + if ingress_id__.is_some() { + return Err(serde::de::Error::duplicate_field("ingressId")); } - video_codec__ = Some(map_.next_value::()? as i32); + ingress_id__ = Some(map_.next_value()?); } - GeneratedField::FrameRate => { - if frame_rate__.is_some() { - return Err(serde::de::Error::duplicate_field("frameRate")); + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); } - frame_rate__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + name__ = Some(map_.next_value()?); } - GeneratedField::Layers => { - if layers__.is_some() { - return Err(serde::de::Error::duplicate_field("layers")); + GeneratedField::StreamKey => { + if stream_key__.is_some() { + return Err(serde::de::Error::duplicate_field("streamKey")); } - layers__ = Some(map_.next_value()?); + stream_key__ = Some(map_.next_value()?); } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; + GeneratedField::Url => { + if url__.is_some() { + return Err(serde::de::Error::duplicate_field("url")); + } + url__ = Some(map_.next_value()?); } - } - } - Ok(IngressVideoEncodingOptions { - video_codec: video_codec__.unwrap_or_default(), - frame_rate: frame_rate__.unwrap_or_default(), - layers: layers__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("livekit.IngressVideoEncodingOptions", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for IngressVideoEncodingPreset { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::H264720p30fps3Layers => "H264_720P_30FPS_3_LAYERS", - Self::H2641080p30fps3Layers => "H264_1080P_30FPS_3_LAYERS", - Self::H264540p25fps2Layers => "H264_540P_25FPS_2_LAYERS", - Self::H264720p30fps1Layer => "H264_720P_30FPS_1_LAYER", - Self::H2641080p30fps1Layer => "H264_1080P_30FPS_1_LAYER", - Self::H264720p30fps3LayersHighMotion => "H264_720P_30FPS_3_LAYERS_HIGH_MOTION", - Self::H2641080p30fps3LayersHighMotion => "H264_1080P_30FPS_3_LAYERS_HIGH_MOTION", - Self::H264540p25fps2LayersHighMotion => "H264_540P_25FPS_2_LAYERS_HIGH_MOTION", - Self::H264720p30fps1LayerHighMotion => "H264_720P_30FPS_1_LAYER_HIGH_MOTION", - Self::H2641080p30fps1LayerHighMotion => "H264_1080P_30FPS_1_LAYER_HIGH_MOTION", + GeneratedField::InputType => { + if input_type__.is_some() { + return Err(serde::de::Error::duplicate_field("inputType")); + } + input_type__ = Some(map_.next_value::()? as i32); + } + GeneratedField::BypassTranscoding => { + if bypass_transcoding__.is_some() { + return Err(serde::de::Error::duplicate_field("bypassTranscoding")); + } + bypass_transcoding__ = Some(map_.next_value()?); + } + GeneratedField::EnableTranscoding => { + if enable_transcoding__.is_some() { + return Err(serde::de::Error::duplicate_field("enableTranscoding")); + } + enable_transcoding__ = map_.next_value()?; + } + GeneratedField::Audio => { + if audio__.is_some() { + return Err(serde::de::Error::duplicate_field("audio")); + } + audio__ = map_.next_value()?; + } + GeneratedField::Video => { + if video__.is_some() { + return Err(serde::de::Error::duplicate_field("video")); + } + video__ = 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::ParticipantIdentity => { + if participant_identity__.is_some() { + return Err(serde::de::Error::duplicate_field("participantIdentity")); + } + participant_identity__ = Some(map_.next_value()?); + } + GeneratedField::ParticipantName => { + if participant_name__.is_some() { + return Err(serde::de::Error::duplicate_field("participantName")); + } + participant_name__ = Some(map_.next_value()?); + } + GeneratedField::ParticipantMetadata => { + if participant_metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("participantMetadata")); + } + participant_metadata__ = Some(map_.next_value()?); + } + GeneratedField::Reusable => { + if reusable__.is_some() { + return Err(serde::de::Error::duplicate_field("reusable")); + } + reusable__ = Some(map_.next_value()?); + } + GeneratedField::State => { + if state__.is_some() { + return Err(serde::de::Error::duplicate_field("state")); + } + state__ = map_.next_value()?; + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(IngressInfo { + ingress_id: ingress_id__.unwrap_or_default(), + name: name__.unwrap_or_default(), + stream_key: stream_key__.unwrap_or_default(), + url: url__.unwrap_or_default(), + input_type: input_type__.unwrap_or_default(), + bypass_transcoding: bypass_transcoding__.unwrap_or_default(), + enable_transcoding: enable_transcoding__, + audio: audio__, + video: video__, + room_name: room_name__.unwrap_or_default(), + participant_identity: participant_identity__.unwrap_or_default(), + participant_name: participant_name__.unwrap_or_default(), + participant_metadata: participant_metadata__.unwrap_or_default(), + reusable: reusable__.unwrap_or_default(), + state: state__, + }) + } + } + deserializer.deserialize_struct("livekit.IngressInfo", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for IngressInput { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::RtmpInput => "RTMP_INPUT", + Self::WhipInput => "WHIP_INPUT", + Self::UrlInput => "URL_INPUT", }; serializer.serialize_str(variant) } } -impl<'de> serde::Deserialize<'de> for IngressVideoEncodingPreset { +impl<'de> serde::Deserialize<'de> for IngressInput { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "H264_720P_30FPS_3_LAYERS", - "H264_1080P_30FPS_3_LAYERS", - "H264_540P_25FPS_2_LAYERS", - "H264_720P_30FPS_1_LAYER", - "H264_1080P_30FPS_1_LAYER", - "H264_720P_30FPS_3_LAYERS_HIGH_MOTION", - "H264_1080P_30FPS_3_LAYERS_HIGH_MOTION", - "H264_540P_25FPS_2_LAYERS_HIGH_MOTION", - "H264_720P_30FPS_1_LAYER_HIGH_MOTION", - "H264_1080P_30FPS_1_LAYER_HIGH_MOTION", + "RTMP_INPUT", + "WHIP_INPUT", + "URL_INPUT", ]; struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = IngressVideoEncodingPreset; + type Value = IngressInput; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(formatter, "expected one of: {:?}", &FIELDS) @@ -9681,16 +10028,9 @@ impl<'de> serde::Deserialize<'de> for IngressVideoEncodingPreset { E: serde::de::Error, { match value { - "H264_720P_30FPS_3_LAYERS" => Ok(IngressVideoEncodingPreset::H264720p30fps3Layers), - "H264_1080P_30FPS_3_LAYERS" => Ok(IngressVideoEncodingPreset::H2641080p30fps3Layers), - "H264_540P_25FPS_2_LAYERS" => Ok(IngressVideoEncodingPreset::H264540p25fps2Layers), - "H264_720P_30FPS_1_LAYER" => Ok(IngressVideoEncodingPreset::H264720p30fps1Layer), - "H264_1080P_30FPS_1_LAYER" => Ok(IngressVideoEncodingPreset::H2641080p30fps1Layer), - "H264_720P_30FPS_3_LAYERS_HIGH_MOTION" => Ok(IngressVideoEncodingPreset::H264720p30fps3LayersHighMotion), - "H264_1080P_30FPS_3_LAYERS_HIGH_MOTION" => Ok(IngressVideoEncodingPreset::H2641080p30fps3LayersHighMotion), - "H264_540P_25FPS_2_LAYERS_HIGH_MOTION" => Ok(IngressVideoEncodingPreset::H264540p25fps2LayersHighMotion), - "H264_720P_30FPS_1_LAYER_HIGH_MOTION" => Ok(IngressVideoEncodingPreset::H264720p30fps1LayerHighMotion), - "H264_1080P_30FPS_1_LAYER_HIGH_MOTION" => Ok(IngressVideoEncodingPreset::H2641080p30fps1LayerHighMotion), + "RTMP_INPUT" => Ok(IngressInput::RtmpInput), + "WHIP_INPUT" => Ok(IngressInput::WhipInput), + "URL_INPUT" => Ok(IngressInput::UrlInput), _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } } @@ -9698,7 +10038,7 @@ impl<'de> serde::Deserialize<'de> for IngressVideoEncodingPreset { deserializer.deserialize_any(GeneratedVisitor) } } -impl serde::Serialize for IngressVideoOptions { +impl serde::Serialize for IngressState { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -9706,65 +10046,121 @@ impl serde::Serialize for IngressVideoOptions { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.name.is_empty() { + if self.status != 0 { len += 1; } - if self.source != 0 { + if !self.error.is_empty() { len += 1; } - if self.encoding_options.is_some() { + if self.video.is_some() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.IngressVideoOptions", len)?; - if !self.name.is_empty() { - struct_ser.serialize_field("name", &self.name)?; + if self.audio.is_some() { + len += 1; } - if self.source != 0 { - let v = TrackSource::try_from(self.source) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.source)))?; - struct_ser.serialize_field("source", &v)?; + if !self.room_id.is_empty() { + len += 1; } - if let Some(v) = self.encoding_options.as_ref() { - match v { - ingress_video_options::EncodingOptions::Preset(v) => { - let v = IngressVideoEncodingPreset::try_from(*v) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; - struct_ser.serialize_field("preset", &v)?; - } - ingress_video_options::EncodingOptions::Options(v) => { - struct_ser.serialize_field("options", v)?; - } - } + if self.started_at != 0 { + len += 1; + } + if self.ended_at != 0 { + len += 1; + } + if self.updated_at != 0 { + len += 1; + } + if !self.resource_id.is_empty() { + len += 1; + } + if !self.tracks.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.IngressState", len)?; + if self.status != 0 { + let v = ingress_state::Status::try_from(self.status) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.status)))?; + struct_ser.serialize_field("status", &v)?; + } + if !self.error.is_empty() { + struct_ser.serialize_field("error", &self.error)?; + } + if let Some(v) = self.video.as_ref() { + struct_ser.serialize_field("video", v)?; + } + if let Some(v) = self.audio.as_ref() { + struct_ser.serialize_field("audio", v)?; + } + if !self.room_id.is_empty() { + struct_ser.serialize_field("roomId", &self.room_id)?; + } + if self.started_at != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("startedAt", ToString::to_string(&self.started_at).as_str())?; + } + if self.ended_at != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("endedAt", ToString::to_string(&self.ended_at).as_str())?; + } + if self.updated_at != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("updatedAt", ToString::to_string(&self.updated_at).as_str())?; + } + if !self.resource_id.is_empty() { + struct_ser.serialize_field("resourceId", &self.resource_id)?; + } + if !self.tracks.is_empty() { + struct_ser.serialize_field("tracks", &self.tracks)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for IngressVideoOptions { +impl<'de> serde::Deserialize<'de> for IngressState { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "name", - "source", - "preset", - "options", + "status", + "error", + "video", + "audio", + "room_id", + "roomId", + "started_at", + "startedAt", + "ended_at", + "endedAt", + "updated_at", + "updatedAt", + "resource_id", + "resourceId", + "tracks", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Name, - Source, - Preset, - Options, - __SkipField__, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { + Status, + Error, + Video, + Audio, + RoomId, + StartedAt, + EndedAt, + UpdatedAt, + ResourceId, + Tracks, + __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 { @@ -9780,10 +10176,16 @@ impl<'de> serde::Deserialize<'de> for IngressVideoOptions { E: serde::de::Error, { match value { - "name" => Ok(GeneratedField::Name), - "source" => Ok(GeneratedField::Source), - "preset" => Ok(GeneratedField::Preset), - "options" => Ok(GeneratedField::Options), + "status" => Ok(GeneratedField::Status), + "error" => Ok(GeneratedField::Error), + "video" => Ok(GeneratedField::Video), + "audio" => Ok(GeneratedField::Audio), + "roomId" | "room_id" => Ok(GeneratedField::RoomId), + "startedAt" | "started_at" => Ok(GeneratedField::StartedAt), + "endedAt" | "ended_at" => Ok(GeneratedField::EndedAt), + "updatedAt" | "updated_at" => Ok(GeneratedField::UpdatedAt), + "resourceId" | "resource_id" => Ok(GeneratedField::ResourceId), + "tracks" => Ok(GeneratedField::Tracks), _ => Ok(GeneratedField::__SkipField__), } } @@ -9793,62 +10195,197 @@ impl<'de> serde::Deserialize<'de> for IngressVideoOptions { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = IngressVideoOptions; + type Value = IngressState; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.IngressVideoOptions") + formatter.write_str("struct livekit.IngressState") } - 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 name__ = None; - let mut source__ = None; - let mut encoding_options__ = None; + let mut status__ = None; + let mut error__ = None; + let mut video__ = None; + let mut audio__ = None; + let mut room_id__ = None; + let mut started_at__ = None; + let mut ended_at__ = None; + let mut updated_at__ = None; + let mut resource_id__ = None; + let mut tracks__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); + GeneratedField::Status => { + if status__.is_some() { + return Err(serde::de::Error::duplicate_field("status")); } - name__ = Some(map_.next_value()?); + status__ = Some(map_.next_value::()? as i32); } - GeneratedField::Source => { - if source__.is_some() { - return Err(serde::de::Error::duplicate_field("source")); + GeneratedField::Error => { + if error__.is_some() { + return Err(serde::de::Error::duplicate_field("error")); } - source__ = Some(map_.next_value::()? as i32); + error__ = Some(map_.next_value()?); } - GeneratedField::Preset => { - if encoding_options__.is_some() { - return Err(serde::de::Error::duplicate_field("preset")); + GeneratedField::Video => { + if video__.is_some() { + return Err(serde::de::Error::duplicate_field("video")); } - encoding_options__ = map_.next_value::<::std::option::Option>()?.map(|x| ingress_video_options::EncodingOptions::Preset(x as i32)); + video__ = map_.next_value()?; } - GeneratedField::Options => { - if encoding_options__.is_some() { - return Err(serde::de::Error::duplicate_field("options")); + GeneratedField::Audio => { + if audio__.is_some() { + return Err(serde::de::Error::duplicate_field("audio")); } - encoding_options__ = map_.next_value::<::std::option::Option<_>>()?.map(ingress_video_options::EncodingOptions::Options) -; + audio__ = map_.next_value()?; + } + GeneratedField::RoomId => { + if room_id__.is_some() { + return Err(serde::de::Error::duplicate_field("roomId")); + } + room_id__ = Some(map_.next_value()?); + } + GeneratedField::StartedAt => { + if started_at__.is_some() { + return Err(serde::de::Error::duplicate_field("startedAt")); + } + started_at__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::EndedAt => { + if ended_at__.is_some() { + return Err(serde::de::Error::duplicate_field("endedAt")); + } + ended_at__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::UpdatedAt => { + if updated_at__.is_some() { + return Err(serde::de::Error::duplicate_field("updatedAt")); + } + updated_at__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::ResourceId => { + if resource_id__.is_some() { + return Err(serde::de::Error::duplicate_field("resourceId")); + } + resource_id__ = Some(map_.next_value()?); + } + GeneratedField::Tracks => { + if tracks__.is_some() { + return Err(serde::de::Error::duplicate_field("tracks")); + } + tracks__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(IngressVideoOptions { - name: name__.unwrap_or_default(), - source: source__.unwrap_or_default(), - encoding_options: encoding_options__, + Ok(IngressState { + status: status__.unwrap_or_default(), + error: error__.unwrap_or_default(), + video: video__, + audio: audio__, + room_id: room_id__.unwrap_or_default(), + started_at: started_at__.unwrap_or_default(), + ended_at: ended_at__.unwrap_or_default(), + updated_at: updated_at__.unwrap_or_default(), + resource_id: resource_id__.unwrap_or_default(), + tracks: tracks__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.IngressVideoOptions", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.IngressState", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for InputAudioState { +impl serde::Serialize for ingress_state::Status { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::EndpointInactive => "ENDPOINT_INACTIVE", + Self::EndpointBuffering => "ENDPOINT_BUFFERING", + Self::EndpointPublishing => "ENDPOINT_PUBLISHING", + Self::EndpointError => "ENDPOINT_ERROR", + Self::EndpointComplete => "ENDPOINT_COMPLETE", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for ingress_state::Status { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "ENDPOINT_INACTIVE", + "ENDPOINT_BUFFERING", + "ENDPOINT_PUBLISHING", + "ENDPOINT_ERROR", + "ENDPOINT_COMPLETE", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ingress_state::Status; + + 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 { + "ENDPOINT_INACTIVE" => Ok(ingress_state::Status::EndpointInactive), + "ENDPOINT_BUFFERING" => Ok(ingress_state::Status::EndpointBuffering), + "ENDPOINT_PUBLISHING" => Ok(ingress_state::Status::EndpointPublishing), + "ENDPOINT_ERROR" => Ok(ingress_state::Status::EndpointError), + "ENDPOINT_COMPLETE" => Ok(ingress_state::Status::EndpointComplete), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for IngressVideoEncodingOptions { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -9856,56 +10393,49 @@ impl serde::Serialize for InputAudioState { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.mime_type.is_empty() { - len += 1; - } - if self.average_bitrate != 0 { + if self.video_codec != 0 { len += 1; } - if self.channels != 0 { + if self.frame_rate != 0. { len += 1; } - if self.sample_rate != 0 { + if !self.layers.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.InputAudioState", len)?; - if !self.mime_type.is_empty() { - struct_ser.serialize_field("mimeType", &self.mime_type)?; - } - if self.average_bitrate != 0 { - struct_ser.serialize_field("averageBitrate", &self.average_bitrate)?; + let mut struct_ser = serializer.serialize_struct("livekit.IngressVideoEncodingOptions", len)?; + if self.video_codec != 0 { + let v = VideoCodec::try_from(self.video_codec) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.video_codec)))?; + struct_ser.serialize_field("videoCodec", &v)?; } - if self.channels != 0 { - struct_ser.serialize_field("channels", &self.channels)?; + if self.frame_rate != 0. { + struct_ser.serialize_field("frameRate", &self.frame_rate)?; } - if self.sample_rate != 0 { - struct_ser.serialize_field("sampleRate", &self.sample_rate)?; + if !self.layers.is_empty() { + struct_ser.serialize_field("layers", &self.layers)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for InputAudioState { +impl<'de> serde::Deserialize<'de> for IngressVideoEncodingOptions { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "mime_type", - "mimeType", - "average_bitrate", - "averageBitrate", - "channels", - "sample_rate", - "sampleRate", + "video_codec", + "videoCodec", + "frame_rate", + "frameRate", + "layers", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - MimeType, - AverageBitrate, - Channels, - SampleRate, + VideoCodec, + FrameRate, + Layers, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -9928,10 +10458,9 @@ impl<'de> serde::Deserialize<'de> for InputAudioState { E: serde::de::Error, { match value { - "mimeType" | "mime_type" => Ok(GeneratedField::MimeType), - "averageBitrate" | "average_bitrate" => Ok(GeneratedField::AverageBitrate), - "channels" => Ok(GeneratedField::Channels), - "sampleRate" | "sample_rate" => Ok(GeneratedField::SampleRate), + "videoCodec" | "video_codec" => Ok(GeneratedField::VideoCodec), + "frameRate" | "frame_rate" => Ok(GeneratedField::FrameRate), + "layers" => Ok(GeneratedField::Layers), _ => Ok(GeneratedField::__SkipField__), } } @@ -9941,69 +10470,152 @@ impl<'de> serde::Deserialize<'de> for InputAudioState { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = InputAudioState; + type Value = IngressVideoEncodingOptions; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.InputAudioState") + formatter.write_str("struct livekit.IngressVideoEncodingOptions") } - 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 mime_type__ = None; - let mut average_bitrate__ = None; - let mut channels__ = None; - let mut sample_rate__ = None; + let mut video_codec__ = None; + let mut frame_rate__ = None; + let mut layers__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::MimeType => { - if mime_type__.is_some() { - return Err(serde::de::Error::duplicate_field("mimeType")); - } - mime_type__ = Some(map_.next_value()?); - } - GeneratedField::AverageBitrate => { - if average_bitrate__.is_some() { - return Err(serde::de::Error::duplicate_field("averageBitrate")); + GeneratedField::VideoCodec => { + if video_codec__.is_some() { + return Err(serde::de::Error::duplicate_field("videoCodec")); } - average_bitrate__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + video_codec__ = Some(map_.next_value::()? as i32); } - GeneratedField::Channels => { - if channels__.is_some() { - return Err(serde::de::Error::duplicate_field("channels")); + GeneratedField::FrameRate => { + if frame_rate__.is_some() { + return Err(serde::de::Error::duplicate_field("frameRate")); } - channels__ = + frame_rate__ = Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } - GeneratedField::SampleRate => { - if sample_rate__.is_some() { - return Err(serde::de::Error::duplicate_field("sampleRate")); + GeneratedField::Layers => { + if layers__.is_some() { + return Err(serde::de::Error::duplicate_field("layers")); } - sample_rate__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + layers__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(InputAudioState { - mime_type: mime_type__.unwrap_or_default(), - average_bitrate: average_bitrate__.unwrap_or_default(), - channels: channels__.unwrap_or_default(), - sample_rate: sample_rate__.unwrap_or_default(), + Ok(IngressVideoEncodingOptions { + video_codec: video_codec__.unwrap_or_default(), + frame_rate: frame_rate__.unwrap_or_default(), + layers: layers__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.InputAudioState", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.IngressVideoEncodingOptions", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for InputVideoState { +impl serde::Serialize for IngressVideoEncodingPreset { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::H264720p30fps3Layers => "H264_720P_30FPS_3_LAYERS", + Self::H2641080p30fps3Layers => "H264_1080P_30FPS_3_LAYERS", + Self::H264540p25fps2Layers => "H264_540P_25FPS_2_LAYERS", + Self::H264720p30fps1Layer => "H264_720P_30FPS_1_LAYER", + Self::H2641080p30fps1Layer => "H264_1080P_30FPS_1_LAYER", + Self::H264720p30fps3LayersHighMotion => "H264_720P_30FPS_3_LAYERS_HIGH_MOTION", + Self::H2641080p30fps3LayersHighMotion => "H264_1080P_30FPS_3_LAYERS_HIGH_MOTION", + Self::H264540p25fps2LayersHighMotion => "H264_540P_25FPS_2_LAYERS_HIGH_MOTION", + Self::H264720p30fps1LayerHighMotion => "H264_720P_30FPS_1_LAYER_HIGH_MOTION", + Self::H2641080p30fps1LayerHighMotion => "H264_1080P_30FPS_1_LAYER_HIGH_MOTION", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for IngressVideoEncodingPreset { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "H264_720P_30FPS_3_LAYERS", + "H264_1080P_30FPS_3_LAYERS", + "H264_540P_25FPS_2_LAYERS", + "H264_720P_30FPS_1_LAYER", + "H264_1080P_30FPS_1_LAYER", + "H264_720P_30FPS_3_LAYERS_HIGH_MOTION", + "H264_1080P_30FPS_3_LAYERS_HIGH_MOTION", + "H264_540P_25FPS_2_LAYERS_HIGH_MOTION", + "H264_720P_30FPS_1_LAYER_HIGH_MOTION", + "H264_1080P_30FPS_1_LAYER_HIGH_MOTION", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = IngressVideoEncodingPreset; + + 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 { + "H264_720P_30FPS_3_LAYERS" => Ok(IngressVideoEncodingPreset::H264720p30fps3Layers), + "H264_1080P_30FPS_3_LAYERS" => Ok(IngressVideoEncodingPreset::H2641080p30fps3Layers), + "H264_540P_25FPS_2_LAYERS" => Ok(IngressVideoEncodingPreset::H264540p25fps2Layers), + "H264_720P_30FPS_1_LAYER" => Ok(IngressVideoEncodingPreset::H264720p30fps1Layer), + "H264_1080P_30FPS_1_LAYER" => Ok(IngressVideoEncodingPreset::H2641080p30fps1Layer), + "H264_720P_30FPS_3_LAYERS_HIGH_MOTION" => Ok(IngressVideoEncodingPreset::H264720p30fps3LayersHighMotion), + "H264_1080P_30FPS_3_LAYERS_HIGH_MOTION" => Ok(IngressVideoEncodingPreset::H2641080p30fps3LayersHighMotion), + "H264_540P_25FPS_2_LAYERS_HIGH_MOTION" => Ok(IngressVideoEncodingPreset::H264540p25fps2LayersHighMotion), + "H264_720P_30FPS_1_LAYER_HIGH_MOTION" => Ok(IngressVideoEncodingPreset::H264720p30fps1LayerHighMotion), + "H264_1080P_30FPS_1_LAYER_HIGH_MOTION" => Ok(IngressVideoEncodingPreset::H2641080p30fps1LayerHighMotion), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for IngressVideoOptions { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -10011,63 +10623,58 @@ impl serde::Serialize for InputVideoState { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.mime_type.is_empty() { - len += 1; - } - if self.average_bitrate != 0 { - len += 1; - } - if self.width != 0 { + if !self.name.is_empty() { len += 1; } - if self.height != 0 { + if self.source != 0 { len += 1; } - if self.framerate != 0. { + if self.encoding_options.is_some() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.InputVideoState", len)?; - if !self.mime_type.is_empty() { - struct_ser.serialize_field("mimeType", &self.mime_type)?; - } - if self.average_bitrate != 0 { - struct_ser.serialize_field("averageBitrate", &self.average_bitrate)?; - } - if self.width != 0 { - struct_ser.serialize_field("width", &self.width)?; + let mut struct_ser = serializer.serialize_struct("livekit.IngressVideoOptions", len)?; + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; } - if self.height != 0 { - struct_ser.serialize_field("height", &self.height)?; + if self.source != 0 { + let v = TrackSource::try_from(self.source) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.source)))?; + struct_ser.serialize_field("source", &v)?; } - if self.framerate != 0. { - struct_ser.serialize_field("framerate", &self.framerate)?; + if let Some(v) = self.encoding_options.as_ref() { + match v { + ingress_video_options::EncodingOptions::Preset(v) => { + let v = IngressVideoEncodingPreset::try_from(*v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("preset", &v)?; + } + ingress_video_options::EncodingOptions::Options(v) => { + struct_ser.serialize_field("options", v)?; + } + } } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for InputVideoState { +impl<'de> serde::Deserialize<'de> for IngressVideoOptions { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "mime_type", - "mimeType", - "average_bitrate", - "averageBitrate", - "width", - "height", - "framerate", + "name", + "source", + "preset", + "options", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - MimeType, - AverageBitrate, - Width, - Height, - Framerate, + Name, + Source, + Preset, + Options, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -10090,11 +10697,10 @@ impl<'de> serde::Deserialize<'de> for InputVideoState { E: serde::de::Error, { match value { - "mimeType" | "mime_type" => Ok(GeneratedField::MimeType), - "averageBitrate" | "average_bitrate" => Ok(GeneratedField::AverageBitrate), - "width" => Ok(GeneratedField::Width), - "height" => Ok(GeneratedField::Height), - "framerate" => Ok(GeneratedField::Framerate), + "name" => Ok(GeneratedField::Name), + "source" => Ok(GeneratedField::Source), + "preset" => Ok(GeneratedField::Preset), + "options" => Ok(GeneratedField::Options), _ => Ok(GeneratedField::__SkipField__), } } @@ -10104,79 +10710,62 @@ impl<'de> serde::Deserialize<'de> for InputVideoState { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = InputVideoState; + type Value = IngressVideoOptions; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.InputVideoState") + formatter.write_str("struct livekit.IngressVideoOptions") } - 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 mime_type__ = None; - let mut average_bitrate__ = None; - let mut width__ = None; - let mut height__ = None; - let mut framerate__ = None; + let mut name__ = None; + let mut source__ = None; + let mut encoding_options__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::MimeType => { - if mime_type__.is_some() { - return Err(serde::de::Error::duplicate_field("mimeType")); - } - mime_type__ = Some(map_.next_value()?); - } - GeneratedField::AverageBitrate => { - if average_bitrate__.is_some() { - return Err(serde::de::Error::duplicate_field("averageBitrate")); + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); } - average_bitrate__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + name__ = Some(map_.next_value()?); } - GeneratedField::Width => { - if width__.is_some() { - return Err(serde::de::Error::duplicate_field("width")); + GeneratedField::Source => { + if source__.is_some() { + return Err(serde::de::Error::duplicate_field("source")); } - width__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + source__ = Some(map_.next_value::()? as i32); } - GeneratedField::Height => { - if height__.is_some() { - return Err(serde::de::Error::duplicate_field("height")); + GeneratedField::Preset => { + if encoding_options__.is_some() { + return Err(serde::de::Error::duplicate_field("preset")); } - height__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + encoding_options__ = map_.next_value::<::std::option::Option>()?.map(|x| ingress_video_options::EncodingOptions::Preset(x as i32)); } - GeneratedField::Framerate => { - if framerate__.is_some() { - return Err(serde::de::Error::duplicate_field("framerate")); + GeneratedField::Options => { + if encoding_options__.is_some() { + return Err(serde::de::Error::duplicate_field("options")); } - framerate__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + encoding_options__ = map_.next_value::<::std::option::Option<_>>()?.map(ingress_video_options::EncodingOptions::Options) +; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(InputVideoState { - mime_type: mime_type__.unwrap_or_default(), - average_bitrate: average_bitrate__.unwrap_or_default(), - width: width__.unwrap_or_default(), - height: height__.unwrap_or_default(), - framerate: framerate__.unwrap_or_default(), + Ok(IngressVideoOptions { + name: name__.unwrap_or_default(), + source: source__.unwrap_or_default(), + encoding_options: encoding_options__, }) } } - deserializer.deserialize_struct("livekit.InputVideoState", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.IngressVideoOptions", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for Job { +impl serde::Serialize for InputAudioState { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -10184,97 +10773,56 @@ impl serde::Serialize for Job { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.id.is_empty() { - len += 1; - } - if !self.dispatch_id.is_empty() { - len += 1; - } - if self.r#type != 0 { - len += 1; - } - if self.room.is_some() { - len += 1; - } - if self.participant.is_some() { - len += 1; - } - if !self.namespace.is_empty() { + if !self.mime_type.is_empty() { len += 1; } - if !self.metadata.is_empty() { + if self.average_bitrate != 0 { len += 1; } - if !self.agent_name.is_empty() { + if self.channels != 0 { len += 1; } - if self.state.is_some() { + if self.sample_rate != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.Job", len)?; - if !self.id.is_empty() { - struct_ser.serialize_field("id", &self.id)?; - } - if !self.dispatch_id.is_empty() { - struct_ser.serialize_field("dispatchId", &self.dispatch_id)?; - } - if self.r#type != 0 { - let v = JobType::try_from(self.r#type) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.r#type)))?; - struct_ser.serialize_field("type", &v)?; - } - if let Some(v) = self.room.as_ref() { - struct_ser.serialize_field("room", v)?; - } - if let Some(v) = self.participant.as_ref() { - struct_ser.serialize_field("participant", v)?; - } - if !self.namespace.is_empty() { - struct_ser.serialize_field("namespace", &self.namespace)?; + let mut struct_ser = serializer.serialize_struct("livekit.InputAudioState", len)?; + if !self.mime_type.is_empty() { + struct_ser.serialize_field("mimeType", &self.mime_type)?; } - if !self.metadata.is_empty() { - struct_ser.serialize_field("metadata", &self.metadata)?; + if self.average_bitrate != 0 { + struct_ser.serialize_field("averageBitrate", &self.average_bitrate)?; } - if !self.agent_name.is_empty() { - struct_ser.serialize_field("agentName", &self.agent_name)?; + if self.channels != 0 { + struct_ser.serialize_field("channels", &self.channels)?; } - if let Some(v) = self.state.as_ref() { - struct_ser.serialize_field("state", v)?; + if self.sample_rate != 0 { + struct_ser.serialize_field("sampleRate", &self.sample_rate)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for Job { +impl<'de> serde::Deserialize<'de> for InputAudioState { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "id", - "dispatch_id", - "dispatchId", - "type", - "room", - "participant", - "namespace", - "metadata", - "agent_name", - "agentName", - "state", + "mime_type", + "mimeType", + "average_bitrate", + "averageBitrate", + "channels", + "sample_rate", + "sampleRate", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Id, - DispatchId, - Type, - Room, - Participant, - Namespace, - Metadata, - AgentName, - State, + MimeType, + AverageBitrate, + Channels, + SampleRate, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -10297,15 +10845,10 @@ impl<'de> serde::Deserialize<'de> for Job { E: serde::de::Error, { match value { - "id" => Ok(GeneratedField::Id), - "dispatchId" | "dispatch_id" => Ok(GeneratedField::DispatchId), - "type" => Ok(GeneratedField::Type), - "room" => Ok(GeneratedField::Room), - "participant" => Ok(GeneratedField::Participant), - "namespace" => Ok(GeneratedField::Namespace), - "metadata" => Ok(GeneratedField::Metadata), - "agentName" | "agent_name" => Ok(GeneratedField::AgentName), - "state" => Ok(GeneratedField::State), + "mimeType" | "mime_type" => Ok(GeneratedField::MimeType), + "averageBitrate" | "average_bitrate" => Ok(GeneratedField::AverageBitrate), + "channels" => Ok(GeneratedField::Channels), + "sampleRate" | "sample_rate" => Ok(GeneratedField::SampleRate), _ => Ok(GeneratedField::__SkipField__), } } @@ -10315,103 +10858,69 @@ impl<'de> serde::Deserialize<'de> for Job { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Job; + type Value = InputAudioState; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.Job") + formatter.write_str("struct livekit.InputAudioState") } - 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 id__ = None; - let mut dispatch_id__ = None; - let mut r#type__ = None; - let mut room__ = None; - let mut participant__ = None; - let mut namespace__ = None; - let mut metadata__ = None; - let mut agent_name__ = None; - let mut state__ = None; + let mut mime_type__ = None; + let mut average_bitrate__ = None; + let mut channels__ = None; + let mut sample_rate__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Id => { - if id__.is_some() { - return Err(serde::de::Error::duplicate_field("id")); - } - id__ = Some(map_.next_value()?); - } - GeneratedField::DispatchId => { - if dispatch_id__.is_some() { - return Err(serde::de::Error::duplicate_field("dispatchId")); - } - dispatch_id__ = Some(map_.next_value()?); - } - GeneratedField::Type => { - if r#type__.is_some() { - return Err(serde::de::Error::duplicate_field("type")); + GeneratedField::MimeType => { + if mime_type__.is_some() { + return Err(serde::de::Error::duplicate_field("mimeType")); } - r#type__ = Some(map_.next_value::()? as i32); + mime_type__ = Some(map_.next_value()?); } - GeneratedField::Room => { - if room__.is_some() { - return Err(serde::de::Error::duplicate_field("room")); + GeneratedField::AverageBitrate => { + if average_bitrate__.is_some() { + return Err(serde::de::Error::duplicate_field("averageBitrate")); } - room__ = map_.next_value()?; + average_bitrate__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } - GeneratedField::Participant => { - if participant__.is_some() { - return Err(serde::de::Error::duplicate_field("participant")); + GeneratedField::Channels => { + if channels__.is_some() { + return Err(serde::de::Error::duplicate_field("channels")); } - participant__ = map_.next_value()?; + channels__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } - GeneratedField::Namespace => { - if namespace__.is_some() { - return Err(serde::de::Error::duplicate_field("namespace")); + GeneratedField::SampleRate => { + if sample_rate__.is_some() { + return Err(serde::de::Error::duplicate_field("sampleRate")); } - namespace__ = Some(map_.next_value()?); + sample_rate__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } - GeneratedField::Metadata => { - if metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("metadata")); - } - metadata__ = Some(map_.next_value()?); - } - GeneratedField::AgentName => { - if agent_name__.is_some() { - return Err(serde::de::Error::duplicate_field("agentName")); - } - agent_name__ = Some(map_.next_value()?); - } - GeneratedField::State => { - if state__.is_some() { - return Err(serde::de::Error::duplicate_field("state")); - } - state__ = map_.next_value()?; - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; } } } - Ok(Job { - id: id__.unwrap_or_default(), - dispatch_id: dispatch_id__.unwrap_or_default(), - r#type: r#type__.unwrap_or_default(), - room: room__, - participant: participant__, - namespace: namespace__.unwrap_or_default(), - metadata: metadata__.unwrap_or_default(), - agent_name: agent_name__.unwrap_or_default(), - state: state__, + Ok(InputAudioState { + mime_type: mime_type__.unwrap_or_default(), + average_bitrate: average_bitrate__.unwrap_or_default(), + channels: channels__.unwrap_or_default(), + sample_rate: sample_rate__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.Job", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.InputAudioState", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for JobAssignment { +impl serde::Serialize for InputVideoState { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -10419,45 +10928,63 @@ impl serde::Serialize for JobAssignment { { use serde::ser::SerializeStruct; let mut len = 0; - if self.job.is_some() { + if !self.mime_type.is_empty() { len += 1; } - if self.url.is_some() { + if self.average_bitrate != 0 { len += 1; } - if !self.token.is_empty() { + if self.width != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.JobAssignment", len)?; - if let Some(v) = self.job.as_ref() { - struct_ser.serialize_field("job", v)?; + if self.height != 0 { + len += 1; } - if let Some(v) = self.url.as_ref() { - struct_ser.serialize_field("url", v)?; + if self.framerate != 0. { + len += 1; } - if !self.token.is_empty() { - struct_ser.serialize_field("token", &self.token)?; + let mut struct_ser = serializer.serialize_struct("livekit.InputVideoState", len)?; + if !self.mime_type.is_empty() { + struct_ser.serialize_field("mimeType", &self.mime_type)?; + } + if self.average_bitrate != 0 { + struct_ser.serialize_field("averageBitrate", &self.average_bitrate)?; + } + if self.width != 0 { + struct_ser.serialize_field("width", &self.width)?; + } + if self.height != 0 { + struct_ser.serialize_field("height", &self.height)?; + } + if self.framerate != 0. { + struct_ser.serialize_field("framerate", &self.framerate)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for JobAssignment { +impl<'de> serde::Deserialize<'de> for InputVideoState { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "job", - "url", - "token", + "mime_type", + "mimeType", + "average_bitrate", + "averageBitrate", + "width", + "height", + "framerate", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Job, - Url, - Token, + MimeType, + AverageBitrate, + Width, + Height, + Framerate, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -10480,9 +11007,11 @@ impl<'de> serde::Deserialize<'de> for JobAssignment { E: serde::de::Error, { match value { - "job" => Ok(GeneratedField::Job), - "url" => Ok(GeneratedField::Url), - "token" => Ok(GeneratedField::Token), + "mimeType" | "mime_type" => Ok(GeneratedField::MimeType), + "averageBitrate" | "average_bitrate" => Ok(GeneratedField::AverageBitrate), + "width" => Ok(GeneratedField::Width), + "height" => Ok(GeneratedField::Height), + "framerate" => Ok(GeneratedField::Framerate), _ => Ok(GeneratedField::__SkipField__), } } @@ -10492,55 +11021,79 @@ impl<'de> serde::Deserialize<'de> for JobAssignment { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = JobAssignment; + type Value = InputVideoState; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.JobAssignment") + formatter.write_str("struct livekit.InputVideoState") } - 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 job__ = None; - let mut url__ = None; - let mut token__ = None; + let mut mime_type__ = None; + let mut average_bitrate__ = None; + let mut width__ = None; + let mut height__ = None; + let mut framerate__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Job => { - if job__.is_some() { - return Err(serde::de::Error::duplicate_field("job")); + GeneratedField::MimeType => { + if mime_type__.is_some() { + return Err(serde::de::Error::duplicate_field("mimeType")); } - job__ = map_.next_value()?; + mime_type__ = Some(map_.next_value()?); } - GeneratedField::Url => { - if url__.is_some() { - return Err(serde::de::Error::duplicate_field("url")); + GeneratedField::AverageBitrate => { + if average_bitrate__.is_some() { + return Err(serde::de::Error::duplicate_field("averageBitrate")); } - url__ = map_.next_value()?; + average_bitrate__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } - GeneratedField::Token => { - if token__.is_some() { - return Err(serde::de::Error::duplicate_field("token")); + GeneratedField::Width => { + if width__.is_some() { + return Err(serde::de::Error::duplicate_field("width")); } - token__ = Some(map_.next_value()?); + width__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Height => { + if height__.is_some() { + return Err(serde::de::Error::duplicate_field("height")); + } + height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Framerate => { + if framerate__.is_some() { + return Err(serde::de::Error::duplicate_field("framerate")); + } + framerate__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(JobAssignment { - job: job__, - url: url__, - token: token__.unwrap_or_default(), + Ok(InputVideoState { + mime_type: mime_type__.unwrap_or_default(), + average_bitrate: average_bitrate__.unwrap_or_default(), + width: width__.unwrap_or_default(), + height: height__.unwrap_or_default(), + framerate: framerate__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.JobAssignment", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.InputVideoState", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for JobState { +impl serde::Serialize for Job { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -10548,81 +11101,97 @@ impl serde::Serialize for JobState { { use serde::ser::SerializeStruct; let mut len = 0; - if self.status != 0 { + if !self.id.is_empty() { len += 1; } - if !self.error.is_empty() { + if !self.dispatch_id.is_empty() { len += 1; } - if self.started_at != 0 { + if self.r#type != 0 { len += 1; } - if self.ended_at != 0 { + if self.room.is_some() { len += 1; } - if self.updated_at != 0 { + if self.participant.is_some() { len += 1; } - if !self.participant_identity.is_empty() { + if !self.namespace.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.JobState", len)?; - if self.status != 0 { - let v = JobStatus::try_from(self.status) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.status)))?; - struct_ser.serialize_field("status", &v)?; + if !self.metadata.is_empty() { + len += 1; } - if !self.error.is_empty() { - struct_ser.serialize_field("error", &self.error)?; + if !self.agent_name.is_empty() { + len += 1; } - if self.started_at != 0 { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("startedAt", ToString::to_string(&self.started_at).as_str())?; + if self.state.is_some() { + len += 1; } - if self.ended_at != 0 { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("endedAt", ToString::to_string(&self.ended_at).as_str())?; + let mut struct_ser = serializer.serialize_struct("livekit.Job", len)?; + if !self.id.is_empty() { + struct_ser.serialize_field("id", &self.id)?; } - if self.updated_at != 0 { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("updatedAt", ToString::to_string(&self.updated_at).as_str())?; + if !self.dispatch_id.is_empty() { + struct_ser.serialize_field("dispatchId", &self.dispatch_id)?; } - if !self.participant_identity.is_empty() { - struct_ser.serialize_field("participantIdentity", &self.participant_identity)?; + if self.r#type != 0 { + let v = JobType::try_from(self.r#type) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.r#type)))?; + struct_ser.serialize_field("type", &v)?; + } + if let Some(v) = self.room.as_ref() { + struct_ser.serialize_field("room", v)?; + } + if let Some(v) = self.participant.as_ref() { + struct_ser.serialize_field("participant", v)?; + } + if !self.namespace.is_empty() { + struct_ser.serialize_field("namespace", &self.namespace)?; + } + if !self.metadata.is_empty() { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + if !self.agent_name.is_empty() { + struct_ser.serialize_field("agentName", &self.agent_name)?; + } + if let Some(v) = self.state.as_ref() { + struct_ser.serialize_field("state", v)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for JobState { +impl<'de> serde::Deserialize<'de> for Job { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "status", - "error", - "started_at", - "startedAt", - "ended_at", - "endedAt", - "updated_at", - "updatedAt", - "participant_identity", - "participantIdentity", + "id", + "dispatch_id", + "dispatchId", + "type", + "room", + "participant", + "namespace", + "metadata", + "agent_name", + "agentName", + "state", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Status, - Error, - StartedAt, - EndedAt, - UpdatedAt, - ParticipantIdentity, + Id, + DispatchId, + Type, + Room, + Participant, + Namespace, + Metadata, + AgentName, + State, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -10645,12 +11214,15 @@ impl<'de> serde::Deserialize<'de> for JobState { E: serde::de::Error, { match value { - "status" => Ok(GeneratedField::Status), - "error" => Ok(GeneratedField::Error), - "startedAt" | "started_at" => Ok(GeneratedField::StartedAt), - "endedAt" | "ended_at" => Ok(GeneratedField::EndedAt), - "updatedAt" | "updated_at" => Ok(GeneratedField::UpdatedAt), - "participantIdentity" | "participant_identity" => Ok(GeneratedField::ParticipantIdentity), + "id" => Ok(GeneratedField::Id), + "dispatchId" | "dispatch_id" => Ok(GeneratedField::DispatchId), + "type" => Ok(GeneratedField::Type), + "room" => Ok(GeneratedField::Room), + "participant" => Ok(GeneratedField::Participant), + "namespace" => Ok(GeneratedField::Namespace), + "metadata" => Ok(GeneratedField::Metadata), + "agentName" | "agent_name" => Ok(GeneratedField::AgentName), + "state" => Ok(GeneratedField::State), _ => Ok(GeneratedField::__SkipField__), } } @@ -10660,162 +11232,103 @@ impl<'de> serde::Deserialize<'de> for JobState { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = JobState; + type Value = Job; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.JobState") + formatter.write_str("struct livekit.Job") } - 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 status__ = None; - let mut error__ = None; - let mut started_at__ = None; - let mut ended_at__ = None; - let mut updated_at__ = None; - let mut participant_identity__ = None; + let mut id__ = None; + let mut dispatch_id__ = None; + let mut r#type__ = None; + let mut room__ = None; + let mut participant__ = None; + let mut namespace__ = None; + let mut metadata__ = None; + let mut agent_name__ = None; + let mut state__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Status => { - if status__.is_some() { - return Err(serde::de::Error::duplicate_field("status")); + GeneratedField::Id => { + if id__.is_some() { + return Err(serde::de::Error::duplicate_field("id")); } - status__ = Some(map_.next_value::()? as i32); + id__ = Some(map_.next_value()?); } - GeneratedField::Error => { - if error__.is_some() { - return Err(serde::de::Error::duplicate_field("error")); + GeneratedField::DispatchId => { + if dispatch_id__.is_some() { + return Err(serde::de::Error::duplicate_field("dispatchId")); } - error__ = Some(map_.next_value()?); + dispatch_id__ = Some(map_.next_value()?); } - GeneratedField::StartedAt => { - if started_at__.is_some() { - return Err(serde::de::Error::duplicate_field("startedAt")); + GeneratedField::Type => { + if r#type__.is_some() { + return Err(serde::de::Error::duplicate_field("type")); } - started_at__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + r#type__ = Some(map_.next_value::()? as i32); } - GeneratedField::EndedAt => { - if ended_at__.is_some() { - return Err(serde::de::Error::duplicate_field("endedAt")); + GeneratedField::Room => { + if room__.is_some() { + return Err(serde::de::Error::duplicate_field("room")); } - ended_at__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + room__ = map_.next_value()?; } - GeneratedField::UpdatedAt => { - if updated_at__.is_some() { - return Err(serde::de::Error::duplicate_field("updatedAt")); + GeneratedField::Participant => { + if participant__.is_some() { + return Err(serde::de::Error::duplicate_field("participant")); } - updated_at__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + participant__ = map_.next_value()?; } - GeneratedField::ParticipantIdentity => { - if participant_identity__.is_some() { - return Err(serde::de::Error::duplicate_field("participantIdentity")); + GeneratedField::Namespace => { + if namespace__.is_some() { + return Err(serde::de::Error::duplicate_field("namespace")); } - participant_identity__ = Some(map_.next_value()?); + namespace__ = Some(map_.next_value()?); + } + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = Some(map_.next_value()?); + } + GeneratedField::AgentName => { + if agent_name__.is_some() { + return Err(serde::de::Error::duplicate_field("agentName")); + } + agent_name__ = Some(map_.next_value()?); + } + GeneratedField::State => { + if state__.is_some() { + return Err(serde::de::Error::duplicate_field("state")); + } + state__ = map_.next_value()?; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(JobState { - status: status__.unwrap_or_default(), - error: error__.unwrap_or_default(), - started_at: started_at__.unwrap_or_default(), - ended_at: ended_at__.unwrap_or_default(), - updated_at: updated_at__.unwrap_or_default(), - participant_identity: participant_identity__.unwrap_or_default(), + Ok(Job { + id: id__.unwrap_or_default(), + dispatch_id: dispatch_id__.unwrap_or_default(), + r#type: r#type__.unwrap_or_default(), + room: room__, + participant: participant__, + namespace: namespace__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), + agent_name: agent_name__.unwrap_or_default(), + state: state__, }) } } - deserializer.deserialize_struct("livekit.JobState", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for JobStatus { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::JsPending => "JS_PENDING", - Self::JsRunning => "JS_RUNNING", - Self::JsSuccess => "JS_SUCCESS", - Self::JsFailed => "JS_FAILED", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for JobStatus { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "JS_PENDING", - "JS_RUNNING", - "JS_SUCCESS", - "JS_FAILED", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = JobStatus; - - 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 { - "JS_PENDING" => Ok(JobStatus::JsPending), - "JS_RUNNING" => Ok(JobStatus::JsRunning), - "JS_SUCCESS" => Ok(JobStatus::JsSuccess), - "JS_FAILED" => Ok(JobStatus::JsFailed), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) + deserializer.deserialize_struct("livekit.Job", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for JobTermination { +impl serde::Serialize for JobAssignment { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -10823,30 +11336,45 @@ impl serde::Serialize for JobTermination { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.job_id.is_empty() { + if self.job.is_some() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.JobTermination", len)?; - if !self.job_id.is_empty() { - struct_ser.serialize_field("jobId", &self.job_id)?; + if self.url.is_some() { + len += 1; + } + if !self.token.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.JobAssignment", len)?; + if let Some(v) = self.job.as_ref() { + struct_ser.serialize_field("job", v)?; + } + if let Some(v) = self.url.as_ref() { + struct_ser.serialize_field("url", v)?; + } + if !self.token.is_empty() { + struct_ser.serialize_field("token", &self.token)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for JobTermination { +impl<'de> serde::Deserialize<'de> for JobAssignment { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "job_id", - "jobId", + "job", + "url", + "token", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - JobId, + Job, + Url, + Token, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -10869,7 +11397,9 @@ impl<'de> serde::Deserialize<'de> for JobTermination { E: serde::de::Error, { match value { - "jobId" | "job_id" => Ok(GeneratedField::JobId), + "job" => Ok(GeneratedField::Job), + "url" => Ok(GeneratedField::Url), + "token" => Ok(GeneratedField::Token), _ => Ok(GeneratedField::__SkipField__), } } @@ -10879,66 +11409,284 @@ impl<'de> serde::Deserialize<'de> for JobTermination { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = JobTermination; + type Value = JobAssignment; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.JobTermination") + formatter.write_str("struct livekit.JobAssignment") } - 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 job_id__ = None; + let mut job__ = None; + let mut url__ = None; + let mut token__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::JobId => { - if job_id__.is_some() { - return Err(serde::de::Error::duplicate_field("jobId")); + GeneratedField::Job => { + if job__.is_some() { + return Err(serde::de::Error::duplicate_field("job")); } - job_id__ = Some(map_.next_value()?); + job__ = map_.next_value()?; + } + GeneratedField::Url => { + if url__.is_some() { + return Err(serde::de::Error::duplicate_field("url")); + } + url__ = map_.next_value()?; + } + GeneratedField::Token => { + if token__.is_some() { + return Err(serde::de::Error::duplicate_field("token")); + } + token__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(JobTermination { - job_id: job_id__.unwrap_or_default(), + Ok(JobAssignment { + job: job__, + url: url__, + token: token__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.JobTermination", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.JobAssignment", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for JobType { +impl serde::Serialize for JobState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.status != 0 { + len += 1; + } + if !self.error.is_empty() { + len += 1; + } + if self.started_at != 0 { + len += 1; + } + if self.ended_at != 0 { + len += 1; + } + if self.updated_at != 0 { + len += 1; + } + if !self.participant_identity.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.JobState", len)?; + if self.status != 0 { + let v = JobStatus::try_from(self.status) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.status)))?; + struct_ser.serialize_field("status", &v)?; + } + if !self.error.is_empty() { + struct_ser.serialize_field("error", &self.error)?; + } + if self.started_at != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("startedAt", ToString::to_string(&self.started_at).as_str())?; + } + if self.ended_at != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("endedAt", ToString::to_string(&self.ended_at).as_str())?; + } + if self.updated_at != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("updatedAt", ToString::to_string(&self.updated_at).as_str())?; + } + if !self.participant_identity.is_empty() { + struct_ser.serialize_field("participantIdentity", &self.participant_identity)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for JobState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "status", + "error", + "started_at", + "startedAt", + "ended_at", + "endedAt", + "updated_at", + "updatedAt", + "participant_identity", + "participantIdentity", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Status, + Error, + StartedAt, + EndedAt, + UpdatedAt, + ParticipantIdentity, + __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 { + "status" => Ok(GeneratedField::Status), + "error" => Ok(GeneratedField::Error), + "startedAt" | "started_at" => Ok(GeneratedField::StartedAt), + "endedAt" | "ended_at" => Ok(GeneratedField::EndedAt), + "updatedAt" | "updated_at" => Ok(GeneratedField::UpdatedAt), + "participantIdentity" | "participant_identity" => Ok(GeneratedField::ParticipantIdentity), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = JobState; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.JobState") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut status__ = None; + let mut error__ = None; + let mut started_at__ = None; + let mut ended_at__ = None; + let mut updated_at__ = None; + let mut participant_identity__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Status => { + if status__.is_some() { + return Err(serde::de::Error::duplicate_field("status")); + } + status__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Error => { + if error__.is_some() { + return Err(serde::de::Error::duplicate_field("error")); + } + error__ = Some(map_.next_value()?); + } + GeneratedField::StartedAt => { + if started_at__.is_some() { + return Err(serde::de::Error::duplicate_field("startedAt")); + } + started_at__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::EndedAt => { + if ended_at__.is_some() { + return Err(serde::de::Error::duplicate_field("endedAt")); + } + ended_at__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::UpdatedAt => { + if updated_at__.is_some() { + return Err(serde::de::Error::duplicate_field("updatedAt")); + } + updated_at__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::ParticipantIdentity => { + if participant_identity__.is_some() { + return Err(serde::de::Error::duplicate_field("participantIdentity")); + } + participant_identity__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(JobState { + status: status__.unwrap_or_default(), + error: error__.unwrap_or_default(), + started_at: started_at__.unwrap_or_default(), + ended_at: ended_at__.unwrap_or_default(), + updated_at: updated_at__.unwrap_or_default(), + participant_identity: participant_identity__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.JobState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for JobStatus { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { let variant = match self { - Self::JtRoom => "JT_ROOM", - Self::JtPublisher => "JT_PUBLISHER", + Self::JsPending => "JS_PENDING", + Self::JsRunning => "JS_RUNNING", + Self::JsSuccess => "JS_SUCCESS", + Self::JsFailed => "JS_FAILED", }; serializer.serialize_str(variant) } } -impl<'de> serde::Deserialize<'de> for JobType { +impl<'de> serde::Deserialize<'de> for JobStatus { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "JT_ROOM", - "JT_PUBLISHER", + "JS_PENDING", + "JS_RUNNING", + "JS_SUCCESS", + "JS_FAILED", ]; struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = JobType; + type Value = JobStatus; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(formatter, "expected one of: {:?}", &FIELDS) @@ -10973,8 +11721,10 @@ impl<'de> serde::Deserialize<'de> for JobType { E: serde::de::Error, { match value { - "JT_ROOM" => Ok(JobType::JtRoom), - "JT_PUBLISHER" => Ok(JobType::JtPublisher), + "JS_PENDING" => Ok(JobStatus::JsPending), + "JS_RUNNING" => Ok(JobStatus::JsRunning), + "JS_SUCCESS" => Ok(JobStatus::JsSuccess), + "JS_FAILED" => Ok(JobStatus::JsFailed), _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } } @@ -10982,7 +11732,174 @@ impl<'de> serde::Deserialize<'de> for JobType { deserializer.deserialize_any(GeneratedVisitor) } } -impl serde::Serialize for JoinResponse { +impl serde::Serialize for JobTermination { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.job_id.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.JobTermination", len)?; + if !self.job_id.is_empty() { + struct_ser.serialize_field("jobId", &self.job_id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for JobTermination { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "job_id", + "jobId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + JobId, + __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 { + "jobId" | "job_id" => Ok(GeneratedField::JobId), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = JobTermination; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.JobTermination") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut job_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::JobId => { + if job_id__.is_some() { + return Err(serde::de::Error::duplicate_field("jobId")); + } + job_id__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(JobTermination { + job_id: job_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.JobTermination", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for JobType { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::JtRoom => "JT_ROOM", + Self::JtPublisher => "JT_PUBLISHER", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for JobType { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "JT_ROOM", + "JT_PUBLISHER", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = JobType; + + 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 { + "JT_ROOM" => Ok(JobType::JtRoom), + "JT_PUBLISHER" => Ok(JobType::JtPublisher), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for JoinResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -11029,6 +11946,12 @@ impl serde::Serialize for JoinResponse { if !self.sif_trailer.is_empty() { len += 1; } + if !self.enabled_publish_codecs.is_empty() { + len += 1; + } + if self.fast_publish { + len += 1; + } let mut struct_ser = serializer.serialize_struct("livekit.JoinResponse", len)?; if let Some(v) = self.room.as_ref() { struct_ser.serialize_field("room", v)?; @@ -11071,6 +11994,12 @@ impl serde::Serialize for JoinResponse { #[allow(clippy::needless_borrows_for_generic_args)] struct_ser.serialize_field("sifTrailer", pbjson::private::base64::encode(&self.sif_trailer).as_str())?; } + if !self.enabled_publish_codecs.is_empty() { + struct_ser.serialize_field("enabledPublishCodecs", &self.enabled_publish_codecs)?; + } + if self.fast_publish { + struct_ser.serialize_field("fastPublish", &self.fast_publish)?; + } struct_ser.end() } } @@ -11105,6 +12034,10 @@ impl<'de> serde::Deserialize<'de> for JoinResponse { "serverInfo", "sif_trailer", "sifTrailer", + "enabled_publish_codecs", + "enabledPublishCodecs", + "fast_publish", + "fastPublish", ]; #[allow(clippy::enum_variant_names)] @@ -11122,6 +12055,8 @@ impl<'de> serde::Deserialize<'de> for JoinResponse { PingInterval, ServerInfo, SifTrailer, + EnabledPublishCodecs, + FastPublish, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -11157,6 +12092,8 @@ impl<'de> serde::Deserialize<'de> for JoinResponse { "pingInterval" | "ping_interval" => Ok(GeneratedField::PingInterval), "serverInfo" | "server_info" => Ok(GeneratedField::ServerInfo), "sifTrailer" | "sif_trailer" => Ok(GeneratedField::SifTrailer), + "enabledPublishCodecs" | "enabled_publish_codecs" => Ok(GeneratedField::EnabledPublishCodecs), + "fastPublish" | "fast_publish" => Ok(GeneratedField::FastPublish), _ => Ok(GeneratedField::__SkipField__), } } @@ -11189,6 +12126,8 @@ impl<'de> serde::Deserialize<'de> for JoinResponse { let mut ping_interval__ = None; let mut server_info__ = None; let mut sif_trailer__ = None; + let mut enabled_publish_codecs__ = None; + let mut fast_publish__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Room => { @@ -11275,6 +12214,18 @@ impl<'de> serde::Deserialize<'de> for JoinResponse { Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) ; } + GeneratedField::EnabledPublishCodecs => { + if enabled_publish_codecs__.is_some() { + return Err(serde::de::Error::duplicate_field("enabledPublishCodecs")); + } + enabled_publish_codecs__ = Some(map_.next_value()?); + } + GeneratedField::FastPublish => { + if fast_publish__.is_some() { + return Err(serde::de::Error::duplicate_field("fastPublish")); + } + fast_publish__ = Some(map_.next_value()?); + } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } @@ -11294,6 +12245,8 @@ impl<'de> serde::Deserialize<'de> for JoinResponse { ping_interval: ping_interval__.unwrap_or_default(), server_info: server_info__, sif_trailer: sif_trailer__.unwrap_or_default(), + enabled_publish_codecs: enabled_publish_codecs__.unwrap_or_default(), + fast_publish: fast_publish__.unwrap_or_default(), }) } } @@ -13217,7 +14170,126 @@ impl<'de> serde::Deserialize<'de> for ListSipTrunkResponse { deserializer.deserialize_struct("livekit.ListSIPTrunkResponse", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for MigrateJobRequest { +impl serde::Serialize for MetricLabel { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::AgentsLlmTtft => "AGENTS_LLM_TTFT", + Self::AgentsSttTtft => "AGENTS_STT_TTFT", + Self::AgentsTtsTtfb => "AGENTS_TTS_TTFB", + Self::ClientVideoSubscriberFreezeCount => "CLIENT_VIDEO_SUBSCRIBER_FREEZE_COUNT", + Self::ClientVideoSubscriberTotalFreezeDuration => "CLIENT_VIDEO_SUBSCRIBER_TOTAL_FREEZE_DURATION", + Self::ClientVideoSubscriberPauseCount => "CLIENT_VIDEO_SUBSCRIBER_PAUSE_COUNT", + Self::ClientVideoSubscriberTotalPausesDuration => "CLIENT_VIDEO_SUBSCRIBER_TOTAL_PAUSES_DURATION", + Self::ClientAudioSubscriberConcealedSamples => "CLIENT_AUDIO_SUBSCRIBER_CONCEALED_SAMPLES", + Self::ClientAudioSubscriberSilentConcealedSamples => "CLIENT_AUDIO_SUBSCRIBER_SILENT_CONCEALED_SAMPLES", + Self::ClientAudioSubscriberConcealmentEvents => "CLIENT_AUDIO_SUBSCRIBER_CONCEALMENT_EVENTS", + Self::ClientAudioSubscriberInterruptionCount => "CLIENT_AUDIO_SUBSCRIBER_INTERRUPTION_COUNT", + Self::ClientAudioSubscriberTotalInterruptionDuration => "CLIENT_AUDIO_SUBSCRIBER_TOTAL_INTERRUPTION_DURATION", + Self::ClientSubscriberJitterBufferDelay => "CLIENT_SUBSCRIBER_JITTER_BUFFER_DELAY", + Self::ClientSubscriberJitterBufferEmittedCount => "CLIENT_SUBSCRIBER_JITTER_BUFFER_EMITTED_COUNT", + Self::ClientVideoPublisherQualityLimitationDurationBandwidth => "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_BANDWIDTH", + Self::ClientVideoPublisherQualityLimitationDurationCpu => "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_CPU", + Self::ClientVideoPublisherQualityLimitationDurationOther => "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_OTHER", + Self::PredefinedMaxValue => "METRIC_LABEL_PREDEFINED_MAX_VALUE", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for MetricLabel { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "AGENTS_LLM_TTFT", + "AGENTS_STT_TTFT", + "AGENTS_TTS_TTFB", + "CLIENT_VIDEO_SUBSCRIBER_FREEZE_COUNT", + "CLIENT_VIDEO_SUBSCRIBER_TOTAL_FREEZE_DURATION", + "CLIENT_VIDEO_SUBSCRIBER_PAUSE_COUNT", + "CLIENT_VIDEO_SUBSCRIBER_TOTAL_PAUSES_DURATION", + "CLIENT_AUDIO_SUBSCRIBER_CONCEALED_SAMPLES", + "CLIENT_AUDIO_SUBSCRIBER_SILENT_CONCEALED_SAMPLES", + "CLIENT_AUDIO_SUBSCRIBER_CONCEALMENT_EVENTS", + "CLIENT_AUDIO_SUBSCRIBER_INTERRUPTION_COUNT", + "CLIENT_AUDIO_SUBSCRIBER_TOTAL_INTERRUPTION_DURATION", + "CLIENT_SUBSCRIBER_JITTER_BUFFER_DELAY", + "CLIENT_SUBSCRIBER_JITTER_BUFFER_EMITTED_COUNT", + "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_BANDWIDTH", + "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_CPU", + "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_OTHER", + "METRIC_LABEL_PREDEFINED_MAX_VALUE", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MetricLabel; + + 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 { + "AGENTS_LLM_TTFT" => Ok(MetricLabel::AgentsLlmTtft), + "AGENTS_STT_TTFT" => Ok(MetricLabel::AgentsSttTtft), + "AGENTS_TTS_TTFB" => Ok(MetricLabel::AgentsTtsTtfb), + "CLIENT_VIDEO_SUBSCRIBER_FREEZE_COUNT" => Ok(MetricLabel::ClientVideoSubscriberFreezeCount), + "CLIENT_VIDEO_SUBSCRIBER_TOTAL_FREEZE_DURATION" => Ok(MetricLabel::ClientVideoSubscriberTotalFreezeDuration), + "CLIENT_VIDEO_SUBSCRIBER_PAUSE_COUNT" => Ok(MetricLabel::ClientVideoSubscriberPauseCount), + "CLIENT_VIDEO_SUBSCRIBER_TOTAL_PAUSES_DURATION" => Ok(MetricLabel::ClientVideoSubscriberTotalPausesDuration), + "CLIENT_AUDIO_SUBSCRIBER_CONCEALED_SAMPLES" => Ok(MetricLabel::ClientAudioSubscriberConcealedSamples), + "CLIENT_AUDIO_SUBSCRIBER_SILENT_CONCEALED_SAMPLES" => Ok(MetricLabel::ClientAudioSubscriberSilentConcealedSamples), + "CLIENT_AUDIO_SUBSCRIBER_CONCEALMENT_EVENTS" => Ok(MetricLabel::ClientAudioSubscriberConcealmentEvents), + "CLIENT_AUDIO_SUBSCRIBER_INTERRUPTION_COUNT" => Ok(MetricLabel::ClientAudioSubscriberInterruptionCount), + "CLIENT_AUDIO_SUBSCRIBER_TOTAL_INTERRUPTION_DURATION" => Ok(MetricLabel::ClientAudioSubscriberTotalInterruptionDuration), + "CLIENT_SUBSCRIBER_JITTER_BUFFER_DELAY" => Ok(MetricLabel::ClientSubscriberJitterBufferDelay), + "CLIENT_SUBSCRIBER_JITTER_BUFFER_EMITTED_COUNT" => Ok(MetricLabel::ClientSubscriberJitterBufferEmittedCount), + "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_BANDWIDTH" => Ok(MetricLabel::ClientVideoPublisherQualityLimitationDurationBandwidth), + "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_CPU" => Ok(MetricLabel::ClientVideoPublisherQualityLimitationDurationCpu), + "CLIENT_VIDEO_PUBLISHER_QUALITY_LIMITATION_DURATION_OTHER" => Ok(MetricLabel::ClientVideoPublisherQualityLimitationDurationOther), + "METRIC_LABEL_PREDEFINED_MAX_VALUE" => Ok(MetricLabel::PredefinedMaxValue), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for MetricSample { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -13225,25 +14297,333 @@ impl serde::Serialize for MigrateJobRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.job_ids.is_empty() { + if self.timestamp_ms != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.MigrateJobRequest", len)?; - if !self.job_ids.is_empty() { - struct_ser.serialize_field("jobIds", &self.job_ids)?; + if self.normalized_timestamp.is_some() { + len += 1; + } + if self.value != 0. { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.MetricSample", len)?; + if self.timestamp_ms != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("timestampMs", ToString::to_string(&self.timestamp_ms).as_str())?; + } + if let Some(v) = self.normalized_timestamp.as_ref() { + struct_ser.serialize_field("normalizedTimestamp", v)?; + } + if self.value != 0. { + struct_ser.serialize_field("value", &self.value)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for MigrateJobRequest { +impl<'de> serde::Deserialize<'de> for MetricSample { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "job_ids", - "jobIds", + "timestamp_ms", + "timestampMs", + "normalized_timestamp", + "normalizedTimestamp", + "value", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + TimestampMs, + NormalizedTimestamp, + Value, + __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 { + "timestampMs" | "timestamp_ms" => Ok(GeneratedField::TimestampMs), + "normalizedTimestamp" | "normalized_timestamp" => Ok(GeneratedField::NormalizedTimestamp), + "value" => Ok(GeneratedField::Value), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MetricSample; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.MetricSample") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut timestamp_ms__ = None; + let mut normalized_timestamp__ = None; + let mut value__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::TimestampMs => { + if timestamp_ms__.is_some() { + return Err(serde::de::Error::duplicate_field("timestampMs")); + } + timestamp_ms__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::NormalizedTimestamp => { + if normalized_timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("normalizedTimestamp")); + } + normalized_timestamp__ = map_.next_value()?; + } + GeneratedField::Value => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("value")); + } + value__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(MetricSample { + timestamp_ms: timestamp_ms__.unwrap_or_default(), + normalized_timestamp: normalized_timestamp__, + value: value__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.MetricSample", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MetricsBatch { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.timestamp_ms != 0 { + len += 1; + } + if self.normalized_timestamp.is_some() { + len += 1; + } + if !self.str_data.is_empty() { + len += 1; + } + if !self.time_series.is_empty() { + len += 1; + } + if !self.events.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.MetricsBatch", len)?; + if self.timestamp_ms != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("timestampMs", ToString::to_string(&self.timestamp_ms).as_str())?; + } + if let Some(v) = self.normalized_timestamp.as_ref() { + struct_ser.serialize_field("normalizedTimestamp", v)?; + } + if !self.str_data.is_empty() { + struct_ser.serialize_field("strData", &self.str_data)?; + } + if !self.time_series.is_empty() { + struct_ser.serialize_field("timeSeries", &self.time_series)?; + } + if !self.events.is_empty() { + struct_ser.serialize_field("events", &self.events)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MetricsBatch { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "timestamp_ms", + "timestampMs", + "normalized_timestamp", + "normalizedTimestamp", + "str_data", + "strData", + "time_series", + "timeSeries", + "events", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + TimestampMs, + NormalizedTimestamp, + StrData, + TimeSeries, + Events, + __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 { + "timestampMs" | "timestamp_ms" => Ok(GeneratedField::TimestampMs), + "normalizedTimestamp" | "normalized_timestamp" => Ok(GeneratedField::NormalizedTimestamp), + "strData" | "str_data" => Ok(GeneratedField::StrData), + "timeSeries" | "time_series" => Ok(GeneratedField::TimeSeries), + "events" => Ok(GeneratedField::Events), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MetricsBatch; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.MetricsBatch") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut timestamp_ms__ = None; + let mut normalized_timestamp__ = None; + let mut str_data__ = None; + let mut time_series__ = None; + let mut events__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::TimestampMs => { + if timestamp_ms__.is_some() { + return Err(serde::de::Error::duplicate_field("timestampMs")); + } + timestamp_ms__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::NormalizedTimestamp => { + if normalized_timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("normalizedTimestamp")); + } + normalized_timestamp__ = map_.next_value()?; + } + GeneratedField::StrData => { + if str_data__.is_some() { + return Err(serde::de::Error::duplicate_field("strData")); + } + str_data__ = Some(map_.next_value()?); + } + GeneratedField::TimeSeries => { + if time_series__.is_some() { + return Err(serde::de::Error::duplicate_field("timeSeries")); + } + time_series__ = Some(map_.next_value()?); + } + GeneratedField::Events => { + if events__.is_some() { + return Err(serde::de::Error::duplicate_field("events")); + } + events__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(MetricsBatch { + timestamp_ms: timestamp_ms__.unwrap_or_default(), + normalized_timestamp: normalized_timestamp__, + str_data: str_data__.unwrap_or_default(), + time_series: time_series__.unwrap_or_default(), + events: events__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.MetricsBatch", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MigrateJobRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.job_ids.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.MigrateJobRequest", len)?; + if !self.job_ids.is_empty() { + struct_ser.serialize_field("jobIds", &self.job_ids)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MigrateJobRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "job_ids", + "jobIds", ]; #[allow(clippy::enum_variant_names)] @@ -14428,6 +15808,9 @@ impl serde::Serialize for ParticipantPermission { if self.agent { len += 1; } + if self.can_subscribe_metrics { + len += 1; + } let mut struct_ser = serializer.serialize_struct("livekit.ParticipantPermission", len)?; if self.can_subscribe { struct_ser.serialize_field("canSubscribe", &self.can_subscribe)?; @@ -14457,6 +15840,9 @@ impl serde::Serialize for ParticipantPermission { if self.agent { struct_ser.serialize_field("agent", &self.agent)?; } + if self.can_subscribe_metrics { + struct_ser.serialize_field("canSubscribeMetrics", &self.can_subscribe_metrics)?; + } struct_ser.end() } } @@ -14480,6 +15866,8 @@ impl<'de> serde::Deserialize<'de> for ParticipantPermission { "can_update_metadata", "canUpdateMetadata", "agent", + "can_subscribe_metrics", + "canSubscribeMetrics", ]; #[allow(clippy::enum_variant_names)] @@ -14492,6 +15880,7 @@ impl<'de> serde::Deserialize<'de> for ParticipantPermission { Recorder, CanUpdateMetadata, Agent, + CanSubscribeMetrics, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -14522,6 +15911,7 @@ impl<'de> serde::Deserialize<'de> for ParticipantPermission { "recorder" => Ok(GeneratedField::Recorder), "canUpdateMetadata" | "can_update_metadata" => Ok(GeneratedField::CanUpdateMetadata), "agent" => Ok(GeneratedField::Agent), + "canSubscribeMetrics" | "can_subscribe_metrics" => Ok(GeneratedField::CanSubscribeMetrics), _ => Ok(GeneratedField::__SkipField__), } } @@ -14549,6 +15939,7 @@ impl<'de> serde::Deserialize<'de> for ParticipantPermission { let mut recorder__ = None; let mut can_update_metadata__ = None; let mut agent__ = None; + let mut can_subscribe_metrics__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::CanSubscribe => { @@ -14599,6 +15990,12 @@ impl<'de> serde::Deserialize<'de> for ParticipantPermission { } agent__ = Some(map_.next_value()?); } + GeneratedField::CanSubscribeMetrics => { + if can_subscribe_metrics__.is_some() { + return Err(serde::de::Error::duplicate_field("canSubscribeMetrics")); + } + can_subscribe_metrics__ = Some(map_.next_value()?); + } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } @@ -14613,6 +16010,7 @@ impl<'de> serde::Deserialize<'de> for ParticipantPermission { recorder: recorder__.unwrap_or_default(), can_update_metadata: can_update_metadata__.unwrap_or_default(), agent: agent__.unwrap_or_default(), + can_subscribe_metrics: can_subscribe_metrics__.unwrap_or_default(), }) } } @@ -15331,7 +16729,7 @@ impl<'de> serde::Deserialize<'de> for ProxyConfig { deserializer.deserialize_struct("livekit.ProxyConfig", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for RtpDrift { +impl serde::Serialize for RtcpSenderReportState { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -15339,96 +16737,321 @@ impl serde::Serialize for RtpDrift { { use serde::ser::SerializeStruct; let mut len = 0; - if self.start_time.is_some() { - len += 1; - } - if self.end_time.is_some() { - len += 1; - } - if self.duration != 0. { + if self.rtp_timestamp != 0 { len += 1; } - if self.start_timestamp != 0 { + if self.rtp_timestamp_ext != 0 { len += 1; } - if self.end_timestamp != 0 { + if self.ntp_timestamp != 0 { len += 1; } - if self.rtp_clock_ticks != 0 { + if self.at != 0 { len += 1; } - if self.drift_samples != 0 { + if self.at_adjusted != 0 { len += 1; } - if self.drift_ms != 0. { + if self.packets != 0 { len += 1; } - if self.clock_rate != 0. { + if self.octets != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.RTPDrift", len)?; - if let Some(v) = self.start_time.as_ref() { - struct_ser.serialize_field("startTime", v)?; - } - if let Some(v) = self.end_time.as_ref() { - struct_ser.serialize_field("endTime", v)?; - } - if self.duration != 0. { - struct_ser.serialize_field("duration", &self.duration)?; + let mut struct_ser = serializer.serialize_struct("livekit.RTCPSenderReportState", len)?; + if self.rtp_timestamp != 0 { + struct_ser.serialize_field("rtpTimestamp", &self.rtp_timestamp)?; } - if self.start_timestamp != 0 { + if self.rtp_timestamp_ext != 0 { #[allow(clippy::needless_borrow)] #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("startTimestamp", ToString::to_string(&self.start_timestamp).as_str())?; + struct_ser.serialize_field("rtpTimestampExt", ToString::to_string(&self.rtp_timestamp_ext).as_str())?; } - if self.end_timestamp != 0 { + if self.ntp_timestamp != 0 { #[allow(clippy::needless_borrow)] #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("endTimestamp", ToString::to_string(&self.end_timestamp).as_str())?; + struct_ser.serialize_field("ntpTimestamp", ToString::to_string(&self.ntp_timestamp).as_str())?; } - if self.rtp_clock_ticks != 0 { + if self.at != 0 { #[allow(clippy::needless_borrow)] #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("rtpClockTicks", ToString::to_string(&self.rtp_clock_ticks).as_str())?; + struct_ser.serialize_field("at", ToString::to_string(&self.at).as_str())?; } - if self.drift_samples != 0 { + if self.at_adjusted != 0 { #[allow(clippy::needless_borrow)] #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("driftSamples", ToString::to_string(&self.drift_samples).as_str())?; + struct_ser.serialize_field("atAdjusted", ToString::to_string(&self.at_adjusted).as_str())?; } - if self.drift_ms != 0. { - struct_ser.serialize_field("driftMs", &self.drift_ms)?; + if self.packets != 0 { + struct_ser.serialize_field("packets", &self.packets)?; } - if self.clock_rate != 0. { - struct_ser.serialize_field("clockRate", &self.clock_rate)?; + if self.octets != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("octets", ToString::to_string(&self.octets).as_str())?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for RtpDrift { +impl<'de> serde::Deserialize<'de> for RtcpSenderReportState { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "start_time", - "startTime", - "end_time", - "endTime", - "duration", - "start_timestamp", - "startTimestamp", - "end_timestamp", - "endTimestamp", - "rtp_clock_ticks", - "rtpClockTicks", - "drift_samples", - "driftSamples", - "drift_ms", - "driftMs", - "clock_rate", - "clockRate", + "rtp_timestamp", + "rtpTimestamp", + "rtp_timestamp_ext", + "rtpTimestampExt", + "ntp_timestamp", + "ntpTimestamp", + "at", + "at_adjusted", + "atAdjusted", + "packets", + "octets", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + RtpTimestamp, + RtpTimestampExt, + NtpTimestamp, + At, + AtAdjusted, + Packets, + Octets, + __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 { + "rtpTimestamp" | "rtp_timestamp" => Ok(GeneratedField::RtpTimestamp), + "rtpTimestampExt" | "rtp_timestamp_ext" => Ok(GeneratedField::RtpTimestampExt), + "ntpTimestamp" | "ntp_timestamp" => Ok(GeneratedField::NtpTimestamp), + "at" => Ok(GeneratedField::At), + "atAdjusted" | "at_adjusted" => Ok(GeneratedField::AtAdjusted), + "packets" => Ok(GeneratedField::Packets), + "octets" => Ok(GeneratedField::Octets), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = RtcpSenderReportState; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.RTCPSenderReportState") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut rtp_timestamp__ = None; + let mut rtp_timestamp_ext__ = None; + let mut ntp_timestamp__ = None; + let mut at__ = None; + let mut at_adjusted__ = None; + let mut packets__ = None; + let mut octets__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::RtpTimestamp => { + if rtp_timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("rtpTimestamp")); + } + rtp_timestamp__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::RtpTimestampExt => { + if rtp_timestamp_ext__.is_some() { + return Err(serde::de::Error::duplicate_field("rtpTimestampExt")); + } + rtp_timestamp_ext__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::NtpTimestamp => { + if ntp_timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("ntpTimestamp")); + } + ntp_timestamp__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::At => { + if at__.is_some() { + return Err(serde::de::Error::duplicate_field("at")); + } + at__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::AtAdjusted => { + if at_adjusted__.is_some() { + return Err(serde::de::Error::duplicate_field("atAdjusted")); + } + at_adjusted__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Packets => { + if packets__.is_some() { + return Err(serde::de::Error::duplicate_field("packets")); + } + packets__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Octets => { + if octets__.is_some() { + return Err(serde::de::Error::duplicate_field("octets")); + } + octets__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(RtcpSenderReportState { + rtp_timestamp: rtp_timestamp__.unwrap_or_default(), + rtp_timestamp_ext: rtp_timestamp_ext__.unwrap_or_default(), + ntp_timestamp: ntp_timestamp__.unwrap_or_default(), + at: at__.unwrap_or_default(), + at_adjusted: at_adjusted__.unwrap_or_default(), + packets: packets__.unwrap_or_default(), + octets: octets__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.RTCPSenderReportState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for RtpDrift { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.start_time.is_some() { + len += 1; + } + if self.end_time.is_some() { + len += 1; + } + if self.duration != 0. { + len += 1; + } + if self.start_timestamp != 0 { + len += 1; + } + if self.end_timestamp != 0 { + len += 1; + } + if self.rtp_clock_ticks != 0 { + len += 1; + } + if self.drift_samples != 0 { + len += 1; + } + if self.drift_ms != 0. { + len += 1; + } + if self.clock_rate != 0. { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.RTPDrift", len)?; + if let Some(v) = self.start_time.as_ref() { + struct_ser.serialize_field("startTime", v)?; + } + if let Some(v) = self.end_time.as_ref() { + struct_ser.serialize_field("endTime", v)?; + } + if self.duration != 0. { + struct_ser.serialize_field("duration", &self.duration)?; + } + if self.start_timestamp != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("startTimestamp", ToString::to_string(&self.start_timestamp).as_str())?; + } + if self.end_timestamp != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("endTimestamp", ToString::to_string(&self.end_timestamp).as_str())?; + } + if self.rtp_clock_ticks != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("rtpClockTicks", ToString::to_string(&self.rtp_clock_ticks).as_str())?; + } + if self.drift_samples != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("driftSamples", ToString::to_string(&self.drift_samples).as_str())?; + } + if self.drift_ms != 0. { + struct_ser.serialize_field("driftMs", &self.drift_ms)?; + } + if self.clock_rate != 0. { + struct_ser.serialize_field("clockRate", &self.clock_rate)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for RtpDrift { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "start_time", + "startTime", + "end_time", + "endTime", + "duration", + "start_timestamp", + "startTimestamp", + "end_timestamp", + "endTimestamp", + "rtp_clock_ticks", + "rtpClockTicks", + "drift_samples", + "driftSamples", + "drift_ms", + "driftMs", + "clock_rate", + "clockRate", ]; #[allow(clippy::enum_variant_names)] @@ -15618,6 +17241,9 @@ impl serde::Serialize for RtpForwarderState { if self.rtp_munger.is_some() { len += 1; } + if !self.sender_report_state.is_empty() { + len += 1; + } if self.codec_munger.is_some() { len += 1; } @@ -15646,6 +17272,9 @@ impl serde::Serialize for RtpForwarderState { if let Some(v) = self.rtp_munger.as_ref() { struct_ser.serialize_field("rtpMunger", v)?; } + if !self.sender_report_state.is_empty() { + struct_ser.serialize_field("senderReportState", &self.sender_report_state)?; + } if let Some(v) = self.codec_munger.as_ref() { match v { rtp_forwarder_state::CodecMunger::Vp8Munger(v) => { @@ -15674,6 +17303,8 @@ impl<'de> serde::Deserialize<'de> for RtpForwarderState { "dummyStartTimestampOffset", "rtp_munger", "rtpMunger", + "sender_report_state", + "senderReportState", "vp8_munger", "vp8Munger", ]; @@ -15686,6 +17317,7 @@ impl<'de> serde::Deserialize<'de> for RtpForwarderState { ExtFirstTimestamp, DummyStartTimestampOffset, RtpMunger, + SenderReportState, Vp8Munger, __SkipField__, } @@ -15715,6 +17347,7 @@ impl<'de> serde::Deserialize<'de> for RtpForwarderState { "extFirstTimestamp" | "ext_first_timestamp" => Ok(GeneratedField::ExtFirstTimestamp), "dummyStartTimestampOffset" | "dummy_start_timestamp_offset" => Ok(GeneratedField::DummyStartTimestampOffset), "rtpMunger" | "rtp_munger" => Ok(GeneratedField::RtpMunger), + "senderReportState" | "sender_report_state" => Ok(GeneratedField::SenderReportState), "vp8Munger" | "vp8_munger" => Ok(GeneratedField::Vp8Munger), _ => Ok(GeneratedField::__SkipField__), } @@ -15741,6 +17374,7 @@ impl<'de> serde::Deserialize<'de> for RtpForwarderState { let mut ext_first_timestamp__ = None; let mut dummy_start_timestamp_offset__ = None; let mut rtp_munger__ = None; + let mut sender_report_state__ = None; let mut codec_munger__ = None; while let Some(k) = map_.next_key()? { match k { @@ -15788,6 +17422,12 @@ impl<'de> serde::Deserialize<'de> for RtpForwarderState { } rtp_munger__ = map_.next_value()?; } + GeneratedField::SenderReportState => { + if sender_report_state__.is_some() { + return Err(serde::de::Error::duplicate_field("senderReportState")); + } + sender_report_state__ = Some(map_.next_value()?); + } GeneratedField::Vp8Munger => { if codec_munger__.is_some() { return Err(serde::de::Error::duplicate_field("vp8Munger")); @@ -15807,6 +17447,7 @@ impl<'de> serde::Deserialize<'de> for RtpForwarderState { ext_first_timestamp: ext_first_timestamp__.unwrap_or_default(), dummy_start_timestamp_offset: dummy_start_timestamp_offset__.unwrap_or_default(), rtp_munger: rtp_munger__, + sender_report_state: sender_report_state__.unwrap_or_default(), codec_munger: codec_munger__, }) } @@ -16150,12 +17791,15 @@ impl serde::Serialize for RtpStats { if self.packet_drift.is_some() { len += 1; } - if self.report_drift.is_some() { + if self.ntp_report_drift.is_some() { len += 1; } if self.rebased_report_drift.is_some() { len += 1; } + if self.received_report_drift.is_some() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("livekit.RTPStats", len)?; if let Some(v) = self.start_time.as_ref() { struct_ser.serialize_field("startTime", v)?; @@ -16295,12 +17939,15 @@ impl serde::Serialize for RtpStats { if let Some(v) = self.packet_drift.as_ref() { struct_ser.serialize_field("packetDrift", v)?; } - if let Some(v) = self.report_drift.as_ref() { - struct_ser.serialize_field("reportDrift", v)?; + if let Some(v) = self.ntp_report_drift.as_ref() { + struct_ser.serialize_field("ntpReportDrift", v)?; } if let Some(v) = self.rebased_report_drift.as_ref() { struct_ser.serialize_field("rebasedReportDrift", v)?; } + if let Some(v) = self.received_report_drift.as_ref() { + struct_ser.serialize_field("receivedReportDrift", v)?; + } struct_ser.end() } } @@ -16387,10 +18034,12 @@ impl<'de> serde::Deserialize<'de> for RtpStats { "lastLayerLockPli", "packet_drift", "packetDrift", - "report_drift", - "reportDrift", + "ntp_report_drift", + "ntpReportDrift", "rebased_report_drift", "rebasedReportDrift", + "received_report_drift", + "receivedReportDrift", ]; #[allow(clippy::enum_variant_names)] @@ -16437,8 +18086,9 @@ impl<'de> serde::Deserialize<'de> for RtpStats { LayerLockPlis, LastLayerLockPli, PacketDrift, - ReportDrift, + NtpReportDrift, RebasedReportDrift, + ReceivedReportDrift, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -16503,8 +18153,9 @@ impl<'de> serde::Deserialize<'de> for RtpStats { "layerLockPlis" | "layer_lock_plis" => Ok(GeneratedField::LayerLockPlis), "lastLayerLockPli" | "last_layer_lock_pli" => Ok(GeneratedField::LastLayerLockPli), "packetDrift" | "packet_drift" => Ok(GeneratedField::PacketDrift), - "reportDrift" | "report_drift" => Ok(GeneratedField::ReportDrift), + "ntpReportDrift" | "ntp_report_drift" => Ok(GeneratedField::NtpReportDrift), "rebasedReportDrift" | "rebased_report_drift" => Ok(GeneratedField::RebasedReportDrift), + "receivedReportDrift" | "received_report_drift" => Ok(GeneratedField::ReceivedReportDrift), _ => Ok(GeneratedField::__SkipField__), } } @@ -16566,8 +18217,9 @@ impl<'de> serde::Deserialize<'de> for RtpStats { let mut layer_lock_plis__ = None; let mut last_layer_lock_pli__ = None; let mut packet_drift__ = None; - let mut report_drift__ = None; + let mut ntp_report_drift__ = None; let mut rebased_report_drift__ = None; + let mut received_report_drift__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::StartTime => { @@ -16891,157 +18543,693 @@ impl<'de> serde::Deserialize<'de> for RtpStats { if packet_drift__.is_some() { return Err(serde::de::Error::duplicate_field("packetDrift")); } - packet_drift__ = map_.next_value()?; + packet_drift__ = map_.next_value()?; + } + GeneratedField::NtpReportDrift => { + if ntp_report_drift__.is_some() { + return Err(serde::de::Error::duplicate_field("ntpReportDrift")); + } + ntp_report_drift__ = map_.next_value()?; + } + GeneratedField::RebasedReportDrift => { + if rebased_report_drift__.is_some() { + return Err(serde::de::Error::duplicate_field("rebasedReportDrift")); + } + rebased_report_drift__ = map_.next_value()?; + } + GeneratedField::ReceivedReportDrift => { + if received_report_drift__.is_some() { + return Err(serde::de::Error::duplicate_field("receivedReportDrift")); + } + received_report_drift__ = map_.next_value()?; + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(RtpStats { + start_time: start_time__, + end_time: end_time__, + duration: duration__.unwrap_or_default(), + packets: packets__.unwrap_or_default(), + packet_rate: packet_rate__.unwrap_or_default(), + bytes: bytes__.unwrap_or_default(), + header_bytes: header_bytes__.unwrap_or_default(), + bitrate: bitrate__.unwrap_or_default(), + packets_lost: packets_lost__.unwrap_or_default(), + packet_loss_rate: packet_loss_rate__.unwrap_or_default(), + packet_loss_percentage: packet_loss_percentage__.unwrap_or_default(), + packets_duplicate: packets_duplicate__.unwrap_or_default(), + packet_duplicate_rate: packet_duplicate_rate__.unwrap_or_default(), + bytes_duplicate: bytes_duplicate__.unwrap_or_default(), + header_bytes_duplicate: header_bytes_duplicate__.unwrap_or_default(), + bitrate_duplicate: bitrate_duplicate__.unwrap_or_default(), + packets_padding: packets_padding__.unwrap_or_default(), + packet_padding_rate: packet_padding_rate__.unwrap_or_default(), + bytes_padding: bytes_padding__.unwrap_or_default(), + header_bytes_padding: header_bytes_padding__.unwrap_or_default(), + bitrate_padding: bitrate_padding__.unwrap_or_default(), + packets_out_of_order: packets_out_of_order__.unwrap_or_default(), + frames: frames__.unwrap_or_default(), + frame_rate: frame_rate__.unwrap_or_default(), + jitter_current: jitter_current__.unwrap_or_default(), + jitter_max: jitter_max__.unwrap_or_default(), + gap_histogram: gap_histogram__.unwrap_or_default(), + nacks: nacks__.unwrap_or_default(), + nack_acks: nack_acks__.unwrap_or_default(), + nack_misses: nack_misses__.unwrap_or_default(), + nack_repeated: nack_repeated__.unwrap_or_default(), + plis: plis__.unwrap_or_default(), + last_pli: last_pli__, + firs: firs__.unwrap_or_default(), + last_fir: last_fir__, + rtt_current: rtt_current__.unwrap_or_default(), + rtt_max: rtt_max__.unwrap_or_default(), + key_frames: key_frames__.unwrap_or_default(), + last_key_frame: last_key_frame__, + layer_lock_plis: layer_lock_plis__.unwrap_or_default(), + last_layer_lock_pli: last_layer_lock_pli__, + packet_drift: packet_drift__, + ntp_report_drift: ntp_report_drift__, + rebased_report_drift: rebased_report_drift__, + received_report_drift: received_report_drift__, + }) + } + } + deserializer.deserialize_struct("livekit.RTPStats", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ReconnectReason { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::RrUnknown => "RR_UNKNOWN", + Self::RrSignalDisconnected => "RR_SIGNAL_DISCONNECTED", + Self::RrPublisherFailed => "RR_PUBLISHER_FAILED", + Self::RrSubscriberFailed => "RR_SUBSCRIBER_FAILED", + Self::RrSwitchCandidate => "RR_SWITCH_CANDIDATE", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for ReconnectReason { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "RR_UNKNOWN", + "RR_SIGNAL_DISCONNECTED", + "RR_PUBLISHER_FAILED", + "RR_SUBSCRIBER_FAILED", + "RR_SWITCH_CANDIDATE", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ReconnectReason; + + 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 { + "RR_UNKNOWN" => Ok(ReconnectReason::RrUnknown), + "RR_SIGNAL_DISCONNECTED" => Ok(ReconnectReason::RrSignalDisconnected), + "RR_PUBLISHER_FAILED" => Ok(ReconnectReason::RrPublisherFailed), + "RR_SUBSCRIBER_FAILED" => Ok(ReconnectReason::RrSubscriberFailed), + "RR_SWITCH_CANDIDATE" => Ok(ReconnectReason::RrSwitchCandidate), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for ReconnectResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.ice_servers.is_empty() { + len += 1; + } + if self.client_configuration.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.ReconnectResponse", len)?; + if !self.ice_servers.is_empty() { + struct_ser.serialize_field("iceServers", &self.ice_servers)?; + } + if let Some(v) = self.client_configuration.as_ref() { + struct_ser.serialize_field("clientConfiguration", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ReconnectResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "ice_servers", + "iceServers", + "client_configuration", + "clientConfiguration", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + IceServers, + ClientConfiguration, + __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 { + "iceServers" | "ice_servers" => Ok(GeneratedField::IceServers), + "clientConfiguration" | "client_configuration" => Ok(GeneratedField::ClientConfiguration), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ReconnectResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.ReconnectResponse") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut ice_servers__ = None; + let mut client_configuration__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::IceServers => { + if ice_servers__.is_some() { + return Err(serde::de::Error::duplicate_field("iceServers")); + } + ice_servers__ = Some(map_.next_value()?); + } + GeneratedField::ClientConfiguration => { + if client_configuration__.is_some() { + return Err(serde::de::Error::duplicate_field("clientConfiguration")); + } + client_configuration__ = map_.next_value()?; + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(ReconnectResponse { + ice_servers: ice_servers__.unwrap_or_default(), + client_configuration: client_configuration__, + }) + } + } + deserializer.deserialize_struct("livekit.ReconnectResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for RegionInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.region.is_empty() { + len += 1; + } + if !self.url.is_empty() { + len += 1; + } + if self.distance != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.RegionInfo", len)?; + if !self.region.is_empty() { + struct_ser.serialize_field("region", &self.region)?; + } + if !self.url.is_empty() { + struct_ser.serialize_field("url", &self.url)?; + } + if self.distance != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("distance", ToString::to_string(&self.distance).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for RegionInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "region", + "url", + "distance", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Region, + Url, + Distance, + __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 { + "region" => Ok(GeneratedField::Region), + "url" => Ok(GeneratedField::Url), + "distance" => Ok(GeneratedField::Distance), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = RegionInfo; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.RegionInfo") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut region__ = None; + let mut url__ = None; + let mut distance__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Region => { + if region__.is_some() { + return Err(serde::de::Error::duplicate_field("region")); + } + region__ = Some(map_.next_value()?); + } + GeneratedField::Url => { + if url__.is_some() { + return Err(serde::de::Error::duplicate_field("url")); + } + url__ = Some(map_.next_value()?); + } + GeneratedField::Distance => { + if distance__.is_some() { + return Err(serde::de::Error::duplicate_field("distance")); + } + distance__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(RegionInfo { + region: region__.unwrap_or_default(), + url: url__.unwrap_or_default(), + distance: distance__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.RegionInfo", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for RegionSettings { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.regions.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.RegionSettings", len)?; + if !self.regions.is_empty() { + struct_ser.serialize_field("regions", &self.regions)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for RegionSettings { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "regions", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Regions, + __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 { + "regions" => Ok(GeneratedField::Regions), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = RegionSettings; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.RegionSettings") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut regions__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Regions => { + if regions__.is_some() { + return Err(serde::de::Error::duplicate_field("regions")); + } + regions__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(RegionSettings { + regions: regions__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.RegionSettings", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for RegisterWorkerRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.r#type != 0 { + len += 1; + } + if !self.agent_name.is_empty() { + len += 1; + } + if !self.version.is_empty() { + len += 1; + } + if self.ping_interval != 0 { + len += 1; + } + if self.namespace.is_some() { + len += 1; + } + if self.allowed_permissions.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.RegisterWorkerRequest", len)?; + if self.r#type != 0 { + let v = JobType::try_from(self.r#type) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.r#type)))?; + struct_ser.serialize_field("type", &v)?; + } + if !self.agent_name.is_empty() { + struct_ser.serialize_field("agentName", &self.agent_name)?; + } + if !self.version.is_empty() { + struct_ser.serialize_field("version", &self.version)?; + } + if self.ping_interval != 0 { + struct_ser.serialize_field("pingInterval", &self.ping_interval)?; + } + if let Some(v) = self.namespace.as_ref() { + struct_ser.serialize_field("namespace", v)?; + } + if let Some(v) = self.allowed_permissions.as_ref() { + struct_ser.serialize_field("allowedPermissions", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for RegisterWorkerRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "type", + "agent_name", + "agentName", + "version", + "ping_interval", + "pingInterval", + "namespace", + "allowed_permissions", + "allowedPermissions", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Type, + AgentName, + Version, + PingInterval, + Namespace, + AllowedPermissions, + __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 { + "type" => Ok(GeneratedField::Type), + "agentName" | "agent_name" => Ok(GeneratedField::AgentName), + "version" => Ok(GeneratedField::Version), + "pingInterval" | "ping_interval" => Ok(GeneratedField::PingInterval), + "namespace" => Ok(GeneratedField::Namespace), + "allowedPermissions" | "allowed_permissions" => Ok(GeneratedField::AllowedPermissions), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = RegisterWorkerRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.RegisterWorkerRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut r#type__ = None; + let mut agent_name__ = None; + let mut version__ = None; + let mut ping_interval__ = None; + let mut namespace__ = None; + let mut allowed_permissions__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Type => { + if r#type__.is_some() { + return Err(serde::de::Error::duplicate_field("type")); + } + r#type__ = Some(map_.next_value::()? as i32); + } + GeneratedField::AgentName => { + if agent_name__.is_some() { + return Err(serde::de::Error::duplicate_field("agentName")); + } + agent_name__ = Some(map_.next_value()?); + } + GeneratedField::Version => { + if version__.is_some() { + return Err(serde::de::Error::duplicate_field("version")); + } + version__ = Some(map_.next_value()?); + } + GeneratedField::PingInterval => { + if ping_interval__.is_some() { + return Err(serde::de::Error::duplicate_field("pingInterval")); + } + ping_interval__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } - GeneratedField::ReportDrift => { - if report_drift__.is_some() { - return Err(serde::de::Error::duplicate_field("reportDrift")); + GeneratedField::Namespace => { + if namespace__.is_some() { + return Err(serde::de::Error::duplicate_field("namespace")); } - report_drift__ = map_.next_value()?; + namespace__ = map_.next_value()?; } - GeneratedField::RebasedReportDrift => { - if rebased_report_drift__.is_some() { - return Err(serde::de::Error::duplicate_field("rebasedReportDrift")); + GeneratedField::AllowedPermissions => { + if allowed_permissions__.is_some() { + return Err(serde::de::Error::duplicate_field("allowedPermissions")); } - rebased_report_drift__ = map_.next_value()?; + allowed_permissions__ = map_.next_value()?; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(RtpStats { - start_time: start_time__, - end_time: end_time__, - duration: duration__.unwrap_or_default(), - packets: packets__.unwrap_or_default(), - packet_rate: packet_rate__.unwrap_or_default(), - bytes: bytes__.unwrap_or_default(), - header_bytes: header_bytes__.unwrap_or_default(), - bitrate: bitrate__.unwrap_or_default(), - packets_lost: packets_lost__.unwrap_or_default(), - packet_loss_rate: packet_loss_rate__.unwrap_or_default(), - packet_loss_percentage: packet_loss_percentage__.unwrap_or_default(), - packets_duplicate: packets_duplicate__.unwrap_or_default(), - packet_duplicate_rate: packet_duplicate_rate__.unwrap_or_default(), - bytes_duplicate: bytes_duplicate__.unwrap_or_default(), - header_bytes_duplicate: header_bytes_duplicate__.unwrap_or_default(), - bitrate_duplicate: bitrate_duplicate__.unwrap_or_default(), - packets_padding: packets_padding__.unwrap_or_default(), - packet_padding_rate: packet_padding_rate__.unwrap_or_default(), - bytes_padding: bytes_padding__.unwrap_or_default(), - header_bytes_padding: header_bytes_padding__.unwrap_or_default(), - bitrate_padding: bitrate_padding__.unwrap_or_default(), - packets_out_of_order: packets_out_of_order__.unwrap_or_default(), - frames: frames__.unwrap_or_default(), - frame_rate: frame_rate__.unwrap_or_default(), - jitter_current: jitter_current__.unwrap_or_default(), - jitter_max: jitter_max__.unwrap_or_default(), - gap_histogram: gap_histogram__.unwrap_or_default(), - nacks: nacks__.unwrap_or_default(), - nack_acks: nack_acks__.unwrap_or_default(), - nack_misses: nack_misses__.unwrap_or_default(), - nack_repeated: nack_repeated__.unwrap_or_default(), - plis: plis__.unwrap_or_default(), - last_pli: last_pli__, - firs: firs__.unwrap_or_default(), - last_fir: last_fir__, - rtt_current: rtt_current__.unwrap_or_default(), - rtt_max: rtt_max__.unwrap_or_default(), - key_frames: key_frames__.unwrap_or_default(), - last_key_frame: last_key_frame__, - layer_lock_plis: layer_lock_plis__.unwrap_or_default(), - last_layer_lock_pli: last_layer_lock_pli__, - packet_drift: packet_drift__, - report_drift: report_drift__, - rebased_report_drift: rebased_report_drift__, + Ok(RegisterWorkerRequest { + r#type: r#type__.unwrap_or_default(), + agent_name: agent_name__.unwrap_or_default(), + version: version__.unwrap_or_default(), + ping_interval: ping_interval__.unwrap_or_default(), + namespace: namespace__, + allowed_permissions: allowed_permissions__, }) } } - deserializer.deserialize_struct("livekit.RTPStats", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for ReconnectReason { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::RrUnknown => "RR_UNKNOWN", - Self::RrSignalDisconnected => "RR_SIGNAL_DISCONNECTED", - Self::RrPublisherFailed => "RR_PUBLISHER_FAILED", - Self::RrSubscriberFailed => "RR_SUBSCRIBER_FAILED", - Self::RrSwitchCandidate => "RR_SWITCH_CANDIDATE", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for ReconnectReason { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "RR_UNKNOWN", - "RR_SIGNAL_DISCONNECTED", - "RR_PUBLISHER_FAILED", - "RR_SUBSCRIBER_FAILED", - "RR_SWITCH_CANDIDATE", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ReconnectReason; - - 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 { - "RR_UNKNOWN" => Ok(ReconnectReason::RrUnknown), - "RR_SIGNAL_DISCONNECTED" => Ok(ReconnectReason::RrSignalDisconnected), - "RR_PUBLISHER_FAILED" => Ok(ReconnectReason::RrPublisherFailed), - "RR_SUBSCRIBER_FAILED" => Ok(ReconnectReason::RrSubscriberFailed), - "RR_SWITCH_CANDIDATE" => Ok(ReconnectReason::RrSwitchCandidate), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) + deserializer.deserialize_struct("livekit.RegisterWorkerRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ReconnectResponse { +impl serde::Serialize for RegisterWorkerResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -17049,39 +19237,39 @@ impl serde::Serialize for ReconnectResponse { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.ice_servers.is_empty() { + if !self.worker_id.is_empty() { len += 1; } - if self.client_configuration.is_some() { + if self.server_info.is_some() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.ReconnectResponse", len)?; - if !self.ice_servers.is_empty() { - struct_ser.serialize_field("iceServers", &self.ice_servers)?; + let mut struct_ser = serializer.serialize_struct("livekit.RegisterWorkerResponse", len)?; + if !self.worker_id.is_empty() { + struct_ser.serialize_field("workerId", &self.worker_id)?; } - if let Some(v) = self.client_configuration.as_ref() { - struct_ser.serialize_field("clientConfiguration", v)?; + if let Some(v) = self.server_info.as_ref() { + struct_ser.serialize_field("serverInfo", v)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for ReconnectResponse { +impl<'de> serde::Deserialize<'de> for RegisterWorkerResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "ice_servers", - "iceServers", - "client_configuration", - "clientConfiguration", + "worker_id", + "workerId", + "server_info", + "serverInfo", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - IceServers, - ClientConfiguration, + WorkerId, + ServerInfo, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -17104,8 +19292,8 @@ impl<'de> serde::Deserialize<'de> for ReconnectResponse { E: serde::de::Error, { match value { - "iceServers" | "ice_servers" => Ok(GeneratedField::IceServers), - "clientConfiguration" | "client_configuration" => Ok(GeneratedField::ClientConfiguration), + "workerId" | "worker_id" => Ok(GeneratedField::WorkerId), + "serverInfo" | "server_info" => Ok(GeneratedField::ServerInfo), _ => Ok(GeneratedField::__SkipField__), } } @@ -17115,95 +19303,69 @@ impl<'de> serde::Deserialize<'de> for ReconnectResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ReconnectResponse; + type Value = RegisterWorkerResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ReconnectResponse") + formatter.write_str("struct livekit.RegisterWorkerResponse") } - 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 ice_servers__ = None; - let mut client_configuration__ = None; + let mut worker_id__ = None; + let mut server_info__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::IceServers => { - if ice_servers__.is_some() { - return Err(serde::de::Error::duplicate_field("iceServers")); + GeneratedField::WorkerId => { + if worker_id__.is_some() { + return Err(serde::de::Error::duplicate_field("workerId")); } - ice_servers__ = Some(map_.next_value()?); + worker_id__ = Some(map_.next_value()?); } - GeneratedField::ClientConfiguration => { - if client_configuration__.is_some() { - return Err(serde::de::Error::duplicate_field("clientConfiguration")); + GeneratedField::ServerInfo => { + if server_info__.is_some() { + return Err(serde::de::Error::duplicate_field("serverInfo")); } - client_configuration__ = map_.next_value()?; + server_info__ = map_.next_value()?; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(ReconnectResponse { - ice_servers: ice_servers__.unwrap_or_default(), - client_configuration: client_configuration__, + Ok(RegisterWorkerResponse { + worker_id: worker_id__.unwrap_or_default(), + server_info: server_info__, }) } } - deserializer.deserialize_struct("livekit.ReconnectResponse", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.RegisterWorkerResponse", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for RegionInfo { +impl serde::Serialize for RemoveParticipantResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { use serde::ser::SerializeStruct; - let mut len = 0; - if !self.region.is_empty() { - len += 1; - } - if !self.url.is_empty() { - len += 1; - } - if self.distance != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("livekit.RegionInfo", len)?; - if !self.region.is_empty() { - struct_ser.serialize_field("region", &self.region)?; - } - if !self.url.is_empty() { - struct_ser.serialize_field("url", &self.url)?; - } - if self.distance != 0 { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("distance", ToString::to_string(&self.distance).as_str())?; - } + let len = 0; + let struct_ser = serializer.serialize_struct("livekit.RemoveParticipantResponse", len)?; struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for RegionInfo { +impl<'de> serde::Deserialize<'de> for RemoveParticipantResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "region", - "url", - "distance", ]; #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Region, - Url, - Distance, + enum GeneratedField { __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -17225,12 +19387,7 @@ impl<'de> serde::Deserialize<'de> for RegionInfo { where E: serde::de::Error, { - match value { - "region" => Ok(GeneratedField::Region), - "url" => Ok(GeneratedField::Url), - "distance" => Ok(GeneratedField::Distance), - _ => Ok(GeneratedField::__SkipField__), - } + Ok(GeneratedField::__SkipField__) } } deserializer.deserialize_identifier(GeneratedVisitor) @@ -17238,57 +19395,27 @@ impl<'de> serde::Deserialize<'de> for RegionInfo { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RegionInfo; + type Value = RemoveParticipantResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.RegionInfo") + formatter.write_str("struct livekit.RemoveParticipantResponse") } - 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 region__ = None; - let mut url__ = None; - let mut distance__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Region => { - if region__.is_some() { - return Err(serde::de::Error::duplicate_field("region")); - } - region__ = Some(map_.next_value()?); - } - GeneratedField::Url => { - if url__.is_some() { - return Err(serde::de::Error::duplicate_field("url")); - } - url__ = Some(map_.next_value()?); - } - GeneratedField::Distance => { - if distance__.is_some() { - return Err(serde::de::Error::duplicate_field("distance")); - } - distance__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; - } - } + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; } - Ok(RegionInfo { - region: region__.unwrap_or_default(), - url: url__.unwrap_or_default(), - distance: distance__.unwrap_or_default(), + Ok(RemoveParticipantResponse { }) } } - deserializer.deserialize_struct("livekit.RegionInfo", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.RemoveParticipantResponse", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for RegionSettings { +impl serde::Serialize for RequestResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -17296,29 +19423,48 @@ impl serde::Serialize for RegionSettings { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.regions.is_empty() { + if self.request_id != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.RegionSettings", len)?; - if !self.regions.is_empty() { - struct_ser.serialize_field("regions", &self.regions)?; + if self.reason != 0 { + len += 1; + } + if !self.message.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.RequestResponse", len)?; + if self.request_id != 0 { + struct_ser.serialize_field("requestId", &self.request_id)?; + } + if self.reason != 0 { + let v = request_response::Reason::try_from(self.reason) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.reason)))?; + struct_ser.serialize_field("reason", &v)?; + } + if !self.message.is_empty() { + struct_ser.serialize_field("message", &self.message)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for RegionSettings { +impl<'de> serde::Deserialize<'de> for RequestResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "regions", + "request_id", + "requestId", + "reason", + "message", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Regions, + RequestId, + Reason, + Message, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -17341,7 +19487,9 @@ impl<'de> serde::Deserialize<'de> for RegionSettings { E: serde::de::Error, { match value { - "regions" => Ok(GeneratedField::Regions), + "requestId" | "request_id" => Ok(GeneratedField::RequestId), + "reason" => Ok(GeneratedField::Reason), + "message" => Ok(GeneratedField::Message), _ => Ok(GeneratedField::__SkipField__), } } @@ -17351,39 +19499,134 @@ impl<'de> serde::Deserialize<'de> for RegionSettings { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RegionSettings; + type Value = RequestResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.RegionSettings") + formatter.write_str("struct livekit.RequestResponse") } - 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 regions__ = None; + let mut request_id__ = None; + let mut reason__ = None; + let mut message__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Regions => { - if regions__.is_some() { - return Err(serde::de::Error::duplicate_field("regions")); + GeneratedField::RequestId => { + if request_id__.is_some() { + return Err(serde::de::Error::duplicate_field("requestId")); } - regions__ = Some(map_.next_value()?); + request_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Reason => { + if reason__.is_some() { + return Err(serde::de::Error::duplicate_field("reason")); + } + reason__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Message => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("message")); + } + message__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(RegionSettings { - regions: regions__.unwrap_or_default(), + Ok(RequestResponse { + request_id: request_id__.unwrap_or_default(), + reason: reason__.unwrap_or_default(), + message: message__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.RegionSettings", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.RequestResponse", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for RegisterWorkerRequest { +impl serde::Serialize for request_response::Reason { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Ok => "OK", + Self::NotFound => "NOT_FOUND", + Self::NotAllowed => "NOT_ALLOWED", + Self::LimitExceeded => "LIMIT_EXCEEDED", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for request_response::Reason { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "OK", + "NOT_FOUND", + "NOT_ALLOWED", + "LIMIT_EXCEEDED", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = request_response::Reason; + + 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 { + "OK" => Ok(request_response::Reason::Ok), + "NOT_FOUND" => Ok(request_response::Reason::NotFound), + "NOT_ALLOWED" => Ok(request_response::Reason::NotAllowed), + "LIMIT_EXCEEDED" => Ok(request_response::Reason::LimitExceeded), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for Room { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -17391,74 +19634,136 @@ impl serde::Serialize for RegisterWorkerRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if self.r#type != 0 { + if !self.sid.is_empty() { len += 1; } - if !self.agent_name.is_empty() { + if !self.name.is_empty() { len += 1; } - if !self.version.is_empty() { + if self.empty_timeout != 0 { + len += 1; + } + if self.departure_timeout != 0 { + len += 1; + } + if self.max_participants != 0 { + len += 1; + } + if self.creation_time != 0 { + len += 1; + } + if !self.turn_password.is_empty() { + len += 1; + } + if !self.enabled_codecs.is_empty() { + len += 1; + } + if !self.metadata.is_empty() { + len += 1; + } + if self.num_participants != 0 { + len += 1; + } + if self.num_publishers != 0 { len += 1; } - if self.ping_interval != 0 { - len += 1; + if self.active_recording { + len += 1; + } + if self.version.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.Room", len)?; + if !self.sid.is_empty() { + struct_ser.serialize_field("sid", &self.sid)?; + } + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if self.empty_timeout != 0 { + struct_ser.serialize_field("emptyTimeout", &self.empty_timeout)?; + } + if self.departure_timeout != 0 { + struct_ser.serialize_field("departureTimeout", &self.departure_timeout)?; } - if self.namespace.is_some() { - len += 1; + if self.max_participants != 0 { + struct_ser.serialize_field("maxParticipants", &self.max_participants)?; } - if self.allowed_permissions.is_some() { - len += 1; + if self.creation_time != 0 { + #[allow(clippy::needless_borrow)] + #[allow(clippy::needless_borrows_for_generic_args)] + struct_ser.serialize_field("creationTime", ToString::to_string(&self.creation_time).as_str())?; } - let mut struct_ser = serializer.serialize_struct("livekit.RegisterWorkerRequest", len)?; - if self.r#type != 0 { - let v = JobType::try_from(self.r#type) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.r#type)))?; - struct_ser.serialize_field("type", &v)?; + if !self.turn_password.is_empty() { + struct_ser.serialize_field("turnPassword", &self.turn_password)?; } - if !self.agent_name.is_empty() { - struct_ser.serialize_field("agentName", &self.agent_name)?; + if !self.enabled_codecs.is_empty() { + struct_ser.serialize_field("enabledCodecs", &self.enabled_codecs)?; } - if !self.version.is_empty() { - struct_ser.serialize_field("version", &self.version)?; + if !self.metadata.is_empty() { + struct_ser.serialize_field("metadata", &self.metadata)?; } - if self.ping_interval != 0 { - struct_ser.serialize_field("pingInterval", &self.ping_interval)?; + if self.num_participants != 0 { + struct_ser.serialize_field("numParticipants", &self.num_participants)?; } - if let Some(v) = self.namespace.as_ref() { - struct_ser.serialize_field("namespace", v)?; + if self.num_publishers != 0 { + struct_ser.serialize_field("numPublishers", &self.num_publishers)?; } - if let Some(v) = self.allowed_permissions.as_ref() { - struct_ser.serialize_field("allowedPermissions", v)?; + if self.active_recording { + struct_ser.serialize_field("activeRecording", &self.active_recording)?; + } + if let Some(v) = self.version.as_ref() { + struct_ser.serialize_field("version", v)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for RegisterWorkerRequest { +impl<'de> serde::Deserialize<'de> for Room { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "type", - "agent_name", - "agentName", + "sid", + "name", + "empty_timeout", + "emptyTimeout", + "departure_timeout", + "departureTimeout", + "max_participants", + "maxParticipants", + "creation_time", + "creationTime", + "turn_password", + "turnPassword", + "enabled_codecs", + "enabledCodecs", + "metadata", + "num_participants", + "numParticipants", + "num_publishers", + "numPublishers", + "active_recording", + "activeRecording", "version", - "ping_interval", - "pingInterval", - "namespace", - "allowed_permissions", - "allowedPermissions", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Type, - AgentName, + Sid, + Name, + EmptyTimeout, + DepartureTimeout, + MaxParticipants, + CreationTime, + TurnPassword, + EnabledCodecs, + Metadata, + NumParticipants, + NumPublishers, + ActiveRecording, Version, - PingInterval, - Namespace, - AllowedPermissions, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -17481,12 +19786,19 @@ impl<'de> serde::Deserialize<'de> for RegisterWorkerRequest { E: serde::de::Error, { match value { - "type" => Ok(GeneratedField::Type), - "agentName" | "agent_name" => Ok(GeneratedField::AgentName), + "sid" => Ok(GeneratedField::Sid), + "name" => Ok(GeneratedField::Name), + "emptyTimeout" | "empty_timeout" => Ok(GeneratedField::EmptyTimeout), + "departureTimeout" | "departure_timeout" => Ok(GeneratedField::DepartureTimeout), + "maxParticipants" | "max_participants" => Ok(GeneratedField::MaxParticipants), + "creationTime" | "creation_time" => Ok(GeneratedField::CreationTime), + "turnPassword" | "turn_password" => Ok(GeneratedField::TurnPassword), + "enabledCodecs" | "enabled_codecs" => Ok(GeneratedField::EnabledCodecs), + "metadata" => Ok(GeneratedField::Metadata), + "numParticipants" | "num_participants" => Ok(GeneratedField::NumParticipants), + "numPublishers" | "num_publishers" => Ok(GeneratedField::NumPublishers), + "activeRecording" | "active_recording" => Ok(GeneratedField::ActiveRecording), "version" => Ok(GeneratedField::Version), - "pingInterval" | "ping_interval" => Ok(GeneratedField::PingInterval), - "namespace" => Ok(GeneratedField::Namespace), - "allowedPermissions" | "allowed_permissions" => Ok(GeneratedField::AllowedPermissions), _ => Ok(GeneratedField::__SkipField__), } } @@ -17496,81 +19808,147 @@ impl<'de> serde::Deserialize<'de> for RegisterWorkerRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RegisterWorkerRequest; + type Value = Room; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.RegisterWorkerRequest") + formatter.write_str("struct livekit.Room") } - 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 r#type__ = None; - let mut agent_name__ = None; + let mut sid__ = None; + let mut name__ = None; + let mut empty_timeout__ = None; + let mut departure_timeout__ = None; + let mut max_participants__ = None; + let mut creation_time__ = None; + let mut turn_password__ = None; + let mut enabled_codecs__ = None; + let mut metadata__ = None; + let mut num_participants__ = None; + let mut num_publishers__ = None; + let mut active_recording__ = None; let mut version__ = None; - let mut ping_interval__ = None; - let mut namespace__ = None; - let mut allowed_permissions__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Type => { - if r#type__.is_some() { - return Err(serde::de::Error::duplicate_field("type")); + GeneratedField::Sid => { + if sid__.is_some() { + return Err(serde::de::Error::duplicate_field("sid")); } - r#type__ = Some(map_.next_value::()? as i32); + sid__ = Some(map_.next_value()?); } - GeneratedField::AgentName => { - if agent_name__.is_some() { - return Err(serde::de::Error::duplicate_field("agentName")); + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); } - agent_name__ = Some(map_.next_value()?); + name__ = Some(map_.next_value()?); } - GeneratedField::Version => { - if version__.is_some() { - return Err(serde::de::Error::duplicate_field("version")); + GeneratedField::EmptyTimeout => { + if empty_timeout__.is_some() { + return Err(serde::de::Error::duplicate_field("emptyTimeout")); } - version__ = Some(map_.next_value()?); + empty_timeout__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } - GeneratedField::PingInterval => { - if ping_interval__.is_some() { - return Err(serde::de::Error::duplicate_field("pingInterval")); + GeneratedField::DepartureTimeout => { + if departure_timeout__.is_some() { + return Err(serde::de::Error::duplicate_field("departureTimeout")); } - ping_interval__ = + departure_timeout__ = Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } - GeneratedField::Namespace => { - if namespace__.is_some() { - return Err(serde::de::Error::duplicate_field("namespace")); + GeneratedField::MaxParticipants => { + if max_participants__.is_some() { + return Err(serde::de::Error::duplicate_field("maxParticipants")); } - namespace__ = map_.next_value()?; + max_participants__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } - GeneratedField::AllowedPermissions => { - if allowed_permissions__.is_some() { - return Err(serde::de::Error::duplicate_field("allowedPermissions")); + GeneratedField::CreationTime => { + if creation_time__.is_some() { + return Err(serde::de::Error::duplicate_field("creationTime")); } - allowed_permissions__ = map_.next_value()?; + creation_time__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::TurnPassword => { + if turn_password__.is_some() { + return Err(serde::de::Error::duplicate_field("turnPassword")); + } + turn_password__ = Some(map_.next_value()?); + } + GeneratedField::EnabledCodecs => { + if enabled_codecs__.is_some() { + return Err(serde::de::Error::duplicate_field("enabledCodecs")); + } + enabled_codecs__ = Some(map_.next_value()?); + } + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = Some(map_.next_value()?); + } + GeneratedField::NumParticipants => { + if num_participants__.is_some() { + return Err(serde::de::Error::duplicate_field("numParticipants")); + } + num_participants__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::NumPublishers => { + if num_publishers__.is_some() { + return Err(serde::de::Error::duplicate_field("numPublishers")); + } + num_publishers__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::ActiveRecording => { + if active_recording__.is_some() { + return Err(serde::de::Error::duplicate_field("activeRecording")); + } + active_recording__ = Some(map_.next_value()?); + } + GeneratedField::Version => { + if version__.is_some() { + return Err(serde::de::Error::duplicate_field("version")); + } + version__ = map_.next_value()?; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(RegisterWorkerRequest { - r#type: r#type__.unwrap_or_default(), - agent_name: agent_name__.unwrap_or_default(), - version: version__.unwrap_or_default(), - ping_interval: ping_interval__.unwrap_or_default(), - namespace: namespace__, - allowed_permissions: allowed_permissions__, + Ok(Room { + sid: sid__.unwrap_or_default(), + name: name__.unwrap_or_default(), + empty_timeout: empty_timeout__.unwrap_or_default(), + departure_timeout: departure_timeout__.unwrap_or_default(), + max_participants: max_participants__.unwrap_or_default(), + creation_time: creation_time__.unwrap_or_default(), + turn_password: turn_password__.unwrap_or_default(), + enabled_codecs: enabled_codecs__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), + num_participants: num_participants__.unwrap_or_default(), + num_publishers: num_publishers__.unwrap_or_default(), + active_recording: active_recording__.unwrap_or_default(), + version: version__, }) } } - deserializer.deserialize_struct("livekit.RegisterWorkerRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.Room", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for RegisterWorkerResponse { +impl serde::Serialize for RoomAgent { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -17578,39 +19956,29 @@ impl serde::Serialize for RegisterWorkerResponse { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.worker_id.is_empty() { - len += 1; - } - if self.server_info.is_some() { + if !self.dispatches.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.RegisterWorkerResponse", len)?; - if !self.worker_id.is_empty() { - struct_ser.serialize_field("workerId", &self.worker_id)?; - } - if let Some(v) = self.server_info.as_ref() { - struct_ser.serialize_field("serverInfo", v)?; + let mut struct_ser = serializer.serialize_struct("livekit.RoomAgent", len)?; + if !self.dispatches.is_empty() { + struct_ser.serialize_field("dispatches", &self.dispatches)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for RegisterWorkerResponse { +impl<'de> serde::Deserialize<'de> for RoomAgent { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "worker_id", - "workerId", - "server_info", - "serverInfo", + "dispatches", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - WorkerId, - ServerInfo, + Dispatches, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -17633,8 +20001,7 @@ impl<'de> serde::Deserialize<'de> for RegisterWorkerResponse { E: serde::de::Error, { match value { - "workerId" | "worker_id" => Ok(GeneratedField::WorkerId), - "serverInfo" | "server_info" => Ok(GeneratedField::ServerInfo), + "dispatches" => Ok(GeneratedField::Dispatches), _ => Ok(GeneratedField::__SkipField__), } } @@ -17644,69 +20011,78 @@ impl<'de> serde::Deserialize<'de> for RegisterWorkerResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RegisterWorkerResponse; + type Value = RoomAgent; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.RegisterWorkerResponse") + formatter.write_str("struct livekit.RoomAgent") } - 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 worker_id__ = None; - let mut server_info__ = None; + let mut dispatches__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::WorkerId => { - if worker_id__.is_some() { - return Err(serde::de::Error::duplicate_field("workerId")); - } - worker_id__ = Some(map_.next_value()?); - } - GeneratedField::ServerInfo => { - if server_info__.is_some() { - return Err(serde::de::Error::duplicate_field("serverInfo")); + GeneratedField::Dispatches => { + if dispatches__.is_some() { + return Err(serde::de::Error::duplicate_field("dispatches")); } - server_info__ = map_.next_value()?; + dispatches__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(RegisterWorkerResponse { - worker_id: worker_id__.unwrap_or_default(), - server_info: server_info__, + Ok(RoomAgent { + dispatches: dispatches__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.RegisterWorkerResponse", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.RoomAgent", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for RemoveParticipantResponse { +impl serde::Serialize for RoomAgentDispatch { #[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.RemoveParticipantResponse", len)?; + let mut len = 0; + if !self.agent_name.is_empty() { + len += 1; + } + if !self.metadata.is_empty() { + 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)?; + } + if !self.metadata.is_empty() { + struct_ser.serialize_field("metadata", &self.metadata)?; + } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for RemoveParticipantResponse { +impl<'de> serde::Deserialize<'de> for RoomAgentDispatch { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ + "agent_name", + "agentName", + "metadata", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { + AgentName, + Metadata, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -17728,7 +20104,11 @@ impl<'de> serde::Deserialize<'de> for RemoveParticipantResponse { where E: serde::de::Error, { - Ok(GeneratedField::__SkipField__) + match value { + "agentName" | "agent_name" => Ok(GeneratedField::AgentName), + "metadata" => Ok(GeneratedField::Metadata), + _ => Ok(GeneratedField::__SkipField__), + } } } deserializer.deserialize_identifier(GeneratedVisitor) @@ -17736,27 +20116,47 @@ impl<'de> serde::Deserialize<'de> for RemoveParticipantResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RemoveParticipantResponse; + type Value = RoomAgentDispatch; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.RemoveParticipantResponse") + formatter.write_str("struct livekit.RoomAgentDispatch") } - 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>, { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; + let mut agent_name__ = None; + let mut metadata__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::AgentName => { + if agent_name__.is_some() { + return Err(serde::de::Error::duplicate_field("agentName")); + } + agent_name__ = Some(map_.next_value()?); + } + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } } - Ok(RemoveParticipantResponse { + Ok(RoomAgentDispatch { + agent_name: agent_name__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.RemoveParticipantResponse", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.RoomAgentDispatch", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for RequestResponse { +impl serde::Serialize for RoomCompositeEgressRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -17764,48 +20164,142 @@ impl serde::Serialize for RequestResponse { { use serde::ser::SerializeStruct; let mut len = 0; - if self.request_id != 0 { + if !self.room_name.is_empty() { len += 1; } - if self.reason != 0 { + if !self.layout.is_empty() { len += 1; } - if !self.message.is_empty() { + if self.audio_only { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.RequestResponse", len)?; - if self.request_id != 0 { - struct_ser.serialize_field("requestId", &self.request_id)?; + if self.video_only { + len += 1; } - if self.reason != 0 { - let v = request_response::Reason::try_from(self.reason) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.reason)))?; - struct_ser.serialize_field("reason", &v)?; + if !self.custom_base_url.is_empty() { + len += 1; } - if !self.message.is_empty() { - struct_ser.serialize_field("message", &self.message)?; + if !self.file_outputs.is_empty() { + len += 1; + } + if !self.stream_outputs.is_empty() { + len += 1; + } + if !self.segment_outputs.is_empty() { + len += 1; + } + if !self.image_outputs.is_empty() { + len += 1; + } + if self.output.is_some() { + len += 1; + } + if self.options.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.RoomCompositeEgressRequest", len)?; + if !self.room_name.is_empty() { + struct_ser.serialize_field("roomName", &self.room_name)?; + } + 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)?; + } + if !self.file_outputs.is_empty() { + struct_ser.serialize_field("fileOutputs", &self.file_outputs)?; + } + if !self.stream_outputs.is_empty() { + struct_ser.serialize_field("streamOutputs", &self.stream_outputs)?; + } + if !self.segment_outputs.is_empty() { + struct_ser.serialize_field("segmentOutputs", &self.segment_outputs)?; + } + if !self.image_outputs.is_empty() { + struct_ser.serialize_field("imageOutputs", &self.image_outputs)?; + } + if let Some(v) = self.output.as_ref() { + match v { + room_composite_egress_request::Output::File(v) => { + struct_ser.serialize_field("file", v)?; + } + room_composite_egress_request::Output::Stream(v) => { + struct_ser.serialize_field("stream", v)?; + } + room_composite_egress_request::Output::Segments(v) => { + struct_ser.serialize_field("segments", v)?; + } + } + } + if let Some(v) = self.options.as_ref() { + match v { + room_composite_egress_request::Options::Preset(v) => { + let v = EncodingOptionsPreset::try_from(*v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("preset", &v)?; + } + room_composite_egress_request::Options::Advanced(v) => { + struct_ser.serialize_field("advanced", v)?; + } + } } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for RequestResponse { +impl<'de> serde::Deserialize<'de> for RoomCompositeEgressRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "request_id", - "requestId", - "reason", - "message", + "room_name", + "roomName", + "layout", + "audio_only", + "audioOnly", + "video_only", + "videoOnly", + "custom_base_url", + "customBaseUrl", + "file_outputs", + "fileOutputs", + "stream_outputs", + "streamOutputs", + "segment_outputs", + "segmentOutputs", + "image_outputs", + "imageOutputs", + "file", + "stream", + "segments", + "preset", + "advanced", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - RequestId, - Reason, - Message, + RoomName, + Layout, + AudioOnly, + VideoOnly, + CustomBaseUrl, + FileOutputs, + StreamOutputs, + SegmentOutputs, + ImageOutputs, + File, + Stream, + Segments, + Preset, + Advanced, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -17828,9 +20322,20 @@ impl<'de> serde::Deserialize<'de> for RequestResponse { E: serde::de::Error, { match value { - "requestId" | "request_id" => Ok(GeneratedField::RequestId), - "reason" => Ok(GeneratedField::Reason), - "message" => Ok(GeneratedField::Message), + "roomName" | "room_name" => Ok(GeneratedField::RoomName), + "layout" => Ok(GeneratedField::Layout), + "audioOnly" | "audio_only" => Ok(GeneratedField::AudioOnly), + "videoOnly" | "video_only" => Ok(GeneratedField::VideoOnly), + "customBaseUrl" | "custom_base_url" => Ok(GeneratedField::CustomBaseUrl), + "fileOutputs" | "file_outputs" => Ok(GeneratedField::FileOutputs), + "streamOutputs" | "stream_outputs" => Ok(GeneratedField::StreamOutputs), + "segmentOutputs" | "segment_outputs" => Ok(GeneratedField::SegmentOutputs), + "imageOutputs" | "image_outputs" => Ok(GeneratedField::ImageOutputs), + "file" => Ok(GeneratedField::File), + "stream" => Ok(GeneratedField::Stream), + "segments" => Ok(GeneratedField::Segments), + "preset" => Ok(GeneratedField::Preset), + "advanced" => Ok(GeneratedField::Advanced), _ => Ok(GeneratedField::__SkipField__), } } @@ -17840,134 +20345,141 @@ impl<'de> serde::Deserialize<'de> for RequestResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RequestResponse; + type Value = RoomCompositeEgressRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.RequestResponse") + formatter.write_str("struct livekit.RoomCompositeEgressRequest") } - 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 request_id__ = None; - let mut reason__ = None; - let mut message__ = None; + let mut room_name__ = None; + let mut layout__ = None; + let mut audio_only__ = None; + let mut video_only__ = None; + let mut custom_base_url__ = None; + let mut file_outputs__ = None; + let mut stream_outputs__ = None; + let mut segment_outputs__ = None; + let mut image_outputs__ = None; + let mut output__ = None; + let mut options__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::RequestId => { - if request_id__.is_some() { - return Err(serde::de::Error::duplicate_field("requestId")); + GeneratedField::RoomName => { + if room_name__.is_some() { + return Err(serde::de::Error::duplicate_field("roomName")); } - request_id__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + room_name__ = Some(map_.next_value()?); } - GeneratedField::Reason => { - if reason__.is_some() { - return Err(serde::de::Error::duplicate_field("reason")); + GeneratedField::Layout => { + if layout__.is_some() { + return Err(serde::de::Error::duplicate_field("layout")); } - reason__ = Some(map_.next_value::()? as i32); + layout__ = Some(map_.next_value()?); } - GeneratedField::Message => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("message")); + GeneratedField::AudioOnly => { + if audio_only__.is_some() { + return Err(serde::de::Error::duplicate_field("audioOnly")); } - message__ = Some(map_.next_value()?); + 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::FileOutputs => { + if file_outputs__.is_some() { + return Err(serde::de::Error::duplicate_field("fileOutputs")); + } + file_outputs__ = Some(map_.next_value()?); + } + GeneratedField::StreamOutputs => { + if stream_outputs__.is_some() { + return Err(serde::de::Error::duplicate_field("streamOutputs")); + } + stream_outputs__ = Some(map_.next_value()?); + } + GeneratedField::SegmentOutputs => { + if segment_outputs__.is_some() { + return Err(serde::de::Error::duplicate_field("segmentOutputs")); + } + segment_outputs__ = Some(map_.next_value()?); + } + GeneratedField::ImageOutputs => { + if image_outputs__.is_some() { + return Err(serde::de::Error::duplicate_field("imageOutputs")); + } + image_outputs__ = Some(map_.next_value()?); + } + GeneratedField::File => { + if output__.is_some() { + return Err(serde::de::Error::duplicate_field("file")); + } + output__ = map_.next_value::<::std::option::Option<_>>()?.map(room_composite_egress_request::Output::File) +; + } + GeneratedField::Stream => { + if output__.is_some() { + return Err(serde::de::Error::duplicate_field("stream")); + } + output__ = map_.next_value::<::std::option::Option<_>>()?.map(room_composite_egress_request::Output::Stream) +; + } + GeneratedField::Segments => { + if output__.is_some() { + return Err(serde::de::Error::duplicate_field("segments")); + } + output__ = map_.next_value::<::std::option::Option<_>>()?.map(room_composite_egress_request::Output::Segments) +; + } + GeneratedField::Preset => { + if options__.is_some() { + return Err(serde::de::Error::duplicate_field("preset")); + } + options__ = map_.next_value::<::std::option::Option>()?.map(|x| room_composite_egress_request::Options::Preset(x as i32)); + } + GeneratedField::Advanced => { + if options__.is_some() { + return Err(serde::de::Error::duplicate_field("advanced")); + } + options__ = map_.next_value::<::std::option::Option<_>>()?.map(room_composite_egress_request::Options::Advanced) +; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(RequestResponse { - request_id: request_id__.unwrap_or_default(), - reason: reason__.unwrap_or_default(), - message: message__.unwrap_or_default(), + Ok(RoomCompositeEgressRequest { + room_name: room_name__.unwrap_or_default(), + 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(), + file_outputs: file_outputs__.unwrap_or_default(), + stream_outputs: stream_outputs__.unwrap_or_default(), + segment_outputs: segment_outputs__.unwrap_or_default(), + image_outputs: image_outputs__.unwrap_or_default(), + output: output__, + options: options__, }) } } - deserializer.deserialize_struct("livekit.RequestResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for request_response::Reason { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::Ok => "OK", - Self::NotFound => "NOT_FOUND", - Self::NotAllowed => "NOT_ALLOWED", - Self::LimitExceeded => "LIMIT_EXCEEDED", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for request_response::Reason { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "OK", - "NOT_FOUND", - "NOT_ALLOWED", - "LIMIT_EXCEEDED", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = request_response::Reason; - - 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 { - "OK" => Ok(request_response::Reason::Ok), - "NOT_FOUND" => Ok(request_response::Reason::NotFound), - "NOT_ALLOWED" => Ok(request_response::Reason::NotAllowed), - "LIMIT_EXCEEDED" => Ok(request_response::Reason::LimitExceeded), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) + deserializer.deserialize_struct("livekit.RoomCompositeEgressRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for Room { +impl serde::Serialize for RoomConfiguration { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -17975,9 +20487,6 @@ impl serde::Serialize for Room { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.sid.is_empty() { - len += 1; - } if !self.name.is_empty() { len += 1; } @@ -17990,34 +20499,22 @@ impl serde::Serialize for Room { if self.max_participants != 0 { len += 1; } - if self.creation_time != 0 { - len += 1; - } - if !self.turn_password.is_empty() { - len += 1; - } - if !self.enabled_codecs.is_empty() { - len += 1; - } - if !self.metadata.is_empty() { - len += 1; - } - if self.num_participants != 0 { + if self.egress.is_some() { len += 1; } - if self.num_publishers != 0 { + if self.agent.is_some() { len += 1; } - if self.active_recording { + if self.min_playout_delay != 0 { len += 1; } - if self.version.is_some() { + if self.max_playout_delay != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.Room", len)?; - if !self.sid.is_empty() { - struct_ser.serialize_field("sid", &self.sid)?; + if self.sync_streams { + len += 1; } + let mut struct_ser = serializer.serialize_struct("livekit.RoomConfiguration", len)?; if !self.name.is_empty() { struct_ser.serialize_field("name", &self.name)?; } @@ -18030,43 +20527,31 @@ impl serde::Serialize for Room { if self.max_participants != 0 { struct_ser.serialize_field("maxParticipants", &self.max_participants)?; } - if self.creation_time != 0 { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("creationTime", ToString::to_string(&self.creation_time).as_str())?; - } - if !self.turn_password.is_empty() { - struct_ser.serialize_field("turnPassword", &self.turn_password)?; - } - if !self.enabled_codecs.is_empty() { - struct_ser.serialize_field("enabledCodecs", &self.enabled_codecs)?; - } - if !self.metadata.is_empty() { - struct_ser.serialize_field("metadata", &self.metadata)?; + if let Some(v) = self.egress.as_ref() { + struct_ser.serialize_field("egress", v)?; } - if self.num_participants != 0 { - struct_ser.serialize_field("numParticipants", &self.num_participants)?; + if let Some(v) = self.agent.as_ref() { + struct_ser.serialize_field("agent", v)?; } - if self.num_publishers != 0 { - struct_ser.serialize_field("numPublishers", &self.num_publishers)?; + if self.min_playout_delay != 0 { + struct_ser.serialize_field("minPlayoutDelay", &self.min_playout_delay)?; } - if self.active_recording { - struct_ser.serialize_field("activeRecording", &self.active_recording)?; + if self.max_playout_delay != 0 { + struct_ser.serialize_field("maxPlayoutDelay", &self.max_playout_delay)?; } - if let Some(v) = self.version.as_ref() { - struct_ser.serialize_field("version", v)?; + if self.sync_streams { + struct_ser.serialize_field("syncStreams", &self.sync_streams)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for Room { +impl<'de> serde::Deserialize<'de> for RoomConfiguration { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "sid", "name", "empty_timeout", "emptyTimeout", @@ -18074,37 +20559,27 @@ impl<'de> serde::Deserialize<'de> for Room { "departureTimeout", "max_participants", "maxParticipants", - "creation_time", - "creationTime", - "turn_password", - "turnPassword", - "enabled_codecs", - "enabledCodecs", - "metadata", - "num_participants", - "numParticipants", - "num_publishers", - "numPublishers", - "active_recording", - "activeRecording", - "version", + "egress", + "agent", + "min_playout_delay", + "minPlayoutDelay", + "max_playout_delay", + "maxPlayoutDelay", + "sync_streams", + "syncStreams", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Sid, Name, EmptyTimeout, DepartureTimeout, MaxParticipants, - CreationTime, - TurnPassword, - EnabledCodecs, - Metadata, - NumParticipants, - NumPublishers, - ActiveRecording, - Version, + Egress, + Agent, + MinPlayoutDelay, + MaxPlayoutDelay, + SyncStreams, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -18127,19 +20602,15 @@ impl<'de> serde::Deserialize<'de> for Room { E: serde::de::Error, { match value { - "sid" => Ok(GeneratedField::Sid), "name" => Ok(GeneratedField::Name), "emptyTimeout" | "empty_timeout" => Ok(GeneratedField::EmptyTimeout), "departureTimeout" | "departure_timeout" => Ok(GeneratedField::DepartureTimeout), "maxParticipants" | "max_participants" => Ok(GeneratedField::MaxParticipants), - "creationTime" | "creation_time" => Ok(GeneratedField::CreationTime), - "turnPassword" | "turn_password" => Ok(GeneratedField::TurnPassword), - "enabledCodecs" | "enabled_codecs" => Ok(GeneratedField::EnabledCodecs), - "metadata" => Ok(GeneratedField::Metadata), - "numParticipants" | "num_participants" => Ok(GeneratedField::NumParticipants), - "numPublishers" | "num_publishers" => Ok(GeneratedField::NumPublishers), - "activeRecording" | "active_recording" => Ok(GeneratedField::ActiveRecording), - "version" => Ok(GeneratedField::Version), + "egress" => Ok(GeneratedField::Egress), + "agent" => Ok(GeneratedField::Agent), + "minPlayoutDelay" | "min_playout_delay" => Ok(GeneratedField::MinPlayoutDelay), + "maxPlayoutDelay" | "max_playout_delay" => Ok(GeneratedField::MaxPlayoutDelay), + "syncStreams" | "sync_streams" => Ok(GeneratedField::SyncStreams), _ => Ok(GeneratedField::__SkipField__), } } @@ -18149,37 +20620,27 @@ impl<'de> serde::Deserialize<'de> for Room { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Room; + type Value = RoomConfiguration; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.Room") + formatter.write_str("struct livekit.RoomConfiguration") } - 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 sid__ = None; let mut name__ = None; let mut empty_timeout__ = None; let mut departure_timeout__ = None; let mut max_participants__ = None; - let mut creation_time__ = None; - let mut turn_password__ = None; - let mut enabled_codecs__ = None; - let mut metadata__ = None; - let mut num_participants__ = None; - let mut num_publishers__ = None; - let mut active_recording__ = None; - let mut version__ = None; + let mut egress__ = None; + let mut agent__ = None; + let mut min_playout_delay__ = None; + let mut max_playout_delay__ = None; + let mut sync_streams__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Sid => { - if sid__.is_some() { - return Err(serde::de::Error::duplicate_field("sid")); - } - sid__ = Some(map_.next_value()?); - } GeneratedField::Name => { if name__.is_some() { return Err(serde::de::Error::duplicate_field("name")); @@ -18210,181 +20671,62 @@ impl<'de> serde::Deserialize<'de> for Room { Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } - GeneratedField::CreationTime => { - if creation_time__.is_some() { - return Err(serde::de::Error::duplicate_field("creationTime")); - } - creation_time__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::TurnPassword => { - if turn_password__.is_some() { - return Err(serde::de::Error::duplicate_field("turnPassword")); - } - turn_password__ = Some(map_.next_value()?); - } - GeneratedField::EnabledCodecs => { - if enabled_codecs__.is_some() { - return Err(serde::de::Error::duplicate_field("enabledCodecs")); + GeneratedField::Egress => { + if egress__.is_some() { + return Err(serde::de::Error::duplicate_field("egress")); } - enabled_codecs__ = Some(map_.next_value()?); + egress__ = map_.next_value()?; } - GeneratedField::Metadata => { - if metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("metadata")); + GeneratedField::Agent => { + if agent__.is_some() { + return Err(serde::de::Error::duplicate_field("agent")); } - metadata__ = Some(map_.next_value()?); + agent__ = map_.next_value()?; } - GeneratedField::NumParticipants => { - if num_participants__.is_some() { - return Err(serde::de::Error::duplicate_field("numParticipants")); + GeneratedField::MinPlayoutDelay => { + if min_playout_delay__.is_some() { + return Err(serde::de::Error::duplicate_field("minPlayoutDelay")); } - num_participants__ = + min_playout_delay__ = Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } - GeneratedField::NumPublishers => { - if num_publishers__.is_some() { - return Err(serde::de::Error::duplicate_field("numPublishers")); + GeneratedField::MaxPlayoutDelay => { + if max_playout_delay__.is_some() { + return Err(serde::de::Error::duplicate_field("maxPlayoutDelay")); } - num_publishers__ = + max_playout_delay__ = Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::ActiveRecording => { - if active_recording__.is_some() { - return Err(serde::de::Error::duplicate_field("activeRecording")); - } - active_recording__ = Some(map_.next_value()?); - } - GeneratedField::Version => { - if version__.is_some() { - return Err(serde::de::Error::duplicate_field("version")); - } - version__ = map_.next_value()?; - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; - } - } - } - Ok(Room { - sid: sid__.unwrap_or_default(), - name: name__.unwrap_or_default(), - empty_timeout: empty_timeout__.unwrap_or_default(), - departure_timeout: departure_timeout__.unwrap_or_default(), - max_participants: max_participants__.unwrap_or_default(), - creation_time: creation_time__.unwrap_or_default(), - turn_password: turn_password__.unwrap_or_default(), - enabled_codecs: enabled_codecs__.unwrap_or_default(), - metadata: metadata__.unwrap_or_default(), - num_participants: num_participants__.unwrap_or_default(), - num_publishers: num_publishers__.unwrap_or_default(), - active_recording: active_recording__.unwrap_or_default(), - version: version__, - }) - } - } - deserializer.deserialize_struct("livekit.Room", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for RoomAgent { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.dispatches.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("livekit.RoomAgent", len)?; - if !self.dispatches.is_empty() { - struct_ser.serialize_field("dispatches", &self.dispatches)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for RoomAgent { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "dispatches", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Dispatches, - __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 { - "dispatches" => Ok(GeneratedField::Dispatches), - _ => Ok(GeneratedField::__SkipField__), + ; } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RoomAgent; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.RoomAgent") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut dispatches__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Dispatches => { - if dispatches__.is_some() { - return Err(serde::de::Error::duplicate_field("dispatches")); + GeneratedField::SyncStreams => { + if sync_streams__.is_some() { + return Err(serde::de::Error::duplicate_field("syncStreams")); } - dispatches__ = Some(map_.next_value()?); + sync_streams__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(RoomAgent { - dispatches: dispatches__.unwrap_or_default(), + Ok(RoomConfiguration { + name: name__.unwrap_or_default(), + empty_timeout: empty_timeout__.unwrap_or_default(), + departure_timeout: departure_timeout__.unwrap_or_default(), + max_participants: max_participants__.unwrap_or_default(), + egress: egress__, + agent: agent__, + min_playout_delay: min_playout_delay__.unwrap_or_default(), + max_playout_delay: max_playout_delay__.unwrap_or_default(), + sync_streams: sync_streams__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.RoomAgent", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.RoomConfiguration", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for RoomAgentDispatch { +impl serde::Serialize for RoomEgress { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -18392,38 +20734,45 @@ impl serde::Serialize for RoomAgentDispatch { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.agent_name.is_empty() { + if self.room.is_some() { len += 1; } - if !self.metadata.is_empty() { + if self.participant.is_some() { 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)?; + if self.tracks.is_some() { + len += 1; } - if !self.metadata.is_empty() { - struct_ser.serialize_field("metadata", &self.metadata)?; + let mut struct_ser = serializer.serialize_struct("livekit.RoomEgress", len)?; + if let Some(v) = self.room.as_ref() { + struct_ser.serialize_field("room", v)?; + } + if let Some(v) = self.participant.as_ref() { + struct_ser.serialize_field("participant", v)?; + } + if let Some(v) = self.tracks.as_ref() { + struct_ser.serialize_field("tracks", v)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for RoomAgentDispatch { +impl<'de> serde::Deserialize<'de> for RoomEgress { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "agent_name", - "agentName", - "metadata", + "room", + "participant", + "tracks", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - AgentName, - Metadata, + Room, + Participant, + Tracks, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -18446,8 +20795,9 @@ impl<'de> serde::Deserialize<'de> for RoomAgentDispatch { E: serde::de::Error, { match value { - "agentName" | "agent_name" => Ok(GeneratedField::AgentName), - "metadata" => Ok(GeneratedField::Metadata), + "room" => Ok(GeneratedField::Room), + "participant" => Ok(GeneratedField::Participant), + "tracks" => Ok(GeneratedField::Tracks), _ => Ok(GeneratedField::__SkipField__), } } @@ -18457,47 +20807,55 @@ impl<'de> serde::Deserialize<'de> for RoomAgentDispatch { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RoomAgentDispatch; + type Value = RoomEgress; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.RoomAgentDispatch") + formatter.write_str("struct livekit.RoomEgress") } - 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 agent_name__ = None; - let mut metadata__ = None; + let mut room__ = None; + let mut participant__ = None; + let mut tracks__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::AgentName => { - if agent_name__.is_some() { - return Err(serde::de::Error::duplicate_field("agentName")); + GeneratedField::Room => { + if room__.is_some() { + return Err(serde::de::Error::duplicate_field("room")); } - agent_name__ = Some(map_.next_value()?); + room__ = map_.next_value()?; } - GeneratedField::Metadata => { - if metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("metadata")); + GeneratedField::Participant => { + if participant__.is_some() { + return Err(serde::de::Error::duplicate_field("participant")); } - metadata__ = Some(map_.next_value()?); + participant__ = map_.next_value()?; + } + GeneratedField::Tracks => { + if tracks__.is_some() { + return Err(serde::de::Error::duplicate_field("tracks")); + } + tracks__ = map_.next_value()?; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(RoomAgentDispatch { - agent_name: agent_name__.unwrap_or_default(), - metadata: metadata__.unwrap_or_default(), + Ok(RoomEgress { + room: room__, + participant: participant__, + tracks: tracks__, }) } } - deserializer.deserialize_struct("livekit.RoomAgentDispatch", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.RoomEgress", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for RoomCompositeEgressRequest { +impl serde::Serialize for RoomParticipantIdentity { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -18505,142 +20863,37 @@ impl serde::Serialize for RoomCompositeEgressRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.room_name.is_empty() { - len += 1; - } - 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; - } - if !self.file_outputs.is_empty() { - len += 1; - } - if !self.stream_outputs.is_empty() { - len += 1; - } - if !self.segment_outputs.is_empty() { - len += 1; - } - if !self.image_outputs.is_empty() { - len += 1; - } - if self.output.is_some() { + if !self.room.is_empty() { len += 1; } - if self.options.is_some() { + if !self.identity.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.RoomCompositeEgressRequest", len)?; - if !self.room_name.is_empty() { - struct_ser.serialize_field("roomName", &self.room_name)?; - } - 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)?; - } - if !self.file_outputs.is_empty() { - struct_ser.serialize_field("fileOutputs", &self.file_outputs)?; - } - if !self.stream_outputs.is_empty() { - struct_ser.serialize_field("streamOutputs", &self.stream_outputs)?; - } - if !self.segment_outputs.is_empty() { - struct_ser.serialize_field("segmentOutputs", &self.segment_outputs)?; - } - if !self.image_outputs.is_empty() { - struct_ser.serialize_field("imageOutputs", &self.image_outputs)?; - } - if let Some(v) = self.output.as_ref() { - match v { - room_composite_egress_request::Output::File(v) => { - struct_ser.serialize_field("file", v)?; - } - room_composite_egress_request::Output::Stream(v) => { - struct_ser.serialize_field("stream", v)?; - } - room_composite_egress_request::Output::Segments(v) => { - struct_ser.serialize_field("segments", v)?; - } - } + let mut struct_ser = serializer.serialize_struct("livekit.RoomParticipantIdentity", len)?; + if !self.room.is_empty() { + struct_ser.serialize_field("room", &self.room)?; } - if let Some(v) = self.options.as_ref() { - match v { - room_composite_egress_request::Options::Preset(v) => { - let v = EncodingOptionsPreset::try_from(*v) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; - struct_ser.serialize_field("preset", &v)?; - } - room_composite_egress_request::Options::Advanced(v) => { - struct_ser.serialize_field("advanced", v)?; - } - } + if !self.identity.is_empty() { + struct_ser.serialize_field("identity", &self.identity)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for RoomCompositeEgressRequest { +impl<'de> serde::Deserialize<'de> for RoomParticipantIdentity { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "room_name", - "roomName", - "layout", - "audio_only", - "audioOnly", - "video_only", - "videoOnly", - "custom_base_url", - "customBaseUrl", - "file_outputs", - "fileOutputs", - "stream_outputs", - "streamOutputs", - "segment_outputs", - "segmentOutputs", - "image_outputs", - "imageOutputs", - "file", - "stream", - "segments", - "preset", - "advanced", + "room", + "identity", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - RoomName, - Layout, - AudioOnly, - VideoOnly, - CustomBaseUrl, - FileOutputs, - StreamOutputs, - SegmentOutputs, - ImageOutputs, - File, - Stream, - Segments, - Preset, - Advanced, + Room, + Identity, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -18663,20 +20916,8 @@ impl<'de> serde::Deserialize<'de> for RoomCompositeEgressRequest { E: serde::de::Error, { match value { - "roomName" | "room_name" => Ok(GeneratedField::RoomName), - "layout" => Ok(GeneratedField::Layout), - "audioOnly" | "audio_only" => Ok(GeneratedField::AudioOnly), - "videoOnly" | "video_only" => Ok(GeneratedField::VideoOnly), - "customBaseUrl" | "custom_base_url" => Ok(GeneratedField::CustomBaseUrl), - "fileOutputs" | "file_outputs" => Ok(GeneratedField::FileOutputs), - "streamOutputs" | "stream_outputs" => Ok(GeneratedField::StreamOutputs), - "segmentOutputs" | "segment_outputs" => Ok(GeneratedField::SegmentOutputs), - "imageOutputs" | "image_outputs" => Ok(GeneratedField::ImageOutputs), - "file" => Ok(GeneratedField::File), - "stream" => Ok(GeneratedField::Stream), - "segments" => Ok(GeneratedField::Segments), - "preset" => Ok(GeneratedField::Preset), - "advanced" => Ok(GeneratedField::Advanced), + "room" => Ok(GeneratedField::Room), + "identity" => Ok(GeneratedField::Identity), _ => Ok(GeneratedField::__SkipField__), } } @@ -18686,141 +20927,47 @@ impl<'de> serde::Deserialize<'de> for RoomCompositeEgressRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RoomCompositeEgressRequest; + type Value = RoomParticipantIdentity; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.RoomCompositeEgressRequest") + formatter.write_str("struct livekit.RoomParticipantIdentity") } - 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_name__ = None; - let mut layout__ = None; - let mut audio_only__ = None; - let mut video_only__ = None; - let mut custom_base_url__ = None; - let mut file_outputs__ = None; - let mut stream_outputs__ = None; - let mut segment_outputs__ = None; - let mut image_outputs__ = None; - let mut output__ = None; - let mut options__ = None; + let mut room__ = None; + let mut identity__ = 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::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::FileOutputs => { - if file_outputs__.is_some() { - return Err(serde::de::Error::duplicate_field("fileOutputs")); - } - file_outputs__ = Some(map_.next_value()?); - } - GeneratedField::StreamOutputs => { - if stream_outputs__.is_some() { - return Err(serde::de::Error::duplicate_field("streamOutputs")); - } - stream_outputs__ = Some(map_.next_value()?); - } - GeneratedField::SegmentOutputs => { - if segment_outputs__.is_some() { - return Err(serde::de::Error::duplicate_field("segmentOutputs")); - } - segment_outputs__ = Some(map_.next_value()?); - } - GeneratedField::ImageOutputs => { - if image_outputs__.is_some() { - return Err(serde::de::Error::duplicate_field("imageOutputs")); - } - image_outputs__ = Some(map_.next_value()?); - } - GeneratedField::File => { - if output__.is_some() { - return Err(serde::de::Error::duplicate_field("file")); - } - output__ = map_.next_value::<::std::option::Option<_>>()?.map(room_composite_egress_request::Output::File) -; - } - GeneratedField::Stream => { - if output__.is_some() { - return Err(serde::de::Error::duplicate_field("stream")); - } - output__ = map_.next_value::<::std::option::Option<_>>()?.map(room_composite_egress_request::Output::Stream) -; - } - GeneratedField::Segments => { - if output__.is_some() { - return Err(serde::de::Error::duplicate_field("segments")); - } - output__ = map_.next_value::<::std::option::Option<_>>()?.map(room_composite_egress_request::Output::Segments) -; - } - GeneratedField::Preset => { - if options__.is_some() { - return Err(serde::de::Error::duplicate_field("preset")); + GeneratedField::Room => { + if room__.is_some() { + return Err(serde::de::Error::duplicate_field("room")); } - options__ = map_.next_value::<::std::option::Option>()?.map(|x| room_composite_egress_request::Options::Preset(x as i32)); + room__ = Some(map_.next_value()?); } - GeneratedField::Advanced => { - if options__.is_some() { - return Err(serde::de::Error::duplicate_field("advanced")); + GeneratedField::Identity => { + if identity__.is_some() { + return Err(serde::de::Error::duplicate_field("identity")); } - options__ = map_.next_value::<::std::option::Option<_>>()?.map(room_composite_egress_request::Options::Advanced) -; + identity__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(RoomCompositeEgressRequest { - room_name: room_name__.unwrap_or_default(), - 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(), - file_outputs: file_outputs__.unwrap_or_default(), - stream_outputs: stream_outputs__.unwrap_or_default(), - segment_outputs: segment_outputs__.unwrap_or_default(), - image_outputs: image_outputs__.unwrap_or_default(), - output: output__, - options: options__, + Ok(RoomParticipantIdentity { + room: room__.unwrap_or_default(), + identity: identity__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.RoomCompositeEgressRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.RoomParticipantIdentity", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for RoomConfiguration { +impl serde::Serialize for RoomUpdate { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -18828,99 +20975,125 @@ impl serde::Serialize for RoomConfiguration { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.name.is_empty() { - len += 1; - } - if self.empty_timeout != 0 { - len += 1; - } - if self.departure_timeout != 0 { - len += 1; - } - if self.max_participants != 0 { - len += 1; - } - if self.egress.is_some() { - len += 1; - } - if self.agent.is_some() { - len += 1; - } - if self.min_playout_delay != 0 { - len += 1; - } - if self.max_playout_delay != 0 { - len += 1; - } - if self.sync_streams { + if self.room.is_some() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.RoomConfiguration", len)?; - if !self.name.is_empty() { - struct_ser.serialize_field("name", &self.name)?; - } - if self.empty_timeout != 0 { - struct_ser.serialize_field("emptyTimeout", &self.empty_timeout)?; - } - if self.departure_timeout != 0 { - struct_ser.serialize_field("departureTimeout", &self.departure_timeout)?; - } - if self.max_participants != 0 { - struct_ser.serialize_field("maxParticipants", &self.max_participants)?; + let mut struct_ser = serializer.serialize_struct("livekit.RoomUpdate", len)?; + if let Some(v) = self.room.as_ref() { + struct_ser.serialize_field("room", v)?; } - if let Some(v) = self.egress.as_ref() { - struct_ser.serialize_field("egress", v)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for RoomUpdate { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "room", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Room, + __SkipField__, } - if let Some(v) = self.agent.as_ref() { - struct_ser.serialize_field("agent", v)?; + 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), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } } - if self.min_playout_delay != 0 { - struct_ser.serialize_field("minPlayoutDelay", &self.min_playout_delay)?; + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = RoomUpdate; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.RoomUpdate") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut room__ = 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__ = map_.next_value()?; + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(RoomUpdate { + room: room__, + }) + } } - if self.max_playout_delay != 0 { - struct_ser.serialize_field("maxPlayoutDelay", &self.max_playout_delay)?; + deserializer.deserialize_struct("livekit.RoomUpdate", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for RpcAck { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.request_id.is_empty() { + len += 1; } - if self.sync_streams { - struct_ser.serialize_field("syncStreams", &self.sync_streams)?; + let mut struct_ser = serializer.serialize_struct("livekit.RpcAck", len)?; + if !self.request_id.is_empty() { + struct_ser.serialize_field("requestId", &self.request_id)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for RoomConfiguration { +impl<'de> serde::Deserialize<'de> for RpcAck { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "name", - "empty_timeout", - "emptyTimeout", - "departure_timeout", - "departureTimeout", - "max_participants", - "maxParticipants", - "egress", - "agent", - "min_playout_delay", - "minPlayoutDelay", - "max_playout_delay", - "maxPlayoutDelay", - "sync_streams", - "syncStreams", + "request_id", + "requestId", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Name, - EmptyTimeout, - DepartureTimeout, - MaxParticipants, - Egress, - Agent, - MinPlayoutDelay, - MaxPlayoutDelay, - SyncStreams, + RequestId, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -18943,15 +21116,7 @@ impl<'de> serde::Deserialize<'de> for RoomConfiguration { E: serde::de::Error, { match value { - "name" => Ok(GeneratedField::Name), - "emptyTimeout" | "empty_timeout" => Ok(GeneratedField::EmptyTimeout), - "departureTimeout" | "departure_timeout" => Ok(GeneratedField::DepartureTimeout), - "maxParticipants" | "max_participants" => Ok(GeneratedField::MaxParticipants), - "egress" => Ok(GeneratedField::Egress), - "agent" => Ok(GeneratedField::Agent), - "minPlayoutDelay" | "min_playout_delay" => Ok(GeneratedField::MinPlayoutDelay), - "maxPlayoutDelay" | "max_playout_delay" => Ok(GeneratedField::MaxPlayoutDelay), - "syncStreams" | "sync_streams" => Ok(GeneratedField::SyncStreams), + "requestId" | "request_id" => Ok(GeneratedField::RequestId), _ => Ok(GeneratedField::__SkipField__), } } @@ -18961,113 +21126,39 @@ impl<'de> serde::Deserialize<'de> for RoomConfiguration { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RoomConfiguration; + type Value = RpcAck; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.RoomConfiguration") + formatter.write_str("struct livekit.RpcAck") } - 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 name__ = None; - let mut empty_timeout__ = None; - let mut departure_timeout__ = None; - let mut max_participants__ = None; - let mut egress__ = None; - let mut agent__ = None; - let mut min_playout_delay__ = None; - let mut max_playout_delay__ = None; - let mut sync_streams__ = None; + let mut request_id__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); - } - name__ = Some(map_.next_value()?); - } - GeneratedField::EmptyTimeout => { - if empty_timeout__.is_some() { - return Err(serde::de::Error::duplicate_field("emptyTimeout")); - } - empty_timeout__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::DepartureTimeout => { - if departure_timeout__.is_some() { - return Err(serde::de::Error::duplicate_field("departureTimeout")); - } - departure_timeout__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::MaxParticipants => { - if max_participants__.is_some() { - return Err(serde::de::Error::duplicate_field("maxParticipants")); - } - max_participants__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Egress => { - if egress__.is_some() { - return Err(serde::de::Error::duplicate_field("egress")); - } - egress__ = map_.next_value()?; - } - GeneratedField::Agent => { - if agent__.is_some() { - return Err(serde::de::Error::duplicate_field("agent")); - } - agent__ = map_.next_value()?; - } - GeneratedField::MinPlayoutDelay => { - if min_playout_delay__.is_some() { - return Err(serde::de::Error::duplicate_field("minPlayoutDelay")); - } - min_playout_delay__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::MaxPlayoutDelay => { - if max_playout_delay__.is_some() { - return Err(serde::de::Error::duplicate_field("maxPlayoutDelay")); - } - max_playout_delay__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::SyncStreams => { - if sync_streams__.is_some() { - return Err(serde::de::Error::duplicate_field("syncStreams")); + GeneratedField::RequestId => { + if request_id__.is_some() { + return Err(serde::de::Error::duplicate_field("requestId")); } - sync_streams__ = Some(map_.next_value()?); + request_id__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(RoomConfiguration { - name: name__.unwrap_or_default(), - empty_timeout: empty_timeout__.unwrap_or_default(), - departure_timeout: departure_timeout__.unwrap_or_default(), - max_participants: max_participants__.unwrap_or_default(), - egress: egress__, - agent: agent__, - min_playout_delay: min_playout_delay__.unwrap_or_default(), - max_playout_delay: max_playout_delay__.unwrap_or_default(), - sync_streams: sync_streams__.unwrap_or_default(), + Ok(RpcAck { + request_id: request_id__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.RoomConfiguration", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.RpcAck", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for RoomEgress { +impl serde::Serialize for RpcError { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -19075,45 +21166,45 @@ impl serde::Serialize for RoomEgress { { use serde::ser::SerializeStruct; let mut len = 0; - if self.room.is_some() { + if self.code != 0 { len += 1; } - if self.participant.is_some() { + if !self.message.is_empty() { len += 1; } - if self.tracks.is_some() { + if !self.data.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.RoomEgress", len)?; - if let Some(v) = self.room.as_ref() { - struct_ser.serialize_field("room", v)?; + let mut struct_ser = serializer.serialize_struct("livekit.RpcError", len)?; + if self.code != 0 { + struct_ser.serialize_field("code", &self.code)?; } - if let Some(v) = self.participant.as_ref() { - struct_ser.serialize_field("participant", v)?; + if !self.message.is_empty() { + struct_ser.serialize_field("message", &self.message)?; } - if let Some(v) = self.tracks.as_ref() { - struct_ser.serialize_field("tracks", v)?; + if !self.data.is_empty() { + struct_ser.serialize_field("data", &self.data)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for RoomEgress { +impl<'de> serde::Deserialize<'de> for RpcError { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "room", - "participant", - "tracks", + "code", + "message", + "data", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Room, - Participant, - Tracks, + Code, + Message, + Data, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -19136,9 +21227,9 @@ impl<'de> serde::Deserialize<'de> for RoomEgress { E: serde::de::Error, { match value { - "room" => Ok(GeneratedField::Room), - "participant" => Ok(GeneratedField::Participant), - "tracks" => Ok(GeneratedField::Tracks), + "code" => Ok(GeneratedField::Code), + "message" => Ok(GeneratedField::Message), + "data" => Ok(GeneratedField::Data), _ => Ok(GeneratedField::__SkipField__), } } @@ -19148,55 +21239,57 @@ impl<'de> serde::Deserialize<'de> for RoomEgress { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RoomEgress; + type Value = RpcError; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.RoomEgress") + formatter.write_str("struct livekit.RpcError") } - 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 participant__ = None; - let mut tracks__ = None; + let mut code__ = None; + let mut message__ = None; + let mut data__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Room => { - if room__.is_some() { - return Err(serde::de::Error::duplicate_field("room")); + GeneratedField::Code => { + if code__.is_some() { + return Err(serde::de::Error::duplicate_field("code")); } - room__ = map_.next_value()?; + code__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } - GeneratedField::Participant => { - if participant__.is_some() { - return Err(serde::de::Error::duplicate_field("participant")); + GeneratedField::Message => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("message")); } - participant__ = map_.next_value()?; + message__ = Some(map_.next_value()?); } - GeneratedField::Tracks => { - if tracks__.is_some() { - return Err(serde::de::Error::duplicate_field("tracks")); + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); } - tracks__ = map_.next_value()?; + data__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(RoomEgress { - room: room__, - participant: participant__, - tracks: tracks__, + Ok(RpcError { + code: code__.unwrap_or_default(), + message: message__.unwrap_or_default(), + data: data__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.RoomEgress", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.RpcError", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for RoomParticipantIdentity { +impl serde::Serialize for RpcRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -19204,37 +21297,62 @@ impl serde::Serialize for RoomParticipantIdentity { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.room.is_empty() { + if !self.id.is_empty() { len += 1; } - if !self.identity.is_empty() { + if !self.method.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.RoomParticipantIdentity", len)?; - if !self.room.is_empty() { - struct_ser.serialize_field("room", &self.room)?; + if !self.payload.is_empty() { + len += 1; + } + if self.response_timeout_ms != 0 { + len += 1; + } + if self.version != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.RpcRequest", len)?; + if !self.id.is_empty() { + struct_ser.serialize_field("id", &self.id)?; + } + 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.identity.is_empty() { - struct_ser.serialize_field("identity", &self.identity)?; + if self.version != 0 { + struct_ser.serialize_field("version", &self.version)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for RoomParticipantIdentity { +impl<'de> serde::Deserialize<'de> for RpcRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "room", - "identity", + "id", + "method", + "payload", + "response_timeout_ms", + "responseTimeoutMs", + "version", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Room, - Identity, + Id, + Method, + Payload, + ResponseTimeoutMs, + Version, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -19257,8 +21375,11 @@ impl<'de> serde::Deserialize<'de> for RoomParticipantIdentity { E: serde::de::Error, { match value { - "room" => Ok(GeneratedField::Room), - "identity" => Ok(GeneratedField::Identity), + "id" => Ok(GeneratedField::Id), + "method" => Ok(GeneratedField::Method), + "payload" => Ok(GeneratedField::Payload), + "responseTimeoutMs" | "response_timeout_ms" => Ok(GeneratedField::ResponseTimeoutMs), + "version" => Ok(GeneratedField::Version), _ => Ok(GeneratedField::__SkipField__), } } @@ -19268,47 +21389,75 @@ impl<'de> serde::Deserialize<'de> for RoomParticipantIdentity { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RoomParticipantIdentity; + type Value = RpcRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.RoomParticipantIdentity") + formatter.write_str("struct livekit.RpcRequest") } - 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 identity__ = None; + let mut id__ = None; + let mut method__ = None; + let mut payload__ = None; + let mut response_timeout_ms__ = None; + let mut version__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Room => { - if room__.is_some() { - return Err(serde::de::Error::duplicate_field("room")); + GeneratedField::Id => { + if id__.is_some() { + return Err(serde::de::Error::duplicate_field("id")); } - room__ = Some(map_.next_value()?); + id__ = Some(map_.next_value()?); } - GeneratedField::Identity => { - if identity__.is_some() { - return Err(serde::de::Error::duplicate_field("identity")); + GeneratedField::Method => { + if method__.is_some() { + return Err(serde::de::Error::duplicate_field("method")); } - identity__ = Some(map_.next_value()?); + 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::Version => { + if version__.is_some() { + return Err(serde::de::Error::duplicate_field("version")); + } + version__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(RoomParticipantIdentity { - room: room__.unwrap_or_default(), - identity: identity__.unwrap_or_default(), + Ok(RpcRequest { + id: id__.unwrap_or_default(), + method: method__.unwrap_or_default(), + payload: payload__.unwrap_or_default(), + response_timeout_ms: response_timeout_ms__.unwrap_or_default(), + version: version__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.RoomParticipantIdentity", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.RpcRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for RoomUpdate { +impl serde::Serialize for RpcResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -19316,29 +21465,47 @@ impl serde::Serialize for RoomUpdate { { use serde::ser::SerializeStruct; let mut len = 0; - if self.room.is_some() { + if !self.request_id.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.RoomUpdate", len)?; - if let Some(v) = self.room.as_ref() { - struct_ser.serialize_field("room", v)?; + if self.value.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.RpcResponse", len)?; + if !self.request_id.is_empty() { + struct_ser.serialize_field("requestId", &self.request_id)?; + } + if let Some(v) = self.value.as_ref() { + match v { + rpc_response::Value::Payload(v) => { + struct_ser.serialize_field("payload", v)?; + } + rpc_response::Value::Error(v) => { + struct_ser.serialize_field("error", v)?; + } + } } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for RoomUpdate { +impl<'de> serde::Deserialize<'de> for RpcResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "room", + "request_id", + "requestId", + "payload", + "error", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Room, + RequestId, + Payload, + Error, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -19361,7 +21528,9 @@ impl<'de> serde::Deserialize<'de> for RoomUpdate { E: serde::de::Error, { match value { - "room" => Ok(GeneratedField::Room), + "requestId" | "request_id" => Ok(GeneratedField::RequestId), + "payload" => Ok(GeneratedField::Payload), + "error" => Ok(GeneratedField::Error), _ => Ok(GeneratedField::__SkipField__), } } @@ -19371,36 +21540,51 @@ impl<'de> serde::Deserialize<'de> for RoomUpdate { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RoomUpdate; + type Value = RpcResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.RoomUpdate") + formatter.write_str("struct livekit.RpcResponse") } - 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 request_id__ = None; + let mut value__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Room => { - if room__.is_some() { - return Err(serde::de::Error::duplicate_field("room")); + GeneratedField::RequestId => { + if request_id__.is_some() { + return Err(serde::de::Error::duplicate_field("requestId")); } - room__ = map_.next_value()?; + request_id__ = Some(map_.next_value()?); + } + GeneratedField::Payload => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("payload")); + } + value__ = map_.next_value::<::std::option::Option<_>>()?.map(rpc_response::Value::Payload); + } + GeneratedField::Error => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("error")); + } + value__ = map_.next_value::<::std::option::Option<_>>()?.map(rpc_response::Value::Error) +; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(RoomUpdate { - room: room__, + Ok(RpcResponse { + request_id: request_id__.unwrap_or_default(), + value: value__, }) } } - deserializer.deserialize_struct("livekit.RoomUpdate", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.RpcResponse", FIELDS, GeneratedVisitor) } } impl serde::Serialize for S3Upload { @@ -19694,6 +21878,9 @@ impl serde::Serialize for SipDispatchRule { sip_dispatch_rule::Rule::DispatchRuleIndividual(v) => { struct_ser.serialize_field("dispatchRuleIndividual", v)?; } + sip_dispatch_rule::Rule::DispatchRuleCallee(v) => { + struct_ser.serialize_field("dispatchRuleCallee", v)?; + } } } struct_ser.end() @@ -19710,12 +21897,15 @@ impl<'de> serde::Deserialize<'de> for SipDispatchRule { "dispatchRuleDirect", "dispatch_rule_individual", "dispatchRuleIndividual", + "dispatch_rule_callee", + "dispatchRuleCallee", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { DispatchRuleDirect, DispatchRuleIndividual, + DispatchRuleCallee, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -19740,6 +21930,7 @@ impl<'de> serde::Deserialize<'de> for SipDispatchRule { match value { "dispatchRuleDirect" | "dispatch_rule_direct" => Ok(GeneratedField::DispatchRuleDirect), "dispatchRuleIndividual" | "dispatch_rule_individual" => Ok(GeneratedField::DispatchRuleIndividual), + "dispatchRuleCallee" | "dispatch_rule_callee" => Ok(GeneratedField::DispatchRuleCallee), _ => Ok(GeneratedField::__SkipField__), } } @@ -19774,6 +21965,13 @@ impl<'de> serde::Deserialize<'de> for SipDispatchRule { return Err(serde::de::Error::duplicate_field("dispatchRuleIndividual")); } rule__ = map_.next_value::<::std::option::Option<_>>()?.map(sip_dispatch_rule::Rule::DispatchRuleIndividual) +; + } + GeneratedField::DispatchRuleCallee => { + if rule__.is_some() { + return Err(serde::de::Error::duplicate_field("dispatchRuleCallee")); + } + rule__ = map_.next_value::<::std::option::Option<_>>()?.map(sip_dispatch_rule::Rule::DispatchRuleCallee) ; } GeneratedField::__SkipField__ => { @@ -19789,6 +21987,136 @@ impl<'de> serde::Deserialize<'de> for SipDispatchRule { deserializer.deserialize_struct("livekit.SIPDispatchRule", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for SipDispatchRuleCallee { + #[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_prefix.is_empty() { + len += 1; + } + if !self.pin.is_empty() { + len += 1; + } + if self.randomize { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.SIPDispatchRuleCallee", len)?; + if !self.room_prefix.is_empty() { + struct_ser.serialize_field("roomPrefix", &self.room_prefix)?; + } + if !self.pin.is_empty() { + struct_ser.serialize_field("pin", &self.pin)?; + } + if self.randomize { + struct_ser.serialize_field("randomize", &self.randomize)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SipDispatchRuleCallee { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "room_prefix", + "roomPrefix", + "pin", + "randomize", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + RoomPrefix, + Pin, + Randomize, + __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 { + "roomPrefix" | "room_prefix" => Ok(GeneratedField::RoomPrefix), + "pin" => Ok(GeneratedField::Pin), + "randomize" => Ok(GeneratedField::Randomize), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SipDispatchRuleCallee; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.SIPDispatchRuleCallee") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut room_prefix__ = None; + let mut pin__ = None; + let mut randomize__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::RoomPrefix => { + if room_prefix__.is_some() { + return Err(serde::de::Error::duplicate_field("roomPrefix")); + } + room_prefix__ = Some(map_.next_value()?); + } + GeneratedField::Pin => { + if pin__.is_some() { + return Err(serde::de::Error::duplicate_field("pin")); + } + pin__ = Some(map_.next_value()?); + } + GeneratedField::Randomize => { + if randomize__.is_some() { + return Err(serde::de::Error::duplicate_field("randomize")); + } + randomize__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(SipDispatchRuleCallee { + room_prefix: room_prefix__.unwrap_or_default(), + pin: pin__.unwrap_or_default(), + randomize: randomize__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.SIPDispatchRuleCallee", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for SipDispatchRuleDirect { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -20267,6 +22595,12 @@ impl serde::Serialize for SipInboundTrunkInfo { if !self.auth_password.is_empty() { len += 1; } + if !self.headers.is_empty() { + len += 1; + } + if !self.headers_to_attributes.is_empty() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("livekit.SIPInboundTrunkInfo", len)?; if !self.sip_trunk_id.is_empty() { struct_ser.serialize_field("sipTrunkId", &self.sip_trunk_id)?; @@ -20292,6 +22626,12 @@ impl serde::Serialize for SipInboundTrunkInfo { if !self.auth_password.is_empty() { struct_ser.serialize_field("authPassword", &self.auth_password)?; } + if !self.headers.is_empty() { + struct_ser.serialize_field("headers", &self.headers)?; + } + if !self.headers_to_attributes.is_empty() { + struct_ser.serialize_field("headersToAttributes", &self.headers_to_attributes)?; + } struct_ser.end() } } @@ -20315,6 +22655,9 @@ impl<'de> serde::Deserialize<'de> for SipInboundTrunkInfo { "authUsername", "auth_password", "authPassword", + "headers", + "headers_to_attributes", + "headersToAttributes", ]; #[allow(clippy::enum_variant_names)] @@ -20327,6 +22670,8 @@ impl<'de> serde::Deserialize<'de> for SipInboundTrunkInfo { AllowedNumbers, AuthUsername, AuthPassword, + Headers, + HeadersToAttributes, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -20357,6 +22702,8 @@ impl<'de> serde::Deserialize<'de> for SipInboundTrunkInfo { "allowedNumbers" | "allowed_numbers" => Ok(GeneratedField::AllowedNumbers), "authUsername" | "auth_username" => Ok(GeneratedField::AuthUsername), "authPassword" | "auth_password" => Ok(GeneratedField::AuthPassword), + "headers" => Ok(GeneratedField::Headers), + "headersToAttributes" | "headers_to_attributes" => Ok(GeneratedField::HeadersToAttributes), _ => Ok(GeneratedField::__SkipField__), } } @@ -20384,6 +22731,8 @@ impl<'de> serde::Deserialize<'de> for SipInboundTrunkInfo { let mut allowed_numbers__ = None; let mut auth_username__ = None; let mut auth_password__ = None; + let mut headers__ = None; + let mut headers_to_attributes__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::SipTrunkId => { @@ -20434,6 +22783,22 @@ impl<'de> serde::Deserialize<'de> for SipInboundTrunkInfo { } auth_password__ = Some(map_.next_value()?); } + GeneratedField::Headers => { + if headers__.is_some() { + return Err(serde::de::Error::duplicate_field("headers")); + } + headers__ = Some( + map_.next_value::>()? + ); + } + GeneratedField::HeadersToAttributes => { + if headers_to_attributes__.is_some() { + return Err(serde::de::Error::duplicate_field("headersToAttributes")); + } + headers_to_attributes__ = Some( + map_.next_value::>()? + ); + } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } @@ -20448,6 +22813,8 @@ impl<'de> serde::Deserialize<'de> for SipInboundTrunkInfo { allowed_numbers: allowed_numbers__.unwrap_or_default(), auth_username: auth_username__.unwrap_or_default(), auth_password: auth_password__.unwrap_or_default(), + headers: headers__.unwrap_or_default(), + headers_to_attributes: headers_to_attributes__.unwrap_or_default(), }) } } @@ -20480,10 +22847,16 @@ impl serde::Serialize for SipOutboundTrunkInfo { if !self.numbers.is_empty() { len += 1; } - if !self.auth_username.is_empty() { + if !self.auth_username.is_empty() { + len += 1; + } + if !self.auth_password.is_empty() { + len += 1; + } + if !self.headers.is_empty() { len += 1; } - if !self.auth_password.is_empty() { + if !self.headers_to_attributes.is_empty() { len += 1; } let mut struct_ser = serializer.serialize_struct("livekit.SIPOutboundTrunkInfo", len)?; @@ -20513,6 +22886,12 @@ impl serde::Serialize for SipOutboundTrunkInfo { if !self.auth_password.is_empty() { struct_ser.serialize_field("authPassword", &self.auth_password)?; } + if !self.headers.is_empty() { + struct_ser.serialize_field("headers", &self.headers)?; + } + if !self.headers_to_attributes.is_empty() { + struct_ser.serialize_field("headersToAttributes", &self.headers_to_attributes)?; + } struct_ser.end() } } @@ -20534,6 +22913,9 @@ impl<'de> serde::Deserialize<'de> for SipOutboundTrunkInfo { "authUsername", "auth_password", "authPassword", + "headers", + "headers_to_attributes", + "headersToAttributes", ]; #[allow(clippy::enum_variant_names)] @@ -20546,6 +22928,8 @@ impl<'de> serde::Deserialize<'de> for SipOutboundTrunkInfo { Numbers, AuthUsername, AuthPassword, + Headers, + HeadersToAttributes, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -20576,6 +22960,8 @@ impl<'de> serde::Deserialize<'de> for SipOutboundTrunkInfo { "numbers" => Ok(GeneratedField::Numbers), "authUsername" | "auth_username" => Ok(GeneratedField::AuthUsername), "authPassword" | "auth_password" => Ok(GeneratedField::AuthPassword), + "headers" => Ok(GeneratedField::Headers), + "headersToAttributes" | "headers_to_attributes" => Ok(GeneratedField::HeadersToAttributes), _ => Ok(GeneratedField::__SkipField__), } } @@ -20603,6 +22989,8 @@ impl<'de> serde::Deserialize<'de> for SipOutboundTrunkInfo { let mut numbers__ = None; let mut auth_username__ = None; let mut auth_password__ = None; + let mut headers__ = None; + let mut headers_to_attributes__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::SipTrunkId => { @@ -20653,6 +23041,22 @@ impl<'de> serde::Deserialize<'de> for SipOutboundTrunkInfo { } auth_password__ = Some(map_.next_value()?); } + GeneratedField::Headers => { + if headers__.is_some() { + return Err(serde::de::Error::duplicate_field("headers")); + } + headers__ = Some( + map_.next_value::>()? + ); + } + GeneratedField::HeadersToAttributes => { + if headers_to_attributes__.is_some() { + return Err(serde::de::Error::duplicate_field("headersToAttributes")); + } + headers_to_attributes__ = Some( + map_.next_value::>()? + ); + } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } @@ -20667,6 +23071,8 @@ impl<'de> serde::Deserialize<'de> for SipOutboundTrunkInfo { numbers: numbers__.unwrap_or_default(), auth_username: auth_username__.unwrap_or_default(), auth_password: auth_password__.unwrap_or_default(), + headers: headers__.unwrap_or_default(), + headers_to_attributes: headers_to_attributes__.unwrap_or_default(), }) } } @@ -26411,6 +28817,179 @@ impl<'de> serde::Deserialize<'de> for SyncState { deserializer.deserialize_struct("livekit.SyncState", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for TimeSeriesMetric { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.label != 0 { + len += 1; + } + if self.participant_identity != 0 { + len += 1; + } + if self.track_sid != 0 { + len += 1; + } + if !self.samples.is_empty() { + len += 1; + } + if self.rid != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.TimeSeriesMetric", len)?; + if self.label != 0 { + struct_ser.serialize_field("label", &self.label)?; + } + if self.participant_identity != 0 { + struct_ser.serialize_field("participantIdentity", &self.participant_identity)?; + } + if self.track_sid != 0 { + struct_ser.serialize_field("trackSid", &self.track_sid)?; + } + if !self.samples.is_empty() { + struct_ser.serialize_field("samples", &self.samples)?; + } + if self.rid != 0 { + struct_ser.serialize_field("rid", &self.rid)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for TimeSeriesMetric { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "label", + "participant_identity", + "participantIdentity", + "track_sid", + "trackSid", + "samples", + "rid", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Label, + ParticipantIdentity, + TrackSid, + Samples, + Rid, + __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 { + "label" => Ok(GeneratedField::Label), + "participantIdentity" | "participant_identity" => Ok(GeneratedField::ParticipantIdentity), + "trackSid" | "track_sid" => Ok(GeneratedField::TrackSid), + "samples" => Ok(GeneratedField::Samples), + "rid" => Ok(GeneratedField::Rid), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = TimeSeriesMetric; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.TimeSeriesMetric") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut label__ = None; + let mut participant_identity__ = None; + let mut track_sid__ = None; + let mut samples__ = None; + let mut rid__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Label => { + if label__.is_some() { + return Err(serde::de::Error::duplicate_field("label")); + } + label__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::ParticipantIdentity => { + if participant_identity__.is_some() { + return Err(serde::de::Error::duplicate_field("participantIdentity")); + } + participant_identity__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::TrackSid => { + if track_sid__.is_some() { + return Err(serde::de::Error::duplicate_field("trackSid")); + } + track_sid__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Samples => { + if samples__.is_some() { + return Err(serde::de::Error::duplicate_field("samples")); + } + samples__ = Some(map_.next_value()?); + } + GeneratedField::Rid => { + if rid__.is_some() { + return Err(serde::de::Error::duplicate_field("rid")); + } + rid__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(TimeSeriesMetric { + label: label__.unwrap_or_default(), + participant_identity: participant_identity__.unwrap_or_default(), + track_sid: track_sid__.unwrap_or_default(), + samples: samples__.unwrap_or_default(), + rid: rid__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.TimeSeriesMetric", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for TimedVersion { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -28315,6 +30894,138 @@ impl<'de> serde::Deserialize<'de> for TranscriptionSegment { deserializer.deserialize_struct("livekit.TranscriptionSegment", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for TransferSipParticipantRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.participant_identity.is_empty() { + len += 1; + } + if !self.room_name.is_empty() { + len += 1; + } + if !self.transfer_to.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.TransferSIPParticipantRequest", len)?; + if !self.participant_identity.is_empty() { + struct_ser.serialize_field("participantIdentity", &self.participant_identity)?; + } + if !self.room_name.is_empty() { + struct_ser.serialize_field("roomName", &self.room_name)?; + } + if !self.transfer_to.is_empty() { + struct_ser.serialize_field("transferTo", &self.transfer_to)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for TransferSipParticipantRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "participant_identity", + "participantIdentity", + "room_name", + "roomName", + "transfer_to", + "transferTo", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ParticipantIdentity, + RoomName, + TransferTo, + __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 { + "participantIdentity" | "participant_identity" => Ok(GeneratedField::ParticipantIdentity), + "roomName" | "room_name" => Ok(GeneratedField::RoomName), + "transferTo" | "transfer_to" => Ok(GeneratedField::TransferTo), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = TransferSipParticipantRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.TransferSIPParticipantRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut participant_identity__ = None; + let mut room_name__ = None; + let mut transfer_to__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ParticipantIdentity => { + if participant_identity__.is_some() { + return Err(serde::de::Error::duplicate_field("participantIdentity")); + } + participant_identity__ = Some(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::TransferTo => { + if transfer_to__.is_some() { + return Err(serde::de::Error::duplicate_field("transferTo")); + } + transfer_to__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(TransferSipParticipantRequest { + participant_identity: participant_identity__.unwrap_or_default(), + room_name: room_name__.unwrap_or_default(), + transfer_to: transfer_to__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.TransferSIPParticipantRequest", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for TrickleRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result diff --git a/livekit/src/rtc_engine/rtc_session.rs b/livekit/src/rtc_engine/rtc_session.rs index 16dcf4e6d..100ef8390 100644 --- a/livekit/src/rtc_engine/rtc_session.rs +++ b/livekit/src/rtc_engine/rtc_session.rs @@ -657,6 +657,7 @@ impl SessionInner { segments, }); } + _ => {} } } } diff --git a/soxr-sys/src/lib.rs b/soxr-sys/src/lib.rs index e8f775907..545f21c78 100644 --- a/soxr-sys/src/lib.rs +++ b/soxr-sys/src/lib.rs @@ -6,6 +6,8 @@ include!("soxr.rs"); #[cfg(test)] mod tests { use super::*; + use std::fs::File; + use std::io::{Read, Seek, SeekFrom}; #[test] fn it_works() { @@ -24,14 +26,40 @@ mod tests { use hound::{WavReader, WavSpec, WavWriter}; - let input_wav_path = "input.wav"; - let output_wav_path = "output.wav"; + let input_wav_path = "test-input.wav"; + let output_wav_path = "test-output.wav"; + + let input_spec = WavSpec { + channels: 1, + sample_rate: 44100, + bits_per_sample: 16, + sample_format: hound::SampleFormat::Int, + }; + + let output_spec = WavSpec { + channels: 1, + sample_rate: 24000, + bits_per_sample: 16, + sample_format: hound::SampleFormat::Int, + }; + + let input_duration: u32 = 3; // 3 second of audio + + let mut writer = WavWriter::create(input_wav_path, input_spec) + .expect("Failed to create test input WAV file"); + for t in (0..input_spec.sample_rate * input_duration) + .map(|x| x as f32 / input_spec.sample_rate as f32) + { + let a4note = 440.0; // 440Hz = A4 + let sample = (t * a4note * 2.0 * std::f32::consts::PI).sin(); + let amplitude = i16::MAX as f32; + writer.write_sample((sample * amplitude) as i16).expect("Failed to write sample"); + } + writer.finalize().expect("Failed to finalize test input WAV file"); let mut reader = WavReader::open(input_wav_path).expect("Failed to open input WAV file"); let wav_spec = reader.spec(); - let input_rate = wav_spec.sample_rate as f64; - let output_rate = 24000.0; let num_channels = wav_spec.channels as u32; @@ -39,8 +67,9 @@ mod tests { reader.samples::().map(|s| s.expect("Failed to read sample")).collect(); let buf_total_len = samples.len(); - let olen = - ((output_rate * buf_total_len as f64) / (input_rate + output_rate) + 0.5) as usize; + let olen = ((output_spec.sample_rate as f64 * buf_total_len as f64) + / (input_spec.sample_rate as f64 + output_spec.sample_rate as f64) + + 0.5) as usize; let ilen = buf_total_len - olen; let mut obuf = vec![0i16; olen]; @@ -51,8 +80,8 @@ mod tests { let mut error: soxr_error_t = ptr::null(); let io_spec = soxr_io_spec { - itype: SOXR_INT16_I as u32, - otype: SOXR_INT16_I as u32, + itype: soxr_datatype_t_SOXR_INT16_I as u32, + otype: soxr_datatype_t_SOXR_INT16_I as u32, scale: 1.0, e: ptr::null_mut(), flags: 0, @@ -60,8 +89,8 @@ mod tests { let soxr = unsafe { soxr_create( - input_rate, - output_rate, + input_spec.sample_rate as f64, + output_spec.sample_rate as f64, num_channels, &mut error, &io_spec, @@ -121,15 +150,8 @@ mod tests { need_input = (odone < olen) && ibuf.is_some(); } - let spec = WavSpec { - channels: wav_spec.channels, - sample_rate: output_rate as u32, - bits_per_sample: 16, - sample_format: hound::SampleFormat::Int, - }; - - let mut writer = - WavWriter::create(output_wav_path, spec).expect("Failed to create output WAV file"); + let mut writer = WavWriter::create(output_wav_path, output_spec) + .expect("Failed to create output WAV file"); for sample in output_samples { writer.write_sample(sample).expect("Failed to write sample"); @@ -146,5 +168,8 @@ mod tests { unsafe { soxr_delete(soxr); } + + std::fs::remove_file(input_wav_path).expect("Failed to remove test input file"); + std::fs::remove_file(output_wav_path).expect("Failed to remove test output file"); } }