Server

<back to all web services

SmtpConfigCert

Requires Authentication
The following routes are available for this service:
POST/files/Certificate
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 SmtpConfigCert extends SmtpConfig implements IConvertible
{
    // @DataMember(Name="SecurityType")
    SecurityType? SecurityType;

    SmtpConfigCert({this.SecurityType});
    SmtpConfigCert.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() => "SmtpConfigCert";
    TypeContext? context = _ctx;
}

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

Dart SmtpConfigCert DTOs

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

HTTP + XML

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: elotesch-servdesk.eras-online.de 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<SmtpConfigCert xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eras2Web.Service.Desktop.Server.ServiceModel.Eras2Client.Smtp">
  <Host>String</Host>
  <Password>String</Password>
  <Port>String</Port>
  <SecurityType>Ssl</SecurityType>
  <SmtpFromEmail>String</SmtpFromEmail>
  <Username>String</Username>
</SmtpConfigCert>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<SmtpConfigResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eras2Web.Service.Desktop.Server.ServiceModel.Eras2Client.Smtp">
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
</SmtpConfigResponse>