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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
* 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};
/// Database : One database FAMILY, with your organization's license beside it. A license covers the family, while a download names a specific version, so the IDs passed to `download` and `checksum` come from `versions`.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Database {
/// The family, e.g. `vpn_ip`. What a license is held against.
#[serde(rename = "base")]
pub base: String,
#[serde(rename = "name")]
pub name: String,
/// One line on what the newest version contains.
#[serde(rename = "summary")]
pub summary: String,
#[serde(rename = "standing")]
pub standing: models::Standing,
/// An Open database: free under CC BY-SA 4.0 (credit InternetData, https://internetdata.io, and share what you build from it under the same license). Every organization holds a `standard` license to it from the start, which `standing` and `license_type` report like any other.
#[serde(rename = "open")]
pub open: bool,
/// What your license permits you to do with the data. Null when there is no license, which is every family with standing `unlicensed`.
#[serde(rename = "license_type", deserialize_with = "Option::deserialize")]
pub license_type: Option<LicenseType>,
#[serde(rename = "starts", deserialize_with = "crate::dates::option_date_time")]
pub starts: Option<chrono::DateTime<chrono::FixedOffset>>,
/// A hard stop. Null when the license has no end date, which is the normal case for a rolling agreement, and when there is no license. A rolling license reports its turnover date in renews_at instead.
#[serde(rename = "expires", deserialize_with = "crate::dates::option_date_time")]
pub expires: Option<chrono::DateTime<chrono::FixedOffset>>,
/// When a rolling license next renews. Null when the license has no defined term, when expires sets a hard stop instead, and when there is no license.
#[serde(rename = "renews_at", deserialize_with = "crate::dates::option_date_time")]
pub renews_at: Option<chrono::DateTime<chrono::FixedOffset>>,
/// The last day notice of non-renewal can be given for the term ending at renews_at. Null whenever renews_at is, and when the agreement records no notice period.
#[serde(rename = "notice_due_at", deserialize_with = "crate::dates::option_date_time")]
pub notice_due_at: Option<chrono::DateTime<chrono::FixedOffset>>,
/// Every published version of this family, oldest first. Old versions are frozen rather than migrated, so both stay downloadable.
#[serde(rename = "versions")]
pub versions: Vec<models::DatabaseVersion>,
}
impl Database {
/// One database FAMILY, with your organization's license beside it. A license covers the family, while a download names a specific version, so the IDs passed to `download` and `checksum` come from `versions`.
pub fn new(
base: String,
name: String,
summary: String,
standing: models::Standing,
open: bool,
license_type: Option<LicenseType>,
starts: Option<chrono::DateTime<chrono::FixedOffset>>,
expires: Option<chrono::DateTime<chrono::FixedOffset>>,
renews_at: Option<chrono::DateTime<chrono::FixedOffset>>,
notice_due_at: Option<chrono::DateTime<chrono::FixedOffset>>,
versions: Vec<models::DatabaseVersion>,
) -> Database {
Database {
base,
name,
summary,
standing,
open,
license_type,
starts,
expires,
renews_at,
notice_due_at,
versions,
}
}
}
/// What your license permits you to do with the data. Null when there is no license, which is every family with standing `unlicensed`.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum LicenseType {
#[serde(rename = "evaluation")]
Evaluation,
#[serde(rename = "standard")]
Standard,
#[serde(rename = "redistribute")]
Redistribute,
}
impl Default for LicenseType {
fn default() -> LicenseType {
Self::Evaluation
}
}