| POST | /api/documents/movetorecyclebin |
|---|
<?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};
/** @description Move document to the Recycle Bin */
// @Api(Description="Move document to the Recycle Bin")
// @ApiResponse(Description="Document is moved to recycle bin", StatusCode=204)
// @ApiResponse(Description="Unauthorized to read document", StatusCode=401)
// @ApiResponse(Description="Document not found", StatusCode=410)
// @ApiResponse(Description="Document is already in recycle bin, document is not newest version, user has no 'move to recycle bin' access or document is locked/checked out by a user", StatusCode=405)
class MoveDocumentToRecycleBin implements JsonSerializable
{
public function __construct(
/** @description ID of the document that must be moved to the recycle bin */
// @ApiMember(Description="ID of the document that must be moved to the recycle bin", IsRequired=true)
/** @var string */
public string $DocumentID='',
/** @description Reason for moving the document to the recyclebin */
// @ApiMember(Description="Reason for moving the document to the recyclebin")
/** @var string|null */
public ?string $Reason=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['DocumentID'])) $this->DocumentID = $o['DocumentID'];
if (isset($o['Reason'])) $this->Reason = $o['Reason'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->DocumentID)) $o['DocumentID'] = $this->DocumentID;
if (isset($this->Reason)) $o['Reason'] = $this->Reason;
return empty($o) ? new class(){} : $o;
}
}
PHP MoveDocumentToRecycleBin DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/documents/movetorecyclebin HTTP/1.1
Host: test-do-services.klokgroep.nl
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"DocumentID":"00000000-0000-0000-0000-000000000000","Reason":"String"}