Required role: | REGISUserRole |
POST | /Directory/Browse/{page} |
---|
<?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 DirectoryPersonBrowseResponse implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $directory_uuid=null,
/** @var string|null */
public ?string $imageBase64=null,
/** @var string|null */
public ?string $name=null,
/** @var bool|null */
public ?bool $is_active=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['directory_uuid'])) $this->directory_uuid = $o['directory_uuid'];
if (isset($o['imageBase64'])) $this->imageBase64 = $o['imageBase64'];
if (isset($o['name'])) $this->name = $o['name'];
if (isset($o['is_active'])) $this->is_active = $o['is_active'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->directory_uuid)) $o['directory_uuid'] = $this->directory_uuid;
if (isset($this->imageBase64)) $o['imageBase64'] = $this->imageBase64;
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->is_active)) $o['is_active'] = $this->is_active;
return empty($o) ? new class(){} : $o;
}
}
class DirectoryBrowseResponse implements JsonSerializable
{
public function __construct(
/** @var array<DirectoryPersonBrowseResponse>|null */
public ?array $persons=null,
/** @var int */
public int $total_items=0,
/** @var int */
public int $current_page=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['persons'])) $this->persons = JsonConverters::fromArray('DirectoryPersonBrowseResponse', $o['persons']);
if (isset($o['total_items'])) $this->total_items = $o['total_items'];
if (isset($o['current_page'])) $this->current_page = $o['current_page'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->persons)) $o['persons'] = JsonConverters::toArray('DirectoryPersonBrowseResponse', $this->persons);
if (isset($this->total_items)) $o['total_items'] = $this->total_items;
if (isset($this->current_page)) $o['current_page'] = $this->current_page;
return empty($o) ? new class(){} : $o;
}
}
class DirectoryBrowseRequest implements JsonSerializable
{
public function __construct(
/** @var int */
public int $page=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['page'])) $this->page = $o['page'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->page)) $o['page'] = $this->page;
return empty($o) ? new class(){} : $o;
}
}
PHP DirectoryBrowseRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /Directory/Browse/{page} HTTP/1.1
Host: data.regent-college.edu
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
page: 0
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { persons: [ { directory_uuid: String, imageBase64: String, name: String, is_active: False } ], total_items: 0, current_page: 0 }