Server

<back to all web services

SmtpConfigCert

Requires Authentication
The following routes are available for this service:
POST/files/Certificate
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 SmtpConfigCert(SmtpConfig):
    security_type: Optional[SecurityType] = None

Python 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: andreiuologmbh-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
		}
	}
}