All Downloads are FREE. Search and download functionalities are using the official Maven repository.

global.maplink.freight.async.FreightAsyncAPI Maven / Gradle / Ivy

package global.maplink.freight.async;

import global.maplink.MapLinkSDK;
import global.maplink.env.Environment;
import global.maplink.freight.schema.FreightCalculationRequest;
import global.maplink.freight.schema.FreightCalculationResponse;

import java.util.Optional;
import java.util.concurrent.CompletableFuture;

import static global.maplink.MapLinkServiceRequestAsyncRunner.proxyFor;

public interface FreightAsyncAPI {

    CompletableFuture calculate(FreightCalculationRequest request);

    static FreightAsyncAPI getInstance() {
        return getInstance(null);
    }

    static FreightAsyncAPI getInstance(Environment environment) {
        MapLinkSDK sdk = MapLinkSDK.getInstance();
        return proxyFor(
                FreightAsyncAPI.class,
                Optional.ofNullable(environment).orElse(sdk.getEnvironment()),
                sdk
        );
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy