All Verbs | /RestApi/Sitefinity/Analytics/GetUsers | ||
---|---|---|---|
All Verbs | /RestApi/GetAdministrators |
<?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 GetAdministratorsMessage implements JsonSerializable
{
public function __construct(
/** @var string */
public string $SiteId='',
/** @var int */
public int $Take=0,
/** @var int */
public int $Skip=0,
/** @var string|null */
public ?string $Provider=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['SiteId'])) $this->SiteId = $o['SiteId'];
if (isset($o['Take'])) $this->Take = $o['Take'];
if (isset($o['Skip'])) $this->Skip = $o['Skip'];
if (isset($o['Provider'])) $this->Provider = $o['Provider'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->SiteId)) $o['SiteId'] = $this->SiteId;
if (isset($this->Take)) $o['Take'] = $this->Take;
if (isset($this->Skip)) $o['Skip'] = $this->Skip;
if (isset($this->Provider)) $o['Provider'] = $this->Provider;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class AnalyticsUserNamePair implements JsonSerializable
{
public function __construct(
// @DataMember
/** @var string|null */
public ?string $Username=null,
// @DataMember
/** @var string|null */
public ?string $FullName=null,
// @DataMember
/** @var string|null */
public ?string $Role=null,
// @DataMember
/** @var bool|null */
public ?bool $IsAdmin=null,
// @DataMember
/** @var string */
public string $UserID='',
// @DataMember
/** @var string|null */
public ?string $Avatar=null,
// @DataMember
/** @var string|null */
public ?string $Provider=null,
// @DataMember
/** @var string|null */
public ?string $ExternalProviderName=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Username'])) $this->Username = $o['Username'];
if (isset($o['FullName'])) $this->FullName = $o['FullName'];
if (isset($o['Role'])) $this->Role = $o['Role'];
if (isset($o['IsAdmin'])) $this->IsAdmin = $o['IsAdmin'];
if (isset($o['UserID'])) $this->UserID = $o['UserID'];
if (isset($o['Avatar'])) $this->Avatar = $o['Avatar'];
if (isset($o['Provider'])) $this->Provider = $o['Provider'];
if (isset($o['ExternalProviderName'])) $this->ExternalProviderName = $o['ExternalProviderName'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Username)) $o['Username'] = $this->Username;
if (isset($this->FullName)) $o['FullName'] = $this->FullName;
if (isset($this->Role)) $o['Role'] = $this->Role;
if (isset($this->IsAdmin)) $o['IsAdmin'] = $this->IsAdmin;
if (isset($this->UserID)) $o['UserID'] = $this->UserID;
if (isset($this->Avatar)) $o['Avatar'] = $this->Avatar;
if (isset($this->Provider)) $o['Provider'] = $this->Provider;
if (isset($this->ExternalProviderName)) $o['ExternalProviderName'] = $this->ExternalProviderName;
return empty($o) ? new class(){} : $o;
}
}
class GetAdministratorsData implements JsonSerializable
{
public function __construct(
/** @var array<AnalyticsUserNamePair>|null */
public ?array $Users=null,
/** @var int */
public int $Total=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Users'])) $this->Users = JsonConverters::fromArray('AnalyticsUserNamePair', $o['Users']);
if (isset($o['Total'])) $this->Total = $o['Total'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Users)) $o['Users'] = JsonConverters::toArray('AnalyticsUserNamePair', $this->Users);
if (isset($this->Total)) $o['Total'] = $this->Total;
return empty($o) ? new class(){} : $o;
}
}
PHP GetAdministratorsMessage DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /RestApi/Sitefinity/Analytics/GetUsers HTTP/1.1
Host: www.asg.com.au
Accept: application/json
Content-Type: application/json
Content-Length: length
{"Take":0,"Skip":0,"Provider":"String"}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"Users":[{}],"Total":0}