Server

<back to all web services

SmtpConfigTls

Requires Authentication
The following routes are available for this service:
POST/files/Tls
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

enum SecurityType
{
    Ssl,
    Tls,
    Certificate,
}

// @DataContract
abstract class SmtpConfig
{
    // @DataMember(Name="Host")
    String? Host;

    // @DataMember(Name="Port")
    String? Port;

    // @DataMember(Name="SecurityType")
    SecurityType? SecurityType;

    // @DataMember(Name="Username")
    String? Username;

    // @DataMember(Name="Password")
    String? Password;

    // @DataMember(Name="SmtpFromEmail")
    String? SmtpFromEmail;

    SmtpConfig({this.Host,this.Port,this.SecurityType,this.Username,this.Password,this.SmtpFromEmail});
    SmtpConfig.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Host = json['host'];
        Port = json['port'];
        SecurityType = JsonConverters.fromJson(json['securityType'],'SecurityType',context!);
        Username = json['username'];
        Password = json['password'];
        SmtpFromEmail = json['smtpFromEmail'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'host': Host,
        'port': Port,
        'securityType': JsonConverters.toJson(SecurityType,'SecurityType',context!),
        'username': Username,
        'password': Password,
        'smtpFromEmail': SmtpFromEmail
    };

    getTypeName() => "SmtpConfig";
    TypeContext? context = _ctx;
}

class SmtpConfigResponse implements IConvertible
{
    ResponseStatus? responseStatus;

    SmtpConfigResponse({this.responseStatus});
    SmtpConfigResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!)
    };

    getTypeName() => "SmtpConfigResponse";
    TypeContext? context = _ctx;
}

// @DataContract
class SmtpConfigTls extends SmtpConfig implements IConvertible
{
    // @DataMember(Name="SecurityType")
    SecurityType? SecurityType;

    SmtpConfigTls({this.SecurityType});
    SmtpConfigTls.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        SecurityType = JsonConverters.fromJson(json['securityType'],'SecurityType',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'securityType': JsonConverters.toJson(SecurityType,'SecurityType',context!)
    });

    getTypeName() => "SmtpConfigTls";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'inea_servdesk.eras_online.de', types: <String, TypeInfo> {
    'SecurityType': TypeInfo(TypeOf.Enum, enumValues:SecurityType.values),
    'SmtpConfig': TypeInfo(TypeOf.AbstractClass),
    'SmtpConfigResponse': TypeInfo(TypeOf.Class, create:() => SmtpConfigResponse()),
    'SmtpConfigTls': TypeInfo(TypeOf.Class, create:() => SmtpConfigTls()),
});

Dart SmtpConfigTls 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/Tls HTTP/1.1 
Host: inea-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"}}}