# generated by update to not change manually
import typing as t
from bungieapi.base import BaseClient
from bungieapi.forge import forge
from bungieapi.generated.components.responses import (
CEListOfForumRecruitmentDetailClientResponse,
ListOfTagClientResponse,
int64ClientResponse,
)
from bungieapi.generated.components.responses.forum import PostSearchClientResponse
from bungieapi.generated.components.schemas.forum import (
ForumPostSortEnum,
ForumTopicsCategoryFiltersEnum,
ForumTopicsQuickDateEnum,
ForumTopicsSortEnum,
)
[docs]class Client(BaseClient):
[docs] async def get_topics_paged(
self,
category_filter: t.Optional["ForumTopicsCategoryFiltersEnum"] = None,
group: t.Optional[int] = None,
locales: t.Optional[str] = None,
page: t.Optional[int] = None,
page_size: t.Optional[int] = None,
quick_date: t.Optional["ForumTopicsQuickDateEnum"] = None,
sort: t.Optional["ForumTopicsSortEnum"] = None,
tagstring: t.Optional[str] = None,
) -> PostSearchClientResponse:
"""Get topics from any forum.
Parameters:
category_filter: A category filter
group: The group, if any.
locales: Comma seperated list of locales posts must match to return in the result list. Default 'en'
page: Zero paged page number
page_size: Unused
quick_date: A date filter.
sort: The sort mode.
tagstring: The tags to search, if any.
"""
query = {"locales": locales, "tagstring": tagstring}
result = await self.get(
path=f"/Forum/GetTopicsPaged/{page}/{page_size}/{group}/{sort}/{quick_date}/{category_filter}/",
query=query,
)
return forge(PostSearchClientResponse, result)
[docs] async def get_core_topics_paged(
self,
category_filter: t.Optional["ForumTopicsCategoryFiltersEnum"] = None,
locales: t.Optional[str] = None,
page: t.Optional[int] = None,
quick_date: t.Optional["ForumTopicsQuickDateEnum"] = None,
sort: t.Optional["ForumTopicsSortEnum"] = None,
) -> PostSearchClientResponse:
"""Gets a listing of all topics marked as part of the core group.
Parameters:
category_filter: The category filter.
locales: Comma seperated list of locales posts must match to return in the result list. Default 'en'
page: Zero base page
quick_date: The date filter.
sort: The sort mode.
"""
query = {"locales": locales}
result = await self.get(
path=f"/Forum/GetCoreTopicsPaged/{page}/{sort}/{quick_date}/{category_filter}/",
query=query,
)
return forge(PostSearchClientResponse, result)
[docs] async def get_posts_threaded_paged(
self,
get_parent_post: t.Optional[bool] = None,
page: t.Optional[int] = None,
page_size: t.Optional[int] = None,
parent_post_id: t.Optional[int] = None,
reply_size: t.Optional[int] = None,
root_thread_mode: t.Optional[bool] = None,
showbanned: t.Optional[str] = None,
sort_mode: t.Optional["ForumPostSortEnum"] = None,
) -> PostSearchClientResponse:
"""Returns a thread of posts at the given parent, optionally returning
replies to those posts as well as the original parent.
Parameters:
showbanned: If this value is not null or empty, banned posts are requested to be returned
"""
query = {"showbanned": showbanned}
result = await self.get(
path=f"/Forum/GetPostsThreadedPaged/{parent_post_id}/{page}/{page_size}/{reply_size}/{get_parent_post}/{root_thread_mode}/{sort_mode}/",
query=query,
)
return forge(PostSearchClientResponse, result)
[docs] async def get_posts_threaded_paged_from_child(
self,
child_post_id: t.Optional[int] = None,
page: t.Optional[int] = None,
page_size: t.Optional[int] = None,
reply_size: t.Optional[int] = None,
root_thread_mode: t.Optional[bool] = None,
showbanned: t.Optional[str] = None,
sort_mode: t.Optional["ForumPostSortEnum"] = None,
) -> PostSearchClientResponse:
"""Returns a thread of posts starting at the topicId of the input
childPostId, optionally returning replies to those posts as well as the
original parent.
Parameters:
showbanned: If this value is not null or empty, banned posts are requested to be returned
"""
query = {"showbanned": showbanned}
result = await self.get(
path=f"/Forum/GetPostsThreadedPagedFromChild/{child_post_id}/{page}/{page_size}/{reply_size}/{root_thread_mode}/{sort_mode}/",
query=query,
)
return forge(PostSearchClientResponse, result)
[docs] async def get_post_and_parent(
self,
child_post_id: t.Optional[int] = None,
showbanned: t.Optional[str] = None,
) -> PostSearchClientResponse:
"""Returns the post specified and its immediate parent.
Parameters:
showbanned: If this value is not null or empty, banned posts are requested to be returned
"""
query = {"showbanned": showbanned}
result = await self.get(
path=f"/Forum/GetPostAndParent/{child_post_id}/",
query=query,
)
return forge(PostSearchClientResponse, result)
[docs] async def get_post_and_parent_awaiting_approval(
self,
child_post_id: t.Optional[int] = None,
showbanned: t.Optional[str] = None,
) -> PostSearchClientResponse:
"""Returns the post specified and its immediate parent of posts that
are awaiting approval.
Parameters:
showbanned: If this value is not null or empty, banned posts are requested to be returned
"""
query = {"showbanned": showbanned}
result = await self.get(
path=f"/Forum/GetPostAndParentAwaitingApproval/{child_post_id}/",
query=query,
)
return forge(PostSearchClientResponse, result)
[docs] async def get_topic_for_content(
self,
content_id: t.Optional[int] = None,
) -> int64ClientResponse:
"""Gets the post Id for the given content item's comments, if it
exists."""
query = None
result = await self.get(
path=f"/Forum/GetTopicForContent/{content_id}/",
query=query,
)
return forge(int64ClientResponse, result)
[docs] async def get_forum_tag_suggestions(
self,
partialtag: t.Optional[str] = None,
) -> ListOfTagClientResponse:
"""Gets tag suggestions based on partial text entry, matching them with
other tags previously used in the forums.
Parameters:
partialtag: The partial tag input to generate suggestions from.
"""
query = {"partialtag": partialtag}
result = await self.get(
path="/Forum/GetForumTagSuggestions/",
query=query,
)
return forge(ListOfTagClientResponse, result)
[docs] async def get_poll(
self,
topic_id: t.Optional[int] = None,
) -> PostSearchClientResponse:
"""Gets the specified forum poll.
Parameters:
topic_id: The post id of the topic that has the poll.
"""
query = None
result = await self.get(
path=f"/Forum/Poll/{topic_id}/",
query=query,
)
return forge(PostSearchClientResponse, result)
[docs] async def get_recruitment_thread_summaries(
self,
request: t.Optional[t.Sequence[int]],
) -> CEListOfForumRecruitmentDetailClientResponse:
"""Allows the caller to get a list of to 25 recruitment thread summary
information objects."""
query = None
result = await self.post(
path="/Forum/Recruit/Summaries/", query=query, request=request
)
return forge(CEListOfForumRecruitmentDetailClientResponse, result)