From 1e47c5c11169c458ec6a64ae3bb17eced22379bb Mon Sep 17 00:00:00 2001 From: Denys Smirnov Date: Sat, 22 Jun 2024 01:35:01 +0300 Subject: [PATCH] Update protocol (#350) * Update protocol. * generated protobuf * Handle attribute updates. --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --- livekit-api/src/access_token.rs | 22 + livekit-api/src/services/egress.rs | 27 +- livekit-api/src/services/ingress.rs | 16 +- livekit-api/src/services/mod.rs | 17 +- livekit-api/src/services/room.rs | 84 +- livekit-api/src/services/sip.rs | 208 +- livekit-ffi/protocol/room.proto | 2 +- livekit-ffi/src/livekit.proto.rs | 4 +- livekit-ffi/src/server/room.rs | 6 +- livekit-protocol/protocol | 2 +- livekit-protocol/src/livekit.rs | 270 +- livekit-protocol/src/livekit.serde.rs | 5790 +++++++++++------ livekit/src/room/mod.rs | 7 +- .../src/room/participant/local_participant.rs | 37 +- livekit/src/room/participant/mod.rs | 20 + .../room/participant/remote_participant.rs | 3 +- 16 files changed, 4341 insertions(+), 2174 deletions(-) diff --git a/livekit-api/src/access_token.rs b/livekit-api/src/access_token.rs index c1b82f81..52131326 100644 --- a/livekit-api/src/access_token.rs +++ b/livekit-api/src/access_token.rs @@ -95,6 +95,21 @@ impl Default for VideoGrants { } } +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SIPGrants { + // manage sip resources + pub admin: bool, + // make outbound calls + pub call: bool, +} + +impl Default for SIPGrants { + fn default() -> Self { + Self { admin: false, call: false } + } +} + #[derive(Debug, Clone, Serialize, Default, Deserialize)] #[serde(default)] #[serde(rename_all = "camelCase")] @@ -106,6 +121,7 @@ pub struct Claims { pub name: String, pub video: VideoGrants, + pub sip: SIPGrants, pub sha256: String, // Used to verify the integrity of the message body pub metadata: String, } @@ -140,6 +156,7 @@ impl AccessToken { sub: Default::default(), name: Default::default(), video: VideoGrants::default(), + sip: SIPGrants::default(), sha256: Default::default(), metadata: Default::default(), }, @@ -162,6 +179,11 @@ impl AccessToken { self } + pub fn with_sip_grants(mut self, grants: SIPGrants) -> Self { + self.claims.sip = grants; + self + } + pub fn with_identity(mut self, identity: &str) -> Self { self.claims.sub = identity.to_owned(); self diff --git a/livekit-api/src/services/egress.rs b/livekit-api/src/services/egress.rs index cfc66131..b28b3979 100644 --- a/livekit-api/src/services/egress.rs +++ b/livekit-api/src/services/egress.rs @@ -121,7 +121,8 @@ impl EgressClient { image_outputs, output: None, // Deprecated }, - self.base.auth_header(VideoGrants { room_record: true, ..Default::default() })?, + self.base + .auth_header(VideoGrants { room_record: true, ..Default::default() }, None)?, ) .await .map_err(Into::into) @@ -152,7 +153,8 @@ impl EgressClient { output: None, // Deprecated await_start_signal: options.await_start_signal, }, - self.base.auth_header(VideoGrants { room_record: true, ..Default::default() })?, + self.base + .auth_header(VideoGrants { room_record: true, ..Default::default() }, None)?, ) .await .map_err(Into::into) @@ -182,7 +184,8 @@ impl EgressClient { segment_outputs, image_outputs, }, - self.base.auth_header(VideoGrants { room_record: true, ..Default::default() })?, + self.base + .auth_header(VideoGrants { room_record: true, ..Default::default() }, None)?, ) .await .map_err(Into::into) @@ -212,7 +215,8 @@ impl EgressClient { image_outputs, output: None, // Deprecated }, - self.base.auth_header(VideoGrants { room_record: true, ..Default::default() })?, + self.base + .auth_header(VideoGrants { room_record: true, ..Default::default() }, None)?, ) .await .map_err(Into::into) @@ -240,7 +244,8 @@ impl EgressClient { }, track_id: track_id.to_string(), }, - self.base.auth_header(VideoGrants { room_record: true, ..Default::default() })?, + self.base + .auth_header(VideoGrants { room_record: true, ..Default::default() }, None)?, ) .await .map_err(Into::into) @@ -259,7 +264,8 @@ impl EgressClient { egress_id: egress_id.to_owned(), layout: layout.to_owned(), }, - self.base.auth_header(VideoGrants { room_record: true, ..Default::default() })?, + self.base + .auth_header(VideoGrants { room_record: true, ..Default::default() }, None)?, ) .await .map_err(Into::into) @@ -280,7 +286,8 @@ impl EgressClient { add_output_urls, remove_output_urls, }, - self.base.auth_header(VideoGrants { room_record: true, ..Default::default() })?, + self.base + .auth_header(VideoGrants { room_record: true, ..Default::default() }, None)?, ) .await .map_err(Into::into) @@ -305,7 +312,8 @@ impl EgressClient { SVC, "ListEgress", proto::ListEgressRequest { room_name, egress_id, active: options.active }, - self.base.auth_header(VideoGrants { room_record: true, ..Default::default() })?, + self.base + .auth_header(VideoGrants { room_record: true, ..Default::default() }, None)?, ) .await?; @@ -318,7 +326,8 @@ impl EgressClient { SVC, "StopEgress", proto::StopEgressRequest { egress_id: egress_id.to_owned() }, - self.base.auth_header(VideoGrants { room_record: true, ..Default::default() })?, + self.base + .auth_header(VideoGrants { room_record: true, ..Default::default() }, None)?, ) .await .map_err(Into::into) diff --git a/livekit-api/src/services/ingress.rs b/livekit-api/src/services/ingress.rs index 4cc91f97..e46463f8 100644 --- a/livekit-api/src/services/ingress.rs +++ b/livekit-api/src/services/ingress.rs @@ -27,6 +27,7 @@ pub struct CreateIngressOptions { pub audio: proto::IngressAudioOptions, pub video: proto::IngressVideoOptions, pub bypass_transcoding: bool, + pub enable_transcoding: Option, pub url: String, } @@ -40,6 +41,7 @@ pub struct UpdateIngressOptions { pub audio: proto::IngressAudioOptions, pub video: proto::IngressVideoOptions, pub bypass_transcoding: Option, + pub enable_transcoding: Option, } #[derive(Debug, Clone, PartialEq, Eq)] @@ -89,9 +91,11 @@ impl IngressClient { audio: Some(options.audio), video: Some(options.video), bypass_transcoding: options.bypass_transcoding, + enable_transcoding: options.enable_transcoding, url: options.url, }, - self.base.auth_header(VideoGrants { ingress_admin: true, ..Default::default() })?, + self.base + .auth_header(VideoGrants { ingress_admin: true, ..Default::default() }, None)?, ) .await .map_err(Into::into) @@ -116,8 +120,10 @@ impl IngressClient { audio: Some(options.audio), video: Some(options.video), bypass_transcoding: options.bypass_transcoding, + enable_transcoding: options.enable_transcoding, }, - self.base.auth_header(VideoGrants { ingress_admin: true, ..Default::default() })?, + self.base + .auth_header(VideoGrants { ingress_admin: true, ..Default::default() }, None)?, ) .await .map_err(Into::into) @@ -142,7 +148,8 @@ impl IngressClient { _ => Default::default(), }, }, - self.base.auth_header(VideoGrants { ingress_admin: true, ..Default::default() })?, + self.base + .auth_header(VideoGrants { ingress_admin: true, ..Default::default() }, None)?, ) .await?; @@ -155,7 +162,8 @@ impl IngressClient { SVC, "DeleteIngress", proto::DeleteIngressRequest { ingress_id: ingress_id.to_owned() }, - self.base.auth_header(VideoGrants { ingress_admin: true, ..Default::default() })?, + self.base + .auth_header(VideoGrants { ingress_admin: true, ..Default::default() }, None)?, ) .await .map_err(Into::into) diff --git a/livekit-api/src/services/mod.rs b/livekit-api/src/services/mod.rs index a84f7d95..d983c39b 100644 --- a/livekit-api/src/services/mod.rs +++ b/livekit-api/src/services/mod.rs @@ -17,7 +17,7 @@ use std::fmt::Debug; use http::header::{HeaderMap, HeaderValue, AUTHORIZATION}; use thiserror::Error; -use crate::access_token::{AccessToken, AccessTokenError, VideoGrants}; +use crate::access_token::{AccessToken, AccessTokenError, SIPGrants, VideoGrants}; pub mod egress; pub mod ingress; @@ -56,10 +56,17 @@ impl ServiceBase { Self { api_key: api_key.to_owned(), api_secret: api_secret.to_owned() } } - pub fn auth_header(&self, grants: VideoGrants) -> Result { - let token = AccessToken::with_api_key(&self.api_key, &self.api_secret) - .with_grants(grants) - .to_jwt()?; + pub fn auth_header( + &self, + grants: VideoGrants, + sip: Option, + ) -> Result { + let mut tok = + AccessToken::with_api_key(&self.api_key, &self.api_secret).with_grants(grants); + if sip.is_some() { + tok = tok.with_sip_grants(sip.unwrap()) + } + let token = tok.to_jwt()?; let mut headers = HeaderMap::new(); headers.insert(AUTHORIZATION, HeaderValue::from_str(&format!("Bearer {}", token)).unwrap()); diff --git a/livekit-api/src/services/room.rs b/livekit-api/src/services/room.rs index 26605393..0bdae45b 100644 --- a/livekit-api/src/services/room.rs +++ b/livekit-api/src/services/room.rs @@ -13,6 +13,7 @@ // limitations under the License. use livekit_protocol as proto; +use std::collections::HashMap; use super::{ServiceBase, ServiceResult, LIVEKIT_PACKAGE}; use crate::{access_token::VideoGrants, get_env_keys, services::twirp_client::TwirpClient}; @@ -31,6 +32,7 @@ pub struct CreateRoomOptions { #[derive(Debug, Clone, Default)] pub struct UpdateParticipantOptions { pub metadata: String, + pub attributes: HashMap, pub permission: Option, pub name: String, // No effect if left empty } @@ -81,7 +83,8 @@ impl RoomClient { egress: options.egress, ..Default::default() }, - self.base.auth_header(VideoGrants { room_create: true, ..Default::default() })?, + self.base + .auth_header(VideoGrants { room_create: true, ..Default::default() }, None)?, ) .await .map_err(Into::into) @@ -94,7 +97,8 @@ impl RoomClient { SVC, "ListRooms", proto::ListRoomsRequest { names }, - self.base.auth_header(VideoGrants { room_list: true, ..Default::default() })?, + self.base + .auth_header(VideoGrants { room_list: true, ..Default::default() }, None)?, ) .await?; @@ -107,7 +111,8 @@ impl RoomClient { SVC, "DeleteRoom", proto::DeleteRoomRequest { room: room.to_owned() }, - self.base.auth_header(VideoGrants { room_create: true, ..Default::default() })?, + self.base + .auth_header(VideoGrants { room_create: true, ..Default::default() }, None)?, ) .await .map_err(Into::into) @@ -126,11 +131,10 @@ impl RoomClient { room: room.to_owned(), metadata: metadata.to_owned(), }, - self.base.auth_header(VideoGrants { - room_admin: true, - room: room.to_owned(), - ..Default::default() - })?, + self.base.auth_header( + VideoGrants { room_admin: true, room: room.to_owned(), ..Default::default() }, + None, + )?, ) .await .map_err(Into::into) @@ -146,11 +150,10 @@ impl RoomClient { SVC, "ListParticipants", proto::ListParticipantsRequest { room: room.to_owned() }, - self.base.auth_header(VideoGrants { - room_admin: true, - room: room.to_owned(), - ..Default::default() - })?, + self.base.auth_header( + VideoGrants { room_admin: true, room: room.to_owned(), ..Default::default() }, + None, + )?, ) .await?; @@ -170,11 +173,10 @@ impl RoomClient { room: room.to_owned(), identity: identity.to_owned(), }, - self.base.auth_header(VideoGrants { - room_admin: true, - room: room.to_owned(), - ..Default::default() - })?, + self.base.auth_header( + VideoGrants { room_admin: true, room: room.to_owned(), ..Default::default() }, + None, + )?, ) .await .map_err(Into::into) @@ -189,11 +191,10 @@ impl RoomClient { room: room.to_owned(), identity: identity.to_owned(), }, - self.base.auth_header(VideoGrants { - room_admin: true, - room: room.to_owned(), - ..Default::default() - })?, + self.base.auth_header( + VideoGrants { room_admin: true, room: room.to_owned(), ..Default::default() }, + None, + )?, ) .await .map_err(Into::into) @@ -217,11 +218,10 @@ impl RoomClient { track_sid: track_sid.to_owned(), muted, }, - self.base.auth_header(VideoGrants { - room_admin: true, - room: room.to_owned(), - ..Default::default() - })?, + self.base.auth_header( + VideoGrants { room_admin: true, room: room.to_owned(), ..Default::default() }, + None, + )?, ) .await?; @@ -243,13 +243,13 @@ impl RoomClient { identity: identity.to_owned(), permission: options.permission, metadata: options.metadata, + attributes: options.attributes.to_owned(), name: options.name, }, - self.base.auth_header(VideoGrants { - room_admin: true, - room: room.to_owned(), - ..Default::default() - })?, + self.base.auth_header( + VideoGrants { room_admin: true, room: room.to_owned(), ..Default::default() }, + None, + )?, ) .await .map_err(Into::into) @@ -273,11 +273,10 @@ impl RoomClient { subscribe, ..Default::default() }, - self.base.auth_header(VideoGrants { - room_admin: true, - room: room.to_owned(), - ..Default::default() - })?, + self.base.auth_header( + VideoGrants { room_admin: true, room: room.to_owned(), ..Default::default() }, + None, + )?, ) .await .map_err(Into::into) @@ -302,11 +301,10 @@ impl RoomClient { kind: options.kind as i32, destination_identities: options.destination_identities, }, - self.base.auth_header(VideoGrants { - room_admin: true, - room: room.to_owned(), - ..Default::default() - })?, + self.base.auth_header( + VideoGrants { room_admin: true, room: room.to_owned(), ..Default::default() }, + None, + )?, ) .await .map_err(Into::into) diff --git a/livekit-api/src/services/sip.rs b/livekit-api/src/services/sip.rs index d722b03e..55ddf30a 100644 --- a/livekit-api/src/services/sip.rs +++ b/livekit-api/src/services/sip.rs @@ -13,11 +13,11 @@ // limitations under the License. use livekit_protocol as proto; +use std::collections::HashMap; use std::ptr::null; -use crate::access_token::VideoGrants; +use crate::access_token::{SIPGrants, VideoGrants}; use crate::get_env_keys; -use crate::services::ingress::{CreateIngressOptions, IngressListFilter}; use crate::services::twirp_client::TwirpClient; use crate::services::{ServiceBase, ServiceResult, LIVEKIT_PACKAGE}; @@ -29,8 +29,13 @@ pub struct SIPClient { client: TwirpClient, } +#[deprecated] #[derive(Default, Clone, Debug)] pub struct CreateSIPTrunkOptions { + /// Human-readable name for the Trunk. + pub name: String, + /// Optional free-form metadata. + pub metadata: String, /// CIDR or IPs that traffic is accepted from /// An empty list means all inbound traffic is accepted. pub inbound_addresses: Vec, @@ -51,16 +56,57 @@ pub struct CreateSIPTrunkOptions { pub outbound_password: String, } +#[derive(Default, Clone, Debug)] +pub struct CreateSIPInboundTrunkOptions { + /// Optional free-form metadata. + pub metadata: String, + /// CIDR or IPs that traffic is accepted from + /// An empty list means all inbound traffic is accepted. + pub allowed_addresses: Vec, + /// Accepted `To` values. This Trunk will only accept a call made to + /// these numbers. This allows you to have distinct Trunks for different phone + /// numbers at the same provider. + pub allowed_numbers: Vec, + /// Username and password used to authenticate inbound SIP invites + /// May be empty to have no Authentication + pub auth_username: String, + pub auth_password: String, +} + +#[derive(Default, Clone, Debug)] +pub struct CreateSIPOutboundTrunkOptions { + pub transport: proto::SipTransport, + /// Optional free-form metadata. + pub metadata: String, + /// Username and password used to authenticate outbound SIP invites + /// May be empty to have no Authentication + pub auth_username: String, + pub auth_password: String, +} + +#[deprecated] #[derive(Debug, Clone, PartialEq, Eq)] pub enum ListSIPTrunkFilter { All, } +#[derive(Debug, Clone, PartialEq, Eq)] +pub enum ListSIPInboundTrunkFilter { + All, +} +#[derive(Debug, Clone, PartialEq, Eq)] +pub enum ListSIPOutboundTrunkFilter { + All, +} #[derive(Default, Clone, Debug)] pub struct CreateSIPDispatchRuleOptions { + pub name: String, + pub metadata: String, + pub attributes: HashMap, /// What trunks are accepted for this dispatch rule /// If empty all trunks will match this dispatch rule pub trunk_ids: Vec, + pub allowed_numbers: Vec, pub hide_phone_number: bool, } @@ -73,13 +119,17 @@ pub enum ListSIPDispatchRuleFilter { pub struct CreateSIPParticipantOptions { /// Optional identity of the participant in LiveKit room pub participant_identity: String, - // Optionally set the name of the participant in a LiveKit room + /// Optionally set the name of the participant in a LiveKit room pub participant_name: String, + /// Optionally set the free-form metadata of the participant in a LiveKit room + pub participant_metadata: String, + pub participant_attributes: HashMap, /// Optionally send following DTMF digits (extension codes) when making a call. /// Character 'w' can be used to add a 0.5 sec delay. pub dtmf: String, /// Optionally play ringtone in the room as an audible indicator for existing participants pub play_ringtone: bool, + pub hide_phone_number: bool, } impl SIPClient { @@ -95,6 +145,7 @@ impl SIPClient { Ok(Self::with_api_key(host, &api_key, &api_secret)) } + #[deprecated] pub async fn create_sip_trunk( &self, number: String, @@ -105,6 +156,9 @@ impl SIPClient { SVC, "CreateSIPTrunk", proto::CreateSipTrunkRequest { + name: options.name, + metadata: options.metadata, + outbound_number: number.to_owned(), outbound_address: options.outbound_address.to_owned(), outbound_username: options.outbound_username.to_owned(), @@ -116,12 +170,81 @@ impl SIPClient { inbound_username: options.inbound_username.to_owned(), inbound_password: options.inbound_password.to_owned(), }, - self.base.auth_header(VideoGrants { ..Default::default() })?, + self.base.auth_header( + Default::default(), + Some(SIPGrants { admin: true, ..Default::default() }), + )?, + ) + .await + .map_err(Into::into) + } + + pub async fn create_sip_inbound_trunk( + &self, + name: String, + numbers: Vec, + options: CreateSIPInboundTrunkOptions, + ) -> ServiceResult { + self.client + .request( + SVC, + "CreateSIPInboundTrunk", + proto::CreateSipInboundTrunkRequest { + trunk: Some(proto::SipInboundTrunkInfo { + sip_trunk_id: Default::default(), + name, + numbers, + metadata: options.metadata, + + allowed_numbers: options.allowed_numbers.to_owned(), + allowed_addresses: options.allowed_addresses.to_owned(), + auth_username: options.auth_username.to_owned(), + auth_password: options.auth_password.to_owned(), + }), + }, + self.base.auth_header( + Default::default(), + Some(SIPGrants { admin: true, ..Default::default() }), + )?, ) .await .map_err(Into::into) } + pub async fn create_sip_outbound_trunk( + &self, + name: String, + address: String, + numbers: Vec, + options: CreateSIPOutboundTrunkOptions, + ) -> ServiceResult { + self.client + .request( + SVC, + "CreateSIPOutboundTrunk", + proto::CreateSipOutboundTrunkRequest { + trunk: Some(proto::SipOutboundTrunkInfo { + sip_trunk_id: Default::default(), + name, + address, + numbers, + transport: options.transport as i32, + metadata: options.metadata, + + auth_username: options.auth_username.to_owned(), + auth_password: options.auth_password.to_owned(), + }), + }, + self.base.auth_header( + Default::default(), + Some(SIPGrants { admin: true, ..Default::default() }), + )?, + ) + .await + .map_err(Into::into) + } + + #[deprecated] pub async fn list_sip_trunk( &self, filter: ListSIPTrunkFilter, @@ -132,7 +255,50 @@ impl SIPClient { SVC, "ListSIPTrunk", proto::ListSipTrunkRequest {}, - self.base.auth_header(VideoGrants { ..Default::default() })?, + self.base.auth_header( + Default::default(), + Some(SIPGrants { admin: true, ..Default::default() }), + )?, + ) + .await?; + + Ok(resp.items) + } + + pub async fn list_sip_inbound_trunk( + &self, + filter: ListSIPInboundTrunkFilter, + ) -> ServiceResult> { + let resp: proto::ListSipInboundTrunkResponse = self + .client + .request( + SVC, + "ListSIPInboundTrunk", + proto::ListSipInboundTrunkRequest {}, + self.base.auth_header( + Default::default(), + Some(SIPGrants { admin: true, ..Default::default() }), + )?, + ) + .await?; + + Ok(resp.items) + } + + pub async fn list_sip_outbound_trunk( + &self, + filter: ListSIPOutboundTrunkFilter, + ) -> ServiceResult> { + let resp: proto::ListSipOutboundTrunkResponse = self + .client + .request( + SVC, + "ListSIPOutboundTrunk", + proto::ListSipOutboundTrunkRequest {}, + self.base.auth_header( + Default::default(), + Some(SIPGrants { admin: true, ..Default::default() }), + )?, ) .await?; @@ -145,7 +311,10 @@ impl SIPClient { SVC, "DeleteSIPTrunk", proto::DeleteSipTrunkRequest { sip_trunk_id: sip_trunk_id.to_owned() }, - self.base.auth_header(VideoGrants { ..Default::default() })?, + self.base.auth_header( + Default::default(), + Some(SIPGrants { admin: true, ..Default::default() }), + )?, ) .await .map_err(Into::into) @@ -161,11 +330,18 @@ impl SIPClient { SVC, "CreateSIPDispatchRule", proto::CreateSipDispatchRuleRequest { + name: options.name, + metadata: options.metadata, + attributes: options.attributes, trunk_ids: options.trunk_ids.to_owned(), + inbound_numbers: options.allowed_numbers.to_owned(), hide_phone_number: options.hide_phone_number, rule: Some(proto::SipDispatchRule { rule: Some(rule.to_owned()) }), }, - self.base.auth_header(VideoGrants { ..Default::default() })?, + self.base.auth_header( + Default::default(), + Some(SIPGrants { admin: true, ..Default::default() }), + )?, ) .await .map_err(Into::into) @@ -181,7 +357,10 @@ impl SIPClient { SVC, "ListSIPDispatchRule", proto::ListSipDispatchRuleRequest {}, - self.base.auth_header(VideoGrants { ..Default::default() })?, + self.base.auth_header( + Default::default(), + Some(SIPGrants { admin: true, ..Default::default() }), + )?, ) .await?; @@ -199,7 +378,10 @@ impl SIPClient { proto::DeleteSipDispatchRuleRequest { sip_dispatch_rule_id: sip_dispatch_rule_id.to_owned(), }, - self.base.auth_header(VideoGrants { ..Default::default() })?, + self.base.auth_header( + Default::default(), + Some(SIPGrants { admin: true, ..Default::default() }), + )?, ) .await .map_err(Into::into) @@ -222,10 +404,16 @@ impl SIPClient { room_name: room_name.to_owned(), participant_identity: options.participant_identity.to_owned(), participant_name: options.participant_name.to_owned(), + participant_metadata: options.participant_metadata.to_owned(), + participant_attributes: options.participant_attributes.to_owned(), dtmf: options.dtmf.to_owned(), play_ringtone: options.play_ringtone, + hide_phone_number: options.hide_phone_number, }, - self.base.auth_header(VideoGrants { ..Default::default() })?, + self.base.auth_header( + Default::default(), + Some(SIPGrants { call: true, ..Default::default() }), + )?, ) .await .map_err(Into::into) diff --git a/livekit-ffi/protocol/room.proto b/livekit-ffi/protocol/room.proto index 1e9efc9e..8d58952e 100644 --- a/livekit-ffi/protocol/room.proto +++ b/livekit-ffi/protocol/room.proto @@ -107,7 +107,6 @@ message PublishTranscriptionRequest { string participant_identity = 2; string track_id = 3; repeated TranscriptionSegment segments = 4; - string language = 5; } message PublishTranscriptionResponse { uint64 async_id = 1; @@ -245,6 +244,7 @@ message TranscriptionSegment { uint64 start_time = 3; uint64 end_time = 4; bool final = 5; + string language = 6; } message BufferInfo { diff --git a/livekit-ffi/src/livekit.proto.rs b/livekit-ffi/src/livekit.proto.rs index 4501028d..c26ffb8e 100644 --- a/livekit-ffi/src/livekit.proto.rs +++ b/livekit-ffi/src/livekit.proto.rs @@ -2054,8 +2054,6 @@ pub struct PublishTranscriptionRequest { pub track_id: ::prost::alloc::string::String, #[prost(message, repeated, tag="4")] pub segments: ::prost::alloc::vec::Vec, - #[prost(string, tag="5")] - pub language: ::prost::alloc::string::String, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -2238,6 +2236,8 @@ pub struct TranscriptionSegment { pub end_time: u64, #[prost(bool, tag="5")] pub r#final: bool, + #[prost(string, tag="6")] + pub language: ::prost::alloc::string::String, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/livekit-ffi/src/server/room.rs b/livekit-ffi/src/server/room.rs index 7e99c401..0fd1fc26 100644 --- a/livekit-ffi/src/server/room.rs +++ b/livekit-ffi/src/server/room.rs @@ -86,7 +86,6 @@ struct FfiTranscription { participant_identity: String, segments: Vec, track_id: String, - language: String, async_id: u64, } @@ -96,6 +95,7 @@ struct FfiTranscriptionSegment { start_time: u64, end_time: u64, r#final: bool, + language: String, } impl FfiRoom { @@ -301,10 +301,10 @@ impl RoomInner { start_time: segment.start_time, end_time: segment.end_time, r#final: segment.r#final, + language: segment.language, }) .collect(), track_id: publish.track_id, - language: publish.language, async_id, }) { let handle = server.async_runtime.spawn(async move { @@ -506,6 +506,7 @@ async fn transcription_task( let segments = event.segments.into_iter().map(|segment| TranscriptionSegment { id: segment.id, text: segment.text, + language: segment.language, start_time: segment.start_time, end_time: segment.end_time, r#final: segment.r#final, @@ -515,7 +516,6 @@ async fn transcription_task( participant_identity: event.participant_identity, segments, track_id: event.track_id, - language: event.language, }; let res = inner.room.local_participant().publish_transcription(transcription).await; diff --git a/livekit-protocol/protocol b/livekit-protocol/protocol index bad3fc96..288772c5 160000 --- a/livekit-protocol/protocol +++ b/livekit-protocol/protocol @@ -1 +1 @@ -Subproject commit bad3fc9684c3fccb68b12d7ef3cbeeadf0cf5df9 +Subproject commit 288772c53cfb172f25304f811fff87326f4b0cd3 diff --git a/livekit-protocol/src/livekit.rs b/livekit-protocol/src/livekit.rs index 60a06b3b..c1a0fd65 100644 --- a/livekit-protocol/src/livekit.rs +++ b/livekit-protocol/src/livekit.rs @@ -67,12 +67,16 @@ pub struct ParticipantPermission { #[prost(bool, tag="7")] pub hidden: bool, /// indicates it's a recorder instance + /// deprecated: use ParticipantInfo.kind instead + #[deprecated] #[prost(bool, tag="8")] pub recorder: bool, - /// indicates that participant can update own metadata + /// indicates that participant can update own metadata and attributes #[prost(bool, tag="10")] pub can_update_metadata: bool, /// indicates that participant is an agent + /// deprecated: use ParticipantInfo.kind instead + #[deprecated] #[prost(bool, tag="11")] pub agent: bool, } @@ -106,6 +110,8 @@ pub struct ParticipantInfo { pub is_publisher: bool, #[prost(enumeration="participant_info::Kind", tag="14")] pub kind: i32, + #[prost(map="string, string", tag="15")] + pub attributes: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, } /// Nested message and enum types in `ParticipantInfo`. pub mod participant_info { @@ -281,6 +287,8 @@ pub struct TrackInfo { pub stream: ::prost::alloc::string::String, #[prost(message, optional, tag="18")] pub version: ::core::option::Option, + #[prost(enumeration="AudioTrackFeature", repeated, tag="19")] + pub audio_features: ::prost::alloc::vec::Vec, } /// provide information about available spatial layers #[allow(clippy::derive_partial_eq_without_eq)] @@ -418,14 +426,13 @@ pub struct SipDtmf { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Transcription { + /// Participant that got its speech transcribed #[prost(string, tag="2")] - pub participant_identity: ::prost::alloc::string::String, + pub transcribed_participant_identity: ::prost::alloc::string::String, #[prost(string, tag="3")] pub track_id: ::prost::alloc::string::String, #[prost(message, repeated, tag="4")] pub segments: ::prost::alloc::vec::Vec, - #[prost(string, tag="5")] - pub language: ::prost::alloc::string::String, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -440,6 +447,8 @@ pub struct TranscriptionSegment { pub end_time: u64, #[prost(bool, tag="5")] pub r#final: bool, + #[prost(string, tag="6")] + pub language: ::prost::alloc::string::String, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1506,6 +1515,8 @@ pub struct S3Upload { pub access_key: ::prost::alloc::string::String, #[prost(string, tag="2")] pub secret: ::prost::alloc::string::String, + #[prost(string, tag="11")] + pub session_token: ::prost::alloc::string::String, #[prost(string, tag="3")] pub region: ::prost::alloc::string::String, #[prost(string, tag="4")] @@ -1683,6 +1694,8 @@ pub struct EgressInfo { pub details: ::prost::alloc::string::String, #[prost(string, tag="9")] pub error: ::prost::alloc::string::String, + #[prost(int32, tag="22")] + pub error_code: i32, #[prost(message, repeated, tag="15")] pub stream_results: ::prost::alloc::vec::Vec, #[prost(message, repeated, tag="16")] @@ -1859,7 +1872,7 @@ pub struct AutoTrackEgress { /// disables upload of json manifest file (default false) #[prost(bool, tag="5")] pub disable_manifest: bool, - #[prost(oneof="auto_track_egress::Output", tags="2, 3, 4")] + #[prost(oneof="auto_track_egress::Output", tags="2, 3, 4, 6")] pub output: ::core::option::Option, } /// Nested message and enum types in `AutoTrackEgress`. @@ -1873,6 +1886,8 @@ pub mod auto_track_egress { Gcp(super::GcpUpload), #[prost(message, tag="4")] Azure(super::AzureBlobUpload), + #[prost(message, tag="6")] + AliOss(super::AliOssUpload), } } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] @@ -2153,7 +2168,8 @@ pub mod signal_request { /// deprecated by ping_req (message Ping) #[prost(int64, tag="14")] Ping(i64), - /// update a participant's own metadata and/or name + /// update a participant's own metadata, name, or attributes + /// requires canUpdateOwnParticipantMetadata permission #[prost(message, tag="15")] UpdateMetadata(super::UpdateParticipantMetadata), #[prost(message, tag="16")] @@ -2505,6 +2521,10 @@ pub struct UpdateParticipantMetadata { pub metadata: ::prost::alloc::string::String, #[prost(string, tag="2")] pub name: ::prost::alloc::string::String, + /// attributes to update. it only updates attributes that have been set + /// 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>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -2648,7 +2668,7 @@ pub struct DataChannelInfo { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SimulateScenario { - #[prost(oneof="simulate_scenario::Scenario", tags="1, 2, 3, 4, 5, 6, 7, 8")] + #[prost(oneof="simulate_scenario::Scenario", tags="1, 2, 3, 4, 5, 6, 7, 8, 9")] pub scenario: ::core::option::Option, } /// Nested message and enum types in `SimulateScenario`. @@ -2681,6 +2701,9 @@ pub mod simulate_scenario { /// disconnect signal on resume before sending any messages from server #[prost(bool, tag="8")] DisconnectSignalOnResumeNoMessages(bool), + /// full reconnect leave request + #[prost(bool, tag="9")] + LeaveRequestFullReconnect(bool), } } #[allow(clippy::derive_partial_eq_without_eq)] @@ -2938,6 +2961,10 @@ pub struct UpdateParticipantRequest { /// display name to update #[prost(string, tag="5")] pub name: ::prost::alloc::string::String, + /// attributes to update. it only updates attributes that have been set + /// to delete attributes, set the value to an empty string + #[prost(map="string, string", tag="6")] + pub attributes: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -3017,9 +3044,13 @@ pub struct CreateIngressRequest { /// metadata associated with the publishing participant #[prost(string, tag="10")] pub participant_metadata: ::prost::alloc::string::String, - /// whether to pass through the incoming media without transcoding, only compatible with some input types + /// \[depreacted \] whether to pass through the incoming media without transcoding, only compatible with some input types. Use `enable_transcoding` instead. + #[deprecated] #[prost(bool, tag="8")] pub bypass_transcoding: bool, + /// Whether to transcode the ingested media. Only WHIP supports disabling transcoding currently. WHIP will default to transcoding disabled. Replaces `bypass_transcoding. + #[prost(bool, optional, tag="11")] + pub enable_transcoding: ::core::option::Option, #[prost(message, optional, tag="6")] pub audio: ::core::option::Option, #[prost(message, optional, tag="7")] @@ -3109,8 +3140,11 @@ pub struct IngressInfo { /// for SRT input, it'll be a srt:// URL #[prost(enumeration="IngressInput", tag="5")] pub input_type: i32, + #[deprecated] #[prost(bool, tag="13")] pub bypass_transcoding: bool, + #[prost(bool, optional, tag="15")] + pub enable_transcoding: ::core::option::Option, #[prost(message, optional, tag="6")] pub audio: ::core::option::Option, #[prost(message, optional, tag="7")] @@ -3234,8 +3268,11 @@ pub struct UpdateIngressRequest { pub participant_name: ::prost::alloc::string::String, #[prost(string, tag="9")] pub participant_metadata: ::prost::alloc::string::String, + #[deprecated] #[prost(bool, optional, tag="8")] pub bypass_transcoding: ::core::option::Option, + #[prost(bool, optional, tag="10")] + pub enable_transcoding: ::core::option::Option, #[prost(message, optional, tag="6")] pub audio: ::core::option::Option, #[prost(message, optional, tag="7")] @@ -3445,12 +3482,20 @@ pub struct CreateSipTrunkRequest { pub outbound_username: ::prost::alloc::string::String, #[prost(string, tag="8")] pub outbound_password: ::prost::alloc::string::String, + /// Optional human-readable name for the Trunk. + #[prost(string, tag="10")] + pub name: ::prost::alloc::string::String, + /// Optional user-defined metadata for the Trunk. + #[prost(string, tag="11")] + pub metadata: ::prost::alloc::string::String, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SipTrunkInfo { #[prost(string, tag="1")] pub sip_trunk_id: ::prost::alloc::string::String, + #[prost(enumeration="sip_trunk_info::TrunkKind", tag="14")] + pub kind: i32, /// CIDR or IPs that traffic is accepted from /// An empty list means all inbound traffic is accepted. #[prost(string, repeated, tag="2")] @@ -3461,6 +3506,9 @@ pub struct SipTrunkInfo { /// Number used to make outbound calls #[prost(string, tag="4")] pub outbound_number: ::prost::alloc::string::String, + /// Transport used for inbound and outbound calls. + #[prost(enumeration="SipTransport", tag="13")] + pub transport: i32, #[deprecated] #[prost(string, repeated, tag="5")] pub inbound_numbers_regex: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, @@ -3479,6 +3527,116 @@ pub struct SipTrunkInfo { pub outbound_username: ::prost::alloc::string::String, #[prost(string, tag="9")] pub outbound_password: ::prost::alloc::string::String, + /// Human-readable name for the Trunk. + #[prost(string, tag="11")] + pub name: ::prost::alloc::string::String, + /// User-defined metadata for the Trunk. + #[prost(string, tag="12")] + pub metadata: ::prost::alloc::string::String, +} +/// Nested message and enum types in `SIPTrunkInfo`. +pub mod sip_trunk_info { + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + pub enum TrunkKind { + TrunkLegacy = 0, + TrunkInbound = 1, + TrunkOutbound = 2, + } + impl TrunkKind { + /// 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 { + TrunkKind::TrunkLegacy => "TRUNK_LEGACY", + TrunkKind::TrunkInbound => "TRUNK_INBOUND", + TrunkKind::TrunkOutbound => "TRUNK_OUTBOUND", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "TRUNK_LEGACY" => Some(Self::TrunkLegacy), + "TRUNK_INBOUND" => Some(Self::TrunkInbound), + "TRUNK_OUTBOUND" => Some(Self::TrunkOutbound), + _ => None, + } + } + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateSipInboundTrunkRequest { + /// Trunk ID is ignored + #[prost(message, optional, tag="1")] + pub trunk: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SipInboundTrunkInfo { + #[prost(string, tag="1")] + pub sip_trunk_id: ::prost::alloc::string::String, + /// Human-readable name for the Trunk. + #[prost(string, tag="2")] + pub name: ::prost::alloc::string::String, + /// User-defined metadata for the Trunk. + #[prost(string, tag="3")] + pub metadata: ::prost::alloc::string::String, + /// Numbers associated with LiveKit SIP. The Trunk will only accept calls made to these numbers. + /// Creating multiple Trunks with different phone numbers allows having different rules for a single provider. + #[prost(string, repeated, tag="4")] + pub numbers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// CIDR or IPs that traffic is accepted from. + /// An empty list means all inbound traffic is accepted. + #[prost(string, repeated, tag="5")] + pub allowed_addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// Numbers that are allowed to make calls to this Trunk. + /// An empty list means calls from any phone number is accepted. + #[prost(string, repeated, tag="6")] + pub allowed_numbers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// Username and password used to authenticate inbound SIP invites. + /// May be empty to have no authentication. + #[prost(string, tag="7")] + pub auth_username: ::prost::alloc::string::String, + #[prost(string, tag="8")] + pub auth_password: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateSipOutboundTrunkRequest { + /// Trunk ID is ignored + #[prost(message, optional, tag="1")] + pub trunk: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SipOutboundTrunkInfo { + #[prost(string, tag="1")] + pub sip_trunk_id: ::prost::alloc::string::String, + /// Human-readable name for the Trunk. + #[prost(string, tag="2")] + pub name: ::prost::alloc::string::String, + /// User-defined metadata for the Trunk. + #[prost(string, tag="3")] + pub metadata: ::prost::alloc::string::String, + /// Hostname or IP that SIP INVITE is sent too. + /// Note that this is not a SIP URI and should not contain the 'sip:' protocol prefix. + #[prost(string, tag="4")] + pub address: ::prost::alloc::string::String, + /// SIP Transport used for outbound call. + #[prost(enumeration="SipTransport", tag="5")] + pub transport: i32, + /// Numbers used to make the calls. Random one from this list will be selected. + #[prost(string, repeated, tag="6")] + pub numbers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// Username and password used to authenticate with SIP server. + /// May be empty to have no authentication. + #[prost(string, tag="7")] + pub auth_username: ::prost::alloc::string::String, + #[prost(string, tag="8")] + pub auth_password: ::prost::alloc::string::String, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -3492,6 +3650,26 @@ pub struct ListSipTrunkResponse { } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListSipInboundTrunkRequest { +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListSipInboundTrunkResponse { + #[prost(message, repeated, tag="1")] + pub items: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListSipOutboundTrunkRequest { +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListSipOutboundTrunkResponse { + #[prost(message, repeated, tag="1")] + pub items: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct DeleteSipTrunkRequest { #[prost(string, tag="1")] pub sip_trunk_id: ::prost::alloc::string::String, @@ -3546,10 +3724,24 @@ pub struct CreateSipDispatchRuleRequest { /// If empty all trunks will match this dispatch rule #[prost(string, repeated, tag="2")] pub trunk_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// By default the From value (Phone number) is used as the participant identity - /// If true a random value will be used instead + /// By default the From value (Phone number) is used for participant name/identity and added to attributes. + /// If true, a random value for identity will be used and numbers will be omitted from attributes. #[prost(bool, tag="3")] pub hide_phone_number: bool, + /// Dispatch Rule will only accept a call made to these numbers (if set). + #[prost(string, repeated, tag="6")] + pub inbound_numbers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// Optional human-readable name for the Dispatch Rule. + #[prost(string, tag="4")] + pub name: ::prost::alloc::string::String, + /// User-defined metadata for the Dispatch Rule. + /// Participants created by this rule will inherit this metadata. + #[prost(string, tag="5")] + pub metadata: ::prost::alloc::string::String, + /// User-defined attributes for the Dispatch Rule. + /// Participants created by this rule will inherit these attributes. + #[prost(map="string, string", tag="7")] + pub attributes: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -3562,6 +3754,20 @@ pub struct SipDispatchRuleInfo { pub trunk_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, #[prost(bool, tag="4")] pub hide_phone_number: bool, + /// Dispatch Rule will only accept a call made to these numbers (if set). + #[prost(string, repeated, tag="7")] + pub inbound_numbers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// Human-readable name for the Dispatch Rule. + #[prost(string, tag="5")] + pub name: ::prost::alloc::string::String, + /// User-defined metadata for the Dispatch Rule. + /// Participants created by this rule will inherit this metadata. + #[prost(string, tag="6")] + pub metadata: ::prost::alloc::string::String, + /// User-defined attributes for the Dispatch Rule. + /// Participants created by this rule will inherit these attributes. + #[prost(map="string, string", tag="8")] + pub attributes: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -3599,6 +3805,12 @@ pub struct CreateSipParticipantRequest { /// Optional name of the participant in LiveKit room #[prost(string, tag="7")] pub participant_name: ::prost::alloc::string::String, + /// Optional user-defined metadata. Will be attached to a created Participant in the room. + #[prost(string, tag="8")] + pub participant_metadata: ::prost::alloc::string::String, + /// Optional user-defined attributes. Will be attached to a created Participant in the room. + #[prost(map="string, string", tag="9")] + pub participant_attributes: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, /// Optionally send following DTMF digits (extension codes) when making a call. /// Character 'w' can be used to add a 0.5 sec delay. #[prost(string, tag="5")] @@ -3606,6 +3818,10 @@ pub struct CreateSipParticipantRequest { /// Optionally play ringtone in the room as an audible indicator for existing participants #[prost(bool, tag="6")] pub play_ringtone: bool, + /// By default the From value (Phone number) is used for participant name/identity (if not set) and added to attributes. + /// If true, a random value for identity will be used and numbers will be omitted from attributes. + #[prost(bool, tag="10")] + pub hide_phone_number: bool, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -3616,6 +3832,40 @@ pub struct SipParticipantInfo { pub participant_identity: ::prost::alloc::string::String, #[prost(string, tag="3")] pub room_name: ::prost::alloc::string::String, + #[prost(string, tag="4")] + pub sip_call_id: ::prost::alloc::string::String, +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum SipTransport { + Auto = 0, + Udp = 1, + Tcp = 2, + Tls = 3, +} +impl SipTransport { + /// 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 { + SipTransport::Auto => "SIP_TRANSPORT_AUTO", + SipTransport::Udp => "SIP_TRANSPORT_UDP", + SipTransport::Tcp => "SIP_TRANSPORT_TCP", + SipTransport::Tls => "SIP_TRANSPORT_TLS", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "SIP_TRANSPORT_AUTO" => Some(Self::Auto), + "SIP_TRANSPORT_UDP" => Some(Self::Udp), + "SIP_TRANSPORT_TCP" => Some(Self::Tcp), + "SIP_TRANSPORT_TLS" => Some(Self::Tls), + _ => None, + } + } } include!("livekit.serde.rs"); // @@protoc_insertion_point(module) diff --git a/livekit-protocol/src/livekit.serde.rs b/livekit-protocol/src/livekit.serde.rs index 00efe0ab..9d261034 100644 --- a/livekit-protocol/src/livekit.serde.rs +++ b/livekit-protocol/src/livekit.serde.rs @@ -946,6 +946,9 @@ impl serde::Serialize for AutoTrackEgress { auto_track_egress::Output::Azure(v) => { struct_ser.serialize_field("azure", v)?; } + auto_track_egress::Output::AliOss(v) => { + struct_ser.serialize_field("aliOSS", v)?; + } } } struct_ser.end() @@ -964,6 +967,7 @@ impl<'de> serde::Deserialize<'de> for AutoTrackEgress { "s3", "gcp", "azure", + "aliOSS", ]; #[allow(clippy::enum_variant_names)] @@ -973,6 +977,7 @@ impl<'de> serde::Deserialize<'de> for AutoTrackEgress { S3, Gcp, Azure, + AliOss, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -1000,6 +1005,7 @@ impl<'de> serde::Deserialize<'de> for AutoTrackEgress { "s3" => Ok(GeneratedField::S3), "gcp" => Ok(GeneratedField::Gcp), "azure" => Ok(GeneratedField::Azure), + "aliOSS" => Ok(GeneratedField::AliOss), _ => Ok(GeneratedField::__SkipField__), } } @@ -1055,6 +1061,13 @@ impl<'de> serde::Deserialize<'de> for AutoTrackEgress { return Err(serde::de::Error::duplicate_field("azure")); } output__ = map_.next_value::<::std::option::Option<_>>()?.map(auto_track_egress::Output::Azure) +; + } + GeneratedField::AliOss => { + if output__.is_some() { + return Err(serde::de::Error::duplicate_field("aliOSS")); + } + output__ = map_.next_value::<::std::option::Option<_>>()?.map(auto_track_egress::Output::AliOss) ; } GeneratedField::__SkipField__ => { @@ -2326,6 +2339,9 @@ impl serde::Serialize for CreateIngressRequest { if self.bypass_transcoding { len += 1; } + if self.enable_transcoding.is_some() { + len += 1; + } if self.audio.is_some() { len += 1; } @@ -2359,6 +2375,9 @@ impl serde::Serialize for CreateIngressRequest { if self.bypass_transcoding { struct_ser.serialize_field("bypassTranscoding", &self.bypass_transcoding)?; } + if let Some(v) = self.enable_transcoding.as_ref() { + struct_ser.serialize_field("enableTranscoding", v)?; + } if let Some(v) = self.audio.as_ref() { struct_ser.serialize_field("audio", v)?; } @@ -2389,6 +2408,8 @@ impl<'de> serde::Deserialize<'de> for CreateIngressRequest { "participantMetadata", "bypass_transcoding", "bypassTranscoding", + "enable_transcoding", + "enableTranscoding", "audio", "video", ]; @@ -2403,6 +2424,7 @@ impl<'de> serde::Deserialize<'de> for CreateIngressRequest { ParticipantName, ParticipantMetadata, BypassTranscoding, + EnableTranscoding, Audio, Video, __SkipField__, @@ -2435,6 +2457,7 @@ impl<'de> serde::Deserialize<'de> for CreateIngressRequest { "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__), @@ -2464,6 +2487,7 @@ impl<'de> serde::Deserialize<'de> for CreateIngressRequest { 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()? { @@ -2516,6 +2540,12 @@ impl<'de> serde::Deserialize<'de> for CreateIngressRequest { } bypass_transcoding__ = Some(map_.next_value()?); } + GeneratedField::EnableTranscoding => { + if enable_transcoding__.is_some() { + return Err(serde::de::Error::duplicate_field("enableTranscoding")); + } + enable_transcoding__ = map_.next_value()?; + } GeneratedField::Audio => { if audio__.is_some() { return Err(serde::de::Error::duplicate_field("audio")); @@ -2542,6 +2572,7 @@ impl<'de> serde::Deserialize<'de> for CreateIngressRequest { participant_name: participant_name__.unwrap_or_default(), participant_metadata: participant_metadata__.unwrap_or_default(), bypass_transcoding: bypass_transcoding__.unwrap_or_default(), + enable_transcoding: enable_transcoding__, audio: audio__, video: video__, }) @@ -2832,6 +2863,18 @@ impl serde::Serialize for CreateSipDispatchRuleRequest { 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.CreateSIPDispatchRuleRequest", len)?; if let Some(v) = self.rule.as_ref() { struct_ser.serialize_field("rule", v)?; @@ -2842,6 +2885,18 @@ impl serde::Serialize for CreateSipDispatchRuleRequest { 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.attributes.is_empty() { + struct_ser.serialize_field("attributes", &self.attributes)?; + } struct_ser.end() } } @@ -2857,6 +2912,11 @@ impl<'de> serde::Deserialize<'de> for CreateSipDispatchRuleRequest { "trunkIds", "hide_phone_number", "hidePhoneNumber", + "inbound_numbers", + "inboundNumbers", + "name", + "metadata", + "attributes", ]; #[allow(clippy::enum_variant_names)] @@ -2864,6 +2924,10 @@ impl<'de> serde::Deserialize<'de> for CreateSipDispatchRuleRequest { Rule, TrunkIds, HidePhoneNumber, + InboundNumbers, + Name, + Metadata, + Attributes, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -2889,6 +2953,10 @@ impl<'de> serde::Deserialize<'de> for CreateSipDispatchRuleRequest { "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__), } } @@ -2911,6 +2979,10 @@ impl<'de> serde::Deserialize<'de> for CreateSipDispatchRuleRequest { 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::Rule => { @@ -2931,6 +3003,32 @@ impl<'de> serde::Deserialize<'de> for CreateSipDispatchRuleRequest { } 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::()?; } @@ -2940,12 +3038,206 @@ impl<'de> serde::Deserialize<'de> for CreateSipDispatchRuleRequest { 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.CreateSIPDispatchRuleRequest", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for CreateSipInboundTrunkRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.trunk.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.CreateSIPInboundTrunkRequest", len)?; + if let Some(v) = self.trunk.as_ref() { + struct_ser.serialize_field("trunk", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for CreateSipInboundTrunkRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "trunk", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Trunk, + __SkipField__, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + 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 { + "trunk" => Ok(GeneratedField::Trunk), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = CreateSipInboundTrunkRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.CreateSIPInboundTrunkRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut trunk__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Trunk => { + if trunk__.is_some() { + return Err(serde::de::Error::duplicate_field("trunk")); + } + trunk__ = map_.next_value()?; + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(CreateSipInboundTrunkRequest { + trunk: trunk__, + }) + } + } + deserializer.deserialize_struct("livekit.CreateSIPInboundTrunkRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for CreateSipOutboundTrunkRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.trunk.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("livekit.CreateSIPOutboundTrunkRequest", len)?; + if let Some(v) = self.trunk.as_ref() { + struct_ser.serialize_field("trunk", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for CreateSipOutboundTrunkRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "trunk", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Trunk, + __SkipField__, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + 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 { + "trunk" => Ok(GeneratedField::Trunk), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = CreateSipOutboundTrunkRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.CreateSIPOutboundTrunkRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut trunk__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Trunk => { + if trunk__.is_some() { + return Err(serde::de::Error::duplicate_field("trunk")); + } + trunk__ = map_.next_value()?; + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } + } + Ok(CreateSipOutboundTrunkRequest { + trunk: trunk__, + }) + } + } + deserializer.deserialize_struct("livekit.CreateSIPOutboundTrunkRequest", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for CreateSipParticipantRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -2969,12 +3261,21 @@ impl serde::Serialize for CreateSipParticipantRequest { if !self.participant_name.is_empty() { len += 1; } + if !self.participant_metadata.is_empty() { + len += 1; + } + if !self.participant_attributes.is_empty() { + len += 1; + } if !self.dtmf.is_empty() { len += 1; } if self.play_ringtone { len += 1; } + if self.hide_phone_number { + len += 1; + } let mut struct_ser = serializer.serialize_struct("livekit.CreateSIPParticipantRequest", len)?; if !self.sip_trunk_id.is_empty() { struct_ser.serialize_field("sipTrunkId", &self.sip_trunk_id)?; @@ -2991,12 +3292,21 @@ impl serde::Serialize for CreateSipParticipantRequest { if !self.participant_name.is_empty() { struct_ser.serialize_field("participantName", &self.participant_name)?; } + if !self.participant_metadata.is_empty() { + struct_ser.serialize_field("participantMetadata", &self.participant_metadata)?; + } + if !self.participant_attributes.is_empty() { + struct_ser.serialize_field("participantAttributes", &self.participant_attributes)?; + } if !self.dtmf.is_empty() { struct_ser.serialize_field("dtmf", &self.dtmf)?; } if self.play_ringtone { struct_ser.serialize_field("playRingtone", &self.play_ringtone)?; } + if self.hide_phone_number { + struct_ser.serialize_field("hidePhoneNumber", &self.hide_phone_number)?; + } struct_ser.end() } } @@ -3017,9 +3327,15 @@ impl<'de> serde::Deserialize<'de> for CreateSipParticipantRequest { "participantIdentity", "participant_name", "participantName", + "participant_metadata", + "participantMetadata", + "participant_attributes", + "participantAttributes", "dtmf", "play_ringtone", "playRingtone", + "hide_phone_number", + "hidePhoneNumber", ]; #[allow(clippy::enum_variant_names)] @@ -3029,8 +3345,11 @@ impl<'de> serde::Deserialize<'de> for CreateSipParticipantRequest { RoomName, ParticipantIdentity, ParticipantName, + ParticipantMetadata, + ParticipantAttributes, Dtmf, PlayRingtone, + HidePhoneNumber, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -3058,8 +3377,11 @@ impl<'de> serde::Deserialize<'de> for CreateSipParticipantRequest { "roomName" | "room_name" => Ok(GeneratedField::RoomName), "participantIdentity" | "participant_identity" => Ok(GeneratedField::ParticipantIdentity), "participantName" | "participant_name" => Ok(GeneratedField::ParticipantName), + "participantMetadata" | "participant_metadata" => Ok(GeneratedField::ParticipantMetadata), + "participantAttributes" | "participant_attributes" => Ok(GeneratedField::ParticipantAttributes), "dtmf" => Ok(GeneratedField::Dtmf), "playRingtone" | "play_ringtone" => Ok(GeneratedField::PlayRingtone), + "hidePhoneNumber" | "hide_phone_number" => Ok(GeneratedField::HidePhoneNumber), _ => Ok(GeneratedField::__SkipField__), } } @@ -3084,8 +3406,11 @@ impl<'de> serde::Deserialize<'de> for CreateSipParticipantRequest { let mut room_name__ = None; let mut participant_identity__ = None; let mut participant_name__ = None; + let mut participant_metadata__ = None; + let mut participant_attributes__ = None; let mut dtmf__ = None; let mut play_ringtone__ = None; + let mut hide_phone_number__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::SipTrunkId => { @@ -3118,9 +3443,23 @@ impl<'de> serde::Deserialize<'de> for CreateSipParticipantRequest { } participant_name__ = Some(map_.next_value()?); } - GeneratedField::Dtmf => { - if dtmf__.is_some() { - return Err(serde::de::Error::duplicate_field("dtmf")); + GeneratedField::ParticipantMetadata => { + if participant_metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("participantMetadata")); + } + participant_metadata__ = Some(map_.next_value()?); + } + GeneratedField::ParticipantAttributes => { + if participant_attributes__.is_some() { + return Err(serde::de::Error::duplicate_field("participantAttributes")); + } + participant_attributes__ = Some( + map_.next_value::>()? + ); + } + GeneratedField::Dtmf => { + if dtmf__.is_some() { + return Err(serde::de::Error::duplicate_field("dtmf")); } dtmf__ = Some(map_.next_value()?); } @@ -3130,6 +3469,12 @@ impl<'de> serde::Deserialize<'de> for CreateSipParticipantRequest { } play_ringtone__ = 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::__SkipField__ => { let _ = map_.next_value::()?; } @@ -3141,8 +3486,11 @@ impl<'de> serde::Deserialize<'de> for CreateSipParticipantRequest { 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(), + participant_attributes: participant_attributes__.unwrap_or_default(), dtmf: dtmf__.unwrap_or_default(), play_ringtone: play_ringtone__.unwrap_or_default(), + hide_phone_number: hide_phone_number__.unwrap_or_default(), }) } } @@ -3184,6 +3532,12 @@ impl serde::Serialize for CreateSipTrunkRequest { 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.CreateSIPTrunkRequest", len)?; if !self.inbound_addresses.is_empty() { struct_ser.serialize_field("inboundAddresses", &self.inbound_addresses)?; @@ -3212,6 +3566,12 @@ impl serde::Serialize for CreateSipTrunkRequest { 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() } } @@ -3240,6 +3600,8 @@ impl<'de> serde::Deserialize<'de> for CreateSipTrunkRequest { "outboundUsername", "outbound_password", "outboundPassword", + "name", + "metadata", ]; #[allow(clippy::enum_variant_names)] @@ -3253,6 +3615,8 @@ impl<'de> serde::Deserialize<'de> for CreateSipTrunkRequest { InboundPassword, OutboundUsername, OutboundPassword, + Name, + Metadata, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -3284,6 +3648,8 @@ impl<'de> serde::Deserialize<'de> for CreateSipTrunkRequest { "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__), } } @@ -3312,6 +3678,8 @@ impl<'de> serde::Deserialize<'de> for CreateSipTrunkRequest { 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::InboundAddresses => { @@ -3368,6 +3736,18 @@ impl<'de> serde::Deserialize<'de> for CreateSipTrunkRequest { } 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::()?; } @@ -3383,6 +3763,8 @@ impl<'de> serde::Deserialize<'de> for CreateSipTrunkRequest { 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(), }) } } @@ -4659,6 +5041,9 @@ impl serde::Serialize for EgressInfo { if !self.error.is_empty() { len += 1; } + if self.error_code != 0 { + len += 1; + } if !self.stream_results.is_empty() { len += 1; } @@ -4710,6 +5095,9 @@ impl serde::Serialize for EgressInfo { if !self.error.is_empty() { struct_ser.serialize_field("error", &self.error)?; } + if self.error_code != 0 { + struct_ser.serialize_field("errorCode", &self.error_code)?; + } if !self.stream_results.is_empty() { struct_ser.serialize_field("streamResults", &self.stream_results)?; } @@ -4779,6 +5167,8 @@ impl<'de> serde::Deserialize<'de> for EgressInfo { "updatedAt", "details", "error", + "error_code", + "errorCode", "stream_results", "streamResults", "file_results", @@ -4810,6 +5200,7 @@ impl<'de> serde::Deserialize<'de> for EgressInfo { UpdatedAt, Details, Error, + ErrorCode, StreamResults, FileResults, SegmentResults, @@ -4853,6 +5244,7 @@ impl<'de> serde::Deserialize<'de> for EgressInfo { "updatedAt" | "updated_at" => Ok(GeneratedField::UpdatedAt), "details" => Ok(GeneratedField::Details), "error" => Ok(GeneratedField::Error), + "errorCode" | "error_code" => Ok(GeneratedField::ErrorCode), "streamResults" | "stream_results" => Ok(GeneratedField::StreamResults), "fileResults" | "file_results" => Ok(GeneratedField::FileResults), "segmentResults" | "segment_results" => Ok(GeneratedField::SegmentResults), @@ -4893,6 +5285,7 @@ impl<'de> serde::Deserialize<'de> for EgressInfo { let mut updated_at__ = None; let mut details__ = None; let mut error__ = None; + let mut error_code__ = None; let mut stream_results__ = None; let mut file_results__ = None; let mut segment_results__ = None; @@ -4961,6 +5354,14 @@ impl<'de> serde::Deserialize<'de> for EgressInfo { } error__ = Some(map_.next_value()?); } + GeneratedField::ErrorCode => { + if error_code__.is_some() { + return Err(serde::de::Error::duplicate_field("errorCode")); + } + error_code__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } GeneratedField::StreamResults => { if stream_results__.is_some() { return Err(serde::de::Error::duplicate_field("streamResults")); @@ -5056,6 +5457,7 @@ impl<'de> serde::Deserialize<'de> for EgressInfo { updated_at: updated_at__.unwrap_or_default(), details: details__.unwrap_or_default(), error: error__.unwrap_or_default(), + error_code: error_code__.unwrap_or_default(), stream_results: stream_results__.unwrap_or_default(), file_results: file_results__.unwrap_or_default(), segment_results: segment_results__.unwrap_or_default(), @@ -7380,6 +7782,9 @@ impl serde::Serialize for IngressInfo { if self.bypass_transcoding { len += 1; } + if self.enable_transcoding.is_some() { + len += 1; + } if self.audio.is_some() { len += 1; } @@ -7425,6 +7830,9 @@ impl serde::Serialize for IngressInfo { if self.bypass_transcoding { struct_ser.serialize_field("bypassTranscoding", &self.bypass_transcoding)?; } + if let Some(v) = self.enable_transcoding.as_ref() { + struct_ser.serialize_field("enableTranscoding", v)?; + } if let Some(v) = self.audio.as_ref() { struct_ser.serialize_field("audio", v)?; } @@ -7469,6 +7877,8 @@ impl<'de> serde::Deserialize<'de> for IngressInfo { "inputType", "bypass_transcoding", "bypassTranscoding", + "enable_transcoding", + "enableTranscoding", "audio", "video", "room_name", @@ -7491,6 +7901,7 @@ impl<'de> serde::Deserialize<'de> for IngressInfo { Url, InputType, BypassTranscoding, + EnableTranscoding, Audio, Video, RoomName, @@ -7527,6 +7938,7 @@ impl<'de> serde::Deserialize<'de> for IngressInfo { "url" => Ok(GeneratedField::Url), "inputType" | "input_type" => Ok(GeneratedField::InputType), "bypassTranscoding" | "bypass_transcoding" => Ok(GeneratedField::BypassTranscoding), + "enableTranscoding" | "enable_transcoding" => Ok(GeneratedField::EnableTranscoding), "audio" => Ok(GeneratedField::Audio), "video" => Ok(GeneratedField::Video), "roomName" | "room_name" => Ok(GeneratedField::RoomName), @@ -7560,6 +7972,7 @@ impl<'de> serde::Deserialize<'de> for IngressInfo { let mut url__ = None; let mut input_type__ = None; let mut bypass_transcoding__ = None; + let mut enable_transcoding__ = None; let mut audio__ = None; let mut video__ = None; let mut room_name__ = None; @@ -7606,6 +8019,12 @@ impl<'de> serde::Deserialize<'de> for IngressInfo { } bypass_transcoding__ = Some(map_.next_value()?); } + GeneratedField::EnableTranscoding => { + if enable_transcoding__.is_some() { + return Err(serde::de::Error::duplicate_field("enableTranscoding")); + } + enable_transcoding__ = map_.next_value()?; + } GeneratedField::Audio => { if audio__.is_some() { return Err(serde::de::Error::duplicate_field("audio")); @@ -7666,6 +8085,7 @@ impl<'de> serde::Deserialize<'de> for IngressInfo { url: url__.unwrap_or_default(), input_type: input_type__.unwrap_or_default(), bypass_transcoding: bypass_transcoding__.unwrap_or_default(), + enable_transcoding: enable_transcoding__, audio: audio__, video: video__, room_name: room_name__.unwrap_or_default(), @@ -10330,7 +10750,7 @@ impl<'de> serde::Deserialize<'de> for ListSipDispatchRuleResponse { deserializer.deserialize_struct("livekit.ListSIPDispatchRuleResponse", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ListSipTrunkRequest { +impl serde::Serialize for ListSipInboundTrunkRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -10338,11 +10758,11 @@ impl serde::Serialize for ListSipTrunkRequest { { use serde::ser::SerializeStruct; let len = 0; - let struct_ser = serializer.serialize_struct("livekit.ListSIPTrunkRequest", len)?; + let struct_ser = serializer.serialize_struct("livekit.ListSIPInboundTrunkRequest", len)?; struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for ListSipTrunkRequest { +impl<'de> serde::Deserialize<'de> for ListSipInboundTrunkRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where @@ -10382,27 +10802,27 @@ impl<'de> serde::Deserialize<'de> for ListSipTrunkRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ListSipTrunkRequest; + type Value = ListSipInboundTrunkRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ListSIPTrunkRequest") + 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>, { while map_.next_key::()?.is_some() { let _ = map_.next_value::()?; } - Ok(ListSipTrunkRequest { + Ok(ListSipInboundTrunkRequest { }) } } - deserializer.deserialize_struct("livekit.ListSIPTrunkRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ListSIPInboundTrunkRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ListSipTrunkResponse { +impl serde::Serialize for ListSipInboundTrunkResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -10413,14 +10833,14 @@ impl serde::Serialize for ListSipTrunkResponse { if !self.items.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.ListSIPTrunkResponse", len)?; + 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 ListSipTrunkResponse { +impl<'de> serde::Deserialize<'de> for ListSipInboundTrunkResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where @@ -10465,13 +10885,13 @@ impl<'de> serde::Deserialize<'de> for ListSipTrunkResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ListSipTrunkResponse; + type Value = ListSipInboundTrunkResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ListSIPTrunkResponse") + 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>, { @@ -10489,70 +10909,37 @@ impl<'de> serde::Deserialize<'de> for ListSipTrunkResponse { } } } - Ok(ListSipTrunkResponse { + Ok(ListSipInboundTrunkResponse { items: items__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.ListSIPTrunkResponse", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ListSIPInboundTrunkResponse", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for MuteRoomTrackRequest { +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.is_empty() { - len += 1; - } - if !self.identity.is_empty() { - len += 1; - } - if !self.track_sid.is_empty() { - len += 1; - } - if self.muted { - 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 len = 0; + let struct_ser = serializer.serialize_struct("livekit.ListSIPOutboundTrunkRequest", len)?; struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for MuteRoomTrackRequest { +impl<'de> serde::Deserialize<'de> for ListSipOutboundTrunkRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "room", - "identity", - "track_sid", - "trackSid", - "muted", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Room, - Identity, - TrackSid, - Muted, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -10574,13 +10961,7 @@ impl<'de> serde::Deserialize<'de> for MuteRoomTrackRequest { where E: serde::de::Error, { - match value { - "room" => Ok(GeneratedField::Room), - "identity" => Ok(GeneratedField::Identity), - "trackSid" | "track_sid" => Ok(GeneratedField::TrackSid), - "muted" => Ok(GeneratedField::Muted), - _ => Ok(GeneratedField::__SkipField__), - } + Ok(GeneratedField::__SkipField__) } } deserializer.deserialize_identifier(GeneratedVisitor) @@ -10588,63 +10969,27 @@ impl<'de> serde::Deserialize<'de> for MuteRoomTrackRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MuteRoomTrackRequest; + type Value = ListSipOutboundTrunkRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.MuteRoomTrackRequest") + formatter.write_str("struct livekit.ListSIPOutboundTrunkRequest") } - 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; - 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")); - } - muted__ = Some(map_.next_value()?); - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; - } - } + while map_.next_key::()?.is_some() { + 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(ListSipOutboundTrunkRequest { }) } } - deserializer.deserialize_struct("livekit.MuteRoomTrackRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ListSIPOutboundTrunkRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for MuteRoomTrackResponse { +impl serde::Serialize for ListSipOutboundTrunkResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -10652,29 +10997,29 @@ impl serde::Serialize for MuteRoomTrackResponse { { use serde::ser::SerializeStruct; let mut len = 0; - if self.track.is_some() { + if !self.items.is_empty() { 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 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 MuteRoomTrackResponse { +impl<'de> serde::Deserialize<'de> for ListSipOutboundTrunkResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "track", + "items", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Track, + Items, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -10697,7 +11042,7 @@ impl<'de> serde::Deserialize<'de> for MuteRoomTrackResponse { E: serde::de::Error, { match value { - "track" => Ok(GeneratedField::Track), + "items" => Ok(GeneratedField::Items), _ => Ok(GeneratedField::__SkipField__), } } @@ -10707,77 +11052,61 @@ impl<'de> serde::Deserialize<'de> for MuteRoomTrackResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MuteRoomTrackResponse; + type Value = ListSipOutboundTrunkResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.MuteRoomTrackResponse") + 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 track__ = None; + let mut items__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Track => { - if track__.is_some() { - return Err(serde::de::Error::duplicate_field("track")); + GeneratedField::Items => { + if items__.is_some() { + return Err(serde::de::Error::duplicate_field("items")); } - track__ = map_.next_value()?; + items__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(MuteRoomTrackResponse { - track: track__, + Ok(ListSipOutboundTrunkResponse { + items: items__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.MuteRoomTrackResponse", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ListSIPOutboundTrunkResponse", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for MuteTrackRequest { +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.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)?; - } + let len = 0; + let struct_ser = serializer.serialize_struct("livekit.ListSIPTrunkRequest", len)?; struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for MuteTrackRequest { +impl<'de> serde::Deserialize<'de> for ListSipTrunkRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "sid", - "muted", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Sid, - Muted, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -10799,11 +11128,7 @@ impl<'de> serde::Deserialize<'de> for MuteTrackRequest { where E: serde::de::Error, { - match value { - "sid" => Ok(GeneratedField::Sid), - "muted" => Ok(GeneratedField::Muted), - _ => Ok(GeneratedField::__SkipField__), - } + Ok(GeneratedField::__SkipField__) } } deserializer.deserialize_identifier(GeneratedVisitor) @@ -10811,47 +11136,27 @@ impl<'de> serde::Deserialize<'de> for MuteTrackRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MuteTrackRequest; + type Value = ListSipTrunkRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.MuteTrackRequest") + formatter.write_str("struct livekit.ListSIPTrunkRequest") } - 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; - 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")); - } - muted__ = Some(map_.next_value()?); - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; - } - } + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; } - Ok(MuteTrackRequest { - sid: sid__.unwrap_or_default(), - muted: muted__.unwrap_or_default(), + Ok(ListSipTrunkRequest { }) } } - deserializer.deserialize_struct("livekit.MuteTrackRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ListSIPTrunkRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ParticipantEgressRequest { +impl serde::Serialize for ListSipTrunkResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -10859,102 +11164,29 @@ impl serde::Serialize for ParticipantEgressRequest { { 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; - } - if !self.segment_outputs.is_empty() { - len += 1; - } - if !self.image_outputs.is_empty() { - len += 1; - } - if self.options.is_some() { + 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.ListSIPTrunkResponse", 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 ListSipTrunkResponse { #[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 { @@ -10977,15 +11209,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__), } } @@ -10995,102 +11219,39 @@ impl<'de> serde::Deserialize<'de> for ParticipantEgressRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ParticipantEgressRequest; + type Value = ListSipTrunkResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ParticipantEgressRequest") + 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 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(ListSipTrunkResponse { + items: items__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.ParticipantEgressRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ListSIPTrunkResponse", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ParticipantInfo { +impl serde::Serialize for MuteRoomTrackRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -11098,124 +11259,54 @@ impl serde::Serialize for ParticipantInfo { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.sid.is_empty() { + if !self.room.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; - } - if self.is_publisher { + if !self.track_sid.is_empty() { len += 1; } - if self.kind != 0 { + if self.muted { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.ParticipantInfo", len)?; - if !self.sid.is_empty() { - struct_ser.serialize_field("sid", &self.sid)?; + 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.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.track_sid.is_empty() { + struct_ser.serialize_field("trackSid", &self.track_sid)?; } - 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.muted { + struct_ser.serialize_field("muted", &self.muted)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for ParticipantInfo { +impl<'de> serde::Deserialize<'de> for MuteRoomTrackRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "sid", + "room", "identity", - "state", - "tracks", - "metadata", - "joined_at", - "joinedAt", - "name", - "version", - "permission", - "region", - "is_publisher", - "isPublisher", - "kind", + "track_sid", + "trackSid", + "muted", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Sid, + Room, Identity, - State, - Tracks, - Metadata, - JoinedAt, - Name, - Version, - Permission, - Region, - IsPublisher, - Kind, + TrackSid, + Muted, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -11238,18 +11329,10 @@ impl<'de> serde::Deserialize<'de> for ParticipantInfo { E: serde::de::Error, { match value { - "sid" => Ok(GeneratedField::Sid), + "room" => Ok(GeneratedField::Room), "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), + "trackSid" | "track_sid" => Ok(GeneratedField::TrackSid), + "muted" => Ok(GeneratedField::Muted), _ => Ok(GeneratedField::__SkipField__), } } @@ -11259,35 +11342,27 @@ impl<'de> serde::Deserialize<'de> for ParticipantInfo { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ParticipantInfo; + type Value = MuteRoomTrackRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ParticipantInfo") + 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 sid__ = None; + let mut room__ = 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 track_sid__ = None; + let mut muted__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Sid => { - if sid__.is_some() { - return Err(serde::de::Error::duplicate_field("sid")); + GeneratedField::Room => { + if room__.is_some() { + return Err(serde::de::Error::duplicate_field("room")); } - sid__ = Some(map_.next_value()?); + room__ = Some(map_.next_value()?); } GeneratedField::Identity => { if identity__.is_some() { @@ -11295,252 +11370,130 @@ impl<'de> serde::Deserialize<'de> for ParticipantInfo { } 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::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")); + GeneratedField::TrackSid => { + if track_sid__.is_some() { + return Err(serde::de::Error::duplicate_field("trackSid")); } - is_publisher__ = Some(map_.next_value()?); + track_sid__ = Some(map_.next_value()?); } - GeneratedField::Kind => { - if kind__.is_some() { - return Err(serde::de::Error::duplicate_field("kind")); + GeneratedField::Muted => { + if muted__.is_some() { + return Err(serde::de::Error::duplicate_field("muted")); } - kind__ = Some(map_.next_value::()? as i32); + muted__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(ParticipantInfo { - sid: sid__.unwrap_or_default(), + Ok(MuteRoomTrackRequest { + room: room__.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(), + track_sid: track_sid__.unwrap_or_default(), + muted: muted__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.ParticipantInfo", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.MuteRoomTrackRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for participant_info::Kind { +impl serde::Serialize for MuteRoomTrackResponse { #[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.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)?; + } + struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for participant_info::Kind { +impl<'de> serde::Deserialize<'de> for MuteRoomTrackResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "STANDARD", - "INGRESS", - "EGRESS", - "SIP", - "AGENT", + "track", ]; - struct GeneratedVisitor; + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Track, + __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 { + "track" => Ok(GeneratedField::Track), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = participant_info::Kind; + type Value = MuteRoomTrackResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) + formatter.write_str("struct livekit.MuteRoomTrackResponse") } - fn visit_i64(self, v: i64) -> std::result::Result - where - E: serde::de::Error, + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'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) - }) - } - - 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)), + 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::()?; + } + } } + Ok(MuteRoomTrackResponse { + track: track__, + }) } } - deserializer.deserialize_any(GeneratedVisitor) + deserializer.deserialize_struct("livekit.MuteRoomTrackResponse", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ParticipantPermission { +impl serde::Serialize for MuteTrackRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -11548,94 +11501,37 @@ impl serde::Serialize for ParticipantPermission { { use serde::ser::SerializeStruct; let mut len = 0; - if self.can_subscribe { - len += 1; - } - if self.can_publish { - len += 1; - } - 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 { + if !self.sid.is_empty() { len += 1; } - if self.agent { + if self.muted { 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)?; + let mut struct_ser = serializer.serialize_struct("livekit.MuteTrackRequest", len)?; + if !self.sid.is_empty() { + struct_ser.serialize_field("sid", &self.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 MuteTrackRequest { #[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", + "sid", + "muted", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - CanSubscribe, - CanPublish, - CanPublishData, - CanPublishSources, - Hidden, - Recorder, - CanUpdateMetadata, - Agent, + Sid, + Muted, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -11658,14 +11554,8 @@ 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), + "sid" => Ok(GeneratedField::Sid), + "muted" => Ok(GeneratedField::Muted), _ => Ok(GeneratedField::__SkipField__), } } @@ -11675,95 +11565,47 @@ impl<'de> serde::Deserialize<'de> for ParticipantPermission { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ParticipantPermission; + type Value = MuteTrackRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ParticipantPermission") + 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 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 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")); + GeneratedField::Sid => { + if sid__.is_some() { + return Err(serde::de::Error::duplicate_field("sid")); } - can_publish__ = Some(map_.next_value()?); + sid__ = Some(map_.next_value()?); } - GeneratedField::CanPublishData => { - if can_publish_data__.is_some() { - return Err(serde::de::Error::duplicate_field("canPublishData")); + GeneratedField::Muted => { + if muted__.is_some() { + return Err(serde::de::Error::duplicate_field("muted")); } - can_publish_data__ = Some(map_.next_value()?); + muted__ = 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::()?; + 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(MuteTrackRequest { + sid: sid__.unwrap_or_default(), + muted: muted__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.ParticipantPermission", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.MuteTrackRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ParticipantTracks { +impl serde::Serialize for ParticipantEgressRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -11771,39 +11613,102 @@ impl serde::Serialize for ParticipantTracks { { 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_sids.is_empty() { + if !self.identity.is_empty() { 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.screen_share { + len += 1; } - if !self.track_sids.is_empty() { - struct_ser.serialize_field("trackSids", &self.track_sids)?; + 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 ParticipantTracks { +impl<'de> serde::Deserialize<'de> for ParticipantEgressRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "participant_sid", - "participantSid", - "track_sids", - "trackSids", + "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 { - ParticipantSid, - TrackSids, + RoomName, + Identity, + ScreenShare, + FileOutputs, + StreamOutputs, + SegmentOutputs, + ImageOutputs, + Preset, + Advanced, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -11826,8 +11731,15 @@ 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), + "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__), } } @@ -11837,47 +11749,102 @@ impl<'de> serde::Deserialize<'de> for ParticipantTracks { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ParticipantTracks; + type Value = ParticipantEgressRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ParticipantTracks") + 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 participant_sid__ = None; - let mut track_sids__ = 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::ParticipantSid => { - if participant_sid__.is_some() { - return Err(serde::de::Error::duplicate_field("participantSid")); + GeneratedField::RoomName => { + if room_name__.is_some() { + return Err(serde::de::Error::duplicate_field("roomName")); } - participant_sid__ = Some(map_.next_value()?); + room_name__ = Some(map_.next_value()?); } - GeneratedField::TrackSids => { - if track_sids__.is_some() { - return Err(serde::de::Error::duplicate_field("trackSids")); + GeneratedField::Identity => { + if identity__.is_some() { + return Err(serde::de::Error::duplicate_field("identity")); } - track_sids__ = Some(map_.next_value()?); + 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(ParticipantTracks { - participant_sid: participant_sid__.unwrap_or_default(), - track_sids: track_sids__.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.ParticipantTracks", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.ParticipantEgressRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for ParticipantUpdate { +impl serde::Serialize for ParticipantInfo { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -11885,134 +11852,132 @@ 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.identity.is_empty() { + len += 1; } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ParticipantUpdate { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "participants", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Participants, - __SkipField__, + if self.state != 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 { - "participants" => Ok(GeneratedField::Participants), - _ => Ok(GeneratedField::__SkipField__), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } + if !self.tracks.is_empty() { + len += 1; } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ParticipantUpdate; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.ParticipantUpdate") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - 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::()?; - } - } - } - Ok(ParticipantUpdate { - participants: participants__.unwrap_or_default(), - }) - } + if !self.metadata.is_empty() { + len += 1; } - 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 { + if self.joined_at != 0 { len += 1; } - if self.rtt != 0 { + if !self.name.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.version != 0 { + len += 1; } - if self.rtt != 0 { + 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("rtt", ToString::to_string(&self.rtt).as_str())?; + 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 Ping { +impl<'de> serde::Deserialize<'de> for ParticipantInfo { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "timestamp", - "rtt", + "sid", + "identity", + "state", + "tracks", + "metadata", + "joined_at", + "joinedAt", + "name", + "version", + "permission", + "region", + "is_publisher", + "isPublisher", + "kind", + "attributes", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Timestamp, - Rtt, + Sid, + Identity, + State, + Tracks, + Metadata, + JoinedAt, + Name, + Version, + Permission, + Region, + IsPublisher, + Kind, + Attributes, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -12035,8 +12000,19 @@ impl<'de> serde::Deserialize<'de> for Ping { E: serde::de::Error, { match value { - "timestamp" => Ok(GeneratedField::Timestamp), - "rtt" => Ok(GeneratedField::Rtt), + "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__), } } @@ -12046,40 +12022,837 @@ impl<'de> serde::Deserialize<'de> for Ping { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Ping; + type Value = ParticipantInfo; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.Ping") + 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 timestamp__ = None; - let mut rtt__ = 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::Timestamp => { - if timestamp__.is_some() { - return Err(serde::de::Error::duplicate_field("timestamp")); + GeneratedField::Sid => { + if sid__.is_some() { + return Err(serde::de::Error::duplicate_field("sid")); } - timestamp__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; + sid__ = 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__ = + 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::__SkipField__ => { - let _ = map_.next_value::()?; - } - } + 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::()?; + } + } + } + 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.ParticipantInfo", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for participant_info::Kind { + #[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) + } +} +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; + } + if self.can_publish { + len += 1; + } + 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 ParticipantPermission { + #[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", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CanSubscribe, + CanPublish, + CanPublishData, + CanPublishSources, + Hidden, + Recorder, + CanUpdateMetadata, + Agent, + __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 { + "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__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ParticipantPermission; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.ParticipantPermission") + } + + 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; + 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")); + } + 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(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.ParticipantPermission", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ParticipantTracks { + #[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_sids.is_empty() { + 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)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ParticipantTracks { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "participant_sid", + "participantSid", + "track_sids", + "trackSids", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ParticipantSid, + TrackSids, + __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), + "trackSids" | "track_sids" => Ok(GeneratedField::TrackSids), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ParticipantTracks; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.ParticipantTracks") + } + + 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; + 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")); + } + track_sids__ = Some(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(), + }) + } + } + deserializer.deserialize_struct("livekit.ParticipantTracks", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ParticipantUpdate { + #[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.ParticipantUpdate", len)?; + if !self.participants.is_empty() { + struct_ser.serialize_field("participants", &self.participants)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ParticipantUpdate { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "participants", + ]; + + #[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; + + 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 { + "participants" => Ok(GeneratedField::Participants), + _ => Ok(GeneratedField::__SkipField__), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ParticipantUpdate; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.ParticipantUpdate") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + 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::()?; + } + } + } + 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__), + } + } + } + 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")); + } + timestamp__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Rtt => { + if rtt__.is_some() { + return Err(serde::de::Error::duplicate_field("rtt")); + } + rtt__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::__SkipField__ => { + let _ = map_.next_value::()?; + } + } } Ok(Ping { timestamp: timestamp__.unwrap_or_default(), @@ -14023,7 +14796,280 @@ impl<'de> serde::Deserialize<'de> for RegionSettings { #[allow(clippy::enum_variant_names)] enum GeneratedField { - Regions, + 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 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 { @@ -14046,7 +15092,19 @@ impl<'de> serde::Deserialize<'de> for RegionSettings { E: serde::de::Error, { match value { - "regions" => Ok(GeneratedField::Regions), + "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__), } } @@ -14056,61 +15114,290 @@ impl<'de> serde::Deserialize<'de> for RegionSettings { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RegionSettings; + type Value = Room; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.RegionSettings") + formatter.write_str("struct livekit.Room") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut regions__ = None; + let mut sid__ = None; + let mut name__ = None; + let mut empty_timeout__ = None; + let mut departure_timeout__ = None; + let mut max_participants__ = None; + let mut creation_time__ = None; + let mut turn_password__ = None; + let mut enabled_codecs__ = None; + let mut metadata__ = None; + let mut num_participants__ = None; + let mut num_publishers__ = None; + let mut active_recording__ = None; + let mut version__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Regions => { - if regions__.is_some() { - return Err(serde::de::Error::duplicate_field("regions")); + GeneratedField::Sid => { + if sid__.is_some() { + return Err(serde::de::Error::duplicate_field("sid")); } - regions__ = Some(map_.next_value()?); + 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(RegionSettings { - regions: regions__.unwrap_or_default(), - }) + 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 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)?; + } } } - 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 { +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 { @@ -14132,7 +15419,23 @@ impl<'de> serde::Deserialize<'de> for RemoveParticipantResponse { where E: serde::de::Error, { - Ok(GeneratedField::__SkipField__) + 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) @@ -14140,163 +15443,187 @@ impl<'de> serde::Deserialize<'de> for RemoveParticipantResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RemoveParticipantResponse; + type Value = RoomCompositeEgressRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.RemoveParticipantResponse") + formatter.write_str("struct livekit.RoomCompositeEgressRequest") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; + 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(RemoveParticipantResponse { + 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.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 { + deserializer.deserialize_struct("livekit.RoomCompositeEgressRequest", 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.active_recording { + if self.participant.is_some() { len += 1; } - if self.version.is_some() { + if self.tracks.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)?; + 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 self.active_recording { - struct_ser.serialize_field("activeRecording", &self.active_recording)?; + if let Some(v) = self.participant.as_ref() { + struct_ser.serialize_field("participant", v)?; } - if let Some(v) = self.version.as_ref() { - struct_ser.serialize_field("version", v)?; + if let Some(v) = self.tracks.as_ref() { + struct_ser.serialize_field("tracks", v)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for Room { +impl<'de> serde::Deserialize<'de> for RoomEgress { #[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", + "room", + "participant", + "tracks", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Sid, - Name, - EmptyTimeout, - DepartureTimeout, - MaxParticipants, - CreationTime, - TurnPassword, - EnabledCodecs, - Metadata, - NumParticipants, - NumPublishers, - ActiveRecording, - Version, + Room, + Participant, + Tracks, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -14319,19 +15646,9 @@ impl<'de> serde::Deserialize<'de> for Room { E: serde::de::Error, { match value { - "sid" => Ok(GeneratedField::Sid), - "name" => Ok(GeneratedField::Name), - "emptyTimeout" | "empty_timeout" => Ok(GeneratedField::EmptyTimeout), - "departureTimeout" | "departure_timeout" => Ok(GeneratedField::DepartureTimeout), - "maxParticipants" | "max_participants" => Ok(GeneratedField::MaxParticipants), - "creationTime" | "creation_time" => Ok(GeneratedField::CreationTime), - "turnPassword" | "turn_password" => Ok(GeneratedField::TurnPassword), - "enabledCodecs" | "enabled_codecs" => Ok(GeneratedField::EnabledCodecs), - "metadata" => Ok(GeneratedField::Metadata), - "numParticipants" | "num_participants" => Ok(GeneratedField::NumParticipants), - "numPublishers" | "num_publishers" => Ok(GeneratedField::NumPublishers), - "activeRecording" | "active_recording" => Ok(GeneratedField::ActiveRecording), - "version" => Ok(GeneratedField::Version), + "room" => Ok(GeneratedField::Room), + "participant" => Ok(GeneratedField::Participant), + "tracks" => Ok(GeneratedField::Tracks), _ => Ok(GeneratedField::__SkipField__), } } @@ -14341,147 +15658,55 @@ impl<'de> serde::Deserialize<'de> for Room { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Room; + type Value = RoomEgress; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.Room") + formatter.write_str("struct livekit.RoomEgress") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut sid__ = None; - let mut name__ = None; - let mut empty_timeout__ = None; - let mut departure_timeout__ = None; - let mut max_participants__ = None; - let mut creation_time__ = None; - let mut turn_password__ = None; - let mut enabled_codecs__ = None; - let mut metadata__ = None; - let mut num_participants__ = None; - let mut num_publishers__ = None; - let mut active_recording__ = None; - let mut version__ = None; + let mut room__ = None; + let mut participant__ = None; + let mut tracks__ = 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")); + GeneratedField::Room => { + if room__.is_some() { + return Err(serde::de::Error::duplicate_field("room")); } - active_recording__ = Some(map_.next_value()?); + room__ = map_.next_value()?; } - GeneratedField::Version => { - if version__.is_some() { - return Err(serde::de::Error::duplicate_field("version")); + GeneratedField::Participant => { + if participant__.is_some() { + return Err(serde::de::Error::duplicate_field("participant")); } - version__ = map_.next_value()?; - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; + participant__ = 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__, + 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.Room", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.RoomEgress", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for RoomCompositeEgressRequest { +impl serde::Serialize for RoomParticipantIdentity { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -14489,142 +15714,141 @@ impl serde::Serialize for RoomCompositeEgressRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.room_name.is_empty() { - len += 1; - } - if !self.layout.is_empty() { - len += 1; - } - if self.audio_only { - len += 1; - } - if self.video_only { - len += 1; - } - if !self.custom_base_url.is_empty() { - len += 1; - } - if !self.file_outputs.is_empty() { - len += 1; - } - if !self.stream_outputs.is_empty() { - len += 1; - } - if !self.segment_outputs.is_empty() { - len += 1; - } - if !self.image_outputs.is_empty() { - len += 1; - } - if self.output.is_some() { + if !self.room.is_empty() { len += 1; } - if self.options.is_some() { + if !self.identity.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.RoomCompositeEgressRequest", len)?; - if !self.room_name.is_empty() { - struct_ser.serialize_field("roomName", &self.room_name)?; - } - if !self.layout.is_empty() { - struct_ser.serialize_field("layout", &self.layout)?; - } - if self.audio_only { - struct_ser.serialize_field("audioOnly", &self.audio_only)?; - } - if self.video_only { - struct_ser.serialize_field("videoOnly", &self.video_only)?; - } - if !self.custom_base_url.is_empty() { - struct_ser.serialize_field("customBaseUrl", &self.custom_base_url)?; - } - if !self.file_outputs.is_empty() { - struct_ser.serialize_field("fileOutputs", &self.file_outputs)?; - } - if !self.stream_outputs.is_empty() { - struct_ser.serialize_field("streamOutputs", &self.stream_outputs)?; + let mut struct_ser = serializer.serialize_struct("livekit.RoomParticipantIdentity", len)?; + if !self.room.is_empty() { + struct_ser.serialize_field("room", &self.room)?; } - if !self.segment_outputs.is_empty() { - struct_ser.serialize_field("segmentOutputs", &self.segment_outputs)?; + if !self.identity.is_empty() { + struct_ser.serialize_field("identity", &self.identity)?; } - if !self.image_outputs.is_empty() { - struct_ser.serialize_field("imageOutputs", &self.image_outputs)?; + 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__, } - 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)?; + 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) } } - 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 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 RoomCompositeEgressRequest { +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_name", - "roomName", - "layout", - "audio_only", - "audioOnly", - "video_only", - "videoOnly", - "custom_base_url", - "customBaseUrl", - "file_outputs", - "fileOutputs", - "stream_outputs", - "streamOutputs", - "segment_outputs", - "segmentOutputs", - "image_outputs", - "imageOutputs", - "file", - "stream", - "segments", - "preset", - "advanced", + "room", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - RoomName, - Layout, - AudioOnly, - VideoOnly, - CustomBaseUrl, - FileOutputs, - StreamOutputs, - SegmentOutputs, - ImageOutputs, - File, - Stream, - Segments, - Preset, - Advanced, + Room, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -14643,24 +15867,11 @@ impl<'de> serde::Deserialize<'de> for RoomCompositeEgressRequest { #[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), + where + E: serde::de::Error, + { + match value { + "room" => Ok(GeneratedField::Room), _ => Ok(GeneratedField::__SkipField__), } } @@ -14670,141 +15881,39 @@ impl<'de> serde::Deserialize<'de> for RoomCompositeEgressRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RoomCompositeEgressRequest; + type Value = RoomUpdate; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.RoomCompositeEgressRequest") + formatter.write_str("struct livekit.RoomUpdate") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut room_name__ = None; - let mut layout__ = None; - let mut audio_only__ = None; - let mut video_only__ = None; - let mut custom_base_url__ = None; - let mut file_outputs__ = None; - let mut stream_outputs__ = None; - let mut segment_outputs__ = None; - let mut image_outputs__ = None; - let mut output__ = None; - let mut options__ = None; + let mut room__ = None; 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")); + GeneratedField::Room => { + if room__.is_some() { + return Err(serde::de::Error::duplicate_field("room")); } - options__ = map_.next_value::<::std::option::Option<_>>()?.map(room_composite_egress_request::Options::Advanced) -; + room__ = map_.next_value()?; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(RoomCompositeEgressRequest { - room_name: room_name__.unwrap_or_default(), - layout: layout__.unwrap_or_default(), - audio_only: audio_only__.unwrap_or_default(), - video_only: video_only__.unwrap_or_default(), - custom_base_url: custom_base_url__.unwrap_or_default(), - file_outputs: file_outputs__.unwrap_or_default(), - stream_outputs: stream_outputs__.unwrap_or_default(), - segment_outputs: segment_outputs__.unwrap_or_default(), - image_outputs: image_outputs__.unwrap_or_default(), - output: output__, - options: options__, + Ok(RoomUpdate { + room: room__, }) } } - deserializer.deserialize_struct("livekit.RoomCompositeEgressRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.RoomUpdate", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for RoomEgress { +impl serde::Serialize for S3Upload { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -14812,45 +15921,113 @@ impl serde::Serialize for RoomEgress { { use serde::ser::SerializeStruct; let mut len = 0; - if self.room.is_some() { + if !self.access_key.is_empty() { len += 1; } - if self.participant.is_some() { + if !self.secret.is_empty() { len += 1; } - if self.tracks.is_some() { + if !self.session_token.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 !self.region.is_empty() { + len += 1; } - if let Some(v) = self.participant.as_ref() { - struct_ser.serialize_field("participant", v)?; + if !self.endpoint.is_empty() { + len += 1; } - if let Some(v) = self.tracks.as_ref() { - struct_ser.serialize_field("tracks", v)?; + 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 RoomEgress { +impl<'de> serde::Deserialize<'de> for S3Upload { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "room", - "participant", - "tracks", + "access_key", + "accessKey", + "secret", + "session_token", + "sessionToken", + "region", + "endpoint", + "bucket", + "force_path_style", + "forcePathStyle", + "metadata", + "tagging", + "content_disposition", + "contentDisposition", + "proxy", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Room, - Participant, - Tracks, + AccessKey, + Secret, + SessionToken, + Region, + Endpoint, + Bucket, + ForcePathStyle, + Metadata, + Tagging, + ContentDisposition, + Proxy, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -14873,9 +16050,17 @@ 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), + "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), + "tagging" => Ok(GeneratedField::Tagging), + "contentDisposition" | "content_disposition" => Ok(GeneratedField::ContentDisposition), + "proxy" => Ok(GeneratedField::Proxy), _ => Ok(GeneratedField::__SkipField__), } } @@ -14885,55 +16070,121 @@ impl<'de> serde::Deserialize<'de> for RoomEgress { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RoomEgress; + type Value = S3Upload; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.RoomEgress") + 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 room__ = None; - let mut participant__ = None; - let mut tracks__ = 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 tagging__ = None; + let mut content_disposition__ = None; + let mut proxy__ = 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::AccessKey => { + if access_key__.is_some() { + return Err(serde::de::Error::duplicate_field("accessKey")); } - room__ = map_.next_value()?; + access_key__ = Some(map_.next_value()?); } - GeneratedField::Participant => { - if participant__.is_some() { - return Err(serde::de::Error::duplicate_field("participant")); + GeneratedField::Secret => { + if secret__.is_some() { + return Err(serde::de::Error::duplicate_field("secret")); } - participant__ = map_.next_value()?; + secret__ = Some(map_.next_value()?); } - GeneratedField::Tracks => { - if tracks__.is_some() { - return Err(serde::de::Error::duplicate_field("tracks")); + GeneratedField::SessionToken => { + if session_token__.is_some() { + return Err(serde::de::Error::duplicate_field("sessionToken")); } - tracks__ = map_.next_value()?; + session_token__ = Some(map_.next_value()?); + } + GeneratedField::Region => { + if region__.is_some() { + return Err(serde::de::Error::duplicate_field("region")); + } + region__ = Some(map_.next_value()?); + } + GeneratedField::Endpoint => { + if endpoint__.is_some() { + return Err(serde::de::Error::duplicate_field("endpoint")); + } + endpoint__ = Some(map_.next_value()?); + } + GeneratedField::Bucket => { + if bucket__.is_some() { + return Err(serde::de::Error::duplicate_field("bucket")); + } + bucket__ = Some(map_.next_value()?); + } + GeneratedField::ForcePathStyle => { + if force_path_style__.is_some() { + return Err(serde::de::Error::duplicate_field("forcePathStyle")); + } + 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::>()? + ); + } + GeneratedField::Tagging => { + if tagging__.is_some() { + return Err(serde::de::Error::duplicate_field("tagging")); + } + tagging__ = Some(map_.next_value()?); + } + GeneratedField::ContentDisposition => { + if content_disposition__.is_some() { + return Err(serde::de::Error::duplicate_field("contentDisposition")); + } + 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(RoomEgress { - room: room__, - participant: participant__, - tracks: tracks__, + 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.RoomEgress", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.S3Upload", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for RoomParticipantIdentity { +impl serde::Serialize for SipDispatchRule { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -14941,37 +16192,40 @@ impl serde::Serialize for RoomParticipantIdentity { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.room.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.identity.is_empty() { - struct_ser.serialize_field("identity", &self.identity)?; + 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 RoomParticipantIdentity { +impl<'de> serde::Deserialize<'de> for SipDispatchRule { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "room", - "identity", + "dispatch_rule_direct", + "dispatchRuleDirect", + "dispatch_rule_individual", + "dispatchRuleIndividual", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Room, - Identity, + DispatchRuleDirect, + DispatchRuleIndividual, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -14994,8 +16248,8 @@ impl<'de> serde::Deserialize<'de> for RoomParticipantIdentity { E: serde::de::Error, { match value { - "room" => Ok(GeneratedField::Room), - "identity" => Ok(GeneratedField::Identity), + "dispatchRuleDirect" | "dispatch_rule_direct" => Ok(GeneratedField::DispatchRuleDirect), + "dispatchRuleIndividual" | "dispatch_rule_individual" => Ok(GeneratedField::DispatchRuleIndividual), _ => Ok(GeneratedField::__SkipField__), } } @@ -15005,47 +16259,47 @@ impl<'de> serde::Deserialize<'de> for RoomParticipantIdentity { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RoomParticipantIdentity; + type Value = SipDispatchRule; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.RoomParticipantIdentity") + formatter.write_str("struct livekit.SIPDispatchRule") } - 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 rule__ = 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::DispatchRuleDirect => { + if rule__.is_some() { + return Err(serde::de::Error::duplicate_field("dispatchRuleDirect")); } - room__ = Some(map_.next_value()?); + rule__ = map_.next_value::<::std::option::Option<_>>()?.map(sip_dispatch_rule::Rule::DispatchRuleDirect) +; } - GeneratedField::Identity => { - if identity__.is_some() { - return Err(serde::de::Error::duplicate_field("identity")); + GeneratedField::DispatchRuleIndividual => { + if rule__.is_some() { + return Err(serde::de::Error::duplicate_field("dispatchRuleIndividual")); } - identity__ = Some(map_.next_value()?); + rule__ = map_.next_value::<::std::option::Option<_>>()?.map(sip_dispatch_rule::Rule::DispatchRuleIndividual) +; } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(RoomParticipantIdentity { - room: room__.unwrap_or_default(), - identity: identity__.unwrap_or_default(), + Ok(SipDispatchRule { + rule: rule__, }) } } - deserializer.deserialize_struct("livekit.RoomParticipantIdentity", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.SIPDispatchRule", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for RoomUpdate { +impl serde::Serialize for SipDispatchRuleDirect { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -15053,29 +16307,38 @@ impl serde::Serialize for RoomUpdate { { use serde::ser::SerializeStruct; let mut len = 0; - if self.room.is_some() { + if !self.room_name.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.pin.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.pin.is_empty() { + struct_ser.serialize_field("pin", &self.pin)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for RoomUpdate { +impl<'de> serde::Deserialize<'de> for SipDispatchRuleDirect { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "room", + "room_name", + "roomName", + "pin", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Room, + RoomName, + Pin, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -15098,7 +16361,8 @@ impl<'de> serde::Deserialize<'de> for RoomUpdate { E: serde::de::Error, { match value { - "room" => Ok(GeneratedField::Room), + "roomName" | "room_name" => Ok(GeneratedField::RoomName), + "pin" => Ok(GeneratedField::Pin), _ => Ok(GeneratedField::__SkipField__), } } @@ -15108,144 +16372,86 @@ impl<'de> serde::Deserialize<'de> for RoomUpdate { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RoomUpdate; + type Value = SipDispatchRuleDirect; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.RoomUpdate") + 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__ = None; + let mut room_name__ = 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")); + GeneratedField::RoomName => { + if room_name__.is_some() { + return Err(serde::de::Error::duplicate_field("roomName")); } - room__ = map_.next_value()?; + room_name__ = 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::()?; } } } - Ok(RoomUpdate { - room: room__, + Ok(SipDispatchRuleDirect { + room_name: room_name__.unwrap_or_default(), + pin: pin__.unwrap_or_default(), }) } } - 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.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() { + deserializer.deserialize_struct("livekit.SIPDispatchRuleDirect", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SipDispatchRuleIndividual { + #[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.proxy.is_some() { + if !self.pin.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.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)?; + 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.proxy.as_ref() { - struct_ser.serialize_field("proxy", v)?; + if !self.pin.is_empty() { + struct_ser.serialize_field("pin", &self.pin)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for S3Upload { +impl<'de> serde::Deserialize<'de> for SipDispatchRuleIndividual { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "access_key", - "accessKey", - "secret", - "region", - "endpoint", - "bucket", - "force_path_style", - "forcePathStyle", - "metadata", - "tagging", - "content_disposition", - "contentDisposition", - "proxy", + "room_prefix", + "roomPrefix", + "pin", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - AccessKey, - Secret, - Region, - Endpoint, - Bucket, - ForcePathStyle, - Metadata, - Tagging, - ContentDisposition, - Proxy, + RoomPrefix, + Pin, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -15268,16 +16474,8 @@ impl<'de> serde::Deserialize<'de> for S3Upload { E: serde::de::Error, { match value { - "accessKey" | "access_key" => Ok(GeneratedField::AccessKey), - "secret" => Ok(GeneratedField::Secret), - "region" => Ok(GeneratedField::Region), - "endpoint" => Ok(GeneratedField::Endpoint), - "bucket" => Ok(GeneratedField::Bucket), - "forcePathStyle" | "force_path_style" => Ok(GeneratedField::ForcePathStyle), - "metadata" => Ok(GeneratedField::Metadata), - "tagging" => Ok(GeneratedField::Tagging), - "contentDisposition" | "content_disposition" => Ok(GeneratedField::ContentDisposition), - "proxy" => Ok(GeneratedField::Proxy), + "roomPrefix" | "room_prefix" => Ok(GeneratedField::RoomPrefix), + "pin" => Ok(GeneratedField::Pin), _ => Ok(GeneratedField::__SkipField__), } } @@ -15287,113 +16485,47 @@ impl<'de> serde::Deserialize<'de> for S3Upload { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = S3Upload; + type Value = SipDispatchRuleIndividual; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.S3Upload") + 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 access_key__ = None; - let mut secret__ = 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 tagging__ = None; - let mut content_disposition__ = None; - let mut proxy__ = None; + let mut room_prefix__ = None; + let mut pin__ = 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::Region => { - if region__.is_some() { - return Err(serde::de::Error::duplicate_field("region")); - } - region__ = Some(map_.next_value()?); - } - GeneratedField::Endpoint => { - if endpoint__.is_some() { - return Err(serde::de::Error::duplicate_field("endpoint")); - } - endpoint__ = Some(map_.next_value()?); - } - GeneratedField::Bucket => { - if bucket__.is_some() { - return Err(serde::de::Error::duplicate_field("bucket")); - } - bucket__ = Some(map_.next_value()?); - } - GeneratedField::ForcePathStyle => { - if force_path_style__.is_some() { - return Err(serde::de::Error::duplicate_field("forcePathStyle")); - } - 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::>()? - ); - } - GeneratedField::Tagging => { - if tagging__.is_some() { - return Err(serde::de::Error::duplicate_field("tagging")); - } - tagging__ = Some(map_.next_value()?); - } - GeneratedField::ContentDisposition => { - if content_disposition__.is_some() { - return Err(serde::de::Error::duplicate_field("contentDisposition")); + GeneratedField::RoomPrefix => { + if room_prefix__.is_some() { + return Err(serde::de::Error::duplicate_field("roomPrefix")); } - content_disposition__ = Some(map_.next_value()?); + room_prefix__ = Some(map_.next_value()?); } - GeneratedField::Proxy => { - if proxy__.is_some() { - return Err(serde::de::Error::duplicate_field("proxy")); + GeneratedField::Pin => { + if pin__.is_some() { + return Err(serde::de::Error::duplicate_field("pin")); } - proxy__ = map_.next_value()?; + pin__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(S3Upload { - access_key: access_key__.unwrap_or_default(), - secret: secret__.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__, + Ok(SipDispatchRuleIndividual { + room_prefix: room_prefix__.unwrap_or_default(), + pin: pin__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("livekit.S3Upload", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.SIPDispatchRuleIndividual", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for SipDispatchRule { +impl serde::Serialize for SipDispatchRuleInfo { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -15401,40 +16533,89 @@ impl serde::Serialize for SipDispatchRule { { use serde::ser::SerializeStruct; let mut len = 0; + if !self.sip_dispatch_rule_id.is_empty() { + len += 1; + } if self.rule.is_some() { len += 1; } - let mut struct_ser = serializer.serialize_struct("livekit.SIPDispatchRule", len)?; + 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() { - 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.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.attributes.is_empty() { + struct_ser.serialize_field("attributes", &self.attributes)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for SipDispatchRule { +impl<'de> serde::Deserialize<'de> for SipDispatchRuleInfo { #[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", + "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 { - DispatchRuleDirect, - DispatchRuleIndividual, + SipDispatchRuleId, + Rule, + TrunkIds, + HidePhoneNumber, + InboundNumbers, + Name, + Metadata, + Attributes, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -15457,8 +16638,14 @@ 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), + "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__), } } @@ -15468,47 +16655,97 @@ impl<'de> serde::Deserialize<'de> for SipDispatchRule { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SipDispatchRule; + type Value = SipDispatchRuleInfo; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SIPDispatchRule") + 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 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::DispatchRuleDirect => { - if rule__.is_some() { - return Err(serde::de::Error::duplicate_field("dispatchRuleDirect")); + GeneratedField::SipDispatchRuleId => { + if sip_dispatch_rule_id__.is_some() { + return Err(serde::de::Error::duplicate_field("sipDispatchRuleId")); } - rule__ = map_.next_value::<::std::option::Option<_>>()?.map(sip_dispatch_rule::Rule::DispatchRuleDirect) -; + sip_dispatch_rule_id__ = Some(map_.next_value()?); } - GeneratedField::DispatchRuleIndividual => { + GeneratedField::Rule => { if rule__.is_some() { - return Err(serde::de::Error::duplicate_field("dispatchRuleIndividual")); + return Err(serde::de::Error::duplicate_field("rule")); } - rule__ = map_.next_value::<::std::option::Option<_>>()?.map(sip_dispatch_rule::Rule::DispatchRuleIndividual) -; + 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(SipDispatchRule { + 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.SIPDispatchRule", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.SIPDispatchRuleInfo", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for SipDispatchRuleDirect { +impl serde::Serialize for SipInboundTrunkInfo { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -15516,38 +16753,90 @@ impl serde::Serialize for SipDispatchRuleDirect { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.room_name.is_empty() { + if !self.sip_trunk_id.is_empty() { len += 1; } - if !self.pin.is_empty() { + if !self.name.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.metadata.is_empty() { + len += 1; } - if !self.pin.is_empty() { - struct_ser.serialize_field("pin", &self.pin)?; + 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 SipDispatchRuleDirect { +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_name", - "roomName", - "pin", + "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 { - RoomName, - Pin, + SipTrunkId, + Name, + Metadata, + Numbers, + AllowedAddresses, + AllowedNumbers, + AuthUsername, + AuthPassword, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -15570,8 +16859,14 @@ 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), + "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__), } } @@ -15581,160 +16876,95 @@ impl<'de> serde::Deserialize<'de> for SipDispatchRuleDirect { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SipDispatchRuleDirect; + type Value = SipInboundTrunkInfo; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SIPDispatchRuleDirect") + 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_name__ = None; - let mut pin__ = 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::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::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); } - pin__ = Some(map_.next_value()?); + name__ = Some(map_.next_value()?); } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = Some(map_.next_value()?); } - } - } - Ok(SipDispatchRuleDirect { - room_name: room_name__.unwrap_or_default(), - pin: pin__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("livekit.SIPDispatchRuleDirect", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for SipDispatchRuleIndividual { - #[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() - } -} -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_prefix", - "roomPrefix", - "pin", - ]; - - #[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; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "roomPrefix" | "room_prefix" => Ok(GeneratedField::RoomPrefix), - "pin" => Ok(GeneratedField::Pin), - _ => Ok(GeneratedField::__SkipField__), + 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")); + } + 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()?); } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - 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_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - 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")); + GeneratedField::AuthUsername => { + if auth_username__.is_some() { + return Err(serde::de::Error::duplicate_field("authUsername")); } - room_prefix__ = Some(map_.next_value()?); + auth_username__ = Some(map_.next_value()?); } - GeneratedField::Pin => { - if pin__.is_some() { - return Err(serde::de::Error::duplicate_field("pin")); + GeneratedField::AuthPassword => { + if auth_password__.is_some() { + return Err(serde::de::Error::duplicate_field("authPassword")); } - pin__ = Some(map_.next_value()?); + auth_password__ = Some(map_.next_value()?); } GeneratedField::__SkipField__ => { let _ = map_.next_value::()?; } } } - Ok(SipDispatchRuleIndividual { - room_prefix: room_prefix__.unwrap_or_default(), - pin: pin__.unwrap_or_default(), + 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.SIPDispatchRuleIndividual", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.SIPInboundTrunkInfo", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for SipDispatchRuleInfo { +impl serde::Serialize for SipOutboundTrunkInfo { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -15742,56 +16972,90 @@ impl serde::Serialize for SipDispatchRuleInfo { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.sip_dispatch_rule_id.is_empty() { + if !self.sip_trunk_id.is_empty() { len += 1; } - if self.rule.is_some() { + if !self.name.is_empty() { len += 1; } - if !self.trunk_ids.is_empty() { + if !self.metadata.is_empty() { len += 1; } - if self.hide_phone_number { + if !self.address.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 self.transport != 0 { + len += 1; } - if let Some(v) = self.rule.as_ref() { - struct_ser.serialize_field("rule", v)?; + if !self.numbers.is_empty() { + len += 1; } - if !self.trunk_ids.is_empty() { - struct_ser.serialize_field("trunkIds", &self.trunk_ids)?; + if !self.auth_username.is_empty() { + len += 1; } - if self.hide_phone_number { - struct_ser.serialize_field("hidePhoneNumber", &self.hide_phone_number)?; + if !self.auth_password.is_empty() { + 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)?; + } + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + 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.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 SipDispatchRuleInfo { +impl<'de> serde::Deserialize<'de> for SipOutboundTrunkInfo { #[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", + "sip_trunk_id", + "sipTrunkId", + "name", + "metadata", + "address", + "transport", + "numbers", + "auth_username", + "authUsername", + "auth_password", + "authPassword", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - SipDispatchRuleId, - Rule, - TrunkIds, - HidePhoneNumber, + SipTrunkId, + Name, + Metadata, + Address, + Transport, + Numbers, + AuthUsername, + AuthPassword, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -15814,10 +17078,14 @@ 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), + "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), _ => Ok(GeneratedField::__SkipField__), } } @@ -15827,60 +17095,92 @@ impl<'de> serde::Deserialize<'de> for SipDispatchRuleInfo { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SipDispatchRuleInfo; + type Value = SipOutboundTrunkInfo; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SIPDispatchRuleInfo") + 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 sip_dispatch_rule_id__ = None; - let mut rule__ = None; - let mut trunk_ids__ = None; - let mut hide_phone_number__ = None; + 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; 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::SipTrunkId => { + if sip_trunk_id__.is_some() { + return Err(serde::de::Error::duplicate_field("sipTrunkId")); } - sip_dispatch_rule_id__ = Some(map_.next_value()?); + sip_trunk_id__ = Some(map_.next_value()?); } - GeneratedField::Rule => { - if rule__.is_some() { - return Err(serde::de::Error::duplicate_field("rule")); + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); } - rule__ = map_.next_value()?; + name__ = Some(map_.next_value()?); } - GeneratedField::TrunkIds => { - if trunk_ids__.is_some() { - return Err(serde::de::Error::duplicate_field("trunkIds")); + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); } - trunk_ids__ = Some(map_.next_value()?); + metadata__ = Some(map_.next_value()?); } - GeneratedField::HidePhoneNumber => { - if hide_phone_number__.is_some() { - return Err(serde::de::Error::duplicate_field("hidePhoneNumber")); + GeneratedField::Address => { + if address__.is_some() { + return Err(serde::de::Error::duplicate_field("address")); } - hide_phone_number__ = Some(map_.next_value()?); + address__ = 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::Numbers => { + if numbers__.is_some() { + return Err(serde::de::Error::duplicate_field("numbers")); + } + 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(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(), + 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(), }) } } - deserializer.deserialize_struct("livekit.SIPDispatchRuleInfo", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("livekit.SIPOutboundTrunkInfo", FIELDS, GeneratedVisitor) } } impl serde::Serialize for SipParticipantInfo { @@ -15900,6 +17200,9 @@ impl serde::Serialize for SipParticipantInfo { 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)?; @@ -15910,6 +17213,9 @@ impl serde::Serialize for SipParticipantInfo { 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() } } @@ -15926,6 +17232,8 @@ impl<'de> serde::Deserialize<'de> for SipParticipantInfo { "participantIdentity", "room_name", "roomName", + "sip_call_id", + "sipCallId", ]; #[allow(clippy::enum_variant_names)] @@ -15933,6 +17241,7 @@ impl<'de> serde::Deserialize<'de> for SipParticipantInfo { ParticipantId, ParticipantIdentity, RoomName, + SipCallId, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -15958,61 +17267,147 @@ impl<'de> serde::Deserialize<'de> for SipParticipantInfo { "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__), } } } deserializer.deserialize_identifier(GeneratedVisitor) } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SipParticipantInfo; + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SipParticipantInfo; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct livekit.SIPParticipantInfo") + } + + 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; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ParticipantId => { + if participant_id__.is_some() { + return Err(serde::de::Error::duplicate_field("participantId")); + } + participant_id__ = 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::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(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.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 expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct livekit.SIPParticipantInfo") + 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_id__ = None; - let mut participant_identity__ = None; - let mut room_name__ = 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")); - } - participant_id__ = 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::RoomName => { - if room_name__.is_some() { - return Err(serde::de::Error::duplicate_field("roomName")); - } - room_name__ = Some(map_.next_value()?); - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; - } - } + 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)), } - Ok(SipParticipantInfo { - participant_id: participant_id__.unwrap_or_default(), - participant_identity: participant_identity__.unwrap_or_default(), - room_name: room_name__.unwrap_or_default(), - }) } } - deserializer.deserialize_struct("livekit.SIPParticipantInfo", FIELDS, GeneratedVisitor) + deserializer.deserialize_any(GeneratedVisitor) } } impl serde::Serialize for SipTrunkInfo { @@ -16026,6 +17421,9 @@ impl serde::Serialize for SipTrunkInfo { if !self.sip_trunk_id.is_empty() { len += 1; } + if self.kind != 0 { + len += 1; + } if !self.inbound_addresses.is_empty() { len += 1; } @@ -16035,6 +17433,9 @@ impl serde::Serialize for SipTrunkInfo { if !self.outbound_number.is_empty() { len += 1; } + if self.transport != 0 { + len += 1; + } if !self.inbound_numbers_regex.is_empty() { len += 1; } @@ -16053,10 +17454,21 @@ impl serde::Serialize for SipTrunkInfo { 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)?; } @@ -16066,6 +17478,11 @@ impl serde::Serialize for SipTrunkInfo { 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)?; } @@ -16084,6 +17501,12 @@ impl serde::Serialize for SipTrunkInfo { 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() } } @@ -16096,12 +17519,14 @@ impl<'de> serde::Deserialize<'de> for SipTrunkInfo { const FIELDS: &[&str] = &[ "sip_trunk_id", "sipTrunkId", + "kind", "inbound_addresses", "inboundAddresses", "outbound_address", "outboundAddress", "outbound_number", "outboundNumber", + "transport", "inbound_numbers_regex", "inboundNumbersRegex", "inbound_numbers", @@ -16114,20 +17539,26 @@ impl<'de> serde::Deserialize<'de> for SipTrunkInfo { "outboundUsername", "outbound_password", "outboundPassword", + "name", + "metadata", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { SipTrunkId, + Kind, InboundAddresses, OutboundAddress, OutboundNumber, + Transport, InboundNumbersRegex, InboundNumbers, InboundUsername, InboundPassword, OutboundUsername, OutboundPassword, + Name, + Metadata, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -16151,15 +17582,19 @@ impl<'de> serde::Deserialize<'de> for SipTrunkInfo { { 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), _ => Ok(GeneratedField::__SkipField__), } } @@ -16180,15 +17615,19 @@ impl<'de> serde::Deserialize<'de> for SipTrunkInfo { 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 => { @@ -16197,6 +17636,12 @@ impl<'de> serde::Deserialize<'de> for SipTrunkInfo { } 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")); @@ -16215,6 +17660,12 @@ impl<'de> serde::Deserialize<'de> for SipTrunkInfo { } 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")); @@ -16251,6 +17702,18 @@ impl<'de> serde::Deserialize<'de> for SipTrunkInfo { } 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::()?; } @@ -16258,21 +17721,99 @@ impl<'de> serde::Deserialize<'de> for SipTrunkInfo { } 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.SIPTrunkInfo", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for sip_trunk_info::TrunkKind { + #[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) + } +} +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] = &[ + "TRUNK_LEGACY", + "TRUNK_INBOUND", + "TRUNK_OUTBOUND", + ]; + + struct GeneratedVisitor; + + 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 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 { + "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)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} impl serde::Serialize for SegmentedFileOutput { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -18372,6 +19913,9 @@ impl serde::Serialize for SimulateScenario { 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() @@ -18399,6 +19943,8 @@ impl<'de> serde::Deserialize<'de> for SimulateScenario { "disconnectSignalOnResume", "disconnect_signal_on_resume_no_messages", "disconnectSignalOnResumeNoMessages", + "leave_request_full_reconnect", + "leaveRequestFullReconnect", ]; #[allow(clippy::enum_variant_names)] @@ -18411,6 +19957,7 @@ impl<'de> serde::Deserialize<'de> for SimulateScenario { SubscriberBandwidth, DisconnectSignalOnResume, DisconnectSignalOnResumeNoMessages, + LeaveRequestFullReconnect, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -18441,6 +19988,7 @@ impl<'de> serde::Deserialize<'de> for SimulateScenario { "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__), } } @@ -18511,6 +20059,12 @@ impl<'de> serde::Deserialize<'de> for SimulateScenario { } 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::()?; } @@ -21658,6 +23212,9 @@ impl serde::Serialize for TrackInfo { 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)?; @@ -21719,6 +23276,13 @@ impl serde::Serialize for TrackInfo { 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() } } @@ -21750,6 +23314,8 @@ impl<'de> serde::Deserialize<'de> for TrackInfo { "encryption", "stream", "version", + "audio_features", + "audioFeatures", ]; #[allow(clippy::enum_variant_names)] @@ -21772,6 +23338,7 @@ impl<'de> serde::Deserialize<'de> for TrackInfo { Encryption, Stream, Version, + AudioFeatures, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -21812,6 +23379,7 @@ impl<'de> serde::Deserialize<'de> for TrackInfo { "encryption" => Ok(GeneratedField::Encryption), "stream" => Ok(GeneratedField::Stream), "version" => Ok(GeneratedField::Version), + "audioFeatures" | "audio_features" => Ok(GeneratedField::AudioFeatures), _ => Ok(GeneratedField::__SkipField__), } } @@ -21849,6 +23417,7 @@ impl<'de> serde::Deserialize<'de> for TrackInfo { 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::Sid => { @@ -21963,6 +23532,12 @@ impl<'de> serde::Deserialize<'de> for TrackInfo { } 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::()?; } @@ -21987,6 +23562,7 @@ impl<'de> serde::Deserialize<'de> for TrackInfo { encryption: encryption__.unwrap_or_default(), stream: stream__.unwrap_or_default(), version: version__, + audio_features: audio_features__.unwrap_or_default(), }) } } @@ -22513,7 +24089,7 @@ impl serde::Serialize for Transcription { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.participant_identity.is_empty() { + if !self.transcribed_participant_identity.is_empty() { len += 1; } if !self.track_id.is_empty() { @@ -22522,12 +24098,9 @@ impl serde::Serialize for Transcription { if !self.segments.is_empty() { len += 1; } - if !self.language.is_empty() { - len += 1; - } let mut struct_ser = serializer.serialize_struct("livekit.Transcription", len)?; - if !self.participant_identity.is_empty() { - struct_ser.serialize_field("participantIdentity", &self.participant_identity)?; + 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)?; @@ -22535,9 +24108,6 @@ impl serde::Serialize for Transcription { if !self.segments.is_empty() { struct_ser.serialize_field("segments", &self.segments)?; } - if !self.language.is_empty() { - struct_ser.serialize_field("language", &self.language)?; - } struct_ser.end() } } @@ -22548,20 +24118,18 @@ impl<'de> serde::Deserialize<'de> for Transcription { D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "participant_identity", - "participantIdentity", + "transcribed_participant_identity", + "transcribedParticipantIdentity", "track_id", "trackId", "segments", - "language", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - ParticipantIdentity, + TranscribedParticipantIdentity, TrackId, Segments, - Language, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -22584,10 +24152,9 @@ impl<'de> serde::Deserialize<'de> for Transcription { E: serde::de::Error, { match value { - "participantIdentity" | "participant_identity" => Ok(GeneratedField::ParticipantIdentity), + "transcribedParticipantIdentity" | "transcribed_participant_identity" => Ok(GeneratedField::TranscribedParticipantIdentity), "trackId" | "track_id" => Ok(GeneratedField::TrackId), "segments" => Ok(GeneratedField::Segments), - "language" => Ok(GeneratedField::Language), _ => Ok(GeneratedField::__SkipField__), } } @@ -22607,17 +24174,16 @@ impl<'de> serde::Deserialize<'de> for Transcription { where V: serde::de::MapAccess<'de>, { - let mut participant_identity__ = None; + let mut transcribed_participant_identity__ = None; let mut track_id__ = None; let mut segments__ = None; - let mut language__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::ParticipantIdentity => { - if participant_identity__.is_some() { - return Err(serde::de::Error::duplicate_field("participantIdentity")); + GeneratedField::TranscribedParticipantIdentity => { + if transcribed_participant_identity__.is_some() { + return Err(serde::de::Error::duplicate_field("transcribedParticipantIdentity")); } - participant_identity__ = Some(map_.next_value()?); + transcribed_participant_identity__ = Some(map_.next_value()?); } GeneratedField::TrackId => { if track_id__.is_some() { @@ -22631,22 +24197,15 @@ impl<'de> serde::Deserialize<'de> for Transcription { } segments__ = 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(Transcription { - participant_identity: participant_identity__.unwrap_or_default(), + transcribed_participant_identity: transcribed_participant_identity__.unwrap_or_default(), track_id: track_id__.unwrap_or_default(), segments: segments__.unwrap_or_default(), - language: language__.unwrap_or_default(), }) } } @@ -22676,6 +24235,9 @@ impl serde::Serialize for TranscriptionSegment { if self.r#final { len += 1; } + if !self.language.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)?; @@ -22694,6 +24256,9 @@ impl serde::Serialize for TranscriptionSegment { 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() } } @@ -22711,6 +24276,7 @@ impl<'de> serde::Deserialize<'de> for TranscriptionSegment { "end_time", "endTime", "final", + "language", ]; #[allow(clippy::enum_variant_names)] @@ -22720,6 +24286,7 @@ impl<'de> serde::Deserialize<'de> for TranscriptionSegment { StartTime, EndTime, Final, + Language, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -22747,6 +24314,7 @@ impl<'de> serde::Deserialize<'de> for TranscriptionSegment { "startTime" | "start_time" => Ok(GeneratedField::StartTime), "endTime" | "end_time" => Ok(GeneratedField::EndTime), "final" => Ok(GeneratedField::Final), + "language" => Ok(GeneratedField::Language), _ => Ok(GeneratedField::__SkipField__), } } @@ -22771,6 +24339,7 @@ impl<'de> serde::Deserialize<'de> for TranscriptionSegment { 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::Id => { @@ -22807,6 +24376,12 @@ impl<'de> serde::Deserialize<'de> for TranscriptionSegment { } 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::()?; } @@ -22818,6 +24393,7 @@ impl<'de> serde::Deserialize<'de> for TranscriptionSegment { 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(), }) } } @@ -22967,6 +24543,9 @@ impl serde::Serialize for UpdateIngressRequest { if self.bypass_transcoding.is_some() { len += 1; } + if self.enable_transcoding.is_some() { + len += 1; + } if self.audio.is_some() { len += 1; } @@ -22995,6 +24574,9 @@ impl serde::Serialize for UpdateIngressRequest { 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)?; } @@ -23024,6 +24606,8 @@ impl<'de> serde::Deserialize<'de> for UpdateIngressRequest { "participantMetadata", "bypass_transcoding", "bypassTranscoding", + "enable_transcoding", + "enableTranscoding", "audio", "video", ]; @@ -23037,6 +24621,7 @@ impl<'de> serde::Deserialize<'de> for UpdateIngressRequest { ParticipantName, ParticipantMetadata, BypassTranscoding, + EnableTranscoding, Audio, Video, __SkipField__, @@ -23068,6 +24653,7 @@ impl<'de> serde::Deserialize<'de> for UpdateIngressRequest { "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__), @@ -23096,6 +24682,7 @@ impl<'de> serde::Deserialize<'de> for UpdateIngressRequest { 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()? { @@ -23142,6 +24729,12 @@ impl<'de> serde::Deserialize<'de> for UpdateIngressRequest { } 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")); @@ -23167,6 +24760,7 @@ impl<'de> serde::Deserialize<'de> for UpdateIngressRequest { 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__, }) @@ -23553,6 +25147,9 @@ impl serde::Serialize for UpdateParticipantMetadata { if !self.name.is_empty() { len += 1; } + if !self.attributes.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)?; @@ -23560,6 +25157,9 @@ impl serde::Serialize for UpdateParticipantMetadata { 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() } } @@ -23572,12 +25172,14 @@ impl<'de> serde::Deserialize<'de> for UpdateParticipantMetadata { const FIELDS: &[&str] = &[ "metadata", "name", + "attributes", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { Metadata, Name, + Attributes, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -23602,6 +25204,7 @@ impl<'de> serde::Deserialize<'de> for UpdateParticipantMetadata { match value { "metadata" => Ok(GeneratedField::Metadata), "name" => Ok(GeneratedField::Name), + "attributes" => Ok(GeneratedField::Attributes), _ => Ok(GeneratedField::__SkipField__), } } @@ -23623,6 +25226,7 @@ impl<'de> serde::Deserialize<'de> for UpdateParticipantMetadata { { let mut metadata__ = None; let mut name__ = None; + let mut attributes__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Metadata => { @@ -23637,6 +25241,14 @@ impl<'de> serde::Deserialize<'de> for UpdateParticipantMetadata { } 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::()?; } @@ -23645,6 +25257,7 @@ impl<'de> serde::Deserialize<'de> for UpdateParticipantMetadata { Ok(UpdateParticipantMetadata { metadata: metadata__.unwrap_or_default(), name: name__.unwrap_or_default(), + attributes: attributes__.unwrap_or_default(), }) } } @@ -23674,6 +25287,9 @@ impl serde::Serialize for UpdateParticipantRequest { 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)?; @@ -23690,6 +25306,9 @@ impl serde::Serialize for UpdateParticipantRequest { 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() } } @@ -23705,6 +25324,7 @@ impl<'de> serde::Deserialize<'de> for UpdateParticipantRequest { "metadata", "permission", "name", + "attributes", ]; #[allow(clippy::enum_variant_names)] @@ -23714,6 +25334,7 @@ impl<'de> serde::Deserialize<'de> for UpdateParticipantRequest { Metadata, Permission, Name, + Attributes, __SkipField__, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -23741,6 +25362,7 @@ impl<'de> serde::Deserialize<'de> for UpdateParticipantRequest { "metadata" => Ok(GeneratedField::Metadata), "permission" => Ok(GeneratedField::Permission), "name" => Ok(GeneratedField::Name), + "attributes" => Ok(GeneratedField::Attributes), _ => Ok(GeneratedField::__SkipField__), } } @@ -23765,6 +25387,7 @@ impl<'de> serde::Deserialize<'de> for UpdateParticipantRequest { 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::Room => { @@ -23797,6 +25420,14 @@ impl<'de> serde::Deserialize<'de> for UpdateParticipantRequest { } 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::()?; } @@ -23808,6 +25439,7 @@ impl<'de> serde::Deserialize<'de> for UpdateParticipantRequest { metadata: metadata__.unwrap_or_default(), permission: permission__, name: name__.unwrap_or_default(), + attributes: attributes__.unwrap_or_default(), }) } } diff --git a/livekit/src/room/mod.rs b/livekit/src/room/mod.rs index 6fccde3b..0561e5d7 100644 --- a/livekit/src/room/mod.rs +++ b/livekit/src/room/mod.rs @@ -199,7 +199,6 @@ pub struct Transcription { pub participant_identity: String, pub track_id: String, pub segments: Vec, - pub language: String, } #[derive(Default, Debug, Clone)] @@ -209,6 +208,7 @@ pub struct TranscriptionSegment { pub start_time: u64, pub end_time: u64, pub r#final: bool, + pub language: String, } #[derive(Debug, Clone)] @@ -318,6 +318,7 @@ impl Room { pi.identity.into(), pi.name, pi.metadata, + pi.attributes, e2ee_manager.encryption_type(), ); @@ -435,6 +436,7 @@ impl Room { pi.identity.into(), pi.name, pi.metadata, + pi.attributes, ) }; participant.update_info(pi.clone()); @@ -653,6 +655,7 @@ impl RoomSession { pi.identity.into(), pi.name, pi.metadata, + pi.attributes, ) }; @@ -1034,6 +1037,7 @@ impl RoomSession { identity: ParticipantIdentity, name: String, metadata: String, + attributes: HashMap, ) -> RemoteParticipant { let participant = RemoteParticipant::new( self.rtc_engine.clone(), @@ -1041,6 +1045,7 @@ impl RoomSession { identity.clone(), name, metadata, + attributes, self.options.auto_subscribe, ); diff --git a/livekit/src/room/participant/local_participant.rs b/livekit/src/room/participant/local_participant.rs index 73730748..3e5dd980 100644 --- a/livekit/src/room/participant/local_participant.rs +++ b/livekit/src/room/participant/local_participant.rs @@ -65,10 +65,11 @@ impl LocalParticipant { identity: ParticipantIdentity, name: String, metadata: String, + attributes: HashMap, encryption_type: EncryptionType, ) -> Self { Self { - inner: super::new_inner(rtc_engine, sid, identity, name, metadata), + inner: super::new_inner(rtc_engine, sid, identity, name, metadata, attributes), local: Arc::new(LocalInfo { events: LocalEvents::default(), encryption_type }), } } @@ -226,7 +227,25 @@ impl LocalParticipant { self.inner .rtc_engine .send_request(proto::signal_request::Message::UpdateMetadata( - proto::UpdateParticipantMetadata { metadata, name: self.name() }, + proto::UpdateParticipantMetadata { + metadata, + name: self.name(), + attributes: Default::default(), + }, + )) + .await; + Ok(()) + } + + pub async fn update_attributes(&self, attributes: HashMap) -> RoomResult<()> { + self.inner + .rtc_engine + .send_request(proto::signal_request::Message::UpdateMetadata( + proto::UpdateParticipantMetadata { + attributes, + metadata: self.metadata(), + name: self.name(), + }, )) .await; Ok(()) @@ -236,7 +255,11 @@ impl LocalParticipant { self.inner .rtc_engine .send_request(proto::signal_request::Message::UpdateMetadata( - proto::UpdateParticipantMetadata { metadata: self.metadata(), name }, + proto::UpdateParticipantMetadata { + name, + metadata: self.metadata(), + attributes: Default::default(), + }, )) .await; Ok(()) @@ -302,14 +325,14 @@ impl LocalParticipant { end_time: segment.end_time, text: segment.text, r#final: segment.r#final, + language: segment.language, }), ) .collect(); let transcription_packet = proto::Transcription { - participant_identity: packet.participant_identity, + transcribed_participant_identity: packet.participant_identity, segments: segments, track_id: packet.track_id, - language: packet.language, }; let data = proto::DataPacket { value: Some(proto::data_packet::Value::Transcription(transcription_packet)), @@ -348,6 +371,10 @@ impl LocalParticipant { self.inner.info.read().metadata.clone() } + pub fn attributes(&self) -> HashMap { + self.inner.info.read().attributes.clone() + } + pub fn is_speaking(&self) -> bool { self.inner.info.read().speaking } diff --git a/livekit/src/room/participant/mod.rs b/livekit/src/room/participant/mod.rs index 0e3ea93d..eeb3297c 100644 --- a/livekit/src/room/participant/mod.rs +++ b/livekit/src/room/participant/mod.rs @@ -74,6 +74,7 @@ struct ParticipantInfo { pub identity: ParticipantIdentity, pub name: String, pub metadata: String, + pub attributes: HashMap, pub speaking: bool, pub audio_level: f32, pub connection_quality: ConnectionQuality, @@ -82,6 +83,8 @@ struct ParticipantInfo { type TrackMutedHandler = Box; type TrackUnmutedHandler = Box; type MetadataChangedHandler = Box; +type AttributesChangedHandler = + Box, HashMap) + Send>; type NameChangedHandler = Box; #[derive(Default)] @@ -89,6 +92,7 @@ struct ParticipantEvents { track_muted: Mutex>, track_unmuted: Mutex>, metadata_changed: Mutex>, + attributes_changed: Mutex>, name_changed: Mutex>, } @@ -105,6 +109,7 @@ pub(super) fn new_inner( identity: ParticipantIdentity, name: String, metadata: String, + attributes: HashMap, ) -> Arc { Arc::new(ParticipantInner { rtc_engine, @@ -113,6 +118,7 @@ pub(super) fn new_inner( identity, name, metadata, + attributes, speaking: false, audio_level: 0.0, connection_quality: ConnectionQuality::Excellent, @@ -144,6 +150,20 @@ pub(super) fn update_info( cb(participant.clone(), old_metadata, new_info.metadata); } } + + if new_info.attributes.len() != 0 { + let old_attributes = info.attributes.clone(); + for (key, value) in new_info.attributes { + if value.is_empty() { + info.attributes.remove(&key); + } else { + info.attributes.insert(key, value); + } + } + if let Some(cb) = inner.events.attributes_changed.lock().as_ref() { + cb(participant.clone(), old_attributes, info.attributes.clone()); + } + } } pub(super) fn set_speaking( diff --git a/livekit/src/room/participant/remote_participant.rs b/livekit/src/room/participant/remote_participant.rs index 12277ac3..2f6c09c6 100644 --- a/livekit/src/room/participant/remote_participant.rs +++ b/livekit/src/room/participant/remote_participant.rs @@ -74,10 +74,11 @@ impl RemoteParticipant { identity: ParticipantIdentity, name: String, metadata: String, + attributes: HashMap, auto_subscribe: bool, ) -> Self { Self { - inner: super::new_inner(rtc_engine, sid, identity, name, metadata), + inner: super::new_inner(rtc_engine, sid, identity, name, metadata, attributes), remote: Arc::new(RemoteInfo { events: Default::default(), auto_subscribe }), } }