Trendsic Platform Service

<back to all web services

AgentReminderRequest

Requires Authentication
Requires any of the roles:Agent, Administrator
The following routes are available for this service:
GET,OPTIONS/v1/AgentReminder
<?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 Reminder implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $ReminderId='',
        /** @var string|null */
        public ?string $TableName=null,
        /** @var string|null */
        public ?string $FieldName=null,
        /** @var int */
        public int $RecordId=0,
        /** @var DateTime */
        public DateTime $ReminderDate=new DateTime(),
        /** @var string|null */
        public ?string $ReminderNote=null,
        /** @var DateTime */
        public DateTime $CreatedDate=new DateTime(),
        /** @var string|null */
        public ?string $CreatedBy=null,
        /** @var DateTime */
        public DateTime $CompletedDate=new DateTime()
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ReminderId'])) $this->ReminderId = $o['ReminderId'];
        if (isset($o['TableName'])) $this->TableName = $o['TableName'];
        if (isset($o['FieldName'])) $this->FieldName = $o['FieldName'];
        if (isset($o['RecordId'])) $this->RecordId = $o['RecordId'];
        if (isset($o['ReminderDate'])) $this->ReminderDate = JsonConverters::from('DateTime', $o['ReminderDate']);
        if (isset($o['ReminderNote'])) $this->ReminderNote = $o['ReminderNote'];
        if (isset($o['CreatedDate'])) $this->CreatedDate = JsonConverters::from('DateTime', $o['CreatedDate']);
        if (isset($o['CreatedBy'])) $this->CreatedBy = $o['CreatedBy'];
        if (isset($o['CompletedDate'])) $this->CompletedDate = JsonConverters::from('DateTime', $o['CompletedDate']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ReminderId)) $o['ReminderId'] = $this->ReminderId;
        if (isset($this->TableName)) $o['TableName'] = $this->TableName;
        if (isset($this->FieldName)) $o['FieldName'] = $this->FieldName;
        if (isset($this->RecordId)) $o['RecordId'] = $this->RecordId;
        if (isset($this->ReminderDate)) $o['ReminderDate'] = JsonConverters::to('DateTime', $this->ReminderDate);
        if (isset($this->ReminderNote)) $o['ReminderNote'] = $this->ReminderNote;
        if (isset($this->CreatedDate)) $o['CreatedDate'] = JsonConverters::to('DateTime', $this->CreatedDate);
        if (isset($this->CreatedBy)) $o['CreatedBy'] = $this->CreatedBy;
        if (isset($this->CompletedDate)) $o['CompletedDate'] = JsonConverters::to('DateTime', $this->CompletedDate);
        return empty($o) ? new class(){} : $o;
    }
}

class ReminderExtended extends Reminder implements JsonSerializable
{
    /**
     * @param string $ReminderId
     * @param string|null $TableName
     * @param string|null $FieldName
     * @param int $RecordId
     * @param DateTime $ReminderDate
     * @param string|null $ReminderNote
     * @param DateTime $CreatedDate
     * @param string|null $CreatedBy
     * @param DateTime $CompletedDate
     */
    public function __construct(
        string $ReminderId='',
        ?string $TableName=null,
        ?string $FieldName=null,
        int $RecordId=0,
        DateTime $ReminderDate=new DateTime(),
        ?string $ReminderNote=null,
        DateTime $CreatedDate=new DateTime(),
        ?string $CreatedBy=null,
        DateTime $CompletedDate=new DateTime(),
        /** @var string|null */
        public ?string $AgentName=null,
        /** @var string|null */
        public ?string $RecordAgentName=null,
        /** @var int */
        public int $RecordAgentID=0,
        /** @var bool|null */
        public ?bool $IsAdmin=null,
        /** @var int */
        public int $AgentID=0
    ) {
        parent::__construct($ReminderId,$TableName,$FieldName,$RecordId,$ReminderDate,$ReminderNote,$CreatedDate,$CreatedBy,$CompletedDate);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['AgentName'])) $this->AgentName = $o['AgentName'];
        if (isset($o['RecordAgentName'])) $this->RecordAgentName = $o['RecordAgentName'];
        if (isset($o['RecordAgentID'])) $this->RecordAgentID = $o['RecordAgentID'];
        if (isset($o['IsAdmin'])) $this->IsAdmin = $o['IsAdmin'];
        if (isset($o['AgentID'])) $this->AgentID = $o['AgentID'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->AgentName)) $o['AgentName'] = $this->AgentName;
        if (isset($this->RecordAgentName)) $o['RecordAgentName'] = $this->RecordAgentName;
        if (isset($this->RecordAgentID)) $o['RecordAgentID'] = $this->RecordAgentID;
        if (isset($this->IsAdmin)) $o['IsAdmin'] = $this->IsAdmin;
        if (isset($this->AgentID)) $o['AgentID'] = $this->AgentID;
        return empty($o) ? new class(){} : $o;
    }
}

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

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

class AgentReminderRequest implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $IsAdmin=null,
        /** @var string|null */
        public ?string $ReminderType=null
    ) {
    }

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

PHP AgentReminderRequest DTOs

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

HTTP + OTHER

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

GET /v1/AgentReminder HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"Reminder":[{"AgentName":"String","RecordAgentName":"String","RecordAgentID":0,"IsAdmin":false,"AgentID":0,"ReminderId":"00000000000000000000000000000000","TableName":"String","FieldName":"String","RecordId":0,"ReminderDate":"0001-01-01T00:00:00.0000000","ReminderNote":"String","CreatedDate":"0001-01-01T00:00:00.0000000","CreatedBy":"String","CompletedDate":"0001-01-01T00:00:00.0000000"}]}