/*
* 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 ItautomationPolicy {
#[serde(rename = "config", skip_serializing_if = "Option::is_none")]
pub config: Option<Box<models::ItautomationPolicyConfig>>,
/// Timestamp when the policy was created. Example: 2025-01-23T18:49:26.785778Z
#[serde(rename = "created_at")]
pub created_at: String,
/// User who created the policy. Example: john.smith@crowdstrike.com
#[serde(rename = "created_by")]
pub created_by: String,
/// Description of the policy. Example: windows policy check
#[serde(rename = "description")]
pub description: String,
/// List of host groups associated with this policy.Example: 'g53b95555ef54ea682419ce990d267cc'
#[serde(rename = "host_groups", skip_serializing_if = "Option::is_none")]
pub host_groups: Option<Vec<String>>,
/// ID of the policy. Example: f64b95555ef54ea682619ce880d267cc
#[serde(rename = "id")]
pub id: String,
/// Whether the policy is enabled or disabled
#[serde(rename = "is_enabled", skip_serializing_if = "Option::is_none")]
pub is_enabled: Option<bool>,
/// Timestamp when the policy was last modified. Example: 2025-01-23T18:49:26.785778Z
#[serde(rename = "modified_at")]
pub modified_at: String,
/// User who last modified the policy. Example: john.smith@crowdstrike.com
#[serde(rename = "modified_by")]
pub modified_by: String,
/// The name of the policy. Example: platform_policy
#[serde(rename = "name")]
pub name: String,
/// Priority level of the policy
#[serde(rename = "precedence", skip_serializing_if = "Option::is_none")]
pub precedence: Option<i32>,
/// The platform for the policy
#[serde(rename = "target")]
pub target: Target,
}
impl ItautomationPolicy {
pub fn new(
created_at: String,
created_by: String,
description: String,
id: String,
modified_at: String,
modified_by: String,
name: String,
target: Target,
) -> ItautomationPolicy {
ItautomationPolicy {
config: None,
created_at,
created_by,
description,
host_groups: None,
id,
is_enabled: None,
modified_at,
modified_by,
name,
precedence: None,
target,
}
}
}
/// The platform for the policy
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Target {
#[serde(rename = "Windows")]
Windows,
#[serde(rename = "Linux")]
Linux,
#[serde(rename = "Mac")]
Mac,
}
impl Default for Target {
fn default() -> Target {
Self::Windows
}
}