| POST | /files/Tls |
|---|
import Foundation
import ServiceStack
// @DataContract
public class SmtpConfigTls : SmtpConfig
{
// @DataMember(Name="SecurityType")
public var SecurityType:SecurityType
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case SecurityType
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
SecurityType = try container.decodeIfPresent(SecurityType.self, forKey: .SecurityType)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if SecurityType != nil { try container.encode(SecurityType, forKey: .SecurityType) }
}
}
// @DataContract
public class SmtpConfig : Codable
{
// @DataMember(Name="Host")
public var Host:String
// @DataMember(Name="Port")
public var Port:String
// @DataMember(Name="SecurityType")
public var SecurityType:SecurityType
// @DataMember(Name="Username")
public var Username:String
// @DataMember(Name="Password")
public var Password:String
// @DataMember(Name="SmtpFromEmail")
public var SmtpFromEmail:String
required public init(){}
}
public enum SecurityType : String, Codable
{
case Ssl
case Tls
case Certificate
}
public class SmtpConfigResponse : Codable
{
public var responseStatus:ResponseStatus
required public init(){}
}
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 /files/Tls HTTP/1.1
Host: inea-servdesk.eras-online.de
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"SecurityType":"Ssl","Host":"String","Port":"String","Username":"String","Password":"String","SmtpFromEmail":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}