| 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: 'isp_plauen_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()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
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: isp-plauen-servdesk.eras-online.de
Accept: application/json
Content-Type: application/json
Content-Length: length
{"SecurityType":"Ssl","Host":"String","Port":"String","Username":"String","Password":"String","SmtpFromEmail":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}