Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
PUT | /homepage/widget/settings | Update homepage widget settings | Update homepage widget settings on the company of the currently logged in user, only administrators are allowed to update homepage menu. |
---|
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class HomepageWidgetServiceLayoutsResponse:
# @ApiMember(Description="The layout id.")
id: int = 0
"""
The layout id.
"""
# @ApiMember(Description="The layout name.")
name: Optional[str] = None
"""
The layout name.
"""
# @ApiMember(Description="The layout description.")
description: Optional[str] = None
"""
The layout description.
"""
# @ApiMember(Description="The layout code.")
code: Optional[str] = None
"""
The layout code.
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class HomepageWidgetTimeLayoutsResponse:
# @ApiMember(Description="The layout id.")
id: int = 0
"""
The layout id.
"""
# @ApiMember(Description="The layout name.")
name: Optional[str] = None
"""
The layout name.
"""
# @ApiMember(Description="The layout description.")
description: Optional[str] = None
"""
The layout description.
"""
# @ApiMember(Description="The layout code.")
code: Optional[str] = None
"""
The layout code.
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class HomepageWidgetBookingLayoutsResponse:
# @ApiMember(Description="The layout id.")
id: int = 0
"""
The layout id.
"""
# @ApiMember(Description="The layout name.")
name: Optional[str] = None
"""
The layout name.
"""
# @ApiMember(Description="The layout description.")
description: Optional[str] = None
"""
The layout description.
"""
# @ApiMember(Description="The layout code.")
code: Optional[str] = None
"""
The layout code.
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class HomepageWidgetBookingMethodsResponse:
# @ApiMember(Description="The layout id.")
id: int = 0
"""
The layout id.
"""
# @ApiMember(Description="The layout name.")
name: Optional[str] = None
"""
The layout name.
"""
# @ApiMember(Description="The layout description.")
description: Optional[str] = None
"""
The layout description.
"""
# @ApiMember(Description="The layout code.")
code: Optional[str] = None
"""
The layout code.
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class HomepageWidgetSettingsQueryResponse:
# @ApiMember(Description="The company id.")
company_id: Optional[str] = None
"""
The company id.
"""
# @ApiMember(Description="The service layouts id.")
service_layout_id: int = 0
"""
The service layouts id.
"""
# @ApiMember(Description="The time layouts id.")
time_layout_id: int = 0
"""
The time layouts id.
"""
# @ApiMember(Description="The booking layouts id.")
booking_layout_id: int = 0
"""
The booking layouts id.
"""
# @ApiMember(Description="The primary color of the booking widget.")
primary_color: Optional[str] = None
"""
The primary color of the booking widget.
"""
# @ApiMember(Description="If you should show the service image in the booking widget.")
show_service_image: bool = False
"""
If you should show the service image in the booking widget.
"""
# @ApiMember(Description="If you should show the rebate code field in the booking widget.")
show_rebate_code_field: bool = False
"""
If you should show the rebate code field in the booking widget.
"""
# @ApiMember(Description="If you should show the next available time in the booking widget.")
show_next_available_time: bool = False
"""
If you should show the next available time in the booking widget.
"""
# @ApiMember(Description="If you should show the subscribe to newsletter checkbox in the booking widget.")
show_subscribe_to_newsletter: bool = False
"""
If you should show the subscribe to newsletter checkbox in the booking widget.
"""
# @ApiMember(Description="If you should show the create account option.")
enable_create_account: bool = False
"""
If you should show the create account option.
"""
# @ApiMember(Description="If you should show the login to account option.")
enable_login: bool = False
"""
If you should show the login to account option.
"""
# @ApiMember(Description="If you should show the facebook login to account option.")
enable_facebook_login: bool = False
"""
If you should show the facebook login to account option.
"""
# @ApiMember(Description="If you should show the direct booking option. This enables customer to book with entering contact information.")
enable_direct_booking: bool = False
"""
If you should show the direct booking option. This enables customer to book with entering contact information.
"""
# @ApiMember(Description="If the site should have dark theme or not.")
dark_theme: bool = False
"""
If the site should have dark theme or not.
"""
# @ApiMember(Description="If you should show the end time in the booking widget.")
show_end_time: bool = False
"""
If you should show the end time in the booking widget.
"""
# @ApiMember(Description="What text to show on booked time slots. Default text is Booked")
booked_time_slot_text: Optional[str] = None
"""
What text to show on booked time slots. Default text is Booked
"""
service_layout_options: Optional[List[HomepageWidgetServiceLayoutsResponse]] = None
time_layout_options: Optional[List[HomepageWidgetTimeLayoutsResponse]] = None
booking_layout_options: Optional[List[HomepageWidgetBookingLayoutsResponse]] = None
booking_method_options: Optional[List[HomepageWidgetBookingMethodsResponse]] = None
# @ValidateRequest(Validator="IsAuthenticated")
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UpdateHomepageWidgetSettings(ICompany):
# @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")
company_id: Optional[str] = None
"""
The company id, if empty will use the company id for the user you are logged in with.
"""
# @ApiMember(Description="Serivce Layout.")
service_layout_id: Optional[int] = None
"""
Serivce Layout.
"""
# @ApiMember(Description="Time Layout.")
time_layout_id: Optional[int] = None
"""
Time Layout.
"""
# @ApiMember(Description="Booking Layout.")
booking_layout_id: Optional[int] = None
"""
Booking Layout.
"""
# @ApiMember(Description="The primary color of the booking widget.")
primary_color: Optional[str] = None
"""
The primary color of the booking widget.
"""
# @ApiMember(Description="If the site should have dark theme or not.")
dark_theme: Optional[bool] = None
"""
If the site should have dark theme or not.
"""
# @ApiMember(Description="If you should show the service image in the booking widget.")
show_service_image: Optional[bool] = None
"""
If you should show the service image in the booking widget.
"""
# @ApiMember(Description="If you should show the rebate code field in the booking widget.")
show_rebate_code_field: Optional[bool] = None
"""
If you should show the rebate code field in the booking widget.
"""
# @ApiMember(Description="If you should show the next available time in the booking widget.")
show_next_available_time: Optional[bool] = None
"""
If you should show the next available time in the booking widget.
"""
# @ApiMember(Description="If you should show the end time in the booking widget.")
show_end_time: Optional[bool] = None
"""
If you should show the end time in the booking widget.
"""
# @ApiMember(Description="Show subscribe to newsletter checkbox on the page")
show_subscribe_to_newsletter: Optional[bool] = None
"""
Show subscribe to newsletter checkbox on the page
"""
# @ApiMember(Description="What text to show on booked time slots. Default text is Booked")
booked_time_slot_text: Optional[str] = None
"""
What text to show on booked time slots. Default text is Booked
"""
# @ApiMember(Description="If you should show the create account option.")
enable_create_account: Optional[bool] = None
"""
If you should show the create account option.
"""
# @ApiMember(Description="If you should show the login to account option.")
enable_login: Optional[bool] = None
"""
If you should show the login to account option.
"""
# @ApiMember(Description="If you should show the facebook login to account option.")
enable_facebook_login: Optional[bool] = None
"""
If you should show the facebook login to account option.
"""
# @ApiMember(Description="If you should show the direct booking option. This enables customer to book with entering contact information.")
enable_direct_booking: Optional[bool] = None
"""
If you should show the direct booking option. This enables customer to book with entering contact information.
"""
Python UpdateHomepageWidgetSettings DTOs
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/widget/settings HTTP/1.1
Host: api.bokamera.se
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<UpdateHomepageWidgetSettings xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
<BookedTimeSlotText>String</BookedTimeSlotText>
<BookingLayoutId>0</BookingLayoutId>
<CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
<DarkTheme>false</DarkTheme>
<EnableCreateAccount>false</EnableCreateAccount>
<EnableDirectBooking>false</EnableDirectBooking>
<EnableFacebookLogin>false</EnableFacebookLogin>
<EnableLogin>false</EnableLogin>
<PrimaryColor>String</PrimaryColor>
<ServiceLayoutId>0</ServiceLayoutId>
<ShowEndTime>false</ShowEndTime>
<ShowNextAvailableTime>false</ShowNextAvailableTime>
<ShowRebateCodeField>false</ShowRebateCodeField>
<ShowServiceImage>false</ShowServiceImage>
<ShowSubscribeToNewsletter>false</ShowSubscribeToNewsletter>
<TimeLayoutId>0</TimeLayoutId>
</UpdateHomepageWidgetSettings>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <HomepageWidgetSettingsQueryResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos"> <BookedTimeSlotText>String</BookedTimeSlotText> <BookingLayoutId>0</BookingLayoutId> <BookingLayoutOptions> <HomepageWidgetBookingLayoutsResponse> <Code>String</Code> <Description>String</Description> <Id>0</Id> <Name>String</Name> </HomepageWidgetBookingLayoutsResponse> </BookingLayoutOptions> <BookingMethodOptions> <HomepageWidgetBookingMethodsResponse> <Code>String</Code> <Description>String</Description> <Id>0</Id> <Name>String</Name> </HomepageWidgetBookingMethodsResponse> </BookingMethodOptions> <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId> <DarkTheme>false</DarkTheme> <EnableCreateAccount>false</EnableCreateAccount> <EnableDirectBooking>false</EnableDirectBooking> <EnableFacebookLogin>false</EnableFacebookLogin> <EnableLogin>false</EnableLogin> <PrimaryColor>String</PrimaryColor> <ServiceLayoutId>0</ServiceLayoutId> <ServiceLayoutOptions> <HomepageWidgetServiceLayoutsResponse> <Code>String</Code> <Description>String</Description> <Id>0</Id> <Name>String</Name> </HomepageWidgetServiceLayoutsResponse> </ServiceLayoutOptions> <ShowEndTime>false</ShowEndTime> <ShowNextAvailableTime>false</ShowNextAvailableTime> <ShowRebateCodeField>false</ShowRebateCodeField> <ShowServiceImage>false</ShowServiceImage> <ShowSubscribeToNewsletter>false</ShowSubscribeToNewsletter> <TimeLayoutId>0</TimeLayoutId> <TimeLayoutOptions> <HomepageWidgetTimeLayoutsResponse> <Code>String</Code> <Description>String</Description> <Id>0</Id> <Name>String</Name> </HomepageWidgetTimeLayoutsResponse> </TimeLayoutOptions> </HomepageWidgetSettingsQueryResponse>