2024-06-28 10:54:00 -05:00
|
|
|
using System.Text.Json.Serialization;
|
|
|
|
|
|
|
|
|
|
namespace AnthropicClient.Models;
|
|
|
|
|
|
2024-06-29 22:20:55 -05:00
|
|
|
/// <summary>
|
|
|
|
|
/// Represents an event from the Anthropic API.
|
|
|
|
|
/// </summary>
|
2024-06-28 16:30:09 -05:00
|
|
|
public class AnthropicEvent
|
2024-06-28 10:54:00 -05:00
|
|
|
{
|
2024-06-29 22:20:55 -05:00
|
|
|
/// <summary>
|
|
|
|
|
/// The type of the event.
|
|
|
|
|
/// </summary>
|
2024-06-28 10:54:00 -05:00
|
|
|
public string Type { get; init; } = string.Empty;
|
2024-06-29 22:20:55 -05:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The data associated with the event.
|
|
|
|
|
/// </summary>
|
2024-06-28 10:54:00 -05:00
|
|
|
public EventData Data { get; init; } = default!;
|
|
|
|
|
|
|
|
|
|
[JsonConstructor]
|
|
|
|
|
internal AnthropicEvent()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-29 22:20:55 -05:00
|
|
|
/// <summary>
|
|
|
|
|
/// Initializes a new instance of the <see cref="AnthropicEvent"/> class.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="type">The type of the event.</param>
|
|
|
|
|
/// <param name="data">The data associated with the event.</param>
|
|
|
|
|
/// <returns>A new instance of the <see cref="AnthropicEvent"/> class.</returns>
|
2024-06-28 10:54:00 -05:00
|
|
|
public AnthropicEvent(string type, EventData data)
|
|
|
|
|
{
|
|
|
|
|
Type = type;
|
|
|
|
|
Data = data;
|
|
|
|
|
}
|
|
|
|
|
}
|