Headline Operations¶
Operations for managing headlines and headline-related data.
API Reference¶
HeadlineOperations
¶
Bases: BaseOperations
Class to handle all operations related to headlines.
Methods:
-
create
–Create a new headline.
-
update
–Update a headline.
-
details
–Get headline details.
-
list
–Get headlines for a user or a meeting.
-
delete
–Delete a headline.
Functions¶
create
¶
create(meeting_id: int, title: str, owner_id: int | None = None, notes: str | None = None) -> HeadlineInfo
Create a new headline.
Parameters:
-
meeting_id
(int
) –The ID of the meeting
-
title
(str
) –The title of the headline
-
owner_id
(int | None
, default:None
) –The ID of the headline owner (default: current user ID)
-
notes
(str | None
, default:None
) –Additional notes for the headline
Returns:
-
HeadlineInfo
–A HeadlineInfo model instance containing id, title, owner_details,
-
HeadlineInfo
–and notes_url
update
¶
Update a headline.
Parameters:
-
headline_id
(int
) –The ID of the headline to update
-
title
(str
) –The new title of the headline
Returns:
-
bool
–True if update was successful
details
¶
Get headline details.
Parameters:
-
headline_id
(int
) –The ID of the headline
Returns:
-
HeadlineDetails
–A HeadlineDetails model instance containing id, title, notes_url,
-
HeadlineDetails
–meeting_details, owner_details, archived, created_at, and closed_at
list
¶
Get headlines for a user or a meeting.
Parameters:
-
user_id
(int | None
, default:None
) –The ID of the user (defaults to initialized user_id)
-
meeting_id
(int | None
, default:None
) –The ID of the meeting
Returns:
-
list[HeadlineListItem]
–A list of HeadlineListItem model instances containing:
-
list[HeadlineListItem]
–- id
-
list[HeadlineListItem]
–- title
-
list[HeadlineListItem]
–- meeting_details
-
list[HeadlineListItem]
–- owner_details
-
list[HeadlineListItem]
–- archived
-
list[HeadlineListItem]
–- created_at
-
list[HeadlineListItem]
–- closed_at
Raises:
-
ValueError
–If both user_id and meeting_id are provided
delete
¶
Delete a headline.
Parameters:
-
headline_id
(int
) –The ID of the headline to delete
Returns:
-
bool
–True if the deletion was successful
Async Version¶
The async version AsyncHeadlineOperations
provides the same methods as above, but with async/await support:
AsyncHeadlineOperations
¶
Async class to handle all operations related to headlines.
Initialize the async headline operations.
Parameters:
-
client
(AsyncClient
) –The async HTTP client to use for API requests.
Async Usage
All methods have the same parameters and return types as their sync counterparts. Simply add await
before each method call.
Usage Examples¶
from bloomy import Client
with Client(api_key="your-api-key") as client:
# Create a new headline
headline = client.headline.create(
meeting_id=123,
title="Product launch successful",
notes="Exceeded targets by 15%"
)
# Get headline details
details = client.headline.details(headline_id=headline.id)
print(f"Created: {details.created_at}")
print(f"Archived: {details.archived}")
# List headlines for current user
headlines = client.headline.list()
# List headlines for a specific meeting
meeting_headlines = client.headline.list(meeting_id=123)
# Update headline title
client.headline.update(
headline_id=headline.id,
title="Product launch exceeded expectations"
)
# Delete headline
client.headline.delete(headline_id=headline.id)
import asyncio
from bloomy import AsyncClient
async def main():
async with AsyncClient(api_key="your-api-key") as client:
# Create a new headline
headline = await client.headline.create(
meeting_id=123,
title="Product launch successful",
notes="Exceeded targets by 15%"
)
# Get headline details
details = await client.headline.details(headline_id=headline.id)
print(f"Created: {details.created_at}")
print(f"Archived: {details.archived}")
# List headlines for current user
headlines = await client.headline.list()
# List headlines for a specific meeting
meeting_headlines = await client.headline.list(meeting_id=123)
# Update headline title
await client.headline.update(
headline_id=headline.id,
title="Product launch exceeded expectations"
)
# Delete headline
await client.headline.delete(headline_id=headline.id)
asyncio.run(main())
Available Methods¶
Method | Description | Parameters |
---|---|---|
create() |
Create a new headline | meeting_id , title , owner_id , notes |
update() |
Update a headline title | headline_id , title |
details() |
Get detailed headline information | headline_id |
list() |
Get headlines | user_id , meeting_id |
delete() |
Delete a headline | headline_id |
Filtering
Like todos, headlines can be filtered by either user_id
or meeting_id
, but not both.