| POST | /optimizer/tod |
|---|
import java.math.*
import java.util.*
import net.servicestack.client.*
import com.google.gson.annotations.*
import com.google.gson.reflect.*
open class TODOptimizerRequest : TodOptimizerRequestBase()
{
}
open class TodOptimizerRequestBase
{
var projectId:UUID? = null
var chargeDischargeLimit:BigDecimal? = null
var batteryCapacity:BigDecimal? = null
var chargeEfficiency:BigDecimal? = null
var dischargeEfficiency:BigDecimal? = null
var paraciticLossesOperation:BigDecimal? = null
var paraciticLossesResting:BigDecimal? = null
var hvacLosses:BigDecimal? = null
var acCablingLosses:BigDecimal? = null
var transformatorLosses:BigDecimal? = null
var thermalLosses:BigDecimal? = null
var unavailabilityLoss:BigDecimal? = null
var otherLosses:BigDecimal? = null
var enableCapacity:Boolean? = null
var energySchedule:ArrayList<AnnualRateItem> = ArrayList<AnnualRateItem>()
var capacitySchedule:ArrayList<AnnualRateItem> = ArrayList<AnnualRateItem>()
var yoyFactors:ArrayList<YoyFactorOptimizarItem> = ArrayList<YoyFactorOptimizarItem>()
@SerializedName("data") var Data:ArrayList<TodOptimizerRequestItem> = ArrayList<TodOptimizerRequestItem>()
var apiActionId:UUID? = null
}
open class AnnualRateItem
{
var year:Int? = null
var value:BigDecimal? = null
}
open class YoyFactorOptimizarItem
{
var year:Int? = null
var factor:BigDecimal? = null
}
open class TodOptimizerRequestItem
{
var year:Int? = null
var month:Int? = null
var hour:Int? = null
var weekDay:Int? = null
var energyPrice:BigDecimal? = null
var capacityPrice:BigDecimal? = null
}
open class TodOptimizerResponse
{
var status:ApiResponseStatus? = null
var message:String? = null
var apiActionId:UUID? = null
var testItems:ArrayList<TodOptimizerResponseItem> = ArrayList<TodOptimizerResponseItem>()
}
enum class ApiResponseStatus(val value:Int)
{
Undefined(0),
Success(1),
Pending(10),
Failed(100),
}
open class TodOptimizerResponseItem : TodOptimizerRequestItem()
{
var chargeState:BigDecimal? = null
var charging:BigDecimal? = null
var loss:BigDecimal? = null
var chargeRate:BigDecimal? = null
}
Kotlin TODOptimizerRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
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: text/jsv
Content-Type: text/jsv
Content-Length: length
{
projectId: 00000000000000000000000000000000,
chargeDischargeLimit: 0,
batteryCapacity: 0,
chargeEfficiency: 0,
dischargeEfficiency: 0,
paraciticLossesOperation: 0,
paraciticLossesResting: 0,
hvacLosses: 0,
acCablingLosses: 0,
transformatorLosses: 0,
thermalLosses: 0,
unavailabilityLoss: 0,
otherLosses: 0,
enableCapacity: False,
apiActionId: 00000000000000000000000000000000
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
status: Undefined,
message: String,
apiActionId: 00000000000000000000000000000000,
testItems:
[
{
chargeState: 0,
charging: 0,
loss: 0,
chargeRate: 0,
year: 0,
month: 0,
hour: 0,
weekDay: 0,
energyPrice: 0,
capacityPrice: 0
}
]
}