/* Options:
Date: 2025-04-14 13:15:00
Version: 8.23
Tip: To override a DTO option, remove "//" prefix before updating
BaseUrl: https://api.bokamera.se

//GlobalNamespace: 
//AddServiceStackTypes: True
//AddResponseStatus: False
//AddImplicitVersion: 
//AddDescriptionAsComments: True
IncludeTypes: RecuringScheduleQuery.*
//ExcludeTypes: 
//DefaultImports: package:servicestack/servicestack.dart
*/

import 'package:servicestack/servicestack.dart';

enum BookingStatusEnum
{
    Booked,
    Unbooked,
    Reserved,
    Canceled,
    AwaitingPayment,
    AwaitingPaymentNoTimeLimit,
    Payed,
    AwaitingPaymentRequestFromAdmin,
    AwaitingPaymentFromProvider,
    Invoiced,
}

abstract class IInterval
{
    DateTime? From;
    DateTime? To;
}

class BaseModel implements IConvertible
{
    BaseModel();
    BaseModel.fromJson(Map<String, dynamic> json) : super();
    fromMap(Map<String, dynamic> json) {
        return this;
    }

    Map<String, dynamic> toJson() => {};
    getTypeName() => "BaseModel";
    TypeContext? context = _ctx;
}

class CustomFieldValue extends BaseModel implements IConvertible
{
    // @Required()
    String? CompanyId;

    int? Id;
    // @Required()
    String? Value;

    // @Required()
    bool? Active;

    int? SortOrder;
    DateTime? ModifiedDate;

    CustomFieldValue({this.CompanyId,this.Id,this.Value,this.Active,this.SortOrder,this.ModifiedDate});
    CustomFieldValue.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        CompanyId = json['CompanyId'];
        Id = json['Id'];
        Value = json['Value'];
        Active = json['Active'];
        SortOrder = json['SortOrder'];
        ModifiedDate = JsonConverters.fromJson(json['ModifiedDate'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'CompanyId': CompanyId,
        'Id': Id,
        'Value': Value,
        'Active': Active,
        'SortOrder': SortOrder,
        'ModifiedDate': JsonConverters.toJson(ModifiedDate,'DateTime',context!)
    });

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

class CustomField extends BaseModel implements IConvertible
{
    // @Required()
    String? Table;

    // @Required()
    String? Column;

    // @Required()
    String? DataType;

    // @Required()
    String? Description;

    // @Required()
    bool? Active;

    DateTime? ModifiedDate;
    int? Id;

    CustomField({this.Table,this.Column,this.DataType,this.Description,this.Active,this.ModifiedDate,this.Id});
    CustomField.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        Table = json['Table'];
        Column = json['Column'];
        DataType = json['DataType'];
        Description = json['Description'];
        Active = json['Active'];
        ModifiedDate = JsonConverters.fromJson(json['ModifiedDate'],'DateTime',context!);
        Id = json['Id'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'Table': Table,
        'Column': Column,
        'DataType': DataType,
        'Description': Description,
        'Active': Active,
        'ModifiedDate': JsonConverters.toJson(ModifiedDate,'DateTime',context!),
        'Id': Id
    });

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

class RegEx extends BaseModel implements IConvertible
{
    // @Required()
    String? Name;

    // @Required()
    String? Description;

    // @Required()
    String? RegExCode;

    String? ErrorMessage;
    DateTime? ModifiedDate;
    int? Id;

    RegEx({this.Name,this.Description,this.RegExCode,this.ErrorMessage,this.ModifiedDate,this.Id});
    RegEx.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        Name = json['Name'];
        Description = json['Description'];
        RegExCode = json['RegExCode'];
        ErrorMessage = json['ErrorMessage'];
        ModifiedDate = JsonConverters.fromJson(json['ModifiedDate'],'DateTime',context!);
        Id = json['Id'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'Name': Name,
        'Description': Description,
        'RegExCode': RegExCode,
        'ErrorMessage': ErrorMessage,
        'ModifiedDate': JsonConverters.toJson(ModifiedDate,'DateTime',context!),
        'Id': Id
    });

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

class CustomFieldServiceRelation extends BaseModel implements IConvertible
{
    // @Required()
    String? CompanyId;

    int? Id;
    // @Required()
    int? CustomFieldConfigId;

    // @Required()
    int? ServiceId;

    DateTime? ModifiedDate;

    CustomFieldServiceRelation({this.CompanyId,this.Id,this.CustomFieldConfigId,this.ServiceId,this.ModifiedDate});
    CustomFieldServiceRelation.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        CompanyId = json['CompanyId'];
        Id = json['Id'];
        CustomFieldConfigId = json['CustomFieldConfigId'];
        ServiceId = json['ServiceId'];
        ModifiedDate = JsonConverters.fromJson(json['ModifiedDate'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'CompanyId': CompanyId,
        'Id': Id,
        'CustomFieldConfigId': CustomFieldConfigId,
        'ServiceId': ServiceId,
        'ModifiedDate': JsonConverters.toJson(ModifiedDate,'DateTime',context!)
    });

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

class CustomFieldConfig extends BaseModel implements IConvertible
{
    // @Ignore()
    List<CustomFieldValue>? Values;

    CustomField? CustomField;
    // @Ignore()
    RegEx? RegEx;

    // @Ignore()
    List<Service>? Services;

    List<CustomFieldServiceRelation>? CustomFieldServiceRelation;
    // @Required()
    String? CompanyId;

    int? Id;
    int? GroupId;
    // @Required()
    int? FieldId;

    // @Required()
    int? IconId;

    int? RegExId;
    // @Required()
    String? Name;

    // @Required()
    String? Description;

    // @Required()
    String? Datatype;

    // @Required()
    int? MaxLength;

    // @Required()
    bool? IsPublic;

    // @Required()
    bool? IsHidden;

    // @Required()
    bool? IsMandatory;

    String? DefaultValue;
    String? RegExErrorMessage;
    String? MandatoryErrorMessage;
    int? Width;
    // @Required()
    bool? MultipleLineText;

    DateTime? ModifiedDate;

    CustomFieldConfig({this.Values,this.CustomField,this.RegEx,this.Services,this.CustomFieldServiceRelation,this.CompanyId,this.Id,this.GroupId,this.FieldId,this.IconId,this.RegExId,this.Name,this.Description,this.Datatype,this.MaxLength,this.IsPublic,this.IsHidden,this.IsMandatory,this.DefaultValue,this.RegExErrorMessage,this.MandatoryErrorMessage,this.Width,this.MultipleLineText,this.ModifiedDate});
    CustomFieldConfig.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        Values = JsonConverters.fromJson(json['Values'],'List<CustomFieldValue>',context!);
        CustomField = JsonConverters.fromJson(json['CustomField'],'CustomField',context!);
        RegEx = JsonConverters.fromJson(json['RegEx'],'RegEx',context!);
        Services = JsonConverters.fromJson(json['Services'],'List<Service>',context!);
        CustomFieldServiceRelation = JsonConverters.fromJson(json['CustomFieldServiceRelation'],'List<CustomFieldServiceRelation>',context!);
        CompanyId = json['CompanyId'];
        Id = json['Id'];
        GroupId = json['GroupId'];
        FieldId = json['FieldId'];
        IconId = json['IconId'];
        RegExId = json['RegExId'];
        Name = json['Name'];
        Description = json['Description'];
        Datatype = json['Datatype'];
        MaxLength = json['MaxLength'];
        IsPublic = json['IsPublic'];
        IsHidden = json['IsHidden'];
        IsMandatory = json['IsMandatory'];
        DefaultValue = json['DefaultValue'];
        RegExErrorMessage = json['RegExErrorMessage'];
        MandatoryErrorMessage = json['MandatoryErrorMessage'];
        Width = json['Width'];
        MultipleLineText = json['MultipleLineText'];
        ModifiedDate = JsonConverters.fromJson(json['ModifiedDate'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'Values': JsonConverters.toJson(Values,'List<CustomFieldValue>',context!),
        'CustomField': JsonConverters.toJson(CustomField,'CustomField',context!),
        'RegEx': JsonConverters.toJson(RegEx,'RegEx',context!),
        'Services': JsonConverters.toJson(Services,'List<Service>',context!),
        'CustomFieldServiceRelation': JsonConverters.toJson(CustomFieldServiceRelation,'List<CustomFieldServiceRelation>',context!),
        'CompanyId': CompanyId,
        'Id': Id,
        'GroupId': GroupId,
        'FieldId': FieldId,
        'IconId': IconId,
        'RegExId': RegExId,
        'Name': Name,
        'Description': Description,
        'Datatype': Datatype,
        'MaxLength': MaxLength,
        'IsPublic': IsPublic,
        'IsHidden': IsHidden,
        'IsMandatory': IsMandatory,
        'DefaultValue': DefaultValue,
        'RegExErrorMessage': RegExErrorMessage,
        'MandatoryErrorMessage': MandatoryErrorMessage,
        'Width': Width,
        'MultipleLineText': MultipleLineText,
        'ModifiedDate': JsonConverters.toJson(ModifiedDate,'DateTime',context!)
    });

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

abstract class ITimeException extends IInterval
{
    int? Id;
    String? ReasonText;
    bool? IsBlock;
    String? ReasonTextPublic;
    bool? IsRecurring;
    List<int>? ResourceIds;
}

class BookedCustomer implements IConvertible
{
    String? Id;
    String? Firstname;
    String? Lastname;
    String? Email;
    String? Phone;
    String? FacebookUserName;
    String? ImageUrl;
    String? CorporateIdentityNumber;
    String? InvoiceAddress1;
    String? InvoiceAddress2;
    String? InvoiceCity;
    String? InvoicePostalCode;
    String? InvoiceCountryCode;

    BookedCustomer({this.Id,this.Firstname,this.Lastname,this.Email,this.Phone,this.FacebookUserName,this.ImageUrl,this.CorporateIdentityNumber,this.InvoiceAddress1,this.InvoiceAddress2,this.InvoiceCity,this.InvoicePostalCode,this.InvoiceCountryCode});
    BookedCustomer.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        Firstname = json['Firstname'];
        Lastname = json['Lastname'];
        Email = json['Email'];
        Phone = json['Phone'];
        FacebookUserName = json['FacebookUserName'];
        ImageUrl = json['ImageUrl'];
        CorporateIdentityNumber = json['CorporateIdentityNumber'];
        InvoiceAddress1 = json['InvoiceAddress1'];
        InvoiceAddress2 = json['InvoiceAddress2'];
        InvoiceCity = json['InvoiceCity'];
        InvoicePostalCode = json['InvoicePostalCode'];
        InvoiceCountryCode = json['InvoiceCountryCode'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'Firstname': Firstname,
        'Lastname': Lastname,
        'Email': Email,
        'Phone': Phone,
        'FacebookUserName': FacebookUserName,
        'ImageUrl': ImageUrl,
        'CorporateIdentityNumber': CorporateIdentityNumber,
        'InvoiceAddress1': InvoiceAddress1,
        'InvoiceAddress2': InvoiceAddress2,
        'InvoiceCity': InvoiceCity,
        'InvoicePostalCode': InvoicePostalCode,
        'InvoiceCountryCode': InvoiceCountryCode
    };

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

abstract class IBookedTime extends IInterval
{
    int? Id;
    int? ServiceId;
    int? BookedSpots;
    int? TotalSpots;
    int? PauseAfterInMinutes;
    BookingStatusEnum? Status;
    int? StatusId;
    BookedCustomer? Customer;
}

class CustomFieldDataResponse implements IConvertible
{
    int? Id;
    String? Column;
    String? Name;
    String? Description;
    String? Value;
    /**
    * Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox'
    */
    // @ApiMember(Description="Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox'")
    String? DataType;

    CustomFieldDataResponse({this.Id,this.Column,this.Name,this.Description,this.Value,this.DataType});
    CustomFieldDataResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class Resource extends BaseModel implements ICustomFieldTable, IBaseModelCreated, IBaseModelUpdated, IConvertible
{
    // @Ignore()
    int? Priority;

    // @Ignore()
    List<ISchedule>? Schedules;

    // @Ignore()
    List<ITimeException>? Exceptions;

    // @Ignore()
    List<IBookedTime>? Bookings;

    // @Ignore()
    List<CustomFieldConfig>? CustomFieldsConfig;

    // @Ignore()
    List<CustomFieldDataResponse>? CustomFieldsData;

    // @Required()
    String? CompanyId;

    int? Id;
    // @Required()
    String? Name;

    // @Required()
    bool? Active;

    String? Description;
    String? ImageUrl;
    // @Required()
    DateTime? UpdatedDate;

    // @Required()
    DateTime? CreatedDate;

    // @Required()
    String? Color;

    String? Email;
    String? MobilePhone;
    bool? EmailNotification;
    bool? SMSNotification;
    // @Required()
    bool? SendSMSReminder;

    // @Required()
    bool? SendEmailReminder;

    DateTime? ModifiedDate;
    String? AccessGroup;
    String? TextField1;
    String? TextField2;
    String? TextField3;
    String? TextField4;
    String? TextField5;
    String? TextField6;
    String? TextField7;
    String? TextField8;
    String? TextField9;
    String? TextField10;
    String? TextField11;
    String? TextField12;
    String? TextField13;
    String? TextField14;
    String? TextField15;
    String? TextField16;
    String? TextField17;
    String? TextField18;
    String? TextField19;
    String? TextField20;

    Resource({this.Priority,this.Schedules,this.Exceptions,this.Bookings,this.CustomFieldsConfig,this.CustomFieldsData,this.CompanyId,this.Id,this.Name,this.Active,this.Description,this.ImageUrl,this.UpdatedDate,this.CreatedDate,this.Color,this.Email,this.MobilePhone,this.EmailNotification,this.SMSNotification,this.SendSMSReminder,this.SendEmailReminder,this.ModifiedDate,this.AccessGroup,this.TextField1,this.TextField2,this.TextField3,this.TextField4,this.TextField5,this.TextField6,this.TextField7,this.TextField8,this.TextField9,this.TextField10,this.TextField11,this.TextField12,this.TextField13,this.TextField14,this.TextField15,this.TextField16,this.TextField17,this.TextField18,this.TextField19,this.TextField20});
    Resource.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        Priority = json['Priority'];
        Schedules = JsonConverters.fromJson(json['Schedules'],'List<ISchedule>',context!);
        Exceptions = JsonConverters.fromJson(json['Exceptions'],'List<ITimeException>',context!);
        Bookings = JsonConverters.fromJson(json['Bookings'],'List<IBookedTime>',context!);
        CustomFieldsConfig = JsonConverters.fromJson(json['CustomFieldsConfig'],'List<CustomFieldConfig>',context!);
        CustomFieldsData = JsonConverters.fromJson(json['CustomFieldsData'],'List<CustomFieldDataResponse>',context!);
        CompanyId = json['CompanyId'];
        Id = json['Id'];
        Name = json['Name'];
        Active = json['Active'];
        Description = json['Description'];
        ImageUrl = json['ImageUrl'];
        UpdatedDate = JsonConverters.fromJson(json['UpdatedDate'],'DateTime',context!);
        CreatedDate = JsonConverters.fromJson(json['CreatedDate'],'DateTime',context!);
        Color = json['Color'];
        Email = json['Email'];
        MobilePhone = json['MobilePhone'];
        EmailNotification = json['EmailNotification'];
        SMSNotification = json['SMSNotification'];
        SendSMSReminder = json['SendSMSReminder'];
        SendEmailReminder = json['SendEmailReminder'];
        ModifiedDate = JsonConverters.fromJson(json['ModifiedDate'],'DateTime',context!);
        AccessGroup = json['AccessGroup'];
        TextField1 = json['TextField1'];
        TextField2 = json['TextField2'];
        TextField3 = json['TextField3'];
        TextField4 = json['TextField4'];
        TextField5 = json['TextField5'];
        TextField6 = json['TextField6'];
        TextField7 = json['TextField7'];
        TextField8 = json['TextField8'];
        TextField9 = json['TextField9'];
        TextField10 = json['TextField10'];
        TextField11 = json['TextField11'];
        TextField12 = json['TextField12'];
        TextField13 = json['TextField13'];
        TextField14 = json['TextField14'];
        TextField15 = json['TextField15'];
        TextField16 = json['TextField16'];
        TextField17 = json['TextField17'];
        TextField18 = json['TextField18'];
        TextField19 = json['TextField19'];
        TextField20 = json['TextField20'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'Priority': Priority,
        'Schedules': JsonConverters.toJson(Schedules,'List<ISchedule>',context!),
        'Exceptions': JsonConverters.toJson(Exceptions,'List<ITimeException>',context!),
        'Bookings': JsonConverters.toJson(Bookings,'List<IBookedTime>',context!),
        'CustomFieldsConfig': JsonConverters.toJson(CustomFieldsConfig,'List<CustomFieldConfig>',context!),
        'CustomFieldsData': JsonConverters.toJson(CustomFieldsData,'List<CustomFieldDataResponse>',context!),
        'CompanyId': CompanyId,
        'Id': Id,
        'Name': Name,
        'Active': Active,
        'Description': Description,
        'ImageUrl': ImageUrl,
        'UpdatedDate': JsonConverters.toJson(UpdatedDate,'DateTime',context!),
        'CreatedDate': JsonConverters.toJson(CreatedDate,'DateTime',context!),
        'Color': Color,
        'Email': Email,
        'MobilePhone': MobilePhone,
        'EmailNotification': EmailNotification,
        'SMSNotification': SMSNotification,
        'SendSMSReminder': SendSMSReminder,
        'SendEmailReminder': SendEmailReminder,
        'ModifiedDate': JsonConverters.toJson(ModifiedDate,'DateTime',context!),
        'AccessGroup': AccessGroup,
        'TextField1': TextField1,
        'TextField2': TextField2,
        'TextField3': TextField3,
        'TextField4': TextField4,
        'TextField5': TextField5,
        'TextField6': TextField6,
        'TextField7': TextField7,
        'TextField8': TextField8,
        'TextField9': TextField9,
        'TextField10': TextField10,
        'TextField11': TextField11,
        'TextField12': TextField12,
        'TextField13': TextField13,
        'TextField14': TextField14,
        'TextField15': TextField15,
        'TextField16': TextField16,
        'TextField17': TextField17,
        'TextField18': TextField18,
        'TextField19': TextField19,
        'TextField20': TextField20
    });

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

enum ScheduleType
{
    NotDefined,
    RecurringSchedule,
    DateSchedule,
}

abstract class ISchedule
{
    String? CompanyId;
    List<Resource>? Resources;
    ScheduleType? Type;
    bool? Active;
    bool? IsResourceSpecific;
}

class RecurringScheduleDate extends BaseModel implements IInterval, IConvertible
{
    // @Ignore()
    DateTime? From;

    // @Ignore()
    DateTime? To;

    // @Required()
    String? CompanyId;

    int? Id;
    // @Required()
    int? RecurringScheduleId;

    // @Required()
    DateTime? Date;

    // @Required()
    Duration? StartTime;

    // @Required()
    Duration? EndTime;

    DateTime? ModifiedDate;

    RecurringScheduleDate({this.From,this.To,this.CompanyId,this.Id,this.RecurringScheduleId,this.Date,this.StartTime,this.EndTime,this.ModifiedDate});
    RecurringScheduleDate.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        From = JsonConverters.fromJson(json['From'],'DateTime',context!);
        To = JsonConverters.fromJson(json['To'],'DateTime',context!);
        CompanyId = json['CompanyId'];
        Id = json['Id'];
        RecurringScheduleId = json['RecurringScheduleId'];
        Date = JsonConverters.fromJson(json['Date'],'DateTime',context!);
        StartTime = JsonConverters.fromJson(json['StartTime'],'Duration',context!);
        EndTime = JsonConverters.fromJson(json['EndTime'],'Duration',context!);
        ModifiedDate = JsonConverters.fromJson(json['ModifiedDate'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'From': JsonConverters.toJson(From,'DateTime',context!),
        'To': JsonConverters.toJson(To,'DateTime',context!),
        'CompanyId': CompanyId,
        'Id': Id,
        'RecurringScheduleId': RecurringScheduleId,
        'Date': JsonConverters.toJson(Date,'DateTime',context!),
        'StartTime': JsonConverters.toJson(StartTime,'Duration',context!),
        'EndTime': JsonConverters.toJson(EndTime,'Duration',context!),
        'ModifiedDate': JsonConverters.toJson(ModifiedDate,'DateTime',context!)
    });

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

class RecurringScheduleResourceRelation extends BaseModel implements IConvertible
{
    // @Required()
    String? CompanyId;

    // @Required()
    int? RecurringScheduleId;

    // @Required()
    int? ResourceId;

    int? Id;
    DateTime? ModifiedDate;

    RecurringScheduleResourceRelation({this.CompanyId,this.RecurringScheduleId,this.ResourceId,this.Id,this.ModifiedDate});
    RecurringScheduleResourceRelation.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        CompanyId = json['CompanyId'];
        RecurringScheduleId = json['RecurringScheduleId'];
        ResourceId = json['ResourceId'];
        Id = json['Id'];
        ModifiedDate = JsonConverters.fromJson(json['ModifiedDate'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'CompanyId': CompanyId,
        'RecurringScheduleId': RecurringScheduleId,
        'ResourceId': ResourceId,
        'Id': Id,
        'ModifiedDate': JsonConverters.toJson(ModifiedDate,'DateTime',context!)
    });

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

enum BokaMeraDayOfWeek
{
    Monday,
    Tuesday,
    Wednesday,
    Thursday,
    Friday,
    Saturday,
    Sunday,
}

class RecurringScheduleDayOfWeekRelation extends BaseModel implements IConvertible
{
    // @Ignore()
    BokaMeraDayOfWeek? DayOfWeek;

    // @Required()
    int? DayOfWeekId;

    // @Required()
    String? CompanyId;

    // @Required()
    int? RecurringScheduleId;

    int? Id;
    DateTime? ModifiedDate;

    RecurringScheduleDayOfWeekRelation({this.DayOfWeek,this.DayOfWeekId,this.CompanyId,this.RecurringScheduleId,this.Id,this.ModifiedDate});
    RecurringScheduleDayOfWeekRelation.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        DayOfWeek = JsonConverters.fromJson(json['DayOfWeek'],'BokaMeraDayOfWeek',context!);
        DayOfWeekId = json['DayOfWeekId'];
        CompanyId = json['CompanyId'];
        RecurringScheduleId = json['RecurringScheduleId'];
        Id = json['Id'];
        ModifiedDate = JsonConverters.fromJson(json['ModifiedDate'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'DayOfWeek': JsonConverters.toJson(DayOfWeek,'BokaMeraDayOfWeek',context!),
        'DayOfWeekId': DayOfWeekId,
        'CompanyId': CompanyId,
        'RecurringScheduleId': RecurringScheduleId,
        'Id': Id,
        'ModifiedDate': JsonConverters.toJson(ModifiedDate,'DateTime',context!)
    });

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

class ServiceRecurringScheduleRelation extends BaseModel implements IConvertible
{
    // @Required()
    String? CompanyId;

    // @Required()
    int? ServiceId;

    // @Required()
    int? RecurringScheduleId;

    int? Id;
    DateTime? ModifiedDate;

    ServiceRecurringScheduleRelation({this.CompanyId,this.ServiceId,this.RecurringScheduleId,this.Id,this.ModifiedDate});
    ServiceRecurringScheduleRelation.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        CompanyId = json['CompanyId'];
        ServiceId = json['ServiceId'];
        RecurringScheduleId = json['RecurringScheduleId'];
        Id = json['Id'];
        ModifiedDate = JsonConverters.fromJson(json['ModifiedDate'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'CompanyId': CompanyId,
        'ServiceId': ServiceId,
        'RecurringScheduleId': RecurringScheduleId,
        'Id': Id,
        'ModifiedDate': JsonConverters.toJson(ModifiedDate,'DateTime',context!)
    });

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

class RecurringScheduleException extends BaseModel implements IScheduleException, IConvertible
{
    // @Required()
    String? CompanyId;

    // @Required()
    int? RecurringScheduleId;

    int? Id;
    DateTime? ModifiedDate;
    // @Required()
    Duration? StartTime;

    // @Required()
    Duration? EndTime;

    RecurringScheduleException({this.CompanyId,this.RecurringScheduleId,this.Id,this.ModifiedDate,this.StartTime,this.EndTime});
    RecurringScheduleException.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        CompanyId = json['CompanyId'];
        RecurringScheduleId = json['RecurringScheduleId'];
        Id = json['Id'];
        ModifiedDate = JsonConverters.fromJson(json['ModifiedDate'],'DateTime',context!);
        StartTime = JsonConverters.fromJson(json['StartTime'],'Duration',context!);
        EndTime = JsonConverters.fromJson(json['EndTime'],'Duration',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'CompanyId': CompanyId,
        'RecurringScheduleId': RecurringScheduleId,
        'Id': Id,
        'ModifiedDate': JsonConverters.toJson(ModifiedDate,'DateTime',context!),
        'StartTime': JsonConverters.toJson(StartTime,'Duration',context!),
        'EndTime': JsonConverters.toJson(EndTime,'Duration',context!)
    });

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

abstract class IScheduleException
{
    Duration? StartTime;
    Duration? EndTime;
}

class RecurringSchedule extends BaseModel implements ISchedule, IBaseModelCreated, IBaseModelUpdated, IConvertible
{
    // @Ignore()
    ScheduleType? Type;

    // @Ignore()
    List<RecurringScheduleDate>? Dates;

    // @Ignore()
    List<Resource>? Resources;

    // @Ignore()
    List<Service>? Services;

    List<RecurringScheduleResourceRelation>? RecurringScheduleResourceRelation;
    List<RecurringScheduleDate>? RecurringScheduleDates;
    List<RecurringScheduleDayOfWeekRelation>? RecurringScheduleDayOfWeekRelation;
    List<ServiceRecurringScheduleRelation>? ServiceRecurringScheduleRelation;
    List<RecurringScheduleException>? RecurringScheduleExceptions;
    // @Ignore()
    List<IScheduleException>? Exceptions;

    // @Ignore()
    bool? IsRecurringByDayOfWeek;

    // @Ignore()
    bool? IsRecurringByDates;

    // @Ignore()
    bool? IsResourceSpecific;

    // @Required()
    String? CompanyId;

    int? Id;
    // @Required()
    String? Name;

    // @Required()
    String? Description;

    // @Required()
    int? TimeInterval;

    // @Required()
    Duration? StartTime;

    // @Required()
    Duration? EndTime;

    // @Required()
    int? NumberOfScheduleDays;

    // @Required()
    DateTime? UpdatedDate;

    // @Required()
    DateTime? CreatedDate;

    // @Required()
    bool? EnableBookingUntilClosingTime;

    // @Required()
    DateTime? ValidFrom;

    // @Required()
    DateTime? ValidTo;

    DateTime? ModifiedDate;
    // @Required()
    bool? Active;

    RecurringSchedule({this.Type,this.Dates,this.Resources,this.Services,this.RecurringScheduleResourceRelation,this.RecurringScheduleDates,this.RecurringScheduleDayOfWeekRelation,this.ServiceRecurringScheduleRelation,this.RecurringScheduleExceptions,this.Exceptions,this.IsRecurringByDayOfWeek,this.IsRecurringByDates,this.IsResourceSpecific,this.CompanyId,this.Id,this.Name,this.Description,this.TimeInterval,this.StartTime,this.EndTime,this.NumberOfScheduleDays,this.UpdatedDate,this.CreatedDate,this.EnableBookingUntilClosingTime,this.ValidFrom,this.ValidTo,this.ModifiedDate,this.Active});
    RecurringSchedule.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        Type = JsonConverters.fromJson(json['Type'],'ScheduleType',context!);
        Dates = JsonConverters.fromJson(json['Dates'],'List<RecurringScheduleDate>',context!);
        Resources = JsonConverters.fromJson(json['Resources'],'List<Resource>',context!);
        Services = JsonConverters.fromJson(json['Services'],'List<Service>',context!);
        RecurringScheduleResourceRelation = JsonConverters.fromJson(json['RecurringScheduleResourceRelation'],'List<RecurringScheduleResourceRelation>',context!);
        RecurringScheduleDates = JsonConverters.fromJson(json['RecurringScheduleDates'],'List<RecurringScheduleDate>',context!);
        RecurringScheduleDayOfWeekRelation = JsonConverters.fromJson(json['RecurringScheduleDayOfWeekRelation'],'List<RecurringScheduleDayOfWeekRelation>',context!);
        ServiceRecurringScheduleRelation = JsonConverters.fromJson(json['ServiceRecurringScheduleRelation'],'List<ServiceRecurringScheduleRelation>',context!);
        RecurringScheduleExceptions = JsonConverters.fromJson(json['RecurringScheduleExceptions'],'List<RecurringScheduleException>',context!);
        Exceptions = JsonConverters.fromJson(json['Exceptions'],'List<IScheduleException>',context!);
        IsRecurringByDayOfWeek = json['IsRecurringByDayOfWeek'];
        IsRecurringByDates = json['IsRecurringByDates'];
        IsResourceSpecific = json['IsResourceSpecific'];
        CompanyId = json['CompanyId'];
        Id = json['Id'];
        Name = json['Name'];
        Description = json['Description'];
        TimeInterval = json['TimeInterval'];
        StartTime = JsonConverters.fromJson(json['StartTime'],'Duration',context!);
        EndTime = JsonConverters.fromJson(json['EndTime'],'Duration',context!);
        NumberOfScheduleDays = json['NumberOfScheduleDays'];
        UpdatedDate = JsonConverters.fromJson(json['UpdatedDate'],'DateTime',context!);
        CreatedDate = JsonConverters.fromJson(json['CreatedDate'],'DateTime',context!);
        EnableBookingUntilClosingTime = json['EnableBookingUntilClosingTime'];
        ValidFrom = JsonConverters.fromJson(json['ValidFrom'],'DateTime',context!);
        ValidTo = JsonConverters.fromJson(json['ValidTo'],'DateTime',context!);
        ModifiedDate = JsonConverters.fromJson(json['ModifiedDate'],'DateTime',context!);
        Active = json['Active'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'Type': JsonConverters.toJson(Type,'ScheduleType',context!),
        'Dates': JsonConverters.toJson(Dates,'List<RecurringScheduleDate>',context!),
        'Resources': JsonConverters.toJson(Resources,'List<Resource>',context!),
        'Services': JsonConverters.toJson(Services,'List<Service>',context!),
        'RecurringScheduleResourceRelation': JsonConverters.toJson(RecurringScheduleResourceRelation,'List<RecurringScheduleResourceRelation>',context!),
        'RecurringScheduleDates': JsonConverters.toJson(RecurringScheduleDates,'List<RecurringScheduleDate>',context!),
        'RecurringScheduleDayOfWeekRelation': JsonConverters.toJson(RecurringScheduleDayOfWeekRelation,'List<RecurringScheduleDayOfWeekRelation>',context!),
        'ServiceRecurringScheduleRelation': JsonConverters.toJson(ServiceRecurringScheduleRelation,'List<ServiceRecurringScheduleRelation>',context!),
        'RecurringScheduleExceptions': JsonConverters.toJson(RecurringScheduleExceptions,'List<RecurringScheduleException>',context!),
        'Exceptions': JsonConverters.toJson(Exceptions,'List<IScheduleException>',context!),
        'IsRecurringByDayOfWeek': IsRecurringByDayOfWeek,
        'IsRecurringByDates': IsRecurringByDates,
        'IsResourceSpecific': IsResourceSpecific,
        'CompanyId': CompanyId,
        'Id': Id,
        'Name': Name,
        'Description': Description,
        'TimeInterval': TimeInterval,
        'StartTime': JsonConverters.toJson(StartTime,'Duration',context!),
        'EndTime': JsonConverters.toJson(EndTime,'Duration',context!),
        'NumberOfScheduleDays': NumberOfScheduleDays,
        'UpdatedDate': JsonConverters.toJson(UpdatedDate,'DateTime',context!),
        'CreatedDate': JsonConverters.toJson(CreatedDate,'DateTime',context!),
        'EnableBookingUntilClosingTime': EnableBookingUntilClosingTime,
        'ValidFrom': JsonConverters.toJson(ValidFrom,'DateTime',context!),
        'ValidTo': JsonConverters.toJson(ValidTo,'DateTime',context!),
        'ModifiedDate': JsonConverters.toJson(ModifiedDate,'DateTime',context!),
        'Active': Active
    });

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

class DayOfWeekDto implements IConvertible
{
    int? DayOfWeekId;
    int? DotNetDayOfWeekId;
    String? DayOfWeek;

    DayOfWeekDto({this.DayOfWeekId,this.DotNetDayOfWeekId,this.DayOfWeek});
    DayOfWeekDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'DayOfWeekId': DayOfWeekId,
        'DotNetDayOfWeekId': DotNetDayOfWeekId,
        'DayOfWeek': DayOfWeek
    };

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

class ScheduleResources implements IConvertible
{
    int? Id;
    /**
    * Name of the resource
    */
    // @ApiMember(Description="Name of the resource")
    String? Name;

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

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

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

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

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

class ScheduleServices implements IConvertible
{
    int? Id;
    /**
    * Name of the service
    */
    // @ApiMember(Description="Name of the service")
    String? Name;

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

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

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

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

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

class RecurringScheduleExceptionResponse implements IConvertible
{
    /**
    * Start time of the schedule exception.
    */
    // @ApiMember(Description="Start time of the schedule exception.")
    Duration? StartTime;

    /**
    * End time of the schedule exception.
    */
    // @ApiMember(Description="End time of the schedule exception.")
    Duration? EndTime;

    RecurringScheduleExceptionResponse({this.StartTime,this.EndTime});
    RecurringScheduleExceptionResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        StartTime = JsonConverters.fromJson(json['StartTime'],'Duration',context!);
        EndTime = JsonConverters.fromJson(json['EndTime'],'Duration',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'StartTime': JsonConverters.toJson(StartTime,'Duration',context!),
        'EndTime': JsonConverters.toJson(EndTime,'Duration',context!)
    };

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

class RecurringScheduleDateResponse implements IConvertible
{
    int? Id;
    DateTime? Date;
    Duration? StartTime;
    Duration? EndTime;
    ResponseStatus? ResponseStatus;

    RecurringScheduleDateResponse({this.Id,this.Date,this.StartTime,this.EndTime,this.ResponseStatus});
    RecurringScheduleDateResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        Date = JsonConverters.fromJson(json['Date'],'DateTime',context!);
        StartTime = JsonConverters.fromJson(json['StartTime'],'Duration',context!);
        EndTime = JsonConverters.fromJson(json['EndTime'],'Duration',context!);
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'Date': JsonConverters.toJson(Date,'DateTime',context!),
        'StartTime': JsonConverters.toJson(StartTime,'Duration',context!),
        'EndTime': JsonConverters.toJson(EndTime,'Duration',context!),
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

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

abstract class IBaseModelCreated
{
    DateTime? CreatedDate;
}

abstract class IBaseModelUpdated
{
    DateTime? UpdatedDate;
}

abstract class ICustomFieldTable
{
    List<CustomFieldConfig>? CustomFieldsConfig;
    List<CustomFieldDataResponse>? CustomFieldsData;
    String? TextField1;
    String? TextField2;
    String? TextField3;
    String? TextField4;
    String? TextField5;
    String? TextField6;
    String? TextField7;
    String? TextField8;
    String? TextField9;
    String? TextField10;
    String? TextField11;
    String? TextField12;
    String? TextField13;
    String? TextField14;
    String? TextField15;
    String? TextField16;
    String? TextField17;
    String? TextField18;
    String? TextField19;
    String? TextField20;
}

class RecurringScheduleQueryResponse implements IConvertible
{
    /**
    * The schedule id
    */
    // @ApiMember(Description="The schedule id")
    int? Id;

    /**
    * Name of the schedule
    */
    // @ApiMember(Description="Name of the schedule")
    String? Name;

    /**
    * Description of the schedule
    */
    // @ApiMember(Description="Description of the schedule")
    String? Description;

    /**
    * If the schedule is active or not
    */
    // @ApiMember(Description="If the schedule is active or not")
    bool? Active;

    /**
    * Time interval for available times Here you set the interval at which times should appear. For example, if you select the range 15minutes, and your service has an duration of 1 hour and opening hours are 9AM to 6PM you will see the following suggested times: 09AM-10PM 09:15AM-10:15PM, 09:30AM-10:30PM ,  ..... 04:45PM-05:45, 05:00PM-06:00PM
    */
    // @ApiMember(Description="Time interval for available times Here you set the interval at which times should appear. For example, if you select the range 15minutes, and your service has an duration of 1 hour and opening hours are 9AM to 6PM you will see the following suggested times: 09AM-10PM 09:15AM-10:15PM, 09:30AM-10:30PM ,  ..... 04:45PM-05:45, 05:00PM-06:00PM", IsRequired=true)
    int? TimeInterval;

    /**
    * The timestamp to which the schedule is valid from
    */
    // @ApiMember(Description="The timestamp to which the schedule is valid from", IsRequired=true)
    DateTime? ValidFrom;

    /**
    * The timestamp to which the schedule is valid to
    */
    // @ApiMember(Description="The timestamp to which the schedule is valid to", IsRequired=true)
    DateTime? ValidTo;

    /**
    * The time for the schedule opening hours (starttime)
    */
    // @ApiMember(Description="The time for the schedule opening hours (starttime)", IsRequired=true)
    Duration? StartTime;

    /**
    * The time for the schedule opening hours (endtime)
    */
    // @ApiMember(Description="The time for the schedule opening hours (endtime)", IsRequired=true)
    Duration? EndTime;

    /**
    * The number of days the schedule is valid from todays date
    */
    // @ApiMember(Description="The number of days the schedule is valid from todays date", IsRequired=true)
    int? NumberOfScheduleDays;

    /**
    * If the schedule is only connected to some specific resources. Note: You must have IncludeResources property to see this.
    */
    // @ApiMember(Description="If the schedule is only connected to some specific resources. Note: You must have IncludeResources property to see this.", IsRequired=true)
    bool? IsResourceSpecific;

    /**
    * The timestamp when the schedule was updated
    */
    // @ApiMember(Description="The timestamp when the schedule was updated", IsRequired=true)
    DateTime? UpdatedDate;

    /**
    * The timestamp when the schedule was created
    */
    // @ApiMember(Description="The timestamp when the schedule was created", IsRequired=true)
    DateTime? CreatedDate;

    /**
    * Allow bookings end time exceeds the opening hours Here you can choose whether it should be possible to make a reservation exceeding the opening hours. This should be ticked when a service duration is longer than 24 hours (possible to book over midnight).
    */
    // @ApiMember(Description="Allow bookings end time exceeds the opening hours Here you can choose whether it should be possible to make a reservation exceeding the opening hours. This should be ticked when a service duration is longer than 24 hours (possible to book over midnight).", IsRequired=true)
    bool? EnableBookingUntilClosingTime;

    /**
    * If recurring, an array indicating which days of the week the exception recures on where 1 = Monday .. 7 = Sunday. When recurring then the time portion of the Fields From and To indicates the time of day the recurrence occurs
    */
    // @ApiMember(Description="If recurring, an array indicating which days of the week the exception recures on where 1 = Monday .. 7 = Sunday. When recurring then the time portion of the Fields From and To indicates the time of day the recurrence occurs")
    List<DayOfWeekDto>? DaysOfWeek;

    /**
    * The resources that is connected to the schedule
    */
    // @ApiMember(Description="The resources that is connected to the schedule")
    List<ScheduleResources>? Resources;

    /**
    * The services that is connected to the schedule
    */
    // @ApiMember(Description="The services that is connected to the schedule")
    List<ScheduleServices>? Services;

    /**
    * The exceptions that is added to the schedule
    */
    // @ApiMember(Description="The exceptions that is added to the schedule")
    List<RecurringScheduleExceptionResponse>? Exceptions;

    /**
    * Schedule dates, used when the schedule is not a rolling schedule using days of week
    */
    // @ApiMember(Description="Schedule dates, used when the schedule is not a rolling schedule using days of week")
    List<RecurringScheduleDateResponse>? ScheduleDates;

    ResponseStatus? ResponseStatus;

    RecurringScheduleQueryResponse({this.Id,this.Name,this.Description,this.Active,this.TimeInterval,this.ValidFrom,this.ValidTo,this.StartTime,this.EndTime,this.NumberOfScheduleDays,this.IsResourceSpecific,this.UpdatedDate,this.CreatedDate,this.EnableBookingUntilClosingTime,this.DaysOfWeek,this.Resources,this.Services,this.Exceptions,this.ScheduleDates,this.ResponseStatus});
    RecurringScheduleQueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        Name = json['Name'];
        Description = json['Description'];
        Active = json['Active'];
        TimeInterval = json['TimeInterval'];
        ValidFrom = JsonConverters.fromJson(json['ValidFrom'],'DateTime',context!);
        ValidTo = JsonConverters.fromJson(json['ValidTo'],'DateTime',context!);
        StartTime = JsonConverters.fromJson(json['StartTime'],'Duration',context!);
        EndTime = JsonConverters.fromJson(json['EndTime'],'Duration',context!);
        NumberOfScheduleDays = json['NumberOfScheduleDays'];
        IsResourceSpecific = json['IsResourceSpecific'];
        UpdatedDate = JsonConverters.fromJson(json['UpdatedDate'],'DateTime',context!);
        CreatedDate = JsonConverters.fromJson(json['CreatedDate'],'DateTime',context!);
        EnableBookingUntilClosingTime = json['EnableBookingUntilClosingTime'];
        DaysOfWeek = JsonConverters.fromJson(json['DaysOfWeek'],'List<DayOfWeekDto>',context!);
        Resources = JsonConverters.fromJson(json['Resources'],'List<ScheduleResources>',context!);
        Services = JsonConverters.fromJson(json['Services'],'List<ScheduleServices>',context!);
        Exceptions = JsonConverters.fromJson(json['Exceptions'],'List<RecurringScheduleExceptionResponse>',context!);
        ScheduleDates = JsonConverters.fromJson(json['ScheduleDates'],'List<RecurringScheduleDateResponse>',context!);
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'Name': Name,
        'Description': Description,
        'Active': Active,
        'TimeInterval': TimeInterval,
        'ValidFrom': JsonConverters.toJson(ValidFrom,'DateTime',context!),
        'ValidTo': JsonConverters.toJson(ValidTo,'DateTime',context!),
        'StartTime': JsonConverters.toJson(StartTime,'Duration',context!),
        'EndTime': JsonConverters.toJson(EndTime,'Duration',context!),
        'NumberOfScheduleDays': NumberOfScheduleDays,
        'IsResourceSpecific': IsResourceSpecific,
        'UpdatedDate': JsonConverters.toJson(UpdatedDate,'DateTime',context!),
        'CreatedDate': JsonConverters.toJson(CreatedDate,'DateTime',context!),
        'EnableBookingUntilClosingTime': EnableBookingUntilClosingTime,
        'DaysOfWeek': JsonConverters.toJson(DaysOfWeek,'List<DayOfWeekDto>',context!),
        'Resources': JsonConverters.toJson(Resources,'List<ScheduleResources>',context!),
        'Services': JsonConverters.toJson(Services,'List<ScheduleServices>',context!),
        'Exceptions': JsonConverters.toJson(Exceptions,'List<RecurringScheduleExceptionResponse>',context!),
        'ScheduleDates': JsonConverters.toJson(ScheduleDates,'List<RecurringScheduleDateResponse>',context!),
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

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

// @Route("/schedules/recurring", "GET")
// @ValidateRequest(Validator="IsAuthenticated")
class RecuringScheduleQuery extends QueryDb2<RecurringSchedule,RecurringScheduleQueryResponse> implements IReturn<QueryResponse<RecurringScheduleQueryResponse>>, IConvertible, IGet
{
    /**
    * Enter the company you want to see news for, if blank and you are an admin, your company id will be used
    */
    // @ApiMember(Description="Enter the company you want to see news for, if blank and you are an admin, your company id will be used", ParameterType="path")
    String? CompanyId;

    /**
    * Enter the From Date you want to see news from, only allowed if admin
    */
    // @ApiMember(DataType="dateTime", Description="Enter the From Date you want to see news from, only allowed if admin", ParameterType="query")
    DateTime? ValidFrom;

    /**
    * Enter the To Date you want to see news to, only allowed if admin
    */
    // @ApiMember(DataType="dateTime", Description="Enter the To Date you want to see news to, only allowed if admin", ParameterType="query")
    DateTime? ValidTo;

    /**
    * If you want to include the connected days for the schedule
    */
    // @ApiMember(DataType="bool", Description="If you want to include the connected days for the schedule", ParameterType="query")
    bool? IncludeRecurringDays;

    /**
    * If you want to include the connected resources for the schedule
    */
    // @ApiMember(DataType="bool", Description="If you want to include the connected resources for the schedule", ParameterType="query")
    bool? IncludeConnectedResources;

    /**
    * If you want to include the connected services for the schedule
    */
    // @ApiMember(DataType="bool", Description="If you want to include the connected services for the schedule", ParameterType="query")
    bool? IncludeConnectedServices;

    /**
    * If you want to include the exceptions for the schedule
    */
    // @ApiMember(DataType="bool", Description="If you want to include the exceptions for the schedule", ParameterType="query")
    bool? IncludeExceptions;

    /**
    * Use this parameter if you want to only show active news
    */
    // @ApiMember(DataType="boolean", Description="Use this parameter if you want to only show active news")
    bool? Active;

    /**
    * If you want to include the connected dates for the schedule. This is used when the schedule having setting, different opening hours per week (not rolling schedule using days of week).
    */
    // @ApiMember(DataType="bool", Description="If you want to include the connected dates for the schedule. This is used when the schedule having setting, different opening hours per week (not rolling schedule using days of week).", ParameterType="query")
    bool? IncludeScheduleDates;

    RecuringScheduleQuery({this.CompanyId,this.ValidFrom,this.ValidTo,this.IncludeRecurringDays,this.IncludeConnectedResources,this.IncludeConnectedServices,this.IncludeExceptions,this.Active,this.IncludeScheduleDates});
    RecuringScheduleQuery.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        CompanyId = json['CompanyId'];
        ValidFrom = JsonConverters.fromJson(json['ValidFrom'],'DateTime',context!);
        ValidTo = JsonConverters.fromJson(json['ValidTo'],'DateTime',context!);
        IncludeRecurringDays = json['IncludeRecurringDays'];
        IncludeConnectedResources = json['IncludeConnectedResources'];
        IncludeConnectedServices = json['IncludeConnectedServices'];
        IncludeExceptions = json['IncludeExceptions'];
        Active = json['Active'];
        IncludeScheduleDates = json['IncludeScheduleDates'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'CompanyId': CompanyId,
        'ValidFrom': JsonConverters.toJson(ValidFrom,'DateTime',context!),
        'ValidTo': JsonConverters.toJson(ValidTo,'DateTime',context!),
        'IncludeRecurringDays': IncludeRecurringDays,
        'IncludeConnectedResources': IncludeConnectedResources,
        'IncludeConnectedServices': IncludeConnectedServices,
        'IncludeExceptions': IncludeExceptions,
        'Active': Active,
        'IncludeScheduleDates': IncludeScheduleDates
    });

    createResponse() => QueryResponse<RecurringScheduleQueryResponse>();
    getResponseTypeName() => "QueryResponse<RecurringScheduleQueryResponse>";
    getTypeName() => "RecuringScheduleQuery";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'api.bokamera.se', types: <String, TypeInfo> {
    'BookingStatusEnum': TypeInfo(TypeOf.Enum, enumValues:BookingStatusEnum.values),
    'IInterval': TypeInfo(TypeOf.Interface),
    'BaseModel': TypeInfo(TypeOf.Class, create:() => BaseModel()),
    'CustomFieldValue': TypeInfo(TypeOf.Class, create:() => CustomFieldValue()),
    'CustomField': TypeInfo(TypeOf.Class, create:() => CustomField()),
    'RegEx': TypeInfo(TypeOf.Class, create:() => RegEx()),
    'CustomFieldServiceRelation': TypeInfo(TypeOf.Class, create:() => CustomFieldServiceRelation()),
    'CustomFieldConfig': TypeInfo(TypeOf.Class, create:() => CustomFieldConfig()),
    'List<CustomFieldValue>': TypeInfo(TypeOf.Class, create:() => <CustomFieldValue>[]),
    'List<Service>': TypeInfo(TypeOf.Class, create:() => <Service>[]),
    'Service': TypeInfo(TypeOf.Class, create:() => Service()),
    'List<CustomFieldServiceRelation>': TypeInfo(TypeOf.Class, create:() => <CustomFieldServiceRelation>[]),
    'ITimeException': TypeInfo(TypeOf.Interface),
    'BookedCustomer': TypeInfo(TypeOf.Class, create:() => BookedCustomer()),
    'IBookedTime': TypeInfo(TypeOf.Interface),
    'CustomFieldDataResponse': TypeInfo(TypeOf.Class, create:() => CustomFieldDataResponse()),
    'Resource': TypeInfo(TypeOf.Class, create:() => Resource()),
    'List<ISchedule>': TypeInfo(TypeOf.Class, create:() => <ISchedule>[]),
    'ISchedule': TypeInfo(TypeOf.Class, create:() => ISchedule()),
    'List<ITimeException>': TypeInfo(TypeOf.Class, create:() => <ITimeException>[]),
    'List<IBookedTime>': TypeInfo(TypeOf.Class, create:() => <IBookedTime>[]),
    'List<CustomFieldConfig>': TypeInfo(TypeOf.Class, create:() => <CustomFieldConfig>[]),
    'List<CustomFieldDataResponse>': TypeInfo(TypeOf.Class, create:() => <CustomFieldDataResponse>[]),
    'ScheduleType': TypeInfo(TypeOf.Enum, enumValues:ScheduleType.values),
    'RecurringScheduleDate': TypeInfo(TypeOf.Class, create:() => RecurringScheduleDate()),
    'RecurringScheduleResourceRelation': TypeInfo(TypeOf.Class, create:() => RecurringScheduleResourceRelation()),
    'BokaMeraDayOfWeek': TypeInfo(TypeOf.Enum, enumValues:BokaMeraDayOfWeek.values),
    'RecurringScheduleDayOfWeekRelation': TypeInfo(TypeOf.Class, create:() => RecurringScheduleDayOfWeekRelation()),
    'ServiceRecurringScheduleRelation': TypeInfo(TypeOf.Class, create:() => ServiceRecurringScheduleRelation()),
    'RecurringScheduleException': TypeInfo(TypeOf.Class, create:() => RecurringScheduleException()),
    'IScheduleException': TypeInfo(TypeOf.Interface),
    'RecurringSchedule': TypeInfo(TypeOf.Class, create:() => RecurringSchedule()),
    'List<RecurringScheduleDate>': TypeInfo(TypeOf.Class, create:() => <RecurringScheduleDate>[]),
    'List<Resource>': TypeInfo(TypeOf.Class, create:() => <Resource>[]),
    'List<RecurringScheduleResourceRelation>': TypeInfo(TypeOf.Class, create:() => <RecurringScheduleResourceRelation>[]),
    'List<RecurringScheduleDayOfWeekRelation>': TypeInfo(TypeOf.Class, create:() => <RecurringScheduleDayOfWeekRelation>[]),
    'List<ServiceRecurringScheduleRelation>': TypeInfo(TypeOf.Class, create:() => <ServiceRecurringScheduleRelation>[]),
    'List<RecurringScheduleException>': TypeInfo(TypeOf.Class, create:() => <RecurringScheduleException>[]),
    'List<IScheduleException>': TypeInfo(TypeOf.Class, create:() => <IScheduleException>[]),
    'DayOfWeekDto': TypeInfo(TypeOf.Class, create:() => DayOfWeekDto()),
    'ScheduleResources': TypeInfo(TypeOf.Class, create:() => ScheduleResources()),
    'Uri': TypeInfo(TypeOf.Class, create:() => Uri()),
    'ScheduleServices': TypeInfo(TypeOf.Class, create:() => ScheduleServices()),
    'RecurringScheduleExceptionResponse': TypeInfo(TypeOf.Class, create:() => RecurringScheduleExceptionResponse()),
    'RecurringScheduleDateResponse': TypeInfo(TypeOf.Class, create:() => RecurringScheduleDateResponse()),
    'IBaseModelCreated': TypeInfo(TypeOf.Interface),
    'IBaseModelUpdated': TypeInfo(TypeOf.Interface),
    'ICustomFieldTable': TypeInfo(TypeOf.Interface),
    'RecurringScheduleQueryResponse': TypeInfo(TypeOf.Class, create:() => RecurringScheduleQueryResponse()),
    'List<DayOfWeekDto>': TypeInfo(TypeOf.Class, create:() => <DayOfWeekDto>[]),
    'List<ScheduleResources>': TypeInfo(TypeOf.Class, create:() => <ScheduleResources>[]),
    'List<ScheduleServices>': TypeInfo(TypeOf.Class, create:() => <ScheduleServices>[]),
    'List<RecurringScheduleExceptionResponse>': TypeInfo(TypeOf.Class, create:() => <RecurringScheduleExceptionResponse>[]),
    'List<RecurringScheduleDateResponse>': TypeInfo(TypeOf.Class, create:() => <RecurringScheduleDateResponse>[]),
    'QueryResponse<RecurringScheduleQueryResponse>': TypeInfo(TypeOf.Class, create:() => QueryResponse<RecurringScheduleQueryResponse>()),
    'RecuringScheduleQuery': TypeInfo(TypeOf.Class, create:() => RecuringScheduleQuery()),
    'List<RecurringScheduleQueryResponse>': TypeInfo(TypeOf.Class, create:() => <RecurringScheduleQueryResponse>[]),
});