Initial commit
This commit is contained in:
31
Radium.DataExporter.Models/Accounts/Account.cs
Normal file
31
Radium.DataExporter.Models/Accounts/Account.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using Radium.DataExporter.Models.Accounts.Enums;
|
||||
using Radium.DataExporter.Models.Common.Enums;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Radium.DataExporter.Models.Accounts;
|
||||
|
||||
public class Account
|
||||
{
|
||||
[JsonPropertyName(name: "accountId")] public long AccountId { get; set; }
|
||||
|
||||
[JsonPropertyName(name: "username")] public string Username { get; set; } = string.Empty;
|
||||
[JsonPropertyName(name: "displayName")] public string DisplayName { get; set; } = string.Empty;
|
||||
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
[JsonPropertyName(name: "displayEmoji")] public string? DisplayEmoji { get; set; }
|
||||
|
||||
[JsonPropertyName(name: "profileImage")] public string ProfileImage { get; set; } = "DefaultProfileImage";
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
[JsonPropertyName(name: "bannerImage")] public string? BannerImage { get; set; }
|
||||
|
||||
[JsonPropertyName(name: "isJunior")] public bool? IsJunior { get; set; }
|
||||
|
||||
[JsonPropertyName(name: "platforms")] public PlatformMask Platforms { get; set; }
|
||||
|
||||
[JsonPropertyName(name: "personalPronouns")] public PersonalPronouns PersonalPronouns { get; set; }
|
||||
[JsonPropertyName(name: "identityFlags")] public IdentityFlags IdentityFlags { get; set; }
|
||||
|
||||
[JsonPropertyName(name: "createdAt")] public DateTime CreatedAt { get; set; }
|
||||
|
||||
[JsonPropertyName(name: "isMetaPlatformBlocked")] public bool IsMetaPlatformBlocked { get; set; }
|
||||
}
|
||||
17
Radium.DataExporter.Models/Accounts/Enums/IdentityFlags.cs
Normal file
17
Radium.DataExporter.Models/Accounts/Enums/IdentityFlags.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
namespace Radium.DataExporter.Models.Accounts.Enums;
|
||||
|
||||
[Flags]
|
||||
public enum IdentityFlags
|
||||
{
|
||||
None = 0,
|
||||
LGBTQIA = 1,
|
||||
Transgender = 2,
|
||||
Bisexual = 4,
|
||||
Lesbian = 8,
|
||||
Pansexual = 16,
|
||||
Asexual = 32,
|
||||
Intersex = 64,
|
||||
Genderqueer = 128,
|
||||
Nonbinary = 256,
|
||||
Aromantic = 512
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace Radium.DataExporter.Models.Accounts.Enums;
|
||||
|
||||
[Flags]
|
||||
public enum PersonalPronouns
|
||||
{
|
||||
None = 0,
|
||||
SheHer = 1,
|
||||
HeHim = 2,
|
||||
TheyThem = 4,
|
||||
ZeHir = 8,
|
||||
ZeZir = 16,
|
||||
XeXem = 32
|
||||
}
|
||||
16
Radium.DataExporter.Models/Authentication/CachedLogin.cs
Normal file
16
Radium.DataExporter.Models/Authentication/CachedLogin.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using Radium.DataExporter.Models.Common.Enums;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Radium.DataExporter.Models.Authentication;
|
||||
|
||||
public class CachedLogin
|
||||
{
|
||||
[JsonPropertyName(name: "platform")] public PlatformType Platform { get; set; }
|
||||
[JsonPropertyName(name: "platformId")] public string PlatformId { get; set; } = string.Empty;
|
||||
[JsonPropertyName(name: "accountId")] public long AccountId { get; set; }
|
||||
[JsonPropertyName(name: "lastLoginTime")] public DateTime LastLoginTime { get; set; } = DateTime.UtcNow;
|
||||
|
||||
[JsonPropertyName(name: "requirePassword")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public bool RequirePassword { get; set; } = false;
|
||||
}
|
||||
18
Radium.DataExporter.Models/Common/Enums/PlatformMask.cs
Normal file
18
Radium.DataExporter.Models/Common/Enums/PlatformMask.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
namespace Radium.DataExporter.Models.Common.Enums;
|
||||
|
||||
[Flags]
|
||||
public enum PlatformMask
|
||||
{
|
||||
None,
|
||||
Steam,
|
||||
Oculus,
|
||||
PlayStation = 4,
|
||||
Xbox = 8,
|
||||
RecNet = 16,
|
||||
IOS = 32,
|
||||
GooglePlay = 64,
|
||||
Standalone = 128,
|
||||
Pico = 256,
|
||||
Switch = 512,
|
||||
All = -1
|
||||
}
|
||||
16
Radium.DataExporter.Models/Common/Enums/PlatformType.cs
Normal file
16
Radium.DataExporter.Models/Common/Enums/PlatformType.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace Radium.DataExporter.Models.Common.Enums;
|
||||
|
||||
public enum PlatformType
|
||||
{
|
||||
All = -1,
|
||||
Steam,
|
||||
Oculus,
|
||||
PlayStation,
|
||||
Xbox,
|
||||
RecNet,
|
||||
IOS,
|
||||
GooglePlay,
|
||||
Standalone,
|
||||
Pico,
|
||||
Switch
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Radium.DataExporter.Models.Common.Requests;
|
||||
|
||||
public class CompleteAuthLinkRequest
|
||||
{
|
||||
public required string Code { get; set; }
|
||||
public required long AccountId { get; set; }
|
||||
public required string SteamId { get; set; }
|
||||
public required string SteamTicket { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Radium.DataExporter.Models.Common.Results;
|
||||
|
||||
public class CompleteAuthLinkResult
|
||||
{
|
||||
[JsonPropertyName(name: "jobId")] public Guid JobId { get; set; }
|
||||
[JsonPropertyName(name: "recNetUserId")] public long RecNetUserId { get; set; }
|
||||
[JsonPropertyName(name: "resumedExistingJob")] public bool ResumedExistingJob { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Radium.DataExporter.Models.Common.Results;
|
||||
|
||||
public class CreateJobSessionResponse
|
||||
{
|
||||
public CompleteAuthLinkResult? Result { get; init; }
|
||||
public RecNetError? Error { get; init; }
|
||||
|
||||
public bool IsSuccess => Result != null;
|
||||
}
|
||||
22
Radium.DataExporter.Models/Common/Results/RecNetError.cs
Normal file
22
Radium.DataExporter.Models/Common/Results/RecNetError.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.Net;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Radium.DataExporter.Models.Common.Results;
|
||||
|
||||
public class RecNetError
|
||||
{
|
||||
[JsonPropertyName("type")]
|
||||
public Uri? Type { get; init; }
|
||||
|
||||
[JsonPropertyName("title")]
|
||||
public string Title { get; init; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("status")]
|
||||
public HttpStatusCode Status { get; init; }
|
||||
|
||||
[JsonPropertyName("detail")]
|
||||
public string Detail { get; init; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("traceId")]
|
||||
public string TraceId { get; init; } = string.Empty;
|
||||
}
|
||||
18
Radium.DataExporter.Models/JsonContext/RecNetJsonContext.cs
Normal file
18
Radium.DataExporter.Models/JsonContext/RecNetJsonContext.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Radium.DataExporter.Models.Accounts;
|
||||
using Radium.DataExporter.Models.Authentication;
|
||||
using Radium.DataExporter.Models.Common.Requests;
|
||||
using Radium.DataExporter.Models.Common.Results;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Radium.DataExporter.Models.JsonContext;
|
||||
|
||||
[JsonSerializable(typeof(CompleteAuthLinkRequest))]
|
||||
[JsonSerializable(typeof(CompleteAuthLinkResult))]
|
||||
[JsonSerializable(typeof(List<CachedLogin>))]
|
||||
[JsonSerializable(typeof(CachedLogin))]
|
||||
[JsonSerializable(typeof(List<Account>))]
|
||||
[JsonSerializable(typeof(Account))]
|
||||
[JsonSerializable(typeof(RecNetError))]
|
||||
public partial class RecNetJsonContext : JsonSerializerContext
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user