200 lines
8.7 KiB
C#
200 lines
8.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; }
|
|
}
|
|
|
|
public sealed class Balances
|
|
{
|
|
[JsonProperty("gold")] public int Gold { get; set; }
|
|
[JsonProperty("dust")] public int Dust { get; set; }
|
|
[JsonProperty("tokens")] public int Tokens { get; set; }
|
|
}
|
|
|
|
public sealed class OnboardingResponse
|
|
{
|
|
[JsonProperty("balances")] public Balances Balances { get; set; } = new Balances();
|
|
[JsonProperty("deckId")] public string DeckId { get; set; } = string.Empty;
|
|
}
|
|
|
|
public sealed class OnboardingRequest
|
|
{
|
|
[JsonProperty("deckId")] public string DeckId { get; set; } = string.Empty;
|
|
}
|
|
|
|
public sealed class StoreResponse
|
|
{
|
|
[JsonProperty("balances")] public Balances Balances { get; set; } = new Balances();
|
|
[JsonProperty("boosterPriceGold")] public int BoosterPriceGold { get; set; }
|
|
[JsonProperty("trialDecks")] public List<StoreTrialDeckDto> TrialDecks { get; set; } = new List<StoreTrialDeckDto>();
|
|
}
|
|
|
|
public sealed class StoreTrialDeckDto
|
|
{
|
|
[JsonProperty("id")] public string Id { get; set; } = string.Empty;
|
|
[JsonProperty("name")] public string Name { get; set; } = string.Empty;
|
|
[JsonProperty("clan")] public string Clan { get; set; }
|
|
[JsonProperty("cardCount")] public int CardCount { get; set; }
|
|
[JsonProperty("owned")] public bool Owned { get; set; }
|
|
[JsonProperty("priceGold")] public int PriceGold { get; set; }
|
|
[JsonProperty("cards")] public List<TrialDeckCardDto> Cards { get; set; } = new List<TrialDeckCardDto>();
|
|
}
|
|
|
|
public sealed class TrialDeckCardDto
|
|
{
|
|
[JsonProperty("printingId")] public string PrintingId { get; set; } = string.Empty;
|
|
[JsonProperty("count")] public int Count { get; set; }
|
|
}
|
|
|
|
public sealed class CollectionResponse
|
|
{
|
|
[JsonProperty("items")] public List<CollectionItemDto> Items { get; set; } = new List<CollectionItemDto>();
|
|
[JsonProperty("balances")] public Balances Balances { get; set; } = new Balances();
|
|
}
|
|
|
|
public sealed class CollectionItemDto
|
|
{
|
|
[JsonProperty("printingId")] public string PrintingId { get; set; } = string.Empty;
|
|
[JsonProperty("nameId")] public string NameId { get; set; } = string.Empty;
|
|
[JsonProperty("nameEn")] public string NameEn { get; set; } = string.Empty;
|
|
[JsonProperty("rarity")] public string Rarity { get; set; } = string.Empty;
|
|
[JsonProperty("count")] public int Count { get; set; }
|
|
}
|
|
|
|
public sealed class DismantleRequest
|
|
{
|
|
[JsonProperty("printingId")] public string PrintingId { get; set; } = string.Empty;
|
|
[JsonProperty("count")] public int Count { get; set; }
|
|
[JsonProperty("idempotencyKey")] public string IdempotencyKey { get; set; } = string.Empty;
|
|
}
|
|
|
|
public sealed class DeckDto
|
|
{
|
|
[JsonProperty("id")] public Guid Id { get; set; }
|
|
[JsonProperty("name")] public string Name { get; set; } = string.Empty;
|
|
[JsonProperty("format")] public string Format { get; set; } = string.Empty;
|
|
[JsonProperty("cards")] public List<string> Cards { get; set; } = new List<string>();
|
|
[JsonProperty("createdAt")] public DateTimeOffset CreatedAt { get; set; }
|
|
[JsonProperty("updatedAt")] public DateTimeOffset UpdatedAt { get; set; }
|
|
[JsonProperty("shareCode")] public string ShareCode { get; set; }
|
|
}
|
|
|
|
public sealed class DeckRequest
|
|
{
|
|
[JsonProperty("name")] public string Name { get; set; } = string.Empty;
|
|
[JsonProperty("cards")] public List<string> Cards { get; set; } = new List<string>();
|
|
}
|
|
|
|
public sealed class DeckValidationResponse
|
|
{
|
|
[JsonProperty("valid")] public bool Valid { get; set; }
|
|
[JsonProperty("violations")] public List<DeckViolationDto> Violations { get; set; } = new List<DeckViolationDto>();
|
|
}
|
|
|
|
public sealed class DeckViolationDto
|
|
{
|
|
[JsonProperty("code")] public string Code { get; set; } = string.Empty;
|
|
[JsonProperty("message")] public string Message { get; set; } = string.Empty;
|
|
}
|
|
}
|