// @generated by eql-codegen from the eql-domains catalog — do not edit
//! The `text` encrypted-domain family — generated from the eql-domains catalog.
use crate::v3::terms::{BloomFilter, Ciphertext, Hmac256, OpeCllw, OreBlock256};
use crate::v3::DomainType;
use crate::{Identifier, SchemaVersion};
use schemars::{schema_for, JsonSchema, Schema};
use serde::{Deserialize, Serialize};
use ts_rs::TS;
/// `eql_v3.text` — storage-only domain.
///
/// Operators: none. Required keys: `v` `i` `c`.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)]
#[ts(export, export_to = "v3/")]
#[serde(deny_unknown_fields)]
pub struct Text {
    pub v: SchemaVersion,
    pub i: Identifier,
    pub c: Ciphertext,
}
impl DomainType for Text {
    fn sql_domain_static() -> &'static str {
        "eql_v3.text"
    }
    fn sql_domain(&self) -> &'static str {
        Self::sql_domain_static()
    }
    fn term_json_keys_static() -> Option<&'static [&'static str]> {
        Some(&[])
    }
    fn term_json_keys(&self) -> Option<&'static [&'static str]> {
        Self::term_json_keys_static()
    }
    fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> {
        Text::deserialize(value).map(|_| ())
    }
    fn schema(&self) -> Schema {
        schema_for!(Text)
    }
}
/// `eql_v3.text_eq` — equality domain.
///
/// Operators: `=` `<>`. Required keys: `v` `i` `c` `hm`.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)]
#[ts(export, export_to = "v3/")]
#[serde(deny_unknown_fields)]
pub struct TextEq {
    pub v: SchemaVersion,
    pub i: Identifier,
    pub c: Ciphertext,
    pub hm: Hmac256,
}
impl DomainType for TextEq {
    fn sql_domain_static() -> &'static str {
        "eql_v3.text_eq"
    }
    fn sql_domain(&self) -> &'static str {
        Self::sql_domain_static()
    }
    fn term_json_keys_static() -> Option<&'static [&'static str]> {
        Some(&["hm"])
    }
    fn term_json_keys(&self) -> Option<&'static [&'static str]> {
        Self::term_json_keys_static()
    }
    fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> {
        TextEq::deserialize(value).map(|_| ())
    }
    fn schema(&self) -> Schema {
        schema_for!(TextEq)
    }
}
/// `eql_v3.text_match` — match domain.
///
/// Operators: `@>` `<@`. Required keys: `v` `i` `c` `bf`.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)]
#[ts(export, export_to = "v3/")]
#[serde(deny_unknown_fields)]
pub struct TextMatch {
    pub v: SchemaVersion,
    pub i: Identifier,
    pub c: Ciphertext,
    pub bf: BloomFilter,
}
impl DomainType for TextMatch {
    fn sql_domain_static() -> &'static str {
        "eql_v3.text_match"
    }
    fn sql_domain(&self) -> &'static str {
        Self::sql_domain_static()
    }
    fn term_json_keys_static() -> Option<&'static [&'static str]> {
        Some(&["bf"])
    }
    fn term_json_keys(&self) -> Option<&'static [&'static str]> {
        Self::term_json_keys_static()
    }
    fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> {
        TextMatch::deserialize(value).map(|_| ())
    }
    fn schema(&self) -> Schema {
        schema_for!(TextMatch)
    }
}
/// `eql_v3.text_ord_ore` — ordering domain.
///
/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `hm` `ob`.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)]
#[ts(export, export_to = "v3/")]
#[serde(deny_unknown_fields)]
pub struct TextOrdOre {
    pub v: SchemaVersion,
    pub i: Identifier,
    pub c: Ciphertext,
    pub hm: Hmac256,
    pub ob: OreBlock256,
}
impl DomainType for TextOrdOre {
    fn sql_domain_static() -> &'static str {
        "eql_v3.text_ord_ore"
    }
    fn sql_domain(&self) -> &'static str {
        Self::sql_domain_static()
    }
    fn term_json_keys_static() -> Option<&'static [&'static str]> {
        Some(&["hm", "ob"])
    }
    fn term_json_keys(&self) -> Option<&'static [&'static str]> {
        Self::term_json_keys_static()
    }
    fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> {
        TextOrdOre::deserialize(value).map(|_| ())
    }
    fn schema(&self) -> Schema {
        schema_for!(TextOrdOre)
    }
}
/// `eql_v3.text_ord` — ordering domain.
///
/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `hm` `ob`.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)]
#[ts(export, export_to = "v3/")]
#[serde(deny_unknown_fields)]
pub struct TextOrd {
    pub v: SchemaVersion,
    pub i: Identifier,
    pub c: Ciphertext,
    pub hm: Hmac256,
    pub ob: OreBlock256,
}
impl DomainType for TextOrd {
    fn sql_domain_static() -> &'static str {
        "eql_v3.text_ord"
    }
    fn sql_domain(&self) -> &'static str {
        Self::sql_domain_static()
    }
    fn term_json_keys_static() -> Option<&'static [&'static str]> {
        Some(&["hm", "ob"])
    }
    fn term_json_keys(&self) -> Option<&'static [&'static str]> {
        Self::term_json_keys_static()
    }
    fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> {
        TextOrd::deserialize(value).map(|_| ())
    }
    fn schema(&self) -> Schema {
        schema_for!(TextOrd)
    }
}
/// `eql_v3.text_ord_ope` — ordering domain.
///
/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `hm` `op`.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)]
#[ts(export, export_to = "v3/")]
#[serde(deny_unknown_fields)]
pub struct TextOrdOpe {
    pub v: SchemaVersion,
    pub i: Identifier,
    pub c: Ciphertext,
    pub hm: Hmac256,
    pub op: OpeCllw,
}
impl DomainType for TextOrdOpe {
    fn sql_domain_static() -> &'static str {
        "eql_v3.text_ord_ope"
    }
    fn sql_domain(&self) -> &'static str {
        Self::sql_domain_static()
    }
    fn term_json_keys_static() -> Option<&'static [&'static str]> {
        Some(&["hm", "op"])
    }
    fn term_json_keys(&self) -> Option<&'static [&'static str]> {
        Self::term_json_keys_static()
    }
    fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> {
        TextOrdOpe::deserialize(value).map(|_| ())
    }
    fn schema(&self) -> Schema {
        schema_for!(TextOrdOpe)
    }
}
/// `eql_v3.text_search` — search domain.
///
/// Operators: `=` `<>` `<` `<=` `>` `>=` `@>` `<@`. Required keys: `v` `i` `c` `hm` `ob` `bf`.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)]
#[ts(export, export_to = "v3/")]
#[serde(deny_unknown_fields)]
pub struct TextSearch {
    pub v: SchemaVersion,
    pub i: Identifier,
    pub c: Ciphertext,
    pub hm: Hmac256,
    pub ob: OreBlock256,
    pub bf: BloomFilter,
}
impl DomainType for TextSearch {
    fn sql_domain_static() -> &'static str {
        "eql_v3.text_search"
    }
    fn sql_domain(&self) -> &'static str {
        Self::sql_domain_static()
    }
    fn term_json_keys_static() -> Option<&'static [&'static str]> {
        Some(&["hm", "ob", "bf"])
    }
    fn term_json_keys(&self) -> Option<&'static [&'static str]> {
        Self::term_json_keys_static()
    }
    fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> {
        TextSearch::deserialize(value).map(|_| ())
    }
    fn schema(&self) -> Schema {
        schema_for!(TextSearch)
    }
}
