| POST | /api/documentuploads |
|---|
<?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 DocumentQueuedForRegistration implements JsonSerializable
{
public function __construct(
/** @var int */
public int $DocumentuploadID=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['DocumentuploadID'])) $this->DocumentuploadID = $o['DocumentuploadID'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->DocumentuploadID)) $o['DocumentuploadID'] = $this->DocumentuploadID;
return empty($o) ? new class(){} : $o;
}
}
class AddFileDocumentQueuedForRegistration implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Note=null,
/** @var string|null */
public ?string $Description=null,
/** @var string|null */
public ?string $UploadOrigin=null,
/** @var int|null */
public ?int $AssignToUserID=null,
/** @var int|null */
public ?int $AssignToGroupID=null,
/** @var string|null */
public ?string $DocumentInfo=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Note'])) $this->Note = $o['Note'];
if (isset($o['Description'])) $this->Description = $o['Description'];
if (isset($o['UploadOrigin'])) $this->UploadOrigin = $o['UploadOrigin'];
if (isset($o['AssignToUserID'])) $this->AssignToUserID = $o['AssignToUserID'];
if (isset($o['AssignToGroupID'])) $this->AssignToGroupID = $o['AssignToGroupID'];
if (isset($o['DocumentInfo'])) $this->DocumentInfo = $o['DocumentInfo'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Note)) $o['Note'] = $this->Note;
if (isset($this->Description)) $o['Description'] = $this->Description;
if (isset($this->UploadOrigin)) $o['UploadOrigin'] = $this->UploadOrigin;
if (isset($this->AssignToUserID)) $o['AssignToUserID'] = $this->AssignToUserID;
if (isset($this->AssignToGroupID)) $o['AssignToGroupID'] = $this->AssignToGroupID;
if (isset($this->DocumentInfo)) $o['DocumentInfo'] = $this->DocumentInfo;
return empty($o) ? new class(){} : $o;
}
}
PHP AddFileDocumentQueuedForRegistration 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 /api/documentuploads HTTP/1.1
Host: test-dogw.klokgroep.nl
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<AddFileDocumentQueuedForRegistration xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.Document.Operations">
<AssignToGroupID>0</AssignToGroupID>
<AssignToUserID>0</AssignToUserID>
<Description>String</Description>
<DocumentInfo>String</DocumentInfo>
<Note>String</Note>
<UploadOrigin>String</UploadOrigin>
</AddFileDocumentQueuedForRegistration>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <DocumentQueuedForRegistration xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.Document"> <DocumentuploadID>0</DocumentuploadID> </DocumentQueuedForRegistration>