| POST | /App/{UserId}/HkEvaluate |
|---|
import Foundation
import ServiceStack
// @DataContract
public class EvaluateHkRadiators : Eras2AppServiceModelBase
{
// @DataMember(Name="RadiatorGroupId")
public var RadiatorGroupId:Int
// @DataMember(Name="Parameters")
public var Parameters:IList<HkEvaluateParameter>
// @DataMember(Name="Attributes")
public var Attributes:IList<HkEvaluateAttribute>
// @DataMember(Name="DeviceTypeIdentifier")
public var DeviceTypeIdentifier:String
// @DataMember(Name="MountingPoint")
public var MountingPoint:String
// @DataMember(Name="MaxResultSize")
public var MaxResultSize:Int
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case RadiatorGroupId
case Parameters
case Attributes
case DeviceTypeIdentifier
case MountingPoint
case MaxResultSize
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
RadiatorGroupId = try container.decodeIfPresent(Int.self, forKey: .RadiatorGroupId)
Parameters = try container.decodeIfPresent(IList<HkEvaluateParameter>.self, forKey: .Parameters)
Attributes = try container.decodeIfPresent(IList<HkEvaluateAttribute>.self, forKey: .Attributes)
DeviceTypeIdentifier = try container.decodeIfPresent(String.self, forKey: .DeviceTypeIdentifier)
MountingPoint = try container.decodeIfPresent(String.self, forKey: .MountingPoint)
MaxResultSize = try container.decodeIfPresent(Int.self, forKey: .MaxResultSize)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if RadiatorGroupId != nil { try container.encode(RadiatorGroupId, forKey: .RadiatorGroupId) }
if Parameters != nil { try container.encode(Parameters, forKey: .Parameters) }
if Attributes != nil { try container.encode(Attributes, forKey: .Attributes) }
if DeviceTypeIdentifier != nil { try container.encode(DeviceTypeIdentifier, forKey: .DeviceTypeIdentifier) }
if MountingPoint != nil { try container.encode(MountingPoint, forKey: .MountingPoint) }
if MaxResultSize != nil { try container.encode(MaxResultSize, forKey: .MaxResultSize) }
}
}
// @DataContract
public class Eras2AppServiceModelBase : Codable
{
// @DataMember(Name="UserId")
public var UserId:String
required public init(){}
}
// @DataContract
public class HkEvaluateParameter : Codable
{
// @DataMember(Name="RadiatisId")
public var RadiatisId:Int
// @DataMember(Name="Value")
public var Value:String
required public init(){}
}
// @DataContract
public class HkEvaluateAttribute : Codable
{
// @DataMember(Name="RadiatisId")
public var RadiatisId:Int
// @DataMember(Name="Value")
public var Value:Int
required public init(){}
}
// @DataContract
public class EvaluateHkRadiatorsResponse : Codable
{
// @DataMember(Name="Radiators")
public var Radiators:IList<HkRadiatorMatch>
// @DataMember(Name="ResponseStatus")
public var ResponseStatus:ResponseStatus
required public init(){}
}
// @DataContract
public class HkRadiatorMatch : Codable
{
// @DataMember(Name="Match")
public var Match:Int
// @DataMember(Name="RadiatisRadiatorId")
public var RadiatisRadiatorId:Int?
// @DataMember(Name="Producer")
public var Producer:String
// @DataMember(Name="Model")
public var Model:String
// @DataMember(Name="ModelNoteReference")
public var ModelNoteReference:String
// @DataMember(Name="KcValue")
public var KcValue:Double?
// @DataMember(Name="KqValue")
public var KqValue:Double?
// @DataMember(Name="KtValue")
public var KtValue:Double?
// @DataMember(Name="Differences")
public var Differences:IList<HkMatchDifference>
required public init(){}
}
// @DataContract
public class HkMatchDifference : Codable
{
// @DataMember(Name="Code")
public var Code:String
// @DataMember(Name="Name")
public var Name:String
// @DataMember(Name="Value")
public var Value:String
required public init(){}
}
Swift EvaluateHkRadiators 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 /App/{UserId}/HkEvaluate HTTP/1.1
Host: faabrechnungen-servamw.eras-online.de
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
RadiatorGroupId: 0,
DeviceTypeIdentifier: String,
MountingPoint: String,
MaxResultSize: 0,
UserId: 00000000000000000000000000000000
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
ResponseStatus:
{
errorCode: String,
message: String,
stackTrace: String,
errors:
[
{
errorCode: String,
fieldName: String,
message: String,
meta:
{
String: String
}
}
],
meta:
{
String: String
}
}
}