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};

/// WriteContextRegexRule : Regex classifier rule for a write context
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WriteContextRegexRule {
    /// An identifier for a rule
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[serde(rename = "pattern")]
    pub pattern: String,
    #[serde(rename = "matchOnKey")]
    pub match_on_key: bool,
    #[serde(rename = "spanTags")]
    pub span_tags: Vec<models::WriteContextClassifierTag>,
    #[serde(rename = "capsuleTags")]
    pub capsule_tags: Vec<models::WriteContextClassifierTag>,
}

impl WriteContextRegexRule {
    /// Regex classifier rule for a write context
    pub fn new(pattern: String, match_on_key: bool, span_tags: Vec<models::WriteContextClassifierTag>, capsule_tags: Vec<models::WriteContextClassifierTag>) -> WriteContextRegexRule {
        WriteContextRegexRule {
            id: None,
            pattern,
            match_on_key,
            span_tags,
            capsule_tags,
        }
    }
}