| All Verbs | /nodes/live-answer/email |
|---|
<?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 LiveAnswerEmailRecipient implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $name=null,
/** @var string|null */
public ?string $address=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['name'])) $this->name = $o['name'];
if (isset($o['address'])) $this->address = $o['address'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->address)) $o['address'] = $this->address;
return empty($o) ? new class(){} : $o;
}
}
class LiveAnswerSendEmail implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $flowId=null,
/** @var string|null */
public ?string $sessionId=null,
/** @var string|null */
public ?string $nodeId=null,
/** @var string|null */
public ?string $clientId=null,
/** @var string|null */
public ?string $subject=null,
/** @var string|null */
public ?string $body=null,
/** @var array<LiveAnswerEmailRecipient>|null */
public ?array $to=null,
/** @var array<LiveAnswerEmailRecipient>|null */
public ?array $cc=null,
/** @var array<LiveAnswerEmailRecipient>|null */
public ?array $bcc=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['flowId'])) $this->flowId = $o['flowId'];
if (isset($o['sessionId'])) $this->sessionId = $o['sessionId'];
if (isset($o['nodeId'])) $this->nodeId = $o['nodeId'];
if (isset($o['clientId'])) $this->clientId = $o['clientId'];
if (isset($o['subject'])) $this->subject = $o['subject'];
if (isset($o['body'])) $this->body = $o['body'];
if (isset($o['to'])) $this->to = JsonConverters::fromArray('LiveAnswerEmailRecipient', $o['to']);
if (isset($o['cc'])) $this->cc = JsonConverters::fromArray('LiveAnswerEmailRecipient', $o['cc']);
if (isset($o['bcc'])) $this->bcc = JsonConverters::fromArray('LiveAnswerEmailRecipient', $o['bcc']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->flowId)) $o['flowId'] = $this->flowId;
if (isset($this->sessionId)) $o['sessionId'] = $this->sessionId;
if (isset($this->nodeId)) $o['nodeId'] = $this->nodeId;
if (isset($this->clientId)) $o['clientId'] = $this->clientId;
if (isset($this->subject)) $o['subject'] = $this->subject;
if (isset($this->body)) $o['body'] = $this->body;
if (isset($this->to)) $o['to'] = JsonConverters::toArray('LiveAnswerEmailRecipient', $this->to);
if (isset($this->cc)) $o['cc'] = JsonConverters::toArray('LiveAnswerEmailRecipient', $this->cc);
if (isset($this->bcc)) $o['bcc'] = JsonConverters::toArray('LiveAnswerEmailRecipient', $this->bcc);
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 /nodes/live-answer/email HTTP/1.1
Host: evovoice.io
Accept: application/json
Content-Type: application/json
Content-Length: length
{"flowId":"String","sessionId":"String","nodeId":"String","clientId":"String","subject":"String","body":"String","to":[{"name":"String","address":"String"}],"cc":[{"name":"String","address":"String"}],"bcc":[{"name":"String","address":"String"}]}