<?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 UserOrGroup implements JsonSerializable
{
public function __construct(
/** @var int */
public int $ID=0,
/** @var string|null */
public ?string $Title=null,
/** @var bool|null */
public ?bool $IsChecked=null,
/** @var string|null */
public ?string $Image=null
) {
}
/** @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['IsChecked'])) $this->IsChecked = $o['IsChecked'];
if (isset($o['Image'])) $this->Image = $o['Image'];
}
/** @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->IsChecked)) $o['IsChecked'] = $this->IsChecked;
if (isset($this->Image)) $o['Image'] = $this->Image;
return empty($o) ? new class(){} : $o;
}
}
class User extends UserOrGroup implements JsonSerializable
{
/**
* @param int $ID
* @param string|null $Title
* @param bool|null $IsChecked
* @param string|null $Image
*/
public function __construct(
int $ID=0,
?string $Title=null,
?bool $IsChecked=null,
?string $Image=null
) {
parent::__construct($ID,$Title,$IsChecked,$Image);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['Image'])) $this->Image = $o['Image'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->Image)) $o['Image'] = $this->Image;
return empty($o) ? new class(){} : $o;
}
}
class Group extends UserOrGroup implements JsonSerializable
{
/**
* @param int $ID
* @param string|null $Title
* @param bool|null $IsChecked
* @param string|null $Image
*/
public function __construct(
int $ID=0,
?string $Title=null,
?bool $IsChecked=null,
?string $Image=null
) {
parent::__construct($ID,$Title,$IsChecked,$Image);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['Image'])) $this->Image = $o['Image'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->Image)) $o['Image'] = $this->Image;
return empty($o) ? new class(){} : $o;
}
}
class WorkflowTaskDelay implements JsonSerializable
{
public function __construct(
/** @var DateTime|null */
public ?DateTime $DelayDate=null,
/** @var string|null */
public ?string $Reason=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['DelayDate'])) $this->DelayDate = JsonConverters::from('DateTime', $o['DelayDate']);
if (isset($o['Reason'])) $this->Reason = $o['Reason'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->DelayDate)) $o['DelayDate'] = JsonConverters::to('DateTime', $this->DelayDate);
if (isset($this->Reason)) $o['Reason'] = $this->Reason;
return empty($o) ? new class(){} : $o;
}
}
class WorkflowTaskReason implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Reason=null,
/** @var bool|null */
public ?bool $Required=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Reason'])) $this->Reason = $o['Reason'];
if (isset($o['Required'])) $this->Required = $o['Required'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Reason)) $o['Reason'] = $this->Reason;
if (isset($this->Required)) $o['Required'] = $this->Required;
return empty($o) ? new class(){} : $o;
}
}
class WorkflowTaskAdhocTransition implements JsonSerializable
{
public function __construct(
/** @var string */
public string $ID='',
/** @var string|null */
public ?string $Title=null,
/** @var bool|null */
public ?bool $AssignmentAllowed=null,
/** @var bool|null */
public ?bool $AssignmentRequired=null,
/** @var int */
public int $UserEnvironment=0,
/** @var array<User>|null */
public ?array $Users=null,
/** @var array<Group>|null */
public ?array $Groups=null,
/** @var WorkflowTaskDelay|null */
public ?WorkflowTaskDelay $Delay=null,
/** @var WorkflowTaskReason|null */
public ?WorkflowTaskReason $Reason=null,
/** @var array<UserOrGroup>|null */
public ?array $UsersOrGroups=null,
/** @var string|null */
public ?string $Value=null
) {
}
/** @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['AssignmentAllowed'])) $this->AssignmentAllowed = $o['AssignmentAllowed'];
if (isset($o['AssignmentRequired'])) $this->AssignmentRequired = $o['AssignmentRequired'];
if (isset($o['UserEnvironment'])) $this->UserEnvironment = $o['UserEnvironment'];
if (isset($o['Users'])) $this->Users = JsonConverters::fromArray('User', $o['Users']);
if (isset($o['Groups'])) $this->Groups = JsonConverters::fromArray('Group', $o['Groups']);
if (isset($o['Delay'])) $this->Delay = JsonConverters::from('WorkflowTaskDelay', $o['Delay']);
if (isset($o['Reason'])) $this->Reason = JsonConverters::from('WorkflowTaskReason', $o['Reason']);
if (isset($o['UsersOrGroups'])) $this->UsersOrGroups = JsonConverters::fromArray('UserOrGroup', $o['UsersOrGroups']);
if (isset($o['Value'])) $this->Value = $o['Value'];
}
/** @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->AssignmentAllowed)) $o['AssignmentAllowed'] = $this->AssignmentAllowed;
if (isset($this->AssignmentRequired)) $o['AssignmentRequired'] = $this->AssignmentRequired;
if (isset($this->UserEnvironment)) $o['UserEnvironment'] = $this->UserEnvironment;
if (isset($this->Users)) $o['Users'] = JsonConverters::toArray('User', $this->Users);
if (isset($this->Groups)) $o['Groups'] = JsonConverters::toArray('Group', $this->Groups);
if (isset($this->Delay)) $o['Delay'] = JsonConverters::to('WorkflowTaskDelay', $this->Delay);
if (isset($this->Reason)) $o['Reason'] = JsonConverters::to('WorkflowTaskReason', $this->Reason);
if (isset($this->UsersOrGroups)) $o['UsersOrGroups'] = JsonConverters::toArray('UserOrGroup', $this->UsersOrGroups);
if (isset($this->Value)) $o['Value'] = $this->Value;
return empty($o) ? new class(){} : $o;
}
}
class AdhocTransitionDetails implements JsonSerializable
{
public function __construct(
/** @var array<WorkflowTaskAdhocTransition>|null */
public ?array $AdhocTransitions=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['AdhocTransitions'])) $this->AdhocTransitions = JsonConverters::fromArray('WorkflowTaskAdhocTransition', $o['AdhocTransitions']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->AdhocTransitions)) $o['AdhocTransitions'] = JsonConverters::toArray('WorkflowTaskAdhocTransition', $this->AdhocTransitions);
return empty($o) ? new class(){} : $o;
}
}
class WorkflowTaskActionComment implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Comment=null,
/** @var bool|null */
public ?bool $Required=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Comment'])) $this->Comment = $o['Comment'];
if (isset($o['Required'])) $this->Required = $o['Required'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Comment)) $o['Comment'] = $this->Comment;
if (isset($this->Required)) $o['Required'] = $this->Required;
return empty($o) ? new class(){} : $o;
}
}
class WorkflowTaskActionDetails extends AdhocTransitionDetails implements JsonSerializable
{
/**
* @param array<WorkflowTaskAdhocTransition>|null $AdhocTransitions
*/
public function __construct(
?array $AdhocTransitions=null,
/** @var string|null */
public ?string $Title=null,
/** @var WorkflowTaskActionComment|null */
public ?WorkflowTaskActionComment $Comment=null,
/** @var WorkflowTaskReason|null */
public ?WorkflowTaskReason $Reason=null
) {
parent::__construct($AdhocTransitions);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['Title'])) $this->Title = $o['Title'];
if (isset($o['Comment'])) $this->Comment = JsonConverters::from('WorkflowTaskActionComment', $o['Comment']);
if (isset($o['Reason'])) $this->Reason = JsonConverters::from('WorkflowTaskReason', $o['Reason']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->Title)) $o['Title'] = $this->Title;
if (isset($this->Comment)) $o['Comment'] = JsonConverters::to('WorkflowTaskActionComment', $this->Comment);
if (isset($this->Reason)) $o['Reason'] = JsonConverters::to('WorkflowTaskReason', $this->Reason);
return empty($o) ? new class(){} : $o;
}
}
class SetWorkflowTaskFinished implements JsonSerializable
{
public function __construct(
/** @var int */
public int $ID=0,
/** @var string|null */
public ?string $ConnectionID=null,
/** @var WorkflowTaskActionDetails|null */
public ?WorkflowTaskActionDetails $Details=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ID'])) $this->ID = $o['ID'];
if (isset($o['ConnectionID'])) $this->ConnectionID = $o['ConnectionID'];
if (isset($o['Details'])) $this->Details = JsonConverters::from('WorkflowTaskActionDetails', $o['Details']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ID)) $o['ID'] = $this->ID;
if (isset($this->ConnectionID)) $o['ConnectionID'] = $this->ConnectionID;
if (isset($this->Details)) $o['Details'] = JsonConverters::to('WorkflowTaskActionDetails', $this->Details);
return empty($o) ? new class(){} : $o;
}
}
PHP SetWorkflowTaskFinished DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /json/oneway/SetWorkflowTaskFinished HTTP/1.1
Host: test-dogw.klokgroep.nl
Accept: application/json
Content-Type: application/json
Content-Length: length
{"ID":0,"ConnectionID":"00000000-0000-0000-0000-000000000000","Details":{"Title":"String","Comment":{"Comment":"String","Required":false},"Reason":{"Reason":"String","Required":false},"AdhocTransitions":[{"ID":"00000000-0000-0000-0000-000000000000","Title":"String","AssignmentAllowed":false,"AssignmentRequired":false,"UserEnvironment":0,"Users":[{"Image":"Icons/User","ID":0,"Title":"String","IsChecked":false}],"Groups":[{"Image":"Icons/Group","ID":0,"Title":"String","IsChecked":false}],"Delay":{"DelayDate":"0001-01-01T00:00:00.0000000","Reason":"String"},"Reason":{"Reason":"String","Required":false},"UsersOrGroups":[{"__type":"IDB.API.DTO.User, IDB.API.DTO","Image":"Icons/User","ID":0,"Title":"String","IsChecked":false},{"__type":"IDB.API.DTO.Group, IDB.API.DTO","Image":"Icons/Group","ID":0,"Title":"String","IsChecked":false}],"Value":"String\r\nString"}]}}