using System.Text.Json;
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
using StabilityMatrix.Core.Models.Api.Comfy.WebSocketData;
namespace StabilityMatrix.Core.Models.Api.Comfy;
public class ComfyWebSocketResponse
{
[JsonPropertyName("type")]
public required ComfyWebSocketResponseType Type { get; set; }
///
/// Depending on the value of ,
/// this property will be one of these types
///
/// - Status -
/// - Progress -
/// - Executing -
///
///
[JsonPropertyName("data")]
public required JsonObject Data { get; set; }
public T? GetDataAsType(JsonSerializerOptions? options = null)
where T : class
{
return Data.Deserialize(options);
}
}