Breakthrough Insights
albert.collections.btinsight.BTInsightCollection
Bases: BaseCollection
BTInsightCollection is a collection class for managing Breakthrough insight entities.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
AlbertSession
|
The Albert session instance. |
required |
Attributes:
Name | Type | Description |
---|---|---|
base_path |
str
|
The base path for BTInsight API requests. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
AlbertSession
|
The Albert session instance. |
required |
Methods:
Name | Description |
---|---|
create |
Create a new BTInsight. |
get_by_id |
Get a BTInsight by ID. |
search |
Search for items in the BTInsight collection. |
update |
Update a BTInsight. |
delete |
Delete a BTInsight by ID. |
Source code in src/albert/collections/btinsight.py
create
Create a new BTInsight.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
insight
|
BTInsight
|
The BTInsight record to create. |
required |
Returns:
Type | Description |
---|---|
BTInsight
|
The created BTInsight. |
Source code in src/albert/collections/btinsight.py
get_by_id
get_by_id(*, id: BTInsightId) -> BTInsight
Get a BTInsight by ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id
|
BTInsightId
|
The Albert ID of the insight. |
required |
Returns:
Type | Description |
---|---|
BTInsight
|
The retrived BTInsight. |
Source code in src/albert/collections/btinsight.py
search
search(
*,
limit: int = 100,
offset: int | None = None,
order_by: OrderBy | None = None,
sort_by: str | None = None,
text: str | None = None,
name: str | list[str] | None = None,
state: BTInsightState
| list[BTInsightState]
| None = None,
category: BTInsightCategory
| list[BTInsightCategory]
| None = None,
) -> Iterator[BTInsight]
Search for items in the BTInsight collection.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
limit
|
int
|
Number of items to return per page, default 100 |
100
|
offset
|
int | None
|
Item offset to begin search at, default None |
None
|
order_by
|
OrderBy | None
|
Asc/desc ordering, default None |
None
|
sort_by
|
str | None
|
Sort field, default None |
None
|
text
|
str | None
|
Text field in search query, default None |
None
|
name
|
str | list[str] | None
|
BTInsight name search filter, default None |
None
|
state
|
BTInsightState | list[BTInsightState] | None
|
BTInsight state search filter, default None |
None
|
category
|
BTInsightCategory | list[BTInsightCategory] | None
|
BTInsight category search filter, default None |
None
|
Returns:
Type | Description |
---|---|
Iterator[BTInsight]
|
An iterator of elements returned by the BTInsight search query. |
Source code in src/albert/collections/btinsight.py
update
Update a BTInsight.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
insight
|
BTInsight
|
The BTInsight to update. |
required |
Returns:
Type | Description |
---|---|
BTInsight
|
The updated BTInsight. |
Source code in src/albert/collections/btinsight.py
delete
delete(*, id: BTInsightId) -> None
Delete a BTInsight by ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id
|
str
|
The ID of the BTInsight to delete. |
required |
Returns:
Type | Description |
---|---|
None
|
|