using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using Crowdin.Plugin.Server_API.Helpers; using Crowdin.Plugin.Server_API.Models.Labels; namespace Crowdin.Plugin.Server_API.Services { public class LabelsApiService : BaseApiService { private static string BaseUri => SettingsHelper.GetUri("labels", SettingsHelper.GetProjectId()); private readonly CrowdinHttpClient _httpClient = CrowdinHttpClient.Default; public Task AddLabel(string title, CancellationToken ct) { return _httpClient.PostAsync(BaseUri, new { title }, ct); } public Task> ListLabels(CancellationToken ct) { return _httpClient.ListAllAsync(BaseUri, limit: 500, ct); } } }