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

com.genability.client.api.service.signal.CalculateService Maven / Gradle / Ivy

There is a newer version: 1.5.1
Show newest version
package com.genability.client.api.service.signal;

import com.fasterxml.jackson.core.type.TypeReference;
import com.genability.client.api.request.signal.GetCalculatedCostRequest;
import com.genability.client.api.request.signal.GetMassCalculatedCostRequest;
import com.genability.client.api.service.BaseService;
import com.genability.client.types.Response;
import com.genability.client.types.signal.CalculatedCost;
import com.genability.client.types.signal.MassCalculation;


public class CalculateService extends BaseService {

    private static final TypeReference> CALCULATEDCOST_RESPONSE_TYPEREF =
            new TypeReference>() { };
    private static final TypeReference> MASSCALCULATION_RESPONSE_TYPEREF =
            new TypeReference>() { };


    public Response getCalculatedCost(GetCalculatedCostRequest request) {
        if (log.isDebugEnabled()) {
            log.debug("getCalculatedCost called");
        }

        String uri = "v1/ondemand/calculate";

        Response response = this.callPost(
                uri,
                request,
                CALCULATEDCOST_RESPONSE_TYPEREF);

        if (log.isDebugEnabled()) {
            log.debug("getCalculatedCost completed");
        }

        return response;
    }

    public Response getMassCalculatedCost(GetMassCalculatedCostRequest request) {
        if (log.isDebugEnabled()) {
            log.debug("getMassCalculatedCost");
        }

        String uri = "v1/ondemand/calculate/mass";

        Response response = this.callPost(
                uri,
                request,
                MASSCALCULATION_RESPONSE_TYPEREF
        );

        if (log.isDebugEnabled()) {
            log.debug("getMassCalculatedCost completed");
        }

        return response;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy