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 'package:servicestack/servicestack.dart';

class HomepageWidgetServiceLayoutsResponse implements IConvertible
{
    /**
    * The layout id.
    */
    // @ApiMember(Description="The layout id.")
    int? Id;

    /**
    * The layout name.
    */
    // @ApiMember(Description="The layout name.")
    String? Name;

    /**
    * The layout description.
    */
    // @ApiMember(Description="The layout description.")
    String? Description;

    /**
    * The layout code.
    */
    // @ApiMember(Description="The layout code.")
    String? Code;

    HomepageWidgetServiceLayoutsResponse({this.Id,this.Name,this.Description,this.Code});
    HomepageWidgetServiceLayoutsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        Name = json['Name'];
        Description = json['Description'];
        Code = json['Code'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'Name': Name,
        'Description': Description,
        'Code': Code
    };

    getTypeName() => "HomepageWidgetServiceLayoutsResponse";
    TypeContext? context = _ctx;
}

class HomepageWidgetTimeLayoutsResponse implements IConvertible
{
    /**
    * The layout id.
    */
    // @ApiMember(Description="The layout id.")
    int? Id;

    /**
    * The layout name.
    */
    // @ApiMember(Description="The layout name.")
    String? Name;

    /**
    * The layout description.
    */
    // @ApiMember(Description="The layout description.")
    String? Description;

    /**
    * The layout code.
    */
    // @ApiMember(Description="The layout code.")
    String? Code;

    HomepageWidgetTimeLayoutsResponse({this.Id,this.Name,this.Description,this.Code});
    HomepageWidgetTimeLayoutsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        Name = json['Name'];
        Description = json['Description'];
        Code = json['Code'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'Name': Name,
        'Description': Description,
        'Code': Code
    };

    getTypeName() => "HomepageWidgetTimeLayoutsResponse";
    TypeContext? context = _ctx;
}

class HomepageWidgetBookingLayoutsResponse implements IConvertible
{
    /**
    * The layout id.
    */
    // @ApiMember(Description="The layout id.")
    int? Id;

    /**
    * The layout name.
    */
    // @ApiMember(Description="The layout name.")
    String? Name;

    /**
    * The layout description.
    */
    // @ApiMember(Description="The layout description.")
    String? Description;

    /**
    * The layout code.
    */
    // @ApiMember(Description="The layout code.")
    String? Code;

    HomepageWidgetBookingLayoutsResponse({this.Id,this.Name,this.Description,this.Code});
    HomepageWidgetBookingLayoutsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        Name = json['Name'];
        Description = json['Description'];
        Code = json['Code'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'Name': Name,
        'Description': Description,
        'Code': Code
    };

    getTypeName() => "HomepageWidgetBookingLayoutsResponse";
    TypeContext? context = _ctx;
}

class HomepageWidgetBookingMethodsResponse implements IConvertible
{
    /**
    * The layout id.
    */
    // @ApiMember(Description="The layout id.")
    int? Id;

    /**
    * The layout name.
    */
    // @ApiMember(Description="The layout name.")
    String? Name;

    /**
    * The layout description.
    */
    // @ApiMember(Description="The layout description.")
    String? Description;

    /**
    * The layout code.
    */
    // @ApiMember(Description="The layout code.")
    String? Code;

    HomepageWidgetBookingMethodsResponse({this.Id,this.Name,this.Description,this.Code});
    HomepageWidgetBookingMethodsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        Name = json['Name'];
        Description = json['Description'];
        Code = json['Code'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'Name': Name,
        'Description': Description,
        'Code': Code
    };

    getTypeName() => "HomepageWidgetBookingMethodsResponse";
    TypeContext? context = _ctx;
}

class HomepageWidgetSettingsQueryResponse implements IConvertible
{
    /**
    * The company id.
    */
    // @ApiMember(Description="The company id.")
    String? CompanyId;

    /**
    * The service layouts id.
    */
    // @ApiMember(Description="The service layouts id.")
    int? ServiceLayoutId;

    /**
    * The time layouts id.
    */
    // @ApiMember(Description="The time layouts id.")
    int? TimeLayoutId;

    /**
    * The booking layouts id.
    */
    // @ApiMember(Description="The booking layouts id.")
    int? BookingLayoutId;

    /**
    * The primary color of the booking widget.
    */
    // @ApiMember(Description="The primary color of the booking widget.")
    String? PrimaryColor;

    /**
    * If you should show the service image in the booking widget.
    */
    // @ApiMember(Description="If you should show the service image in the booking widget.")
    bool? ShowServiceImage;

    /**
    * If you should show the rebate code field in the booking widget.
    */
    // @ApiMember(Description="If you should show the rebate code field in the booking widget.")
    bool? ShowRebateCodeField;

    /**
    * If you should show the next available time in the booking widget.
    */
    // @ApiMember(Description="If you should show the next available time in the booking widget.")
    bool? ShowNextAvailableTime;

    /**
    * If you should show the create account option.
    */
    // @ApiMember(Description="If you should show the create account option.")
    bool? EnableCreateAccount;

    /**
    * If you should show the login to account option.
    */
    // @ApiMember(Description="If you should show the login to account option.")
    bool? EnableLogin;

    /**
    * If you should show the facebook login to account option.
    */
    // @ApiMember(Description="If you should show the facebook login to account option.")
    bool? EnableFacebookLogin;

    /**
    * If you should show the direct booking option. This enables customer to book with entering contact information.
    */
    // @ApiMember(Description="If you should show the direct booking option. This enables customer to book with entering contact information.")
    bool? EnableDirectBooking;

    /**
    * If the site should have dark theme or not.
    */
    // @ApiMember(Description="If the site should have dark theme or not.")
    bool? DarkTheme;

    /**
    * If you should show the end time in the booking widget.
    */
    // @ApiMember(Description="If you should show the end time in the booking widget.")
    bool? ShowEndTime;

    /**
    * What text to show on booked time slots. Default text is Booked
    */
    // @ApiMember(Description="What text to show on booked time slots. Default text is Booked")
    String? BookedTimeSlotText;

    List<HomepageWidgetServiceLayoutsResponse>? ServiceLayoutOptions;
    List<HomepageWidgetTimeLayoutsResponse>? TimeLayoutOptions;
    List<HomepageWidgetBookingLayoutsResponse>? BookingLayoutOptions;
    List<HomepageWidgetBookingMethodsResponse>? BookingMethodOptions;

    HomepageWidgetSettingsQueryResponse({this.CompanyId,this.ServiceLayoutId,this.TimeLayoutId,this.BookingLayoutId,this.PrimaryColor,this.ShowServiceImage,this.ShowRebateCodeField,this.ShowNextAvailableTime,this.EnableCreateAccount,this.EnableLogin,this.EnableFacebookLogin,this.EnableDirectBooking,this.DarkTheme,this.ShowEndTime,this.BookedTimeSlotText,this.ServiceLayoutOptions,this.TimeLayoutOptions,this.BookingLayoutOptions,this.BookingMethodOptions});
    HomepageWidgetSettingsQueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        CompanyId = json['CompanyId'];
        ServiceLayoutId = json['ServiceLayoutId'];
        TimeLayoutId = json['TimeLayoutId'];
        BookingLayoutId = json['BookingLayoutId'];
        PrimaryColor = json['PrimaryColor'];
        ShowServiceImage = json['ShowServiceImage'];
        ShowRebateCodeField = json['ShowRebateCodeField'];
        ShowNextAvailableTime = json['ShowNextAvailableTime'];
        EnableCreateAccount = json['EnableCreateAccount'];
        EnableLogin = json['EnableLogin'];
        EnableFacebookLogin = json['EnableFacebookLogin'];
        EnableDirectBooking = json['EnableDirectBooking'];
        DarkTheme = json['DarkTheme'];
        ShowEndTime = json['ShowEndTime'];
        BookedTimeSlotText = json['BookedTimeSlotText'];
        ServiceLayoutOptions = JsonConverters.fromJson(json['ServiceLayoutOptions'],'List<HomepageWidgetServiceLayoutsResponse>',context!);
        TimeLayoutOptions = JsonConverters.fromJson(json['TimeLayoutOptions'],'List<HomepageWidgetTimeLayoutsResponse>',context!);
        BookingLayoutOptions = JsonConverters.fromJson(json['BookingLayoutOptions'],'List<HomepageWidgetBookingLayoutsResponse>',context!);
        BookingMethodOptions = JsonConverters.fromJson(json['BookingMethodOptions'],'List<HomepageWidgetBookingMethodsResponse>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'CompanyId': CompanyId,
        'ServiceLayoutId': ServiceLayoutId,
        'TimeLayoutId': TimeLayoutId,
        'BookingLayoutId': BookingLayoutId,
        'PrimaryColor': PrimaryColor,
        'ShowServiceImage': ShowServiceImage,
        'ShowRebateCodeField': ShowRebateCodeField,
        'ShowNextAvailableTime': ShowNextAvailableTime,
        'EnableCreateAccount': EnableCreateAccount,
        'EnableLogin': EnableLogin,
        'EnableFacebookLogin': EnableFacebookLogin,
        'EnableDirectBooking': EnableDirectBooking,
        'DarkTheme': DarkTheme,
        'ShowEndTime': ShowEndTime,
        'BookedTimeSlotText': BookedTimeSlotText,
        'ServiceLayoutOptions': JsonConverters.toJson(ServiceLayoutOptions,'List<HomepageWidgetServiceLayoutsResponse>',context!),
        'TimeLayoutOptions': JsonConverters.toJson(TimeLayoutOptions,'List<HomepageWidgetTimeLayoutsResponse>',context!),
        'BookingLayoutOptions': JsonConverters.toJson(BookingLayoutOptions,'List<HomepageWidgetBookingLayoutsResponse>',context!),
        'BookingMethodOptions': JsonConverters.toJson(BookingMethodOptions,'List<HomepageWidgetBookingMethodsResponse>',context!)
    };

    getTypeName() => "HomepageWidgetSettingsQueryResponse";
    TypeContext? context = _ctx;
}

// @ValidateRequest(Validator="IsAuthenticated")
class UpdateHomepageWidgetSettings implements ICompany, IConvertible
{
    /**
    * 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.")
    String? CompanyId;

    /**
    * Serivce Layout.
    */
    // @ApiMember(Description="Serivce Layout.")
    int? ServiceLayoutId;

    /**
    * Time Layout.
    */
    // @ApiMember(Description="Time Layout.")
    int? TimeLayoutId;

    /**
    * Booking Layout.
    */
    // @ApiMember(Description="Booking Layout.")
    int? BookingLayoutId;

    /**
    * The primary color of the booking widget.
    */
    // @ApiMember(Description="The primary color of the booking widget.")
    String? PrimaryColor;

    /**
    * If the site should have dark theme or not.
    */
    // @ApiMember(Description="If the site should have dark theme or not.")
    bool? DarkTheme;

    /**
    * If you should show the service image in the booking widget.
    */
    // @ApiMember(Description="If you should show the service image in the booking widget.")
    bool? ShowServiceImage;

    /**
    * If you should show the rebate code field in the booking widget.
    */
    // @ApiMember(Description="If you should show the rebate code field in the booking widget.")
    bool? ShowRebateCodeField;

    /**
    * If you should show the next available time in the booking widget.
    */
    // @ApiMember(Description="If you should show the next available time in the booking widget.")
    bool? ShowNextAvailableTime;

    /**
    * If you should show the end time in the booking widget.
    */
    // @ApiMember(Description="If you should show the end time in the booking widget.")
    bool? ShowEndTime;

    /**
    * What text to show on booked time slots. Default text is Booked
    */
    // @ApiMember(Description="What text to show on booked time slots. Default text is Booked")
    String? BookedTimeSlotText;

    /**
    * If you should show the create account option.
    */
    // @ApiMember(Description="If you should show the create account option.")
    bool? EnableCreateAccount;

    /**
    * If you should show the login to account option.
    */
    // @ApiMember(Description="If you should show the login to account option.")
    bool? EnableLogin;

    /**
    * If you should show the facebook login to account option.
    */
    // @ApiMember(Description="If you should show the facebook login to account option.")
    bool? EnableFacebookLogin;

    /**
    * If you should show the direct booking option. This enables customer to book with entering contact information.
    */
    // @ApiMember(Description="If you should show the direct booking option. This enables customer to book with entering contact information.")
    bool? EnableDirectBooking;

    UpdateHomepageWidgetSettings({this.CompanyId,this.ServiceLayoutId,this.TimeLayoutId,this.BookingLayoutId,this.PrimaryColor,this.DarkTheme,this.ShowServiceImage,this.ShowRebateCodeField,this.ShowNextAvailableTime,this.ShowEndTime,this.BookedTimeSlotText,this.EnableCreateAccount,this.EnableLogin,this.EnableFacebookLogin,this.EnableDirectBooking});
    UpdateHomepageWidgetSettings.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        CompanyId = json['CompanyId'];
        ServiceLayoutId = json['ServiceLayoutId'];
        TimeLayoutId = json['TimeLayoutId'];
        BookingLayoutId = json['BookingLayoutId'];
        PrimaryColor = json['PrimaryColor'];
        DarkTheme = json['DarkTheme'];
        ShowServiceImage = json['ShowServiceImage'];
        ShowRebateCodeField = json['ShowRebateCodeField'];
        ShowNextAvailableTime = json['ShowNextAvailableTime'];
        ShowEndTime = json['ShowEndTime'];
        BookedTimeSlotText = json['BookedTimeSlotText'];
        EnableCreateAccount = json['EnableCreateAccount'];
        EnableLogin = json['EnableLogin'];
        EnableFacebookLogin = json['EnableFacebookLogin'];
        EnableDirectBooking = json['EnableDirectBooking'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'CompanyId': CompanyId,
        'ServiceLayoutId': ServiceLayoutId,
        'TimeLayoutId': TimeLayoutId,
        'BookingLayoutId': BookingLayoutId,
        'PrimaryColor': PrimaryColor,
        'DarkTheme': DarkTheme,
        'ShowServiceImage': ShowServiceImage,
        'ShowRebateCodeField': ShowRebateCodeField,
        'ShowNextAvailableTime': ShowNextAvailableTime,
        'ShowEndTime': ShowEndTime,
        'BookedTimeSlotText': BookedTimeSlotText,
        'EnableCreateAccount': EnableCreateAccount,
        'EnableLogin': EnableLogin,
        'EnableFacebookLogin': EnableFacebookLogin,
        'EnableDirectBooking': EnableDirectBooking
    };

    getTypeName() => "UpdateHomepageWidgetSettings";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'testapi.bokamera.se', types: <String, TypeInfo> {
    'HomepageWidgetServiceLayoutsResponse': TypeInfo(TypeOf.Class, create:() => HomepageWidgetServiceLayoutsResponse()),
    'HomepageWidgetTimeLayoutsResponse': TypeInfo(TypeOf.Class, create:() => HomepageWidgetTimeLayoutsResponse()),
    'HomepageWidgetBookingLayoutsResponse': TypeInfo(TypeOf.Class, create:() => HomepageWidgetBookingLayoutsResponse()),
    'HomepageWidgetBookingMethodsResponse': TypeInfo(TypeOf.Class, create:() => HomepageWidgetBookingMethodsResponse()),
    'HomepageWidgetSettingsQueryResponse': TypeInfo(TypeOf.Class, create:() => HomepageWidgetSettingsQueryResponse()),
    'List<HomepageWidgetServiceLayoutsResponse>': TypeInfo(TypeOf.Class, create:() => <HomepageWidgetServiceLayoutsResponse>[]),
    'List<HomepageWidgetTimeLayoutsResponse>': TypeInfo(TypeOf.Class, create:() => <HomepageWidgetTimeLayoutsResponse>[]),
    'List<HomepageWidgetBookingLayoutsResponse>': TypeInfo(TypeOf.Class, create:() => <HomepageWidgetBookingLayoutsResponse>[]),
    'List<HomepageWidgetBookingMethodsResponse>': TypeInfo(TypeOf.Class, create:() => <HomepageWidgetBookingMethodsResponse>[]),
    'UpdateHomepageWidgetSettings': TypeInfo(TypeOf.Class, create:() => UpdateHomepageWidgetSettings()),
});

Dart UpdateHomepageWidgetSettings DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + 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: testapi.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>
  <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>
  <TimeLayoutId>0</TimeLayoutId>
  <TimeLayoutOptions>
    <HomepageWidgetTimeLayoutsResponse>
      <Code>String</Code>
      <Description>String</Description>
      <Id>0</Id>
      <Name>String</Name>
    </HomepageWidgetTimeLayoutsResponse>
  </TimeLayoutOptions>
</HomepageWidgetSettingsQueryResponse>