-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from andmos/feature/anm-GBFSVersion
Feature/anm gbfs version
- Loading branch information
Showing
22 changed files
with
616 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 19 additions & 15 deletions
34
src/BikeshareClient/BikeshareClient/DTO/StationStatusDTO.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,45 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using BikeshareClient.Helpers; | ||
using BikeshareClient.Models; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
|
||
namespace BikeshareClient.DTO | ||
{ | ||
internal readonly struct StationStatusDTO | ||
internal readonly struct StationStatusDTO | ||
{ | ||
[JsonConstructor] | ||
public StationStatusDTO([JsonProperty("last_updated"), JsonConverter(typeof(UnixDateTimeConverter))]DateTime lastUpdated, | ||
[JsonProperty("ttl")] int timeToLive, | ||
[JsonProperty("data")]StationStatusData stationStatusData) | ||
[JsonConstructor] | ||
public StationStatusDTO( | ||
[JsonProperty("last_updated"), JsonConverter(typeof(UnixDateTimeConverter))]DateTime lastUpdated, | ||
[JsonProperty("ttl")] int timeToLive, | ||
[JsonProperty("version"), JsonConverter(typeof(StringToSemanticVersionConverter))] SemanticVersion version, | ||
[JsonProperty("data")]StationStatusData stationStatusData) | ||
{ | ||
LastUpdated = lastUpdated; | ||
TimeToLive = timeToLive; | ||
Version = version ?? new SemanticVersion("1.0"); | ||
StationsStatusData = stationStatusData; | ||
} | ||
|
||
|
||
public DateTime LastUpdated { get; } | ||
public DateTime LastUpdated { get; } | ||
|
||
|
||
public int TimeToLive { get; } | ||
|
||
|
||
public SemanticVersion Version { get; } | ||
|
||
public StationStatusData StationsStatusData { get; } | ||
|
||
} | ||
internal struct StationStatusData | ||
internal struct StationStatusData | ||
{ | ||
[JsonConstructor] | ||
public StationStatusData(IEnumerable<StationStatus> stations) | ||
{ | ||
StationsStatus = stations; | ||
} | ||
[JsonConstructor] | ||
public StationStatusData(IEnumerable<StationStatus> stations) | ||
{ | ||
StationsStatus = stations; | ||
} | ||
|
||
public IEnumerable<StationStatus> StationsStatus { get; } | ||
public IEnumerable<StationStatus> StationsStatus { get; } | ||
} | ||
} |
28 changes: 17 additions & 11 deletions
28
src/BikeshareClient/BikeshareClient/DTO/SystemInformationDTO.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,32 @@ | ||
using System; | ||
using BikeshareClient.Helpers; | ||
using BikeshareClient.Models; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
|
||
namespace BikeshareClient.DTO | ||
{ | ||
internal readonly struct SystemInformationDTO | ||
internal readonly struct SystemInformationDTO | ||
{ | ||
public SystemInformationDTO([JsonProperty("last_updated"), JsonConverter(typeof(UnixDateTimeConverter))] DateTime lastupdated, | ||
[JsonProperty("ttl")] int timeToLive, | ||
[JsonProperty("data")] SystemInformation systemInformation) | ||
public SystemInformationDTO( | ||
[JsonProperty("last_updated"), JsonConverter(typeof(UnixDateTimeConverter))] DateTime lastupdated, | ||
[JsonProperty("ttl")] int timeToLive, | ||
[JsonProperty("version"), JsonConverter(typeof(StringToSemanticVersionConverter))] SemanticVersion version, | ||
[JsonProperty("data")] SystemInformation systemInformation) | ||
{ | ||
LastUpdated = lastupdated; | ||
TimeToLive = timeToLive; | ||
SystemInformation = systemInformation; | ||
} | ||
LastUpdated = lastupdated; | ||
TimeToLive = timeToLive; | ||
Version = version ?? new SemanticVersion("1.0"); | ||
SystemInformation = systemInformation; | ||
} | ||
|
||
public DateTime LastUpdated { get; } | ||
public DateTime LastUpdated { get; } | ||
|
||
public int TimeToLive { get; } | ||
public int TimeToLive { get; } | ||
|
||
public SystemInformation SystemInformation { get; } | ||
public SemanticVersion Version { get; } | ||
|
||
public SystemInformation SystemInformation { get; } | ||
|
||
} | ||
} |
Oops, something went wrong.