antimatter_api 2.0.13

Interact with the Antimatter Cloud API
Documentation
/*
 * Antimatter Public API
 *
 * Interact with the Antimatter Cloud API
 *
 * The version of the OpenAPI document: 2.0.13
 * Contact: support@antimatter.io
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// ClassifierRule : Configuration for a classification hook.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ClassifierRule {
    /// An identifier for a rule
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[serde(rename = "comment", skip_serializing_if = "Option::is_none")]
    pub comment: Option<String>,
    #[serde(rename = "spanTags")]
    pub span_tags: Vec<models::WriteContextClassifierTag>,
    #[serde(rename = "capsuleTags")]
    pub capsule_tags: Vec<models::WriteContextClassifierTag>,
    #[serde(rename = "llmConfig", skip_serializing_if = "Option::is_none")]
    pub llm_config: Option<Box<models::LlmClassifierConfig>>,
    #[serde(rename = "regexConfig", skip_serializing_if = "Option::is_none")]
    pub regex_config: Option<Box<models::RegexClassifierConfig>>,
}

impl ClassifierRule {
    /// Configuration for a classification hook.
    pub fn new(span_tags: Vec<models::WriteContextClassifierTag>, capsule_tags: Vec<models::WriteContextClassifierTag>) -> ClassifierRule {
        ClassifierRule {
            id: None,
            comment: None,
            span_tags,
            capsule_tags,
            llm_config: None,
            regex_config: None,
        }
    }
}