<?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 Document implements ICustomProperties, JsonSerializable
{
public function __construct(
/** @var string */
public string $ID='',
/** @var string */
public string $RootDocumentID='',
/** @var string */
public string $RegistrationprofileID='',
/** @var string|null */
public ?string $Title=null,
/** @var string|null */
public ?string $FullTitle=null,
/** @var string|null */
public ?string $Number=null,
/** @var string|null */
public ?string $Version=null,
/** @var string|null */
public ?string $ExternalNumber=null,
/** @var string|null */
public ?string $ExternalVersion=null,
/** @var string|null */
public ?string $InternalNumber=null,
/** @var string|null */
public ?string $InternalInvoiceNumber=null,
/** @var int */
public int $PersonID=0,
/** @var int */
public int $RelationID=0,
/** @var string|null */
public ?string $RelationTitle=null,
/** @var int */
public int $ProjectID=0,
/** @var string|null */
public ?string $ProjectTitle=null,
/** @var string|null */
public ?string $Extension=null,
/** @var DateTime|null */
public ?DateTime $Date=null,
/** @var int */
public int $CommentsCount=0,
/** @var bool|null */
public ?bool $HasComments=null,
/** @var bool|null */
public ?bool $HasPreview=null,
/** @var string|null */
public ?string $ExtraField=null,
/** @var bool|null */
public ?bool $IsFavorite=null,
/** @var string|null */
public ?string $DocumentcategoryText=null,
/** @var int|null */
public ?int $FileSize=null,
/** @var DateTime|null */
public ?DateTime $FileDate=null,
/** @var string|null */
public ?string $Hash=null,
/** @var string|null */
public ?string $HashType=null,
/** @var string|null */
public ?string $FileUrl=null,
/** @var string|null */
public ?string $StandardDocumentUrl=null,
/** @var bool|null */
public ?bool $IsCorporateIdentity=null,
/** @var string|null */
public ?string $UserTitle=null,
/** @var bool|null */
public ?bool $IsFrozen=null,
/** @var int */
public int $InternalCompanyID=0,
/** @var int|null */
public ?int $InternalLocationID=null,
/** @var int|null */
public ?int $LanguageID=null,
/** @var string|null */
public ?string $DirectUrl=null,
/** @var bool|null */
public ?bool $AllowDigitalSigningOnlyOnPrimaryVersions=null,
/** @var bool|null */
public ?bool $IsPrimaryVersion=null,
/** @var string|null */
public ?string $FileExtension=null,
/** @var array<string,Object>|null */
public ?array $CustomProperties=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ID'])) $this->ID = $o['ID'];
if (isset($o['RootDocumentID'])) $this->RootDocumentID = $o['RootDocumentID'];
if (isset($o['RegistrationprofileID'])) $this->RegistrationprofileID = $o['RegistrationprofileID'];
if (isset($o['Title'])) $this->Title = $o['Title'];
if (isset($o['FullTitle'])) $this->FullTitle = $o['FullTitle'];
if (isset($o['Number'])) $this->Number = $o['Number'];
if (isset($o['Version'])) $this->Version = $o['Version'];
if (isset($o['ExternalNumber'])) $this->ExternalNumber = $o['ExternalNumber'];
if (isset($o['ExternalVersion'])) $this->ExternalVersion = $o['ExternalVersion'];
if (isset($o['InternalNumber'])) $this->InternalNumber = $o['InternalNumber'];
if (isset($o['InternalInvoiceNumber'])) $this->InternalInvoiceNumber = $o['InternalInvoiceNumber'];
if (isset($o['PersonID'])) $this->PersonID = $o['PersonID'];
if (isset($o['RelationID'])) $this->RelationID = $o['RelationID'];
if (isset($o['RelationTitle'])) $this->RelationTitle = $o['RelationTitle'];
if (isset($o['ProjectID'])) $this->ProjectID = $o['ProjectID'];
if (isset($o['ProjectTitle'])) $this->ProjectTitle = $o['ProjectTitle'];
if (isset($o['Extension'])) $this->Extension = $o['Extension'];
if (isset($o['Date'])) $this->Date = JsonConverters::from('DateTime', $o['Date']);
if (isset($o['CommentsCount'])) $this->CommentsCount = $o['CommentsCount'];
if (isset($o['HasComments'])) $this->HasComments = $o['HasComments'];
if (isset($o['HasPreview'])) $this->HasPreview = $o['HasPreview'];
if (isset($o['ExtraField'])) $this->ExtraField = $o['ExtraField'];
if (isset($o['IsFavorite'])) $this->IsFavorite = $o['IsFavorite'];
if (isset($o['DocumentcategoryText'])) $this->DocumentcategoryText = $o['DocumentcategoryText'];
if (isset($o['FileSize'])) $this->FileSize = $o['FileSize'];
if (isset($o['FileDate'])) $this->FileDate = JsonConverters::from('DateTime', $o['FileDate']);
if (isset($o['Hash'])) $this->Hash = $o['Hash'];
if (isset($o['HashType'])) $this->HashType = $o['HashType'];
if (isset($o['FileUrl'])) $this->FileUrl = $o['FileUrl'];
if (isset($o['StandardDocumentUrl'])) $this->StandardDocumentUrl = $o['StandardDocumentUrl'];
if (isset($o['IsCorporateIdentity'])) $this->IsCorporateIdentity = $o['IsCorporateIdentity'];
if (isset($o['UserTitle'])) $this->UserTitle = $o['UserTitle'];
if (isset($o['IsFrozen'])) $this->IsFrozen = $o['IsFrozen'];
if (isset($o['InternalCompanyID'])) $this->InternalCompanyID = $o['InternalCompanyID'];
if (isset($o['InternalLocationID'])) $this->InternalLocationID = $o['InternalLocationID'];
if (isset($o['LanguageID'])) $this->LanguageID = $o['LanguageID'];
if (isset($o['DirectUrl'])) $this->DirectUrl = $o['DirectUrl'];
if (isset($o['AllowDigitalSigningOnlyOnPrimaryVersions'])) $this->AllowDigitalSigningOnlyOnPrimaryVersions = $o['AllowDigitalSigningOnlyOnPrimaryVersions'];
if (isset($o['IsPrimaryVersion'])) $this->IsPrimaryVersion = $o['IsPrimaryVersion'];
if (isset($o['FileExtension'])) $this->FileExtension = $o['FileExtension'];
if (isset($o['CustomProperties'])) $this->CustomProperties = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','Object']), $o['CustomProperties']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ID)) $o['ID'] = $this->ID;
if (isset($this->RootDocumentID)) $o['RootDocumentID'] = $this->RootDocumentID;
if (isset($this->RegistrationprofileID)) $o['RegistrationprofileID'] = $this->RegistrationprofileID;
if (isset($this->Title)) $o['Title'] = $this->Title;
if (isset($this->FullTitle)) $o['FullTitle'] = $this->FullTitle;
if (isset($this->Number)) $o['Number'] = $this->Number;
if (isset($this->Version)) $o['Version'] = $this->Version;
if (isset($this->ExternalNumber)) $o['ExternalNumber'] = $this->ExternalNumber;
if (isset($this->ExternalVersion)) $o['ExternalVersion'] = $this->ExternalVersion;
if (isset($this->InternalNumber)) $o['InternalNumber'] = $this->InternalNumber;
if (isset($this->InternalInvoiceNumber)) $o['InternalInvoiceNumber'] = $this->InternalInvoiceNumber;
if (isset($this->PersonID)) $o['PersonID'] = $this->PersonID;
if (isset($this->RelationID)) $o['RelationID'] = $this->RelationID;
if (isset($this->RelationTitle)) $o['RelationTitle'] = $this->RelationTitle;
if (isset($this->ProjectID)) $o['ProjectID'] = $this->ProjectID;
if (isset($this->ProjectTitle)) $o['ProjectTitle'] = $this->ProjectTitle;
if (isset($this->Extension)) $o['Extension'] = $this->Extension;
if (isset($this->Date)) $o['Date'] = JsonConverters::to('DateTime', $this->Date);
if (isset($this->CommentsCount)) $o['CommentsCount'] = $this->CommentsCount;
if (isset($this->HasComments)) $o['HasComments'] = $this->HasComments;
if (isset($this->HasPreview)) $o['HasPreview'] = $this->HasPreview;
if (isset($this->ExtraField)) $o['ExtraField'] = $this->ExtraField;
if (isset($this->IsFavorite)) $o['IsFavorite'] = $this->IsFavorite;
if (isset($this->DocumentcategoryText)) $o['DocumentcategoryText'] = $this->DocumentcategoryText;
if (isset($this->FileSize)) $o['FileSize'] = $this->FileSize;
if (isset($this->FileDate)) $o['FileDate'] = JsonConverters::to('DateTime', $this->FileDate);
if (isset($this->Hash)) $o['Hash'] = $this->Hash;
if (isset($this->HashType)) $o['HashType'] = $this->HashType;
if (isset($this->FileUrl)) $o['FileUrl'] = $this->FileUrl;
if (isset($this->StandardDocumentUrl)) $o['StandardDocumentUrl'] = $this->StandardDocumentUrl;
if (isset($this->IsCorporateIdentity)) $o['IsCorporateIdentity'] = $this->IsCorporateIdentity;
if (isset($this->UserTitle)) $o['UserTitle'] = $this->UserTitle;
if (isset($this->IsFrozen)) $o['IsFrozen'] = $this->IsFrozen;
if (isset($this->InternalCompanyID)) $o['InternalCompanyID'] = $this->InternalCompanyID;
if (isset($this->InternalLocationID)) $o['InternalLocationID'] = $this->InternalLocationID;
if (isset($this->LanguageID)) $o['LanguageID'] = $this->LanguageID;
if (isset($this->DirectUrl)) $o['DirectUrl'] = $this->DirectUrl;
if (isset($this->AllowDigitalSigningOnlyOnPrimaryVersions)) $o['AllowDigitalSigningOnlyOnPrimaryVersions'] = $this->AllowDigitalSigningOnlyOnPrimaryVersions;
if (isset($this->IsPrimaryVersion)) $o['IsPrimaryVersion'] = $this->IsPrimaryVersion;
if (isset($this->FileExtension)) $o['FileExtension'] = $this->FileExtension;
if (isset($this->CustomProperties)) $o['CustomProperties'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','Object']), $this->CustomProperties);
return empty($o) ? new class(){} : $o;
}
}
class GetDocumentByMessageQueueId implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $MessageQueueId=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['MessageQueueId'])) $this->MessageQueueId = $o['MessageQueueId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->MessageQueueId)) $o['MessageQueueId'] = $this->MessageQueueId;
return empty($o) ? new class(){} : $o;
}
}
PHP GetDocumentByMessageQueueId 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/GetDocumentByMessageQueueId HTTP/1.1
Host: test-do-services.klokgroep.nl
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<GetDocumentByMessageQueueId xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.Document.Operations">
<MessageQueueId>String</MessageQueueId>
</GetDocumentByMessageQueueId>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<Document xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.Document">
<AllowDigitalSigningOnlyOnPrimaryVersions>false</AllowDigitalSigningOnlyOnPrimaryVersions>
<CommentsCount>0</CommentsCount>
<CustomProperties xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:KeyValueOfstringanyType>
<d2p1:Key>String</d2p1:Key>
<d2p1:Value />
</d2p1:KeyValueOfstringanyType>
</CustomProperties>
<Date>0001-01-01T00:00:00</Date>
<DirectUrl>String</DirectUrl>
<DocumentcategoryText>String</DocumentcategoryText>
<Extension>String</Extension>
<ExternalNumber>String</ExternalNumber>
<ExternalVersion>String</ExternalVersion>
<ExtraField>String</ExtraField>
<FileDate>0001-01-01T00:00:00</FileDate>
<FileExtension>String</FileExtension>
<FileSize>0</FileSize>
<FileUrl>String</FileUrl>
<FullTitle>String</FullTitle>
<HasPreview>false</HasPreview>
<Hash>String</Hash>
<HashType>String</HashType>
<ID>00000000-0000-0000-0000-000000000000</ID>
<InternalCompanyID>0</InternalCompanyID>
<InternalInvoiceNumber>String</InternalInvoiceNumber>
<InternalLocationID>0</InternalLocationID>
<InternalNumber>String</InternalNumber>
<IsCorporateIdentity>false</IsCorporateIdentity>
<IsFavorite>false</IsFavorite>
<IsFrozen>false</IsFrozen>
<IsPrimaryVersion>false</IsPrimaryVersion>
<LanguageID>0</LanguageID>
<Number>String</Number>
<PersonID>0</PersonID>
<ProjectID>0</ProjectID>
<ProjectTitle>String</ProjectTitle>
<RegistrationprofileID>00000000-0000-0000-0000-000000000000</RegistrationprofileID>
<RelationID>0</RelationID>
<RelationTitle>String</RelationTitle>
<RootDocumentID>00000000-0000-0000-0000-000000000000</RootDocumentID>
<StandardDocumentUrl>String</StandardDocumentUrl>
<Title>String</Title>
<UserTitle>String</UserTitle>
<Version>String</Version>
</Document>