From 7fde2bdf182d89c1c81801204bd36cd27675e649 Mon Sep 17 00:00:00 2001 From: Jodenee <81998397+Jodenee@users.noreply.github.com> Date: Mon, 17 Mar 2025 23:19:45 +0100 Subject: [PATCH 1/9] update basegrouo.py added get_relationship_requests and unimplemented get_relationships --- roblox/bases/basegroup.py | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/roblox/bases/basegroup.py b/roblox/bases/basegroup.py index c216add0..5a592d85 100644 --- a/roblox/bases/basegroup.py +++ b/roblox/bases/basegroup.py @@ -6,10 +6,11 @@ """ from __future__ import annotations -from typing import Optional, List, Union, TYPE_CHECKING +from typing import Dict, Optional, List, Union, TYPE_CHECKING from datetime import datetime from dateutil.parser import parse +from enum import Enum from .baseitem import BaseItem from ..members import Member, MemberRelationship @@ -18,8 +19,9 @@ from ..shout import Shout from ..sociallinks import SocialLink from ..utilities.exceptions import InvalidRole -from ..utilities.iterators import PageIterator, SortOrder +from ..utilities.iterators import PageIterator, RowIterator, SortOrder from ..wall import WallPost, WallPostRelationship +from ..groups import GroupRelationshipRequest if TYPE_CHECKING: from ..client import Client @@ -27,6 +29,15 @@ from ..utilities.types import UserOrUserId, RoleOrRoleId +class GroupRelationshipType(Enum): + """ + Represents a group's relationship type. + """ + + allies = "allies" + enemies = "enemies" + + class JoinRequest: """ Represents a group join request. @@ -473,4 +484,23 @@ def get_name_history( sort_order=sort_order, max_items=max_items, handler=lambda client, data: GroupNameHistoryItem(client=client, data=data), - ) \ No newline at end of file + ) + + def get_relationship_requests( + self, + relationshipType: GroupRelationshipType = GroupRelationshipType.allies, + sort_order: SortOrder = SortOrder.Ascending, + max_items: int = None + ) -> RowIterator: + return RowIterator( + client=self._client, + url=self._client._url_generator.get_url("groups", f"v1/groups/{self.id}/relationships/{relationshipType.value}/requests"), + data_field_name="relatedGroups", + sort_order=sort_order, + max_rows=max_items, + handler=lambda client, data, group_id, relationship_type: GroupRelationshipRequest(client, data, group_id, relationship_type), + handler_kwargs={"group_id": self.id, "relationship_type": relationshipType} + ) + + def get_relationships(self, relationshipType: GroupRelationshipType = GroupRelationshipType.allies): + return NotImplementedError() \ No newline at end of file From dadf029551c3d3d83e78c203dd406a0f259cb8aa Mon Sep 17 00:00:00 2001 From: Jodenee <81998397+Jodenee@users.noreply.github.com> Date: Mon, 17 Mar 2025 23:20:49 +0100 Subject: [PATCH 2/9] update iterators.py Added RowIterator --- roblox/utilities/iterators.py | 76 ++++++++++++++++++++++++++++++++++- 1 file changed, 75 insertions(+), 1 deletion(-) diff --git a/roblox/utilities/iterators.py b/roblox/utilities/iterators.py index 11ec82f3..20391f64 100644 --- a/roblox/utilities/iterators.py +++ b/roblox/utilities/iterators.py @@ -5,7 +5,7 @@ """ from __future__ import annotations -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Dict, List if TYPE_CHECKING: from ..client import Client @@ -323,3 +323,77 @@ async def next(self): ] return data + +class RowIterator(RobloxIterator): + """ + Represents an iterator that is meant to iterate over rows, like those seen on groups.roblox.com. + + Attributes: + url: The endpoint to hit for new row data. + starting_row_index: The starting row number. + max_rows: The maximum amount of rows to return. + extra_parameters: Extra parameters to pass to the endpoint. + handler: A callable object to use to convert raw endpoint data to parsed objects. + handler_kwargs: Extra keyword arguments to pass to the handler. + """ + + def __init__( + self, + client: Client, + url: str, + data_field_name: str, + sort_order: SortOrder = SortOrder.Ascending, + row_index: int = 0, + max_rows: int = 10, + extra_parameters: Optional[dict] = None, + handler: Optional[Callable] = None, + handler_kwargs: Optional[dict] = None + ): + super().__init__() + + self._client: Client = client + + self.url: str = url + self.data_field_name: str = data_field_name + self.sort_order: SortOrder = sort_order + self.row_index: int = row_index + self.max_items: int = max_rows + + self.extra_parameters: Dict = extra_parameters or {} + self.handler: Callable = handler + self.handler_kwargs: Dict = handler_kwargs or {} + + self.iterator_position = 0 + self.iterator_items = [] + + async def next(self) -> List: + """ + Advances the iterator to the next set of rows. + """ + + page_response = await self._client.requests.get( + url=self.url, + params={ + "startRowIndex": self.row_index, + "maxRows": self.max_items, + "sortOrder": self.sort_order, + **self.extra_parameters + } + ) + data = page_response.json()[self.data_field_name] + + if len(data) == 0: + raise NoMoreItems("No more items.") + + self.row_index += self.max_items + + if self.handler: + data = [ + self.handler( + client=self._client, + data=item_data, + **self.handler_kwargs + ) for item_data in data + ] + + return data \ No newline at end of file From d92b15cc085d3eaa852623d31b5c54801220d2c4 Mon Sep 17 00:00:00 2001 From: Jodenee <81998397+Jodenee@users.noreply.github.com> Date: Mon, 17 Mar 2025 23:21:41 +0100 Subject: [PATCH 3/9] update groups.py Added GroupRelationship And GroupRelationshipRequest --- roblox/groups.py | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/roblox/groups.py b/roblox/groups.py index 28f2885a..026656ab 100644 --- a/roblox/groups.py +++ b/roblox/groups.py @@ -11,7 +11,7 @@ from .client import Client from typing import Optional, Tuple -from .bases.basegroup import BaseGroup +from .bases.basegroup import BaseGroup, GroupRelationshipType from .partials.partialuser import PartialUser from .shout import Shout @@ -88,3 +88,37 @@ async def update_shout(self, message: str, update_self: bool = True) -> Tuple[Op self.shout = new_shout return old_shout, new_shout + +class GroupRelationship: + """ + Represents a group's relationship with another group. + + Attributes: + client: The Client this object belongs to. + relationship_type: The type of relationship established. + groupId: The group id. + related_group: The related group. + """ + + def __init__(self, client: Client, data: dict): + self._client: Client = client + self.group_id: int = data.get("groupId") + self.relationship_type: GroupRelationshipType = data.get("relationshipType") + self.related_group: Group = Group(client=client, data=data) + +class GroupRelationshipRequest: + """ + Represents a request to establish a relationship with a group. + + Attributes: + client: The Client this object belongs to. + relationship_type: The type of relationship to be established. + groupId: The group id. + related_group: The related group. + """ + + def __init__(self, client: Client, data: dict, group_id: int, relationship_type: GroupRelationshipType): + self._client: Client = client + self.relationship_type: GroupRelationshipType = relationship_type + self.group_id: int = group_id + self.related_group: Group = Group(client=client, data=data) From 6a6b8d090317f49983a9558671d1caa8e97e665b Mon Sep 17 00:00:00 2001 From: Jodenee <81998397+Jodenee@users.noreply.github.com> Date: Thu, 20 Mar 2025 23:09:35 +0100 Subject: [PATCH 4/9] update iterators.py renamed starting_row_index to row_index, removed unused fields, added rows field, fixed bug where sortOrder would be sent as the actual python object instead of Asc or Desc, fixed next row logic --- roblox/utilities/iterators.py | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/roblox/utilities/iterators.py b/roblox/utilities/iterators.py index 20391f64..54d06dfd 100644 --- a/roblox/utilities/iterators.py +++ b/roblox/utilities/iterators.py @@ -330,8 +330,11 @@ class RowIterator(RobloxIterator): Attributes: url: The endpoint to hit for new row data. - starting_row_index: The starting row number. - max_rows: The maximum amount of rows to return. + data_field_name: The name of the field containing the data. + sort_order: The sort order to use for returned data. + row_index: The starting row index. + rows: The maximum amount of rows to return on each iteration. + max_rows: The maximum amount of items to return when this iterator is looped through. extra_parameters: Extra parameters to pass to the endpoint. handler: A callable object to use to convert raw endpoint data to parsed objects. handler_kwargs: Extra keyword arguments to pass to the handler. @@ -344,7 +347,8 @@ def __init__( data_field_name: str, sort_order: SortOrder = SortOrder.Ascending, row_index: int = 0, - max_rows: int = 10, + rows: int = 50, + max_rows: int = None, extra_parameters: Optional[dict] = None, handler: Optional[Callable] = None, handler_kwargs: Optional[dict] = None @@ -357,15 +361,13 @@ def __init__( self.data_field_name: str = data_field_name self.sort_order: SortOrder = sort_order self.row_index: int = row_index + self.rows: int = rows self.max_items: int = max_rows self.extra_parameters: Dict = extra_parameters or {} self.handler: Callable = handler self.handler_kwargs: Dict = handler_kwargs or {} - self.iterator_position = 0 - self.iterator_items = [] - async def next(self) -> List: """ Advances the iterator to the next set of rows. @@ -375,17 +377,19 @@ async def next(self) -> List: url=self.url, params={ "startRowIndex": self.row_index, - "maxRows": self.max_items, - "sortOrder": self.sort_order, + "maxRows": self.rows, + "sortOrder": self.sort_order.value, **self.extra_parameters } ) - data = page_response.json()[self.data_field_name] + body: dict = page_response.json() + next_row_index: int = body.get("nextRowIndex") + data = body.get(self.data_field_name) if len(data) == 0: raise NoMoreItems("No more items.") - self.row_index += self.max_items + self.row_index = next_row_index if self.handler: data = [ @@ -396,4 +400,4 @@ async def next(self) -> List: ) for item_data in data ] - return data \ No newline at end of file + return data From fa881212523ec08eb5dfe5f1c7a3b8d6ed9c2114 Mon Sep 17 00:00:00 2001 From: Jodenee <81998397+Jodenee@users.noreply.github.com> Date: Thu, 20 Mar 2025 23:12:06 +0100 Subject: [PATCH 5/9] update groups.py Moved GroupRelationship and GroupRelationshipRequest to basegroup.py for better organization --- roblox/groups.py | 36 +----------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/roblox/groups.py b/roblox/groups.py index 026656ab..28f2885a 100644 --- a/roblox/groups.py +++ b/roblox/groups.py @@ -11,7 +11,7 @@ from .client import Client from typing import Optional, Tuple -from .bases.basegroup import BaseGroup, GroupRelationshipType +from .bases.basegroup import BaseGroup from .partials.partialuser import PartialUser from .shout import Shout @@ -88,37 +88,3 @@ async def update_shout(self, message: str, update_self: bool = True) -> Tuple[Op self.shout = new_shout return old_shout, new_shout - -class GroupRelationship: - """ - Represents a group's relationship with another group. - - Attributes: - client: The Client this object belongs to. - relationship_type: The type of relationship established. - groupId: The group id. - related_group: The related group. - """ - - def __init__(self, client: Client, data: dict): - self._client: Client = client - self.group_id: int = data.get("groupId") - self.relationship_type: GroupRelationshipType = data.get("relationshipType") - self.related_group: Group = Group(client=client, data=data) - -class GroupRelationshipRequest: - """ - Represents a request to establish a relationship with a group. - - Attributes: - client: The Client this object belongs to. - relationship_type: The type of relationship to be established. - groupId: The group id. - related_group: The related group. - """ - - def __init__(self, client: Client, data: dict, group_id: int, relationship_type: GroupRelationshipType): - self._client: Client = client - self.relationship_type: GroupRelationshipType = relationship_type - self.group_id: int = group_id - self.related_group: Group = Group(client=client, data=data) From 072e56d593701f11f0286242d4e82cd31d4a5c96 Mon Sep 17 00:00:00 2001 From: Jodenee <81998397+Jodenee@users.noreply.github.com> Date: Thu, 20 Mar 2025 23:41:22 +0100 Subject: [PATCH 6/9] update basegroup.py Removed import from groups.py, moved GroupRelationshipType above GroupRelationship for better organization, moved GroupRelationship and GroupRelationshipRequest from groups.py, added remove method to GroupRelationship, added accept and decline method to GroupRelationshipRequest, renamed BaseGroup.get_relationship_requests to get_ally_relationship_requests and added docs, added BaseGroup.request_relationship, BaseGroup.decline_relationship_requests and BaseGroup.accept_relationship_requests --- roblox/bases/basegroup.py | 198 ++++++++++++++++++++++++++++++++++---- 1 file changed, 181 insertions(+), 17 deletions(-) diff --git a/roblox/bases/basegroup.py b/roblox/bases/basegroup.py index 5a592d85..f7d0f9c6 100644 --- a/roblox/bases/basegroup.py +++ b/roblox/bases/basegroup.py @@ -21,7 +21,6 @@ from ..utilities.exceptions import InvalidRole from ..utilities.iterators import PageIterator, RowIterator, SortOrder from ..wall import WallPost, WallPostRelationship -from ..groups import GroupRelationshipRequest if TYPE_CHECKING: from ..client import Client @@ -29,15 +28,6 @@ from ..utilities.types import UserOrUserId, RoleOrRoleId -class GroupRelationshipType(Enum): - """ - Represents a group's relationship type. - """ - - allies = "allies" - enemies = "enemies" - - class JoinRequest: """ Represents a group join request. @@ -129,6 +119,82 @@ def __repr__(self): return f"<{self.__class__.__name__} name={self.name!r} created={self.created}>" +class GroupRelationshipType(Enum): + """ + Represents a type of relationship between two groups. + """ + + allies = "allies" + enemies = "enemies" + + +class GroupRelationship: + """ + Represents a relationship between two groups. + + Attributes: + client: The Client this object belongs to. + relationship_type: The type of relationship established. + group: The group. + related_group: The related group. + """ + + def __init__(self, client: Client, data: dict, group: BaseGroup, relationship_type: GroupRelationshipType): + from ..groups import Group + + self._client: Client = client + self.relationship_type: GroupRelationshipType = relationship_type + self.group: BaseGroup = group + self.related_group: Group = Group(client=client, data=data) + + async def remove(self): + """ + Removes a relationship with another group. + """ + + await self._client.requests.delete( + url=self._client.url_generator.get_url("groups", f"v1/groups/{self.group.id}/relationships/{self.relationship_type.value}/{self.related_group.id}") + ) + + +class GroupRelationshipRequest: + """ + Represents a request to establish a relationship with a group. + + Attributes: + client: The Client this object belongs to. + relationship_type: The type of relationship to be established. + group: The group that received the request. + related_group: The group that sent the request. + """ + + def __init__(self, client: Client, data: dict, group: BaseGroup, relationship_type: GroupRelationshipType): + from ..groups import Group + + self._client: Client = client + self.relationship_type: GroupRelationshipType = relationship_type + self.group: BaseGroup = group + self.related_group: Group = Group(client=client, data=data) + + async def accept(self): + """ + Accepts the incoming relationship request. + """ + + await self._client.requests.post( + url=self._client.url_generator.get_url("groups", f"v1/groups/{self.group.id}/relationships/{self.relationship_type.value}/requests/{self.related_group.id}") + ) + + async def decline(self): + """ + Declines the incoming relationship request. + """ + + await self._client.requests.delete( + url=self._client.url_generator.get_url("groups", f"v1/groups/{self.group.id}/relationships/{self.relationship_type.value}/requests/{self.related_group.id}") + ) + + class BaseGroup(BaseItem): """ Represents a Roblox group ID. @@ -486,21 +552,119 @@ def get_name_history( handler=lambda client, data: GroupNameHistoryItem(client=client, data=data), ) - def get_relationship_requests( + def get_ally_relationship_requests( self, - relationshipType: GroupRelationshipType = GroupRelationshipType.allies, + rows: int = 50, sort_order: SortOrder = SortOrder.Ascending, max_items: int = None ) -> RowIterator: + """ + Grabs the group's pending relationship requests from other groups. + + Arguments: + rows: How many relationship requests should be returned for each iteration. + sort_order: Order in which data should be grabbed. + max_items: The maximum items to return when looping through this object. + + Returns: + A RowIterator containing the groups's pending relationship requests. + """ + + return RowIterator( + client=self._client, + url=self._client._url_generator.get_url("groups", f"v1/groups/{self.id}/relationships/{GroupRelationshipType.allies.value}/requests"), + data_field_name="relatedGroups", + sort_order=sort_order, + rows=rows, + max_rows=max_items, + handler=lambda client, data, group, relationship_type: GroupRelationshipRequest(client, data, group, relationship_type), + handler_kwargs={"group": self, "relationship_type": GroupRelationshipType.allies} + ) + + def get_relationships( + self, + relationshipType: GroupRelationshipType = GroupRelationshipType.allies, + rows: int = 50, + sort_order: SortOrder = SortOrder.Ascending, + max_items: int = None, + ) -> RowIterator: + """ + Grabs the groups's relationships with other groups. + + Arguments: + relationshipType: The type of relationship established between both groups. + rows: How many relationships should be returned for each iteration. + sort_order: Order in which data should be grabbed. + max_items: The maximum items to return when looping through this object. + + Returns: + A RowIterator containing the groups's relationships. + """ + return RowIterator( client=self._client, - url=self._client._url_generator.get_url("groups", f"v1/groups/{self.id}/relationships/{relationshipType.value}/requests"), + url=self._client._url_generator.get_url("groups", f"v1/groups/{self.id}/relationships/{relationshipType.value}"), data_field_name="relatedGroups", sort_order=sort_order, + rows=rows, max_rows=max_items, - handler=lambda client, data, group_id, relationship_type: GroupRelationshipRequest(client, data, group_id, relationship_type), - handler_kwargs={"group_id": self.id, "relationship_type": relationshipType} + handler=lambda client, data, group, relationship_type: GroupRelationship(client, data, group, relationship_type), + handler_kwargs={"group": self, "relationship_type": relationshipType} ) - def get_relationships(self, relationshipType: GroupRelationshipType = GroupRelationshipType.allies): - return NotImplementedError() \ No newline at end of file + async def request_relationship( + self, + group: Union[int, BaseGroup], + relationshipType: GroupRelationshipType = GroupRelationshipType.allies + ): + """ + Requests to establish a relationship with another group. + + Arguments: + group: The group to prepose the relationship with. + relationshipType: The type of relationship to be established. + """ + + await self._client.requests.post( + url=self._client.url_generator.get_url("groups", f"v1/groups/{self.id}/relationships/{relationshipType.value}/{int(group)}") + ) + + async def decline_relationship_requests( + self, + groups: List[Union[int, BaseGroup]], + relationshipType: GroupRelationshipType = GroupRelationshipType.allies + ): + """ + Declines all relationship requests from a list of groups. + + Arguments: + groups: A list of groups to decline. + relationshipType: The type of relationship. + """ + + await self._client.requests.delete( + url=self._client.url_generator.get_url("groups", f"v1/groups/{self.id}/relationships/{relationshipType.value}/requests"), + json={ + "GroupIds": list(map(int, groups)) + } + ) + + async def accept_relationship_requests( + self, + groups: List[Union[int, BaseGroup]], + relationshipType: GroupRelationshipType = GroupRelationshipType.allies + ): + """ + Accepts all relationship requests from a list of groups. + + Arguments: + groups: A list of groups to accept. + relationshipType: The type of relationship. + """ + + await self._client.requests.post( + url=self._client.url_generator.get_url("groups", f"v1/groups/{self.id}/relationships/{relationshipType.value}/requests"), + json={ + "GroupIds": list(map(int, groups)) + } + ) From 9912c4a30dcb46f620fd285559119d913c4cfe6f Mon Sep 17 00:00:00 2001 From: Jodenee <81998397+Jodenee@users.noreply.github.com> Date: Thu, 20 Mar 2025 23:49:58 +0100 Subject: [PATCH 7/9] update basegroup.py Removed unused import --- roblox/bases/basegroup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roblox/bases/basegroup.py b/roblox/bases/basegroup.py index f7d0f9c6..51f85160 100644 --- a/roblox/bases/basegroup.py +++ b/roblox/bases/basegroup.py @@ -6,7 +6,7 @@ """ from __future__ import annotations -from typing import Dict, Optional, List, Union, TYPE_CHECKING +from typing import Optional, List, Union, TYPE_CHECKING from datetime import datetime from dateutil.parser import parse From c8a9f66595948b69b032356c6b330d87d4238f2c Mon Sep 17 00:00:00 2001 From: Jodenee <81998397+Jodenee@users.noreply.github.com> Date: Sat, 22 Mar 2025 23:55:18 +0100 Subject: [PATCH 8/9] update basegroup.py improved typing --- roblox/bases/basegroup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/roblox/bases/basegroup.py b/roblox/bases/basegroup.py index 51f85160..02396664 100644 --- a/roblox/bases/basegroup.py +++ b/roblox/bases/basegroup.py @@ -25,7 +25,7 @@ if TYPE_CHECKING: from ..client import Client from .baseuser import BaseUser - from ..utilities.types import UserOrUserId, RoleOrRoleId + from ..utilities.types import UserOrUserId, RoleOrRoleId, GroupOrGroupId class JoinRequest: @@ -614,7 +614,7 @@ def get_relationships( async def request_relationship( self, - group: Union[int, BaseGroup], + group: GroupOrGroupId, relationshipType: GroupRelationshipType = GroupRelationshipType.allies ): """ @@ -631,7 +631,7 @@ async def request_relationship( async def decline_relationship_requests( self, - groups: List[Union[int, BaseGroup]], + groups: List[GroupOrGroupId], relationshipType: GroupRelationshipType = GroupRelationshipType.allies ): """ @@ -651,7 +651,7 @@ async def decline_relationship_requests( async def accept_relationship_requests( self, - groups: List[Union[int, BaseGroup]], + groups: List[GroupOrGroupId], relationshipType: GroupRelationshipType = GroupRelationshipType.allies ): """ From e417d5c62be8065baa26c5f64f2a3981e923de63 Mon Sep 17 00:00:00 2001 From: Jodenee <81998397+Jodenee@users.noreply.github.com> Date: Sun, 23 Mar 2025 15:47:45 +0100 Subject: [PATCH 9/9] update basegroup.py improved docs --- roblox/bases/basegroup.py | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/roblox/bases/basegroup.py b/roblox/bases/basegroup.py index 02396664..ca4363da 100644 --- a/roblox/bases/basegroup.py +++ b/roblox/bases/basegroup.py @@ -133,13 +133,20 @@ class GroupRelationship: Represents a relationship between two groups. Attributes: - client: The Client this object belongs to. - relationship_type: The type of relationship established. + relationship_type: The type of relationship between both groups. group: The group. related_group: The related group. """ def __init__(self, client: Client, data: dict, group: BaseGroup, relationship_type: GroupRelationshipType): + """ + Arguments: + client: The Client this object belongs to. + data: A GroupDetailResponse Object. + group: The group getting queried for it's relationships. + relationship_type: The type of relationship between both groups. + """ + from ..groups import Group self._client: Client = client @@ -149,7 +156,7 @@ def __init__(self, client: Client, data: dict, group: BaseGroup, relationship_ty async def remove(self): """ - Removes a relationship with another group. + Severs the relationship between both groups. """ await self._client.requests.delete( @@ -159,16 +166,23 @@ async def remove(self): class GroupRelationshipRequest: """ - Represents a request to establish a relationship with a group. + Represents a request to establish a relationship with another group. Attributes: - client: The Client this object belongs to. - relationship_type: The type of relationship to be established. + relationship_type: The type of relationship to be established between both groups. group: The group that received the request. related_group: The group that sent the request. """ def __init__(self, client: Client, data: dict, group: BaseGroup, relationship_type: GroupRelationshipType): + """ + Arguments: + client: The Client this object belongs to. + data: A GroupDetailResponse Object. + group: The group that received the request. + relationship_type: The type of relationship to be established between both groups. + """ + from ..groups import Group self._client: Client = client @@ -178,7 +192,7 @@ def __init__(self, client: Client, data: dict, group: BaseGroup, relationship_ty async def accept(self): """ - Accepts the incoming relationship request. + Accepts the relationship request. """ await self._client.requests.post( @@ -187,7 +201,7 @@ async def accept(self): async def decline(self): """ - Declines the incoming relationship request. + Declines the relationship request. """ await self._client.requests.delete( @@ -559,10 +573,10 @@ def get_ally_relationship_requests( max_items: int = None ) -> RowIterator: """ - Grabs the group's pending relationship requests from other groups. + Returns the group's pending ally requests from other groups. Arguments: - rows: How many relationship requests should be returned for each iteration. + rows: How many ally requests should be returned for each iteration. sort_order: Order in which data should be grabbed. max_items: The maximum items to return when looping through this object. @@ -589,7 +603,7 @@ def get_relationships( max_items: int = None, ) -> RowIterator: """ - Grabs the groups's relationships with other groups. + Returns established relationships with other groups. Arguments: relationshipType: The type of relationship established between both groups.