roark_rs/models/call_analysis_create_request.rs
1/*
2 * Roark Analytics API
3 *
4 * # Roark Analytics API - Voice AI Analytics Platform The Roark Analytics API provides comprehensive monitoring, evaluation, and analytics capabilities for voice AI agents. This API allows developers to seamlessly integrate with the Roark platform to track call quality, analyze agent performance, and extract insights from voice interactions. ## Key Features - **Real-time Call Analysis**: Upload and analyze voice call recordings with AI-powered insights - **Sentiment Analysis**: Extract emotional tone, key phrases, and sentiment scores across 64+ emotions - **Agent Performance Evaluation**: Create custom evaluation jobs with configurable metrics and scoring - **Platform Integrations**: Native support for VAPI and Retell AI with webhook-based data ingestion - **Custom Analytics**: Build custom analytics pipelines with flexible data models and properties ## Authentication All API endpoints require Bearer token authentication. Include your API token in the Authorization header: ``` Authorization: Bearer YOUR_API_TOKEN ``` ## Rate Limiting The API implements rate limiting to ensure service stability. Rate limit headers are included in responses. ## Error Handling The API uses standard HTTP status codes and returns structured error responses with detailed error information including error types, codes, and human-readable messages. ## Rust Code Generation This OpenAPI specification has been optimized for Rust code generation with: - Snake_case field naming conventions - Proper nullable field handling with Option<T> - Comprehensive documentation for generated code - Type-safe enum definitions - Structured error handling
5 *
6 * The version of the OpenAPI document: 1.0.0
7 * Contact: support@roark.ai
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// CallAnalysisCreateRequest : Request payload for creating a new call analysis job
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CallAnalysisCreateRequest {
17 /// Publicly accessible URL of the call recording file (WAV or MP3 format). Can be a signed URL with appropriate expiration.
18 #[serde(rename = "recording_url")]
19 pub recording_url: String,
20 /// Optional URL of stereo recording in WAV format for enhanced audio analysis and playback experience
21 #[serde(rename = "stereo_recording_url", skip_serializing_if = "Option::is_none")]
22 pub stereo_recording_url: Option<String>,
23 /// ISO 8601 timestamp when the call started
24 #[serde(rename = "started_at")]
25 pub started_at: String,
26 #[serde(rename = "interface_type")]
27 pub interface_type: models::InterfaceType,
28 #[serde(rename = "call_direction")]
29 pub call_direction: models::CallDirection,
30 /// Exactly two participants: one agent and one customer
31 #[serde(rename = "participants")]
32 pub participants: Vec<models::CallParticipant>,
33 #[serde(rename = "ended_status", skip_serializing_if = "Option::is_none")]
34 pub ended_status: Option<models::CallEndedStatus>,
35 /// Additional context about why the call ended
36 #[serde(rename = "ended_reason", skip_serializing_if = "Option::is_none")]
37 pub ended_reason: Option<String>,
38 /// List of tools/functions invoked during the call
39 #[serde(rename = "tool_invocations", skip_serializing_if = "Option::is_none")]
40 pub tool_invocations: Option<Vec<models::ToolInvocation>>,
41 /// Mark this as a test call for development/QA purposes
42 #[serde(rename = "is_test", skip_serializing_if = "Option::is_none")]
43 pub is_test: Option<bool>,
44 /// Original VAPI call ID if importing from VAPI platform
45 #[serde(rename = "vapi_call_id", skip_serializing_if = "Option::is_none")]
46 pub vapi_call_id: Option<uuid::Uuid>,
47 /// Original Retell call ID if importing from Retell platform
48 #[serde(rename = "retell_call_id", skip_serializing_if = "Option::is_none")]
49 pub retell_call_id: Option<String>,
50 /// Custom metadata properties for filtering and categorization
51 #[serde(rename = "properties", skip_serializing_if = "Option::is_none")]
52 pub properties: Option<std::collections::HashMap<String, serde_json::Value>>,
53}
54
55impl CallAnalysisCreateRequest {
56 /// Request payload for creating a new call analysis job
57 pub fn new(recording_url: String, started_at: String, interface_type: models::InterfaceType, call_direction: models::CallDirection, participants: Vec<models::CallParticipant>) -> CallAnalysisCreateRequest {
58 CallAnalysisCreateRequest {
59 recording_url,
60 stereo_recording_url: None,
61 started_at,
62 interface_type,
63 call_direction,
64 participants,
65 ended_status: None,
66 ended_reason: None,
67 tool_invocations: None,
68 is_test: None,
69 vapi_call_id: None,
70 retell_call_id: None,
71 properties: None,
72 }
73 }
74}
75