generated from wazzamatazz/csharp-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TimeSeriesSample.cs
54 lines (45 loc) · 1.64 KB
/
TimeSeriesSample.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
using System;
namespace Jaahas.Json {
/// <summary>
/// Describes a sample extracted from a JSON document using <see cref="TimeSeriesExtractor"/>.
/// </summary>
public readonly struct TimeSeriesSample {
/// <summary>
/// The key (identifier) for the sample.
/// </summary>
public string Key { get; }
/// <summary>
/// The timestamp for the sample.
/// </summary>
public DateTimeOffset Timestamp { get; }
/// <summary>
/// The value for the sample.
/// </summary>
public object? Value { get; }
/// <summary>
/// Specifies where the <see cref="Timestamp"/> for the sample was sourced from.
/// </summary>
public TimestampSource TimestampSource { get; }
/// <summary>
/// Creates a new <see cref="TimeSeriesSample"/>.
/// </summary>
/// <param name="key">
/// The key for the sample.
/// </param>
/// <param name="timestamp">
/// The sample timestamp.
/// </param>
/// <param name="value">
/// The sample value.
/// </param>
/// <param name="timestampSource">
/// A flag describing the source of the specifed <paramref name="timestamp"/>.
/// </param>
public TimeSeriesSample(string key, DateTimeOffset timestamp, object? value, TimestampSource timestampSource = TimestampSource.Unspecified) {
Key = key ?? throw new ArgumentNullException(nameof(key));
Timestamp = timestamp;
Value = value;
TimestampSource = timestampSource;
}
}
}