POST | /optimizer/tod |
---|
namespace powerDev.Optimization.ServiceModel
open System
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations
[<AllowNullLiteral>]
type AnnualRateItem() =
member val Year:Int32 = new Int32() with get,set
member val Value:Decimal = new Decimal() with get,set
[<AllowNullLiteral>]
type YoyFactorOptimizarItem() =
member val Year:Int32 = new Int32() with get,set
member val Factor:Decimal = new Decimal() with get,set
[<AllowNullLiteral>]
type TodOptimizerRequestItem() =
member val Year:Int32 = new Int32() with get,set
member val Month:Int32 = new Int32() with get,set
member val Hour:Int32 = new Int32() with get,set
member val WeekDay:Int32 = new Int32() with get,set
member val EnergyPrice:Decimal = new Decimal() with get,set
member val CapacityPrice:Decimal = new Decimal() with get,set
[<AllowNullLiteral>]
type TodOptimizerRequestBase() =
member val ProjectId:Guid = new Guid() with get,set
member val ChargeDischargeLimit:Decimal = new Decimal() with get,set
member val BatteryCapacity:Decimal = new Decimal() with get,set
member val ChargeEfficiency:Decimal = new Decimal() with get,set
member val DischargeEfficiency:Decimal = new Decimal() with get,set
member val ParaciticLossesOperation:Decimal = new Decimal() with get,set
member val ParaciticLossesResting:Decimal = new Decimal() with get,set
member val HVACLosses:Decimal = new Decimal() with get,set
member val AcCablingLosses:Decimal = new Decimal() with get,set
member val TransformatorLosses:Decimal = new Decimal() with get,set
member val ThermalLosses:Decimal = new Decimal() with get,set
member val UnavailabilityLoss:Decimal = new Decimal() with get,set
member val OtherLosses:Decimal = new Decimal() with get,set
member val EnableCapacity:Boolean = new Boolean() with get,set
member val EnergySchedule:IEnumerable<AnnualRateItem> = null with get,set
member val CapacitySchedule:IEnumerable<AnnualRateItem> = null with get,set
member val YoyFactors:IEnumerable<YoyFactorOptimizarItem> = null with get,set
member val Data:IEnumerable<TodOptimizerRequestItem> = null with get,set
member val ApiActionId:Guid = new Guid() with get,set
[<AllowNullLiteral>]
type TODOptimizerRequest() =
inherit TodOptimizerRequestBase()
type ApiResponseStatus =
| Undefined = 0
| Success = 1
| Pending = 10
| Failed = 100
[<AllowNullLiteral>]
type TodOptimizerResponseItem() =
inherit TodOptimizerRequestItem()
member val ChargeState:Decimal = new Decimal() with get,set
member val Charging:Decimal = new Decimal() with get,set
member val Loss:Decimal = new Decimal() with get,set
member val ChargeRate:Decimal = new Decimal() with get,set
[<AllowNullLiteral>]
type TodOptimizerResponse() =
member val Status:ApiResponseStatus = new ApiResponseStatus() with get,set
member val Message:String = null with get,set
member val ApiActionId:Guid = new Guid() with get,set
member val TestItems:ResizeArray<TodOptimizerResponseItem> = new ResizeArray<TodOptimizerResponseItem>() with get,set
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>