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 DevicecontrolapiRespPolicyV2 {
    /// Default or Automatic
    #[serde(rename = "assignment_type")]
    pub assignment_type: String,
    /// Bluetooth channel file version number
    #[serde(
        rename = "bluetooth_channel_version",
        skip_serializing_if = "Option::is_none"
    )]
    pub bluetooth_channel_version: Option<i64>,
    #[serde(rename = "bluetooth_settings", skip_serializing_if = "Option::is_none")]
    pub bluetooth_settings: Option<Box<models::DevicecontrolapiBluetoothSettings>>,
    /// Customer ID of the policy
    #[serde(rename = "cid")]
    pub cid: String,
    /// CS username who created the policy
    #[serde(rename = "created_by")]
    pub created_by: String,
    /// UTC time policy created
    #[serde(rename = "created_timestamp")]
    pub created_timestamp: String,
    /// Description of the policy
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Policy level enablement of the policy
    #[serde(rename = "enabled")]
    pub enabled: bool,
    /// Host group IDs assigned to this policy
    #[serde(rename = "groups")]
    pub groups: Vec<String>,
    /// ID of the policy
    #[serde(rename = "id")]
    pub id: String,
    /// Last CS username who modified the policy
    #[serde(rename = "modified_by")]
    pub modified_by: String,
    /// UTC time policy modified
    #[serde(rename = "modified_timestamp")]
    pub modified_timestamp: String,
    /// Name of the policy
    #[serde(rename = "name")]
    pub name: String,
    /// The platform numeric value. Windows:0, MacOS:1
    #[serde(rename = "platform_id")]
    pub platform_id: String,
    /// Policy platform name (Windows or Mac)
    #[serde(rename = "platform_name")]
    pub platform_name: String,
    /// Order in which a policy is applied (lower values is higher precedence)
    #[serde(rename = "precedence")]
    pub precedence: i64,
    /// For Flight Control enabled CIDs, indicates whether to propagate to child CIDs
    #[serde(rename = "propagated", skip_serializing_if = "Option::is_none")]
    pub propagated: Option<bool>,
    /// The hash of hostgroups assigned to the policy
    #[serde(rename = "settings_hash", skip_serializing_if = "Option::is_none")]
    pub settings_hash: Option<String>,
    /// USB channel file version number
    #[serde(rename = "usb_channel_version")]
    pub usb_channel_version: i64,
    #[serde(rename = "usb_settings")]
    pub usb_settings: Box<models::DevicecontrolapiRespUsbSettingsV2>,
}

impl DevicecontrolapiRespPolicyV2 {
    pub fn new(
        assignment_type: String,
        cid: String,
        created_by: String,
        created_timestamp: String,
        enabled: bool,
        groups: Vec<String>,
        id: String,
        modified_by: String,
        modified_timestamp: String,
        name: String,
        platform_id: String,
        platform_name: String,
        precedence: i64,
        usb_channel_version: i64,
        usb_settings: models::DevicecontrolapiRespUsbSettingsV2,
    ) -> DevicecontrolapiRespPolicyV2 {
        DevicecontrolapiRespPolicyV2 {
            assignment_type,
            bluetooth_channel_version: None,
            bluetooth_settings: None,
            cid,
            created_by,
            created_timestamp,
            description: None,
            enabled,
            groups,
            id,
            modified_by,
            modified_timestamp,
            name,
            platform_id,
            platform_name,
            precedence,
            propagated: None,
            settings_hash: None,
            usb_channel_version,
            usb_settings: Box::new(usb_settings),
        }
    }
}