Skip to content

App Routes

AppRouteInterface

Bases: ClientMixin

Source code in src/bungio/api/bungie/app.py
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
@custom_define()
class AppRouteInterface(ClientMixin):
    async def get_application_api_usage(
        self, application_id: int, auth: AuthData, end: Optional[datetime] = None, start: Optional[datetime] = None
    ) -> ApiUsage:
        """
        Get API usage by application for time frame specified. You can go as far back as 30 days ago, and can ask for up to a 48 hour window of time in a single request. You must be authenticated with at least the ReadUserData permission to access this endpoint.

        Warning: Requires Authentication.
            Required oauth2 scopes: ReadUserData

        Args:
            application_id: ID of the application to get usage statistics.
            auth: Authentication information.
            end: End time for query. Goes to now if not specified.
            start: Start time for query. Goes to 24 hours ago if not specified.

        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_application_api_usage(
            application_id=application_id,
            auth=auth,
            end=end if end is not None else None,
            start=start if start is not None else None,
        )
        return await ApiUsage.from_dict(
            data=response, client=self._client, application_id=application_id, auth=auth, end=end, start=start
        )

    async def get_bungie_applications(self, auth: Optional[AuthData] = None) -> list[Application]:
        """
        Get list of applications created by Bungie.

        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_bungie_applications(auth=auth)
        return [
            await Application.from_dict(data=value, client=self._client, auth=auth) for value in response["Response"]
        ]

get_application_api_usage(application_id, auth, end=None, start=None) async

Get API usage by application for time frame specified. You can go as far back as 30 days ago, and can ask for up to a 48 hour window of time in a single request. You must be authenticated with at least the ReadUserData permission to access this endpoint.

Requires Authentication.

Required oauth2 scopes: ReadUserData

Parameters:

Name Type Description Default
application_id int

ID of the application to get usage statistics.

required
auth AuthData

Authentication information.

required
end Optional[datetime]

End time for query. Goes to now if not specified.

None
start Optional[datetime]

Start time for query. Goes to 24 hours ago if not specified.

None

Returns:

Type Description
ApiUsage

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

Source code in src/bungio/api/bungie/app.py
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
async def get_application_api_usage(
    self, application_id: int, auth: AuthData, end: Optional[datetime] = None, start: Optional[datetime] = None
) -> ApiUsage:
    """
    Get API usage by application for time frame specified. You can go as far back as 30 days ago, and can ask for up to a 48 hour window of time in a single request. You must be authenticated with at least the ReadUserData permission to access this endpoint.

    Warning: Requires Authentication.
        Required oauth2 scopes: ReadUserData

    Args:
        application_id: ID of the application to get usage statistics.
        auth: Authentication information.
        end: End time for query. Goes to now if not specified.
        start: Start time for query. Goes to 24 hours ago if not specified.

    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_application_api_usage(
        application_id=application_id,
        auth=auth,
        end=end if end is not None else None,
        start=start if start is not None else None,
    )
    return await ApiUsage.from_dict(
        data=response, client=self._client, application_id=application_id, auth=auth, end=end, start=start
    )

get_bungie_applications(auth=None) async

Get list of applications created by Bungie.

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
list[Application]

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

Source code in src/bungio/api/bungie/app.py
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
async def get_bungie_applications(self, auth: Optional[AuthData] = None) -> list[Application]:
    """
    Get list of applications created by Bungie.

    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_bungie_applications(auth=auth)
    return [
        await Application.from_dict(data=value, client=self._client, auth=auth) for value in response["Response"]
    ]