-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Files.cs
33 lines (28 loc) · 1.44 KB
/
Files.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using CurseForge.APIClient.Models;
using CurseForge.APIClient.Models.Files;
using CurseForge.APIClient.Models.Mods;
using System.Threading.Tasks;
namespace CurseForge.APIClient
{
public partial class ApiClient
{
public async Task<GenericResponse<File>> GetModFileAsync(int modId, int fileId) =>
await GetItem<File>($"/v1/mods/{modId}/files/{fileId}");
public async Task<GenericListResponse<File>> GetModFilesAsync(int modId, string gameVersion = null,
ModLoaderType? modLoaderType = null, string gameVersionFlavor = null,
int? index = null, int? pageSize = null) =>
await GetList<File>($"/v1/mods/{modId}/files",
("gameVersion", gameVersion),
("modLoaderType", modLoaderType),
("gameVersionFlavor", gameVersionFlavor),
("index", index),
("pageSize", pageSize)
);
public async Task<GenericListResponse<File>> GetFilesAsync(GetModFilesRequestBody body) =>
await PostList<File>("/v1/mods/files", body);
public async Task<GenericResponse<string>> GetModFileChangelogAsync(int modId, int fileId) =>
await GetItem<string>($"/v1/mods/{modId}/files/{fileId}/changelog");
public async Task<GenericResponse<string>> GetModFileDownloadUrlAsync(int modId, int fileId) =>
await GetItem<string>($"/v1/mods/{modId}/files/{fileId}/download-url");
}
}