-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
RepositoryTrafficClone.cs
75 lines (61 loc) · 2.45 KB
/
RepositoryTrafficClone.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
63
64
65
66
67
68
69
70
71
72
73
74
75
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using Octokit.Helpers;
using Octokit.Internal;
namespace Octokit
{
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class RepositoryTrafficCloneSummary
{
public RepositoryTrafficCloneSummary() { }
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "It's a property from the api.")]
public RepositoryTrafficCloneSummary(int count, int uniques, IReadOnlyList<RepositoryTrafficClone> clones)
{
Count = count;
Uniques = uniques;
Clones = clones;
}
public int Count { get; protected set; }
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "It's a property from the api.")]
public int Uniques { get; protected set; }
public IReadOnlyList<RepositoryTrafficClone> Clones { get; protected set; }
internal string DebuggerDisplay
{
get { return string.Format(CultureInfo.InvariantCulture, "Number: {0} Uniques: {1}", Count, Uniques); }
}
}
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class RepositoryTrafficClone
{
public RepositoryTrafficClone() { }
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "It's a property from the api.")]
public RepositoryTrafficClone(long timestamp, int count, int uniques)
{
TimestampAsUtcEpochSeconds = timestamp;
Count = count;
Uniques = uniques;
}
[Parameter(Key = "ignoreThisField")]
public DateTimeOffset Timestamp
{
get { return TimestampAsUtcEpochSeconds.FromUnixTime(); }
}
[Parameter(Key = "timestamp")]
public long TimestampAsUtcEpochSeconds { get; protected set; }
public int Count { get; protected set; }
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "It's a property from the api.")]
public int Uniques { get; protected set; }
internal string DebuggerDisplay
{
get { return string.Format(CultureInfo.InvariantCulture, "Number: {0} Uniques: {1}", Count, Uniques); }
}
}
public enum TrafficDayOrWeek
{
Day,
Week
}
}