# generated by update to not change manually
import dataclasses as dt
import typing as t
from enum import Enum
from bungieapi.json import to_json
[docs]class ForumTopicsCategoryFiltersEnum(Enum):
NONE = 0
LINKS = 1
QUESTIONS = 2
ANSWERED_QUESTIONS = 4
MEDIA = 8
TEXT_ONLY = 16
ANNOUNCEMENT = 32
BUNGIE_OFFICIAL = 64
POLLS = 128
[docs]class ForumTopicsQuickDateEnum(Enum):
ALL = 0
LAST_YEAR = 1
LAST_MONTH = 2
LAST_WEEK = 3
LAST_DAY = 4
[docs]class ForumTopicsSortEnum(Enum):
DEFAULT = 0
LAST_REPLIED = 1
MOST_REPLIED = 2
POPULARITY = 3
CONTROVERSIALITY = 4
LIKED = 5
HIGHEST_RATED = 6
MOST_UPVOTED = 7
[docs]@dt.dataclass(frozen=True)
class PostResponse:
is_pinned: t.Optional[bool] = None
ignore_status: t.Optional["IgnoreResponse"] = None
is_active: t.Optional[bool] = None
is_announcement: t.Optional[bool] = None
last_reply_timestamp: t.Optional[str] = None
latest_reply_author_id: t.Optional[int] = None
latest_reply_post_id: t.Optional[int] = None
locale: t.Optional[str] = None
popularity: t.Optional["ForumPostPopularity"] = None
thumbnail: t.Optional[str] = None
url_media_type: t.Optional["ForumMediaType"] = None
user_has_muted_post: t.Optional[bool] = None
user_has_rated: t.Optional[bool] = None
user_rating: t.Optional[int] = None
[docs] def to_json(self) -> t.Mapping[str, t.Any]:
return {
"lastReplyTimestamp": to_json(self.last_reply_timestamp),
"IsPinned": to_json(self.is_pinned),
"urlMediaType": to_json(self.url_media_type),
"thumbnail": to_json(self.thumbnail),
"popularity": to_json(self.popularity),
"isActive": to_json(self.is_active),
"isAnnouncement": to_json(self.is_announcement),
"userRating": to_json(self.user_rating),
"userHasRated": to_json(self.user_has_rated),
"userHasMutedPost": to_json(self.user_has_muted_post),
"latestReplyPostId": to_json(self.latest_reply_post_id),
"latestReplyAuthorId": to_json(self.latest_reply_author_id),
"ignoreStatus": to_json(self.ignore_status),
"locale": to_json(self.locale),
}
[docs]class ForumPostPopularity(Enum):
EMPTY = 0
DEFAULT = 1
DISCUSSED = 2
COOL_STORY = 3
HEATING_UP = 4
HOT = 5
[docs]@dt.dataclass(frozen=True)
class PostSearchResponse:
authors: t.Optional[t.Sequence["GeneralUser"]] = None
available_pages: t.Optional[int] = None
groups: t.Optional[t.Sequence["GroupResponse"]] = None
has_more: t.Optional[bool] = None
polls: t.Optional[t.Sequence["PollResponse"]] = None
query: t.Optional["PagedQuery"] = None
recruitment_details: t.Optional[t.Sequence["ForumRecruitmentDetail"]] = None
related_posts: t.Optional[t.Sequence["PostResponse"]] = None
replacement_continuation_token: t.Optional[str] = None
results: t.Optional[t.Sequence["PostResponse"]] = None
searched_tags: t.Optional[t.Sequence["TagResponse"]] = None
total_results: t.Optional[int] = None
use_total_results: t.Optional[
bool
] = None # If useTotalResults is true, then totalResults represents an accurate count. If False, it does not, and may be estimated/only the size of the current page. Either way, you should probably always only trust hasMore. This is a long-held historical throwback to when we used to do paging with known total results. Those queries toasted our database, and we were left to hastily alter our endpoints and create backward- compatible shims, of which useTotalResults is one.
[docs] def to_json(self) -> t.Mapping[str, t.Any]:
return {
"relatedPosts": to_json(self.related_posts),
"authors": to_json(self.authors),
"groups": to_json(self.groups),
"searchedTags": to_json(self.searched_tags),
"polls": to_json(self.polls),
"recruitmentDetails": to_json(self.recruitment_details),
"availablePages": to_json(self.available_pages),
"results": to_json(self.results),
"totalResults": to_json(self.total_results),
"hasMore": to_json(self.has_more),
"query": to_json(self.query),
"replacementContinuationToken": to_json(
self.replacement_continuation_token
),
"useTotalResults": to_json(self.use_total_results),
}
[docs]@dt.dataclass(frozen=True)
class PollResponse:
results: t.Optional[t.Sequence["PollResult"]] = None
topic_id: t.Optional[int] = None
total_votes: t.Optional[int] = None
[docs] def to_json(self) -> t.Mapping[str, t.Any]:
return {
"topicId": to_json(self.topic_id),
"results": to_json(self.results),
"totalVotes": to_json(self.total_votes),
}
[docs]@dt.dataclass(frozen=True)
class PollResult:
answer_slot: t.Optional[int] = None
answer_text: t.Optional[str] = None
last_vote_date: t.Optional[str] = None
requesting_user_voted: t.Optional[bool] = None
votes: t.Optional[int] = None
[docs] def to_json(self) -> t.Mapping[str, t.Any]:
return {
"answerText": to_json(self.answer_text),
"answerSlot": to_json(self.answer_slot),
"lastVoteDate": to_json(self.last_vote_date),
"votes": to_json(self.votes),
"requestingUserVoted": to_json(self.requesting_user_voted),
}
[docs]@dt.dataclass(frozen=True)
class ForumRecruitmentDetail:
fireteam: t.Optional[t.Sequence["GeneralUser"]] = None
approved: t.Optional[bool] = None
conversation_id: t.Optional[int] = None
intensity: t.Optional["ForumRecruitmentIntensityLabel"] = None
kicked_player_ids: t.Optional[t.Sequence[int]] = None
microphone_required: t.Optional[bool] = None
player_slots_remaining: t.Optional[int] = None
player_slots_total: t.Optional[int] = None
tone: t.Optional["ForumRecruitmentToneLabel"] = None
topic_id: t.Optional[int] = None
[docs] def to_json(self) -> t.Mapping[str, t.Any]:
return {
"topicId": to_json(self.topic_id),
"microphoneRequired": to_json(self.microphone_required),
"intensity": to_json(self.intensity),
"tone": to_json(self.tone),
"approved": to_json(self.approved),
"conversationId": to_json(self.conversation_id),
"playerSlotsTotal": to_json(self.player_slots_total),
"playerSlotsRemaining": to_json(self.player_slots_remaining),
"Fireteam": to_json(self.fireteam),
"kickedPlayerIds": to_json(self.kicked_player_ids),
}
[docs]class ForumRecruitmentIntensityLabel(Enum):
NONE = 0
CASUAL = 1
PROFESSIONAL = 2
[docs]class ForumRecruitmentToneLabel(Enum):
NONE = 0
FAMILY_FRIENDLY = 1
ROWDY = 2
[docs]class ForumPostSortEnum(Enum):
DEFAULT = 0
OLDEST_FIRST = 1
from bungieapi.generated.components.schemas.groups_v2 import GroupResponse # noqa: E402
# imported at the end to do not case circular imports for type annotations
from bungieapi.generated.components.schemas.ignores import IgnoreResponse # noqa: E402
from bungieapi.generated.components.schemas.queries import PagedQuery # noqa: E402
from bungieapi.generated.components.schemas.tags.models.contracts import (
TagResponse,
) # noqa: E402
from bungieapi.generated.components.schemas.user import GeneralUser # noqa: E402