Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
PUT | /codelock/settings | Update settings for the code locks of the company of the currently logged in user | Update 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: 'api.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 .xml suffix or ?format=xml
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: api.bokamera.se
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<UpdateCodeLockSetting xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
<Active>false</Active>
<CodeLockSystemsId>0</CodeLockSystemsId>
<CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
<DeleteOldBySchedule>false</DeleteOldBySchedule>
<EmailNotificationTime>0</EmailNotificationTime>
<SMSNotificationTime>0</SMSNotificationTime>
<SendEmailNotification>false</SendEmailNotification>
<SendSMSNotification>false</SendSMSNotification>
<ValidAfterMinutes>0</ValidAfterMinutes>
<ValidBeforeMinutes>0</ValidBeforeMinutes>
</UpdateCodeLockSetting>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <CodeLockSettingResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos"> <Active>false</Active> <CodeLockSystemOptions> <CodeLockSystemResponse> <Description>String</Description> <Id>0</Id> <LogoType i:nil="true" /> <Name>String</Name> <Supplier>String</Supplier> </CodeLockSystemResponse> </CodeLockSystemOptions> <CodeLockSystemsId>0</CodeLockSystemsId> <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId> <Created>0001-01-01T00:00:00</Created> <DeleteOldBySchedule>false</DeleteOldBySchedule> <EmailNotificationTime>0</EmailNotificationTime> <SMSNotificationTime>0</SMSNotificationTime> <SendEmailNotification>false</SendEmailNotification> <SendSMSNotification>false</SendSMSNotification> <Updated>0001-01-01T00:00:00</Updated> <ValidAfterMinutes>0</ValidAfterMinutes> <ValidBeforeMinutes>0</ValidBeforeMinutes> </CodeLockSettingResponse>