diff --git a/livekit-protocol/src/livekit.rs b/livekit-protocol/src/livekit.rs index c1a0fd65..bc52a754 100644 --- a/livekit-protocol/src/livekit.rs +++ b/livekit-protocol/src/livekit.rs @@ -1833,6 +1833,8 @@ pub struct SegmentsInfo { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ImagesInfo { + #[prost(string, tag="4")] + pub filename_prefix: ::prost::alloc::string::String, #[prost(int64, tag="1")] pub image_count: i64, #[prost(int64, tag="2")] @@ -2185,7 +2187,7 @@ pub mod signal_request { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SignalResponse { - #[prost(oneof="signal_response::Message", tags="1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21")] + #[prost(oneof="signal_response::Message", tags="1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23")] pub message: ::core::option::Option, } /// Nested message and enum types in `SignalResponse`. @@ -2256,6 +2258,12 @@ pub mod signal_response { /// Subscription response, client should not expect any media from this subscription if it fails #[prost(message, tag="21")] SubscriptionResponse(super::SubscriptionResponse), + /// Errors relating to user inititated requests that carry a `request_id` + #[prost(message, tag="22")] + ErrorResponse(super::ErrorResponse), + /// notify to the publisher when a published track has been subscribed for the first time + #[prost(message, tag="23")] + TrackSubscribed(super::TrackSubscribed), } } #[allow(clippy::derive_partial_eq_without_eq)] @@ -2525,6 +2533,8 @@ pub struct UpdateParticipantMetadata { /// to delete attributes, set the value to an empty string #[prost(map="string, string", tag="3")] pub attributes: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, + #[prost(uint32, tag="4")] + pub request_id: u32, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -2748,6 +2758,57 @@ pub struct SubscriptionResponse { #[prost(enumeration="SubscriptionError", tag="2")] pub err: i32, } +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ErrorResponse { + #[prost(uint32, tag="1")] + pub request_id: u32, + #[prost(enumeration="error_response::Reason", tag="2")] + pub reason: i32, + #[prost(string, tag="3")] + pub message: ::prost::alloc::string::String, +} +/// Nested message and enum types in `ErrorResponse`. +pub mod error_response { + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + pub enum Reason { + Unknown = 0, + NotFound = 1, + NotAllowed = 2, + LimitExceeded = 3, + } + impl Reason { + /// 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 { + Reason::Unknown => "UNKNOWN", + Reason::NotFound => "NOT_FOUND", + Reason::NotAllowed => "NOT_ALLOWED", + Reason::LimitExceeded => "LIMIT_EXCEEDED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "UNKNOWN" => Some(Self::Unknown), + "NOT_FOUND" => Some(Self::NotFound), + "NOT_ALLOWED" => Some(Self::NotAllowed), + "LIMIT_EXCEEDED" => Some(Self::LimitExceeded), + _ => None, + } + } + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TrackSubscribed { + #[prost(string, tag="1")] + pub track_sid: ::prost::alloc::string::String, +} #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum SignalTarget { @@ -2831,10 +2892,379 @@ impl CandidateProtocol { } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateAgentDispatchRequest { + #[prost(string, tag="1")] + pub agent_name: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub room: ::prost::alloc::string::String, + #[prost(string, tag="3")] + pub metadata: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RoomAgentDispatch { + #[prost(string, tag="1")] + pub agent_name: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub metadata: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteAgentDispatchRequest { + #[prost(string, tag="1")] + pub dispatch_id: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListAgentDispatchRequesst { + /// if set, only the dispatch whose id is given will be returned + #[prost(string, tag="1")] + pub dispatch_id: ::prost::alloc::string::String, + /// name of the room to list agents for. Must be set. + #[prost(string, tag="2")] + pub room: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListAgentDispatchResponse { + #[prost(message, repeated, tag="1")] + pub agent_dispatches: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AgentDispatch { + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub agent_name: ::prost::alloc::string::String, + #[prost(string, tag="3")] + pub room: ::prost::alloc::string::String, + #[prost(string, tag="4")] + pub metadata: ::prost::alloc::string::String, + #[prost(message, optional, tag="5")] + pub state: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AgentDispatchState { + /// For dispatches of tyoe JT_ROOM, there will be at most 1 job. + /// For dispatches of type JT_PUBLISHER, there will be 1 per publisher. + #[prost(message, repeated, tag="1")] + pub jobs: ::prost::alloc::vec::Vec, + #[prost(int64, tag="2")] + pub created_at: i64, + #[prost(int64, tag="3")] + pub deleted_at: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Job { + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, + #[prost(enumeration="JobType", tag="2")] + pub r#type: i32, + #[prost(message, optional, tag="3")] + pub room: ::core::option::Option, + #[prost(message, optional, tag="4")] + pub participant: ::core::option::Option, + #[deprecated] + #[prost(string, tag="5")] + pub namespace: ::prost::alloc::string::String, + #[prost(string, tag="6")] + pub metadata: ::prost::alloc::string::String, + #[prost(string, tag="7")] + pub agent_name: ::prost::alloc::string::String, + #[prost(message, optional, tag="8")] + pub state: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct JobState { + #[prost(enumeration="JobStatus", tag="1")] + pub status: i32, + #[prost(string, tag="2")] + pub error: ::prost::alloc::string::String, + #[prost(int64, tag="3")] + pub started_at: i64, + #[prost(int64, tag="4")] + pub ended_at: i64, + #[prost(int64, tag="5")] + pub updated_at: i64, +} +/// from Worker to Server +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct WorkerMessage { + #[prost(oneof="worker_message::Message", tags="1, 2, 3, 4, 5, 6, 7")] + pub message: ::core::option::Option, +} +/// Nested message and enum types in `WorkerMessage`. +pub mod worker_message { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Message { + /// agent workers need to register themselves with the server first + #[prost(message, tag="1")] + Register(super::RegisterWorkerRequest), + /// worker confirms to server that it's available for a job, or declines it + #[prost(message, tag="2")] + Availability(super::AvailabilityResponse), + /// worker can update its status to the server, including taking itself out of the pool + #[prost(message, tag="3")] + UpdateWorker(super::UpdateWorkerStatus), + /// job can send status updates to the server, useful for tracking progress + #[prost(message, tag="4")] + UpdateJob(super::UpdateJobStatus), + #[prost(message, tag="5")] + Ping(super::WorkerPing), + #[prost(message, tag="6")] + SimulateJob(super::SimulateJobRequest), + #[prost(message, tag="7")] + MigrateJob(super::MigrateJobRequest), + } +} +/// from Server to Worker +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ServerMessage { + #[prost(oneof="server_message::Message", tags="1, 2, 3, 5, 4")] + pub message: ::core::option::Option, +} +/// Nested message and enum types in `ServerMessage`. +pub mod server_message { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Message { + /// server confirms the registration, from this moment on, the worker is considered active + #[prost(message, tag="1")] + Register(super::RegisterWorkerResponse), + /// server asks worker to confirm availability for a job + #[prost(message, tag="2")] + Availability(super::AvailabilityRequest), + #[prost(message, tag="3")] + Assignment(super::JobAssignment), + #[prost(message, tag="5")] + Termination(super::JobTermination), + #[prost(message, tag="4")] + Pong(super::WorkerPong), + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SimulateJobRequest { + #[prost(enumeration="JobType", tag="1")] + pub r#type: i32, + #[prost(message, optional, tag="2")] + pub room: ::core::option::Option, + #[prost(message, optional, tag="3")] + pub participant: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct WorkerPing { + #[prost(int64, tag="1")] + pub timestamp: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct WorkerPong { + #[prost(int64, tag="1")] + pub last_timestamp: i64, + #[prost(int64, tag="2")] + pub timestamp: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RegisterWorkerRequest { + #[prost(enumeration="JobType", tag="1")] + pub r#type: i32, + #[prost(string, tag="8")] + pub agent_name: ::prost::alloc::string::String, + /// string worker_id = 2; + #[prost(string, tag="3")] + pub version: ::prost::alloc::string::String, + #[prost(string, tag="4")] + pub name: ::prost::alloc::string::String, + #[prost(uint32, tag="5")] + pub ping_interval: u32, + #[prost(string, optional, tag="6")] + pub namespace: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag="7")] + pub allowed_permissions: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RegisterWorkerResponse { + #[prost(string, tag="1")] + pub worker_id: ::prost::alloc::string::String, + #[prost(message, optional, tag="3")] + pub server_info: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MigrateJobRequest { + /// string job_id = 1 \[deprecated = true\]; + #[prost(string, repeated, tag="2")] + pub job_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AvailabilityRequest { + #[prost(message, optional, tag="1")] + pub job: ::core::option::Option, + /// True when the job was previously assigned to another worker but has been + /// migrated due to different reasons (e.g. worker failure, job migration) + #[prost(bool, tag="2")] + pub resuming: bool, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AvailabilityResponse { + #[prost(string, tag="1")] + pub job_id: ::prost::alloc::string::String, + #[prost(bool, tag="2")] + pub available: bool, + #[prost(bool, tag="3")] + pub supports_resume: bool, + #[prost(string, tag="4")] + pub participant_name: ::prost::alloc::string::String, + #[prost(string, tag="5")] + pub participant_identity: ::prost::alloc::string::String, + #[prost(string, tag="6")] + pub participant_metadata: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateJobStatus { + #[prost(string, tag="1")] + pub job_id: ::prost::alloc::string::String, + /// The worker can indicate the job end by either specifying SUCCESS or FAILED + #[prost(enumeration="JobStatus", tag="2")] + pub status: i32, + /// metadata shown on the dashboard, useful for debugging + #[prost(string, tag="3")] + pub error: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateWorkerStatus { + #[prost(enumeration="WorkerStatus", optional, tag="1")] + pub status: ::core::option::Option, + /// optional string metadata = 2 \[deprecated=true\]; + #[prost(float, tag="3")] + pub load: f32, + #[prost(int32, tag="4")] + pub job_count: i32, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct JobAssignment { + #[prost(message, optional, tag="1")] + pub job: ::core::option::Option, + #[prost(string, optional, tag="2")] + pub url: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, tag="3")] + pub token: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct JobTermination { + #[prost(string, tag="1")] + pub job_id: ::prost::alloc::string::String, +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum JobType { + JtRoom = 0, + JtPublisher = 1, +} +impl JobType { + /// 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 { + JobType::JtRoom => "JT_ROOM", + JobType::JtPublisher => "JT_PUBLISHER", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "JT_ROOM" => Some(Self::JtRoom), + "JT_PUBLISHER" => Some(Self::JtPublisher), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum WorkerStatus { + WsAvailable = 0, + WsFull = 1, +} +impl WorkerStatus { + /// 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 { + WorkerStatus::WsAvailable => "WS_AVAILABLE", + WorkerStatus::WsFull => "WS_FULL", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "WS_AVAILABLE" => Some(Self::WsAvailable), + "WS_FULL" => Some(Self::WsFull), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum JobStatus { + JsPending = 0, + JsRunning = 1, + JsSuccess = 2, + JsFailed = 3, +} +impl JobStatus { + /// 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 { + JobStatus::JsPending => "JS_PENDING", + JobStatus::JsRunning => "JS_RUNNING", + JobStatus::JsSuccess => "JS_SUCCESS", + JobStatus::JsFailed => "JS_FAILED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "JS_PENDING" => Some(Self::JsPending), + "JS_RUNNING" => Some(Self::JsRunning), + "JS_SUCCESS" => Some(Self::JsSuccess), + "JS_FAILED" => Some(Self::JsFailed), + _ => None, + } + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct CreateRoomRequest { /// name of the room #[prost(string, tag="1")] pub name: ::prost::alloc::string::String, + /// configuration to use for this room parameters. Setting parameters below override the config defaults. + #[prost(string, tag="12")] + pub config_name: ::prost::alloc::string::String, /// number of seconds to keep the room open if no one joins #[prost(uint32, tag="2")] pub empty_timeout: u32, @@ -2853,6 +3283,9 @@ pub struct CreateRoomRequest { /// egress #[prost(message, optional, tag="6")] pub egress: ::core::option::Option, + /// agent + #[prost(message, optional, tag="11")] + pub agent: ::core::option::Option, /// playout delay of subscriber #[prost(uint32, tag="7")] pub min_playout_delay: u32, @@ -2862,6 +3295,11 @@ pub struct CreateRoomRequest { /// so not recommended for rooms with frequent subscription changes #[prost(bool, tag="9")] pub sync_streams: bool, + /// replay + /// + /// NEXT-ID: 14 + #[prost(bool, tag="13")] + pub replay_enabled: bool, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -2875,6 +3313,12 @@ pub struct RoomEgress { } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] +pub struct RoomAgent { + #[prost(message, repeated, tag="1")] + pub dispatches: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct ListRoomsRequest { /// when set, will only return rooms with name match #[prost(string, repeated, tag="1")] @@ -3023,6 +3467,37 @@ pub struct UpdateRoomMetadataRequest { } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] +pub struct RoomConfiguration { + /// Used as ID, must be unique + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, + /// number of seconds to keep the room open if no one joins + #[prost(uint32, tag="2")] + pub empty_timeout: u32, + /// number of seconds to keep the room open after everyone leaves + #[prost(uint32, tag="3")] + pub departure_timeout: u32, + /// limit number of participants that can be in a room + #[prost(uint32, tag="4")] + pub max_participants: u32, + /// egress + #[prost(message, optional, tag="5")] + pub egress: ::core::option::Option, + /// agent + #[prost(message, optional, tag="6")] + pub agent: ::core::option::Option, + /// playout delay of subscriber + #[prost(uint32, tag="7")] + pub min_playout_delay: u32, + #[prost(uint32, tag="8")] + pub max_playout_delay: u32, + /// improves A/V sync when playout_delay set to a value larger than 200ms. It will disables transceiver re-use + /// so not recommended for rooms with frequent subscription changes + #[prost(bool, tag="9")] + pub sync_streams: bool, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct CreateIngressRequest { #[prost(enumeration="IngressInput", tag="1")] pub input_type: i32, diff --git a/livekit-protocol/src/livekit.serde.rs b/livekit-protocol/src/livekit.serde.rs index 9d261034..918fddc8 100644 --- a/livekit-protocol/src/livekit.serde.rs +++ b/livekit-protocol/src/livekit.serde.rs @@ -440,6 +440,307 @@ impl<'de> serde::Deserialize<'de> for AddTrackRequest { deserializer.deserialize_struct("livekit.AddTrackRequest", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for AgentDispatch { + #[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.agent_name.is_empty() { + len += 1; + } + if !self.room.is_empty() { + len += 1; + } + if !self.metadata.is_empty() { + len += 1; + } + if self.state.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.AgentDispatch", len)?; + if !self.id.is_empty() { + struct_ser.serialize_field("id", &self.id)?; + } + if !self.agent_name.is_empty() { + struct_ser.serialize_field("agentName", &self.agent_name)?; + } + if !self.room.is_empty() { + struct_ser.serialize_field("room", &self.room)?; + } + if !self.metadata.is_empty() { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + if let Some(v) = self.state.as_ref() { + struct_ser.serialize_field("state", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for AgentDispatch { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "id", + "agent_name", + "agentName", + "room", + "metadata", + "state", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Id, + AgentName, + Room, + Metadata, + State, + __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), + "agentName" | "agent_name" => Ok(GeneratedField::AgentName), + "room" => Ok(GeneratedField::Room), + "metadata" => Ok(GeneratedField::Metadata), + "state" => Ok(GeneratedField::State), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = AgentDispatch; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.AgentDispatch") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut id__ = None; + let mut agent_name__ = None; + let mut room__ = None; + let mut metadata__ = None; + let mut state__ = 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::AgentName => { + if agent_name__.is_some() { + return Err(serde::de::Error::duplicate_field("agentName")); + } + agent_name__ = Some(map_.next_value()?); + } + GeneratedField::Room => { + if room__.is_some() { + return Err(serde::de::Error::duplicate_field("room")); + } + room__ = Some(map_.next_value()?); + } + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = 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(AgentDispatch { + id: id__.unwrap_or_default(), + agent_name: agent_name__.unwrap_or_default(), + room: room__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), + state: state__, + }) + } + } + deserializer.deserialize_struct("livekit.AgentDispatch", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for AgentDispatchState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.jobs.is_empty() { + len += 1; + } + if self.created_at != 0 { + len += 1; + } + if self.deleted_at != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.AgentDispatchState", len)?; + if !self.jobs.is_empty() { + struct_ser.serialize_field("jobs", &self.jobs)?; + } + if self.created_at != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("createdAt", ToString::to_string(&self.created_at).as_str())?; + } + if self.deleted_at != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("deletedAt", ToString::to_string(&self.deleted_at).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for AgentDispatchState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "jobs", + "created_at", + "createdAt", + "deleted_at", + "deletedAt", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Jobs, + CreatedAt, + DeletedAt, + __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 { + "jobs" => Ok(GeneratedField::Jobs), + "createdAt" | "created_at" => Ok(GeneratedField::CreatedAt), + "deletedAt" | "deleted_at" => Ok(GeneratedField::DeletedAt), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = AgentDispatchState; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.AgentDispatchState") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut jobs__ = None; + let mut created_at__ = None; + let mut deleted_at__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Jobs => { + if jobs__.is_some() { + return Err(serde::de::Error::duplicate_field("jobs")); + } + jobs__ = Some(map_.next_value()?); + } + GeneratedField::CreatedAt => { + if created_at__.is_some() { + return Err(serde::de::Error::duplicate_field("createdAt")); + } + created_at__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::DeletedAt => { + if deleted_at__.is_some() { + return Err(serde::de::Error::duplicate_field("deletedAt")); + } + deleted_at__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(AgentDispatchState { + jobs: jobs__.unwrap_or_default(), + created_at: created_at__.unwrap_or_default(), + deleted_at: deleted_at__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.AgentDispatchState", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for AliOssUpload { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -1085,7 +1386,7 @@ impl<'de> serde::Deserialize<'de> for AutoTrackEgress { deserializer.deserialize_struct("livekit.AutoTrackEgress", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for AzureBlobUpload { +impl serde::Serialize for AvailabilityRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -1093,20 +1394,317 @@ impl serde::Serialize for AzureBlobUpload { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.account_name.is_empty() { + if self.job.is_some() { len += 1; } - if !self.account_key.is_empty() { + if self.resuming { len += 1; } - if !self.container_name.is_empty() { - len += 1; + let mut struct_ser = serializer.serialize_struct("livekit.AvailabilityRequest", len)?; + if let Some(v) = self.job.as_ref() { + struct_ser.serialize_field("job", v)?; } - let mut struct_ser = serializer.serialize_struct("livekit.AzureBlobUpload", len)?; - if !self.account_name.is_empty() { - struct_ser.serialize_field("accountName", &self.account_name)?; + if self.resuming { + struct_ser.serialize_field("resuming", &self.resuming)?; } - if !self.account_key.is_empty() { + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for AvailabilityRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "job", + "resuming", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Job, + Resuming, + __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 { + "job" => Ok(GeneratedField::Job), + "resuming" => Ok(GeneratedField::Resuming), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = AvailabilityRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.AvailabilityRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut job__ = None; + let mut resuming__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Job => { + if job__.is_some() { + return Err(serde::de::Error::duplicate_field("job")); + } + job__ = map_.next_value()?; + } + GeneratedField::Resuming => { + if resuming__.is_some() { + return Err(serde::de::Error::duplicate_field("resuming")); + } + resuming__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(AvailabilityRequest { + job: job__, + resuming: resuming__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.AvailabilityRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for AvailabilityResponse { + #[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; + } + if self.available { + len += 1; + } + if self.supports_resume { + len += 1; + } + if !self.participant_name.is_empty() { + len += 1; + } + if !self.participant_identity.is_empty() { + len += 1; + } + if !self.participant_metadata.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.AvailabilityResponse", len)?; + if !self.job_id.is_empty() { + struct_ser.serialize_field("jobId", &self.job_id)?; + } + if self.available { + struct_ser.serialize_field("available", &self.available)?; + } + if self.supports_resume { + struct_ser.serialize_field("supportsResume", &self.supports_resume)?; + } + if !self.participant_name.is_empty() { + struct_ser.serialize_field("participantName", &self.participant_name)?; + } + if !self.participant_identity.is_empty() { + struct_ser.serialize_field("participantIdentity", &self.participant_identity)?; + } + if !self.participant_metadata.is_empty() { + struct_ser.serialize_field("participantMetadata", &self.participant_metadata)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for AvailabilityResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "job_id", + "jobId", + "available", + "supports_resume", + "supportsResume", + "participant_name", + "participantName", + "participant_identity", + "participantIdentity", + "participant_metadata", + "participantMetadata", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + JobId, + Available, + SupportsResume, + ParticipantName, + ParticipantIdentity, + ParticipantMetadata, + __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), + "available" => Ok(GeneratedField::Available), + "supportsResume" | "supports_resume" => Ok(GeneratedField::SupportsResume), + "participantName" | "participant_name" => Ok(GeneratedField::ParticipantName), + "participantIdentity" | "participant_identity" => Ok(GeneratedField::ParticipantIdentity), + "participantMetadata" | "participant_metadata" => Ok(GeneratedField::ParticipantMetadata), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = AvailabilityResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.AvailabilityResponse") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut job_id__ = None; + let mut available__ = None; + let mut supports_resume__ = None; + let mut participant_name__ = None; + let mut participant_identity__ = None; + let mut participant_metadata__ = 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::Available => { + if available__.is_some() { + return Err(serde::de::Error::duplicate_field("available")); + } + available__ = Some(map_.next_value()?); + } + GeneratedField::SupportsResume => { + if supports_resume__.is_some() { + return Err(serde::de::Error::duplicate_field("supportsResume")); + } + supports_resume__ = 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::ParticipantIdentity => { + if participant_identity__.is_some() { + return Err(serde::de::Error::duplicate_field("participantIdentity")); + } + participant_identity__ = 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::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(AvailabilityResponse { + job_id: job_id__.unwrap_or_default(), + available: available__.unwrap_or_default(), + supports_resume: supports_resume__.unwrap_or_default(), + participant_name: participant_name__.unwrap_or_default(), + participant_identity: participant_identity__.unwrap_or_default(), + participant_metadata: participant_metadata__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.AvailabilityResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for AzureBlobUpload { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.account_name.is_empty() { + len += 1; + } + if !self.account_key.is_empty() { + len += 1; + } + if !self.container_name.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.AzureBlobUpload", len)?; + if !self.account_name.is_empty() { + struct_ser.serialize_field("accountName", &self.account_name)?; + } + if !self.account_key.is_empty() { struct_ser.serialize_field("accountKey", &self.account_key)?; } if !self.container_name.is_empty() { @@ -2307,7 +2905,7 @@ impl<'de> serde::Deserialize<'de> for ConnectionQualityUpdate { deserializer.deserialize_struct("livekit.ConnectionQualityUpdate", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for CreateIngressRequest { +impl serde::Serialize for CreateAgentDispatchRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -2315,35 +2913,165 @@ impl serde::Serialize for CreateIngressRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if self.input_type != 0 { - len += 1; - } - if !self.url.is_empty() { - len += 1; - } - if !self.name.is_empty() { - len += 1; - } - if !self.room_name.is_empty() { - len += 1; - } - if !self.participant_identity.is_empty() { + if !self.agent_name.is_empty() { len += 1; } - if !self.participant_name.is_empty() { + if !self.room.is_empty() { len += 1; } - if !self.participant_metadata.is_empty() { + if !self.metadata.is_empty() { len += 1; } - if self.bypass_transcoding { - len += 1; + let mut struct_ser = serializer.serialize_struct("livekit.CreateAgentDispatchRequest", len)?; + if !self.agent_name.is_empty() { + struct_ser.serialize_field("agentName", &self.agent_name)?; } - if self.enable_transcoding.is_some() { - len += 1; + if !self.room.is_empty() { + struct_ser.serialize_field("room", &self.room)?; } - if self.audio.is_some() { - len += 1; + if !self.metadata.is_empty() { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for CreateAgentDispatchRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "agent_name", + "agentName", + "room", + "metadata", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AgentName, + Room, + Metadata, + __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 { + "agentName" | "agent_name" => Ok(GeneratedField::AgentName), + "room" => Ok(GeneratedField::Room), + "metadata" => Ok(GeneratedField::Metadata), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = CreateAgentDispatchRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.CreateAgentDispatchRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut agent_name__ = None; + let mut room__ = 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::Room => { + if room__.is_some() { + return Err(serde::de::Error::duplicate_field("room")); + } + room__ = 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(CreateAgentDispatchRequest { + agent_name: agent_name__.unwrap_or_default(), + room: room__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.CreateAgentDispatchRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for CreateIngressRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.input_type != 0 { + len += 1; + } + if !self.url.is_empty() { + len += 1; + } + if !self.name.is_empty() { + 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.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; @@ -2592,6 +3320,9 @@ impl serde::Serialize for CreateRoomRequest { if !self.name.is_empty() { len += 1; } + if !self.config_name.is_empty() { + len += 1; + } if self.empty_timeout != 0 { len += 1; } @@ -2610,6 +3341,9 @@ impl serde::Serialize for CreateRoomRequest { if self.egress.is_some() { len += 1; } + if self.agent.is_some() { + len += 1; + } if self.min_playout_delay != 0 { len += 1; } @@ -2619,10 +3353,16 @@ impl serde::Serialize for CreateRoomRequest { if self.sync_streams { len += 1; } + if self.replay_enabled { + len += 1; + } let mut struct_ser = serializer.serialize_struct("livekit.CreateRoomRequest", len)?; if !self.name.is_empty() { struct_ser.serialize_field("name", &self.name)?; } + if !self.config_name.is_empty() { + struct_ser.serialize_field("configName", &self.config_name)?; + } if self.empty_timeout != 0 { struct_ser.serialize_field("emptyTimeout", &self.empty_timeout)?; } @@ -2641,6 +3381,9 @@ impl serde::Serialize for CreateRoomRequest { if let Some(v) = self.egress.as_ref() { struct_ser.serialize_field("egress", v)?; } + if let Some(v) = self.agent.as_ref() { + struct_ser.serialize_field("agent", v)?; + } if self.min_playout_delay != 0 { struct_ser.serialize_field("minPlayoutDelay", &self.min_playout_delay)?; } @@ -2650,6 +3393,9 @@ impl serde::Serialize for CreateRoomRequest { if self.sync_streams { struct_ser.serialize_field("syncStreams", &self.sync_streams)?; } + if self.replay_enabled { + struct_ser.serialize_field("replayEnabled", &self.replay_enabled)?; + } struct_ser.end() } } @@ -2661,6 +3407,8 @@ impl<'de> serde::Deserialize<'de> for CreateRoomRequest { { const FIELDS: &[&str] = &[ "name", + "config_name", + "configName", "empty_timeout", "emptyTimeout", "departure_timeout", @@ -2671,26 +3419,32 @@ impl<'de> serde::Deserialize<'de> for CreateRoomRequest { "nodeId", "metadata", "egress", + "agent", "min_playout_delay", "minPlayoutDelay", "max_playout_delay", "maxPlayoutDelay", "sync_streams", "syncStreams", + "replay_enabled", + "replayEnabled", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { Name, + ConfigName, EmptyTimeout, DepartureTimeout, MaxParticipants, NodeId, Metadata, Egress, + Agent, MinPlayoutDelay, MaxPlayoutDelay, SyncStreams, + ReplayEnabled, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -2714,15 +3468,18 @@ impl<'de> serde::Deserialize<'de> for CreateRoomRequest { { match value { "name" => Ok(GeneratedField::Name), + "configName" | "config_name" => Ok(GeneratedField::ConfigName), "emptyTimeout" | "empty_timeout" => Ok(GeneratedField::EmptyTimeout), "departureTimeout" | "departure_timeout" => Ok(GeneratedField::DepartureTimeout), "maxParticipants" | "max_participants" => Ok(GeneratedField::MaxParticipants), "nodeId" | "node_id" => Ok(GeneratedField::NodeId), "metadata" => Ok(GeneratedField::Metadata), "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), + "replayEnabled" | "replay_enabled" => Ok(GeneratedField::ReplayEnabled), _ => Ok(GeneratedField::__SkipField__), } } @@ -2743,15 +3500,18 @@ impl<'de> serde::Deserialize<'de> for CreateRoomRequest { V: serde::de::MapAccess<'de>, { let mut name__ = None; + let mut config_name__ = None; let mut empty_timeout__ = None; let mut departure_timeout__ = None; let mut max_participants__ = None; let mut node_id__ = None; let mut metadata__ = 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 replay_enabled__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Name => { @@ -2760,6 +3520,12 @@ impl<'de> serde::Deserialize<'de> for CreateRoomRequest { } name__ = Some(map_.next_value()?); } + GeneratedField::ConfigName => { + if config_name__.is_some() { + return Err(serde::de::Error::duplicate_field("configName")); + } + config_name__ = Some(map_.next_value()?); + } GeneratedField::EmptyTimeout => { if empty_timeout__.is_some() { return Err(serde::de::Error::duplicate_field("emptyTimeout")); @@ -2802,6 +3568,12 @@ impl<'de> serde::Deserialize<'de> for CreateRoomRequest { } 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")); @@ -2824,6 +3596,12 @@ impl<'de> serde::Deserialize<'de> for CreateRoomRequest { } sync_streams__ = Some(map_.next_value()?); } + GeneratedField::ReplayEnabled => { + if replay_enabled__.is_some() { + return Err(serde::de::Error::duplicate_field("replayEnabled")); + } + replay_enabled__ = Some(map_.next_value()?); + } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } @@ -2831,15 +3609,18 @@ impl<'de> serde::Deserialize<'de> for CreateRoomRequest { } Ok(CreateRoomRequest { name: name__.unwrap_or_default(), + config_name: config_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(), node_id: node_id__.unwrap_or_default(), metadata: metadata__.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(), + replay_enabled: replay_enabled__.unwrap_or_default(), }) } } @@ -4170,6 +4951,102 @@ impl<'de> serde::Deserialize<'de> for data_packet::Kind { deserializer.deserialize_any(GeneratedVisitor) } } +impl serde::Serialize for DeleteAgentDispatchRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.dispatch_id.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.DeleteAgentDispatchRequest", len)?; + if !self.dispatch_id.is_empty() { + struct_ser.serialize_field("dispatchId", &self.dispatch_id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for DeleteAgentDispatchRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "dispatch_id", + "dispatchId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DispatchId, + __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 { + "dispatchId" | "dispatch_id" => Ok(GeneratedField::DispatchId), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = DeleteAgentDispatchRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.DeleteAgentDispatchRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut dispatch_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::DispatchId => { + if dispatch_id__.is_some() { + return Err(serde::de::Error::duplicate_field("dispatchId")); + } + dispatch_id__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(DeleteAgentDispatchRequest { + dispatch_id: dispatch_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.DeleteAgentDispatchRequest", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for DeleteIngressRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -6373,7 +7250,7 @@ impl<'de> serde::Deserialize<'de> for encryption::Type { deserializer.deserialize_any(GeneratedVisitor) } } -impl serde::Serialize for FileInfo { +impl serde::Serialize for ErrorResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -6381,29 +7258,240 @@ impl serde::Serialize for FileInfo { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.filename.is_empty() { + if self.request_id != 0 { len += 1; } - if self.started_at != 0 { + if self.reason != 0 { len += 1; } - if self.ended_at != 0 { + if !self.message.is_empty() { len += 1; } - if self.duration != 0 { - len += 1; + let mut struct_ser = serializer.serialize_struct("livekit.ErrorResponse", len)?; + if self.request_id != 0 { + struct_ser.serialize_field("requestId", &self.request_id)?; } - if self.size != 0 { - len += 1; + if self.reason != 0 { + let v = error_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.location.is_empty() { - len += 1; + if !self.message.is_empty() { + struct_ser.serialize_field("message", &self.message)?; } - let mut struct_ser = serializer.serialize_struct("livekit.FileInfo", len)?; - if !self.filename.is_empty() { - struct_ser.serialize_field("filename", &self.filename)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ErrorResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "request_id", + "requestId", + "reason", + "message", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + RequestId, + Reason, + Message, + __SkipField__, } - if self.started_at != 0 { + 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 { + "requestId" | "request_id" => Ok(GeneratedField::RequestId), + "reason" => Ok(GeneratedField::Reason), + "message" => Ok(GeneratedField::Message), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ErrorResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.ErrorResponse") + } + + 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; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::RequestId => { + if request_id__.is_some() { + return Err(serde::de::Error::duplicate_field("requestId")); + } + 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(ErrorResponse { + request_id: request_id__.unwrap_or_default(), + reason: reason__.unwrap_or_default(), + message: message__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.ErrorResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for error_response::Reason { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unknown => "UNKNOWN", + Self::NotFound => "NOT_FOUND", + Self::NotAllowed => "NOT_ALLOWED", + Self::LimitExceeded => "LIMIT_EXCEEDED", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for error_response::Reason { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "UNKNOWN", + "NOT_FOUND", + "NOT_ALLOWED", + "LIMIT_EXCEEDED", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = error_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 { + "UNKNOWN" => Ok(error_response::Reason::Unknown), + "NOT_FOUND" => Ok(error_response::Reason::NotFound), + "NOT_ALLOWED" => Ok(error_response::Reason::NotAllowed), + "LIMIT_EXCEEDED" => Ok(error_response::Reason::LimitExceeded), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(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)] struct_ser.serialize_field("startedAt", ToString::to_string(&self.started_at).as_str())?; } @@ -7248,6 +8336,9 @@ 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 { len += 1; } @@ -7258,6 +8349,9 @@ impl serde::Serialize for ImagesInfo { 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)] struct_ser.serialize_field("imageCount", ToString::to_string(&self.image_count).as_str())?; @@ -7280,6 +8374,8 @@ impl<'de> serde::Deserialize<'de> for ImagesInfo { D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ + "filename_prefix", + "filenamePrefix", "image_count", "imageCount", "started_at", @@ -7290,6 +8386,7 @@ impl<'de> serde::Deserialize<'de> for ImagesInfo { #[allow(clippy::enum_variant_names)] enum GeneratedField { + FilenamePrefix, ImageCount, StartedAt, EndedAt, @@ -7315,6 +8412,7 @@ 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), @@ -7337,11 +8435,18 @@ impl<'de> serde::Deserialize<'de> for ImagesInfo { 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; 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")); @@ -7372,6 +8477,7 @@ impl<'de> serde::Deserialize<'de> for ImagesInfo { } } 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(), @@ -9226,7 +10332,7 @@ impl<'de> serde::Deserialize<'de> for InputVideoState { deserializer.deserialize_struct("livekit.InputVideoState", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for JoinResponse { +impl serde::Serialize for Job { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -9234,137 +10340,88 @@ impl serde::Serialize for JoinResponse { { use serde::ser::SerializeStruct; let mut len = 0; - if self.room.is_some() { - len += 1; - } - if self.participant.is_some() { - len += 1; - } - if !self.other_participants.is_empty() { - len += 1; - } - if !self.server_version.is_empty() { + if !self.id.is_empty() { len += 1; } - if !self.ice_servers.is_empty() { + if self.r#type != 0 { len += 1; } - if self.subscriber_primary { + if self.room.is_some() { len += 1; } - if !self.alternative_url.is_empty() { + if self.participant.is_some() { len += 1; } - if self.client_configuration.is_some() { + if !self.namespace.is_empty() { len += 1; } - if !self.server_region.is_empty() { + if !self.metadata.is_empty() { len += 1; } - if self.ping_timeout != 0 { + if !self.agent_name.is_empty() { len += 1; } - if self.ping_interval != 0 { + if self.state.is_some() { len += 1; } - if self.server_info.is_some() { - 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.sif_trailer.is_empty() { - len += 1; + 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)?; } - let mut struct_ser = serializer.serialize_struct("livekit.JoinResponse", 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 !self.other_participants.is_empty() { - struct_ser.serialize_field("otherParticipants", &self.other_participants)?; - } - if !self.server_version.is_empty() { - struct_ser.serialize_field("serverVersion", &self.server_version)?; - } - if !self.ice_servers.is_empty() { - struct_ser.serialize_field("iceServers", &self.ice_servers)?; - } - if self.subscriber_primary { - struct_ser.serialize_field("subscriberPrimary", &self.subscriber_primary)?; - } - if !self.alternative_url.is_empty() { - struct_ser.serialize_field("alternativeUrl", &self.alternative_url)?; - } - if let Some(v) = self.client_configuration.as_ref() { - struct_ser.serialize_field("clientConfiguration", v)?; - } - if !self.server_region.is_empty() { - struct_ser.serialize_field("serverRegion", &self.server_region)?; - } - if self.ping_timeout != 0 { - struct_ser.serialize_field("pingTimeout", &self.ping_timeout)?; + if !self.namespace.is_empty() { + struct_ser.serialize_field("namespace", &self.namespace)?; } - if self.ping_interval != 0 { - struct_ser.serialize_field("pingInterval", &self.ping_interval)?; + if !self.metadata.is_empty() { + struct_ser.serialize_field("metadata", &self.metadata)?; } - if let Some(v) = self.server_info.as_ref() { - struct_ser.serialize_field("serverInfo", v)?; + if !self.agent_name.is_empty() { + struct_ser.serialize_field("agentName", &self.agent_name)?; } - if !self.sif_trailer.is_empty() { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("sifTrailer", pbjson::private::base64::encode(&self.sif_trailer).as_str())?; + if let Some(v) = self.state.as_ref() { + struct_ser.serialize_field("state", v)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for JoinResponse { +impl<'de> serde::Deserialize<'de> for Job { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ + "id", + "type", "room", "participant", - "other_participants", - "otherParticipants", - "server_version", - "serverVersion", - "ice_servers", - "iceServers", - "subscriber_primary", - "subscriberPrimary", - "alternative_url", - "alternativeUrl", - "client_configuration", - "clientConfiguration", - "server_region", - "serverRegion", - "ping_timeout", - "pingTimeout", - "ping_interval", - "pingInterval", - "server_info", - "serverInfo", - "sif_trailer", - "sifTrailer", + "namespace", + "metadata", + "agent_name", + "agentName", + "state", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { + Id, + Type, Room, Participant, - OtherParticipants, - ServerVersion, - IceServers, - SubscriberPrimary, - AlternativeUrl, - ClientConfiguration, - ServerRegion, - PingTimeout, - PingInterval, - ServerInfo, - SifTrailer, + Namespace, + Metadata, + AgentName, + State, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -9387,19 +10444,14 @@ impl<'de> serde::Deserialize<'de> for JoinResponse { E: serde::de::Error, { match value { + "id" => Ok(GeneratedField::Id), + "type" => Ok(GeneratedField::Type), "room" => Ok(GeneratedField::Room), "participant" => Ok(GeneratedField::Participant), - "otherParticipants" | "other_participants" => Ok(GeneratedField::OtherParticipants), - "serverVersion" | "server_version" => Ok(GeneratedField::ServerVersion), - "iceServers" | "ice_servers" => Ok(GeneratedField::IceServers), - "subscriberPrimary" | "subscriber_primary" => Ok(GeneratedField::SubscriberPrimary), - "alternativeUrl" | "alternative_url" => Ok(GeneratedField::AlternativeUrl), - "clientConfiguration" | "client_configuration" => Ok(GeneratedField::ClientConfiguration), - "serverRegion" | "server_region" => Ok(GeneratedField::ServerRegion), - "pingTimeout" | "ping_timeout" => Ok(GeneratedField::PingTimeout), - "pingInterval" | "ping_interval" => Ok(GeneratedField::PingInterval), - "serverInfo" | "server_info" => Ok(GeneratedField::ServerInfo), - "sifTrailer" | "sif_trailer" => Ok(GeneratedField::SifTrailer), + "namespace" => Ok(GeneratedField::Namespace), + "metadata" => Ok(GeneratedField::Metadata), + "agentName" | "agent_name" => Ok(GeneratedField::AgentName), + "state" => Ok(GeneratedField::State), _ => Ok(GeneratedField::__SkipField__), } } @@ -9409,31 +10461,38 @@ impl<'de> serde::Deserialize<'de> for JoinResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = JoinResponse; + type Value = Job; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.JoinResponse") + 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 id__ = None; + let mut r#type__ = None; let mut room__ = None; let mut participant__ = None; - let mut other_participants__ = None; - let mut server_version__ = None; - let mut ice_servers__ = None; - let mut subscriber_primary__ = None; - let mut alternative_url__ = None; - let mut client_configuration__ = None; - let mut server_region__ = None; - let mut ping_timeout__ = None; - let mut ping_interval__ = None; - let mut server_info__ = None; - let mut sif_trailer__ = 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::Id => { + if id__.is_some() { + return Err(serde::de::Error::duplicate_field("id")); + } + id__ = Some(map_.next_value()?); + } + GeneratedField::Type => { + if r#type__.is_some() { + return Err(serde::de::Error::duplicate_field("type")); + } + r#type__ = Some(map_.next_value::()? as i32); + } GeneratedField::Room => { if room__.is_some() { return Err(serde::de::Error::duplicate_field("room")); @@ -9446,104 +10505,51 @@ impl<'de> serde::Deserialize<'de> for JoinResponse { } participant__ = map_.next_value()?; } - GeneratedField::OtherParticipants => { - if other_participants__.is_some() { - return Err(serde::de::Error::duplicate_field("otherParticipants")); - } - other_participants__ = Some(map_.next_value()?); - } - GeneratedField::ServerVersion => { - if server_version__.is_some() { - return Err(serde::de::Error::duplicate_field("serverVersion")); - } - server_version__ = Some(map_.next_value()?); - } - GeneratedField::IceServers => { - if ice_servers__.is_some() { - return Err(serde::de::Error::duplicate_field("iceServers")); - } - ice_servers__ = Some(map_.next_value()?); - } - GeneratedField::SubscriberPrimary => { - if subscriber_primary__.is_some() { - return Err(serde::de::Error::duplicate_field("subscriberPrimary")); - } - subscriber_primary__ = Some(map_.next_value()?); - } - GeneratedField::AlternativeUrl => { - if alternative_url__.is_some() { - return Err(serde::de::Error::duplicate_field("alternativeUrl")); - } - alternative_url__ = 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::ServerRegion => { - if server_region__.is_some() { - return Err(serde::de::Error::duplicate_field("serverRegion")); - } - server_region__ = Some(map_.next_value()?); - } - GeneratedField::PingTimeout => { - if ping_timeout__.is_some() { - return Err(serde::de::Error::duplicate_field("pingTimeout")); + GeneratedField::Namespace => { + if namespace__.is_some() { + return Err(serde::de::Error::duplicate_field("namespace")); } - ping_timeout__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + namespace__ = Some(map_.next_value()?); } - GeneratedField::PingInterval => { - if ping_interval__.is_some() { - return Err(serde::de::Error::duplicate_field("pingInterval")); + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); } - ping_interval__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + metadata__ = Some(map_.next_value()?); } - GeneratedField::ServerInfo => { - if server_info__.is_some() { - return Err(serde::de::Error::duplicate_field("serverInfo")); + GeneratedField::AgentName => { + if agent_name__.is_some() { + return Err(serde::de::Error::duplicate_field("agentName")); } - server_info__ = map_.next_value()?; + agent_name__ = Some(map_.next_value()?); } - GeneratedField::SifTrailer => { - if sif_trailer__.is_some() { - return Err(serde::de::Error::duplicate_field("sifTrailer")); + GeneratedField::State => { + if state__.is_some() { + return Err(serde::de::Error::duplicate_field("state")); } - sif_trailer__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; + state__ = map_.next_value()?; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(JoinResponse { + Ok(Job { + id: id__.unwrap_or_default(), + r#type: r#type__.unwrap_or_default(), room: room__, participant: participant__, - other_participants: other_participants__.unwrap_or_default(), - server_version: server_version__.unwrap_or_default(), - ice_servers: ice_servers__.unwrap_or_default(), - subscriber_primary: subscriber_primary__.unwrap_or_default(), - alternative_url: alternative_url__.unwrap_or_default(), - client_configuration: client_configuration__, - server_region: server_region__.unwrap_or_default(), - ping_timeout: ping_timeout__.unwrap_or_default(), - ping_interval: ping_interval__.unwrap_or_default(), - server_info: server_info__, - sif_trailer: sif_trailer__.unwrap_or_default(), + namespace: namespace__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), + agent_name: agent_name__.unwrap_or_default(), + state: state__, }) } } - deserializer.deserialize_struct("livekit.JoinResponse", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.Job", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for LeaveRequest { +impl serde::Serialize for JobAssignment { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -9551,58 +10557,45 @@ impl serde::Serialize for LeaveRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if self.can_reconnect { - len += 1; - } - if self.reason != 0 { + if self.job.is_some() { len += 1; } - if self.action != 0 { + if self.url.is_some() { len += 1; } - if self.regions.is_some() { + if !self.token.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.LeaveRequest", len)?; - if self.can_reconnect { - struct_ser.serialize_field("canReconnect", &self.can_reconnect)?; - } - if self.reason != 0 { - let v = DisconnectReason::try_from(self.reason) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.reason)))?; - struct_ser.serialize_field("reason", &v)?; + 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.action != 0 { - let v = leave_request::Action::try_from(self.action) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.action)))?; - struct_ser.serialize_field("action", &v)?; + if let Some(v) = self.url.as_ref() { + struct_ser.serialize_field("url", v)?; } - if let Some(v) = self.regions.as_ref() { - struct_ser.serialize_field("regions", v)?; + if !self.token.is_empty() { + struct_ser.serialize_field("token", &self.token)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for LeaveRequest { +impl<'de> serde::Deserialize<'de> for JobAssignment { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "can_reconnect", - "canReconnect", - "reason", - "action", - "regions", + "job", + "url", + "token", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - CanReconnect, - Reason, - Action, - Regions, + Job, + Url, + Token, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -9625,10 +10618,9 @@ impl<'de> serde::Deserialize<'de> for LeaveRequest { E: serde::de::Error, { match value { - "canReconnect" | "can_reconnect" => Ok(GeneratedField::CanReconnect), - "reason" => Ok(GeneratedField::Reason), - "action" => Ok(GeneratedField::Action), - "regions" => Ok(GeneratedField::Regions), + "job" => Ok(GeneratedField::Job), + "url" => Ok(GeneratedField::Url), + "token" => Ok(GeneratedField::Token), _ => Ok(GeneratedField::__SkipField__), } } @@ -9638,137 +10630,55 @@ impl<'de> serde::Deserialize<'de> for LeaveRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = LeaveRequest; + type Value = JobAssignment; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.LeaveRequest") + 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 can_reconnect__ = None; - let mut reason__ = None; - let mut action__ = None; - let mut regions__ = None; + let mut job__ = None; + let mut url__ = None; + let mut token__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::CanReconnect => { - if can_reconnect__.is_some() { - return Err(serde::de::Error::duplicate_field("canReconnect")); - } - can_reconnect__ = Some(map_.next_value()?); - } - GeneratedField::Reason => { - if reason__.is_some() { - return Err(serde::de::Error::duplicate_field("reason")); + GeneratedField::Job => { + if job__.is_some() { + return Err(serde::de::Error::duplicate_field("job")); } - reason__ = Some(map_.next_value::()? as i32); + job__ = map_.next_value()?; } - GeneratedField::Action => { - if action__.is_some() { - return Err(serde::de::Error::duplicate_field("action")); + GeneratedField::Url => { + if url__.is_some() { + return Err(serde::de::Error::duplicate_field("url")); } - action__ = Some(map_.next_value::()? as i32); + url__ = map_.next_value()?; } - GeneratedField::Regions => { - if regions__.is_some() { - return Err(serde::de::Error::duplicate_field("regions")); + GeneratedField::Token => { + if token__.is_some() { + return Err(serde::de::Error::duplicate_field("token")); } - regions__ = map_.next_value()?; + token__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(LeaveRequest { - can_reconnect: can_reconnect__.unwrap_or_default(), - reason: reason__.unwrap_or_default(), - action: action__.unwrap_or_default(), - regions: regions__, + Ok(JobAssignment { + job: job__, + url: url__, + token: token__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.LeaveRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.JobAssignment", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for leave_request::Action { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::Disconnect => "DISCONNECT", - Self::Resume => "RESUME", - Self::Reconnect => "RECONNECT", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for leave_request::Action { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "DISCONNECT", - "RESUME", - "RECONNECT", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = leave_request::Action; - - 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 { - "DISCONNECT" => Ok(leave_request::Action::Disconnect), - "RESUME" => Ok(leave_request::Action::Resume), - "RECONNECT" => Ok(leave_request::Action::Reconnect), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for ListEgressRequest { +impl serde::Serialize for JobState { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -9776,47 +10686,69 @@ impl serde::Serialize for ListEgressRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.room_name.is_empty() { + if self.status != 0 { len += 1; } - if !self.egress_id.is_empty() { + if !self.error.is_empty() { len += 1; } - if self.active { + if self.started_at != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.ListEgressRequest", len)?; - if !self.room_name.is_empty() { - struct_ser.serialize_field("roomName", &self.room_name)?; + if self.ended_at != 0 { + len += 1; } - if !self.egress_id.is_empty() { - struct_ser.serialize_field("egressId", &self.egress_id)?; + if self.updated_at != 0 { + len += 1; } - if self.active { - struct_ser.serialize_field("active", &self.active)?; + 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)] + struct_ser.serialize_field("startedAt", ToString::to_string(&self.started_at).as_str())?; + } + if self.ended_at != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("endedAt", ToString::to_string(&self.ended_at).as_str())?; + } + if self.updated_at != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("updatedAt", ToString::to_string(&self.updated_at).as_str())?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for ListEgressRequest { +impl<'de> serde::Deserialize<'de> for JobState { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "room_name", - "roomName", - "egress_id", - "egressId", - "active", + "status", + "error", + "started_at", + "startedAt", + "ended_at", + "endedAt", + "updated_at", + "updatedAt", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - RoomName, - EgressId, - Active, + Status, + Error, + StartedAt, + EndedAt, + UpdatedAt, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -9839,9 +10771,11 @@ impl<'de> serde::Deserialize<'de> for ListEgressRequest { E: serde::de::Error, { match value { - "roomName" | "room_name" => Ok(GeneratedField::RoomName), - "egressId" | "egress_id" => Ok(GeneratedField::EgressId), - "active" => Ok(GeneratedField::Active), + "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), _ => Ok(GeneratedField::__SkipField__), } } @@ -9851,55 +10785,154 @@ impl<'de> serde::Deserialize<'de> for ListEgressRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ListEgressRequest; + type Value = JobState; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ListEgressRequest") + formatter.write_str("struct livekit.JobState") } - 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 egress_id__ = None; - let mut active__ = None; + let mut status__ = None; + let mut error__ = None; + let mut started_at__ = None; + let mut ended_at__ = None; + let mut updated_at__ = 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")); + GeneratedField::Status => { + if status__.is_some() { + return Err(serde::de::Error::duplicate_field("status")); } - room_name__ = Some(map_.next_value()?); + status__ = Some(map_.next_value::()? as i32); } - GeneratedField::EgressId => { - if egress_id__.is_some() { - return Err(serde::de::Error::duplicate_field("egressId")); + GeneratedField::Error => { + if error__.is_some() { + return Err(serde::de::Error::duplicate_field("error")); } - egress_id__ = Some(map_.next_value()?); + error__ = Some(map_.next_value()?); } - GeneratedField::Active => { - if active__.is_some() { - return Err(serde::de::Error::duplicate_field("active")); + GeneratedField::StartedAt => { + if started_at__.is_some() { + return Err(serde::de::Error::duplicate_field("startedAt")); } - active__ = Some(map_.next_value()?); + 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::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(ListEgressRequest { - room_name: room_name__.unwrap_or_default(), - egress_id: egress_id__.unwrap_or_default(), - active: active__.unwrap_or_default(), + 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(), }) } } - deserializer.deserialize_struct("livekit.ListEgressRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.JobState", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ListEgressResponse { +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) + } +} +impl serde::Serialize for JobTermination { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -9907,29 +10940,30 @@ impl serde::Serialize for ListEgressResponse { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.items.is_empty() { + if !self.job_id.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.ListEgressResponse", len)?; - if !self.items.is_empty() { - struct_ser.serialize_field("items", &self.items)?; + 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 ListEgressResponse { +impl<'de> serde::Deserialize<'de> for JobTermination { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "items", + "job_id", + "jobId", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Items, + JobId, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -9952,7 +10986,7 @@ impl<'de> serde::Deserialize<'de> for ListEgressResponse { E: serde::de::Error, { match value { - "items" => Ok(GeneratedField::Items), + "jobId" | "job_id" => Ok(GeneratedField::JobId), _ => Ok(GeneratedField::__SkipField__), } } @@ -9962,153 +10996,110 @@ impl<'de> serde::Deserialize<'de> for ListEgressResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ListEgressResponse; + type Value = JobTermination; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ListEgressResponse") + formatter.write_str("struct livekit.JobTermination") } - 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 items__ = None; + let mut job_id__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Items => { - if items__.is_some() { - return Err(serde::de::Error::duplicate_field("items")); + GeneratedField::JobId => { + if job_id__.is_some() { + return Err(serde::de::Error::duplicate_field("jobId")); } - items__ = Some(map_.next_value()?); + job_id__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(ListEgressResponse { - items: items__.unwrap_or_default(), + Ok(JobTermination { + job_id: job_id__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.ListEgressResponse", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.JobTermination", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ListIngressRequest { +impl serde::Serialize for JobType { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.room_name.is_empty() { - len += 1; - } - if !self.ingress_id.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("livekit.ListIngressRequest", len)?; - if !self.room_name.is_empty() { - struct_ser.serialize_field("roomName", &self.room_name)?; - } - if !self.ingress_id.is_empty() { - struct_ser.serialize_field("ingressId", &self.ingress_id)?; - } - struct_ser.end() + let variant = match self { + Self::JtRoom => "JT_ROOM", + Self::JtPublisher => "JT_PUBLISHER", + }; + serializer.serialize_str(variant) } } -impl<'de> serde::Deserialize<'de> for ListIngressRequest { +impl<'de> serde::Deserialize<'de> for JobType { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "room_name", - "roomName", - "ingress_id", - "ingressId", + "JT_ROOM", + "JT_PUBLISHER", ]; - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - RoomName, - IngressId, - __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 = JobType; - 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 { - "roomName" | "room_name" => Ok(GeneratedField::RoomName), - "ingressId" | "ingress_id" => Ok(GeneratedField::IngressId), - _ => 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 = ListIngressRequest; - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ListIngressRequest") + 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 room_name__ = None; - let mut ingress_id__ = 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::IngressId => { - if ingress_id__.is_some() { - return Err(serde::de::Error::duplicate_field("ingressId")); - } - ingress_id__ = Some(map_.next_value()?); - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; - } - } + match value { + "JT_ROOM" => Ok(JobType::JtRoom), + "JT_PUBLISHER" => Ok(JobType::JtPublisher), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } - Ok(ListIngressRequest { - room_name: room_name__.unwrap_or_default(), - ingress_id: ingress_id__.unwrap_or_default(), - }) } } - deserializer.deserialize_struct("livekit.ListIngressRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_any(GeneratedVisitor) } } -impl serde::Serialize for ListIngressResponse { +impl serde::Serialize for JoinResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -10116,29 +11107,137 @@ impl serde::Serialize for ListIngressResponse { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.items.is_empty() { + if self.room.is_some() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.ListIngressResponse", len)?; - if !self.items.is_empty() { - struct_ser.serialize_field("items", &self.items)?; + if self.participant.is_some() { + len += 1; + } + if !self.other_participants.is_empty() { + len += 1; + } + if !self.server_version.is_empty() { + len += 1; + } + if !self.ice_servers.is_empty() { + len += 1; + } + if self.subscriber_primary { + len += 1; + } + if !self.alternative_url.is_empty() { + len += 1; + } + if self.client_configuration.is_some() { + len += 1; + } + if !self.server_region.is_empty() { + len += 1; + } + if self.ping_timeout != 0 { + len += 1; + } + if self.ping_interval != 0 { + len += 1; + } + if self.server_info.is_some() { + len += 1; + } + if !self.sif_trailer.is_empty() { + 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)?; + } + if let Some(v) = self.participant.as_ref() { + struct_ser.serialize_field("participant", v)?; + } + if !self.other_participants.is_empty() { + struct_ser.serialize_field("otherParticipants", &self.other_participants)?; + } + if !self.server_version.is_empty() { + struct_ser.serialize_field("serverVersion", &self.server_version)?; + } + if !self.ice_servers.is_empty() { + struct_ser.serialize_field("iceServers", &self.ice_servers)?; + } + if self.subscriber_primary { + struct_ser.serialize_field("subscriberPrimary", &self.subscriber_primary)?; + } + if !self.alternative_url.is_empty() { + struct_ser.serialize_field("alternativeUrl", &self.alternative_url)?; + } + if let Some(v) = self.client_configuration.as_ref() { + struct_ser.serialize_field("clientConfiguration", v)?; + } + if !self.server_region.is_empty() { + struct_ser.serialize_field("serverRegion", &self.server_region)?; + } + if self.ping_timeout != 0 { + struct_ser.serialize_field("pingTimeout", &self.ping_timeout)?; + } + if self.ping_interval != 0 { + struct_ser.serialize_field("pingInterval", &self.ping_interval)?; + } + if let Some(v) = self.server_info.as_ref() { + struct_ser.serialize_field("serverInfo", v)?; + } + if !self.sif_trailer.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sifTrailer", pbjson::private::base64::encode(&self.sif_trailer).as_str())?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for ListIngressResponse { +impl<'de> serde::Deserialize<'de> for JoinResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "items", + "room", + "participant", + "other_participants", + "otherParticipants", + "server_version", + "serverVersion", + "ice_servers", + "iceServers", + "subscriber_primary", + "subscriberPrimary", + "alternative_url", + "alternativeUrl", + "client_configuration", + "clientConfiguration", + "server_region", + "serverRegion", + "ping_timeout", + "pingTimeout", + "ping_interval", + "pingInterval", + "server_info", + "serverInfo", + "sif_trailer", + "sifTrailer", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Items, + Room, + Participant, + OtherParticipants, + ServerVersion, + IceServers, + SubscriberPrimary, + AlternativeUrl, + ClientConfiguration, + ServerRegion, + PingTimeout, + PingInterval, + ServerInfo, + SifTrailer, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -10161,9 +11260,21 @@ impl<'de> serde::Deserialize<'de> for ListIngressResponse { E: serde::de::Error, { match value { - "items" => Ok(GeneratedField::Items), - _ => Ok(GeneratedField::__SkipField__), - } + "room" => Ok(GeneratedField::Room), + "participant" => Ok(GeneratedField::Participant), + "otherParticipants" | "other_participants" => Ok(GeneratedField::OtherParticipants), + "serverVersion" | "server_version" => Ok(GeneratedField::ServerVersion), + "iceServers" | "ice_servers" => Ok(GeneratedField::IceServers), + "subscriberPrimary" | "subscriber_primary" => Ok(GeneratedField::SubscriberPrimary), + "alternativeUrl" | "alternative_url" => Ok(GeneratedField::AlternativeUrl), + "clientConfiguration" | "client_configuration" => Ok(GeneratedField::ClientConfiguration), + "serverRegion" | "server_region" => Ok(GeneratedField::ServerRegion), + "pingTimeout" | "ping_timeout" => Ok(GeneratedField::PingTimeout), + "pingInterval" | "ping_interval" => Ok(GeneratedField::PingInterval), + "serverInfo" | "server_info" => Ok(GeneratedField::ServerInfo), + "sifTrailer" | "sif_trailer" => Ok(GeneratedField::SifTrailer), + _ => Ok(GeneratedField::__SkipField__), + } } } deserializer.deserialize_identifier(GeneratedVisitor) @@ -10171,39 +11282,141 @@ impl<'de> serde::Deserialize<'de> for ListIngressResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ListIngressResponse; + type Value = JoinResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ListIngressResponse") + formatter.write_str("struct livekit.JoinResponse") } - 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 items__ = None; + let mut room__ = None; + let mut participant__ = None; + let mut other_participants__ = None; + let mut server_version__ = None; + let mut ice_servers__ = None; + let mut subscriber_primary__ = None; + let mut alternative_url__ = None; + let mut client_configuration__ = None; + let mut server_region__ = None; + let mut ping_timeout__ = None; + let mut ping_interval__ = None; + let mut server_info__ = None; + let mut sif_trailer__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Items => { - if items__.is_some() { - return Err(serde::de::Error::duplicate_field("items")); + GeneratedField::Room => { + if room__.is_some() { + return Err(serde::de::Error::duplicate_field("room")); } - items__ = Some(map_.next_value()?); + room__ = map_.next_value()?; + } + GeneratedField::Participant => { + if participant__.is_some() { + return Err(serde::de::Error::duplicate_field("participant")); + } + participant__ = map_.next_value()?; + } + GeneratedField::OtherParticipants => { + if other_participants__.is_some() { + return Err(serde::de::Error::duplicate_field("otherParticipants")); + } + other_participants__ = Some(map_.next_value()?); + } + GeneratedField::ServerVersion => { + if server_version__.is_some() { + return Err(serde::de::Error::duplicate_field("serverVersion")); + } + server_version__ = Some(map_.next_value()?); + } + GeneratedField::IceServers => { + if ice_servers__.is_some() { + return Err(serde::de::Error::duplicate_field("iceServers")); + } + ice_servers__ = Some(map_.next_value()?); + } + GeneratedField::SubscriberPrimary => { + if subscriber_primary__.is_some() { + return Err(serde::de::Error::duplicate_field("subscriberPrimary")); + } + subscriber_primary__ = Some(map_.next_value()?); + } + GeneratedField::AlternativeUrl => { + if alternative_url__.is_some() { + return Err(serde::de::Error::duplicate_field("alternativeUrl")); + } + alternative_url__ = 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::ServerRegion => { + if server_region__.is_some() { + return Err(serde::de::Error::duplicate_field("serverRegion")); + } + server_region__ = Some(map_.next_value()?); + } + GeneratedField::PingTimeout => { + if ping_timeout__.is_some() { + return Err(serde::de::Error::duplicate_field("pingTimeout")); + } + ping_timeout__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + 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::ServerInfo => { + if server_info__.is_some() { + return Err(serde::de::Error::duplicate_field("serverInfo")); + } + server_info__ = map_.next_value()?; + } + GeneratedField::SifTrailer => { + if sif_trailer__.is_some() { + return Err(serde::de::Error::duplicate_field("sifTrailer")); + } + sif_trailer__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(ListIngressResponse { - items: items__.unwrap_or_default(), + Ok(JoinResponse { + room: room__, + participant: participant__, + other_participants: other_participants__.unwrap_or_default(), + server_version: server_version__.unwrap_or_default(), + ice_servers: ice_servers__.unwrap_or_default(), + subscriber_primary: subscriber_primary__.unwrap_or_default(), + alternative_url: alternative_url__.unwrap_or_default(), + client_configuration: client_configuration__, + server_region: server_region__.unwrap_or_default(), + ping_timeout: ping_timeout__.unwrap_or_default(), + ping_interval: ping_interval__.unwrap_or_default(), + server_info: server_info__, + sif_trailer: sif_trailer__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.ListIngressResponse", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.JoinResponse", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ListParticipantsRequest { +impl serde::Serialize for LeaveRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -10211,29 +11424,58 @@ impl serde::Serialize for ListParticipantsRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.room.is_empty() { + if self.can_reconnect { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.ListParticipantsRequest", len)?; - if !self.room.is_empty() { - struct_ser.serialize_field("room", &self.room)?; + if self.reason != 0 { + len += 1; + } + if self.action != 0 { + len += 1; + } + if self.regions.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.LeaveRequest", len)?; + if self.can_reconnect { + struct_ser.serialize_field("canReconnect", &self.can_reconnect)?; + } + if self.reason != 0 { + let v = DisconnectReason::try_from(self.reason) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.reason)))?; + struct_ser.serialize_field("reason", &v)?; + } + if self.action != 0 { + let v = leave_request::Action::try_from(self.action) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.action)))?; + struct_ser.serialize_field("action", &v)?; + } + if let Some(v) = self.regions.as_ref() { + struct_ser.serialize_field("regions", v)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for ListParticipantsRequest { +impl<'de> serde::Deserialize<'de> for LeaveRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "room", + "can_reconnect", + "canReconnect", + "reason", + "action", + "regions", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Room, + CanReconnect, + Reason, + Action, + Regions, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -10256,7 +11498,10 @@ impl<'de> serde::Deserialize<'de> for ListParticipantsRequest { E: serde::de::Error, { match value { - "room" => Ok(GeneratedField::Room), + "canReconnect" | "can_reconnect" => Ok(GeneratedField::CanReconnect), + "reason" => Ok(GeneratedField::Reason), + "action" => Ok(GeneratedField::Action), + "regions" => Ok(GeneratedField::Regions), _ => Ok(GeneratedField::__SkipField__), } } @@ -10266,134 +11511,137 @@ impl<'de> serde::Deserialize<'de> for ListParticipantsRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ListParticipantsRequest; + type Value = LeaveRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ListParticipantsRequest") + formatter.write_str("struct livekit.LeaveRequest") } - 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 can_reconnect__ = None; + let mut reason__ = None; + let mut action__ = None; + let mut regions__ = 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::CanReconnect => { + if can_reconnect__.is_some() { + return Err(serde::de::Error::duplicate_field("canReconnect")); } - room__ = Some(map_.next_value()?); + can_reconnect__ = Some(map_.next_value()?); + } + GeneratedField::Reason => { + if reason__.is_some() { + return Err(serde::de::Error::duplicate_field("reason")); + } + reason__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Action => { + if action__.is_some() { + return Err(serde::de::Error::duplicate_field("action")); + } + action__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Regions => { + if regions__.is_some() { + return Err(serde::de::Error::duplicate_field("regions")); + } + regions__ = map_.next_value()?; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(ListParticipantsRequest { - room: room__.unwrap_or_default(), + Ok(LeaveRequest { + can_reconnect: can_reconnect__.unwrap_or_default(), + reason: reason__.unwrap_or_default(), + action: action__.unwrap_or_default(), + regions: regions__, }) } } - deserializer.deserialize_struct("livekit.ListParticipantsRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.LeaveRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ListParticipantsResponse { +impl serde::Serialize for leave_request::Action { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.participants.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("livekit.ListParticipantsResponse", len)?; - if !self.participants.is_empty() { - struct_ser.serialize_field("participants", &self.participants)?; - } - struct_ser.end() + let variant = match self { + Self::Disconnect => "DISCONNECT", + Self::Resume => "RESUME", + Self::Reconnect => "RECONNECT", + }; + serializer.serialize_str(variant) } } -impl<'de> serde::Deserialize<'de> for ListParticipantsResponse { +impl<'de> serde::Deserialize<'de> for leave_request::Action { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "participants", + "DISCONNECT", + "RESUME", + "RECONNECT", ]; - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Participants, - __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 = leave_request::Action; - 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 { - "participants" => Ok(GeneratedField::Participants), - _ => 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 = ListParticipantsResponse; - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ListParticipantsResponse") + 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 participants__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Participants => { - if participants__.is_some() { - return Err(serde::de::Error::duplicate_field("participants")); - } - participants__ = Some(map_.next_value()?); - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; - } - } + match value { + "DISCONNECT" => Ok(leave_request::Action::Disconnect), + "RESUME" => Ok(leave_request::Action::Resume), + "RECONNECT" => Ok(leave_request::Action::Reconnect), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } - Ok(ListParticipantsResponse { - participants: participants__.unwrap_or_default(), - }) } } - deserializer.deserialize_struct("livekit.ListParticipantsResponse", FIELDS, GeneratedVisitor) + deserializer.deserialize_any(GeneratedVisitor) } } -impl serde::Serialize for ListRoomsRequest { +impl serde::Serialize for ListAgentDispatchRequesst { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -10401,29 +11649,38 @@ impl serde::Serialize for ListRoomsRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.names.is_empty() { + if !self.dispatch_id.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.ListRoomsRequest", len)?; - if !self.names.is_empty() { - struct_ser.serialize_field("names", &self.names)?; + if !self.room.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.ListAgentDispatchRequesst", len)?; + if !self.dispatch_id.is_empty() { + struct_ser.serialize_field("dispatchId", &self.dispatch_id)?; + } + if !self.room.is_empty() { + struct_ser.serialize_field("room", &self.room)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for ListRoomsRequest { +impl<'de> serde::Deserialize<'de> for ListAgentDispatchRequesst { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "names", + "dispatch_id", + "dispatchId", + "room", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Names, + DispatchId, + Room, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -10446,7 +11703,8 @@ impl<'de> serde::Deserialize<'de> for ListRoomsRequest { E: serde::de::Error, { match value { - "names" => Ok(GeneratedField::Names), + "dispatchId" | "dispatch_id" => Ok(GeneratedField::DispatchId), + "room" => Ok(GeneratedField::Room), _ => Ok(GeneratedField::__SkipField__), } } @@ -10456,39 +11714,47 @@ impl<'de> serde::Deserialize<'de> for ListRoomsRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ListRoomsRequest; + type Value = ListAgentDispatchRequesst; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ListRoomsRequest") + formatter.write_str("struct livekit.ListAgentDispatchRequesst") } - 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 names__ = None; + let mut dispatch_id__ = None; + let mut room__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Names => { - if names__.is_some() { - return Err(serde::de::Error::duplicate_field("names")); + GeneratedField::DispatchId => { + if dispatch_id__.is_some() { + return Err(serde::de::Error::duplicate_field("dispatchId")); } - names__ = Some(map_.next_value()?); + dispatch_id__ = Some(map_.next_value()?); + } + GeneratedField::Room => { + if room__.is_some() { + return Err(serde::de::Error::duplicate_field("room")); + } + room__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(ListRoomsRequest { - names: names__.unwrap_or_default(), + Ok(ListAgentDispatchRequesst { + dispatch_id: dispatch_id__.unwrap_or_default(), + room: room__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.ListRoomsRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ListAgentDispatchRequesst", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ListRoomsResponse { +impl serde::Serialize for ListAgentDispatchResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -10496,29 +11762,30 @@ impl serde::Serialize for ListRoomsResponse { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.rooms.is_empty() { + if !self.agent_dispatches.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.ListRoomsResponse", len)?; - if !self.rooms.is_empty() { - struct_ser.serialize_field("rooms", &self.rooms)?; + let mut struct_ser = serializer.serialize_struct("livekit.ListAgentDispatchResponse", len)?; + if !self.agent_dispatches.is_empty() { + struct_ser.serialize_field("agentDispatches", &self.agent_dispatches)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for ListRoomsResponse { +impl<'de> serde::Deserialize<'de> for ListAgentDispatchResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "rooms", + "agent_dispatches", + "agentDispatches", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Rooms, + AgentDispatches, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -10541,7 +11808,7 @@ impl<'de> serde::Deserialize<'de> for ListRoomsResponse { E: serde::de::Error, { match value { - "rooms" => Ok(GeneratedField::Rooms), + "agentDispatches" | "agent_dispatches" => Ok(GeneratedField::AgentDispatches), _ => Ok(GeneratedField::__SkipField__), } } @@ -10551,61 +11818,87 @@ impl<'de> serde::Deserialize<'de> for ListRoomsResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ListRoomsResponse; + type Value = ListAgentDispatchResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ListRoomsResponse") + formatter.write_str("struct livekit.ListAgentDispatchResponse") } - 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 rooms__ = None; + let mut agent_dispatches__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Rooms => { - if rooms__.is_some() { - return Err(serde::de::Error::duplicate_field("rooms")); + GeneratedField::AgentDispatches => { + if agent_dispatches__.is_some() { + return Err(serde::de::Error::duplicate_field("agentDispatches")); } - rooms__ = Some(map_.next_value()?); + agent_dispatches__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(ListRoomsResponse { - rooms: rooms__.unwrap_or_default(), + Ok(ListAgentDispatchResponse { + agent_dispatches: agent_dispatches__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.ListRoomsResponse", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ListAgentDispatchResponse", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ListSipDispatchRuleRequest { +impl serde::Serialize for ListEgressRequest { #[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.ListSIPDispatchRuleRequest", len)?; + let mut len = 0; + if !self.room_name.is_empty() { + len += 1; + } + if !self.egress_id.is_empty() { + len += 1; + } + if self.active { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.ListEgressRequest", len)?; + if !self.room_name.is_empty() { + struct_ser.serialize_field("roomName", &self.room_name)?; + } + if !self.egress_id.is_empty() { + struct_ser.serialize_field("egressId", &self.egress_id)?; + } + if self.active { + struct_ser.serialize_field("active", &self.active)?; + } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for ListSipDispatchRuleRequest { +impl<'de> serde::Deserialize<'de> for ListEgressRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ + "room_name", + "roomName", + "egress_id", + "egressId", + "active", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { + RoomName, + EgressId, + Active, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -10627,7 +11920,12 @@ impl<'de> serde::Deserialize<'de> for ListSipDispatchRuleRequest { where E: serde::de::Error, { - Ok(GeneratedField::__SkipField__) + match value { + "roomName" | "room_name" => Ok(GeneratedField::RoomName), + "egressId" | "egress_id" => Ok(GeneratedField::EgressId), + "active" => Ok(GeneratedField::Active), + _ => Ok(GeneratedField::__SkipField__), + } } } deserializer.deserialize_identifier(GeneratedVisitor) @@ -10635,27 +11933,55 @@ impl<'de> serde::Deserialize<'de> for ListSipDispatchRuleRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ListSipDispatchRuleRequest; + type Value = ListEgressRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ListSIPDispatchRuleRequest") + formatter.write_str("struct livekit.ListEgressRequest") } - 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 room_name__ = None; + let mut egress_id__ = None; + let mut active__ = 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::EgressId => { + if egress_id__.is_some() { + return Err(serde::de::Error::duplicate_field("egressId")); + } + egress_id__ = Some(map_.next_value()?); + } + GeneratedField::Active => { + if active__.is_some() { + return Err(serde::de::Error::duplicate_field("active")); + } + active__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } } - Ok(ListSipDispatchRuleRequest { + Ok(ListEgressRequest { + room_name: room_name__.unwrap_or_default(), + egress_id: egress_id__.unwrap_or_default(), + active: active__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.ListSIPDispatchRuleRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ListEgressRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ListSipDispatchRuleResponse { +impl serde::Serialize for ListEgressResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -10666,14 +11992,14 @@ impl serde::Serialize for ListSipDispatchRuleResponse { if !self.items.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.ListSIPDispatchRuleResponse", len)?; + let mut struct_ser = serializer.serialize_struct("livekit.ListEgressResponse", len)?; if !self.items.is_empty() { struct_ser.serialize_field("items", &self.items)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for ListSipDispatchRuleResponse { +impl<'de> serde::Deserialize<'de> for ListEgressResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where @@ -10718,13 +12044,13 @@ impl<'de> serde::Deserialize<'de> for ListSipDispatchRuleResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ListSipDispatchRuleResponse; + type Value = ListEgressResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ListSIPDispatchRuleResponse") + formatter.write_str("struct livekit.ListEgressResponse") } - 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>, { @@ -10742,37 +12068,55 @@ impl<'de> serde::Deserialize<'de> for ListSipDispatchRuleResponse { } } } - Ok(ListSipDispatchRuleResponse { + Ok(ListEgressResponse { items: items__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.ListSIPDispatchRuleResponse", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ListEgressResponse", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ListSipInboundTrunkRequest { +impl serde::Serialize for ListIngressRequest { #[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.ListSIPInboundTrunkRequest", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ListSipInboundTrunkRequest { + let mut len = 0; + if !self.room_name.is_empty() { + len += 1; + } + if !self.ingress_id.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.ListIngressRequest", len)?; + if !self.room_name.is_empty() { + struct_ser.serialize_field("roomName", &self.room_name)?; + } + if !self.ingress_id.is_empty() { + struct_ser.serialize_field("ingressId", &self.ingress_id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ListIngressRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ + "room_name", + "roomName", + "ingress_id", + "ingressId", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { + RoomName, + IngressId, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -10794,7 +12138,11 @@ impl<'de> serde::Deserialize<'de> for ListSipInboundTrunkRequest { where E: serde::de::Error, { - Ok(GeneratedField::__SkipField__) + match value { + "roomName" | "room_name" => Ok(GeneratedField::RoomName), + "ingressId" | "ingress_id" => Ok(GeneratedField::IngressId), + _ => Ok(GeneratedField::__SkipField__), + } } } deserializer.deserialize_identifier(GeneratedVisitor) @@ -10802,27 +12150,47 @@ impl<'de> serde::Deserialize<'de> for ListSipInboundTrunkRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ListSipInboundTrunkRequest; + type Value = ListIngressRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ListSIPInboundTrunkRequest") + formatter.write_str("struct livekit.ListIngressRequest") } - 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 room_name__ = None; + let mut ingress_id__ = 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::IngressId => { + if ingress_id__.is_some() { + return Err(serde::de::Error::duplicate_field("ingressId")); + } + ingress_id__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } } - Ok(ListSipInboundTrunkRequest { + Ok(ListIngressRequest { + room_name: room_name__.unwrap_or_default(), + ingress_id: ingress_id__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.ListSIPInboundTrunkRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ListIngressRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ListSipInboundTrunkResponse { +impl serde::Serialize for ListIngressResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -10833,14 +12201,14 @@ impl serde::Serialize for ListSipInboundTrunkResponse { if !self.items.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.ListSIPInboundTrunkResponse", len)?; + let mut struct_ser = serializer.serialize_struct("livekit.ListIngressResponse", len)?; if !self.items.is_empty() { struct_ser.serialize_field("items", &self.items)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for ListSipInboundTrunkResponse { +impl<'de> serde::Deserialize<'de> for ListIngressResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where @@ -10885,13 +12253,13 @@ impl<'de> serde::Deserialize<'de> for ListSipInboundTrunkResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ListSipInboundTrunkResponse; + type Value = ListIngressResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ListSIPInboundTrunkResponse") + formatter.write_str("struct livekit.ListIngressResponse") } - 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>, { @@ -10909,37 +12277,45 @@ impl<'de> serde::Deserialize<'de> for ListSipInboundTrunkResponse { } } } - Ok(ListSipInboundTrunkResponse { + Ok(ListIngressResponse { items: items__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.ListSIPInboundTrunkResponse", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ListIngressResponse", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ListSipOutboundTrunkRequest { +impl serde::Serialize for ListParticipantsRequest { #[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.ListSIPOutboundTrunkRequest", len)?; + let mut len = 0; + if !self.room.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.ListParticipantsRequest", len)?; + if !self.room.is_empty() { + struct_ser.serialize_field("room", &self.room)?; + } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for ListSipOutboundTrunkRequest { +impl<'de> serde::Deserialize<'de> for ListParticipantsRequest { #[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__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -10961,7 +12337,10 @@ impl<'de> serde::Deserialize<'de> for ListSipOutboundTrunkRequest { where E: serde::de::Error, { - Ok(GeneratedField::__SkipField__) + match value { + "room" => Ok(GeneratedField::Room), + _ => Ok(GeneratedField::__SkipField__), + } } } deserializer.deserialize_identifier(GeneratedVisitor) @@ -10969,27 +12348,39 @@ impl<'de> serde::Deserialize<'de> for ListSipOutboundTrunkRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ListSipOutboundTrunkRequest; + type Value = ListParticipantsRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ListSIPOutboundTrunkRequest") + formatter.write_str("struct livekit.ListParticipantsRequest") } - 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 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__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } } - Ok(ListSipOutboundTrunkRequest { + Ok(ListParticipantsRequest { + room: room__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.ListSIPOutboundTrunkRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ListParticipantsRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ListSipOutboundTrunkResponse { +impl serde::Serialize for ListParticipantsResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -10997,29 +12388,29 @@ impl serde::Serialize for ListSipOutboundTrunkResponse { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.items.is_empty() { + if !self.participants.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.ListSIPOutboundTrunkResponse", len)?; - if !self.items.is_empty() { - struct_ser.serialize_field("items", &self.items)?; + let mut struct_ser = serializer.serialize_struct("livekit.ListParticipantsResponse", len)?; + if !self.participants.is_empty() { + struct_ser.serialize_field("participants", &self.participants)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for ListSipOutboundTrunkResponse { +impl<'de> serde::Deserialize<'de> for ListParticipantsResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "items", + "participants", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Items, + Participants, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -11042,7 +12433,7 @@ impl<'de> serde::Deserialize<'de> for ListSipOutboundTrunkResponse { E: serde::de::Error, { match value { - "items" => Ok(GeneratedField::Items), + "participants" => Ok(GeneratedField::Participants), _ => Ok(GeneratedField::__SkipField__), } } @@ -11052,61 +12443,69 @@ impl<'de> serde::Deserialize<'de> for ListSipOutboundTrunkResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ListSipOutboundTrunkResponse; + type Value = ListParticipantsResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ListSIPOutboundTrunkResponse") + formatter.write_str("struct livekit.ListParticipantsResponse") } - 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 items__ = None; + let mut participants__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Items => { - if items__.is_some() { - return Err(serde::de::Error::duplicate_field("items")); + GeneratedField::Participants => { + if participants__.is_some() { + return Err(serde::de::Error::duplicate_field("participants")); } - items__ = Some(map_.next_value()?); + participants__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(ListSipOutboundTrunkResponse { - items: items__.unwrap_or_default(), + Ok(ListParticipantsResponse { + participants: participants__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.ListSIPOutboundTrunkResponse", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ListParticipantsResponse", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ListSipTrunkRequest { +impl serde::Serialize for ListRoomsRequest { #[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.ListSIPTrunkRequest", len)?; + let mut len = 0; + if !self.names.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.ListRoomsRequest", len)?; + if !self.names.is_empty() { + struct_ser.serialize_field("names", &self.names)?; + } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for ListSipTrunkRequest { +impl<'de> serde::Deserialize<'de> for ListRoomsRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ + "names", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { + Names, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -11128,7 +12527,10 @@ impl<'de> serde::Deserialize<'de> for ListSipTrunkRequest { where E: serde::de::Error, { - Ok(GeneratedField::__SkipField__) + match value { + "names" => Ok(GeneratedField::Names), + _ => Ok(GeneratedField::__SkipField__), + } } } deserializer.deserialize_identifier(GeneratedVisitor) @@ -11136,27 +12538,39 @@ impl<'de> serde::Deserialize<'de> for ListSipTrunkRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ListSipTrunkRequest; + type Value = ListRoomsRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ListSIPTrunkRequest") + formatter.write_str("struct livekit.ListRoomsRequest") } - 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 names__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Names => { + if names__.is_some() { + return Err(serde::de::Error::duplicate_field("names")); + } + names__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } } - Ok(ListSipTrunkRequest { + Ok(ListRoomsRequest { + names: names__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.ListSIPTrunkRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ListRoomsRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ListSipTrunkResponse { +impl serde::Serialize for ListRoomsResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -11164,29 +12578,29 @@ impl serde::Serialize for ListSipTrunkResponse { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.items.is_empty() { + if !self.rooms.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.ListSIPTrunkResponse", len)?; - if !self.items.is_empty() { - struct_ser.serialize_field("items", &self.items)?; + let mut struct_ser = serializer.serialize_struct("livekit.ListRoomsResponse", len)?; + if !self.rooms.is_empty() { + struct_ser.serialize_field("rooms", &self.rooms)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for ListSipTrunkResponse { +impl<'de> serde::Deserialize<'de> for ListRoomsResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "items", + "rooms", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Items, + Rooms, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -11209,7 +12623,7 @@ impl<'de> serde::Deserialize<'de> for ListSipTrunkResponse { E: serde::de::Error, { match value { - "items" => Ok(GeneratedField::Items), + "rooms" => Ok(GeneratedField::Rooms), _ => Ok(GeneratedField::__SkipField__), } } @@ -11219,94 +12633,141 @@ impl<'de> serde::Deserialize<'de> for ListSipTrunkResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ListSipTrunkResponse; + type Value = ListRoomsResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ListSIPTrunkResponse") + formatter.write_str("struct livekit.ListRoomsResponse") } - 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 items__ = None; + let mut rooms__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Items => { - if items__.is_some() { - return Err(serde::de::Error::duplicate_field("items")); + GeneratedField::Rooms => { + if rooms__.is_some() { + return Err(serde::de::Error::duplicate_field("rooms")); } - items__ = Some(map_.next_value()?); + rooms__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(ListSipTrunkResponse { - items: items__.unwrap_or_default(), + Ok(ListRoomsResponse { + rooms: rooms__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.ListSIPTrunkResponse", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ListRoomsResponse", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for MuteRoomTrackRequest { +impl serde::Serialize for ListSipDispatchRuleRequest { #[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.is_empty() { - len += 1; + let len = 0; + let struct_ser = serializer.serialize_struct("livekit.ListSIPDispatchRuleRequest", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ListSipDispatchRuleRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + __SkipField__, } - if !self.identity.is_empty() { - len += 1; + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + Ok(GeneratedField::__SkipField__) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } } - if !self.track_sid.is_empty() { - len += 1; + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ListSipDispatchRuleRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.ListSIPDispatchRuleRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(ListSipDispatchRuleRequest { + }) + } } - if self.muted { + deserializer.deserialize_struct("livekit.ListSIPDispatchRuleRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ListSipDispatchRuleResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.items.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.MuteRoomTrackRequest", len)?; - if !self.room.is_empty() { - struct_ser.serialize_field("room", &self.room)?; - } - if !self.identity.is_empty() { - struct_ser.serialize_field("identity", &self.identity)?; - } - if !self.track_sid.is_empty() { - struct_ser.serialize_field("trackSid", &self.track_sid)?; - } - if self.muted { - struct_ser.serialize_field("muted", &self.muted)?; + let mut struct_ser = serializer.serialize_struct("livekit.ListSIPDispatchRuleResponse", len)?; + if !self.items.is_empty() { + struct_ser.serialize_field("items", &self.items)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for MuteRoomTrackRequest { +impl<'de> serde::Deserialize<'de> for ListSipDispatchRuleResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "room", - "identity", - "track_sid", - "trackSid", - "muted", + "items", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Room, - Identity, - TrackSid, - Muted, + Items, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -11329,10 +12790,7 @@ impl<'de> serde::Deserialize<'de> for MuteRoomTrackRequest { E: serde::de::Error, { match value { - "room" => Ok(GeneratedField::Room), - "identity" => Ok(GeneratedField::Identity), - "trackSid" | "track_sid" => Ok(GeneratedField::TrackSid), - "muted" => Ok(GeneratedField::Muted), + "items" => Ok(GeneratedField::Items), _ => Ok(GeneratedField::__SkipField__), } } @@ -11342,93 +12800,61 @@ impl<'de> serde::Deserialize<'de> for MuteRoomTrackRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MuteRoomTrackRequest; + type Value = ListSipDispatchRuleResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.MuteRoomTrackRequest") + formatter.write_str("struct livekit.ListSIPDispatchRuleResponse") } - 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 track_sid__ = None; - let mut muted__ = None; + let mut items__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Room => { - if room__.is_some() { - return Err(serde::de::Error::duplicate_field("room")); - } - room__ = Some(map_.next_value()?); - } - GeneratedField::Identity => { - if identity__.is_some() { - return Err(serde::de::Error::duplicate_field("identity")); - } - identity__ = Some(map_.next_value()?); - } - GeneratedField::TrackSid => { - if track_sid__.is_some() { - return Err(serde::de::Error::duplicate_field("trackSid")); - } - track_sid__ = Some(map_.next_value()?); - } - GeneratedField::Muted => { - if muted__.is_some() { - return Err(serde::de::Error::duplicate_field("muted")); + GeneratedField::Items => { + if items__.is_some() { + return Err(serde::de::Error::duplicate_field("items")); } - muted__ = Some(map_.next_value()?); + items__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(MuteRoomTrackRequest { - room: room__.unwrap_or_default(), - identity: identity__.unwrap_or_default(), - track_sid: track_sid__.unwrap_or_default(), - muted: muted__.unwrap_or_default(), + Ok(ListSipDispatchRuleResponse { + items: items__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.MuteRoomTrackRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ListSIPDispatchRuleResponse", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for MuteRoomTrackResponse { +impl serde::Serialize for ListSipInboundTrunkRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { use serde::ser::SerializeStruct; - let mut len = 0; - if self.track.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("livekit.MuteRoomTrackResponse", len)?; - if let Some(v) = self.track.as_ref() { - struct_ser.serialize_field("track", v)?; - } + let len = 0; + let struct_ser = serializer.serialize_struct("livekit.ListSIPInboundTrunkRequest", len)?; struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for MuteRoomTrackResponse { +impl<'de> serde::Deserialize<'de> for ListSipInboundTrunkRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "track", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Track, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -11450,10 +12876,7 @@ impl<'de> serde::Deserialize<'de> for MuteRoomTrackResponse { where E: serde::de::Error, { - match value { - "track" => Ok(GeneratedField::Track), - _ => Ok(GeneratedField::__SkipField__), - } + Ok(GeneratedField::__SkipField__) } } deserializer.deserialize_identifier(GeneratedVisitor) @@ -11461,39 +12884,27 @@ impl<'de> serde::Deserialize<'de> for MuteRoomTrackResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MuteRoomTrackResponse; + type Value = ListSipInboundTrunkRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.MuteRoomTrackResponse") + formatter.write_str("struct livekit.ListSIPInboundTrunkRequest") } - 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 track__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Track => { - if track__.is_some() { - return Err(serde::de::Error::duplicate_field("track")); - } - track__ = map_.next_value()?; - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; - } - } + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; } - Ok(MuteRoomTrackResponse { - track: track__, + Ok(ListSipInboundTrunkRequest { }) } } - deserializer.deserialize_struct("livekit.MuteRoomTrackResponse", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ListSIPInboundTrunkRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for MuteTrackRequest { +impl serde::Serialize for ListSipInboundTrunkResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -11501,37 +12912,29 @@ impl serde::Serialize for MuteTrackRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.sid.is_empty() { - len += 1; - } - if self.muted { + if !self.items.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.MuteTrackRequest", len)?; - if !self.sid.is_empty() { - struct_ser.serialize_field("sid", &self.sid)?; - } - if self.muted { - struct_ser.serialize_field("muted", &self.muted)?; + let mut struct_ser = serializer.serialize_struct("livekit.ListSIPInboundTrunkResponse", len)?; + if !self.items.is_empty() { + struct_ser.serialize_field("items", &self.items)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for MuteTrackRequest { +impl<'de> serde::Deserialize<'de> for ListSipInboundTrunkResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "sid", - "muted", + "items", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Sid, - Muted, + Items, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -11554,8 +12957,7 @@ impl<'de> serde::Deserialize<'de> for MuteTrackRequest { E: serde::de::Error, { match value { - "sid" => Ok(GeneratedField::Sid), - "muted" => Ok(GeneratedField::Muted), + "items" => Ok(GeneratedField::Items), _ => Ok(GeneratedField::__SkipField__), } } @@ -11565,150 +12967,141 @@ impl<'de> serde::Deserialize<'de> for MuteTrackRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MuteTrackRequest; + type Value = ListSipInboundTrunkResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.MuteTrackRequest") + formatter.write_str("struct livekit.ListSIPInboundTrunkResponse") } - 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 muted__ = None; + let mut items__ = 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::Muted => { - if muted__.is_some() { - return Err(serde::de::Error::duplicate_field("muted")); + GeneratedField::Items => { + if items__.is_some() { + return Err(serde::de::Error::duplicate_field("items")); } - muted__ = Some(map_.next_value()?); + items__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(MuteTrackRequest { - sid: sid__.unwrap_or_default(), - muted: muted__.unwrap_or_default(), + Ok(ListSipInboundTrunkResponse { + items: items__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.MuteTrackRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ListSIPInboundTrunkResponse", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ParticipantEgressRequest { +impl serde::Serialize for ListSipOutboundTrunkRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { use serde::ser::SerializeStruct; - let mut len = 0; - if !self.room_name.is_empty() { - len += 1; - } - if !self.identity.is_empty() { - len += 1; - } - if self.screen_share { - len += 1; - } - if !self.file_outputs.is_empty() { - len += 1; - } - if !self.stream_outputs.is_empty() { - len += 1; + let len = 0; + let struct_ser = serializer.serialize_struct("livekit.ListSIPOutboundTrunkRequest", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ListSipOutboundTrunkRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + __SkipField__, } - if !self.segment_outputs.is_empty() { - len += 1; + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + Ok(GeneratedField::__SkipField__) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } } - if !self.image_outputs.is_empty() { - len += 1; + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ListSipOutboundTrunkRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.ListSIPOutboundTrunkRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(ListSipOutboundTrunkRequest { + }) + } } - if self.options.is_some() { + deserializer.deserialize_struct("livekit.ListSIPOutboundTrunkRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ListSipOutboundTrunkResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.items.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.ParticipantEgressRequest", len)?; - if !self.room_name.is_empty() { - struct_ser.serialize_field("roomName", &self.room_name)?; - } - if !self.identity.is_empty() { - struct_ser.serialize_field("identity", &self.identity)?; - } - if self.screen_share { - struct_ser.serialize_field("screenShare", &self.screen_share)?; - } - 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.options.as_ref() { - match v { - participant_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)?; - } - participant_egress_request::Options::Advanced(v) => { - struct_ser.serialize_field("advanced", v)?; - } - } + let mut struct_ser = serializer.serialize_struct("livekit.ListSIPOutboundTrunkResponse", len)?; + if !self.items.is_empty() { + struct_ser.serialize_field("items", &self.items)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for ParticipantEgressRequest { +impl<'de> serde::Deserialize<'de> for ListSipOutboundTrunkResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "room_name", - "roomName", - "identity", - "screen_share", - "screenShare", - "file_outputs", - "fileOutputs", - "stream_outputs", - "streamOutputs", - "segment_outputs", - "segmentOutputs", - "image_outputs", - "imageOutputs", - "preset", - "advanced", + "items", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - RoomName, - Identity, - ScreenShare, - FileOutputs, - StreamOutputs, - SegmentOutputs, - ImageOutputs, - Preset, - Advanced, + Items, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -11731,15 +13124,7 @@ impl<'de> serde::Deserialize<'de> for ParticipantEgressRequest { E: serde::de::Error, { match value { - "roomName" | "room_name" => Ok(GeneratedField::RoomName), - "identity" => Ok(GeneratedField::Identity), - "screenShare" | "screen_share" => Ok(GeneratedField::ScreenShare), - "fileOutputs" | "file_outputs" => Ok(GeneratedField::FileOutputs), - "streamOutputs" | "stream_outputs" => Ok(GeneratedField::StreamOutputs), - "segmentOutputs" | "segment_outputs" => Ok(GeneratedField::SegmentOutputs), - "imageOutputs" | "image_outputs" => Ok(GeneratedField::ImageOutputs), - "preset" => Ok(GeneratedField::Preset), - "advanced" => Ok(GeneratedField::Advanced), + "items" => Ok(GeneratedField::Items), _ => Ok(GeneratedField::__SkipField__), } } @@ -11749,235 +13134,141 @@ impl<'de> serde::Deserialize<'de> for ParticipantEgressRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ParticipantEgressRequest; + type Value = ListSipOutboundTrunkResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ParticipantEgressRequest") + formatter.write_str("struct livekit.ListSIPOutboundTrunkResponse") } - 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 identity__ = None; - let mut screen_share__ = None; - let mut file_outputs__ = None; - let mut stream_outputs__ = None; - let mut segment_outputs__ = None; - let mut image_outputs__ = None; - let mut options__ = None; + let mut items__ = 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::Identity => { - if identity__.is_some() { - return Err(serde::de::Error::duplicate_field("identity")); - } - identity__ = Some(map_.next_value()?); - } - GeneratedField::ScreenShare => { - if screen_share__.is_some() { - return Err(serde::de::Error::duplicate_field("screenShare")); - } - screen_share__ = 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::Preset => { - if options__.is_some() { - return Err(serde::de::Error::duplicate_field("preset")); - } - options__ = map_.next_value::<::std::option::Option>()?.map(|x| participant_egress_request::Options::Preset(x as i32)); - } - GeneratedField::Advanced => { - if options__.is_some() { - return Err(serde::de::Error::duplicate_field("advanced")); + GeneratedField::Items => { + if items__.is_some() { + return Err(serde::de::Error::duplicate_field("items")); } - options__ = map_.next_value::<::std::option::Option<_>>()?.map(participant_egress_request::Options::Advanced) -; + items__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(ParticipantEgressRequest { - room_name: room_name__.unwrap_or_default(), - identity: identity__.unwrap_or_default(), - screen_share: screen_share__.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(), - options: options__, + Ok(ListSipOutboundTrunkResponse { + items: items__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.ParticipantEgressRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ListSIPOutboundTrunkResponse", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ParticipantInfo { +impl serde::Serialize for ListSipTrunkRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { use serde::ser::SerializeStruct; - let mut len = 0; - if !self.sid.is_empty() { - len += 1; - } - if !self.identity.is_empty() { - len += 1; - } - if self.state != 0 { - len += 1; - } - if !self.tracks.is_empty() { - len += 1; - } - if !self.metadata.is_empty() { - len += 1; - } - if self.joined_at != 0 { - len += 1; - } - if !self.name.is_empty() { - len += 1; - } - if self.version != 0 { - len += 1; - } - if self.permission.is_some() { - len += 1; - } - if !self.region.is_empty() { - len += 1; + let len = 0; + let struct_ser = serializer.serialize_struct("livekit.ListSIPTrunkRequest", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ListSipTrunkRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + __SkipField__, } - if self.is_publisher { - len += 1; + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + Ok(GeneratedField::__SkipField__) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } } - if self.kind != 0 { - len += 1; + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ListSipTrunkRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.ListSIPTrunkRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(ListSipTrunkRequest { + }) + } } - if !self.attributes.is_empty() { + deserializer.deserialize_struct("livekit.ListSIPTrunkRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ListSipTrunkResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.items.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.ParticipantInfo", len)?; - if !self.sid.is_empty() { - struct_ser.serialize_field("sid", &self.sid)?; - } - if !self.identity.is_empty() { - struct_ser.serialize_field("identity", &self.identity)?; - } - if self.state != 0 { - let v = participant_info::State::try_from(self.state) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.state)))?; - struct_ser.serialize_field("state", &v)?; - } - if !self.tracks.is_empty() { - struct_ser.serialize_field("tracks", &self.tracks)?; - } - if !self.metadata.is_empty() { - struct_ser.serialize_field("metadata", &self.metadata)?; - } - if self.joined_at != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("joinedAt", ToString::to_string(&self.joined_at).as_str())?; - } - if !self.name.is_empty() { - struct_ser.serialize_field("name", &self.name)?; - } - if self.version != 0 { - struct_ser.serialize_field("version", &self.version)?; - } - if let Some(v) = self.permission.as_ref() { - struct_ser.serialize_field("permission", v)?; - } - if !self.region.is_empty() { - struct_ser.serialize_field("region", &self.region)?; - } - if self.is_publisher { - struct_ser.serialize_field("isPublisher", &self.is_publisher)?; - } - if self.kind != 0 { - let v = participant_info::Kind::try_from(self.kind) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.kind)))?; - struct_ser.serialize_field("kind", &v)?; - } - if !self.attributes.is_empty() { - struct_ser.serialize_field("attributes", &self.attributes)?; + let mut struct_ser = serializer.serialize_struct("livekit.ListSIPTrunkResponse", len)?; + if !self.items.is_empty() { + struct_ser.serialize_field("items", &self.items)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for ParticipantInfo { +impl<'de> serde::Deserialize<'de> for ListSipTrunkResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "sid", - "identity", - "state", - "tracks", - "metadata", - "joined_at", - "joinedAt", - "name", - "version", - "permission", - "region", - "is_publisher", - "isPublisher", - "kind", - "attributes", + "items", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Sid, - Identity, - State, - Tracks, - Metadata, - JoinedAt, - Name, - Version, - Permission, - Region, - IsPublisher, - Kind, - Attributes, + Items, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -12000,19 +13291,7 @@ impl<'de> serde::Deserialize<'de> for ParticipantInfo { E: serde::de::Error, { match value { - "sid" => Ok(GeneratedField::Sid), - "identity" => Ok(GeneratedField::Identity), - "state" => Ok(GeneratedField::State), - "tracks" => Ok(GeneratedField::Tracks), - "metadata" => Ok(GeneratedField::Metadata), - "joinedAt" | "joined_at" => Ok(GeneratedField::JoinedAt), - "name" => Ok(GeneratedField::Name), - "version" => Ok(GeneratedField::Version), - "permission" => Ok(GeneratedField::Permission), - "region" => Ok(GeneratedField::Region), - "isPublisher" | "is_publisher" => Ok(GeneratedField::IsPublisher), - "kind" => Ok(GeneratedField::Kind), - "attributes" => Ok(GeneratedField::Attributes), + "items" => Ok(GeneratedField::Items), _ => Ok(GeneratedField::__SkipField__), } } @@ -12022,298 +13301,135 @@ impl<'de> serde::Deserialize<'de> for ParticipantInfo { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ParticipantInfo; + type Value = ListSipTrunkResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ParticipantInfo") + formatter.write_str("struct livekit.ListSIPTrunkResponse") } - 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 identity__ = None; - let mut state__ = None; - let mut tracks__ = None; - let mut metadata__ = None; - let mut joined_at__ = None; - let mut name__ = None; - let mut version__ = None; - let mut permission__ = None; - let mut region__ = None; - let mut is_publisher__ = None; - let mut kind__ = None; - let mut attributes__ = None; + let mut items__ = 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::Identity => { - if identity__.is_some() { - return Err(serde::de::Error::duplicate_field("identity")); - } - identity__ = Some(map_.next_value()?); - } - GeneratedField::State => { - if state__.is_some() { - return Err(serde::de::Error::duplicate_field("state")); - } - state__ = Some(map_.next_value::()? as i32); - } - GeneratedField::Tracks => { - if tracks__.is_some() { - return Err(serde::de::Error::duplicate_field("tracks")); + GeneratedField::Items => { + if items__.is_some() { + return Err(serde::de::Error::duplicate_field("items")); } - tracks__ = Some(map_.next_value()?); + items__ = Some(map_.next_value()?); } - GeneratedField::Metadata => { - if metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("metadata")); - } - metadata__ = Some(map_.next_value()?); - } - GeneratedField::JoinedAt => { - if joined_at__.is_some() { - return Err(serde::de::Error::duplicate_field("joinedAt")); - } - joined_at__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); - } - name__ = Some(map_.next_value()?); - } - GeneratedField::Version => { - if version__.is_some() { - return Err(serde::de::Error::duplicate_field("version")); - } - version__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Permission => { - if permission__.is_some() { - return Err(serde::de::Error::duplicate_field("permission")); - } - permission__ = map_.next_value()?; - } - GeneratedField::Region => { - if region__.is_some() { - return Err(serde::de::Error::duplicate_field("region")); - } - region__ = Some(map_.next_value()?); - } - GeneratedField::IsPublisher => { - if is_publisher__.is_some() { - return Err(serde::de::Error::duplicate_field("isPublisher")); - } - is_publisher__ = Some(map_.next_value()?); - } - GeneratedField::Kind => { - if kind__.is_some() { - return Err(serde::de::Error::duplicate_field("kind")); - } - kind__ = Some(map_.next_value::()? as i32); - } - GeneratedField::Attributes => { - if attributes__.is_some() { - return Err(serde::de::Error::duplicate_field("attributes")); - } - attributes__ = Some( - map_.next_value::>()? - ); - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; } } } - Ok(ParticipantInfo { - sid: sid__.unwrap_or_default(), - identity: identity__.unwrap_or_default(), - state: state__.unwrap_or_default(), - tracks: tracks__.unwrap_or_default(), - metadata: metadata__.unwrap_or_default(), - joined_at: joined_at__.unwrap_or_default(), - name: name__.unwrap_or_default(), - version: version__.unwrap_or_default(), - permission: permission__, - region: region__.unwrap_or_default(), - is_publisher: is_publisher__.unwrap_or_default(), - kind: kind__.unwrap_or_default(), - attributes: attributes__.unwrap_or_default(), + Ok(ListSipTrunkResponse { + items: items__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.ParticipantInfo", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ListSIPTrunkResponse", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for participant_info::Kind { +impl serde::Serialize for MigrateJobRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { - let variant = match self { - Self::Standard => "STANDARD", - Self::Ingress => "INGRESS", - Self::Egress => "EGRESS", - Self::Sip => "SIP", - Self::Agent => "AGENT", - }; - serializer.serialize_str(variant) + 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 participant_info::Kind { +impl<'de> serde::Deserialize<'de> for MigrateJobRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "STANDARD", - "INGRESS", - "EGRESS", - "SIP", - "AGENT", + "job_ids", + "jobIds", ]; - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = participant_info::Kind; - - 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 + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + JobIds, + __SkipField__, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result where - E: serde::de::Error, + D: serde::Deserializer<'de>, { - 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; - 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) - }) - } + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "STANDARD" => Ok(participant_info::Kind::Standard), - "INGRESS" => Ok(participant_info::Kind::Ingress), - "EGRESS" => Ok(participant_info::Kind::Egress), - "SIP" => Ok(participant_info::Kind::Sip), - "AGENT" => Ok(participant_info::Kind::Agent), - _ => Err(serde::de::Error::unknown_variant(value, 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 { + "jobIds" | "job_ids" => Ok(GeneratedField::JobIds), + _ => Ok(GeneratedField::__SkipField__), + } + } } + deserializer.deserialize_identifier(GeneratedVisitor) } } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for participant_info::State { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::Joining => "JOINING", - Self::Joined => "JOINED", - Self::Active => "ACTIVE", - Self::Disconnected => "DISCONNECTED", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for participant_info::State { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "JOINING", - "JOINED", - "ACTIVE", - "DISCONNECTED", - ]; - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = participant_info::State; + type Value = MigrateJobRequest; 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) - }) + formatter.write_str("struct livekit.MigrateJobRequest") } - 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 { - "JOINING" => Ok(participant_info::State::Joining), - "JOINED" => Ok(participant_info::State::Joined), - "ACTIVE" => Ok(participant_info::State::Active), - "DISCONNECTED" => Ok(participant_info::State::Disconnected), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + let mut job_ids__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::JobIds => { + if job_ids__.is_some() { + return Err(serde::de::Error::duplicate_field("jobIds")); + } + job_ids__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } } + Ok(MigrateJobRequest { + job_ids: job_ids__.unwrap_or_default(), + }) } } - deserializer.deserialize_any(GeneratedVisitor) + deserializer.deserialize_struct("livekit.MigrateJobRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ParticipantPermission { +impl serde::Serialize for MuteRoomTrackRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -12321,94 +13437,54 @@ impl serde::Serialize for ParticipantPermission { { use serde::ser::SerializeStruct; let mut len = 0; - if self.can_subscribe { + if !self.room.is_empty() { len += 1; } - if self.can_publish { + if !self.identity.is_empty() { len += 1; } - if self.can_publish_data { + if !self.track_sid.is_empty() { len += 1; } - if !self.can_publish_sources.is_empty() { + if self.muted { len += 1; } - if self.hidden { - len += 1; + let mut struct_ser = serializer.serialize_struct("livekit.MuteRoomTrackRequest", len)?; + if !self.room.is_empty() { + struct_ser.serialize_field("room", &self.room)?; } - if self.recorder { - len += 1; - } - if self.can_update_metadata { - len += 1; - } - if self.agent { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("livekit.ParticipantPermission", len)?; - if self.can_subscribe { - struct_ser.serialize_field("canSubscribe", &self.can_subscribe)?; - } - if self.can_publish { - struct_ser.serialize_field("canPublish", &self.can_publish)?; - } - if self.can_publish_data { - struct_ser.serialize_field("canPublishData", &self.can_publish_data)?; - } - if !self.can_publish_sources.is_empty() { - let v = self.can_publish_sources.iter().cloned().map(|v| { - TrackSource::try_from(v) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", v))) - }).collect::, _>>()?; - struct_ser.serialize_field("canPublishSources", &v)?; - } - if self.hidden { - struct_ser.serialize_field("hidden", &self.hidden)?; - } - if self.recorder { - struct_ser.serialize_field("recorder", &self.recorder)?; + if !self.identity.is_empty() { + struct_ser.serialize_field("identity", &self.identity)?; } - if self.can_update_metadata { - struct_ser.serialize_field("canUpdateMetadata", &self.can_update_metadata)?; + if !self.track_sid.is_empty() { + struct_ser.serialize_field("trackSid", &self.track_sid)?; } - if self.agent { - struct_ser.serialize_field("agent", &self.agent)?; + if self.muted { + struct_ser.serialize_field("muted", &self.muted)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for ParticipantPermission { +impl<'de> serde::Deserialize<'de> for MuteRoomTrackRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "can_subscribe", - "canSubscribe", - "can_publish", - "canPublish", - "can_publish_data", - "canPublishData", - "can_publish_sources", - "canPublishSources", - "hidden", - "recorder", - "can_update_metadata", - "canUpdateMetadata", - "agent", + "room", + "identity", + "track_sid", + "trackSid", + "muted", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - CanSubscribe, - CanPublish, - CanPublishData, - CanPublishSources, - Hidden, - Recorder, - CanUpdateMetadata, - Agent, + Room, + Identity, + TrackSid, + Muted, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -12431,14 +13507,10 @@ impl<'de> serde::Deserialize<'de> for ParticipantPermission { E: serde::de::Error, { match value { - "canSubscribe" | "can_subscribe" => Ok(GeneratedField::CanSubscribe), - "canPublish" | "can_publish" => Ok(GeneratedField::CanPublish), - "canPublishData" | "can_publish_data" => Ok(GeneratedField::CanPublishData), - "canPublishSources" | "can_publish_sources" => Ok(GeneratedField::CanPublishSources), - "hidden" => Ok(GeneratedField::Hidden), - "recorder" => Ok(GeneratedField::Recorder), - "canUpdateMetadata" | "can_update_metadata" => Ok(GeneratedField::CanUpdateMetadata), - "agent" => Ok(GeneratedField::Agent), + "room" => Ok(GeneratedField::Room), + "identity" => Ok(GeneratedField::Identity), + "trackSid" | "track_sid" => Ok(GeneratedField::TrackSid), + "muted" => Ok(GeneratedField::Muted), _ => Ok(GeneratedField::__SkipField__), } } @@ -12448,95 +13520,63 @@ impl<'de> serde::Deserialize<'de> for ParticipantPermission { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ParticipantPermission; + type Value = MuteRoomTrackRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ParticipantPermission") + formatter.write_str("struct livekit.MuteRoomTrackRequest") } - 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 can_subscribe__ = None; - let mut can_publish__ = None; - let mut can_publish_data__ = None; - let mut can_publish_sources__ = None; - let mut hidden__ = None; - let mut recorder__ = None; - let mut can_update_metadata__ = None; - let mut agent__ = None; + let mut room__ = None; + let mut identity__ = None; + let mut track_sid__ = None; + let mut muted__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::CanSubscribe => { - if can_subscribe__.is_some() { - return Err(serde::de::Error::duplicate_field("canSubscribe")); - } - can_subscribe__ = Some(map_.next_value()?); - } - GeneratedField::CanPublish => { - if can_publish__.is_some() { - return Err(serde::de::Error::duplicate_field("canPublish")); - } - can_publish__ = Some(map_.next_value()?); - } - GeneratedField::CanPublishData => { - if can_publish_data__.is_some() { - return Err(serde::de::Error::duplicate_field("canPublishData")); - } - can_publish_data__ = Some(map_.next_value()?); - } - GeneratedField::CanPublishSources => { - if can_publish_sources__.is_some() { - return Err(serde::de::Error::duplicate_field("canPublishSources")); - } - can_publish_sources__ = Some(map_.next_value::>()?.into_iter().map(|x| x as i32).collect()); - } - GeneratedField::Hidden => { - if hidden__.is_some() { - return Err(serde::de::Error::duplicate_field("hidden")); + GeneratedField::Room => { + if room__.is_some() { + return Err(serde::de::Error::duplicate_field("room")); } - hidden__ = Some(map_.next_value()?); + room__ = Some(map_.next_value()?); } - GeneratedField::Recorder => { - if recorder__.is_some() { - return Err(serde::de::Error::duplicate_field("recorder")); + GeneratedField::Identity => { + if identity__.is_some() { + return Err(serde::de::Error::duplicate_field("identity")); } - recorder__ = Some(map_.next_value()?); + identity__ = Some(map_.next_value()?); } - GeneratedField::CanUpdateMetadata => { - if can_update_metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("canUpdateMetadata")); + GeneratedField::TrackSid => { + if track_sid__.is_some() { + return Err(serde::de::Error::duplicate_field("trackSid")); } - can_update_metadata__ = Some(map_.next_value()?); + track_sid__ = Some(map_.next_value()?); } - GeneratedField::Agent => { - if agent__.is_some() { - return Err(serde::de::Error::duplicate_field("agent")); + GeneratedField::Muted => { + if muted__.is_some() { + return Err(serde::de::Error::duplicate_field("muted")); } - agent__ = Some(map_.next_value()?); + muted__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(ParticipantPermission { - can_subscribe: can_subscribe__.unwrap_or_default(), - can_publish: can_publish__.unwrap_or_default(), - can_publish_data: can_publish_data__.unwrap_or_default(), - can_publish_sources: can_publish_sources__.unwrap_or_default(), - hidden: hidden__.unwrap_or_default(), - recorder: recorder__.unwrap_or_default(), - can_update_metadata: can_update_metadata__.unwrap_or_default(), - agent: agent__.unwrap_or_default(), + Ok(MuteRoomTrackRequest { + room: room__.unwrap_or_default(), + identity: identity__.unwrap_or_default(), + track_sid: track_sid__.unwrap_or_default(), + muted: muted__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.ParticipantPermission", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.MuteRoomTrackRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ParticipantTracks { +impl serde::Serialize for MuteRoomTrackResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -12544,39 +13584,29 @@ impl serde::Serialize for ParticipantTracks { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.participant_sid.is_empty() { - len += 1; - } - if !self.track_sids.is_empty() { + if self.track.is_some() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.ParticipantTracks", len)?; - if !self.participant_sid.is_empty() { - struct_ser.serialize_field("participantSid", &self.participant_sid)?; - } - if !self.track_sids.is_empty() { - struct_ser.serialize_field("trackSids", &self.track_sids)?; + let mut struct_ser = serializer.serialize_struct("livekit.MuteRoomTrackResponse", len)?; + if let Some(v) = self.track.as_ref() { + struct_ser.serialize_field("track", v)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for ParticipantTracks { +impl<'de> serde::Deserialize<'de> for MuteRoomTrackResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "participant_sid", - "participantSid", - "track_sids", - "trackSids", + "track", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - ParticipantSid, - TrackSids, + Track, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -12599,8 +13629,7 @@ impl<'de> serde::Deserialize<'de> for ParticipantTracks { E: serde::de::Error, { match value { - "participantSid" | "participant_sid" => Ok(GeneratedField::ParticipantSid), - "trackSids" | "track_sids" => Ok(GeneratedField::TrackSids), + "track" => Ok(GeneratedField::Track), _ => Ok(GeneratedField::__SkipField__), } } @@ -12610,47 +13639,39 @@ impl<'de> serde::Deserialize<'de> for ParticipantTracks { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ParticipantTracks; + type Value = MuteRoomTrackResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ParticipantTracks") + formatter.write_str("struct livekit.MuteRoomTrackResponse") } - 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 participant_sid__ = None; - let mut track_sids__ = None; + let mut track__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::ParticipantSid => { - if participant_sid__.is_some() { - return Err(serde::de::Error::duplicate_field("participantSid")); - } - participant_sid__ = Some(map_.next_value()?); - } - GeneratedField::TrackSids => { - if track_sids__.is_some() { - return Err(serde::de::Error::duplicate_field("trackSids")); + GeneratedField::Track => { + if track__.is_some() { + return Err(serde::de::Error::duplicate_field("track")); } - track_sids__ = Some(map_.next_value()?); + track__ = map_.next_value()?; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(ParticipantTracks { - participant_sid: participant_sid__.unwrap_or_default(), - track_sids: track_sids__.unwrap_or_default(), + Ok(MuteRoomTrackResponse { + track: track__, }) } } - deserializer.deserialize_struct("livekit.ParticipantTracks", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.MuteRoomTrackResponse", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ParticipantUpdate { +impl serde::Serialize for MuteTrackRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -12658,29 +13679,37 @@ impl serde::Serialize for ParticipantUpdate { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.participants.is_empty() { + if !self.sid.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.ParticipantUpdate", len)?; - if !self.participants.is_empty() { - struct_ser.serialize_field("participants", &self.participants)?; + if self.muted { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.MuteTrackRequest", len)?; + if !self.sid.is_empty() { + struct_ser.serialize_field("sid", &self.sid)?; + } + if self.muted { + struct_ser.serialize_field("muted", &self.muted)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for ParticipantUpdate { +impl<'de> serde::Deserialize<'de> for MuteTrackRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "participants", + "sid", + "muted", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Participants, + Sid, + Muted, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -12703,7 +13732,8 @@ impl<'de> serde::Deserialize<'de> for ParticipantUpdate { E: serde::de::Error, { match value { - "participants" => Ok(GeneratedField::Participants), + "sid" => Ok(GeneratedField::Sid), + "muted" => Ok(GeneratedField::Muted), _ => Ok(GeneratedField::__SkipField__), } } @@ -12713,39 +13743,47 @@ impl<'de> serde::Deserialize<'de> for ParticipantUpdate { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ParticipantUpdate; + type Value = MuteTrackRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ParticipantUpdate") + formatter.write_str("struct livekit.MuteTrackRequest") } - 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 participants__ = None; + let mut sid__ = None; + let mut muted__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Participants => { - if participants__.is_some() { - return Err(serde::de::Error::duplicate_field("participants")); + GeneratedField::Sid => { + if sid__.is_some() { + return Err(serde::de::Error::duplicate_field("sid")); } - participants__ = Some(map_.next_value()?); + sid__ = Some(map_.next_value()?); + } + GeneratedField::Muted => { + if muted__.is_some() { + return Err(serde::de::Error::duplicate_field("muted")); + } + muted__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(ParticipantUpdate { - participants: participants__.unwrap_or_default(), + Ok(MuteTrackRequest { + sid: sid__.unwrap_or_default(), + muted: muted__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.ParticipantUpdate", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.MuteTrackRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for Ping { +impl serde::Serialize for ParticipantEgressRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -12753,39 +13791,102 @@ impl serde::Serialize for Ping { { use serde::ser::SerializeStruct; let mut len = 0; - if self.timestamp != 0 { + if !self.room_name.is_empty() { len += 1; } - if self.rtt != 0 { + if !self.identity.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.Ping", len)?; - if self.timestamp != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; + if self.screen_share { + len += 1; } - if self.rtt != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("rtt", ToString::to_string(&self.rtt).as_str())?; + 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.options.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.ParticipantEgressRequest", len)?; + if !self.room_name.is_empty() { + struct_ser.serialize_field("roomName", &self.room_name)?; + } + if !self.identity.is_empty() { + struct_ser.serialize_field("identity", &self.identity)?; + } + if self.screen_share { + struct_ser.serialize_field("screenShare", &self.screen_share)?; + } + 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.options.as_ref() { + match v { + participant_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)?; + } + participant_egress_request::Options::Advanced(v) => { + struct_ser.serialize_field("advanced", v)?; + } + } } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for Ping { +impl<'de> serde::Deserialize<'de> for ParticipantEgressRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "timestamp", - "rtt", + "room_name", + "roomName", + "identity", + "screen_share", + "screenShare", + "file_outputs", + "fileOutputs", + "stream_outputs", + "streamOutputs", + "segment_outputs", + "segmentOutputs", + "image_outputs", + "imageOutputs", + "preset", + "advanced", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Timestamp, - Rtt, + RoomName, + Identity, + ScreenShare, + FileOutputs, + StreamOutputs, + SegmentOutputs, + ImageOutputs, + Preset, + Advanced, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -12808,8 +13909,15 @@ impl<'de> serde::Deserialize<'de> for Ping { E: serde::de::Error, { match value { - "timestamp" => Ok(GeneratedField::Timestamp), - "rtt" => Ok(GeneratedField::Rtt), + "roomName" | "room_name" => Ok(GeneratedField::RoomName), + "identity" => Ok(GeneratedField::Identity), + "screenShare" | "screen_share" => Ok(GeneratedField::ScreenShare), + "fileOutputs" | "file_outputs" => Ok(GeneratedField::FileOutputs), + "streamOutputs" | "stream_outputs" => Ok(GeneratedField::StreamOutputs), + "segmentOutputs" | "segment_outputs" => Ok(GeneratedField::SegmentOutputs), + "imageOutputs" | "image_outputs" => Ok(GeneratedField::ImageOutputs), + "preset" => Ok(GeneratedField::Preset), + "advanced" => Ok(GeneratedField::Advanced), _ => Ok(GeneratedField::__SkipField__), } } @@ -12819,51 +13927,102 @@ impl<'de> serde::Deserialize<'de> for Ping { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Ping; + type Value = ParticipantEgressRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.Ping") + formatter.write_str("struct livekit.ParticipantEgressRequest") } - 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 timestamp__ = None; - let mut rtt__ = None; + let mut room_name__ = None; + let mut identity__ = None; + let mut screen_share__ = None; + let mut file_outputs__ = None; + let mut stream_outputs__ = None; + let mut segment_outputs__ = None; + let mut image_outputs__ = None; + let mut options__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Timestamp => { - if timestamp__.is_some() { - return Err(serde::de::Error::duplicate_field("timestamp")); + GeneratedField::RoomName => { + if room_name__.is_some() { + return Err(serde::de::Error::duplicate_field("roomName")); } - timestamp__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + room_name__ = Some(map_.next_value()?); } - GeneratedField::Rtt => { - if rtt__.is_some() { - return Err(serde::de::Error::duplicate_field("rtt")); + GeneratedField::Identity => { + if identity__.is_some() { + return Err(serde::de::Error::duplicate_field("identity")); } - rtt__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + identity__ = Some(map_.next_value()?); + } + GeneratedField::ScreenShare => { + if screen_share__.is_some() { + return Err(serde::de::Error::duplicate_field("screenShare")); + } + screen_share__ = 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::Preset => { + if options__.is_some() { + return Err(serde::de::Error::duplicate_field("preset")); + } + options__ = map_.next_value::<::std::option::Option>()?.map(|x| participant_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(participant_egress_request::Options::Advanced) +; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(Ping { - timestamp: timestamp__.unwrap_or_default(), - rtt: rtt__.unwrap_or_default(), + Ok(ParticipantEgressRequest { + room_name: room_name__.unwrap_or_default(), + identity: identity__.unwrap_or_default(), + screen_share: screen_share__.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(), + options: options__, }) } } - deserializer.deserialize_struct("livekit.Ping", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ParticipantEgressRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for PlayoutDelay { +impl serde::Serialize for ParticipantInfo { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -12871,45 +14030,132 @@ impl serde::Serialize for PlayoutDelay { { use serde::ser::SerializeStruct; let mut len = 0; - if self.enabled { + if !self.sid.is_empty() { len += 1; } - if self.min != 0 { + if !self.identity.is_empty() { len += 1; } - if self.max != 0 { + if self.state != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.PlayoutDelay", len)?; - if self.enabled { - struct_ser.serialize_field("enabled", &self.enabled)?; + if !self.tracks.is_empty() { + len += 1; } - if self.min != 0 { - struct_ser.serialize_field("min", &self.min)?; + if !self.metadata.is_empty() { + len += 1; } - if self.max != 0 { - struct_ser.serialize_field("max", &self.max)?; + if self.joined_at != 0 { + len += 1; } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for PlayoutDelay { - #[allow(deprecated)] + if !self.name.is_empty() { + len += 1; + } + if self.version != 0 { + len += 1; + } + if self.permission.is_some() { + len += 1; + } + if !self.region.is_empty() { + len += 1; + } + if self.is_publisher { + len += 1; + } + if self.kind != 0 { + len += 1; + } + if !self.attributes.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.ParticipantInfo", len)?; + if !self.sid.is_empty() { + struct_ser.serialize_field("sid", &self.sid)?; + } + if !self.identity.is_empty() { + struct_ser.serialize_field("identity", &self.identity)?; + } + if self.state != 0 { + let v = participant_info::State::try_from(self.state) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.state)))?; + struct_ser.serialize_field("state", &v)?; + } + if !self.tracks.is_empty() { + struct_ser.serialize_field("tracks", &self.tracks)?; + } + if !self.metadata.is_empty() { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + if self.joined_at != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("joinedAt", ToString::to_string(&self.joined_at).as_str())?; + } + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if self.version != 0 { + struct_ser.serialize_field("version", &self.version)?; + } + if let Some(v) = self.permission.as_ref() { + struct_ser.serialize_field("permission", v)?; + } + if !self.region.is_empty() { + struct_ser.serialize_field("region", &self.region)?; + } + if self.is_publisher { + struct_ser.serialize_field("isPublisher", &self.is_publisher)?; + } + if self.kind != 0 { + let v = participant_info::Kind::try_from(self.kind) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.kind)))?; + struct_ser.serialize_field("kind", &v)?; + } + if !self.attributes.is_empty() { + struct_ser.serialize_field("attributes", &self.attributes)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ParticipantInfo { + #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "enabled", - "min", - "max", + "sid", + "identity", + "state", + "tracks", + "metadata", + "joined_at", + "joinedAt", + "name", + "version", + "permission", + "region", + "is_publisher", + "isPublisher", + "kind", + "attributes", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Enabled, - Min, - Max, + Sid, + Identity, + State, + Tracks, + Metadata, + JoinedAt, + Name, + Version, + Permission, + Region, + IsPublisher, + Kind, + Attributes, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -12932,9 +14178,19 @@ impl<'de> serde::Deserialize<'de> for PlayoutDelay { E: serde::de::Error, { match value { - "enabled" => Ok(GeneratedField::Enabled), - "min" => Ok(GeneratedField::Min), - "max" => Ok(GeneratedField::Max), + "sid" => Ok(GeneratedField::Sid), + "identity" => Ok(GeneratedField::Identity), + "state" => Ok(GeneratedField::State), + "tracks" => Ok(GeneratedField::Tracks), + "metadata" => Ok(GeneratedField::Metadata), + "joinedAt" | "joined_at" => Ok(GeneratedField::JoinedAt), + "name" => Ok(GeneratedField::Name), + "version" => Ok(GeneratedField::Version), + "permission" => Ok(GeneratedField::Permission), + "region" => Ok(GeneratedField::Region), + "isPublisher" | "is_publisher" => Ok(GeneratedField::IsPublisher), + "kind" => Ok(GeneratedField::Kind), + "attributes" => Ok(GeneratedField::Attributes), _ => Ok(GeneratedField::__SkipField__), } } @@ -12944,100 +14200,393 @@ impl<'de> serde::Deserialize<'de> for PlayoutDelay { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = PlayoutDelay; + type Value = ParticipantInfo; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.PlayoutDelay") + formatter.write_str("struct livekit.ParticipantInfo") } - 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 enabled__ = None; - let mut min__ = None; - let mut max__ = None; + let mut sid__ = None; + let mut identity__ = None; + let mut state__ = None; + let mut tracks__ = None; + let mut metadata__ = None; + let mut joined_at__ = None; + let mut name__ = None; + let mut version__ = None; + let mut permission__ = None; + let mut region__ = None; + let mut is_publisher__ = None; + let mut kind__ = None; + let mut attributes__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Enabled => { - if enabled__.is_some() { - return Err(serde::de::Error::duplicate_field("enabled")); + GeneratedField::Sid => { + if sid__.is_some() { + return Err(serde::de::Error::duplicate_field("sid")); } - enabled__ = Some(map_.next_value()?); + sid__ = Some(map_.next_value()?); } - GeneratedField::Min => { - if min__.is_some() { - return Err(serde::de::Error::duplicate_field("min")); + GeneratedField::Identity => { + if identity__.is_some() { + return Err(serde::de::Error::duplicate_field("identity")); } - min__ = + identity__ = Some(map_.next_value()?); + } + GeneratedField::State => { + if state__.is_some() { + return Err(serde::de::Error::duplicate_field("state")); + } + state__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Tracks => { + if tracks__.is_some() { + return Err(serde::de::Error::duplicate_field("tracks")); + } + tracks__ = Some(map_.next_value()?); + } + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = Some(map_.next_value()?); + } + GeneratedField::JoinedAt => { + if joined_at__.is_some() { + return Err(serde::de::Error::duplicate_field("joinedAt")); + } + joined_at__ = Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } - GeneratedField::Max => { - if max__.is_some() { - return Err(serde::de::Error::duplicate_field("max")); + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); } - max__ = + name__ = Some(map_.next_value()?); + } + GeneratedField::Version => { + if version__.is_some() { + return Err(serde::de::Error::duplicate_field("version")); + } + version__ = Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } + GeneratedField::Permission => { + if permission__.is_some() { + return Err(serde::de::Error::duplicate_field("permission")); + } + permission__ = map_.next_value()?; + } + GeneratedField::Region => { + if region__.is_some() { + return Err(serde::de::Error::duplicate_field("region")); + } + region__ = Some(map_.next_value()?); + } + GeneratedField::IsPublisher => { + if is_publisher__.is_some() { + return Err(serde::de::Error::duplicate_field("isPublisher")); + } + is_publisher__ = Some(map_.next_value()?); + } + GeneratedField::Kind => { + if kind__.is_some() { + return Err(serde::de::Error::duplicate_field("kind")); + } + kind__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Attributes => { + if attributes__.is_some() { + return Err(serde::de::Error::duplicate_field("attributes")); + } + attributes__ = Some( + map_.next_value::>()? + ); + } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(PlayoutDelay { - enabled: enabled__.unwrap_or_default(), - min: min__.unwrap_or_default(), - max: max__.unwrap_or_default(), + Ok(ParticipantInfo { + sid: sid__.unwrap_or_default(), + identity: identity__.unwrap_or_default(), + state: state__.unwrap_or_default(), + tracks: tracks__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), + joined_at: joined_at__.unwrap_or_default(), + name: name__.unwrap_or_default(), + version: version__.unwrap_or_default(), + permission: permission__, + region: region__.unwrap_or_default(), + is_publisher: is_publisher__.unwrap_or_default(), + kind: kind__.unwrap_or_default(), + attributes: attributes__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.PlayoutDelay", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ParticipantInfo", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for Pong { +impl serde::Serialize for participant_info::Kind { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.last_ping_timestamp != 0 { - len += 1; - } - if self.timestamp != 0 { + let variant = match self { + Self::Standard => "STANDARD", + Self::Ingress => "INGRESS", + Self::Egress => "EGRESS", + Self::Sip => "SIP", + Self::Agent => "AGENT", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for participant_info::Kind { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "STANDARD", + "INGRESS", + "EGRESS", + "SIP", + "AGENT", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = participant_info::Kind; + + 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 { + "STANDARD" => Ok(participant_info::Kind::Standard), + "INGRESS" => Ok(participant_info::Kind::Ingress), + "EGRESS" => Ok(participant_info::Kind::Egress), + "SIP" => Ok(participant_info::Kind::Sip), + "AGENT" => Ok(participant_info::Kind::Agent), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for participant_info::State { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Joining => "JOINING", + Self::Joined => "JOINED", + Self::Active => "ACTIVE", + Self::Disconnected => "DISCONNECTED", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for participant_info::State { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "JOINING", + "JOINED", + "ACTIVE", + "DISCONNECTED", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = participant_info::State; + + 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 { + "JOINING" => Ok(participant_info::State::Joining), + "JOINED" => Ok(participant_info::State::Joined), + "ACTIVE" => Ok(participant_info::State::Active), + "DISCONNECTED" => Ok(participant_info::State::Disconnected), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for ParticipantPermission { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.can_subscribe { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.Pong", len)?; - if self.last_ping_timestamp != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("lastPingTimestamp", ToString::to_string(&self.last_ping_timestamp).as_str())?; + if self.can_publish { + len += 1; } - if self.timestamp != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; + if self.can_publish_data { + len += 1; + } + if !self.can_publish_sources.is_empty() { + len += 1; + } + if self.hidden { + len += 1; + } + if self.recorder { + len += 1; + } + if self.can_update_metadata { + len += 1; + } + if self.agent { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.ParticipantPermission", len)?; + if self.can_subscribe { + struct_ser.serialize_field("canSubscribe", &self.can_subscribe)?; + } + if self.can_publish { + struct_ser.serialize_field("canPublish", &self.can_publish)?; + } + if self.can_publish_data { + struct_ser.serialize_field("canPublishData", &self.can_publish_data)?; + } + if !self.can_publish_sources.is_empty() { + let v = self.can_publish_sources.iter().cloned().map(|v| { + TrackSource::try_from(v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", v))) + }).collect::, _>>()?; + struct_ser.serialize_field("canPublishSources", &v)?; + } + if self.hidden { + struct_ser.serialize_field("hidden", &self.hidden)?; + } + if self.recorder { + struct_ser.serialize_field("recorder", &self.recorder)?; + } + if self.can_update_metadata { + struct_ser.serialize_field("canUpdateMetadata", &self.can_update_metadata)?; + } + if self.agent { + struct_ser.serialize_field("agent", &self.agent)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for Pong { +impl<'de> serde::Deserialize<'de> for ParticipantPermission { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "last_ping_timestamp", - "lastPingTimestamp", - "timestamp", + "can_subscribe", + "canSubscribe", + "can_publish", + "canPublish", + "can_publish_data", + "canPublishData", + "can_publish_sources", + "canPublishSources", + "hidden", + "recorder", + "can_update_metadata", + "canUpdateMetadata", + "agent", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - LastPingTimestamp, - Timestamp, + CanSubscribe, + CanPublish, + CanPublishData, + CanPublishSources, + Hidden, + Recorder, + CanUpdateMetadata, + Agent, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -13060,8 +14609,14 @@ impl<'de> serde::Deserialize<'de> for Pong { E: serde::de::Error, { match value { - "lastPingTimestamp" | "last_ping_timestamp" => Ok(GeneratedField::LastPingTimestamp), - "timestamp" => Ok(GeneratedField::Timestamp), + "canSubscribe" | "can_subscribe" => Ok(GeneratedField::CanSubscribe), + "canPublish" | "can_publish" => Ok(GeneratedField::CanPublish), + "canPublishData" | "can_publish_data" => Ok(GeneratedField::CanPublishData), + "canPublishSources" | "can_publish_sources" => Ok(GeneratedField::CanPublishSources), + "hidden" => Ok(GeneratedField::Hidden), + "recorder" => Ok(GeneratedField::Recorder), + "canUpdateMetadata" | "can_update_metadata" => Ok(GeneratedField::CanUpdateMetadata), + "agent" => Ok(GeneratedField::Agent), _ => Ok(GeneratedField::__SkipField__), } } @@ -13071,51 +14626,95 @@ impl<'de> serde::Deserialize<'de> for Pong { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Pong; + type Value = ParticipantPermission; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.Pong") + formatter.write_str("struct livekit.ParticipantPermission") } - 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 last_ping_timestamp__ = None; - let mut timestamp__ = None; + let mut can_subscribe__ = None; + let mut can_publish__ = None; + let mut can_publish_data__ = None; + let mut can_publish_sources__ = None; + let mut hidden__ = None; + let mut recorder__ = None; + let mut can_update_metadata__ = None; + let mut agent__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::LastPingTimestamp => { - if last_ping_timestamp__.is_some() { - return Err(serde::de::Error::duplicate_field("lastPingTimestamp")); + GeneratedField::CanSubscribe => { + if can_subscribe__.is_some() { + return Err(serde::de::Error::duplicate_field("canSubscribe")); } - last_ping_timestamp__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + can_subscribe__ = Some(map_.next_value()?); } - GeneratedField::Timestamp => { - if timestamp__.is_some() { - return Err(serde::de::Error::duplicate_field("timestamp")); + GeneratedField::CanPublish => { + if can_publish__.is_some() { + return Err(serde::de::Error::duplicate_field("canPublish")); } - timestamp__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + can_publish__ = Some(map_.next_value()?); + } + GeneratedField::CanPublishData => { + if can_publish_data__.is_some() { + return Err(serde::de::Error::duplicate_field("canPublishData")); + } + can_publish_data__ = Some(map_.next_value()?); + } + GeneratedField::CanPublishSources => { + if can_publish_sources__.is_some() { + return Err(serde::de::Error::duplicate_field("canPublishSources")); + } + can_publish_sources__ = Some(map_.next_value::>()?.into_iter().map(|x| x as i32).collect()); + } + GeneratedField::Hidden => { + if hidden__.is_some() { + return Err(serde::de::Error::duplicate_field("hidden")); + } + hidden__ = Some(map_.next_value()?); + } + GeneratedField::Recorder => { + if recorder__.is_some() { + return Err(serde::de::Error::duplicate_field("recorder")); + } + recorder__ = Some(map_.next_value()?); + } + GeneratedField::CanUpdateMetadata => { + if can_update_metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("canUpdateMetadata")); + } + can_update_metadata__ = Some(map_.next_value()?); + } + GeneratedField::Agent => { + if agent__.is_some() { + return Err(serde::de::Error::duplicate_field("agent")); + } + agent__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(Pong { - last_ping_timestamp: last_ping_timestamp__.unwrap_or_default(), - timestamp: timestamp__.unwrap_or_default(), + Ok(ParticipantPermission { + can_subscribe: can_subscribe__.unwrap_or_default(), + can_publish: can_publish__.unwrap_or_default(), + can_publish_data: can_publish_data__.unwrap_or_default(), + can_publish_sources: can_publish_sources__.unwrap_or_default(), + hidden: hidden__.unwrap_or_default(), + recorder: recorder__.unwrap_or_default(), + can_update_metadata: can_update_metadata__.unwrap_or_default(), + agent: agent__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.Pong", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ParticipantPermission", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ProxyConfig { +impl serde::Serialize for ParticipantTracks { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -13123,45 +14722,39 @@ impl serde::Serialize for ProxyConfig { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.url.is_empty() { - len += 1; - } - if !self.username.is_empty() { + if !self.participant_sid.is_empty() { len += 1; } - if !self.password.is_empty() { + if !self.track_sids.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.ProxyConfig", len)?; - if !self.url.is_empty() { - struct_ser.serialize_field("url", &self.url)?; - } - if !self.username.is_empty() { - struct_ser.serialize_field("username", &self.username)?; + let mut struct_ser = serializer.serialize_struct("livekit.ParticipantTracks", len)?; + if !self.participant_sid.is_empty() { + struct_ser.serialize_field("participantSid", &self.participant_sid)?; } - if !self.password.is_empty() { - struct_ser.serialize_field("password", &self.password)?; + if !self.track_sids.is_empty() { + struct_ser.serialize_field("trackSids", &self.track_sids)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for ProxyConfig { +impl<'de> serde::Deserialize<'de> for ParticipantTracks { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "url", - "username", - "password", + "participant_sid", + "participantSid", + "track_sids", + "trackSids", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Url, - Username, - Password, + ParticipantSid, + TrackSids, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -13184,9 +14777,8 @@ impl<'de> serde::Deserialize<'de> for ProxyConfig { E: serde::de::Error, { match value { - "url" => Ok(GeneratedField::Url), - "username" => Ok(GeneratedField::Username), - "password" => Ok(GeneratedField::Password), + "participantSid" | "participant_sid" => Ok(GeneratedField::ParticipantSid), + "trackSids" | "track_sids" => Ok(GeneratedField::TrackSids), _ => Ok(GeneratedField::__SkipField__), } } @@ -13196,55 +14788,47 @@ impl<'de> serde::Deserialize<'de> for ProxyConfig { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ProxyConfig; + type Value = ParticipantTracks; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ProxyConfig") + formatter.write_str("struct livekit.ParticipantTracks") } - 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 url__ = None; - let mut username__ = None; - let mut password__ = None; + let mut participant_sid__ = None; + let mut track_sids__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Url => { - if url__.is_some() { - return Err(serde::de::Error::duplicate_field("url")); - } - url__ = Some(map_.next_value()?); - } - GeneratedField::Username => { - if username__.is_some() { - return Err(serde::de::Error::duplicate_field("username")); + GeneratedField::ParticipantSid => { + if participant_sid__.is_some() { + return Err(serde::de::Error::duplicate_field("participantSid")); } - username__ = Some(map_.next_value()?); + participant_sid__ = Some(map_.next_value()?); } - GeneratedField::Password => { - if password__.is_some() { - return Err(serde::de::Error::duplicate_field("password")); + GeneratedField::TrackSids => { + if track_sids__.is_some() { + return Err(serde::de::Error::duplicate_field("trackSids")); } - password__ = Some(map_.next_value()?); + track_sids__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(ProxyConfig { - url: url__.unwrap_or_default(), - username: username__.unwrap_or_default(), - password: password__.unwrap_or_default(), + Ok(ParticipantTracks { + participant_sid: participant_sid__.unwrap_or_default(), + track_sids: track_sids__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.ProxyConfig", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ParticipantTracks", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for RtpDrift { +impl serde::Serialize for ParticipantUpdate { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -13252,105 +14836,29 @@ 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. { - 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. { + if !self.participants.is_empty() { 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)] - struct_ser.serialize_field("startTimestamp", ToString::to_string(&self.start_timestamp).as_str())?; - } - if self.end_timestamp != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("endTimestamp", ToString::to_string(&self.end_timestamp).as_str())?; - } - if self.rtp_clock_ticks != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("rtpClockTicks", ToString::to_string(&self.rtp_clock_ticks).as_str())?; - } - if self.drift_samples != 0 { - #[allow(clippy::needless_borrow)] - 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)?; + let mut struct_ser = serializer.serialize_struct("livekit.ParticipantUpdate", len)?; + if !self.participants.is_empty() { + struct_ser.serialize_field("participants", &self.participants)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for RtpDrift { +impl<'de> serde::Deserialize<'de> for ParticipantUpdate { #[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", + "participants", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - StartTime, - EndTime, - Duration, - StartTimestamp, - EndTimestamp, - RtpClockTicks, - DriftSamples, - DriftMs, - ClockRate, + Participants, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -13373,15 +14881,7 @@ impl<'de> serde::Deserialize<'de> for RtpDrift { E: serde::de::Error, { match value { - "startTime" | "start_time" => Ok(GeneratedField::StartTime), - "endTime" | "end_time" => Ok(GeneratedField::EndTime), - "duration" => Ok(GeneratedField::Duration), - "startTimestamp" | "start_timestamp" => Ok(GeneratedField::StartTimestamp), - "endTimestamp" | "end_timestamp" => Ok(GeneratedField::EndTimestamp), - "rtpClockTicks" | "rtp_clock_ticks" => Ok(GeneratedField::RtpClockTicks), - "driftSamples" | "drift_samples" => Ok(GeneratedField::DriftSamples), - "driftMs" | "drift_ms" => Ok(GeneratedField::DriftMs), - "clockRate" | "clock_rate" => Ok(GeneratedField::ClockRate), + "participants" => Ok(GeneratedField::Participants), _ => Ok(GeneratedField::__SkipField__), } } @@ -13391,92 +14891,139 @@ impl<'de> serde::Deserialize<'de> for RtpDrift { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RtpDrift; + type Value = ParticipantUpdate; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.RTPDrift") + formatter.write_str("struct livekit.ParticipantUpdate") } - 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 start_time__ = None; - let mut end_time__ = None; - let mut duration__ = None; - let mut start_timestamp__ = None; - let mut end_timestamp__ = None; - let mut rtp_clock_ticks__ = None; - let mut drift_samples__ = None; - let mut drift_ms__ = None; - let mut clock_rate__ = None; + let mut participants__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::StartTime => { - if start_time__.is_some() { - return Err(serde::de::Error::duplicate_field("startTime")); - } - start_time__ = map_.next_value()?; - } - GeneratedField::EndTime => { - if end_time__.is_some() { - return Err(serde::de::Error::duplicate_field("endTime")); - } - end_time__ = map_.next_value()?; - } - GeneratedField::Duration => { - if duration__.is_some() { - return Err(serde::de::Error::duplicate_field("duration")); - } - duration__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::StartTimestamp => { - if start_timestamp__.is_some() { - return Err(serde::de::Error::duplicate_field("startTimestamp")); - } - start_timestamp__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::EndTimestamp => { - if end_timestamp__.is_some() { - return Err(serde::de::Error::duplicate_field("endTimestamp")); + GeneratedField::Participants => { + if participants__.is_some() { + return Err(serde::de::Error::duplicate_field("participants")); } - end_timestamp__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + participants__ = Some(map_.next_value()?); } - GeneratedField::RtpClockTicks => { - if rtp_clock_ticks__.is_some() { - return Err(serde::de::Error::duplicate_field("rtpClockTicks")); - } - rtp_clock_ticks__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; } - GeneratedField::DriftSamples => { - if drift_samples__.is_some() { - return Err(serde::de::Error::duplicate_field("driftSamples")); - } - drift_samples__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + } + } + Ok(ParticipantUpdate { + participants: participants__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.ParticipantUpdate", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Ping { + #[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 != 0 { + len += 1; + } + if self.rtt != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.Ping", len)?; + if self.timestamp != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; + } + if self.rtt != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("rtt", ToString::to_string(&self.rtt).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Ping { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "timestamp", + "rtt", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Timestamp, + Rtt, + __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 { + "timestamp" => Ok(GeneratedField::Timestamp), + "rtt" => Ok(GeneratedField::Rtt), + _ => Ok(GeneratedField::__SkipField__), } - GeneratedField::DriftMs => { - if drift_ms__.is_some() { - return Err(serde::de::Error::duplicate_field("driftMs")); + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Ping; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.Ping") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut timestamp__ = None; + let mut rtt__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Timestamp => { + if timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timestamp")); } - drift_ms__ = + timestamp__ = Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } - GeneratedField::ClockRate => { - if clock_rate__.is_some() { - return Err(serde::de::Error::duplicate_field("clockRate")); + GeneratedField::Rtt => { + if rtt__.is_some() { + return Err(serde::de::Error::duplicate_field("rtt")); } - clock_rate__ = + rtt__ = Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } @@ -13485,23 +15032,16 @@ impl<'de> serde::Deserialize<'de> for RtpDrift { } } } - Ok(RtpDrift { - start_time: start_time__, - end_time: end_time__, - duration: duration__.unwrap_or_default(), - start_timestamp: start_timestamp__.unwrap_or_default(), - end_timestamp: end_timestamp__.unwrap_or_default(), - rtp_clock_ticks: rtp_clock_ticks__.unwrap_or_default(), - drift_samples: drift_samples__.unwrap_or_default(), - drift_ms: drift_ms__.unwrap_or_default(), - clock_rate: clock_rate__.unwrap_or_default(), + Ok(Ping { + timestamp: timestamp__.unwrap_or_default(), + rtt: rtt__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.RTPDrift", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.Ping", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for RtpStats { +impl serde::Serialize for PlayoutDelay { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -13509,139 +15049,415 @@ impl serde::Serialize for RtpStats { { use serde::ser::SerializeStruct; let mut len = 0; - if self.start_time.is_some() { + if self.enabled { len += 1; } - if self.end_time.is_some() { + if self.min != 0 { len += 1; } - if self.duration != 0. { + if self.max != 0 { len += 1; } - if self.packets != 0 { - len += 1; + let mut struct_ser = serializer.serialize_struct("livekit.PlayoutDelay", len)?; + if self.enabled { + struct_ser.serialize_field("enabled", &self.enabled)?; } - if self.packet_rate != 0. { - len += 1; + if self.min != 0 { + struct_ser.serialize_field("min", &self.min)?; } - if self.bytes != 0 { - len += 1; + if self.max != 0 { + struct_ser.serialize_field("max", &self.max)?; } - if self.header_bytes != 0 { - len += 1; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for PlayoutDelay { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "enabled", + "min", + "max", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Enabled, + Min, + Max, + __SkipField__, } - if self.bitrate != 0. { - len += 1; - } - if self.packets_lost != 0 { - len += 1; - } - if self.packet_loss_rate != 0. { - len += 1; - } - if self.packet_loss_percentage != 0. { - len += 1; - } - if self.packets_duplicate != 0 { - len += 1; - } - if self.packet_duplicate_rate != 0. { - len += 1; - } - if self.bytes_duplicate != 0 { - len += 1; - } - if self.header_bytes_duplicate != 0 { - len += 1; + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "enabled" => Ok(GeneratedField::Enabled), + "min" => Ok(GeneratedField::Min), + "max" => Ok(GeneratedField::Max), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } } - if self.bitrate_duplicate != 0. { - len += 1; + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = PlayoutDelay; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.PlayoutDelay") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut enabled__ = None; + let mut min__ = None; + let mut max__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Enabled => { + if enabled__.is_some() { + return Err(serde::de::Error::duplicate_field("enabled")); + } + enabled__ = Some(map_.next_value()?); + } + GeneratedField::Min => { + if min__.is_some() { + return Err(serde::de::Error::duplicate_field("min")); + } + min__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Max => { + if max__.is_some() { + return Err(serde::de::Error::duplicate_field("max")); + } + max__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(PlayoutDelay { + enabled: enabled__.unwrap_or_default(), + min: min__.unwrap_or_default(), + max: max__.unwrap_or_default(), + }) + } } - if self.packets_padding != 0 { + deserializer.deserialize_struct("livekit.PlayoutDelay", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Pong { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.last_ping_timestamp != 0 { len += 1; } - if self.packet_padding_rate != 0. { + if self.timestamp != 0 { len += 1; } - if self.bytes_padding != 0 { - len += 1; + let mut struct_ser = serializer.serialize_struct("livekit.Pong", len)?; + if self.last_ping_timestamp != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("lastPingTimestamp", ToString::to_string(&self.last_ping_timestamp).as_str())?; } - if self.header_bytes_padding != 0 { - len += 1; + if self.timestamp != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; } - if self.bitrate_padding != 0. { - len += 1; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Pong { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "last_ping_timestamp", + "lastPingTimestamp", + "timestamp", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + LastPingTimestamp, + Timestamp, + __SkipField__, } - if self.packets_out_of_order != 0 { - len += 1; + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "lastPingTimestamp" | "last_ping_timestamp" => Ok(GeneratedField::LastPingTimestamp), + "timestamp" => Ok(GeneratedField::Timestamp), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } } - if self.frames != 0 { - len += 1; + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Pong; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.Pong") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut last_ping_timestamp__ = None; + let mut timestamp__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::LastPingTimestamp => { + if last_ping_timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("lastPingTimestamp")); + } + last_ping_timestamp__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Timestamp => { + if timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timestamp")); + } + timestamp__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(Pong { + last_ping_timestamp: last_ping_timestamp__.unwrap_or_default(), + timestamp: timestamp__.unwrap_or_default(), + }) + } } - if self.frame_rate != 0. { + deserializer.deserialize_struct("livekit.Pong", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ProxyConfig { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.url.is_empty() { len += 1; } - if self.jitter_current != 0. { + if !self.username.is_empty() { len += 1; } - if self.jitter_max != 0. { + if !self.password.is_empty() { len += 1; } - if !self.gap_histogram.is_empty() { - len += 1; + let mut struct_ser = serializer.serialize_struct("livekit.ProxyConfig", len)?; + if !self.url.is_empty() { + struct_ser.serialize_field("url", &self.url)?; } - if self.nacks != 0 { - len += 1; + if !self.username.is_empty() { + struct_ser.serialize_field("username", &self.username)?; } - if self.nack_acks != 0 { - len += 1; + if !self.password.is_empty() { + struct_ser.serialize_field("password", &self.password)?; } - if self.nack_misses != 0 { - len += 1; - } - if self.nack_repeated != 0 { - len += 1; - } - if self.plis != 0 { - len += 1; - } - if self.last_pli.is_some() { - len += 1; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ProxyConfig { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "url", + "username", + "password", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Url, + Username, + Password, + __SkipField__, } - if self.firs != 0 { - len += 1; + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "url" => Ok(GeneratedField::Url), + "username" => Ok(GeneratedField::Username), + "password" => Ok(GeneratedField::Password), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } } - if self.last_fir.is_some() { - len += 1; + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ProxyConfig; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.ProxyConfig") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut url__ = None; + let mut username__ = None; + let mut password__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Url => { + if url__.is_some() { + return Err(serde::de::Error::duplicate_field("url")); + } + url__ = Some(map_.next_value()?); + } + GeneratedField::Username => { + if username__.is_some() { + return Err(serde::de::Error::duplicate_field("username")); + } + username__ = Some(map_.next_value()?); + } + GeneratedField::Password => { + if password__.is_some() { + return Err(serde::de::Error::duplicate_field("password")); + } + password__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(ProxyConfig { + url: url__.unwrap_or_default(), + username: username__.unwrap_or_default(), + password: password__.unwrap_or_default(), + }) + } } - if self.rtt_current != 0 { + deserializer.deserialize_struct("livekit.ProxyConfig", 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.rtt_max != 0 { + if self.end_time.is_some() { len += 1; } - if self.key_frames != 0 { + if self.duration != 0. { len += 1; } - if self.last_key_frame.is_some() { + if self.start_timestamp != 0 { len += 1; } - if self.layer_lock_plis != 0 { + if self.end_timestamp != 0 { len += 1; } - if self.last_layer_lock_pli.is_some() { + if self.rtp_clock_ticks != 0 { len += 1; } - if self.packet_drift.is_some() { + if self.drift_samples != 0 { len += 1; } - if self.report_drift.is_some() { + if self.drift_ms != 0. { len += 1; } - if self.rebased_report_drift.is_some() { + if self.clock_rate != 0. { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.RTPStats", len)?; + 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)?; } @@ -13651,274 +15467,69 @@ impl serde::Serialize for RtpStats { if self.duration != 0. { struct_ser.serialize_field("duration", &self.duration)?; } - if self.packets != 0 { - struct_ser.serialize_field("packets", &self.packets)?; - } - if self.packet_rate != 0. { - struct_ser.serialize_field("packetRate", &self.packet_rate)?; - } - if self.bytes != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("bytes", ToString::to_string(&self.bytes).as_str())?; - } - if self.header_bytes != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("headerBytes", ToString::to_string(&self.header_bytes).as_str())?; - } - if self.bitrate != 0. { - struct_ser.serialize_field("bitrate", &self.bitrate)?; - } - if self.packets_lost != 0 { - struct_ser.serialize_field("packetsLost", &self.packets_lost)?; - } - if self.packet_loss_rate != 0. { - struct_ser.serialize_field("packetLossRate", &self.packet_loss_rate)?; - } - if self.packet_loss_percentage != 0. { - struct_ser.serialize_field("packetLossPercentage", &self.packet_loss_percentage)?; - } - if self.packets_duplicate != 0 { - struct_ser.serialize_field("packetsDuplicate", &self.packets_duplicate)?; - } - if self.packet_duplicate_rate != 0. { - struct_ser.serialize_field("packetDuplicateRate", &self.packet_duplicate_rate)?; - } - if self.bytes_duplicate != 0 { + if self.start_timestamp != 0 { #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("bytesDuplicate", ToString::to_string(&self.bytes_duplicate).as_str())?; + struct_ser.serialize_field("startTimestamp", ToString::to_string(&self.start_timestamp).as_str())?; } - if self.header_bytes_duplicate != 0 { + if self.end_timestamp != 0 { #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("headerBytesDuplicate", ToString::to_string(&self.header_bytes_duplicate).as_str())?; - } - if self.bitrate_duplicate != 0. { - struct_ser.serialize_field("bitrateDuplicate", &self.bitrate_duplicate)?; - } - if self.packets_padding != 0 { - struct_ser.serialize_field("packetsPadding", &self.packets_padding)?; - } - if self.packet_padding_rate != 0. { - struct_ser.serialize_field("packetPaddingRate", &self.packet_padding_rate)?; + struct_ser.serialize_field("endTimestamp", ToString::to_string(&self.end_timestamp).as_str())?; } - if self.bytes_padding != 0 { + if self.rtp_clock_ticks != 0 { #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("bytesPadding", ToString::to_string(&self.bytes_padding).as_str())?; + struct_ser.serialize_field("rtpClockTicks", ToString::to_string(&self.rtp_clock_ticks).as_str())?; } - if self.header_bytes_padding != 0 { + if self.drift_samples != 0 { #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("headerBytesPadding", ToString::to_string(&self.header_bytes_padding).as_str())?; - } - if self.bitrate_padding != 0. { - struct_ser.serialize_field("bitratePadding", &self.bitrate_padding)?; - } - if self.packets_out_of_order != 0 { - struct_ser.serialize_field("packetsOutOfOrder", &self.packets_out_of_order)?; + struct_ser.serialize_field("driftSamples", ToString::to_string(&self.drift_samples).as_str())?; } - if self.frames != 0 { - struct_ser.serialize_field("frames", &self.frames)?; + if self.drift_ms != 0. { + struct_ser.serialize_field("driftMs", &self.drift_ms)?; } - if self.frame_rate != 0. { - struct_ser.serialize_field("frameRate", &self.frame_rate)?; + if self.clock_rate != 0. { + struct_ser.serialize_field("clockRate", &self.clock_rate)?; } - if self.jitter_current != 0. { - struct_ser.serialize_field("jitterCurrent", &self.jitter_current)?; - } - if self.jitter_max != 0. { - struct_ser.serialize_field("jitterMax", &self.jitter_max)?; - } - if !self.gap_histogram.is_empty() { - struct_ser.serialize_field("gapHistogram", &self.gap_histogram)?; - } - if self.nacks != 0 { - struct_ser.serialize_field("nacks", &self.nacks)?; - } - if self.nack_acks != 0 { - struct_ser.serialize_field("nackAcks", &self.nack_acks)?; - } - if self.nack_misses != 0 { - struct_ser.serialize_field("nackMisses", &self.nack_misses)?; - } - if self.nack_repeated != 0 { - struct_ser.serialize_field("nackRepeated", &self.nack_repeated)?; - } - if self.plis != 0 { - struct_ser.serialize_field("plis", &self.plis)?; - } - if let Some(v) = self.last_pli.as_ref() { - struct_ser.serialize_field("lastPli", v)?; - } - if self.firs != 0 { - struct_ser.serialize_field("firs", &self.firs)?; - } - if let Some(v) = self.last_fir.as_ref() { - struct_ser.serialize_field("lastFir", v)?; - } - if self.rtt_current != 0 { - struct_ser.serialize_field("rttCurrent", &self.rtt_current)?; - } - if self.rtt_max != 0 { - struct_ser.serialize_field("rttMax", &self.rtt_max)?; - } - if self.key_frames != 0 { - struct_ser.serialize_field("keyFrames", &self.key_frames)?; - } - if let Some(v) = self.last_key_frame.as_ref() { - struct_ser.serialize_field("lastKeyFrame", v)?; - } - if self.layer_lock_plis != 0 { - struct_ser.serialize_field("layerLockPlis", &self.layer_lock_plis)?; - } - if let Some(v) = self.last_layer_lock_pli.as_ref() { - struct_ser.serialize_field("lastLayerLockPli", v)?; - } - 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.rebased_report_drift.as_ref() { - struct_ser.serialize_field("rebasedReportDrift", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for RtpStats { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "start_time", - "startTime", - "end_time", - "endTime", - "duration", - "packets", - "packet_rate", - "packetRate", - "bytes", - "header_bytes", - "headerBytes", - "bitrate", - "packets_lost", - "packetsLost", - "packet_loss_rate", - "packetLossRate", - "packet_loss_percentage", - "packetLossPercentage", - "packets_duplicate", - "packetsDuplicate", - "packet_duplicate_rate", - "packetDuplicateRate", - "bytes_duplicate", - "bytesDuplicate", - "header_bytes_duplicate", - "headerBytesDuplicate", - "bitrate_duplicate", - "bitrateDuplicate", - "packets_padding", - "packetsPadding", - "packet_padding_rate", - "packetPaddingRate", - "bytes_padding", - "bytesPadding", - "header_bytes_padding", - "headerBytesPadding", - "bitrate_padding", - "bitratePadding", - "packets_out_of_order", - "packetsOutOfOrder", - "frames", - "frame_rate", - "frameRate", - "jitter_current", - "jitterCurrent", - "jitter_max", - "jitterMax", - "gap_histogram", - "gapHistogram", - "nacks", - "nack_acks", - "nackAcks", - "nack_misses", - "nackMisses", - "nack_repeated", - "nackRepeated", - "plis", - "last_pli", - "lastPli", - "firs", - "last_fir", - "lastFir", - "rtt_current", - "rttCurrent", - "rtt_max", - "rttMax", - "key_frames", - "keyFrames", - "last_key_frame", - "lastKeyFrame", - "layer_lock_plis", - "layerLockPlis", - "last_layer_lock_pli", - "lastLayerLockPli", - "packet_drift", - "packetDrift", - "report_drift", - "reportDrift", - "rebased_report_drift", - "rebasedReportDrift", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - StartTime, - EndTime, - Duration, - Packets, - PacketRate, - Bytes, - HeaderBytes, - Bitrate, - PacketsLost, - PacketLossRate, - PacketLossPercentage, - PacketsDuplicate, - PacketDuplicateRate, - BytesDuplicate, - HeaderBytesDuplicate, - BitrateDuplicate, - PacketsPadding, - PacketPaddingRate, - BytesPadding, - HeaderBytesPadding, - BitratePadding, - PacketsOutOfOrder, - Frames, - FrameRate, - JitterCurrent, - JitterMax, - GapHistogram, - Nacks, - NackAcks, - NackMisses, - NackRepeated, - Plis, - LastPli, - Firs, - LastFir, - RttCurrent, - RttMax, - KeyFrames, - LastKeyFrame, - LayerLockPlis, - LastLayerLockPli, - PacketDrift, - ReportDrift, - RebasedReportDrift, - __SkipField__, + 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)] + enum GeneratedField { + StartTime, + EndTime, + Duration, + StartTimestamp, + EndTimestamp, + RtpClockTicks, + DriftSamples, + DriftMs, + ClockRate, + __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -13943,47 +15554,12 @@ impl<'de> serde::Deserialize<'de> for RtpStats { "startTime" | "start_time" => Ok(GeneratedField::StartTime), "endTime" | "end_time" => Ok(GeneratedField::EndTime), "duration" => Ok(GeneratedField::Duration), - "packets" => Ok(GeneratedField::Packets), - "packetRate" | "packet_rate" => Ok(GeneratedField::PacketRate), - "bytes" => Ok(GeneratedField::Bytes), - "headerBytes" | "header_bytes" => Ok(GeneratedField::HeaderBytes), - "bitrate" => Ok(GeneratedField::Bitrate), - "packetsLost" | "packets_lost" => Ok(GeneratedField::PacketsLost), - "packetLossRate" | "packet_loss_rate" => Ok(GeneratedField::PacketLossRate), - "packetLossPercentage" | "packet_loss_percentage" => Ok(GeneratedField::PacketLossPercentage), - "packetsDuplicate" | "packets_duplicate" => Ok(GeneratedField::PacketsDuplicate), - "packetDuplicateRate" | "packet_duplicate_rate" => Ok(GeneratedField::PacketDuplicateRate), - "bytesDuplicate" | "bytes_duplicate" => Ok(GeneratedField::BytesDuplicate), - "headerBytesDuplicate" | "header_bytes_duplicate" => Ok(GeneratedField::HeaderBytesDuplicate), - "bitrateDuplicate" | "bitrate_duplicate" => Ok(GeneratedField::BitrateDuplicate), - "packetsPadding" | "packets_padding" => Ok(GeneratedField::PacketsPadding), - "packetPaddingRate" | "packet_padding_rate" => Ok(GeneratedField::PacketPaddingRate), - "bytesPadding" | "bytes_padding" => Ok(GeneratedField::BytesPadding), - "headerBytesPadding" | "header_bytes_padding" => Ok(GeneratedField::HeaderBytesPadding), - "bitratePadding" | "bitrate_padding" => Ok(GeneratedField::BitratePadding), - "packetsOutOfOrder" | "packets_out_of_order" => Ok(GeneratedField::PacketsOutOfOrder), - "frames" => Ok(GeneratedField::Frames), - "frameRate" | "frame_rate" => Ok(GeneratedField::FrameRate), - "jitterCurrent" | "jitter_current" => Ok(GeneratedField::JitterCurrent), - "jitterMax" | "jitter_max" => Ok(GeneratedField::JitterMax), - "gapHistogram" | "gap_histogram" => Ok(GeneratedField::GapHistogram), - "nacks" => Ok(GeneratedField::Nacks), - "nackAcks" | "nack_acks" => Ok(GeneratedField::NackAcks), - "nackMisses" | "nack_misses" => Ok(GeneratedField::NackMisses), - "nackRepeated" | "nack_repeated" => Ok(GeneratedField::NackRepeated), - "plis" => Ok(GeneratedField::Plis), - "lastPli" | "last_pli" => Ok(GeneratedField::LastPli), - "firs" => Ok(GeneratedField::Firs), - "lastFir" | "last_fir" => Ok(GeneratedField::LastFir), - "rttCurrent" | "rtt_current" => Ok(GeneratedField::RttCurrent), - "rttMax" | "rtt_max" => Ok(GeneratedField::RttMax), - "keyFrames" | "key_frames" => Ok(GeneratedField::KeyFrames), - "lastKeyFrame" | "last_key_frame" => Ok(GeneratedField::LastKeyFrame), - "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), - "rebasedReportDrift" | "rebased_report_drift" => Ok(GeneratedField::RebasedReportDrift), + "startTimestamp" | "start_timestamp" => Ok(GeneratedField::StartTimestamp), + "endTimestamp" | "end_timestamp" => Ok(GeneratedField::EndTimestamp), + "rtpClockTicks" | "rtp_clock_ticks" => Ok(GeneratedField::RtpClockTicks), + "driftSamples" | "drift_samples" => Ok(GeneratedField::DriftSamples), + "driftMs" | "drift_ms" => Ok(GeneratedField::DriftMs), + "clockRate" | "clock_rate" => Ok(GeneratedField::ClockRate), _ => Ok(GeneratedField::__SkipField__), } } @@ -13993,60 +15569,25 @@ impl<'de> serde::Deserialize<'de> for RtpStats { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RtpStats; + type Value = RtpDrift; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.RTPStats") + formatter.write_str("struct livekit.RTPDrift") } - 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 start_time__ = None; let mut end_time__ = None; let mut duration__ = None; - let mut packets__ = None; - let mut packet_rate__ = None; - let mut bytes__ = None; - let mut header_bytes__ = None; - let mut bitrate__ = None; - let mut packets_lost__ = None; - let mut packet_loss_rate__ = None; - let mut packet_loss_percentage__ = None; - let mut packets_duplicate__ = None; - let mut packet_duplicate_rate__ = None; - let mut bytes_duplicate__ = None; - let mut header_bytes_duplicate__ = None; - let mut bitrate_duplicate__ = None; - let mut packets_padding__ = None; - let mut packet_padding_rate__ = None; - let mut bytes_padding__ = None; - let mut header_bytes_padding__ = None; - let mut bitrate_padding__ = None; - let mut packets_out_of_order__ = None; - let mut frames__ = None; - let mut frame_rate__ = None; - let mut jitter_current__ = None; - let mut jitter_max__ = None; - let mut gap_histogram__ = None; - let mut nacks__ = None; - let mut nack_acks__ = None; - let mut nack_misses__ = None; - let mut nack_repeated__ = None; - let mut plis__ = None; - let mut last_pli__ = None; - let mut firs__ = None; - let mut last_fir__ = None; - let mut rtt_current__ = None; - let mut rtt_max__ = None; - let mut key_frames__ = None; - let mut last_key_frame__ = None; - 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 rebased_report_drift__ = None; + let mut start_timestamp__ = None; + let mut end_timestamp__ = None; + let mut rtp_clock_ticks__ = None; + let mut drift_samples__ = None; + let mut drift_ms__ = None; + let mut clock_rate__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::StartTime => { @@ -14069,458 +15610,76 @@ impl<'de> serde::Deserialize<'de> for RtpStats { 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::PacketRate => { - if packet_rate__.is_some() { - return Err(serde::de::Error::duplicate_field("packetRate")); - } - packet_rate__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Bytes => { - if bytes__.is_some() { - return Err(serde::de::Error::duplicate_field("bytes")); - } - bytes__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::HeaderBytes => { - if header_bytes__.is_some() { - return Err(serde::de::Error::duplicate_field("headerBytes")); - } - header_bytes__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Bitrate => { - if bitrate__.is_some() { - return Err(serde::de::Error::duplicate_field("bitrate")); - } - bitrate__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::PacketsLost => { - if packets_lost__.is_some() { - return Err(serde::de::Error::duplicate_field("packetsLost")); - } - packets_lost__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::PacketLossRate => { - if packet_loss_rate__.is_some() { - return Err(serde::de::Error::duplicate_field("packetLossRate")); - } - packet_loss_rate__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::PacketLossPercentage => { - if packet_loss_percentage__.is_some() { - return Err(serde::de::Error::duplicate_field("packetLossPercentage")); - } - packet_loss_percentage__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::PacketsDuplicate => { - if packets_duplicate__.is_some() { - return Err(serde::de::Error::duplicate_field("packetsDuplicate")); - } - packets_duplicate__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::PacketDuplicateRate => { - if packet_duplicate_rate__.is_some() { - return Err(serde::de::Error::duplicate_field("packetDuplicateRate")); - } - packet_duplicate_rate__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::BytesDuplicate => { - if bytes_duplicate__.is_some() { - return Err(serde::de::Error::duplicate_field("bytesDuplicate")); - } - bytes_duplicate__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::HeaderBytesDuplicate => { - if header_bytes_duplicate__.is_some() { - return Err(serde::de::Error::duplicate_field("headerBytesDuplicate")); - } - header_bytes_duplicate__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::BitrateDuplicate => { - if bitrate_duplicate__.is_some() { - return Err(serde::de::Error::duplicate_field("bitrateDuplicate")); - } - bitrate_duplicate__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::PacketsPadding => { - if packets_padding__.is_some() { - return Err(serde::de::Error::duplicate_field("packetsPadding")); - } - packets_padding__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::PacketPaddingRate => { - if packet_padding_rate__.is_some() { - return Err(serde::de::Error::duplicate_field("packetPaddingRate")); - } - packet_padding_rate__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::BytesPadding => { - if bytes_padding__.is_some() { - return Err(serde::de::Error::duplicate_field("bytesPadding")); - } - bytes_padding__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::HeaderBytesPadding => { - if header_bytes_padding__.is_some() { - return Err(serde::de::Error::duplicate_field("headerBytesPadding")); - } - header_bytes_padding__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::BitratePadding => { - if bitrate_padding__.is_some() { - return Err(serde::de::Error::duplicate_field("bitratePadding")); - } - bitrate_padding__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::PacketsOutOfOrder => { - if packets_out_of_order__.is_some() { - return Err(serde::de::Error::duplicate_field("packetsOutOfOrder")); + GeneratedField::StartTimestamp => { + if start_timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("startTimestamp")); } - packets_out_of_order__ = + start_timestamp__ = Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } - GeneratedField::Frames => { - if frames__.is_some() { - return Err(serde::de::Error::duplicate_field("frames")); + GeneratedField::EndTimestamp => { + if end_timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("endTimestamp")); } - frames__ = + end_timestamp__ = Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } - GeneratedField::FrameRate => { - if frame_rate__.is_some() { - return Err(serde::de::Error::duplicate_field("frameRate")); + GeneratedField::RtpClockTicks => { + if rtp_clock_ticks__.is_some() { + return Err(serde::de::Error::duplicate_field("rtpClockTicks")); } - frame_rate__ = + rtp_clock_ticks__ = Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } - GeneratedField::JitterCurrent => { - if jitter_current__.is_some() { - return Err(serde::de::Error::duplicate_field("jitterCurrent")); + GeneratedField::DriftSamples => { + if drift_samples__.is_some() { + return Err(serde::de::Error::duplicate_field("driftSamples")); } - jitter_current__ = + drift_samples__ = Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } - GeneratedField::JitterMax => { - if jitter_max__.is_some() { - return Err(serde::de::Error::duplicate_field("jitterMax")); + GeneratedField::DriftMs => { + if drift_ms__.is_some() { + return Err(serde::de::Error::duplicate_field("driftMs")); } - jitter_max__ = + drift_ms__ = Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } - GeneratedField::GapHistogram => { - if gap_histogram__.is_some() { - return Err(serde::de::Error::duplicate_field("gapHistogram")); - } - gap_histogram__ = Some( - map_.next_value::, ::pbjson::private::NumberDeserialize>>()? - .into_iter().map(|(k,v)| (k.0, v.0)).collect() - ); - } - GeneratedField::Nacks => { - if nacks__.is_some() { - return Err(serde::de::Error::duplicate_field("nacks")); + GeneratedField::ClockRate => { + if clock_rate__.is_some() { + return Err(serde::de::Error::duplicate_field("clockRate")); } - nacks__ = + clock_rate__ = Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } - GeneratedField::NackAcks => { - if nack_acks__.is_some() { - return Err(serde::de::Error::duplicate_field("nackAcks")); - } - nack_acks__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::NackMisses => { - if nack_misses__.is_some() { - return Err(serde::de::Error::duplicate_field("nackMisses")); - } - nack_misses__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::NackRepeated => { - if nack_repeated__.is_some() { - return Err(serde::de::Error::duplicate_field("nackRepeated")); - } - nack_repeated__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Plis => { - if plis__.is_some() { - return Err(serde::de::Error::duplicate_field("plis")); - } - plis__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::LastPli => { - if last_pli__.is_some() { - return Err(serde::de::Error::duplicate_field("lastPli")); - } - last_pli__ = map_.next_value()?; - } - GeneratedField::Firs => { - if firs__.is_some() { - return Err(serde::de::Error::duplicate_field("firs")); - } - firs__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::LastFir => { - if last_fir__.is_some() { - return Err(serde::de::Error::duplicate_field("lastFir")); - } - last_fir__ = map_.next_value()?; - } - GeneratedField::RttCurrent => { - if rtt_current__.is_some() { - return Err(serde::de::Error::duplicate_field("rttCurrent")); - } - rtt_current__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::RttMax => { - if rtt_max__.is_some() { - return Err(serde::de::Error::duplicate_field("rttMax")); - } - rtt_max__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::KeyFrames => { - if key_frames__.is_some() { - return Err(serde::de::Error::duplicate_field("keyFrames")); - } - key_frames__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::LastKeyFrame => { - if last_key_frame__.is_some() { - return Err(serde::de::Error::duplicate_field("lastKeyFrame")); - } - last_key_frame__ = map_.next_value()?; - } - GeneratedField::LayerLockPlis => { - if layer_lock_plis__.is_some() { - return Err(serde::de::Error::duplicate_field("layerLockPlis")); - } - layer_lock_plis__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::LastLayerLockPli => { - if last_layer_lock_pli__.is_some() { - return Err(serde::de::Error::duplicate_field("lastLayerLockPli")); - } - last_layer_lock_pli__ = map_.next_value()?; - } - GeneratedField::PacketDrift => { - if packet_drift__.is_some() { - return Err(serde::de::Error::duplicate_field("packetDrift")); - } - packet_drift__ = map_.next_value()?; - } - GeneratedField::ReportDrift => { - if report_drift__.is_some() { - return Err(serde::de::Error::duplicate_field("reportDrift")); - } - 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::__SkipField__ => { - let _ = map_.next_value::()?; + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; } } } - Ok(RtpStats { + Ok(RtpDrift { 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__, + start_timestamp: start_timestamp__.unwrap_or_default(), + end_timestamp: end_timestamp__.unwrap_or_default(), + rtp_clock_ticks: rtp_clock_ticks__.unwrap_or_default(), + drift_samples: drift_samples__.unwrap_or_default(), + drift_ms: drift_ms__.unwrap_or_default(), + clock_rate: clock_rate__.unwrap_or_default(), }) } } - 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.RTPDrift", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ReconnectResponse { +impl serde::Serialize for RtpStats { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -14528,548 +15687,3298 @@ impl serde::Serialize for ReconnectResponse { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.ice_servers.is_empty() { + if self.start_time.is_some() { len += 1; } - if self.client_configuration.is_some() { + if self.end_time.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 self.duration != 0. { + len += 1; } - if let Some(v) = self.client_configuration.as_ref() { - struct_ser.serialize_field("clientConfiguration", v)?; + if self.packets != 0 { + len += 1; } - 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__, + if self.packet_rate != 0. { + len += 1; } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "iceServers" | "ice_servers" => Ok(GeneratedField::IceServers), - "clientConfiguration" | "client_configuration" => Ok(GeneratedField::ClientConfiguration), - _ => Ok(GeneratedField::__SkipField__), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } + if self.bytes != 0 { + len += 1; } - 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__, - }) - } + if self.header_bytes != 0 { + len += 1; } - 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() { + if self.bitrate != 0. { len += 1; } - if !self.url.is_empty() { + if self.packets_lost != 0 { len += 1; } - if self.distance != 0 { + if self.packet_loss_rate != 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.packet_loss_percentage != 0. { + len += 1; } - if !self.url.is_empty() { - struct_ser.serialize_field("url", &self.url)?; + if self.packets_duplicate != 0 { + len += 1; } - if self.distance != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("distance", ToString::to_string(&self.distance).as_str())?; + if self.packet_duplicate_rate != 0. { + len += 1; } - 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__, + if self.bytes_duplicate != 0 { + len += 1; } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "region" => Ok(GeneratedField::Region), - "url" => Ok(GeneratedField::Url), - "distance" => Ok(GeneratedField::Distance), - _ => Ok(GeneratedField::__SkipField__), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } + if self.header_bytes_duplicate != 0 { + len += 1; } - 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(), - }) - } + if self.bitrate_duplicate != 0. { + len += 1; } - 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() { + if self.packets_padding != 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.packet_padding_rate != 0. { + len += 1; } - 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__, + if self.bytes_padding != 0 { + len += 1; } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "regions" => Ok(GeneratedField::Regions), - _ => Ok(GeneratedField::__SkipField__), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } + if self.header_bytes_padding != 0 { + len += 1; } - 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(), - }) - } + if self.bitrate_padding != 0. { + len += 1; } - deserializer.deserialize_struct("livekit.RegionSettings", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for RemoveParticipantResponse { - #[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)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for RemoveParticipantResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - __SkipField__, + if self.packets_out_of_order != 0 { + len += 1; } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - Ok(GeneratedField::__SkipField__) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } + if self.frames != 0 { + len += 1; } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RemoveParticipantResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.RemoveParticipantResponse") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(RemoveParticipantResponse { - }) - } + if self.frame_rate != 0. { + len += 1; } - deserializer.deserialize_struct("livekit.RemoveParticipantResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Room { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.sid.is_empty() { + if self.jitter_current != 0. { len += 1; } - if !self.name.is_empty() { + if self.jitter_max != 0. { len += 1; } - if self.empty_timeout != 0 { + if !self.gap_histogram.is_empty() { len += 1; } - if self.departure_timeout != 0 { + if self.nacks != 0 { len += 1; } - if self.max_participants != 0 { + if self.nack_acks != 0 { len += 1; } - if self.creation_time != 0 { + if self.nack_misses != 0 { len += 1; } - if !self.turn_password.is_empty() { + if self.nack_repeated != 0 { len += 1; } - if !self.enabled_codecs.is_empty() { + if self.plis != 0 { len += 1; } - if !self.metadata.is_empty() { + if self.last_pli.is_some() { len += 1; } - if self.num_participants != 0 { + if self.firs != 0 { len += 1; } - if self.num_publishers != 0 { + if self.last_fir.is_some() { len += 1; } - if self.active_recording { + if self.rtt_current != 0 { len += 1; } - if self.version.is_some() { + if self.rtt_max != 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.key_frames != 0 { + len += 1; } - if !self.name.is_empty() { - struct_ser.serialize_field("name", &self.name)?; + if self.last_key_frame.is_some() { + len += 1; } - if self.empty_timeout != 0 { - struct_ser.serialize_field("emptyTimeout", &self.empty_timeout)?; + if self.layer_lock_plis != 0 { + len += 1; } - if self.departure_timeout != 0 { - struct_ser.serialize_field("departureTimeout", &self.departure_timeout)?; + if self.last_layer_lock_pli.is_some() { + len += 1; } - if self.max_participants != 0 { - struct_ser.serialize_field("maxParticipants", &self.max_participants)?; + if self.packet_drift.is_some() { + len += 1; } - if self.creation_time != 0 { + if self.report_drift.is_some() { + len += 1; + } + if self.rebased_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)?; + } + 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.packets != 0 { + struct_ser.serialize_field("packets", &self.packets)?; + } + if self.packet_rate != 0. { + struct_ser.serialize_field("packetRate", &self.packet_rate)?; + } + if self.bytes != 0 { #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("creationTime", ToString::to_string(&self.creation_time).as_str())?; + struct_ser.serialize_field("bytes", ToString::to_string(&self.bytes).as_str())?; } - if !self.turn_password.is_empty() { - struct_ser.serialize_field("turnPassword", &self.turn_password)?; + if self.header_bytes != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("headerBytes", ToString::to_string(&self.header_bytes).as_str())?; } - if !self.enabled_codecs.is_empty() { - struct_ser.serialize_field("enabledCodecs", &self.enabled_codecs)?; + if self.bitrate != 0. { + struct_ser.serialize_field("bitrate", &self.bitrate)?; } - if !self.metadata.is_empty() { - struct_ser.serialize_field("metadata", &self.metadata)?; + if self.packets_lost != 0 { + struct_ser.serialize_field("packetsLost", &self.packets_lost)?; } - if self.num_participants != 0 { - struct_ser.serialize_field("numParticipants", &self.num_participants)?; + if self.packet_loss_rate != 0. { + struct_ser.serialize_field("packetLossRate", &self.packet_loss_rate)?; } - if self.num_publishers != 0 { - struct_ser.serialize_field("numPublishers", &self.num_publishers)?; + if self.packet_loss_percentage != 0. { + struct_ser.serialize_field("packetLossPercentage", &self.packet_loss_percentage)?; } - if self.active_recording { - struct_ser.serialize_field("activeRecording", &self.active_recording)?; + if self.packets_duplicate != 0 { + struct_ser.serialize_field("packetsDuplicate", &self.packets_duplicate)?; } - if let Some(v) = self.version.as_ref() { - struct_ser.serialize_field("version", v)?; + if self.packet_duplicate_rate != 0. { + struct_ser.serialize_field("packetDuplicateRate", &self.packet_duplicate_rate)?; } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Room { - #[allow(deprecated)] + if self.bytes_duplicate != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("bytesDuplicate", ToString::to_string(&self.bytes_duplicate).as_str())?; + } + if self.header_bytes_duplicate != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("headerBytesDuplicate", ToString::to_string(&self.header_bytes_duplicate).as_str())?; + } + if self.bitrate_duplicate != 0. { + struct_ser.serialize_field("bitrateDuplicate", &self.bitrate_duplicate)?; + } + if self.packets_padding != 0 { + struct_ser.serialize_field("packetsPadding", &self.packets_padding)?; + } + if self.packet_padding_rate != 0. { + struct_ser.serialize_field("packetPaddingRate", &self.packet_padding_rate)?; + } + if self.bytes_padding != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("bytesPadding", ToString::to_string(&self.bytes_padding).as_str())?; + } + if self.header_bytes_padding != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("headerBytesPadding", ToString::to_string(&self.header_bytes_padding).as_str())?; + } + if self.bitrate_padding != 0. { + struct_ser.serialize_field("bitratePadding", &self.bitrate_padding)?; + } + if self.packets_out_of_order != 0 { + struct_ser.serialize_field("packetsOutOfOrder", &self.packets_out_of_order)?; + } + if self.frames != 0 { + struct_ser.serialize_field("frames", &self.frames)?; + } + if self.frame_rate != 0. { + struct_ser.serialize_field("frameRate", &self.frame_rate)?; + } + if self.jitter_current != 0. { + struct_ser.serialize_field("jitterCurrent", &self.jitter_current)?; + } + if self.jitter_max != 0. { + struct_ser.serialize_field("jitterMax", &self.jitter_max)?; + } + if !self.gap_histogram.is_empty() { + struct_ser.serialize_field("gapHistogram", &self.gap_histogram)?; + } + if self.nacks != 0 { + struct_ser.serialize_field("nacks", &self.nacks)?; + } + if self.nack_acks != 0 { + struct_ser.serialize_field("nackAcks", &self.nack_acks)?; + } + if self.nack_misses != 0 { + struct_ser.serialize_field("nackMisses", &self.nack_misses)?; + } + if self.nack_repeated != 0 { + struct_ser.serialize_field("nackRepeated", &self.nack_repeated)?; + } + if self.plis != 0 { + struct_ser.serialize_field("plis", &self.plis)?; + } + if let Some(v) = self.last_pli.as_ref() { + struct_ser.serialize_field("lastPli", v)?; + } + if self.firs != 0 { + struct_ser.serialize_field("firs", &self.firs)?; + } + if let Some(v) = self.last_fir.as_ref() { + struct_ser.serialize_field("lastFir", v)?; + } + if self.rtt_current != 0 { + struct_ser.serialize_field("rttCurrent", &self.rtt_current)?; + } + if self.rtt_max != 0 { + struct_ser.serialize_field("rttMax", &self.rtt_max)?; + } + if self.key_frames != 0 { + struct_ser.serialize_field("keyFrames", &self.key_frames)?; + } + if let Some(v) = self.last_key_frame.as_ref() { + struct_ser.serialize_field("lastKeyFrame", v)?; + } + if self.layer_lock_plis != 0 { + struct_ser.serialize_field("layerLockPlis", &self.layer_lock_plis)?; + } + if let Some(v) = self.last_layer_lock_pli.as_ref() { + struct_ser.serialize_field("lastLayerLockPli", v)?; + } + 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.rebased_report_drift.as_ref() { + struct_ser.serialize_field("rebasedReportDrift", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for RtpStats { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "start_time", + "startTime", + "end_time", + "endTime", + "duration", + "packets", + "packet_rate", + "packetRate", + "bytes", + "header_bytes", + "headerBytes", + "bitrate", + "packets_lost", + "packetsLost", + "packet_loss_rate", + "packetLossRate", + "packet_loss_percentage", + "packetLossPercentage", + "packets_duplicate", + "packetsDuplicate", + "packet_duplicate_rate", + "packetDuplicateRate", + "bytes_duplicate", + "bytesDuplicate", + "header_bytes_duplicate", + "headerBytesDuplicate", + "bitrate_duplicate", + "bitrateDuplicate", + "packets_padding", + "packetsPadding", + "packet_padding_rate", + "packetPaddingRate", + "bytes_padding", + "bytesPadding", + "header_bytes_padding", + "headerBytesPadding", + "bitrate_padding", + "bitratePadding", + "packets_out_of_order", + "packetsOutOfOrder", + "frames", + "frame_rate", + "frameRate", + "jitter_current", + "jitterCurrent", + "jitter_max", + "jitterMax", + "gap_histogram", + "gapHistogram", + "nacks", + "nack_acks", + "nackAcks", + "nack_misses", + "nackMisses", + "nack_repeated", + "nackRepeated", + "plis", + "last_pli", + "lastPli", + "firs", + "last_fir", + "lastFir", + "rtt_current", + "rttCurrent", + "rtt_max", + "rttMax", + "key_frames", + "keyFrames", + "last_key_frame", + "lastKeyFrame", + "layer_lock_plis", + "layerLockPlis", + "last_layer_lock_pli", + "lastLayerLockPli", + "packet_drift", + "packetDrift", + "report_drift", + "reportDrift", + "rebased_report_drift", + "rebasedReportDrift", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + StartTime, + EndTime, + Duration, + Packets, + PacketRate, + Bytes, + HeaderBytes, + Bitrate, + PacketsLost, + PacketLossRate, + PacketLossPercentage, + PacketsDuplicate, + PacketDuplicateRate, + BytesDuplicate, + HeaderBytesDuplicate, + BitrateDuplicate, + PacketsPadding, + PacketPaddingRate, + BytesPadding, + HeaderBytesPadding, + BitratePadding, + PacketsOutOfOrder, + Frames, + FrameRate, + JitterCurrent, + JitterMax, + GapHistogram, + Nacks, + NackAcks, + NackMisses, + NackRepeated, + Plis, + LastPli, + Firs, + LastFir, + RttCurrent, + RttMax, + KeyFrames, + LastKeyFrame, + LayerLockPlis, + LastLayerLockPli, + PacketDrift, + ReportDrift, + RebasedReportDrift, + __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 { + "startTime" | "start_time" => Ok(GeneratedField::StartTime), + "endTime" | "end_time" => Ok(GeneratedField::EndTime), + "duration" => Ok(GeneratedField::Duration), + "packets" => Ok(GeneratedField::Packets), + "packetRate" | "packet_rate" => Ok(GeneratedField::PacketRate), + "bytes" => Ok(GeneratedField::Bytes), + "headerBytes" | "header_bytes" => Ok(GeneratedField::HeaderBytes), + "bitrate" => Ok(GeneratedField::Bitrate), + "packetsLost" | "packets_lost" => Ok(GeneratedField::PacketsLost), + "packetLossRate" | "packet_loss_rate" => Ok(GeneratedField::PacketLossRate), + "packetLossPercentage" | "packet_loss_percentage" => Ok(GeneratedField::PacketLossPercentage), + "packetsDuplicate" | "packets_duplicate" => Ok(GeneratedField::PacketsDuplicate), + "packetDuplicateRate" | "packet_duplicate_rate" => Ok(GeneratedField::PacketDuplicateRate), + "bytesDuplicate" | "bytes_duplicate" => Ok(GeneratedField::BytesDuplicate), + "headerBytesDuplicate" | "header_bytes_duplicate" => Ok(GeneratedField::HeaderBytesDuplicate), + "bitrateDuplicate" | "bitrate_duplicate" => Ok(GeneratedField::BitrateDuplicate), + "packetsPadding" | "packets_padding" => Ok(GeneratedField::PacketsPadding), + "packetPaddingRate" | "packet_padding_rate" => Ok(GeneratedField::PacketPaddingRate), + "bytesPadding" | "bytes_padding" => Ok(GeneratedField::BytesPadding), + "headerBytesPadding" | "header_bytes_padding" => Ok(GeneratedField::HeaderBytesPadding), + "bitratePadding" | "bitrate_padding" => Ok(GeneratedField::BitratePadding), + "packetsOutOfOrder" | "packets_out_of_order" => Ok(GeneratedField::PacketsOutOfOrder), + "frames" => Ok(GeneratedField::Frames), + "frameRate" | "frame_rate" => Ok(GeneratedField::FrameRate), + "jitterCurrent" | "jitter_current" => Ok(GeneratedField::JitterCurrent), + "jitterMax" | "jitter_max" => Ok(GeneratedField::JitterMax), + "gapHistogram" | "gap_histogram" => Ok(GeneratedField::GapHistogram), + "nacks" => Ok(GeneratedField::Nacks), + "nackAcks" | "nack_acks" => Ok(GeneratedField::NackAcks), + "nackMisses" | "nack_misses" => Ok(GeneratedField::NackMisses), + "nackRepeated" | "nack_repeated" => Ok(GeneratedField::NackRepeated), + "plis" => Ok(GeneratedField::Plis), + "lastPli" | "last_pli" => Ok(GeneratedField::LastPli), + "firs" => Ok(GeneratedField::Firs), + "lastFir" | "last_fir" => Ok(GeneratedField::LastFir), + "rttCurrent" | "rtt_current" => Ok(GeneratedField::RttCurrent), + "rttMax" | "rtt_max" => Ok(GeneratedField::RttMax), + "keyFrames" | "key_frames" => Ok(GeneratedField::KeyFrames), + "lastKeyFrame" | "last_key_frame" => Ok(GeneratedField::LastKeyFrame), + "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), + "rebasedReportDrift" | "rebased_report_drift" => Ok(GeneratedField::RebasedReportDrift), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = RtpStats; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.RTPStats") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut start_time__ = None; + let mut end_time__ = None; + let mut duration__ = None; + let mut packets__ = None; + let mut packet_rate__ = None; + let mut bytes__ = None; + let mut header_bytes__ = None; + let mut bitrate__ = None; + let mut packets_lost__ = None; + let mut packet_loss_rate__ = None; + let mut packet_loss_percentage__ = None; + let mut packets_duplicate__ = None; + let mut packet_duplicate_rate__ = None; + let mut bytes_duplicate__ = None; + let mut header_bytes_duplicate__ = None; + let mut bitrate_duplicate__ = None; + let mut packets_padding__ = None; + let mut packet_padding_rate__ = None; + let mut bytes_padding__ = None; + let mut header_bytes_padding__ = None; + let mut bitrate_padding__ = None; + let mut packets_out_of_order__ = None; + let mut frames__ = None; + let mut frame_rate__ = None; + let mut jitter_current__ = None; + let mut jitter_max__ = None; + let mut gap_histogram__ = None; + let mut nacks__ = None; + let mut nack_acks__ = None; + let mut nack_misses__ = None; + let mut nack_repeated__ = None; + let mut plis__ = None; + let mut last_pli__ = None; + let mut firs__ = None; + let mut last_fir__ = None; + let mut rtt_current__ = None; + let mut rtt_max__ = None; + let mut key_frames__ = None; + let mut last_key_frame__ = None; + 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 rebased_report_drift__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::StartTime => { + if start_time__.is_some() { + return Err(serde::de::Error::duplicate_field("startTime")); + } + start_time__ = map_.next_value()?; + } + GeneratedField::EndTime => { + if end_time__.is_some() { + return Err(serde::de::Error::duplicate_field("endTime")); + } + end_time__ = map_.next_value()?; + } + GeneratedField::Duration => { + if duration__.is_some() { + return Err(serde::de::Error::duplicate_field("duration")); + } + duration__ = + 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::PacketRate => { + if packet_rate__.is_some() { + return Err(serde::de::Error::duplicate_field("packetRate")); + } + packet_rate__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Bytes => { + if bytes__.is_some() { + return Err(serde::de::Error::duplicate_field("bytes")); + } + bytes__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::HeaderBytes => { + if header_bytes__.is_some() { + return Err(serde::de::Error::duplicate_field("headerBytes")); + } + header_bytes__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Bitrate => { + if bitrate__.is_some() { + return Err(serde::de::Error::duplicate_field("bitrate")); + } + bitrate__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::PacketsLost => { + if packets_lost__.is_some() { + return Err(serde::de::Error::duplicate_field("packetsLost")); + } + packets_lost__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::PacketLossRate => { + if packet_loss_rate__.is_some() { + return Err(serde::de::Error::duplicate_field("packetLossRate")); + } + packet_loss_rate__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::PacketLossPercentage => { + if packet_loss_percentage__.is_some() { + return Err(serde::de::Error::duplicate_field("packetLossPercentage")); + } + packet_loss_percentage__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::PacketsDuplicate => { + if packets_duplicate__.is_some() { + return Err(serde::de::Error::duplicate_field("packetsDuplicate")); + } + packets_duplicate__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::PacketDuplicateRate => { + if packet_duplicate_rate__.is_some() { + return Err(serde::de::Error::duplicate_field("packetDuplicateRate")); + } + packet_duplicate_rate__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::BytesDuplicate => { + if bytes_duplicate__.is_some() { + return Err(serde::de::Error::duplicate_field("bytesDuplicate")); + } + bytes_duplicate__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::HeaderBytesDuplicate => { + if header_bytes_duplicate__.is_some() { + return Err(serde::de::Error::duplicate_field("headerBytesDuplicate")); + } + header_bytes_duplicate__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::BitrateDuplicate => { + if bitrate_duplicate__.is_some() { + return Err(serde::de::Error::duplicate_field("bitrateDuplicate")); + } + bitrate_duplicate__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::PacketsPadding => { + if packets_padding__.is_some() { + return Err(serde::de::Error::duplicate_field("packetsPadding")); + } + packets_padding__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::PacketPaddingRate => { + if packet_padding_rate__.is_some() { + return Err(serde::de::Error::duplicate_field("packetPaddingRate")); + } + packet_padding_rate__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::BytesPadding => { + if bytes_padding__.is_some() { + return Err(serde::de::Error::duplicate_field("bytesPadding")); + } + bytes_padding__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::HeaderBytesPadding => { + if header_bytes_padding__.is_some() { + return Err(serde::de::Error::duplicate_field("headerBytesPadding")); + } + header_bytes_padding__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::BitratePadding => { + if bitrate_padding__.is_some() { + return Err(serde::de::Error::duplicate_field("bitratePadding")); + } + bitrate_padding__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::PacketsOutOfOrder => { + if packets_out_of_order__.is_some() { + return Err(serde::de::Error::duplicate_field("packetsOutOfOrder")); + } + packets_out_of_order__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Frames => { + if frames__.is_some() { + return Err(serde::de::Error::duplicate_field("frames")); + } + frames__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::FrameRate => { + if frame_rate__.is_some() { + return Err(serde::de::Error::duplicate_field("frameRate")); + } + frame_rate__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::JitterCurrent => { + if jitter_current__.is_some() { + return Err(serde::de::Error::duplicate_field("jitterCurrent")); + } + jitter_current__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::JitterMax => { + if jitter_max__.is_some() { + return Err(serde::de::Error::duplicate_field("jitterMax")); + } + jitter_max__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::GapHistogram => { + if gap_histogram__.is_some() { + return Err(serde::de::Error::duplicate_field("gapHistogram")); + } + gap_histogram__ = Some( + map_.next_value::, ::pbjson::private::NumberDeserialize>>()? + .into_iter().map(|(k,v)| (k.0, v.0)).collect() + ); + } + GeneratedField::Nacks => { + if nacks__.is_some() { + return Err(serde::de::Error::duplicate_field("nacks")); + } + nacks__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::NackAcks => { + if nack_acks__.is_some() { + return Err(serde::de::Error::duplicate_field("nackAcks")); + } + nack_acks__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::NackMisses => { + if nack_misses__.is_some() { + return Err(serde::de::Error::duplicate_field("nackMisses")); + } + nack_misses__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::NackRepeated => { + if nack_repeated__.is_some() { + return Err(serde::de::Error::duplicate_field("nackRepeated")); + } + nack_repeated__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Plis => { + if plis__.is_some() { + return Err(serde::de::Error::duplicate_field("plis")); + } + plis__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::LastPli => { + if last_pli__.is_some() { + return Err(serde::de::Error::duplicate_field("lastPli")); + } + last_pli__ = map_.next_value()?; + } + GeneratedField::Firs => { + if firs__.is_some() { + return Err(serde::de::Error::duplicate_field("firs")); + } + firs__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::LastFir => { + if last_fir__.is_some() { + return Err(serde::de::Error::duplicate_field("lastFir")); + } + last_fir__ = map_.next_value()?; + } + GeneratedField::RttCurrent => { + if rtt_current__.is_some() { + return Err(serde::de::Error::duplicate_field("rttCurrent")); + } + rtt_current__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::RttMax => { + if rtt_max__.is_some() { + return Err(serde::de::Error::duplicate_field("rttMax")); + } + rtt_max__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::KeyFrames => { + if key_frames__.is_some() { + return Err(serde::de::Error::duplicate_field("keyFrames")); + } + key_frames__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::LastKeyFrame => { + if last_key_frame__.is_some() { + return Err(serde::de::Error::duplicate_field("lastKeyFrame")); + } + last_key_frame__ = map_.next_value()?; + } + GeneratedField::LayerLockPlis => { + if layer_lock_plis__.is_some() { + return Err(serde::de::Error::duplicate_field("layerLockPlis")); + } + layer_lock_plis__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::LastLayerLockPli => { + if last_layer_lock_pli__.is_some() { + return Err(serde::de::Error::duplicate_field("lastLayerLockPli")); + } + last_layer_lock_pli__ = map_.next_value()?; + } + GeneratedField::PacketDrift => { + if packet_drift__.is_some() { + return Err(serde::de::Error::duplicate_field("packetDrift")); + } + packet_drift__ = map_.next_value()?; + } + GeneratedField::ReportDrift => { + if report_drift__.is_some() { + return Err(serde::de::Error::duplicate_field("reportDrift")); + } + 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::__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__, + }) + } + } + 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)] + 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.name.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.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + 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", + "name", + "ping_interval", + "pingInterval", + "namespace", + "allowed_permissions", + "allowedPermissions", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Type, + AgentName, + Version, + Name, + 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), + "name" => Ok(GeneratedField::Name), + "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 name__ = 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::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); + } + name__ = 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::Namespace => { + if namespace__.is_some() { + return Err(serde::de::Error::duplicate_field("namespace")); + } + namespace__ = map_.next_value()?; + } + GeneratedField::AllowedPermissions => { + if allowed_permissions__.is_some() { + return Err(serde::de::Error::duplicate_field("allowedPermissions")); + } + allowed_permissions__ = 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(), + name: name__.unwrap_or_default(), + ping_interval: ping_interval__.unwrap_or_default(), + namespace: namespace__, + allowed_permissions: allowed_permissions__, + }) + } + } + deserializer.deserialize_struct("livekit.RegisterWorkerRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for RegisterWorkerResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.worker_id.is_empty() { + len += 1; + } + if self.server_info.is_some() { + 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)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for RegisterWorkerResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "worker_id", + "workerId", + "server_info", + "serverInfo", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + WorkerId, + ServerInfo, + __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 { + "workerId" | "worker_id" => Ok(GeneratedField::WorkerId), + "serverInfo" | "server_info" => Ok(GeneratedField::ServerInfo), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = RegisterWorkerResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.RegisterWorkerResponse") + } + + 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; + 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")); + } + server_info__ = map_.next_value()?; + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(RegisterWorkerResponse { + worker_id: worker_id__.unwrap_or_default(), + server_info: server_info__, + }) + } + } + deserializer.deserialize_struct("livekit.RegisterWorkerResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for RemoveParticipantResponse { + #[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)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for RemoveParticipantResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + __SkipField__, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + Ok(GeneratedField::__SkipField__) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = RemoveParticipantResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.RemoveParticipantResponse") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(RemoveParticipantResponse { + }) + } + } + deserializer.deserialize_struct("livekit.RemoveParticipantResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Room { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.sid.is_empty() { + len += 1; + } + 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.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.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.max_participants != 0 { + struct_ser.serialize_field("maxParticipants", &self.max_participants)?; + } + if self.creation_time != 0 { + #[allow(clippy::needless_borrow)] + 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 self.num_participants != 0 { + struct_ser.serialize_field("numParticipants", &self.num_participants)?; + } + if self.num_publishers != 0 { + struct_ser.serialize_field("numPublishers", &self.num_publishers)?; + } + 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 Room { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "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", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sid, + Name, + EmptyTimeout, + DepartureTimeout, + MaxParticipants, + CreationTime, + TurnPassword, + EnabledCodecs, + Metadata, + NumParticipants, + NumPublishers, + ActiveRecording, + Version, + __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 { + "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), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Room; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.Room") + } + + 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; + 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")); + } + 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::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")); + } + 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(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")); + } + dispatches__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(RoomAgent { + dispatches: dispatches__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.RoomAgent", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for RoomAgentDispatch { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + 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 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 { + 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 { + "agentName" | "agent_name" => Ok(GeneratedField::AgentName), + "metadata" => Ok(GeneratedField::Metadata), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = RoomAgentDispatch; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.RoomAgentDispatch") + } + + 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; + 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(RoomAgentDispatch { + agent_name: agent_name__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.RoomAgentDispatch", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for RoomCompositeEgressRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.room_name.is_empty() { + len += 1; + } + if !self.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() { + 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 RoomCompositeEgressRequest { + #[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", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + RoomName, + Layout, + AudioOnly, + VideoOnly, + CustomBaseUrl, + FileOutputs, + StreamOutputs, + SegmentOutputs, + ImageOutputs, + File, + Stream, + Segments, + Preset, + Advanced, + __SkipField__, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "roomName" | "room_name" => Ok(GeneratedField::RoomName), + "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__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = RoomCompositeEgressRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.RoomCompositeEgressRequest") + } + + 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; + 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")); + } + 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(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.RoomCompositeEgressRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for RoomConfiguration { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.name.is_empty() { + len += 1; + } + 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 { + 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)?; + } + if let Some(v) = self.egress.as_ref() { + struct_ser.serialize_field("egress", v)?; + } + if let Some(v) = self.agent.as_ref() { + struct_ser.serialize_field("agent", v)?; + } + if self.min_playout_delay != 0 { + struct_ser.serialize_field("minPlayoutDelay", &self.min_playout_delay)?; + } + if self.max_playout_delay != 0 { + struct_ser.serialize_field("maxPlayoutDelay", &self.max_playout_delay)?; + } + if self.sync_streams { + struct_ser.serialize_field("syncStreams", &self.sync_streams)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for RoomConfiguration { + #[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", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + EmptyTimeout, + DepartureTimeout, + MaxParticipants, + Egress, + Agent, + MinPlayoutDelay, + MaxPlayoutDelay, + SyncStreams, + __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 { + "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), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = RoomConfiguration; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.RoomConfiguration") + } + + 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; + 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")); + } + sync_streams__ = 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(), + }) + } + } + deserializer.deserialize_struct("livekit.RoomConfiguration", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for RoomEgress { + #[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.is_some() { + len += 1; + } + if self.participant.is_some() { + len += 1; + } + if self.tracks.is_some() { + 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)?; + } + 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 RoomEgress { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "room", + "participant", + "tracks", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Room, + Participant, + 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 { + 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), + "participant" => Ok(GeneratedField::Participant), + "tracks" => Ok(GeneratedField::Tracks), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = RoomEgress; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.RoomEgress") + } + + 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; + 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::Participant => { + if participant__.is_some() { + return Err(serde::de::Error::duplicate_field("participant")); + } + 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(RoomEgress { + room: room__, + participant: participant__, + tracks: tracks__, + }) + } + } + deserializer.deserialize_struct("livekit.RoomEgress", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for RoomParticipantIdentity { + #[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.is_empty() { + len += 1; + } + if !self.identity.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.identity.is_empty() { + struct_ser.serialize_field("identity", &self.identity)?; + } + struct_ser.end() + } +} +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", + "identity", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Room, + Identity, + __SkipField__, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "room" => Ok(GeneratedField::Room), + "identity" => Ok(GeneratedField::Identity), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = RoomParticipantIdentity; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.RoomParticipantIdentity") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut room__ = None; + let mut identity__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Room => { + if room__.is_some() { + return Err(serde::de::Error::duplicate_field("room")); + } + room__ = Some(map_.next_value()?); + } + GeneratedField::Identity => { + if identity__.is_some() { + return Err(serde::de::Error::duplicate_field("identity")); + } + identity__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(RoomParticipantIdentity { + room: room__.unwrap_or_default(), + identity: identity__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.RoomParticipantIdentity", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for RoomUpdate { + #[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.is_some() { + 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)?; + } + 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__, + } + 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) + } + } + 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__, + }) + } + } + deserializer.deserialize_struct("livekit.RoomUpdate", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for S3Upload { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.access_key.is_empty() { + len += 1; + } + if !self.secret.is_empty() { + len += 1; + } + if !self.session_token.is_empty() { + len += 1; + } + if !self.region.is_empty() { + len += 1; + } + if !self.endpoint.is_empty() { + len += 1; + } + if !self.bucket.is_empty() { + len += 1; + } + if self.force_path_style { + len += 1; + } + if !self.metadata.is_empty() { + len += 1; + } + if !self.tagging.is_empty() { + len += 1; + } + if !self.content_disposition.is_empty() { + len += 1; + } + if self.proxy.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.S3Upload", len)?; + if !self.access_key.is_empty() { + struct_ser.serialize_field("accessKey", &self.access_key)?; + } + if !self.secret.is_empty() { + struct_ser.serialize_field("secret", &self.secret)?; + } + if !self.session_token.is_empty() { + struct_ser.serialize_field("sessionToken", &self.session_token)?; + } + if !self.region.is_empty() { + struct_ser.serialize_field("region", &self.region)?; + } + if !self.endpoint.is_empty() { + struct_ser.serialize_field("endpoint", &self.endpoint)?; + } + if !self.bucket.is_empty() { + struct_ser.serialize_field("bucket", &self.bucket)?; + } + if self.force_path_style { + struct_ser.serialize_field("forcePathStyle", &self.force_path_style)?; + } + if !self.metadata.is_empty() { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + if !self.tagging.is_empty() { + struct_ser.serialize_field("tagging", &self.tagging)?; + } + if !self.content_disposition.is_empty() { + struct_ser.serialize_field("contentDisposition", &self.content_disposition)?; + } + if let Some(v) = self.proxy.as_ref() { + struct_ser.serialize_field("proxy", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for S3Upload { + #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "sid", - "name", - "empty_timeout", - "emptyTimeout", - "departure_timeout", - "departureTimeout", - "max_participants", - "maxParticipants", - "creation_time", - "creationTime", - "turn_password", - "turnPassword", - "enabled_codecs", - "enabledCodecs", + "access_key", + "accessKey", + "secret", + "session_token", + "sessionToken", + "region", + "endpoint", + "bucket", + "force_path_style", + "forcePathStyle", "metadata", - "num_participants", - "numParticipants", - "num_publishers", - "numPublishers", - "active_recording", - "activeRecording", - "version", + "tagging", + "content_disposition", + "contentDisposition", + "proxy", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Sid, - Name, - EmptyTimeout, - DepartureTimeout, - MaxParticipants, - CreationTime, - TurnPassword, - EnabledCodecs, + AccessKey, + Secret, + SessionToken, + Region, + Endpoint, + Bucket, + ForcePathStyle, Metadata, - NumParticipants, - NumPublishers, - ActiveRecording, - Version, + Tagging, + ContentDisposition, + Proxy, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -15092,19 +19001,17 @@ 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), + "accessKey" | "access_key" => Ok(GeneratedField::AccessKey), + "secret" => Ok(GeneratedField::Secret), + "sessionToken" | "session_token" => Ok(GeneratedField::SessionToken), + "region" => Ok(GeneratedField::Region), + "endpoint" => Ok(GeneratedField::Endpoint), + "bucket" => Ok(GeneratedField::Bucket), + "forcePathStyle" | "force_path_style" => Ok(GeneratedField::ForcePathStyle), "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), + "tagging" => Ok(GeneratedField::Tagging), + "contentDisposition" | "content_disposition" => Ok(GeneratedField::ContentDisposition), + "proxy" => Ok(GeneratedField::Proxy), _ => Ok(GeneratedField::__SkipField__), } } @@ -15114,147 +19021,236 @@ impl<'de> serde::Deserialize<'de> for Room { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Room; + type Value = S3Upload; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.Room") + formatter.write_str("struct livekit.S3Upload") } - 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 access_key__ = None; + let mut secret__ = None; + let mut session_token__ = None; + let mut region__ = None; + let mut endpoint__ = None; + let mut bucket__ = None; + let mut force_path_style__ = 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 tagging__ = None; + let mut content_disposition__ = None; + let mut proxy__ = 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")); + GeneratedField::AccessKey => { + if access_key__.is_some() { + return Err(serde::de::Error::duplicate_field("accessKey")); } - name__ = Some(map_.next_value()?); + access_key__ = Some(map_.next_value()?); } - GeneratedField::EmptyTimeout => { - if empty_timeout__.is_some() { - return Err(serde::de::Error::duplicate_field("emptyTimeout")); + GeneratedField::Secret => { + if secret__.is_some() { + return Err(serde::de::Error::duplicate_field("secret")); } - empty_timeout__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + secret__ = Some(map_.next_value()?); } - GeneratedField::DepartureTimeout => { - if departure_timeout__.is_some() { - return Err(serde::de::Error::duplicate_field("departureTimeout")); + GeneratedField::SessionToken => { + if session_token__.is_some() { + return Err(serde::de::Error::duplicate_field("sessionToken")); } - departure_timeout__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + session_token__ = Some(map_.next_value()?); } - GeneratedField::MaxParticipants => { - if max_participants__.is_some() { - return Err(serde::de::Error::duplicate_field("maxParticipants")); + GeneratedField::Region => { + if region__.is_some() { + return Err(serde::de::Error::duplicate_field("region")); } - max_participants__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + region__ = Some(map_.next_value()?); } - GeneratedField::CreationTime => { - if creation_time__.is_some() { - return Err(serde::de::Error::duplicate_field("creationTime")); + GeneratedField::Endpoint => { + if endpoint__.is_some() { + return Err(serde::de::Error::duplicate_field("endpoint")); } - creation_time__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + endpoint__ = Some(map_.next_value()?); } - GeneratedField::TurnPassword => { - if turn_password__.is_some() { - return Err(serde::de::Error::duplicate_field("turnPassword")); + GeneratedField::Bucket => { + if bucket__.is_some() { + return Err(serde::de::Error::duplicate_field("bucket")); } - turn_password__ = Some(map_.next_value()?); + bucket__ = Some(map_.next_value()?); } - GeneratedField::EnabledCodecs => { - if enabled_codecs__.is_some() { - return Err(serde::de::Error::duplicate_field("enabledCodecs")); + GeneratedField::ForcePathStyle => { + if force_path_style__.is_some() { + return Err(serde::de::Error::duplicate_field("forcePathStyle")); } - enabled_codecs__ = Some(map_.next_value()?); + force_path_style__ = Some(map_.next_value()?); } GeneratedField::Metadata => { if metadata__.is_some() { return Err(serde::de::Error::duplicate_field("metadata")); } - metadata__ = Some(map_.next_value()?); + metadata__ = Some( + map_.next_value::>()? + ); } - GeneratedField::NumParticipants => { - if num_participants__.is_some() { - return Err(serde::de::Error::duplicate_field("numParticipants")); + GeneratedField::Tagging => { + if tagging__.is_some() { + return Err(serde::de::Error::duplicate_field("tagging")); } - num_participants__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + tagging__ = Some(map_.next_value()?); } - GeneratedField::NumPublishers => { - if num_publishers__.is_some() { - return Err(serde::de::Error::duplicate_field("numPublishers")); + GeneratedField::ContentDisposition => { + if content_disposition__.is_some() { + return Err(serde::de::Error::duplicate_field("contentDisposition")); } - num_publishers__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + content_disposition__ = Some(map_.next_value()?); + } + GeneratedField::Proxy => { + if proxy__.is_some() { + return Err(serde::de::Error::duplicate_field("proxy")); + } + proxy__ = map_.next_value()?; + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(S3Upload { + access_key: access_key__.unwrap_or_default(), + secret: secret__.unwrap_or_default(), + session_token: session_token__.unwrap_or_default(), + region: region__.unwrap_or_default(), + endpoint: endpoint__.unwrap_or_default(), + bucket: bucket__.unwrap_or_default(), + force_path_style: force_path_style__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), + tagging: tagging__.unwrap_or_default(), + content_disposition: content_disposition__.unwrap_or_default(), + proxy: proxy__, + }) + } + } + deserializer.deserialize_struct("livekit.S3Upload", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SipDispatchRule { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.rule.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.SIPDispatchRule", len)?; + if let Some(v) = self.rule.as_ref() { + match v { + sip_dispatch_rule::Rule::DispatchRuleDirect(v) => { + struct_ser.serialize_field("dispatchRuleDirect", v)?; + } + sip_dispatch_rule::Rule::DispatchRuleIndividual(v) => { + struct_ser.serialize_field("dispatchRuleIndividual", v)?; + } + } + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SipDispatchRule { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "dispatch_rule_direct", + "dispatchRuleDirect", + "dispatch_rule_individual", + "dispatchRuleIndividual", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DispatchRuleDirect, + DispatchRuleIndividual, + __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 { + "dispatchRuleDirect" | "dispatch_rule_direct" => Ok(GeneratedField::DispatchRuleDirect), + "dispatchRuleIndividual" | "dispatch_rule_individual" => Ok(GeneratedField::DispatchRuleIndividual), + _ => Ok(GeneratedField::__SkipField__), } - GeneratedField::ActiveRecording => { - if active_recording__.is_some() { - return Err(serde::de::Error::duplicate_field("activeRecording")); + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SipDispatchRule; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.SIPDispatchRule") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut rule__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::DispatchRuleDirect => { + if rule__.is_some() { + return Err(serde::de::Error::duplicate_field("dispatchRuleDirect")); } - active_recording__ = Some(map_.next_value()?); + rule__ = map_.next_value::<::std::option::Option<_>>()?.map(sip_dispatch_rule::Rule::DispatchRuleDirect) +; } - GeneratedField::Version => { - if version__.is_some() { - return Err(serde::de::Error::duplicate_field("version")); + GeneratedField::DispatchRuleIndividual => { + if rule__.is_some() { + return Err(serde::de::Error::duplicate_field("dispatchRuleIndividual")); } - version__ = map_.next_value()?; + rule__ = map_.next_value::<::std::option::Option<_>>()?.map(sip_dispatch_rule::Rule::DispatchRuleIndividual) +; } 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__, + Ok(SipDispatchRule { + rule: rule__, }) } } - deserializer.deserialize_struct("livekit.Room", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.SIPDispatchRule", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for RoomCompositeEgressRequest { +impl serde::Serialize for SipDispatchRuleDirect { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -15265,93 +19261,20 @@ impl serde::Serialize for RoomCompositeEgressRequest { 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() { - len += 1; - } - if self.options.is_some() { + if !self.pin.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.RoomCompositeEgressRequest", len)?; + let mut struct_ser = serializer.serialize_struct("livekit.SIPDispatchRuleDirect", 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)?; - } - } + if !self.pin.is_empty() { + struct_ser.serialize_field("pin", &self.pin)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for RoomCompositeEgressRequest { +impl<'de> serde::Deserialize<'de> for SipDispatchRuleDirect { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where @@ -15360,44 +19283,13 @@ impl<'de> serde::Deserialize<'de> for RoomCompositeEgressRequest { 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", + "pin", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { RoomName, - Layout, - AudioOnly, - VideoOnly, - CustomBaseUrl, - FileOutputs, - StreamOutputs, - SegmentOutputs, - ImageOutputs, - File, - Stream, - Segments, - Preset, - Advanced, + Pin, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -15411,29 +19303,17 @@ impl<'de> serde::Deserialize<'de> for RoomCompositeEgressRequest { type Value = GeneratedField; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "roomName" | "room_name" => Ok(GeneratedField::RoomName), - "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), + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "roomName" | "room_name" => Ok(GeneratedField::RoomName), + "pin" => Ok(GeneratedField::Pin), _ => Ok(GeneratedField::__SkipField__), } } @@ -15443,27 +19323,18 @@ impl<'de> serde::Deserialize<'de> for RoomCompositeEgressRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RoomCompositeEgressRequest; + type Value = SipDispatchRuleDirect; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.RoomCompositeEgressRequest") + formatter.write_str("struct livekit.SIPDispatchRuleDirect") } - 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 pin__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::RoomName => { @@ -15472,112 +19343,27 @@ impl<'de> serde::Deserialize<'de> for RoomCompositeEgressRequest { } 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")); - } - 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")); + GeneratedField::Pin => { + if pin__.is_some() { + return Err(serde::de::Error::duplicate_field("pin")); } - options__ = map_.next_value::<::std::option::Option<_>>()?.map(room_composite_egress_request::Options::Advanced) -; + pin__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(RoomCompositeEgressRequest { + Ok(SipDispatchRuleDirect { 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__, + pin: pin__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.RoomCompositeEgressRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.SIPDispatchRuleDirect", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for RoomEgress { +impl serde::Serialize for SipDispatchRuleIndividual { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -15585,45 +19371,38 @@ impl serde::Serialize for RoomEgress { { use serde::ser::SerializeStruct; let mut len = 0; - if self.room.is_some() { - len += 1; - } - if self.participant.is_some() { + if !self.room_prefix.is_empty() { len += 1; } - if self.tracks.is_some() { + if !self.pin.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)?; - } - if let Some(v) = self.participant.as_ref() { - struct_ser.serialize_field("participant", v)?; + let mut struct_ser = serializer.serialize_struct("livekit.SIPDispatchRuleIndividual", len)?; + if !self.room_prefix.is_empty() { + struct_ser.serialize_field("roomPrefix", &self.room_prefix)?; } - if let Some(v) = self.tracks.as_ref() { - struct_ser.serialize_field("tracks", v)?; + if !self.pin.is_empty() { + struct_ser.serialize_field("pin", &self.pin)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for RoomEgress { +impl<'de> serde::Deserialize<'de> for SipDispatchRuleIndividual { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "room", - "participant", - "tracks", + "room_prefix", + "roomPrefix", + "pin", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Room, - Participant, - Tracks, + RoomPrefix, + Pin, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -15646,9 +19425,8 @@ 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), + "roomPrefix" | "room_prefix" => Ok(GeneratedField::RoomPrefix), + "pin" => Ok(GeneratedField::Pin), _ => Ok(GeneratedField::__SkipField__), } } @@ -15658,55 +19436,47 @@ impl<'de> serde::Deserialize<'de> for RoomEgress { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RoomEgress; + type Value = SipDispatchRuleIndividual; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.RoomEgress") + formatter.write_str("struct livekit.SIPDispatchRuleIndividual") } - 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 room_prefix__ = None; + let mut pin__ = 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::Participant => { - if participant__.is_some() { - return Err(serde::de::Error::duplicate_field("participant")); + GeneratedField::RoomPrefix => { + if room_prefix__.is_some() { + return Err(serde::de::Error::duplicate_field("roomPrefix")); } - participant__ = map_.next_value()?; + room_prefix__ = Some(map_.next_value()?); } - GeneratedField::Tracks => { - if tracks__.is_some() { - return Err(serde::de::Error::duplicate_field("tracks")); + GeneratedField::Pin => { + if pin__.is_some() { + return Err(serde::de::Error::duplicate_field("pin")); } - tracks__ = map_.next_value()?; + pin__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(RoomEgress { - room: room__, - participant: participant__, - tracks: tracks__, + Ok(SipDispatchRuleIndividual { + room_prefix: room_prefix__.unwrap_or_default(), + pin: pin__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.RoomEgress", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.SIPDispatchRuleIndividual", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for RoomParticipantIdentity { +impl serde::Serialize for SipDispatchRuleInfo { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -15714,37 +19484,89 @@ impl serde::Serialize for RoomParticipantIdentity { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.room.is_empty() { + if !self.sip_dispatch_rule_id.is_empty() { len += 1; } - if !self.identity.is_empty() { + if self.rule.is_some() { 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.trunk_ids.is_empty() { + len += 1; + } + if self.hide_phone_number { + len += 1; + } + if !self.inbound_numbers.is_empty() { + len += 1; + } + if !self.name.is_empty() { + len += 1; + } + if !self.metadata.is_empty() { + len += 1; + } + if !self.attributes.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.SIPDispatchRuleInfo", len)?; + if !self.sip_dispatch_rule_id.is_empty() { + struct_ser.serialize_field("sipDispatchRuleId", &self.sip_dispatch_rule_id)?; + } + if let Some(v) = self.rule.as_ref() { + struct_ser.serialize_field("rule", v)?; + } + if !self.trunk_ids.is_empty() { + struct_ser.serialize_field("trunkIds", &self.trunk_ids)?; + } + if self.hide_phone_number { + struct_ser.serialize_field("hidePhoneNumber", &self.hide_phone_number)?; + } + if !self.inbound_numbers.is_empty() { + struct_ser.serialize_field("inboundNumbers", &self.inbound_numbers)?; + } + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if !self.metadata.is_empty() { + struct_ser.serialize_field("metadata", &self.metadata)?; } - if !self.identity.is_empty() { - struct_ser.serialize_field("identity", &self.identity)?; + if !self.attributes.is_empty() { + struct_ser.serialize_field("attributes", &self.attributes)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for RoomParticipantIdentity { +impl<'de> serde::Deserialize<'de> for SipDispatchRuleInfo { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "room", - "identity", + "sip_dispatch_rule_id", + "sipDispatchRuleId", + "rule", + "trunk_ids", + "trunkIds", + "hide_phone_number", + "hidePhoneNumber", + "inbound_numbers", + "inboundNumbers", + "name", + "metadata", + "attributes", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Room, - Identity, + SipDispatchRuleId, + Rule, + TrunkIds, + HidePhoneNumber, + InboundNumbers, + Name, + Metadata, + Attributes, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -15767,8 +19589,14 @@ impl<'de> serde::Deserialize<'de> for RoomParticipantIdentity { E: serde::de::Error, { match value { - "room" => Ok(GeneratedField::Room), - "identity" => Ok(GeneratedField::Identity), + "sipDispatchRuleId" | "sip_dispatch_rule_id" => Ok(GeneratedField::SipDispatchRuleId), + "rule" => Ok(GeneratedField::Rule), + "trunkIds" | "trunk_ids" => Ok(GeneratedField::TrunkIds), + "hidePhoneNumber" | "hide_phone_number" => Ok(GeneratedField::HidePhoneNumber), + "inboundNumbers" | "inbound_numbers" => Ok(GeneratedField::InboundNumbers), + "name" => Ok(GeneratedField::Name), + "metadata" => Ok(GeneratedField::Metadata), + "attributes" => Ok(GeneratedField::Attributes), _ => Ok(GeneratedField::__SkipField__), } } @@ -15778,47 +19606,97 @@ impl<'de> serde::Deserialize<'de> for RoomParticipantIdentity { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RoomParticipantIdentity; + type Value = SipDispatchRuleInfo; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.RoomParticipantIdentity") + formatter.write_str("struct livekit.SIPDispatchRuleInfo") } - 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 sip_dispatch_rule_id__ = None; + let mut rule__ = None; + let mut trunk_ids__ = None; + let mut hide_phone_number__ = None; + let mut inbound_numbers__ = None; + let mut name__ = None; + let mut metadata__ = None; + let mut attributes__ = 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::SipDispatchRuleId => { + if sip_dispatch_rule_id__.is_some() { + return Err(serde::de::Error::duplicate_field("sipDispatchRuleId")); } - room__ = Some(map_.next_value()?); + sip_dispatch_rule_id__ = Some(map_.next_value()?); } - GeneratedField::Identity => { - if identity__.is_some() { - return Err(serde::de::Error::duplicate_field("identity")); + GeneratedField::Rule => { + if rule__.is_some() { + return Err(serde::de::Error::duplicate_field("rule")); } - identity__ = Some(map_.next_value()?); + rule__ = map_.next_value()?; + } + GeneratedField::TrunkIds => { + if trunk_ids__.is_some() { + return Err(serde::de::Error::duplicate_field("trunkIds")); + } + trunk_ids__ = Some(map_.next_value()?); + } + GeneratedField::HidePhoneNumber => { + if hide_phone_number__.is_some() { + return Err(serde::de::Error::duplicate_field("hidePhoneNumber")); + } + hide_phone_number__ = Some(map_.next_value()?); + } + GeneratedField::InboundNumbers => { + if inbound_numbers__.is_some() { + return Err(serde::de::Error::duplicate_field("inboundNumbers")); + } + inbound_numbers__ = Some(map_.next_value()?); + } + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); + } + 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::Attributes => { + if attributes__.is_some() { + return Err(serde::de::Error::duplicate_field("attributes")); + } + attributes__ = Some( + map_.next_value::>()? + ); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(RoomParticipantIdentity { - room: room__.unwrap_or_default(), - identity: identity__.unwrap_or_default(), + Ok(SipDispatchRuleInfo { + sip_dispatch_rule_id: sip_dispatch_rule_id__.unwrap_or_default(), + rule: rule__, + trunk_ids: trunk_ids__.unwrap_or_default(), + hide_phone_number: hide_phone_number__.unwrap_or_default(), + inbound_numbers: inbound_numbers__.unwrap_or_default(), + name: name__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), + attributes: attributes__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.RoomParticipantIdentity", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.SIPDispatchRuleInfo", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for RoomUpdate { +impl serde::Serialize for SipInboundTrunkInfo { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -15826,29 +19704,90 @@ impl serde::Serialize for RoomUpdate { { use serde::ser::SerializeStruct; let mut len = 0; - if self.room.is_some() { + if !self.sip_trunk_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.name.is_empty() { + len += 1; + } + if !self.metadata.is_empty() { + len += 1; + } + if !self.numbers.is_empty() { + len += 1; + } + if !self.allowed_addresses.is_empty() { + len += 1; + } + if !self.allowed_numbers.is_empty() { + len += 1; + } + if !self.auth_username.is_empty() { + len += 1; + } + if !self.auth_password.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)?; + } + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if !self.metadata.is_empty() { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + if !self.numbers.is_empty() { + struct_ser.serialize_field("numbers", &self.numbers)?; + } + if !self.allowed_addresses.is_empty() { + struct_ser.serialize_field("allowedAddresses", &self.allowed_addresses)?; + } + if !self.allowed_numbers.is_empty() { + struct_ser.serialize_field("allowedNumbers", &self.allowed_numbers)?; + } + if !self.auth_username.is_empty() { + struct_ser.serialize_field("authUsername", &self.auth_username)?; + } + if !self.auth_password.is_empty() { + struct_ser.serialize_field("authPassword", &self.auth_password)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for RoomUpdate { +impl<'de> serde::Deserialize<'de> for SipInboundTrunkInfo { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "room", + "sip_trunk_id", + "sipTrunkId", + "name", + "metadata", + "numbers", + "allowed_addresses", + "allowedAddresses", + "allowed_numbers", + "allowedNumbers", + "auth_username", + "authUsername", + "auth_password", + "authPassword", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Room, + SipTrunkId, + Name, + Metadata, + Numbers, + AllowedAddresses, + AllowedNumbers, + AuthUsername, + AuthPassword, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -15871,7 +19810,14 @@ impl<'de> serde::Deserialize<'de> for RoomUpdate { E: serde::de::Error, { match value { - "room" => Ok(GeneratedField::Room), + "sipTrunkId" | "sip_trunk_id" => Ok(GeneratedField::SipTrunkId), + "name" => Ok(GeneratedField::Name), + "metadata" => Ok(GeneratedField::Metadata), + "numbers" => Ok(GeneratedField::Numbers), + "allowedAddresses" | "allowed_addresses" => Ok(GeneratedField::AllowedAddresses), + "allowedNumbers" | "allowed_numbers" => Ok(GeneratedField::AllowedNumbers), + "authUsername" | "auth_username" => Ok(GeneratedField::AuthUsername), + "authPassword" | "auth_password" => Ok(GeneratedField::AuthPassword), _ => Ok(GeneratedField::__SkipField__), } } @@ -15881,39 +19827,95 @@ impl<'de> serde::Deserialize<'de> for RoomUpdate { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RoomUpdate; + type Value = SipInboundTrunkInfo; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.RoomUpdate") + formatter.write_str("struct livekit.SIPInboundTrunkInfo") } - 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 sip_trunk_id__ = None; + let mut name__ = None; + let mut metadata__ = None; + let mut numbers__ = None; + let mut allowed_addresses__ = None; + let mut allowed_numbers__ = None; + let mut auth_username__ = None; + let mut auth_password__ = 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::SipTrunkId => { + if sip_trunk_id__.is_some() { + return Err(serde::de::Error::duplicate_field("sipTrunkId")); + } + sip_trunk_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::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = Some(map_.next_value()?); + } + GeneratedField::Numbers => { + if numbers__.is_some() { + return Err(serde::de::Error::duplicate_field("numbers")); + } + numbers__ = Some(map_.next_value()?); + } + GeneratedField::AllowedAddresses => { + if allowed_addresses__.is_some() { + return Err(serde::de::Error::duplicate_field("allowedAddresses")); } - room__ = map_.next_value()?; + allowed_addresses__ = Some(map_.next_value()?); + } + GeneratedField::AllowedNumbers => { + if allowed_numbers__.is_some() { + return Err(serde::de::Error::duplicate_field("allowedNumbers")); + } + allowed_numbers__ = Some(map_.next_value()?); + } + GeneratedField::AuthUsername => { + if auth_username__.is_some() { + return Err(serde::de::Error::duplicate_field("authUsername")); + } + auth_username__ = Some(map_.next_value()?); + } + GeneratedField::AuthPassword => { + if auth_password__.is_some() { + return Err(serde::de::Error::duplicate_field("authPassword")); + } + auth_password__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(RoomUpdate { - room: room__, + Ok(SipInboundTrunkInfo { + sip_trunk_id: sip_trunk_id__.unwrap_or_default(), + name: name__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), + numbers: numbers__.unwrap_or_default(), + allowed_addresses: allowed_addresses__.unwrap_or_default(), + allowed_numbers: allowed_numbers__.unwrap_or_default(), + auth_username: auth_username__.unwrap_or_default(), + auth_password: auth_password__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.RoomUpdate", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.SIPInboundTrunkInfo", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for S3Upload { +impl serde::Serialize for SipOutboundTrunkInfo { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -15921,113 +19923,90 @@ impl serde::Serialize for S3Upload { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.access_key.is_empty() { - len += 1; - } - if !self.secret.is_empty() { - len += 1; - } - if !self.session_token.is_empty() { - len += 1; - } - if !self.region.is_empty() { + if !self.sip_trunk_id.is_empty() { len += 1; } - if !self.endpoint.is_empty() { + if !self.name.is_empty() { len += 1; } - if !self.bucket.is_empty() { + if !self.metadata.is_empty() { len += 1; } - if self.force_path_style { + if !self.address.is_empty() { len += 1; } - if !self.metadata.is_empty() { + if self.transport != 0 { len += 1; } - if !self.tagging.is_empty() { + if !self.numbers.is_empty() { len += 1; } - if !self.content_disposition.is_empty() { + if !self.auth_username.is_empty() { len += 1; } - if self.proxy.is_some() { + if !self.auth_password.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.S3Upload", len)?; - if !self.access_key.is_empty() { - struct_ser.serialize_field("accessKey", &self.access_key)?; - } - if !self.secret.is_empty() { - struct_ser.serialize_field("secret", &self.secret)?; - } - if !self.session_token.is_empty() { - struct_ser.serialize_field("sessionToken", &self.session_token)?; - } - if !self.region.is_empty() { - struct_ser.serialize_field("region", &self.region)?; - } - if !self.endpoint.is_empty() { - struct_ser.serialize_field("endpoint", &self.endpoint)?; - } - if !self.bucket.is_empty() { - struct_ser.serialize_field("bucket", &self.bucket)?; + let mut struct_ser = serializer.serialize_struct("livekit.SIPOutboundTrunkInfo", len)?; + if !self.sip_trunk_id.is_empty() { + struct_ser.serialize_field("sipTrunkId", &self.sip_trunk_id)?; } - if self.force_path_style { - struct_ser.serialize_field("forcePathStyle", &self.force_path_style)?; + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; } if !self.metadata.is_empty() { struct_ser.serialize_field("metadata", &self.metadata)?; } - if !self.tagging.is_empty() { - struct_ser.serialize_field("tagging", &self.tagging)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; } - if !self.content_disposition.is_empty() { - struct_ser.serialize_field("contentDisposition", &self.content_disposition)?; + if self.transport != 0 { + let v = SipTransport::try_from(self.transport) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.transport)))?; + struct_ser.serialize_field("transport", &v)?; } - if let Some(v) = self.proxy.as_ref() { - struct_ser.serialize_field("proxy", v)?; + if !self.numbers.is_empty() { + struct_ser.serialize_field("numbers", &self.numbers)?; + } + if !self.auth_username.is_empty() { + struct_ser.serialize_field("authUsername", &self.auth_username)?; + } + if !self.auth_password.is_empty() { + struct_ser.serialize_field("authPassword", &self.auth_password)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for S3Upload { +impl<'de> serde::Deserialize<'de> for SipOutboundTrunkInfo { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "access_key", - "accessKey", - "secret", - "session_token", - "sessionToken", - "region", - "endpoint", - "bucket", - "force_path_style", - "forcePathStyle", + "sip_trunk_id", + "sipTrunkId", + "name", "metadata", - "tagging", - "content_disposition", - "contentDisposition", - "proxy", + "address", + "transport", + "numbers", + "auth_username", + "authUsername", + "auth_password", + "authPassword", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - AccessKey, - Secret, - SessionToken, - Region, - Endpoint, - Bucket, - ForcePathStyle, + SipTrunkId, + Name, Metadata, - Tagging, - ContentDisposition, - Proxy, + Address, + Transport, + Numbers, + AuthUsername, + AuthPassword, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -16050,17 +20029,14 @@ impl<'de> serde::Deserialize<'de> for S3Upload { E: serde::de::Error, { match value { - "accessKey" | "access_key" => Ok(GeneratedField::AccessKey), - "secret" => Ok(GeneratedField::Secret), - "sessionToken" | "session_token" => Ok(GeneratedField::SessionToken), - "region" => Ok(GeneratedField::Region), - "endpoint" => Ok(GeneratedField::Endpoint), - "bucket" => Ok(GeneratedField::Bucket), - "forcePathStyle" | "force_path_style" => Ok(GeneratedField::ForcePathStyle), + "sipTrunkId" | "sip_trunk_id" => Ok(GeneratedField::SipTrunkId), + "name" => Ok(GeneratedField::Name), "metadata" => Ok(GeneratedField::Metadata), - "tagging" => Ok(GeneratedField::Tagging), - "contentDisposition" | "content_disposition" => Ok(GeneratedField::ContentDisposition), - "proxy" => Ok(GeneratedField::Proxy), + "address" => Ok(GeneratedField::Address), + "transport" => Ok(GeneratedField::Transport), + "numbers" => Ok(GeneratedField::Numbers), + "authUsername" | "auth_username" => Ok(GeneratedField::AuthUsername), + "authPassword" | "auth_password" => Ok(GeneratedField::AuthPassword), _ => Ok(GeneratedField::__SkipField__), } } @@ -16070,121 +20046,95 @@ impl<'de> serde::Deserialize<'de> for S3Upload { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = S3Upload; + type Value = SipOutboundTrunkInfo; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.S3Upload") + formatter.write_str("struct livekit.SIPOutboundTrunkInfo") } - 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 access_key__ = None; - let mut secret__ = None; - let mut session_token__ = None; - let mut region__ = None; - let mut endpoint__ = None; - let mut bucket__ = None; - let mut force_path_style__ = None; + let mut sip_trunk_id__ = None; + let mut name__ = None; let mut metadata__ = None; - let mut tagging__ = None; - let mut content_disposition__ = None; - let mut proxy__ = None; + let mut address__ = None; + let mut transport__ = None; + let mut numbers__ = None; + let mut auth_username__ = None; + let mut auth_password__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::AccessKey => { - if access_key__.is_some() { - return Err(serde::de::Error::duplicate_field("accessKey")); - } - access_key__ = Some(map_.next_value()?); - } - GeneratedField::Secret => { - if secret__.is_some() { - return Err(serde::de::Error::duplicate_field("secret")); - } - secret__ = Some(map_.next_value()?); - } - GeneratedField::SessionToken => { - if session_token__.is_some() { - return Err(serde::de::Error::duplicate_field("sessionToken")); - } - session_token__ = Some(map_.next_value()?); - } - GeneratedField::Region => { - if region__.is_some() { - return Err(serde::de::Error::duplicate_field("region")); + GeneratedField::SipTrunkId => { + if sip_trunk_id__.is_some() { + return Err(serde::de::Error::duplicate_field("sipTrunkId")); } - region__ = Some(map_.next_value()?); + sip_trunk_id__ = Some(map_.next_value()?); } - GeneratedField::Endpoint => { - if endpoint__.is_some() { - return Err(serde::de::Error::duplicate_field("endpoint")); + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); } - endpoint__ = Some(map_.next_value()?); + name__ = Some(map_.next_value()?); } - GeneratedField::Bucket => { - if bucket__.is_some() { - return Err(serde::de::Error::duplicate_field("bucket")); + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); } - bucket__ = Some(map_.next_value()?); + metadata__ = Some(map_.next_value()?); } - GeneratedField::ForcePathStyle => { - if force_path_style__.is_some() { - return Err(serde::de::Error::duplicate_field("forcePathStyle")); + GeneratedField::Address => { + if address__.is_some() { + return Err(serde::de::Error::duplicate_field("address")); } - force_path_style__ = Some(map_.next_value()?); + address__ = Some(map_.next_value()?); } - GeneratedField::Metadata => { - if metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("metadata")); + GeneratedField::Transport => { + if transport__.is_some() { + return Err(serde::de::Error::duplicate_field("transport")); } - metadata__ = Some( - map_.next_value::>()? - ); + transport__ = Some(map_.next_value::()? as i32); } - GeneratedField::Tagging => { - if tagging__.is_some() { - return Err(serde::de::Error::duplicate_field("tagging")); + GeneratedField::Numbers => { + if numbers__.is_some() { + return Err(serde::de::Error::duplicate_field("numbers")); } - tagging__ = Some(map_.next_value()?); + numbers__ = Some(map_.next_value()?); } - GeneratedField::ContentDisposition => { - if content_disposition__.is_some() { - return Err(serde::de::Error::duplicate_field("contentDisposition")); + GeneratedField::AuthUsername => { + if auth_username__.is_some() { + return Err(serde::de::Error::duplicate_field("authUsername")); } - content_disposition__ = Some(map_.next_value()?); + auth_username__ = Some(map_.next_value()?); } - GeneratedField::Proxy => { - if proxy__.is_some() { - return Err(serde::de::Error::duplicate_field("proxy")); + GeneratedField::AuthPassword => { + if auth_password__.is_some() { + return Err(serde::de::Error::duplicate_field("authPassword")); } - proxy__ = map_.next_value()?; + auth_password__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(S3Upload { - access_key: access_key__.unwrap_or_default(), - secret: secret__.unwrap_or_default(), - session_token: session_token__.unwrap_or_default(), - region: region__.unwrap_or_default(), - endpoint: endpoint__.unwrap_or_default(), - bucket: bucket__.unwrap_or_default(), - force_path_style: force_path_style__.unwrap_or_default(), + Ok(SipOutboundTrunkInfo { + sip_trunk_id: sip_trunk_id__.unwrap_or_default(), + name: name__.unwrap_or_default(), metadata: metadata__.unwrap_or_default(), - tagging: tagging__.unwrap_or_default(), - content_disposition: content_disposition__.unwrap_or_default(), - proxy: proxy__, + address: address__.unwrap_or_default(), + transport: transport__.unwrap_or_default(), + numbers: numbers__.unwrap_or_default(), + auth_username: auth_username__.unwrap_or_default(), + auth_password: auth_password__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.S3Upload", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.SIPOutboundTrunkInfo", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for SipDispatchRule { +impl serde::Serialize for SipParticipantInfo { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -16192,40 +20142,57 @@ impl serde::Serialize for SipDispatchRule { { use serde::ser::SerializeStruct; let mut len = 0; - if self.rule.is_some() { + if !self.participant_id.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.SIPDispatchRule", len)?; - if let Some(v) = self.rule.as_ref() { - match v { - sip_dispatch_rule::Rule::DispatchRuleDirect(v) => { - struct_ser.serialize_field("dispatchRuleDirect", v)?; - } - sip_dispatch_rule::Rule::DispatchRuleIndividual(v) => { - struct_ser.serialize_field("dispatchRuleIndividual", v)?; - } - } + if !self.participant_identity.is_empty() { + len += 1; + } + if !self.room_name.is_empty() { + len += 1; + } + if !self.sip_call_id.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.SIPParticipantInfo", len)?; + if !self.participant_id.is_empty() { + struct_ser.serialize_field("participantId", &self.participant_id)?; + } + 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.sip_call_id.is_empty() { + struct_ser.serialize_field("sipCallId", &self.sip_call_id)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for SipDispatchRule { +impl<'de> serde::Deserialize<'de> for SipParticipantInfo { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "dispatch_rule_direct", - "dispatchRuleDirect", - "dispatch_rule_individual", - "dispatchRuleIndividual", + "participant_id", + "participantId", + "participant_identity", + "participantIdentity", + "room_name", + "roomName", + "sip_call_id", + "sipCallId", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - DispatchRuleDirect, - DispatchRuleIndividual, + ParticipantId, + ParticipantIdentity, + RoomName, + SipCallId, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -16248,8 +20215,10 @@ impl<'de> serde::Deserialize<'de> for SipDispatchRule { E: serde::de::Error, { match value { - "dispatchRuleDirect" | "dispatch_rule_direct" => Ok(GeneratedField::DispatchRuleDirect), - "dispatchRuleIndividual" | "dispatch_rule_individual" => Ok(GeneratedField::DispatchRuleIndividual), + "participantId" | "participant_id" => Ok(GeneratedField::ParticipantId), + "participantIdentity" | "participant_identity" => Ok(GeneratedField::ParticipantIdentity), + "roomName" | "room_name" => Ok(GeneratedField::RoomName), + "sipCallId" | "sip_call_id" => Ok(GeneratedField::SipCallId), _ => Ok(GeneratedField::__SkipField__), } } @@ -16259,86 +20228,288 @@ impl<'de> serde::Deserialize<'de> for SipDispatchRule { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SipDispatchRule; + type Value = SipParticipantInfo; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SIPDispatchRule") + formatter.write_str("struct livekit.SIPParticipantInfo") } - 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 rule__ = None; + let mut participant_id__ = None; + let mut participant_identity__ = None; + let mut room_name__ = None; + let mut sip_call_id__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::DispatchRuleDirect => { - if rule__.is_some() { - return Err(serde::de::Error::duplicate_field("dispatchRuleDirect")); + GeneratedField::ParticipantId => { + if participant_id__.is_some() { + return Err(serde::de::Error::duplicate_field("participantId")); } - rule__ = map_.next_value::<::std::option::Option<_>>()?.map(sip_dispatch_rule::Rule::DispatchRuleDirect) -; + participant_id__ = Some(map_.next_value()?); } - GeneratedField::DispatchRuleIndividual => { - if rule__.is_some() { - return Err(serde::de::Error::duplicate_field("dispatchRuleIndividual")); + GeneratedField::ParticipantIdentity => { + if participant_identity__.is_some() { + return Err(serde::de::Error::duplicate_field("participantIdentity")); } - rule__ = map_.next_value::<::std::option::Option<_>>()?.map(sip_dispatch_rule::Rule::DispatchRuleIndividual) -; + 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::SipCallId => { + if sip_call_id__.is_some() { + return Err(serde::de::Error::duplicate_field("sipCallId")); + } + sip_call_id__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(SipDispatchRule { - rule: rule__, + Ok(SipParticipantInfo { + participant_id: participant_id__.unwrap_or_default(), + participant_identity: participant_identity__.unwrap_or_default(), + room_name: room_name__.unwrap_or_default(), + sip_call_id: sip_call_id__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.SIPDispatchRule", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for SipDispatchRuleDirect { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.room_name.is_empty() { + deserializer.deserialize_struct("livekit.SIPParticipantInfo", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SipTransport { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Auto => "SIP_TRANSPORT_AUTO", + Self::Udp => "SIP_TRANSPORT_UDP", + Self::Tcp => "SIP_TRANSPORT_TCP", + Self::Tls => "SIP_TRANSPORT_TLS", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for SipTransport { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "SIP_TRANSPORT_AUTO", + "SIP_TRANSPORT_UDP", + "SIP_TRANSPORT_TCP", + "SIP_TRANSPORT_TLS", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SipTransport; + + 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 { + "SIP_TRANSPORT_AUTO" => Ok(SipTransport::Auto), + "SIP_TRANSPORT_UDP" => Ok(SipTransport::Udp), + "SIP_TRANSPORT_TCP" => Ok(SipTransport::Tcp), + "SIP_TRANSPORT_TLS" => Ok(SipTransport::Tls), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for SipTrunkInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.sip_trunk_id.is_empty() { + len += 1; + } + if self.kind != 0 { + len += 1; + } + if !self.inbound_addresses.is_empty() { + len += 1; + } + if !self.outbound_address.is_empty() { + len += 1; + } + if !self.outbound_number.is_empty() { + len += 1; + } + if self.transport != 0 { + len += 1; + } + if !self.inbound_numbers_regex.is_empty() { + len += 1; + } + if !self.inbound_numbers.is_empty() { + len += 1; + } + if !self.inbound_username.is_empty() { len += 1; } - if !self.pin.is_empty() { + if !self.inbound_password.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.SIPDispatchRuleDirect", len)?; - if !self.room_name.is_empty() { - struct_ser.serialize_field("roomName", &self.room_name)?; + if !self.outbound_username.is_empty() { + len += 1; } - if !self.pin.is_empty() { - struct_ser.serialize_field("pin", &self.pin)?; + if !self.outbound_password.is_empty() { + len += 1; + } + if !self.name.is_empty() { + len += 1; + } + if !self.metadata.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.SIPTrunkInfo", len)?; + if !self.sip_trunk_id.is_empty() { + struct_ser.serialize_field("sipTrunkId", &self.sip_trunk_id)?; + } + if self.kind != 0 { + let v = sip_trunk_info::TrunkKind::try_from(self.kind) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.kind)))?; + struct_ser.serialize_field("kind", &v)?; + } + if !self.inbound_addresses.is_empty() { + struct_ser.serialize_field("inboundAddresses", &self.inbound_addresses)?; + } + if !self.outbound_address.is_empty() { + struct_ser.serialize_field("outboundAddress", &self.outbound_address)?; + } + if !self.outbound_number.is_empty() { + struct_ser.serialize_field("outboundNumber", &self.outbound_number)?; + } + if self.transport != 0 { + let v = SipTransport::try_from(self.transport) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.transport)))?; + struct_ser.serialize_field("transport", &v)?; + } + if !self.inbound_numbers_regex.is_empty() { + struct_ser.serialize_field("inboundNumbersRegex", &self.inbound_numbers_regex)?; + } + if !self.inbound_numbers.is_empty() { + struct_ser.serialize_field("inboundNumbers", &self.inbound_numbers)?; + } + if !self.inbound_username.is_empty() { + struct_ser.serialize_field("inboundUsername", &self.inbound_username)?; + } + if !self.inbound_password.is_empty() { + struct_ser.serialize_field("inboundPassword", &self.inbound_password)?; + } + if !self.outbound_username.is_empty() { + struct_ser.serialize_field("outboundUsername", &self.outbound_username)?; + } + if !self.outbound_password.is_empty() { + struct_ser.serialize_field("outboundPassword", &self.outbound_password)?; + } + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if !self.metadata.is_empty() { + struct_ser.serialize_field("metadata", &self.metadata)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for SipDispatchRuleDirect { +impl<'de> serde::Deserialize<'de> for SipTrunkInfo { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "room_name", - "roomName", - "pin", + "sip_trunk_id", + "sipTrunkId", + "kind", + "inbound_addresses", + "inboundAddresses", + "outbound_address", + "outboundAddress", + "outbound_number", + "outboundNumber", + "transport", + "inbound_numbers_regex", + "inboundNumbersRegex", + "inbound_numbers", + "inboundNumbers", + "inbound_username", + "inboundUsername", + "inbound_password", + "inboundPassword", + "outbound_username", + "outboundUsername", + "outbound_password", + "outboundPassword", + "name", + "metadata", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - RoomName, - Pin, + SipTrunkId, + Kind, + InboundAddresses, + OutboundAddress, + OutboundNumber, + Transport, + InboundNumbersRegex, + InboundNumbers, + InboundUsername, + InboundPassword, + OutboundUsername, + OutboundPassword, + Name, + Metadata, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -16361,8 +20532,20 @@ impl<'de> serde::Deserialize<'de> for SipDispatchRuleDirect { E: serde::de::Error, { match value { - "roomName" | "room_name" => Ok(GeneratedField::RoomName), - "pin" => Ok(GeneratedField::Pin), + "sipTrunkId" | "sip_trunk_id" => Ok(GeneratedField::SipTrunkId), + "kind" => Ok(GeneratedField::Kind), + "inboundAddresses" | "inbound_addresses" => Ok(GeneratedField::InboundAddresses), + "outboundAddress" | "outbound_address" => Ok(GeneratedField::OutboundAddress), + "outboundNumber" | "outbound_number" => Ok(GeneratedField::OutboundNumber), + "transport" => Ok(GeneratedField::Transport), + "inboundNumbersRegex" | "inbound_numbers_regex" => Ok(GeneratedField::InboundNumbersRegex), + "inboundNumbers" | "inbound_numbers" => Ok(GeneratedField::InboundNumbers), + "inboundUsername" | "inbound_username" => Ok(GeneratedField::InboundUsername), + "inboundPassword" | "inbound_password" => Ok(GeneratedField::InboundPassword), + "outboundUsername" | "outbound_username" => Ok(GeneratedField::OutboundUsername), + "outboundPassword" | "outbound_password" => Ok(GeneratedField::OutboundPassword), + "name" => Ok(GeneratedField::Name), + "metadata" => Ok(GeneratedField::Metadata), _ => Ok(GeneratedField::__SkipField__), } } @@ -16372,160 +20555,217 @@ impl<'de> serde::Deserialize<'de> for SipDispatchRuleDirect { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SipDispatchRuleDirect; + type Value = SipTrunkInfo; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SIPDispatchRuleDirect") + formatter.write_str("struct livekit.SIPTrunkInfo") } - 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 pin__ = None; + let mut sip_trunk_id__ = None; + let mut kind__ = None; + let mut inbound_addresses__ = None; + let mut outbound_address__ = None; + let mut outbound_number__ = None; + let mut transport__ = None; + let mut inbound_numbers_regex__ = None; + let mut inbound_numbers__ = None; + let mut inbound_username__ = None; + let mut inbound_password__ = None; + let mut outbound_username__ = None; + let mut outbound_password__ = None; + let mut name__ = None; + let mut metadata__ = 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")); + GeneratedField::SipTrunkId => { + if sip_trunk_id__.is_some() { + return Err(serde::de::Error::duplicate_field("sipTrunkId")); } - room_name__ = Some(map_.next_value()?); + sip_trunk_id__ = Some(map_.next_value()?); } - GeneratedField::Pin => { - if pin__.is_some() { - return Err(serde::de::Error::duplicate_field("pin")); + GeneratedField::Kind => { + if kind__.is_some() { + return Err(serde::de::Error::duplicate_field("kind")); } - pin__ = Some(map_.next_value()?); + kind__ = Some(map_.next_value::()? as i32); + } + GeneratedField::InboundAddresses => { + if inbound_addresses__.is_some() { + return Err(serde::de::Error::duplicate_field("inboundAddresses")); + } + inbound_addresses__ = Some(map_.next_value()?); + } + GeneratedField::OutboundAddress => { + if outbound_address__.is_some() { + return Err(serde::de::Error::duplicate_field("outboundAddress")); + } + outbound_address__ = Some(map_.next_value()?); + } + GeneratedField::OutboundNumber => { + if outbound_number__.is_some() { + return Err(serde::de::Error::duplicate_field("outboundNumber")); + } + outbound_number__ = Some(map_.next_value()?); + } + GeneratedField::Transport => { + if transport__.is_some() { + return Err(serde::de::Error::duplicate_field("transport")); + } + transport__ = Some(map_.next_value::()? as i32); + } + GeneratedField::InboundNumbersRegex => { + if inbound_numbers_regex__.is_some() { + return Err(serde::de::Error::duplicate_field("inboundNumbersRegex")); + } + inbound_numbers_regex__ = Some(map_.next_value()?); + } + GeneratedField::InboundNumbers => { + if inbound_numbers__.is_some() { + return Err(serde::de::Error::duplicate_field("inboundNumbers")); + } + inbound_numbers__ = Some(map_.next_value()?); + } + GeneratedField::InboundUsername => { + if inbound_username__.is_some() { + return Err(serde::de::Error::duplicate_field("inboundUsername")); + } + inbound_username__ = Some(map_.next_value()?); + } + GeneratedField::InboundPassword => { + if inbound_password__.is_some() { + return Err(serde::de::Error::duplicate_field("inboundPassword")); + } + inbound_password__ = Some(map_.next_value()?); + } + GeneratedField::OutboundUsername => { + if outbound_username__.is_some() { + return Err(serde::de::Error::duplicate_field("outboundUsername")); + } + outbound_username__ = Some(map_.next_value()?); + } + GeneratedField::OutboundPassword => { + if outbound_password__.is_some() { + return Err(serde::de::Error::duplicate_field("outboundPassword")); + } + outbound_password__ = Some(map_.next_value()?); + } + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); + } + 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(SipDispatchRuleDirect { - room_name: room_name__.unwrap_or_default(), - pin: pin__.unwrap_or_default(), + Ok(SipTrunkInfo { + sip_trunk_id: sip_trunk_id__.unwrap_or_default(), + kind: kind__.unwrap_or_default(), + inbound_addresses: inbound_addresses__.unwrap_or_default(), + outbound_address: outbound_address__.unwrap_or_default(), + outbound_number: outbound_number__.unwrap_or_default(), + transport: transport__.unwrap_or_default(), + inbound_numbers_regex: inbound_numbers_regex__.unwrap_or_default(), + inbound_numbers: inbound_numbers__.unwrap_or_default(), + inbound_username: inbound_username__.unwrap_or_default(), + inbound_password: inbound_password__.unwrap_or_default(), + outbound_username: outbound_username__.unwrap_or_default(), + outbound_password: outbound_password__.unwrap_or_default(), + name: name__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.SIPDispatchRuleDirect", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.SIPTrunkInfo", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for SipDispatchRuleIndividual { +impl serde::Serialize for sip_trunk_info::TrunkKind { #[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; - } - let mut struct_ser = serializer.serialize_struct("livekit.SIPDispatchRuleIndividual", 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)?; - } - struct_ser.end() + let variant = match self { + Self::TrunkLegacy => "TRUNK_LEGACY", + Self::TrunkInbound => "TRUNK_INBOUND", + Self::TrunkOutbound => "TRUNK_OUTBOUND", + }; + serializer.serialize_str(variant) } } -impl<'de> serde::Deserialize<'de> for SipDispatchRuleIndividual { +impl<'de> serde::Deserialize<'de> for sip_trunk_info::TrunkKind { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "room_prefix", - "roomPrefix", - "pin", + "TRUNK_LEGACY", + "TRUNK_INBOUND", + "TRUNK_OUTBOUND", ]; - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - RoomPrefix, - Pin, - __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 = sip_trunk_info::TrunkKind; - 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 { - "roomPrefix" | "room_prefix" => Ok(GeneratedField::RoomPrefix), - "pin" => Ok(GeneratedField::Pin), - _ => 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 = SipDispatchRuleIndividual; - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SIPDispatchRuleIndividual") + 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 room_prefix__ = None; - let mut pin__ = 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::__SkipField__ => { - let _ = map_.next_value::()?; - } - } + match value { + "TRUNK_LEGACY" => Ok(sip_trunk_info::TrunkKind::TrunkLegacy), + "TRUNK_INBOUND" => Ok(sip_trunk_info::TrunkKind::TrunkInbound), + "TRUNK_OUTBOUND" => Ok(sip_trunk_info::TrunkKind::TrunkOutbound), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } - Ok(SipDispatchRuleIndividual { - room_prefix: room_prefix__.unwrap_or_default(), - pin: pin__.unwrap_or_default(), - }) } } - deserializer.deserialize_struct("livekit.SIPDispatchRuleIndividual", FIELDS, GeneratedVisitor) + deserializer.deserialize_any(GeneratedVisitor) } } -impl serde::Serialize for SipDispatchRuleInfo { +impl serde::Serialize for SegmentedFileOutput { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -16533,89 +20773,114 @@ impl serde::Serialize for SipDispatchRuleInfo { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.sip_dispatch_rule_id.is_empty() { + if self.protocol != 0 { len += 1; } - if self.rule.is_some() { + if !self.filename_prefix.is_empty() { len += 1; } - if !self.trunk_ids.is_empty() { + if !self.playlist_name.is_empty() { len += 1; } - if self.hide_phone_number { + if !self.live_playlist_name.is_empty() { len += 1; } - if !self.inbound_numbers.is_empty() { + if self.segment_duration != 0 { len += 1; } - if !self.name.is_empty() { + if self.filename_suffix != 0 { len += 1; } - if !self.metadata.is_empty() { + if self.disable_manifest { len += 1; } - if !self.attributes.is_empty() { + if self.output.is_some() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.SIPDispatchRuleInfo", len)?; - if !self.sip_dispatch_rule_id.is_empty() { - struct_ser.serialize_field("sipDispatchRuleId", &self.sip_dispatch_rule_id)?; + let mut struct_ser = serializer.serialize_struct("livekit.SegmentedFileOutput", len)?; + if self.protocol != 0 { + let v = SegmentedFileProtocol::try_from(self.protocol) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.protocol)))?; + struct_ser.serialize_field("protocol", &v)?; } - if let Some(v) = self.rule.as_ref() { - struct_ser.serialize_field("rule", v)?; + if !self.filename_prefix.is_empty() { + struct_ser.serialize_field("filenamePrefix", &self.filename_prefix)?; } - if !self.trunk_ids.is_empty() { - struct_ser.serialize_field("trunkIds", &self.trunk_ids)?; + if !self.playlist_name.is_empty() { + struct_ser.serialize_field("playlistName", &self.playlist_name)?; } - if self.hide_phone_number { - struct_ser.serialize_field("hidePhoneNumber", &self.hide_phone_number)?; + if !self.live_playlist_name.is_empty() { + struct_ser.serialize_field("livePlaylistName", &self.live_playlist_name)?; } - if !self.inbound_numbers.is_empty() { - struct_ser.serialize_field("inboundNumbers", &self.inbound_numbers)?; + if self.segment_duration != 0 { + struct_ser.serialize_field("segmentDuration", &self.segment_duration)?; } - if !self.name.is_empty() { - struct_ser.serialize_field("name", &self.name)?; + if self.filename_suffix != 0 { + let v = SegmentedFileSuffix::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.metadata.is_empty() { - struct_ser.serialize_field("metadata", &self.metadata)?; + if self.disable_manifest { + struct_ser.serialize_field("disableManifest", &self.disable_manifest)?; } - if !self.attributes.is_empty() { - struct_ser.serialize_field("attributes", &self.attributes)?; + if let Some(v) = self.output.as_ref() { + match v { + segmented_file_output::Output::S3(v) => { + struct_ser.serialize_field("s3", v)?; + } + segmented_file_output::Output::Gcp(v) => { + struct_ser.serialize_field("gcp", v)?; + } + segmented_file_output::Output::Azure(v) => { + struct_ser.serialize_field("azure", v)?; + } + segmented_file_output::Output::AliOss(v) => { + struct_ser.serialize_field("aliOSS", v)?; + } + } } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for SipDispatchRuleInfo { +impl<'de> serde::Deserialize<'de> for SegmentedFileOutput { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "sip_dispatch_rule_id", - "sipDispatchRuleId", - "rule", - "trunk_ids", - "trunkIds", - "hide_phone_number", - "hidePhoneNumber", - "inbound_numbers", - "inboundNumbers", - "name", - "metadata", - "attributes", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - SipDispatchRuleId, - Rule, - TrunkIds, - HidePhoneNumber, - InboundNumbers, - Name, - Metadata, - Attributes, + "protocol", + "filename_prefix", + "filenamePrefix", + "playlist_name", + "playlistName", + "live_playlist_name", + "livePlaylistName", + "segment_duration", + "segmentDuration", + "filename_suffix", + "filenameSuffix", + "disable_manifest", + "disableManifest", + "s3", + "gcp", + "azure", + "aliOSS", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Protocol, + FilenamePrefix, + PlaylistName, + LivePlaylistName, + SegmentDuration, + FilenameSuffix, + DisableManifest, + S3, + Gcp, + Azure, + AliOss, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -16638,14 +20903,17 @@ impl<'de> serde::Deserialize<'de> for SipDispatchRuleInfo { E: serde::de::Error, { match value { - "sipDispatchRuleId" | "sip_dispatch_rule_id" => Ok(GeneratedField::SipDispatchRuleId), - "rule" => Ok(GeneratedField::Rule), - "trunkIds" | "trunk_ids" => Ok(GeneratedField::TrunkIds), - "hidePhoneNumber" | "hide_phone_number" => Ok(GeneratedField::HidePhoneNumber), - "inboundNumbers" | "inbound_numbers" => Ok(GeneratedField::InboundNumbers), - "name" => Ok(GeneratedField::Name), - "metadata" => Ok(GeneratedField::Metadata), - "attributes" => Ok(GeneratedField::Attributes), + "protocol" => Ok(GeneratedField::Protocol), + "filenamePrefix" | "filename_prefix" => Ok(GeneratedField::FilenamePrefix), + "playlistName" | "playlist_name" => Ok(GeneratedField::PlaylistName), + "livePlaylistName" | "live_playlist_name" => Ok(GeneratedField::LivePlaylistName), + "segmentDuration" | "segment_duration" => Ok(GeneratedField::SegmentDuration), + "filenameSuffix" | "filename_suffix" => Ok(GeneratedField::FilenameSuffix), + "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__), } } @@ -16655,97 +20923,261 @@ impl<'de> serde::Deserialize<'de> for SipDispatchRuleInfo { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SipDispatchRuleInfo; + type Value = SegmentedFileOutput; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SIPDispatchRuleInfo") + formatter.write_str("struct livekit.SegmentedFileOutput") } - 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 sip_dispatch_rule_id__ = None; - let mut rule__ = None; - let mut trunk_ids__ = None; - let mut hide_phone_number__ = None; - let mut inbound_numbers__ = None; - let mut name__ = None; - let mut metadata__ = None; - let mut attributes__ = None; + let mut protocol__ = None; + let mut filename_prefix__ = None; + let mut playlist_name__ = None; + let mut live_playlist_name__ = None; + let mut segment_duration__ = None; + let mut filename_suffix__ = None; + let mut disable_manifest__ = None; + let mut output__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::SipDispatchRuleId => { - if sip_dispatch_rule_id__.is_some() { - return Err(serde::de::Error::duplicate_field("sipDispatchRuleId")); + GeneratedField::Protocol => { + if protocol__.is_some() { + return Err(serde::de::Error::duplicate_field("protocol")); } - sip_dispatch_rule_id__ = Some(map_.next_value()?); + protocol__ = Some(map_.next_value::()? as i32); } - GeneratedField::Rule => { - if rule__.is_some() { - return Err(serde::de::Error::duplicate_field("rule")); + GeneratedField::FilenamePrefix => { + if filename_prefix__.is_some() { + return Err(serde::de::Error::duplicate_field("filenamePrefix")); } - rule__ = map_.next_value()?; + filename_prefix__ = Some(map_.next_value()?); } - GeneratedField::TrunkIds => { - if trunk_ids__.is_some() { - return Err(serde::de::Error::duplicate_field("trunkIds")); + GeneratedField::PlaylistName => { + if playlist_name__.is_some() { + return Err(serde::de::Error::duplicate_field("playlistName")); } - trunk_ids__ = Some(map_.next_value()?); + playlist_name__ = Some(map_.next_value()?); } - GeneratedField::HidePhoneNumber => { - if hide_phone_number__.is_some() { - return Err(serde::de::Error::duplicate_field("hidePhoneNumber")); + GeneratedField::LivePlaylistName => { + if live_playlist_name__.is_some() { + return Err(serde::de::Error::duplicate_field("livePlaylistName")); } - hide_phone_number__ = Some(map_.next_value()?); + live_playlist_name__ = Some(map_.next_value()?); } - GeneratedField::InboundNumbers => { - if inbound_numbers__.is_some() { - return Err(serde::de::Error::duplicate_field("inboundNumbers")); + GeneratedField::SegmentDuration => { + if segment_duration__.is_some() { + return Err(serde::de::Error::duplicate_field("segmentDuration")); } - inbound_numbers__ = Some(map_.next_value()?); + segment_duration__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); + GeneratedField::FilenameSuffix => { + if filename_suffix__.is_some() { + return Err(serde::de::Error::duplicate_field("filenameSuffix")); } - name__ = Some(map_.next_value()?); + filename_suffix__ = Some(map_.next_value::()? as i32); } - GeneratedField::Metadata => { - if metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("metadata")); + GeneratedField::DisableManifest => { + if disable_manifest__.is_some() { + return Err(serde::de::Error::duplicate_field("disableManifest")); } - metadata__ = Some(map_.next_value()?); + disable_manifest__ = Some(map_.next_value()?); } - GeneratedField::Attributes => { - if attributes__.is_some() { - return Err(serde::de::Error::duplicate_field("attributes")); + GeneratedField::S3 => { + if output__.is_some() { + return Err(serde::de::Error::duplicate_field("s3")); } - attributes__ = Some( - map_.next_value::>()? - ); + output__ = map_.next_value::<::std::option::Option<_>>()?.map(segmented_file_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(segmented_file_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(segmented_file_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(segmented_file_output::Output::AliOss) +; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(SipDispatchRuleInfo { - sip_dispatch_rule_id: sip_dispatch_rule_id__.unwrap_or_default(), - rule: rule__, - trunk_ids: trunk_ids__.unwrap_or_default(), - hide_phone_number: hide_phone_number__.unwrap_or_default(), - inbound_numbers: inbound_numbers__.unwrap_or_default(), - name: name__.unwrap_or_default(), - metadata: metadata__.unwrap_or_default(), - attributes: attributes__.unwrap_or_default(), - }) + Ok(SegmentedFileOutput { + protocol: protocol__.unwrap_or_default(), + filename_prefix: filename_prefix__.unwrap_or_default(), + playlist_name: playlist_name__.unwrap_or_default(), + live_playlist_name: live_playlist_name__.unwrap_or_default(), + segment_duration: segment_duration__.unwrap_or_default(), + filename_suffix: filename_suffix__.unwrap_or_default(), + disable_manifest: disable_manifest__.unwrap_or_default(), + output: output__, + }) + } + } + deserializer.deserialize_struct("livekit.SegmentedFileOutput", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SegmentedFileProtocol { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::DefaultSegmentedFileProtocol => "DEFAULT_SEGMENTED_FILE_PROTOCOL", + Self::HlsProtocol => "HLS_PROTOCOL", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for SegmentedFileProtocol { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "DEFAULT_SEGMENTED_FILE_PROTOCOL", + "HLS_PROTOCOL", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SegmentedFileProtocol; + + 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 { + "DEFAULT_SEGMENTED_FILE_PROTOCOL" => Ok(SegmentedFileProtocol::DefaultSegmentedFileProtocol), + "HLS_PROTOCOL" => Ok(SegmentedFileProtocol::HlsProtocol), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for SegmentedFileSuffix { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Index => "INDEX", + Self::Timestamp => "TIMESTAMP", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for SegmentedFileSuffix { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "INDEX", + "TIMESTAMP", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SegmentedFileSuffix; + + 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 { + "INDEX" => Ok(SegmentedFileSuffix::Index), + "TIMESTAMP" => Ok(SegmentedFileSuffix::Timestamp), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } } } - deserializer.deserialize_struct("livekit.SIPDispatchRuleInfo", FIELDS, GeneratedVisitor) + deserializer.deserialize_any(GeneratedVisitor) } } -impl serde::Serialize for SipInboundTrunkInfo { +impl serde::Serialize for SegmentsInfo { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -16753,90 +21185,105 @@ impl serde::Serialize for SipInboundTrunkInfo { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.sip_trunk_id.is_empty() { + if !self.playlist_name.is_empty() { len += 1; } - if !self.name.is_empty() { + if !self.live_playlist_name.is_empty() { len += 1; } - if !self.metadata.is_empty() { + if self.duration != 0 { len += 1; } - if !self.numbers.is_empty() { + if self.size != 0 { len += 1; } - if !self.allowed_addresses.is_empty() { + if !self.playlist_location.is_empty() { len += 1; } - if !self.allowed_numbers.is_empty() { + if !self.live_playlist_location.is_empty() { len += 1; } - if !self.auth_username.is_empty() { + if self.segment_count != 0 { len += 1; } - if !self.auth_password.is_empty() { + if self.started_at != 0 { 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)?; + if self.ended_at != 0 { + len += 1; } - if !self.name.is_empty() { - struct_ser.serialize_field("name", &self.name)?; + let mut struct_ser = serializer.serialize_struct("livekit.SegmentsInfo", len)?; + if !self.playlist_name.is_empty() { + struct_ser.serialize_field("playlistName", &self.playlist_name)?; } - if !self.metadata.is_empty() { - struct_ser.serialize_field("metadata", &self.metadata)?; + if !self.live_playlist_name.is_empty() { + struct_ser.serialize_field("livePlaylistName", &self.live_playlist_name)?; } - if !self.numbers.is_empty() { - struct_ser.serialize_field("numbers", &self.numbers)?; + if self.duration != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("duration", ToString::to_string(&self.duration).as_str())?; } - if !self.allowed_addresses.is_empty() { - struct_ser.serialize_field("allowedAddresses", &self.allowed_addresses)?; + if self.size != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("size", ToString::to_string(&self.size).as_str())?; } - if !self.allowed_numbers.is_empty() { - struct_ser.serialize_field("allowedNumbers", &self.allowed_numbers)?; + if !self.playlist_location.is_empty() { + struct_ser.serialize_field("playlistLocation", &self.playlist_location)?; } - if !self.auth_username.is_empty() { - struct_ser.serialize_field("authUsername", &self.auth_username)?; + if !self.live_playlist_location.is_empty() { + struct_ser.serialize_field("livePlaylistLocation", &self.live_playlist_location)?; } - if !self.auth_password.is_empty() { - struct_ser.serialize_field("authPassword", &self.auth_password)?; + if self.segment_count != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("segmentCount", ToString::to_string(&self.segment_count).as_str())?; + } + if self.started_at != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("startedAt", ToString::to_string(&self.started_at).as_str())?; + } + if self.ended_at != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("endedAt", ToString::to_string(&self.ended_at).as_str())?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for SipInboundTrunkInfo { +impl<'de> serde::Deserialize<'de> for SegmentsInfo { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "sip_trunk_id", - "sipTrunkId", - "name", - "metadata", - "numbers", - "allowed_addresses", - "allowedAddresses", - "allowed_numbers", - "allowedNumbers", - "auth_username", - "authUsername", - "auth_password", - "authPassword", + "playlist_name", + "playlistName", + "live_playlist_name", + "livePlaylistName", + "duration", + "size", + "playlist_location", + "playlistLocation", + "live_playlist_location", + "livePlaylistLocation", + "segment_count", + "segmentCount", + "started_at", + "startedAt", + "ended_at", + "endedAt", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - SipTrunkId, - Name, - Metadata, - Numbers, - AllowedAddresses, - AllowedNumbers, - AuthUsername, - AuthPassword, + PlaylistName, + LivePlaylistName, + Duration, + Size, + PlaylistLocation, + LivePlaylistLocation, + SegmentCount, + StartedAt, + EndedAt, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -16859,14 +21306,15 @@ impl<'de> serde::Deserialize<'de> for SipInboundTrunkInfo { E: serde::de::Error, { match value { - "sipTrunkId" | "sip_trunk_id" => Ok(GeneratedField::SipTrunkId), - "name" => Ok(GeneratedField::Name), - "metadata" => Ok(GeneratedField::Metadata), - "numbers" => Ok(GeneratedField::Numbers), - "allowedAddresses" | "allowed_addresses" => Ok(GeneratedField::AllowedAddresses), - "allowedNumbers" | "allowed_numbers" => Ok(GeneratedField::AllowedNumbers), - "authUsername" | "auth_username" => Ok(GeneratedField::AuthUsername), - "authPassword" | "auth_password" => Ok(GeneratedField::AuthPassword), + "playlistName" | "playlist_name" => Ok(GeneratedField::PlaylistName), + "livePlaylistName" | "live_playlist_name" => Ok(GeneratedField::LivePlaylistName), + "duration" => Ok(GeneratedField::Duration), + "size" => Ok(GeneratedField::Size), + "playlistLocation" | "playlist_location" => Ok(GeneratedField::PlaylistLocation), + "livePlaylistLocation" | "live_playlist_location" => Ok(GeneratedField::LivePlaylistLocation), + "segmentCount" | "segment_count" => Ok(GeneratedField::SegmentCount), + "startedAt" | "started_at" => Ok(GeneratedField::StartedAt), + "endedAt" | "ended_at" => Ok(GeneratedField::EndedAt), _ => Ok(GeneratedField::__SkipField__), } } @@ -16876,95 +21324,113 @@ impl<'de> serde::Deserialize<'de> for SipInboundTrunkInfo { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SipInboundTrunkInfo; + type Value = SegmentsInfo; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SIPInboundTrunkInfo") + formatter.write_str("struct livekit.SegmentsInfo") } - 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 sip_trunk_id__ = None; - let mut name__ = None; - let mut metadata__ = None; - let mut numbers__ = None; - let mut allowed_addresses__ = None; - let mut allowed_numbers__ = None; - let mut auth_username__ = None; - let mut auth_password__ = None; + let mut playlist_name__ = None; + let mut live_playlist_name__ = None; + let mut duration__ = None; + let mut size__ = None; + let mut playlist_location__ = None; + let mut live_playlist_location__ = None; + let mut segment_count__ = None; + let mut started_at__ = None; + let mut ended_at__ = 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")); + GeneratedField::PlaylistName => { + if playlist_name__.is_some() { + return Err(serde::de::Error::duplicate_field("playlistName")); } - sip_trunk_id__ = Some(map_.next_value()?); + playlist_name__ = Some(map_.next_value()?); } - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); + GeneratedField::LivePlaylistName => { + if live_playlist_name__.is_some() { + return Err(serde::de::Error::duplicate_field("livePlaylistName")); } - name__ = Some(map_.next_value()?); + live_playlist_name__ = Some(map_.next_value()?); } - GeneratedField::Metadata => { - if metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("metadata")); + GeneratedField::Duration => { + if duration__.is_some() { + return Err(serde::de::Error::duplicate_field("duration")); } - metadata__ = Some(map_.next_value()?); + duration__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } - GeneratedField::Numbers => { - if numbers__.is_some() { - return Err(serde::de::Error::duplicate_field("numbers")); + GeneratedField::Size => { + if size__.is_some() { + return Err(serde::de::Error::duplicate_field("size")); } - numbers__ = Some(map_.next_value()?); + size__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } - GeneratedField::AllowedAddresses => { - if allowed_addresses__.is_some() { - return Err(serde::de::Error::duplicate_field("allowedAddresses")); + GeneratedField::PlaylistLocation => { + if playlist_location__.is_some() { + return Err(serde::de::Error::duplicate_field("playlistLocation")); } - allowed_addresses__ = Some(map_.next_value()?); + playlist_location__ = Some(map_.next_value()?); + } + GeneratedField::LivePlaylistLocation => { + if live_playlist_location__.is_some() { + return Err(serde::de::Error::duplicate_field("livePlaylistLocation")); + } + live_playlist_location__ = Some(map_.next_value()?); } - GeneratedField::AllowedNumbers => { - if allowed_numbers__.is_some() { - return Err(serde::de::Error::duplicate_field("allowedNumbers")); + GeneratedField::SegmentCount => { + if segment_count__.is_some() { + return Err(serde::de::Error::duplicate_field("segmentCount")); } - allowed_numbers__ = Some(map_.next_value()?); + segment_count__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } - GeneratedField::AuthUsername => { - if auth_username__.is_some() { - return Err(serde::de::Error::duplicate_field("authUsername")); + GeneratedField::StartedAt => { + if started_at__.is_some() { + return Err(serde::de::Error::duplicate_field("startedAt")); } - auth_username__ = Some(map_.next_value()?); + started_at__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } - GeneratedField::AuthPassword => { - if auth_password__.is_some() { - return Err(serde::de::Error::duplicate_field("authPassword")); + GeneratedField::EndedAt => { + if ended_at__.is_some() { + return Err(serde::de::Error::duplicate_field("endedAt")); } - auth_password__ = Some(map_.next_value()?); + ended_at__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(SipInboundTrunkInfo { - sip_trunk_id: sip_trunk_id__.unwrap_or_default(), - name: name__.unwrap_or_default(), - metadata: metadata__.unwrap_or_default(), - numbers: numbers__.unwrap_or_default(), - allowed_addresses: allowed_addresses__.unwrap_or_default(), - allowed_numbers: allowed_numbers__.unwrap_or_default(), - auth_username: auth_username__.unwrap_or_default(), - auth_password: auth_password__.unwrap_or_default(), + Ok(SegmentsInfo { + playlist_name: playlist_name__.unwrap_or_default(), + live_playlist_name: live_playlist_name__.unwrap_or_default(), + duration: duration__.unwrap_or_default(), + size: size__.unwrap_or_default(), + playlist_location: playlist_location__.unwrap_or_default(), + live_playlist_location: live_playlist_location__.unwrap_or_default(), + segment_count: segment_count__.unwrap_or_default(), + started_at: started_at__.unwrap_or_default(), + ended_at: ended_at__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.SIPInboundTrunkInfo", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.SegmentsInfo", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for SipOutboundTrunkInfo { +impl serde::Serialize for SendDataRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -16972,90 +21438,74 @@ impl serde::Serialize for SipOutboundTrunkInfo { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.sip_trunk_id.is_empty() { - len += 1; - } - if !self.name.is_empty() { - len += 1; - } - if !self.metadata.is_empty() { + if !self.room.is_empty() { len += 1; } - if !self.address.is_empty() { + if !self.data.is_empty() { len += 1; } - if self.transport != 0 { + if self.kind != 0 { len += 1; } - if !self.numbers.is_empty() { + if !self.destination_sids.is_empty() { len += 1; } - if !self.auth_username.is_empty() { + if !self.destination_identities.is_empty() { len += 1; } - if !self.auth_password.is_empty() { + if self.topic.is_some() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.SIPOutboundTrunkInfo", len)?; - if !self.sip_trunk_id.is_empty() { - struct_ser.serialize_field("sipTrunkId", &self.sip_trunk_id)?; - } - if !self.name.is_empty() { - struct_ser.serialize_field("name", &self.name)?; - } - if !self.metadata.is_empty() { - struct_ser.serialize_field("metadata", &self.metadata)?; + let mut struct_ser = serializer.serialize_struct("livekit.SendDataRequest", len)?; + if !self.room.is_empty() { + struct_ser.serialize_field("room", &self.room)?; } - if !self.address.is_empty() { - struct_ser.serialize_field("address", &self.address)?; + if !self.data.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; } - if self.transport != 0 { - let v = SipTransport::try_from(self.transport) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.transport)))?; - struct_ser.serialize_field("transport", &v)?; + if self.kind != 0 { + let v = data_packet::Kind::try_from(self.kind) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.kind)))?; + struct_ser.serialize_field("kind", &v)?; } - if !self.numbers.is_empty() { - struct_ser.serialize_field("numbers", &self.numbers)?; + if !self.destination_sids.is_empty() { + struct_ser.serialize_field("destinationSids", &self.destination_sids)?; } - if !self.auth_username.is_empty() { - struct_ser.serialize_field("authUsername", &self.auth_username)?; + if !self.destination_identities.is_empty() { + struct_ser.serialize_field("destinationIdentities", &self.destination_identities)?; } - if !self.auth_password.is_empty() { - struct_ser.serialize_field("authPassword", &self.auth_password)?; + if let Some(v) = self.topic.as_ref() { + struct_ser.serialize_field("topic", v)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for SipOutboundTrunkInfo { +impl<'de> serde::Deserialize<'de> for SendDataRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "sip_trunk_id", - "sipTrunkId", - "name", - "metadata", - "address", - "transport", - "numbers", - "auth_username", - "authUsername", - "auth_password", - "authPassword", + "room", + "data", + "kind", + "destination_sids", + "destinationSids", + "destination_identities", + "destinationIdentities", + "topic", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - SipTrunkId, - Name, - Metadata, - Address, - Transport, - Numbers, - AuthUsername, - AuthPassword, + Room, + Data, + Kind, + DestinationSids, + DestinationIdentities, + Topic, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -17078,14 +21528,12 @@ impl<'de> serde::Deserialize<'de> for SipOutboundTrunkInfo { E: serde::de::Error, { match value { - "sipTrunkId" | "sip_trunk_id" => Ok(GeneratedField::SipTrunkId), - "name" => Ok(GeneratedField::Name), - "metadata" => Ok(GeneratedField::Metadata), - "address" => Ok(GeneratedField::Address), - "transport" => Ok(GeneratedField::Transport), - "numbers" => Ok(GeneratedField::Numbers), - "authUsername" | "auth_username" => Ok(GeneratedField::AuthUsername), - "authPassword" | "auth_password" => Ok(GeneratedField::AuthPassword), + "room" => Ok(GeneratedField::Room), + "data" => Ok(GeneratedField::Data), + "kind" => Ok(GeneratedField::Kind), + "destinationSids" | "destination_sids" => Ok(GeneratedField::DestinationSids), + "destinationIdentities" | "destination_identities" => Ok(GeneratedField::DestinationIdentities), + "topic" => Ok(GeneratedField::Topic), _ => Ok(GeneratedField::__SkipField__), } } @@ -17095,95 +21543,153 @@ impl<'de> serde::Deserialize<'de> for SipOutboundTrunkInfo { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SipOutboundTrunkInfo; + type Value = SendDataRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SIPOutboundTrunkInfo") + formatter.write_str("struct livekit.SendDataRequest") } - 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 sip_trunk_id__ = None; - let mut name__ = None; - let mut metadata__ = None; - let mut address__ = None; - let mut transport__ = None; - let mut numbers__ = None; - let mut auth_username__ = None; - let mut auth_password__ = None; + let mut room__ = None; + let mut data__ = None; + let mut kind__ = None; + let mut destination_sids__ = None; + let mut destination_identities__ = None; + let mut topic__ = 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::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); - } - name__ = Some(map_.next_value()?); - } - GeneratedField::Metadata => { - if metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("metadata")); + GeneratedField::Room => { + if room__.is_some() { + return Err(serde::de::Error::duplicate_field("room")); } - metadata__ = Some(map_.next_value()?); + room__ = Some(map_.next_value()?); } - GeneratedField::Address => { - if address__.is_some() { - return Err(serde::de::Error::duplicate_field("address")); + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); } - address__ = Some(map_.next_value()?); + data__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; } - GeneratedField::Transport => { - if transport__.is_some() { - return Err(serde::de::Error::duplicate_field("transport")); + GeneratedField::Kind => { + if kind__.is_some() { + return Err(serde::de::Error::duplicate_field("kind")); } - transport__ = Some(map_.next_value::()? as i32); + kind__ = Some(map_.next_value::()? as i32); } - GeneratedField::Numbers => { - if numbers__.is_some() { - return Err(serde::de::Error::duplicate_field("numbers")); + GeneratedField::DestinationSids => { + if destination_sids__.is_some() { + return Err(serde::de::Error::duplicate_field("destinationSids")); } - numbers__ = Some(map_.next_value()?); + destination_sids__ = Some(map_.next_value()?); } - GeneratedField::AuthUsername => { - if auth_username__.is_some() { - return Err(serde::de::Error::duplicate_field("authUsername")); + GeneratedField::DestinationIdentities => { + if destination_identities__.is_some() { + return Err(serde::de::Error::duplicate_field("destinationIdentities")); } - auth_username__ = Some(map_.next_value()?); + destination_identities__ = Some(map_.next_value()?); } - GeneratedField::AuthPassword => { - if auth_password__.is_some() { - return Err(serde::de::Error::duplicate_field("authPassword")); + GeneratedField::Topic => { + if topic__.is_some() { + return Err(serde::de::Error::duplicate_field("topic")); } - auth_password__ = Some(map_.next_value()?); + topic__ = map_.next_value()?; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(SipOutboundTrunkInfo { - sip_trunk_id: sip_trunk_id__.unwrap_or_default(), - name: name__.unwrap_or_default(), - metadata: metadata__.unwrap_or_default(), - address: address__.unwrap_or_default(), - transport: transport__.unwrap_or_default(), - numbers: numbers__.unwrap_or_default(), - auth_username: auth_username__.unwrap_or_default(), - auth_password: auth_password__.unwrap_or_default(), + Ok(SendDataRequest { + room: room__.unwrap_or_default(), + data: data__.unwrap_or_default(), + kind: kind__.unwrap_or_default(), + destination_sids: destination_sids__.unwrap_or_default(), + destination_identities: destination_identities__.unwrap_or_default(), + topic: topic__, + }) + } + } + deserializer.deserialize_struct("livekit.SendDataRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SendDataResponse { + #[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.SendDataResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SendDataResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + __SkipField__, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + Ok(GeneratedField::__SkipField__) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SendDataResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.SendDataResponse") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(SendDataResponse { }) } } - deserializer.deserialize_struct("livekit.SIPOutboundTrunkInfo", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.SendDataResponse", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for SipParticipantInfo { +impl serde::Serialize for ServerInfo { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -17191,57 +21697,82 @@ impl serde::Serialize for SipParticipantInfo { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.participant_id.is_empty() { + if self.edition != 0 { len += 1; } - if !self.participant_identity.is_empty() { + if !self.version.is_empty() { len += 1; } - if !self.room_name.is_empty() { + if self.protocol != 0 { len += 1; } - if !self.sip_call_id.is_empty() { + if !self.region.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.SIPParticipantInfo", len)?; - if !self.participant_id.is_empty() { - struct_ser.serialize_field("participantId", &self.participant_id)?; + if !self.node_id.is_empty() { + len += 1; } - if !self.participant_identity.is_empty() { - struct_ser.serialize_field("participantIdentity", &self.participant_identity)?; + if !self.debug_info.is_empty() { + len += 1; } - if !self.room_name.is_empty() { - struct_ser.serialize_field("roomName", &self.room_name)?; + if self.agent_protocol != 0 { + len += 1; } - if !self.sip_call_id.is_empty() { - struct_ser.serialize_field("sipCallId", &self.sip_call_id)?; + let mut struct_ser = serializer.serialize_struct("livekit.ServerInfo", len)?; + if self.edition != 0 { + let v = server_info::Edition::try_from(self.edition) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.edition)))?; + struct_ser.serialize_field("edition", &v)?; + } + if !self.version.is_empty() { + struct_ser.serialize_field("version", &self.version)?; + } + if self.protocol != 0 { + struct_ser.serialize_field("protocol", &self.protocol)?; + } + if !self.region.is_empty() { + struct_ser.serialize_field("region", &self.region)?; + } + if !self.node_id.is_empty() { + struct_ser.serialize_field("nodeId", &self.node_id)?; + } + if !self.debug_info.is_empty() { + struct_ser.serialize_field("debugInfo", &self.debug_info)?; + } + if self.agent_protocol != 0 { + struct_ser.serialize_field("agentProtocol", &self.agent_protocol)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for SipParticipantInfo { +impl<'de> serde::Deserialize<'de> for ServerInfo { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "participant_id", - "participantId", - "participant_identity", - "participantIdentity", - "room_name", - "roomName", - "sip_call_id", - "sipCallId", + "edition", + "version", + "protocol", + "region", + "node_id", + "nodeId", + "debug_info", + "debugInfo", + "agent_protocol", + "agentProtocol", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - ParticipantId, - ParticipantIdentity, - RoomName, - SipCallId, + Edition, + Version, + Protocol, + Region, + NodeId, + DebugInfo, + AgentProtocol, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -17264,10 +21795,13 @@ impl<'de> serde::Deserialize<'de> for SipParticipantInfo { E: serde::de::Error, { match value { - "participantId" | "participant_id" => Ok(GeneratedField::ParticipantId), - "participantIdentity" | "participant_identity" => Ok(GeneratedField::ParticipantIdentity), - "roomName" | "room_name" => Ok(GeneratedField::RoomName), - "sipCallId" | "sip_call_id" => Ok(GeneratedField::SipCallId), + "edition" => Ok(GeneratedField::Edition), + "version" => Ok(GeneratedField::Version), + "protocol" => Ok(GeneratedField::Protocol), + "region" => Ok(GeneratedField::Region), + "nodeId" | "node_id" => Ok(GeneratedField::NodeId), + "debugInfo" | "debug_info" => Ok(GeneratedField::DebugInfo), + "agentProtocol" | "agent_protocol" => Ok(GeneratedField::AgentProtocol), _ => Ok(GeneratedField::__SkipField__), } } @@ -17277,94 +21811,118 @@ impl<'de> serde::Deserialize<'de> for SipParticipantInfo { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SipParticipantInfo; + type Value = ServerInfo; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SIPParticipantInfo") + formatter.write_str("struct livekit.ServerInfo") } - 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 participant_id__ = None; - let mut participant_identity__ = None; - let mut room_name__ = None; - let mut sip_call_id__ = None; + let mut edition__ = None; + let mut version__ = None; + let mut protocol__ = None; + let mut region__ = None; + let mut node_id__ = None; + let mut debug_info__ = None; + let mut agent_protocol__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::ParticipantId => { - if participant_id__.is_some() { - return Err(serde::de::Error::duplicate_field("participantId")); + GeneratedField::Edition => { + if edition__.is_some() { + return Err(serde::de::Error::duplicate_field("edition")); } - participant_id__ = Some(map_.next_value()?); + edition__ = Some(map_.next_value::()? as i32); } - GeneratedField::ParticipantIdentity => { - if participant_identity__.is_some() { - return Err(serde::de::Error::duplicate_field("participantIdentity")); + GeneratedField::Version => { + if version__.is_some() { + return Err(serde::de::Error::duplicate_field("version")); } - participant_identity__ = Some(map_.next_value()?); + version__ = Some(map_.next_value()?); } - GeneratedField::RoomName => { - if room_name__.is_some() { - return Err(serde::de::Error::duplicate_field("roomName")); + GeneratedField::Protocol => { + if protocol__.is_some() { + return Err(serde::de::Error::duplicate_field("protocol")); } - room_name__ = Some(map_.next_value()?); + protocol__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } - GeneratedField::SipCallId => { - if sip_call_id__.is_some() { - return Err(serde::de::Error::duplicate_field("sipCallId")); + GeneratedField::Region => { + if region__.is_some() { + return Err(serde::de::Error::duplicate_field("region")); } - sip_call_id__ = Some(map_.next_value()?); + region__ = Some(map_.next_value()?); + } + GeneratedField::NodeId => { + if node_id__.is_some() { + return Err(serde::de::Error::duplicate_field("nodeId")); + } + node_id__ = Some(map_.next_value()?); + } + GeneratedField::DebugInfo => { + if debug_info__.is_some() { + return Err(serde::de::Error::duplicate_field("debugInfo")); + } + debug_info__ = Some(map_.next_value()?); + } + GeneratedField::AgentProtocol => { + if agent_protocol__.is_some() { + return Err(serde::de::Error::duplicate_field("agentProtocol")); + } + agent_protocol__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(SipParticipantInfo { - participant_id: participant_id__.unwrap_or_default(), - participant_identity: participant_identity__.unwrap_or_default(), - room_name: room_name__.unwrap_or_default(), - sip_call_id: sip_call_id__.unwrap_or_default(), + Ok(ServerInfo { + edition: edition__.unwrap_or_default(), + version: version__.unwrap_or_default(), + protocol: protocol__.unwrap_or_default(), + region: region__.unwrap_or_default(), + node_id: node_id__.unwrap_or_default(), + debug_info: debug_info__.unwrap_or_default(), + agent_protocol: agent_protocol__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.SIPParticipantInfo", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ServerInfo", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for SipTransport { +impl serde::Serialize for server_info::Edition { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { - let variant = match self { - Self::Auto => "SIP_TRANSPORT_AUTO", - Self::Udp => "SIP_TRANSPORT_UDP", - Self::Tcp => "SIP_TRANSPORT_TCP", - Self::Tls => "SIP_TRANSPORT_TLS", + let variant = match self { + Self::Standard => "Standard", + Self::Cloud => "Cloud", }; serializer.serialize_str(variant) } } -impl<'de> serde::Deserialize<'de> for SipTransport { +impl<'de> serde::Deserialize<'de> for server_info::Edition { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "SIP_TRANSPORT_AUTO", - "SIP_TRANSPORT_UDP", - "SIP_TRANSPORT_TCP", - "SIP_TRANSPORT_TLS", + "Standard", + "Cloud", ]; struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SipTransport; + type Value = server_info::Edition; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(formatter, "expected one of: {:?}", &FIELDS) @@ -17399,10 +21957,8 @@ impl<'de> serde::Deserialize<'de> for SipTransport { E: serde::de::Error, { match value { - "SIP_TRANSPORT_AUTO" => Ok(SipTransport::Auto), - "SIP_TRANSPORT_UDP" => Ok(SipTransport::Udp), - "SIP_TRANSPORT_TCP" => Ok(SipTransport::Tcp), - "SIP_TRANSPORT_TLS" => Ok(SipTransport::Tls), + "Standard" => Ok(server_info::Edition::Standard), + "Cloud" => Ok(server_info::Edition::Cloud), _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } } @@ -17410,7 +21966,7 @@ impl<'de> serde::Deserialize<'de> for SipTransport { deserializer.deserialize_any(GeneratedVisitor) } } -impl serde::Serialize for SipTrunkInfo { +impl serde::Serialize for ServerMessage { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -17418,147 +21974,53 @@ impl serde::Serialize for SipTrunkInfo { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.sip_trunk_id.is_empty() { - len += 1; - } - if self.kind != 0 { - len += 1; - } - if !self.inbound_addresses.is_empty() { - len += 1; - } - if !self.outbound_address.is_empty() { - len += 1; - } - if !self.outbound_number.is_empty() { - len += 1; - } - if self.transport != 0 { - len += 1; - } - if !self.inbound_numbers_regex.is_empty() { - len += 1; - } - if !self.inbound_numbers.is_empty() { - len += 1; - } - if !self.inbound_username.is_empty() { - len += 1; - } - if !self.inbound_password.is_empty() { - len += 1; - } - if !self.outbound_username.is_empty() { - len += 1; - } - if !self.outbound_password.is_empty() { - len += 1; - } - if !self.name.is_empty() { - len += 1; - } - if !self.metadata.is_empty() { + if self.message.is_some() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.SIPTrunkInfo", len)?; - if !self.sip_trunk_id.is_empty() { - struct_ser.serialize_field("sipTrunkId", &self.sip_trunk_id)?; - } - if self.kind != 0 { - let v = sip_trunk_info::TrunkKind::try_from(self.kind) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.kind)))?; - struct_ser.serialize_field("kind", &v)?; - } - if !self.inbound_addresses.is_empty() { - struct_ser.serialize_field("inboundAddresses", &self.inbound_addresses)?; - } - if !self.outbound_address.is_empty() { - struct_ser.serialize_field("outboundAddress", &self.outbound_address)?; - } - if !self.outbound_number.is_empty() { - struct_ser.serialize_field("outboundNumber", &self.outbound_number)?; - } - if self.transport != 0 { - let v = SipTransport::try_from(self.transport) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.transport)))?; - struct_ser.serialize_field("transport", &v)?; - } - if !self.inbound_numbers_regex.is_empty() { - struct_ser.serialize_field("inboundNumbersRegex", &self.inbound_numbers_regex)?; - } - if !self.inbound_numbers.is_empty() { - struct_ser.serialize_field("inboundNumbers", &self.inbound_numbers)?; - } - if !self.inbound_username.is_empty() { - struct_ser.serialize_field("inboundUsername", &self.inbound_username)?; - } - if !self.inbound_password.is_empty() { - struct_ser.serialize_field("inboundPassword", &self.inbound_password)?; - } - if !self.outbound_username.is_empty() { - struct_ser.serialize_field("outboundUsername", &self.outbound_username)?; - } - if !self.outbound_password.is_empty() { - struct_ser.serialize_field("outboundPassword", &self.outbound_password)?; - } - if !self.name.is_empty() { - struct_ser.serialize_field("name", &self.name)?; - } - if !self.metadata.is_empty() { - struct_ser.serialize_field("metadata", &self.metadata)?; + let mut struct_ser = serializer.serialize_struct("livekit.ServerMessage", len)?; + if let Some(v) = self.message.as_ref() { + match v { + server_message::Message::Register(v) => { + struct_ser.serialize_field("register", v)?; + } + server_message::Message::Availability(v) => { + struct_ser.serialize_field("availability", v)?; + } + server_message::Message::Assignment(v) => { + struct_ser.serialize_field("assignment", v)?; + } + server_message::Message::Termination(v) => { + struct_ser.serialize_field("termination", v)?; + } + server_message::Message::Pong(v) => { + struct_ser.serialize_field("pong", v)?; + } + } } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for SipTrunkInfo { +impl<'de> serde::Deserialize<'de> for ServerMessage { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "sip_trunk_id", - "sipTrunkId", - "kind", - "inbound_addresses", - "inboundAddresses", - "outbound_address", - "outboundAddress", - "outbound_number", - "outboundNumber", - "transport", - "inbound_numbers_regex", - "inboundNumbersRegex", - "inbound_numbers", - "inboundNumbers", - "inbound_username", - "inboundUsername", - "inbound_password", - "inboundPassword", - "outbound_username", - "outboundUsername", - "outbound_password", - "outboundPassword", - "name", - "metadata", + "register", + "availability", + "assignment", + "termination", + "pong", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - SipTrunkId, - Kind, - InboundAddresses, - OutboundAddress, - OutboundNumber, - Transport, - InboundNumbersRegex, - InboundNumbers, - InboundUsername, - InboundPassword, - OutboundUsername, - OutboundPassword, - Name, - Metadata, + Register, + Availability, + Assignment, + Termination, + Pong, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -17581,20 +22043,11 @@ impl<'de> serde::Deserialize<'de> for SipTrunkInfo { E: serde::de::Error, { match value { - "sipTrunkId" | "sip_trunk_id" => Ok(GeneratedField::SipTrunkId), - "kind" => Ok(GeneratedField::Kind), - "inboundAddresses" | "inbound_addresses" => Ok(GeneratedField::InboundAddresses), - "outboundAddress" | "outbound_address" => Ok(GeneratedField::OutboundAddress), - "outboundNumber" | "outbound_number" => Ok(GeneratedField::OutboundNumber), - "transport" => Ok(GeneratedField::Transport), - "inboundNumbersRegex" | "inbound_numbers_regex" => Ok(GeneratedField::InboundNumbersRegex), - "inboundNumbers" | "inbound_numbers" => Ok(GeneratedField::InboundNumbers), - "inboundUsername" | "inbound_username" => Ok(GeneratedField::InboundUsername), - "inboundPassword" | "inbound_password" => Ok(GeneratedField::InboundPassword), - "outboundUsername" | "outbound_username" => Ok(GeneratedField::OutboundUsername), - "outboundPassword" | "outbound_password" => Ok(GeneratedField::OutboundPassword), - "name" => Ok(GeneratedField::Name), - "metadata" => Ok(GeneratedField::Metadata), + "register" => Ok(GeneratedField::Register), + "availability" => Ok(GeneratedField::Availability), + "assignment" => Ok(GeneratedField::Assignment), + "termination" => Ok(GeneratedField::Termination), + "pong" => Ok(GeneratedField::Pong), _ => Ok(GeneratedField::__SkipField__), } } @@ -17602,219 +22055,182 @@ impl<'de> serde::Deserialize<'de> for SipTrunkInfo { deserializer.deserialize_identifier(GeneratedVisitor) } } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SipTrunkInfo; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SIPTrunkInfo") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut sip_trunk_id__ = None; - let mut kind__ = None; - let mut inbound_addresses__ = None; - let mut outbound_address__ = None; - let mut outbound_number__ = None; - let mut transport__ = None; - let mut inbound_numbers_regex__ = None; - let mut inbound_numbers__ = None; - let mut inbound_username__ = None; - let mut inbound_password__ = None; - let mut outbound_username__ = None; - let mut outbound_password__ = None; - let mut name__ = None; - let mut metadata__ = 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::Kind => { - if kind__.is_some() { - return Err(serde::de::Error::duplicate_field("kind")); - } - kind__ = Some(map_.next_value::()? as i32); - } - GeneratedField::InboundAddresses => { - if inbound_addresses__.is_some() { - return Err(serde::de::Error::duplicate_field("inboundAddresses")); - } - inbound_addresses__ = Some(map_.next_value()?); - } - GeneratedField::OutboundAddress => { - if outbound_address__.is_some() { - return Err(serde::de::Error::duplicate_field("outboundAddress")); - } - outbound_address__ = Some(map_.next_value()?); - } - GeneratedField::OutboundNumber => { - if outbound_number__.is_some() { - return Err(serde::de::Error::duplicate_field("outboundNumber")); - } - outbound_number__ = Some(map_.next_value()?); - } - GeneratedField::Transport => { - if transport__.is_some() { - return Err(serde::de::Error::duplicate_field("transport")); - } - transport__ = Some(map_.next_value::()? as i32); - } - GeneratedField::InboundNumbersRegex => { - if inbound_numbers_regex__.is_some() { - return Err(serde::de::Error::duplicate_field("inboundNumbersRegex")); - } - inbound_numbers_regex__ = Some(map_.next_value()?); - } - GeneratedField::InboundNumbers => { - if inbound_numbers__.is_some() { - return Err(serde::de::Error::duplicate_field("inboundNumbers")); - } - inbound_numbers__ = Some(map_.next_value()?); - } - GeneratedField::InboundUsername => { - if inbound_username__.is_some() { - return Err(serde::de::Error::duplicate_field("inboundUsername")); - } - inbound_username__ = Some(map_.next_value()?); - } - GeneratedField::InboundPassword => { - if inbound_password__.is_some() { - return Err(serde::de::Error::duplicate_field("inboundPassword")); + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ServerMessage; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.ServerMessage") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut message__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Register => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("register")); } - inbound_password__ = Some(map_.next_value()?); + message__ = map_.next_value::<::std::option::Option<_>>()?.map(server_message::Message::Register) +; } - GeneratedField::OutboundUsername => { - if outbound_username__.is_some() { - return Err(serde::de::Error::duplicate_field("outboundUsername")); + GeneratedField::Availability => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("availability")); } - outbound_username__ = Some(map_.next_value()?); + message__ = map_.next_value::<::std::option::Option<_>>()?.map(server_message::Message::Availability) +; } - GeneratedField::OutboundPassword => { - if outbound_password__.is_some() { - return Err(serde::de::Error::duplicate_field("outboundPassword")); + GeneratedField::Assignment => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("assignment")); } - outbound_password__ = Some(map_.next_value()?); + message__ = map_.next_value::<::std::option::Option<_>>()?.map(server_message::Message::Assignment) +; } - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); + GeneratedField::Termination => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("termination")); } - name__ = Some(map_.next_value()?); + message__ = map_.next_value::<::std::option::Option<_>>()?.map(server_message::Message::Termination) +; } - GeneratedField::Metadata => { - if metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("metadata")); + GeneratedField::Pong => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("pong")); } - metadata__ = Some(map_.next_value()?); + message__ = map_.next_value::<::std::option::Option<_>>()?.map(server_message::Message::Pong) +; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(SipTrunkInfo { - sip_trunk_id: sip_trunk_id__.unwrap_or_default(), - kind: kind__.unwrap_or_default(), - inbound_addresses: inbound_addresses__.unwrap_or_default(), - outbound_address: outbound_address__.unwrap_or_default(), - outbound_number: outbound_number__.unwrap_or_default(), - transport: transport__.unwrap_or_default(), - inbound_numbers_regex: inbound_numbers_regex__.unwrap_or_default(), - inbound_numbers: inbound_numbers__.unwrap_or_default(), - inbound_username: inbound_username__.unwrap_or_default(), - inbound_password: inbound_password__.unwrap_or_default(), - outbound_username: outbound_username__.unwrap_or_default(), - outbound_password: outbound_password__.unwrap_or_default(), - name: name__.unwrap_or_default(), - metadata: metadata__.unwrap_or_default(), + Ok(ServerMessage { + message: message__, }) } } - deserializer.deserialize_struct("livekit.SIPTrunkInfo", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ServerMessage", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for sip_trunk_info::TrunkKind { +impl serde::Serialize for SessionDescription { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { - let variant = match self { - Self::TrunkLegacy => "TRUNK_LEGACY", - Self::TrunkInbound => "TRUNK_INBOUND", - Self::TrunkOutbound => "TRUNK_OUTBOUND", - }; - serializer.serialize_str(variant) + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.r#type.is_empty() { + len += 1; + } + if !self.sdp.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.SessionDescription", len)?; + if !self.r#type.is_empty() { + struct_ser.serialize_field("type", &self.r#type)?; + } + if !self.sdp.is_empty() { + struct_ser.serialize_field("sdp", &self.sdp)?; + } + struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for sip_trunk_info::TrunkKind { +impl<'de> serde::Deserialize<'de> for SessionDescription { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "TRUNK_LEGACY", - "TRUNK_INBOUND", - "TRUNK_OUTBOUND", + "type", + "sdp", ]; - struct GeneratedVisitor; + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Type, + Sdp, + __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 = sip_trunk_info::TrunkKind; + 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 { + "type" => Ok(GeneratedField::Type), + "sdp" => Ok(GeneratedField::Sdp), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SessionDescription; - 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.SessionDescription") } - 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 { - "TRUNK_LEGACY" => Ok(sip_trunk_info::TrunkKind::TrunkLegacy), - "TRUNK_INBOUND" => Ok(sip_trunk_info::TrunkKind::TrunkInbound), - "TRUNK_OUTBOUND" => Ok(sip_trunk_info::TrunkKind::TrunkOutbound), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + let mut r#type__ = None; + let mut sdp__ = 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()?); + } + GeneratedField::Sdp => { + if sdp__.is_some() { + return Err(serde::de::Error::duplicate_field("sdp")); + } + sdp__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } } + Ok(SessionDescription { + r#type: r#type__.unwrap_or_default(), + sdp: sdp__.unwrap_or_default(), + }) } } - deserializer.deserialize_any(GeneratedVisitor) + deserializer.deserialize_struct("livekit.SessionDescription", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for SegmentedFileOutput { +impl serde::Serialize for SignalRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -17822,114 +22238,123 @@ impl serde::Serialize for SegmentedFileOutput { { use serde::ser::SerializeStruct; let mut len = 0; - if self.protocol != 0 { - len += 1; - } - if !self.filename_prefix.is_empty() { - len += 1; - } - if !self.playlist_name.is_empty() { - len += 1; - } - if !self.live_playlist_name.is_empty() { - len += 1; - } - if self.segment_duration != 0 { - len += 1; - } - if self.filename_suffix != 0 { - len += 1; - } - if self.disable_manifest { - len += 1; - } - if self.output.is_some() { + if self.message.is_some() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.SegmentedFileOutput", len)?; - if self.protocol != 0 { - let v = SegmentedFileProtocol::try_from(self.protocol) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.protocol)))?; - struct_ser.serialize_field("protocol", &v)?; - } - if !self.filename_prefix.is_empty() { - struct_ser.serialize_field("filenamePrefix", &self.filename_prefix)?; - } - if !self.playlist_name.is_empty() { - struct_ser.serialize_field("playlistName", &self.playlist_name)?; - } - if !self.live_playlist_name.is_empty() { - struct_ser.serialize_field("livePlaylistName", &self.live_playlist_name)?; - } - if self.segment_duration != 0 { - struct_ser.serialize_field("segmentDuration", &self.segment_duration)?; - } - if self.filename_suffix != 0 { - let v = SegmentedFileSuffix::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.disable_manifest { - struct_ser.serialize_field("disableManifest", &self.disable_manifest)?; - } - if let Some(v) = self.output.as_ref() { + let mut struct_ser = serializer.serialize_struct("livekit.SignalRequest", len)?; + if let Some(v) = self.message.as_ref() { match v { - segmented_file_output::Output::S3(v) => { - struct_ser.serialize_field("s3", v)?; + signal_request::Message::Offer(v) => { + struct_ser.serialize_field("offer", v)?; + } + signal_request::Message::Answer(v) => { + struct_ser.serialize_field("answer", v)?; + } + signal_request::Message::Trickle(v) => { + struct_ser.serialize_field("trickle", v)?; + } + signal_request::Message::AddTrack(v) => { + struct_ser.serialize_field("addTrack", v)?; + } + signal_request::Message::Mute(v) => { + struct_ser.serialize_field("mute", v)?; } - segmented_file_output::Output::Gcp(v) => { - struct_ser.serialize_field("gcp", v)?; + signal_request::Message::Subscription(v) => { + struct_ser.serialize_field("subscription", v)?; } - segmented_file_output::Output::Azure(v) => { - struct_ser.serialize_field("azure", v)?; + signal_request::Message::TrackSetting(v) => { + struct_ser.serialize_field("trackSetting", v)?; } - segmented_file_output::Output::AliOss(v) => { - struct_ser.serialize_field("aliOSS", v)?; + signal_request::Message::Leave(v) => { + struct_ser.serialize_field("leave", v)?; + } + signal_request::Message::UpdateLayers(v) => { + struct_ser.serialize_field("updateLayers", v)?; + } + signal_request::Message::SubscriptionPermission(v) => { + struct_ser.serialize_field("subscriptionPermission", v)?; + } + signal_request::Message::SyncState(v) => { + struct_ser.serialize_field("syncState", v)?; + } + signal_request::Message::Simulate(v) => { + struct_ser.serialize_field("simulate", v)?; + } + signal_request::Message::Ping(v) => { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("ping", ToString::to_string(&v).as_str())?; + } + signal_request::Message::UpdateMetadata(v) => { + struct_ser.serialize_field("updateMetadata", v)?; + } + signal_request::Message::PingReq(v) => { + struct_ser.serialize_field("pingReq", v)?; + } + signal_request::Message::UpdateAudioTrack(v) => { + struct_ser.serialize_field("updateAudioTrack", v)?; + } + signal_request::Message::UpdateVideoTrack(v) => { + struct_ser.serialize_field("updateVideoTrack", v)?; } } } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for SegmentedFileOutput { +impl<'de> serde::Deserialize<'de> for SignalRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "protocol", - "filename_prefix", - "filenamePrefix", - "playlist_name", - "playlistName", - "live_playlist_name", - "livePlaylistName", - "segment_duration", - "segmentDuration", - "filename_suffix", - "filenameSuffix", - "disable_manifest", - "disableManifest", - "s3", - "gcp", - "azure", - "aliOSS", + "offer", + "answer", + "trickle", + "add_track", + "addTrack", + "mute", + "subscription", + "track_setting", + "trackSetting", + "leave", + "update_layers", + "updateLayers", + "subscription_permission", + "subscriptionPermission", + "sync_state", + "syncState", + "simulate", + "ping", + "update_metadata", + "updateMetadata", + "ping_req", + "pingReq", + "update_audio_track", + "updateAudioTrack", + "update_video_track", + "updateVideoTrack", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Protocol, - FilenamePrefix, - PlaylistName, - LivePlaylistName, - SegmentDuration, - FilenameSuffix, - DisableManifest, - S3, - Gcp, - Azure, - AliOss, + Offer, + Answer, + Trickle, + AddTrack, + Mute, + Subscription, + TrackSetting, + Leave, + UpdateLayers, + SubscriptionPermission, + SyncState, + Simulate, + Ping, + UpdateMetadata, + PingReq, + UpdateAudioTrack, + UpdateVideoTrack, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -17952,17 +22377,23 @@ impl<'de> serde::Deserialize<'de> for SegmentedFileOutput { E: serde::de::Error, { match value { - "protocol" => Ok(GeneratedField::Protocol), - "filenamePrefix" | "filename_prefix" => Ok(GeneratedField::FilenamePrefix), - "playlistName" | "playlist_name" => Ok(GeneratedField::PlaylistName), - "livePlaylistName" | "live_playlist_name" => Ok(GeneratedField::LivePlaylistName), - "segmentDuration" | "segment_duration" => Ok(GeneratedField::SegmentDuration), - "filenameSuffix" | "filename_suffix" => Ok(GeneratedField::FilenameSuffix), - "disableManifest" | "disable_manifest" => Ok(GeneratedField::DisableManifest), - "s3" => Ok(GeneratedField::S3), - "gcp" => Ok(GeneratedField::Gcp), - "azure" => Ok(GeneratedField::Azure), - "aliOSS" => Ok(GeneratedField::AliOss), + "offer" => Ok(GeneratedField::Offer), + "answer" => Ok(GeneratedField::Answer), + "trickle" => Ok(GeneratedField::Trickle), + "addTrack" | "add_track" => Ok(GeneratedField::AddTrack), + "mute" => Ok(GeneratedField::Mute), + "subscription" => Ok(GeneratedField::Subscription), + "trackSetting" | "track_setting" => Ok(GeneratedField::TrackSetting), + "leave" => Ok(GeneratedField::Leave), + "updateLayers" | "update_layers" => Ok(GeneratedField::UpdateLayers), + "subscriptionPermission" | "subscription_permission" => Ok(GeneratedField::SubscriptionPermission), + "syncState" | "sync_state" => Ok(GeneratedField::SyncState), + "simulate" => Ok(GeneratedField::Simulate), + "ping" => Ok(GeneratedField::Ping), + "updateMetadata" | "update_metadata" => Ok(GeneratedField::UpdateMetadata), + "pingReq" | "ping_req" => Ok(GeneratedField::PingReq), + "updateAudioTrack" | "update_audio_track" => Ok(GeneratedField::UpdateAudioTrack), + "updateVideoTrack" | "update_video_track" => Ok(GeneratedField::UpdateVideoTrack), _ => Ok(GeneratedField::__SkipField__), } } @@ -17972,367 +22403,304 @@ impl<'de> serde::Deserialize<'de> for SegmentedFileOutput { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SegmentedFileOutput; + type Value = SignalRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SegmentedFileOutput") + formatter.write_str("struct livekit.SignalRequest") } - 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 protocol__ = None; - let mut filename_prefix__ = None; - let mut playlist_name__ = None; - let mut live_playlist_name__ = None; - let mut segment_duration__ = None; - let mut filename_suffix__ = None; - let mut disable_manifest__ = None; - let mut output__ = None; + let mut message__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Protocol => { - if protocol__.is_some() { - return Err(serde::de::Error::duplicate_field("protocol")); + GeneratedField::Offer => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("offer")); } - protocol__ = Some(map_.next_value::()? as i32); + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::Offer) +; } - GeneratedField::FilenamePrefix => { - if filename_prefix__.is_some() { - return Err(serde::de::Error::duplicate_field("filenamePrefix")); + GeneratedField::Answer => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("answer")); } - filename_prefix__ = Some(map_.next_value()?); + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::Answer) +; } - GeneratedField::PlaylistName => { - if playlist_name__.is_some() { - return Err(serde::de::Error::duplicate_field("playlistName")); + GeneratedField::Trickle => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("trickle")); } - playlist_name__ = Some(map_.next_value()?); + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::Trickle) +; } - GeneratedField::LivePlaylistName => { - if live_playlist_name__.is_some() { - return Err(serde::de::Error::duplicate_field("livePlaylistName")); + GeneratedField::AddTrack => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("addTrack")); } - live_playlist_name__ = Some(map_.next_value()?); + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::AddTrack) +; } - GeneratedField::SegmentDuration => { - if segment_duration__.is_some() { - return Err(serde::de::Error::duplicate_field("segmentDuration")); + GeneratedField::Mute => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("mute")); } - segment_duration__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::Mute) +; } - GeneratedField::FilenameSuffix => { - if filename_suffix__.is_some() { - return Err(serde::de::Error::duplicate_field("filenameSuffix")); + GeneratedField::Subscription => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("subscription")); } - filename_suffix__ = Some(map_.next_value::()? as i32); + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::Subscription) +; } - GeneratedField::DisableManifest => { - if disable_manifest__.is_some() { - return Err(serde::de::Error::duplicate_field("disableManifest")); + GeneratedField::TrackSetting => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("trackSetting")); } - disable_manifest__ = Some(map_.next_value()?); + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::TrackSetting) +; } - GeneratedField::S3 => { - if output__.is_some() { - return Err(serde::de::Error::duplicate_field("s3")); + GeneratedField::Leave => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("leave")); + } + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::Leave) +; + } + GeneratedField::UpdateLayers => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("updateLayers")); + } + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::UpdateLayers) +; + } + GeneratedField::SubscriptionPermission => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("subscriptionPermission")); + } + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::SubscriptionPermission) +; + } + GeneratedField::SyncState => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("syncState")); + } + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::SyncState) +; + } + GeneratedField::Simulate => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("simulate")); } - output__ = map_.next_value::<::std::option::Option<_>>()?.map(segmented_file_output::Output::S3) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::Simulate) ; } - GeneratedField::Gcp => { - if output__.is_some() { - return Err(serde::de::Error::duplicate_field("gcp")); + GeneratedField::Ping => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("ping")); } - output__ = map_.next_value::<::std::option::Option<_>>()?.map(segmented_file_output::Output::Gcp) -; + message__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| signal_request::Message::Ping(x.0)); } - GeneratedField::Azure => { - if output__.is_some() { - return Err(serde::de::Error::duplicate_field("azure")); + GeneratedField::UpdateMetadata => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("updateMetadata")); } - output__ = map_.next_value::<::std::option::Option<_>>()?.map(segmented_file_output::Output::Azure) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::UpdateMetadata) ; } - GeneratedField::AliOss => { - if output__.is_some() { - return Err(serde::de::Error::duplicate_field("aliOSS")); + GeneratedField::PingReq => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("pingReq")); } - output__ = map_.next_value::<::std::option::Option<_>>()?.map(segmented_file_output::Output::AliOss) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::PingReq) ; } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; + GeneratedField::UpdateAudioTrack => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("updateAudioTrack")); + } + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::UpdateAudioTrack) +; } - } - } - Ok(SegmentedFileOutput { - protocol: protocol__.unwrap_or_default(), - filename_prefix: filename_prefix__.unwrap_or_default(), - playlist_name: playlist_name__.unwrap_or_default(), - live_playlist_name: live_playlist_name__.unwrap_or_default(), - segment_duration: segment_duration__.unwrap_or_default(), - filename_suffix: filename_suffix__.unwrap_or_default(), - disable_manifest: disable_manifest__.unwrap_or_default(), - output: output__, - }) - } - } - deserializer.deserialize_struct("livekit.SegmentedFileOutput", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for SegmentedFileProtocol { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::DefaultSegmentedFileProtocol => "DEFAULT_SEGMENTED_FILE_PROTOCOL", - Self::HlsProtocol => "HLS_PROTOCOL", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for SegmentedFileProtocol { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "DEFAULT_SEGMENTED_FILE_PROTOCOL", - "HLS_PROTOCOL", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SegmentedFileProtocol; - - 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 { - "DEFAULT_SEGMENTED_FILE_PROTOCOL" => Ok(SegmentedFileProtocol::DefaultSegmentedFileProtocol), - "HLS_PROTOCOL" => Ok(SegmentedFileProtocol::HlsProtocol), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for SegmentedFileSuffix { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::Index => "INDEX", - Self::Timestamp => "TIMESTAMP", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for SegmentedFileSuffix { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "INDEX", - "TIMESTAMP", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SegmentedFileSuffix; - - 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 { - "INDEX" => Ok(SegmentedFileSuffix::Index), - "TIMESTAMP" => Ok(SegmentedFileSuffix::Timestamp), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for SegmentsInfo { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.playlist_name.is_empty() { - len += 1; - } - if !self.live_playlist_name.is_empty() { - len += 1; - } - if self.duration != 0 { - len += 1; - } - if self.size != 0 { - len += 1; - } - if !self.playlist_location.is_empty() { - len += 1; - } - if !self.live_playlist_location.is_empty() { - len += 1; - } - if self.segment_count != 0 { - len += 1; - } - if self.started_at != 0 { - len += 1; - } - if self.ended_at != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("livekit.SegmentsInfo", len)?; - if !self.playlist_name.is_empty() { - struct_ser.serialize_field("playlistName", &self.playlist_name)?; - } - if !self.live_playlist_name.is_empty() { - struct_ser.serialize_field("livePlaylistName", &self.live_playlist_name)?; - } - if self.duration != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("duration", ToString::to_string(&self.duration).as_str())?; - } - if self.size != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("size", ToString::to_string(&self.size).as_str())?; - } - if !self.playlist_location.is_empty() { - struct_ser.serialize_field("playlistLocation", &self.playlist_location)?; - } - if !self.live_playlist_location.is_empty() { - struct_ser.serialize_field("livePlaylistLocation", &self.live_playlist_location)?; - } - if self.segment_count != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("segmentCount", ToString::to_string(&self.segment_count).as_str())?; + GeneratedField::UpdateVideoTrack => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("updateVideoTrack")); + } + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::UpdateVideoTrack) +; + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(SignalRequest { + message: message__, + }) + } } - if self.started_at != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("startedAt", ToString::to_string(&self.started_at).as_str())?; + deserializer.deserialize_struct("livekit.SignalRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SignalResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.message.is_some() { + len += 1; } - if self.ended_at != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("endedAt", ToString::to_string(&self.ended_at).as_str())?; + let mut struct_ser = serializer.serialize_struct("livekit.SignalResponse", len)?; + if let Some(v) = self.message.as_ref() { + match v { + signal_response::Message::Join(v) => { + struct_ser.serialize_field("join", v)?; + } + signal_response::Message::Answer(v) => { + struct_ser.serialize_field("answer", v)?; + } + signal_response::Message::Offer(v) => { + struct_ser.serialize_field("offer", v)?; + } + signal_response::Message::Trickle(v) => { + struct_ser.serialize_field("trickle", v)?; + } + signal_response::Message::Update(v) => { + struct_ser.serialize_field("update", v)?; + } + signal_response::Message::TrackPublished(v) => { + struct_ser.serialize_field("trackPublished", v)?; + } + signal_response::Message::Leave(v) => { + struct_ser.serialize_field("leave", v)?; + } + signal_response::Message::Mute(v) => { + struct_ser.serialize_field("mute", v)?; + } + signal_response::Message::SpeakersChanged(v) => { + struct_ser.serialize_field("speakersChanged", v)?; + } + signal_response::Message::RoomUpdate(v) => { + struct_ser.serialize_field("roomUpdate", v)?; + } + signal_response::Message::ConnectionQuality(v) => { + struct_ser.serialize_field("connectionQuality", v)?; + } + signal_response::Message::StreamStateUpdate(v) => { + struct_ser.serialize_field("streamStateUpdate", v)?; + } + signal_response::Message::SubscribedQualityUpdate(v) => { + struct_ser.serialize_field("subscribedQualityUpdate", v)?; + } + signal_response::Message::SubscriptionPermissionUpdate(v) => { + struct_ser.serialize_field("subscriptionPermissionUpdate", v)?; + } + signal_response::Message::RefreshToken(v) => { + struct_ser.serialize_field("refreshToken", v)?; + } + signal_response::Message::TrackUnpublished(v) => { + struct_ser.serialize_field("trackUnpublished", v)?; + } + signal_response::Message::Pong(v) => { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("pong", ToString::to_string(&v).as_str())?; + } + signal_response::Message::Reconnect(v) => { + struct_ser.serialize_field("reconnect", v)?; + } + signal_response::Message::PongResp(v) => { + struct_ser.serialize_field("pongResp", v)?; + } + signal_response::Message::SubscriptionResponse(v) => { + struct_ser.serialize_field("subscriptionResponse", v)?; + } + signal_response::Message::ErrorResponse(v) => { + struct_ser.serialize_field("errorResponse", v)?; + } + signal_response::Message::TrackSubscribed(v) => { + struct_ser.serialize_field("trackSubscribed", v)?; + } + } } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for SegmentsInfo { +impl<'de> serde::Deserialize<'de> for SignalResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "playlist_name", - "playlistName", - "live_playlist_name", - "livePlaylistName", - "duration", - "size", - "playlist_location", - "playlistLocation", - "live_playlist_location", - "livePlaylistLocation", - "segment_count", - "segmentCount", - "started_at", - "startedAt", - "ended_at", - "endedAt", + "join", + "answer", + "offer", + "trickle", + "update", + "track_published", + "trackPublished", + "leave", + "mute", + "speakers_changed", + "speakersChanged", + "room_update", + "roomUpdate", + "connection_quality", + "connectionQuality", + "stream_state_update", + "streamStateUpdate", + "subscribed_quality_update", + "subscribedQualityUpdate", + "subscription_permission_update", + "subscriptionPermissionUpdate", + "refresh_token", + "refreshToken", + "track_unpublished", + "trackUnpublished", + "pong", + "reconnect", + "pong_resp", + "pongResp", + "subscription_response", + "subscriptionResponse", + "error_response", + "errorResponse", + "track_subscribed", + "trackSubscribed", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - PlaylistName, - LivePlaylistName, - Duration, - Size, - PlaylistLocation, - LivePlaylistLocation, - SegmentCount, - StartedAt, - EndedAt, + Join, + Answer, + Offer, + Trickle, + Update, + TrackPublished, + Leave, + Mute, + SpeakersChanged, + RoomUpdate, + ConnectionQuality, + StreamStateUpdate, + SubscribedQualityUpdate, + SubscriptionPermissionUpdate, + RefreshToken, + TrackUnpublished, + Pong, + Reconnect, + PongResp, + SubscriptionResponse, + ErrorResponse, + TrackSubscribed, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -18355,131 +22723,287 @@ impl<'de> serde::Deserialize<'de> for SegmentsInfo { E: serde::de::Error, { match value { - "playlistName" | "playlist_name" => Ok(GeneratedField::PlaylistName), - "livePlaylistName" | "live_playlist_name" => Ok(GeneratedField::LivePlaylistName), - "duration" => Ok(GeneratedField::Duration), - "size" => Ok(GeneratedField::Size), - "playlistLocation" | "playlist_location" => Ok(GeneratedField::PlaylistLocation), - "livePlaylistLocation" | "live_playlist_location" => Ok(GeneratedField::LivePlaylistLocation), - "segmentCount" | "segment_count" => Ok(GeneratedField::SegmentCount), - "startedAt" | "started_at" => Ok(GeneratedField::StartedAt), - "endedAt" | "ended_at" => Ok(GeneratedField::EndedAt), + "join" => Ok(GeneratedField::Join), + "answer" => Ok(GeneratedField::Answer), + "offer" => Ok(GeneratedField::Offer), + "trickle" => Ok(GeneratedField::Trickle), + "update" => Ok(GeneratedField::Update), + "trackPublished" | "track_published" => Ok(GeneratedField::TrackPublished), + "leave" => Ok(GeneratedField::Leave), + "mute" => Ok(GeneratedField::Mute), + "speakersChanged" | "speakers_changed" => Ok(GeneratedField::SpeakersChanged), + "roomUpdate" | "room_update" => Ok(GeneratedField::RoomUpdate), + "connectionQuality" | "connection_quality" => Ok(GeneratedField::ConnectionQuality), + "streamStateUpdate" | "stream_state_update" => Ok(GeneratedField::StreamStateUpdate), + "subscribedQualityUpdate" | "subscribed_quality_update" => Ok(GeneratedField::SubscribedQualityUpdate), + "subscriptionPermissionUpdate" | "subscription_permission_update" => Ok(GeneratedField::SubscriptionPermissionUpdate), + "refreshToken" | "refresh_token" => Ok(GeneratedField::RefreshToken), + "trackUnpublished" | "track_unpublished" => Ok(GeneratedField::TrackUnpublished), + "pong" => Ok(GeneratedField::Pong), + "reconnect" => Ok(GeneratedField::Reconnect), + "pongResp" | "pong_resp" => Ok(GeneratedField::PongResp), + "subscriptionResponse" | "subscription_response" => Ok(GeneratedField::SubscriptionResponse), + "errorResponse" | "error_response" => Ok(GeneratedField::ErrorResponse), + "trackSubscribed" | "track_subscribed" => Ok(GeneratedField::TrackSubscribed), _ => Ok(GeneratedField::__SkipField__), } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SegmentsInfo; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SegmentsInfo") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut playlist_name__ = None; - let mut live_playlist_name__ = None; - let mut duration__ = None; - let mut size__ = None; - let mut playlist_location__ = None; - let mut live_playlist_location__ = None; - let mut segment_count__ = None; - let mut started_at__ = None; - let mut ended_at__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::PlaylistName => { - if playlist_name__.is_some() { - return Err(serde::de::Error::duplicate_field("playlistName")); + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SignalResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.SignalResponse") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut message__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Join => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("join")); + } + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Join) +; + } + GeneratedField::Answer => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("answer")); + } + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Answer) +; + } + GeneratedField::Offer => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("offer")); + } + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Offer) +; + } + GeneratedField::Trickle => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("trickle")); + } + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Trickle) +; + } + GeneratedField::Update => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("update")); + } + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Update) +; + } + GeneratedField::TrackPublished => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("trackPublished")); } - playlist_name__ = Some(map_.next_value()?); + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::TrackPublished) +; } - GeneratedField::LivePlaylistName => { - if live_playlist_name__.is_some() { - return Err(serde::de::Error::duplicate_field("livePlaylistName")); + GeneratedField::Leave => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("leave")); } - live_playlist_name__ = Some(map_.next_value()?); + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Leave) +; } - GeneratedField::Duration => { - if duration__.is_some() { - return Err(serde::de::Error::duplicate_field("duration")); + GeneratedField::Mute => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("mute")); } - duration__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Mute) +; } - GeneratedField::Size => { - if size__.is_some() { - return Err(serde::de::Error::duplicate_field("size")); + GeneratedField::SpeakersChanged => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("speakersChanged")); } - size__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::SpeakersChanged) +; } - GeneratedField::PlaylistLocation => { - if playlist_location__.is_some() { - return Err(serde::de::Error::duplicate_field("playlistLocation")); + GeneratedField::RoomUpdate => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("roomUpdate")); } - playlist_location__ = Some(map_.next_value()?); + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::RoomUpdate) +; } - GeneratedField::LivePlaylistLocation => { - if live_playlist_location__.is_some() { - return Err(serde::de::Error::duplicate_field("livePlaylistLocation")); + GeneratedField::ConnectionQuality => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("connectionQuality")); } - live_playlist_location__ = Some(map_.next_value()?); + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::ConnectionQuality) +; } - GeneratedField::SegmentCount => { - if segment_count__.is_some() { - return Err(serde::de::Error::duplicate_field("segmentCount")); + GeneratedField::StreamStateUpdate => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("streamStateUpdate")); } - segment_count__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::StreamStateUpdate) +; } - GeneratedField::StartedAt => { - if started_at__.is_some() { - return Err(serde::de::Error::duplicate_field("startedAt")); + GeneratedField::SubscribedQualityUpdate => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("subscribedQualityUpdate")); } - started_at__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::SubscribedQualityUpdate) +; } - GeneratedField::EndedAt => { - if ended_at__.is_some() { - return Err(serde::de::Error::duplicate_field("endedAt")); + GeneratedField::SubscriptionPermissionUpdate => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("subscriptionPermissionUpdate")); } - ended_at__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::SubscriptionPermissionUpdate) +; + } + GeneratedField::RefreshToken => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("refreshToken")); + } + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::RefreshToken); + } + GeneratedField::TrackUnpublished => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("trackUnpublished")); + } + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::TrackUnpublished) +; + } + GeneratedField::Pong => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("pong")); + } + message__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| signal_response::Message::Pong(x.0)); + } + GeneratedField::Reconnect => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("reconnect")); + } + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Reconnect) +; + } + GeneratedField::PongResp => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("pongResp")); + } + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::PongResp) +; + } + GeneratedField::SubscriptionResponse => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("subscriptionResponse")); + } + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::SubscriptionResponse) +; + } + GeneratedField::ErrorResponse => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("errorResponse")); + } + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::ErrorResponse) +; + } + GeneratedField::TrackSubscribed => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("trackSubscribed")); + } + message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::TrackSubscribed) +; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(SegmentsInfo { - playlist_name: playlist_name__.unwrap_or_default(), - live_playlist_name: live_playlist_name__.unwrap_or_default(), - duration: duration__.unwrap_or_default(), - size: size__.unwrap_or_default(), - playlist_location: playlist_location__.unwrap_or_default(), - live_playlist_location: live_playlist_location__.unwrap_or_default(), - segment_count: segment_count__.unwrap_or_default(), - started_at: started_at__.unwrap_or_default(), - ended_at: ended_at__.unwrap_or_default(), + Ok(SignalResponse { + message: message__, }) } } - deserializer.deserialize_struct("livekit.SegmentsInfo", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.SignalResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SignalTarget { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Publisher => "PUBLISHER", + Self::Subscriber => "SUBSCRIBER", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for SignalTarget { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "PUBLISHER", + "SUBSCRIBER", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SignalTarget; + + 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 { + "PUBLISHER" => Ok(SignalTarget::Publisher), + "SUBSCRIBER" => Ok(SignalTarget::Subscriber), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) } } -impl serde::Serialize for SendDataRequest { +impl serde::Serialize for SimulateJobRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -18487,74 +23011,47 @@ impl serde::Serialize for SendDataRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.room.is_empty() { - len += 1; - } - if !self.data.is_empty() { - len += 1; - } - if self.kind != 0 { - len += 1; - } - if !self.destination_sids.is_empty() { + if self.r#type != 0 { len += 1; } - if !self.destination_identities.is_empty() { + if self.room.is_some() { len += 1; } - if self.topic.is_some() { + if self.participant.is_some() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.SendDataRequest", len)?; - if !self.room.is_empty() { - struct_ser.serialize_field("room", &self.room)?; - } - if !self.data.is_empty() { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; - } - if self.kind != 0 { - let v = data_packet::Kind::try_from(self.kind) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.kind)))?; - struct_ser.serialize_field("kind", &v)?; - } - if !self.destination_sids.is_empty() { - struct_ser.serialize_field("destinationSids", &self.destination_sids)?; + let mut struct_ser = serializer.serialize_struct("livekit.SimulateJobRequest", 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.destination_identities.is_empty() { - struct_ser.serialize_field("destinationIdentities", &self.destination_identities)?; + if let Some(v) = self.room.as_ref() { + struct_ser.serialize_field("room", v)?; } - if let Some(v) = self.topic.as_ref() { - struct_ser.serialize_field("topic", v)?; + if let Some(v) = self.participant.as_ref() { + struct_ser.serialize_field("participant", v)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for SendDataRequest { +impl<'de> serde::Deserialize<'de> for SimulateJobRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ + "type", "room", - "data", - "kind", - "destination_sids", - "destinationSids", - "destination_identities", - "destinationIdentities", - "topic", + "participant", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { + Type, Room, - Data, - Kind, - DestinationSids, - DestinationIdentities, - Topic, + Participant, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -18577,12 +23074,9 @@ impl<'de> serde::Deserialize<'de> for SendDataRequest { E: serde::de::Error, { match value { + "type" => Ok(GeneratedField::Type), "room" => Ok(GeneratedField::Room), - "data" => Ok(GeneratedField::Data), - "kind" => Ok(GeneratedField::Kind), - "destinationSids" | "destination_sids" => Ok(GeneratedField::DestinationSids), - "destinationIdentities" | "destination_identities" => Ok(GeneratedField::DestinationIdentities), - "topic" => Ok(GeneratedField::Topic), + "participant" => Ok(GeneratedField::Participant), _ => Ok(GeneratedField::__SkipField__), } } @@ -18592,153 +23086,55 @@ impl<'de> serde::Deserialize<'de> for SendDataRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SendDataRequest; + type Value = SimulateJobRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SendDataRequest") + formatter.write_str("struct livekit.SimulateJobRequest") } - 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 room__ = None; - let mut data__ = None; - let mut kind__ = None; - let mut destination_sids__ = None; - let mut destination_identities__ = None; - let mut topic__ = None; + let mut participant__ = 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::Room => { if room__.is_some() { return Err(serde::de::Error::duplicate_field("room")); } - room__ = Some(map_.next_value()?); - } - GeneratedField::Data => { - if data__.is_some() { - return Err(serde::de::Error::duplicate_field("data")); - } - data__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::Kind => { - if kind__.is_some() { - return Err(serde::de::Error::duplicate_field("kind")); - } - kind__ = Some(map_.next_value::()? as i32); - } - GeneratedField::DestinationSids => { - if destination_sids__.is_some() { - return Err(serde::de::Error::duplicate_field("destinationSids")); - } - destination_sids__ = Some(map_.next_value()?); - } - GeneratedField::DestinationIdentities => { - if destination_identities__.is_some() { - return Err(serde::de::Error::duplicate_field("destinationIdentities")); - } - destination_identities__ = Some(map_.next_value()?); + room__ = map_.next_value()?; } - GeneratedField::Topic => { - if topic__.is_some() { - return Err(serde::de::Error::duplicate_field("topic")); + GeneratedField::Participant => { + if participant__.is_some() { + return Err(serde::de::Error::duplicate_field("participant")); } - topic__ = map_.next_value()?; + participant__ = map_.next_value()?; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(SendDataRequest { - room: room__.unwrap_or_default(), - data: data__.unwrap_or_default(), - kind: kind__.unwrap_or_default(), - destination_sids: destination_sids__.unwrap_or_default(), - destination_identities: destination_identities__.unwrap_or_default(), - topic: topic__, - }) - } - } - deserializer.deserialize_struct("livekit.SendDataRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for SendDataResponse { - #[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.SendDataResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SendDataResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - __SkipField__, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - Ok(GeneratedField::__SkipField__) - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SendDataResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SendDataResponse") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; - } - Ok(SendDataResponse { + Ok(SimulateJobRequest { + r#type: r#type__.unwrap_or_default(), + room: room__, + participant: participant__, }) } } - deserializer.deserialize_struct("livekit.SendDataResponse", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.SimulateJobRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ServerInfo { +impl serde::Serialize for SimulateScenario { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -18746,82 +23142,84 @@ impl serde::Serialize for ServerInfo { { use serde::ser::SerializeStruct; let mut len = 0; - if self.edition != 0 { - len += 1; - } - if !self.version.is_empty() { - len += 1; - } - if self.protocol != 0 { - len += 1; - } - if !self.region.is_empty() { - len += 1; - } - if !self.node_id.is_empty() { - len += 1; - } - if !self.debug_info.is_empty() { - len += 1; - } - if self.agent_protocol != 0 { + if self.scenario.is_some() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.ServerInfo", len)?; - if self.edition != 0 { - let v = server_info::Edition::try_from(self.edition) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.edition)))?; - struct_ser.serialize_field("edition", &v)?; - } - if !self.version.is_empty() { - struct_ser.serialize_field("version", &self.version)?; - } - if self.protocol != 0 { - struct_ser.serialize_field("protocol", &self.protocol)?; - } - if !self.region.is_empty() { - struct_ser.serialize_field("region", &self.region)?; - } - if !self.node_id.is_empty() { - struct_ser.serialize_field("nodeId", &self.node_id)?; - } - if !self.debug_info.is_empty() { - struct_ser.serialize_field("debugInfo", &self.debug_info)?; - } - if self.agent_protocol != 0 { - struct_ser.serialize_field("agentProtocol", &self.agent_protocol)?; + let mut struct_ser = serializer.serialize_struct("livekit.SimulateScenario", len)?; + if let Some(v) = self.scenario.as_ref() { + match v { + simulate_scenario::Scenario::SpeakerUpdate(v) => { + struct_ser.serialize_field("speakerUpdate", v)?; + } + simulate_scenario::Scenario::NodeFailure(v) => { + struct_ser.serialize_field("nodeFailure", v)?; + } + simulate_scenario::Scenario::Migration(v) => { + struct_ser.serialize_field("migration", v)?; + } + simulate_scenario::Scenario::ServerLeave(v) => { + struct_ser.serialize_field("serverLeave", v)?; + } + simulate_scenario::Scenario::SwitchCandidateProtocol(v) => { + let v = CandidateProtocol::try_from(*v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("switchCandidateProtocol", &v)?; + } + simulate_scenario::Scenario::SubscriberBandwidth(v) => { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("subscriberBandwidth", ToString::to_string(&v).as_str())?; + } + simulate_scenario::Scenario::DisconnectSignalOnResume(v) => { + struct_ser.serialize_field("disconnectSignalOnResume", v)?; + } + simulate_scenario::Scenario::DisconnectSignalOnResumeNoMessages(v) => { + struct_ser.serialize_field("disconnectSignalOnResumeNoMessages", v)?; + } + simulate_scenario::Scenario::LeaveRequestFullReconnect(v) => { + struct_ser.serialize_field("leaveRequestFullReconnect", v)?; + } + } } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for ServerInfo { +impl<'de> serde::Deserialize<'de> for SimulateScenario { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "edition", - "version", - "protocol", - "region", - "node_id", - "nodeId", - "debug_info", - "debugInfo", - "agent_protocol", - "agentProtocol", + "speaker_update", + "speakerUpdate", + "node_failure", + "nodeFailure", + "migration", + "server_leave", + "serverLeave", + "switch_candidate_protocol", + "switchCandidateProtocol", + "subscriber_bandwidth", + "subscriberBandwidth", + "disconnect_signal_on_resume", + "disconnectSignalOnResume", + "disconnect_signal_on_resume_no_messages", + "disconnectSignalOnResumeNoMessages", + "leave_request_full_reconnect", + "leaveRequestFullReconnect", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Edition, - Version, - Protocol, - Region, - NodeId, - DebugInfo, - AgentProtocol, + SpeakerUpdate, + NodeFailure, + Migration, + ServerLeave, + SwitchCandidateProtocol, + SubscriberBandwidth, + DisconnectSignalOnResume, + DisconnectSignalOnResumeNoMessages, + LeaveRequestFullReconnect, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -18844,13 +23242,15 @@ impl<'de> serde::Deserialize<'de> for ServerInfo { E: serde::de::Error, { match value { - "edition" => Ok(GeneratedField::Edition), - "version" => Ok(GeneratedField::Version), - "protocol" => Ok(GeneratedField::Protocol), - "region" => Ok(GeneratedField::Region), - "nodeId" | "node_id" => Ok(GeneratedField::NodeId), - "debugInfo" | "debug_info" => Ok(GeneratedField::DebugInfo), - "agentProtocol" | "agent_protocol" => Ok(GeneratedField::AgentProtocol), + "speakerUpdate" | "speaker_update" => Ok(GeneratedField::SpeakerUpdate), + "nodeFailure" | "node_failure" => Ok(GeneratedField::NodeFailure), + "migration" => Ok(GeneratedField::Migration), + "serverLeave" | "server_leave" => Ok(GeneratedField::ServerLeave), + "switchCandidateProtocol" | "switch_candidate_protocol" => Ok(GeneratedField::SwitchCandidateProtocol), + "subscriberBandwidth" | "subscriber_bandwidth" => Ok(GeneratedField::SubscriberBandwidth), + "disconnectSignalOnResume" | "disconnect_signal_on_resume" => Ok(GeneratedField::DisconnectSignalOnResume), + "disconnectSignalOnResumeNoMessages" | "disconnect_signal_on_resume_no_messages" => Ok(GeneratedField::DisconnectSignalOnResumeNoMessages), + "leaveRequestFullReconnect" | "leave_request_full_reconnect" => Ok(GeneratedField::LeaveRequestFullReconnect), _ => Ok(GeneratedField::__SkipField__), } } @@ -18860,162 +23260,199 @@ impl<'de> serde::Deserialize<'de> for ServerInfo { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ServerInfo; + type Value = SimulateScenario; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ServerInfo") + formatter.write_str("struct livekit.SimulateScenario") } - 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 edition__ = None; - let mut version__ = None; - let mut protocol__ = None; - let mut region__ = None; - let mut node_id__ = None; - let mut debug_info__ = None; - let mut agent_protocol__ = None; + let mut scenario__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Edition => { - if edition__.is_some() { - return Err(serde::de::Error::duplicate_field("edition")); + GeneratedField::SpeakerUpdate => { + if scenario__.is_some() { + return Err(serde::de::Error::duplicate_field("speakerUpdate")); } - edition__ = Some(map_.next_value::()? as i32); + scenario__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| simulate_scenario::Scenario::SpeakerUpdate(x.0)); } - GeneratedField::Version => { - if version__.is_some() { - return Err(serde::de::Error::duplicate_field("version")); + GeneratedField::NodeFailure => { + if scenario__.is_some() { + return Err(serde::de::Error::duplicate_field("nodeFailure")); } - version__ = Some(map_.next_value()?); + scenario__ = map_.next_value::<::std::option::Option<_>>()?.map(simulate_scenario::Scenario::NodeFailure); } - GeneratedField::Protocol => { - if protocol__.is_some() { - return Err(serde::de::Error::duplicate_field("protocol")); + GeneratedField::Migration => { + if scenario__.is_some() { + return Err(serde::de::Error::duplicate_field("migration")); } - protocol__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + scenario__ = map_.next_value::<::std::option::Option<_>>()?.map(simulate_scenario::Scenario::Migration); } - GeneratedField::Region => { - if region__.is_some() { - return Err(serde::de::Error::duplicate_field("region")); + GeneratedField::ServerLeave => { + if scenario__.is_some() { + return Err(serde::de::Error::duplicate_field("serverLeave")); } - region__ = Some(map_.next_value()?); + scenario__ = map_.next_value::<::std::option::Option<_>>()?.map(simulate_scenario::Scenario::ServerLeave); } - GeneratedField::NodeId => { - if node_id__.is_some() { - return Err(serde::de::Error::duplicate_field("nodeId")); + GeneratedField::SwitchCandidateProtocol => { + if scenario__.is_some() { + return Err(serde::de::Error::duplicate_field("switchCandidateProtocol")); } - node_id__ = Some(map_.next_value()?); + scenario__ = map_.next_value::<::std::option::Option>()?.map(|x| simulate_scenario::Scenario::SwitchCandidateProtocol(x as i32)); } - GeneratedField::DebugInfo => { - if debug_info__.is_some() { - return Err(serde::de::Error::duplicate_field("debugInfo")); + GeneratedField::SubscriberBandwidth => { + if scenario__.is_some() { + return Err(serde::de::Error::duplicate_field("subscriberBandwidth")); } - debug_info__ = Some(map_.next_value()?); + scenario__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| simulate_scenario::Scenario::SubscriberBandwidth(x.0)); } - GeneratedField::AgentProtocol => { - if agent_protocol__.is_some() { - return Err(serde::de::Error::duplicate_field("agentProtocol")); + GeneratedField::DisconnectSignalOnResume => { + if scenario__.is_some() { + return Err(serde::de::Error::duplicate_field("disconnectSignalOnResume")); } - agent_protocol__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + scenario__ = map_.next_value::<::std::option::Option<_>>()?.map(simulate_scenario::Scenario::DisconnectSignalOnResume); + } + GeneratedField::DisconnectSignalOnResumeNoMessages => { + if scenario__.is_some() { + return Err(serde::de::Error::duplicate_field("disconnectSignalOnResumeNoMessages")); + } + scenario__ = map_.next_value::<::std::option::Option<_>>()?.map(simulate_scenario::Scenario::DisconnectSignalOnResumeNoMessages); + } + GeneratedField::LeaveRequestFullReconnect => { + if scenario__.is_some() { + return Err(serde::de::Error::duplicate_field("leaveRequestFullReconnect")); + } + scenario__ = map_.next_value::<::std::option::Option<_>>()?.map(simulate_scenario::Scenario::LeaveRequestFullReconnect); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(ServerInfo { - edition: edition__.unwrap_or_default(), - version: version__.unwrap_or_default(), - protocol: protocol__.unwrap_or_default(), - region: region__.unwrap_or_default(), - node_id: node_id__.unwrap_or_default(), - debug_info: debug_info__.unwrap_or_default(), - agent_protocol: agent_protocol__.unwrap_or_default(), + Ok(SimulateScenario { + scenario: scenario__, }) } } - deserializer.deserialize_struct("livekit.ServerInfo", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.SimulateScenario", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for server_info::Edition { +impl serde::Serialize for SimulcastCodec { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { - let variant = match self { - Self::Standard => "Standard", - Self::Cloud => "Cloud", - }; - serializer.serialize_str(variant) + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.codec.is_empty() { + len += 1; + } + if !self.cid.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.SimulcastCodec", len)?; + if !self.codec.is_empty() { + struct_ser.serialize_field("codec", &self.codec)?; + } + if !self.cid.is_empty() { + struct_ser.serialize_field("cid", &self.cid)?; + } + struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for server_info::Edition { +impl<'de> serde::Deserialize<'de> for SimulcastCodec { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "Standard", - "Cloud", + "codec", + "cid", ]; - struct GeneratedVisitor; + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Codec, + Cid, + __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 = server_info::Edition; + 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 { + "codec" => Ok(GeneratedField::Codec), + "cid" => Ok(GeneratedField::Cid), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SimulcastCodec; - 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.SimulcastCodec") } - 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 { - "Standard" => Ok(server_info::Edition::Standard), - "Cloud" => Ok(server_info::Edition::Cloud), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + let mut codec__ = None; + let mut cid__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Codec => { + if codec__.is_some() { + return Err(serde::de::Error::duplicate_field("codec")); + } + codec__ = Some(map_.next_value()?); + } + GeneratedField::Cid => { + if cid__.is_some() { + return Err(serde::de::Error::duplicate_field("cid")); + } + cid__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } } + Ok(SimulcastCodec { + codec: codec__.unwrap_or_default(), + cid: cid__.unwrap_or_default(), + }) } } - deserializer.deserialize_any(GeneratedVisitor) + deserializer.deserialize_struct("livekit.SimulcastCodec", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for SessionDescription { +impl serde::Serialize for SimulcastCodecInfo { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -19023,37 +23460,54 @@ impl serde::Serialize for SessionDescription { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.r#type.is_empty() { + if !self.mime_type.is_empty() { len += 1; } - if !self.sdp.is_empty() { + if !self.mid.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.SessionDescription", len)?; - if !self.r#type.is_empty() { - struct_ser.serialize_field("type", &self.r#type)?; + if !self.cid.is_empty() { + len += 1; } - if !self.sdp.is_empty() { - struct_ser.serialize_field("sdp", &self.sdp)?; + if !self.layers.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.SimulcastCodecInfo", len)?; + if !self.mime_type.is_empty() { + struct_ser.serialize_field("mimeType", &self.mime_type)?; + } + if !self.mid.is_empty() { + struct_ser.serialize_field("mid", &self.mid)?; + } + if !self.cid.is_empty() { + struct_ser.serialize_field("cid", &self.cid)?; + } + if !self.layers.is_empty() { + struct_ser.serialize_field("layers", &self.layers)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for SessionDescription { +impl<'de> serde::Deserialize<'de> for SimulcastCodecInfo { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "type", - "sdp", + "mime_type", + "mimeType", + "mid", + "cid", + "layers", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Type, - Sdp, + MimeType, + Mid, + Cid, + Layers, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -19076,8 +23530,10 @@ impl<'de> serde::Deserialize<'de> for SessionDescription { E: serde::de::Error, { match value { - "type" => Ok(GeneratedField::Type), - "sdp" => Ok(GeneratedField::Sdp), + "mimeType" | "mime_type" => Ok(GeneratedField::MimeType), + "mid" => Ok(GeneratedField::Mid), + "cid" => Ok(GeneratedField::Cid), + "layers" => Ok(GeneratedField::Layers), _ => Ok(GeneratedField::__SkipField__), } } @@ -19087,47 +23543,63 @@ impl<'de> serde::Deserialize<'de> for SessionDescription { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SessionDescription; + type Value = SimulcastCodecInfo; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SessionDescription") + formatter.write_str("struct livekit.SimulcastCodecInfo") } - 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 sdp__ = None; + let mut mime_type__ = None; + let mut mid__ = None; + let mut cid__ = None; + let mut layers__ = 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::MimeType => { + if mime_type__.is_some() { + return Err(serde::de::Error::duplicate_field("mimeType")); } - r#type__ = Some(map_.next_value()?); + mime_type__ = Some(map_.next_value()?); } - GeneratedField::Sdp => { - if sdp__.is_some() { - return Err(serde::de::Error::duplicate_field("sdp")); + GeneratedField::Mid => { + if mid__.is_some() { + return Err(serde::de::Error::duplicate_field("mid")); } - sdp__ = Some(map_.next_value()?); + mid__ = Some(map_.next_value()?); + } + GeneratedField::Cid => { + if cid__.is_some() { + return Err(serde::de::Error::duplicate_field("cid")); + } + cid__ = Some(map_.next_value()?); + } + GeneratedField::Layers => { + if layers__.is_some() { + return Err(serde::de::Error::duplicate_field("layers")); + } + layers__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(SessionDescription { - r#type: r#type__.unwrap_or_default(), - sdp: sdp__.unwrap_or_default(), + Ok(SimulcastCodecInfo { + mime_type: mime_type__.unwrap_or_default(), + mid: mid__.unwrap_or_default(), + cid: cid__.unwrap_or_default(), + layers: layers__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.SessionDescription", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.SimulcastCodecInfo", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for SignalRequest { +impl serde::Serialize for SipDtmf { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -19135,123 +23607,37 @@ impl serde::Serialize for SignalRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if self.message.is_some() { + if self.code != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.SignalRequest", len)?; - if let Some(v) = self.message.as_ref() { - match v { - signal_request::Message::Offer(v) => { - struct_ser.serialize_field("offer", v)?; - } - signal_request::Message::Answer(v) => { - struct_ser.serialize_field("answer", v)?; - } - signal_request::Message::Trickle(v) => { - struct_ser.serialize_field("trickle", v)?; - } - signal_request::Message::AddTrack(v) => { - struct_ser.serialize_field("addTrack", v)?; - } - signal_request::Message::Mute(v) => { - struct_ser.serialize_field("mute", v)?; - } - signal_request::Message::Subscription(v) => { - struct_ser.serialize_field("subscription", v)?; - } - signal_request::Message::TrackSetting(v) => { - struct_ser.serialize_field("trackSetting", v)?; - } - signal_request::Message::Leave(v) => { - struct_ser.serialize_field("leave", v)?; - } - signal_request::Message::UpdateLayers(v) => { - struct_ser.serialize_field("updateLayers", v)?; - } - signal_request::Message::SubscriptionPermission(v) => { - struct_ser.serialize_field("subscriptionPermission", v)?; - } - signal_request::Message::SyncState(v) => { - struct_ser.serialize_field("syncState", v)?; - } - signal_request::Message::Simulate(v) => { - struct_ser.serialize_field("simulate", v)?; - } - signal_request::Message::Ping(v) => { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("ping", ToString::to_string(&v).as_str())?; - } - signal_request::Message::UpdateMetadata(v) => { - struct_ser.serialize_field("updateMetadata", v)?; - } - signal_request::Message::PingReq(v) => { - struct_ser.serialize_field("pingReq", v)?; - } - signal_request::Message::UpdateAudioTrack(v) => { - struct_ser.serialize_field("updateAudioTrack", v)?; - } - signal_request::Message::UpdateVideoTrack(v) => { - struct_ser.serialize_field("updateVideoTrack", v)?; - } - } + if !self.digit.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.SipDTMF", len)?; + if self.code != 0 { + struct_ser.serialize_field("code", &self.code)?; + } + if !self.digit.is_empty() { + struct_ser.serialize_field("digit", &self.digit)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for SignalRequest { +impl<'de> serde::Deserialize<'de> for SipDtmf { #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "offer", - "answer", - "trickle", - "add_track", - "addTrack", - "mute", - "subscription", - "track_setting", - "trackSetting", - "leave", - "update_layers", - "updateLayers", - "subscription_permission", - "subscriptionPermission", - "sync_state", - "syncState", - "simulate", - "ping", - "update_metadata", - "updateMetadata", - "ping_req", - "pingReq", - "update_audio_track", - "updateAudioTrack", - "update_video_track", - "updateVideoTrack", + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "code", + "digit", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Offer, - Answer, - Trickle, - AddTrack, - Mute, - Subscription, - TrackSetting, - Leave, - UpdateLayers, - SubscriptionPermission, - SyncState, - Simulate, - Ping, - UpdateMetadata, - PingReq, - UpdateAudioTrack, - UpdateVideoTrack, + Code, + Digit, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -19274,23 +23660,8 @@ impl<'de> serde::Deserialize<'de> for SignalRequest { E: serde::de::Error, { match value { - "offer" => Ok(GeneratedField::Offer), - "answer" => Ok(GeneratedField::Answer), - "trickle" => Ok(GeneratedField::Trickle), - "addTrack" | "add_track" => Ok(GeneratedField::AddTrack), - "mute" => Ok(GeneratedField::Mute), - "subscription" => Ok(GeneratedField::Subscription), - "trackSetting" | "track_setting" => Ok(GeneratedField::TrackSetting), - "leave" => Ok(GeneratedField::Leave), - "updateLayers" | "update_layers" => Ok(GeneratedField::UpdateLayers), - "subscriptionPermission" | "subscription_permission" => Ok(GeneratedField::SubscriptionPermission), - "syncState" | "sync_state" => Ok(GeneratedField::SyncState), - "simulate" => Ok(GeneratedField::Simulate), - "ping" => Ok(GeneratedField::Ping), - "updateMetadata" | "update_metadata" => Ok(GeneratedField::UpdateMetadata), - "pingReq" | "ping_req" => Ok(GeneratedField::PingReq), - "updateAudioTrack" | "update_audio_track" => Ok(GeneratedField::UpdateAudioTrack), - "updateVideoTrack" | "update_video_track" => Ok(GeneratedField::UpdateVideoTrack), + "code" => Ok(GeneratedField::Code), + "digit" => Ok(GeneratedField::Digit), _ => Ok(GeneratedField::__SkipField__), } } @@ -19300,151 +23671,49 @@ impl<'de> serde::Deserialize<'de> for SignalRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SignalRequest; + type Value = SipDtmf; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SignalRequest") + formatter.write_str("struct livekit.SipDTMF") } - 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 message__ = None; + let mut code__ = None; + let mut digit__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Offer => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("offer")); - } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::Offer) -; - } - GeneratedField::Answer => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("answer")); - } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::Answer) -; - } - GeneratedField::Trickle => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("trickle")); - } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::Trickle) -; - } - GeneratedField::AddTrack => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("addTrack")); - } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::AddTrack) -; - } - GeneratedField::Mute => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("mute")); - } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::Mute) -; - } - GeneratedField::Subscription => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("subscription")); - } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::Subscription) -; - } - GeneratedField::TrackSetting => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("trackSetting")); - } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::TrackSetting) -; - } - GeneratedField::Leave => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("leave")); - } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::Leave) -; - } - GeneratedField::UpdateLayers => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("updateLayers")); - } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::UpdateLayers) -; - } - GeneratedField::SubscriptionPermission => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("subscriptionPermission")); - } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::SubscriptionPermission) -; - } - GeneratedField::SyncState => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("syncState")); - } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::SyncState) -; - } - GeneratedField::Simulate => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("simulate")); - } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::Simulate) -; - } - GeneratedField::Ping => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("ping")); - } - message__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| signal_request::Message::Ping(x.0)); - } - GeneratedField::UpdateMetadata => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("updateMetadata")); - } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::UpdateMetadata) -; - } - GeneratedField::PingReq => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("pingReq")); - } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::PingReq) -; - } - GeneratedField::UpdateAudioTrack => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("updateAudioTrack")); + GeneratedField::Code => { + if code__.is_some() { + return Err(serde::de::Error::duplicate_field("code")); } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::UpdateAudioTrack) -; + code__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } - GeneratedField::UpdateVideoTrack => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("updateVideoTrack")); + GeneratedField::Digit => { + if digit__.is_some() { + return Err(serde::de::Error::duplicate_field("digit")); } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_request::Message::UpdateVideoTrack) -; + digit__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(SignalRequest { - message: message__, + Ok(SipDtmf { + code: code__.unwrap_or_default(), + digit: digit__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.SignalRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.SipDTMF", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for SignalResponse { +impl serde::Serialize for SpeakerInfo { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -19452,140 +23721,45 @@ impl serde::Serialize for SignalResponse { { use serde::ser::SerializeStruct; let mut len = 0; - if self.message.is_some() { + if !self.sid.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.SignalResponse", len)?; - if let Some(v) = self.message.as_ref() { - match v { - signal_response::Message::Join(v) => { - struct_ser.serialize_field("join", v)?; - } - signal_response::Message::Answer(v) => { - struct_ser.serialize_field("answer", v)?; - } - signal_response::Message::Offer(v) => { - struct_ser.serialize_field("offer", v)?; - } - signal_response::Message::Trickle(v) => { - struct_ser.serialize_field("trickle", v)?; - } - signal_response::Message::Update(v) => { - struct_ser.serialize_field("update", v)?; - } - signal_response::Message::TrackPublished(v) => { - struct_ser.serialize_field("trackPublished", v)?; - } - signal_response::Message::Leave(v) => { - struct_ser.serialize_field("leave", v)?; - } - signal_response::Message::Mute(v) => { - struct_ser.serialize_field("mute", v)?; - } - signal_response::Message::SpeakersChanged(v) => { - struct_ser.serialize_field("speakersChanged", v)?; - } - signal_response::Message::RoomUpdate(v) => { - struct_ser.serialize_field("roomUpdate", v)?; - } - signal_response::Message::ConnectionQuality(v) => { - struct_ser.serialize_field("connectionQuality", v)?; - } - signal_response::Message::StreamStateUpdate(v) => { - struct_ser.serialize_field("streamStateUpdate", v)?; - } - signal_response::Message::SubscribedQualityUpdate(v) => { - struct_ser.serialize_field("subscribedQualityUpdate", v)?; - } - signal_response::Message::SubscriptionPermissionUpdate(v) => { - struct_ser.serialize_field("subscriptionPermissionUpdate", v)?; - } - signal_response::Message::RefreshToken(v) => { - struct_ser.serialize_field("refreshToken", v)?; - } - signal_response::Message::TrackUnpublished(v) => { - struct_ser.serialize_field("trackUnpublished", v)?; - } - signal_response::Message::Pong(v) => { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("pong", ToString::to_string(&v).as_str())?; - } - signal_response::Message::Reconnect(v) => { - struct_ser.serialize_field("reconnect", v)?; - } - signal_response::Message::PongResp(v) => { - struct_ser.serialize_field("pongResp", v)?; - } - signal_response::Message::SubscriptionResponse(v) => { - struct_ser.serialize_field("subscriptionResponse", v)?; - } - } + if self.level != 0. { + len += 1; + } + if self.active { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.SpeakerInfo", len)?; + if !self.sid.is_empty() { + struct_ser.serialize_field("sid", &self.sid)?; + } + if self.level != 0. { + struct_ser.serialize_field("level", &self.level)?; + } + if self.active { + struct_ser.serialize_field("active", &self.active)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for SignalResponse { +impl<'de> serde::Deserialize<'de> for SpeakerInfo { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "join", - "answer", - "offer", - "trickle", - "update", - "track_published", - "trackPublished", - "leave", - "mute", - "speakers_changed", - "speakersChanged", - "room_update", - "roomUpdate", - "connection_quality", - "connectionQuality", - "stream_state_update", - "streamStateUpdate", - "subscribed_quality_update", - "subscribedQualityUpdate", - "subscription_permission_update", - "subscriptionPermissionUpdate", - "refresh_token", - "refreshToken", - "track_unpublished", - "trackUnpublished", - "pong", - "reconnect", - "pong_resp", - "pongResp", - "subscription_response", - "subscriptionResponse", + "sid", + "level", + "active", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Join, - Answer, - Offer, - Trickle, - Update, - TrackPublished, - Leave, - Mute, - SpeakersChanged, - RoomUpdate, - ConnectionQuality, - StreamStateUpdate, - SubscribedQualityUpdate, - SubscriptionPermissionUpdate, - RefreshToken, - TrackUnpublished, - Pong, - Reconnect, - PongResp, - SubscriptionResponse, + Sid, + Level, + Active, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -19608,26 +23782,9 @@ impl<'de> serde::Deserialize<'de> for SignalResponse { E: serde::de::Error, { match value { - "join" => Ok(GeneratedField::Join), - "answer" => Ok(GeneratedField::Answer), - "offer" => Ok(GeneratedField::Offer), - "trickle" => Ok(GeneratedField::Trickle), - "update" => Ok(GeneratedField::Update), - "trackPublished" | "track_published" => Ok(GeneratedField::TrackPublished), - "leave" => Ok(GeneratedField::Leave), - "mute" => Ok(GeneratedField::Mute), - "speakersChanged" | "speakers_changed" => Ok(GeneratedField::SpeakersChanged), - "roomUpdate" | "room_update" => Ok(GeneratedField::RoomUpdate), - "connectionQuality" | "connection_quality" => Ok(GeneratedField::ConnectionQuality), - "streamStateUpdate" | "stream_state_update" => Ok(GeneratedField::StreamStateUpdate), - "subscribedQualityUpdate" | "subscribed_quality_update" => Ok(GeneratedField::SubscribedQualityUpdate), - "subscriptionPermissionUpdate" | "subscription_permission_update" => Ok(GeneratedField::SubscriptionPermissionUpdate), - "refreshToken" | "refresh_token" => Ok(GeneratedField::RefreshToken), - "trackUnpublished" | "track_unpublished" => Ok(GeneratedField::TrackUnpublished), - "pong" => Ok(GeneratedField::Pong), - "reconnect" => Ok(GeneratedField::Reconnect), - "pongResp" | "pong_resp" => Ok(GeneratedField::PongResp), - "subscriptionResponse" | "subscription_response" => Ok(GeneratedField::SubscriptionResponse), + "sid" => Ok(GeneratedField::Sid), + "level" => Ok(GeneratedField::Level), + "active" => Ok(GeneratedField::Active), _ => Ok(GeneratedField::__SkipField__), } } @@ -19637,242 +23794,152 @@ impl<'de> serde::Deserialize<'de> for SignalResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SignalResponse; + type Value = SpeakerInfo; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SignalResponse") + formatter.write_str("struct livekit.SpeakerInfo") } - 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 message__ = None; + let mut sid__ = None; + let mut level__ = None; + let mut active__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Join => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("join")); - } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Join) -; - } - GeneratedField::Answer => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("answer")); - } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Answer) -; - } - GeneratedField::Offer => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("offer")); - } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Offer) -; - } - GeneratedField::Trickle => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("trickle")); - } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Trickle) -; - } - GeneratedField::Update => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("update")); - } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Update) -; - } - GeneratedField::TrackPublished => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("trackPublished")); - } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::TrackPublished) -; - } - GeneratedField::Leave => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("leave")); - } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Leave) -; - } - GeneratedField::Mute => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("mute")); - } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Mute) -; - } - GeneratedField::SpeakersChanged => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("speakersChanged")); - } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::SpeakersChanged) -; - } - GeneratedField::RoomUpdate => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("roomUpdate")); - } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::RoomUpdate) -; - } - GeneratedField::ConnectionQuality => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("connectionQuality")); - } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::ConnectionQuality) -; - } - GeneratedField::StreamStateUpdate => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("streamStateUpdate")); - } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::StreamStateUpdate) -; - } - GeneratedField::SubscribedQualityUpdate => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("subscribedQualityUpdate")); - } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::SubscribedQualityUpdate) -; - } - GeneratedField::SubscriptionPermissionUpdate => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("subscriptionPermissionUpdate")); - } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::SubscriptionPermissionUpdate) -; - } - GeneratedField::RefreshToken => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("refreshToken")); - } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::RefreshToken); - } - GeneratedField::TrackUnpublished => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("trackUnpublished")); - } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::TrackUnpublished) -; - } - GeneratedField::Pong => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("pong")); - } - message__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| signal_response::Message::Pong(x.0)); - } - GeneratedField::Reconnect => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("reconnect")); + GeneratedField::Sid => { + if sid__.is_some() { + return Err(serde::de::Error::duplicate_field("sid")); } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::Reconnect) -; + sid__ = Some(map_.next_value()?); } - GeneratedField::PongResp => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("pongResp")); + GeneratedField::Level => { + if level__.is_some() { + return Err(serde::de::Error::duplicate_field("level")); } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::PongResp) -; + level__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } - GeneratedField::SubscriptionResponse => { - if message__.is_some() { - return Err(serde::de::Error::duplicate_field("subscriptionResponse")); + GeneratedField::Active => { + if active__.is_some() { + return Err(serde::de::Error::duplicate_field("active")); } - message__ = map_.next_value::<::std::option::Option<_>>()?.map(signal_response::Message::SubscriptionResponse) -; + active__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(SignalResponse { - message: message__, + Ok(SpeakerInfo { + sid: sid__.unwrap_or_default(), + level: level__.unwrap_or_default(), + active: active__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.SignalResponse", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.SpeakerInfo", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for SignalTarget { +impl serde::Serialize for SpeakersChanged { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { - let variant = match self { - Self::Publisher => "PUBLISHER", - Self::Subscriber => "SUBSCRIBER", - }; - serializer.serialize_str(variant) + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.speakers.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.SpeakersChanged", len)?; + if !self.speakers.is_empty() { + struct_ser.serialize_field("speakers", &self.speakers)?; + } + struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for SignalTarget { +impl<'de> serde::Deserialize<'de> for SpeakersChanged { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "PUBLISHER", - "SUBSCRIBER", + "speakers", ]; - struct GeneratedVisitor; + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Speakers, + __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 = SignalTarget; + 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 { + "speakers" => Ok(GeneratedField::Speakers), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SpeakersChanged; - fn 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.SpeakersChanged") } - 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 { - "PUBLISHER" => Ok(SignalTarget::Publisher), - "SUBSCRIBER" => Ok(SignalTarget::Subscriber), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + let mut speakers__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Speakers => { + if speakers__.is_some() { + return Err(serde::de::Error::duplicate_field("speakers")); + } + speakers__ = Some(map_.next_value()?); + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } } + Ok(SpeakersChanged { + speakers: speakers__.unwrap_or_default(), + }) } } - deserializer.deserialize_any(GeneratedVisitor) + deserializer.deserialize_struct("livekit.SpeakersChanged", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for SimulateScenario { +impl serde::Serialize for StopEgressRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -19880,84 +23947,30 @@ impl serde::Serialize for SimulateScenario { { use serde::ser::SerializeStruct; let mut len = 0; - if self.scenario.is_some() { + if !self.egress_id.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.SimulateScenario", len)?; - if let Some(v) = self.scenario.as_ref() { - match v { - simulate_scenario::Scenario::SpeakerUpdate(v) => { - struct_ser.serialize_field("speakerUpdate", v)?; - } - simulate_scenario::Scenario::NodeFailure(v) => { - struct_ser.serialize_field("nodeFailure", v)?; - } - simulate_scenario::Scenario::Migration(v) => { - struct_ser.serialize_field("migration", v)?; - } - simulate_scenario::Scenario::ServerLeave(v) => { - struct_ser.serialize_field("serverLeave", v)?; - } - simulate_scenario::Scenario::SwitchCandidateProtocol(v) => { - let v = CandidateProtocol::try_from(*v) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; - struct_ser.serialize_field("switchCandidateProtocol", &v)?; - } - simulate_scenario::Scenario::SubscriberBandwidth(v) => { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("subscriberBandwidth", ToString::to_string(&v).as_str())?; - } - simulate_scenario::Scenario::DisconnectSignalOnResume(v) => { - struct_ser.serialize_field("disconnectSignalOnResume", v)?; - } - simulate_scenario::Scenario::DisconnectSignalOnResumeNoMessages(v) => { - struct_ser.serialize_field("disconnectSignalOnResumeNoMessages", v)?; - } - simulate_scenario::Scenario::LeaveRequestFullReconnect(v) => { - struct_ser.serialize_field("leaveRequestFullReconnect", v)?; - } - } + let mut struct_ser = serializer.serialize_struct("livekit.StopEgressRequest", len)?; + if !self.egress_id.is_empty() { + struct_ser.serialize_field("egressId", &self.egress_id)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for SimulateScenario { +impl<'de> serde::Deserialize<'de> for StopEgressRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "speaker_update", - "speakerUpdate", - "node_failure", - "nodeFailure", - "migration", - "server_leave", - "serverLeave", - "switch_candidate_protocol", - "switchCandidateProtocol", - "subscriber_bandwidth", - "subscriberBandwidth", - "disconnect_signal_on_resume", - "disconnectSignalOnResume", - "disconnect_signal_on_resume_no_messages", - "disconnectSignalOnResumeNoMessages", - "leave_request_full_reconnect", - "leaveRequestFullReconnect", + "egress_id", + "egressId", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - SpeakerUpdate, - NodeFailure, - Migration, - ServerLeave, - SwitchCandidateProtocol, - SubscriberBandwidth, - DisconnectSignalOnResume, - DisconnectSignalOnResumeNoMessages, - LeaveRequestFullReconnect, + EgressId, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -19980,15 +23993,7 @@ impl<'de> serde::Deserialize<'de> for SimulateScenario { E: serde::de::Error, { match value { - "speakerUpdate" | "speaker_update" => Ok(GeneratedField::SpeakerUpdate), - "nodeFailure" | "node_failure" => Ok(GeneratedField::NodeFailure), - "migration" => Ok(GeneratedField::Migration), - "serverLeave" | "server_leave" => Ok(GeneratedField::ServerLeave), - "switchCandidateProtocol" | "switch_candidate_protocol" => Ok(GeneratedField::SwitchCandidateProtocol), - "subscriberBandwidth" | "subscriber_bandwidth" => Ok(GeneratedField::SubscriberBandwidth), - "disconnectSignalOnResume" | "disconnect_signal_on_resume" => Ok(GeneratedField::DisconnectSignalOnResume), - "disconnectSignalOnResumeNoMessages" | "disconnect_signal_on_resume_no_messages" => Ok(GeneratedField::DisconnectSignalOnResumeNoMessages), - "leaveRequestFullReconnect" | "leave_request_full_reconnect" => Ok(GeneratedField::LeaveRequestFullReconnect), + "egressId" | "egress_id" => Ok(GeneratedField::EgressId), _ => Ok(GeneratedField::__SkipField__), } } @@ -19998,87 +24003,39 @@ impl<'de> serde::Deserialize<'de> for SimulateScenario { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SimulateScenario; + type Value = StopEgressRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SimulateScenario") + formatter.write_str("struct livekit.StopEgressRequest") } - 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 scenario__ = None; + let mut egress_id__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::SpeakerUpdate => { - if scenario__.is_some() { - return Err(serde::de::Error::duplicate_field("speakerUpdate")); - } - scenario__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| simulate_scenario::Scenario::SpeakerUpdate(x.0)); - } - GeneratedField::NodeFailure => { - if scenario__.is_some() { - return Err(serde::de::Error::duplicate_field("nodeFailure")); - } - scenario__ = map_.next_value::<::std::option::Option<_>>()?.map(simulate_scenario::Scenario::NodeFailure); - } - GeneratedField::Migration => { - if scenario__.is_some() { - return Err(serde::de::Error::duplicate_field("migration")); - } - scenario__ = map_.next_value::<::std::option::Option<_>>()?.map(simulate_scenario::Scenario::Migration); - } - GeneratedField::ServerLeave => { - if scenario__.is_some() { - return Err(serde::de::Error::duplicate_field("serverLeave")); - } - scenario__ = map_.next_value::<::std::option::Option<_>>()?.map(simulate_scenario::Scenario::ServerLeave); - } - GeneratedField::SwitchCandidateProtocol => { - if scenario__.is_some() { - return Err(serde::de::Error::duplicate_field("switchCandidateProtocol")); - } - scenario__ = map_.next_value::<::std::option::Option>()?.map(|x| simulate_scenario::Scenario::SwitchCandidateProtocol(x as i32)); - } - GeneratedField::SubscriberBandwidth => { - if scenario__.is_some() { - return Err(serde::de::Error::duplicate_field("subscriberBandwidth")); - } - scenario__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| simulate_scenario::Scenario::SubscriberBandwidth(x.0)); - } - GeneratedField::DisconnectSignalOnResume => { - if scenario__.is_some() { - return Err(serde::de::Error::duplicate_field("disconnectSignalOnResume")); - } - scenario__ = map_.next_value::<::std::option::Option<_>>()?.map(simulate_scenario::Scenario::DisconnectSignalOnResume); - } - GeneratedField::DisconnectSignalOnResumeNoMessages => { - if scenario__.is_some() { - return Err(serde::de::Error::duplicate_field("disconnectSignalOnResumeNoMessages")); - } - scenario__ = map_.next_value::<::std::option::Option<_>>()?.map(simulate_scenario::Scenario::DisconnectSignalOnResumeNoMessages); - } - GeneratedField::LeaveRequestFullReconnect => { - if scenario__.is_some() { - return Err(serde::de::Error::duplicate_field("leaveRequestFullReconnect")); + GeneratedField::EgressId => { + if egress_id__.is_some() { + return Err(serde::de::Error::duplicate_field("egressId")); } - scenario__ = map_.next_value::<::std::option::Option<_>>()?.map(simulate_scenario::Scenario::LeaveRequestFullReconnect); + egress_id__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(SimulateScenario { - scenario: scenario__, + Ok(StopEgressRequest { + egress_id: egress_id__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.SimulateScenario", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.StopEgressRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for SimulcastCodec { +impl serde::Serialize for StreamInfo { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -20086,37 +24043,76 @@ impl serde::Serialize for SimulcastCodec { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.codec.is_empty() { + if !self.url.is_empty() { len += 1; } - if !self.cid.is_empty() { + if self.started_at != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.SimulcastCodec", len)?; - if !self.codec.is_empty() { - struct_ser.serialize_field("codec", &self.codec)?; + if self.ended_at != 0 { + len += 1; } - if !self.cid.is_empty() { - struct_ser.serialize_field("cid", &self.cid)?; + if self.duration != 0 { + len += 1; + } + if self.status != 0 { + len += 1; + } + if !self.error.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.StreamInfo", len)?; + if !self.url.is_empty() { + struct_ser.serialize_field("url", &self.url)?; + } + if self.started_at != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("startedAt", ToString::to_string(&self.started_at).as_str())?; + } + if self.ended_at != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("endedAt", ToString::to_string(&self.ended_at).as_str())?; + } + if self.duration != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("duration", ToString::to_string(&self.duration).as_str())?; + } + if self.status != 0 { + let v = stream_info::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)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for SimulcastCodec { +impl<'de> serde::Deserialize<'de> for StreamInfo { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "codec", - "cid", + "url", + "started_at", + "startedAt", + "ended_at", + "endedAt", + "duration", + "status", + "error", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Codec, - Cid, + Url, + StartedAt, + EndedAt, + Duration, + Status, + Error, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -20139,8 +24135,12 @@ impl<'de> serde::Deserialize<'de> for SimulcastCodec { E: serde::de::Error, { match value { - "codec" => Ok(GeneratedField::Codec), - "cid" => Ok(GeneratedField::Cid), + "url" => Ok(GeneratedField::Url), + "startedAt" | "started_at" => Ok(GeneratedField::StartedAt), + "endedAt" | "ended_at" => Ok(GeneratedField::EndedAt), + "duration" => Ok(GeneratedField::Duration), + "status" => Ok(GeneratedField::Status), + "error" => Ok(GeneratedField::Error), _ => Ok(GeneratedField::__SkipField__), } } @@ -20150,47 +24150,159 @@ impl<'de> serde::Deserialize<'de> for SimulcastCodec { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SimulcastCodec; + type Value = StreamInfo; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SimulcastCodec") + formatter.write_str("struct livekit.StreamInfo") } - 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 codec__ = None; - let mut cid__ = None; + let mut url__ = None; + let mut started_at__ = None; + let mut ended_at__ = None; + let mut duration__ = None; + let mut status__ = None; + let mut error__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Codec => { - if codec__.is_some() { - return Err(serde::de::Error::duplicate_field("codec")); + GeneratedField::Url => { + if url__.is_some() { + return Err(serde::de::Error::duplicate_field("url")); } - codec__ = Some(map_.next_value()?); + url__ = Some(map_.next_value()?); } - GeneratedField::Cid => { - if cid__.is_some() { - return Err(serde::de::Error::duplicate_field("cid")); + GeneratedField::StartedAt => { + if started_at__.is_some() { + return Err(serde::de::Error::duplicate_field("startedAt")); } - cid__ = Some(map_.next_value()?); + 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::Duration => { + if duration__.is_some() { + return Err(serde::de::Error::duplicate_field("duration")); + } + duration__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + 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::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(SimulcastCodec { - codec: codec__.unwrap_or_default(), - cid: cid__.unwrap_or_default(), + Ok(StreamInfo { + url: url__.unwrap_or_default(), + started_at: started_at__.unwrap_or_default(), + ended_at: ended_at__.unwrap_or_default(), + duration: duration__.unwrap_or_default(), + status: status__.unwrap_or_default(), + error: error__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.SimulcastCodec", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.StreamInfo", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for SimulcastCodecInfo { +impl serde::Serialize for stream_info::Status { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Active => "ACTIVE", + Self::Finished => "FINISHED", + Self::Failed => "FAILED", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for stream_info::Status { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "ACTIVE", + "FINISHED", + "FAILED", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = stream_info::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 { + "ACTIVE" => Ok(stream_info::Status::Active), + "FINISHED" => Ok(stream_info::Status::Finished), + "FAILED" => Ok(stream_info::Status::Failed), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for StreamInfoList { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -20198,54 +24310,29 @@ impl serde::Serialize for SimulcastCodecInfo { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.mime_type.is_empty() { - len += 1; - } - if !self.mid.is_empty() { - len += 1; - } - if !self.cid.is_empty() { - len += 1; - } - if !self.layers.is_empty() { + if !self.info.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.SimulcastCodecInfo", len)?; - if !self.mime_type.is_empty() { - struct_ser.serialize_field("mimeType", &self.mime_type)?; - } - if !self.mid.is_empty() { - struct_ser.serialize_field("mid", &self.mid)?; - } - if !self.cid.is_empty() { - struct_ser.serialize_field("cid", &self.cid)?; - } - if !self.layers.is_empty() { - struct_ser.serialize_field("layers", &self.layers)?; + let mut struct_ser = serializer.serialize_struct("livekit.StreamInfoList", len)?; + if !self.info.is_empty() { + struct_ser.serialize_field("info", &self.info)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for SimulcastCodecInfo { +impl<'de> serde::Deserialize<'de> for StreamInfoList { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "mime_type", - "mimeType", - "mid", - "cid", - "layers", + "info", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - MimeType, - Mid, - Cid, - Layers, + Info, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -20268,10 +24355,7 @@ impl<'de> serde::Deserialize<'de> for SimulcastCodecInfo { E: serde::de::Error, { match value { - "mimeType" | "mime_type" => Ok(GeneratedField::MimeType), - "mid" => Ok(GeneratedField::Mid), - "cid" => Ok(GeneratedField::Cid), - "layers" => Ok(GeneratedField::Layers), + "info" => Ok(GeneratedField::Info), _ => Ok(GeneratedField::__SkipField__), } } @@ -20281,63 +24365,39 @@ impl<'de> serde::Deserialize<'de> for SimulcastCodecInfo { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SimulcastCodecInfo; + type Value = StreamInfoList; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SimulcastCodecInfo") + formatter.write_str("struct livekit.StreamInfoList") } - 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 mid__ = None; - let mut cid__ = None; - let mut layers__ = None; + let mut info__ = 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::Mid => { - if mid__.is_some() { - return Err(serde::de::Error::duplicate_field("mid")); - } - mid__ = Some(map_.next_value()?); - } - GeneratedField::Cid => { - if cid__.is_some() { - return Err(serde::de::Error::duplicate_field("cid")); - } - cid__ = Some(map_.next_value()?); - } - GeneratedField::Layers => { - if layers__.is_some() { - return Err(serde::de::Error::duplicate_field("layers")); + GeneratedField::Info => { + if info__.is_some() { + return Err(serde::de::Error::duplicate_field("info")); } - layers__ = Some(map_.next_value()?); + info__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(SimulcastCodecInfo { - mime_type: mime_type__.unwrap_or_default(), - mid: mid__.unwrap_or_default(), - cid: cid__.unwrap_or_default(), - layers: layers__.unwrap_or_default(), + Ok(StreamInfoList { + info: info__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.SimulcastCodecInfo", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.StreamInfoList", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for SipDtmf { +impl serde::Serialize for StreamOutput { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -20345,37 +24405,39 @@ impl serde::Serialize for SipDtmf { { use serde::ser::SerializeStruct; let mut len = 0; - if self.code != 0 { + if self.protocol != 0 { len += 1; } - if !self.digit.is_empty() { + if !self.urls.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.SipDTMF", len)?; - if self.code != 0 { - struct_ser.serialize_field("code", &self.code)?; + let mut struct_ser = serializer.serialize_struct("livekit.StreamOutput", len)?; + if self.protocol != 0 { + let v = StreamProtocol::try_from(self.protocol) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.protocol)))?; + struct_ser.serialize_field("protocol", &v)?; } - if !self.digit.is_empty() { - struct_ser.serialize_field("digit", &self.digit)?; + if !self.urls.is_empty() { + struct_ser.serialize_field("urls", &self.urls)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for SipDtmf { +impl<'de> serde::Deserialize<'de> for StreamOutput { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "code", - "digit", + "protocol", + "urls", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Code, - Digit, + Protocol, + Urls, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -20398,8 +24460,8 @@ impl<'de> serde::Deserialize<'de> for SipDtmf { E: serde::de::Error, { match value { - "code" => Ok(GeneratedField::Code), - "digit" => Ok(GeneratedField::Digit), + "protocol" => Ok(GeneratedField::Protocol), + "urls" => Ok(GeneratedField::Urls), _ => Ok(GeneratedField::__SkipField__), } } @@ -20409,180 +24471,189 @@ impl<'de> serde::Deserialize<'de> for SipDtmf { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SipDtmf; + type Value = StreamOutput; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SipDTMF") + formatter.write_str("struct livekit.StreamOutput") } - 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 code__ = None; - let mut digit__ = None; + let mut protocol__ = None; + let mut urls__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Code => { - if code__.is_some() { - return Err(serde::de::Error::duplicate_field("code")); + GeneratedField::Protocol => { + if protocol__.is_some() { + return Err(serde::de::Error::duplicate_field("protocol")); } - code__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + protocol__ = Some(map_.next_value::()? as i32); } - GeneratedField::Digit => { - if digit__.is_some() { - return Err(serde::de::Error::duplicate_field("digit")); + GeneratedField::Urls => { + if urls__.is_some() { + return Err(serde::de::Error::duplicate_field("urls")); } - digit__ = Some(map_.next_value()?); + urls__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(SipDtmf { - code: code__.unwrap_or_default(), - digit: digit__.unwrap_or_default(), + Ok(StreamOutput { + protocol: protocol__.unwrap_or_default(), + urls: urls__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.SipDTMF", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.StreamOutput", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for SpeakerInfo { +impl serde::Serialize for StreamProtocol { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.sid.is_empty() { - len += 1; - } - if self.level != 0. { - len += 1; - } - if self.active { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("livekit.SpeakerInfo", len)?; - if !self.sid.is_empty() { - struct_ser.serialize_field("sid", &self.sid)?; - } - if self.level != 0. { - struct_ser.serialize_field("level", &self.level)?; - } - if self.active { - struct_ser.serialize_field("active", &self.active)?; - } - struct_ser.end() + let variant = match self { + Self::DefaultProtocol => "DEFAULT_PROTOCOL", + Self::Rtmp => "RTMP", + }; + serializer.serialize_str(variant) } } -impl<'de> serde::Deserialize<'de> for SpeakerInfo { +impl<'de> serde::Deserialize<'de> for StreamProtocol { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "sid", - "level", - "active", + "DEFAULT_PROTOCOL", + "RTMP", ]; - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Sid, - Level, - Active, - __SkipField__, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = StreamProtocol; + + 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 - D: serde::Deserializer<'de>, + E: serde::de::Error, { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; + 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 expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } + 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) + }) + } - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "sid" => Ok(GeneratedField::Sid), - "level" => Ok(GeneratedField::Level), - "active" => Ok(GeneratedField::Active), - _ => Ok(GeneratedField::__SkipField__), - } - } + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "DEFAULT_PROTOCOL" => Ok(StreamProtocol::DefaultProtocol), + "RTMP" => Ok(StreamProtocol::Rtmp), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } - deserializer.deserialize_identifier(GeneratedVisitor) } } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for StreamState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Active => "ACTIVE", + Self::Paused => "PAUSED", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for StreamState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "ACTIVE", + "PAUSED", + ]; + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SpeakerInfo; + type Value = StreamState; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SpeakerInfo") + write!(formatter, "expected one of: {:?}", &FIELDS) } - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, + fn visit_i64(self, v: i64) -> std::result::Result + where + E: serde::de::Error, { - let mut sid__ = None; - let mut level__ = None; - let mut active__ = 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::Level => { - if level__.is_some() { - return Err(serde::de::Error::duplicate_field("level")); - } - level__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Active => { - if active__.is_some() { - return Err(serde::de::Error::duplicate_field("active")); - } - active__ = Some(map_.next_value()?); - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; - } - } + 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 { + "ACTIVE" => Ok(StreamState::Active), + "PAUSED" => Ok(StreamState::Paused), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } - Ok(SpeakerInfo { - sid: sid__.unwrap_or_default(), - level: level__.unwrap_or_default(), - active: active__.unwrap_or_default(), - }) } } - deserializer.deserialize_struct("livekit.SpeakerInfo", FIELDS, GeneratedVisitor) + deserializer.deserialize_any(GeneratedVisitor) } } -impl serde::Serialize for SpeakersChanged { +impl serde::Serialize for StreamStateInfo { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -20590,29 +24661,49 @@ impl serde::Serialize for SpeakersChanged { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.speakers.is_empty() { + if !self.participant_sid.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.SpeakersChanged", len)?; - if !self.speakers.is_empty() { - struct_ser.serialize_field("speakers", &self.speakers)?; + if !self.track_sid.is_empty() { + len += 1; + } + if self.state != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.StreamStateInfo", len)?; + if !self.participant_sid.is_empty() { + struct_ser.serialize_field("participantSid", &self.participant_sid)?; + } + if !self.track_sid.is_empty() { + struct_ser.serialize_field("trackSid", &self.track_sid)?; + } + if self.state != 0 { + let v = StreamState::try_from(self.state) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.state)))?; + struct_ser.serialize_field("state", &v)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for SpeakersChanged { +impl<'de> serde::Deserialize<'de> for StreamStateInfo { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "speakers", + "participant_sid", + "participantSid", + "track_sid", + "trackSid", + "state", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Speakers, + ParticipantSid, + TrackSid, + State, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -20635,7 +24726,9 @@ impl<'de> serde::Deserialize<'de> for SpeakersChanged { E: serde::de::Error, { match value { - "speakers" => Ok(GeneratedField::Speakers), + "participantSid" | "participant_sid" => Ok(GeneratedField::ParticipantSid), + "trackSid" | "track_sid" => Ok(GeneratedField::TrackSid), + "state" => Ok(GeneratedField::State), _ => Ok(GeneratedField::__SkipField__), } } @@ -20645,39 +24738,55 @@ impl<'de> serde::Deserialize<'de> for SpeakersChanged { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SpeakersChanged; + type Value = StreamStateInfo; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SpeakersChanged") + formatter.write_str("struct livekit.StreamStateInfo") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut speakers__ = None; + let mut participant_sid__ = None; + let mut track_sid__ = None; + let mut state__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Speakers => { - if speakers__.is_some() { - return Err(serde::de::Error::duplicate_field("speakers")); + GeneratedField::ParticipantSid => { + if participant_sid__.is_some() { + return Err(serde::de::Error::duplicate_field("participantSid")); } - speakers__ = Some(map_.next_value()?); + participant_sid__ = Some(map_.next_value()?); + } + GeneratedField::TrackSid => { + if track_sid__.is_some() { + return Err(serde::de::Error::duplicate_field("trackSid")); + } + track_sid__ = Some(map_.next_value()?); + } + GeneratedField::State => { + if state__.is_some() { + return Err(serde::de::Error::duplicate_field("state")); + } + state__ = Some(map_.next_value::()? as i32); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(SpeakersChanged { - speakers: speakers__.unwrap_or_default(), + Ok(StreamStateInfo { + participant_sid: participant_sid__.unwrap_or_default(), + track_sid: track_sid__.unwrap_or_default(), + state: state__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.SpeakersChanged", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.StreamStateInfo", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for StopEgressRequest { +impl serde::Serialize for StreamStateUpdate { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -20685,30 +24794,30 @@ impl serde::Serialize for StopEgressRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.egress_id.is_empty() { + if !self.stream_states.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.StopEgressRequest", len)?; - if !self.egress_id.is_empty() { - struct_ser.serialize_field("egressId", &self.egress_id)?; + let mut struct_ser = serializer.serialize_struct("livekit.StreamStateUpdate", len)?; + if !self.stream_states.is_empty() { + struct_ser.serialize_field("streamStates", &self.stream_states)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for StopEgressRequest { +impl<'de> serde::Deserialize<'de> for StreamStateUpdate { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "egress_id", - "egressId", + "stream_states", + "streamStates", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - EgressId, + StreamStates, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -20731,7 +24840,7 @@ impl<'de> serde::Deserialize<'de> for StopEgressRequest { E: serde::de::Error, { match value { - "egressId" | "egress_id" => Ok(GeneratedField::EgressId), + "streamStates" | "stream_states" => Ok(GeneratedField::StreamStates), _ => Ok(GeneratedField::__SkipField__), } } @@ -20741,39 +24850,39 @@ impl<'de> serde::Deserialize<'de> for StopEgressRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = StopEgressRequest; + type Value = StreamStateUpdate; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.StopEgressRequest") + formatter.write_str("struct livekit.StreamStateUpdate") } - 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 egress_id__ = None; + let mut stream_states__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::EgressId => { - if egress_id__.is_some() { - return Err(serde::de::Error::duplicate_field("egressId")); + GeneratedField::StreamStates => { + if stream_states__.is_some() { + return Err(serde::de::Error::duplicate_field("streamStates")); } - egress_id__ = Some(map_.next_value()?); + stream_states__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(StopEgressRequest { - egress_id: egress_id__.unwrap_or_default(), + Ok(StreamStateUpdate { + stream_states: stream_states__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.StopEgressRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.StreamStateUpdate", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for StreamInfo { +impl serde::Serialize for SubscribedCodec { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -20781,76 +24890,37 @@ impl serde::Serialize for StreamInfo { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.url.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.status != 0 { + if !self.codec.is_empty() { len += 1; } - if !self.error.is_empty() { + if !self.qualities.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.StreamInfo", len)?; - if !self.url.is_empty() { - struct_ser.serialize_field("url", &self.url)?; - } - if self.started_at != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("startedAt", ToString::to_string(&self.started_at).as_str())?; - } - if self.ended_at != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("endedAt", ToString::to_string(&self.ended_at).as_str())?; - } - if self.duration != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("duration", ToString::to_string(&self.duration).as_str())?; - } - if self.status != 0 { - let v = stream_info::Status::try_from(self.status) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.status)))?; - struct_ser.serialize_field("status", &v)?; + let mut struct_ser = serializer.serialize_struct("livekit.SubscribedCodec", len)?; + if !self.codec.is_empty() { + struct_ser.serialize_field("codec", &self.codec)?; } - if !self.error.is_empty() { - struct_ser.serialize_field("error", &self.error)?; + if !self.qualities.is_empty() { + struct_ser.serialize_field("qualities", &self.qualities)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for StreamInfo { +impl<'de> serde::Deserialize<'de> for SubscribedCodec { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "url", - "started_at", - "startedAt", - "ended_at", - "endedAt", - "duration", - "status", - "error", + "codec", + "qualities", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Url, - StartedAt, - EndedAt, - Duration, - Status, - Error, + Codec, + Qualities, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -20873,12 +24943,8 @@ impl<'de> serde::Deserialize<'de> for StreamInfo { E: serde::de::Error, { match value { - "url" => Ok(GeneratedField::Url), - "startedAt" | "started_at" => Ok(GeneratedField::StartedAt), - "endedAt" | "ended_at" => Ok(GeneratedField::EndedAt), - "duration" => Ok(GeneratedField::Duration), - "status" => Ok(GeneratedField::Status), - "error" => Ok(GeneratedField::Error), + "codec" => Ok(GeneratedField::Codec), + "qualities" => Ok(GeneratedField::Qualities), _ => Ok(GeneratedField::__SkipField__), } } @@ -20888,159 +24954,47 @@ impl<'de> serde::Deserialize<'de> for StreamInfo { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = StreamInfo; + type Value = SubscribedCodec; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.StreamInfo") + formatter.write_str("struct livekit.SubscribedCodec") } - 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 url__ = None; - let mut started_at__ = None; - let mut ended_at__ = None; - let mut duration__ = None; - let mut status__ = None; - let mut error__ = None; + let mut codec__ = None; + let mut qualities__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Url => { - if url__.is_some() { - return Err(serde::de::Error::duplicate_field("url")); - } - url__ = Some(map_.next_value()?); - } - GeneratedField::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::Duration => { - if duration__.is_some() { - return Err(serde::de::Error::duplicate_field("duration")); - } - duration__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Status => { - if status__.is_some() { - return Err(serde::de::Error::duplicate_field("status")); + GeneratedField::Codec => { + if codec__.is_some() { + return Err(serde::de::Error::duplicate_field("codec")); } - status__ = Some(map_.next_value::()? as i32); + codec__ = Some(map_.next_value()?); } - GeneratedField::Error => { - if error__.is_some() { - return Err(serde::de::Error::duplicate_field("error")); + GeneratedField::Qualities => { + if qualities__.is_some() { + return Err(serde::de::Error::duplicate_field("qualities")); } - error__ = Some(map_.next_value()?); + qualities__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(StreamInfo { - url: url__.unwrap_or_default(), - started_at: started_at__.unwrap_or_default(), - ended_at: ended_at__.unwrap_or_default(), - duration: duration__.unwrap_or_default(), - status: status__.unwrap_or_default(), - error: error__.unwrap_or_default(), + Ok(SubscribedCodec { + codec: codec__.unwrap_or_default(), + qualities: qualities__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.StreamInfo", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for stream_info::Status { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::Active => "ACTIVE", - Self::Finished => "FINISHED", - Self::Failed => "FAILED", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for stream_info::Status { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "ACTIVE", - "FINISHED", - "FAILED", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = stream_info::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 { - "ACTIVE" => Ok(stream_info::Status::Active), - "FINISHED" => Ok(stream_info::Status::Finished), - "FAILED" => Ok(stream_info::Status::Failed), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) + deserializer.deserialize_struct("livekit.SubscribedCodec", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for StreamInfoList { +impl serde::Serialize for SubscribedQuality { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -21048,29 +25002,39 @@ impl serde::Serialize for StreamInfoList { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.info.is_empty() { + if self.quality != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.StreamInfoList", len)?; - if !self.info.is_empty() { - struct_ser.serialize_field("info", &self.info)?; + if self.enabled { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.SubscribedQuality", len)?; + if self.quality != 0 { + let v = VideoQuality::try_from(self.quality) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.quality)))?; + struct_ser.serialize_field("quality", &v)?; + } + if self.enabled { + struct_ser.serialize_field("enabled", &self.enabled)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for StreamInfoList { +impl<'de> serde::Deserialize<'de> for SubscribedQuality { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "info", + "quality", + "enabled", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Info, + Quality, + Enabled, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -21093,7 +25057,8 @@ impl<'de> serde::Deserialize<'de> for StreamInfoList { E: serde::de::Error, { match value { - "info" => Ok(GeneratedField::Info), + "quality" => Ok(GeneratedField::Quality), + "enabled" => Ok(GeneratedField::Enabled), _ => Ok(GeneratedField::__SkipField__), } } @@ -21103,39 +25068,47 @@ impl<'de> serde::Deserialize<'de> for StreamInfoList { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = StreamInfoList; + type Value = SubscribedQuality; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.StreamInfoList") + formatter.write_str("struct livekit.SubscribedQuality") } - 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 info__ = None; + let mut quality__ = None; + let mut enabled__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Info => { - if info__.is_some() { - return Err(serde::de::Error::duplicate_field("info")); + GeneratedField::Quality => { + if quality__.is_some() { + return Err(serde::de::Error::duplicate_field("quality")); } - info__ = Some(map_.next_value()?); + quality__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Enabled => { + if enabled__.is_some() { + return Err(serde::de::Error::duplicate_field("enabled")); + } + enabled__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(StreamInfoList { - info: info__.unwrap_or_default(), + Ok(SubscribedQuality { + quality: quality__.unwrap_or_default(), + enabled: enabled__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.StreamInfoList", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.SubscribedQuality", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for StreamOutput { +impl serde::Serialize for SubscribedQualityUpdate { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -21143,39 +25116,48 @@ impl serde::Serialize for StreamOutput { { use serde::ser::SerializeStruct; let mut len = 0; - if self.protocol != 0 { + if !self.track_sid.is_empty() { len += 1; } - if !self.urls.is_empty() { + if !self.subscribed_qualities.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.StreamOutput", len)?; - if self.protocol != 0 { - let v = StreamProtocol::try_from(self.protocol) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.protocol)))?; - struct_ser.serialize_field("protocol", &v)?; + if !self.subscribed_codecs.is_empty() { + len += 1; } - if !self.urls.is_empty() { - struct_ser.serialize_field("urls", &self.urls)?; + let mut struct_ser = serializer.serialize_struct("livekit.SubscribedQualityUpdate", len)?; + if !self.track_sid.is_empty() { + struct_ser.serialize_field("trackSid", &self.track_sid)?; + } + if !self.subscribed_qualities.is_empty() { + struct_ser.serialize_field("subscribedQualities", &self.subscribed_qualities)?; + } + if !self.subscribed_codecs.is_empty() { + struct_ser.serialize_field("subscribedCodecs", &self.subscribed_codecs)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for StreamOutput { +impl<'de> serde::Deserialize<'de> for SubscribedQualityUpdate { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "protocol", - "urls", + "track_sid", + "trackSid", + "subscribed_qualities", + "subscribedQualities", + "subscribed_codecs", + "subscribedCodecs", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Protocol, - Urls, + TrackSid, + SubscribedQualities, + SubscribedCodecs, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -21198,8 +25180,9 @@ impl<'de> serde::Deserialize<'de> for StreamOutput { E: serde::de::Error, { match value { - "protocol" => Ok(GeneratedField::Protocol), - "urls" => Ok(GeneratedField::Urls), + "trackSid" | "track_sid" => Ok(GeneratedField::TrackSid), + "subscribedQualities" | "subscribed_qualities" => Ok(GeneratedField::SubscribedQualities), + "subscribedCodecs" | "subscribed_codecs" => Ok(GeneratedField::SubscribedCodecs), _ => Ok(GeneratedField::__SkipField__), } } @@ -21209,145 +25192,84 @@ impl<'de> serde::Deserialize<'de> for StreamOutput { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = StreamOutput; + type Value = SubscribedQualityUpdate; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.StreamOutput") + formatter.write_str("struct livekit.SubscribedQualityUpdate") } - 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 protocol__ = None; - let mut urls__ = None; + let mut track_sid__ = None; + let mut subscribed_qualities__ = None; + let mut subscribed_codecs__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Protocol => { - if protocol__.is_some() { - return Err(serde::de::Error::duplicate_field("protocol")); + GeneratedField::TrackSid => { + if track_sid__.is_some() { + return Err(serde::de::Error::duplicate_field("trackSid")); } - protocol__ = Some(map_.next_value::()? as i32); + track_sid__ = Some(map_.next_value()?); } - GeneratedField::Urls => { - if urls__.is_some() { - return Err(serde::de::Error::duplicate_field("urls")); + GeneratedField::SubscribedQualities => { + if subscribed_qualities__.is_some() { + return Err(serde::de::Error::duplicate_field("subscribedQualities")); } - urls__ = Some(map_.next_value()?); + subscribed_qualities__ = Some(map_.next_value()?); + } + GeneratedField::SubscribedCodecs => { + if subscribed_codecs__.is_some() { + return Err(serde::de::Error::duplicate_field("subscribedCodecs")); + } + subscribed_codecs__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(StreamOutput { - protocol: protocol__.unwrap_or_default(), - urls: urls__.unwrap_or_default(), + Ok(SubscribedQualityUpdate { + track_sid: track_sid__.unwrap_or_default(), + subscribed_qualities: subscribed_qualities__.unwrap_or_default(), + subscribed_codecs: subscribed_codecs__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.StreamOutput", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for StreamProtocol { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::DefaultProtocol => "DEFAULT_PROTOCOL", - Self::Rtmp => "RTMP", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for StreamProtocol { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "DEFAULT_PROTOCOL", - "RTMP", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = StreamProtocol; - - 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 { - "DEFAULT_PROTOCOL" => Ok(StreamProtocol::DefaultProtocol), - "RTMP" => Ok(StreamProtocol::Rtmp), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) + deserializer.deserialize_struct("livekit.SubscribedQualityUpdate", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for StreamState { +impl serde::Serialize for SubscriptionError { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { let variant = match self { - Self::Active => "ACTIVE", - Self::Paused => "PAUSED", + Self::SeUnknown => "SE_UNKNOWN", + Self::SeCodecUnsupported => "SE_CODEC_UNSUPPORTED", + Self::SeTrackNotfound => "SE_TRACK_NOTFOUND", }; serializer.serialize_str(variant) } } -impl<'de> serde::Deserialize<'de> for StreamState { +impl<'de> serde::Deserialize<'de> for SubscriptionError { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "ACTIVE", - "PAUSED", + "SE_UNKNOWN", + "SE_CODEC_UNSUPPORTED", + "SE_TRACK_NOTFOUND", ]; struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = StreamState; + type Value = SubscriptionError; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(formatter, "expected one of: {:?}", &FIELDS) @@ -21364,167 +25286,35 @@ impl<'de> serde::Deserialize<'de> for StreamState { 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 { - "ACTIVE" => Ok(StreamState::Active), - "PAUSED" => Ok(StreamState::Paused), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for StreamStateInfo { - #[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_sid.is_empty() { - len += 1; - } - if !self.track_sid.is_empty() { - len += 1; - } - if self.state != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("livekit.StreamStateInfo", len)?; - if !self.participant_sid.is_empty() { - struct_ser.serialize_field("participantSid", &self.participant_sid)?; - } - if !self.track_sid.is_empty() { - struct_ser.serialize_field("trackSid", &self.track_sid)?; - } - if self.state != 0 { - let v = StreamState::try_from(self.state) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.state)))?; - struct_ser.serialize_field("state", &v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for StreamStateInfo { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "participant_sid", - "participantSid", - "track_sid", - "trackSid", - "state", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ParticipantSid, - TrackSid, - State, - __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 { - "participantSid" | "participant_sid" => Ok(GeneratedField::ParticipantSid), - "trackSid" | "track_sid" => Ok(GeneratedField::TrackSid), - "state" => Ok(GeneratedField::State), - _ => Ok(GeneratedField::__SkipField__), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = StreamStateInfo; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.StreamStateInfo") + + 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 participant_sid__ = None; - let mut track_sid__ = None; - let mut state__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ParticipantSid => { - if participant_sid__.is_some() { - return Err(serde::de::Error::duplicate_field("participantSid")); - } - participant_sid__ = Some(map_.next_value()?); - } - GeneratedField::TrackSid => { - if track_sid__.is_some() { - return Err(serde::de::Error::duplicate_field("trackSid")); - } - track_sid__ = Some(map_.next_value()?); - } - GeneratedField::State => { - if state__.is_some() { - return Err(serde::de::Error::duplicate_field("state")); - } - state__ = Some(map_.next_value::()? as i32); - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; - } - } + match value { + "SE_UNKNOWN" => Ok(SubscriptionError::SeUnknown), + "SE_CODEC_UNSUPPORTED" => Ok(SubscriptionError::SeCodecUnsupported), + "SE_TRACK_NOTFOUND" => Ok(SubscriptionError::SeTrackNotfound), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } - Ok(StreamStateInfo { - participant_sid: participant_sid__.unwrap_or_default(), - track_sid: track_sid__.unwrap_or_default(), - state: state__.unwrap_or_default(), - }) } } - deserializer.deserialize_struct("livekit.StreamStateInfo", FIELDS, GeneratedVisitor) + deserializer.deserialize_any(GeneratedVisitor) } } -impl serde::Serialize for StreamStateUpdate { +impl serde::Serialize for SubscriptionPermission { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -21532,30 +25322,39 @@ impl serde::Serialize for StreamStateUpdate { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.stream_states.is_empty() { + if self.all_participants { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.StreamStateUpdate", len)?; - if !self.stream_states.is_empty() { - struct_ser.serialize_field("streamStates", &self.stream_states)?; + if !self.track_permissions.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.SubscriptionPermission", len)?; + if self.all_participants { + struct_ser.serialize_field("allParticipants", &self.all_participants)?; + } + if !self.track_permissions.is_empty() { + struct_ser.serialize_field("trackPermissions", &self.track_permissions)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for StreamStateUpdate { +impl<'de> serde::Deserialize<'de> for SubscriptionPermission { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "stream_states", - "streamStates", + "all_participants", + "allParticipants", + "track_permissions", + "trackPermissions", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - StreamStates, + AllParticipants, + TrackPermissions, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -21578,7 +25377,8 @@ impl<'de> serde::Deserialize<'de> for StreamStateUpdate { E: serde::de::Error, { match value { - "streamStates" | "stream_states" => Ok(GeneratedField::StreamStates), + "allParticipants" | "all_participants" => Ok(GeneratedField::AllParticipants), + "trackPermissions" | "track_permissions" => Ok(GeneratedField::TrackPermissions), _ => Ok(GeneratedField::__SkipField__), } } @@ -21588,39 +25388,47 @@ impl<'de> serde::Deserialize<'de> for StreamStateUpdate { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = StreamStateUpdate; + type Value = SubscriptionPermission; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.StreamStateUpdate") + formatter.write_str("struct livekit.SubscriptionPermission") } - 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 stream_states__ = None; + let mut all_participants__ = None; + let mut track_permissions__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::StreamStates => { - if stream_states__.is_some() { - return Err(serde::de::Error::duplicate_field("streamStates")); + GeneratedField::AllParticipants => { + if all_participants__.is_some() { + return Err(serde::de::Error::duplicate_field("allParticipants")); } - stream_states__ = Some(map_.next_value()?); + all_participants__ = Some(map_.next_value()?); + } + GeneratedField::TrackPermissions => { + if track_permissions__.is_some() { + return Err(serde::de::Error::duplicate_field("trackPermissions")); + } + track_permissions__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(StreamStateUpdate { - stream_states: stream_states__.unwrap_or_default(), + Ok(SubscriptionPermission { + all_participants: all_participants__.unwrap_or_default(), + track_permissions: track_permissions__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.StreamStateUpdate", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.SubscriptionPermission", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for SubscribedCodec { +impl serde::Serialize for SubscriptionPermissionUpdate { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -21628,37 +25436,47 @@ impl serde::Serialize for SubscribedCodec { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.codec.is_empty() { + if !self.participant_sid.is_empty() { len += 1; } - if !self.qualities.is_empty() { + if !self.track_sid.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.SubscribedCodec", len)?; - if !self.codec.is_empty() { - struct_ser.serialize_field("codec", &self.codec)?; + if self.allowed { + len += 1; } - if !self.qualities.is_empty() { - struct_ser.serialize_field("qualities", &self.qualities)?; + let mut struct_ser = serializer.serialize_struct("livekit.SubscriptionPermissionUpdate", len)?; + if !self.participant_sid.is_empty() { + struct_ser.serialize_field("participantSid", &self.participant_sid)?; + } + if !self.track_sid.is_empty() { + struct_ser.serialize_field("trackSid", &self.track_sid)?; + } + if self.allowed { + struct_ser.serialize_field("allowed", &self.allowed)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for SubscribedCodec { +impl<'de> serde::Deserialize<'de> for SubscriptionPermissionUpdate { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "codec", - "qualities", + "participant_sid", + "participantSid", + "track_sid", + "trackSid", + "allowed", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Codec, - Qualities, + ParticipantSid, + TrackSid, + Allowed, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -21681,8 +25499,9 @@ impl<'de> serde::Deserialize<'de> for SubscribedCodec { E: serde::de::Error, { match value { - "codec" => Ok(GeneratedField::Codec), - "qualities" => Ok(GeneratedField::Qualities), + "participantSid" | "participant_sid" => Ok(GeneratedField::ParticipantSid), + "trackSid" | "track_sid" => Ok(GeneratedField::TrackSid), + "allowed" => Ok(GeneratedField::Allowed), _ => Ok(GeneratedField::__SkipField__), } } @@ -21692,47 +25511,55 @@ impl<'de> serde::Deserialize<'de> for SubscribedCodec { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SubscribedCodec; + type Value = SubscriptionPermissionUpdate; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SubscribedCodec") + formatter.write_str("struct livekit.SubscriptionPermissionUpdate") } - 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 codec__ = None; - let mut qualities__ = None; + let mut participant_sid__ = None; + let mut track_sid__ = None; + let mut allowed__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Codec => { - if codec__.is_some() { - return Err(serde::de::Error::duplicate_field("codec")); + GeneratedField::ParticipantSid => { + if participant_sid__.is_some() { + return Err(serde::de::Error::duplicate_field("participantSid")); } - codec__ = Some(map_.next_value()?); + participant_sid__ = Some(map_.next_value()?); } - GeneratedField::Qualities => { - if qualities__.is_some() { - return Err(serde::de::Error::duplicate_field("qualities")); + GeneratedField::TrackSid => { + if track_sid__.is_some() { + return Err(serde::de::Error::duplicate_field("trackSid")); } - qualities__ = Some(map_.next_value()?); + track_sid__ = Some(map_.next_value()?); + } + GeneratedField::Allowed => { + if allowed__.is_some() { + return Err(serde::de::Error::duplicate_field("allowed")); + } + allowed__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(SubscribedCodec { - codec: codec__.unwrap_or_default(), - qualities: qualities__.unwrap_or_default(), + Ok(SubscriptionPermissionUpdate { + participant_sid: participant_sid__.unwrap_or_default(), + track_sid: track_sid__.unwrap_or_default(), + allowed: allowed__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.SubscribedCodec", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.SubscriptionPermissionUpdate", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for SubscribedQuality { +impl serde::Serialize for SubscriptionResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -21740,39 +25567,40 @@ impl serde::Serialize for SubscribedQuality { { use serde::ser::SerializeStruct; let mut len = 0; - if self.quality != 0 { + if !self.track_sid.is_empty() { len += 1; } - if self.enabled { + if self.err != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.SubscribedQuality", len)?; - if self.quality != 0 { - let v = VideoQuality::try_from(self.quality) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.quality)))?; - struct_ser.serialize_field("quality", &v)?; + let mut struct_ser = serializer.serialize_struct("livekit.SubscriptionResponse", len)?; + if !self.track_sid.is_empty() { + struct_ser.serialize_field("trackSid", &self.track_sid)?; } - if self.enabled { - struct_ser.serialize_field("enabled", &self.enabled)?; + if self.err != 0 { + let v = SubscriptionError::try_from(self.err) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.err)))?; + struct_ser.serialize_field("err", &v)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for SubscribedQuality { +impl<'de> serde::Deserialize<'de> for SubscriptionResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "quality", - "enabled", + "track_sid", + "trackSid", + "err", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Quality, - Enabled, + TrackSid, + Err, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -21795,8 +25623,8 @@ impl<'de> serde::Deserialize<'de> for SubscribedQuality { E: serde::de::Error, { match value { - "quality" => Ok(GeneratedField::Quality), - "enabled" => Ok(GeneratedField::Enabled), + "trackSid" | "track_sid" => Ok(GeneratedField::TrackSid), + "err" => Ok(GeneratedField::Err), _ => Ok(GeneratedField::__SkipField__), } } @@ -21806,47 +25634,47 @@ impl<'de> serde::Deserialize<'de> for SubscribedQuality { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SubscribedQuality; + type Value = SubscriptionResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SubscribedQuality") + formatter.write_str("struct livekit.SubscriptionResponse") } - 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 quality__ = None; - let mut enabled__ = None; + let mut track_sid__ = None; + let mut err__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Quality => { - if quality__.is_some() { - return Err(serde::de::Error::duplicate_field("quality")); + GeneratedField::TrackSid => { + if track_sid__.is_some() { + return Err(serde::de::Error::duplicate_field("trackSid")); } - quality__ = Some(map_.next_value::()? as i32); + track_sid__ = Some(map_.next_value()?); } - GeneratedField::Enabled => { - if enabled__.is_some() { - return Err(serde::de::Error::duplicate_field("enabled")); + GeneratedField::Err => { + if err__.is_some() { + return Err(serde::de::Error::duplicate_field("err")); } - enabled__ = Some(map_.next_value()?); + err__ = Some(map_.next_value::()? as i32); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(SubscribedQuality { - quality: quality__.unwrap_or_default(), - enabled: enabled__.unwrap_or_default(), + Ok(SubscriptionResponse { + track_sid: track_sid__.unwrap_or_default(), + err: err__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.SubscribedQuality", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.SubscriptionResponse", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for SubscribedQualityUpdate { +impl serde::Serialize for SyncState { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -21854,48 +25682,72 @@ impl serde::Serialize for SubscribedQualityUpdate { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.track_sid.is_empty() { + if self.answer.is_some() { len += 1; } - if !self.subscribed_qualities.is_empty() { + if self.subscription.is_some() { len += 1; } - if !self.subscribed_codecs.is_empty() { + if !self.publish_tracks.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.SubscribedQualityUpdate", len)?; - if !self.track_sid.is_empty() { - struct_ser.serialize_field("trackSid", &self.track_sid)?; + if !self.data_channels.is_empty() { + len += 1; } - if !self.subscribed_qualities.is_empty() { - struct_ser.serialize_field("subscribedQualities", &self.subscribed_qualities)?; + if self.offer.is_some() { + len += 1; } - if !self.subscribed_codecs.is_empty() { - struct_ser.serialize_field("subscribedCodecs", &self.subscribed_codecs)?; + if !self.track_sids_disabled.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.SyncState", len)?; + if let Some(v) = self.answer.as_ref() { + struct_ser.serialize_field("answer", v)?; + } + if let Some(v) = self.subscription.as_ref() { + struct_ser.serialize_field("subscription", v)?; + } + if !self.publish_tracks.is_empty() { + struct_ser.serialize_field("publishTracks", &self.publish_tracks)?; + } + if !self.data_channels.is_empty() { + struct_ser.serialize_field("dataChannels", &self.data_channels)?; + } + if let Some(v) = self.offer.as_ref() { + struct_ser.serialize_field("offer", v)?; + } + if !self.track_sids_disabled.is_empty() { + struct_ser.serialize_field("trackSidsDisabled", &self.track_sids_disabled)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for SubscribedQualityUpdate { +impl<'de> serde::Deserialize<'de> for SyncState { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "track_sid", - "trackSid", - "subscribed_qualities", - "subscribedQualities", - "subscribed_codecs", - "subscribedCodecs", + "answer", + "subscription", + "publish_tracks", + "publishTracks", + "data_channels", + "dataChannels", + "offer", + "track_sids_disabled", + "trackSidsDisabled", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - TrackSid, - SubscribedQualities, - SubscribedCodecs, + Answer, + Subscription, + PublishTracks, + DataChannels, + Offer, + TrackSidsDisabled, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -21918,9 +25770,12 @@ impl<'de> serde::Deserialize<'de> for SubscribedQualityUpdate { E: serde::de::Error, { match value { - "trackSid" | "track_sid" => Ok(GeneratedField::TrackSid), - "subscribedQualities" | "subscribed_qualities" => Ok(GeneratedField::SubscribedQualities), - "subscribedCodecs" | "subscribed_codecs" => Ok(GeneratedField::SubscribedCodecs), + "answer" => Ok(GeneratedField::Answer), + "subscription" => Ok(GeneratedField::Subscription), + "publishTracks" | "publish_tracks" => Ok(GeneratedField::PublishTracks), + "dataChannels" | "data_channels" => Ok(GeneratedField::DataChannels), + "offer" => Ok(GeneratedField::Offer), + "trackSidsDisabled" | "track_sids_disabled" => Ok(GeneratedField::TrackSidsDisabled), _ => Ok(GeneratedField::__SkipField__), } } @@ -21930,129 +25785,79 @@ impl<'de> serde::Deserialize<'de> for SubscribedQualityUpdate { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SubscribedQualityUpdate; + type Value = SyncState; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SubscribedQualityUpdate") + formatter.write_str("struct livekit.SyncState") } - 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 track_sid__ = None; - let mut subscribed_qualities__ = None; - let mut subscribed_codecs__ = None; + let mut answer__ = None; + let mut subscription__ = None; + let mut publish_tracks__ = None; + let mut data_channels__ = None; + let mut offer__ = None; + let mut track_sids_disabled__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::TrackSid => { - if track_sid__.is_some() { - return Err(serde::de::Error::duplicate_field("trackSid")); + GeneratedField::Answer => { + if answer__.is_some() { + return Err(serde::de::Error::duplicate_field("answer")); } - track_sid__ = Some(map_.next_value()?); + answer__ = map_.next_value()?; } - GeneratedField::SubscribedQualities => { - if subscribed_qualities__.is_some() { - return Err(serde::de::Error::duplicate_field("subscribedQualities")); + GeneratedField::Subscription => { + if subscription__.is_some() { + return Err(serde::de::Error::duplicate_field("subscription")); } - subscribed_qualities__ = Some(map_.next_value()?); + subscription__ = map_.next_value()?; } - GeneratedField::SubscribedCodecs => { - if subscribed_codecs__.is_some() { - return Err(serde::de::Error::duplicate_field("subscribedCodecs")); + GeneratedField::PublishTracks => { + if publish_tracks__.is_some() { + return Err(serde::de::Error::duplicate_field("publishTracks")); } - subscribed_codecs__ = Some(map_.next_value()?); + publish_tracks__ = Some(map_.next_value()?); + } + GeneratedField::DataChannels => { + if data_channels__.is_some() { + return Err(serde::de::Error::duplicate_field("dataChannels")); + } + data_channels__ = Some(map_.next_value()?); + } + GeneratedField::Offer => { + if offer__.is_some() { + return Err(serde::de::Error::duplicate_field("offer")); + } + offer__ = map_.next_value()?; + } + GeneratedField::TrackSidsDisabled => { + if track_sids_disabled__.is_some() { + return Err(serde::de::Error::duplicate_field("trackSidsDisabled")); + } + track_sids_disabled__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(SubscribedQualityUpdate { - track_sid: track_sid__.unwrap_or_default(), - subscribed_qualities: subscribed_qualities__.unwrap_or_default(), - subscribed_codecs: subscribed_codecs__.unwrap_or_default(), + Ok(SyncState { + answer: answer__, + subscription: subscription__, + publish_tracks: publish_tracks__.unwrap_or_default(), + data_channels: data_channels__.unwrap_or_default(), + offer: offer__, + track_sids_disabled: track_sids_disabled__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.SubscribedQualityUpdate", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for SubscriptionError { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::SeUnknown => "SE_UNKNOWN", - Self::SeCodecUnsupported => "SE_CODEC_UNSUPPORTED", - Self::SeTrackNotfound => "SE_TRACK_NOTFOUND", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for SubscriptionError { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "SE_UNKNOWN", - "SE_CODEC_UNSUPPORTED", - "SE_TRACK_NOTFOUND", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SubscriptionError; - - 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 { - "SE_UNKNOWN" => Ok(SubscriptionError::SeUnknown), - "SE_CODEC_UNSUPPORTED" => Ok(SubscriptionError::SeCodecUnsupported), - "SE_TRACK_NOTFOUND" => Ok(SubscriptionError::SeTrackNotfound), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) + deserializer.deserialize_struct("livekit.SyncState", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for SubscriptionPermission { +impl serde::Serialize for TimedVersion { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -22060,39 +25865,39 @@ impl serde::Serialize for SubscriptionPermission { { use serde::ser::SerializeStruct; let mut len = 0; - if self.all_participants { + if self.unix_micro != 0 { len += 1; } - if !self.track_permissions.is_empty() { + if self.ticks != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.SubscriptionPermission", len)?; - if self.all_participants { - struct_ser.serialize_field("allParticipants", &self.all_participants)?; + let mut struct_ser = serializer.serialize_struct("livekit.TimedVersion", len)?; + if self.unix_micro != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("unixMicro", ToString::to_string(&self.unix_micro).as_str())?; } - if !self.track_permissions.is_empty() { - struct_ser.serialize_field("trackPermissions", &self.track_permissions)?; + if self.ticks != 0 { + struct_ser.serialize_field("ticks", &self.ticks)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for SubscriptionPermission { +impl<'de> serde::Deserialize<'de> for TimedVersion { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "all_participants", - "allParticipants", - "track_permissions", - "trackPermissions", + "unix_micro", + "unixMicro", + "ticks", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - AllParticipants, - TrackPermissions, + UnixMicro, + Ticks, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -22115,8 +25920,8 @@ impl<'de> serde::Deserialize<'de> for SubscriptionPermission { E: serde::de::Error, { match value { - "allParticipants" | "all_participants" => Ok(GeneratedField::AllParticipants), - "trackPermissions" | "track_permissions" => Ok(GeneratedField::TrackPermissions), + "unixMicro" | "unix_micro" => Ok(GeneratedField::UnixMicro), + "ticks" => Ok(GeneratedField::Ticks), _ => Ok(GeneratedField::__SkipField__), } } @@ -22126,47 +25931,51 @@ impl<'de> serde::Deserialize<'de> for SubscriptionPermission { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SubscriptionPermission; + type Value = TimedVersion; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SubscriptionPermission") + formatter.write_str("struct livekit.TimedVersion") } - 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 all_participants__ = None; - let mut track_permissions__ = None; + let mut unix_micro__ = None; + let mut ticks__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::AllParticipants => { - if all_participants__.is_some() { - return Err(serde::de::Error::duplicate_field("allParticipants")); + GeneratedField::UnixMicro => { + if unix_micro__.is_some() { + return Err(serde::de::Error::duplicate_field("unixMicro")); } - all_participants__ = Some(map_.next_value()?); + unix_micro__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } - GeneratedField::TrackPermissions => { - if track_permissions__.is_some() { - return Err(serde::de::Error::duplicate_field("trackPermissions")); + GeneratedField::Ticks => { + if ticks__.is_some() { + return Err(serde::de::Error::duplicate_field("ticks")); } - track_permissions__ = Some(map_.next_value()?); + ticks__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(SubscriptionPermission { - all_participants: all_participants__.unwrap_or_default(), - track_permissions: track_permissions__.unwrap_or_default(), + Ok(TimedVersion { + unix_micro: unix_micro__.unwrap_or_default(), + ticks: ticks__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.SubscriptionPermission", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.TimedVersion", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for SubscriptionPermissionUpdate { +impl serde::Serialize for TrackCompositeEgressRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -22174,47 +25983,125 @@ impl serde::Serialize for SubscriptionPermissionUpdate { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.participant_sid.is_empty() { + if !self.room_name.is_empty() { len += 1; } - if !self.track_sid.is_empty() { + if !self.audio_track_id.is_empty() { len += 1; } - if self.allowed { + if !self.video_track_id.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.SubscriptionPermissionUpdate", len)?; - if !self.participant_sid.is_empty() { - struct_ser.serialize_field("participantSid", &self.participant_sid)?; + if !self.file_outputs.is_empty() { + len += 1; } - if !self.track_sid.is_empty() { - struct_ser.serialize_field("trackSid", &self.track_sid)?; + if !self.stream_outputs.is_empty() { + len += 1; } - if self.allowed { - struct_ser.serialize_field("allowed", &self.allowed)?; + 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.TrackCompositeEgressRequest", len)?; + if !self.room_name.is_empty() { + struct_ser.serialize_field("roomName", &self.room_name)?; + } + if !self.audio_track_id.is_empty() { + struct_ser.serialize_field("audioTrackId", &self.audio_track_id)?; + } + if !self.video_track_id.is_empty() { + struct_ser.serialize_field("videoTrackId", &self.video_track_id)?; + } + 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 { + track_composite_egress_request::Output::File(v) => { + struct_ser.serialize_field("file", v)?; + } + track_composite_egress_request::Output::Stream(v) => { + struct_ser.serialize_field("stream", v)?; + } + track_composite_egress_request::Output::Segments(v) => { + struct_ser.serialize_field("segments", v)?; + } + } + } + if let Some(v) = self.options.as_ref() { + match v { + track_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)?; + } + track_composite_egress_request::Options::Advanced(v) => { + struct_ser.serialize_field("advanced", v)?; + } + } } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for SubscriptionPermissionUpdate { +impl<'de> serde::Deserialize<'de> for TrackCompositeEgressRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "participant_sid", - "participantSid", - "track_sid", - "trackSid", - "allowed", + "room_name", + "roomName", + "audio_track_id", + "audioTrackId", + "video_track_id", + "videoTrackId", + "file_outputs", + "fileOutputs", + "stream_outputs", + "streamOutputs", + "segment_outputs", + "segmentOutputs", + "image_outputs", + "imageOutputs", + "file", + "stream", + "segments", + "preset", + "advanced", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - ParticipantSid, - TrackSid, - Allowed, + RoomName, + AudioTrackId, + VideoTrackId, + FileOutputs, + StreamOutputs, + SegmentOutputs, + ImageOutputs, + File, + Stream, + Segments, + Preset, + Advanced, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -22237,67 +26124,146 @@ impl<'de> serde::Deserialize<'de> for SubscriptionPermissionUpdate { E: serde::de::Error, { match value { - "participantSid" | "participant_sid" => Ok(GeneratedField::ParticipantSid), - "trackSid" | "track_sid" => Ok(GeneratedField::TrackSid), - "allowed" => Ok(GeneratedField::Allowed), + "roomName" | "room_name" => Ok(GeneratedField::RoomName), + "audioTrackId" | "audio_track_id" => Ok(GeneratedField::AudioTrackId), + "videoTrackId" | "video_track_id" => Ok(GeneratedField::VideoTrackId), + "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__), } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SubscriptionPermissionUpdate; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SubscriptionPermissionUpdate") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut participant_sid__ = None; - let mut track_sid__ = None; - let mut allowed__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ParticipantSid => { - if participant_sid__.is_some() { - return Err(serde::de::Error::duplicate_field("participantSid")); + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = TrackCompositeEgressRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.TrackCompositeEgressRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut room_name__ = None; + let mut audio_track_id__ = None; + let mut video_track_id__ = 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::RoomName => { + if room_name__.is_some() { + return Err(serde::de::Error::duplicate_field("roomName")); + } + room_name__ = Some(map_.next_value()?); + } + GeneratedField::AudioTrackId => { + if audio_track_id__.is_some() { + return Err(serde::de::Error::duplicate_field("audioTrackId")); + } + audio_track_id__ = Some(map_.next_value()?); + } + GeneratedField::VideoTrackId => { + if video_track_id__.is_some() { + return Err(serde::de::Error::duplicate_field("videoTrackId")); + } + video_track_id__ = 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(track_composite_egress_request::Output::File) +; + } + GeneratedField::Stream => { + if output__.is_some() { + return Err(serde::de::Error::duplicate_field("stream")); } - participant_sid__ = Some(map_.next_value()?); + output__ = map_.next_value::<::std::option::Option<_>>()?.map(track_composite_egress_request::Output::Stream) +; } - GeneratedField::TrackSid => { - if track_sid__.is_some() { - return Err(serde::de::Error::duplicate_field("trackSid")); + GeneratedField::Segments => { + if output__.is_some() { + return Err(serde::de::Error::duplicate_field("segments")); } - track_sid__ = Some(map_.next_value()?); + output__ = map_.next_value::<::std::option::Option<_>>()?.map(track_composite_egress_request::Output::Segments) +; } - GeneratedField::Allowed => { - if allowed__.is_some() { - return Err(serde::de::Error::duplicate_field("allowed")); + GeneratedField::Preset => { + if options__.is_some() { + return Err(serde::de::Error::duplicate_field("preset")); } - allowed__ = Some(map_.next_value()?); + options__ = map_.next_value::<::std::option::Option>()?.map(|x| track_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(track_composite_egress_request::Options::Advanced) +; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(SubscriptionPermissionUpdate { - participant_sid: participant_sid__.unwrap_or_default(), - track_sid: track_sid__.unwrap_or_default(), - allowed: allowed__.unwrap_or_default(), + Ok(TrackCompositeEgressRequest { + room_name: room_name__.unwrap_or_default(), + audio_track_id: audio_track_id__.unwrap_or_default(), + video_track_id: video_track_id__.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.SubscriptionPermissionUpdate", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.TrackCompositeEgressRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for SubscriptionResponse { +impl serde::Serialize for TrackEgressRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -22305,40 +26271,57 @@ impl serde::Serialize for SubscriptionResponse { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.track_sid.is_empty() { + if !self.room_name.is_empty() { len += 1; } - if self.err != 0 { + if !self.track_id.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.SubscriptionResponse", len)?; - if !self.track_sid.is_empty() { - struct_ser.serialize_field("trackSid", &self.track_sid)?; + if self.output.is_some() { + len += 1; } - if self.err != 0 { - let v = SubscriptionError::try_from(self.err) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.err)))?; - struct_ser.serialize_field("err", &v)?; + let mut struct_ser = serializer.serialize_struct("livekit.TrackEgressRequest", len)?; + if !self.room_name.is_empty() { + struct_ser.serialize_field("roomName", &self.room_name)?; + } + if !self.track_id.is_empty() { + struct_ser.serialize_field("trackId", &self.track_id)?; + } + if let Some(v) = self.output.as_ref() { + match v { + track_egress_request::Output::File(v) => { + struct_ser.serialize_field("file", v)?; + } + track_egress_request::Output::WebsocketUrl(v) => { + struct_ser.serialize_field("websocketUrl", v)?; + } + } } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for SubscriptionResponse { +impl<'de> serde::Deserialize<'de> for TrackEgressRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "track_sid", - "trackSid", - "err", + "room_name", + "roomName", + "track_id", + "trackId", + "file", + "websocket_url", + "websocketUrl", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - TrackSid, - Err, + RoomName, + TrackId, + File, + WebsocketUrl, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -22361,8 +26344,10 @@ impl<'de> serde::Deserialize<'de> for SubscriptionResponse { E: serde::de::Error, { match value { - "trackSid" | "track_sid" => Ok(GeneratedField::TrackSid), - "err" => Ok(GeneratedField::Err), + "roomName" | "room_name" => Ok(GeneratedField::RoomName), + "trackId" | "track_id" => Ok(GeneratedField::TrackId), + "file" => Ok(GeneratedField::File), + "websocketUrl" | "websocket_url" => Ok(GeneratedField::WebsocketUrl), _ => Ok(GeneratedField::__SkipField__), } } @@ -22372,120 +26357,250 @@ impl<'de> serde::Deserialize<'de> for SubscriptionResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SubscriptionResponse; + type Value = TrackEgressRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SubscriptionResponse") + formatter.write_str("struct livekit.TrackEgressRequest") } - 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 track_sid__ = None; - let mut err__ = None; + let mut room_name__ = None; + let mut track_id__ = None; + let mut output__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::TrackSid => { - if track_sid__.is_some() { - return Err(serde::de::Error::duplicate_field("trackSid")); + GeneratedField::RoomName => { + if room_name__.is_some() { + return Err(serde::de::Error::duplicate_field("roomName")); } - track_sid__ = Some(map_.next_value()?); + room_name__ = Some(map_.next_value()?); } - GeneratedField::Err => { - if err__.is_some() { - return Err(serde::de::Error::duplicate_field("err")); + GeneratedField::TrackId => { + if track_id__.is_some() { + return Err(serde::de::Error::duplicate_field("trackId")); } - err__ = Some(map_.next_value::()? as i32); + track_id__ = 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(track_egress_request::Output::File) +; + } + GeneratedField::WebsocketUrl => { + if output__.is_some() { + return Err(serde::de::Error::duplicate_field("websocketUrl")); + } + output__ = map_.next_value::<::std::option::Option<_>>()?.map(track_egress_request::Output::WebsocketUrl); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(SubscriptionResponse { - track_sid: track_sid__.unwrap_or_default(), - err: err__.unwrap_or_default(), + Ok(TrackEgressRequest { + room_name: room_name__.unwrap_or_default(), + track_id: track_id__.unwrap_or_default(), + output: output__, }) } } - deserializer.deserialize_struct("livekit.SubscriptionResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for SyncState { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.answer.is_some() { - len += 1; + deserializer.deserialize_struct("livekit.TrackEgressRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for TrackInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.sid.is_empty() { + len += 1; + } + if self.r#type != 0 { + len += 1; + } + if !self.name.is_empty() { + len += 1; + } + if self.muted { + len += 1; + } + if self.width != 0 { + len += 1; + } + if self.height != 0 { + len += 1; + } + if self.simulcast { + len += 1; + } + if self.disable_dtx { + len += 1; + } + if self.source != 0 { + len += 1; + } + if !self.layers.is_empty() { + len += 1; + } + if !self.mime_type.is_empty() { + len += 1; + } + if !self.mid.is_empty() { + len += 1; + } + if !self.codecs.is_empty() { + len += 1; + } + if self.stereo { + len += 1; + } + if self.disable_red { + len += 1; + } + if self.encryption != 0 { + len += 1; + } + if !self.stream.is_empty() { + len += 1; + } + if self.version.is_some() { + len += 1; + } + if !self.audio_features.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.TrackInfo", len)?; + if !self.sid.is_empty() { + struct_ser.serialize_field("sid", &self.sid)?; + } + if self.r#type != 0 { + let v = TrackType::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.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if self.muted { + struct_ser.serialize_field("muted", &self.muted)?; + } + if self.width != 0 { + struct_ser.serialize_field("width", &self.width)?; } - if self.subscription.is_some() { - len += 1; + if self.height != 0 { + struct_ser.serialize_field("height", &self.height)?; } - if !self.publish_tracks.is_empty() { - len += 1; + if self.simulcast { + struct_ser.serialize_field("simulcast", &self.simulcast)?; } - if !self.data_channels.is_empty() { - len += 1; + if self.disable_dtx { + struct_ser.serialize_field("disableDtx", &self.disable_dtx)?; } - if self.offer.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.track_sids_disabled.is_empty() { - len += 1; + if !self.layers.is_empty() { + struct_ser.serialize_field("layers", &self.layers)?; } - let mut struct_ser = serializer.serialize_struct("livekit.SyncState", len)?; - if let Some(v) = self.answer.as_ref() { - struct_ser.serialize_field("answer", v)?; + if !self.mime_type.is_empty() { + struct_ser.serialize_field("mimeType", &self.mime_type)?; } - if let Some(v) = self.subscription.as_ref() { - struct_ser.serialize_field("subscription", v)?; + if !self.mid.is_empty() { + struct_ser.serialize_field("mid", &self.mid)?; } - if !self.publish_tracks.is_empty() { - struct_ser.serialize_field("publishTracks", &self.publish_tracks)?; + if !self.codecs.is_empty() { + struct_ser.serialize_field("codecs", &self.codecs)?; } - if !self.data_channels.is_empty() { - struct_ser.serialize_field("dataChannels", &self.data_channels)?; + if self.stereo { + struct_ser.serialize_field("stereo", &self.stereo)?; } - if let Some(v) = self.offer.as_ref() { - struct_ser.serialize_field("offer", v)?; + if self.disable_red { + struct_ser.serialize_field("disableRed", &self.disable_red)?; } - if !self.track_sids_disabled.is_empty() { - struct_ser.serialize_field("trackSidsDisabled", &self.track_sids_disabled)?; + if self.encryption != 0 { + let v = encryption::Type::try_from(self.encryption) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.encryption)))?; + struct_ser.serialize_field("encryption", &v)?; + } + if !self.stream.is_empty() { + struct_ser.serialize_field("stream", &self.stream)?; + } + if let Some(v) = self.version.as_ref() { + struct_ser.serialize_field("version", v)?; + } + if !self.audio_features.is_empty() { + let v = self.audio_features.iter().cloned().map(|v| { + AudioTrackFeature::try_from(v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", v))) + }).collect::, _>>()?; + struct_ser.serialize_field("audioFeatures", &v)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for SyncState { +impl<'de> serde::Deserialize<'de> for TrackInfo { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "answer", - "subscription", - "publish_tracks", - "publishTracks", - "data_channels", - "dataChannels", - "offer", - "track_sids_disabled", - "trackSidsDisabled", + "sid", + "type", + "name", + "muted", + "width", + "height", + "simulcast", + "disable_dtx", + "disableDtx", + "source", + "layers", + "mime_type", + "mimeType", + "mid", + "codecs", + "stereo", + "disable_red", + "disableRed", + "encryption", + "stream", + "version", + "audio_features", + "audioFeatures", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Answer, - Subscription, - PublishTracks, - DataChannels, - Offer, - TrackSidsDisabled, + Sid, + Type, + Name, + Muted, + Width, + Height, + Simulcast, + DisableDtx, + Source, + Layers, + MimeType, + Mid, + Codecs, + Stereo, + DisableRed, + Encryption, + Stream, + Version, + AudioFeatures, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -22508,12 +26623,25 @@ impl<'de> serde::Deserialize<'de> for SyncState { E: serde::de::Error, { match value { - "answer" => Ok(GeneratedField::Answer), - "subscription" => Ok(GeneratedField::Subscription), - "publishTracks" | "publish_tracks" => Ok(GeneratedField::PublishTracks), - "dataChannels" | "data_channels" => Ok(GeneratedField::DataChannels), - "offer" => Ok(GeneratedField::Offer), - "trackSidsDisabled" | "track_sids_disabled" => Ok(GeneratedField::TrackSidsDisabled), + "sid" => Ok(GeneratedField::Sid), + "type" => Ok(GeneratedField::Type), + "name" => Ok(GeneratedField::Name), + "muted" => Ok(GeneratedField::Muted), + "width" => Ok(GeneratedField::Width), + "height" => Ok(GeneratedField::Height), + "simulcast" => Ok(GeneratedField::Simulcast), + "disableDtx" | "disable_dtx" => Ok(GeneratedField::DisableDtx), + "source" => Ok(GeneratedField::Source), + "layers" => Ok(GeneratedField::Layers), + "mimeType" | "mime_type" => Ok(GeneratedField::MimeType), + "mid" => Ok(GeneratedField::Mid), + "codecs" => Ok(GeneratedField::Codecs), + "stereo" => Ok(GeneratedField::Stereo), + "disableRed" | "disable_red" => Ok(GeneratedField::DisableRed), + "encryption" => Ok(GeneratedField::Encryption), + "stream" => Ok(GeneratedField::Stream), + "version" => Ok(GeneratedField::Version), + "audioFeatures" | "audio_features" => Ok(GeneratedField::AudioFeatures), _ => Ok(GeneratedField::__SkipField__), } } @@ -22523,79 +26651,187 @@ impl<'de> serde::Deserialize<'de> for SyncState { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SyncState; + type Value = TrackInfo; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SyncState") + formatter.write_str("struct livekit.TrackInfo") } - 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 answer__ = None; - let mut subscription__ = None; - let mut publish_tracks__ = None; - let mut data_channels__ = None; - let mut offer__ = None; - let mut track_sids_disabled__ = None; + let mut sid__ = None; + let mut r#type__ = None; + let mut name__ = None; + let mut muted__ = None; + let mut width__ = None; + let mut height__ = None; + let mut simulcast__ = None; + let mut disable_dtx__ = None; + let mut source__ = None; + let mut layers__ = None; + let mut mime_type__ = None; + let mut mid__ = None; + let mut codecs__ = None; + let mut stereo__ = None; + let mut disable_red__ = None; + let mut encryption__ = None; + let mut stream__ = None; + let mut version__ = None; + let mut audio_features__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Answer => { - if answer__.is_some() { - return Err(serde::de::Error::duplicate_field("answer")); + GeneratedField::Sid => { + if sid__.is_some() { + return Err(serde::de::Error::duplicate_field("sid")); + } + sid__ = Some(map_.next_value()?); + } + GeneratedField::Type => { + if r#type__.is_some() { + return Err(serde::de::Error::duplicate_field("type")); + } + r#type__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); + } + name__ = Some(map_.next_value()?); + } + GeneratedField::Muted => { + if muted__.is_some() { + return Err(serde::de::Error::duplicate_field("muted")); + } + muted__ = Some(map_.next_value()?); + } + 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::Simulcast => { + if simulcast__.is_some() { + return Err(serde::de::Error::duplicate_field("simulcast")); + } + simulcast__ = Some(map_.next_value()?); + } + GeneratedField::DisableDtx => { + if disable_dtx__.is_some() { + return Err(serde::de::Error::duplicate_field("disableDtx")); + } + disable_dtx__ = Some(map_.next_value()?); + } + GeneratedField::Source => { + if source__.is_some() { + return Err(serde::de::Error::duplicate_field("source")); + } + source__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Layers => { + if layers__.is_some() { + return Err(serde::de::Error::duplicate_field("layers")); } - answer__ = map_.next_value()?; + layers__ = Some(map_.next_value()?); } - GeneratedField::Subscription => { - if subscription__.is_some() { - return Err(serde::de::Error::duplicate_field("subscription")); + GeneratedField::MimeType => { + if mime_type__.is_some() { + return Err(serde::de::Error::duplicate_field("mimeType")); } - subscription__ = map_.next_value()?; + mime_type__ = Some(map_.next_value()?); } - GeneratedField::PublishTracks => { - if publish_tracks__.is_some() { - return Err(serde::de::Error::duplicate_field("publishTracks")); + GeneratedField::Mid => { + if mid__.is_some() { + return Err(serde::de::Error::duplicate_field("mid")); } - publish_tracks__ = Some(map_.next_value()?); + mid__ = Some(map_.next_value()?); } - GeneratedField::DataChannels => { - if data_channels__.is_some() { - return Err(serde::de::Error::duplicate_field("dataChannels")); + GeneratedField::Codecs => { + if codecs__.is_some() { + return Err(serde::de::Error::duplicate_field("codecs")); } - data_channels__ = Some(map_.next_value()?); + codecs__ = Some(map_.next_value()?); } - GeneratedField::Offer => { - if offer__.is_some() { - return Err(serde::de::Error::duplicate_field("offer")); + GeneratedField::Stereo => { + if stereo__.is_some() { + return Err(serde::de::Error::duplicate_field("stereo")); } - offer__ = map_.next_value()?; + stereo__ = Some(map_.next_value()?); } - GeneratedField::TrackSidsDisabled => { - if track_sids_disabled__.is_some() { - return Err(serde::de::Error::duplicate_field("trackSidsDisabled")); + GeneratedField::DisableRed => { + if disable_red__.is_some() { + return Err(serde::de::Error::duplicate_field("disableRed")); } - track_sids_disabled__ = Some(map_.next_value()?); + disable_red__ = Some(map_.next_value()?); + } + GeneratedField::Encryption => { + if encryption__.is_some() { + return Err(serde::de::Error::duplicate_field("encryption")); + } + encryption__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Stream => { + if stream__.is_some() { + return Err(serde::de::Error::duplicate_field("stream")); + } + stream__ = Some(map_.next_value()?); + } + GeneratedField::Version => { + if version__.is_some() { + return Err(serde::de::Error::duplicate_field("version")); + } + version__ = map_.next_value()?; + } + GeneratedField::AudioFeatures => { + if audio_features__.is_some() { + return Err(serde::de::Error::duplicate_field("audioFeatures")); + } + audio_features__ = Some(map_.next_value::>()?.into_iter().map(|x| x as i32).collect()); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(SyncState { - answer: answer__, - subscription: subscription__, - publish_tracks: publish_tracks__.unwrap_or_default(), - data_channels: data_channels__.unwrap_or_default(), - offer: offer__, - track_sids_disabled: track_sids_disabled__.unwrap_or_default(), + Ok(TrackInfo { + sid: sid__.unwrap_or_default(), + r#type: r#type__.unwrap_or_default(), + name: name__.unwrap_or_default(), + muted: muted__.unwrap_or_default(), + width: width__.unwrap_or_default(), + height: height__.unwrap_or_default(), + simulcast: simulcast__.unwrap_or_default(), + disable_dtx: disable_dtx__.unwrap_or_default(), + source: source__.unwrap_or_default(), + layers: layers__.unwrap_or_default(), + mime_type: mime_type__.unwrap_or_default(), + mid: mid__.unwrap_or_default(), + codecs: codecs__.unwrap_or_default(), + stereo: stereo__.unwrap_or_default(), + disable_red: disable_red__.unwrap_or_default(), + encryption: encryption__.unwrap_or_default(), + stream: stream__.unwrap_or_default(), + version: version__, + audio_features: audio_features__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.SyncState", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.TrackInfo", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for TimedVersion { +impl serde::Serialize for TrackPermission { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -22603,39 +26839,57 @@ impl serde::Serialize for TimedVersion { { use serde::ser::SerializeStruct; let mut len = 0; - if self.unix_micro != 0 { + if !self.participant_sid.is_empty() { len += 1; } - if self.ticks != 0 { + if self.all_tracks { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.TimedVersion", len)?; - if self.unix_micro != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("unixMicro", ToString::to_string(&self.unix_micro).as_str())?; + if !self.track_sids.is_empty() { + len += 1; } - if self.ticks != 0 { - struct_ser.serialize_field("ticks", &self.ticks)?; + if !self.participant_identity.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.TrackPermission", len)?; + if !self.participant_sid.is_empty() { + struct_ser.serialize_field("participantSid", &self.participant_sid)?; + } + if self.all_tracks { + struct_ser.serialize_field("allTracks", &self.all_tracks)?; + } + if !self.track_sids.is_empty() { + struct_ser.serialize_field("trackSids", &self.track_sids)?; + } + if !self.participant_identity.is_empty() { + struct_ser.serialize_field("participantIdentity", &self.participant_identity)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for TimedVersion { +impl<'de> serde::Deserialize<'de> for TrackPermission { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "unix_micro", - "unixMicro", - "ticks", + "participant_sid", + "participantSid", + "all_tracks", + "allTracks", + "track_sids", + "trackSids", + "participant_identity", + "participantIdentity", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - UnixMicro, - Ticks, + ParticipantSid, + AllTracks, + TrackSids, + ParticipantIdentity, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -22658,8 +26912,10 @@ impl<'de> serde::Deserialize<'de> for TimedVersion { E: serde::de::Error, { match value { - "unixMicro" | "unix_micro" => Ok(GeneratedField::UnixMicro), - "ticks" => Ok(GeneratedField::Ticks), + "participantSid" | "participant_sid" => Ok(GeneratedField::ParticipantSid), + "allTracks" | "all_tracks" => Ok(GeneratedField::AllTracks), + "trackSids" | "track_sids" => Ok(GeneratedField::TrackSids), + "participantIdentity" | "participant_identity" => Ok(GeneratedField::ParticipantIdentity), _ => Ok(GeneratedField::__SkipField__), } } @@ -22669,177 +26925,101 @@ impl<'de> serde::Deserialize<'de> for TimedVersion { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TimedVersion; + type Value = TrackPermission; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.TimedVersion") + formatter.write_str("struct livekit.TrackPermission") } - 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 unix_micro__ = None; - let mut ticks__ = None; + let mut participant_sid__ = None; + let mut all_tracks__ = None; + let mut track_sids__ = None; + let mut participant_identity__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::UnixMicro => { - if unix_micro__.is_some() { - return Err(serde::de::Error::duplicate_field("unixMicro")); + GeneratedField::ParticipantSid => { + if participant_sid__.is_some() { + return Err(serde::de::Error::duplicate_field("participantSid")); } - unix_micro__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + participant_sid__ = Some(map_.next_value()?); } - GeneratedField::Ticks => { - if ticks__.is_some() { - return Err(serde::de::Error::duplicate_field("ticks")); + GeneratedField::AllTracks => { + if all_tracks__.is_some() { + return Err(serde::de::Error::duplicate_field("allTracks")); } - ticks__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + all_tracks__ = Some(map_.next_value()?); + } + GeneratedField::TrackSids => { + if track_sids__.is_some() { + return Err(serde::de::Error::duplicate_field("trackSids")); + } + track_sids__ = 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::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(TimedVersion { - unix_micro: unix_micro__.unwrap_or_default(), - ticks: ticks__.unwrap_or_default(), + Ok(TrackPermission { + participant_sid: participant_sid__.unwrap_or_default(), + all_tracks: all_tracks__.unwrap_or_default(), + track_sids: track_sids__.unwrap_or_default(), + participant_identity: participant_identity__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.TimedVersion", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.TrackPermission", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for TrackCompositeEgressRequest { +impl serde::Serialize for TrackPublishedResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.room_name.is_empty() { - len += 1; - } - if !self.audio_track_id.is_empty() { - len += 1; - } - if !self.video_track_id.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() { - len += 1; - } - if self.options.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("livekit.TrackCompositeEgressRequest", len)?; - if !self.room_name.is_empty() { - struct_ser.serialize_field("roomName", &self.room_name)?; - } - if !self.audio_track_id.is_empty() { - struct_ser.serialize_field("audioTrackId", &self.audio_track_id)?; - } - if !self.video_track_id.is_empty() { - struct_ser.serialize_field("videoTrackId", &self.video_track_id)?; - } - 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)?; + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.cid.is_empty() { + len += 1; } - if !self.image_outputs.is_empty() { - struct_ser.serialize_field("imageOutputs", &self.image_outputs)?; + if self.track.is_some() { + len += 1; } - if let Some(v) = self.output.as_ref() { - match v { - track_composite_egress_request::Output::File(v) => { - struct_ser.serialize_field("file", v)?; - } - track_composite_egress_request::Output::Stream(v) => { - struct_ser.serialize_field("stream", v)?; - } - track_composite_egress_request::Output::Segments(v) => { - struct_ser.serialize_field("segments", v)?; - } - } + let mut struct_ser = serializer.serialize_struct("livekit.TrackPublishedResponse", len)?; + if !self.cid.is_empty() { + struct_ser.serialize_field("cid", &self.cid)?; } - if let Some(v) = self.options.as_ref() { - match v { - track_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)?; - } - track_composite_egress_request::Options::Advanced(v) => { - struct_ser.serialize_field("advanced", v)?; - } - } + if let Some(v) = self.track.as_ref() { + struct_ser.serialize_field("track", v)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for TrackCompositeEgressRequest { +impl<'de> serde::Deserialize<'de> for TrackPublishedResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "room_name", - "roomName", - "audio_track_id", - "audioTrackId", - "video_track_id", - "videoTrackId", - "file_outputs", - "fileOutputs", - "stream_outputs", - "streamOutputs", - "segment_outputs", - "segmentOutputs", - "image_outputs", - "imageOutputs", - "file", - "stream", - "segments", - "preset", - "advanced", + "cid", + "track", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - RoomName, - AudioTrackId, - VideoTrackId, - FileOutputs, - StreamOutputs, - SegmentOutputs, - ImageOutputs, - File, - Stream, - Segments, - Preset, - Advanced, + Cid, + Track, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -22862,18 +27042,8 @@ impl<'de> serde::Deserialize<'de> for TrackCompositeEgressRequest { E: serde::de::Error, { match value { - "roomName" | "room_name" => Ok(GeneratedField::RoomName), - "audioTrackId" | "audio_track_id" => Ok(GeneratedField::AudioTrackId), - "videoTrackId" | "video_track_id" => Ok(GeneratedField::VideoTrackId), - "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), + "cid" => Ok(GeneratedField::Cid), + "track" => Ok(GeneratedField::Track), _ => Ok(GeneratedField::__SkipField__), } } @@ -22883,125 +27053,127 @@ impl<'de> serde::Deserialize<'de> for TrackCompositeEgressRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TrackCompositeEgressRequest; + type Value = TrackPublishedResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.TrackCompositeEgressRequest") + formatter.write_str("struct livekit.TrackPublishedResponse") } - 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 audio_track_id__ = None; - let mut video_track_id__ = 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 cid__ = None; + let mut track__ = 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::AudioTrackId => { - if audio_track_id__.is_some() { - return Err(serde::de::Error::duplicate_field("audioTrackId")); - } - audio_track_id__ = Some(map_.next_value()?); - } - GeneratedField::VideoTrackId => { - if video_track_id__.is_some() { - return Err(serde::de::Error::duplicate_field("videoTrackId")); - } - video_track_id__ = 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(track_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(track_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(track_composite_egress_request::Output::Segments) -; - } - GeneratedField::Preset => { - if options__.is_some() { - return Err(serde::de::Error::duplicate_field("preset")); + GeneratedField::Cid => { + if cid__.is_some() { + return Err(serde::de::Error::duplicate_field("cid")); } - options__ = map_.next_value::<::std::option::Option>()?.map(|x| track_composite_egress_request::Options::Preset(x as i32)); + cid__ = Some(map_.next_value()?); } - GeneratedField::Advanced => { - if options__.is_some() { - return Err(serde::de::Error::duplicate_field("advanced")); + GeneratedField::Track => { + if track__.is_some() { + return Err(serde::de::Error::duplicate_field("track")); } - options__ = map_.next_value::<::std::option::Option<_>>()?.map(track_composite_egress_request::Options::Advanced) -; + track__ = map_.next_value()?; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(TrackCompositeEgressRequest { - room_name: room_name__.unwrap_or_default(), - audio_track_id: audio_track_id__.unwrap_or_default(), - video_track_id: video_track_id__.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(TrackPublishedResponse { + cid: cid__.unwrap_or_default(), + track: track__, + }) + } + } + deserializer.deserialize_struct("livekit.TrackPublishedResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for TrackSource { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unknown => "UNKNOWN", + Self::Camera => "CAMERA", + Self::Microphone => "MICROPHONE", + Self::ScreenShare => "SCREEN_SHARE", + Self::ScreenShareAudio => "SCREEN_SHARE_AUDIO", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for TrackSource { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "UNKNOWN", + "CAMERA", + "MICROPHONE", + "SCREEN_SHARE", + "SCREEN_SHARE_AUDIO", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = TrackSource; + + 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 { + "UNKNOWN" => Ok(TrackSource::Unknown), + "CAMERA" => Ok(TrackSource::Camera), + "MICROPHONE" => Ok(TrackSource::Microphone), + "SCREEN_SHARE" => Ok(TrackSource::ScreenShare), + "SCREEN_SHARE_AUDIO" => Ok(TrackSource::ScreenShareAudio), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } } } - deserializer.deserialize_struct("livekit.TrackCompositeEgressRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_any(GeneratedVisitor) } } -impl serde::Serialize for TrackEgressRequest { +impl serde::Serialize for TrackSubscribed { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -23009,57 +27181,30 @@ impl serde::Serialize for TrackEgressRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.room_name.is_empty() { - len += 1; - } - if !self.track_id.is_empty() { - len += 1; - } - if self.output.is_some() { + if !self.track_sid.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.TrackEgressRequest", len)?; - if !self.room_name.is_empty() { - struct_ser.serialize_field("roomName", &self.room_name)?; - } - if !self.track_id.is_empty() { - struct_ser.serialize_field("trackId", &self.track_id)?; - } - if let Some(v) = self.output.as_ref() { - match v { - track_egress_request::Output::File(v) => { - struct_ser.serialize_field("file", v)?; - } - track_egress_request::Output::WebsocketUrl(v) => { - struct_ser.serialize_field("websocketUrl", v)?; - } - } + let mut struct_ser = serializer.serialize_struct("livekit.TrackSubscribed", len)?; + if !self.track_sid.is_empty() { + struct_ser.serialize_field("trackSid", &self.track_sid)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for TrackEgressRequest { +impl<'de> serde::Deserialize<'de> for TrackSubscribed { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "room_name", - "roomName", - "track_id", - "trackId", - "file", - "websocket_url", - "websocketUrl", + "track_sid", + "trackSid", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - RoomName, - TrackId, - File, - WebsocketUrl, + TrackSid, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -23082,10 +27227,7 @@ impl<'de> serde::Deserialize<'de> for TrackEgressRequest { E: serde::de::Error, { match value { - "roomName" | "room_name" => Ok(GeneratedField::RoomName), - "trackId" | "track_id" => Ok(GeneratedField::TrackId), - "file" => Ok(GeneratedField::File), - "websocketUrl" | "websocket_url" => Ok(GeneratedField::WebsocketUrl), + "trackSid" | "track_sid" => Ok(GeneratedField::TrackSid), _ => Ok(GeneratedField::__SkipField__), } } @@ -23095,250 +27237,144 @@ impl<'de> serde::Deserialize<'de> for TrackEgressRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TrackEgressRequest; + type Value = TrackSubscribed; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.TrackEgressRequest") + formatter.write_str("struct livekit.TrackSubscribed") } - 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 track_id__ = None; - let mut output__ = None; + let mut track_sid__ = 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::TrackId => { - if track_id__.is_some() { - return Err(serde::de::Error::duplicate_field("trackId")); - } - track_id__ = 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(track_egress_request::Output::File) -; - } - GeneratedField::WebsocketUrl => { - if output__.is_some() { - return Err(serde::de::Error::duplicate_field("websocketUrl")); + GeneratedField::TrackSid => { + if track_sid__.is_some() { + return Err(serde::de::Error::duplicate_field("trackSid")); } - output__ = map_.next_value::<::std::option::Option<_>>()?.map(track_egress_request::Output::WebsocketUrl); + track_sid__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(TrackEgressRequest { - room_name: room_name__.unwrap_or_default(), - track_id: track_id__.unwrap_or_default(), - output: output__, + Ok(TrackSubscribed { + track_sid: track_sid__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.TrackEgressRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.TrackSubscribed", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for TrackInfo { +impl serde::Serialize for TrackType { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.sid.is_empty() { - len += 1; - } - if self.r#type != 0 { - len += 1; - } - if !self.name.is_empty() { - len += 1; - } - if self.muted { - len += 1; - } - if self.width != 0 { - len += 1; - } - if self.height != 0 { - len += 1; - } - if self.simulcast { - len += 1; - } - if self.disable_dtx { - len += 1; - } - if self.source != 0 { - len += 1; - } - if !self.layers.is_empty() { - len += 1; - } - if !self.mime_type.is_empty() { - len += 1; - } - if !self.mid.is_empty() { - len += 1; - } - if !self.codecs.is_empty() { - len += 1; - } - if self.stereo { - len += 1; - } - if self.disable_red { - len += 1; - } - if self.encryption != 0 { - len += 1; - } - if !self.stream.is_empty() { - len += 1; - } - if self.version.is_some() { - len += 1; - } - if !self.audio_features.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("livekit.TrackInfo", len)?; - if !self.sid.is_empty() { - struct_ser.serialize_field("sid", &self.sid)?; - } - if self.r#type != 0 { - let v = TrackType::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.name.is_empty() { - struct_ser.serialize_field("name", &self.name)?; - } - if self.muted { - struct_ser.serialize_field("muted", &self.muted)?; - } - if self.width != 0 { - struct_ser.serialize_field("width", &self.width)?; - } - if self.height != 0 { - struct_ser.serialize_field("height", &self.height)?; - } - if self.simulcast { - struct_ser.serialize_field("simulcast", &self.simulcast)?; - } - if self.disable_dtx { - struct_ser.serialize_field("disableDtx", &self.disable_dtx)?; - } - 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.layers.is_empty() { - struct_ser.serialize_field("layers", &self.layers)?; - } - if !self.mime_type.is_empty() { - struct_ser.serialize_field("mimeType", &self.mime_type)?; - } - if !self.mid.is_empty() { - struct_ser.serialize_field("mid", &self.mid)?; - } - if !self.codecs.is_empty() { - struct_ser.serialize_field("codecs", &self.codecs)?; - } - if self.stereo { - struct_ser.serialize_field("stereo", &self.stereo)?; - } - if self.disable_red { - struct_ser.serialize_field("disableRed", &self.disable_red)?; - } - if self.encryption != 0 { - let v = encryption::Type::try_from(self.encryption) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.encryption)))?; - struct_ser.serialize_field("encryption", &v)?; - } - if !self.stream.is_empty() { - struct_ser.serialize_field("stream", &self.stream)?; + let variant = match self { + Self::Audio => "AUDIO", + Self::Video => "VIDEO", + Self::Data => "DATA", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for TrackType { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "AUDIO", + "VIDEO", + "DATA", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = TrackType; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> std::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "AUDIO" => Ok(TrackType::Audio), + "VIDEO" => Ok(TrackType::Video), + "DATA" => Ok(TrackType::Data), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } } - if let Some(v) = self.version.as_ref() { - struct_ser.serialize_field("version", v)?; + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for TrackUnpublishedResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.track_sid.is_empty() { + len += 1; } - if !self.audio_features.is_empty() { - let v = self.audio_features.iter().cloned().map(|v| { - AudioTrackFeature::try_from(v) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", v))) - }).collect::, _>>()?; - struct_ser.serialize_field("audioFeatures", &v)?; + let mut struct_ser = serializer.serialize_struct("livekit.TrackUnpublishedResponse", len)?; + if !self.track_sid.is_empty() { + struct_ser.serialize_field("trackSid", &self.track_sid)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for TrackInfo { +impl<'de> serde::Deserialize<'de> for TrackUnpublishedResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "sid", - "type", - "name", - "muted", - "width", - "height", - "simulcast", - "disable_dtx", - "disableDtx", - "source", - "layers", - "mime_type", - "mimeType", - "mid", - "codecs", - "stereo", - "disable_red", - "disableRed", - "encryption", - "stream", - "version", - "audio_features", - "audioFeatures", + "track_sid", + "trackSid", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Sid, - Type, - Name, - Muted, - Width, - Height, - Simulcast, - DisableDtx, - Source, - Layers, - MimeType, - Mid, - Codecs, - Stereo, - DisableRed, - Encryption, - Stream, - Version, - AudioFeatures, + TrackSid, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -23361,25 +27397,7 @@ impl<'de> serde::Deserialize<'de> for TrackInfo { E: serde::de::Error, { match value { - "sid" => Ok(GeneratedField::Sid), - "type" => Ok(GeneratedField::Type), - "name" => Ok(GeneratedField::Name), - "muted" => Ok(GeneratedField::Muted), - "width" => Ok(GeneratedField::Width), - "height" => Ok(GeneratedField::Height), - "simulcast" => Ok(GeneratedField::Simulcast), - "disableDtx" | "disable_dtx" => Ok(GeneratedField::DisableDtx), - "source" => Ok(GeneratedField::Source), - "layers" => Ok(GeneratedField::Layers), - "mimeType" | "mime_type" => Ok(GeneratedField::MimeType), - "mid" => Ok(GeneratedField::Mid), - "codecs" => Ok(GeneratedField::Codecs), - "stereo" => Ok(GeneratedField::Stereo), - "disableRed" | "disable_red" => Ok(GeneratedField::DisableRed), - "encryption" => Ok(GeneratedField::Encryption), - "stream" => Ok(GeneratedField::Stream), - "version" => Ok(GeneratedField::Version), - "audioFeatures" | "audio_features" => Ok(GeneratedField::AudioFeatures), + "trackSid" | "track_sid" => Ok(GeneratedField::TrackSid), _ => Ok(GeneratedField::__SkipField__), } } @@ -23389,187 +27407,170 @@ impl<'de> serde::Deserialize<'de> for TrackInfo { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TrackInfo; + type Value = TrackUnpublishedResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.TrackInfo") + formatter.write_str("struct livekit.TrackUnpublishedResponse") } - 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 r#type__ = None; - let mut name__ = None; - let mut muted__ = None; - let mut width__ = None; - let mut height__ = None; - let mut simulcast__ = None; - let mut disable_dtx__ = None; - let mut source__ = None; - let mut layers__ = None; - let mut mime_type__ = None; - let mut mid__ = None; - let mut codecs__ = None; - let mut stereo__ = None; - let mut disable_red__ = None; - let mut encryption__ = None; - let mut stream__ = None; - let mut version__ = None; - let mut audio_features__ = None; + let mut track_sid__ = 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::Type => { - if r#type__.is_some() { - return Err(serde::de::Error::duplicate_field("type")); - } - r#type__ = Some(map_.next_value::()? as i32); - } - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); - } - name__ = Some(map_.next_value()?); - } - GeneratedField::Muted => { - if muted__.is_some() { - return Err(serde::de::Error::duplicate_field("muted")); - } - muted__ = Some(map_.next_value()?); - } - 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::Simulcast => { - if simulcast__.is_some() { - return Err(serde::de::Error::duplicate_field("simulcast")); - } - simulcast__ = Some(map_.next_value()?); - } - GeneratedField::DisableDtx => { - if disable_dtx__.is_some() { - return Err(serde::de::Error::duplicate_field("disableDtx")); - } - disable_dtx__ = Some(map_.next_value()?); - } - GeneratedField::Source => { - if source__.is_some() { - return Err(serde::de::Error::duplicate_field("source")); - } - source__ = Some(map_.next_value::()? as i32); - } - GeneratedField::Layers => { - if layers__.is_some() { - return Err(serde::de::Error::duplicate_field("layers")); - } - layers__ = Some(map_.next_value()?); - } - GeneratedField::MimeType => { - if mime_type__.is_some() { - return Err(serde::de::Error::duplicate_field("mimeType")); - } - mime_type__ = Some(map_.next_value()?); - } - GeneratedField::Mid => { - if mid__.is_some() { - return Err(serde::de::Error::duplicate_field("mid")); - } - mid__ = Some(map_.next_value()?); - } - GeneratedField::Codecs => { - if codecs__.is_some() { - return Err(serde::de::Error::duplicate_field("codecs")); - } - codecs__ = Some(map_.next_value()?); - } - GeneratedField::Stereo => { - if stereo__.is_some() { - return Err(serde::de::Error::duplicate_field("stereo")); - } - stereo__ = Some(map_.next_value()?); - } - GeneratedField::DisableRed => { - if disable_red__.is_some() { - return Err(serde::de::Error::duplicate_field("disableRed")); - } - disable_red__ = Some(map_.next_value()?); - } - GeneratedField::Encryption => { - if encryption__.is_some() { - return Err(serde::de::Error::duplicate_field("encryption")); + GeneratedField::TrackSid => { + if track_sid__.is_some() { + return Err(serde::de::Error::duplicate_field("trackSid")); } - encryption__ = Some(map_.next_value::()? as i32); + track_sid__ = Some(map_.next_value()?); } - GeneratedField::Stream => { - if stream__.is_some() { - return Err(serde::de::Error::duplicate_field("stream")); + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(TrackUnpublishedResponse { + track_sid: track_sid__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("livekit.TrackUnpublishedResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Transcription { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.transcribed_participant_identity.is_empty() { + len += 1; + } + if !self.track_id.is_empty() { + len += 1; + } + if !self.segments.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.Transcription", len)?; + if !self.transcribed_participant_identity.is_empty() { + struct_ser.serialize_field("transcribedParticipantIdentity", &self.transcribed_participant_identity)?; + } + if !self.track_id.is_empty() { + struct_ser.serialize_field("trackId", &self.track_id)?; + } + if !self.segments.is_empty() { + struct_ser.serialize_field("segments", &self.segments)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Transcription { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "transcribed_participant_identity", + "transcribedParticipantIdentity", + "track_id", + "trackId", + "segments", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + TranscribedParticipantIdentity, + TrackId, + Segments, + __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 { + "transcribedParticipantIdentity" | "transcribed_participant_identity" => Ok(GeneratedField::TranscribedParticipantIdentity), + "trackId" | "track_id" => Ok(GeneratedField::TrackId), + "segments" => Ok(GeneratedField::Segments), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Transcription; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.Transcription") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut transcribed_participant_identity__ = None; + let mut track_id__ = None; + let mut segments__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::TranscribedParticipantIdentity => { + if transcribed_participant_identity__.is_some() { + return Err(serde::de::Error::duplicate_field("transcribedParticipantIdentity")); } - stream__ = Some(map_.next_value()?); + transcribed_participant_identity__ = Some(map_.next_value()?); } - GeneratedField::Version => { - if version__.is_some() { - return Err(serde::de::Error::duplicate_field("version")); + GeneratedField::TrackId => { + if track_id__.is_some() { + return Err(serde::de::Error::duplicate_field("trackId")); } - version__ = map_.next_value()?; + track_id__ = Some(map_.next_value()?); } - GeneratedField::AudioFeatures => { - if audio_features__.is_some() { - return Err(serde::de::Error::duplicate_field("audioFeatures")); + GeneratedField::Segments => { + if segments__.is_some() { + return Err(serde::de::Error::duplicate_field("segments")); } - audio_features__ = Some(map_.next_value::>()?.into_iter().map(|x| x as i32).collect()); + segments__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(TrackInfo { - sid: sid__.unwrap_or_default(), - r#type: r#type__.unwrap_or_default(), - name: name__.unwrap_or_default(), - muted: muted__.unwrap_or_default(), - width: width__.unwrap_or_default(), - height: height__.unwrap_or_default(), - simulcast: simulcast__.unwrap_or_default(), - disable_dtx: disable_dtx__.unwrap_or_default(), - source: source__.unwrap_or_default(), - layers: layers__.unwrap_or_default(), - mime_type: mime_type__.unwrap_or_default(), - mid: mid__.unwrap_or_default(), - codecs: codecs__.unwrap_or_default(), - stereo: stereo__.unwrap_or_default(), - disable_red: disable_red__.unwrap_or_default(), - encryption: encryption__.unwrap_or_default(), - stream: stream__.unwrap_or_default(), - version: version__, - audio_features: audio_features__.unwrap_or_default(), + Ok(Transcription { + transcribed_participant_identity: transcribed_participant_identity__.unwrap_or_default(), + track_id: track_id__.unwrap_or_default(), + segments: segments__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.TrackInfo", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.Transcription", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for TrackPermission { +impl serde::Serialize for TranscriptionSegment { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -23577,57 +27578,73 @@ impl serde::Serialize for TrackPermission { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.participant_sid.is_empty() { + if !self.id.is_empty() { len += 1; } - if self.all_tracks { + if !self.text.is_empty() { len += 1; } - if !self.track_sids.is_empty() { + if self.start_time != 0 { len += 1; } - if !self.participant_identity.is_empty() { + if self.end_time != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.TrackPermission", len)?; - if !self.participant_sid.is_empty() { - struct_ser.serialize_field("participantSid", &self.participant_sid)?; + if self.r#final { + len += 1; } - if self.all_tracks { - struct_ser.serialize_field("allTracks", &self.all_tracks)?; + if !self.language.is_empty() { + len += 1; } - if !self.track_sids.is_empty() { - struct_ser.serialize_field("trackSids", &self.track_sids)?; + let mut struct_ser = serializer.serialize_struct("livekit.TranscriptionSegment", len)?; + if !self.id.is_empty() { + struct_ser.serialize_field("id", &self.id)?; } - if !self.participant_identity.is_empty() { - struct_ser.serialize_field("participantIdentity", &self.participant_identity)?; + if !self.text.is_empty() { + struct_ser.serialize_field("text", &self.text)?; + } + if self.start_time != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("startTime", ToString::to_string(&self.start_time).as_str())?; + } + if self.end_time != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("endTime", ToString::to_string(&self.end_time).as_str())?; + } + if self.r#final { + struct_ser.serialize_field("final", &self.r#final)?; + } + if !self.language.is_empty() { + struct_ser.serialize_field("language", &self.language)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for TrackPermission { +impl<'de> serde::Deserialize<'de> for TranscriptionSegment { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "participant_sid", - "participantSid", - "all_tracks", - "allTracks", - "track_sids", - "trackSids", - "participant_identity", - "participantIdentity", + "id", + "text", + "start_time", + "startTime", + "end_time", + "endTime", + "final", + "language", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - ParticipantSid, - AllTracks, - TrackSids, - ParticipantIdentity, + Id, + Text, + StartTime, + EndTime, + Final, + Language, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -23650,10 +27667,12 @@ impl<'de> serde::Deserialize<'de> for TrackPermission { E: serde::de::Error, { match value { - "participantSid" | "participant_sid" => Ok(GeneratedField::ParticipantSid), - "allTracks" | "all_tracks" => Ok(GeneratedField::AllTracks), - "trackSids" | "track_sids" => Ok(GeneratedField::TrackSids), - "participantIdentity" | "participant_identity" => Ok(GeneratedField::ParticipantIdentity), + "id" => Ok(GeneratedField::Id), + "text" => Ok(GeneratedField::Text), + "startTime" | "start_time" => Ok(GeneratedField::StartTime), + "endTime" | "end_time" => Ok(GeneratedField::EndTime), + "final" => Ok(GeneratedField::Final), + "language" => Ok(GeneratedField::Language), _ => Ok(GeneratedField::__SkipField__), } } @@ -23663,63 +27682,83 @@ impl<'de> serde::Deserialize<'de> for TrackPermission { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TrackPermission; + type Value = TranscriptionSegment; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.TrackPermission") + formatter.write_str("struct livekit.TranscriptionSegment") } - 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 participant_sid__ = None; - let mut all_tracks__ = None; - let mut track_sids__ = None; - let mut participant_identity__ = None; + { + let mut id__ = None; + let mut text__ = None; + let mut start_time__ = None; + let mut end_time__ = None; + let mut r#final__ = None; + let mut language__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::ParticipantSid => { - if participant_sid__.is_some() { - return Err(serde::de::Error::duplicate_field("participantSid")); + GeneratedField::Id => { + if id__.is_some() { + return Err(serde::de::Error::duplicate_field("id")); } - participant_sid__ = Some(map_.next_value()?); + id__ = Some(map_.next_value()?); } - GeneratedField::AllTracks => { - if all_tracks__.is_some() { - return Err(serde::de::Error::duplicate_field("allTracks")); + GeneratedField::Text => { + if text__.is_some() { + return Err(serde::de::Error::duplicate_field("text")); } - all_tracks__ = Some(map_.next_value()?); + text__ = Some(map_.next_value()?); } - GeneratedField::TrackSids => { - if track_sids__.is_some() { - return Err(serde::de::Error::duplicate_field("trackSids")); + GeneratedField::StartTime => { + if start_time__.is_some() { + return Err(serde::de::Error::duplicate_field("startTime")); } - track_sids__ = Some(map_.next_value()?); + start_time__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } - GeneratedField::ParticipantIdentity => { - if participant_identity__.is_some() { - return Err(serde::de::Error::duplicate_field("participantIdentity")); + GeneratedField::EndTime => { + if end_time__.is_some() { + return Err(serde::de::Error::duplicate_field("endTime")); } - participant_identity__ = Some(map_.next_value()?); + end_time__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Final => { + if r#final__.is_some() { + return Err(serde::de::Error::duplicate_field("final")); + } + r#final__ = Some(map_.next_value()?); + } + GeneratedField::Language => { + if language__.is_some() { + return Err(serde::de::Error::duplicate_field("language")); + } + language__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(TrackPermission { - participant_sid: participant_sid__.unwrap_or_default(), - all_tracks: all_tracks__.unwrap_or_default(), - track_sids: track_sids__.unwrap_or_default(), - participant_identity: participant_identity__.unwrap_or_default(), + Ok(TranscriptionSegment { + id: id__.unwrap_or_default(), + text: text__.unwrap_or_default(), + start_time: start_time__.unwrap_or_default(), + end_time: end_time__.unwrap_or_default(), + r#final: r#final__.unwrap_or_default(), + language: language__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.TrackPermission", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.TranscriptionSegment", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for TrackPublishedResponse { +impl serde::Serialize for TrickleRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -23727,37 +27766,39 @@ impl serde::Serialize for TrackPublishedResponse { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.cid.is_empty() { + if !self.candidate_init.is_empty() { len += 1; } - if self.track.is_some() { + if self.target != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.TrackPublishedResponse", len)?; - if !self.cid.is_empty() { - struct_ser.serialize_field("cid", &self.cid)?; + let mut struct_ser = serializer.serialize_struct("livekit.TrickleRequest", len)?; + if !self.candidate_init.is_empty() { + struct_ser.serialize_field("candidateInit", &self.candidate_init)?; } - if let Some(v) = self.track.as_ref() { - struct_ser.serialize_field("track", v)?; + if self.target != 0 { + let v = SignalTarget::try_from(self.target) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.target)))?; + struct_ser.serialize_field("target", &v)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for TrackPublishedResponse { +impl<'de> serde::Deserialize<'de> for TrickleRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "cid", - "track", + "candidateInit", + "target", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Cid, - Track, + CandidateInit, + Target, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -23780,8 +27821,8 @@ impl<'de> serde::Deserialize<'de> for TrackPublishedResponse { E: serde::de::Error, { match value { - "cid" => Ok(GeneratedField::Cid), - "track" => Ok(GeneratedField::Track), + "candidateInit" => Ok(GeneratedField::CandidateInit), + "target" => Ok(GeneratedField::Target), _ => Ok(GeneratedField::__SkipField__), } } @@ -23791,201 +27832,302 @@ impl<'de> serde::Deserialize<'de> for TrackPublishedResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TrackPublishedResponse; + type Value = TrickleRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.TrackPublishedResponse") + formatter.write_str("struct livekit.TrickleRequest") } - 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 cid__ = None; - let mut track__ = None; + let mut candidate_init__ = None; + let mut target__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Cid => { - if cid__.is_some() { - return Err(serde::de::Error::duplicate_field("cid")); + GeneratedField::CandidateInit => { + if candidate_init__.is_some() { + return Err(serde::de::Error::duplicate_field("candidateInit")); } - cid__ = Some(map_.next_value()?); + candidate_init__ = Some(map_.next_value()?); } - GeneratedField::Track => { - if track__.is_some() { - return Err(serde::de::Error::duplicate_field("track")); + GeneratedField::Target => { + if target__.is_some() { + return Err(serde::de::Error::duplicate_field("target")); } - track__ = map_.next_value()?; + target__ = Some(map_.next_value::()? as i32); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(TrackPublishedResponse { - cid: cid__.unwrap_or_default(), - track: track__, + Ok(TrickleRequest { + candidate_init: candidate_init__.unwrap_or_default(), + target: target__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.TrackPublishedResponse", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.TrickleRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for TrackSource { +impl serde::Serialize for UpdateIngressRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { - let variant = match self { - Self::Unknown => "UNKNOWN", - Self::Camera => "CAMERA", - Self::Microphone => "MICROPHONE", - Self::ScreenShare => "SCREEN_SHARE", - Self::ScreenShareAudio => "SCREEN_SHARE_AUDIO", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for TrackSource { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "UNKNOWN", - "CAMERA", - "MICROPHONE", - "SCREEN_SHARE", - "SCREEN_SHARE_AUDIO", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TrackSource; - - 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 { - "UNKNOWN" => Ok(TrackSource::Unknown), - "CAMERA" => Ok(TrackSource::Camera), - "MICROPHONE" => Ok(TrackSource::Microphone), - "SCREEN_SHARE" => Ok(TrackSource::ScreenShare), - "SCREEN_SHARE_AUDIO" => Ok(TrackSource::ScreenShareAudio), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.ingress_id.is_empty() { + len += 1; + } + if !self.name.is_empty() { + 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.bypass_transcoding.is_some() { + len += 1; + } + if self.enable_transcoding.is_some() { + len += 1; + } + if self.audio.is_some() { + len += 1; + } + if self.video.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.UpdateIngressRequest", 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.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)?; } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for TrackType { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::Audio => "AUDIO", - Self::Video => "VIDEO", - Self::Data => "DATA", - }; - serializer.serialize_str(variant) + if let Some(v) = self.bypass_transcoding.as_ref() { + struct_ser.serialize_field("bypassTranscoding", v)?; + } + 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)?; + } + struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for TrackType { +impl<'de> serde::Deserialize<'de> for UpdateIngressRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "AUDIO", - "VIDEO", - "DATA", + "ingress_id", + "ingressId", + "name", + "room_name", + "roomName", + "participant_identity", + "participantIdentity", + "participant_name", + "participantName", + "participant_metadata", + "participantMetadata", + "bypass_transcoding", + "bypassTranscoding", + "enable_transcoding", + "enableTranscoding", + "audio", + "video", ]; - struct GeneratedVisitor; + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + IngressId, + Name, + RoomName, + ParticipantIdentity, + ParticipantName, + ParticipantMetadata, + BypassTranscoding, + EnableTranscoding, + Audio, + Video, + __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 = TrackType; + 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 { + "ingressId" | "ingress_id" => Ok(GeneratedField::IngressId), + "name" => Ok(GeneratedField::Name), + "roomName" | "room_name" => Ok(GeneratedField::RoomName), + "participantIdentity" | "participant_identity" => Ok(GeneratedField::ParticipantIdentity), + "participantName" | "participant_name" => Ok(GeneratedField::ParticipantName), + "participantMetadata" | "participant_metadata" => Ok(GeneratedField::ParticipantMetadata), + "bypassTranscoding" | "bypass_transcoding" => Ok(GeneratedField::BypassTranscoding), + "enableTranscoding" | "enable_transcoding" => Ok(GeneratedField::EnableTranscoding), + "audio" => Ok(GeneratedField::Audio), + "video" => Ok(GeneratedField::Video), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = UpdateIngressRequest; - 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.UpdateIngressRequest") } - 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 { - "AUDIO" => Ok(TrackType::Audio), - "VIDEO" => Ok(TrackType::Video), - "DATA" => Ok(TrackType::Data), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + let mut ingress_id__ = None; + let mut name__ = None; + let mut room_name__ = None; + let mut participant_identity__ = None; + let mut participant_name__ = None; + let mut participant_metadata__ = None; + let mut bypass_transcoding__ = None; + let mut enable_transcoding__ = None; + let mut audio__ = None; + let mut video__ = 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::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::BypassTranscoding => { + if bypass_transcoding__.is_some() { + return Err(serde::de::Error::duplicate_field("bypassTranscoding")); + } + bypass_transcoding__ = 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::__SkipField__ => { + let _ = map_.next_value::()?; + } + } } + Ok(UpdateIngressRequest { + ingress_id: ingress_id__.unwrap_or_default(), + name: name__.unwrap_or_default(), + 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(), + bypass_transcoding: bypass_transcoding__, + enable_transcoding: enable_transcoding__, + audio: audio__, + video: video__, + }) } } - deserializer.deserialize_any(GeneratedVisitor) + deserializer.deserialize_struct("livekit.UpdateIngressRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for TrackUnpublishedResponse { +impl serde::Serialize for UpdateJobStatus { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -23993,30 +28135,48 @@ impl serde::Serialize for TrackUnpublishedResponse { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.track_sid.is_empty() { + if !self.job_id.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.TrackUnpublishedResponse", len)?; - if !self.track_sid.is_empty() { - struct_ser.serialize_field("trackSid", &self.track_sid)?; + if self.status != 0 { + len += 1; + } + if !self.error.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.UpdateJobStatus", len)?; + if !self.job_id.is_empty() { + struct_ser.serialize_field("jobId", &self.job_id)?; + } + 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)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for TrackUnpublishedResponse { +impl<'de> serde::Deserialize<'de> for UpdateJobStatus { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "track_sid", - "trackSid", + "job_id", + "jobId", + "status", + "error", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - TrackSid, + JobId, + Status, + Error, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -24039,7 +28199,9 @@ impl<'de> serde::Deserialize<'de> for TrackUnpublishedResponse { E: serde::de::Error, { match value { - "trackSid" | "track_sid" => Ok(GeneratedField::TrackSid), + "jobId" | "job_id" => Ok(GeneratedField::JobId), + "status" => Ok(GeneratedField::Status), + "error" => Ok(GeneratedField::Error), _ => Ok(GeneratedField::__SkipField__), } } @@ -24049,39 +28211,55 @@ impl<'de> serde::Deserialize<'de> for TrackUnpublishedResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TrackUnpublishedResponse; + type Value = UpdateJobStatus; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.TrackUnpublishedResponse") + formatter.write_str("struct livekit.UpdateJobStatus") } - 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 track_sid__ = None; + let mut job_id__ = None; + let mut status__ = None; + let mut error__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::TrackSid => { - if track_sid__.is_some() { - return Err(serde::de::Error::duplicate_field("trackSid")); + GeneratedField::JobId => { + if job_id__.is_some() { + return Err(serde::de::Error::duplicate_field("jobId")); } - track_sid__ = Some(map_.next_value()?); + job_id__ = Some(map_.next_value()?); + } + 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::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(TrackUnpublishedResponse { - track_sid: track_sid__.unwrap_or_default(), + Ok(UpdateJobStatus { + job_id: job_id__.unwrap_or_default(), + status: status__.unwrap_or_default(), + error: error__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.TrackUnpublishedResponse", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.UpdateJobStatus", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for Transcription { +impl serde::Serialize for UpdateLayoutRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -24089,47 +28267,38 @@ impl serde::Serialize for Transcription { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.transcribed_participant_identity.is_empty() { - len += 1; - } - if !self.track_id.is_empty() { + if !self.egress_id.is_empty() { len += 1; } - if !self.segments.is_empty() { + if !self.layout.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.Transcription", len)?; - if !self.transcribed_participant_identity.is_empty() { - struct_ser.serialize_field("transcribedParticipantIdentity", &self.transcribed_participant_identity)?; - } - if !self.track_id.is_empty() { - struct_ser.serialize_field("trackId", &self.track_id)?; + let mut struct_ser = serializer.serialize_struct("livekit.UpdateLayoutRequest", len)?; + if !self.egress_id.is_empty() { + struct_ser.serialize_field("egressId", &self.egress_id)?; } - if !self.segments.is_empty() { - struct_ser.serialize_field("segments", &self.segments)?; + if !self.layout.is_empty() { + struct_ser.serialize_field("layout", &self.layout)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for Transcription { +impl<'de> serde::Deserialize<'de> for UpdateLayoutRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "transcribed_participant_identity", - "transcribedParticipantIdentity", - "track_id", - "trackId", - "segments", + "egress_id", + "egressId", + "layout", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - TranscribedParticipantIdentity, - TrackId, - Segments, + EgressId, + Layout, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -24152,9 +28321,8 @@ impl<'de> serde::Deserialize<'de> for Transcription { E: serde::de::Error, { match value { - "transcribedParticipantIdentity" | "transcribed_participant_identity" => Ok(GeneratedField::TranscribedParticipantIdentity), - "trackId" | "track_id" => Ok(GeneratedField::TrackId), - "segments" => Ok(GeneratedField::Segments), + "egressId" | "egress_id" => Ok(GeneratedField::EgressId), + "layout" => Ok(GeneratedField::Layout), _ => Ok(GeneratedField::__SkipField__), } } @@ -24164,55 +28332,47 @@ impl<'de> serde::Deserialize<'de> for Transcription { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Transcription; + type Value = UpdateLayoutRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.Transcription") + formatter.write_str("struct livekit.UpdateLayoutRequest") } - 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 transcribed_participant_identity__ = None; - let mut track_id__ = None; - let mut segments__ = None; + let mut egress_id__ = None; + let mut layout__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::TranscribedParticipantIdentity => { - if transcribed_participant_identity__.is_some() { - return Err(serde::de::Error::duplicate_field("transcribedParticipantIdentity")); - } - transcribed_participant_identity__ = Some(map_.next_value()?); - } - GeneratedField::TrackId => { - if track_id__.is_some() { - return Err(serde::de::Error::duplicate_field("trackId")); + GeneratedField::EgressId => { + if egress_id__.is_some() { + return Err(serde::de::Error::duplicate_field("egressId")); } - track_id__ = Some(map_.next_value()?); + egress_id__ = Some(map_.next_value()?); } - GeneratedField::Segments => { - if segments__.is_some() { - return Err(serde::de::Error::duplicate_field("segments")); + GeneratedField::Layout => { + if layout__.is_some() { + return Err(serde::de::Error::duplicate_field("layout")); } - segments__ = Some(map_.next_value()?); + layout__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(Transcription { - transcribed_participant_identity: transcribed_participant_identity__.unwrap_or_default(), - track_id: track_id__.unwrap_or_default(), - segments: segments__.unwrap_or_default(), + Ok(UpdateLayoutRequest { + egress_id: egress_id__.unwrap_or_default(), + layout: layout__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.Transcription", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.UpdateLayoutRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for TranscriptionSegment { +impl serde::Serialize for UpdateLocalAudioTrack { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -24220,73 +28380,42 @@ impl serde::Serialize for TranscriptionSegment { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.id.is_empty() { - len += 1; - } - if !self.text.is_empty() { - len += 1; - } - if self.start_time != 0 { - len += 1; - } - if self.end_time != 0 { - len += 1; - } - if self.r#final { + if !self.track_sid.is_empty() { len += 1; } - if !self.language.is_empty() { + if !self.features.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.TranscriptionSegment", len)?; - if !self.id.is_empty() { - struct_ser.serialize_field("id", &self.id)?; - } - if !self.text.is_empty() { - struct_ser.serialize_field("text", &self.text)?; - } - if self.start_time != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("startTime", ToString::to_string(&self.start_time).as_str())?; - } - if self.end_time != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("endTime", ToString::to_string(&self.end_time).as_str())?; - } - if self.r#final { - struct_ser.serialize_field("final", &self.r#final)?; + let mut struct_ser = serializer.serialize_struct("livekit.UpdateLocalAudioTrack", len)?; + if !self.track_sid.is_empty() { + struct_ser.serialize_field("trackSid", &self.track_sid)?; } - if !self.language.is_empty() { - struct_ser.serialize_field("language", &self.language)?; + if !self.features.is_empty() { + let v = self.features.iter().cloned().map(|v| { + AudioTrackFeature::try_from(v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", v))) + }).collect::, _>>()?; + struct_ser.serialize_field("features", &v)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for TranscriptionSegment { +impl<'de> serde::Deserialize<'de> for UpdateLocalAudioTrack { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "id", - "text", - "start_time", - "startTime", - "end_time", - "endTime", - "final", - "language", + "track_sid", + "trackSid", + "features", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Id, - Text, - StartTime, - EndTime, - Final, - Language, + TrackSid, + Features, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -24309,12 +28438,8 @@ impl<'de> serde::Deserialize<'de> for TranscriptionSegment { E: serde::de::Error, { match value { - "id" => Ok(GeneratedField::Id), - "text" => Ok(GeneratedField::Text), - "startTime" | "start_time" => Ok(GeneratedField::StartTime), - "endTime" | "end_time" => Ok(GeneratedField::EndTime), - "final" => Ok(GeneratedField::Final), - "language" => Ok(GeneratedField::Language), + "trackSid" | "track_sid" => Ok(GeneratedField::TrackSid), + "features" => Ok(GeneratedField::Features), _ => Ok(GeneratedField::__SkipField__), } } @@ -24324,83 +28449,47 @@ impl<'de> serde::Deserialize<'de> for TranscriptionSegment { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TranscriptionSegment; + type Value = UpdateLocalAudioTrack; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.TranscriptionSegment") + formatter.write_str("struct livekit.UpdateLocalAudioTrack") } - 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 text__ = None; - let mut start_time__ = None; - let mut end_time__ = None; - let mut r#final__ = None; - let mut language__ = None; + let mut track_sid__ = None; + let mut features__ = 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::Text => { - if text__.is_some() { - return Err(serde::de::Error::duplicate_field("text")); - } - text__ = Some(map_.next_value()?); - } - GeneratedField::StartTime => { - if start_time__.is_some() { - return Err(serde::de::Error::duplicate_field("startTime")); - } - start_time__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::EndTime => { - if end_time__.is_some() { - return Err(serde::de::Error::duplicate_field("endTime")); - } - end_time__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Final => { - if r#final__.is_some() { - return Err(serde::de::Error::duplicate_field("final")); + GeneratedField::TrackSid => { + if track_sid__.is_some() { + return Err(serde::de::Error::duplicate_field("trackSid")); } - r#final__ = Some(map_.next_value()?); + track_sid__ = Some(map_.next_value()?); } - GeneratedField::Language => { - if language__.is_some() { - return Err(serde::de::Error::duplicate_field("language")); + GeneratedField::Features => { + if features__.is_some() { + return Err(serde::de::Error::duplicate_field("features")); } - language__ = Some(map_.next_value()?); + features__ = Some(map_.next_value::>()?.into_iter().map(|x| x as i32).collect()); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; - } - } - } - Ok(TranscriptionSegment { - id: id__.unwrap_or_default(), - text: text__.unwrap_or_default(), - start_time: start_time__.unwrap_or_default(), - end_time: end_time__.unwrap_or_default(), - r#final: r#final__.unwrap_or_default(), - language: language__.unwrap_or_default(), + } + } + } + Ok(UpdateLocalAudioTrack { + track_sid: track_sid__.unwrap_or_default(), + features: features__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.TranscriptionSegment", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.UpdateLocalAudioTrack", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for TrickleRequest { +impl serde::Serialize for UpdateLocalVideoTrack { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -24408,39 +28497,46 @@ impl serde::Serialize for TrickleRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.candidate_init.is_empty() { + if !self.track_sid.is_empty() { len += 1; } - if self.target != 0 { + if self.width != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.TrickleRequest", len)?; - if !self.candidate_init.is_empty() { - struct_ser.serialize_field("candidateInit", &self.candidate_init)?; + if self.height != 0 { + len += 1; } - if self.target != 0 { - let v = SignalTarget::try_from(self.target) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.target)))?; - struct_ser.serialize_field("target", &v)?; + let mut struct_ser = serializer.serialize_struct("livekit.UpdateLocalVideoTrack", len)?; + if !self.track_sid.is_empty() { + struct_ser.serialize_field("trackSid", &self.track_sid)?; + } + if self.width != 0 { + struct_ser.serialize_field("width", &self.width)?; + } + if self.height != 0 { + struct_ser.serialize_field("height", &self.height)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for TrickleRequest { +impl<'de> serde::Deserialize<'de> for UpdateLocalVideoTrack { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "candidateInit", - "target", + "track_sid", + "trackSid", + "width", + "height", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - CandidateInit, - Target, + TrackSid, + Width, + Height, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -24463,8 +28559,9 @@ impl<'de> serde::Deserialize<'de> for TrickleRequest { E: serde::de::Error, { match value { - "candidateInit" => Ok(GeneratedField::CandidateInit), - "target" => Ok(GeneratedField::Target), + "trackSid" | "track_sid" => Ok(GeneratedField::TrackSid), + "width" => Ok(GeneratedField::Width), + "height" => Ok(GeneratedField::Height), _ => Ok(GeneratedField::__SkipField__), } } @@ -24474,47 +28571,59 @@ impl<'de> serde::Deserialize<'de> for TrickleRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TrickleRequest; + type Value = UpdateLocalVideoTrack; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.TrickleRequest") + formatter.write_str("struct livekit.UpdateLocalVideoTrack") } - 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 candidate_init__ = None; - let mut target__ = None; + let mut track_sid__ = None; + let mut width__ = None; + let mut height__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::CandidateInit => { - if candidate_init__.is_some() { - return Err(serde::de::Error::duplicate_field("candidateInit")); + GeneratedField::TrackSid => { + if track_sid__.is_some() { + return Err(serde::de::Error::duplicate_field("trackSid")); } - candidate_init__ = Some(map_.next_value()?); + track_sid__ = Some(map_.next_value()?); } - GeneratedField::Target => { - if target__.is_some() { - return Err(serde::de::Error::duplicate_field("target")); + GeneratedField::Width => { + if width__.is_some() { + return Err(serde::de::Error::duplicate_field("width")); } - target__ = Some(map_.next_value::()? as i32); + 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::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(TrickleRequest { - candidate_init: candidate_init__.unwrap_or_default(), - target: target__.unwrap_or_default(), + Ok(UpdateLocalVideoTrack { + track_sid: track_sid__.unwrap_or_default(), + width: width__.unwrap_or_default(), + height: height__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.TrickleRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.UpdateLocalVideoTrack", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for UpdateIngressRequest { +impl serde::Serialize for UpdateParticipantMetadata { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -24522,108 +28631,54 @@ impl serde::Serialize for UpdateIngressRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.ingress_id.is_empty() { + if !self.metadata.is_empty() { len += 1; } if !self.name.is_empty() { 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.bypass_transcoding.is_some() { - len += 1; - } - if self.enable_transcoding.is_some() { - len += 1; - } - if self.audio.is_some() { + if !self.attributes.is_empty() { len += 1; } - if self.video.is_some() { + if self.request_id != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.UpdateIngressRequest", len)?; - if !self.ingress_id.is_empty() { - struct_ser.serialize_field("ingressId", &self.ingress_id)?; + let mut struct_ser = serializer.serialize_struct("livekit.UpdateParticipantMetadata", len)?; + if !self.metadata.is_empty() { + struct_ser.serialize_field("metadata", &self.metadata)?; } if !self.name.is_empty() { struct_ser.serialize_field("name", &self.name)?; } - 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 let Some(v) = self.bypass_transcoding.as_ref() { - struct_ser.serialize_field("bypassTranscoding", v)?; - } - 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 !self.attributes.is_empty() { + struct_ser.serialize_field("attributes", &self.attributes)?; } - if let Some(v) = self.video.as_ref() { - struct_ser.serialize_field("video", v)?; + if self.request_id != 0 { + struct_ser.serialize_field("requestId", &self.request_id)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for UpdateIngressRequest { +impl<'de> serde::Deserialize<'de> for UpdateParticipantMetadata { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "ingress_id", - "ingressId", + "metadata", "name", - "room_name", - "roomName", - "participant_identity", - "participantIdentity", - "participant_name", - "participantName", - "participant_metadata", - "participantMetadata", - "bypass_transcoding", - "bypassTranscoding", - "enable_transcoding", - "enableTranscoding", - "audio", - "video", + "attributes", + "request_id", + "requestId", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - IngressId, + Metadata, Name, - RoomName, - ParticipantIdentity, - ParticipantName, - ParticipantMetadata, - BypassTranscoding, - EnableTranscoding, - Audio, - Video, + Attributes, + RequestId, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -24646,16 +28701,10 @@ impl<'de> serde::Deserialize<'de> for UpdateIngressRequest { E: serde::de::Error, { match value { - "ingressId" | "ingress_id" => Ok(GeneratedField::IngressId), + "metadata" => Ok(GeneratedField::Metadata), "name" => Ok(GeneratedField::Name), - "roomName" | "room_name" => Ok(GeneratedField::RoomName), - "participantIdentity" | "participant_identity" => Ok(GeneratedField::ParticipantIdentity), - "participantName" | "participant_name" => Ok(GeneratedField::ParticipantName), - "participantMetadata" | "participant_metadata" => Ok(GeneratedField::ParticipantMetadata), - "bypassTranscoding" | "bypass_transcoding" => Ok(GeneratedField::BypassTranscoding), - "enableTranscoding" | "enable_transcoding" => Ok(GeneratedField::EnableTranscoding), - "audio" => Ok(GeneratedField::Audio), - "video" => Ok(GeneratedField::Video), + "attributes" => Ok(GeneratedField::Attributes), + "requestId" | "request_id" => Ok(GeneratedField::RequestId), _ => Ok(GeneratedField::__SkipField__), } } @@ -24665,111 +28714,67 @@ impl<'de> serde::Deserialize<'de> for UpdateIngressRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = UpdateIngressRequest; + type Value = UpdateParticipantMetadata; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.UpdateIngressRequest") + formatter.write_str("struct livekit.UpdateParticipantMetadata") } - 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 metadata__ = None; let mut name__ = None; - let mut room_name__ = None; - let mut participant_identity__ = None; - let mut participant_name__ = None; - let mut participant_metadata__ = None; - let mut bypass_transcoding__ = None; - let mut enable_transcoding__ = None; - let mut audio__ = None; - let mut video__ = None; + let mut attributes__ = None; + let mut request_id__ = 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")); + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); } - ingress_id__ = Some(map_.next_value()?); + metadata__ = Some(map_.next_value()?); } GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); - } - name__ = 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::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::BypassTranscoding => { - if bypass_transcoding__.is_some() { - return Err(serde::de::Error::duplicate_field("bypassTranscoding")); - } - bypass_transcoding__ = map_.next_value()?; - } - GeneratedField::EnableTranscoding => { - if enable_transcoding__.is_some() { - return Err(serde::de::Error::duplicate_field("enableTranscoding")); + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); } - enable_transcoding__ = map_.next_value()?; + name__ = Some(map_.next_value()?); } - GeneratedField::Audio => { - if audio__.is_some() { - return Err(serde::de::Error::duplicate_field("audio")); + GeneratedField::Attributes => { + if attributes__.is_some() { + return Err(serde::de::Error::duplicate_field("attributes")); } - audio__ = map_.next_value()?; + attributes__ = Some( + map_.next_value::>()? + ); } - GeneratedField::Video => { - if video__.is_some() { - return Err(serde::de::Error::duplicate_field("video")); + GeneratedField::RequestId => { + if request_id__.is_some() { + return Err(serde::de::Error::duplicate_field("requestId")); } - video__ = map_.next_value()?; + request_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(UpdateIngressRequest { - ingress_id: ingress_id__.unwrap_or_default(), + Ok(UpdateParticipantMetadata { + metadata: metadata__.unwrap_or_default(), name: name__.unwrap_or_default(), - 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(), - bypass_transcoding: bypass_transcoding__, - enable_transcoding: enable_transcoding__, - audio: audio__, - video: video__, + attributes: attributes__.unwrap_or_default(), + request_id: request_id__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.UpdateIngressRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.UpdateParticipantMetadata", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for UpdateLayoutRequest { +impl serde::Serialize for UpdateParticipantRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -24777,38 +28782,69 @@ impl serde::Serialize for UpdateLayoutRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.egress_id.is_empty() { + if !self.room.is_empty() { len += 1; } - if !self.layout.is_empty() { + if !self.identity.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.UpdateLayoutRequest", len)?; - if !self.egress_id.is_empty() { - struct_ser.serialize_field("egressId", &self.egress_id)?; + if !self.metadata.is_empty() { + len += 1; } - if !self.layout.is_empty() { - struct_ser.serialize_field("layout", &self.layout)?; + if self.permission.is_some() { + len += 1; + } + if !self.name.is_empty() { + len += 1; + } + if !self.attributes.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.UpdateParticipantRequest", len)?; + if !self.room.is_empty() { + struct_ser.serialize_field("room", &self.room)?; + } + if !self.identity.is_empty() { + struct_ser.serialize_field("identity", &self.identity)?; + } + if !self.metadata.is_empty() { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + if let Some(v) = self.permission.as_ref() { + struct_ser.serialize_field("permission", v)?; + } + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if !self.attributes.is_empty() { + struct_ser.serialize_field("attributes", &self.attributes)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for UpdateLayoutRequest { +impl<'de> serde::Deserialize<'de> for UpdateParticipantRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "egress_id", - "egressId", - "layout", + "room", + "identity", + "metadata", + "permission", + "name", + "attributes", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - EgressId, - Layout, + Room, + Identity, + Metadata, + Permission, + Name, + Attributes, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -24831,8 +28867,12 @@ impl<'de> serde::Deserialize<'de> for UpdateLayoutRequest { E: serde::de::Error, { match value { - "egressId" | "egress_id" => Ok(GeneratedField::EgressId), - "layout" => Ok(GeneratedField::Layout), + "room" => Ok(GeneratedField::Room), + "identity" => Ok(GeneratedField::Identity), + "metadata" => Ok(GeneratedField::Metadata), + "permission" => Ok(GeneratedField::Permission), + "name" => Ok(GeneratedField::Name), + "attributes" => Ok(GeneratedField::Attributes), _ => Ok(GeneratedField::__SkipField__), } } @@ -24842,47 +28882,81 @@ impl<'de> serde::Deserialize<'de> for UpdateLayoutRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = UpdateLayoutRequest; + type Value = UpdateParticipantRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.UpdateLayoutRequest") + formatter.write_str("struct livekit.UpdateParticipantRequest") } - 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 egress_id__ = None; - let mut layout__ = None; + let mut room__ = None; + let mut identity__ = None; + let mut metadata__ = None; + let mut permission__ = None; + let mut name__ = None; + let mut attributes__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::EgressId => { - if egress_id__.is_some() { - return Err(serde::de::Error::duplicate_field("egressId")); + GeneratedField::Room => { + if room__.is_some() { + return Err(serde::de::Error::duplicate_field("room")); } - egress_id__ = Some(map_.next_value()?); + room__ = Some(map_.next_value()?); } - GeneratedField::Layout => { - if layout__.is_some() { - return Err(serde::de::Error::duplicate_field("layout")); + GeneratedField::Identity => { + if identity__.is_some() { + return Err(serde::de::Error::duplicate_field("identity")); } - layout__ = Some(map_.next_value()?); + identity__ = Some(map_.next_value()?); + } + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = Some(map_.next_value()?); + } + GeneratedField::Permission => { + if permission__.is_some() { + return Err(serde::de::Error::duplicate_field("permission")); + } + permission__ = map_.next_value()?; + } + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); + } + name__ = Some(map_.next_value()?); + } + GeneratedField::Attributes => { + if attributes__.is_some() { + return Err(serde::de::Error::duplicate_field("attributes")); + } + attributes__ = Some( + map_.next_value::>()? + ); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(UpdateLayoutRequest { - egress_id: egress_id__.unwrap_or_default(), - layout: layout__.unwrap_or_default(), + Ok(UpdateParticipantRequest { + room: room__.unwrap_or_default(), + identity: identity__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), + permission: permission__, + name: name__.unwrap_or_default(), + attributes: attributes__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.UpdateLayoutRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.UpdateParticipantRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for UpdateLocalAudioTrack { +impl serde::Serialize for UpdateRoomMetadataRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -24890,42 +28964,37 @@ impl serde::Serialize for UpdateLocalAudioTrack { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.track_sid.is_empty() { + if !self.room.is_empty() { len += 1; } - if !self.features.is_empty() { + if !self.metadata.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.UpdateLocalAudioTrack", len)?; - if !self.track_sid.is_empty() { - struct_ser.serialize_field("trackSid", &self.track_sid)?; + let mut struct_ser = serializer.serialize_struct("livekit.UpdateRoomMetadataRequest", len)?; + if !self.room.is_empty() { + struct_ser.serialize_field("room", &self.room)?; } - if !self.features.is_empty() { - let v = self.features.iter().cloned().map(|v| { - AudioTrackFeature::try_from(v) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", v))) - }).collect::, _>>()?; - struct_ser.serialize_field("features", &v)?; + if !self.metadata.is_empty() { + struct_ser.serialize_field("metadata", &self.metadata)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for UpdateLocalAudioTrack { +impl<'de> serde::Deserialize<'de> for UpdateRoomMetadataRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "track_sid", - "trackSid", - "features", + "room", + "metadata", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - TrackSid, - Features, + Room, + Metadata, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -24948,8 +29017,8 @@ impl<'de> serde::Deserialize<'de> for UpdateLocalAudioTrack { E: serde::de::Error, { match value { - "trackSid" | "track_sid" => Ok(GeneratedField::TrackSid), - "features" => Ok(GeneratedField::Features), + "room" => Ok(GeneratedField::Room), + "metadata" => Ok(GeneratedField::Metadata), _ => Ok(GeneratedField::__SkipField__), } } @@ -24959,47 +29028,47 @@ impl<'de> serde::Deserialize<'de> for UpdateLocalAudioTrack { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = UpdateLocalAudioTrack; + type Value = UpdateRoomMetadataRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.UpdateLocalAudioTrack") + formatter.write_str("struct livekit.UpdateRoomMetadataRequest") } - 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 track_sid__ = None; - let mut features__ = None; + let mut room__ = None; + let mut metadata__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::TrackSid => { - if track_sid__.is_some() { - return Err(serde::de::Error::duplicate_field("trackSid")); + GeneratedField::Room => { + if room__.is_some() { + return Err(serde::de::Error::duplicate_field("room")); } - track_sid__ = Some(map_.next_value()?); + room__ = Some(map_.next_value()?); } - GeneratedField::Features => { - if features__.is_some() { - return Err(serde::de::Error::duplicate_field("features")); + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); } - features__ = Some(map_.next_value::>()?.into_iter().map(|x| x as i32).collect()); + metadata__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(UpdateLocalAudioTrack { - track_sid: track_sid__.unwrap_or_default(), - features: features__.unwrap_or_default(), + Ok(UpdateRoomMetadataRequest { + room: room__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.UpdateLocalAudioTrack", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.UpdateRoomMetadataRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for UpdateLocalVideoTrack { +impl serde::Serialize for UpdateStreamRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -25007,46 +29076,48 @@ impl serde::Serialize for UpdateLocalVideoTrack { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.track_sid.is_empty() { + if !self.egress_id.is_empty() { len += 1; } - if self.width != 0 { + if !self.add_output_urls.is_empty() { len += 1; } - if self.height != 0 { + if !self.remove_output_urls.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.UpdateLocalVideoTrack", len)?; - if !self.track_sid.is_empty() { - struct_ser.serialize_field("trackSid", &self.track_sid)?; + let mut struct_ser = serializer.serialize_struct("livekit.UpdateStreamRequest", len)?; + if !self.egress_id.is_empty() { + struct_ser.serialize_field("egressId", &self.egress_id)?; } - if self.width != 0 { - struct_ser.serialize_field("width", &self.width)?; + if !self.add_output_urls.is_empty() { + struct_ser.serialize_field("addOutputUrls", &self.add_output_urls)?; } - if self.height != 0 { - struct_ser.serialize_field("height", &self.height)?; + if !self.remove_output_urls.is_empty() { + struct_ser.serialize_field("removeOutputUrls", &self.remove_output_urls)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for UpdateLocalVideoTrack { +impl<'de> serde::Deserialize<'de> for UpdateStreamRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "track_sid", - "trackSid", - "width", - "height", + "egress_id", + "egressId", + "add_output_urls", + "addOutputUrls", + "remove_output_urls", + "removeOutputUrls", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - TrackSid, - Width, - Height, + EgressId, + AddOutputUrls, + RemoveOutputUrls, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -25069,9 +29140,9 @@ impl<'de> serde::Deserialize<'de> for UpdateLocalVideoTrack { E: serde::de::Error, { match value { - "trackSid" | "track_sid" => Ok(GeneratedField::TrackSid), - "width" => Ok(GeneratedField::Width), - "height" => Ok(GeneratedField::Height), + "egressId" | "egress_id" => Ok(GeneratedField::EgressId), + "addOutputUrls" | "add_output_urls" => Ok(GeneratedField::AddOutputUrls), + "removeOutputUrls" | "remove_output_urls" => Ok(GeneratedField::RemoveOutputUrls), _ => Ok(GeneratedField::__SkipField__), } } @@ -25081,59 +29152,55 @@ impl<'de> serde::Deserialize<'de> for UpdateLocalVideoTrack { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = UpdateLocalVideoTrack; + type Value = UpdateStreamRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.UpdateLocalVideoTrack") + formatter.write_str("struct livekit.UpdateStreamRequest") } - 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 track_sid__ = None; - let mut width__ = None; - let mut height__ = None; + let mut egress_id__ = None; + let mut add_output_urls__ = None; + let mut remove_output_urls__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::TrackSid => { - if track_sid__.is_some() { - return Err(serde::de::Error::duplicate_field("trackSid")); + GeneratedField::EgressId => { + if egress_id__.is_some() { + return Err(serde::de::Error::duplicate_field("egressId")); } - track_sid__ = Some(map_.next_value()?); + egress_id__ = Some(map_.next_value()?); } - GeneratedField::Width => { - if width__.is_some() { - return Err(serde::de::Error::duplicate_field("width")); + GeneratedField::AddOutputUrls => { + if add_output_urls__.is_some() { + return Err(serde::de::Error::duplicate_field("addOutputUrls")); } - width__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + add_output_urls__ = Some(map_.next_value()?); } - GeneratedField::Height => { - if height__.is_some() { - return Err(serde::de::Error::duplicate_field("height")); + GeneratedField::RemoveOutputUrls => { + if remove_output_urls__.is_some() { + return Err(serde::de::Error::duplicate_field("removeOutputUrls")); } - height__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + remove_output_urls__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(UpdateLocalVideoTrack { - track_sid: track_sid__.unwrap_or_default(), - width: width__.unwrap_or_default(), - height: height__.unwrap_or_default(), + Ok(UpdateStreamRequest { + egress_id: egress_id__.unwrap_or_default(), + add_output_urls: add_output_urls__.unwrap_or_default(), + remove_output_urls: remove_output_urls__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.UpdateLocalVideoTrack", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.UpdateStreamRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for UpdateParticipantMetadata { +impl serde::Serialize for UpdateSubscription { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -25141,45 +29208,47 @@ impl serde::Serialize for UpdateParticipantMetadata { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.metadata.is_empty() { + if !self.track_sids.is_empty() { len += 1; } - if !self.name.is_empty() { + if self.subscribe { len += 1; } - if !self.attributes.is_empty() { + if !self.participant_tracks.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.UpdateParticipantMetadata", len)?; - if !self.metadata.is_empty() { - struct_ser.serialize_field("metadata", &self.metadata)?; + let mut struct_ser = serializer.serialize_struct("livekit.UpdateSubscription", len)?; + if !self.track_sids.is_empty() { + struct_ser.serialize_field("trackSids", &self.track_sids)?; } - if !self.name.is_empty() { - struct_ser.serialize_field("name", &self.name)?; + if self.subscribe { + struct_ser.serialize_field("subscribe", &self.subscribe)?; } - if !self.attributes.is_empty() { - struct_ser.serialize_field("attributes", &self.attributes)?; + if !self.participant_tracks.is_empty() { + struct_ser.serialize_field("participantTracks", &self.participant_tracks)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for UpdateParticipantMetadata { +impl<'de> serde::Deserialize<'de> for UpdateSubscription { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "metadata", - "name", - "attributes", + "track_sids", + "trackSids", + "subscribe", + "participant_tracks", + "participantTracks", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Metadata, - Name, - Attributes, + TrackSids, + Subscribe, + ParticipantTracks, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -25202,9 +29271,9 @@ impl<'de> serde::Deserialize<'de> for UpdateParticipantMetadata { E: serde::de::Error, { match value { - "metadata" => Ok(GeneratedField::Metadata), - "name" => Ok(GeneratedField::Name), - "attributes" => Ok(GeneratedField::Attributes), + "trackSids" | "track_sids" => Ok(GeneratedField::TrackSids), + "subscribe" => Ok(GeneratedField::Subscribe), + "participantTracks" | "participant_tracks" => Ok(GeneratedField::ParticipantTracks), _ => Ok(GeneratedField::__SkipField__), } } @@ -25214,57 +29283,55 @@ impl<'de> serde::Deserialize<'de> for UpdateParticipantMetadata { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = UpdateParticipantMetadata; + type Value = UpdateSubscription; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.UpdateParticipantMetadata") + formatter.write_str("struct livekit.UpdateSubscription") } - 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 metadata__ = None; - let mut name__ = None; - let mut attributes__ = None; + let mut track_sids__ = None; + let mut subscribe__ = None; + let mut participant_tracks__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Metadata => { - if metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("metadata")); + GeneratedField::TrackSids => { + if track_sids__.is_some() { + return Err(serde::de::Error::duplicate_field("trackSids")); } - metadata__ = Some(map_.next_value()?); + track_sids__ = Some(map_.next_value()?); } - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); + GeneratedField::Subscribe => { + if subscribe__.is_some() { + return Err(serde::de::Error::duplicate_field("subscribe")); } - name__ = Some(map_.next_value()?); + subscribe__ = Some(map_.next_value()?); } - GeneratedField::Attributes => { - if attributes__.is_some() { - return Err(serde::de::Error::duplicate_field("attributes")); + GeneratedField::ParticipantTracks => { + if participant_tracks__.is_some() { + return Err(serde::de::Error::duplicate_field("participantTracks")); } - attributes__ = Some( - map_.next_value::>()? - ); + participant_tracks__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(UpdateParticipantMetadata { - metadata: metadata__.unwrap_or_default(), - name: name__.unwrap_or_default(), - attributes: attributes__.unwrap_or_default(), + Ok(UpdateSubscription { + track_sids: track_sids__.unwrap_or_default(), + subscribe: subscribe__.unwrap_or_default(), + participant_tracks: participant_tracks__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.UpdateParticipantMetadata", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.UpdateSubscription", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for UpdateParticipantRequest { +impl serde::Serialize for UpdateSubscriptionsRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -25278,41 +29345,35 @@ impl serde::Serialize for UpdateParticipantRequest { if !self.identity.is_empty() { len += 1; } - if !self.metadata.is_empty() { - len += 1; - } - if self.permission.is_some() { + if !self.track_sids.is_empty() { len += 1; } - if !self.name.is_empty() { + if self.subscribe { len += 1; } - if !self.attributes.is_empty() { + if !self.participant_tracks.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.UpdateParticipantRequest", len)?; + let mut struct_ser = serializer.serialize_struct("livekit.UpdateSubscriptionsRequest", len)?; if !self.room.is_empty() { struct_ser.serialize_field("room", &self.room)?; } if !self.identity.is_empty() { struct_ser.serialize_field("identity", &self.identity)?; } - if !self.metadata.is_empty() { - struct_ser.serialize_field("metadata", &self.metadata)?; - } - if let Some(v) = self.permission.as_ref() { - struct_ser.serialize_field("permission", v)?; + if !self.track_sids.is_empty() { + struct_ser.serialize_field("trackSids", &self.track_sids)?; } - if !self.name.is_empty() { - struct_ser.serialize_field("name", &self.name)?; + if self.subscribe { + struct_ser.serialize_field("subscribe", &self.subscribe)?; } - if !self.attributes.is_empty() { - struct_ser.serialize_field("attributes", &self.attributes)?; + if !self.participant_tracks.is_empty() { + struct_ser.serialize_field("participantTracks", &self.participant_tracks)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for UpdateParticipantRequest { +impl<'de> serde::Deserialize<'de> for UpdateSubscriptionsRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where @@ -25321,20 +29382,20 @@ impl<'de> serde::Deserialize<'de> for UpdateParticipantRequest { const FIELDS: &[&str] = &[ "room", "identity", - "metadata", - "permission", - "name", - "attributes", + "track_sids", + "trackSids", + "subscribe", + "participant_tracks", + "participantTracks", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { Room, Identity, - Metadata, - Permission, - Name, - Attributes, + TrackSids, + Subscribe, + ParticipantTracks, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -25359,10 +29420,9 @@ impl<'de> serde::Deserialize<'de> for UpdateParticipantRequest { match value { "room" => Ok(GeneratedField::Room), "identity" => Ok(GeneratedField::Identity), - "metadata" => Ok(GeneratedField::Metadata), - "permission" => Ok(GeneratedField::Permission), - "name" => Ok(GeneratedField::Name), - "attributes" => Ok(GeneratedField::Attributes), + "trackSids" | "track_sids" => Ok(GeneratedField::TrackSids), + "subscribe" => Ok(GeneratedField::Subscribe), + "participantTracks" | "participant_tracks" => Ok(GeneratedField::ParticipantTracks), _ => Ok(GeneratedField::__SkipField__), } } @@ -25372,22 +29432,21 @@ impl<'de> serde::Deserialize<'de> for UpdateParticipantRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = UpdateParticipantRequest; + type Value = UpdateSubscriptionsRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.UpdateParticipantRequest") + formatter.write_str("struct livekit.UpdateSubscriptionsRequest") } - 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 metadata__ = None; - let mut permission__ = None; - let mut name__ = None; - let mut attributes__ = None; + let mut track_sids__ = None; + let mut subscribe__ = None; + let mut participant_tracks__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Room => { @@ -25402,89 +29461,64 @@ impl<'de> serde::Deserialize<'de> for UpdateParticipantRequest { } identity__ = Some(map_.next_value()?); } - GeneratedField::Metadata => { - if metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("metadata")); - } - metadata__ = Some(map_.next_value()?); - } - GeneratedField::Permission => { - if permission__.is_some() { - return Err(serde::de::Error::duplicate_field("permission")); + GeneratedField::TrackSids => { + if track_sids__.is_some() { + return Err(serde::de::Error::duplicate_field("trackSids")); } - permission__ = map_.next_value()?; + track_sids__ = Some(map_.next_value()?); } - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); + GeneratedField::Subscribe => { + if subscribe__.is_some() { + return Err(serde::de::Error::duplicate_field("subscribe")); } - name__ = Some(map_.next_value()?); + subscribe__ = Some(map_.next_value()?); } - GeneratedField::Attributes => { - if attributes__.is_some() { - return Err(serde::de::Error::duplicate_field("attributes")); + GeneratedField::ParticipantTracks => { + if participant_tracks__.is_some() { + return Err(serde::de::Error::duplicate_field("participantTracks")); } - attributes__ = Some( - map_.next_value::>()? - ); + participant_tracks__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(UpdateParticipantRequest { + Ok(UpdateSubscriptionsRequest { room: room__.unwrap_or_default(), identity: identity__.unwrap_or_default(), - metadata: metadata__.unwrap_or_default(), - permission: permission__, - name: name__.unwrap_or_default(), - attributes: attributes__.unwrap_or_default(), + track_sids: track_sids__.unwrap_or_default(), + subscribe: subscribe__.unwrap_or_default(), + participant_tracks: participant_tracks__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.UpdateParticipantRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.UpdateSubscriptionsRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for UpdateRoomMetadataRequest { +impl serde::Serialize for UpdateSubscriptionsResponse { #[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.is_empty() { - len += 1; - } - if !self.metadata.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("livekit.UpdateRoomMetadataRequest", len)?; - if !self.room.is_empty() { - struct_ser.serialize_field("room", &self.room)?; - } - if !self.metadata.is_empty() { - struct_ser.serialize_field("metadata", &self.metadata)?; - } + let len = 0; + let struct_ser = serializer.serialize_struct("livekit.UpdateSubscriptionsResponse", len)?; struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for UpdateRoomMetadataRequest { +impl<'de> serde::Deserialize<'de> for UpdateSubscriptionsResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "room", - "metadata", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Room, - Metadata, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -25506,11 +29540,7 @@ impl<'de> serde::Deserialize<'de> for UpdateRoomMetadataRequest { where E: serde::de::Error, { - match value { - "room" => Ok(GeneratedField::Room), - "metadata" => Ok(GeneratedField::Metadata), - _ => Ok(GeneratedField::__SkipField__), - } + Ok(GeneratedField::__SkipField__) } } deserializer.deserialize_identifier(GeneratedVisitor) @@ -25518,47 +29548,27 @@ impl<'de> serde::Deserialize<'de> for UpdateRoomMetadataRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = UpdateRoomMetadataRequest; + type Value = UpdateSubscriptionsResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.UpdateRoomMetadataRequest") + formatter.write_str("struct livekit.UpdateSubscriptionsResponse") } - 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 metadata__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Room => { - if room__.is_some() { - return Err(serde::de::Error::duplicate_field("room")); - } - room__ = Some(map_.next_value()?); - } - GeneratedField::Metadata => { - if metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("metadata")); - } - metadata__ = Some(map_.next_value()?); - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; - } - } + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; } - Ok(UpdateRoomMetadataRequest { - room: room__.unwrap_or_default(), - metadata: metadata__.unwrap_or_default(), + Ok(UpdateSubscriptionsResponse { }) } } - deserializer.deserialize_struct("livekit.UpdateRoomMetadataRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.UpdateSubscriptionsResponse", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for UpdateStreamRequest { +impl serde::Serialize for UpdateTrackSettings { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -25566,48 +29576,80 @@ impl serde::Serialize for UpdateStreamRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.egress_id.is_empty() { + if !self.track_sids.is_empty() { len += 1; } - if !self.add_output_urls.is_empty() { + if self.disabled { len += 1; } - if !self.remove_output_urls.is_empty() { + if self.quality != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.UpdateStreamRequest", len)?; - if !self.egress_id.is_empty() { - struct_ser.serialize_field("egressId", &self.egress_id)?; + if self.width != 0 { + len += 1; } - if !self.add_output_urls.is_empty() { - struct_ser.serialize_field("addOutputUrls", &self.add_output_urls)?; + if self.height != 0 { + len += 1; } - if !self.remove_output_urls.is_empty() { - struct_ser.serialize_field("removeOutputUrls", &self.remove_output_urls)?; + if self.fps != 0 { + len += 1; + } + if self.priority != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.UpdateTrackSettings", len)?; + if !self.track_sids.is_empty() { + struct_ser.serialize_field("trackSids", &self.track_sids)?; + } + if self.disabled { + struct_ser.serialize_field("disabled", &self.disabled)?; + } + if self.quality != 0 { + let v = VideoQuality::try_from(self.quality) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.quality)))?; + struct_ser.serialize_field("quality", &v)?; + } + if self.width != 0 { + struct_ser.serialize_field("width", &self.width)?; + } + if self.height != 0 { + struct_ser.serialize_field("height", &self.height)?; + } + if self.fps != 0 { + struct_ser.serialize_field("fps", &self.fps)?; + } + if self.priority != 0 { + struct_ser.serialize_field("priority", &self.priority)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for UpdateStreamRequest { +impl<'de> serde::Deserialize<'de> for UpdateTrackSettings { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "egress_id", - "egressId", - "add_output_urls", - "addOutputUrls", - "remove_output_urls", - "removeOutputUrls", + "track_sids", + "trackSids", + "disabled", + "quality", + "width", + "height", + "fps", + "priority", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - EgressId, - AddOutputUrls, - RemoveOutputUrls, + TrackSids, + Disabled, + Quality, + Width, + Height, + Fps, + Priority, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -25630,9 +29672,13 @@ impl<'de> serde::Deserialize<'de> for UpdateStreamRequest { E: serde::de::Error, { match value { - "egressId" | "egress_id" => Ok(GeneratedField::EgressId), - "addOutputUrls" | "add_output_urls" => Ok(GeneratedField::AddOutputUrls), - "removeOutputUrls" | "remove_output_urls" => Ok(GeneratedField::RemoveOutputUrls), + "trackSids" | "track_sids" => Ok(GeneratedField::TrackSids), + "disabled" => Ok(GeneratedField::Disabled), + "quality" => Ok(GeneratedField::Quality), + "width" => Ok(GeneratedField::Width), + "height" => Ok(GeneratedField::Height), + "fps" => Ok(GeneratedField::Fps), + "priority" => Ok(GeneratedField::Priority), _ => Ok(GeneratedField::__SkipField__), } } @@ -25642,55 +29688,95 @@ impl<'de> serde::Deserialize<'de> for UpdateStreamRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = UpdateStreamRequest; + type Value = UpdateTrackSettings; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.UpdateStreamRequest") + formatter.write_str("struct livekit.UpdateTrackSettings") } - 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 egress_id__ = None; - let mut add_output_urls__ = None; - let mut remove_output_urls__ = None; + let mut track_sids__ = None; + let mut disabled__ = None; + let mut quality__ = None; + let mut width__ = None; + let mut height__ = None; + let mut fps__ = None; + let mut priority__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::EgressId => { - if egress_id__.is_some() { - return Err(serde::de::Error::duplicate_field("egressId")); + GeneratedField::TrackSids => { + if track_sids__.is_some() { + return Err(serde::de::Error::duplicate_field("trackSids")); } - egress_id__ = Some(map_.next_value()?); + track_sids__ = Some(map_.next_value()?); } - GeneratedField::AddOutputUrls => { - if add_output_urls__.is_some() { - return Err(serde::de::Error::duplicate_field("addOutputUrls")); + GeneratedField::Disabled => { + if disabled__.is_some() { + return Err(serde::de::Error::duplicate_field("disabled")); } - add_output_urls__ = Some(map_.next_value()?); + disabled__ = Some(map_.next_value()?); } - GeneratedField::RemoveOutputUrls => { - if remove_output_urls__.is_some() { - return Err(serde::de::Error::duplicate_field("removeOutputUrls")); + GeneratedField::Quality => { + if quality__.is_some() { + return Err(serde::de::Error::duplicate_field("quality")); } - remove_output_urls__ = Some(map_.next_value()?); + quality__ = Some(map_.next_value::()? as i32); + } + 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::Fps => { + if fps__.is_some() { + return Err(serde::de::Error::duplicate_field("fps")); + } + fps__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Priority => { + if priority__.is_some() { + return Err(serde::de::Error::duplicate_field("priority")); + } + priority__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(UpdateStreamRequest { - egress_id: egress_id__.unwrap_or_default(), - add_output_urls: add_output_urls__.unwrap_or_default(), - remove_output_urls: remove_output_urls__.unwrap_or_default(), + Ok(UpdateTrackSettings { + track_sids: track_sids__.unwrap_or_default(), + disabled: disabled__.unwrap_or_default(), + quality: quality__.unwrap_or_default(), + width: width__.unwrap_or_default(), + height: height__.unwrap_or_default(), + fps: fps__.unwrap_or_default(), + priority: priority__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.UpdateStreamRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.UpdateTrackSettings", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for UpdateSubscription { +impl serde::Serialize for UpdateVideoLayers { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -25698,47 +29784,38 @@ impl serde::Serialize for UpdateSubscription { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.track_sids.is_empty() { - len += 1; - } - if self.subscribe { + if !self.track_sid.is_empty() { len += 1; } - if !self.participant_tracks.is_empty() { + if !self.layers.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.UpdateSubscription", len)?; - if !self.track_sids.is_empty() { - struct_ser.serialize_field("trackSids", &self.track_sids)?; - } - if self.subscribe { - struct_ser.serialize_field("subscribe", &self.subscribe)?; + let mut struct_ser = serializer.serialize_struct("livekit.UpdateVideoLayers", len)?; + if !self.track_sid.is_empty() { + struct_ser.serialize_field("trackSid", &self.track_sid)?; } - if !self.participant_tracks.is_empty() { - struct_ser.serialize_field("participantTracks", &self.participant_tracks)?; + if !self.layers.is_empty() { + struct_ser.serialize_field("layers", &self.layers)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for UpdateSubscription { +impl<'de> serde::Deserialize<'de> for UpdateVideoLayers { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "track_sids", - "trackSids", - "subscribe", - "participant_tracks", - "participantTracks", + "track_sid", + "trackSid", + "layers", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - TrackSids, - Subscribe, - ParticipantTracks, + TrackSid, + Layers, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -25761,9 +29838,8 @@ impl<'de> serde::Deserialize<'de> for UpdateSubscription { E: serde::de::Error, { match value { - "trackSids" | "track_sids" => Ok(GeneratedField::TrackSids), - "subscribe" => Ok(GeneratedField::Subscribe), - "participantTracks" | "participant_tracks" => Ok(GeneratedField::ParticipantTracks), + "trackSid" | "track_sid" => Ok(GeneratedField::TrackSid), + "layers" => Ok(GeneratedField::Layers), _ => Ok(GeneratedField::__SkipField__), } } @@ -25773,55 +29849,47 @@ impl<'de> serde::Deserialize<'de> for UpdateSubscription { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = UpdateSubscription; + type Value = UpdateVideoLayers; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.UpdateSubscription") + formatter.write_str("struct livekit.UpdateVideoLayers") } - 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 track_sids__ = None; - let mut subscribe__ = None; - let mut participant_tracks__ = None; + let mut track_sid__ = None; + let mut layers__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::TrackSids => { - if track_sids__.is_some() { - return Err(serde::de::Error::duplicate_field("trackSids")); - } - track_sids__ = Some(map_.next_value()?); - } - GeneratedField::Subscribe => { - if subscribe__.is_some() { - return Err(serde::de::Error::duplicate_field("subscribe")); + GeneratedField::TrackSid => { + if track_sid__.is_some() { + return Err(serde::de::Error::duplicate_field("trackSid")); } - subscribe__ = Some(map_.next_value()?); + track_sid__ = Some(map_.next_value()?); } - GeneratedField::ParticipantTracks => { - if participant_tracks__.is_some() { - return Err(serde::de::Error::duplicate_field("participantTracks")); + GeneratedField::Layers => { + if layers__.is_some() { + return Err(serde::de::Error::duplicate_field("layers")); } - participant_tracks__ = Some(map_.next_value()?); + layers__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(UpdateSubscription { - track_sids: track_sids__.unwrap_or_default(), - subscribe: subscribe__.unwrap_or_default(), - participant_tracks: participant_tracks__.unwrap_or_default(), + Ok(UpdateVideoLayers { + track_sid: track_sid__.unwrap_or_default(), + layers: layers__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.UpdateSubscription", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.UpdateVideoLayers", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for UpdateSubscriptionsRequest { +impl serde::Serialize for UpdateWorkerStatus { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -25829,63 +29897,48 @@ impl serde::Serialize for UpdateSubscriptionsRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.room.is_empty() { + if self.status.is_some() { len += 1; } - if !self.identity.is_empty() { - len += 1; - } - if !self.track_sids.is_empty() { + if self.load != 0. { len += 1; } - if self.subscribe { - len += 1; - } - if !self.participant_tracks.is_empty() { + if self.job_count != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.UpdateSubscriptionsRequest", len)?; - if !self.room.is_empty() { - struct_ser.serialize_field("room", &self.room)?; - } - if !self.identity.is_empty() { - struct_ser.serialize_field("identity", &self.identity)?; - } - if !self.track_sids.is_empty() { - struct_ser.serialize_field("trackSids", &self.track_sids)?; + let mut struct_ser = serializer.serialize_struct("livekit.UpdateWorkerStatus", len)?; + if let Some(v) = self.status.as_ref() { + let v = WorkerStatus::try_from(*v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("status", &v)?; } - if self.subscribe { - struct_ser.serialize_field("subscribe", &self.subscribe)?; + if self.load != 0. { + struct_ser.serialize_field("load", &self.load)?; } - if !self.participant_tracks.is_empty() { - struct_ser.serialize_field("participantTracks", &self.participant_tracks)?; + if self.job_count != 0 { + struct_ser.serialize_field("jobCount", &self.job_count)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for UpdateSubscriptionsRequest { +impl<'de> serde::Deserialize<'de> for UpdateWorkerStatus { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "room", - "identity", - "track_sids", - "trackSids", - "subscribe", - "participant_tracks", - "participantTracks", + "status", + "load", + "job_count", + "jobCount", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Room, - Identity, - TrackSids, - Subscribe, - ParticipantTracks, + Status, + Load, + JobCount, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -25908,11 +29961,9 @@ impl<'de> serde::Deserialize<'de> for UpdateSubscriptionsRequest { E: serde::de::Error, { match value { - "room" => Ok(GeneratedField::Room), - "identity" => Ok(GeneratedField::Identity), - "trackSids" | "track_sids" => Ok(GeneratedField::TrackSids), - "subscribe" => Ok(GeneratedField::Subscribe), - "participantTracks" | "participant_tracks" => Ok(GeneratedField::ParticipantTracks), + "status" => Ok(GeneratedField::Status), + "load" => Ok(GeneratedField::Load), + "jobCount" | "job_count" => Ok(GeneratedField::JobCount), _ => Ok(GeneratedField::__SkipField__), } } @@ -25922,93 +29973,162 @@ impl<'de> serde::Deserialize<'de> for UpdateSubscriptionsRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = UpdateSubscriptionsRequest; + type Value = UpdateWorkerStatus; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.UpdateSubscriptionsRequest") + formatter.write_str("struct livekit.UpdateWorkerStatus") } - 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 track_sids__ = None; - let mut subscribe__ = None; - let mut participant_tracks__ = None; + let mut status__ = None; + let mut load__ = None; + let mut job_count__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Room => { - if room__.is_some() { - return Err(serde::de::Error::duplicate_field("room")); - } - room__ = Some(map_.next_value()?); - } - GeneratedField::Identity => { - if identity__.is_some() { - return Err(serde::de::Error::duplicate_field("identity")); - } - identity__ = Some(map_.next_value()?); - } - GeneratedField::TrackSids => { - if track_sids__.is_some() { - return Err(serde::de::Error::duplicate_field("trackSids")); + GeneratedField::Status => { + if status__.is_some() { + return Err(serde::de::Error::duplicate_field("status")); } - track_sids__ = Some(map_.next_value()?); + status__ = map_.next_value::<::std::option::Option>()?.map(|x| x as i32); } - GeneratedField::Subscribe => { - if subscribe__.is_some() { - return Err(serde::de::Error::duplicate_field("subscribe")); + GeneratedField::Load => { + if load__.is_some() { + return Err(serde::de::Error::duplicate_field("load")); } - subscribe__ = Some(map_.next_value()?); + load__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } - GeneratedField::ParticipantTracks => { - if participant_tracks__.is_some() { - return Err(serde::de::Error::duplicate_field("participantTracks")); + GeneratedField::JobCount => { + if job_count__.is_some() { + return Err(serde::de::Error::duplicate_field("jobCount")); } - participant_tracks__ = Some(map_.next_value()?); + job_count__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(UpdateSubscriptionsRequest { - room: room__.unwrap_or_default(), - identity: identity__.unwrap_or_default(), - track_sids: track_sids__.unwrap_or_default(), - subscribe: subscribe__.unwrap_or_default(), - participant_tracks: participant_tracks__.unwrap_or_default(), + Ok(UpdateWorkerStatus { + status: status__, + load: load__.unwrap_or_default(), + job_count: job_count__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.UpdateSubscriptionsRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.UpdateWorkerStatus", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for UpdateSubscriptionsResponse { +impl serde::Serialize for UserPacket { #[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.UpdateSubscriptionsResponse", len)?; + let mut len = 0; + if !self.participant_sid.is_empty() { + len += 1; + } + if !self.participant_identity.is_empty() { + len += 1; + } + if !self.payload.is_empty() { + len += 1; + } + if !self.destination_sids.is_empty() { + len += 1; + } + if !self.destination_identities.is_empty() { + len += 1; + } + if self.topic.is_some() { + len += 1; + } + if self.id.is_some() { + len += 1; + } + if self.start_time.is_some() { + len += 1; + } + if self.end_time.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.UserPacket", len)?; + if !self.participant_sid.is_empty() { + struct_ser.serialize_field("participantSid", &self.participant_sid)?; + } + if !self.participant_identity.is_empty() { + struct_ser.serialize_field("participantIdentity", &self.participant_identity)?; + } + if !self.payload.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("payload", pbjson::private::base64::encode(&self.payload).as_str())?; + } + if !self.destination_sids.is_empty() { + struct_ser.serialize_field("destinationSids", &self.destination_sids)?; + } + if !self.destination_identities.is_empty() { + struct_ser.serialize_field("destinationIdentities", &self.destination_identities)?; + } + if let Some(v) = self.topic.as_ref() { + struct_ser.serialize_field("topic", v)?; + } + if let Some(v) = self.id.as_ref() { + struct_ser.serialize_field("id", v)?; + } + if let Some(v) = self.start_time.as_ref() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("startTime", ToString::to_string(&v).as_str())?; + } + if let Some(v) = self.end_time.as_ref() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("endTime", ToString::to_string(&v).as_str())?; + } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for UpdateSubscriptionsResponse { +impl<'de> serde::Deserialize<'de> for UserPacket { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ + "participant_sid", + "participantSid", + "participant_identity", + "participantIdentity", + "payload", + "destination_sids", + "destinationSids", + "destination_identities", + "destinationIdentities", + "topic", + "id", + "start_time", + "startTime", + "end_time", + "endTime", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { + ParticipantSid, + ParticipantIdentity, + Payload, + DestinationSids, + DestinationIdentities, + Topic, + Id, + StartTime, + EndTime, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -26030,7 +30150,18 @@ impl<'de> serde::Deserialize<'de> for UpdateSubscriptionsResponse { where E: serde::de::Error, { - Ok(GeneratedField::__SkipField__) + match value { + "participantSid" | "participant_sid" => Ok(GeneratedField::ParticipantSid), + "participantIdentity" | "participant_identity" => Ok(GeneratedField::ParticipantIdentity), + "payload" => Ok(GeneratedField::Payload), + "destinationSids" | "destination_sids" => Ok(GeneratedField::DestinationSids), + "destinationIdentities" | "destination_identities" => Ok(GeneratedField::DestinationIdentities), + "topic" => Ok(GeneratedField::Topic), + "id" => Ok(GeneratedField::Id), + "startTime" | "start_time" => Ok(GeneratedField::StartTime), + "endTime" | "end_time" => Ok(GeneratedField::EndTime), + _ => Ok(GeneratedField::__SkipField__), + } } } deserializer.deserialize_identifier(GeneratedVisitor) @@ -26038,235 +30169,189 @@ impl<'de> serde::Deserialize<'de> for UpdateSubscriptionsResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = UpdateSubscriptionsResponse; + type Value = UserPacket; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.UpdateSubscriptionsResponse") + formatter.write_str("struct livekit.UserPacket") } - 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 participant_sid__ = None; + let mut participant_identity__ = None; + let mut payload__ = None; + let mut destination_sids__ = None; + let mut destination_identities__ = None; + let mut topic__ = None; + let mut id__ = None; + let mut start_time__ = None; + let mut end_time__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ParticipantSid => { + if participant_sid__.is_some() { + return Err(serde::de::Error::duplicate_field("participantSid")); + } + participant_sid__ = 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::Payload => { + if payload__.is_some() { + return Err(serde::de::Error::duplicate_field("payload")); + } + payload__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::DestinationSids => { + if destination_sids__.is_some() { + return Err(serde::de::Error::duplicate_field("destinationSids")); + } + destination_sids__ = Some(map_.next_value()?); + } + GeneratedField::DestinationIdentities => { + if destination_identities__.is_some() { + return Err(serde::de::Error::duplicate_field("destinationIdentities")); + } + destination_identities__ = Some(map_.next_value()?); + } + GeneratedField::Topic => { + if topic__.is_some() { + return Err(serde::de::Error::duplicate_field("topic")); + } + topic__ = map_.next_value()?; + } + GeneratedField::Id => { + if id__.is_some() { + return Err(serde::de::Error::duplicate_field("id")); + } + id__ = map_.next_value()?; + } + GeneratedField::StartTime => { + if start_time__.is_some() { + return Err(serde::de::Error::duplicate_field("startTime")); + } + start_time__ = + map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0) + ; + } + GeneratedField::EndTime => { + if end_time__.is_some() { + return Err(serde::de::Error::duplicate_field("endTime")); + } + end_time__ = + map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0) + ; + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } } - Ok(UpdateSubscriptionsResponse { + Ok(UserPacket { + participant_sid: participant_sid__.unwrap_or_default(), + participant_identity: participant_identity__.unwrap_or_default(), + payload: payload__.unwrap_or_default(), + destination_sids: destination_sids__.unwrap_or_default(), + destination_identities: destination_identities__.unwrap_or_default(), + topic: topic__, + id: id__, + start_time: start_time__, + end_time: end_time__, }) } } - deserializer.deserialize_struct("livekit.UpdateSubscriptionsResponse", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.UserPacket", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for UpdateTrackSettings { +impl serde::Serialize for VideoCodec { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.track_sids.is_empty() { - len += 1; - } - if self.disabled { - len += 1; - } - if self.quality != 0 { - len += 1; - } - if self.width != 0 { - len += 1; - } - if self.height != 0 { - len += 1; - } - if self.fps != 0 { - len += 1; - } - if self.priority != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("livekit.UpdateTrackSettings", len)?; - if !self.track_sids.is_empty() { - struct_ser.serialize_field("trackSids", &self.track_sids)?; - } - if self.disabled { - struct_ser.serialize_field("disabled", &self.disabled)?; - } - if self.quality != 0 { - let v = VideoQuality::try_from(self.quality) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.quality)))?; - struct_ser.serialize_field("quality", &v)?; - } - if self.width != 0 { - struct_ser.serialize_field("width", &self.width)?; - } - if self.height != 0 { - struct_ser.serialize_field("height", &self.height)?; - } - if self.fps != 0 { - struct_ser.serialize_field("fps", &self.fps)?; - } - if self.priority != 0 { - struct_ser.serialize_field("priority", &self.priority)?; - } - struct_ser.end() + let variant = match self { + Self::DefaultVc => "DEFAULT_VC", + Self::H264Baseline => "H264_BASELINE", + Self::H264Main => "H264_MAIN", + Self::H264High => "H264_HIGH", + Self::Vp8 => "VP8", + }; + serializer.serialize_str(variant) } } -impl<'de> serde::Deserialize<'de> for UpdateTrackSettings { +impl<'de> serde::Deserialize<'de> for VideoCodec { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "track_sids", - "trackSids", - "disabled", - "quality", - "width", - "height", - "fps", - "priority", + "DEFAULT_VC", + "H264_BASELINE", + "H264_MAIN", + "H264_HIGH", + "VP8", ]; - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - TrackSids, - Disabled, - Quality, - Width, - Height, - Fps, - Priority, - __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 { - "trackSids" | "track_sids" => Ok(GeneratedField::TrackSids), - "disabled" => Ok(GeneratedField::Disabled), - "quality" => Ok(GeneratedField::Quality), - "width" => Ok(GeneratedField::Width), - "height" => Ok(GeneratedField::Height), - "fps" => Ok(GeneratedField::Fps), - "priority" => Ok(GeneratedField::Priority), - _ => Ok(GeneratedField::__SkipField__), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = UpdateTrackSettings; + type Value = VideoCodec; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.UpdateTrackSettings") + 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_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 track_sids__ = None; - let mut disabled__ = None; - let mut quality__ = None; - let mut width__ = None; - let mut height__ = None; - let mut fps__ = None; - let mut priority__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::TrackSids => { - if track_sids__.is_some() { - return Err(serde::de::Error::duplicate_field("trackSids")); - } - track_sids__ = Some(map_.next_value()?); - } - GeneratedField::Disabled => { - if disabled__.is_some() { - return Err(serde::de::Error::duplicate_field("disabled")); - } - disabled__ = Some(map_.next_value()?); - } - GeneratedField::Quality => { - if quality__.is_some() { - return Err(serde::de::Error::duplicate_field("quality")); - } - quality__ = Some(map_.next_value::()? as i32); - } - 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::Fps => { - if fps__.is_some() { - return Err(serde::de::Error::duplicate_field("fps")); - } - fps__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Priority => { - if priority__.is_some() { - return Err(serde::de::Error::duplicate_field("priority")); - } - priority__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; - } - } + match value { + "DEFAULT_VC" => Ok(VideoCodec::DefaultVc), + "H264_BASELINE" => Ok(VideoCodec::H264Baseline), + "H264_MAIN" => Ok(VideoCodec::H264Main), + "H264_HIGH" => Ok(VideoCodec::H264High), + "VP8" => Ok(VideoCodec::Vp8), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } - Ok(UpdateTrackSettings { - track_sids: track_sids__.unwrap_or_default(), - disabled: disabled__.unwrap_or_default(), - quality: quality__.unwrap_or_default(), - width: width__.unwrap_or_default(), - height: height__.unwrap_or_default(), - fps: fps__.unwrap_or_default(), - priority: priority__.unwrap_or_default(), - }) } } - deserializer.deserialize_struct("livekit.UpdateTrackSettings", FIELDS, GeneratedVisitor) + deserializer.deserialize_any(GeneratedVisitor) } } -impl serde::Serialize for UpdateVideoLayers { +impl serde::Serialize for VideoConfiguration { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -26274,38 +30359,32 @@ impl serde::Serialize for UpdateVideoLayers { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.track_sid.is_empty() { - len += 1; - } - if !self.layers.is_empty() { + if self.hardware_encoder != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.UpdateVideoLayers", len)?; - if !self.track_sid.is_empty() { - struct_ser.serialize_field("trackSid", &self.track_sid)?; - } - if !self.layers.is_empty() { - struct_ser.serialize_field("layers", &self.layers)?; + let mut struct_ser = serializer.serialize_struct("livekit.VideoConfiguration", len)?; + if self.hardware_encoder != 0 { + let v = ClientConfigSetting::try_from(self.hardware_encoder) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.hardware_encoder)))?; + struct_ser.serialize_field("hardwareEncoder", &v)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for UpdateVideoLayers { +impl<'de> serde::Deserialize<'de> for VideoConfiguration { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "track_sid", - "trackSid", - "layers", + "hardware_encoder", + "hardwareEncoder", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - TrackSid, - Layers, + HardwareEncoder, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -26328,8 +30407,7 @@ impl<'de> serde::Deserialize<'de> for UpdateVideoLayers { E: serde::de::Error, { match value { - "trackSid" | "track_sid" => Ok(GeneratedField::TrackSid), - "layers" => Ok(GeneratedField::Layers), + "hardwareEncoder" | "hardware_encoder" => Ok(GeneratedField::HardwareEncoder), _ => Ok(GeneratedField::__SkipField__), } } @@ -26339,47 +30417,39 @@ impl<'de> serde::Deserialize<'de> for UpdateVideoLayers { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = UpdateVideoLayers; + type Value = VideoConfiguration; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.UpdateVideoLayers") + formatter.write_str("struct livekit.VideoConfiguration") } - 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 track_sid__ = None; - let mut layers__ = None; + let mut hardware_encoder__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::TrackSid => { - if track_sid__.is_some() { - return Err(serde::de::Error::duplicate_field("trackSid")); - } - track_sid__ = Some(map_.next_value()?); - } - GeneratedField::Layers => { - if layers__.is_some() { - return Err(serde::de::Error::duplicate_field("layers")); + GeneratedField::HardwareEncoder => { + if hardware_encoder__.is_some() { + return Err(serde::de::Error::duplicate_field("hardwareEncoder")); } - layers__ = Some(map_.next_value()?); + hardware_encoder__ = Some(map_.next_value::()? as i32); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(UpdateVideoLayers { - track_sid: track_sid__.unwrap_or_default(), - layers: layers__.unwrap_or_default(), + Ok(VideoConfiguration { + hardware_encoder: hardware_encoder__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.UpdateVideoLayers", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.VideoConfiguration", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for UserPacket { +impl serde::Serialize for VideoLayer { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -26387,102 +30457,63 @@ impl serde::Serialize for UserPacket { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.participant_sid.is_empty() { - len += 1; - } - if !self.participant_identity.is_empty() { - len += 1; - } - if !self.payload.is_empty() { - len += 1; - } - if !self.destination_sids.is_empty() { - len += 1; - } - if !self.destination_identities.is_empty() { + if self.quality != 0 { len += 1; } - if self.topic.is_some() { + if self.width != 0 { len += 1; } - if self.id.is_some() { + if self.height != 0 { len += 1; } - if self.start_time.is_some() { + if self.bitrate != 0 { len += 1; } - if self.end_time.is_some() { + if self.ssrc != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.UserPacket", len)?; - if !self.participant_sid.is_empty() { - struct_ser.serialize_field("participantSid", &self.participant_sid)?; - } - if !self.participant_identity.is_empty() { - struct_ser.serialize_field("participantIdentity", &self.participant_identity)?; - } - if !self.payload.is_empty() { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("payload", pbjson::private::base64::encode(&self.payload).as_str())?; - } - if !self.destination_sids.is_empty() { - struct_ser.serialize_field("destinationSids", &self.destination_sids)?; - } - if !self.destination_identities.is_empty() { - struct_ser.serialize_field("destinationIdentities", &self.destination_identities)?; + let mut struct_ser = serializer.serialize_struct("livekit.VideoLayer", len)?; + if self.quality != 0 { + let v = VideoQuality::try_from(self.quality) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.quality)))?; + struct_ser.serialize_field("quality", &v)?; } - if let Some(v) = self.topic.as_ref() { - struct_ser.serialize_field("topic", v)?; + if self.width != 0 { + struct_ser.serialize_field("width", &self.width)?; } - if let Some(v) = self.id.as_ref() { - struct_ser.serialize_field("id", v)?; + if self.height != 0 { + struct_ser.serialize_field("height", &self.height)?; } - if let Some(v) = self.start_time.as_ref() { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("startTime", ToString::to_string(&v).as_str())?; + if self.bitrate != 0 { + struct_ser.serialize_field("bitrate", &self.bitrate)?; } - if let Some(v) = self.end_time.as_ref() { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("endTime", ToString::to_string(&v).as_str())?; + if self.ssrc != 0 { + struct_ser.serialize_field("ssrc", &self.ssrc)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for UserPacket { +impl<'de> serde::Deserialize<'de> for VideoLayer { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "participant_sid", - "participantSid", - "participant_identity", - "participantIdentity", - "payload", - "destination_sids", - "destinationSids", - "destination_identities", - "destinationIdentities", - "topic", - "id", - "start_time", - "startTime", - "end_time", - "endTime", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ParticipantSid, - ParticipantIdentity, - Payload, - DestinationSids, - DestinationIdentities, - Topic, - Id, - StartTime, - EndTime, + "quality", + "width", + "height", + "bitrate", + "ssrc", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Quality, + Width, + Height, + Bitrate, + Ssrc, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -26505,15 +30536,11 @@ impl<'de> serde::Deserialize<'de> for UserPacket { E: serde::de::Error, { match value { - "participantSid" | "participant_sid" => Ok(GeneratedField::ParticipantSid), - "participantIdentity" | "participant_identity" => Ok(GeneratedField::ParticipantIdentity), - "payload" => Ok(GeneratedField::Payload), - "destinationSids" | "destination_sids" => Ok(GeneratedField::DestinationSids), - "destinationIdentities" | "destination_identities" => Ok(GeneratedField::DestinationIdentities), - "topic" => Ok(GeneratedField::Topic), - "id" => Ok(GeneratedField::Id), - "startTime" | "start_time" => Ok(GeneratedField::StartTime), - "endTime" | "end_time" => Ok(GeneratedField::EndTime), + "quality" => Ok(GeneratedField::Quality), + "width" => Ok(GeneratedField::Width), + "height" => Ok(GeneratedField::Height), + "bitrate" => Ok(GeneratedField::Bitrate), + "ssrc" => Ok(GeneratedField::Ssrc), _ => Ok(GeneratedField::__SkipField__), } } @@ -26523,85 +30550,59 @@ impl<'de> serde::Deserialize<'de> for UserPacket { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = UserPacket; + type Value = VideoLayer; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.UserPacket") + formatter.write_str("struct livekit.VideoLayer") } - 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 participant_sid__ = None; - let mut participant_identity__ = None; - let mut payload__ = None; - let mut destination_sids__ = None; - let mut destination_identities__ = None; - let mut topic__ = None; - let mut id__ = None; - let mut start_time__ = None; - let mut end_time__ = None; + let mut quality__ = None; + let mut width__ = None; + let mut height__ = None; + let mut bitrate__ = None; + let mut ssrc__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::ParticipantSid => { - if participant_sid__.is_some() { - return Err(serde::de::Error::duplicate_field("participantSid")); - } - participant_sid__ = Some(map_.next_value()?); - } - GeneratedField::ParticipantIdentity => { - if participant_identity__.is_some() { - return Err(serde::de::Error::duplicate_field("participantIdentity")); + GeneratedField::Quality => { + if quality__.is_some() { + return Err(serde::de::Error::duplicate_field("quality")); } - participant_identity__ = Some(map_.next_value()?); + quality__ = Some(map_.next_value::()? as i32); } - GeneratedField::Payload => { - if payload__.is_some() { - return Err(serde::de::Error::duplicate_field("payload")); + GeneratedField::Width => { + if width__.is_some() { + return Err(serde::de::Error::duplicate_field("width")); } - payload__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + width__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } - GeneratedField::DestinationSids => { - if destination_sids__.is_some() { - return Err(serde::de::Error::duplicate_field("destinationSids")); - } - destination_sids__ = Some(map_.next_value()?); - } - GeneratedField::DestinationIdentities => { - if destination_identities__.is_some() { - return Err(serde::de::Error::duplicate_field("destinationIdentities")); - } - destination_identities__ = Some(map_.next_value()?); - } - GeneratedField::Topic => { - if topic__.is_some() { - return Err(serde::de::Error::duplicate_field("topic")); - } - topic__ = map_.next_value()?; - } - GeneratedField::Id => { - if id__.is_some() { - return Err(serde::de::Error::duplicate_field("id")); + GeneratedField::Height => { + if height__.is_some() { + return Err(serde::de::Error::duplicate_field("height")); } - id__ = map_.next_value()?; + height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } - GeneratedField::StartTime => { - if start_time__.is_some() { - return Err(serde::de::Error::duplicate_field("startTime")); + GeneratedField::Bitrate => { + if bitrate__.is_some() { + return Err(serde::de::Error::duplicate_field("bitrate")); } - start_time__ = - map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0) + bitrate__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } - GeneratedField::EndTime => { - if end_time__.is_some() { - return Err(serde::de::Error::duplicate_field("endTime")); + GeneratedField::Ssrc => { + if ssrc__.is_some() { + return Err(serde::de::Error::duplicate_field("ssrc")); } - end_time__ = - map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0) + ssrc__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::__SkipField__ => { @@ -26609,56 +30610,50 @@ impl<'de> serde::Deserialize<'de> for UserPacket { } } } - Ok(UserPacket { - participant_sid: participant_sid__.unwrap_or_default(), - participant_identity: participant_identity__.unwrap_or_default(), - payload: payload__.unwrap_or_default(), - destination_sids: destination_sids__.unwrap_or_default(), - destination_identities: destination_identities__.unwrap_or_default(), - topic: topic__, - id: id__, - start_time: start_time__, - end_time: end_time__, + Ok(VideoLayer { + quality: quality__.unwrap_or_default(), + width: width__.unwrap_or_default(), + height: height__.unwrap_or_default(), + bitrate: bitrate__.unwrap_or_default(), + ssrc: ssrc__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.UserPacket", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.VideoLayer", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for VideoCodec { +impl serde::Serialize for VideoQuality { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { let variant = match self { - Self::DefaultVc => "DEFAULT_VC", - Self::H264Baseline => "H264_BASELINE", - Self::H264Main => "H264_MAIN", - Self::H264High => "H264_HIGH", - Self::Vp8 => "VP8", + Self::Low => "LOW", + Self::Medium => "MEDIUM", + Self::High => "HIGH", + Self::Off => "OFF", }; serializer.serialize_str(variant) } } -impl<'de> serde::Deserialize<'de> for VideoCodec { +impl<'de> serde::Deserialize<'de> for VideoQuality { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "DEFAULT_VC", - "H264_BASELINE", - "H264_MAIN", - "H264_HIGH", - "VP8", + "LOW", + "MEDIUM", + "HIGH", + "OFF", ]; struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = VideoCodec; + type Value = VideoQuality; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(formatter, "expected one of: {:?}", &FIELDS) @@ -26693,11 +30688,10 @@ impl<'de> serde::Deserialize<'de> for VideoCodec { E: serde::de::Error, { match value { - "DEFAULT_VC" => Ok(VideoCodec::DefaultVc), - "H264_BASELINE" => Ok(VideoCodec::H264Baseline), - "H264_MAIN" => Ok(VideoCodec::H264Main), - "H264_HIGH" => Ok(VideoCodec::H264High), - "VP8" => Ok(VideoCodec::Vp8), + "LOW" => Ok(VideoQuality::Low), + "MEDIUM" => Ok(VideoQuality::Medium), + "HIGH" => Ok(VideoQuality::High), + "OFF" => Ok(VideoQuality::Off), _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } } @@ -26705,7 +30699,7 @@ impl<'de> serde::Deserialize<'de> for VideoCodec { deserializer.deserialize_any(GeneratedVisitor) } } -impl serde::Serialize for VideoConfiguration { +impl serde::Serialize for WebEgressRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -26713,32 +30707,133 @@ impl serde::Serialize for VideoConfiguration { { use serde::ser::SerializeStruct; let mut len = 0; - if self.hardware_encoder != 0 { + if !self.url.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.VideoConfiguration", len)?; - if self.hardware_encoder != 0 { - let v = ClientConfigSetting::try_from(self.hardware_encoder) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.hardware_encoder)))?; - struct_ser.serialize_field("hardwareEncoder", &v)?; + if self.audio_only { + len += 1; + } + if self.video_only { + len += 1; + } + if self.await_start_signal { + 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() { + len += 1; + } + if self.options.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.WebEgressRequest", len)?; + if !self.url.is_empty() { + struct_ser.serialize_field("url", &self.url)?; + } + if self.audio_only { + struct_ser.serialize_field("audioOnly", &self.audio_only)?; + } + if self.video_only { + struct_ser.serialize_field("videoOnly", &self.video_only)?; + } + if self.await_start_signal { + struct_ser.serialize_field("awaitStartSignal", &self.await_start_signal)?; + } + 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 { + web_egress_request::Output::File(v) => { + struct_ser.serialize_field("file", v)?; + } + web_egress_request::Output::Stream(v) => { + struct_ser.serialize_field("stream", v)?; + } + web_egress_request::Output::Segments(v) => { + struct_ser.serialize_field("segments", v)?; + } + } + } + if let Some(v) = self.options.as_ref() { + match v { + web_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)?; + } + web_egress_request::Options::Advanced(v) => { + struct_ser.serialize_field("advanced", v)?; + } + } } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for VideoConfiguration { +impl<'de> serde::Deserialize<'de> for WebEgressRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "hardware_encoder", - "hardwareEncoder", + "url", + "audio_only", + "audioOnly", + "video_only", + "videoOnly", + "await_start_signal", + "awaitStartSignal", + "file_outputs", + "fileOutputs", + "stream_outputs", + "streamOutputs", + "segment_outputs", + "segmentOutputs", + "image_outputs", + "imageOutputs", + "file", + "stream", + "segments", + "preset", + "advanced", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - HardwareEncoder, + Url, + AudioOnly, + VideoOnly, + AwaitStartSignal, + FileOutputs, + StreamOutputs, + SegmentOutputs, + ImageOutputs, + File, + Stream, + Segments, + Preset, + Advanced, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -26761,7 +30856,19 @@ impl<'de> serde::Deserialize<'de> for VideoConfiguration { E: serde::de::Error, { match value { - "hardwareEncoder" | "hardware_encoder" => Ok(GeneratedField::HardwareEncoder), + "url" => Ok(GeneratedField::Url), + "audioOnly" | "audio_only" => Ok(GeneratedField::AudioOnly), + "videoOnly" | "video_only" => Ok(GeneratedField::VideoOnly), + "awaitStartSignal" | "await_start_signal" => Ok(GeneratedField::AwaitStartSignal), + "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__), } } @@ -26771,39 +30878,133 @@ impl<'de> serde::Deserialize<'de> for VideoConfiguration { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = VideoConfiguration; + type Value = WebEgressRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.VideoConfiguration") + formatter.write_str("struct livekit.WebEgressRequest") } - 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 hardware_encoder__ = None; + let mut url__ = None; + let mut audio_only__ = None; + let mut video_only__ = None; + let mut await_start_signal__ = 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::HardwareEncoder => { - if hardware_encoder__.is_some() { - return Err(serde::de::Error::duplicate_field("hardwareEncoder")); + GeneratedField::Url => { + if url__.is_some() { + return Err(serde::de::Error::duplicate_field("url")); } - hardware_encoder__ = Some(map_.next_value::()? as i32); + url__ = Some(map_.next_value()?); + } + GeneratedField::AudioOnly => { + if audio_only__.is_some() { + return Err(serde::de::Error::duplicate_field("audioOnly")); + } + audio_only__ = Some(map_.next_value()?); + } + GeneratedField::VideoOnly => { + if video_only__.is_some() { + return Err(serde::de::Error::duplicate_field("videoOnly")); + } + video_only__ = Some(map_.next_value()?); + } + GeneratedField::AwaitStartSignal => { + if await_start_signal__.is_some() { + return Err(serde::de::Error::duplicate_field("awaitStartSignal")); + } + await_start_signal__ = Some(map_.next_value()?); + } + GeneratedField::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(web_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(web_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(web_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| web_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(web_egress_request::Options::Advanced) +; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(VideoConfiguration { - hardware_encoder: hardware_encoder__.unwrap_or_default(), + Ok(WebEgressRequest { + url: url__.unwrap_or_default(), + audio_only: audio_only__.unwrap_or_default(), + video_only: video_only__.unwrap_or_default(), + await_start_signal: await_start_signal__.unwrap_or_default(), + 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.VideoConfiguration", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.WebEgressRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for VideoLayer { +impl serde::Serialize for WebhookEvent { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -26811,63 +31012,98 @@ impl serde::Serialize for VideoLayer { { use serde::ser::SerializeStruct; let mut len = 0; - if self.quality != 0 { + if !self.event.is_empty() { len += 1; } - if self.width != 0 { + if self.room.is_some() { len += 1; } - if self.height != 0 { + if self.participant.is_some() { len += 1; } - if self.bitrate != 0 { + if self.egress_info.is_some() { len += 1; } - if self.ssrc != 0 { + if self.ingress_info.is_some() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.VideoLayer", len)?; - if self.quality != 0 { - let v = VideoQuality::try_from(self.quality) - .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.quality)))?; - struct_ser.serialize_field("quality", &v)?; + if self.track.is_some() { + len += 1; } - if self.width != 0 { - struct_ser.serialize_field("width", &self.width)?; + if !self.id.is_empty() { + len += 1; } - if self.height != 0 { - struct_ser.serialize_field("height", &self.height)?; + if self.created_at != 0 { + len += 1; } - if self.bitrate != 0 { - struct_ser.serialize_field("bitrate", &self.bitrate)?; + if self.num_dropped != 0 { + len += 1; } - if self.ssrc != 0 { - struct_ser.serialize_field("ssrc", &self.ssrc)?; + let mut struct_ser = serializer.serialize_struct("livekit.WebhookEvent", len)?; + if !self.event.is_empty() { + struct_ser.serialize_field("event", &self.event)?; + } + 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.egress_info.as_ref() { + struct_ser.serialize_field("egressInfo", v)?; + } + if let Some(v) = self.ingress_info.as_ref() { + struct_ser.serialize_field("ingressInfo", v)?; + } + if let Some(v) = self.track.as_ref() { + struct_ser.serialize_field("track", v)?; + } + if !self.id.is_empty() { + struct_ser.serialize_field("id", &self.id)?; + } + if self.created_at != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("createdAt", ToString::to_string(&self.created_at).as_str())?; + } + if self.num_dropped != 0 { + struct_ser.serialize_field("numDropped", &self.num_dropped)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for VideoLayer { +impl<'de> serde::Deserialize<'de> for WebhookEvent { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "quality", - "width", - "height", - "bitrate", - "ssrc", + "event", + "room", + "participant", + "egress_info", + "egressInfo", + "ingress_info", + "ingressInfo", + "track", + "id", + "created_at", + "createdAt", + "num_dropped", + "numDropped", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Quality, - Width, - Height, - Bitrate, - Ssrc, + Event, + Room, + Participant, + EgressInfo, + IngressInfo, + Track, + Id, + CreatedAt, + NumDropped, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -26890,11 +31126,15 @@ impl<'de> serde::Deserialize<'de> for VideoLayer { E: serde::de::Error, { match value { - "quality" => Ok(GeneratedField::Quality), - "width" => Ok(GeneratedField::Width), - "height" => Ok(GeneratedField::Height), - "bitrate" => Ok(GeneratedField::Bitrate), - "ssrc" => Ok(GeneratedField::Ssrc), + "event" => Ok(GeneratedField::Event), + "room" => Ok(GeneratedField::Room), + "participant" => Ok(GeneratedField::Participant), + "egressInfo" | "egress_info" => Ok(GeneratedField::EgressInfo), + "ingressInfo" | "ingress_info" => Ok(GeneratedField::IngressInfo), + "track" => Ok(GeneratedField::Track), + "id" => Ok(GeneratedField::Id), + "createdAt" | "created_at" => Ok(GeneratedField::CreatedAt), + "numDropped" | "num_dropped" => Ok(GeneratedField::NumDropped), _ => Ok(GeneratedField::__SkipField__), } } @@ -26904,58 +31144,82 @@ impl<'de> serde::Deserialize<'de> for VideoLayer { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = VideoLayer; + type Value = WebhookEvent; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.VideoLayer") + formatter.write_str("struct livekit.WebhookEvent") } - 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 quality__ = None; - let mut width__ = None; - let mut height__ = None; - let mut bitrate__ = None; - let mut ssrc__ = None; + let mut event__ = None; + let mut room__ = None; + let mut participant__ = None; + let mut egress_info__ = None; + let mut ingress_info__ = None; + let mut track__ = None; + let mut id__ = None; + let mut created_at__ = None; + let mut num_dropped__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Quality => { - if quality__.is_some() { - return Err(serde::de::Error::duplicate_field("quality")); + GeneratedField::Event => { + if event__.is_some() { + return Err(serde::de::Error::duplicate_field("event")); } - quality__ = Some(map_.next_value::()? as i32); + event__ = Some(map_.next_value()?); } - GeneratedField::Width => { - if width__.is_some() { - return Err(serde::de::Error::duplicate_field("width")); + GeneratedField::Room => { + if room__.is_some() { + return Err(serde::de::Error::duplicate_field("room")); } - width__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + room__ = map_.next_value()?; } - GeneratedField::Height => { - if height__.is_some() { - return Err(serde::de::Error::duplicate_field("height")); + GeneratedField::Participant => { + if participant__.is_some() { + return Err(serde::de::Error::duplicate_field("participant")); } - height__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + participant__ = map_.next_value()?; } - GeneratedField::Bitrate => { - if bitrate__.is_some() { - return Err(serde::de::Error::duplicate_field("bitrate")); + GeneratedField::EgressInfo => { + if egress_info__.is_some() { + return Err(serde::de::Error::duplicate_field("egressInfo")); } - bitrate__ = + egress_info__ = map_.next_value()?; + } + GeneratedField::IngressInfo => { + if ingress_info__.is_some() { + return Err(serde::de::Error::duplicate_field("ingressInfo")); + } + ingress_info__ = map_.next_value()?; + } + GeneratedField::Track => { + if track__.is_some() { + return Err(serde::de::Error::duplicate_field("track")); + } + track__ = map_.next_value()?; + } + GeneratedField::Id => { + if id__.is_some() { + return Err(serde::de::Error::duplicate_field("id")); + } + id__ = Some(map_.next_value()?); + } + GeneratedField::CreatedAt => { + if created_at__.is_some() { + return Err(serde::de::Error::duplicate_field("createdAt")); + } + created_at__ = Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } - GeneratedField::Ssrc => { - if ssrc__.is_some() { - return Err(serde::de::Error::duplicate_field("ssrc")); + GeneratedField::NumDropped => { + if num_dropped__.is_some() { + return Err(serde::de::Error::duplicate_field("numDropped")); } - ssrc__ = + num_dropped__ = Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } @@ -26964,230 +31228,91 @@ impl<'de> serde::Deserialize<'de> for VideoLayer { } } } - Ok(VideoLayer { - quality: quality__.unwrap_or_default(), - width: width__.unwrap_or_default(), - height: height__.unwrap_or_default(), - bitrate: bitrate__.unwrap_or_default(), - ssrc: ssrc__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("livekit.VideoLayer", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for VideoQuality { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::Low => "LOW", - Self::Medium => "MEDIUM", - Self::High => "HIGH", - Self::Off => "OFF", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for VideoQuality { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "LOW", - "MEDIUM", - "HIGH", - "OFF", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = VideoQuality; - - 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 { - "LOW" => Ok(VideoQuality::Low), - "MEDIUM" => Ok(VideoQuality::Medium), - "HIGH" => Ok(VideoQuality::High), - "OFF" => Ok(VideoQuality::Off), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for WebEgressRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.url.is_empty() { - len += 1; - } - if self.audio_only { - len += 1; - } - if self.video_only { - len += 1; - } - if self.await_start_signal { - len += 1; - } - 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.WebEgressRequest", len)?; - if !self.url.is_empty() { - struct_ser.serialize_field("url", &self.url)?; - } - if self.audio_only { - struct_ser.serialize_field("audioOnly", &self.audio_only)?; - } - if self.video_only { - struct_ser.serialize_field("videoOnly", &self.video_only)?; - } - if self.await_start_signal { - struct_ser.serialize_field("awaitStartSignal", &self.await_start_signal)?; - } - 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)?; + Ok(WebhookEvent { + event: event__.unwrap_or_default(), + room: room__, + participant: participant__, + egress_info: egress_info__, + ingress_info: ingress_info__, + track: track__, + id: id__.unwrap_or_default(), + created_at: created_at__.unwrap_or_default(), + num_dropped: num_dropped__.unwrap_or_default(), + }) + } } - if !self.image_outputs.is_empty() { - struct_ser.serialize_field("imageOutputs", &self.image_outputs)?; + deserializer.deserialize_struct("livekit.WebhookEvent", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for WorkerMessage { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.message.is_some() { + len += 1; } - if let Some(v) = self.output.as_ref() { + let mut struct_ser = serializer.serialize_struct("livekit.WorkerMessage", len)?; + if let Some(v) = self.message.as_ref() { match v { - web_egress_request::Output::File(v) => { - struct_ser.serialize_field("file", v)?; + worker_message::Message::Register(v) => { + struct_ser.serialize_field("register", v)?; } - web_egress_request::Output::Stream(v) => { - struct_ser.serialize_field("stream", v)?; + worker_message::Message::Availability(v) => { + struct_ser.serialize_field("availability", v)?; } - web_egress_request::Output::Segments(v) => { - struct_ser.serialize_field("segments", v)?; + worker_message::Message::UpdateWorker(v) => { + struct_ser.serialize_field("updateWorker", v)?; } - } - } - if let Some(v) = self.options.as_ref() { - match v { - web_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)?; + worker_message::Message::UpdateJob(v) => { + struct_ser.serialize_field("updateJob", v)?; } - web_egress_request::Options::Advanced(v) => { - struct_ser.serialize_field("advanced", v)?; + worker_message::Message::Ping(v) => { + struct_ser.serialize_field("ping", v)?; + } + worker_message::Message::SimulateJob(v) => { + struct_ser.serialize_field("simulateJob", v)?; + } + worker_message::Message::MigrateJob(v) => { + struct_ser.serialize_field("migrateJob", v)?; } } } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for WebEgressRequest { +impl<'de> serde::Deserialize<'de> for WorkerMessage { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "url", - "audio_only", - "audioOnly", - "video_only", - "videoOnly", - "await_start_signal", - "awaitStartSignal", - "file_outputs", - "fileOutputs", - "stream_outputs", - "streamOutputs", - "segment_outputs", - "segmentOutputs", - "image_outputs", - "imageOutputs", - "file", - "stream", - "segments", - "preset", - "advanced", + "register", + "availability", + "update_worker", + "updateWorker", + "update_job", + "updateJob", + "ping", + "simulate_job", + "simulateJob", + "migrate_job", + "migrateJob", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Url, - AudioOnly, - VideoOnly, - AwaitStartSignal, - FileOutputs, - StreamOutputs, - SegmentOutputs, - ImageOutputs, - File, - Stream, - Segments, - Preset, - Advanced, + Register, + Availability, + UpdateWorker, + UpdateJob, + Ping, + SimulateJob, + MigrateJob, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -27210,19 +31335,13 @@ impl<'de> serde::Deserialize<'de> for WebEgressRequest { E: serde::de::Error, { match value { - "url" => Ok(GeneratedField::Url), - "audioOnly" | "audio_only" => Ok(GeneratedField::AudioOnly), - "videoOnly" | "video_only" => Ok(GeneratedField::VideoOnly), - "awaitStartSignal" | "await_start_signal" => Ok(GeneratedField::AwaitStartSignal), - "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), + "register" => Ok(GeneratedField::Register), + "availability" => Ok(GeneratedField::Availability), + "updateWorker" | "update_worker" => Ok(GeneratedField::UpdateWorker), + "updateJob" | "update_job" => Ok(GeneratedField::UpdateJob), + "ping" => Ok(GeneratedField::Ping), + "simulateJob" | "simulate_job" => Ok(GeneratedField::SimulateJob), + "migrateJob" | "migrate_job" => Ok(GeneratedField::MigrateJob), _ => Ok(GeneratedField::__SkipField__), } } @@ -27232,133 +31351,180 @@ impl<'de> serde::Deserialize<'de> for WebEgressRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = WebEgressRequest; + type Value = WorkerMessage; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.WebEgressRequest") + formatter.write_str("struct livekit.WorkerMessage") } - 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 url__ = None; - let mut audio_only__ = None; - let mut video_only__ = None; - let mut await_start_signal__ = 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 message__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Url => { - if url__.is_some() { - return Err(serde::de::Error::duplicate_field("url")); - } - url__ = Some(map_.next_value()?); - } - GeneratedField::AudioOnly => { - if audio_only__.is_some() { - return Err(serde::de::Error::duplicate_field("audioOnly")); - } - audio_only__ = Some(map_.next_value()?); - } - GeneratedField::VideoOnly => { - if video_only__.is_some() { - return Err(serde::de::Error::duplicate_field("videoOnly")); - } - video_only__ = Some(map_.next_value()?); - } - GeneratedField::AwaitStartSignal => { - if await_start_signal__.is_some() { - return Err(serde::de::Error::duplicate_field("awaitStartSignal")); - } - await_start_signal__ = Some(map_.next_value()?); - } - GeneratedField::FileOutputs => { - if file_outputs__.is_some() { - return Err(serde::de::Error::duplicate_field("fileOutputs")); + GeneratedField::Register => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("register")); } - file_outputs__ = Some(map_.next_value()?); + message__ = map_.next_value::<::std::option::Option<_>>()?.map(worker_message::Message::Register) +; } - GeneratedField::StreamOutputs => { - if stream_outputs__.is_some() { - return Err(serde::de::Error::duplicate_field("streamOutputs")); + GeneratedField::Availability => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("availability")); } - stream_outputs__ = Some(map_.next_value()?); + message__ = map_.next_value::<::std::option::Option<_>>()?.map(worker_message::Message::Availability) +; } - GeneratedField::SegmentOutputs => { - if segment_outputs__.is_some() { - return Err(serde::de::Error::duplicate_field("segmentOutputs")); + GeneratedField::UpdateWorker => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("updateWorker")); } - segment_outputs__ = Some(map_.next_value()?); + message__ = map_.next_value::<::std::option::Option<_>>()?.map(worker_message::Message::UpdateWorker) +; } - GeneratedField::ImageOutputs => { - if image_outputs__.is_some() { - return Err(serde::de::Error::duplicate_field("imageOutputs")); + GeneratedField::UpdateJob => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("updateJob")); } - image_outputs__ = Some(map_.next_value()?); + message__ = map_.next_value::<::std::option::Option<_>>()?.map(worker_message::Message::UpdateJob) +; } - GeneratedField::File => { - if output__.is_some() { - return Err(serde::de::Error::duplicate_field("file")); + GeneratedField::Ping => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("ping")); } - output__ = map_.next_value::<::std::option::Option<_>>()?.map(web_egress_request::Output::File) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(worker_message::Message::Ping) ; } - GeneratedField::Stream => { - if output__.is_some() { - return Err(serde::de::Error::duplicate_field("stream")); + GeneratedField::SimulateJob => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("simulateJob")); } - output__ = map_.next_value::<::std::option::Option<_>>()?.map(web_egress_request::Output::Stream) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(worker_message::Message::SimulateJob) ; } - GeneratedField::Segments => { - if output__.is_some() { - return Err(serde::de::Error::duplicate_field("segments")); + GeneratedField::MigrateJob => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("migrateJob")); } - output__ = map_.next_value::<::std::option::Option<_>>()?.map(web_egress_request::Output::Segments) + message__ = map_.next_value::<::std::option::Option<_>>()?.map(worker_message::Message::MigrateJob) ; } - GeneratedField::Preset => { - if options__.is_some() { - return Err(serde::de::Error::duplicate_field("preset")); - } - options__ = map_.next_value::<::std::option::Option>()?.map(|x| web_egress_request::Options::Preset(x as i32)); + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; } - GeneratedField::Advanced => { - if options__.is_some() { - return Err(serde::de::Error::duplicate_field("advanced")); + } + } + Ok(WorkerMessage { + message: message__, + }) + } + } + deserializer.deserialize_struct("livekit.WorkerMessage", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for WorkerPing { + #[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 != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.WorkerPing", len)?; + if self.timestamp != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for WorkerPing { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "timestamp", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Timestamp, + __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 { + "timestamp" => Ok(GeneratedField::Timestamp), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = WorkerPing; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.WorkerPing") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut timestamp__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Timestamp => { + if timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timestamp")); } - options__ = map_.next_value::<::std::option::Option<_>>()?.map(web_egress_request::Options::Advanced) -; + timestamp__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(WebEgressRequest { - url: url__.unwrap_or_default(), - audio_only: audio_only__.unwrap_or_default(), - video_only: video_only__.unwrap_or_default(), - await_start_signal: await_start_signal__.unwrap_or_default(), - 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(WorkerPing { + timestamp: timestamp__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.WebEgressRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.WorkerPing", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for WebhookEvent { +impl serde::Serialize for WorkerPong { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -27366,98 +31532,40 @@ impl serde::Serialize for WebhookEvent { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.event.is_empty() { - len += 1; - } - if self.room.is_some() { - len += 1; - } - if self.participant.is_some() { - len += 1; - } - if self.egress_info.is_some() { - len += 1; - } - if self.ingress_info.is_some() { - len += 1; - } - if self.track.is_some() { - len += 1; - } - if !self.id.is_empty() { - len += 1; - } - if self.created_at != 0 { + if self.last_timestamp != 0 { len += 1; } - if self.num_dropped != 0 { + if self.timestamp != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.WebhookEvent", len)?; - if !self.event.is_empty() { - struct_ser.serialize_field("event", &self.event)?; - } - 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.egress_info.as_ref() { - struct_ser.serialize_field("egressInfo", v)?; - } - if let Some(v) = self.ingress_info.as_ref() { - struct_ser.serialize_field("ingressInfo", v)?; - } - if let Some(v) = self.track.as_ref() { - struct_ser.serialize_field("track", v)?; - } - if !self.id.is_empty() { - struct_ser.serialize_field("id", &self.id)?; - } - if self.created_at != 0 { + let mut struct_ser = serializer.serialize_struct("livekit.WorkerPong", len)?; + if self.last_timestamp != 0 { #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("createdAt", ToString::to_string(&self.created_at).as_str())?; + struct_ser.serialize_field("lastTimestamp", ToString::to_string(&self.last_timestamp).as_str())?; } - if self.num_dropped != 0 { - struct_ser.serialize_field("numDropped", &self.num_dropped)?; + if self.timestamp != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for WebhookEvent { +impl<'de> serde::Deserialize<'de> for WorkerPong { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "event", - "room", - "participant", - "egress_info", - "egressInfo", - "ingress_info", - "ingressInfo", - "track", - "id", - "created_at", - "createdAt", - "num_dropped", - "numDropped", + "last_timestamp", + "lastTimestamp", + "timestamp", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Event, - Room, - Participant, - EgressInfo, - IngressInfo, - Track, - Id, - CreatedAt, - NumDropped, + LastTimestamp, + Timestamp, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -27480,15 +31588,8 @@ impl<'de> serde::Deserialize<'de> for WebhookEvent { E: serde::de::Error, { match value { - "event" => Ok(GeneratedField::Event), - "room" => Ok(GeneratedField::Room), - "participant" => Ok(GeneratedField::Participant), - "egressInfo" | "egress_info" => Ok(GeneratedField::EgressInfo), - "ingressInfo" | "ingress_info" => Ok(GeneratedField::IngressInfo), - "track" => Ok(GeneratedField::Track), - "id" => Ok(GeneratedField::Id), - "createdAt" | "created_at" => Ok(GeneratedField::CreatedAt), - "numDropped" | "num_dropped" => Ok(GeneratedField::NumDropped), + "lastTimestamp" | "last_timestamp" => Ok(GeneratedField::LastTimestamp), + "timestamp" => Ok(GeneratedField::Timestamp), _ => Ok(GeneratedField::__SkipField__), } } @@ -27498,82 +31599,33 @@ impl<'de> serde::Deserialize<'de> for WebhookEvent { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = WebhookEvent; + type Value = WorkerPong; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.WebhookEvent") + formatter.write_str("struct livekit.WorkerPong") } - 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 event__ = None; - let mut room__ = None; - let mut participant__ = None; - let mut egress_info__ = None; - let mut ingress_info__ = None; - let mut track__ = None; - let mut id__ = None; - let mut created_at__ = None; - let mut num_dropped__ = None; + let mut last_timestamp__ = None; + let mut timestamp__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Event => { - if event__.is_some() { - return Err(serde::de::Error::duplicate_field("event")); - } - event__ = Some(map_.next_value()?); - } - GeneratedField::Room => { - if room__.is_some() { - return Err(serde::de::Error::duplicate_field("room")); - } - room__ = map_.next_value()?; - } - GeneratedField::Participant => { - if participant__.is_some() { - return Err(serde::de::Error::duplicate_field("participant")); - } - participant__ = map_.next_value()?; - } - GeneratedField::EgressInfo => { - if egress_info__.is_some() { - return Err(serde::de::Error::duplicate_field("egressInfo")); - } - egress_info__ = map_.next_value()?; - } - GeneratedField::IngressInfo => { - if ingress_info__.is_some() { - return Err(serde::de::Error::duplicate_field("ingressInfo")); - } - ingress_info__ = map_.next_value()?; - } - GeneratedField::Track => { - if track__.is_some() { - return Err(serde::de::Error::duplicate_field("track")); - } - track__ = map_.next_value()?; - } - GeneratedField::Id => { - if id__.is_some() { - return Err(serde::de::Error::duplicate_field("id")); - } - id__ = Some(map_.next_value()?); - } - GeneratedField::CreatedAt => { - if created_at__.is_some() { - return Err(serde::de::Error::duplicate_field("createdAt")); + GeneratedField::LastTimestamp => { + if last_timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("lastTimestamp")); } - created_at__ = + last_timestamp__ = Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } - GeneratedField::NumDropped => { - if num_dropped__.is_some() { - return Err(serde::de::Error::duplicate_field("numDropped")); + GeneratedField::Timestamp => { + if timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timestamp")); } - num_dropped__ = + timestamp__ = Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } @@ -27582,19 +31634,83 @@ impl<'de> serde::Deserialize<'de> for WebhookEvent { } } } - Ok(WebhookEvent { - event: event__.unwrap_or_default(), - room: room__, - participant: participant__, - egress_info: egress_info__, - ingress_info: ingress_info__, - track: track__, - id: id__.unwrap_or_default(), - created_at: created_at__.unwrap_or_default(), - num_dropped: num_dropped__.unwrap_or_default(), + Ok(WorkerPong { + last_timestamp: last_timestamp__.unwrap_or_default(), + timestamp: timestamp__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.WebhookEvent", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.WorkerPong", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for WorkerStatus { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::WsAvailable => "WS_AVAILABLE", + Self::WsFull => "WS_FULL", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for WorkerStatus { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "WS_AVAILABLE", + "WS_FULL", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = WorkerStatus; + + 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 { + "WS_AVAILABLE" => Ok(WorkerStatus::WsAvailable), + "WS_FULL" => Ok(WorkerStatus::WsFull), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) } }