Source code for sidequest_common.schemas.guild_hub

  1"""Guild hub v2 schemas: the addon export/import v2 sections and the ``/api/guild/*`` HTTP API.
  2
  3``local://addon-contract-v2.md`` is the source of truth; field names and string prefixes here are binding. Lua json
  4encoders drop nil keys rather than emitting null (see ``sidequest_common.schemas.epgp``), so every nullable
  5contract field here is a pydantic default, not a required key.
  6"""
  7
  8from datetime import datetime  # pydantic needs it at runtime
  9from enum import StrEnum
 10from typing import Annotated
 11from uuid import UUID  # pydantic needs it at runtime
 12
 13from pydantic import BaseModel, BeforeValidator, ConfigDict, Field
 14
 15from sidequest_common.schemas.characters import CHARACTER_SLUG_PATTERN, CharacterSummary
 16from sidequest_common.schemas.events import SignupRole, SignupStatus, WowClass
 17from sidequest_common.schemas.recruitment import GameImportRecruitPayout
 18
 19
 20def _lower_class(value: object) -> object:
 21    return value.lower() if isinstance(value, str) else value
 22
 23
 24GameClass = Annotated[WowClass, BeforeValidator(_lower_class)]
 25"""A class as the addon sends it: the game's uppercase token (``WARRIOR``), stored as the site's lowercase value."""
 26
 27MAX_ROSTER_MEMBERS = 1000
 28MAX_GUILD_RANKS = 10
 29MAX_PROFESSION_PAIRS = 1000
 30"""A 150-member guild with 2 primaries + 3 fixed secondaries (Cooking/Fishing/First Aid) each sends 750 pairs;
 311000 keeps headroom up to ``MAX_ROSTER_MEMBERS``."""
 32MAX_RECIPES_PER_PROFESSION = 2000
 33MAX_SIGNUPS_V2 = 500
 34MAX_BANK_ENTRIES = 2000
 35MAX_ANNOUNCEMENTS_V2 = 200
 36MAX_RECRUITS_V2 = 200
 37MAX_MEMBER_NOTES_V2 = 500
 38
 39ANNOUNCEMENT_TEXT_MAX = 500
 40NOTE_TEXT_MAX = 500
 41RECRUIT_NOTE_MAX = 500
 42
 43
[docs] 44class RecruitStatus(StrEnum): 45 """A recruiting candidate's status in the vetting pipeline.""" 46 47 APPLICANT = "applicant" 48 TRIAL = "trial" 49 ACCEPTED = "accepted" 50 DECLINED = "declined"
51 52
[docs] 53class RecruitVoteChoice(StrEnum): 54 """An officer's vote on a recruit.""" 55 56 YES = "yes" 57 NO = "no" 58 WAIT = "wait"
59 60
[docs] 61class BankKind(StrEnum): 62 """What kind of guild bank activity log row this is.""" 63 64 DEPOSIT = "deposit" 65 WITHDRAW = "withdraw" 66 MOVE = "move" 67 REPAIR = "repair" 68 BUY_TAB = "buy_tab" 69 DEPOSIT_MONEY = "deposit_money" 70 WITHDRAW_MONEY = "withdraw_money"
71 72
[docs] 73class AnnouncementSource(StrEnum): 74 """Where an announcement was made.""" 75 76 GAME = "game" 77 SITE = "site"
78 79
[docs] 80class NewsKind(StrEnum): 81 """What kind of guild news feed item this is.""" 82 83 BOSS_KILL = "boss_kill" 84 FIRST_KILL = "first_kill" 85 LOOT = "loot" 86 LEVEL = "level" 87 JOINED = "joined" 88 ANNOUNCEMENT = "announcement" 89 BADGE = "badge"
90 91 92LEVEL_MILESTONE_STEP = 10 93LEFT_GUILD_AFTER_DAYS = 30 94INACTIVE_AFTER_DAYS = 14 95 96 97# --- Addon export v2 (``SQX1:``, ``"v": 2``): new optional top-level arrays ------------------------------------ 98 99
[docs] 100class ExportRosterMember(BaseModel): 101 """One roster row in the export payload's ``roster.members``.""" 102 103 model_config = ConfigDict(populate_by_name=True) 104 105 character: str = Field(max_length=64) 106 rank: str = Field(max_length=60) 107 rank_index: int = 0 108 level: int = 0 109 wow_class: GameClass | None = Field(default=None, alias="class") 110 zone: str = Field(default="", max_length=120) 111 online: bool = False 112 last_online_hours: float = 0
113 114
[docs] 115class ExportRank(BaseModel): 116 """One guild rank in the export payload's ``roster.ranks``. 117 118 ``index`` is 0-based (0 = Guild Master, matching :attr:`ExportRosterMember.rank_index`). ``officer`` is 119 ``null`` when the addon could not read ``C_GuildInfo.GuildControlGetRankFlags`` (requires officer privileges). 120 """ 121 122 index: int = Field(ge=0, le=9) 123 name: str = Field(max_length=60) 124 officer: bool | None = None
125 126
[docs] 127class ExportRoster(BaseModel): 128 """The ``roster`` object in the export payload: one sweep, taken at ``taken_at``.""" 129 130 taken_at: int 131 members: list[ExportRosterMember] = Field(default_factory=list, max_length=MAX_ROSTER_MEMBERS) 132 ranks: list[ExportRank] = Field(default_factory=list, max_length=MAX_GUILD_RANKS)
133 134
[docs] 135class ExportRecipe(BaseModel): 136 """One known recipe in a profession scan.""" 137 138 id: int 139 name: str = Field(max_length=120) 140 item_id: int | None = None
141 142
[docs] 143class ExportProfession(BaseModel): 144 """One character's profession scan in the export payload.""" 145 146 character: str = Field(max_length=64) 147 profession: str = Field(max_length=40) 148 skill: int = 0 149 max_skill: int = 0 150 scanned_at: int 151 recipes: list[ExportRecipe] = Field(default_factory=list, max_length=MAX_RECIPES_PER_PROFESSION)
152 153
[docs] 154class ExportSignupV2(BaseModel): 155 """One in-game sign-up relayed by an officer's addon.""" 156 157 model_config = ConfigDict(populate_by_name=True) 158 159 id: str = Field(max_length=120) 160 event_id: UUID 161 character: str = Field(max_length=64) 162 status: SignupStatus 163 role: SignupRole | None = None 164 wow_class: GameClass | None = Field(default=None, alias="class") 165 comment: str | None = Field(default=None, max_length=200) 166 at: int
167 168
[docs] 169class ExportBankEntry(BaseModel): 170 """One guild bank log row.""" 171 172 id: str = Field(max_length=120) 173 at: int 174 character: str | None = Field(default=None, max_length=64) 175 kind: BankKind 176 item_id: int | None = None 177 item_name: str | None = Field(default=None, max_length=120) 178 count: int = 0 179 money: int = 0 180 tab: int | None = None
181 182
[docs] 183class ExportAnnouncement(BaseModel): 184 """One announcement posted in game.""" 185 186 id: str = Field(max_length=120) 187 text: str = Field(max_length=ANNOUNCEMENT_TEXT_MAX) 188 officer: str = Field(max_length=64) 189 at: int 190 discord: bool = False
191 192
[docs] 193class RecruitChecklist(BaseModel): 194 """An officer's vetting checklist for one recruit.""" 195 196 talked: bool = False 197 gear_check: bool = False 198 first_raid: bool = False 199 vouched: bool = False
200 201
[docs] 202class ExportRecruitVote(BaseModel): 203 """One officer's vote on a recruit, within the export payload.""" 204 205 officer: str = Field(max_length=64) 206 vote: RecruitVoteChoice 207 at: int
208 209
[docs] 210class ExportRecruit(BaseModel): 211 """One recruiting candidate in the export payload.""" 212 213 model_config = ConfigDict(populate_by_name=True) 214 215 id: str = Field(max_length=120) 216 character: str = Field(max_length=64) 217 wow_class: GameClass | None = Field(default=None, alias="class") 218 status: RecruitStatus 219 note: str | None = Field(default=None, max_length=RECRUIT_NOTE_MAX) 220 checklist: RecruitChecklist = Field(default_factory=RecruitChecklist) 221 votes: list[ExportRecruitVote] = Field(default_factory=list) 222 at: int
223 224
[docs] 225class ExportMemberNote(BaseModel): 226 """One officer note about a character.""" 227 228 id: str = Field(max_length=120) 229 character: str = Field(max_length=64) 230 note: str = Field(max_length=NOTE_TEXT_MAX) 231 officer: str = Field(max_length=64) 232 at: int 233 voided: bool = False
234 235 236# --- Import counts (added to ``EpgpImportResult``) -------------------------------------------------------------- 237 238
[docs] 239class RosterImportCounts(BaseModel): 240 """Count of roster rows upserted by one import.""" 241 242 updated: int = 0
243 244
[docs] 245class ProfessionImportCounts(BaseModel): 246 """Count of profession rows upserted by one import.""" 247 248 updated: int = 0
249 250
[docs] 251class SignupImportCounts(BaseModel): 252 """Counts for the ``signups`` section of one import.""" 253 254 applied: int = 0 255 skipped_older: int = 0 256 unlinked: int = 0
257 258
[docs] 259class BankImportCounts(BaseModel): 260 """Counts for the ``bank`` section of one import. 261 262 ``merged`` counts rows another officer had already sent (the same game row, matched within two hours). 263 """ 264 265 new: int = 0 266 merged: int = 0
267 268
[docs] 269class AnnouncementImportCounts(BaseModel): 270 """Count of new announcement rows inserted by one import.""" 271 272 new: int = 0
273 274
[docs] 275class RecruitImportCounts(BaseModel): 276 """Counts for the ``recruits`` section of one import.""" 277 278 new: int = 0 279 updated: int = 0
280 281
[docs] 282class MemberNoteImportCounts(BaseModel): 283 """Counts for the ``member_notes`` section of one import.""" 284 285 new: int = 0 286 updated: int = 0 287 voided: int = 0
288 289 290# --- Site import v2 (``SQI1:``, additions): public, on-demand, and officer-only parts ---------------------------- 291 292
[docs] 293class GameImportProfession(BaseModel): 294 """One character's profession and skill, from its stored Battle.net sheet.""" 295 296 name: str 297 skill: int 298 max_skill: int
299 300
[docs] 301class GameImportReputation(BaseModel): 302 """One character's standing with a faction, from its stored Battle.net sheet. 303 304 ``faction_id`` matches the addon's ``SideQuest.Data.REPUTATIONS`` table. ``standing`` is the WoW reaction index 305 (1 Hated .. 8 Exalted); ``value``/``max`` are progress within that standing. 306 """ 307 308 faction_id: int 309 standing: int 310 value: int 311 max: int
312 313
[docs] 314class GameImportCharacter(BaseModel): 315 """One of a member's characters in the ``members`` game-import section.""" 316 317 model_config = ConfigDict(populate_by_name=True, serialize_by_alias=True) 318 319 name: str 320 wow_class: WowClass | None = Field(default=None, alias="class") 321 level: int 322 is_main: bool 323 item_level: int | None = Field( 324 default=None, description="Battle.net equipped average item level, when a profile has been fetched." 325 ) 326 spec: str | None = Field(default=None, description="Battle.net active specialization, when a profile exists.") 327 professions: list[GameImportProfession] = Field( 328 default_factory=list, description="Battle.net professions, when a profile exists." 329 ) 330 reputations: list[GameImportReputation] = Field( 331 default_factory=list, description="Battle.net tracked reputations, when a profile exists." 332 )
333 334
[docs] 335class GameImportBadgeRef(BaseModel): 336 """One earned badge's id and display name.""" 337 338 id: str 339 name: str
340 341
[docs] 342class GameImportMember(BaseModel): 343 """One ``members`` row in the game-import payload's public part.""" 344 345 member_id: int 346 name: str 347 main: str | None 348 wow_class: WowClass | None = Field(default=None, alias="class", serialization_alias="class") 349 rank: str | None 350 raid_status: str | None 351 guild_ep: int = Field(description="Effort points (EP, shown as Renown on the site) on the guild's standings.") 352 attendance_rate: float = Field(description="Attended divided by signed-up for completed events in range.") 353 events_attended: int 354 badges: list[GameImportBadgeRef] 355 characters: list[GameImportCharacter] 356 357 model_config = ConfigDict(populate_by_name=True, serialize_by_alias=True)
358 359
[docs] 360class GameImportNews(BaseModel): 361 """One ``news`` row in the game-import payload's public part.""" 362 363 id: str 364 at: int 365 kind: NewsKind 366 text: str 367 character: str | None 368 item_id: int | None 369 quality: int | None
370 371
[docs] 372class GameImportLedgerEntry(BaseModel): 373 """One ledger row in a member's on-demand sheet.""" 374 375 at: int 376 kind: str 377 amount: int = Field(description="EP or GP change, as set by kind.") 378 decayed: float = Field(description="The amount after weekly decay has been applied, read-time only.") 379 reason: str 380 note: str | None
381 382
[docs] 383class GameImportLootEntry(BaseModel): 384 """One loot row in a member's on-demand sheet.""" 385 386 at: int 387 item_id: int 388 item_name: str 389 quality: int 390 gp: int = Field(description="Gear points (GP) this item cost.") 391 response: str
392 393
[docs] 394class GameImportSheet(BaseModel): 395 """One member's on-demand sheet: last 15 ledger entries and last 10 loot wins.""" 396 397 ledger: list[GameImportLedgerEntry] 398 loot: list[GameImportLootEntry]
399 400
[docs] 401class GameImportCrafter(BaseModel): 402 """One character's profession, recipes as ids (named in the shared ``recipe_names`` table).""" 403 404 character: str 405 member_id: int | None 406 profession: str 407 skill: int 408 recipes: list[int]
409 410
[docs] 411class GameImportOfficerRecruit(BaseModel): 412 """One recruit in the officer-only game-import part: same shape as the export, plus ``member_id``.""" 413 414 model_config = ConfigDict(populate_by_name=True, serialize_by_alias=True) 415 416 id: str 417 character: str 418 wow_class: WowClass | None = Field(default=None, alias="class", serialization_alias="class") 419 status: RecruitStatus 420 note: str | None 421 checklist: RecruitChecklist 422 votes: list[ExportRecruitVote] 423 at: int 424 member_id: int | None
425 426
[docs] 427class GameImportOfficerNote(BaseModel): 428 """One note in the officer-only game-import part: same shape as the export.""" 429 430 id: str 431 character: str 432 note: str 433 officer: str 434 at: int 435 voided: bool
436 437
[docs] 438class GameImportInactiveMember(BaseModel): 439 """One inactive member flagged in the officer-only game-import part.""" 440 441 member_id: int 442 name: str 443 last_seen_at: int | None 444 last_raid_at: int | None 445 level: int | None = None
446 447
[docs] 448class GameImportUnseenMember(BaseModel): 449 """One guild member with no roster sweep, Battle.net login, or raid presence on record at all.""" 450 451 member_id: int 452 name: str
453 454
[docs] 455class GameImportOfficerPart(BaseModel): 456 """The officer-only part of the game-import payload, never broadcast to the whole guild.""" 457 458 recruits: list[GameImportOfficerRecruit] 459 member_notes: list[GameImportOfficerNote] 460 inactive: list[GameImportInactiveMember] 461 unseen: list[GameImportUnseenMember] = Field(default_factory=list) 462 recruit_payouts: list[GameImportRecruitPayout] = Field(default_factory=list) 463 """Settled recruitment drive payouts still owed, grouped per (event, inviter); additive, older addons ignore it."""
464 465 466# --- ``/api/guild/*`` HTTP API schemas --------------------------------------------------------------------------- 467 468
[docs] 469class GuildRosterCharacter(BaseModel): 470 """One of a member's characters on ``GET /api/guild/roster``.""" 471 472 model_config = ConfigDict(populate_by_name=True, serialize_by_alias=True) 473 474 name: str 475 wow_class: WowClass | None = Field(default=None, alias="class", serialization_alias="class") 476 level: int 477 zone: str 478 last_seen_at: datetime 479 is_main: bool
480 481
[docs] 482class GuildRosterMember(BaseModel): 483 """One member's row on ``GET /api/guild/roster``, alts grouped under their main.""" 484 485 member_id: int 486 name: str 487 rank: str | None 488 raid_status: str | None 489 main: str | None 490 characters: list[GuildRosterCharacter]
491 492
[docs] 493class GuildRosterUnlinked(BaseModel): 494 """One roster-only character with no linked member, on ``GET /api/guild/roster``.""" 495 496 name: str 497 wow_class: WowClass | None = Field(default=None, alias="class", serialization_alias="class") 498 level: int 499 rank: str 500 last_seen_at: datetime 501 502 model_config = ConfigDict(populate_by_name=True, serialize_by_alias=True)
503 504
[docs] 505class GuildRoster(BaseModel): 506 """Response for ``GET /api/guild/roster`` (member).""" 507 508 taken_at: datetime | None 509 members: list[GuildRosterMember] 510 unlinked: list[GuildRosterUnlinked]
511 512
[docs] 513class GuildOfficerRow(BaseModel): 514 """One officer on ``GET /api/guild/officers`` (public).""" 515 516 model_config = ConfigDict(populate_by_name=True, serialize_by_alias=True) 517 518 character: str 519 name: str 520 rank: str 521 rank_index: int 522 wow_class: WowClass | None = Field(default=None, alias="class", serialization_alias="class") 523 level: int 524 online: bool 525 last_seen_at: datetime | None
526 527
[docs] 528class GuildOfficers(BaseModel): 529 """Response for ``GET /api/guild/officers`` (public), sorted by rank then name.""" 530 531 officers: list[GuildOfficerRow]
532 533
[docs] 534class GuildCrafterRow(BaseModel): 535 """One character that knows a matched recipe, in ``GET /api/guild/crafters``.""" 536 537 character: str 538 member_id: int | None 539 member_name: str | None 540 profession: str 541 skill: int
542 543
[docs] 544class GuildCrafterResult(BaseModel): 545 """One matched recipe and the characters that know it.""" 546 547 recipe_id: int 548 recipe_name: str 549 item_id: int | None 550 battlenet_recipe_id: int | None = Field( 551 default=None, description="The matching Battle.net recipe id, if Battle.net was reachable. Links to /recipes/." 552 ) 553 crafters: list[GuildCrafterRow]
554 555
[docs] 556class GuildCrafterProfessionCount(BaseModel): 557 """How many characters know each profession, for the ``professions`` filter list.""" 558 559 profession: str 560 crafters: int
561 562
[docs] 563class GuildCrafters(BaseModel): 564 """Response for ``GET /api/guild/crafters`` (member).""" 565 566 results: list[GuildCrafterResult] 567 professions: list[GuildCrafterProfessionCount]
568 569
[docs] 570class GuildNewsItem(BaseModel): 571 """One row of ``GET /api/guild/news`` (public).""" 572 573 id: UUID 574 at: datetime 575 kind: NewsKind 576 text: str 577 character: str | None 578 item_id: int | None 579 quality: int | None
580 581
[docs] 582class GuildNewsPage(BaseModel): 583 """Response for ``GET /api/guild/news`` (public), newest first.""" 584 585 items: list[GuildNewsItem]
586 587
[docs] 588class GuildBankRow(BaseModel): 589 """One row of ``GET /api/guild/bank`` (member).""" 590 591 id: UUID 592 at: datetime 593 character: str | None 594 member_name: str | None 595 kind: BankKind 596 item_id: int | None 597 item_name: str | None 598 count: int 599 money: int 600 tab: int | None
601 602
[docs] 603class GuildBankTotals(BaseModel): 604 """Deposit/withdrawal totals over the last 30 days, for ``GET /api/guild/bank``.""" 605 606 deposits_30d: int 607 withdrawals_30d: int
608 609
[docs] 610class GuildBankPage(BaseModel): 611 """Response for ``GET /api/guild/bank`` (member), newest first.""" 612 613 rows: list[GuildBankRow] 614 totals: GuildBankTotals
615 616
[docs] 617class GuildBankContributorItem(BaseModel): 618 """One item a player has put into or taken out of the guild bank.""" 619 620 item_id: int = Field(description="The item's game ID.") 621 item_name: str | None = Field(description="The item's name, when the site knows it.") 622 given: int = Field(description="How many of it the player deposited.") 623 taken: int = Field(description="How many of it the player withdrew.")
624 625
[docs] 626class GuildBankContributor(BaseModel): 627 """One player's guild bank totals: every character of a site member together, otherwise one character.""" 628 629 member_name: str | None = Field(description="The site member's name, or null for a character no one has claimed.") 630 characters: list[str] = Field(description="The characters whose bank use is counted here, by character key.") 631 gold_in: int = Field(description="Gold deposited, in copper.") 632 gold_out: int = Field(description="Gold withdrawn, in copper, not counting repairs.") 633 repairs: int = Field(description="Repairs paid for by the guild bank, in copper.") 634 items_in: int = Field(description="Items deposited.") 635 items_out: int = Field(description="Items withdrawn.") 636 item_value: int = Field( 637 description="What the deposited items would fetch at the guild's faction auction houses now, in copper. " 638 "Items with no current auction price add nothing." 639 ) 640 last_at: datetime = Field(description="When this player last used the guild bank.") 641 items: list[GuildBankContributorItem] = Field( 642 description="Every item this player has deposited or withdrawn, most deposited first." 643 )
644 645
[docs] 646class GuildBankContributors(BaseModel): 647 """Response for ``GET /api/guild/bank/contributors`` (member): biggest giver first. 648 649 Ranked by gold deposited plus ``item_value``, then items deposited. Moving items between tabs and buying a tab 650 count for no one. 651 """ 652 653 since: datetime | None = Field(description="The earliest bank log row counted, or null before any were synced.") 654 rows: list[GuildBankContributor]
655 656
[docs] 657class GuildAnnouncementRow(BaseModel): 658 """One row of ``GET /api/guild/announcements`` (public).""" 659 660 id: UUID 661 text: str 662 author: str 663 at: datetime 664 source: AnnouncementSource 665 posted_at: datetime | None
666 667
[docs] 668class GuildAnnouncementsPage(BaseModel): 669 """Response for ``GET /api/guild/announcements`` (public), newest first, last 20.""" 670 671 items: list[GuildAnnouncementRow]
672 673
[docs] 674class GuildAnnouncementCreate(BaseModel): 675 """Body for ``POST /api/guild/announcements`` (officer).""" 676 677 text: str = Field(min_length=1, max_length=ANNOUNCEMENT_TEXT_MAX) 678 discord: bool = False
679 680 681# --- Officer recruiting + notes HTTP API schemas ------------------------------------------------------------- 682 683
[docs] 684class EpgpRecruitRow(BaseModel): 685 """One recruit, as returned by ``GET /api/epgp/recruits`` / mutated by ``PUT .../{id}``.""" 686 687 model_config = ConfigDict(populate_by_name=True, serialize_by_alias=True) 688 689 id: UUID 690 character: str 691 wow_class: WowClass | None = Field(default=None, alias="class", serialization_alias="class") 692 status: RecruitStatus 693 note: str | None 694 checklist: RecruitChecklist 695 votes: list[ExportRecruitVote] 696 member_id: int | None 697 at: datetime 698 slug: str | None = None 699 """The recruit's Battle.net character, as an officer set it.""" 700 battlenet: CharacterSummary | None = None 701 """That character as Battle.net last showed it: guild, level, item level, spec, last login. ``None`` until an 702 officer sets ``slug``, or while Battle.net has never answered for it."""
703 704
[docs] 705class EpgpRecruitList(BaseModel): 706 """Response for ``GET /api/epgp/recruits`` (officer).""" 707 708 recruits: list[EpgpRecruitRow]
709 710
[docs] 711class EpgpRecruitUpdate(BaseModel): 712 """Body for ``PUT /api/epgp/recruits/{id}`` (officer). Only fields present change.""" 713 714 status: RecruitStatus | None = None 715 note: str | None = Field(default=None, max_length=RECRUIT_NOTE_MAX) 716 checklist: RecruitChecklist | None = None 717 slug: str | None = Field( 718 default=None, 719 max_length=50, 720 pattern=CHARACTER_SLUG_PATTERN, 721 description="The recruit's Battle.net `name-surname`; setting it looks the character up. `null` clears it.", 722 )
723 724
[docs] 725class EpgpRecruitVoteCreate(BaseModel): 726 """Body for ``POST /api/epgp/recruits/{id}/votes`` (officer).""" 727 728 vote: RecruitVoteChoice
729 730
[docs] 731class EpgpMemberNoteRow(BaseModel): 732 """One row of ``GET /api/epgp/member-notes`` (officer).""" 733 734 id: UUID 735 character: str 736 member_id: int | None 737 note: str 738 officer: str 739 at: datetime 740 voided: bool
741 742
[docs] 743class EpgpMemberNoteList(BaseModel): 744 """Response for ``GET /api/epgp/member-notes`` (officer).""" 745 746 notes: list[EpgpMemberNoteRow]
747 748 749# --- Bot: pending announcements ---------------------------------------------------------------------------------- 750 751
[docs] 752class PendingAnnouncement(BaseModel): 753 """One queued Discord announcement, for ``GET /api/guilds/{guild_id}/announcements/pending`` (bot).""" 754 755 id: UUID 756 text: str 757 author: str 758 at: datetime
759 760
[docs] 761class PendingAnnouncementsPage(BaseModel): 762 """Response for ``GET /api/guilds/{guild_id}/announcements/pending`` (bot).""" 763 764 items: list[PendingAnnouncement]
765 766
[docs] 767class AnnouncementPosted(BaseModel): 768 """Body for ``POST /api/guilds/{guild_id}/announcements/{id}/posted`` (bot).""" 769 770 message_id: int
771 772
[docs] 773class AnnouncementPostedResult(BaseModel): 774 """Response for ``POST /api/guilds/{guild_id}/announcements/{id}/posted`` (bot).""" 775 776 message_id: int
777 778 779__all__ = ( 780 "ANNOUNCEMENT_TEXT_MAX", 781 "INACTIVE_AFTER_DAYS", 782 "LEFT_GUILD_AFTER_DAYS", 783 "LEVEL_MILESTONE_STEP", 784 "MAX_ANNOUNCEMENTS_V2", 785 "MAX_BANK_ENTRIES", 786 "MAX_GUILD_RANKS", 787 "MAX_MEMBER_NOTES_V2", 788 "MAX_PROFESSION_PAIRS", 789 "MAX_RECIPES_PER_PROFESSION", 790 "MAX_RECRUITS_V2", 791 "MAX_ROSTER_MEMBERS", 792 "MAX_SIGNUPS_V2", 793 "NOTE_TEXT_MAX", 794 "RECRUIT_NOTE_MAX", 795 "AnnouncementImportCounts", 796 "AnnouncementPosted", 797 "AnnouncementPostedResult", 798 "AnnouncementSource", 799 "BankImportCounts", 800 "BankKind", 801 "EpgpMemberNoteList", 802 "EpgpMemberNoteRow", 803 "EpgpRecruitList", 804 "EpgpRecruitRow", 805 "EpgpRecruitUpdate", 806 "EpgpRecruitVoteCreate", 807 "ExportAnnouncement", 808 "ExportBankEntry", 809 "ExportMemberNote", 810 "ExportProfession", 811 "ExportRank", 812 "ExportRecipe", 813 "ExportRecruit", 814 "ExportRecruitVote", 815 "ExportRoster", 816 "ExportRosterMember", 817 "ExportSignupV2", 818 "GameImportBadgeRef", 819 "GameImportCharacter", 820 "GameImportCrafter", 821 "GameImportInactiveMember", 822 "GameImportLedgerEntry", 823 "GameImportLootEntry", 824 "GameImportMember", 825 "GameImportNews", 826 "GameImportOfficerNote", 827 "GameImportOfficerPart", 828 "GameImportOfficerRecruit", 829 "GameImportProfession", 830 "GameImportReputation", 831 "GameImportSheet", 832 "GameImportUnseenMember", 833 "GuildAnnouncementCreate", 834 "GuildAnnouncementRow", 835 "GuildAnnouncementsPage", 836 "GuildBankContributor", 837 "GuildBankContributorItem", 838 "GuildBankContributors", 839 "GuildBankPage", 840 "GuildBankRow", 841 "GuildBankTotals", 842 "GuildCrafterProfessionCount", 843 "GuildCrafterResult", 844 "GuildCrafterRow", 845 "GuildCrafters", 846 "GuildNewsItem", 847 "GuildNewsPage", 848 "GuildOfficerRow", 849 "GuildOfficers", 850 "GuildRoster", 851 "GuildRosterCharacter", 852 "GuildRosterMember", 853 "GuildRosterUnlinked", 854 "MemberNoteImportCounts", 855 "NewsKind", 856 "PendingAnnouncement", 857 "PendingAnnouncementsPage", 858 "ProfessionImportCounts", 859 "RecruitChecklist", 860 "RecruitImportCounts", 861 "RecruitStatus", 862 "RecruitVoteChoice", 863 "RosterImportCounts", 864 "SignupImportCounts", 865)