forked from datalust/seq-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQueryResultPart.cs
More file actions
98 lines (86 loc) · 3.61 KB
/
Copy pathQueryResultPart.cs
File metadata and controls
98 lines (86 loc) · 3.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// Copyright © Datalust and contributors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using System.Collections.Generic;
using Newtonsoft.Json;
namespace Seq.Api.Model.Data
{
/// <summary>
/// The result of executing a SQL-style query. Results are hierarchical, rather
/// than tabular, to reduce the amount of data transfer required to send events to
/// the client.
/// </summary>
/// <remarks>
/// Only one of <see cref="Rows"/>, <see cref="Slices"/>, or <see cref="Series"/>
/// will be present for a given result set.
/// Generally, the CSV-based query endpoints are more convenient to use for
/// simple ETL tasks.</remarks>
public class QueryResultPart
{
/// <summary>
/// The columns within the result set (at various levels of the hierarchy).
/// </summary>
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public string[] Columns { get; set; }
/// <summary>
/// Metadata, grouped by column.
/// </summary>
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public Dictionary<int, ColumnMetadataPart> ColumnMetadata { get; set; }
/// <summary>
/// Metadata for the time grouping column.
/// </summary>
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public ColumnMetadataPart TimeColumnMetadata { get; set; }
/// <summary>
/// Result rows.
/// </summary>
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public object[][] Rows { get; set; }
/// <summary>
/// Result time slices.
/// </summary>
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public TimeSlicePart[] Slices { get; set; }
/// <summary>
/// Result timeseries.
/// </summary>
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public TimeseriesPart[] Series { get; set; }
/// <summary>
/// Result variables.
/// </summary>
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public Dictionary<string, object> Variables { get; set; }
/// <summary>
/// On error only, a description of the error.
/// </summary>
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public string Error { get; set; }
/// <summary>
/// Reasons for the <see cref="Error"/>.
/// </summary>
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public string[] Reasons { get; set; }
/// <summary>
/// A corrected version of the query, if one could be suggested.
/// </summary>
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public string Suggestion { get; set; }
/// <summary>
/// Execution statistics.
/// </summary>
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public QueryExecutionStatisticsPart Statistics { get; set; }
}
}