| POST,OPTIONS | /v1/sms/recruitment/reply |
|---|
<?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 TwilioRequest implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $AccountSid=null,
/** @var string|null */
public ?string $From=null,
/** @var string|null */
public ?string $To=null,
/** @var string|null */
public ?string $FromCity=null,
/** @var string|null */
public ?string $FromState=null,
/** @var string|null */
public ?string $FromZip=null,
/** @var string|null */
public ?string $FromCountry=null,
/** @var string|null */
public ?string $ToCity=null,
/** @var string|null */
public ?string $ToState=null,
/** @var string|null */
public ?string $ToZip=null,
/** @var string|null */
public ?string $ToCountry=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['AccountSid'])) $this->AccountSid = $o['AccountSid'];
if (isset($o['From'])) $this->From = $o['From'];
if (isset($o['To'])) $this->To = $o['To'];
if (isset($o['FromCity'])) $this->FromCity = $o['FromCity'];
if (isset($o['FromState'])) $this->FromState = $o['FromState'];
if (isset($o['FromZip'])) $this->FromZip = $o['FromZip'];
if (isset($o['FromCountry'])) $this->FromCountry = $o['FromCountry'];
if (isset($o['ToCity'])) $this->ToCity = $o['ToCity'];
if (isset($o['ToState'])) $this->ToState = $o['ToState'];
if (isset($o['ToZip'])) $this->ToZip = $o['ToZip'];
if (isset($o['ToCountry'])) $this->ToCountry = $o['ToCountry'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->AccountSid)) $o['AccountSid'] = $this->AccountSid;
if (isset($this->From)) $o['From'] = $this->From;
if (isset($this->To)) $o['To'] = $this->To;
if (isset($this->FromCity)) $o['FromCity'] = $this->FromCity;
if (isset($this->FromState)) $o['FromState'] = $this->FromState;
if (isset($this->FromZip)) $o['FromZip'] = $this->FromZip;
if (isset($this->FromCountry)) $o['FromCountry'] = $this->FromCountry;
if (isset($this->ToCity)) $o['ToCity'] = $this->ToCity;
if (isset($this->ToState)) $o['ToState'] = $this->ToState;
if (isset($this->ToZip)) $o['ToZip'] = $this->ToZip;
if (isset($this->ToCountry)) $o['ToCountry'] = $this->ToCountry;
return empty($o) ? new class(){} : $o;
}
}
class SmsRequest extends TwilioRequest implements JsonSerializable
{
/**
* @param string|null $AccountSid
* @param string|null $From
* @param string|null $To
* @param string|null $FromCity
* @param string|null $FromState
* @param string|null $FromZip
* @param string|null $FromCountry
* @param string|null $ToCity
* @param string|null $ToState
* @param string|null $ToZip
* @param string|null $ToCountry
*/
public function __construct(
?string $AccountSid=null,
?string $From=null,
?string $To=null,
?string $FromCity=null,
?string $FromState=null,
?string $FromZip=null,
?string $FromCountry=null,
?string $ToCity=null,
?string $ToState=null,
?string $ToZip=null,
?string $ToCountry=null,
/** @var string|null */
public ?string $MessageSid=null,
/** @var string|null */
public ?string $SmsSid=null,
/** @var string|null */
public ?string $Body=null,
/** @var string|null */
public ?string $MessageStatus=null,
/** @var string|null */
public ?string $OptOutType=null,
/** @var string|null */
public ?string $MessagingServiceSid=null,
/** @var int */
public int $NumMedia=0,
/** @var int */
public int $ReferralNumMedia=0
) {
parent::__construct($AccountSid,$From,$To,$FromCity,$FromState,$FromZip,$FromCountry,$ToCity,$ToState,$ToZip,$ToCountry);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['MessageSid'])) $this->MessageSid = $o['MessageSid'];
if (isset($o['SmsSid'])) $this->SmsSid = $o['SmsSid'];
if (isset($o['Body'])) $this->Body = $o['Body'];
if (isset($o['MessageStatus'])) $this->MessageStatus = $o['MessageStatus'];
if (isset($o['OptOutType'])) $this->OptOutType = $o['OptOutType'];
if (isset($o['MessagingServiceSid'])) $this->MessagingServiceSid = $o['MessagingServiceSid'];
if (isset($o['NumMedia'])) $this->NumMedia = $o['NumMedia'];
if (isset($o['ReferralNumMedia'])) $this->ReferralNumMedia = $o['ReferralNumMedia'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->MessageSid)) $o['MessageSid'] = $this->MessageSid;
if (isset($this->SmsSid)) $o['SmsSid'] = $this->SmsSid;
if (isset($this->Body)) $o['Body'] = $this->Body;
if (isset($this->MessageStatus)) $o['MessageStatus'] = $this->MessageStatus;
if (isset($this->OptOutType)) $o['OptOutType'] = $this->OptOutType;
if (isset($this->MessagingServiceSid)) $o['MessagingServiceSid'] = $this->MessagingServiceSid;
if (isset($this->NumMedia)) $o['NumMedia'] = $this->NumMedia;
if (isset($this->ReferralNumMedia)) $o['ReferralNumMedia'] = $this->ReferralNumMedia;
return empty($o) ? new class(){} : $o;
}
}
class IncomingRecruitmentSMSRequest extends SmsRequest implements JsonSerializable
{
/**
* @param string|null $AccountSid
* @param string|null $From
* @param string|null $To
* @param string|null $FromCity
* @param string|null $FromState
* @param string|null $FromZip
* @param string|null $FromCountry
* @param string|null $ToCity
* @param string|null $ToState
* @param string|null $ToZip
* @param string|null $ToCountry
* @param string|null $MessageSid
* @param string|null $SmsSid
* @param string|null $Body
* @param string|null $MessageStatus
* @param string|null $OptOutType
* @param string|null $MessagingServiceSid
* @param int $NumMedia
* @param int $ReferralNumMedia
*/
public function __construct(
?string $AccountSid=null,
?string $From=null,
?string $To=null,
?string $FromCity=null,
?string $FromState=null,
?string $FromZip=null,
?string $FromCountry=null,
?string $ToCity=null,
?string $ToState=null,
?string $ToZip=null,
?string $ToCountry=null,
?string $MessageSid=null,
?string $SmsSid=null,
?string $Body=null,
?string $MessageStatus=null,
?string $OptOutType=null,
?string $MessagingServiceSid=null,
int $NumMedia=0,
int $ReferralNumMedia=0
) {
parent::__construct($AccountSid,$From,$To,$FromCity,$FromState,$FromZip,$FromCountry,$ToCity,$ToState,$ToZip,$ToCountry,$MessageSid,$SmsSid,$Body,$MessageStatus,$OptOutType,$MessagingServiceSid,$NumMedia,$ReferralNumMedia);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
return empty($o) ? new class(){} : $o;
}
}
PHP IncomingRecruitmentSMSRequest DTOs
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 /v1/sms/recruitment/reply HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"MessageSid":"String","SmsSid":"String","Body":"String","MessageStatus":"String","OptOutType":"String","MessagingServiceSid":"String","NumMedia":0,"ReferralNumMedia":0,"AccountSid":"String","From":"String","To":"String","FromCity":"String","FromState":"String","FromZip":"String","FromCountry":"String","ToCity":"String","ToState":"String","ToZip":"String","ToCountry":"String"}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length (string)