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 SadomainRule {
    /// Weather to monitor exclusively for breach data. breach_monitoring_enabled also needs to be sent as true for this to be enabled.
    #[serde(rename = "breach_monitor_only")]
    pub breach_monitor_only: bool,
    /// Whether to monitor for breach data. Available only for `Company Domains` and `Email addresses` rule topics. When enabled, ownership of the monitored domains or emails is required
    #[serde(rename = "breach_monitoring_enabled")]
    pub breach_monitoring_enabled: bool,
    #[serde(rename = "cid")]
    pub cid: String,
    /// The UUID of the user that created a given rule or Crowdstrike if the rule was system generated
    #[serde(rename = "created_by", skip_serializing_if = "Option::is_none")]
    pub created_by: Option<String>,
    /// The creation time for a given rule
    #[serde(rename = "created_timestamp")]
    pub created_timestamp: String,
    /// The FQL filter contained in a rule and used for searching. Parentheses may be added automatically for clarity
    #[serde(rename = "filter")]
    pub filter: String,
    /// The ID of a given rule
    #[serde(rename = "id")]
    pub id: String,
    /// Which result types to monitor for. Can be set to only monitor domains or subdomains, as well as both. Only available for the `Typosquatting` rule topic.
    #[serde(rename = "match_on_tsq_result_types")]
    pub match_on_tsq_result_types: Vec<String>,
    /// The name of a given rule
    #[serde(rename = "name")]
    pub name: String,
    /// If the rule was generated based on a template, the id of the template
    #[serde(
        rename = "originating_template_id",
        skip_serializing_if = "Option::is_none"
    )]
    pub originating_template_id: Option<String>,
    #[serde(rename = "ownership_assets", skip_serializing_if = "Option::is_none")]
    pub ownership_assets: Option<Box<models::SadomainCustomerAssets>>,
    /// The permissions of a given rule
    #[serde(rename = "permissions")]
    pub permissions: String,
    /// The priority of a given rule
    #[serde(rename = "priority")]
    pub priority: String,
    /// The status of a given rule
    #[serde(rename = "status")]
    pub status: String,
    /// The detailed status message of a given rule
    #[serde(rename = "status_message", skip_serializing_if = "Option::is_none")]
    pub status_message: Option<String>,
    /// Whether to monitor for substring matches. Only available for the `Typosquatting` rule topic
    #[serde(rename = "substring_matching_enabled")]
    pub substring_matching_enabled: bool,
    #[serde(rename = "template_priority", skip_serializing_if = "Option::is_none")]
    pub template_priority: Option<i32>,
    /// The topic of a given rule
    #[serde(rename = "topic")]
    pub topic: String,
    /// The last updated time for a given rule
    #[serde(rename = "updated_timestamp")]
    pub updated_timestamp: String,
    /// The user ID of the user that created a given rule
    #[serde(rename = "user_id", skip_serializing_if = "Option::is_none")]
    pub user_id: Option<String>,
    /// The user name of the user that created a given rule
    #[serde(rename = "user_name", skip_serializing_if = "Option::is_none")]
    pub user_name: Option<String>,
    /// The UUID of the user that created a given rule
    #[serde(rename = "user_uuid")]
    pub user_uuid: String,
}

impl SadomainRule {
    pub fn new(
        breach_monitor_only: bool,
        breach_monitoring_enabled: bool,
        cid: String,
        created_timestamp: String,
        filter: String,
        id: String,
        match_on_tsq_result_types: Vec<String>,
        name: String,
        permissions: String,
        priority: String,
        status: String,
        substring_matching_enabled: bool,
        topic: String,
        updated_timestamp: String,
        user_uuid: String,
    ) -> SadomainRule {
        SadomainRule {
            breach_monitor_only,
            breach_monitoring_enabled,
            cid,
            created_by: None,
            created_timestamp,
            filter,
            id,
            match_on_tsq_result_types,
            name,
            originating_template_id: None,
            ownership_assets: None,
            permissions,
            priority,
            status,
            status_message: None,
            substring_matching_enabled,
            template_priority: None,
            topic,
            updated_timestamp,
            user_id: None,
            user_name: None,
            user_uuid,
        }
    }
}