use of com.sequenceiq.environment.parameter.dto.AzureParametersDto in project cloudbreak by hortonworks.
the class EnvironmentDetailsToCDPEnvironmentDetailsConverter method convertAzureDetails.
private UsageProto.CDPEnvironmentAzureDetails convertAzureDetails(ParametersDto parametersDto) {
UsageProto.CDPEnvironmentAzureDetails.Builder builder = UsageProto.CDPEnvironmentAzureDetails.newBuilder();
if (parametersDto != null) {
AzureParametersDto azureParametersDto = parametersDto.getAzureParametersDto();
if (azureParametersDto != null) {
builder.setSingleResourceGroup(azureParametersDto.getAzureResourceGroupDto().getResourceGroupUsagePattern().isSingleResourceGroup());
Optional<String> encryptionKeyUrl = Optional.of(azureParametersDto).map(AzureParametersDto::getAzureResourceEncryptionParametersDto).map(AzureResourceEncryptionParametersDto::getEncryptionKeyUrl);
builder.setResourceEncryptionEnabled(encryptionKeyUrl.isPresent());
}
}
return builder.build();
}
Aggregations