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
 */

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DevicecontrolapiUsbExceptionBase {
    /// Action to be taken when the exception is matched
    #[serde(rename = "action", skip_serializing_if = "Option::is_none")]
    pub action: Option<Action>,
    /// USB Device class
    #[serde(rename = "class", skip_serializing_if = "Option::is_none")]
    pub class: Option<Class>,
    /// Composite ID of the vendor ID, product ID, and serial number. Format: <vendor ID>_<product ID>_<serial number>
    #[serde(rename = "combined_id", skip_serializing_if = "Option::is_none")]
    pub combined_id: Option<String>,
    /// Description for the exception. Maximum length: 512 characters
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// yyyy-mm-ddThh:mm:ssZ (UTC) format of the time to remove the exception if temporary. Must be in the future. Only provide this value for temporary exceptions
    #[serde(rename = "expiration_time", skip_serializing_if = "Option::is_none")]
    pub expiration_time: Option<String>,
    /// ID of the exception. Leave empty to create a new exception
    #[serde(rename = "id")]
    pub id: String,
    /// Decimal value of the product ID. Required if a serial number is provided
    #[serde(rename = "product_id", skip_serializing_if = "Option::is_none")]
    pub product_id: Option<String>,
    /// Device product name
    #[serde(rename = "product_name", skip_serializing_if = "Option::is_none")]
    pub product_name: Option<String>,
    /// Device serial number
    #[serde(rename = "serial_number", skip_serializing_if = "Option::is_none")]
    pub serial_number: Option<String>,
    /// Boolean value to indicate if wildcard matching should be used on the serial number
    #[serde(rename = "use_wildcard", skip_serializing_if = "Option::is_none")]
    pub use_wildcard: Option<bool>,
    /// Decimal value of the vendor ID
    #[serde(rename = "vendor_id", skip_serializing_if = "Option::is_none")]
    pub vendor_id: Option<String>,
    /// Device vendor name
    #[serde(rename = "vendor_name", skip_serializing_if = "Option::is_none")]
    pub vendor_name: Option<String>,
}

impl DevicecontrolapiUsbExceptionBase {
    pub fn new(id: String) -> DevicecontrolapiUsbExceptionBase {
        DevicecontrolapiUsbExceptionBase {
            action: None,
            class: None,
            combined_id: None,
            description: None,
            expiration_time: None,
            id,
            product_id: None,
            product_name: None,
            serial_number: None,
            use_wildcard: None,
            vendor_id: None,
            vendor_name: None,
        }
    }
}
/// Action to be taken when the exception is matched
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Action {
    #[serde(rename = "FULL_ACCESS")]
    FullAccess,
    #[serde(rename = "BLOCK_EXECUTE")]
    BlockExecute,
    #[serde(rename = "BLOCK_WRITE_EXECUTE")]
    BlockWriteExecute,
    #[serde(rename = "BLOCK_ALL")]
    BlockAll,
    #[serde(rename = "WHITELIST")]
    Whitelist,
}

impl Default for Action {
    fn default() -> Action {
        Self::FullAccess
    }
}
/// USB Device class
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Class {
    #[serde(rename = "ANY")]
    Any,
    #[serde(rename = "AUDIO_VIDEO")]
    AudioVideo,
    #[serde(rename = "IMAGING")]
    Imaging,
    #[serde(rename = "MASS_STORAGE")]
    MassStorage,
    #[serde(rename = "MOBILE")]
    Mobile,
    #[serde(rename = "PRINTER")]
    Printer,
    #[serde(rename = "WIRELESS")]
    Wireless,
}

impl Default for Class {
    fn default() -> Class {
        Self::Any
    }
}