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 DomainDdosAttackSource {
    /// The type of attack. One of `Amplification`, `Botnet`, `Other`
    #[serde(rename = "attack_type")]
    pub attack_type: String,
    /// The confidence level. One of `Low`, `Medium`, `High`
    #[serde(rename = "confidence")]
    pub confidence: String,
    /// The duration of the attack in seconds
    #[serde(rename = "duration")]
    pub duration: i64,
    /// The hash over target and date
    #[serde(rename = "key")]
    pub key: String,
    /// The network protocol used. One of `TCP`, `UDP`, `ICMP`, `Other`
    #[serde(rename = "network_protocol")]
    pub network_protocol: String,
    /// The protocols used in the attack
    #[serde(rename = "protocols")]
    pub protocols: Vec<String>,
    /// The number of requests against the target
    #[serde(rename = "requests")]
    pub requests: i64,
    /// The ISO-8601 date for the attack start time
    #[serde(rename = "start_time")]
    pub start_time: String,
    /// The target's IPv4/6 address or hostname
    #[serde(rename = "target")]
    pub target: String,
    #[serde(rename = "target_details")]
    pub target_details: Box<models::DomainDdosTargetDetails>,
    /// The target's domain
    #[serde(rename = "target_domain")]
    pub target_domain: String,
    /// The target's IPv4/6 address
    #[serde(rename = "target_ip")]
    pub target_ip: String,
    /// List of ports where the attack took place
    #[serde(rename = "target_ports")]
    pub target_ports: Vec<i32>,
}

impl DomainDdosAttackSource {
    pub fn new(
        attack_type: String,
        confidence: String,
        duration: i64,
        key: String,
        network_protocol: String,
        protocols: Vec<String>,
        requests: i64,
        start_time: String,
        target: String,
        target_details: models::DomainDdosTargetDetails,
        target_domain: String,
        target_ip: String,
        target_ports: Vec<i32>,
    ) -> DomainDdosAttackSource {
        DomainDdosAttackSource {
            attack_type,
            confidence,
            duration,
            key,
            network_protocol,
            protocols,
            requests,
            start_time,
            target,
            target_details: Box::new(target_details),
            target_domain,
            target_ip,
            target_ports,
        }
    }
}