Server

<back to all web services

SmtpConfigSsl

Requires Authentication
The following routes are available for this service:
POST/files/Ssl
import Foundation
import ServiceStack

// @DataContract
public class SmtpConfigSsl : 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(){}
}


Swift SmtpConfigSsl DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /files/Ssl HTTP/1.1 
Host: andreiuologmbh-servdesk.eras-online.de 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"SecurityType":"Ssl","Host":"String","Port":"String","Username":"String","Password":"String","SmtpFromEmail":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}