import Foundation
import ServiceStack
public class GetUserTranslations : GetTranslations
{
required public init(){ super.init() }
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
}
}
public class GetTranslations : Codable
{
public var translateKeys:[String] = []
required public init(){}
}
// @DataContract
public class GetTranslationsResponse : Codable
{
// @DataMember
public var translations:[Translation] = []
// @DataMember
public var preferredLanguage:String?
// @DataMember
public var preferredLanguageShort:String?
required public init(){}
}
// @DataContract
public class Translation : ITranslation, Codable
{
// @DataMember
public var key:String?
// @DataMember
public var nl:String?
// @DataMember
public var en:String?
// @DataMember
public var de:String?
// @DataMember
public var fr:String?
// @DataMember
public var c1:String?
// @DataMember
public var c2:String?
// @DataMember
public var c3:String?
// @DataMember
public var c4:String?
// @DataMember
public var c5:String?
// @DataMember
public var c6:String?
required public init(){}
}
Swift GetUserTranslations DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /csv/reply/GetUserTranslations HTTP/1.1
Host: digiofficeapigateway.deltares.nl
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"TranslateKeys":["String"]}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"Translations":[{"Key":"String","NL":"String","EN":"String","DE":"String","FR":"String","C1":"String","C2":"String","C3":"String","C4":"String","C5":"String","C6":"String"}],"PreferredLanguage":"String","PreferredLanguageShort":"String"}