1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-26 08:23:21 +08:00
osu-lazer/osu.Game/Online/API/RegistrationRequest.cs

52 lines
1.5 KiB
C#
Raw Normal View History

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
2023-01-13 14:20:18 +08:00
using System;
using Newtonsoft.Json;
namespace osu.Game.Online.API
{
2020-01-16 11:51:43 +08:00
public class RegistrationRequest : OsuWebRequest
{
2023-01-13 14:20:18 +08:00
internal string Username = string.Empty;
internal string Email = string.Empty;
internal string Password = string.Empty;
protected override void PrePerform()
{
AddParameter("user[username]", Username);
AddParameter("user[user_email]", Email);
AddParameter("user[password]", Password);
base.PrePerform();
}
public class RegistrationRequestErrors
{
/// <summary>
/// An optional error message.
/// </summary>
public string? Message;
/// <summary>
/// An optional URL which the user should be directed towards to complete registration.
/// </summary>
public string? Redirect;
2023-01-13 14:20:18 +08:00
public UserErrors? User;
public class UserErrors
{
[JsonProperty("username")]
2023-01-13 14:20:18 +08:00
public string[] Username = Array.Empty<string>();
[JsonProperty("user_email")]
2023-01-13 14:20:18 +08:00
public string[] Email = Array.Empty<string>();
[JsonProperty("password")]
2023-01-13 14:20:18 +08:00
public string[] Password = Array.Empty<string>();
}
}
}
}