Files
octokit.net/Octokit/Models/Response/RepositoryTrafficClone.cs
Mickaël Derriey 16f7d86d69 React to change in the way the RepositoryTraffic API communicates time (#1560)
* React to change in the way the API communicates time

Fixes #1558.
The API used to send times as number of seconds from Unix epoch time.
This has changed and is now ISO 8601.

* remove openssl linking in TravisCI when on macOS

# Conflicts:
#	.travis.yml

* change appveyor config - public projects can no longer use account feeds (plus we dont actually need it anyway)
2017-03-05 21:14:42 +10:00

67 lines
2.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
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(DateTimeOffset timestamp, int count, int uniques)
{
Timestamp = timestamp;
Count = count;
Uniques = uniques;
}
public DateTimeOffset Timestamp { 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
}
}