| POST | /files/Tls |
|---|
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
class SecurityType(str, Enum):
SSL = 'Ssl'
TLS = 'Tls'
CERTIFICATE = 'Certificate'
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SmtpConfig(IReturn[SmtpConfigResponse]):
host: Optional[str] = None
port: Optional[str] = None
security_type: Optional[SecurityType] = None
username: Optional[str] = None
password: Optional[str] = None
smtp_from_email: Optional[str] = None
@staticmethod
def response_type(): return SmtpConfigResponse
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SmtpConfigResponse:
response_status: Optional[ResponseStatus] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SmtpConfigTls(SmtpConfig):
security_type: Optional[SecurityType] = None
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
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: messdienstservice-stadtwerke-peine-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
}
}
}