nvd_api/v2/mod.rs
1//! nvd-api v2
2use serde::{Deserialize, Serialize};
3
4pub mod api;
5pub mod products;
6pub mod vulnerabilities;
7/// pagination
8#[derive(Debug, Default, Serialize, Deserialize, PartialEq, Clone, Eq)]
9#[serde(rename_all = "camelCase")]
10pub struct LimitOffset {
11 pub results_per_page: Option<u64>,
12 pub start_index: Option<u64>,
13}
14/// If the value of keywordSearch is a phrase, i.e., contains more than one term, including keywordExactMatch returns only the CVEs matching the phrase exactly. Otherwise, the results will contain records having any of the terms. If filtering by keywordExactMatch, keywordSearch is required. Please note, this parameter is provided without a parameter value.
15/// Please note, empty spaces in the URL should be encoded in the request as "%20". The user agent may handle this encoding automatically. Multiple {keywords} function like an 'AND' statement. This returns results where all keywords exist somewhere in the current description, though not necessarily together. Keyword search operates as though a wildcard is placed after each keyword provided. For example, providing "circle" will return results such as "circles" but not "encircle".
16///
17#[derive(Debug, Default, Serialize, Deserialize, PartialEq, Clone, Eq)]
18#[serde(rename_all = "camelCase")]
19pub struct Keyword {
20 /// By default, keywordSearch returns any CVE where a word or phrase is found in the current description.
21 pub keyword_exact_match: bool,
22 /// This parameter returns only the CVEs where a word or phrase is found in the current description. Descriptions associated with CVE are maintained by the CVE Assignment Team through coordination with CVE Numbering Authorities (CNAs). The NVD has no control over CVE descriptions.
23 pub keyword_search: String,
24}
25/// Values must be entered in the extended ISO-8601 date/time format:
26/// If filtering by the last modified date, both lastModStartDate and lastModEndDate are required. The maximum allowable range when using any date range parameters is 120 consecutive days.
27#[derive(Debug, Default, Serialize, Deserialize, PartialEq, Clone, Eq)]
28#[serde(rename_all = "camelCase")]
29pub struct LastModDate {
30 /// lastModStartDate
31 pub last_mod_start_date: String,
32 /// lastModEndDate
33 pub last_mod_end_date: String,
34}