2019-01-24 08:43:03 +00:00
|
|
|
|
// 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.
|
2018-12-04 11:33:29 +00:00
|
|
|
|
|
2023-01-13 06:20:18 +00:00
|
|
|
|
using System;
|
2018-12-05 08:13:22 +00:00
|
|
|
|
using Newtonsoft.Json;
|
2018-12-04 11:33:29 +00:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Online.API
|
|
|
|
|
{
|
2020-01-16 03:51:43 +00:00
|
|
|
|
public class RegistrationRequest : OsuWebRequest
|
2018-12-04 11:33:29 +00:00
|
|
|
|
{
|
2023-01-13 06:20:18 +00:00
|
|
|
|
internal string Username = string.Empty;
|
|
|
|
|
internal string Email = string.Empty;
|
|
|
|
|
internal string Password = string.Empty;
|
2018-12-04 11:33:29 +00:00
|
|
|
|
|
|
|
|
|
protected override void PrePerform()
|
|
|
|
|
{
|
2018-12-05 08:13:22 +00:00
|
|
|
|
AddParameter("user[username]", Username);
|
|
|
|
|
AddParameter("user[user_email]", Email);
|
|
|
|
|
AddParameter("user[password]", Password);
|
2018-12-04 11:33:29 +00:00
|
|
|
|
|
|
|
|
|
base.PrePerform();
|
|
|
|
|
}
|
2018-12-05 08:13:22 +00:00
|
|
|
|
|
|
|
|
|
public class RegistrationRequestErrors
|
|
|
|
|
{
|
2023-01-13 06:32:53 +00:00
|
|
|
|
/// <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 06:20:18 +00:00
|
|
|
|
public UserErrors? User;
|
2018-12-05 08:13:22 +00:00
|
|
|
|
|
|
|
|
|
public class UserErrors
|
|
|
|
|
{
|
|
|
|
|
[JsonProperty("username")]
|
2023-01-13 06:20:18 +00:00
|
|
|
|
public string[] Username = Array.Empty<string>();
|
2018-12-05 08:13:22 +00:00
|
|
|
|
|
|
|
|
|
[JsonProperty("user_email")]
|
2023-01-13 06:20:18 +00:00
|
|
|
|
public string[] Email = Array.Empty<string>();
|
2018-12-05 08:13:22 +00:00
|
|
|
|
|
|
|
|
|
[JsonProperty("password")]
|
2023-01-13 06:20:18 +00:00
|
|
|
|
public string[] Password = Array.Empty<string>();
|
2018-12-05 08:13:22 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2018-12-04 11:33:29 +00:00
|
|
|
|
}
|
|
|
|
|
}
|