Skip to content

Commit

Permalink
fix: 'unassignLabelFromStrings' - 'stringIds' parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-bodnar committed Jul 26, 2023
1 parent e6d9014 commit 8c2e9ee
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/java/com/crowdin/client/labels/LabelsApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,20 @@ public ResponseList<SourceString> assignLabelToStrings(Long projectId, Long labe
/**
* @param projectId Project Identifier
* @param labelId Label Identifier
* @param stringIds List of string IDs
* @return Source string
* @see <ul>
* <li><a href="https://developer.crowdin.com/api/v2/#operation/api.projects.labels.strings.deleteMany" target="_blank"><b>API Documentation</b></a></li>
* <li><a href="https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.labels.strings.deleteMany" target="_blank"><b>Enterprise API Documentation</b></a></li>
* </ul>
*/
public ResponseList<SourceString> unassignLabelFromStrings(Long projectId, Long labelId) throws HttpException, HttpBadRequestException {
public ResponseList<SourceString> unassignLabelFromStrings(Long projectId, Long labelId, List<Long> stringIds) throws HttpException, HttpBadRequestException {
String builtUrl = String.format("%s/projects/%d/labels/%d/strings", this.url, projectId, labelId);
SourceStringResponseList response = this.httpClient.delete(builtUrl, new HttpRequestConfig(), SourceStringResponseList.class);
Map<String, Optional<Object>> queryParams = HttpRequestConfig.buildUrlParams(
"stringIds", Optional.ofNullable(stringIds == null ? null : stringIds.stream().map(String::valueOf).collect(Collectors.joining(","))
));

SourceStringResponseList response = this.httpClient.delete(builtUrl, new HttpRequestConfig(queryParams), SourceStringResponseList.class);
return SourceStringResponseList.to(response);
}

Expand Down

0 comments on commit 8c2e9ee

Please sign in to comment.