BokaMera.API.Host

<back to all web services

ApiVersionQuery

The following routes are available for this service:
GET/versionGet information about this API's version and buildReturns information about which version of the API is currently running and when it was built.
<?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 ApiVersionQueryResponse implements JsonSerializable
{
    public function __construct(
        /** @description Timestamp when this API was built */
        /** @var DateTime */
        public DateTime $BuildTime=new DateTime(),
        /** @description The revision id from which the API was built */
        /** @var string|null */
        public ?string $Sha=null,
        /** @description Full version information regarding the current running assemblies of the api */
        /** @var string|null */
        public ?string $InformationalVersion=null,
        /** @description The semantic version number of the current running api version, see www.semver.org for more information */
        /** @var string|null */
        public ?string $SemVer=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

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

class ApiVersionQuery implements JsonSerializable
{
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        return empty($o) ? new class(){} : $o;
    }
}

PHP ApiVersionQuery DTOs

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

HTTP + OTHER

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

GET /version HTTP/1.1 
Host: testapi.bokamera.se 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"Sha":"String","InformationalVersion":"String","SemVer":"String","ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}