1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
* InternetData API
*
* The InternetData API: look up what every database InternetData publishes says about an IP address, an AS or a domain, download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
*
* The version of the OpenAPI document: 2026.11.15
* Contact: support@internetdata.io
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// DatabaseMetadata : The build document written by the exporter, served through unchanged.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DatabaseMetadata {
#[serde(rename = "id")]
pub id: String,
/// How often a new build is published.
#[serde(rename = "update_freq", skip_serializing_if = "Option::is_none")]
pub update_freq: Option<String>,
/// ISO-8601 date (YYYY-MM-DD) the published build was generated on.
#[serde(rename = "updated", deserialize_with = "crate::dates::date")]
pub updated: chrono::NaiveDate,
/// Row count in the current build.
#[serde(rename = "entries")]
pub entries: i64,
/// Columns, keyed by format.
#[serde(rename = "schema")]
pub schema: std::collections::HashMap<String, Vec<models::DatabaseMetadataColumn>>,
/// A few real rows, keyed by format.
#[serde(
rename = "sample",
skip_serializing_if = "Option::is_none",
default,
deserialize_with = "crate::objects::option_object_lists"
)]
pub sample: Option<std::collections::HashMap<String, Vec<serde_json::Value>>>,
/// Bytes per format.
#[serde(rename = "size")]
pub size: std::collections::HashMap<String, i64>,
/// Bytes per format of the evaluation sample, where one is published.
#[serde(rename = "sample_size", skip_serializing_if = "Option::is_none")]
pub sample_size: Option<std::collections::HashMap<String, i64>>,
/// Row count in the evaluation sample.
#[serde(rename = "sample_entries", skip_serializing_if = "Option::is_none")]
pub sample_entries: Option<i32>,
}
impl DatabaseMetadata {
/// The build document written by the exporter, served through unchanged.
pub fn new(
id: String,
updated: chrono::NaiveDate,
entries: i64,
schema: std::collections::HashMap<String, Vec<models::DatabaseMetadataColumn>>,
size: std::collections::HashMap<String, i64>,
) -> DatabaseMetadata {
DatabaseMetadata {
id,
update_freq: None,
updated,
entries,
schema,
sample: None,
size,
sample_size: None,
sample_entries: None,
}
}
}