Search in sources :

Example 1 with ApiExternalUserMapping

use of com.sequenceiq.mock.swagger.model.ApiExternalUserMapping in project cloudbreak by hortonworks.

the class ExternalUserMappingsResourceOperation method updateExternalUserMapping.

public ResponseEntity<ApiExternalUserMapping> updateExternalUserMapping(String mockUuid, String uuid, @Valid ApiExternalUserMapping body) {
    ClouderaManagerDto dto = clouderaManagerStoreService.read(mockUuid);
    ApiExternalUserMapping user = getUser(dto, uuid);
    user.setAuthRoles(body.getAuthRoles());
    return responseCreatorComponent.exec(body);
}
Also used : ClouderaManagerDto(com.sequenceiq.mock.clouderamanager.ClouderaManagerDto) ApiExternalUserMapping(com.sequenceiq.mock.swagger.model.ApiExternalUserMapping)

Example 2 with ApiExternalUserMapping

use of com.sequenceiq.mock.swagger.model.ApiExternalUserMapping in project cloudbreak by hortonworks.

the class ExternalUserMappingsResourceOperation method createExternalUserMappings.

public ResponseEntity<ApiExternalUserMappingList> createExternalUserMappings(String mockUuid, @Valid ApiExternalUserMappingList body) {
    ClouderaManagerDto dto = clouderaManagerStoreService.read(mockUuid);
    List<ApiExternalUserMapping> items = body.getItems();
    items.forEach(u -> u.uuid(UUID.randomUUID().toString()));
    dto.getExternalUsers().addAll(items);
    return responseCreatorComponent.exec(body);
}
Also used : ClouderaManagerDto(com.sequenceiq.mock.clouderamanager.ClouderaManagerDto) ApiExternalUserMapping(com.sequenceiq.mock.swagger.model.ApiExternalUserMapping)

Aggregations

ClouderaManagerDto (com.sequenceiq.mock.clouderamanager.ClouderaManagerDto)2 ApiExternalUserMapping (com.sequenceiq.mock.swagger.model.ApiExternalUserMapping)2