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 DomainBreachedItemV1 {
    #[serde(rename = "bot", skip_serializing_if = "Option::is_none")]
    pub bot: Option<Box<models::DomainExposedDataRecordBotV1>>,
    /// The company of the user
    #[serde(rename = "company", skip_serializing_if = "Option::is_none")]
    pub company: Option<String>,
    /// The status set after deduplication. Possible values: 'newly_detected', 'previously_reported', 'other'
    #[serde(rename = "credential_status", skip_serializing_if = "Option::is_none")]
    pub credential_status: Option<String>,
    /// The domain where the credentials are valid
    #[serde(rename = "credentials_domain", skip_serializing_if = "Option::is_none")]
    pub credentials_domain: Option<String>,
    /// The IP where the credentials are valid
    #[serde(rename = "credentials_ip", skip_serializing_if = "Option::is_none")]
    pub credentials_ip: Option<String>,
    /// The URL where the credentials are valid
    #[serde(rename = "credentials_url", skip_serializing_if = "Option::is_none")]
    pub credentials_url: Option<String>,
    /// The nickname of the user on the impacted site
    #[serde(rename = "display_name", skip_serializing_if = "Option::is_none")]
    pub display_name: Option<String>,
    /// The domain associated with the breached account.
    #[serde(rename = "domain")]
    pub domain: String,
    /// The email of the breached account.
    #[serde(rename = "email")]
    pub email: String,
    #[serde(rename = "financial", skip_serializing_if = "Option::is_none")]
    pub financial: Option<Box<models::DomainExposedDataRecordFinancialV1>>,
    /// The original hashing algorithm applied to the breached password. Possible values: 'plain', 'unknown', 'base64', 'md5', 'sha1', 'bcrypt', etc. The value 'plain' means that the password was originally found as plaintext.
    #[serde(rename = "hash_type")]
    pub hash_type: String,
    /// The user's job at the company
    #[serde(rename = "job_position", skip_serializing_if = "Option::is_none")]
    pub job_position: Option<String>,
    #[serde(rename = "location", skip_serializing_if = "Option::is_none")]
    pub location: Option<Box<models::DomainExposedDataRecordLocationV1>>,
    /// The username of the breached account.
    #[serde(rename = "login_id")]
    pub login_id: String,
    /// The stealer log bot malware family
    #[serde(rename = "malware_family", skip_serializing_if = "Option::is_none")]
    pub malware_family: Option<String>,
    /// The name of the person associated with the breached account.
    #[serde(rename = "name")]
    pub name: String,
    /// The breached password. Passwords are returned as salted hashes, generated using the SHA256 algorithm and the CID as the salt.
    #[serde(rename = "password")]
    pub password: String,
    /// The password hash
    #[serde(rename = "password_hash", skip_serializing_if = "Option::is_none")]
    pub password_hash: Option<String>,
    /// The password salt
    #[serde(rename = "password_salt", skip_serializing_if = "Option::is_none")]
    pub password_salt: Option<String>,
    /// The phone number of the person associated with the breached account.
    #[serde(rename = "phone")]
    pub phone: String,
    #[serde(rename = "social", skip_serializing_if = "Option::is_none")]
    pub social: Option<Box<models::DomainExposedDataRecordSocialV1>>,
    /// The ID of the user on the impacted site
    #[serde(rename = "user_id", skip_serializing_if = "Option::is_none")]
    pub user_id: Option<String>,
    /// The IP of the user on the impacted site
    #[serde(rename = "user_ip", skip_serializing_if = "Option::is_none")]
    pub user_ip: Option<String>,
}

impl DomainBreachedItemV1 {
    pub fn new(
        domain: String,
        email: String,
        hash_type: String,
        login_id: String,
        name: String,
        password: String,
        phone: String,
    ) -> DomainBreachedItemV1 {
        DomainBreachedItemV1 {
            bot: None,
            company: None,
            credential_status: None,
            credentials_domain: None,
            credentials_ip: None,
            credentials_url: None,
            display_name: None,
            domain,
            email,
            financial: None,
            hash_type,
            job_position: None,
            location: None,
            login_id,
            malware_family: None,
            name,
            password,
            password_hash: None,
            password_salt: None,
            phone,
            social: None,
            user_id: None,
            user_ip: None,
        }
    }
}