-
Notifications
You must be signed in to change notification settings - Fork 146
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
Add api support to try out branding AI feature #668
base: master
Are you sure you want to change the base?
Conversation
c040afc
to
6864024
Compare
"Error while updating custom text preference configurations for organization: %s."), | ||
ERROR_CODE_ERROR_GETTING_BRANDING_RESULT_STATUS("65009", | ||
"Error while getting branding preference generation result status.", | ||
"Error while retrieving branding preference generation result status for operation."), |
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.
Can't we add any information specific to the action in the error description?
if (taskOperationService != null) { | ||
this.brandingAiPreferenceManager = taskOperationService; | ||
} else { | ||
throw new Exception("Unable to retrieve ConfigurationManager service."); |
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.
throw new Exception("Unable to retrieve ConfigurationManager service."); | |
throw new Exception("Unable to retrieve BrandingAIPreferenceManager service."); |
*/ | ||
public class BrandingAIPreferenceManagementService { | ||
|
||
private static final Log log = LogFactory.getLog(BrandingAIPreferenceManagementService.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.
private static final Log log = LogFactory.getLog(BrandingAIPreferenceManagementService.class); | |
private static final Log LOG = LogFactory.getLog(BrandingAIPreferenceManagementService.class); |
BrandingGenerationRequestModel brandingGenerationRequestModel) { | ||
|
||
try { | ||
String operationId = BrandingPreferenceServiceHolder.getBrandingPreferenceAiManager() |
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.
can BrandingPreferenceServiceHolder.getBrandingPreferenceAiManager()
return null?
public BrandingGenerationStatusModel getBrandingPreferenceGenerationStatus(String operationId) { | ||
|
||
try { | ||
Object generationStatus = BrandingPreferenceServiceHolder.getBrandingPreferenceAiManager() |
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.
can BrandingPreferenceServiceHolder.getBrandingPreferenceAiManager()
be null?
operationId: getBrandingGenerationStatus | ||
summary: Get the status of a branding generation operation. | ||
description: | | ||
This API endpoint return the status of the AI branding generation process that initiated using the `/generate` endpoint.<br/> |
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.
This API endpoint return the status of the AI branding generation process that initiated using the `/generate` endpoint.<br/> | |
This API endpoint returns the status of the AI branding generation process that is initiated using the `/generate` endpoint.<br/> |
|
||
|
||
|
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.
Unnecessary new lines
|
||
if (object instanceof Map) { | ||
Map<String, Object> map = new HashMap<>(); | ||
for (Map.Entry<String, Object> entry : ((Map<String, Object>) object).entrySet()) { |
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.
Can we guarantee that the entry is always <String, Object>
return new HashMap<>(); | ||
} | ||
|
||
private static Object[] convertListToArray(List<?> list) { |
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.
can we optimize this method?
Purpose
$subject
Related Issue(s)
Related PR(s)
*** Note: Should merge after merging wso2-extensions/identity-branding-preference-management#46