BokaMera.API.Host

<back to all web services

UpdateHomepageSchedulerSettings

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
PUT/homepage/scheduler/settingsUpdate homepage scheduler settingsUpdate homepage scheduler settings on the company of the currently logged in user, only administrators are allowed to update homepage menu.
import 'package:servicestack/servicestack.dart';

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

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

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

    /**
    * The service image url.
    */
    // @ApiMember(Description="The service image url.")
    Uri? ImageUrl;

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

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        Name = json['Name'];
        Description = json['Description'];
        ImageUrl = JsonConverters.fromJson(json['ImageUrl'],'Uri',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'Name': Name,
        'Description': Description,
        'ImageUrl': JsonConverters.toJson(ImageUrl,'Uri',context!)
    };

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

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

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

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

    /**
    * The resource image url.
    */
    // @ApiMember(Description="The resource image url.")
    Uri? ImageUrl;

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

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        Name = json['Name'];
        Description = json['Description'];
        ImageUrl = JsonConverters.fromJson(json['ImageUrl'],'Uri',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'Name': Name,
        'Description': Description,
        'ImageUrl': JsonConverters.toJson(ImageUrl,'Uri',context!)
    };

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

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

    /**
    * If the field should be shown on booking.
    */
    // @ApiMember(Description="If the field should be shown on booking.")
    bool? ShowOnBooking;

    /**
    * If the field should be shown on tooltip.
    */
    // @ApiMember(Description="If the field should be shown on tooltip.")
    bool? ShowOnTooltip;

    HomepageSchedulerFieldResponse({this.Id,this.ShowOnBooking,this.ShowOnTooltip});
    HomepageSchedulerFieldResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'ShowOnBooking': ShowOnBooking,
        'ShowOnTooltip': ShowOnTooltip
    };

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

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

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

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

    /**
    * The field sort order when listing.
    */
    // @ApiMember(Description="The field sort order when listing.")
    int? SortOrder;

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

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

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

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

class ScheduleViewResponse implements IConvertible
{
    int? Id;
    String? Name;

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

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

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

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

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

    /**
    * If the user schedule is activated.
    */
    // @ApiMember(Description="If the user schedule is activated.")
    bool? Active;

    /**
    * If the user schedule views id.
    */
    // @ApiMember(Description="If the user schedule views id.")
    int? ScheduleViewId;

    /**
    * If the user schedule time slots in minutes.
    */
    // @ApiMember(Description="If the user schedule time slots in minutes.")
    int? ScheduleTimeSlotMinutes;

    /**
    * If the user schedule time start time.
    */
    // @ApiMember(Description="If the user schedule time start time.")
    Duration? StartTime;

    /**
    * If the user schedule time end time.
    */
    // @ApiMember(Description="If the user schedule time end time.")
    Duration? EndTime;

    /**
    * If the user schedule should contain time exceptions.
    */
    // @ApiMember(Description="If the user schedule should contain time exceptions.")
    bool? ShowTimeExceptions;

    /**
    * If allow booking in the scheduler.
    */
    // @ApiMember(Description="If allow booking in the scheduler.")
    bool? EnableBooking;

    /**
    * The homepage schedule services that are selected
    */
    // @ApiMember(Description="The homepage schedule services that are selected")
    List<HomepageSchedulerServiceResponse>? Services;

    /**
    * The homepage schedule resources that are selected
    */
    // @ApiMember(Description="The homepage schedule resources that are selected")
    List<HomepageSchedulerResourceResponse>? Resources;

    /**
    * The homepage schedule fields that are selected
    */
    // @ApiMember(Description="The homepage schedule fields that are selected")
    List<HomepageSchedulerFieldResponse>? Fields;

    /**
    * The homepage schedule fields select from
    */
    // @ApiMember(Description="The homepage schedule fields select from")
    List<HomepageSchedulerFieldOptionsResponse>? FieldOptions;

    /**
    * The available schedule view options to choose from
    */
    // @ApiMember(Description="The available schedule view options to choose from")
    List<ScheduleViewResponse>? ScheduleViewOptions;

    HomepageSchedulerSettingsQueryResponse({this.CompanyId,this.Active,this.ScheduleViewId,this.ScheduleTimeSlotMinutes,this.StartTime,this.EndTime,this.ShowTimeExceptions,this.EnableBooking,this.Services,this.Resources,this.Fields,this.FieldOptions,this.ScheduleViewOptions});
    HomepageSchedulerSettingsQueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        CompanyId = json['CompanyId'];
        Active = json['Active'];
        ScheduleViewId = json['ScheduleViewId'];
        ScheduleTimeSlotMinutes = json['ScheduleTimeSlotMinutes'];
        StartTime = JsonConverters.fromJson(json['StartTime'],'Duration',context!);
        EndTime = JsonConverters.fromJson(json['EndTime'],'Duration',context!);
        ShowTimeExceptions = json['ShowTimeExceptions'];
        EnableBooking = json['EnableBooking'];
        Services = JsonConverters.fromJson(json['Services'],'List<HomepageSchedulerServiceResponse>',context!);
        Resources = JsonConverters.fromJson(json['Resources'],'List<HomepageSchedulerResourceResponse>',context!);
        Fields = JsonConverters.fromJson(json['Fields'],'List<HomepageSchedulerFieldResponse>',context!);
        FieldOptions = JsonConverters.fromJson(json['FieldOptions'],'List<HomepageSchedulerFieldOptionsResponse>',context!);
        ScheduleViewOptions = JsonConverters.fromJson(json['ScheduleViewOptions'],'List<ScheduleViewResponse>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'CompanyId': CompanyId,
        'Active': Active,
        'ScheduleViewId': ScheduleViewId,
        'ScheduleTimeSlotMinutes': ScheduleTimeSlotMinutes,
        'StartTime': JsonConverters.toJson(StartTime,'Duration',context!),
        'EndTime': JsonConverters.toJson(EndTime,'Duration',context!),
        'ShowTimeExceptions': ShowTimeExceptions,
        'EnableBooking': EnableBooking,
        'Services': JsonConverters.toJson(Services,'List<HomepageSchedulerServiceResponse>',context!),
        'Resources': JsonConverters.toJson(Resources,'List<HomepageSchedulerResourceResponse>',context!),
        'Fields': JsonConverters.toJson(Fields,'List<HomepageSchedulerFieldResponse>',context!),
        'FieldOptions': JsonConverters.toJson(FieldOptions,'List<HomepageSchedulerFieldOptionsResponse>',context!),
        'ScheduleViewOptions': JsonConverters.toJson(ScheduleViewOptions,'List<ScheduleViewResponse>',context!)
    };

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

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

    HomepageSchedulerResource({this.Id});
    HomepageSchedulerResource.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

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

    HomepageSchedulerService({this.Id});
    HomepageSchedulerService.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class HomepageScheduleField implements IConvertible
{
    /**
    * The field id.
    */
    // @ApiMember(Description="The field id.", IsRequired=true)
    int? Id;

    /**
    * If the field showed on the booking.
    */
    // @ApiMember(Description="If the field showed on the booking.", IsRequired=true)
    bool? ShowOnBooking;

    /**
    * If the field showed on the bookings tooltip.
    */
    // @ApiMember(Description="If the field showed on the bookings tooltip.", IsRequired=true)
    bool? ShowOnTooltip;

    HomepageScheduleField({this.Id,this.ShowOnBooking,this.ShowOnTooltip});
    HomepageScheduleField.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'ShowOnBooking': ShowOnBooking,
        'ShowOnTooltip': ShowOnTooltip
    };

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

// @ValidateRequest(Validator="IsAuthenticated")
class UpdateHomepageSchedulerSettings 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;

    /**
    * If the user schedule is activated.
    */
    // @ApiMember(Description="If the user schedule is activated.")
    bool? Active;

    /**
    * If the user schedule views id.
    */
    // @ApiMember(Description="If the user schedule views id.")
    int? ScheduleViewId;

    /**
    * If the user schedule time slots in minutes.
    */
    // @ApiMember(Description="If the user schedule time slots in minutes.")
    int? ScheduleTimeSlotMinutes;

    /**
    * If the user schedule time start time.
    */
    // @ApiMember(Description="If the user schedule time start time.")
    Duration? StartTime;

    /**
    * If the user schedule time end time.
    */
    // @ApiMember(Description="If the user schedule time end time.")
    Duration? EndTime;

    /**
    * If the user schedule should contain time exceptions.
    */
    // @ApiMember(Description="If the user schedule should contain time exceptions.")
    bool? ShowTimeExceptions;

    /**
    * If allow booking in the scheduler.
    */
    // @ApiMember(Description="If allow booking in the scheduler.")
    bool? EnableBooking;

    /**
    * What resources you want to be shown in scheduler.
    */
    // @ApiMember(Description="What resources you want to be shown in scheduler.")
    List<HomepageSchedulerResource>? Resources;

    /**
    * What services you want to be shown in scheduler.
    */
    // @ApiMember(Description="What services you want to be shown in scheduler.")
    List<HomepageSchedulerService>? Services;

    /**
    * What fields you want to be shown in scheduler.
    */
    // @ApiMember(Description="What fields you want to be shown in scheduler.")
    List<HomepageScheduleField>? Fields;

    UpdateHomepageSchedulerSettings({this.CompanyId,this.Active,this.ScheduleViewId,this.ScheduleTimeSlotMinutes,this.StartTime,this.EndTime,this.ShowTimeExceptions,this.EnableBooking,this.Resources,this.Services,this.Fields});
    UpdateHomepageSchedulerSettings.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        CompanyId = json['CompanyId'];
        Active = json['Active'];
        ScheduleViewId = json['ScheduleViewId'];
        ScheduleTimeSlotMinutes = json['ScheduleTimeSlotMinutes'];
        StartTime = JsonConverters.fromJson(json['StartTime'],'Duration',context!);
        EndTime = JsonConverters.fromJson(json['EndTime'],'Duration',context!);
        ShowTimeExceptions = json['ShowTimeExceptions'];
        EnableBooking = json['EnableBooking'];
        Resources = JsonConverters.fromJson(json['Resources'],'List<HomepageSchedulerResource>',context!);
        Services = JsonConverters.fromJson(json['Services'],'List<HomepageSchedulerService>',context!);
        Fields = JsonConverters.fromJson(json['Fields'],'List<HomepageScheduleField>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'CompanyId': CompanyId,
        'Active': Active,
        'ScheduleViewId': ScheduleViewId,
        'ScheduleTimeSlotMinutes': ScheduleTimeSlotMinutes,
        'StartTime': JsonConverters.toJson(StartTime,'Duration',context!),
        'EndTime': JsonConverters.toJson(EndTime,'Duration',context!),
        'ShowTimeExceptions': ShowTimeExceptions,
        'EnableBooking': EnableBooking,
        'Resources': JsonConverters.toJson(Resources,'List<HomepageSchedulerResource>',context!),
        'Services': JsonConverters.toJson(Services,'List<HomepageSchedulerService>',context!),
        'Fields': JsonConverters.toJson(Fields,'List<HomepageScheduleField>',context!)
    };

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

TypeContext _ctx = TypeContext(library: 'testapi.bokamera.se', types: <String, TypeInfo> {
    'HomepageSchedulerServiceResponse': TypeInfo(TypeOf.Class, create:() => HomepageSchedulerServiceResponse()),
    'Uri': TypeInfo(TypeOf.Class, create:() => Uri()),
    'HomepageSchedulerResourceResponse': TypeInfo(TypeOf.Class, create:() => HomepageSchedulerResourceResponse()),
    'HomepageSchedulerFieldResponse': TypeInfo(TypeOf.Class, create:() => HomepageSchedulerFieldResponse()),
    'HomepageSchedulerFieldOptionsResponse': TypeInfo(TypeOf.Class, create:() => HomepageSchedulerFieldOptionsResponse()),
    'ScheduleViewResponse': TypeInfo(TypeOf.Class, create:() => ScheduleViewResponse()),
    'HomepageSchedulerSettingsQueryResponse': TypeInfo(TypeOf.Class, create:() => HomepageSchedulerSettingsQueryResponse()),
    'List<HomepageSchedulerServiceResponse>': TypeInfo(TypeOf.Class, create:() => <HomepageSchedulerServiceResponse>[]),
    'List<HomepageSchedulerResourceResponse>': TypeInfo(TypeOf.Class, create:() => <HomepageSchedulerResourceResponse>[]),
    'List<HomepageSchedulerFieldResponse>': TypeInfo(TypeOf.Class, create:() => <HomepageSchedulerFieldResponse>[]),
    'List<HomepageSchedulerFieldOptionsResponse>': TypeInfo(TypeOf.Class, create:() => <HomepageSchedulerFieldOptionsResponse>[]),
    'List<ScheduleViewResponse>': TypeInfo(TypeOf.Class, create:() => <ScheduleViewResponse>[]),
    'HomepageSchedulerResource': TypeInfo(TypeOf.Class, create:() => HomepageSchedulerResource()),
    'HomepageSchedulerService': TypeInfo(TypeOf.Class, create:() => HomepageSchedulerService()),
    'HomepageScheduleField': TypeInfo(TypeOf.Class, create:() => HomepageScheduleField()),
    'UpdateHomepageSchedulerSettings': TypeInfo(TypeOf.Class, create:() => UpdateHomepageSchedulerSettings()),
    'List<HomepageSchedulerResource>': TypeInfo(TypeOf.Class, create:() => <HomepageSchedulerResource>[]),
    'List<HomepageSchedulerService>': TypeInfo(TypeOf.Class, create:() => <HomepageSchedulerService>[]),
    'List<HomepageScheduleField>': TypeInfo(TypeOf.Class, create:() => <HomepageScheduleField>[]),
});

Dart UpdateHomepageSchedulerSettings DTOs

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

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

PUT /homepage/scheduler/settings HTTP/1.1 
Host: testapi.bokamera.se 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"CompanyId":"00000000-0000-0000-0000-000000000000","Active":false,"ScheduleViewId":0,"ScheduleTimeSlotMinutes":0,"StartTime":"00:00:00","EndTime":"00:00:00","ShowTimeExceptions":false,"EnableBooking":false,"Resources":[{"Id":0}],"Services":[{"Id":0}],"Fields":[{"Id":0,"ShowOnBooking":false,"ShowOnTooltip":false}]}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"Active":false,"ScheduleViewId":0,"ScheduleTimeSlotMinutes":0,"StartTime":"00:00:00","EndTime":"00:00:00","ShowTimeExceptions":false,"EnableBooking":false,"Services":[{"Id":0,"Name":"String","Description":"String"}],"Resources":[{"Id":0,"Name":"String","Description":"String"}],"Fields":[{"Id":0,"ShowOnBooking":false,"ShowOnTooltip":false}],"FieldOptions":[{"Id":0,"Name":"String","Description":"String","SortOrder":0}],"ScheduleViewOptions":[{"Id":0,"Name":"String"}]}