// // This code was generated by Refitter. // using Refit; using System.Collections.Generic; using System.Text.Json.Serialization; using System.Threading; using System.Threading.Tasks; #nullable enable annotations namespace Flawless.Client.Remote { [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.5.2.0")] public partial interface IFlawlessServer { /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Post("/api/admin/user/delete/{username}")] Task Delete(string username, CancellationToken cancellationToken = default); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Post("/api/admin/user/enable/{username}")] Task Enable(string username, CancellationToken cancellationToken = default); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Post("/api/admin/user/disable/{username}")] Task Disable(string username, CancellationToken cancellationToken = default); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Post("/api/admin/user/reset_password")] Task ResetPassword([Body] ResetPasswordRequest body, CancellationToken cancellationToken = default); /// OK /// Thrown when the request returns a non-success status code. [Headers("Accept: text/plain, application/json, text/json")] [Get("/api/auth/status")] Task Status(CancellationToken cancellationToken = default); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Post("/api/auth/register")] Task Register([Body] RegisterRequest body, CancellationToken cancellationToken = default); /// OK /// Thrown when the request returns a non-success status code. [Headers("Accept: text/plain, application/json, text/json")] [Post("/api/auth/login")] Task Login([Body] LoginRequest body, CancellationToken cancellationToken = default); /// OK /// Thrown when the request returns a non-success status code. [Headers("Accept: text/plain, application/json, text/json")] [Post("/api/auth/refresh")] Task Refresh([Body] TokenInfo body, CancellationToken cancellationToken = default); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Post("/api/auth/logout_all")] Task LogoutAll(CancellationToken cancellationToken = default); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Post("/api/auth/renew_password")] Task RenewPassword([Body] ResetPasswordRequest body, CancellationToken cancellationToken = default); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Get("/")] Task Index(CancellationToken cancellationToken = default); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Post("/api/repo/{userName}/{repositoryName}/delete_repo")] Task DeleteRepo(string repositoryName, string userName, CancellationToken cancellationToken = default); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Get("/api/repo/{userName}/{repositoryName}/get_info")] Task GetInfo(string repositoryName, string userName, CancellationToken cancellationToken = default); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Post("/api/repo/{userName}/{repositoryName}/archive_repo")] Task ArchiveRepo(string repositoryName, string userName, CancellationToken cancellationToken = default); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Post("/api/repo/{userName}/{repositoryName}/unarchive_repo")] Task UnarchiveRepo(string repositoryName, string userName, CancellationToken cancellationToken = default); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Get("/api/repo/{userName}/{repositoryName}/get_users")] Task GetUsers(string repositoryName, string userName, [Body] QueryPagesRequest body, CancellationToken cancellationToken = default); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Post("/api/repo/{userName}/{repositoryName}/update_user")] Task UpdateUser(string repositoryName, string userName, [Body] RepoUserRole body, CancellationToken cancellationToken = default); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Post("/api/repo/{userName}/{repositoryName}/delete_user")] Task DeleteUser(string repositoryName, string userName, [Body] RepoUserRole body, CancellationToken cancellationToken = default); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Get("/api/repo/{userName}/{repositoryName}/fetch_manifest")] Task FetchManifest(string userName, string repositoryName, [Query] string commitId, CancellationToken cancellationToken = default); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Get("/api/repo/{userName}/{repositoryName}/fetch_depot")] Task FetchDepot(string userName, string repositoryName, [Query] string depotId, CancellationToken cancellationToken = default); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Get("/api/repo/{userName}/{repositoryName}/list_commit")] Task ListCommit(string userName, string repositoryName, CancellationToken cancellationToken = default); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Get("/api/repo/{userName}/{repositoryName}/list_locked_files")] Task ListLockedFiles(string userName, string repositoryName, CancellationToken cancellationToken = default); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Get("/api/repo/{userName}/{repositoryName}/peek_commit")] Task PeekCommit(string userName, string repositoryName, CancellationToken cancellationToken = default); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Post("/api/repo/{userName}/{repositoryName}/lock_file")] Task LockFile(string userName, string repositoryName, [Query] string path, CancellationToken cancellationToken = default); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Post("/api/repo/{userName}/{repositoryName}/unlock_file")] Task UnlockFile(string userName, string repositoryName, [Query] string path, CancellationToken cancellationToken = default); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Multipart] [Post("/api/repo/{userName}/{repositoryName}/create_commit")] Task CreateCommit(string userName, string repositoryName, StreamPart depot, string message, IEnumerable workspaceSnapshot, IEnumerable requiredDepots, string mainDepotId, CancellationToken cancellationToken = default); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Get("/api/repo_list")] Task RepoList([Query, AliasAs("Offset")] int offset, [Query, AliasAs("Length")] int length, CancellationToken cancellationToken = default); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Post("/api/repo_create")] Task RepoCreate([Query] string repositoryName, CancellationToken cancellationToken = default); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Post("/api/user/update_info")] Task UpdateInfo([Body] UserInfoModifyResponse body, CancellationToken cancellationToken = default); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Post("/api/user/update_email")] Task UpdateEmail([Body] UserContactModifyResponse body, CancellationToken cancellationToken = default); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Post("/api/user/update_phone")] Task UpdatePhone([Body] UserContactModifyResponse body, CancellationToken cancellationToken = default); /// OK /// Thrown when the request returns a non-success status code. [Headers("Accept: text/plain, application/json, text/json")] [Get("/api/user/get_info")] Task GetInfo([Query] string username, CancellationToken cancellationToken = default); /// OK /// Thrown when the request returns a non-success status code. [Headers("Accept: text/plain, application/json, text/json")] [Get("/api/user/query_info")] Task QueryInfo([Query] string keyword, [Body] QueryPagesRequest body, CancellationToken cancellationToken = default); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Get("/api/user/delete")] Task Delete(CancellationToken cancellationToken = default); } } //---------------------- // // Generated using the NSwag toolchain v14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org) // //---------------------- #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 649 // Disable "CS0649 Field is never assigned to, and will always have its default value null" #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" #pragma warning disable 8604 // Disable "CS8604 Possible null reference argument for parameter" #pragma warning disable 8625 // Disable "CS8625 Cannot convert null literal to non-nullable reference type" #pragma warning disable 8765 // Disable "CS8765 Nullability of type of parameter doesn't match overridden member (possibly because of nullability attributes)." namespace Flawless.Client.Remote { using System = global::System; [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class LoginRequest { [JsonPropertyName("username")] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public string Username { get; set; } [JsonPropertyName("password")] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public string Password { get; set; } } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class QueryPagesRequest { [JsonPropertyName("offset")] public int Offset { get; set; } [JsonPropertyName("length")] public int Length { get; set; } } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class RegisterRequest { [JsonPropertyName("email")] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public string Email { get; set; } [JsonPropertyName("username")] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public string Username { get; set; } [JsonPropertyName("password")] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public string Password { get; set; } } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class RepoUserRole { [JsonPropertyName("username")] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public string Username { get; set; } [JsonPropertyName("role")] public RepositoryRole Role { get; set; } } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] public enum RepositoryRole { _0 = 0, _1 = 1, _2 = 2, _3 = 3, } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ResetPasswordRequest { [JsonPropertyName("identity")] public string Identity { get; set; } [JsonPropertyName("oldPassword")] public string OldPassword { get; set; } [JsonPropertyName("newPassword")] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public string NewPassword { get; set; } } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ServerStatusResponse { [JsonPropertyName("allowPublicRegister")] public bool AllowPublicRegister { get; set; } } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class TokenInfo { [JsonPropertyName("token")] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public string Token { get; set; } [JsonPropertyName("expiration")] public System.DateTimeOffset? Expiration { get; set; } } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class UserContactModifyResponse { [JsonPropertyName("email")] public string Email { get; set; } [JsonPropertyName("phone")] public string Phone { get; set; } } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class UserInfoModifyResponse { [JsonPropertyName("nickName")] public string NickName { get; set; } [JsonPropertyName("gender")] public UserSex Gender { get; set; } [JsonPropertyName("bio")] public string Bio { get; set; } [JsonPropertyName("publicEmail")] public bool? PublicEmail { get; set; } } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class UserInfoResponse { [JsonPropertyName("authorized")] public bool Authorized { get; set; } [JsonPropertyName("username")] public string Username { get; set; } [JsonPropertyName("nickName")] public string NickName { get; set; } [JsonPropertyName("gender")] public UserSex Gender { get; set; } [JsonPropertyName("bio")] public string Bio { get; set; } [JsonPropertyName("email")] public string Email { get; set; } [JsonPropertyName("phone")] public string Phone { get; set; } [JsonPropertyName("publicEmail")] public bool? PublicEmail { get; set; } [JsonPropertyName("createdAt")] public System.DateTimeOffset? CreatedAt { get; set; } } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class UserInfoResponsePagedResponse { [JsonPropertyName("offset")] public int Offset { get; set; } [JsonPropertyName("length")] public int Length { get; set; } [JsonPropertyName("total")] public int? Total { get; set; } [JsonPropertyName("data")] public ICollection Data { get; set; } } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] public enum UserSex { _0 = 0, _1 = 1, _2 = 2, _3 = 3, } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class WorkspaceFile { } [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class FileParameter { public FileParameter(System.IO.Stream data) : this (data, null, null) { } public FileParameter(System.IO.Stream data, string fileName) : this (data, fileName, null) { } public FileParameter(System.IO.Stream data, string fileName, string contentType) { Data = data; FileName = fileName; ContentType = contentType; } public System.IO.Stream Data { get; private set; } public string FileName { get; private set; } public string ContentType { get; private set; } } } #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 #pragma warning restore 8604 #pragma warning restore 8625