Skip to content

Commit

Permalink
Merge pull request #61 from Afischbacher/develop
Browse files Browse the repository at this point in the history
v3.6.0
  • Loading branch information
Afischbacher authored Nov 5, 2024
2 parents d721f97 + 082c1c9 commit 4ad27d0
Show file tree
Hide file tree
Showing 32 changed files with 842 additions and 193 deletions.
19 changes: 19 additions & 0 deletions Nhl.Api.Common/Attributes/TeamActiveAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;

namespace Nhl.Api.Common.Attributes;

/// <summary>
/// An enumeration to specifically mark NHL teams active or inactive
/// </summary>
/// <remarks>
/// The constructor
/// </remarks>
/// <param name="isActive">Whether an NHL team is active in the leauge</param>
[AttributeUsage(AttributeTargets.Field, Inherited = false, AllowMultiple = false)]
public class TeamActiveAttribute(bool isActive) : Attribute
{
/// <summary>
/// Determines if the NHL team is currently active
/// </summary>
public bool IsActive { get; } = isActive;
}
2 changes: 1 addition & 1 deletion Nhl.Api.Common/Extensions/EnumExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
Expand Down
2 changes: 1 addition & 1 deletion Nhl.Api.Common/Http/NhlApiHttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public abstract class NhlApiHttpClient : INhlApiHttpClient
/// <summary>
/// The Nhl.Api HTTP Client
/// </summary>
public NhlApiHttpClient(string clientApiUri, string clientVersion, int timeoutInSeconds = 30)
public NhlApiHttpClient(string clientApiUri, string clientVersion, int timeoutInSeconds = 60)

Check warning on line 62 in Nhl.Api.Common/Http/NhlApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'HttpClient' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 62 in Nhl.Api.Common/Http/NhlApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'HttpClient' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 62 in Nhl.Api.Common/Http/NhlApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'HttpClient' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 62 in Nhl.Api.Common/Http/NhlApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'HttpClient' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 62 in Nhl.Api.Common/Http/NhlApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'HttpClient' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 62 in Nhl.Api.Common/Http/NhlApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'HttpClient' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 62 in Nhl.Api.Common/Http/NhlApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'HttpClient' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 62 in Nhl.Api.Common/Http/NhlApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'HttpClient' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 62 in Nhl.Api.Common/Http/NhlApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'HttpClient' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 62 in Nhl.Api.Common/Http/NhlApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'HttpClient' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 62 in Nhl.Api.Common/Http/NhlApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'HttpClient' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 62 in Nhl.Api.Common/Http/NhlApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'HttpClient' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 62 in Nhl.Api.Common/Http/NhlApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'HttpClient' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 62 in Nhl.Api.Common/Http/NhlApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'HttpClient' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 62 in Nhl.Api.Common/Http/NhlApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'HttpClient' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 62 in Nhl.Api.Common/Http/NhlApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'HttpClient' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 62 in Nhl.Api.Common/Http/NhlApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'HttpClient' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 62 in Nhl.Api.Common/Http/NhlApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'HttpClient' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 62 in Nhl.Api.Common/Http/NhlApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'HttpClient' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 62 in Nhl.Api.Common/Http/NhlApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'HttpClient' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 62 in Nhl.Api.Common/Http/NhlApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'HttpClient' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 62 in Nhl.Api.Common/Http/NhlApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'HttpClient' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 62 in Nhl.Api.Common/Http/NhlApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'HttpClient' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 62 in Nhl.Api.Common/Http/NhlApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'HttpClient' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 62 in Nhl.Api.Common/Http/NhlApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'HttpClient' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 62 in Nhl.Api.Common/Http/NhlApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'HttpClient' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 62 in Nhl.Api.Common/Http/NhlApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'HttpClient' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 62 in Nhl.Api.Common/Http/NhlApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'HttpClient' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
{
ServicePointManager.ReusePort = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls13 | SecurityProtocolType.Tls12;
Expand Down
2 changes: 1 addition & 1 deletion Nhl.Api.Common/Http/NhlApiWebHttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class NhlApiWebHttpClient : NhlApiHttpClient
/// <summary>
/// The dedicated NHL web api HTTP Client for the Nhl.Api
/// </summary>
public NhlApiWebHttpClient() : base(clientApiUri: ClientApiUrl, clientVersion: "v1", timeoutInSeconds: 30)
public NhlApiWebHttpClient() : base(clientApiUri: ClientApiUrl, clientVersion: "v1", timeoutInSeconds: 60)
{

}
Expand Down
4 changes: 2 additions & 2 deletions Nhl.Api.Common/Http/NhlCmsHttpClient.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Net.Http;

namespace Nhl.Api.Common.Http;
Expand All @@ -18,7 +18,7 @@ public class NhlCmsHttpClient : NhlApiHttpClient
/// <summary>
/// The dedicated NHL HTTP client for NHL player images and content
/// </summary>
public NhlCmsHttpClient() : base(clientApiUri: ClientApiUrl, clientVersion: string.Empty, timeoutInSeconds: 30)
public NhlCmsHttpClient() : base(clientApiUri: ClientApiUrl, clientVersion: string.Empty, timeoutInSeconds: 60)
{
}

Expand Down
4 changes: 2 additions & 2 deletions Nhl.Api.Common/Http/NhlEApiHttpClient.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Net.Http;

namespace Nhl.Api.Common.Http;
Expand All @@ -19,7 +19,7 @@ public class NhlEApiHttpClient : NhlApiHttpClient
/// <summary>
/// The dedicated NHLe Api web api HTTP Client for the Nhl.Api
/// </summary>
public NhlEApiHttpClient() : base(clientApiUri: ClientApiUrl, clientVersion: string.Empty, timeoutInSeconds: 30)
public NhlEApiHttpClient() : base(clientApiUri: ClientApiUrl, clientVersion: string.Empty, timeoutInSeconds: 60)
{

}
Expand Down
2 changes: 1 addition & 1 deletion Nhl.Api.Common/Http/NhlShiftChartHttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class NhlShiftChartHttpClient : NhlApiHttpClient
/// <summary>
/// The dedicated NHL HTTP client for the shift charts for individual live game feeds
/// </summary>
public NhlShiftChartHttpClient() : base(clientApiUri: ClientApiUrl, clientVersion: string.Empty, timeoutInSeconds: 30)
public NhlShiftChartHttpClient() : base(clientApiUri: ClientApiUrl, clientVersion: string.Empty, timeoutInSeconds: 60)
{
}

Expand Down
2 changes: 1 addition & 1 deletion Nhl.Api.Common/Http/NhlStaticAssetsApiHttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class NhlStaticAssetsApiHttpClient : NhlApiHttpClient
/// <summary>
/// The dedicated NHL static assets HTTP Client for the Nhl.Api
/// </summary>
public NhlStaticAssetsApiHttpClient() : base(clientApiUri: ClientApiUrl, clientVersion: string.Empty, timeoutInSeconds: 30)
public NhlStaticAssetsApiHttpClient() : base(clientApiUri: ClientApiUrl, clientVersion: string.Empty, timeoutInSeconds: 60)
{
}

Expand Down
4 changes: 2 additions & 2 deletions Nhl.Api.Common/Http/NhlSuggestionApiHttpClient.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Net.Http;

namespace Nhl.Api.Common.Http;
Expand All @@ -18,7 +18,7 @@ public class NhlSuggestionApiHttpClient : NhlApiHttpClient
/// <summary>
/// The dedicated NHL HTTP Client for the NHL suggestion API
/// </summary>
public NhlSuggestionApiHttpClient() : base(clientApiUri: ClientApiUrl, clientVersion: "v1", timeoutInSeconds: 30)
public NhlSuggestionApiHttpClient() : base(clientApiUri: ClientApiUrl, clientVersion: "v1", timeoutInSeconds: 60)
{
}

Expand Down
2 changes: 1 addition & 1 deletion Nhl.Api.Common/Nhl.Api.Common.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version>3.5.0</Version>
<Version>3.6.0</Version>
<TargetFrameworks>net8.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Nullable>enable</Nullable>
Expand Down
35 changes: 35 additions & 0 deletions Nhl.Api.Domain/Enumerations/Team/TeamEnum.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using Nhl.Api.Common.Attributes;

namespace Nhl.Api.Models.Enumerations.Team;

/// <summary>
Expand All @@ -8,133 +10,166 @@ public enum TeamEnum
/// <summary>
/// New Jersey Devils
/// </summary>
[TeamActive(true)]
NewJerseyDevils = 1,
/// <summary>
/// New York Islanders
/// </summary>
[TeamActive(true)]
NewYorkIslanders = 2,
/// <summary>
/// New York Rangers
/// </summary>
[TeamActive(true)]
NewYorkRangers = 3,
/// <summary>
/// Philadelphia Flyers
/// </summary>
[TeamActive(true)]
PhiladelphiaFlyers = 4,
/// <summary>
/// Pittsburgh Penguins
/// </summary>
[TeamActive(true)]
PittsburghPenguins = 5,
/// <summary>
/// Boston Bruins
/// </summary>
[TeamActive(true)]
BostonBruins = 6,
/// <summary>
/// Buffalo Sabres
/// </summary>
[TeamActive(true)]
BuffaloSabres = 7,
/// <summary>
/// Montreal Canadiens
/// </summary>
[TeamActive(true)]
MontrealCanadiens = 8,
/// <summary>
/// Ottawa Senators
/// </summary>
[TeamActive(true)]
OttawaSenators = 9,
/// <summary>
/// Toronto Maple Leafs
/// </summary>
[TeamActive(true)]
TorontoMapleLeafs = 10,
/// <summary>
/// Carolina Hurricanes
/// </summary>
[TeamActive(true)]
CarolinaHurricanes = 12,
/// <summary>
/// Florida Panthers
/// </summary>
[TeamActive(true)]
FloridaPanthers = 13,
/// <summary>
/// Tampa Bay Lightning
/// </summary>
[TeamActive(true)]
TampaBayLightning = 14,
/// <summary>
/// Washington Capitals
/// </summary>
[TeamActive(true)]
WashingtonCapitals = 15,
/// <summary>
/// Chicago Blackhawks
/// </summary>
[TeamActive(true)]
ChicagoBlackhawks = 16,
/// <summary>
/// Detroit Red Wings
/// </summary>
[TeamActive(true)]
DetroitRedWings = 17,
/// <summary>
/// Nashville Predators
/// </summary>
[TeamActive(true)]
NashvillePredators = 18,
/// <summary>
/// St.Louis Blues
/// </summary>
[TeamActive(true)]
StLouisBlues = 19,
/// <summary>
/// Calgary Flames
/// </summary>
[TeamActive(true)]
CalgaryFlames = 20,
/// <summary>
/// Colorado Avalanche
/// </summary>
[TeamActive(true)]
ColoradoAvalanche = 21,
/// <summary>
/// Edmonton Oilers
/// </summary>
[TeamActive(true)]
EdmontonOilers = 22,
/// <summary>
/// Vancouver Canucks
/// </summary>
[TeamActive(true)]
VancouverCanucks = 23,
/// <summary>
/// Anaheim Ducks
/// </summary>
[TeamActive(true)]
AnaheimDucks = 24,
/// <summary>
/// Dallas Stars
/// </summary>
[TeamActive(true)]
DallasStars = 25,
/// <summary>
/// Los Angeles Kings
/// </summary>
[TeamActive(true)]
LosAngelesKings = 26,
/// <summary>
/// San Jose Sharks
/// </summary>
[TeamActive(true)]
SanJoseSharks = 28,
/// <summary>
/// Columbus Blue Jackets
/// </summary>
[TeamActive(true)]
ColumbusBlueJackets = 29,
/// <summary>
/// Minnesota Wild
/// </summary>
[TeamActive(true)]
MinnesotaWild = 30,
/// <summary>
/// Winnipeg Jets
/// </summary>
[TeamActive(true)]
WinnipegJets = 52,
/// <summary>
/// Arizona Coyotes
/// </summary>
[TeamActive(false)]
ArizonaCoyotes = 53,
/// <summary>
/// Vegas Golden Knights
/// </summary>
[TeamActive(true)]
VegasGoldenKnights = 54,
/// <summary>
/// Seattle Kraken
/// </summary>
[TeamActive(true)]
SeattleKraken = 55,
/// <summary>
/// Utah Hockey Club
/// </summary>
[TeamActive(true)]
UtahHockeyClub = 59
}
4 changes: 2 additions & 2 deletions Nhl.Api.Domain/Models/Draft/DraftYear.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@


namespace Nhl.Api.Models.Draft;

/// <summary>
/// All of the valid NHL draft years
/// </summary>
public class DraftYear
public sealed class DraftYear
{
/// <summary>
/// NHL Draft Year 1963
Expand Down
Loading

0 comments on commit 4ad27d0

Please sign in to comment.