Server

<back to all web services

SmtpConfigCert

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

// @DataContract
public class SmtpConfigCert : 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 SmtpConfigCert DTOs

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

HTTP + JSV

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

POST /files/Certificate HTTP/1.1 
Host: mi-waerme-servdesk.eras-online.de 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	SecurityType: Ssl,
	Host: String,
	Port: String,
	Username: String,
	Password: String,
	SmtpFromEmail: String
}
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
		}
	}
}