-
Notifications
You must be signed in to change notification settings - Fork 72
feat: add support for Application Consents API #396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
andrii-bodnar
merged 2 commits into
crowdin:master
from
Anikesh348:feature/application-consents-api
Sep 4, 2026
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
13 changes: 13 additions & 0 deletions
13
...ain/java/com/crowdin/client/applications/consents/model/AddApplicationConsentRequest.java
This file contains hidden or 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,13 @@ | ||
| package com.crowdin.client.applications.consents.model; | ||
|
|
||
| import lombok.Data; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| @Data | ||
| public class AddApplicationConsentRequest { | ||
| private String identifier; | ||
| private Long installedBy; | ||
| private ConsentStatus status; | ||
| private List<String> scopes; | ||
| } |
26 changes: 26 additions & 0 deletions
26
src/main/java/com/crowdin/client/applications/consents/model/ApplicationConsent.java
This file contains hidden or 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,26 @@ | ||
| package com.crowdin.client.applications.consents.model; | ||
|
|
||
| import lombok.Data; | ||
|
|
||
| import java.util.Date; | ||
|
|
||
| @Data | ||
| public class ApplicationConsent { | ||
|
|
||
| private Long id; | ||
| private User installedBy; | ||
| private String identifier; | ||
| private String name; | ||
| private ConsentStatus status; | ||
| private String[] scopes; | ||
| private Date createdAt; | ||
| private Date updatedAt; | ||
|
|
||
| @Data | ||
| public static class User { | ||
| private Long id; | ||
| private String username; | ||
| private String fullName; | ||
| private String avatarUrl; | ||
| } | ||
| } |
26 changes: 26 additions & 0 deletions
26
...n/java/com/crowdin/client/applications/consents/model/ApplicationConsentResponseList.java
This file contains hidden or 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,26 @@ | ||
| package com.crowdin.client.applications.consents.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 ApplicationConsentResponseList { | ||
|
|
||
| private List<ApplicationConsentResponseObject> data; | ||
| private Pagination pagination; | ||
|
|
||
| public static ResponseList<ApplicationConsent> to(ApplicationConsentResponseList applicationConsentResponseList) { | ||
| return ResponseList.of( | ||
| applicationConsentResponseList.getData().stream() | ||
| .map(ApplicationConsentResponseObject::getData) | ||
| .map(ResponseObject::of) | ||
| .collect(Collectors.toList()), | ||
| applicationConsentResponseList.getPagination() | ||
| ); | ||
| } | ||
| } |
9 changes: 9 additions & 0 deletions
9
...java/com/crowdin/client/applications/consents/model/ApplicationConsentResponseObject.java
This file contains hidden or 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,9 @@ | ||
| package com.crowdin.client.applications.consents.model; | ||
|
|
||
| import lombok.Data; | ||
|
|
||
| @Data | ||
| public class ApplicationConsentResponseObject { | ||
|
|
||
| private ApplicationConsent data; | ||
| } |
16 changes: 16 additions & 0 deletions
16
src/main/java/com/crowdin/client/applications/consents/model/ConsentStatus.java
This file contains hidden or 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,16 @@ | ||
| package com.crowdin.client.applications.consents.model; | ||
|
|
||
| import com.crowdin.client.core.model.EnumConverter; | ||
|
|
||
| public enum ConsentStatus implements EnumConverter<ConsentStatus> { | ||
| GRANTED, DENIED; | ||
|
|
||
| public static ConsentStatus from(String value) { | ||
| return ConsentStatus.valueOf(value.toUpperCase()); | ||
| } | ||
|
|
||
| @Override | ||
| public String to(ConsentStatus v) { | ||
| return v.name().toLowerCase(); | ||
| } | ||
| } |
15 changes: 15 additions & 0 deletions
15
...in/java/com/crowdin/client/applications/consents/model/ListApplicationConsentsParams.java
This file contains hidden or 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,15 @@ | ||
| package com.crowdin.client.applications.consents.model; | ||
|
|
||
| import com.crowdin.client.core.model.OrderByField; | ||
| import com.crowdin.client.core.model.Pagination; | ||
| import lombok.Data; | ||
| import lombok.EqualsAndHashCode; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| @Data | ||
| @EqualsAndHashCode(callSuper = true) | ||
| public class ListApplicationConsentsParams extends Pagination { | ||
| private String identifier; | ||
| private List<OrderByField> orderBy; | ||
| } |
This file contains hidden or 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
9 changes: 9 additions & 0 deletions
9
src/test/resources/api/applications/addApplicationConsentRequest.json
This file contains hidden or 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,9 @@ | ||
| { | ||
| "identifier": "example-application", | ||
| "installedBy": 12, | ||
| "status": "granted", | ||
| "scopes": [ | ||
| "project", | ||
| "tm" | ||
| ] | ||
| } |
20 changes: 20 additions & 0 deletions
20
src/test/resources/api/applications/applicationConsent.json
This file contains hidden or 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,20 @@ | ||
| { | ||
| "data": { | ||
| "id": 12, | ||
| "installedBy": { | ||
| "id": 12, | ||
| "username": "john_smith", | ||
| "fullName": "John Smith", | ||
| "avatarUrl": "" | ||
| }, | ||
| "identifier": "example-application", | ||
| "name": "My App", | ||
| "status": "granted", | ||
| "scopes": [ | ||
| "project", | ||
| "tm" | ||
| ], | ||
| "createdAt": "2026-07-24T10:00:00+00:00", | ||
| "updatedAt": "2026-07-24T10:00:00+00:00" | ||
| } | ||
| } |
7 changes: 7 additions & 0 deletions
7
src/test/resources/api/applications/editApplicationConsentRequest.json
This file contains hidden or 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,7 @@ | ||
| [ | ||
| { | ||
| "op": "replace", | ||
| "path": "/status", | ||
| "value": "denied" | ||
| } | ||
| ] |
28 changes: 28 additions & 0 deletions
28
src/test/resources/api/applications/listApplicationConsentsResponse.json
This file contains hidden or 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,28 @@ | ||
| { | ||
| "data": [ | ||
| { | ||
| "data": { | ||
| "id": 12, | ||
| "installedBy": { | ||
| "id": 12, | ||
| "username": "john_smith", | ||
| "fullName": "John Smith", | ||
| "avatarUrl": "" | ||
| }, | ||
| "identifier": "example-application", | ||
| "name": "My App", | ||
| "status": "granted", | ||
| "scopes": [ | ||
| "project", | ||
| "tm" | ||
| ], | ||
| "createdAt": "2026-07-24T10:00:00+00:00", | ||
| "updatedAt": "2026-07-24T10:00:00+00:00" | ||
| } | ||
| } | ||
| ], | ||
| "pagination": { | ||
| "offset": 0, | ||
| "limit": 25 | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.