BokaMera.API.Host

<back to all web services

UpdateCodeLockSetting

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
PUT/codelock/settingsUpdate settings for the code locks of the company of the currently logged in userUpdate settings for code lock of the company of the currently logged in user.
import 'package:servicestack/servicestack.dart';

class CodeLockSystemResponse implements IConvertible
{
    /**
    * The system type of the code lock
    */
    // @ApiMember(DataType="int", Description="The system type of the code lock")
    int? Id;

    /**
    * The name of the code lock system
    */
    // @ApiMember(DataType="string", Description="The name of the code lock system")
    String? Name;

    /**
    * The description of the code lock system
    */
    // @ApiMember(DataType="string", Description="The description of the code lock system")
    String? Description;

    /**
    * The logotype of the code lock system
    */
    // @ApiMember(Description="The logotype of the code lock system")
    Uri? LogoType;

    /**
    * The supplier name of the code lock system
    */
    // @ApiMember(Description="The supplier name of the code lock system")
    String? Supplier;

    CodeLockSystemResponse({this.Id,this.Name,this.Description,this.LogoType,this.Supplier});
    CodeLockSystemResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class CodeLockSettingResponse implements IConvertible
{
    String? CompanyId;
    /**
    * The system type of the code lock
    */
    // @ApiMember(DataType="int", Description="The system type of the code lock")
    int? CodeLockSystemsId;

    /**
    * If code lock sync is active
    */
    // @ApiMember(DataType="bool", Description="If code lock sync is active")
    bool? Active;

    /**
    * Number of minutes the access should be valid before booking starts.
    */
    // @ApiMember(DataType="int", Description="Number of minutes the access should be valid before booking starts.")
    int? ValidBeforeMinutes;

    /**
    * Number of minutes the access should be valid after booking ends.
    */
    // @ApiMember(DataType="int", Description="Number of minutes the access should be valid after booking ends.")
    int? ValidAfterMinutes;

    /**
    * If it should clean up old bookings after the passed
    */
    // @ApiMember(DataType="boolean", Description="If it should clean up old bookings after the passed")
    bool? DeleteOldBySchedule;

    /**
    * If a notification should be sent by Email
    */
    // @ApiMember(DataType="boolean", Description="If a notification should be sent by Email")
    bool? SendEmailNotification;

    /**
    * If a notification should be sent by SMS
    */
    // @ApiMember(DataType="boolean", Description="If a notification should be sent by SMS")
    bool? SendSMSNotification;

    /**
    * How long before the booking starts in minutes the notification should be sent
    */
    // @ApiMember(DataType="int", Description="How long before the booking starts in minutes the notification should be sent")
    int? EmailNotificationTime;

    /**
    * How long before the booking starts in minutes the notification should be sent
    */
    // @ApiMember(DataType="int", Description="How long before the booking starts in minutes the notification should be sent")
    int? SMSNotificationTime;

    /**
    * When settings was created
    */
    // @ApiMember(DataType="datetime", Description="When settings was created")
    DateTime? Created;

    /**
    * When settings was updated
    */
    // @ApiMember(DataType="datetime", Description="When settings was updated")
    DateTime? Updated;

    /**
    * The available code lock systems to choose from
    */
    // @ApiMember(Description="The available code lock systems to choose from")
    List<CodeLockSystemResponse>? CodeLockSystemOptions;

    CodeLockSettingResponse({this.CompanyId,this.CodeLockSystemsId,this.Active,this.ValidBeforeMinutes,this.ValidAfterMinutes,this.DeleteOldBySchedule,this.SendEmailNotification,this.SendSMSNotification,this.EmailNotificationTime,this.SMSNotificationTime,this.Created,this.Updated,this.CodeLockSystemOptions});
    CodeLockSettingResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        CompanyId = json['CompanyId'];
        CodeLockSystemsId = json['CodeLockSystemsId'];
        Active = json['Active'];
        ValidBeforeMinutes = json['ValidBeforeMinutes'];
        ValidAfterMinutes = json['ValidAfterMinutes'];
        DeleteOldBySchedule = json['DeleteOldBySchedule'];
        SendEmailNotification = json['SendEmailNotification'];
        SendSMSNotification = json['SendSMSNotification'];
        EmailNotificationTime = json['EmailNotificationTime'];
        SMSNotificationTime = json['SMSNotificationTime'];
        Created = JsonConverters.fromJson(json['Created'],'DateTime',context!);
        Updated = JsonConverters.fromJson(json['Updated'],'DateTime',context!);
        CodeLockSystemOptions = JsonConverters.fromJson(json['CodeLockSystemOptions'],'List<CodeLockSystemResponse>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'CompanyId': CompanyId,
        'CodeLockSystemsId': CodeLockSystemsId,
        'Active': Active,
        'ValidBeforeMinutes': ValidBeforeMinutes,
        'ValidAfterMinutes': ValidAfterMinutes,
        'DeleteOldBySchedule': DeleteOldBySchedule,
        'SendEmailNotification': SendEmailNotification,
        'SendSMSNotification': SendSMSNotification,
        'EmailNotificationTime': EmailNotificationTime,
        'SMSNotificationTime': SMSNotificationTime,
        'Created': JsonConverters.toJson(Created,'DateTime',context!),
        'Updated': JsonConverters.toJson(Updated,'DateTime',context!),
        'CodeLockSystemOptions': JsonConverters.toJson(CodeLockSystemOptions,'List<CodeLockSystemResponse>',context!)
    };

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

// @ValidateRequest(Validator="IsAuthenticated")
// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
// @ApiResponse(Description="You have too low privileges to call this service", StatusCode=403)
class UpdateCodeLockSetting 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 code lock sync is active
    */
    // @ApiMember(DataType="bool", Description="If code lock sync is active")
    bool? Active;

    /**
    * The system type of the code lock
    */
    // @ApiMember(DataType="int", Description="The system type of the code lock")
    int? CodeLockSystemsId;

    /**
    * Number of minutes the access should be valid before booking starts.
    */
    // @ApiMember(DataType="int", Description="Number of minutes the access should be valid before booking starts.")
    int? ValidBeforeMinutes;

    /**
    * Number of minutes the access should be valid after booking ends.
    */
    // @ApiMember(DataType="int", Description="Number of minutes the access should be valid after booking ends.")
    int? ValidAfterMinutes;

    /**
    * If it should clean up old bookings after the passed
    */
    // @ApiMember(DataType="boolean", Description="If it should clean up old bookings after the passed")
    bool? DeleteOldBySchedule;

    /**
    * If a notification should be sent by Email
    */
    // @ApiMember(DataType="boolean", Description="If a notification should be sent by Email")
    bool? SendEmailNotification;

    /**
    * If a notification should be sent by SMS
    */
    // @ApiMember(DataType="boolean", Description="If a notification should be sent by SMS")
    bool? SendSMSNotification;

    /**
    * How long before the booking starts in minutes the notification should be sent
    */
    // @ApiMember(DataType="int", Description="How long before the booking starts in minutes the notification should be sent")
    int? EmailNotificationTime;

    /**
    * How long before the booking starts in minutes the notification should be sent
    */
    // @ApiMember(DataType="int", Description="How long before the booking starts in minutes the notification should be sent")
    int? SMSNotificationTime;

    UpdateCodeLockSetting({this.CompanyId,this.Active,this.CodeLockSystemsId,this.ValidBeforeMinutes,this.ValidAfterMinutes,this.DeleteOldBySchedule,this.SendEmailNotification,this.SendSMSNotification,this.EmailNotificationTime,this.SMSNotificationTime});
    UpdateCodeLockSetting.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        CompanyId = json['CompanyId'];
        Active = json['Active'];
        CodeLockSystemsId = json['CodeLockSystemsId'];
        ValidBeforeMinutes = json['ValidBeforeMinutes'];
        ValidAfterMinutes = json['ValidAfterMinutes'];
        DeleteOldBySchedule = json['DeleteOldBySchedule'];
        SendEmailNotification = json['SendEmailNotification'];
        SendSMSNotification = json['SendSMSNotification'];
        EmailNotificationTime = json['EmailNotificationTime'];
        SMSNotificationTime = json['SMSNotificationTime'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'CompanyId': CompanyId,
        'Active': Active,
        'CodeLockSystemsId': CodeLockSystemsId,
        'ValidBeforeMinutes': ValidBeforeMinutes,
        'ValidAfterMinutes': ValidAfterMinutes,
        'DeleteOldBySchedule': DeleteOldBySchedule,
        'SendEmailNotification': SendEmailNotification,
        'SendSMSNotification': SendSMSNotification,
        'EmailNotificationTime': EmailNotificationTime,
        'SMSNotificationTime': SMSNotificationTime
    };

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

TypeContext _ctx = TypeContext(library: 'testapi.bokamera.se', types: <String, TypeInfo> {
    'CodeLockSystemResponse': TypeInfo(TypeOf.Class, create:() => CodeLockSystemResponse()),
    'Uri': TypeInfo(TypeOf.Class, create:() => Uri()),
    'CodeLockSettingResponse': TypeInfo(TypeOf.Class, create:() => CodeLockSettingResponse()),
    'List<CodeLockSystemResponse>': TypeInfo(TypeOf.Class, create:() => <CodeLockSystemResponse>[]),
    'UpdateCodeLockSetting': TypeInfo(TypeOf.Class, create:() => UpdateCodeLockSetting()),
});

Dart UpdateCodeLockSetting DTOs

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

HTTP + CSV

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

PUT /codelock/settings HTTP/1.1 
Host: testapi.bokamera.se 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"CompanyId":"00000000-0000-0000-0000-000000000000","Active":false,"CodeLockSystemsId":0,"ValidBeforeMinutes":0,"ValidAfterMinutes":0,"DeleteOldBySchedule":false,"SendEmailNotification":false,"SendSMSNotification":false,"EmailNotificationTime":0,"SMSNotificationTime":0}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"CodeLockSystemsId":0,"Active":false,"ValidBeforeMinutes":0,"ValidAfterMinutes":0,"DeleteOldBySchedule":false,"SendEmailNotification":false,"SendSMSNotification":false,"EmailNotificationTime":0,"SMSNotificationTime":0,"CodeLockSystemOptions":[{"Id":0,"Name":"String","Description":"String","Supplier":"String"}]}