Defines a packet type PrintJSONPacket used by the AP protocol and a helper class PrintJSONPart. PrintJSONPacket declares the Command name "PrintJSON" and contains an array of PrintJSONPart under the JSON property "data". PrintJSONPart maps a single "text" string.
using System.Text.Json.Serialization;
namespace APLib.Protocol.Packets;
public sealed class PrintJSONPacket : APPacket
{
[JsonPropertyName( "PrintJSON" )]
public override string Command => "PrintJSON";
[JsonPropertyName( "data" )]
public PrintJSONPart[] Data { get; set; } = [];
}
public sealed class PrintJSONPart
{
[JsonPropertyName( "text" )]
public string Text { get; set; }
}