# generated by datamodel-codegen:
#   filename:  all_types.json

from __future__ import annotations

from enum import Enum
from typing import Annotated, Any

from pydantic import BaseModel, ConfigDict, Field, RootModel


class CalendarType(Enum):
    """
    The type of the calendar.
    Defines the scope and authority level of the liturgical calendar.
    """

    general_roman = "general_roman"
    region = "region"
    country = "country"
    archdiocese = "archdiocese"
    diocese = "diocese"
    city = "city"
    parish = "parish"
    general_community = "general_community"
    regional_community = "regional_community"
    local_community = "local_community"
    other = "other"


class CalendarJurisdiction(Enum):
    """
    The jurisdiction of the calendar.
    Determines whether the calendar follows ecclesiastical or civil authority.
    """

    ecclesiastical = "ecclesiastical"
    civil = "civil"


class EasterCalculationType(Enum):
    """
    Easter date calculation method.

    Determines which algorithm to use for calculating the date of Easter Sunday,
    which is the basis for most movable feasts in the liturgical calendar.
    """

    gregorian = "gregorian"
    julian = "julian"


class MonthIndex(RootModel[int]):
    root: Annotated[int, Field(ge=0, le=255, title="MonthIndex")]
    """
    Month index (1-12) with automatic validation

    This type ensures that only valid month values are accepted during
    deserialization. The value 1 represents January, 2 represents February, etc.
    """


class DateFn(Enum):
    """
    Date function for calculating liturgical dates.

    Represents movable feasts and special celebrations that require calculation
    based on Easter or other variable dates.
    """

    mary_mother_of_the_church = "mary_mother_of_the_church"
    epiphany_sunday = "epiphany_sunday"
    presentation_of_the_lord = "presentation_of_the_lord"
    annunciation = "annunciation"
    palm_sunday = "palm_sunday"
    easter_sunday = "easter_sunday"
    divine_mercy_sunday = "divine_mercy_sunday"
    immaculate_heart_of_mary = "immaculate_heart_of_mary"
    pentecost_sunday = "pentecost_sunday"
    corpus_christi_sunday = "corpus_christi_sunday"
    nativity_of_john_the_baptist = "nativity_of_john_the_baptist"
    peter_and_paul_apostles = "peter_and_paul_apostles"
    transfiguration = "transfiguration"
    assumption = "assumption"
    exaltation_of_the_holy_cross = "exaltation_of_the_holy_cross"
    all_saints = "all_saints"
    immaculate_conception_of_mary = "immaculate_conception_of_mary"


class DayOfWeek(RootModel[int]):
    root: Annotated[int, Field(ge=0, le=255, title="DayOfWeek")]
    """
    Day of week (0-6, where 0=Sunday) with automatic validation

    This type ensures that only valid day-of-week values are accepted during
    deserialization. The value 0 represents Sunday, 1 represents Monday, etc.
    """


class ExceptionCondition3(BaseModel):
    """
    If the date falls on a specific day of the week
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    day_of_week: DayOfWeek
    """
    The day of the week to match
    """


class DateDefWithOffset(BaseModel):
    """
    Date definition with offset for adjustments.
    Used when a date needs to be shifted by a specific number of days.
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    day_offset: int
    """
    The number of days to offset the date
    """


class Precedence(Enum):
    """
    Liturgical precedence levels for determining which celebration takes priority.
    Defines the hierarchical order of liturgical celebrations according to UNLY norms.
    """

    triduum_1 = "triduum_1"
    proper_of_time_solemnity_2 = "proper_of_time_solemnity_2"
    privileged_sunday_2 = "privileged_sunday_2"
    ash_wednesday_2 = "ash_wednesday_2"
    weekday_of_holy_week_2 = "weekday_of_holy_week_2"
    weekday_of_easter_octave_2 = "weekday_of_easter_octave_2"
    general_solemnity_3 = "general_solemnity_3"
    commemoration_of_all_the_faithful_departed_3 = "commemoration_of_all_the_faithful_departed_3"
    proper_solemnity__principal_patron_4a = "proper_solemnity__principal_patron_4a"
    proper_solemnity__dedication_of_the_own_church_4b = (
        "proper_solemnity__dedication_of_the_own_church_4b"
    )
    proper_solemnity__title_of_the_own_church_4c = "proper_solemnity__title_of_the_own_church_4c"
    proper_solemnity__title_or_founder_or_primary_patron_of_a_religious_org_4d = (
        "proper_solemnity__title_or_founder_or_primary_patron_of_a_religious_org_4d"
    )
    general_lord_feast_5 = "general_lord_feast_5"
    unprivileged_sunday_6 = "unprivileged_sunday_6"
    general_feast_7 = "general_feast_7"
    proper_feast__principal_patron_of_a_diocese_8a = (
        "proper_feast__principal_patron_of_a_diocese_8a"
    )
    proper_feast__dedication_of_the_cathedral_church_8b = (
        "proper_feast__dedication_of_the_cathedral_church_8b"
    )
    proper_feast__principal_patron_of_a_region_8c = "proper_feast__principal_patron_of_a_region_8c"
    proper_feast__title_or_founder_or_primary_patron_of_a_religious_org_8d = (
        "proper_feast__title_or_founder_or_primary_patron_of_a_religious_org_8d"
    )
    proper_feast__to_an_individual_church_8e = "proper_feast__to_an_individual_church_8e"
    proper_feast_8f = "proper_feast_8f"
    privileged_weekday_9 = "privileged_weekday_9"
    general_memorial_10 = "general_memorial_10"
    proper_memorial__second_patron_11a = "proper_memorial__second_patron_11a"
    proper_memorial_11b = "proper_memorial_11b"
    optional_memorial_12 = "optional_memorial_12"
    weekday_13 = "weekday_13"


class CommonDefinition(Enum):
    """
    Common definition for simplified categorization.
    Provides a simplified version of the Common enum for easier classification.
    """

    none = "none"
    dedication_anniversary__inside = "dedication_anniversary__inside"
    dedication_anniversary__outside = "dedication_anniversary__outside"
    blessed_virgin_mary = "blessed_virgin_mary"
    martyrs = "martyrs"
    missionary_martyrs = "missionary_martyrs"
    virgin_martyrs = "virgin_martyrs"
    woman_martyrs = "woman_martyrs"
    pastors = "pastors"
    popes = "popes"
    bishops = "bishops"
    founders = "founders"
    missionaries = "missionaries"
    doctors_of_the_church = "doctors_of_the_church"
    virgins = "virgins"
    saints = "saints"
    abbots = "abbots"
    monks = "monks"
    nuns = "nuns"
    religious = "religious"
    mercy_workers = "mercy_workers"
    educators = "educators"
    holy_women = "holy_women"


class Title(Enum):
    """
    Titles and patronages associated with saints and blessed.
    Represents the various ecclesiastical titles and patronages that can be assigned to entities.
    """

    abbess = "abbess"
    abbot = "abbot"
    apostle = "apostle"
    archangel = "archangel"
    bishop = "bishop"
    deacon = "deacon"
    doctor_of_the_church = "doctor_of_the_church"
    empress = "empress"
    evangelist = "evangelist"
    first_bishop = "first_bishop"
    hermit = "hermit"
    king = "king"
    martyr = "martyr"
    missionary = "missionary"
    monk = "monk"
    mother_and_queen_of_chile = "mother_and_queen_of_chile"
    parents_of_the_blessed_virgin_mary = "parents_of_the_blessed_virgin_mary"
    pope = "pope"
    patriarch = "patriarch"
    pilgrim = "pilgrim"
    priest = "priest"
    prophet = "prophet"
    proto_martyr_of_oceania = "proto_martyr_of_oceania"
    queen = "queen"
    queen_of_poland = "queen_of_poland"
    religious = "religious"
    slavic_missionary = "slavic_missionary"
    spouse_of_the_blessed_virgin_mary = "spouse_of_the_blessed_virgin_mary"
    the_first_martyr = "the_first_martyr"
    virgin = "virgin"
    copatron_of_europe = "copatron_of_europe"
    copatron_of_ireland = "copatron_of_ireland"
    copatron_of_canada = "copatron_of_canada"
    copatroness_of_europe = "copatroness_of_europe"
    copatroness_of_france = "copatroness_of_france"
    copatroness_of_ireland = "copatroness_of_ireland"
    copatroness_of_italy_and_europe = "copatroness_of_italy_and_europe"
    copatroness_of_the_philippines = "copatroness_of_the_philippines"
    patron_of_canada = "patron_of_canada"
    patron_of_england = "patron_of_england"
    patron_of_europe = "patron_of_europe"
    patron_of_france = "patron_of_france"
    patron_of_ireland = "patron_of_ireland"
    patron_of_italy = "patron_of_italy"
    patron_of_oceania = "patron_of_oceania"
    patron_of_poland = "patron_of_poland"
    patron_of_russia = "patron_of_russia"
    patron_of_scotland = "patron_of_scotland"
    patron_of_spain = "patron_of_spain"
    patron_of_the_czech_nation = "patron_of_the_czech_nation"
    patron_of_the_diocese = "patron_of_the_diocese"
    patron_of_wales = "patron_of_wales"
    patroness_of_alsace = "patroness_of_alsace"
    patroness_of_argentina = "patroness_of_argentina"
    patroness_of_brazil = "patroness_of_brazil"
    patroness_of_hungary = "patroness_of_hungary"
    patroness_of_puerto_rico = "patroness_of_puerto_rico"
    patroness_of_slovakia = "patroness_of_slovakia"
    patroness_of_the_americas = "patroness_of_the_americas"
    patroness_of_the_philippines = "patroness_of_the_philippines"
    patroness_of_the_province_of_quebec = "patroness_of_the_province_of_quebec"
    patroness_of_the_usa = "patroness_of_the_usa"
    patron_of_the_clergy_of_the_archdiocese_of_lyon = (
        "patron_of_the_clergy_of_the_archdiocese_of_lyon"
    )
    patron_of_the_city_of_lyon = "patron_of_the_city_of_lyon"
    patroness_of_costa_rica = "patroness_of_costa_rica"
    principal_patron_of_the_diocese = "principal_patron_of_the_diocese"
    second_patron_of_the_diocese = "second_patron_of_the_diocese"


class CompoundTitle(BaseModel):
    """
    Compound title definition for combining multiple titles.
    Allows adding titles to the beginning or end of an existing title list.
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    append: list[Title] | None = None
    """
    The title(s) to add to the end of the existing list of title(s)
    """
    prepend: list[Title] | None = None
    """
    The title(s) to add to the beginning of the existing list of title(s)
    """


class SaintCount1(RootModel[int]):
    root: Annotated[int, Field(ge=0, title="SaintCount")]
    """
    Represents the number of saints for an entity or a group of entities.

    Can be either a specific number (u32) or "many" to indicate
    an indeterminate number of saints.

    # Serialization
    - `Number(n)` serializes as integer `n`
    - `Many` serializes as string `"many"`

    # Deserialization
    - Integers are converted to `Number(u32)`
    - String `"many"` is converted to `Many`
    - All other types generate an error
    """


class SaintCount(RootModel[SaintCount1 | str | None]):
    root: Annotated[SaintCount1 | str | None, Field(title="SaintCount")]
    """
    Represents the number of saints for an entity or a group of entities.

    Can be either a specific number (u32) or "many" to indicate
    an indeterminate number of saints.

    # Serialization
    - `Number(n)` serializes as integer `n`
    - `Many` serializes as string `"many"`

    # Deserialization
    - Integers are converted to `Number(u32)`
    - String `"many"` is converted to `Many`
    - All other types generate an error
    """


class Color(Enum):
    """
    Liturgical colors used in the celebration of Mass and other liturgical services.
    Each color has specific liturgical significance and is used during particular seasons or celebrations.
    """

    red = "red"
    rose = "rose"
    purple = "purple"
    green = "green"
    white = "white"
    gold = "gold"
    black = "black"


class MassContent(BaseModel):
    """
    Content of a mass for a specific liturgical cycle
    Maps mass parts (readings, psalms, prayers, antiphons, etc.) to their texts
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    alleluia: str | None = None
    """
    Alleluia - acclamation before the Gospel
    """
    canticle: str | None = None
    """
    Canticle - biblical canticle
    """
    collect: str | None = None
    """
    Collect - opening prayer of the Mass
    """
    communion_antiphon: str | None = None
    """
    Communion Antiphon - chant during communion
    """
    easter_vigil_canticle_3: str | None = None
    """
    Canticle 3 (Easter Vigil)
    """
    easter_vigil_canticle_5: str | None = None
    """
    Canticle 5 (Easter Vigil)
    """
    easter_vigil_epistle: str | None = None
    """
    Epistle - reading from the epistles (Easter Vigil)
    """
    easter_vigil_psalm_2: str | None = None
    """
    Psalm 2 (Easter Vigil)
    """
    easter_vigil_psalm_4: str | None = None
    """
    Psalm 4 (Easter Vigil)
    """
    easter_vigil_psalm_6: str | None = None
    """
    Psalm 6 (Easter Vigil)
    """
    easter_vigil_psalm_7: str | None = None
    """
    Psalm 7 (Easter Vigil)
    """
    easter_vigil_reading_3: str | None = None
    """
    Reading 3 - third reading (Easter Vigil)
    """
    easter_vigil_reading_4: str | None = None
    """
    Reading 4 - fourth reading (Easter Vigil)
    """
    easter_vigil_reading_5: str | None = None
    """
    Reading 5 - fifth reading (Easter Vigil)
    """
    easter_vigil_reading_6: str | None = None
    """
    Reading 6 - sixth reading (Easter Vigil)
    """
    easter_vigil_reading_7: str | None = None
    """
    Reading 7 - seventh reading (Easter Vigil)
    """
    entrance_antiphon: str | None = None
    """
    Entrance Antiphon - opening chant of the Mass
    """
    gospel: str | None = None
    """
    Gospel - reading from the Gospels
    """
    messianic_entry: str | None = None
    """
    Messianic entry reading (during the procession with palms, before the Mass of the Passion)
    """
    prayer_after_communion: str | None = None
    """
    Prayer after Communion - concluding prayer
    """
    prayer_over_the_offerings: str | None = None
    """
    Prayer over the Offerings - prayer during the offertory
    """
    prayer_over_the_people: str | None = None
    """
    Prayer over the People - blessing over the congregation
    """
    preface: str | None = None
    """
    Preface - introduction to the Eucharistic Prayer
    """
    psalm: str | None = None
    """
    Psalm - responsorial psalm
    """
    reading_1: str | None = None
    """
    Reading 1 - first reading (usually from the Old Testament)
    """
    reading_2: str | None = None
    """
    Reading 2 - second reading (usually from the New Testament)
    """
    sequence: str | None = None
    """
    Sequence - special chant on certain feasts
    """
    solemn_blessing: str | None = None
    """
    Solemn Blessing - special blessing on certain occasions
    """


class OrdinalFormat(Enum):
    """
    Format for displaying ordinal numbers.

    - `Letters`: Display ordinals as words (e.g., "first", "second", "premier", "deuxième")
    - `Numeric`: Display ordinals as numbers with suffixes (e.g., "1st", "2nd", "1er", "2e")
    """

    letters = "letters"
    numeric = "numeric"


class LocaleColors(BaseModel):
    """
    Liturgical color names in the locale language.
    Provides localized names for each liturgical color.
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    black: str | None = None
    """
    Black color name in the locale language
    """
    gold: str | None = None
    """
    Gold color name in the locale language
    """
    green: str | None = None
    """
    Green color name in the locale language
    """
    purple: str | None = None
    """
    Purple color name in the locale language
    """
    red: str | None = None
    """
    Red color name in the locale language
    """
    rose: str | None = None
    """
    Rose color name in the locale language
    """
    white: str | None = None
    """
    White color name in the locale language
    """


class AdventSeason(BaseModel):
    """
    Advent season localized names and descriptions.
    Provides specific terminology for the Advent season in the locale language.
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    season: str | None = None
    """
    General season name for Advent
    """
    weekday: str | None = None
    """
    Weekday terminology during Advent
    """
    sunday: str | None = None
    """
    Sunday terminology during Advent
    """
    privileged_weekday: str | None = None
    """
    Privileged weekday terminology during Advent
    """


class ChristmasTimeSeason(BaseModel):
    """
    Christmas Time season localized names and descriptions.
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    season: str | None = None
    """
    General season name for Christmas Time
    """
    day: str | None = None
    """
    Day terminology during Christmas Time
    """
    octave: str | None = None
    """
    Octave terminology during Christmas Time
    """
    before_epiphany: str | None = None
    """
    Before Epiphany terminology
    """
    second_sunday_after_christmas: str | None = None
    """
    Second Sunday after Christmas terminology
    """
    after_epiphany: str | None = None
    """
    After Epiphany terminology
    """


class OrdinaryTimeSeason(BaseModel):
    """
    Ordinary Time season localized names and descriptions.
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    season: str | None = None
    """
    General season name for Ordinary Time
    """
    weekday: str | None = None
    """
    Weekday terminology during Ordinary Time
    """
    sunday: str | None = None
    """
    Sunday terminology during Ordinary Time
    """


class LentSeason(BaseModel):
    """
    Lent season localized names and descriptions.
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    season: str | None = None
    """
    General season name for Lent
    """
    weekday: str | None = None
    """
    Weekday terminology during Lent
    """
    sunday: str | None = None
    """
    Sunday terminology during Lent
    """
    day_after_ash_wed: str | None = None
    """
    Day after Ash Wednesday terminology
    """
    holy_week_day: str | None = None
    """
    Holy Week day terminology
    """


class PaschalTriduumSeason(BaseModel):
    """
    Paschal Triduum season localized names and descriptions.
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    season: str | None = None
    """
    General season name for Paschal Triduum
    """


class EasterTimeSeason(BaseModel):
    """
    Easter Time season localized names and descriptions.
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    season: str | None = None
    """
    General season name for Easter Time
    """
    weekday: str | None = None
    """
    Weekday terminology during Easter Time
    """
    sunday: str | None = None
    """
    Sunday terminology during Easter Time
    """
    octave: str | None = None
    """
    Octave terminology during Easter Time
    """


class PeriodsMetadata(BaseModel):
    """
    Liturgical period names in the locale language.
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    christmas_octave: str | None = None
    """
    Christmas Octave period name
    """
    days_before_epiphany: str | None = None
    """
    Days before Epiphany period name
    """
    days_from_epiphany: str | None = None
    """
    Days from Epiphany period name
    """
    christmas_to_presentation_of_the_lord: str | None = None
    """
    Christmas to Presentation of the Lord period name
    """
    presentation_of_the_lord_to_holy_thursday: str | None = None
    """
    Presentation of the Lord to Holy Thursday period name
    """
    holy_week: str | None = None
    """
    Holy Week period name
    """
    paschal_triduum: str | None = None
    """
    Paschal Triduum period name
    """
    easter_octave: str | None = None
    """
    Easter Octave period name
    """
    early_ordinary_time: str | None = None
    """
    Early Ordinary Time period name
    """
    late_ordinary_time: str | None = None
    """
    Late Ordinary Time period name
    """


class RanksMetadata(BaseModel):
    """
    Liturgical rank names in the locale language.
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    solemnity: str | None = None
    """
    Solemnity rank name
    """
    sunday: str | None = None
    """
    Sunday rank name
    """
    feast: str | None = None
    """
    Feast rank name
    """
    memorial: str | None = None
    """
    Memorial rank name
    """
    optional_memorial: str | None = None
    """
    Optional memorial rank name
    """
    weekday: str | None = None
    """
    Weekday rank name
    """


class CyclesMetadata(BaseModel):
    """
    Liturgical cycle names in the locale language.
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    proper_of_time: str | None = None
    """
    Proper of Time cycle name
    """
    proper_of_saints: str | None = None
    """
    Proper of Saints cycle name
    """
    sunday_year_a: str | None = None
    """
    Sunday Year A cycle name
    """
    sunday_year_b: str | None = None
    """
    Sunday Year B cycle name
    """
    sunday_year_c: str | None = None
    """
    Sunday Year C cycle name
    """
    weekday_year_1: str | None = None
    """
    Weekday Year 1 cycle name
    """
    weekday_year_2: str | None = None
    """
    Weekday Year 2 cycle name
    """
    psalter_week_1: str | None = None
    """
    Psalter Week 1 cycle name
    """
    psalter_week_2: str | None = None
    """
    Psalter Week 2 cycle name
    """
    psalter_week_3: str | None = None
    """
    Psalter Week 3 cycle name
    """
    psalter_week_4: str | None = None
    """
    Psalter Week 4 cycle name
    """


class EntityType(Enum):
    """
    The type of entity in the liturgical calendar.
    Defines whether the entity represents a person, place, or event.
    """

    person = "person"
    place = "place"
    event = "event"


class CanonizationLevel(Enum):
    """
    Canonization level indicating the official recognition status of a person.
    Defines whether someone is beatified (Blessed) or canonized (Saint).
    """

    blessed = "blessed"
    saint = "saint"


class SaintDateDef3(BaseModel):
    """
    Century specification (e.g., 12 for 12th century)
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    century: Annotated[int, Field(ge=0)]
    """
    The century number
    """


class SaintDate1(RootModel[int]):
    root: Annotated[int, Field(ge=0)]
    """
    Year only (e.g., 1234)
    """


class SaintDate(RootModel[SaintDate1 | str]):
    root: SaintDate1 | str
    """
    Saint date representation with different precision levels.
    Supports year-only, year-month, or full date specifications.
    """


class Sex(Enum):
    """
    Sex of a person.
    """

    male = "male"
    female = "female"


class Rank(Enum):
    """
    Liturgical rank indicating the importance and celebration style of a liturgical day
    """

    solemnity = "solemnity"
    sunday = "sunday"
    feast = "feast"
    memorial = "memorial"
    optional_memorial = "optional_memorial"
    weekday = "weekday"


class Season(Enum):
    """
    Liturgical seasons of the Church year.
    Represents the major periods that structure the liturgical calendar.
    """

    advent = "advent"
    christmas_time = "christmas_time"
    lent = "lent"
    paschal_triduum = "paschal_triduum"
    easter_time = "easter_time"
    ordinary_time = "ordinary_time"


class Period(Enum):
    """
    Specific periods within liturgical seasons.
    Defines sub-periods that have special liturgical characteristics or rules.
    """

    christmas_octave = "christmas_octave"
    days_before_epiphany = "days_before_epiphany"
    days_from_epiphany = "days_from_epiphany"
    christmas_to_presentation_of_the_lord = "christmas_to_presentation_of_the_lord"
    presentation_of_the_lord_to_holy_thursday = "presentation_of_the_lord_to_holy_thursday"
    holy_week = "holy_week"
    paschal_triduum = "paschal_triduum"
    easter_octave = "easter_octave"
    early_ordinary_time = "early_ordinary_time"
    late_ordinary_time = "late_ordinary_time"


class Common(Enum):
    """
    Common prayers and readings for different categories of saints and celebrations.
    Provides standardized liturgical texts for various types of commemorations.
    """

    none = "none"
    dedication_anniversary__inside = "dedication_anniversary__inside"
    dedication_anniversary__outside = "dedication_anniversary__outside"
    blessed_virgin_mary__ordinary_time = "blessed_virgin_mary__ordinary_time"
    blessed_virgin_mary__advent = "blessed_virgin_mary__advent"
    blessed_virgin_mary__christmas = "blessed_virgin_mary__christmas"
    blessed_virgin_mary__easter = "blessed_virgin_mary__easter"
    martyrs__outside_easter__several = "martyrs__outside_easter__several"
    martyrs__outside_easter__one = "martyrs__outside_easter__one"
    martyrs__easter__several = "martyrs__easter__several"
    martyrs__easter__one = "martyrs__easter__one"
    martyrs__missionary__several = "martyrs__missionary__several"
    martyrs__missionary__one = "martyrs__missionary__one"
    martyrs__virgin = "martyrs__virgin"
    martyrs__woman = "martyrs__woman"
    pastors__pope_or_bishop = "pastors__pope_or_bishop"
    pastors__bishop = "pastors__bishop"
    pastors__several = "pastors__several"
    pastors__one = "pastors__one"
    pastors__founder__one = "pastors__founder__one"
    pastors__founder__several = "pastors__founder__several"
    pastors__missionary = "pastors__missionary"
    doctors_of_the_church = "doctors_of_the_church"
    virgins__several = "virgins__several"
    virgins__one = "virgins__one"
    saints__all__several = "saints__all__several"
    saints__all__one = "saints__all__one"
    saints__abbot = "saints__abbot"
    saint__monk = "saint__monk"
    saints__nun = "saints__nun"
    saints__religious = "saints__religious"
    saints__mercy_works = "saints__mercy_works"
    saints__educators = "saints__educators"
    saints__holy_women = "saints__holy_women"


class ColorInfo(BaseModel):
    """
    Liturgical color information with localized name.
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    key: Color
    """
    The color key
    """
    name: str
    """
    The localized name of the color
    """


class MassTime(Enum):
    """
    Times of Mass celebrations in the liturgical calendar.
    Different Masses are celebrated at various times and occasions throughout the liturgical year.
    """

    easter_vigil = "easter_vigil"
    previous_evening_mass = "previous_evening_mass"
    night_mass = "night_mass"
    mass_at_dawn = "mass_at_dawn"
    morning_mass = "morning_mass"
    mass_of_the_passion = "mass_of_the_passion"
    celebration_of_the_passion = "celebration_of_the_passion"
    day_mass = "day_mass"
    chrism_mass = "chrism_mass"
    evening_mass_of_the_lords_supper = "evening_mass_of_the_lords_supper"


class SundayCycle(Enum):
    """
    A three-year cycle for Sunday Mass readings (and some solemnities), designated by A, B, or C.
    Each cycle begins on the First Sunday of Advent of the previous civil year and ends on Saturday
    after the Christ the King Solemnity. The cycles follow each other in alphabetical order.
    C year is always divisible by 3, A has remainder of 1, and B remainder of 2.
    """

    year_a = "year_a"
    year_b = "year_b"
    year_c = "year_c"


class WeekdayCycle(Enum):
    """
    A two-year cycle for the weekday Mass readings (also called Cycle I and Cycle II).
    Odd-numbered years are the Cycle I (year 1); even-numbered ones are the Cycle II (year 2).
    """

    year_1 = "year_1"
    year_2 = "year_2"


class PsalterWeekCycle(Enum):
    """
    [GILH §133] The four-week cycle of the psalter is coordinated with the liturgical year in such a way that
    on the First Sunday of Advent, the First Sunday in Ordinary Time, the First Sunday of Lent,
    and Easter Sunday the cycle is always begun again with Week 1 (others being omitted when necessary).
    """

    week_1 = "week_1"
    week_2 = "week_2"
    week_3 = "week_3"
    week_4 = "week_4"


class CalendarContext(Enum):
    """
    Calendar year context for date boundaries.

    Determines how the calendar year is structured and which dates are included
    in a given year's calendar output.
    """

    gregorian = "gregorian"
    liturgical = "liturgical"


class SundayCycleCombined(Enum):
    """
    Combined Sunday cycle for cases where readings can apply to multiple years.
    This allows for flexible configuration where the same readings can be used
    across different combinations of Sunday cycles.
    """

    year_a_b = "year_a_b"
    year_a_c = "year_a_c"
    year_b_c = "year_b_c"


class LiturgicalCycle(Enum):
    """
    Liturgical cycle for lectionary readings
    Includes both actual cycles (Year A, B, C, etc.) and invariant content
    """

    invariant = "invariant"
    year_a = "year_a"
    year_b = "year_b"
    year_c = "year_c"
    year_a_b = "year_a_b"
    year_a_c = "year_a_c"
    year_b_c = "year_b_c"
    year_1 = "year_1"
    year_2 = "year_2"


class Acclamation(Enum):
    """
    Acclamations used in liturgical celebrations.
    Acclamations are short liturgical responses or exclamations used during Mass.
    """

    alleluia = "alleluia"
    lent = "lent"
    mixed = "mixed"
    none = "none"


class BibleBook(Enum):
    """
    Books of the Bible using OSIS (Open Scripture Information Standard) identifiers.
    OSIS provides standardized abbreviations for biblical books used in liturgical and biblical applications.
    """

    Gen = "Gen"
    Exod = "Exod"
    Lev = "Lev"
    Num = "Num"
    Deut = "Deut"
    Josh = "Josh"
    Judg = "Judg"
    Ruth = "Ruth"
    field_1Sam = "1Sam"
    field_2Sam = "2Sam"
    field_1Kgs = "1Kgs"
    field_2Kgs = "2Kgs"
    field_1Chr = "1Chr"
    field_2Chr = "2Chr"
    Ezra = "Ezra"
    Neh = "Neh"
    Tob = "Tob"
    Jdt = "Jdt"
    Esth = "Esth"
    field_1Macc = "1Macc"
    field_2Macc = "2Macc"
    Job = "Job"
    Ps = "Ps"
    Prov = "Prov"
    Eccl = "Eccl"
    Song = "Song"
    Wis = "Wis"
    Sir = "Sir"
    Isa = "Isa"
    Jer = "Jer"
    Lam = "Lam"
    Bar = "Bar"
    EpJer = "EpJer"
    Ezek = "Ezek"
    Dan = "Dan"
    Hos = "Hos"
    Joel = "Joel"
    Amos = "Amos"
    Obad = "Obad"
    Jonah = "Jonah"
    Mic = "Mic"
    Nah = "Nah"
    Hab = "Hab"
    Zeph = "Zeph"
    Hag = "Hag"
    Zech = "Zech"
    Mal = "Mal"
    Matt = "Matt"
    Mark = "Mark"
    Luke = "Luke"
    John = "John"
    Acts = "Acts"
    Rom = "Rom"
    field_1Cor = "1Cor"
    field_2Cor = "2Cor"
    Gal = "Gal"
    Eph = "Eph"
    Phil = "Phil"
    Col = "Col"
    field_1Thess = "1Thess"
    field_2Thess = "2Thess"
    field_1Tim = "1Tim"
    field_2Tim = "2Tim"
    Titus = "Titus"
    Phlm = "Phlm"
    Heb = "Heb"
    Jas = "Jas"
    field_1Pet = "1Pet"
    field_2Pet = "2Pet"
    field_1John = "1John"
    field_2John = "2John"
    field_3John = "3John"
    Jude = "Jude"
    Rev = "Rev"


class MassPart(Enum):
    """
    Parts that make up the Mass celebration.
    Each part represents a specific element of the liturgical celebration.
    """

    messianic_entry = "messianic_entry"
    entrance_antiphon = "entrance_antiphon"
    collect = "collect"
    reading_1 = "reading_1"
    psalm = "psalm"
    canticle = "canticle"
    reading_2 = "reading_2"
    easter_vigil_psalm_2 = "easter_vigil_psalm_2"
    easter_vigil_reading_3 = "easter_vigil_reading_3"
    easter_vigil_canticle_3 = "easter_vigil_canticle_3"
    easter_vigil_reading_4 = "easter_vigil_reading_4"
    easter_vigil_psalm_4 = "easter_vigil_psalm_4"
    easter_vigil_reading_5 = "easter_vigil_reading_5"
    easter_vigil_canticle_5 = "easter_vigil_canticle_5"
    easter_vigil_reading_6 = "easter_vigil_reading_6"
    easter_vigil_psalm_6 = "easter_vigil_psalm_6"
    easter_vigil_reading_7 = "easter_vigil_reading_7"
    easter_vigil_psalm_7 = "easter_vigil_psalm_7"
    easter_vigil_epistle = "easter_vigil_epistle"
    sequence = "sequence"
    alleluia = "alleluia"
    gospel = "gospel"
    prayer_over_the_offerings = "prayer_over_the_offerings"
    preface = "preface"
    communion_antiphon = "communion_antiphon"
    prayer_after_communion = "prayer_after_communion"
    solemn_blessing = "solemn_blessing"
    prayer_over_the_people = "prayer_over_the_people"


class CalendarMetadata(BaseModel):
    """
    Metadata for a calendar.
    Contains essential information about the calendar's type and jurisdiction.
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    type: CalendarType
    """
    The type of the calendar
    """
    jurisdiction: CalendarJurisdiction
    """
    The jurisdiction of the calendar
    """


class ParticularConfig(BaseModel):
    """
    Configuration options for "particular" (local/diocesan) calendars.

    In liturgical terminology, a "particular" calendar is one that applies to a specific
    region, diocese, or religious community, as opposed to the General Roman Calendar
    which applies universally.

    These settings can override or extend the default Romcal configuration or any parent
    calendar configuration.
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    epiphany_on_sunday: bool | None = None
    """
    Epiphany is celebrated on a Sunday
    """
    ascension_on_sunday: bool | None = None
    """
    Ascension is celebrated on a Sunday
    """
    corpus_christi_on_sunday: bool | None = None
    """
    Corpus Christi is celebrated on a Sunday
    """
    easter_calculation_type: EasterCalculationType | None = None
    """
    The type of Easter calculation
    """


class DateDef1(BaseModel):
    """
    Simple month/day specification
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    month: MonthIndex
    """
    The month (1-12)
    """
    date: Annotated[int, Field(ge=0, le=255)]
    """
    The day of the month (1-31)
    """
    day_offset: int | None = None
    """
    Optional day offset for adjustments
    """


class DateDef2(BaseModel):
    """
    Date function calculation (Easter, Epiphany, etc.)
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    date_fn: DateFn
    """
    The date function to calculate the base date
    """
    day_offset: int | None = None
    """
    Optional day offset for adjustments
    """


class DateDef3(BaseModel):
    """
    Nth weekday of a specific month
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    month: MonthIndex
    """
    The month (1-12)
    """
    day_of_week: DayOfWeek
    """
    The day of the week (0=Sunday, 1=Monday, etc.)
    """
    nth_week_in_month: Annotated[int, Field(ge=0, le=255)]
    """
    Which occurrence of the weekday (1st, 2nd, 3rd, etc.)
    """
    day_offset: int | None = None
    """
    Optional day offset for adjustments
    """


class DateDef4(BaseModel):
    """
    Last weekday of a specific month
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    month: MonthIndex
    """
    The month (1-12)
    """
    last_day_of_week_in_month: DayOfWeek
    """
    The day of the week to find the last occurrence of
    """
    day_offset: int | None = None
    """
    Optional day offset for adjustments
    """


class DateDef(RootModel[DateDef1 | DateDef2 | DateDef3 | DateDef4 | dict[str, Any]]):
    root: DateDef1 | DateDef2 | DateDef3 | DateDef4 | dict[str, Any]
    """
    Date definition supporting various date calculation methods.
    Provides flexible ways to specify liturgical dates using different approaches.
    """


class ExceptionCondition1(BaseModel):
    """
    If the date is between two specified dates
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    from_: Annotated[DateDef, Field(alias="from")]
    """
    The start date of the range
    """
    to: DateDef
    """
    The end date of the range
    """
    inclusive: bool
    """
    Whether the range is inclusive of the start date and the end date
    """


class ExceptionCondition2(BaseModel):
    """
    If the date is the same as another specified date
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    date: DateDef
    """
    The date to compare against
    """


class ExceptionCondition(
    RootModel[ExceptionCondition1 | ExceptionCondition2 | ExceptionCondition3]
):
    root: ExceptionCondition1 | ExceptionCondition2 | ExceptionCondition3
    """
    Exception conditions that can trigger a date change.
    Defines various conditions under which a date exception applies.
    """


class DateDefExtended(RootModel[DateDef | DateDefWithOffset]):
    root: DateDef | DateDefWithOffset
    """
    Extended date definition supporting both regular dates and offset dates.
    Provides flexibility for date calculations with optional adjustments.
    """


class CommonsDef(RootModel[CommonDefinition | list[CommonDefinition]]):
    root: CommonDefinition | list[CommonDefinition]


class TitlesDef(RootModel[list[Title] | CompoundTitle]):
    root: list[Title] | CompoundTitle
    """
    Title definition that can be either a simple list or a compound definition.
    Supports both direct title lists and compound title operations.
    """


class ColorsDef(RootModel[Color | list[Color]]):
    root: Color | list[Color]


class MassCycleDefinition(BaseModel):
    """
    Mass contents for a specific mass time, organized by liturgical cycle
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    invariant: MassContent | None = None
    """
    Invariant content that applies to all cycles
    """
    year_1: MassContent | None = None
    """
    Year 1 of the weekday cycle (Cycle I)
    """
    year_2: MassContent | None = None
    """
    Year 2 of the weekday cycle (Cycle II)
    """
    year_a: MassContent | None = None
    """
    Year A of the Sunday cycle
    """
    year_a_b: MassContent | None = None
    """
    Combined years A and B of the Sunday cycle
    """
    year_a_c: MassContent | None = None
    """
    Combined years A and C of the Sunday cycle
    """
    year_b: MassContent | None = None
    """
    Year B of the Sunday cycle
    """
    year_b_c: MassContent | None = None
    """
    Combined years B and C of the Sunday cycle
    """
    year_c: MassContent | None = None
    """
    Year C of the Sunday cycle
    """


class SeasonsMetadata(BaseModel):
    """
    Liturgical season names and descriptions in the locale language.
    Provides localized names for each liturgical season and their components.
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    advent: AdventSeason | None = None
    """
    Advent season names and descriptions
    """
    christmas_time: ChristmasTimeSeason | None = None
    """
    Christmas Time season names and descriptions
    """
    ordinary_time: OrdinaryTimeSeason | None = None
    """
    Ordinary Time season names and descriptions
    """
    lent: LentSeason | None = None
    """
    Lent season names and descriptions
    """
    paschal_triduum: PaschalTriduumSeason | None = None
    """
    Paschal Triduum season names and descriptions
    """
    easter_time: EasterTimeSeason | None = None
    """
    Easter Time season names and descriptions
    """


class SaintDateDef1(BaseModel):
    """
    Date range between two dates
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    between: Annotated[list[SaintDate], Field(max_length=2, min_length=2)]
    """
    The date range (start and end dates)
    """


class SaintDateDef2(BaseModel):
    """
    Multiple alternative dates (any one of them)
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    or_: Annotated[list[SaintDate], Field(alias="or")]
    """
    The list of alternative dates
    """


class SaintDateDef(RootModel[SaintDate | SaintDateDef1 | SaintDateDef2 | SaintDateDef3]):
    root: SaintDate | SaintDateDef1 | SaintDateDef2 | SaintDateDef3
    """
    Saint date definition supporting various date specifications.
    Allows single dates, date ranges, multiple alternatives, or century specifications.
    """


class PeriodInfo(BaseModel):
    """
    Liturgical period information with localized name.
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    key: Period
    """
    The period key
    """
    name: str
    """
    The localized name of the period
    """


class CommonInfo(BaseModel):
    """
    Liturgical common information with localized name.
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    key: Common
    """
    The common key
    """
    name: str
    """
    The localized name of the common
    """


class MassInfo(BaseModel):
    """
    Information about a mass celebration for a liturgical day.
    Contains the type of mass and its localized name.
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    type: MassTime
    """
    The type of mass (e.g., DayMass, EasterVigil, etc.)
    Serialized as snake_case (e.g., "day_mass")
    """
    name: str
    """
    The localized name of the mass type (translation key in snake_case)
    """


class Entity(BaseModel):
    """
    An entity with a guaranteed ID.

    This struct is used for entities that have been resolved from the resources,
    where the ID is always present (e.g., in search results, liturgical days).
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    id: str
    """
    The unique identifier of the entity (required)
    """
    type: EntityType
    """
    The type of the entity.
    """
    fullname: str | None = None
    """
    The full name of the entity.
    """
    name: str | None = None
    """
    The short name of the entity, without the canonization level and titles.
    """
    canonization_level: CanonizationLevel | None = None
    """
    The canonization level of a person.
    """
    date_of_canonization: SaintDateDef | None = None
    """
    Date of Canonization.
    """
    date_of_canonization_is_approximative: bool | None = None
    """
    Specify whether an approximate indicator should be added for canonization date.
    """
    date_of_beatification: SaintDateDef | None = None
    """
    Date of Beatification.
    """
    date_of_beatification_is_approximative: bool | None = None
    """
    Specify whether an approximate indicator should be added for beatification date.
    """
    hide_canonization_level: bool | None = None
    """
    Specify if the canonization level should not be displayed.
    """
    titles: list[Title] | None = None
    """
    Titles of the Saint or the Blessed.
    """
    sex: Sex | None = None
    """
    Determine if the Saint or the Blessed is a male or a female.
    """
    hide_titles: bool | None = None
    """
    Specify if the titles should not be displayed.
    """
    date_of_dedication: SaintDateDef | None = None
    """
    Date of Dedication of a place of worship.
    """
    date_of_birth: SaintDateDef | None = None
    """
    Date of Birth.
    """
    date_of_birth_is_approximative: bool | None = None
    """
    Specify whether an approximate indicator should be added for birth date.
    """
    date_of_death: SaintDateDef | None = None
    """
    Date of Death.
    """
    date_of_death_is_approximative: bool | None = None
    """
    Specify whether an approximate indicator should be added for death date.
    """
    count: SaintCount | None = None
    """
    Number of persons that this definition represents.
    """
    sources: list[str] | None = None
    """
    Sources for the information about this entity.
    """


class CelebrationSummary(BaseModel):
    """
    Summary of a celebration for use in optional celebrations list.
    Contains the essential fields from a LiturgicalDay that identify a celebration.
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    id: str
    """
    The unique identifier of the liturgical day
    """
    fullname: str
    """
    The full name of the liturgical day
    """
    precedence: Precedence
    """
    The liturgical precedence for this liturgical day
    """
    rank: Rank
    """
    The liturgical rank for this liturgical day
    """
    rank_name: str
    """
    The localized liturgical rank for this liturgical day
    """
    colors: list[ColorInfo]
    """
    The liturgical colors for this liturgical day
    """
    commons: list[CommonInfo]
    """
    The common prayers/readings used for this celebration
    """
    entities: list[Entity]
    """
    The entities (Saints, Blessed, or Places) linked to this liturgical day
    """
    titles: TitlesDef
    """
    The titles for this liturgical day
    """
    is_holy_day_of_obligation: bool
    """
    Holy days of obligation
    """
    is_optional: bool
    """
    Indicates if this liturgical day is optional
    """
    from_calendar_id: str
    """
    The ID of the calendar where this liturgical day is defined
    """


class MassContext(BaseModel):
    """
    A flat structure representing a single mass with its full liturgical context.

    This is the main type for the mass-centric calendar view. It contains:
    - Mass identification (type, name, civil/liturgical dates)
    - Day-level context (season, cycles, periods)
    - Primary celebration data (flattened from LiturgicalDay)
    - Optional alternative celebrations

    For evening masses (Easter Vigil, Previous Evening Mass), the `civil_date`
    is shifted to the previous day while `liturgical_date` remains the original
    liturgical celebration date.
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    mass_time: MassTime
    """
    The type of mass (e.g., DayMass, EasterVigil, etc.)
    Serialized as snake_case (e.g., "day_mass")
    """
    mass_time_name: str
    """
    The localized name of the mass time (translation key in snake_case)
    """
    civil_date: str
    """
    The civil calendar date when this mass is celebrated (YYYY-MM-DD).
    For evening masses (EasterVigil, PreviousEveningMass), this is the day
    BEFORE the liturgical date.
    """
    liturgical_date: str
    """
    The liturgical date this mass belongs to (YYYY-MM-DD).
    This is the "theological" date of the celebration.
    """
    season: Season | None = None
    """
    The liturgical season
    """
    season_name: str | None = None
    """
    The localized season name
    """
    sunday_cycle: SundayCycle
    """
    The Sunday cycle (Year A, B, or C)
    """
    sunday_cycle_name: str
    """
    The localized Sunday cycle name
    """
    weekday_cycle: WeekdayCycle
    """
    The weekday cycle (Year 1 or 2)
    """
    weekday_cycle_name: str
    """
    The localized weekday cycle name
    """
    psalter_week: PsalterWeekCycle
    """
    The psalter week cycle (Week 1-4)
    """
    psalter_week_name: str
    """
    The localized psalter week name
    """
    week_of_season: Annotated[int | None, Field(ge=0)] = None
    """
    The week number within the liturgical season
    """
    day_of_season: Annotated[int | None, Field(ge=0)] = None
    """
    The day number within the liturgical season
    """
    day_of_week: DayOfWeek
    """
    The day of the week (0=Sunday to 6=Saturday)
    """
    periods: list[PeriodInfo]
    """
    The liturgical periods this day belongs to
    """
    start_of_season: str | None = None
    """
    The first day of the current liturgical season
    """
    end_of_season: str | None = None
    """
    The last day of the current liturgical season
    """
    start_of_liturgical_year: str
    """
    The first day of the liturgical year (first Sunday of Advent)
    """
    end_of_liturgical_year: str
    """
    The last day of the liturgical year
    """
    id: str
    """
    The unique identifier of the liturgical day
    """
    fullname: str
    """
    The full name of the liturgical day
    """
    precedence: Precedence
    """
    The liturgical precedence
    """
    rank: Rank
    """
    The liturgical rank
    """
    rank_name: str
    """
    The localized liturgical rank name
    """
    colors: list[ColorInfo]
    """
    The liturgical colors
    """
    commons: list[CommonInfo]
    """
    The common prayers/readings used
    """
    entities: list[Entity]
    """
    The entities (Saints, Blessed, or Places) linked to this day
    """
    titles: TitlesDef
    """
    The titles for this liturgical day
    """
    is_holy_day_of_obligation: bool
    """
    Whether this is a holy day of obligation
    """
    is_optional: bool
    """
    Whether this liturgical day is optional
    """
    from_calendar_id: str
    """
    The ID of the calendar where this liturgical day is defined
    """
    optional_celebrations: list[CelebrationSummary]
    """
    Optional alternative celebrations (e.g., optional memorials)
    that can be celebrated instead of the primary celebration.
    """


class DateDefException(BaseModel):
    """
    The liturgical day date exception.
    Represents a condition and the date to set when that condition is met.
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    when: ExceptionCondition
    """
    The condition that triggers the exception
    """
    then: DateDefExtended
    """
    The date to set when the condition is met
    """


class EntityOverride(BaseModel):
    """
    Custom entity definition that extends or overrides properties from the entity catalog.
    Used when a liturgical day needs specific entity properties that differ from the base entity.
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    id: str
    """
    The ID of the entity item (must reference an existing entity in the catalog)
    """
    titles: TitlesDef | None = None
    """
    The custom titles for this entity in the context of this liturgical day
    """
    hide_titles: bool | None = None
    """
    Whether to hide titles when displaying this entity (useful when titles are already included in the entity name)
    """
    count: SaintCount | None = None
    """
    The number of persons this entity represents (useful for groups of martyrs or saints)
    """


class MassesDefinitions(BaseModel):
    """
    All mass definitions for a liturgical day
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    celebration_of_the_passion: MassCycleDefinition | None = None
    """
    Celebration of the Passion - special celebration of Christ's passion
    """
    chrism_mass: MassCycleDefinition | None = None
    """
    Chrism Mass - Mass where holy oils are blessed, typically on Holy Thursday morning
    """
    day_mass: MassCycleDefinition | None = None
    """
    Day Mass - regular Mass celebrated during the day
    """
    easter_vigil: MassCycleDefinition | None = None
    """
    Easter Vigil - the most important Mass of the liturgical year, celebrated on Holy Saturday night
    """
    evening_mass_of_the_lords_supper: MassCycleDefinition | None = None
    """
    Evening Mass of the Lord's Supper - Mass celebrated on Holy Thursday evening
    """
    mass_at_dawn: MassCycleDefinition | None = None
    """
    Mass at Dawn - Mass celebrated at dawn, particularly on Easter Sunday
    """
    mass_of_the_passion: MassCycleDefinition | None = None
    """
    Mass of the Passion - Mass focusing on Christ's passion, beginning with the procession with palms
    """
    morning_mass: MassCycleDefinition | None = None
    """
    Morning Mass - Mass celebrated in the morning
    """
    night_mass: MassCycleDefinition | None = None
    """
    Night Mass - Mass celebrated during the night hours
    """
    previous_evening_mass: MassCycleDefinition | None = None
    """
    Previous Evening Mass - Mass celebrated the evening before a major feast
    """


class ResourcesMetadata(BaseModel):
    """
    Metadata for localized resources.
    Contains all the localized strings and configurations for a specific locale.
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    ordinal_format: OrdinalFormat | None = None
    """
    Format for displaying ordinal numbers (defaults to Numeric if not specified)
    """
    ordinals_letters: dict[str, Any] | None = None
    """
    Ordinal numbers as words (first, second, third, etc.) in the locale language
    """
    ordinals_numeric: dict[str, Any] | None = None
    """
    Ordinal numbers as numeric with suffix (1st, 2nd, 3rd, etc.) in the locale language
    """
    weekdays: dict[str, Any] | None = None
    """
    Weekday names (Sunday, Monday, etc.) in the locale language
    """
    months: dict[str, Any] | None = None
    """
    Month names (January, February, etc.) in the locale language
    """
    colors: LocaleColors | None = None
    """
    Liturgical color names in the locale language
    """
    seasons: SeasonsMetadata | None = None
    """
    Liturgical season names and descriptions in the locale language
    """
    periods: PeriodsMetadata | None = None
    """
    Liturgical period names in the locale language
    """
    ranks: RanksMetadata | None = None
    """
    Liturgical rank names in the locale language
    """
    cycles: CyclesMetadata | None = None
    """
    Liturgical cycle names in the locale language
    """


class EntityDefinition(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
    )
    type: EntityType | None = "person"
    """
    The type of the entity.

    Defaults to `EntityType::Person`.
    """
    fullname: str | None = None
    """
    The full name of the entity.
    """
    name: str | None = None
    """
    The short name of the entity, without the canonization level and titles.
    """
    canonization_level: CanonizationLevel | None = None
    """
    The canonization level of a person.
    """
    date_of_canonization: SaintDateDef | None = None
    """
    Date of Canonization, as a Number (year), a String (in 'YYYY-MM' or 'YYYY-MM-DD' format),
    or an object describing date range, multiple possible date, or a century.
    """
    date_of_canonization_is_approximative: bool | None = None
    """
    Specify whether an approximate indicator should be added, when the date is displayed.
    For example in English: 'c. 201'.
    """
    date_of_beatification: SaintDateDef | None = None
    """
    Date of Beatification, as a Number (year), a String (in 'YYYY-MM' or 'YYYY-MM-DD' format),
    or an object describing date range, multiple possible date, or a century.
    """
    date_of_beatification_is_approximative: bool | None = None
    """
    Specify whether an approximate indicator should be added, when the date is displayed.
    For example in English: 'c. 201'.
    """
    hide_canonization_level: bool | None = None
    """
    Specify if the canonization level should not be displayed.
    It's generally the case when the canonization are already included in the name.
    """
    titles: list[Title] | None = None
    """
    Titles of the Saint or the Blessed
    """
    sex: Sex | None = None
    """
    Determine if the Saint or the Blessed is a male or a female.
    """
    hide_titles: bool | None = None
    """
    Specify if the titles should not be displayed.
    It's generally the case when titles are already included in the name.
    """
    date_of_dedication: SaintDateDef | None = None
    """
    Date of Dedication of a church, basilica, or cathedral (or other place of worship),
    as a Number (year), a String (in 'YYYY-MM' or 'YYYY-MM-DD' format),
    or an object describing date range, multiple possible date, or a century.
    """
    date_of_birth: SaintDateDef | None = None
    """
    Date of Birth, as a Number (year), a String (in 'YYYY-MM' or 'YYYY-MM-DD' format),
    or an object describing date range, multiple possible date, or a century.
    """
    date_of_birth_is_approximative: bool | None = None
    """
    Specify whether an approximate indicator should be added, when the date is displayed.
    For example in English: 'c. 201'.
    """
    date_of_death: SaintDateDef | None = None
    """
    Date of Death, as a Number (year), a String (in 'YYYY-MM' or 'YYYY-MM-DD' format),
    or an object describing date range, multiple possible date, or a century.
    """
    date_of_death_is_approximative: bool | None = None
    """
    Specify whether an approximate indicator should be added, when the date is displayed.
    For example in English: 'c. 201'.
    """
    count: SaintCount | None = None
    """
    Number of person that this definition represent.
    It could be set as 'many' if the number is not defined.
    """
    sources: list[str] | None = None
    """
    Sources for the information about this entity
    """
    field_todo: Annotated[list[str] | None, Field(alias="_todo")] = None
    """
    Internal notes (not serialized).
    """


class ParentOverride(BaseModel):
    """
    Represents the differences between a liturgical day definition and its parent definition.
    This is a lightweight structure that only contains fields that can be overridden.
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    from_calendar_id: str
    """
    The ID of the calendar from which this override originates
    """
    date_def: DateDef | None = None
    """
    The date definition if it was changed
    """
    date_exceptions: list[DateDefException] | None = None
    """
    The date exceptions if they were changed
    """
    precedence: Precedence | None = None
    """
    The precedence if it was changed
    """
    rank: Rank | None = None
    """
    The rank if it was changed
    """
    colors: list[ColorInfo] | None = None
    """
    The colors if they were changed
    """
    titles: TitlesDef | None = None
    """
    The titles if they were changed
    """
    commons_def: list[CommonDefinition] | None = None
    """
    The commons definition if it was changed
    """
    is_holy_day_of_obligation: bool | None = None
    """
    The is_holy_day_of_obligation flag if it was changed
    """
    is_optional: bool | None = None
    """
    The is_optional flag if it was changed
    """
    allow_similar_rank_items: bool | None = None
    """
    The allow_similar_rank_items flag if it was changed
    """


class Resources(BaseModel):
    """
    Resources definition
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    field_schema: Annotated[str | None, Field(alias="$schema")] = None
    locale: str
    """
    Locale code of the resources, in BCP-47 IETF tag format
    """
    metadata: ResourcesMetadata | None = None
    """
    Metadata of the resources
    """
    entities: dict[str, Any] | None = None
    """
    Entities of the resources: a person, a place, an event, etc.
    """


class LiturgicalDay(BaseModel):
    """
    A single day in the liturgical calendar with computed values and inheritance information.
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    id: str
    """
    The unique identifier of the liturgical day
    """
    fullname: str
    """
    The full name of the liturgical day
    """
    date: str
    """
    The computed date of the liturgical day.
    """
    date_def: DateDef
    """
    The date definition for this liturgical day.
    """
    date_exceptions: list[DateDefException]
    """
    The date definition exceptions for this liturgical day.
    """
    precedence: Precedence
    """
    The liturgical precedence for this liturgical day.
    """
    rank: Rank
    """
    The liturgical rank for this liturgical day.
    """
    rank_name: str
    """
    The localized liturgical rank for this liturgical day.
    """
    allow_similar_rank_items: bool
    """
    Allows similar items with the same rank and same or lower precedence
    to coexist without this liturgical day overwriting them.
    """
    is_holy_day_of_obligation: bool
    """
    Holy days of obligation are days on which the faithful are expected to attend Mass,
    and engage in rest from work and recreation.
    """
    is_optional: bool
    """
    Indicates if this liturgical day is optional within a specific liturgical calendar.
    """
    season: Season | None = None
    """
    The liturgical seasons to which this liturgical day belongs.
    """
    season_name: str | None = None
    """
    The liturgical season name.
    """
    periods: list[PeriodInfo]
    """
    The liturgical periods to which this liturgical day belongs.
    """
    commons: list[CommonInfo]
    """
    The common prayers, readings, and chants used for celebrating saints or
    feasts that belong to a specific category, such as martyrs, virgins, pastors, or the Blessed
    Virgin Mary.
    """
    colors: list[ColorInfo]
    """
    The liturgical colors for this liturgical day.
    """
    masses: list[MassInfo]
    """
    The masses celebrated on this liturgical day.
    Most days have a single DayMass, but some have multiple masses
    (e.g., Christmas: PreviousEveningMass, NightMass, MassAtDawn, DayMass).
    Aliturgical days like Holy Saturday have an empty list.
    """
    titles: TitlesDef
    """
    The titles for this liturgical day.
    """
    entities: list[Entity]
    """
    The entities (Saints, Blessed, or Places) linked to this liturgical day.
    """
    week_of_season: Annotated[int | None, Field(ge=0)] = None
    """
    The week number of the current liturgical season.
    Starts from `1`, except in the seasons of lent,
    the week of Ash Wednesday to the next Saturday is counted as `0`.
    """
    day_of_season: Annotated[int | None, Field(ge=0)] = None
    """
    The day number within the current liturgical season.
    """
    day_of_week: DayOfWeek
    """
    The day of the week for this liturgical day.
    Returns a number from 0 (Sunday) to 6 (Saturday).
    """
    nth_day_of_week_in_month: Annotated[int, Field(ge=0, le=255)]
    """
    The nth occurrence of this day of the week within the current month.
    For example, the 3rd Sunday of the month would have nth_day_of_week_in_month = 3.
    """
    start_of_season: str | None = None
    """
    The first day of the current liturgical season for this liturgical day.
    """
    end_of_season: str | None = None
    """
    The last day of the current liturgical season for this liturgical day.
    """
    start_of_liturgical_year: str
    """
    The first day of the current liturgical year for this liturgical day,
    i.e. the first Sunday of Advent.
    """
    end_of_liturgical_year: str
    """
    The last day of the current liturgical year for this liturgical day,
    i.e. the last Saturday of Ordinary Time, in the 34th week.
    """
    sunday_cycle: SundayCycle
    """
    The Sunday cycle to which this liturgical day belongs.
    """
    sunday_cycle_name: str
    """
    The localized name of the Sunday cycle to which this liturgical day belongs.
    """
    weekday_cycle: WeekdayCycle
    """
    The weekday cycle to which this liturgical day belongs.
    """
    weekday_cycle_name: str
    """
    The localized name of the weekday cycle to which this liturgical day belongs.
    """
    psalter_week: PsalterWeekCycle
    """
    The psalter week cycle to which this liturgical day belongs.
    """
    psalter_week_name: str
    """
    The localized name of the psalter week cycle to which this liturgical day belongs.
    """
    from_calendar_id: str
    """
    The ID of the calendar where this liturgical day is defined.
    Indicates the source calendar in the inheritance chain.
    """
    parent_overrides: list[ParentOverride]
    """
    Contains the differences between this liturgical day and its parent definitions.
    Each element in the array represents the diff from a parent calendar definition.
    The array is ordered from most general (e.g., general_roman) to most specific.
    """


class DateDefExceptions(RootModel[DateDefException | list[DateDefException]]):
    root: DateDefException | list[DateDefException]
    """
    Date exceptions that can be either a single exception or multiple exceptions.
    Supports both simple single exceptions and complex multiple exception scenarios.
    """


class EntityRef(RootModel[str | EntityOverride]):
    root: str | EntityOverride
    """
    A reference to an entity in the entity catalog.
    Can either reference an existing entity by ID or define a custom entity with additional properties.
    """


class DayDefinition(BaseModel):
    """
    Definition of a liturgical day with all its properties and configurations.
    It represents a complete liturgical day definition that can be used
    to generate calendar entries with proper precedence, colors, and entity associations.
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    date_def: DateDef | None = None
    """
    The date definition for this liturgical day
    """
    date_exceptions: DateDefExceptions | None = None
    """
    The date definition exceptions (overrides for specific circumstances)
    """
    precedence: Precedence | None = None
    """
    The precedence type of the liturgical day
    """
    commons_def: CommonsDef | None = None
    """
    The **Common** refers to a set of prayers, readings, and chants used for celebrating saints or
    feasts that belong to a specific category, such as martyrs, virgins, pastors, or the Blessed
    Virgin Mary.
    """
    is_holy_day_of_obligation: bool | None = None
    """
    Holy days of obligation are days on which the faithful are expected to attend Mass
    and engage in rest from work and recreation
    """
    allow_similar_rank_items: bool | None = None
    """
    Allow similar items that have the same rank and the same or lower precedence
    to coexist with this liturgical day without being overwritten
    """
    is_optional: bool | None = None
    """
    Specify if this liturgical day is optional within a specific liturgical calendar

    UNLY #14:
    Memorials are either obligatory or optional; their observance is integrated into
    the celebration of the occurring weekday in accordance with the norms set forth in the
    General Instruction of the Roman Missal and of the Liturgy of the Hours

    Note: also used for the dedication of consecrated churches, which is an optional solemnity
    that should not overwrite the default weekday.
    """
    custom_locale_id: str | None = None
    """
    The custom locale ID for this date definition in this calendar
    """
    entities: list[EntityRef] | None = None
    """
    The entities (Saints, Blessed, or Places) linked from the Entity catalog
    """
    titles: TitlesDef | None = None
    """
    The combined titles of all entities linked to this date definition
    """
    drop: bool | None = None
    """
    If this liturgical day must be removed from this calendar and from all parent calendars
    in the final calendar generated by romcal
    """
    colors: ColorsDef | None = None
    """
    The liturgical color(s) of the liturgical day.

    **Deprecated:** Rely on the `titles` field of entities instead to determine the liturgical color(s).
    """
    masses: MassesDefinitions | None = None
    """
    The masses definitions for this liturgical day
    """


class CalendarDefinition(BaseModel):
    """
    Calendar definition
    """

    model_config = ConfigDict(
        extra="forbid",
    )
    field_schema: Annotated[str | None, Field(alias="$schema")] = None
    id: str
    metadata: CalendarMetadata
    particular_config: ParticularConfig | None = None
    parent_calendar_ids: list[str]
    days_definitions: dict[str, DayDefinition]


class AllTypes(BaseModel):
    liturgicalDay: LiturgicalDay | None = None
    calendarDefinition: CalendarDefinition | None = None
    resources: Resources | None = None
    massContext: MassContext | None = None
    celebrationSummary: CelebrationSummary | None = None
    calendarContext: CalendarContext | None = None
    sundayCycleCombined: SundayCycleCombined | None = None
    monthIndex: MonthIndex | None = None
    dayOfWeek: DayOfWeek | None = None
    dateDefWithOffset: DateDefWithOffset | None = None
    liturgicalCycle: LiturgicalCycle | None = None
    acclamation: Acclamation | None = None
    bibleBook: BibleBook | None = None
    massPart: MassPart | None = None
    saintCount: SaintCount | None = None
