DigiOffice API Services Services

<back to all web services

FileExists

Requires Authentication
<?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 FileExistsResponse implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Exists=null,
        /** @var string|null */
        public ?string $Url=null,
        /** @var string|null */
        public ?string $FileID=null,
        /** @var string|null */
        public ?string $DocumentID=null,
        /** @var int|null */
        public ?int $DocumentQueuedForRegistrationID=null
    ) {
    }

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

class FileExists implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Url=null
    ) {
    }

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

PHP FileExists DTOs

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

HTTP + CSV

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

POST /csv/reply/FileExists HTTP/1.1 
Host: test-do-services.klokgroep.nl 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"Url":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"Exists":false,"Url":"String","FileID":"00000000-0000-0000-0000-000000000000","DocumentID":"00000000-0000-0000-0000-000000000000","DocumentQueuedForRegistrationID":0}