roark-rs 0.0.2

# Roark Analytics API - Voice AI Analytics Platform
Documentation
/*
 * Roark Analytics API
 *
 * # 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
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: support@roark.ai
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// CallAnalysisCreateRequest : Request payload for creating a new call analysis job
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CallAnalysisCreateRequest {
    /// Publicly accessible URL of the call recording file (WAV or MP3 format). Can be a signed URL with appropriate expiration.
    #[serde(rename = "recording_url")]
    pub recording_url: String,
    /// Optional URL of stereo recording in WAV format for enhanced audio analysis and playback experience
    #[serde(rename = "stereo_recording_url", skip_serializing_if = "Option::is_none")]
    pub stereo_recording_url: Option<String>,
    /// ISO 8601 timestamp when the call started
    #[serde(rename = "started_at")]
    pub started_at: String,
    #[serde(rename = "interface_type")]
    pub interface_type: models::InterfaceType,
    #[serde(rename = "call_direction")]
    pub call_direction: models::CallDirection,
    /// Exactly two participants: one agent and one customer
    #[serde(rename = "participants")]
    pub participants: Vec<models::CallParticipant>,
    #[serde(rename = "ended_status", skip_serializing_if = "Option::is_none")]
    pub ended_status: Option<models::CallEndedStatus>,
    /// Additional context about why the call ended
    #[serde(rename = "ended_reason", skip_serializing_if = "Option::is_none")]
    pub ended_reason: Option<String>,
    /// List of tools/functions invoked during the call
    #[serde(rename = "tool_invocations", skip_serializing_if = "Option::is_none")]
    pub tool_invocations: Option<Vec<models::ToolInvocation>>,
    /// Mark this as a test call for development/QA purposes
    #[serde(rename = "is_test", skip_serializing_if = "Option::is_none")]
    pub is_test: Option<bool>,
    /// Original VAPI call ID if importing from VAPI platform
    #[serde(rename = "vapi_call_id", skip_serializing_if = "Option::is_none")]
    pub vapi_call_id: Option<uuid::Uuid>,
    /// Original Retell call ID if importing from Retell platform
    #[serde(rename = "retell_call_id", skip_serializing_if = "Option::is_none")]
    pub retell_call_id: Option<String>,
    /// Custom metadata properties for filtering and categorization
    #[serde(rename = "properties", skip_serializing_if = "Option::is_none")]
    pub properties: Option<std::collections::HashMap<String, serde_json::Value>>,
}

impl CallAnalysisCreateRequest {
    /// Request payload for creating a new call analysis job
    pub fn new(recording_url: String, started_at: String, interface_type: models::InterfaceType, call_direction: models::CallDirection, participants: Vec<models::CallParticipant>) -> CallAnalysisCreateRequest {
        CallAnalysisCreateRequest {
            recording_url,
            stereo_recording_url: None,
            started_at,
            interface_type,
            call_direction,
            participants,
            ended_status: None,
            ended_reason: None,
            tool_invocations: None,
            is_test: None,
            vapi_call_id: None,
            retell_call_id: None,
            properties: None,
        }
    }
}