Search in sources :

Example 1 with ProjectInvitationResponse

use of com.cloud.api.response.ProjectInvitationResponse in project CloudStack-archive by CloudStack-extras.

the class ListProjectInvitationsCmd method execute.

// ///////////////////////////////////////////////////
// ///////////// API Implementation///////////////////
// ///////////////////////////////////////////////////
@Override
public void execute() {
    List<? extends ProjectInvitation> invites = _projectService.listProjectInvitations(id, projectId, this.getAccountName(), this.getDomainId(), state, activeOnly, this.getStartIndex(), this.getPageSizeVal(), this.isRecursive(), this.listAll());
    ListResponse<ProjectInvitationResponse> response = new ListResponse<ProjectInvitationResponse>();
    List<ProjectInvitationResponse> projectInvitationResponses = new ArrayList<ProjectInvitationResponse>();
    for (ProjectInvitation invite : invites) {
        ProjectInvitationResponse projectResponse = _responseGenerator.createProjectInvitationResponse(invite);
        projectInvitationResponses.add(projectResponse);
    }
    response.setResponses(projectInvitationResponses);
    response.setResponseName(getCommandName());
    this.setResponseObject(response);
}
Also used : ProjectInvitationResponse(com.cloud.api.response.ProjectInvitationResponse) ListResponse(com.cloud.api.response.ListResponse) ArrayList(java.util.ArrayList) ProjectInvitation(com.cloud.projects.ProjectInvitation)

Example 2 with ProjectInvitationResponse

use of com.cloud.api.response.ProjectInvitationResponse in project cosmic by MissionCriticalCloud.

the class ProjectInvitationJoinDaoImpl method newProjectInvitationResponse.

@Override
public ProjectInvitationResponse newProjectInvitationResponse(final ProjectInvitationJoinVO invite) {
    final ProjectInvitationResponse response = new ProjectInvitationResponse();
    response.setId(invite.getUuid());
    response.setProjectId(invite.getProjectUuid());
    response.setProjectName(invite.getProjectName());
    if (invite.getState() != null) {
        response.setInvitationState(invite.getState().toString());
    }
    if (invite.getAccountName() != null) {
        response.setAccountName(invite.getAccountName());
    } else {
        response.setEmail(invite.getEmail());
    }
    response.setDomainId(invite.getDomainUuid());
    response.setDomainName(invite.getDomainName());
    response.setObjectName("projectinvitation");
    return response;
}
Also used : ProjectInvitationResponse(com.cloud.api.response.ProjectInvitationResponse)

Aggregations

ProjectInvitationResponse (com.cloud.api.response.ProjectInvitationResponse)2 ListResponse (com.cloud.api.response.ListResponse)1 ProjectInvitation (com.cloud.projects.ProjectInvitation)1 ArrayList (java.util.ArrayList)1