// @generated by jacquard-lexicon. DO NOT EDIT.
//
// Lexicon: how.bun.reviews.review
//
// This file was automatically generated from Lexicon schemas.
// Any manual changes will be overwritten on the next regeneration.

///Record containing a review of something.
#[jacquard_derive::lexicon]
#[derive(
    serde::Serialize,
    serde::Deserialize,
    Debug,
    Clone,
    PartialEq,
    Eq,
    jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct Review<'a> {
    ///The timestamp when this review was originally written.
    pub created_at: jacquard_common::types::string::Datetime,
    ///Annotations of text (Bluesky-compatible richtext).
    #[serde(skip_serializing_if = "std::option::Option::is_none")]
    #[serde(borrow)]
    pub facets: std::option::Option<Vec<crate::app_bsky::richtext::facet::Facet<'a>>>,
    ///Indicates natural language of text.
    #[serde(skip_serializing_if = "std::option::Option::is_none")]
    pub langs: std::option::Option<Vec<jacquard_common::types::string::Language>>,
    #[serde(borrow)]
    pub subject: ReviewRecordSubject<'a>,
    ///A short summary of the review (perhaps a score).
    #[serde(skip_serializing_if = "std::option::Option::is_none")]
    #[serde(borrow)]
    pub summary: std::option::Option<jacquard_common::CowStr<'a>>,
    ///The text of the review.
    #[serde(borrow)]
    pub text: jacquard_common::CowStr<'a>,
}

#[jacquard_derive::open_union]
#[derive(
    serde::Serialize,
    serde::Deserialize,
    Debug,
    Clone,
    PartialEq,
    Eq,
    jacquard_derive::IntoStatic
)]
#[serde(tag = "$type")]
#[serde(bound(deserialize = "'de: 'a"))]
pub enum ReviewRecordSubject<'a> {
    #[serde(rename = "how.bun.reviews.subject#wikidataObject")]
    SubjectWikidataObject(Box<crate::how_bun::reviews::subject::WikidataObject<'a>>),
}

impl jacquard_common::types::collection::Collection for Review<'_> {
    const NSID: &'static str = "how.bun.reviews.review";
}