<?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 WorkflowTaskAction implements JsonSerializable
{
public function __construct(
/** @var int */
public int $ID=0,
/** @var string|null */
public ?string $Title=null,
/** @var string|null */
public ?string $Type=null,
/** @var bool|null */
public ?bool $UseDialog=null,
/** @var string */
public string $ConnectionID=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ID'])) $this->ID = $o['ID'];
if (isset($o['Title'])) $this->Title = $o['Title'];
if (isset($o['Type'])) $this->Type = $o['Type'];
if (isset($o['UseDialog'])) $this->UseDialog = $o['UseDialog'];
if (isset($o['ConnectionID'])) $this->ConnectionID = $o['ConnectionID'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ID)) $o['ID'] = $this->ID;
if (isset($this->Title)) $o['Title'] = $this->Title;
if (isset($this->Type)) $o['Type'] = $this->Type;
if (isset($this->UseDialog)) $o['UseDialog'] = $this->UseDialog;
if (isset($this->ConnectionID)) $o['ConnectionID'] = $this->ConnectionID;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class WorkflowTask implements JsonSerializable
{
public function __construct(
// @DataMember
/** @var int */
public int $ID=0,
// @DataMember
/** @var string */
public string $DocumentID='',
// @DataMember
/** @var string|null */
public ?string $Title=null,
// @DataMember
/** @var string|null */
public ?string $Description=null,
// @DataMember
/** @var string|null */
public ?string $ContextTitle=null,
// @DataMember
/** @var string|null */
public ?string $Project=null,
// @DataMember
/** @var string|null */
public ?string $Relation=null,
// @DataMember
/** @var string|null */
public ?string $ImageKey=null,
// @DataMember
/** @var bool|null */
public ?bool $Urgent=null,
// @DataMember
/** @var bool|null */
public ?bool $IsRead=null,
// @DataMember
/** @var DateTime|null */
public ?DateTime $AssignmentDate=null,
// @DataMember
/** @var DateTime|null */
public ?DateTime $CompletionDate=null,
// @DataMember
/** @var int */
public int $NumberOfComments=0,
// @DataMember
/** @var string|null */
public ?string $ExtraField=null,
// @DataMember
/** @var bool|null */
public ?bool $HasPreview=null,
// @DataMember
/** @var string|null */
public ?string $Extension=null,
// @DataMember
/** @var bool|null */
public ?bool $IsInformative=null,
// @DataMember
/** @var bool|null */
public ?bool $HasPendingSideSteps=null,
// @DataMember
/** @var array<WorkflowTaskAction>|null */
public ?array $Actions=null,
// @DataMember
/** @var bool|null */
public ?bool $CanAccept=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ID'])) $this->ID = $o['ID'];
if (isset($o['DocumentID'])) $this->DocumentID = $o['DocumentID'];
if (isset($o['Title'])) $this->Title = $o['Title'];
if (isset($o['Description'])) $this->Description = $o['Description'];
if (isset($o['ContextTitle'])) $this->ContextTitle = $o['ContextTitle'];
if (isset($o['Project'])) $this->Project = $o['Project'];
if (isset($o['Relation'])) $this->Relation = $o['Relation'];
if (isset($o['ImageKey'])) $this->ImageKey = $o['ImageKey'];
if (isset($o['Urgent'])) $this->Urgent = $o['Urgent'];
if (isset($o['IsRead'])) $this->IsRead = $o['IsRead'];
if (isset($o['AssignmentDate'])) $this->AssignmentDate = JsonConverters::from('DateTime', $o['AssignmentDate']);
if (isset($o['CompletionDate'])) $this->CompletionDate = JsonConverters::from('DateTime', $o['CompletionDate']);
if (isset($o['NumberOfComments'])) $this->NumberOfComments = $o['NumberOfComments'];
if (isset($o['ExtraField'])) $this->ExtraField = $o['ExtraField'];
if (isset($o['HasPreview'])) $this->HasPreview = $o['HasPreview'];
if (isset($o['Extension'])) $this->Extension = $o['Extension'];
if (isset($o['IsInformative'])) $this->IsInformative = $o['IsInformative'];
if (isset($o['HasPendingSideSteps'])) $this->HasPendingSideSteps = $o['HasPendingSideSteps'];
if (isset($o['Actions'])) $this->Actions = JsonConverters::fromArray('WorkflowTaskAction', $o['Actions']);
if (isset($o['CanAccept'])) $this->CanAccept = $o['CanAccept'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ID)) $o['ID'] = $this->ID;
if (isset($this->DocumentID)) $o['DocumentID'] = $this->DocumentID;
if (isset($this->Title)) $o['Title'] = $this->Title;
if (isset($this->Description)) $o['Description'] = $this->Description;
if (isset($this->ContextTitle)) $o['ContextTitle'] = $this->ContextTitle;
if (isset($this->Project)) $o['Project'] = $this->Project;
if (isset($this->Relation)) $o['Relation'] = $this->Relation;
if (isset($this->ImageKey)) $o['ImageKey'] = $this->ImageKey;
if (isset($this->Urgent)) $o['Urgent'] = $this->Urgent;
if (isset($this->IsRead)) $o['IsRead'] = $this->IsRead;
if (isset($this->AssignmentDate)) $o['AssignmentDate'] = JsonConverters::to('DateTime', $this->AssignmentDate);
if (isset($this->CompletionDate)) $o['CompletionDate'] = JsonConverters::to('DateTime', $this->CompletionDate);
if (isset($this->NumberOfComments)) $o['NumberOfComments'] = $this->NumberOfComments;
if (isset($this->ExtraField)) $o['ExtraField'] = $this->ExtraField;
if (isset($this->HasPreview)) $o['HasPreview'] = $this->HasPreview;
if (isset($this->Extension)) $o['Extension'] = $this->Extension;
if (isset($this->IsInformative)) $o['IsInformative'] = $this->IsInformative;
if (isset($this->HasPendingSideSteps)) $o['HasPendingSideSteps'] = $this->HasPendingSideSteps;
if (isset($this->Actions)) $o['Actions'] = JsonConverters::toArray('WorkflowTaskAction', $this->Actions);
if (isset($this->CanAccept)) $o['CanAccept'] = $this->CanAccept;
return empty($o) ? new class(){} : $o;
}
}
class GetWorkflowTask implements IHasVersion, JsonSerializable
{
public function __construct(
/** @var int */
public int $ID=0,
/** @var int */
public int $Version=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ID'])) $this->ID = $o['ID'];
if (isset($o['Version'])) $this->Version = $o['Version'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ID)) $o['ID'] = $this->ID;
if (isset($this->Version)) $o['Version'] = $this->Version;
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /jsonl/reply/GetWorkflowTask HTTP/1.1
Host: dogw.klokgroep.nl
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"ID":0,"Version":0}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"ID":0,"DocumentID":"00000000-0000-0000-0000-000000000000","Title":"String","Description":"String","ContextTitle":"String","Project":"String","Relation":"String","ImageKey":"String","Urgent":false,"IsRead":false,"AssignmentDate":"0001-01-01T00:00:00.0000000","CompletionDate":"0001-01-01T00:00:00.0000000","NumberOfComments":0,"ExtraField":"String","HasPreview":false,"Extension":"String","IsInformative":false,"HasPendingSideSteps":false,"Actions":[{"ID":0,"Title":"String","Type":"String","UseDialog":false,"ConnectionID":"00000000-0000-0000-0000-000000000000"}],"CanAccept":false}