Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
PUT | /homepage/menu | Update the homepage menu | Update 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;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
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: application/xml
Content-Type: application/xml
Content-Length: length
<UpdateHomepageMenu xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
<AboutUsHidden>false</AboutUsHidden>
<AboutUsText>String</AboutUsText>
<AddressHidden>false</AddressHidden>
<AddressText>String</AddressText>
<BookTimeHidden>false</BookTimeHidden>
<BookTimeText>String</BookTimeText>
<CalendarHidden>false</CalendarHidden>
<CalendarText>String</CalendarText>
<CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
<ContactUsHidden>false</ContactUsHidden>
<ContactUsText>String</ContactUsText>
<GalleryHidden>false</GalleryHidden>
<GalleryText>String</GalleryText>
<HomeHidden>false</HomeHidden>
<HomeText>String</HomeText>
<MyBookingsHidden>false</MyBookingsHidden>
<MyBookingsText>String</MyBookingsText>
<NewsHidden>false</NewsHidden>
<NewsText>String</NewsText>
<ServicesHidden>false</ServicesHidden>
<ServicesText>String</ServicesText>
</UpdateHomepageMenu>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <HomepageMenuQueryResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos"> <AboutUsHidden>false</AboutUsHidden> <AboutUsText>String</AboutUsText> <AddressHidden>false</AddressHidden> <AddressText>String</AddressText> <BookTimeHidden>false</BookTimeHidden> <BookTimeText>String</BookTimeText> <CalendarHidden>false</CalendarHidden> <CalendarText>String</CalendarText> <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId> <ContactUsHidden>false</ContactUsHidden> <ContactUsText>String</ContactUsText> <GalleryHidden>false</GalleryHidden> <GalleryText>String</GalleryText> <HomeHidden>false</HomeHidden> <HomeText>String</HomeText> <MyBookingsHidden>false</MyBookingsHidden> <MyBookingsText>String</MyBookingsText> <NewsHidden>false</NewsHidden> <NewsText>String</NewsText> <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types"> <d2p1:ErrorCode>String</d2p1:ErrorCode> <d2p1:Message>String</d2p1:Message> <d2p1:StackTrace>String</d2p1:StackTrace> <d2p1:Errors> <d2p1:ResponseError> <d2p1:ErrorCode>String</d2p1:ErrorCode> <d2p1:FieldName>String</d2p1:FieldName> <d2p1:Message>String</d2p1:Message> <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d5p1:KeyValueOfstringstring> <d5p1:Key>String</d5p1:Key> <d5p1:Value>String</d5p1:Value> </d5p1:KeyValueOfstringstring> </d2p1:Meta> </d2p1:ResponseError> </d2p1:Errors> <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:KeyValueOfstringstring> <d3p1:Key>String</d3p1:Key> <d3p1:Value>String</d3p1:Value> </d3p1:KeyValueOfstringstring> </d2p1:Meta> </ResponseStatus> <ServicesHidden>false</ServicesHidden> <ServicesText>String</ServicesText> </HomepageMenuQueryResponse>