"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "HttpClientFactory", {
    enumerable: true,
    get: function() {
        return HttpClientFactory;
    }
});
const _defaulthttpclientbuilder = require("../../shared/default-http-client.builder");
class HttpClientFactory {
    settingsStore;
    constructor(settingsStore){
        this.settingsStore = settingsStore;
    }
    createClient(base, buildFluentOptions) {
        base.withMaxBodyLength(1000 * 1000 * 1000);
        base.withMaxContentLength(1000 * 1000 * 1000);
        base.withTimeout(this.settingsStore.getTimeoutSettings().apiTimeout);
        if (buildFluentOptions) {
            buildFluentOptions(base);
        }
        return base.build();
    }
    createDefaultClient(buildFluentOptions) {
        const builder = new _defaulthttpclientbuilder.DefaultHttpClientBuilder();
        return this.createClient(builder, buildFluentOptions);
    }
    createClientWithBaseUrl(base, baseAddress, buildFluentOptions) {
        return this.createClient(base, (builder)=>{
            builder.withBaseUrl(baseAddress);
            if (buildFluentOptions) {
                buildFluentOptions(base);
            }
        });
    }
}

//# sourceMappingURL=http-client.factory.js.map