// #nullable enable using System.Text.Json; using System.Text.Json.Serialization; using System.Text.Json.Serialization.Metadata; namespace CarpaNet.AspNetCore; /// /// ATProtocol XRPC error response body. /// public sealed class XrpcError { /// /// Gets the error type identifier. /// [JsonPropertyName("error")] public string? Error { get; init; } /// /// Gets the human-readable error message. /// [JsonPropertyName("message")] public string? Message { get; init; } /// /// Serializes this error to a JSON string. /// public string ToJson() { return JsonSerializer.Serialize(this, XrpcJsonContext.Default.XrpcError); } }