241 lines
8.9 KiB
C#
241 lines
8.9 KiB
C#
|
|
//----------------------
|
|
// <auto-generated>
|
|
// Generated REST API Client Code Generator v1.7.17.0 on 6/26/2023 11:20:46 AM
|
|
// Using the tool Refitter v0.6.0
|
|
// </auto-generated>
|
|
//----------------------
|
|
|
|
|
|
// <auto-generated>
|
|
// This code was generated by Refitter.
|
|
// </auto-generated>
|
|
|
|
using Refit;
|
|
using System.Collections.Generic;
|
|
using System.Text.Json.Serialization;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace FrontendAvalonia.Services.GamenightApi
|
|
{
|
|
public interface IGamenight
|
|
{
|
|
/// <summary>
|
|
/// Submit your credentials to get a JWT-token to use with the rest of the api.
|
|
/// </summary>
|
|
[Post("/token")]
|
|
Task<IApiResponse<Token>> GetToken([Body] object body, CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>
|
|
/// Create a new user given a registration token and user information, username and email must be unique, and password and password_repeat must match.
|
|
/// </summary>
|
|
[Post("/user")]
|
|
Task PostRegister([Body] object body, CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>
|
|
/// Retrieve the list of gamenights on this gamenight server. Requires authorization.
|
|
/// </summary>
|
|
[Get("/gamenights")]
|
|
Task<IApiResponse<ICollection<Gamenight>>> GetGamenights(CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>
|
|
/// Add a gamenight by providing a name and a date, only available when providing an JWT token.
|
|
/// </summary>
|
|
[Post("/gamenight")]
|
|
Task PostGamenight([Body] object body, [Authorize("Bearer")] string token, CancellationToken cancellationToken = default);
|
|
|
|
[Get("/gamenight")]
|
|
Task<IApiResponse<Gamenight>> GetGamenight([Body] object body, CancellationToken cancellationToken = default);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
//----------------------
|
|
// <auto-generated>
|
|
// Generated using the NSwag toolchain v13.19.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.3.0)) (http://NSwag.org)
|
|
// </auto-generated>
|
|
//----------------------
|
|
|
|
#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended."
|
|
#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword."
|
|
#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?'
|
|
#pragma warning disable 612 // Disable "CS0612 '...' is obsolete"
|
|
#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ...
|
|
#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..."
|
|
#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'"
|
|
#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant"
|
|
#pragma warning disable 8603 // Disable "CS8603 Possible null reference return"
|
|
|
|
namespace FrontendAvalonia.Services.GamenightApi
|
|
{
|
|
using System = global::System;
|
|
|
|
|
|
|
|
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.19.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.3.0))")]
|
|
public partial class Gamenight
|
|
{
|
|
|
|
[JsonPropertyName("id")]
|
|
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
|
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)]
|
|
public string Id { get; set; }
|
|
|
|
[JsonPropertyName("name")]
|
|
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
|
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)]
|
|
public string Name { get; set; }
|
|
|
|
[JsonPropertyName("datetime")]
|
|
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
|
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)]
|
|
public string Datetime { get; set; }
|
|
|
|
[JsonPropertyName("owner_id")]
|
|
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
|
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)]
|
|
public string Owner_id { get; set; }
|
|
|
|
private IDictionary<string, object> _additionalProperties;
|
|
|
|
[JsonExtensionData]
|
|
public IDictionary<string, object> AdditionalProperties
|
|
{
|
|
get { return _additionalProperties ?? (_additionalProperties = new Dictionary<string, object>()); }
|
|
set { _additionalProperties = value; }
|
|
}
|
|
|
|
}
|
|
|
|
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.19.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.3.0))")]
|
|
public partial class Failure
|
|
{
|
|
|
|
[JsonPropertyName("message")]
|
|
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
|
public string Message { get; set; }
|
|
|
|
private IDictionary<string, object> _additionalProperties;
|
|
|
|
[JsonExtensionData]
|
|
public IDictionary<string, object> AdditionalProperties
|
|
{
|
|
get { return _additionalProperties ?? (_additionalProperties = new Dictionary<string, object>()); }
|
|
set { _additionalProperties = value; }
|
|
}
|
|
|
|
}
|
|
|
|
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.19.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.3.0))")]
|
|
public partial class Token
|
|
{
|
|
|
|
[JsonPropertyName("jwt_token")]
|
|
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
|
public string Jwt_token { get; set; }
|
|
|
|
private IDictionary<string, object> _additionalProperties;
|
|
|
|
[JsonExtensionData]
|
|
public IDictionary<string, object> AdditionalProperties
|
|
{
|
|
get { return _additionalProperties ?? (_additionalProperties = new Dictionary<string, object>()); }
|
|
set { _additionalProperties = value; }
|
|
}
|
|
|
|
}
|
|
|
|
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.19.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.3.0))")]
|
|
public partial class Login
|
|
{
|
|
|
|
[JsonPropertyName("username")]
|
|
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
|
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)]
|
|
public string Username { get; set; }
|
|
|
|
[JsonPropertyName("password")]
|
|
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
|
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)]
|
|
public string Password { get; set; }
|
|
|
|
private IDictionary<string, object> _additionalProperties;
|
|
|
|
[JsonExtensionData]
|
|
public IDictionary<string, object> AdditionalProperties
|
|
{
|
|
get { return _additionalProperties ?? (_additionalProperties = new Dictionary<string, object>()); }
|
|
set { _additionalProperties = value; }
|
|
}
|
|
|
|
}
|
|
|
|
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.19.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.3.0))")]
|
|
public partial class Registration
|
|
{
|
|
|
|
[JsonPropertyName("username")]
|
|
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
|
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)]
|
|
public string Username { get; set; }
|
|
|
|
[JsonPropertyName("email")]
|
|
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
|
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)]
|
|
public string Email { get; set; }
|
|
|
|
[JsonPropertyName("password")]
|
|
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
|
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)]
|
|
public string Password { get; set; }
|
|
|
|
[JsonPropertyName("password_repeat")]
|
|
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
|
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)]
|
|
public string Password_repeat { get; set; }
|
|
|
|
[JsonPropertyName("registration_token")]
|
|
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
|
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)]
|
|
public string Registration_token { get; set; }
|
|
|
|
private IDictionary<string, object> _additionalProperties;
|
|
|
|
[JsonExtensionData]
|
|
public IDictionary<string, object> AdditionalProperties
|
|
{
|
|
get { return _additionalProperties ?? (_additionalProperties = new Dictionary<string, object>()); }
|
|
set { _additionalProperties = value; }
|
|
}
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
#pragma warning restore 108
|
|
#pragma warning restore 114
|
|
#pragma warning restore 472
|
|
#pragma warning restore 612
|
|
#pragma warning restore 1573
|
|
#pragma warning restore 1591
|
|
#pragma warning restore 8073
|
|
#pragma warning restore 3016
|
|
#pragma warning restore 8603
|