forked from modelcontextprotocol/csharp-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPaginatedResult.cs
More file actions
30 lines (29 loc) · 1.22 KB
/
PaginatedResult.cs
File metadata and controls
30 lines (29 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
namespace ModelContextProtocol.Protocol;
/// <summary>
/// Provides a base class for result payloads that support cursor-based pagination.
/// </summary>
/// <remarks>
/// <para>
/// Pagination allows API responses to be broken into smaller, manageable chunks when
/// there are potentially many results to return or when dynamically-computed results
/// may incur measurable latency.
/// </para>
/// <para>
/// Classes that inherit from <see cref="PaginatedResult"/> implement cursor-based pagination,
/// where the <see cref="NextCursor"/> property serves as an opaque token pointing to the next
/// set of results.
/// </para>
/// </remarks>
public class PaginatedResult
{
/// <summary>
/// Gets or sets an opaque token representing the pagination position after the last returned result.
/// </summary>
/// <remarks>
/// When a paginated result has more data available, the <see cref="NextCursor"/>
/// property will contain a non-<see langword="null"/> token that can be used in subsequent requests
/// to fetch the next page. When there are no more results to return, the <see cref="NextCursor"/> property
/// will be <see langword="null"/>.
/// </remarks>
public string? NextCursor { get; set; }
}