Skip to content

Trending Routes

TrendingRouteInterface

Bases: ClientMixin

Source code in src/bungio/api/bungie/trending.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
@custom_define()
class TrendingRouteInterface(ClientMixin):
    async def get_trending_categories(self, auth: Optional[AuthData] = None) -> TrendingCategories:
        """
        Returns trending items for Bungie.net, collapsed into the first page of items per category. For pagination within a category, call GetTrendingCategory.

        Args:
            auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

        Returns:
            The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
        """

        response = await self._client.http.get_trending_categories(auth=auth)
        return await TrendingCategories.from_dict(data=response, client=self._client, auth=auth)

    async def get_trending_category(
        self, category_id: str, page_number: int, auth: Optional[AuthData] = None
    ) -> SearchResultOfTrendingEntry:
        """
        Returns paginated lists of trending items for a category.

        Args:
            category_id: The ID of the category for whom you want additional results.
            page_number: The page # of results to return.
            auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

        Returns:
            The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
        """

        response = await self._client.http.get_trending_category(
            category_id=category_id, page_number=page_number, auth=auth
        )
        return await SearchResultOfTrendingEntry.from_dict(
            data=response, client=self._client, category_id=category_id, page_number=page_number, auth=auth
        )

    async def get_trending_entry_detail(
        self, identifier: str, trending_entry_type: Union[TrendingEntryType, int], auth: Optional[AuthData] = None
    ) -> TrendingDetail:
        """
        Returns the detailed results for a specific trending entry. Note that trending entries are uniquely identified by a combination of *both* the TrendingEntryType *and* the identifier: the identifier alone is not guaranteed to be globally unique.

        Args:
            identifier: The identifier for the entity to be returned.
            trending_entry_type: The type of entity to be returned.
            auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

        Returns:
            The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
        """

        response = await self._client.http.get_trending_entry_detail(
            identifier=identifier,
            trending_entry_type=getattr(trending_entry_type, "value", trending_entry_type),
            auth=auth,
        )
        return await TrendingDetail.from_dict(
            data=response,
            client=self._client,
            identifier=identifier,
            trending_entry_type=trending_entry_type,
            auth=auth,
        )

Returns trending items for Bungie.net, collapsed into the first page of items per category. For pagination within a category, call GetTrendingCategory.

Parameters:

Name Type Description Default
auth Optional[AuthData]

Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

None

Returns:

Type Description
TrendingCategories

The model which is returned by bungie. General endpoint information.

Source code in src/bungio/api/bungie/trending.py
14
15
16
17
18
19
20
21
22
23
24
25
26
async def get_trending_categories(self, auth: Optional[AuthData] = None) -> TrendingCategories:
    """
    Returns trending items for Bungie.net, collapsed into the first page of items per category. For pagination within a category, call GetTrendingCategory.

    Args:
        auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

    Returns:
        The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
    """

    response = await self._client.http.get_trending_categories(auth=auth)
    return await TrendingCategories.from_dict(data=response, client=self._client, auth=auth)

Returns paginated lists of trending items for a category.

Parameters:

Name Type Description Default
category_id str

The ID of the category for whom you want additional results.

required
page_number int

The page # of results to return.

required
auth Optional[AuthData]

Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

None

Returns:

Type Description
SearchResultOfTrendingEntry

The model which is returned by bungie. General endpoint information.

Source code in src/bungio/api/bungie/trending.py
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
async def get_trending_category(
    self, category_id: str, page_number: int, auth: Optional[AuthData] = None
) -> SearchResultOfTrendingEntry:
    """
    Returns paginated lists of trending items for a category.

    Args:
        category_id: The ID of the category for whom you want additional results.
        page_number: The page # of results to return.
        auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

    Returns:
        The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
    """

    response = await self._client.http.get_trending_category(
        category_id=category_id, page_number=page_number, auth=auth
    )
    return await SearchResultOfTrendingEntry.from_dict(
        data=response, client=self._client, category_id=category_id, page_number=page_number, auth=auth
    )

get_trending_entry_detail(identifier, trending_entry_type, auth=None) async

Returns the detailed results for a specific trending entry. Note that trending entries are uniquely identified by a combination of both the TrendingEntryType and the identifier: the identifier alone is not guaranteed to be globally unique.

Parameters:

Name Type Description Default
identifier str

The identifier for the entity to be returned.

required
trending_entry_type Union[TrendingEntryType, int]

The type of entity to be returned.

required
auth Optional[AuthData]

Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

None

Returns:

Type Description
TrendingDetail

The model which is returned by bungie. General endpoint information.

Source code in src/bungio/api/bungie/trending.py
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
async def get_trending_entry_detail(
    self, identifier: str, trending_entry_type: Union[TrendingEntryType, int], auth: Optional[AuthData] = None
) -> TrendingDetail:
    """
    Returns the detailed results for a specific trending entry. Note that trending entries are uniquely identified by a combination of *both* the TrendingEntryType *and* the identifier: the identifier alone is not guaranteed to be globally unique.

    Args:
        identifier: The identifier for the entity to be returned.
        trending_entry_type: The type of entity to be returned.
        auth: Authentication information. Required when users with a private profile are queried, or when Bungie feels like it

    Returns:
        The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html)
    """

    response = await self._client.http.get_trending_entry_detail(
        identifier=identifier,
        trending_entry_type=getattr(trending_entry_type, "value", trending_entry_type),
        auth=auth,
    )
    return await TrendingDetail.from_dict(
        data=response,
        client=self._client,
        identifier=identifier,
        trending_entry_type=trending_entry_type,
        auth=auth,
    )