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

v3.6.0 #61

Merged
merged 14 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from 13 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
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 All @@ -15,7 +15,7 @@
/// <typeparam name="T">The enumeration type</typeparam>
/// <param name="value">The value of the enumerations</param>
/// <returns>The string value of the enumeration based on the attribute <see cref="EnumMemberAttribute"/></returns>
public static string GetEnumMemberValue<T>(this T value) where T : Enum => typeof(T)

Check warning on line 18 in Nhl.Api.Common/Extensions/EnumExtensions.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference return.
.GetTypeInfo()
.DeclaredMembers
.SingleOrDefault(x => x.Name == value.ToString())
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 @@
/// <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.
{
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 @@ -9,7 +9,7 @@
public class NhlApiWebHttpClient : NhlApiHttpClient
{
private static readonly object _lock = new object();
private static HttpClient _httpClient;

Check warning on line 12 in Nhl.Api.Common/Http/NhlApiWebHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

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

/// <summary>
/// The NHL web api for the NHL HTTP API Web NHL-e endpoint
Expand All @@ -20,7 +20,7 @@
/// <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)
Afischbacher marked this conversation as resolved.
Show resolved Hide resolved
{

}
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 @@ -8,7 +8,7 @@
public class NhlCmsHttpClient : NhlApiHttpClient
{
private static readonly object _lock = new object();
private static HttpClient _httpClient;

Check warning on line 11 in Nhl.Api.Common/Http/NhlCmsHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

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

/// <summary>
/// The dedicated NHL HTTP API endpoint for NHL player images and content
Expand All @@ -18,7 +18,7 @@
/// <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 @@ -8,7 +8,7 @@
public class NhlEApiHttpClient : NhlApiHttpClient
{
private static readonly object _lock = new object();
private static HttpClient _httpClient;

Check warning on line 11 in Nhl.Api.Common/Http/NhlEApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

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

/// <summary>
/// The NHLe Api for the NHLe Api HTTP API Web NHL-e endpoint for statistics
Expand All @@ -19,7 +19,7 @@
/// <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)
{

Afischbacher marked this conversation as resolved.
Show resolved Hide resolved
}
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 @@ -8,7 +8,7 @@
public class NhlShiftChartHttpClient : NhlApiHttpClient
{
private static readonly object _lock = new object();
private static HttpClient _httpClient;

Check warning on line 11 in Nhl.Api.Common/Http/NhlShiftChartHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

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

/// <summary>
/// The dedicated NHL HTTP API endpoint for the shift charts for individual live game feeds
Expand All @@ -18,7 +18,7 @@
/// <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 @@ -8,7 +8,7 @@
public class NhlStaticAssetsApiHttpClient : NhlApiHttpClient
{
private static readonly object _lock = new object();
private static HttpClient _httpClient;

Check warning on line 11 in Nhl.Api.Common/Http/NhlStaticAssetsApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable field '_httpClient' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.
/// <summary>
/// The dedicated NHL static assets NHL HTTP API endpoint
/// </summary>
Expand All @@ -17,7 +17,7 @@
/// <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)
Afischbacher marked this conversation as resolved.
Show resolved Hide resolved
{
}

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 @@ -8,7 +8,7 @@
public class NhlSuggestionApiHttpClient : NhlApiHttpClient
{
private static readonly object _lock = new object();
private static HttpClient _httpClient;

Check warning on line 11 in Nhl.Api.Common/Http/NhlSuggestionApiHttpClient.cs

View workflow job for this annotation

GitHub Actions / build

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

/// <summary>
/// The NHL HTTP API endpoint for the NHL suggestion API
Expand All @@ -18,7 +18,7 @@
/// <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;
Afischbacher marked this conversation as resolved.
Show resolved Hide resolved

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