| POST | /ValidateEmail |
|---|
import 'package:servicestack/servicestack.dart';
class ValidateEmail implements IConvertible
{
String? email;
String? source;
ValidateEmail({this.email,this.source});
ValidateEmail.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
email = json['email'];
source = json['source'];
return this;
}
Map<String, dynamic> toJson() => {
'email': email,
'source': source
};
getTypeName() => "ValidateEmail";
TypeContext? context = _ctx;
}
class Additional implements IConvertible
{
bool hasKnownBounces;
bool hasSpamReports;
bool hasSuspectedBounces;
DateTime? spamReportCreated;
Additional({this.hasKnownBounces,this.hasSpamReports,this.hasSuspectedBounces,this.spamReportCreated});
Additional.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
hasKnownBounces = json['hasKnownBounces'];
hasSpamReports = json['hasSpamReports'];
hasSuspectedBounces = json['hasSuspectedBounces'];
spamReportCreated = JsonConverters.fromJson(json['spamReportCreated'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'hasKnownBounces': hasKnownBounces,
'hasSpamReports': hasSpamReports,
'hasSuspectedBounces': hasSuspectedBounces,
'spamReportCreated': JsonConverters.toJson(spamReportCreated,'DateTime',context!)
};
getTypeName() => "Additional";
TypeContext? context = _ctx;
}
class Domain implements IConvertible
{
bool hasMxOrARecord;
bool hasValidAddressSyntax;
bool isSuspectedDisposableAddress;
Domain({this.hasMxOrARecord,this.hasValidAddressSyntax,this.isSuspectedDisposableAddress});
Domain.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
hasMxOrARecord = json['hasMxOrARecord'];
hasValidAddressSyntax = json['hasValidAddressSyntax'];
isSuspectedDisposableAddress = json['isSuspectedDisposableAddress'];
return this;
}
Map<String, dynamic> toJson() => {
'hasMxOrARecord': hasMxOrARecord,
'hasValidAddressSyntax': hasValidAddressSyntax,
'isSuspectedDisposableAddress': isSuspectedDisposableAddress
};
getTypeName() => "Domain";
TypeContext? context = _ctx;
}
class LocalPart implements IConvertible
{
bool isSuspectedRoleAddress;
LocalPart({this.isSuspectedRoleAddress});
LocalPart.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
isSuspectedRoleAddress = json['isSuspectedRoleAddress'];
return this;
}
Map<String, dynamic> toJson() => {
'isSuspectedRoleAddress': isSuspectedRoleAddress
};
getTypeName() => "LocalPart";
TypeContext? context = _ctx;
}
class Checks implements IConvertible
{
Additional? additional;
Domain? domain;
LocalPart? localPart;
Checks({this.additional,this.domain,this.localPart});
Checks.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
additional = JsonConverters.fromJson(json['additional'],'Additional',context!);
domain = JsonConverters.fromJson(json['domain'],'Domain',context!);
localPart = JsonConverters.fromJson(json['localPart'],'LocalPart',context!);
return this;
}
Map<String, dynamic> toJson() => {
'additional': JsonConverters.toJson(additional,'Additional',context!),
'domain': JsonConverters.toJson(domain,'Domain',context!),
'localPart': JsonConverters.toJson(localPart,'LocalPart',context!)
};
getTypeName() => "Checks";
TypeContext? context = _ctx;
}
class Result implements IConvertible
{
Checks? checks;
String? email;
String? host;
String? ip_Address;
String? local;
double score = 0;
String? source;
String? suggestion;
String? verdict;
Result({this.checks,this.email,this.host,this.ip_Address,this.local,this.score,this.source,this.suggestion,this.verdict});
Result.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
checks = JsonConverters.fromJson(json['checks'],'Checks',context!);
email = json['email'];
host = json['host'];
ip_Address = json['ip_Address'];
local = json['local'];
score = JsonConverters.toDouble(json['score']);
source = json['source'];
suggestion = json['suggestion'];
verdict = json['verdict'];
return this;
}
Map<String, dynamic> toJson() => {
'checks': JsonConverters.toJson(checks,'Checks',context!),
'email': email,
'host': host,
'ip_Address': ip_Address,
'local': local,
'score': score,
'source': source,
'suggestion': suggestion,
'verdict': verdict
};
getTypeName() => "Result";
TypeContext? context = _ctx;
}
class EmailValidation implements IConvertible
{
Result? result;
EmailValidation({this.result});
EmailValidation.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
result = JsonConverters.fromJson(json['result'],'Result',context!);
return this;
}
Map<String, dynamic> toJson() => {
'result': JsonConverters.toJson(result,'Result',context!)
};
getTypeName() => "EmailValidation";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'cpmwebservices_t.clarkpud.com', types: <String, TypeInfo> {
'ValidateEmail': TypeInfo(TypeOf.Class, create:() => ValidateEmail()),
'Additional': TypeInfo(TypeOf.Class, create:() => Additional()),
'Domain': TypeInfo(TypeOf.Class, create:() => Domain()),
'LocalPart': TypeInfo(TypeOf.Class, create:() => LocalPart()),
'Checks': TypeInfo(TypeOf.Class, create:() => Checks()),
'Result': TypeInfo(TypeOf.Class, create:() => Result()),
'EmailValidation': TypeInfo(TypeOf.Class, create:() => EmailValidation()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /ValidateEmail HTTP/1.1
Host: cpmwebservices-t.clarkpud.com
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"email":"String","source":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"result":{"checks":{"additional":{"hasKnownBounces":false,"hasSpamReports":false,"hasSuspectedBounces":false,"spamReportCreated":"\/Date(-62135596800000-0000)\/"},"domain":{"hasMxOrARecord":false,"hasValidAddressSyntax":false,"isSuspectedDisposableAddress":false},"localPart":{"isSuspectedRoleAddress":false}},"email":"String","host":"String","ip_Address":"String","local":"String","score":0,"source":"String","suggestion":"String@String","verdict":"String"}}