forked from btcpayserver/btcpayserver
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
58 changed files
with
1,190 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System.Net.Http; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using BTCPayServer.Client.Models; | ||
|
||
namespace BTCPayServer.Client; | ||
|
||
public partial class BTCPayServerClient | ||
{ | ||
public virtual async Task<FileData[]> GetFiles(CancellationToken token = default) | ||
{ | ||
return await SendHttpRequest<FileData[]>("api/v1/files", null, HttpMethod.Get, token); | ||
} | ||
|
||
public virtual async Task<FileData> GetFile(string fileId, CancellationToken token = default) | ||
{ | ||
return await SendHttpRequest<FileData>($"api/v1/files/{fileId}", null, HttpMethod.Get, token); | ||
} | ||
|
||
public virtual async Task<FileData> UploadFile(string filePath, string mimeType, CancellationToken token = default) | ||
{ | ||
return await UploadFileRequest<FileData>("api/v1/files", filePath, mimeType, "file", HttpMethod.Post, token); | ||
} | ||
|
||
public virtual async Task DeleteFile(string fileId, CancellationToken token = default) | ||
{ | ||
await SendHttpRequest($"api/v1/files/{fileId}", null, HttpMethod.Delete, token); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using Newtonsoft.Json; | ||
|
||
namespace BTCPayServer.Client.Models; | ||
|
||
public class FileData | ||
{ | ||
public string Id { get; set; } | ||
public string UserId { get; set; } | ||
public string Uri { get; set; } | ||
public string Url { get; set; } | ||
public string OriginalName { get; set; } | ||
public string StorageName { get; set; } | ||
[JsonConverter(typeof(NBitcoin.JsonConverters.DateTimeToUnixTimeConverter))] | ||
public DateTimeOffset? CreatedAt { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.