| All Verbs | /CreateRemMessage/{ClientKey} |
|---|
<?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 BaseResponse implements JsonSerializable
{
public function __construct(
/** @var bool|null */
public ?bool $Result=null,
/** @var int */
public int $ErrorCode=0,
/** @var string|null */
public ?string $ErrorMessage=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Result'])) $this->Result = $o['Result'];
if (isset($o['ErrorCode'])) $this->ErrorCode = $o['ErrorCode'];
if (isset($o['ErrorMessage'])) $this->ErrorMessage = $o['ErrorMessage'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Result)) $o['Result'] = $this->Result;
if (isset($this->ErrorCode)) $o['ErrorCode'] = $this->ErrorCode;
if (isset($this->ErrorMessage)) $o['ErrorMessage'] = $this->ErrorMessage;
return empty($o) ? new class(){} : $o;
}
}
class CreateRemMessageResponse extends BaseResponse implements JsonSerializable
{
/**
* @param bool|null $Result
* @param int $ErrorCode
* @param string|null $ErrorMessage
*/
public function __construct(
?bool $Result=null,
int $ErrorCode=0,
?string $ErrorMessage=null,
/** @var int */
public int $RemID=0
) {
parent::__construct($Result,$ErrorCode,$ErrorMessage);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['RemID'])) $this->RemID = $o['RemID'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->RemID)) $o['RemID'] = $this->RemID;
return empty($o) ? new class(){} : $o;
}
}
class RemAttributes implements JsonSerializable
{
public function __construct(
/** @var int */
public int $SubscriberId=0,
/** @var string|null */
public ?string $Owner=null,
/** @var string|null */
public ?string $FromAddress=null,
/** @var string|null */
public ?string $ToAddresses=null,
/** @var string|null */
public ?string $CcAddresses=null,
/** @var string|null */
public ?string $Subject=null,
/** @var string|null */
public ?string $BodyType=null,
/** @var string|null */
public ?string $Body=null,
/** @var bool|null */
public ?bool $AutoSignerYn=null,
/** @var string|null */
public ?string $TrMessageType=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['SubscriberId'])) $this->SubscriberId = $o['SubscriberId'];
if (isset($o['Owner'])) $this->Owner = $o['Owner'];
if (isset($o['FromAddress'])) $this->FromAddress = $o['FromAddress'];
if (isset($o['ToAddresses'])) $this->ToAddresses = $o['ToAddresses'];
if (isset($o['CcAddresses'])) $this->CcAddresses = $o['CcAddresses'];
if (isset($o['Subject'])) $this->Subject = $o['Subject'];
if (isset($o['BodyType'])) $this->BodyType = $o['BodyType'];
if (isset($o['Body'])) $this->Body = $o['Body'];
if (isset($o['AutoSignerYn'])) $this->AutoSignerYn = $o['AutoSignerYn'];
if (isset($o['TrMessageType'])) $this->TrMessageType = $o['TrMessageType'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->SubscriberId)) $o['SubscriberId'] = $this->SubscriberId;
if (isset($this->Owner)) $o['Owner'] = $this->Owner;
if (isset($this->FromAddress)) $o['FromAddress'] = $this->FromAddress;
if (isset($this->ToAddresses)) $o['ToAddresses'] = $this->ToAddresses;
if (isset($this->CcAddresses)) $o['CcAddresses'] = $this->CcAddresses;
if (isset($this->Subject)) $o['Subject'] = $this->Subject;
if (isset($this->BodyType)) $o['BodyType'] = $this->BodyType;
if (isset($this->Body)) $o['Body'] = $this->Body;
if (isset($this->AutoSignerYn)) $o['AutoSignerYn'] = $this->AutoSignerYn;
if (isset($this->TrMessageType)) $o['TrMessageType'] = $this->TrMessageType;
return empty($o) ? new class(){} : $o;
}
}
class CreateRemMessage implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $ClientKey=null,
/** @var string|null */
public ?string $AuthorizationID=null,
/** @var int */
public int $RemAddressId=0,
/** @var RemAttributes|null */
public ?RemAttributes $RemAttributesValues=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ClientKey'])) $this->ClientKey = $o['ClientKey'];
if (isset($o['AuthorizationID'])) $this->AuthorizationID = $o['AuthorizationID'];
if (isset($o['RemAddressId'])) $this->RemAddressId = $o['RemAddressId'];
if (isset($o['RemAttributesValues'])) $this->RemAttributesValues = JsonConverters::from('RemAttributes', $o['RemAttributesValues']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ClientKey)) $o['ClientKey'] = $this->ClientKey;
if (isset($this->AuthorizationID)) $o['AuthorizationID'] = $this->AuthorizationID;
if (isset($this->RemAddressId)) $o['RemAddressId'] = $this->RemAddressId;
if (isset($this->RemAttributesValues)) $o['RemAttributesValues'] = JsonConverters::to('RemAttributes', $this->RemAttributesValues);
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /CreateRemMessage/{ClientKey} HTTP/1.1
Host: remservices.eyyubiye.bel.tr
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
ClientKey: String,
AuthorizationID: String,
RemAddressId: 0,
RemAttributesValues:
{
SubscriberId: 0,
Owner: String,
FromAddress: String,
ToAddresses: String,
CcAddresses: String,
Subject: String,
BodyType: String,
Body: String,
AutoSignerYn: False,
TrMessageType: String
}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
RemID: 0,
Result: False,
ErrorCode: 0,
ErrorMessage: String
}