GET | /homepage/widget/settings | Get homepage widget settings | Get 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
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class HomepageWidgetSettingsQuery(ICompany, ICompanyRequest):
# @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="The homepage sitepath.")
site_path: Optional[str] = None
"""
The homepage sitepath.
"""
# @ApiMember(Description="If you want to include what service layout options to select from")
include_service_layout_options: bool = False
"""
If you want to include what service layout options to select from
"""
# @ApiMember(Description="If you want to include what time layout options to select from")
include_time_layout_options: bool = False
"""
If you want to include what time layout options to select from
"""
# @ApiMember(Description="If you want to include what booking layout options to select from")
include_booking_layout_options: bool = False
"""
If you want to include what booking layout options to select from
"""
# @ApiMember(Description="If you want to include what booking method options to select from")
include_booking_method_options: bool = False
"""
If you want to include what booking method options to select from
"""
Python HomepageWidgetSettingsQuery DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /homepage/widget/settings HTTP/1.1 Host: api.bokamera.se Accept: text/jsv
HTTP/1.1 200 OK Content-Type: text/jsv 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 } ] }