MBMicrositeFooterService

<back to all web services

MicrositeDataRequest

The following routes are available for this service:
GET/links/
<?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 LinkData implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $LinkID=0,
        /** @var string|null */
        public ?string $LinkText=null,
        /** @var string|null */
        public ?string $LinkUrl=null
    ) {
    }

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

class Response implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Code=null,
        /** @var string|null */
        public ?string $Message=null
    ) {
    }

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

class MicrositeDataResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<LinkData>|null */
        public ?array $linkData=null,
        /** @var Response|null */
        public ?Response $Status=null
    ) {
    }

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

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

PHP MicrositeDataRequest 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 /links/ HTTP/1.1 
Host: webservices.mbukdatabase.co.uk 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"linkData":[{"LinkID":0,"LinkText":"String","LinkUrl":"String"}],"Status":{"Code":"String","Message":"String"}}