DigiOffice Gateway Web Services

<back to all web services

AddDocumentsForBackgroundRegistration

Register documents queueud for registration in background

Requires Authentication
The following routes are available for this service:
POST/api/documentuploads/registerdocuments
<?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 RegisteredDocumentUpload implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $DocumentUploadID=0,
        /** @var bool|null */
        public ?bool $IsSuccess=null,
        /** @var string|null */
        public ?string $Message=null
    ) {
    }

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

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

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

class RegistrationValue implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $Key='',
        /** @var string|null */
        public ?string $Value=null,
        /** @var string|null */
        public ?string $ShadowValue=null
    ) {
    }

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

class Transition implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $ID='',
        /** @var string|null */
        public ?string $Reason=null,
        /** @var DateTime|null */
        public ?DateTime $DelayDate=null,
        /** @var string|null */
        public ?string $DelayReason=null,
        /** @var array<int>|null */
        public ?array $UserIDs=null,
        /** @var array<int>|null */
        public ?array $GroupIDs=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ID'])) $this->ID = $o['ID'];
        if (isset($o['Reason'])) $this->Reason = $o['Reason'];
        if (isset($o['DelayDate'])) $this->DelayDate = JsonConverters::from('DateTime', $o['DelayDate']);
        if (isset($o['DelayReason'])) $this->DelayReason = $o['DelayReason'];
        if (isset($o['UserIDs'])) $this->UserIDs = JsonConverters::fromArray('int', $o['UserIDs']);
        if (isset($o['GroupIDs'])) $this->GroupIDs = JsonConverters::fromArray('int', $o['GroupIDs']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ID)) $o['ID'] = $this->ID;
        if (isset($this->Reason)) $o['Reason'] = $this->Reason;
        if (isset($this->DelayDate)) $o['DelayDate'] = JsonConverters::to('DateTime', $this->DelayDate);
        if (isset($this->DelayReason)) $o['DelayReason'] = $this->DelayReason;
        if (isset($this->UserIDs)) $o['UserIDs'] = JsonConverters::toArray('int', $this->UserIDs);
        if (isset($this->GroupIDs)) $o['GroupIDs'] = JsonConverters::toArray('int', $this->GroupIDs);
        return empty($o) ? new class(){} : $o;
    }
}

class Process implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ID=0,
        /** @var string|null */
        public ?string $Title=null,
        /** @var string|null */
        public ?string $Description=null,
        /** @var string|null */
        public ?string $Note=null,
        /** @var string|null */
        public ?string $Coordinator=null,
        /** @var bool|null */
        public ?bool $Urgent=null,
        /** @var array<Transition>|null */
        public ?array $Transitions=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['Description'])) $this->Description = $o['Description'];
        if (isset($o['Note'])) $this->Note = $o['Note'];
        if (isset($o['Coordinator'])) $this->Coordinator = $o['Coordinator'];
        if (isset($o['Urgent'])) $this->Urgent = $o['Urgent'];
        if (isset($o['Transitions'])) $this->Transitions = JsonConverters::fromArray('Transition', $o['Transitions']);
    }
    
    /** @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->Description)) $o['Description'] = $this->Description;
        if (isset($this->Note)) $o['Note'] = $this->Note;
        if (isset($this->Coordinator)) $o['Coordinator'] = $this->Coordinator;
        if (isset($this->Urgent)) $o['Urgent'] = $this->Urgent;
        if (isset($this->Transitions)) $o['Transitions'] = JsonConverters::toArray('Transition', $this->Transitions);
        return empty($o) ? new class(){} : $o;
    }
}

class RegisterDocument implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $RegistrationProfileID='',
        /** @var array<RegistrationValue>|null */
        public ?array $Values=null,
        /** @var array<Process>|null */
        public ?array $Processes=null,
        /** @var string|null */
        public ?string $DocumentUploadId=null,
        /** @var string|null */
        public ?string $DocumentId=null,
        /** @var string|null */
        public ?string $StandardDocumentID=null,
        /** @var bool|null */
        public ?bool $HasUnsavedChangesInDocument=null,
        /** @var bool|null */
        public ?bool $IsOpenedFromNonDMSLocation=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['RegistrationProfileID'])) $this->RegistrationProfileID = $o['RegistrationProfileID'];
        if (isset($o['Values'])) $this->Values = JsonConverters::fromArray('RegistrationValue', $o['Values']);
        if (isset($o['Processes'])) $this->Processes = JsonConverters::fromArray('Process', $o['Processes']);
        if (isset($o['DocumentUploadId'])) $this->DocumentUploadId = $o['DocumentUploadId'];
        if (isset($o['DocumentId'])) $this->DocumentId = $o['DocumentId'];
        if (isset($o['StandardDocumentID'])) $this->StandardDocumentID = $o['StandardDocumentID'];
        if (isset($o['HasUnsavedChangesInDocument'])) $this->HasUnsavedChangesInDocument = $o['HasUnsavedChangesInDocument'];
        if (isset($o['IsOpenedFromNonDMSLocation'])) $this->IsOpenedFromNonDMSLocation = $o['IsOpenedFromNonDMSLocation'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->RegistrationProfileID)) $o['RegistrationProfileID'] = $this->RegistrationProfileID;
        if (isset($this->Values)) $o['Values'] = JsonConverters::toArray('RegistrationValue', $this->Values);
        if (isset($this->Processes)) $o['Processes'] = JsonConverters::toArray('Process', $this->Processes);
        if (isset($this->DocumentUploadId)) $o['DocumentUploadId'] = $this->DocumentUploadId;
        if (isset($this->DocumentId)) $o['DocumentId'] = $this->DocumentId;
        if (isset($this->StandardDocumentID)) $o['StandardDocumentID'] = $this->StandardDocumentID;
        if (isset($this->HasUnsavedChangesInDocument)) $o['HasUnsavedChangesInDocument'] = $this->HasUnsavedChangesInDocument;
        if (isset($this->IsOpenedFromNonDMSLocation)) $o['IsOpenedFromNonDMSLocation'] = $this->IsOpenedFromNonDMSLocation;
        return empty($o) ? new class(){} : $o;
    }
}

/** @description Register documents queueud for registration in background */
// @Api(Description="Register documents queueud for registration in background")
// @ApiResponse(Description="All queued documents are linked to a systemtask for background processing", StatusCode=200)
class AddDocumentsForBackgroundRegistration implements JsonSerializable
{
    public function __construct(
        /** @description List of queued documents to register in background */
        // @ApiMember(Description="List of queued documents to register in background", IsRequired=true)
        /** @var array<RegisterDocument>|null */
        public ?array $Documents=null
    ) {
    }

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

PHP AddDocumentsForBackgroundRegistration 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.

POST /api/documentuploads/registerdocuments HTTP/1.1 
Host: test-dogw.klokgroep.nl 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"Documents":[{"RegistrationProfileID":"00000000-0000-0000-0000-000000000000","Values":[{"Key":"00000000-0000-0000-0000-000000000000","Value":"String","ShadowValue":"String"}],"Processes":[{"ID":0,"Title":"String","Description":"String","Note":"String","Coordinator":"String","Urgent":false,"Transitions":[{"ID":"00000000-0000-0000-0000-000000000000","Reason":"String","DelayDate":"0001-01-01T00:00:00.0000000","DelayReason":"String","UserIDs":[0],"GroupIDs":[0]}]}],"DocumentUploadId":"String","DocumentId":"00000000-0000-0000-0000-000000000000","StandardDocumentID":"00000000-0000-0000-0000-000000000000","HasUnsavedChangesInDocument":false,"IsOpenedFromNonDMSLocation":false}]}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"RegisteredDocumentUploads":[{"DocumentUploadID":0,"IsSuccess":false,"Message":"String"}]}