class ClusterToClusterV4RequestConverter extends AbstractConversionServiceAwareConverter<Cluster, ClusterV4Request> {

    @Override
    public ClusterV4Request convert(Cluster source) {
        ClusterV4Request clusterRequest = new ClusterV4Request();
        convertClusterManager(source, clusterRequest);
        clusterRequest.setBlueprintName(source.getBlueprint().getName());
        clusterRequest.setValidateBlueprint(null);
        clusterRequest.setExecutorType(source.getExecutorType());
        clusterRequest.setUserName("");
        clusterRequest.setPassword("");
        if (source.getFileSystem() != null) {
            clusterRequest.setCloudStorage(cloudStorageConverter.fileSystemToRequest(source.getFileSystem()));
        }
        clusterRequest.setName(source.getName());
        if (source.getRdsConfigs() != null && !source.getRdsConfigs().isEmpty()) {
            Set<String> databaseNames = source.getRdsConfigs().stream()
                    .filter(rdsConfig -> rdsConfig.getStatus() == ResourceStatus.USER_MANAGED)
                    .map(RDSConfig::getName)
                    .collect(Collectors.toSet());
            clusterRequest.setDatabases(Collections.unmodifiableSet(databaseNames));
        }

        if (StringUtils.isNotEmpty(source.getProxyConfigCrn())) {
            clusterRequest.setProxyConfigCrn(source.getProxyConfigCrn());
        }

        if (source.getGateway() != null) {
            clusterRequest.setGateway(getConversionService().convert(source.getGateway(), GatewayV4Request.class));
        }
        clusterRequest.setRangerRazEnabled(source.isRangerRazEnabled());
        return clusterRequest;
    }

}