<back to all web services

GetUncachedLibraries

The following routes are available for this service:
GET/RestApi/diagnostics/uncached-libraries
<?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 GetUncachedLibraries implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $CountOnly=null,
        /** @var int */
        public int $Skip=0,
        /** @var int */
        public int $Take=0,
        /** @var string */
        public string $SiteId=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['CountOnly'])) $this->CountOnly = $o['CountOnly'];
        if (isset($o['Skip'])) $this->Skip = $o['Skip'];
        if (isset($o['Take'])) $this->Take = $o['Take'];
        if (isset($o['SiteId'])) $this->SiteId = $o['SiteId'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->CountOnly)) $o['CountOnly'] = $this->CountOnly;
        if (isset($this->Skip)) $o['Skip'] = $this->Skip;
        if (isset($this->Take)) $o['Take'] = $this->Take;
        if (isset($this->SiteId)) $o['SiteId'] = $this->SiteId;
        return empty($o) ? new class(){} : $o;
    }
}

enum CacheProfileType : string
{
    case Client = 'Client';
    case Server = 'Server';
    case Both = 'Both';
}

class MediaLibraryProxy implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Title=null,
        /** @var string|null */
        public ?string $LibraryType=null,
        /** @var CacheProfileType|null */
        public ?CacheProfileType $CacheProfileType=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Title'])) $this->Title = $o['Title'];
        if (isset($o['LibraryType'])) $this->LibraryType = $o['LibraryType'];
        if (isset($o['CacheProfileType'])) $this->CacheProfileType = JsonConverters::from('CacheProfileType', $o['CacheProfileType']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Title)) $o['Title'] = $this->Title;
        if (isset($this->LibraryType)) $o['LibraryType'] = $this->LibraryType;
        if (isset($this->CacheProfileType)) $o['CacheProfileType'] = JsonConverters::to('CacheProfileType', $this->CacheProfileType);
        return empty($o) ? new class(){} : $o;
    }
}

class UncachedLibrariesProxy implements JsonSerializable
{
    public function __construct(
        /** @var array<MediaLibraryProxy>|null */
        public ?array $NotCachedLibraries=null,
        /** @var int */
        public int $CountAllSites=0,
        /** @var int */
        public int $CountCurrentSite=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['NotCachedLibraries'])) $this->NotCachedLibraries = JsonConverters::fromArray('MediaLibraryProxy', $o['NotCachedLibraries']);
        if (isset($o['CountAllSites'])) $this->CountAllSites = $o['CountAllSites'];
        if (isset($o['CountCurrentSite'])) $this->CountCurrentSite = $o['CountCurrentSite'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->NotCachedLibraries)) $o['NotCachedLibraries'] = JsonConverters::toArray('MediaLibraryProxy', $this->NotCachedLibraries);
        if (isset($this->CountAllSites)) $o['CountAllSites'] = $this->CountAllSites;
        if (isset($this->CountCurrentSite)) $o['CountCurrentSite'] = $this->CountCurrentSite;
        return empty($o) ? new class(){} : $o;
    }
}

PHP GetUncachedLibraries DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /RestApi/diagnostics/uncached-libraries HTTP/1.1 
Host: www.asg.com.au 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"NotCachedLibraries":[{"Title":"String","LibraryType":"String","CacheProfileType":"Client"}],"CountAllSites":0,"CountCurrentSite":0}