package com.cameleer.server.core.http;

import java.time.Duration;
import java.util.List;

public record OutboundHttpProperties(
        boolean trustAll,
        List<String> trustedCaPemPaths,
        Duration defaultConnectTimeout,
        Duration defaultReadTimeout,
        String proxyUrl,
        String proxyUsername,
        String proxyPassword
) {
    public OutboundHttpProperties {
        trustedCaPemPaths = trustedCaPemPaths == null ? List.of() : List.copyOf(trustedCaPemPaths);
        if (defaultConnectTimeout == null) defaultConnectTimeout = Duration.ofMillis(2000);
        if (defaultReadTimeout == null)    defaultReadTimeout = Duration.ofMillis(5000);
    }
}
