pub struct ConnectorClient { /* private fields */ }Implementations§
Source§impl ConnectorClient
impl ConnectorClient
Sourcepub fn with_api_key(host: &str, api_key: &str, api_secret: &str) -> Self
pub fn with_api_key(host: &str, api_key: &str, api_secret: &str) -> Self
Authenticates with an API key and secret, signing a short-lived token per request.
Sourcepub fn with_token(host: &str, token: &str) -> Self
pub fn with_token(host: &str, token: &str) -> Self
Authenticates with a pre-signed token, sent verbatim on every request.
Sourcepub fn new(host: &str) -> ServiceResult<Self>
pub fn new(host: &str) -> ServiceResult<Self>
Reads the API key and secret from the LIVEKIT_API_KEY and
LIVEKIT_API_SECRET environment variables.
Sourcepub fn with_failover(self, enabled: bool) -> Self
pub fn with_failover(self, enabled: bool) -> Self
Enables or disables region failover (enabled by default). Failover only engages for LiveKit Cloud hosts.
Sourcepub fn with_request_timeout(self, timeout: Duration) -> Self
pub fn with_request_timeout(self, timeout: Duration) -> Self
Overrides the default per-request timeout (10s) for calls on this client.
Sourcepub async fn dial_whatsapp_call(
&self,
phone_number_id: impl Into<String>,
to_phone_number: impl Into<String>,
api_key: impl Into<String>,
cloud_api_version: impl Into<String>,
options: DialWhatsAppCallOptions,
) -> ServiceResult<DialWhatsAppCallResponse>
pub async fn dial_whatsapp_call( &self, phone_number_id: impl Into<String>, to_phone_number: impl Into<String>, api_key: impl Into<String>, cloud_api_version: impl Into<String>, options: DialWhatsAppCallOptions, ) -> ServiceResult<DialWhatsAppCallResponse>
Dials a WhatsApp call
§Arguments
phone_number_id- The identifier of the number for business initiating the callto_phone_number- The number of the user that should receive the callapi_key- The API key of the business initiating the callcloud_api_version- WhatsApp Cloud API version (e.g., “23.0”, “24.0”)options- Additional options for the call
§Returns
Information about the dialed call including the WhatsApp call ID and room name
Sourcepub async fn disconnect_whatsapp_call(
&self,
call_id: impl Into<String>,
api_key: impl Into<String>,
) -> ServiceResult<DisconnectWhatsAppCallResponse>
pub async fn disconnect_whatsapp_call( &self, call_id: impl Into<String>, api_key: impl Into<String>, ) -> ServiceResult<DisconnectWhatsAppCallResponse>
Disconnects a WhatsApp call initiated by the business.
This is the BusinessInitiated case; use disconnect_whatsapp_call_with_reason
to disconnect with a different DisconnectReason.
§Arguments
call_id- Call ID sent by Metaapi_key- The API key of the business disconnecting the call
§Returns
Empty response on success
Sourcepub async fn disconnect_whatsapp_call_with_reason(
&self,
call_id: impl Into<String>,
api_key: impl Into<String>,
reason: DisconnectReason,
) -> ServiceResult<DisconnectWhatsAppCallResponse>
pub async fn disconnect_whatsapp_call_with_reason( &self, call_id: impl Into<String>, api_key: impl Into<String>, reason: DisconnectReason, ) -> ServiceResult<DisconnectWhatsAppCallResponse>
Disconnects a WhatsApp call, specifying why it is being disconnected.
§Arguments
call_id- Call ID sent by Metaapi_key- The API key of the business disconnecting the call. Required whenreasonisBusinessInitiated; optional forUserInitiated.reason- Why the call is being disconnected
§Returns
Empty response on success
Sourcepub async fn connect_whatsapp_call(
&self,
call_id: impl Into<String>,
sdp: SessionDescription,
) -> ServiceResult<ConnectWhatsAppCallResponse>
pub async fn connect_whatsapp_call( &self, call_id: impl Into<String>, sdp: SessionDescription, ) -> ServiceResult<ConnectWhatsAppCallResponse>
Sourcepub async fn accept_whatsapp_call(
&self,
phone_number_id: impl Into<String>,
api_key: impl Into<String>,
cloud_api_version: impl Into<String>,
call_id: impl Into<String>,
sdp: SessionDescription,
options: AcceptWhatsAppCallOptions,
) -> ServiceResult<AcceptWhatsAppCallResponse>
pub async fn accept_whatsapp_call( &self, phone_number_id: impl Into<String>, api_key: impl Into<String>, cloud_api_version: impl Into<String>, call_id: impl Into<String>, sdp: SessionDescription, options: AcceptWhatsAppCallOptions, ) -> ServiceResult<AcceptWhatsAppCallResponse>
Accepts an incoming WhatsApp call
§Arguments
phone_number_id- The identifier of the number for business initiating the callapi_key- The API key of the business connecting the callcloud_api_version- WhatsApp Cloud API version (e.g., “23.0”, “24.0”)call_id- Call ID sent by Metasdp- The SDP from Meta (for user-initiated call)options- Additional options for the call
§Returns
Information about the accepted call including the room name