Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React to change in the way the RepositoryTraffic API communicates time #1560

Merged
merged 3 commits into from
Mar 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ matrix:
mono: 4.2.3
dotnet: 1.0.0-preview2-003121

before_install:
- if test "$TRAVIS_OS_NAME" == "osx"; then ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/; ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/; fi

install:
- nuget restore Octokit-Mono.sln

Expand Down
15 changes: 3 additions & 12 deletions Octokit/Models/Response/RepositoryTrafficClone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using Octokit.Helpers;
using Octokit.Internal;

namespace Octokit
{
Expand Down Expand Up @@ -40,21 +38,14 @@ 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)
public RepositoryTrafficClone(DateTimeOffset timestamp, int count, int uniques)
{
TimestampAsUtcEpochSeconds = timestamp;
Timestamp = 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 DateTimeOffset Timestamp { get; protected set; }

public int Count { get; protected set; }

Expand Down
13 changes: 3 additions & 10 deletions Octokit/Models/Response/RepositoryTrafficView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,14 @@ public class RepositoryTrafficView
public RepositoryTrafficView() { }

[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "It's a property from the api.")]
public RepositoryTrafficView(long timestamp, int count, int uniques)
public RepositoryTrafficView(DateTimeOffset timestamp, int count, int uniques)
{
TimestampAsUtcEpochSeconds = timestamp;
Timestamp = 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 DateTimeOffset Timestamp { get; protected set; }

public int Count { get; protected set; }

Expand Down
3 changes: 0 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ build_script:
- cmd: build.cmd CreatePackages
- cmd: build.cmd UnitTestsDotNetCore
test: off
nuget:
account_feed: true
project_feed: true
artifacts:
- path: 'packaging\octokit*.nupkg'
name: OctokitPackages