POST | /optimizer/tod |
---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
public static class TODOptimizerRequest extends TodOptimizerRequestBase
{
}
public static class TodOptimizerRequestBase
{
public UUID projectId = null;
public BigDecimal chargeDischargeLimit = null;
public BigDecimal batteryCapacity = null;
public BigDecimal chargeEfficiency = null;
public BigDecimal dischargeEfficiency = null;
public BigDecimal paraciticLossesOperation = null;
public BigDecimal paraciticLossesResting = null;
public BigDecimal hvacLosses = null;
public BigDecimal acCablingLosses = null;
public BigDecimal transformatorLosses = null;
public BigDecimal thermalLosses = null;
public BigDecimal unavailabilityLoss = null;
public BigDecimal otherLosses = null;
public Boolean enableCapacity = null;
public ArrayList<AnnualRateItem> energySchedule = null;
public ArrayList<AnnualRateItem> capacitySchedule = null;
public ArrayList<YoyFactorOptimizarItem> yoyFactors = null;
public ArrayList<TodOptimizerRequestItem> data = null;
public UUID apiActionId = null;
public UUID getProjectId() { return projectId; }
public TodOptimizerRequestBase setProjectId(UUID value) { this.projectId = value; return this; }
public BigDecimal getChargeDischargeLimit() { return chargeDischargeLimit; }
public TodOptimizerRequestBase setChargeDischargeLimit(BigDecimal value) { this.chargeDischargeLimit = value; return this; }
public BigDecimal getBatteryCapacity() { return batteryCapacity; }
public TodOptimizerRequestBase setBatteryCapacity(BigDecimal value) { this.batteryCapacity = value; return this; }
public BigDecimal getChargeEfficiency() { return chargeEfficiency; }
public TodOptimizerRequestBase setChargeEfficiency(BigDecimal value) { this.chargeEfficiency = value; return this; }
public BigDecimal getDischargeEfficiency() { return dischargeEfficiency; }
public TodOptimizerRequestBase setDischargeEfficiency(BigDecimal value) { this.dischargeEfficiency = value; return this; }
public BigDecimal getParaciticLossesOperation() { return paraciticLossesOperation; }
public TodOptimizerRequestBase setParaciticLossesOperation(BigDecimal value) { this.paraciticLossesOperation = value; return this; }
public BigDecimal getParaciticLossesResting() { return paraciticLossesResting; }
public TodOptimizerRequestBase setParaciticLossesResting(BigDecimal value) { this.paraciticLossesResting = value; return this; }
public BigDecimal getHvacLosses() { return hvacLosses; }
public TodOptimizerRequestBase setHvacLosses(BigDecimal value) { this.hvacLosses = value; return this; }
public BigDecimal getAcCablingLosses() { return acCablingLosses; }
public TodOptimizerRequestBase setAcCablingLosses(BigDecimal value) { this.acCablingLosses = value; return this; }
public BigDecimal getTransformatorLosses() { return transformatorLosses; }
public TodOptimizerRequestBase setTransformatorLosses(BigDecimal value) { this.transformatorLosses = value; return this; }
public BigDecimal getThermalLosses() { return thermalLosses; }
public TodOptimizerRequestBase setThermalLosses(BigDecimal value) { this.thermalLosses = value; return this; }
public BigDecimal getUnavailabilityLoss() { return unavailabilityLoss; }
public TodOptimizerRequestBase setUnavailabilityLoss(BigDecimal value) { this.unavailabilityLoss = value; return this; }
public BigDecimal getOtherLosses() { return otherLosses; }
public TodOptimizerRequestBase setOtherLosses(BigDecimal value) { this.otherLosses = value; return this; }
public Boolean isEnableCapacity() { return enableCapacity; }
public TodOptimizerRequestBase setEnableCapacity(Boolean value) { this.enableCapacity = value; return this; }
public ArrayList<AnnualRateItem> getEnergySchedule() { return energySchedule; }
public TodOptimizerRequestBase setEnergySchedule(ArrayList<AnnualRateItem> value) { this.energySchedule = value; return this; }
public ArrayList<AnnualRateItem> getCapacitySchedule() { return capacitySchedule; }
public TodOptimizerRequestBase setCapacitySchedule(ArrayList<AnnualRateItem> value) { this.capacitySchedule = value; return this; }
public ArrayList<YoyFactorOptimizarItem> getYoyFactors() { return yoyFactors; }
public TodOptimizerRequestBase setYoyFactors(ArrayList<YoyFactorOptimizarItem> value) { this.yoyFactors = value; return this; }
public ArrayList<TodOptimizerRequestItem> getData() { return data; }
public TodOptimizerRequestBase setData(ArrayList<TodOptimizerRequestItem> value) { this.data = value; return this; }
public UUID getApiActionId() { return apiActionId; }
public TodOptimizerRequestBase setApiActionId(UUID value) { this.apiActionId = value; return this; }
}
public static class AnnualRateItem
{
public Integer year = null;
public BigDecimal value = null;
public Integer getYear() { return year; }
public AnnualRateItem setYear(Integer value) { this.year = value; return this; }
public BigDecimal getValue() { return value; }
public AnnualRateItem setValue(BigDecimal value) { this.value = value; return this; }
}
public static class YoyFactorOptimizarItem
{
public Integer year = null;
public BigDecimal factor = null;
public Integer getYear() { return year; }
public YoyFactorOptimizarItem setYear(Integer value) { this.year = value; return this; }
public BigDecimal getFactor() { return factor; }
public YoyFactorOptimizarItem setFactor(BigDecimal value) { this.factor = value; return this; }
}
public static class TodOptimizerRequestItem
{
public Integer year = null;
public Integer month = null;
public Integer hour = null;
public Integer weekDay = null;
public BigDecimal energyPrice = null;
public BigDecimal capacityPrice = null;
public Integer getYear() { return year; }
public TodOptimizerRequestItem setYear(Integer value) { this.year = value; return this; }
public Integer getMonth() { return month; }
public TodOptimizerRequestItem setMonth(Integer value) { this.month = value; return this; }
public Integer getHour() { return hour; }
public TodOptimizerRequestItem setHour(Integer value) { this.hour = value; return this; }
public Integer getWeekDay() { return weekDay; }
public TodOptimizerRequestItem setWeekDay(Integer value) { this.weekDay = value; return this; }
public BigDecimal getEnergyPrice() { return energyPrice; }
public TodOptimizerRequestItem setEnergyPrice(BigDecimal value) { this.energyPrice = value; return this; }
public BigDecimal getCapacityPrice() { return capacityPrice; }
public TodOptimizerRequestItem setCapacityPrice(BigDecimal value) { this.capacityPrice = value; return this; }
}
public static class TodOptimizerResponse
{
public ApiResponseStatus status = null;
public String message = null;
public UUID apiActionId = null;
public ArrayList<TodOptimizerResponseItem> testItems = null;
public ApiResponseStatus getStatus() { return status; }
public TodOptimizerResponse setStatus(ApiResponseStatus value) { this.status = value; return this; }
public String getMessage() { return message; }
public TodOptimizerResponse setMessage(String value) { this.message = value; return this; }
public UUID getApiActionId() { return apiActionId; }
public TodOptimizerResponse setApiActionId(UUID value) { this.apiActionId = value; return this; }
public ArrayList<TodOptimizerResponseItem> getTestItems() { return testItems; }
public TodOptimizerResponse setTestItems(ArrayList<TodOptimizerResponseItem> value) { this.testItems = value; return this; }
}
public static enum ApiResponseStatus
{
Undefined(0),
Success(1),
Pending(10),
Failed(100);
private final int value;
ApiResponseStatus(final int intValue) { value = intValue; }
public int getValue() { return value; }
}
public static class TodOptimizerResponseItem extends TodOptimizerRequestItem
{
public BigDecimal chargeState = null;
public BigDecimal charging = null;
public BigDecimal loss = null;
public BigDecimal chargeRate = null;
public BigDecimal getChargeState() { return chargeState; }
public TodOptimizerResponseItem setChargeState(BigDecimal value) { this.chargeState = value; return this; }
public BigDecimal getCharging() { return charging; }
public TodOptimizerResponseItem setCharging(BigDecimal value) { this.charging = value; return this; }
public BigDecimal getLoss() { return loss; }
public TodOptimizerResponseItem setLoss(BigDecimal value) { this.loss = value; return this; }
public BigDecimal getChargeRate() { return chargeRate; }
public TodOptimizerResponseItem setChargeRate(BigDecimal value) { this.chargeRate = value; return this; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /optimizer/tod HTTP/1.1
Host: dev-optimization.power.dev
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<TODOptimizerRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/powerDev.Optimization.ServiceModel">
<AcCablingLosses xmlns="http://schemas.datacontract.org/2004/07/powerDev.Common.Models">0</AcCablingLosses>
<ApiActionId xmlns="http://schemas.datacontract.org/2004/07/powerDev.Common.Models">00000000-0000-0000-0000-000000000000</ApiActionId>
<BatteryCapacity xmlns="http://schemas.datacontract.org/2004/07/powerDev.Common.Models">0</BatteryCapacity>
<CapacitySchedule i:nil="true" xmlns="http://schemas.datacontract.org/2004/07/powerDev.Common.Models" />
<ChargeDischargeLimit xmlns="http://schemas.datacontract.org/2004/07/powerDev.Common.Models">0</ChargeDischargeLimit>
<ChargeEfficiency xmlns="http://schemas.datacontract.org/2004/07/powerDev.Common.Models">0</ChargeEfficiency>
<Data i:nil="true" xmlns="http://schemas.datacontract.org/2004/07/powerDev.Common.Models" />
<DischargeEfficiency xmlns="http://schemas.datacontract.org/2004/07/powerDev.Common.Models">0</DischargeEfficiency>
<EnableCapacity xmlns="http://schemas.datacontract.org/2004/07/powerDev.Common.Models">false</EnableCapacity>
<EnergySchedule i:nil="true" xmlns="http://schemas.datacontract.org/2004/07/powerDev.Common.Models" />
<HVACLosses xmlns="http://schemas.datacontract.org/2004/07/powerDev.Common.Models">0</HVACLosses>
<OtherLosses xmlns="http://schemas.datacontract.org/2004/07/powerDev.Common.Models">0</OtherLosses>
<ParaciticLossesOperation xmlns="http://schemas.datacontract.org/2004/07/powerDev.Common.Models">0</ParaciticLossesOperation>
<ParaciticLossesResting xmlns="http://schemas.datacontract.org/2004/07/powerDev.Common.Models">0</ParaciticLossesResting>
<ProjectId xmlns="http://schemas.datacontract.org/2004/07/powerDev.Common.Models">00000000-0000-0000-0000-000000000000</ProjectId>
<ThermalLosses xmlns="http://schemas.datacontract.org/2004/07/powerDev.Common.Models">0</ThermalLosses>
<TransformatorLosses xmlns="http://schemas.datacontract.org/2004/07/powerDev.Common.Models">0</TransformatorLosses>
<UnavailabilityLoss xmlns="http://schemas.datacontract.org/2004/07/powerDev.Common.Models">0</UnavailabilityLoss>
<YoyFactors i:nil="true" xmlns="http://schemas.datacontract.org/2004/07/powerDev.Common.Models" />
</TODOptimizerRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <TodOptimizerResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/powerDev.Common.Models"> <ApiActionId>00000000-0000-0000-0000-000000000000</ApiActionId> <Message>String</Message> <Status>Undefined</Status> <TestItems> <TodOptimizerResponseItem> <CapacityPrice>0</CapacityPrice> <EnergyPrice>0</EnergyPrice> <Hour>0</Hour> <Month>0</Month> <WeekDay>0</WeekDay> <Year>0</Year> <ChargeRate>0</ChargeRate> <ChargeState>0</ChargeState> <Charging>0</Charging> <Loss>0</Loss> </TodOptimizerResponseItem> </TestItems> </TodOptimizerResponse>