Skip to content

Commit

Permalink
Migrate project to .NET Standard 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
CwistSilver committed Mar 4, 2024
1 parent 75d8e2a commit 2254b6e
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion Dynu.API.Tests/DynuSharp.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
5 changes: 1 addition & 4 deletions DynuSharp/Client/Connection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ private async Task<HttpClient> CreateAndInitializeHttpClientAsync()
.WaitAndRetryAsync(3, retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)));


var handler = new SocketsHttpHandler
{
PooledConnectionLifetime = TimeSpan.FromMinutes(15)
};
var handler = new HttpClientHandler();

var policyHandler = new PolicyHttpMessageHandler(retryPolicy)
{
Expand Down
16 changes: 8 additions & 8 deletions DynuSharp/Data/Dns/DnsIpUpdate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ public class DnsIpUpdate
/// The unique identifier for the IP update.
/// </summary>
[JsonPropertyName("id")]
public int Id { get; init; }
public int Id { get; set; }

/// <summary>
/// The identifier for the server's response to the update request.
/// </summary>
[JsonPropertyName("responseId")]
public string ResponseId { get; init; } = string.Empty;
public string ResponseId { get; set; } = string.Empty;

/// <summary>
/// The status of the update operation, represented as an <see cref="UpdateStatus"/> enumeration.
Expand All @@ -25,37 +25,37 @@ public class DnsIpUpdate
/// The IPv4 address involved in the update.
/// </summary>
[JsonPropertyName("ipv4Address")]
public string? IPv4Address { get; init; } = string.Empty;
public string? IPv4Address { get; set; } = string.Empty;

/// <summary>
/// The IPv6 address involved in the update.
/// </summary>
[JsonPropertyName("ipv6Address")]
public string? IPv6Address { get; init; } = string.Empty;
public string? IPv6Address { get; set; } = string.Empty;

/// <summary>
/// The query string used in the update request.
/// </summary>
[JsonPropertyName("queryString")]
public string QueryString { get; init; } = string.Empty;
public string QueryString { get; set; } = string.Empty;

/// <summary>
/// The User-Agent string from the client making the update request.
/// </summary>
[JsonPropertyName("userAgent")]
public string UserAgent { get; init; } = string.Empty;
public string UserAgent { get; set; } = string.Empty;

/// <summary>
/// Indicates whether the update was performed over SSL.
/// </summary>
[JsonPropertyName("ssl")]
public bool SSL { get; init; }
public bool SSL { get; set; }

/// <summary>
/// The date and time when the update was performed.
/// </summary>
[JsonPropertyName("updatedOn")]
public DateTime UpdatedOn { get; init; }
public DateTime UpdatedOn { get; set; }

public override bool Equals(object? obj)
{
Expand Down
10 changes: 5 additions & 5 deletions DynuSharp/Data/Dns/Record/DnsRecordBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class DnsRecordBase
/// </summary>
[JsonPropertyName("id")]
[IgnoreOnPost]
public int Id { get; init; }
public int Id { get; set; }

/// <summary>
/// The unique identifier for the domain associated with the DNS record.
Expand All @@ -34,7 +34,7 @@ public class DnsRecordBase
/// </summary>
[JsonPropertyName("domainName")]
[IgnoreOnPost]
public string DomainName { get; init; } = string.Empty;
public string DomainName { get; set; } = string.Empty;

/// <summary>
/// The name of the node associated with the DNS record.
Expand All @@ -48,7 +48,7 @@ public class DnsRecordBase
/// </summary>
[JsonPropertyName("hostname")]
[IgnoreOnPost]
public string Hostname { get; init; } = string.Empty;
public string Hostname { get; set; } = string.Empty;

/// <summary>
/// The type of the DNS record. This can be one of several enumerated values representing different DNS record types.
Expand All @@ -68,15 +68,15 @@ public class DnsRecordBase
/// </summary>
[JsonPropertyName("content")]
[IgnoreOnPost]
public string Content { get; init; } = string.Empty;
public string Content { get; set; } = string.Empty;

/// <summary>
/// The date and time when the DNS record was last updated.
/// <para>Note: Read-only for API requests (This property is not considered when creating or updating through API requests).</para>
/// </summary>
[JsonPropertyName("updatedOn")]
[IgnoreOnPost]
public DateTime UpdatedOn { get; init; }
public DateTime UpdatedOn { get; set; }

public override bool Equals(object? obj)
{
Expand Down
10 changes: 5 additions & 5 deletions DynuSharp/Data/DnsWebRedirect/DnsWebRedirectBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ public class DnsWebRedirectBase
/// </summary>
[JsonPropertyName("id")]
[IgnoreOnPost]
public int Id { get; init; }
public int Id { get; set; }

/// <summary>
/// The unique identifier for the domain associated with the web redirect.
/// <para>Note: Read-only for API requests (This property is not considered when creating or updating through API requests).</para>
/// </summary>
[JsonPropertyName("domainId")]
[IgnoreOnPost]
public int DomainId { get; init; }
public int DomainId { get; set; }

/// <summary>
/// The name of the domain associated with the web redirect.
/// <para>Note: Read-only for API requests (This property is not considered when creating or updating through API requests).</para>
/// </summary>
[JsonPropertyName("domainName")]
[IgnoreOnPost]
public string DomainName { get; init; } = string.Empty;
public string DomainName { get; set; } = string.Empty;

/// <summary>
/// The name of the node associated with the web redirect.
Expand All @@ -43,7 +43,7 @@ public class DnsWebRedirectBase
/// </summary>
[JsonPropertyName("hostname")]
[IgnoreOnPost]
public string Hostname { get; init; } = string.Empty;
public string Hostname { get; set; } = string.Empty;

/// <summary>
/// The type of web redirect, which can either be URL forwarding (UF) or port forwarding (PF).
Expand All @@ -63,7 +63,7 @@ public class DnsWebRedirectBase
/// </summary>
[JsonPropertyName("updatedOn")]
[IgnoreOnPost]
public DateTime UpdatedOn { get; init; }
public DateTime UpdatedOn { get; set; }

/// <summary>
/// Indicates whether to use dynamic IPv4 address for the redirect.
Expand Down
4 changes: 2 additions & 2 deletions DynuSharp/Data/Email/DynuEmailAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public sealed class DynuEmailAccount
{
[JsonPropertyName("id")]
[IgnoreOnPost]
public int Id { get; init; }
public int Id { get; set; }

[JsonPropertyName("emailId")]
public int EmailId { get; set; }
Expand All @@ -16,7 +16,7 @@ public sealed class DynuEmailAccount

[JsonPropertyName("unicodeEmailAddress")]
[IgnoreOnPost]
public string UnicodeEmailAddress { get; init; } = string.Empty;
public string UnicodeEmailAddress { get; set; } = string.Empty;

[JsonPropertyName("state")]
public EmailAccountState State { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions DynuSharp/Data/Email/DynuEmailListBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ public class DynuEmailListBase
{
[JsonPropertyName("id")]
[IgnoreOnPost]
public int Id { get; init; }
public int Id { get; set; }

[JsonPropertyName("domainId")]
[IgnoreOnPost]
public int DomainId { get; init; }
public int DomainId { get; set; }

[JsonPropertyName("domainName")]
public string DomainName { get; set; } = string.Empty;
Expand Down
2 changes: 1 addition & 1 deletion DynuSharp/Data/Email/QueuedEmailMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public sealed class QueuedEmailMessage

[JsonPropertyName("tries")]
[IgnoreOnPost]
public int Tries { get; init; }
public int Tries { get; set; }

[JsonPropertyName("createdOn")]
[IgnoreOnPost]
Expand Down
2 changes: 1 addition & 1 deletion DynuSharp/Data/Email/Type/DynuEmailServiceBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class DynuEmailServiceBase
{
[JsonPropertyName("id")]
[IgnoreOnPost]
public int Id { get; init; }
public int Id { get; set; }

[JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;
Expand Down
10 changes: 5 additions & 5 deletions DynuSharp/Data/Monitor/MonitorBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class MonitorBase
/// </summary>
[JsonPropertyName("id")]
[IgnoreOnPost]
public int Id { get; init; }
public int Id { get; set; }

/// <summary>
/// The name of the monitor.
Expand All @@ -39,7 +39,7 @@ public class MonitorBase
/// </summary>
[JsonPropertyName("state")]
[IgnoreOnPost]
public MonitorState State { get; init; }
public MonitorState State { get; set; }

/// <summary>
/// A boolean value indicating whether the monitor is paused.
Expand All @@ -53,23 +53,23 @@ public class MonitorBase
/// </summary>
[JsonPropertyName("lastCheck")]
[IgnoreOnPost]
public DateTime LastCheck { get; init; }
public DateTime LastCheck { get; set; }

/// <summary>
/// The date and time of the next check to be performed by the monitor.
/// <para>Note: Read-only for API requests (This property is not considered when creating or updating through API requests).</para>
/// </summary>
[JsonPropertyName("nextCheck")]
[IgnoreOnPost]
public DateTime? NextCheck { get; init; }
public DateTime? NextCheck { get; set; }

/// <summary>
/// The date and time of the last successful check performed by the monitor.
/// <para>Note: Read-only for API requests (This property is not considered when creating or updating through API requests).</para>
/// </summary>
[JsonPropertyName("lastSuccessfulCheck")]
[IgnoreOnPost]
public DateTime LastSuccessfulCheck { get; init; }
public DateTime LastSuccessfulCheck { get; set; }

public override bool Equals(object? obj)
{
Expand Down
5 changes: 4 additions & 1 deletion DynuSharp/DynuSharp.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFramework>netstandard2.1</TargetFramework>
<LangVersion>11</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Title>DynuSharp</Title>
Expand Down Expand Up @@ -36,5 +37,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="8.0.1" />
<PackageReference Include="Microsoft.TSS" Version="2.1.1" />
<PackageReference Include="System.Net.Http.Json" Version="8.0.0" />
<PackageReference Include="System.Text.Json" Version="8.0.2" />
</ItemGroup>
</Project>

0 comments on commit 2254b6e

Please sign in to comment.