forked from harveysburger/pinnaclewrapper
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 13864ff
Showing
42 changed files
with
1,293 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bin/ | ||
obj/ |
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 |
---|---|---|
@@ -0,0 +1,101 @@ | ||
using System; | ||
using Newtonsoft.Json; | ||
|
||
namespace PinnacleWrapper | ||
{ | ||
public class Bet | ||
{ | ||
[JsonProperty(PropertyName = "betId")] | ||
public int BetId; | ||
|
||
[JsonProperty(PropertyName = "wagerNumber")] | ||
public int WagerNumber; | ||
|
||
[JsonProperty(PropertyName = "placedAt")] | ||
public DateTime PlacedAt; | ||
|
||
[JsonProperty(PropertyName = "win")] | ||
public decimal Win; | ||
|
||
[JsonProperty(PropertyName = "risk")] | ||
public decimal Risk; | ||
|
||
[JsonProperty(PropertyName = "winLoss")] | ||
public decimal WinLoss; | ||
|
||
[JsonProperty(PropertyName = "betStatus")] | ||
public BetStatus BetStatus; | ||
|
||
[JsonProperty(PropertyName = "betType")] | ||
public BetType BetType; | ||
|
||
[JsonProperty(PropertyName = "sportId")] | ||
public int SportId; | ||
|
||
[JsonProperty(PropertyName = "leagueId")] | ||
public int LeagueId; | ||
|
||
[JsonProperty(PropertyName = "eventId")] | ||
public int EventId; | ||
|
||
[JsonProperty(PropertyName = "handicap")] | ||
public decimal? Handicap; | ||
|
||
[JsonProperty(PropertyName = "price")] | ||
public decimal Price; | ||
|
||
[JsonProperty(PropertyName = "teamName")] | ||
public string TeamName; | ||
|
||
[JsonProperty(PropertyName = "side")] | ||
public SideType? Side; | ||
|
||
[JsonProperty(PropertyName = "oddsFormat")] | ||
public OddsFormat OddsFormat; | ||
|
||
[JsonProperty(PropertyName = "customerCommission")] | ||
public decimal? ClientCommission; | ||
|
||
[JsonProperty(PropertyName = "pitcher1")] | ||
public string Pitcher1; | ||
|
||
[JsonProperty(PropertyName = "pitcher2")] | ||
public string Pitcher2; | ||
|
||
[JsonProperty(PropertyName = "pitcher1MustStart")] | ||
public bool? Pitcher1MustStart; | ||
|
||
[JsonProperty(PropertyName = "pitcher2MustStart")] | ||
public bool? Pitcher2MustStart; | ||
|
||
[JsonProperty(PropertyName = "team1")] | ||
public string Team1; | ||
|
||
[JsonProperty(PropertyName = "team2")] | ||
public string Team2; | ||
|
||
[JsonProperty(PropertyName = "periodNumber")] | ||
public string PeriodNumber; | ||
|
||
[JsonProperty(PropertyName = "team1Score")] | ||
public decimal? Team1Score; | ||
|
||
[JsonProperty(PropertyName = "team2Score")] | ||
public decimal? Team2Score; | ||
|
||
[JsonProperty(PropertyName = "ftTeam1Score")] | ||
public decimal FullTimeTeam1Score; | ||
|
||
[JsonProperty(PropertyName = "ftTeam2Score")] | ||
public decimal FullTimeTeam2Score; | ||
|
||
[JsonProperty(PropertyName = "pTeam1Score")] | ||
public decimal? PartTimeTeam1Score; | ||
|
||
[JsonProperty(PropertyName = "pTeam2Score")] | ||
public decimal? PartTimeTeam2Score; | ||
|
||
[JsonProperty(PropertyName = "isLive")] | ||
public bool IsLive; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System; | ||
using System.Xml.Serialization; | ||
|
||
namespace PinnacleWrapper | ||
{ | ||
[Serializable] | ||
public class BetAmount | ||
{ | ||
[XmlElement("spread")] | ||
public double Spread { get; set; } | ||
|
||
[XmlElement("moneyLine")] | ||
public double MoneyLine { get; set; } | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace PinnacleWrapper | ||
{ | ||
public enum BetListType | ||
{ | ||
Settled, | ||
Running | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
|
||
namespace PinnacleWrapper | ||
{ | ||
[JsonConverter(typeof(StringEnumConverter))] | ||
public enum BetStatus | ||
{ | ||
Accepted, | ||
PendingAcceptance, | ||
Rejected, | ||
Refunded, | ||
Cancelled, | ||
Lose, | ||
Won | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
|
||
namespace PinnacleWrapper | ||
{ | ||
[JsonConverter(typeof(StringEnumConverter))] | ||
public enum BetType | ||
{ | ||
Spread, | ||
MoneyLine, | ||
TotalPoints, | ||
TeamTotalPoints | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace PinnacleWrapper | ||
{ | ||
public class ClientBalance | ||
{ | ||
[JsonProperty(PropertyName = "availableBalance")] | ||
public decimal AvailableBalance; | ||
|
||
[JsonProperty(PropertyName = "outstandingTransactions")] | ||
public decimal OutstandingTransactions; | ||
|
||
[JsonProperty(PropertyName = "givenCredit")] | ||
public decimal GivenCredit; | ||
|
||
[JsonProperty(PropertyName = "currency")] | ||
public string Currency; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Xml.Serialization; | ||
|
||
namespace PinnacleWrapper | ||
{ | ||
[Serializable] | ||
[XmlRoot("rsp")] | ||
public class CurrenciesResponse : XmlResponse | ||
{ | ||
[XmlArray("currencies")] | ||
[XmlArrayItem("currency")] | ||
public List<Currency> Currencies { get; set; } | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using System.Xml.Serialization; | ||
|
||
namespace PinnacleWrapper | ||
{ | ||
[Serializable] | ||
[XmlRoot("currency")] | ||
public class Currency | ||
{ | ||
[XmlAttribute("code")] | ||
public string Code { get; set; } | ||
|
||
[XmlText] | ||
public string Name { get; set; } | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,73 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Xml.Serialization; | ||
|
||
namespace PinnacleWrapper | ||
{ | ||
[Serializable] | ||
[XmlRoot("event")] | ||
public class Event | ||
{ | ||
[XmlElement("startDateTime")] | ||
public DateTime StartDateTime { get; set; } | ||
|
||
[XmlElement("id")] | ||
public long Id { get; set; } | ||
|
||
[XmlElement("IsLive")] | ||
public string IsLiveString { get; set; } | ||
|
||
[XmlIgnore] | ||
public bool IsLive | ||
{ | ||
get | ||
{ | ||
return IsLiveString.Equals("Yes", StringComparison.OrdinalIgnoreCase); | ||
} | ||
|
||
set | ||
{ | ||
IsLiveString = (value ? "Yes" : "No"); | ||
} | ||
} | ||
|
||
[XmlElement("status")] | ||
public string StatusString { get; set; } | ||
|
||
[XmlIgnore] | ||
public Status Status | ||
{ | ||
get | ||
{ | ||
if (!string.IsNullOrWhiteSpace(StatusString)) | ||
{ | ||
switch (StatusString.ToLower()) | ||
{ | ||
case "o": | ||
return Status.Open; | ||
case "i": | ||
return Status.LowerMaximum; | ||
case "h": | ||
return Status.Unavailable; | ||
case "x": | ||
return Status.Cancelled; | ||
default: | ||
throw new Exception("Unrecognized status: " + StatusString); | ||
} | ||
} | ||
|
||
throw new Exception("No status string"); | ||
} | ||
} | ||
|
||
[XmlElement("homeTeam")] | ||
public Team HomeTeam { get; set; } | ||
|
||
[XmlElement("awayTeam")] | ||
public Team AwayTeam { get; set; } | ||
|
||
[XmlArray("periods")] | ||
[XmlArrayItem("period")] | ||
public List<Period> Periods { get; set; } | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Xml.Serialization; | ||
|
||
namespace PinnacleWrapper | ||
{ | ||
[Serializable] | ||
[XmlRoot("fd")] | ||
public class Feed | ||
{ | ||
[XmlElement("fdTime")] | ||
public long Timestamp { get; set; } | ||
|
||
[XmlArray("sports")] | ||
[XmlArrayItem("sport")] | ||
public List<FeedSport> Sports { get; set; } | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Xml.Serialization; | ||
|
||
namespace PinnacleWrapper | ||
{ | ||
[Serializable] | ||
[XmlRoot("league")] | ||
public class FeedLeague | ||
{ | ||
[XmlElement("id")] | ||
public int Id { get; set; } | ||
|
||
[XmlArray("events")] | ||
[XmlArrayItem("event")] | ||
public List<Event> Events { get; set; } | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
using System.Xml.Serialization; | ||
|
||
namespace PinnacleWrapper | ||
{ | ||
[Serializable] | ||
[XmlRoot("rsp")] | ||
public class FeedResponse : XmlResponse | ||
{ | ||
[XmlElement("fd")] | ||
public Feed Feed { get; set; } | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Xml.Serialization; | ||
|
||
namespace PinnacleWrapper | ||
{ | ||
[Serializable] | ||
[XmlRoot("sport")] | ||
public class FeedSport | ||
{ | ||
[XmlElement("id")] | ||
public int Id { get; set; } | ||
|
||
[XmlArray("leagues")] | ||
[XmlArrayItem("league")] | ||
public List<FeedLeague> Leagues { get; set; } | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
|
||
namespace PinnacleWrapper | ||
{ | ||
public class GetBetsResponse | ||
{ | ||
[JsonProperty(PropertyName = "bets")] | ||
public List<Bet> Bets; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace PinnacleWrapper | ||
{ | ||
public class GetInRunningResponse | ||
{ | ||
[JsonProperty(PropertyName = "elapsed")] | ||
public int Elapsed; | ||
|
||
[JsonProperty(PropertyName = "state")] | ||
public InRunningState State; | ||
|
||
[JsonProperty(PropertyName = "id")] | ||
public int Id; | ||
} | ||
} |
Oops, something went wrong.