using System; using System.Collections.Generic; 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> GetStores(CancellationToken token = default) { return await SendHttpRequest>("api/v1/stores", null, HttpMethod.Get, token); } public virtual async Task GetStore(string storeId, CancellationToken token = default) { return await SendHttpRequest($"api/v1/stores/{storeId}", null, HttpMethod.Get, token); } public virtual async Task RemoveStore(string storeId, CancellationToken token = default) { await SendHttpRequest($"api/v1/stores/{storeId}", null, HttpMethod.Delete, token); } public virtual async Task CreateStore(CreateStoreRequest request, CancellationToken token = default) { if (request == null) throw new ArgumentNullException(nameof(request)); return await SendHttpRequest("api/v1/stores", request, HttpMethod.Post, token); } public virtual async Task UpdateStore(string storeId, UpdateStoreRequest request, CancellationToken token = default) { if (request == null) throw new ArgumentNullException(nameof(request)); if (storeId == null) throw new ArgumentNullException(nameof(storeId)); return await SendHttpRequest($"api/v1/stores/{storeId}", request, HttpMethod.Put, token); } public virtual async Task UploadStoreLogo(string storeId, string filePath, string mimeType, CancellationToken token = default) { return await UploadFileRequest($"api/v1/stores/{storeId}/logo", filePath, mimeType, "file", HttpMethod.Post, token); } public virtual async Task DeleteStoreLogo(string storeId, CancellationToken token = default) { await SendHttpRequest($"api/v1/stores/{storeId}/logo", null, HttpMethod.Delete, token); } }