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 DeviceControlExceptionReqV1 {
    /// Action to be taken for devices matching this exception. Note: BLOCK_EXECUTE and BLOCK_WRITE_EXECUTE only valid for MASS_STORAGE class
    #[serde(rename = "action", skip_serializing_if = "Option::is_none")]
    pub action: Option<Action>,
    /// Combined identifier in the format 'vendorID_productID_serialNumber'. Not allowed if use_wildcard is true.
    #[serde(rename = "combined_id", skip_serializing_if = "Option::is_none")]
    pub combined_id: Option<String>,
    /// Description for this 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.
    #[serde(rename = "expiration_time", skip_serializing_if = "Option::is_none")]
    pub expiration_time: Option<String>,
    /// Unique identifier for an exception. If omitted, a new exception will be created.
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Hexadecimal ProductID used to apply the exception. Must be a valid hex value representing a decimal value less than 65535. Only one of product_id or product_id_decimal is required.
    #[serde(rename = "product_id", skip_serializing_if = "Option::is_none")]
    pub product_id: Option<String>,
    /// Decimal ProductID used to apply the exception. Must be a valid decimal value less than 65535. Only one of product_id or product_id_decimal is required.
    #[serde(rename = "product_id_decimal", skip_serializing_if = "Option::is_none")]
    pub product_id_decimal: Option<String>,
    /// Product Name, optional.
    #[serde(rename = "product_name", skip_serializing_if = "Option::is_none")]
    pub product_name: Option<String>,
    /// Serial number of the USB device. Maximum length: 126 characters. Required when use_wildcard is true.
    #[serde(rename = "serial_number", skip_serializing_if = "Option::is_none")]
    pub serial_number: Option<String>,
    /// true indicates using blob syntax for USB serial numbers. When true, requires serial_number and either vendor_id(_decimal) and product_id(_decimal). Cannot be used with combined_id. Double asterisks (**) are not supported.
    #[serde(rename = "use_wildcard", skip_serializing_if = "Option::is_none")]
    pub use_wildcard: Option<bool>,
    /// Hexadecimal VendorID used to apply the exception. Must be a valid hex value representing a decimal value less than 65535. Only one of vendor_id or vendor_id_decimal is required.
    #[serde(rename = "vendor_id", skip_serializing_if = "Option::is_none")]
    pub vendor_id: Option<String>,
    /// Decimal VendorID used to apply the exception. Must be a valid decimal value less than 65535. Only one of vendor_id or vendor_id_decimal is required.
    #[serde(rename = "vendor_id_decimal", skip_serializing_if = "Option::is_none")]
    pub vendor_id_decimal: Option<String>,
    /// Vendor Name, optional
    #[serde(rename = "vendor_name", skip_serializing_if = "Option::is_none")]
    pub vendor_name: Option<String>,
}

impl DeviceControlExceptionReqV1 {
    pub fn new() -> DeviceControlExceptionReqV1 {
        DeviceControlExceptionReqV1 {
            action: None,
            combined_id: None,
            description: None,
            expiration_time: None,
            id: None,
            product_id: None,
            product_id_decimal: None,
            product_name: None,
            serial_number: None,
            use_wildcard: None,
            vendor_id: None,
            vendor_id_decimal: None,
            vendor_name: None,
        }
    }
}
/// Action to be taken for devices matching this exception. Note: BLOCK_EXECUTE and BLOCK_WRITE_EXECUTE only valid for MASS_STORAGE class
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Action {
    #[serde(rename = "FULL_ACCESS")]
    FullAccess,
    #[serde(rename = "BLOCK_ALL")]
    BlockAll,
    #[serde(rename = "BLOCK_EXECUTE")]
    BlockExecute,
    #[serde(rename = "BLOCK_WRITE_EXECUTE")]
    BlockWriteExecute,
}

impl Default for Action {
    fn default() -> Action {
        Self::FullAccess
    }
}