| GET | /campaign/inbox/formmeta |
|---|
<?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 FormFieldOption implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Value=null,
/** @var string|null */
public ?string $Label=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Value'])) $this->Value = $o['Value'];
if (isset($o['Label'])) $this->Label = $o['Label'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Value)) $o['Value'] = $this->Value;
if (isset($this->Label)) $o['Label'] = $this->Label;
return empty($o) ? new class(){} : $o;
}
}
class FormField implements JsonSerializable
{
public function __construct(
/** @var int */
public int $Id=0,
/** @var string|null */
public ?string $ControlType=null,
/** @var string|null */
public ?string $Label=null,
/** @var string|null */
public ?string $Placeholder=null,
/** @var string|null */
public ?string $Help=null,
/** @var string|null */
public ?string $Name=null,
/** @var int */
public int $SortOrder=0,
/** @var array<FormFieldOption>|null */
public ?array $Options=null,
/** @var array<string>|null */
public ?array $Validation=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['ControlType'])) $this->ControlType = $o['ControlType'];
if (isset($o['Label'])) $this->Label = $o['Label'];
if (isset($o['Placeholder'])) $this->Placeholder = $o['Placeholder'];
if (isset($o['Help'])) $this->Help = $o['Help'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['SortOrder'])) $this->SortOrder = $o['SortOrder'];
if (isset($o['Options'])) $this->Options = JsonConverters::fromArray('FormFieldOption', $o['Options']);
if (isset($o['Validation'])) $this->Validation = JsonConverters::fromArray('string', $o['Validation']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->ControlType)) $o['ControlType'] = $this->ControlType;
if (isset($this->Label)) $o['Label'] = $this->Label;
if (isset($this->Placeholder)) $o['Placeholder'] = $this->Placeholder;
if (isset($this->Help)) $o['Help'] = $this->Help;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->SortOrder)) $o['SortOrder'] = $this->SortOrder;
if (isset($this->Options)) $o['Options'] = JsonConverters::toArray('FormFieldOption', $this->Options);
if (isset($this->Validation)) $o['Validation'] = JsonConverters::toArray('string', $this->Validation);
return empty($o) ? new class(){} : $o;
}
}
class CampaignActionFile implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $FileType=null,
/** @var string|null */
public ?string $FileSize=null,
/** @var string|null */
public ?string $Extension=null,
/** @var string|null */
public ?string $UploadUrl=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['FileType'])) $this->FileType = $o['FileType'];
if (isset($o['FileSize'])) $this->FileSize = $o['FileSize'];
if (isset($o['Extension'])) $this->Extension = $o['Extension'];
if (isset($o['UploadUrl'])) $this->UploadUrl = $o['UploadUrl'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->FileType)) $o['FileType'] = $this->FileType;
if (isset($this->FileSize)) $o['FileSize'] = $this->FileSize;
if (isset($this->Extension)) $o['Extension'] = $this->Extension;
if (isset($this->UploadUrl)) $o['UploadUrl'] = $this->UploadUrl;
return empty($o) ? new class(){} : $o;
}
}
class CampaignActions implements JsonSerializable
{
public function __construct(
// @DataMember(Order=1)
// @Required()
/** @var int */
public int $Id=0,
// @DataMember(Order=2)
// @Required()
// @References("typeof(digitaluapi.ServiceModel.Types.Campaigns)")
/** @var int */
public int $CampaignsId=0,
// @DataMember(Order=3)
// @References("typeof(digitaluapi.ServiceModel.Types.Actions)")
/** @var int|null */
public ?int $ActionsId=null,
// @DataMember(Order=4)
/** @var string|null */
public ?string $ButtonName=null,
// @DataMember(Order=5)
// @References("typeof(digitaluapi.ServiceModel.Types.ActionTypes)")
/** @var int|null */
public ?int $ActionTypesId=null,
// @DataMember(Order=6)
/** @var string|null */
public ?string $Description=null,
// @DataMember(Order=7)
/** @var int|null */
public ?int $OfferOrder=null,
// @DataMember(Order=8)
/** @var bool|null */
public ?bool $StandOut=null,
// @DataMember(Order=9)
// @Required()
/** @var string */
public string $PublicAccessGuid='',
// @DataMember(Order=10)
/** @var array<FormField>|null */
public ?array $FormMeta=null,
// @DataMember(Order=11)
/** @var array<CampaignActionFile>|null */
public ?array $Files=null,
// @DataMember(Order=12)
/** @var string|null */
public ?string $SentToEmailAddress=null,
// @DataMember(Order=13)
/** @var string|null */
public ?string $CcEmailAddress=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['CampaignsId'])) $this->CampaignsId = $o['CampaignsId'];
if (isset($o['ActionsId'])) $this->ActionsId = $o['ActionsId'];
if (isset($o['ButtonName'])) $this->ButtonName = $o['ButtonName'];
if (isset($o['ActionTypesId'])) $this->ActionTypesId = $o['ActionTypesId'];
if (isset($o['Description'])) $this->Description = $o['Description'];
if (isset($o['OfferOrder'])) $this->OfferOrder = $o['OfferOrder'];
if (isset($o['StandOut'])) $this->StandOut = $o['StandOut'];
if (isset($o['PublicAccessGuid'])) $this->PublicAccessGuid = $o['PublicAccessGuid'];
if (isset($o['FormMeta'])) $this->FormMeta = JsonConverters::fromArray('FormField', $o['FormMeta']);
if (isset($o['Files'])) $this->Files = JsonConverters::fromArray('CampaignActionFile', $o['Files']);
if (isset($o['SentToEmailAddress'])) $this->SentToEmailAddress = $o['SentToEmailAddress'];
if (isset($o['CcEmailAddress'])) $this->CcEmailAddress = $o['CcEmailAddress'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->CampaignsId)) $o['CampaignsId'] = $this->CampaignsId;
if (isset($this->ActionsId)) $o['ActionsId'] = $this->ActionsId;
if (isset($this->ButtonName)) $o['ButtonName'] = $this->ButtonName;
if (isset($this->ActionTypesId)) $o['ActionTypesId'] = $this->ActionTypesId;
if (isset($this->Description)) $o['Description'] = $this->Description;
if (isset($this->OfferOrder)) $o['OfferOrder'] = $this->OfferOrder;
if (isset($this->StandOut)) $o['StandOut'] = $this->StandOut;
if (isset($this->PublicAccessGuid)) $o['PublicAccessGuid'] = $this->PublicAccessGuid;
if (isset($this->FormMeta)) $o['FormMeta'] = JsonConverters::toArray('FormField', $this->FormMeta);
if (isset($this->Files)) $o['Files'] = JsonConverters::toArray('CampaignActionFile', $this->Files);
if (isset($this->SentToEmailAddress)) $o['SentToEmailAddress'] = $this->SentToEmailAddress;
if (isset($this->CcEmailAddress)) $o['CcEmailAddress'] = $this->CcEmailAddress;
return empty($o) ? new class(){} : $o;
}
}
class InboxActionResponse implements JsonSerializable
{
public function __construct(
/** @var CampaignActions|null */
public ?CampaignActions $campaignAction=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['campaignAction'])) $this->campaignAction = JsonConverters::from('CampaignActions', $o['campaignAction']);
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->campaignAction)) $o['campaignAction'] = JsonConverters::to('CampaignActions', $this->campaignAction);
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
class GetCampaignActionClientForm implements JsonSerializable
{
public function __construct(
/** @var string */
public string $CommsGuid='',
/** @var int */
public int $CampaignActionsRequestsId=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['CommsGuid'])) $this->CommsGuid = $o['CommsGuid'];
if (isset($o['CampaignActionsRequestsId'])) $this->CampaignActionsRequestsId = $o['CampaignActionsRequestsId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->CommsGuid)) $o['CommsGuid'] = $this->CommsGuid;
if (isset($this->CampaignActionsRequestsId)) $o['CampaignActionsRequestsId'] = $this->CampaignActionsRequestsId;
return empty($o) ? new class(){} : $o;
}
}
PHP GetCampaignActionClientForm DTOs
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.
GET /campaign/inbox/formmeta HTTP/1.1 Host: duengageapi.uat.scadsoftware.com Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
campaignAction:
{
Id: 0,
CampaignsId: 0,
ActionsId: 0,
ButtonName: String,
ActionTypesId: 0,
Description: String,
OfferOrder: 0,
StandOut: False,
PublicAccessGuid: 00000000000000000000000000000000,
FormMeta:
[
{
Id: 0,
ControlType: String,
Label: String,
Placeholder: String,
Help: String,
Name: String,
SortOrder: 0,
Options:
[
{
Value: String,
Label: String
}
],
Validation:
[
String
]
}
],
Files:
[
{
Name: String,
FileType: String,
FileSize: String,
Extension: String,
UploadUrl: String
}
],
SentToEmailAddress: String,
CcEmailAddress: String
},
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
}
}