finance_query/adapters/polygon/
corporate_events.rs1use serde::{Deserialize, Serialize};
4
5use crate::error::Result;
6
7use super::build_client;
8use super::models::PaginatedResponse;
9
10#[derive(Debug, Clone, Serialize, Deserialize)]
12#[non_exhaustive]
13pub struct CorporateEvent {
14 pub ticker: Option<String>,
16 pub event_type: Option<String>,
18 pub name: Option<String>,
20 pub date: Option<String>,
22 pub status: Option<String>,
24 #[serde(flatten)]
26 pub details: std::collections::HashMap<String, serde_json::Value>,
27}
28
29pub async fn corporate_events(
31 params: &[(&str, &str)],
32) -> Result<PaginatedResponse<CorporateEvent>> {
33 let client = build_client()?;
34 client.get("/v1/reference/corporate-events", params).await
35}