POST | /RestApi/recycle-bin/batch/restore |
---|
<?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 RestoreRecycleBinItems implements JsonSerializable
{
public function __construct(
/** @var string[]|null */
public ?array $Ids=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Ids'])) $this->Ids = JsonConverters::fromArray('string', $o['Ids']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Ids)) $o['Ids'] = JsonConverters::toArray('string', $this->Ids);
return empty($o) ? new class(){} : $o;
}
}
class ModalMessageProxy implements JsonSerializable
{
public function __construct(
/** @var bool|null */
public ?bool $IsRecoverable=null,
/** @var string|null */
public ?string $HeaderText=null,
/** @var string|null */
public ?string $BodyText=null,
/** @var string|null */
public ?string $ActionButtonText=null,
/** @var bool|null */
public ?bool $HasCancelButton=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['IsRecoverable'])) $this->IsRecoverable = $o['IsRecoverable'];
if (isset($o['HeaderText'])) $this->HeaderText = $o['HeaderText'];
if (isset($o['BodyText'])) $this->BodyText = $o['BodyText'];
if (isset($o['ActionButtonText'])) $this->ActionButtonText = $o['ActionButtonText'];
if (isset($o['HasCancelButton'])) $this->HasCancelButton = $o['HasCancelButton'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->IsRecoverable)) $o['IsRecoverable'] = $this->IsRecoverable;
if (isset($this->HeaderText)) $o['HeaderText'] = $this->HeaderText;
if (isset($this->BodyText)) $o['BodyText'] = $this->BodyText;
if (isset($this->ActionButtonText)) $o['ActionButtonText'] = $this->ActionButtonText;
if (isset($this->HasCancelButton)) $o['HasCancelButton'] = $this->HasCancelButton;
return empty($o) ? new class(){} : $o;
}
}
class BatchRestoreModalMessageProxy extends ModalMessageProxy implements JsonSerializable
{
/**
* @param bool|null $IsRecoverable
* @param string|null $HeaderText
* @param string|null $BodyText
* @param string|null $ActionButtonText
* @param bool|null $HasCancelButton
*/
public function __construct(
?bool $IsRecoverable=null,
?string $HeaderText=null,
?string $BodyText=null,
?string $ActionButtonText=null,
?bool $HasCancelButton=null,
/** @var string[]|null */
public ?array $InvalidItems=null
) {
parent::__construct($IsRecoverable,$HeaderText,$BodyText,$ActionButtonText,$HasCancelButton);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['InvalidItems'])) $this->InvalidItems = JsonConverters::fromArray('string', $o['InvalidItems']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->InvalidItems)) $o['InvalidItems'] = JsonConverters::toArray('string', $this->InvalidItems);
return empty($o) ? new class(){} : $o;
}
}
PHP RestoreRecycleBinItems DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /RestApi/recycle-bin/batch/restore HTTP/1.1
Host: www.asg.com.au
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"Ids":["00000000-0000-0000-0000-000000000000"]}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {Unable to show example output for type 'BatchRestoreModalMessageProxy' using the custom 'csv' filter}No parameterless constructor defined for this object.