-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAiResponse.cs
62 lines (53 loc) · 1.61 KB
/
AiResponse.cs
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
// <auto-generated />
//
// To parse this JSON data, add NuGet 'Newtonsoft.Json' then do:
//
// using AIMonitor;
//
// var aiResponse = AiResponse.FromJson(jsonString);
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Globalization;
namespace AIMonitor
{
public partial class AiResponse
{
[JsonProperty("value")]
public Value Value { get; set; }
}
public partial class Value
{
[JsonProperty("start")]
public DateTimeOffset Start { get; set; }
[JsonProperty("end")]
public DateTimeOffset End { get; set; }
[JsonProperty("exceptions/count")]
public ExceptionsCount ExceptionsCount { get; set; }
}
public partial class ExceptionsCount
{
[JsonProperty("sum")]
public long? Sum { get; set; }
}
public partial class AiResponse
{
public static AiResponse FromJson(string json) => JsonConvert.DeserializeObject<AiResponse>(json, AIMonitor.Converter.Settings);
}
public static class Serialize
{
public static string ToJson(this AiResponse self) => JsonConvert.SerializeObject(self, AIMonitor.Converter.Settings);
}
internal static class Converter
{
public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings
{
MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
DateParseHandling = DateParseHandling.None,
Converters =
{
new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal }
},
};
}
}