Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
Update org mgt version

Update the models
  • Loading branch information
Kanapriya committed Dec 14, 2023
1 parent feae30d commit 46e2c5a
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
public class UserInvitationMgtConstants {

public static final String ERROR_PREFIX = "OUI-";
public static final String ERROR_FAIL_STATUS = "Fail";
public static final String ERROR_FAIL_STATUS = "Failed";

/**
* Enum for shared user invitation management related errors.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ public class InvitationRequestBody {


/**
* List of username of the user's who will be invited to the organization. This can be an email or an alphanumeric username.
* List of usernames of the users who will be invited to the organization. This can be an email or an alphanumeric username.
**/
public InvitationRequestBody usernames(List<String> usernames) {

this.usernames = usernames;
return this;
}

@ApiModelProperty(required = true, value = "List of username of the user's who will be invited to the organization. This can be an email or an alphanumeric username.")
@ApiModelProperty(required = true, value = "List of usernames of the users who will be invited to the organization. This can be an email or an alphanumeric username.")
@JsonProperty("usernames")
@Valid
@NotNull(message = "Property usernames cannot be null.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public InvitationSuccessResponseResult status(String status) {
return this;
}

@ApiModelProperty(example = "Success/Fail", value = "")
@ApiModelProperty(example = "Successful/Failed", value = "")
@JsonProperty("status")
@Valid
public String getStatus() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,21 @@
import org.wso2.carbon.identity.api.server.organization.user.invitation.management.v1.model.RoleAssignmentResponse;
import org.wso2.carbon.identity.organization.user.invitation.management.InvitationCoreServiceImpl;
import org.wso2.carbon.identity.organization.user.invitation.management.exception.UserInvitationMgtException;
import org.wso2.carbon.identity.organization.user.invitation.management.models.CreatedInvitation;
import org.wso2.carbon.identity.organization.user.invitation.management.models.Invitation;
import org.wso2.carbon.identity.organization.user.invitation.management.models.InvitationDO;
import org.wso2.carbon.identity.organization.user.invitation.management.models.InvitationResult;
import org.wso2.carbon.identity.organization.user.invitation.management.models.RoleAssignments;

import java.util.ArrayList;
import java.util.List;
import javax.ws.rs.core.Response;

import static org.wso2.carbon.identity.organization.user.invitation.management.constant.UserInvitationMgtConstants.ErrorMessage.ERROR_CODE_MULTIPLE_INVITATIONS_FOR_USER;
import static org.wso2.carbon.identity.organization.user.invitation.management.constant.UserInvitationMgtConstants.ErrorMessage.ERROR_CODE_INVALID_CONFIRMATION_CODE;
import static org.wso2.carbon.identity.organization.user.invitation.management.constant.UserInvitationMgtConstants.ErrorMessage.ERROR_CODE_INVALID_FILTER;
import static org.wso2.carbon.identity.organization.user.invitation.management.constant.UserInvitationMgtConstants.ErrorMessage.ERROR_CODE_INVALID_INVITATION_ID;
import static org.wso2.carbon.identity.organization.user.invitation.management.constant.UserInvitationMgtConstants.ErrorMessage.ERROR_CODE_INVALID_ROLE;
import static org.wso2.carbon.identity.organization.user.invitation.management.constant.UserInvitationMgtConstants.ErrorMessage.ERROR_CODE_INVALID_USER;
import static org.wso2.carbon.identity.organization.user.invitation.management.constant.UserInvitationMgtConstants.ErrorMessage.ERROR_CODE_MULTIPLE_INVITATIONS_FOR_USER;
import static org.wso2.carbon.identity.organization.user.invitation.management.constant.UserInvitationMgtConstants.ErrorMessage.ERROR_CODE_STORE_ROLES_APP_ID_INVALID;
import static org.wso2.carbon.identity.organization.user.invitation.management.constant.UserInvitationMgtConstants.ErrorMessage.ERROR_CODE_UNSUPPORTED_FILTER_ATTRIBUTE;
import static org.wso2.carbon.identity.organization.user.invitation.management.constant.UserInvitationMgtConstants.ErrorMessage.ERROR_CODE_UNSUPPORTED_FILTER_ATTRIBUTE_VALUE;
Expand Down Expand Up @@ -102,7 +102,7 @@ public List<InvitationSuccessResponse> createInvitation(InvitationRequestBody in
}
invitation.setRoleAssignments(roleAssignments.toArray(new RoleAssignments[0]));
}
List<CreatedInvitation> invitationResponse;
List<InvitationResult> invitationResponse;
try {
invitationResponse = invitationCoreService.createInvitations(invitation);
} catch (UserInvitationMgtException e) {
Expand Down Expand Up @@ -247,19 +247,19 @@ private String includeData(UserInvitationMgtConstants.ErrorMessage error, String
return error.getDescription();
}

private List<InvitationSuccessResponse> createInvitationSuccessResponse(List<CreatedInvitation> invitationList) {
private List<InvitationSuccessResponse> createInvitationSuccessResponse(List<InvitationResult> invitationList) {

List<InvitationSuccessResponse> invitationSuccessResponseList = new ArrayList<>();
for (CreatedInvitation invitation : invitationList) {
for (InvitationResult invitation : invitationList) {
InvitationSuccessResponse invitationSuccessResponse = new InvitationSuccessResponse();
InvitationSuccessResponseResult invitationSuccessResponseResult = new InvitationSuccessResponseResult();
if (UserInvitationMgtConstants.ERROR_FAIL_STATUS.equals(invitation.getResult().getStatus())) {
invitationSuccessResponseResult.setErrorCode(invitation.getResult().getErrorMsg().getCode());
invitationSuccessResponseResult.setErrorMessage(invitation.getResult().getErrorMsg().getMessage());
invitationSuccessResponseResult.setErrorDescription(invitation.getResult().getErrorMsg()
if (UserInvitationMgtConstants.ERROR_FAIL_STATUS.equals(invitation.getStatus())) {
invitationSuccessResponseResult.setErrorCode(invitation.getErrorMsg().getCode());
invitationSuccessResponseResult.setErrorMessage(invitation.getErrorMsg().getMessage());
invitationSuccessResponseResult.setErrorDescription(invitation.getErrorMsg()
.getDescription());
}
invitationSuccessResponseResult.setStatus(invitation.getResult().getStatus());
invitationSuccessResponseResult.setStatus(invitation.getStatus());
invitationSuccessResponse.setUsername(invitation.getUsername());
invitationSuccessResponse.setResult(invitationSuccessResponseResult);
invitationSuccessResponseList.add(invitationSuccessResponse);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ components:
properties:
usernames:
type: array
description: List of username of the user's who will be invited to the organization. This can be an email or an alphanumeric username.
description: List of usernames of the users who will be invited to the organization. This can be an email or an alphanumeric username.
items:
type: string
example: [email protected], [email protected]
Expand Down Expand Up @@ -335,7 +335,7 @@ components:
properties:
status:
type: string
example: Success/Fail
example: Successful/Failed
errorCode:
type: string
example: OUI-00000
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@
</org.wso2.carbon.identity.organization.management.core.version.range>

<!-- Organization management service Version -->
<org.wso2.carbon.identity.organization.management.version>1.3.131
<org.wso2.carbon.identity.organization.management.version>1.3.136
</org.wso2.carbon.identity.organization.management.version>

<!-- Unit test versions -->
Expand Down

0 comments on commit 46e2c5a

Please sign in to comment.