| POST | /ValidateEmail |
|---|
<?php namespace dtos;
use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};
class ValidateEmail implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $email=null,
/** @var string|null */
public ?string $source=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['email'])) $this->email = $o['email'];
if (isset($o['source'])) $this->source = $o['source'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->email)) $o['email'] = $this->email;
if (isset($this->source)) $o['source'] = $this->source;
return empty($o) ? new class(){} : $o;
}
}
class Additional implements JsonSerializable
{
public function __construct(
/** @var bool|null */
public ?bool $hasKnownBounces=null,
/** @var bool|null */
public ?bool $hasSpamReports=null,
/** @var bool|null */
public ?bool $hasSuspectedBounces=null,
/** @var DateTime|null */
public ?DateTime $spamReportCreated=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['hasKnownBounces'])) $this->hasKnownBounces = $o['hasKnownBounces'];
if (isset($o['hasSpamReports'])) $this->hasSpamReports = $o['hasSpamReports'];
if (isset($o['hasSuspectedBounces'])) $this->hasSuspectedBounces = $o['hasSuspectedBounces'];
if (isset($o['spamReportCreated'])) $this->spamReportCreated = JsonConverters::from('DateTime', $o['spamReportCreated']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->hasKnownBounces)) $o['hasKnownBounces'] = $this->hasKnownBounces;
if (isset($this->hasSpamReports)) $o['hasSpamReports'] = $this->hasSpamReports;
if (isset($this->hasSuspectedBounces)) $o['hasSuspectedBounces'] = $this->hasSuspectedBounces;
if (isset($this->spamReportCreated)) $o['spamReportCreated'] = JsonConverters::to('DateTime', $this->spamReportCreated);
return empty($o) ? new class(){} : $o;
}
}
class Domain implements JsonSerializable
{
public function __construct(
/** @var bool|null */
public ?bool $hasMxOrARecord=null,
/** @var bool|null */
public ?bool $hasValidAddressSyntax=null,
/** @var bool|null */
public ?bool $isSuspectedDisposableAddress=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['hasMxOrARecord'])) $this->hasMxOrARecord = $o['hasMxOrARecord'];
if (isset($o['hasValidAddressSyntax'])) $this->hasValidAddressSyntax = $o['hasValidAddressSyntax'];
if (isset($o['isSuspectedDisposableAddress'])) $this->isSuspectedDisposableAddress = $o['isSuspectedDisposableAddress'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->hasMxOrARecord)) $o['hasMxOrARecord'] = $this->hasMxOrARecord;
if (isset($this->hasValidAddressSyntax)) $o['hasValidAddressSyntax'] = $this->hasValidAddressSyntax;
if (isset($this->isSuspectedDisposableAddress)) $o['isSuspectedDisposableAddress'] = $this->isSuspectedDisposableAddress;
return empty($o) ? new class(){} : $o;
}
}
class LocalPart implements JsonSerializable
{
public function __construct(
/** @var bool|null */
public ?bool $isSuspectedRoleAddress=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['isSuspectedRoleAddress'])) $this->isSuspectedRoleAddress = $o['isSuspectedRoleAddress'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->isSuspectedRoleAddress)) $o['isSuspectedRoleAddress'] = $this->isSuspectedRoleAddress;
return empty($o) ? new class(){} : $o;
}
}
class Checks implements JsonSerializable
{
public function __construct(
/** @var Additional|null */
public ?Additional $additional=null,
/** @var Domain|null */
public ?Domain $domain=null,
/** @var LocalPart|null */
public ?LocalPart $localPart=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['additional'])) $this->additional = JsonConverters::from('Additional', $o['additional']);
if (isset($o['domain'])) $this->domain = JsonConverters::from('Domain', $o['domain']);
if (isset($o['localPart'])) $this->localPart = JsonConverters::from('LocalPart', $o['localPart']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->additional)) $o['additional'] = JsonConverters::to('Additional', $this->additional);
if (isset($this->domain)) $o['domain'] = JsonConverters::to('Domain', $this->domain);
if (isset($this->localPart)) $o['localPart'] = JsonConverters::to('LocalPart', $this->localPart);
return empty($o) ? new class(){} : $o;
}
}
class Result implements JsonSerializable
{
public function __construct(
/** @var Checks|null */
public ?Checks $checks=null,
/** @var string|null */
public ?string $email=null,
/** @var string|null */
public ?string $host=null,
/** @var string|null */
public ?string $ip_Address=null,
/** @var string|null */
public ?string $local=null,
/** @var float */
public float $score=0.0,
/** @var string|null */
public ?string $source=null,
/** @var string|null */
public ?string $suggestion=null,
/** @var string|null */
public ?string $verdict=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['checks'])) $this->checks = JsonConverters::from('Checks', $o['checks']);
if (isset($o['email'])) $this->email = $o['email'];
if (isset($o['host'])) $this->host = $o['host'];
if (isset($o['ip_Address'])) $this->ip_Address = $o['ip_Address'];
if (isset($o['local'])) $this->local = $o['local'];
if (isset($o['score'])) $this->score = $o['score'];
if (isset($o['source'])) $this->source = $o['source'];
if (isset($o['suggestion'])) $this->suggestion = $o['suggestion'];
if (isset($o['verdict'])) $this->verdict = $o['verdict'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->checks)) $o['checks'] = JsonConverters::to('Checks', $this->checks);
if (isset($this->email)) $o['email'] = $this->email;
if (isset($this->host)) $o['host'] = $this->host;
if (isset($this->ip_Address)) $o['ip_Address'] = $this->ip_Address;
if (isset($this->local)) $o['local'] = $this->local;
if (isset($this->score)) $o['score'] = $this->score;
if (isset($this->source)) $o['source'] = $this->source;
if (isset($this->suggestion)) $o['suggestion'] = $this->suggestion;
if (isset($this->verdict)) $o['verdict'] = $this->verdict;
return empty($o) ? new class(){} : $o;
}
}
class EmailValidation implements JsonSerializable
{
public function __construct(
/** @var Result|null */
public ?Result $result=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['result'])) $this->result = JsonConverters::from('Result', $o['result']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->result)) $o['result'] = JsonConverters::to('Result', $this->result);
return empty($o) ? new class(){} : $o;
}
}
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 /ValidateEmail HTTP/1.1
Host: cpmwebservices-t.clarkpud.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"email":"String","source":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
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"}}