BokaMera.API.Host

<back to all web services

UpdateHomepageWidgetSettings

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
PUT/homepage/widget/settingsUpdate homepage widget settingsUpdate 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 .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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/json
Content-Type: application/json
Content-Length: length

{"CompanyId":"00000000-0000-0000-0000-000000000000","ServiceLayoutId":0,"TimeLayoutId":0,"BookingLayoutId":0,"PrimaryColor":"String","DarkTheme":false,"ShowServiceImage":false,"ShowRebateCodeField":false,"ShowNextAvailableTime":false,"ShowEndTime":false,"ShowSubscribeToNewsletter":false,"BookedTimeSlotText":"String","EnableCreateAccount":false,"EnableLogin":false,"EnableFacebookLogin":false,"EnableDirectBooking":false}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"ServiceLayoutId":0,"TimeLayoutId":0,"BookingLayoutId":0,"PrimaryColor":"String","ShowServiceImage":false,"ShowRebateCodeField":false,"ShowNextAvailableTime":false,"ShowSubscribeToNewsletter":false,"EnableCreateAccount":false,"EnableLogin":false,"EnableFacebookLogin":false,"EnableDirectBooking":false,"DarkTheme":false,"ShowEndTime":false,"BookedTimeSlotText":"String","ServiceLayoutOptions":[{"Id":0,"Name":"String","Description":"String","Code":"String"}],"TimeLayoutOptions":[{"Id":0,"Name":"String","Description":"String","Code":"String"}],"BookingLayoutOptions":[{"Id":0,"Name":"String","Description":"String","Code":"String"}],"BookingMethodOptions":[{"Id":0,"Name":"String","Description":"String","Code":"String"}]}