Headline Operations (v2)¶
GraphQL operations for managing headlines. See the v2 guide
for how client.v2 relates to client.v1/client.headline, and for the
description ("notes") behavior shared across v2 entities.
API Reference¶
HeadlineOperations
¶
Bases: GraphQLOperations, HeadlineOperationsMixin
Class to handle v2 (GraphQL) operations related to headlines.
Methods:
-
details–Get details for a headline.
-
list–List headlines for a meeting or a user.
-
create–Create a new headline.
-
update–Update an existing headline.
-
archive–Archive a headline.
-
restore–Restore an archived headline.
Methods:¶
details
¶
details(headline_id: int) -> Headline
Get details for a headline.
Parameters:
-
headline_id(int) –The ID of the headline.
Returns:
-
Headline–A
Headlinemodel instance.
list
¶
list(meeting_id: int | None = None, user_id: int | None = None, *, include_archived: bool = False) -> list[Headline]
List headlines for a meeting or a user.
Parameters:
-
meeting_id(int | None, default:None) –The ID of the meeting. Mutually exclusive with
user_id. -
user_id(int | None, default:None) –The ID of the headline owner. Mutually exclusive with
meeting_id. If neither is given, defaults to the current user. -
include_archived(bool, default:False) –If
True, also include archived headlines.
Returns:
-
list[Headline]–A list of
Headlinemodel instances, ordered by creation date.
Raises:
-
ValueError–If both
meeting_idanduser_idare provided.
create
¶
create(meeting_id: int, title: str, user_id: int | None = None, notes: str | None = None) -> Headline
Create a new headline.
Parameters:
-
meeting_id(int) –The ID of the meeting to create the headline in.
CreateHeadlinerequires exactly one meeting. -
title(str) –The title of the headline.
-
user_id(int | None, default:None) –The ID of the headline owner (defaults to the current user).
-
notes(str | None, default:None) –Description text for the headline.
Returns:
-
Headline–The newly created
Headline.
update
¶
update(headline_id: int, *, title: str | None = None, user_id: int | None = None, notes: str | None = None) -> Headline
Update an existing headline.
Parameters:
-
headline_id(int) –The ID of the headline to update.
-
title(str | None, default:None) –New title for the headline.
-
user_id(int | None, default:None) –New owner for the headline.
-
notes(str | None, default:None) –New description text for the headline.
Returns:
-
Headline–The updated
Headline.
Raises:
-
ValueError–If no update fields are provided.
Async Version¶
The async version AsyncHeadlineOperations provides the same methods as above, but with async/await support:
AsyncHeadlineOperations
¶
Async class to handle v2 (GraphQL) operations related to headlines.
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.v2.headline.create(
meeting_id=123,
title="Product launch successful",
notes="Exceeded targets by 15%",
)
# Get headline details
details = client.v2.headline.details(headline.id)
# List headlines for a meeting (open only, by default)
meeting_headlines = client.v2.headline.list(meeting_id=123)
# Include archived headlines too
all_headlines = client.v2.headline.list(meeting_id=123, include_archived=True)
# List headlines for the current user instead
my_headlines = client.v2.headline.list()
# Update the title
updated = client.v2.headline.update(headline.id, title="Updated title")
# Archive, then restore
client.v2.headline.archive(headline.id)
client.v2.headline.restore(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.v2.headline.create(
meeting_id=123,
title="Product launch successful",
notes="Exceeded targets by 15%",
)
# List headlines for a meeting (open only, by default)
meeting_headlines = await client.v2.headline.list(meeting_id=123)
# Update the title
updated = await client.v2.headline.update(headline.id, title="Updated title")
# Archive, then restore
await client.v2.headline.archive(headline.id)
await client.v2.headline.restore(headline.id)
asyncio.run(main())
Available Methods¶
| Method | Description | Parameters | Returns |
|---|---|---|---|
details() |
Get a headline | headline_id |
Headline |
list() |
List headlines for a meeting or a user | meeting_id, user_id, include_archived |
list[Headline] |
create() |
Create a headline | meeting_id, title, user_id, notes |
Headline |
update() |
Update a headline | headline_id, title, user_id, notes |
Headline |
archive() |
Archive a headline | headline_id |
Headline |
restore() |
Restore an archived headline | headline_id |
Headline |
Filtering
list() accepts either meeting_id or user_id, not both. Passing both
raises ValueError. If neither is given, it defaults to the current user.
Update requirements
At least one field must be provided to update(), or it raises ValueError.