forked from modelcontextprotocol/csharp-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCancelledNotification.cs
More file actions
30 lines (27 loc) · 1.09 KB
/
CancelledNotification.cs
File metadata and controls
30 lines (27 loc) · 1.09 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
using System.Text.Json.Serialization;
namespace ModelContextProtocol.Protocol;
/// <summary>
/// Represents a notification indicating that a request has been cancelled by the client,
/// and that any associated processing should cease immediately.
/// </summary>
/// <remarks>
/// This class is typically used in conjunction with the <see cref="NotificationMethods.CancelledNotification"/>
/// method identifier. When a client sends this notification, the server should attempt to
/// cancel any ongoing operations associated with the specified request ID.
/// </remarks>
public sealed class CancelledNotification
{
/// <summary>
/// Gets or sets the ID of the request to cancel.
/// </summary>
/// <remarks>
/// This must match the ID of an in-flight request that the sender wishes to cancel.
/// </remarks>
[JsonPropertyName("requestId")]
public RequestId RequestId { get; set; }
/// <summary>
/// Gets or sets an optional string describing the reason for the cancellation request.
/// </summary>
[JsonPropertyName("reason")]
public string? Reason { get; set; }
}