-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add new Report Archives API endpoints (#242)
- Loading branch information
1 parent
d7b75c4
commit acb303e
Showing
9 changed files
with
286 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/main/java/com/crowdin/client/reports/model/ExportReportRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.crowdin.client.reports.model; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class ExportReportRequest { | ||
private ReportsFormat format; | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/com/crowdin/client/reports/model/ReportArchive.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.crowdin.client.reports.model; | ||
|
||
import lombok.Data; | ||
|
||
import java.util.Date; | ||
|
||
@Data | ||
public class ReportArchive { | ||
private Long id; | ||
private String scopeType; | ||
private Long scopeId; | ||
private Long userId; | ||
private String name; | ||
private String webUrl; | ||
private Object scheme; | ||
private Date createdAt; | ||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/com/crowdin/client/reports/model/ReportArchiveList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.crowdin.client.reports.model; | ||
|
||
import com.crowdin.client.core.model.Pagination; | ||
import com.crowdin.client.core.model.ResponseList; | ||
import com.crowdin.client.core.model.ResponseObject; | ||
import lombok.Data; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
@Data | ||
public class ReportArchiveList { | ||
private List<ReportArchiveResponseObject> data; | ||
private Pagination pagination; | ||
|
||
public static ResponseList<ReportArchive> to(ReportArchiveList reportArchiveList) { | ||
return ResponseList.of( | ||
reportArchiveList.getData().stream() | ||
.map(ReportArchiveResponseObject::getData) | ||
.map(ResponseObject::of) | ||
.collect(Collectors.toList()), | ||
reportArchiveList.getPagination() | ||
); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/com/crowdin/client/reports/model/ReportArchiveResponseObject.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.crowdin.client.reports.model; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class ReportArchiveResponseObject { | ||
private ReportArchive data; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
src/test/resources/api/reports/exportReportArchiveReques.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"format": "xlsx" | ||
} |
Oops, something went wrong.