121 lines
2.9 KiB
C#
121 lines
2.9 KiB
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace IronLicensing.Client.Models;
|
|
|
|
internal class ValidationResponse
|
|
{
|
|
[JsonPropertyName("valid")]
|
|
public bool Valid { get; set; }
|
|
|
|
[JsonPropertyName("license")]
|
|
public ValidationLicenseInfo? License { get; set; }
|
|
|
|
[JsonPropertyName("signature")]
|
|
public string? Signature { get; set; }
|
|
|
|
[JsonPropertyName("signingPublicKey")]
|
|
public string? SigningPublicKey { get; set; }
|
|
|
|
[JsonPropertyName("signedAt")]
|
|
public DateTime? SignedAt { get; set; }
|
|
|
|
[JsonPropertyName("error")]
|
|
public ApiError? Error { get; set; }
|
|
}
|
|
|
|
internal class ValidationLicenseInfo
|
|
{
|
|
[JsonPropertyName("id")]
|
|
public Guid Id { get; set; }
|
|
|
|
[JsonPropertyName("status")]
|
|
public string Status { get; set; } = string.Empty;
|
|
|
|
[JsonPropertyName("tier")]
|
|
public string Tier { get; set; } = string.Empty;
|
|
|
|
[JsonPropertyName("customerEmail")]
|
|
public string CustomerEmail { get; set; } = string.Empty;
|
|
|
|
[JsonPropertyName("expiresAt")]
|
|
public DateTime? ExpiresAt { get; set; }
|
|
|
|
[JsonPropertyName("features")]
|
|
public List<string> Features { get; set; } = [];
|
|
|
|
[JsonPropertyName("activationsUsed")]
|
|
public int ActivationsUsed { get; set; }
|
|
|
|
[JsonPropertyName("activationsMax")]
|
|
public int ActivationsMax { get; set; }
|
|
}
|
|
|
|
internal class ActivationResponse
|
|
{
|
|
[JsonPropertyName("success")]
|
|
public bool Success { get; set; }
|
|
|
|
[JsonPropertyName("activation")]
|
|
public ActivationInfo? Activation { get; set; }
|
|
|
|
[JsonPropertyName("license")]
|
|
public ActivationLicenseInfo? License { get; set; }
|
|
|
|
[JsonPropertyName("error")]
|
|
public ApiError? Error { get; set; }
|
|
}
|
|
|
|
internal class ActivationInfo
|
|
{
|
|
[JsonPropertyName("id")]
|
|
public Guid Id { get; set; }
|
|
|
|
[JsonPropertyName("activatedAt")]
|
|
public DateTime ActivatedAt { get; set; }
|
|
}
|
|
|
|
internal class ActivationLicenseInfo
|
|
{
|
|
[JsonPropertyName("activationsUsed")]
|
|
public int ActivationsUsed { get; set; }
|
|
|
|
[JsonPropertyName("activationsMax")]
|
|
public int ActivationsMax { get; set; }
|
|
}
|
|
|
|
internal class ApiError
|
|
{
|
|
[JsonPropertyName("code")]
|
|
public string Code { get; set; } = string.Empty;
|
|
|
|
[JsonPropertyName("message")]
|
|
public string Message { get; set; } = string.Empty;
|
|
}
|
|
|
|
internal class CheckoutApiResponse
|
|
{
|
|
[JsonPropertyName("sessionId")]
|
|
public string SessionId { get; set; } = string.Empty;
|
|
|
|
[JsonPropertyName("checkoutUrl")]
|
|
public string CheckoutUrl { get; set; } = string.Empty;
|
|
|
|
[JsonPropertyName("expiresAt")]
|
|
public DateTime ExpiresAt { get; set; }
|
|
}
|
|
|
|
internal class TrialResponse
|
|
{
|
|
[JsonPropertyName("success")]
|
|
public bool Success { get; set; }
|
|
|
|
[JsonPropertyName("licenseKey")]
|
|
public string? LicenseKey { get; set; }
|
|
|
|
[JsonPropertyName("trialEndsAt")]
|
|
public DateTime? TrialEndsAt { get; set; }
|
|
|
|
[JsonPropertyName("error")]
|
|
public ApiError? Error { get; set; }
|
|
}
|