-
Notifications
You must be signed in to change notification settings - Fork 57
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
feat: Added AI related API support #249
Conversation
* <li><a href="https://developer.crowdin.com/api/v2/#operation/api.ai.prompts.getMany" target="_blank"><b>API Documentation</b></a></li> | ||
* </ul> | ||
*/ | ||
public ResponseList<AiPrompt> listAiPrompts (Long userId, Long projectId, String action, Long limit, Integer offset) throws HttpException, HttpBadRequestException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public ResponseList<AiPrompt> listAiPrompts (Long userId, Long projectId, String action, Long limit, Integer offset) throws HttpException, HttpBadRequestException { | |
public ResponseList<AiPrompt> listAiPrompts(Long userId, Long projectId, String action, Long limit, Integer offset) throws HttpException, HttpBadRequestException { |
Usually we don't put a space after the method name. Please fix this here and in other methods
"limit", Optional.ofNullable(limit), | ||
"offset", Optional.ofNullable(offset) | ||
); | ||
AiPromptResponseList aiPromptResponseList = this.httpClient.get(this.url + "/users/" + userId + "/ai/prompts", new HttpRequestConfig(queryParams), AiPromptResponseList.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Crowdin Enterprise version of these API endpoints has a different request URL (without the userId subpath)
https://developer.crowdin.com/enterprise/api/v2/#operation/api.ai.prompts.getMany
A similar situation existed in PR #242. Please consider the same approach in the current implementation.
AiPromptResponseObject response = this.httpClient.get(this.url + "/users/" + userId + "/ai/prompts/" + aiPromptId, new HttpRequestConfig(), AiPromptResponseObject.class); | ||
return ResponseObject.of(response.getData()); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param request request object | ||
* @return newly created Ai prompt | ||
* @see <ul> | ||
* <li><a href="https://developer.crowdin.com/api/v2/#operation/api.users.ai.prompts.post" target="_blank"><b>API Documentation</b></a></li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing Crowdin Enterprise links
@@ -0,0 +1,24 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Format this JSON
} | ||
|
||
@Test | ||
public void listAiPromptTest(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public void listAiPromptTest(){ | |
public void listAiPromptTest() { |
Hi @Durdush, could you please take a look at the discussions? Thanks! |
No description provided.