-
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.
Showing
16 changed files
with
421 additions
and
1 deletion.
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
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,19 @@ | ||
package com.crowdin.client.ai.model; | ||
|
||
import lombok.Data; | ||
|
||
import java.util.Date; | ||
|
||
@Data | ||
public class AiProvider { | ||
private Date createdAt; | ||
private Integer promptsCount; | ||
private Credentials credentials; | ||
private Boolean isEnabled; | ||
private String name; | ||
private Integer id; | ||
private String type; | ||
private Config config; | ||
private Boolean useSystemCredentials; | ||
private Date updatedAt; | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/com/crowdin/client/ai/model/AiProviderModel.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.ai.model; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class AiProviderModel { | ||
private String id; | ||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/com/crowdin/client/ai/model/AiProviderModelResponseList.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.ai.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 AiProviderModelResponseList { | ||
private List<AiProviderModelResponseObject> data; | ||
private Pagination pagination; | ||
|
||
public static ResponseList<AiProviderModel> to(AiProviderModelResponseList responseList) { | ||
return ResponseList.of( | ||
responseList.data.stream() | ||
.map(AiProviderModelResponseObject::getData) | ||
.map(ResponseObject::of) | ||
.collect(Collectors.toList()), | ||
responseList.getPagination() | ||
); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/com/crowdin/client/ai/model/AiProviderModelResponseObject.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.ai.model; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class AiProviderModelResponseObject { | ||
private AiProviderModel data; | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/com/crowdin/client/ai/model/AiProviderRequest.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,14 @@ | ||
package com.crowdin.client.ai.model; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class AiProviderRequest { | ||
|
||
private String name; | ||
private String type; | ||
private Credentials credentials; | ||
private Config config; | ||
private Boolean isEnabled; | ||
private Boolean useSystemCredentials; | ||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/com/crowdin/client/ai/model/AiProviderResponseList.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.ai.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 AiProviderResponseList { | ||
private List<AiProviderResponseObject> data; | ||
private Pagination pagination; | ||
|
||
public static ResponseList<AiProvider> to(AiProviderResponseList responseList) { | ||
return ResponseList.of( | ||
responseList.data.stream() | ||
.map(AiProviderResponseObject::getData) | ||
.map(ResponseObject::of) | ||
.collect(Collectors.toList()), | ||
responseList.pagination | ||
); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/com/crowdin/client/ai/model/AiProviderResponseObject.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.ai.model; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class AiProviderResponseObject { | ||
private AiProvider 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.crowdin.client.ai.model; | ||
|
||
import lombok.Data; | ||
|
||
import java.util.List; | ||
|
||
@Data | ||
public class Config { | ||
private List<ActionRulesItem> actionRules; | ||
|
||
@Data | ||
public static class ActionRulesItem { | ||
private List<String> availableAiModelIds; | ||
private String action; | ||
} | ||
} |
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.ai.model; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class Credentials { | ||
private String apiKey; | ||
} |
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
Oops, something went wrong.