Trendsic Platform Service

<back to all web services

CampaignEmailAuditRequest

Requires Authentication
Requires any of the roles:Agent, Administrator, Agent, Administrator, Agent, Administrator, Agent, Administrator
The following routes are available for this service:
GET,POST,PUT,DELETE,OPTIONS/v1/CampaignEmailAudit/{CampaignEmailID}
GET,POST,PUT,DELETE,OPTIONS/v1/CampaignEmailAudit
<?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 CampaignEmailAudit implements JsonSerializable
{
    public function __construct(
        /** @var DateTime|null */
        public ?DateTime $CreatedDate=null,
        /** @var int */
        public int $CampaignEmailID=0,
        /** @var string|null */
        public ?string $EmailTo=null,
        /** @var string|null */
        public ?string $EmailFrom=null,
        /** @var string|null */
        public ?string $EmailSubject=null,
        /** @var string|null */
        public ?string $EmailBody=null,
        /** @var int */
        public int $CampaignTypeID=0,
        /** @var int */
        public int $AgentID=0,
        /** @var int */
        public int $ContactID=0,
        /** @var bool|null */
        public ?bool $sent=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['CreatedDate'])) $this->CreatedDate = JsonConverters::from('DateTime', $o['CreatedDate']);
        if (isset($o['CampaignEmailID'])) $this->CampaignEmailID = $o['CampaignEmailID'];
        if (isset($o['EmailTo'])) $this->EmailTo = $o['EmailTo'];
        if (isset($o['EmailFrom'])) $this->EmailFrom = $o['EmailFrom'];
        if (isset($o['EmailSubject'])) $this->EmailSubject = $o['EmailSubject'];
        if (isset($o['EmailBody'])) $this->EmailBody = $o['EmailBody'];
        if (isset($o['CampaignTypeID'])) $this->CampaignTypeID = $o['CampaignTypeID'];
        if (isset($o['AgentID'])) $this->AgentID = $o['AgentID'];
        if (isset($o['ContactID'])) $this->ContactID = $o['ContactID'];
        if (isset($o['sent'])) $this->sent = $o['sent'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->CreatedDate)) $o['CreatedDate'] = JsonConverters::to('DateTime', $this->CreatedDate);
        if (isset($this->CampaignEmailID)) $o['CampaignEmailID'] = $this->CampaignEmailID;
        if (isset($this->EmailTo)) $o['EmailTo'] = $this->EmailTo;
        if (isset($this->EmailFrom)) $o['EmailFrom'] = $this->EmailFrom;
        if (isset($this->EmailSubject)) $o['EmailSubject'] = $this->EmailSubject;
        if (isset($this->EmailBody)) $o['EmailBody'] = $this->EmailBody;
        if (isset($this->CampaignTypeID)) $o['CampaignTypeID'] = $this->CampaignTypeID;
        if (isset($this->AgentID)) $o['AgentID'] = $this->AgentID;
        if (isset($this->ContactID)) $o['ContactID'] = $this->ContactID;
        if (isset($this->sent)) $o['sent'] = $this->sent;
        return empty($o) ? new class(){} : $o;
    }
}

class CampaignEmailAuditResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var array<CampaignEmailAudit>|null */
        public ?array $CampaignEmailAudit=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
        if (isset($o['CampaignEmailAudit'])) $this->CampaignEmailAudit = JsonConverters::fromArray('CampaignEmailAudit', $o['CampaignEmailAudit']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        if (isset($this->CampaignEmailAudit)) $o['CampaignEmailAudit'] = JsonConverters::toArray('CampaignEmailAudit', $this->CampaignEmailAudit);
        return empty($o) ? new class(){} : $o;
    }
}

class CampaignEmailAuditRequest implements JsonSerializable
{
    public function __construct(
        /** @var array<CampaignEmailAudit>|null */
        public ?array $CampaignEmailAudit=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['CampaignEmailAudit'])) $this->CampaignEmailAudit = JsonConverters::fromArray('CampaignEmailAudit', $o['CampaignEmailAudit']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->CampaignEmailAudit)) $o['CampaignEmailAudit'] = JsonConverters::toArray('CampaignEmailAudit', $this->CampaignEmailAudit);
        return empty($o) ? new class(){} : $o;
    }
}

PHP CampaignEmailAuditRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /v1/CampaignEmailAudit/{CampaignEmailID} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	CampaignEmailAudit: 
	[
		{
			CreatedDate: 0001-01-01,
			CampaignEmailID: 0,
			EmailTo: String,
			EmailFrom: String,
			EmailSubject: String,
			EmailBody: String,
			CampaignTypeID: 0,
			AgentID: 0,
			ContactID: 0,
			sent: False
		}
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	},
	CampaignEmailAudit: 
	[
		{
			CreatedDate: 0001-01-01,
			CampaignEmailID: 0,
			EmailTo: String,
			EmailFrom: String,
			EmailSubject: String,
			EmailBody: String,
			CampaignTypeID: 0,
			AgentID: 0,
			ContactID: 0,
			sent: False
		}
	]
}