Skip to content

Commit

Permalink
Added isSystem for String based List labels
Browse files Browse the repository at this point in the history
  • Loading branch information
Zahid92 committed Feb 28, 2024
1 parent 965ba7d commit 99ecc3c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/Crowdin.Api/Labels/Label.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@


using JetBrains.Annotations;
using Newtonsoft.Json;

Expand All @@ -12,5 +12,8 @@ public class Label

[JsonProperty("title")]
public string Title { get; set; }

[JsonProperty("isSystem")]
public bool IsSystem { get; set; }
}
}
6 changes: 4 additions & 2 deletions src/Crowdin.Api/Labels/LabelsApiExecutor.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@


using System.Collections.Generic;
using System.Net;
using System.Threading.Tasks;
Expand Down Expand Up @@ -30,13 +30,15 @@ public LabelsApiExecutor(ICrowdinApiClient apiClient, IJsonParser jsonParser)
/// <summary>
/// List labels. Documentation:
/// <a href="https://support.crowdin.com/api/v2/#operation/api.projects.labels.getMany">Crowdin API</a>
/// <a href="https://developer.crowdin.com/api/v2/string-based/#operation/api.projects.labels.getMany">Crowdin String Based API</a>
/// <a href="https://support.crowdin.com/enterprise/api/#operation/api.projects.labels.getMany">Crowdin Enterprise API</a>
/// </summary>
[PublicAPI]
public async Task<ResponseList<Label>> ListLabels(int projectId, int limit = 25, int offset = 0)
public async Task<ResponseList<Label>> ListLabels(int projectId, int limit = 25, int offset = 0, bool isSystem = false)
{
string url = FormUrl_Labels(projectId);
IDictionary<string, string> queryParams = Utils.CreateQueryParamsFromPaging(limit, offset);
queryParams["isSystem"]= isSystem ? "true" : "false";

CrowdinApiResult result = await _apiClient.SendGetRequest(url, queryParams);
return _jsonParser.ParseResponseList<Label>(result.JsonObject);
Expand Down

0 comments on commit 99ecc3c

Please sign in to comment.