<?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 WorkflowTaskComment implements IComment, JsonSerializable
{
public function __construct(
/** @var int */
public int $WorkflowTaskID=0,
/** @var int */
public int $UserID=0,
/** @var string|null */
public ?string $TaskTitle=null,
/** @var string|null */
public ?string $Connection=null,
/** @var string|null */
public ?string $Username=null,
/** @var string|null */
public ?string $Text=null,
/** @var DateTime */
public DateTime $Date=new DateTime(),
/** @var bool|null */
public ?bool $IsMine=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['WorkflowTaskID'])) $this->WorkflowTaskID = $o['WorkflowTaskID'];
if (isset($o['UserID'])) $this->UserID = $o['UserID'];
if (isset($o['TaskTitle'])) $this->TaskTitle = $o['TaskTitle'];
if (isset($o['Connection'])) $this->Connection = $o['Connection'];
if (isset($o['Username'])) $this->Username = $o['Username'];
if (isset($o['Text'])) $this->Text = $o['Text'];
if (isset($o['Date'])) $this->Date = JsonConverters::from('DateTime', $o['Date']);
if (isset($o['IsMine'])) $this->IsMine = $o['IsMine'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->WorkflowTaskID)) $o['WorkflowTaskID'] = $this->WorkflowTaskID;
if (isset($this->UserID)) $o['UserID'] = $this->UserID;
if (isset($this->TaskTitle)) $o['TaskTitle'] = $this->TaskTitle;
if (isset($this->Connection)) $o['Connection'] = $this->Connection;
if (isset($this->Username)) $o['Username'] = $this->Username;
if (isset($this->Text)) $o['Text'] = $this->Text;
if (isset($this->Date)) $o['Date'] = JsonConverters::to('DateTime', $this->Date);
if (isset($this->IsMine)) $o['IsMine'] = $this->IsMine;
return empty($o) ? new class(){} : $o;
}
}
class SetWorkflowTaskMessage implements JsonSerializable
{
public function __construct(
/** @var int */
public int $ID=0,
/** @var int */
public int $UserID=0,
/** @var string|null */
public ?string $Message=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ID'])) $this->ID = $o['ID'];
if (isset($o['UserID'])) $this->UserID = $o['UserID'];
if (isset($o['Message'])) $this->Message = $o['Message'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ID)) $o['ID'] = $this->ID;
if (isset($this->UserID)) $o['UserID'] = $this->UserID;
if (isset($this->Message)) $o['Message'] = $this->Message;
return empty($o) ? new class(){} : $o;
}
}
PHP SetWorkflowTaskMessage DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /xml/reply/SetWorkflowTaskMessage HTTP/1.1
Host: dogw.klokgroep.nl
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<SetWorkflowTaskMessage xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.Workflow.Operations">
<ID>0</ID>
<Message>String</Message>
<UserID>0</UserID>
</SetWorkflowTaskMessage>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <WorkflowTaskComment xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.Workflow"> <Connection>String</Connection> <Date>0001-01-01T00:00:00</Date> <IsMine>false</IsMine> <TaskTitle>String</TaskTitle> <Text>String</Text> <UserID>0</UserID> <Username>String</Username> <WorkflowTaskID>0</WorkflowTaskID> </WorkflowTaskComment>