// @generated by eql-codegen from the eql-domains catalog — do not edit
//! The `boolean` encrypted-domain family — generated from the eql-domains catalog.
use crate::v3::terms::Ciphertext;
use crate::v3::DomainType;
use crate::{Identifier, SchemaVersion};
use schemars::{schema_for, JsonSchema, Schema};
use serde::{Deserialize, Serialize};
use ts_rs::TS;
/// `eql_v3.boolean` — 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 Boolean {
    pub v: SchemaVersion,
    pub i: Identifier,
    pub c: Ciphertext,
}
impl DomainType for Boolean {
    fn sql_domain_static() -> &'static str {
        "eql_v3.boolean"
    }
    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> {
        Boolean::deserialize(value).map(|_| ())
    }
    fn schema(&self) -> Schema {
        schema_for!(Boolean)
    }
}
