pub struct Internal { /* private fields */ }Expand description
Internal resource for SDK operations
This resource provides access to internal SDK functionality, including realtime credentials for WebSocket connections.
Implementations§
Source§impl Internal
impl Internal
Sourcepub fn new(client: Arc<ComposioClient>) -> Self
pub fn new(client: Arc<ComposioClient>) -> Self
Create a new Internal resource
Sourcepub fn with_telemetry_context(
client: Arc<ComposioClient>,
telemetry_context: TelemetryContext,
) -> Self
pub fn with_telemetry_context( client: Arc<ComposioClient>, telemetry_context: TelemetryContext, ) -> Self
Create a new Internal resource with custom telemetry context
Sourcepub async fn get_sdk_realtime_credentials(
&self,
) -> Result<SDKRealtimeCredentialsResponse, ComposioError>
pub async fn get_sdk_realtime_credentials( &self, ) -> Result<SDKRealtimeCredentialsResponse, ComposioError>
Get SDK realtime credentials
Retrieves credentials for establishing realtime WebSocket connections using Pusher. These credentials are used for receiving real-time events and updates from the Composio platform.
§Returns
Returns SDKRealtimeCredentialsResponse containing:
pusher_key: The Pusher API key for authenticationproject_id: The project identifierpusher_cluster: The Pusher cluster region (e.g., “us2”, “eu”)
§Errors
Returns ComposioError if:
- The API request fails
- Authentication is invalid
- The response cannot be deserialized
§Example
use composio_sdk::client::ComposioClient;
use composio_sdk::config::ComposioConfig;
use composio_sdk::models::internal::Internal;
use std::sync::Arc;
let config = ComposioConfig {
api_key: "your-api-key".to_string(),
..Default::default()
};
let client = Arc::new(ComposioClient::from_config(config)?);
let internal = Internal::new(client);
let credentials = internal.get_sdk_realtime_credentials().await?;
println!("Pusher Key: {}", credentials.pusher_key);
println!("Project ID: {}", credentials.project_id);
println!("Cluster: {}", credentials.pusher_cluster);Trait Implementations§
Source§impl Resource for Internal
impl Resource for Internal
Source§fn client(&self) -> &ComposioClient
fn client(&self) -> &ComposioClient
Get the client reference
Source§fn telemetry_context(&self) -> &TelemetryContext
fn telemetry_context(&self) -> &TelemetryContext
Get telemetry context
Source§fn sanitize_payload<T>(&self, payload: T) -> Twhere
T: Serialize + DeserializeOwned,
fn sanitize_payload<T>(&self, payload: T) -> Twhere
T: Serialize + DeserializeOwned,
Sanitize payload by removing sensitive information Read more
Source§fn create_method_event(
&self,
function_name: &str,
provider: Option<&str>,
) -> Option<TelemetryData>
fn create_method_event( &self, function_name: &str, provider: Option<&str>, ) -> Option<TelemetryData>
Create a telemetry event for a method call Read more
Source§fn push_telemetry_event(&self, event: Event)
fn push_telemetry_event(&self, event: Event)
Push a telemetry event
Auto Trait Implementations§
impl Freeze for Internal
impl !RefUnwindSafe for Internal
impl Send for Internal
impl Sync for Internal
impl Unpin for Internal
impl UnsafeUnpin for Internal
impl !UnwindSafe for Internal
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more