|
6 | 6 | import com.crowdin.client.core.http.exceptions.HttpException; |
7 | 7 | import com.crowdin.client.core.model.ClientConfig; |
8 | 8 | import com.crowdin.client.core.model.Credentials; |
| 9 | +import com.crowdin.client.core.model.OrderByField; |
9 | 10 | import com.crowdin.client.core.model.ResponseList; |
10 | 11 | import com.crowdin.client.core.model.ResponseObject; |
| 12 | +import com.crowdin.client.sourcestrings.model.SourceString; |
| 13 | +import com.crowdin.client.sourcestrings.model.SourceStringResponseList; |
11 | 14 | import com.crowdin.client.workflows.model.WorkflowStep; |
12 | 15 | import com.crowdin.client.workflows.model.WorkflowStepResponseList; |
13 | 16 | import com.crowdin.client.workflows.model.WorkflowStepResponseObject; |
14 | 17 | import com.crowdin.client.workflows.model.WorkflowTemplate; |
15 | 18 | import com.crowdin.client.workflows.model.WorkflowTemplateResponseList; |
16 | 19 | import com.crowdin.client.workflows.model.WorkflowTemplateResponseObject; |
17 | 20 |
|
| 21 | +import java.util.List; |
18 | 22 | import java.util.Map; |
19 | 23 | import java.util.Optional; |
20 | 24 |
|
@@ -52,6 +56,31 @@ public ResponseObject<WorkflowStep> getWorkflowStep(Long projectId, Long stepId) |
52 | 56 | return ResponseObject.of(workflowStepResponseObject.getData()); |
53 | 57 | } |
54 | 58 |
|
| 59 | + /** |
| 60 | + * @param projectId project identifier |
| 61 | + * @param stepId workflow step identifier |
| 62 | + * @param languageIds filter progress by language identifiers |
| 63 | + * @param orderBy ["id", "text", "identifier", "context", "createdAt", "updatedAt"]. List of OrderByField (default "id asc") |
| 64 | + * @param status ["todo", "done", "pending", "incomplete", "need_review"]. String status on the workflow step |
| 65 | + * @param limit maximum number of items to retrieve (default 25) |
| 66 | + * @param offset starting offset in the collection (default 0) |
| 67 | + * @return list of project strings |
| 68 | + * @see <ul> |
| 69 | + * <li><a href="https://support.crowdin.com/developer/enterprise/api/v2/#tag/Workflows/operation/api.projects.workflow-steps.strings.getMany" target="_blank"><b>Enterprise API Documentation</b></a></li> |
| 70 | + * </ul> |
| 71 | + */ |
| 72 | + public ResponseList<SourceString> listWorkflowStepStrings(Long projectId, Long stepId, String languageIds, List<OrderByField> orderBy, String status, Integer limit, Integer offset) throws HttpException, HttpBadRequestException { |
| 73 | + Map<String, Optional<Object>> queryParams = HttpRequestConfig.buildUrlParams( |
| 74 | + "languageIds", Optional.ofNullable(languageIds), |
| 75 | + "orderBy", Optional.ofNullable(OrderByField.generateSortParam(orderBy)), |
| 76 | + "status", Optional.ofNullable(status), |
| 77 | + "limit", Optional.ofNullable(limit), |
| 78 | + "offset", Optional.ofNullable(offset) |
| 79 | + ); |
| 80 | + SourceStringResponseList workflowStepStringsList = this.httpClient.get(this.url + "/projects/" + projectId + "/workflow-steps/" + stepId + "/strings", new HttpRequestConfig(queryParams), SourceStringResponseList.class); |
| 81 | + return SourceStringResponseList.to(workflowStepStringsList); |
| 82 | + } |
| 83 | + |
55 | 84 | /** |
56 | 85 | * @param groupId group identifier |
57 | 86 | * @param limit maximum number of items to retrieve (default 25) |
|
0 commit comments