| 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 .xml suffix or ?format=xml
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: inea-servamw.eras-online.de
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<EvaluateHkRadiators xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eras2Amw.Service.Server.ServiceModel.Eras2App.Get">
<UserId xmlns="http://schemas.datacontract.org/2004/07/Eras2Amw.Service.Server.ServiceModel.Eras2App">00000000-0000-0000-0000-000000000000</UserId>
<Attributes xmlns:d2p1="http://schemas.datacontract.org/2004/07/Eras2Amw.Service.Server.ServiceModel.Common" i:nil="true" />
<DeviceTypeIdentifier>String</DeviceTypeIdentifier>
<MaxResultSize>0</MaxResultSize>
<MountingPoint>String</MountingPoint>
<Parameters xmlns:d2p1="http://schemas.datacontract.org/2004/07/Eras2Amw.Service.Server.ServiceModel.Common" i:nil="true" />
<RadiatorGroupId>0</RadiatorGroupId>
</EvaluateHkRadiators>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<EvaluateHkRadiatorsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eras2Amw.Service.Server.ServiceModel.Eras2App.Get">
<Radiators xmlns:d2p1="http://schemas.datacontract.org/2004/07/Eras2Amw.Service.Server.ServiceModel.Common" i:nil="true" />
<ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:Message>String</d2p1:Message>
<d2p1:StackTrace>String</d2p1:StackTrace>
<d2p1:Errors>
<d2p1:ResponseError>
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:FieldName>String</d2p1:FieldName>
<d2p1:Message>String</d2p1:Message>
<d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringstring>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>String</d5p1:Value>
</d5p1:KeyValueOfstringstring>
</d2p1:Meta>
</d2p1:ResponseError>
</d2p1:Errors>
<d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringstring>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfstringstring>
</d2p1:Meta>
</ResponseStatus>
</EvaluateHkRadiatorsResponse>