MicroApp API

<back to all web services

GetCurrentMicroAppRequest

The following routes are available for this service:
All Verbs/current/{Key}/{TenantKey}
<?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 GetCurrentMicroAppRequest implements IHasTenantKey, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $key=null,
        /** @var string|null */
        public ?string $tenantKey=null
    ) {
    }

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

class MicroApp implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $id=0,
        /** @var string|null */
        public ?string $name=null,
        /** @var string|null */
        public ?string $key=null,
        /** @var int */
        public int $version=0,
        /** @var bool|null */
        public ?bool $current=null,
        /** @var bool|null */
        public ?bool $production=null,
        // @Ignore()
        /** @var string|null */
        public ?string $manifestUrl=null,

        // @Ignore()
        /** @var string|null */
        public ?string $url=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['key'])) $this->key = $o['key'];
        if (isset($o['version'])) $this->version = $o['version'];
        if (isset($o['current'])) $this->current = $o['current'];
        if (isset($o['production'])) $this->production = $o['production'];
        if (isset($o['manifestUrl'])) $this->manifestUrl = $o['manifestUrl'];
        if (isset($o['url'])) $this->url = $o['url'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->key)) $o['key'] = $this->key;
        if (isset($this->version)) $o['version'] = $this->version;
        if (isset($this->current)) $o['current'] = $this->current;
        if (isset($this->production)) $o['production'] = $this->production;
        if (isset($this->manifestUrl)) $o['manifestUrl'] = $this->manifestUrl;
        if (isset($this->url)) $o['url'] = $this->url;
        return empty($o) ? new class(){} : $o;
    }
}

PHP GetCurrentMicroAppRequest 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.

POST /current/{Key}/{TenantKey} HTTP/1.1 
Host: apps.harbourassist.com 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"key":"String","tenantKey":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"id":0,"name":"String","key":"String","version":0,"current":false,"production":false,"manifestUrl":"String/manifest.json","url":"String"}