use of org.apache.cloudstack.api.response.RoleResponse in project cloudstack by apache.
the class ListRolesCmd method setupResponse.
private void setupResponse(final List<Role> roles) {
final ListResponse<RoleResponse> response = new ListResponse<>();
final List<RoleResponse> roleResponses = new ArrayList<>();
for (final Role role : roles) {
if (role == null) {
continue;
}
final RoleResponse roleResponse = new RoleResponse();
roleResponse.setId(role.getUuid());
roleResponse.setRoleName(role.getName());
roleResponse.setRoleType(role.getRoleType());
roleResponse.setDescription(role.getDescription());
roleResponse.setObjectName("role");
roleResponses.add(roleResponse);
}
response.setResponses(roleResponses);
response.setResponseName(getCommandName());
setResponseObject(response);
}
use of org.apache.cloudstack.api.response.RoleResponse in project cloudstack by apache.
the class CreateRoleCmd method setupResponse.
private void setupResponse(final Role role) {
final RoleResponse response = new RoleResponse();
response.setId(role.getUuid());
response.setRoleName(role.getName());
response.setRoleType(role.getRoleType());
response.setResponseName(getCommandName());
response.setObjectName("role");
setResponseObject(response);
}
Aggregations