rusty_falcon 0.7.1

Rust bindings for CrowdStrike Falcon API
Documentation
/*
 * CrowdStrike API Specification
 *
 * Use this API specification as a reference for the API endpoints you can use to interact with your Falcon environment. These endpoints support authentication via OAuth2 and interact with detections and network containment. For detailed usage guides and examples, see our [documentation inside the Falcon console](https://falcon.crowdstrike.com/support/documentation).     To use the APIs described below, combine the base URL with the path shown for each API endpoint. For commercial cloud customers, your base URL is `https://api.crowdstrike.com`.    Each API endpoint requires authorization via an OAuth2 token. Your first API request should retrieve an OAuth2 token using the `oauth2/token` endpoint, such as `https://api.crowdstrike.com/oauth2/token`. For subsequent requests, include the OAuth2 token in an HTTP authorization header. Tokens expire after 30 minutes, after which you should make a new token request to continue making API requests.
 *
 * The version of the OpenAPI document: rolling
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DomainCve {
    #[serde(rename = "actors")]
    pub actors: Vec<String>,
    #[serde(rename = "additional_info", skip_serializing_if = "Option::is_none")]
    pub additional_info: Option<String>,
    #[serde(rename = "base_score")]
    pub base_score: f64,
    #[serde(rename = "cisa_kev_info")]
    pub cisa_kev_info: Box<models::DomainCisaKnownExploitedVulnerabilitiesInfo>,
    #[serde(rename = "content_packages", skip_serializing_if = "Option::is_none")]
    pub content_packages: Option<Vec<models::DomainContentPackage>>,
    #[serde(rename = "cps_rating")]
    pub cps_rating: Box<models::DomainCpsRating>,
    #[serde(rename = "cvss_v2_score", skip_serializing_if = "Option::is_none")]
    pub cvss_v2_score: Option<Box<models::DomainCvssv2>>,
    #[serde(rename = "cvss_v3_score", skip_serializing_if = "Option::is_none")]
    pub cvss_v3_score: Option<Box<models::DomainCvssv3>>,
    #[serde(rename = "cvss_version")]
    pub cvss_version: String,
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[serde(
        rename = "exploitability_score",
        skip_serializing_if = "Option::is_none"
    )]
    pub exploitability_score: Option<f64>,
    #[serde(rename = "exploited", skip_serializing_if = "Option::is_none")]
    pub exploited: Option<Box<models::DomainCveExploit>>,
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "impact_score", skip_serializing_if = "Option::is_none")]
    pub impact_score: Option<f64>,
    #[serde(rename = "is_supported")]
    pub is_supported: bool,
    #[serde(rename = "metadata_hash")]
    pub metadata_hash: i32,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "published_date")]
    pub published_date: String,
    #[serde(rename = "references")]
    pub references: Vec<models::DomainReference>,
    #[serde(rename = "severity")]
    pub severity: String,
    #[serde(rename = "source")]
    pub source: String,
    #[serde(rename = "source_type")]
    pub source_type: String,
    #[serde(rename = "spotlight_published_date")]
    pub spotlight_published_date: String,
    #[serde(rename = "types")]
    pub types: Vec<String>,
    #[serde(rename = "vector")]
    pub vector: String,
}

impl DomainCve {
    pub fn new(
        actors: Vec<String>,
        base_score: f64,
        cisa_kev_info: models::DomainCisaKnownExploitedVulnerabilitiesInfo,
        cps_rating: models::DomainCpsRating,
        cvss_version: String,
        id: String,
        is_supported: bool,
        metadata_hash: i32,
        name: String,
        published_date: String,
        references: Vec<models::DomainReference>,
        severity: String,
        source: String,
        source_type: String,
        spotlight_published_date: String,
        types: Vec<String>,
        vector: String,
    ) -> DomainCve {
        DomainCve {
            actors,
            additional_info: None,
            base_score,
            cisa_kev_info: Box::new(cisa_kev_info),
            content_packages: None,
            cps_rating: Box::new(cps_rating),
            cvss_v2_score: None,
            cvss_v3_score: None,
            cvss_version,
            description: None,
            exploitability_score: None,
            exploited: None,
            id,
            impact_score: None,
            is_supported,
            metadata_hash,
            name,
            published_date,
            references,
            severity,
            source,
            source_type,
            spotlight_published_date,
            types,
            vector,
        }
    }
}