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 ItautomationTaskParameter {
    /// Message to show on failure of custom validation regex. Example: API Key must be 32 alphanumeric characters
    #[serde(rename = "custom_validation_message")]
    pub custom_validation_message: String,
    /// Custom regex pattern to apply when input_type is text. Example: ^[A-Za-z0-9]{32}$
    #[serde(rename = "custom_validation_regex")]
    pub custom_validation_regex: String,
    /// Default value for the parameter. Example: default-api-key
    #[serde(rename = "default_value")]
    pub default_value: String,
    /// Type of input field
    #[serde(rename = "input_type")]
    pub input_type: InputType,
    /// Unique identifier for the parameter, corresponds to placeholder used in task content. Example: api_key
    #[serde(rename = "key")]
    pub key: String,
    /// Human readable label for the parameter. Example: API Key
    #[serde(rename = "label")]
    pub label: String,
    /// Available options for option inputs. Used only if input_type is option.
    #[serde(rename = "options")]
    pub options: Vec<models::ItautomationParameterOption>,
    /// Type of validation to apply when input_type is text
    #[serde(rename = "validation_type")]
    pub validation_type: ValidationType,
}

impl ItautomationTaskParameter {
    pub fn new(
        custom_validation_message: String,
        custom_validation_regex: String,
        default_value: String,
        input_type: InputType,
        key: String,
        label: String,
        options: Vec<models::ItautomationParameterOption>,
        validation_type: ValidationType,
    ) -> ItautomationTaskParameter {
        ItautomationTaskParameter {
            custom_validation_message,
            custom_validation_regex,
            default_value,
            input_type,
            key,
            label,
            options,
            validation_type,
        }
    }
}
/// Type of input field
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum InputType {
    #[serde(rename = "text")]
    Text,
    #[serde(rename = "option")]
    Option,
}

impl Default for InputType {
    fn default() -> InputType {
        Self::Text
    }
}
/// Type of validation to apply when input_type is text
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ValidationType {
    #[serde(rename = "text")]
    Text,
    #[serde(rename = "alphanumeric")]
    Alphanumeric,
    #[serde(rename = "integer")]
    Integer,
    #[serde(rename = "float")]
    Float,
    #[serde(rename = "ip")]
    Ip,
    #[serde(rename = "filepath")]
    Filepath,
    #[serde(rename = "filepathwin")]
    Filepathwin,
    #[serde(rename = "filepathunix")]
    Filepathunix,
    #[serde(rename = "datetime")]
    Datetime,
    #[serde(rename = "semver")]
    Semver,
    #[serde(rename = "macaddress")]
    Macaddress,
    #[serde(rename = "uuid")]
    Uuid,
    #[serde(rename = "port")]
    Port,
    #[serde(rename = "winhost")]
    Winhost,
    #[serde(rename = "dnshost")]
    Dnshost,
}

impl Default for ValidationType {
    fn default() -> ValidationType {
        Self::Text
    }
}