107 lines
4.7 KiB
C#
107 lines
4.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace Vanguard.Api.Contracts
|
|
{
|
|
public sealed class LoginRequest
|
|
{
|
|
[JsonProperty("userName")] public string UserName { get; set; } = string.Empty;
|
|
[JsonProperty("password")] public string Password { get; set; } = string.Empty;
|
|
}
|
|
|
|
public sealed class RegisterRequest
|
|
{
|
|
[JsonProperty("userName")] public string UserName { get; set; } = string.Empty;
|
|
[JsonProperty("password")] public string Password { get; set; } = string.Empty;
|
|
}
|
|
|
|
public sealed class RefreshRequest
|
|
{
|
|
[JsonProperty("refreshToken")] public string RefreshToken { get; set; } = string.Empty;
|
|
}
|
|
|
|
public sealed class AuthResponse
|
|
{
|
|
[JsonProperty("userId")] public Guid UserId { get; set; }
|
|
[JsonProperty("userName")] public string UserName { get; set; } = string.Empty;
|
|
[JsonProperty("accessToken")] public string AccessToken { get; set; } = string.Empty;
|
|
[JsonProperty("refreshToken")] public string RefreshToken { get; set; } = string.Empty;
|
|
[JsonProperty("accessExpiresAt")] public DateTimeOffset AccessExpiresAt { get; set; }
|
|
[JsonProperty("refreshExpiresAt")] public DateTimeOffset RefreshExpiresAt { get; set; }
|
|
[JsonProperty("onboardingCompleted")] public bool OnboardingCompleted { get; set; }
|
|
}
|
|
|
|
public sealed class MeResponse
|
|
{
|
|
[JsonProperty("userId")] public Guid UserId { get; set; }
|
|
[JsonProperty("userName")] public string UserName { get; set; } = string.Empty;
|
|
[JsonProperty("createdAt")] public DateTimeOffset CreatedAt { get; set; }
|
|
[JsonProperty("onboardingCompleted")] public bool OnboardingCompleted { get; set; }
|
|
[JsonProperty("selectedTrialDeckId")] public string SelectedTrialDeckId { get; set; }
|
|
[JsonProperty("gold")] public int Gold { get; set; }
|
|
[JsonProperty("dust")] public int Dust { get; set; }
|
|
[JsonProperty("tokens")] public int Tokens { get; set; }
|
|
[JsonProperty("xp")] public int Xp { get; set; }
|
|
[JsonProperty("rankedMmr")] public int RankedMmr { get; set; }
|
|
[JsonProperty("casualMmr")] public int CasualMmr { get; set; }
|
|
[JsonProperty("matches")] public int Matches { get; set; }
|
|
[JsonProperty("wins")] public int Wins { get; set; }
|
|
}
|
|
|
|
public sealed class ApiErrorDto
|
|
{
|
|
[JsonProperty("error")] public string Error { get; set; } = string.Empty;
|
|
[JsonProperty("message")] public string Message { get; set; } = string.Empty;
|
|
[JsonProperty("violations")] public List<ApiViolationDto> Violations { get; set; }
|
|
}
|
|
|
|
public sealed class ApiViolationDto
|
|
{
|
|
[JsonProperty("code")] public string Code { get; set; } = string.Empty;
|
|
[JsonProperty("message")] public string Message { get; set; } = string.Empty;
|
|
}
|
|
|
|
public sealed class QueueRequest
|
|
{
|
|
[JsonProperty("mode")] public string Mode { get; set; } = "classic-ranked";
|
|
[JsonProperty("deckId")] public Guid? DeckId { get; set; }
|
|
}
|
|
|
|
public sealed class QueueAccepted
|
|
{
|
|
[JsonProperty("queueId")] public Guid QueueId { get; set; }
|
|
[JsonProperty("status")] public string Status { get; set; } = string.Empty;
|
|
[JsonProperty("mode")] public string Mode { get; set; } = string.Empty;
|
|
}
|
|
|
|
public sealed class QueueStatusResponse
|
|
{
|
|
[JsonProperty("queueId")] public Guid QueueId { get; set; }
|
|
[JsonProperty("status")] public string Status { get; set; } = string.Empty;
|
|
[JsonProperty("mode")] public string Mode { get; set; } = string.Empty;
|
|
[JsonProperty("waitedSeconds")] public int WaitedSeconds { get; set; }
|
|
[JsonProperty("window")] public int Window { get; set; }
|
|
[JsonProperty("matchId")] public string MatchId { get; set; }
|
|
[JsonProperty("seat")] public int Seat { get; set; }
|
|
[JsonProperty("ticket")] public string Ticket { get; set; }
|
|
[JsonProperty("opponent")] public string Opponent { get; set; }
|
|
[JsonProperty("reason")] public string Reason { get; set; }
|
|
[JsonProperty("wsUrl")] public string WsUrl { get; set; }
|
|
}
|
|
|
|
public sealed class TicketRequest
|
|
{
|
|
[JsonProperty("matchId")] public string MatchId { get; set; } = string.Empty;
|
|
}
|
|
|
|
public sealed class TicketResponse
|
|
{
|
|
[JsonProperty("ticket")] public string Ticket { get; set; } = string.Empty;
|
|
[JsonProperty("matchId")] public string MatchId { get; set; } = string.Empty;
|
|
[JsonProperty("seat")] public int Seat { get; set; }
|
|
[JsonProperty("wsUrl")] public string WsUrl { get; set; } = string.Empty;
|
|
[JsonProperty("expiresAt")] public DateTimeOffset ExpiresAt { get; set; }
|
|
}
|
|
}
|