Skip to main content

finance_query/models/edgar/
filing_index.rs

1//! EDGAR filing index models.
2//!
3//! Models for the filing directory index at:
4//! `https://data.sec.gov/Archives/edgar/data/{cik}/{accession}/index.json`.
5
6use serde::{Deserialize, Serialize};
7
8/// Filing index response for a specific EDGAR accession.
9#[derive(Debug, Clone, Serialize, Deserialize)]
10#[non_exhaustive]
11pub struct EdgarFilingIndex {
12    /// Directory listing metadata.
13    #[serde(default)]
14    pub directory: EdgarFilingIndexDirectory,
15}
16
17/// Directory metadata for an EDGAR filing.
18#[derive(Debug, Clone, Serialize, Deserialize, Default)]
19#[non_exhaustive]
20pub struct EdgarFilingIndexDirectory {
21    /// Listing of files for the filing.
22    #[serde(default)]
23    pub item: Vec<EdgarFilingIndexItem>,
24}
25
26/// Single file entry within an EDGAR filing index.
27#[derive(Debug, Clone, Serialize, Deserialize)]
28#[non_exhaustive]
29pub struct EdgarFilingIndexItem {
30    /// File name (e.g., "aapl-20240928.htm").
31    pub name: String,
32
33    /// File type (often the form type like "10-K").
34    #[serde(default, rename = "type")]
35    pub item_type: String,
36
37    /// File size in bytes.
38    #[serde(default)]
39    pub size: u64,
40}