ConversationItemList class

A paginated list of conversation items.

This class is returned when listing items in a conversation.

Example

final items = await client.conversations.items.list(
  conversationId,
  limit: 10,
);

print('Got ${items.data.length} items');
print('Has more: ${items.hasMore}');

if (items.hasMore) {
  // Fetch next page
  final moreItems = await client.conversations.items.list(
    conversationId,
    after: items.lastId,
  );
}
Annotations
  • @immutable

Constructors

ConversationItemList({required List<ConversationItem> data, String object = 'list', required bool hasMore, String? firstId, String? lastId})
Creates a ConversationItemList.
const
ConversationItemList.fromJson(Map<String, dynamic> json)
Creates a ConversationItemList from JSON.
factory

Properties

data List<ConversationItem>
The list of items.
final
firstId String?
The ID of the first item in the list.
final
hashCode int
The hash code for this object.
no setteroverride
hasMore bool
Whether there are more items to fetch.
final
lastId String?
The ID of the last item in the list.
final
object String
The object type, always "list".
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts to JSON.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override