// // This code was generated by Refitter. // using Refit; using System.Collections.Generic; using System.IO; using System.Text.Json.Serialization; 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); /// 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); /// 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); /// 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); /// 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(); /// 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); /// 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); /// 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); /// 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(); /// 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); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Get("/")] Task Index(); /// 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); /// OK /// Thrown when the request returns a non-success status code. [Headers("Accept: text/plain, application/json, text/json")] [Get("/api/repo/{userName}/{repositoryName}/get_info")] Task GetInfo(string repositoryName, string userName); /// 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); /// 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); /// OK /// Thrown when the request returns a non-success status code. [Headers("Accept: text/plain, application/json, text/json")] [Get("/api/repo/{userName}/{repositoryName}/get_users")] Task GetUsers(string repositoryName, string userName); /// 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); /// 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); /// OK /// Thrown when the request returns a non-success status code. [Headers("Accept: text/plain, application/json, text/json")] [Post("/api/repo/{userName}/{repositoryName}/fetch_manifest")] Task FetchManifest(string userName, string repositoryName, [Query] string commitId); /// OK /// Thrown when the request returns a non-success status code. [Headers("Accept: text/plain, application/json, text/json")] [Post("/api/repo/{userName}/{repositoryName}/fetch_depot")] Task> FetchDepot(string userName, string repositoryName, [Query] string depotId); /// OK /// Thrown when the request returns a non-success status code. [Headers("Accept: text/plain, application/json, text/json")] [Post("/api/repo/{userName}/{repositoryName}/list_commit")] Task ListCommit(string userName, string repositoryName); /// OK /// Thrown when the request returns a non-success status code. [Headers("Accept: text/plain, application/json, text/json")] [Post("/api/repo/{userName}/{repositoryName}/list_locked_files")] Task ListLockedFiles(string userName, string repositoryName); /// OK /// Thrown when the request returns a non-success status code. [Headers("Accept: text/plain, application/json, text/json")] [Get("/api/repo/{userName}/{repositoryName}/peek_commit")] Task PeekCommit(string userName, string repositoryName); /// 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); /// 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); /// OK /// Thrown when the request returns a non-success status code. [Multipart] [Headers("Accept: text/plain, application/json, text/json")] [Post("/api/repo/{userName}/{repositoryName}/create_commit")] Task CreateCommit(string userName, string repositoryName, StreamPart depot, string message, IEnumerable workspaceSnapshot, IEnumerable requiredDepots, string mainDepotId); /// OK /// Thrown when the request returns a non-success status code. [Headers("Accept: text/plain, application/json, text/json")] [Get("/api/repo_list")] Task RepoList(); /// OK /// Thrown when the request returns a non-success status code. [Headers("Accept: text/plain, application/json, text/json")] [Post("/api/repo_create")] Task RepoCreate([Query] string repositoryName, [Query] string description); /// 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); /// 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); /// 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); /// 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); /// 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); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Get("/api/user/delete")] Task Delete(); } } //---------------------- // // 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 CommitManifest { [JsonPropertyName("manifestId")] public System.Guid ManifestId { get; set; } [JsonPropertyName("depot")] public ICollection Depot { get; set; } [JsonPropertyName("filePaths")] public ICollection FilePaths { 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 CommitSuccessResponse { [JsonPropertyName("committedOn")] public System.DateTimeOffset CommittedOn { get; set; } [JsonPropertyName("commitId")] public System.Guid CommitId { get; set; } [JsonPropertyName("mainDepotId")] public System.Guid MainDepotId { 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 DepotLabel { [JsonPropertyName("id")] public System.Guid Id { get; set; } [JsonPropertyName("length")] public long 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 GuidPeekResponse { [JsonPropertyName("result")] public System.Guid Result { 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 LockFileInfo { [JsonPropertyName("path")] public string Path { get; set; } [JsonPropertyName("owner")] public string Owner { 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 LockFileInfoListingResponse { [JsonPropertyName("result")] public ICollection Result { 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 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 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 partial class RepoUserRoleListingResponse { [JsonPropertyName("result")] public ICollection Result { 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 RepositoryCommitResponse { [JsonPropertyName("id")] public System.Guid Id { get; set; } [JsonPropertyName("author")] public string Author { get; set; } [JsonPropertyName("commitedOn")] public System.DateTimeOffset CommitedOn { get; set; } [JsonPropertyName("message")] public string Message { get; set; } [JsonPropertyName("mainDepotId")] public System.Guid MainDepotId { 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 RepositoryCommitResponseListingResponse { [JsonPropertyName("result")] public ICollection Result { 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 RepositoryInfoResponse { [JsonPropertyName("repositoryName")] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public string RepositoryName { get; set; } [JsonPropertyName("ownerUsername")] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public string OwnerUsername { get; set; } [JsonPropertyName("description")] public string Description { get; set; } [JsonPropertyName("isArchived")] public bool IsArchived { 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 partial class RepositoryInfoResponseListingResponse { [JsonPropertyName("result")] public ICollection Result { 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("friendlyName")] public string FriendlyName { get; set; } [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 UserInfoResponseListingResponse { [JsonPropertyName("result")] public ICollection Result { 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 { [JsonPropertyName("modifyTime")] public System.DateTimeOffset ModifyTime { get; set; } [JsonPropertyName("workPath")] public string WorkPath { get; set; } } [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; } } [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class FileResponse : System.IDisposable { private System.IDisposable _client; private System.IDisposable _response; public int StatusCode { get; private set; } public IReadOnlyDictionary> Headers { get; private set; } public System.IO.Stream Stream { get; private set; } public bool IsPartial { get { return StatusCode == 206; } } public FileResponse(int statusCode, IReadOnlyDictionary> headers, System.IO.Stream stream, System.IDisposable client, System.IDisposable response) { StatusCode = statusCode; Headers = headers; Stream = stream; _client = client; _response = response; } public void Dispose() { Stream.Dispose(); if (_response != null) _response.Dispose(); if (_client != null) _client.Dispose(); } } } #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