Skip to content

Social Routes

SocialRouteInterface

Bases: ClientMixin

Source code in src/bungio/api/bungie/social.py
 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
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
@custom_define()
class SocialRouteInterface(ClientMixin):
    async def get_friend_list(self, auth: AuthData) -> BungieFriendListResponse:
        """
        Returns your Bungie Friend list

        Warning: Requires Authentication.
            Required oauth2 scopes: ReadUserData

        Args:
            auth: Authentication information.

        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_friend_list(auth=auth)
        return await BungieFriendListResponse.from_dict(data=response, client=self._client, auth=auth)

    async def get_friend_request_list(self, auth: AuthData) -> BungieFriendRequestListResponse:
        """
        Returns your friend request queue.

        Warning: Requires Authentication.
            Required oauth2 scopes: ReadUserData

        Args:
            auth: Authentication information.

        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_friend_request_list(auth=auth)
        return await BungieFriendRequestListResponse.from_dict(data=response, client=self._client, auth=auth)

    async def issue_friend_request(self, membership_id: str, auth: AuthData) -> bool:
        """
        Requests a friend relationship with the target user. Any of the target user's linked membership ids are valid inputs.

        Warning: Requires Authentication.
            Required oauth2 scopes: BnetWrite

        Args:
            membership_id: The membership id of the user you wish to add.
            auth: Authentication information.

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

        response = await self._client.http.issue_friend_request(membership_id=membership_id, auth=auth)
        return response["Response"]

    async def accept_friend_request(self, membership_id: str, auth: AuthData) -> bool:
        """
        Accepts a friend relationship with the target user. The user must be on your incoming friend request list, though no error will occur if they are not.

        Warning: Requires Authentication.
            Required oauth2 scopes: BnetWrite

        Args:
            membership_id: The membership id of the user you wish to accept.
            auth: Authentication information.

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

        response = await self._client.http.accept_friend_request(membership_id=membership_id, auth=auth)
        return response["Response"]

    async def decline_friend_request(self, membership_id: str, auth: AuthData) -> bool:
        """
        Declines a friend relationship with the target user. The user must be on your incoming friend request list, though no error will occur if they are not.

        Warning: Requires Authentication.
            Required oauth2 scopes: BnetWrite

        Args:
            membership_id: The membership id of the user you wish to decline.
            auth: Authentication information.

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

        response = await self._client.http.decline_friend_request(membership_id=membership_id, auth=auth)
        return response["Response"]

    async def remove_friend(self, membership_id: str, auth: AuthData) -> bool:
        """
        Remove a friend relationship with the target user. The user must be on your friend list, though no error will occur if they are not.

        Warning: Requires Authentication.
            Required oauth2 scopes: BnetWrite

        Args:
            membership_id: The membership id of the user you wish to remove.
            auth: Authentication information.

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

        response = await self._client.http.remove_friend(membership_id=membership_id, auth=auth)
        return response["Response"]

    async def remove_friend_request(self, membership_id: str, auth: AuthData) -> bool:
        """
        Remove a friend relationship with the target user. The user must be on your outgoing request friend list, though no error will occur if they are not.

        Warning: Requires Authentication.
            Required oauth2 scopes: BnetWrite

        Args:
            membership_id: The membership id of the user you wish to remove.
            auth: Authentication information.

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

        response = await self._client.http.remove_friend_request(membership_id=membership_id, auth=auth)
        return response["Response"]

    async def get_platform_friend_list(
        self, friend_platform: Union[PlatformFriendType, int], page: str, auth: Optional[AuthData] = None
    ) -> PlatformFriendResponse:
        """
        Gets the platform friend of the requested type, with additional information if they have Bungie accounts. Must have a recent login session with said platform.

        Args:
            friend_platform: The platform friend type.
            page: The zero based page to return. Page size is 100.
            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_platform_friend_list(
            friend_platform=getattr(friend_platform, "value", friend_platform), page=page, auth=auth
        )
        return await PlatformFriendResponse.from_dict(
            data=response, client=self._client, friend_platform=friend_platform, page=page, auth=auth
        )

accept_friend_request(membership_id, auth) async

Accepts a friend relationship with the target user. The user must be on your incoming friend request list, though no error will occur if they are not.

Requires Authentication.

Required oauth2 scopes: BnetWrite

Parameters:

Name Type Description Default
membership_id str

The membership id of the user you wish to accept.

required
auth AuthData

Authentication information.

required

Returns:

Type Description
bool

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

Source code in src/bungio/api/bungie/social.py
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
async def accept_friend_request(self, membership_id: str, auth: AuthData) -> bool:
    """
    Accepts a friend relationship with the target user. The user must be on your incoming friend request list, though no error will occur if they are not.

    Warning: Requires Authentication.
        Required oauth2 scopes: BnetWrite

    Args:
        membership_id: The membership id of the user you wish to accept.
        auth: Authentication information.

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

    response = await self._client.http.accept_friend_request(membership_id=membership_id, auth=auth)
    return response["Response"]

decline_friend_request(membership_id, auth) async

Declines a friend relationship with the target user. The user must be on your incoming friend request list, though no error will occur if they are not.

Requires Authentication.

Required oauth2 scopes: BnetWrite

Parameters:

Name Type Description Default
membership_id str

The membership id of the user you wish to decline.

required
auth AuthData

Authentication information.

required

Returns:

Type Description
bool

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

Source code in src/bungio/api/bungie/social.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
async def decline_friend_request(self, membership_id: str, auth: AuthData) -> bool:
    """
    Declines a friend relationship with the target user. The user must be on your incoming friend request list, though no error will occur if they are not.

    Warning: Requires Authentication.
        Required oauth2 scopes: BnetWrite

    Args:
        membership_id: The membership id of the user you wish to decline.
        auth: Authentication information.

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

    response = await self._client.http.decline_friend_request(membership_id=membership_id, auth=auth)
    return response["Response"]

get_friend_list(auth) async

Returns your Bungie Friend list

Requires Authentication.

Required oauth2 scopes: ReadUserData

Parameters:

Name Type Description Default
auth AuthData

Authentication information.

required

Returns:

Type Description
BungieFriendListResponse

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

Source code in src/bungio/api/bungie/social.py
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
async def get_friend_list(self, auth: AuthData) -> BungieFriendListResponse:
    """
    Returns your Bungie Friend list

    Warning: Requires Authentication.
        Required oauth2 scopes: ReadUserData

    Args:
        auth: Authentication information.

    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_friend_list(auth=auth)
    return await BungieFriendListResponse.from_dict(data=response, client=self._client, auth=auth)

get_friend_request_list(auth) async

Returns your friend request queue.

Requires Authentication.

Required oauth2 scopes: ReadUserData

Parameters:

Name Type Description Default
auth AuthData

Authentication information.

required

Returns:

Type Description
BungieFriendRequestListResponse

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

Source code in src/bungio/api/bungie/social.py
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
async def get_friend_request_list(self, auth: AuthData) -> BungieFriendRequestListResponse:
    """
    Returns your friend request queue.

    Warning: Requires Authentication.
        Required oauth2 scopes: ReadUserData

    Args:
        auth: Authentication information.

    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_friend_request_list(auth=auth)
    return await BungieFriendRequestListResponse.from_dict(data=response, client=self._client, auth=auth)

get_platform_friend_list(friend_platform, page, auth=None) async

Gets the platform friend of the requested type, with additional information if they have Bungie accounts. Must have a recent login session with said platform.

Parameters:

Name Type Description Default
friend_platform Union[PlatformFriendType, int]

The platform friend type.

required
page str

The zero based page to return. Page size is 100.

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
PlatformFriendResponse

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

Source code in src/bungio/api/bungie/social.py
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
async def get_platform_friend_list(
    self, friend_platform: Union[PlatformFriendType, int], page: str, auth: Optional[AuthData] = None
) -> PlatformFriendResponse:
    """
    Gets the platform friend of the requested type, with additional information if they have Bungie accounts. Must have a recent login session with said platform.

    Args:
        friend_platform: The platform friend type.
        page: The zero based page to return. Page size is 100.
        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_platform_friend_list(
        friend_platform=getattr(friend_platform, "value", friend_platform), page=page, auth=auth
    )
    return await PlatformFriendResponse.from_dict(
        data=response, client=self._client, friend_platform=friend_platform, page=page, auth=auth
    )

issue_friend_request(membership_id, auth) async

Requests a friend relationship with the target user. Any of the target user's linked membership ids are valid inputs.

Requires Authentication.

Required oauth2 scopes: BnetWrite

Parameters:

Name Type Description Default
membership_id str

The membership id of the user you wish to add.

required
auth AuthData

Authentication information.

required

Returns:

Type Description
bool

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

Source code in src/bungio/api/bungie/social.py
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
async def issue_friend_request(self, membership_id: str, auth: AuthData) -> bool:
    """
    Requests a friend relationship with the target user. Any of the target user's linked membership ids are valid inputs.

    Warning: Requires Authentication.
        Required oauth2 scopes: BnetWrite

    Args:
        membership_id: The membership id of the user you wish to add.
        auth: Authentication information.

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

    response = await self._client.http.issue_friend_request(membership_id=membership_id, auth=auth)
    return response["Response"]

remove_friend(membership_id, auth) async

Remove a friend relationship with the target user. The user must be on your friend list, though no error will occur if they are not.

Requires Authentication.

Required oauth2 scopes: BnetWrite

Parameters:

Name Type Description Default
membership_id str

The membership id of the user you wish to remove.

required
auth AuthData

Authentication information.

required

Returns:

Type Description
bool

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

Source code in src/bungio/api/bungie/social.py
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
async def remove_friend(self, membership_id: str, auth: AuthData) -> bool:
    """
    Remove a friend relationship with the target user. The user must be on your friend list, though no error will occur if they are not.

    Warning: Requires Authentication.
        Required oauth2 scopes: BnetWrite

    Args:
        membership_id: The membership id of the user you wish to remove.
        auth: Authentication information.

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

    response = await self._client.http.remove_friend(membership_id=membership_id, auth=auth)
    return response["Response"]

remove_friend_request(membership_id, auth) async

Remove a friend relationship with the target user. The user must be on your outgoing request friend list, though no error will occur if they are not.

Requires Authentication.

Required oauth2 scopes: BnetWrite

Parameters:

Name Type Description Default
membership_id str

The membership id of the user you wish to remove.

required
auth AuthData

Authentication information.

required

Returns:

Type Description
bool

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

Source code in src/bungio/api/bungie/social.py
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
async def remove_friend_request(self, membership_id: str, auth: AuthData) -> bool:
    """
    Remove a friend relationship with the target user. The user must be on your outgoing request friend list, though no error will occur if they are not.

    Warning: Requires Authentication.
        Required oauth2 scopes: BnetWrite

    Args:
        membership_id: The membership id of the user you wish to remove.
        auth: Authentication information.

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

    response = await self._client.http.remove_friend_request(membership_id=membership_id, auth=auth)
    return response["Response"]