BokaMera.API.Host

<back to all web services

UpdateHomepageMenu

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
PUT/homepage/menuUpdate the homepage menuUpdate the homepage menu on the company of the currently logged in user, only administrators are allowed to update homepage menu.
<?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 HomepageMenuQueryResponse implements JsonSerializable
{
    public function __construct(
        /** @description The company id */
        // @ApiMember(Description="The company id")
        /** @var string */
        public string $CompanyId='',

        /** @description The text for home menu item */
        // @ApiMember(Description="The text for home menu item")
        /** @var string|null */
        public ?string $HomeText=null,

        /** @description If the home menu item should be hidden */
        // @ApiMember(Description="If the home menu item should be hidden")
        /** @var bool|null */
        public ?bool $HomeHidden=null,

        /** @description The text for services menu item */
        // @ApiMember(Description="The text for services menu item")
        /** @var string|null */
        public ?string $ServicesText=null,

        /** @description If the services menu item should be hidden */
        // @ApiMember(Description="If the services menu item should be hidden")
        /** @var bool|null */
        public ?bool $ServicesHidden=null,

        /** @description The text for book time menu item */
        // @ApiMember(Description="The text for book time menu item")
        /** @var string|null */
        public ?string $BookTimeText=null,

        /** @description If the book time menu item should be hidden */
        // @ApiMember(Description="If the book time menu item should be hidden")
        /** @var bool|null */
        public ?bool $BookTimeHidden=null,

        /** @description The text for about us menu item */
        // @ApiMember(Description="The text for about us menu item")
        /** @var string|null */
        public ?string $AboutUsText=null,

        /** @description If the about us menu item should be hidden */
        // @ApiMember(Description="If the about us menu item should be hidden")
        /** @var bool|null */
        public ?bool $AboutUsHidden=null,

        /** @description The text for contact us menu item */
        // @ApiMember(Description="The text for contact us menu item")
        /** @var string|null */
        public ?string $ContactUsText=null,

        /** @description If the contact us menu item should be hidden */
        // @ApiMember(Description="If the contact us menu item should be hidden")
        /** @var bool|null */
        public ?bool $ContactUsHidden=null,

        /** @description The text for my bookings menu item */
        // @ApiMember(Description="The text for my bookings menu item")
        /** @var string|null */
        public ?string $MyBookingsText=null,

        /** @description If the my bookings menu item should be hidden */
        // @ApiMember(Description="If the my bookings menu item should be hidden")
        /** @var bool|null */
        public ?bool $MyBookingsHidden=null,

        /** @description The text for calender menu item */
        // @ApiMember(Description="The text for calender menu item")
        /** @var string|null */
        public ?string $CalendarText=null,

        /** @description If the calendar menu item should be hidden */
        // @ApiMember(Description="If the calendar menu item should be hidden")
        /** @var bool|null */
        public ?bool $CalendarHidden=null,

        /** @description The text for news menu item */
        // @ApiMember(Description="The text for news menu item")
        /** @var string|null */
        public ?string $NewsText=null,

        /** @description If the news menu item should be hidden */
        // @ApiMember(Description="If the news menu item should be hidden")
        /** @var bool|null */
        public ?bool $NewsHidden=null,

        /** @description The text for address menu item */
        // @ApiMember(Description="The text for address menu item")
        /** @var string|null */
        public ?string $AddressText=null,

        /** @description If the address menu item should be hidden */
        // @ApiMember(Description="If the address menu item should be hidden")
        /** @var bool|null */
        public ?bool $AddressHidden=null,

        /** @description The text for gallery menu item */
        // @ApiMember(Description="The text for gallery menu item")
        /** @var string|null */
        public ?string $GalleryText=null,

        /** @description If the gallery menu item should be hidden */
        // @ApiMember(Description="If the gallery menu item should be hidden")
        /** @var bool|null */
        public ?bool $GalleryHidden=null,

        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['HomeText'])) $this->HomeText = $o['HomeText'];
        if (isset($o['HomeHidden'])) $this->HomeHidden = $o['HomeHidden'];
        if (isset($o['ServicesText'])) $this->ServicesText = $o['ServicesText'];
        if (isset($o['ServicesHidden'])) $this->ServicesHidden = $o['ServicesHidden'];
        if (isset($o['BookTimeText'])) $this->BookTimeText = $o['BookTimeText'];
        if (isset($o['BookTimeHidden'])) $this->BookTimeHidden = $o['BookTimeHidden'];
        if (isset($o['AboutUsText'])) $this->AboutUsText = $o['AboutUsText'];
        if (isset($o['AboutUsHidden'])) $this->AboutUsHidden = $o['AboutUsHidden'];
        if (isset($o['ContactUsText'])) $this->ContactUsText = $o['ContactUsText'];
        if (isset($o['ContactUsHidden'])) $this->ContactUsHidden = $o['ContactUsHidden'];
        if (isset($o['MyBookingsText'])) $this->MyBookingsText = $o['MyBookingsText'];
        if (isset($o['MyBookingsHidden'])) $this->MyBookingsHidden = $o['MyBookingsHidden'];
        if (isset($o['CalendarText'])) $this->CalendarText = $o['CalendarText'];
        if (isset($o['CalendarHidden'])) $this->CalendarHidden = $o['CalendarHidden'];
        if (isset($o['NewsText'])) $this->NewsText = $o['NewsText'];
        if (isset($o['NewsHidden'])) $this->NewsHidden = $o['NewsHidden'];
        if (isset($o['AddressText'])) $this->AddressText = $o['AddressText'];
        if (isset($o['AddressHidden'])) $this->AddressHidden = $o['AddressHidden'];
        if (isset($o['GalleryText'])) $this->GalleryText = $o['GalleryText'];
        if (isset($o['GalleryHidden'])) $this->GalleryHidden = $o['GalleryHidden'];
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->HomeText)) $o['HomeText'] = $this->HomeText;
        if (isset($this->HomeHidden)) $o['HomeHidden'] = $this->HomeHidden;
        if (isset($this->ServicesText)) $o['ServicesText'] = $this->ServicesText;
        if (isset($this->ServicesHidden)) $o['ServicesHidden'] = $this->ServicesHidden;
        if (isset($this->BookTimeText)) $o['BookTimeText'] = $this->BookTimeText;
        if (isset($this->BookTimeHidden)) $o['BookTimeHidden'] = $this->BookTimeHidden;
        if (isset($this->AboutUsText)) $o['AboutUsText'] = $this->AboutUsText;
        if (isset($this->AboutUsHidden)) $o['AboutUsHidden'] = $this->AboutUsHidden;
        if (isset($this->ContactUsText)) $o['ContactUsText'] = $this->ContactUsText;
        if (isset($this->ContactUsHidden)) $o['ContactUsHidden'] = $this->ContactUsHidden;
        if (isset($this->MyBookingsText)) $o['MyBookingsText'] = $this->MyBookingsText;
        if (isset($this->MyBookingsHidden)) $o['MyBookingsHidden'] = $this->MyBookingsHidden;
        if (isset($this->CalendarText)) $o['CalendarText'] = $this->CalendarText;
        if (isset($this->CalendarHidden)) $o['CalendarHidden'] = $this->CalendarHidden;
        if (isset($this->NewsText)) $o['NewsText'] = $this->NewsText;
        if (isset($this->NewsHidden)) $o['NewsHidden'] = $this->NewsHidden;
        if (isset($this->AddressText)) $o['AddressText'] = $this->AddressText;
        if (isset($this->AddressHidden)) $o['AddressHidden'] = $this->AddressHidden;
        if (isset($this->GalleryText)) $o['GalleryText'] = $this->GalleryText;
        if (isset($this->GalleryHidden)) $o['GalleryHidden'] = $this->GalleryHidden;
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

// @ValidateRequest(Validator="IsAuthenticated")
class UpdateHomepageMenu implements ICompany, JsonSerializable
{
    public function __construct(
        /** @description The company id, if empty will use the company id for the user you are logged in with. */
        // @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")
        /** @var string|null */
        public ?string $CompanyId=null,

        /** @description The text for home menu item */
        // @ApiMember(Description="The text for home menu item")
        /** @var string|null */
        public ?string $HomeText=null,

        /** @description If the home menu item should be hidden */
        // @ApiMember(Description="If the home menu item should be hidden")
        /** @var bool|null */
        public ?bool $HomeHidden=null,

        /** @description The text for services menu item */
        // @ApiMember(Description="The text for services menu item")
        /** @var string|null */
        public ?string $ServicesText=null,

        /** @description If the services menu item should be hidden */
        // @ApiMember(Description="If the services menu item should be hidden")
        /** @var bool|null */
        public ?bool $ServicesHidden=null,

        /** @description The text for book time menu item */
        // @ApiMember(Description="The text for book time menu item")
        /** @var string|null */
        public ?string $BookTimeText=null,

        /** @description If the book time menu item should be hidden */
        // @ApiMember(Description="If the book time menu item should be hidden")
        /** @var bool|null */
        public ?bool $BookTimeHidden=null,

        /** @description The text for about us menu item */
        // @ApiMember(Description="The text for about us menu item")
        /** @var string|null */
        public ?string $AboutUsText=null,

        /** @description If the about us menu item should be hidden */
        // @ApiMember(Description="If the about us menu item should be hidden")
        /** @var bool|null */
        public ?bool $AboutUsHidden=null,

        /** @description The text for contact us menu item */
        // @ApiMember(Description="The text for contact us menu item")
        /** @var string|null */
        public ?string $ContactUsText=null,

        /** @description If the contact us menu item should be hidden */
        // @ApiMember(Description="If the contact us menu item should be hidden")
        /** @var bool|null */
        public ?bool $ContactUsHidden=null,

        /** @description The text for my bookings menu item */
        // @ApiMember(Description="The text for my bookings menu item")
        /** @var string|null */
        public ?string $MyBookingsText=null,

        /** @description If the my bookings menu item should be hidden */
        // @ApiMember(Description="If the my bookings menu item should be hidden")
        /** @var bool|null */
        public ?bool $MyBookingsHidden=null,

        /** @description The text for calendar menu item */
        // @ApiMember(Description="The text for calendar menu item")
        /** @var string|null */
        public ?string $CalendarText=null,

        /** @description If the calendar menu item should be hidden */
        // @ApiMember(Description="If the calendar menu item should be hidden")
        /** @var bool|null */
        public ?bool $CalendarHidden=null,

        /** @description The text for news menu item */
        // @ApiMember(Description="The text for news menu item")
        /** @var string|null */
        public ?string $NewsText=null,

        /** @description If the news menu item should be hidden */
        // @ApiMember(Description="If the news menu item should be hidden")
        /** @var bool|null */
        public ?bool $NewsHidden=null,

        /** @description The text for address menu item */
        // @ApiMember(Description="The text for address menu item")
        /** @var string|null */
        public ?string $AddressText=null,

        /** @description If the address menu item should be hidden */
        // @ApiMember(Description="If the address menu item should be hidden")
        /** @var bool|null */
        public ?bool $AddressHidden=null,

        /** @description The text for gallery menu item */
        // @ApiMember(Description="The text for gallery menu item")
        /** @var string|null */
        public ?string $GalleryText=null,

        /** @description If the gallery menu item should be hidden */
        // @ApiMember(Description="If the gallery menu item should be hidden")
        /** @var bool|null */
        public ?bool $GalleryHidden=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['HomeText'])) $this->HomeText = $o['HomeText'];
        if (isset($o['HomeHidden'])) $this->HomeHidden = $o['HomeHidden'];
        if (isset($o['ServicesText'])) $this->ServicesText = $o['ServicesText'];
        if (isset($o['ServicesHidden'])) $this->ServicesHidden = $o['ServicesHidden'];
        if (isset($o['BookTimeText'])) $this->BookTimeText = $o['BookTimeText'];
        if (isset($o['BookTimeHidden'])) $this->BookTimeHidden = $o['BookTimeHidden'];
        if (isset($o['AboutUsText'])) $this->AboutUsText = $o['AboutUsText'];
        if (isset($o['AboutUsHidden'])) $this->AboutUsHidden = $o['AboutUsHidden'];
        if (isset($o['ContactUsText'])) $this->ContactUsText = $o['ContactUsText'];
        if (isset($o['ContactUsHidden'])) $this->ContactUsHidden = $o['ContactUsHidden'];
        if (isset($o['MyBookingsText'])) $this->MyBookingsText = $o['MyBookingsText'];
        if (isset($o['MyBookingsHidden'])) $this->MyBookingsHidden = $o['MyBookingsHidden'];
        if (isset($o['CalendarText'])) $this->CalendarText = $o['CalendarText'];
        if (isset($o['CalendarHidden'])) $this->CalendarHidden = $o['CalendarHidden'];
        if (isset($o['NewsText'])) $this->NewsText = $o['NewsText'];
        if (isset($o['NewsHidden'])) $this->NewsHidden = $o['NewsHidden'];
        if (isset($o['AddressText'])) $this->AddressText = $o['AddressText'];
        if (isset($o['AddressHidden'])) $this->AddressHidden = $o['AddressHidden'];
        if (isset($o['GalleryText'])) $this->GalleryText = $o['GalleryText'];
        if (isset($o['GalleryHidden'])) $this->GalleryHidden = $o['GalleryHidden'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->HomeText)) $o['HomeText'] = $this->HomeText;
        if (isset($this->HomeHidden)) $o['HomeHidden'] = $this->HomeHidden;
        if (isset($this->ServicesText)) $o['ServicesText'] = $this->ServicesText;
        if (isset($this->ServicesHidden)) $o['ServicesHidden'] = $this->ServicesHidden;
        if (isset($this->BookTimeText)) $o['BookTimeText'] = $this->BookTimeText;
        if (isset($this->BookTimeHidden)) $o['BookTimeHidden'] = $this->BookTimeHidden;
        if (isset($this->AboutUsText)) $o['AboutUsText'] = $this->AboutUsText;
        if (isset($this->AboutUsHidden)) $o['AboutUsHidden'] = $this->AboutUsHidden;
        if (isset($this->ContactUsText)) $o['ContactUsText'] = $this->ContactUsText;
        if (isset($this->ContactUsHidden)) $o['ContactUsHidden'] = $this->ContactUsHidden;
        if (isset($this->MyBookingsText)) $o['MyBookingsText'] = $this->MyBookingsText;
        if (isset($this->MyBookingsHidden)) $o['MyBookingsHidden'] = $this->MyBookingsHidden;
        if (isset($this->CalendarText)) $o['CalendarText'] = $this->CalendarText;
        if (isset($this->CalendarHidden)) $o['CalendarHidden'] = $this->CalendarHidden;
        if (isset($this->NewsText)) $o['NewsText'] = $this->NewsText;
        if (isset($this->NewsHidden)) $o['NewsHidden'] = $this->NewsHidden;
        if (isset($this->AddressText)) $o['AddressText'] = $this->AddressText;
        if (isset($this->AddressHidden)) $o['AddressHidden'] = $this->AddressHidden;
        if (isset($this->GalleryText)) $o['GalleryText'] = $this->GalleryText;
        if (isset($this->GalleryHidden)) $o['GalleryHidden'] = $this->GalleryHidden;
        return empty($o) ? new class(){} : $o;
    }
}

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

PUT /homepage/menu HTTP/1.1 
Host: api.bokamera.se 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"CompanyId":"00000000-0000-0000-0000-000000000000","HomeText":"String","HomeHidden":false,"ServicesText":"String","ServicesHidden":false,"BookTimeText":"String","BookTimeHidden":false,"AboutUsText":"String","AboutUsHidden":false,"ContactUsText":"String","ContactUsHidden":false,"MyBookingsText":"String","MyBookingsHidden":false,"CalendarText":"String","CalendarHidden":false,"NewsText":"String","NewsHidden":false,"AddressText":"String","AddressHidden":false,"GalleryText":"String","GalleryHidden":false}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"HomeText":"String","HomeHidden":false,"ServicesText":"String","ServicesHidden":false,"BookTimeText":"String","BookTimeHidden":false,"AboutUsText":"String","AboutUsHidden":false,"ContactUsText":"String","ContactUsHidden":false,"MyBookingsText":"String","MyBookingsHidden":false,"CalendarText":"String","CalendarHidden":false,"NewsText":"String","NewsHidden":false,"AddressText":"String","AddressHidden":false,"GalleryText":"String","GalleryHidden":false,"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}