Reference for hub_sdk/modules/teams.py
Note
This file is available at https://github.com/ultralytics/hub-sdk/blob/main/hub_sdk/modules/teams.py. If you spot a problem please help fix it by contributing a Pull Request 🛠️. Thank you 🙏!
hub_sdk.modules.teams.Teams
Bases: CRUDClient
A class representing a client for interacting with Teams through CRUD operations.
This class extends the CRUDClient class and provides specific methods for working with Teams.
Attributes:
Name | Type | Description |
---|---|---|
id |
str | None
|
The unique identifier of the team, if available. |
data |
Dict
|
A dictionary to store team data. |
Note
The 'id' attribute is set during initialization and can be used to uniquely identify a team. The 'data' attribute is used to store team data fetched from the API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
team_id
|
str
|
The unique identifier of the team. |
None
|
headers
|
Dict[str, Any]
|
A dictionary of HTTP headers to be included in API requests. |
None
|
Source code in hub_sdk/modules/teams.py
create_team
Create a new team with the provided data and set the team ID for the current instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
team_data
|
Dict[str, Any]
|
A dictionary containing the data for creating the team. |
required |
Source code in hub_sdk/modules/teams.py
delete
Delete the team resource represented by this instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hard
|
bool
|
If True, perform a hard (permanent) delete. |
False
|
Note
The 'hard' parameter determines whether to perform a soft delete (default) or a hard delete. In a soft delete, the team might be marked as deleted but retained in the system. In a hard delete, the team is permanently removed from the system.
Returns:
Type | Description |
---|---|
Optional[Response]
|
The response from the delete request, or None if it fails. |
Source code in hub_sdk/modules/teams.py
get_data
Retrieve data for the current team instance.
If a valid team ID has been set, it sends a request to fetch the team data and stores it in the instance. If no team ID has been set, it logs an error message.
Source code in hub_sdk/modules/teams.py
update
Update the team resource represented by this instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
Dict[str, Any]
|
The updated data for the team resource. |
required |
Returns:
Type | Description |
---|---|
Optional[Response]
|
The response from the update request, or None if it fails. |
Source code in hub_sdk/modules/teams.py
hub_sdk.modules.teams.TeamList
TeamList(
page_size: Optional[int] = None,
public: Optional[bool] = None,
headers: Optional[Dict[str, Any]] = None,
)
Bases: PaginatedList
Provides a paginated list interface for managing and retrieving teams via API requests.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
page_size
|
int
|
The number of items to request per page. |
None
|
public
|
bool
|
Whether the items should be publicly accessible. |
None
|
headers
|
Dict[str, Any]
|
Headers to be included in API requests. |
None
|