29 public string Summary {
get; init; } =
"";
34 public Dictionary<string, string>
QueryTags {
get; init; } =
new();
45 if (json.TryGetProperty(LastSeenTxnFieldName, out var elem))
50 if (json.TryGetProperty(SchemaVersionFieldName, out elem))
55 if (json.TryGetProperty(SummaryFieldName, out elem))
57 Summary = elem.GetString() ??
"";
61 if (json.TryGetProperty(QueryTagsFieldName, out elem))
63 var queryTagsString = elem.GetString();
65 if (!
string.IsNullOrEmpty(queryTagsString))
67 var tagPairs = queryTagsString.Split(
',').Select(tag =>
69 var tokens = tag.Split(
'=');
70 return KeyValuePair.Create(tokens[0], tokens[1]);
73 QueryTags =
new Dictionary<string, string>(tagPairs);
77 if (json.TryGetProperty(StatsFieldName, out elem))
95 HttpStatusCode statusCode,
100 var json = JsonSerializer.Deserialize<JsonElement>(body);
102 if (statusCode is >= HttpStatusCode.OK and <= (HttpStatusCode)299)
109 catch (JsonException)
144 var dataText = json.GetProperty(DataFieldName).GetRawText();
149 if (json.TryGetProperty(StaticTypeFieldName, out var elem))
172 public QueryFailure(HttpStatusCode statusCode, JsonElement json) : base(json)
175 if (!json.TryGetProperty(ErrorFieldName, out var elem))
return;
177 var info = elem.Deserialize<
ErrorInfo>();
Represents a failed query response.
object? ConstraintFailures
QueryFailure(HttpStatusCode statusCode, JsonElement json)
Initializes a new instance of the QueryFailure class, parsing the provided raw response text to extra...
HttpStatusCode StatusCode
Represents the response from a query executed.
QueryStats Stats
Gets the statistics related to the query execution.
Dictionary< string, string > QueryTags
Gets a dictionary of query tags, providing additional context about the query.
string Summary
Gets a summary of the query execution.
long LastSeenTxn
Gets the last transaction seen by this query.
static ? QueryResponse GetFromResponseBody< T >(MappingContext ctx, IDeserializer< T > deserializer, HttpStatusCode statusCode, string body)
Asynchronously parses the HTTP response message to create a QueryResponse instance.
long SchemaVersion
Gets the schema version.
Represents a successful query response.
QuerySuccess(MappingContext ctx, IDeserializer< T > deserializer, JsonElement json)
Initializes a new instance of the QuerySuccess<T> class, deserializing the query response into the sp...
T Data
Gets the deserialized data from the query response.
string? StaticType
Gets the static type information from the query response, if available.
new T Deserialize(MappingContext context, ref Utf8FaunaReader reader)
Contains detailed information about an error in a query response.
object? ConstraintFailures
The constraint failures that occurred during the query.
Contains statistics related to the execution of a query in the Fauna database.
Represents a reader that provides fast, non-cached, forward-only access to serialized data.