Skip to content

Group

Exposes FIO group data. All Group data requires a FIO API KEY. You will need to have access to the data the user has in FIO in order to access it.

Groups can be created and modified in the FIO Settings.

Examples

All groups & their information

1
2
3
4
5
6
7
8
# Get all groups 
groups = fio.Group.all()

# Iterate through group IDs and print group details
for id in groups.ids():
    # Get information of specific group by Id
    group = fio.Group.get(groupid=id)
    print(group)

Members of a specific Group and Hub information

1
2
3
4
5
# Get group users
group_user = fio.Group.get(groupid=123456).users()

# Get hub information
data = fio.Group.hub(group_user)

Members Burn information

# Get Burn information
data = fio.Group.burn(groupid=123456)

Endpoints

Group

Bases: AbstractGroup, AbstractEndpoint

all

all(timeout=None)

Gets all groups from FIO

Note

FIO API Key Required

Parameters:

Name Type Description Default
timeout float

Request timeout in seconds. Defaults to None.

None

Raises:

Type Description
UnknownFIOResponse

FIO returned an unknown response

Returns:

Name Type Description
GroupList GroupList

List of Groups

Source code in fio_wrapper/endpoints/endpoints_v1/group.py
@apikey_required
def all(self, timeout: Optional[float] = None) -> GroupList:
    """Gets all groups from FIO

    Note:
        FIO API Key Required

    Args:
        timeout (float, optional): Request timeout in seconds. Defaults to None.

    Raises:
        UnknownFIOResponse: FIO returned an unknown response

    Returns:
        GroupList: List of Groups
    """
    (status, data) = self.adapter.get(
        endpoint=self.urls.group_all_url(), timeout=timeout
    )

    if status == 200:
        return GroupList.model_validate(data)

get

get(groupid, timeout=None)

Gets group information for specified GroupID from FIO

Note

FIO API Key Required

Parameters:

Name Type Description Default
groupid int

GroupModelId

required
timeout float

Request timeout in seconds. Defaults to None.

None

Raises:

Type Description
UnknownFIOResponse

FIO returned an unknown response

Returns:

Name Type Description
GroupModel Group

GroupModel

Source code in fio_wrapper/endpoints/endpoints_v1/group.py
@apikey_required
def get(self, groupid: int, timeout: Optional[float] = None) -> GroupModel:
    """Gets group information for specified GroupID from FIO

    Note:
        FIO API Key Required

    Args:
        groupid (int): GroupModelId
        timeout (float, optional): Request timeout in seconds. Defaults to None.

    Raises:
        UnknownFIOResponse: FIO returned an unknown response

    Returns:
        GroupModel: GroupModel
    """
    (status, data) = self.adapter.get(
        endpoint=self.urls.group_get_url(groupid=groupid), timeout=timeout
    )

    if status == 200:
        return GroupModel.model_validate(data)

memberships

memberships(timeout=None)

Gets all groups the FIO API Key is member of

Note

FIO API Key Required

Parameters:

Name Type Description Default
timeout float

Request timeout in seconds. Defaults to None.

None

Raises:

Type Description
UnknownFIOResponse

FIO returned an unknown response

Returns:

Name Type Description
GroupMembershipList GroupMembershipList

List of Group Memberships

Source code in fio_wrapper/endpoints/endpoints_v1/group.py
@apikey_required
def memberships(self, timeout: Optional[float] = None) -> GroupMembershipList:
    """Gets all groups the FIO API Key is member of

    Note:
        FIO API Key Required

    Args:
        timeout (float, optional): Request timeout in seconds. Defaults to None.

    Raises:
        UnknownFIOResponse: FIO returned an unknown response

    Returns:
        GroupMembershipList: List of Group Memberships
    """
    (status, data) = self.adapter.get(
        endpoint=self.urls.group_memberships_url(), timeout=timeout
    )

    if status == 200:
        return GroupMembershipList.model_validate(data)

hub

hub(members, timeout=None)

Gets the groups Hub information from FIO

Note

FIO API Key Required

Parameters:

Name Type Description Default
members List[str]

List of members, e.g. ["NAME1", "NAME2"]

required
timeout float

Request timeout in seconds. Defaults to None.

None

Raises:

Type Description
UnknownFIOResponse

FIO returned an unknown response

Returns:

Name Type Description
GroupHub GroupHub

GroupHub data from FIO

Source code in fio_wrapper/endpoints/endpoints_v1/group.py
@apikey_required
def hub(self, members: List[str], timeout: Optional[float] = None) -> GroupHub:
    """Gets the groups Hub information from FIO

    Note:
        FIO API Key Required

    Args:
        members (List[str]): List of members, e.g. ["NAME1", "NAME2"]
        timeout (float, optional): Request timeout in seconds. Defaults to None.

    Raises:
        UnknownFIOResponse: FIO returned an unknown response

    Returns:
        GroupHub: GroupHub data from FIO
    """
    (status, data) = self.adapter.post(
        endpoint=self.urls.group_hub_url(), data=members, timeout=timeout
    )

    if status == 200:
        return GroupHub.model_validate(data)

burn

burn(groupid, timeout=None)

Gets the groups Burn information from FIO

Note

FIO API Key Required

Parameters:

Name Type Description Default
groupid int

GroupModelId

required
timeout float

Request timeout in seconds. Defaults to None.

None

Raises:

Type Description
UnknownFIOResponse

FIO returned an unknown response

Returns:

Name Type Description
BurnList BurnList

List of Burn data

Source code in fio_wrapper/endpoints/endpoints_v1/group.py
@apikey_required
def burn(self, groupid: int, timeout: Optional[float] = None) -> BurnList:
    """Gets the groups Burn information from FIO

    Note:
        FIO API Key Required

    Args:
        groupid (int): GroupModelId
        timeout (float, optional): Request timeout in seconds. Defaults to None.

    Raises:
        UnknownFIOResponse: FIO returned an unknown response

    Returns:
        BurnList: List of Burn data
    """
    (status, data) = self.adapter.get(
        endpoint=self.urls.group_burn_url(groupid=groupid), timeout=timeout
    )

    if status == 200:
        return BurnList.model_validate(data)