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 java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
@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)
public static class UpdateCodeLockSetting implements ICompany
{
/**
* 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.")
public UUID CompanyId = null;
/**
* If code lock sync is active
*/
@ApiMember(DataType="bool", Description="If code lock sync is active")
public Boolean Active = null;
/**
* The system type of the code lock
*/
@ApiMember(DataType="int", Description="The system type of the code lock")
public Integer CodeLockSystemsId = null;
/**
* 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.")
public Integer ValidBeforeMinutes = null;
/**
* 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.")
public Integer ValidAfterMinutes = null;
/**
* If it should clean up old bookings after the passed
*/
@ApiMember(DataType="boolean", Description="If it should clean up old bookings after the passed")
public Boolean DeleteOldBySchedule = null;
/**
* If a notification should be sent by Email
*/
@ApiMember(DataType="boolean", Description="If a notification should be sent by Email")
public Boolean SendEmailNotification = null;
/**
* If a notification should be sent by SMS
*/
@ApiMember(DataType="boolean", Description="If a notification should be sent by SMS")
public Boolean SendSMSNotification = null;
/**
* 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")
public Integer EmailNotificationTime = null;
/**
* 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")
public Integer SMSNotificationTime = null;
public UUID getCompanyId() { return CompanyId; }
public UpdateCodeLockSetting setCompanyId(UUID value) { this.CompanyId = value; return this; }
public Boolean isActive() { return Active; }
public UpdateCodeLockSetting setActive(Boolean value) { this.Active = value; return this; }
public Integer getCodeLockSystemsId() { return CodeLockSystemsId; }
public UpdateCodeLockSetting setCodeLockSystemsId(Integer value) { this.CodeLockSystemsId = value; return this; }
public Integer getValidBeforeMinutes() { return ValidBeforeMinutes; }
public UpdateCodeLockSetting setValidBeforeMinutes(Integer value) { this.ValidBeforeMinutes = value; return this; }
public Integer getValidAfterMinutes() { return ValidAfterMinutes; }
public UpdateCodeLockSetting setValidAfterMinutes(Integer value) { this.ValidAfterMinutes = value; return this; }
public Boolean isDeleteOldBySchedule() { return DeleteOldBySchedule; }
public UpdateCodeLockSetting setDeleteOldBySchedule(Boolean value) { this.DeleteOldBySchedule = value; return this; }
public Boolean isSendEmailNotification() { return SendEmailNotification; }
public UpdateCodeLockSetting setSendEmailNotification(Boolean value) { this.SendEmailNotification = value; return this; }
public Boolean isSendSMSNotification() { return SendSMSNotification; }
public UpdateCodeLockSetting setSendSMSNotification(Boolean value) { this.SendSMSNotification = value; return this; }
public Integer getEmailNotificationTime() { return EmailNotificationTime; }
public UpdateCodeLockSetting setEmailNotificationTime(Integer value) { this.EmailNotificationTime = value; return this; }
public Integer getSmsNotificationTime() { return SMSNotificationTime; }
public UpdateCodeLockSetting setSmsNotificationTime(Integer value) { this.SMSNotificationTime = value; return this; }
}
public static class CodeLockSettingResponse
{
public UUID CompanyId = null;
/**
* The system type of the code lock
*/
@ApiMember(DataType="int", Description="The system type of the code lock")
public Integer CodeLockSystemsId = null;
/**
* If code lock sync is active
*/
@ApiMember(DataType="bool", Description="If code lock sync is active")
public Boolean Active = null;
/**
* 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.")
public Integer ValidBeforeMinutes = null;
/**
* 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.")
public Integer ValidAfterMinutes = null;
/**
* If it should clean up old bookings after the passed
*/
@ApiMember(DataType="boolean", Description="If it should clean up old bookings after the passed")
public Boolean DeleteOldBySchedule = null;
/**
* If a notification should be sent by Email
*/
@ApiMember(DataType="boolean", Description="If a notification should be sent by Email")
public Boolean SendEmailNotification = null;
/**
* If a notification should be sent by SMS
*/
@ApiMember(DataType="boolean", Description="If a notification should be sent by SMS")
public Boolean SendSMSNotification = null;
/**
* 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")
public Integer EmailNotificationTime = null;
/**
* 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")
public Integer SMSNotificationTime = null;
/**
* When settings was created
*/
@ApiMember(DataType="datetime", Description="When settings was created")
public Date Created = null;
/**
* When settings was updated
*/
@ApiMember(DataType="datetime", Description="When settings was updated")
public Date Updated = null;
/**
* The available code lock systems to choose from
*/
@ApiMember(Description="The available code lock systems to choose from")
public ArrayList<CodeLockSystemResponse> CodeLockSystemOptions = null;
public UUID getCompanyId() { return CompanyId; }
public CodeLockSettingResponse setCompanyId(UUID value) { this.CompanyId = value; return this; }
public Integer getCodeLockSystemsId() { return CodeLockSystemsId; }
public CodeLockSettingResponse setCodeLockSystemsId(Integer value) { this.CodeLockSystemsId = value; return this; }
public Boolean isActive() { return Active; }
public CodeLockSettingResponse setActive(Boolean value) { this.Active = value; return this; }
public Integer getValidBeforeMinutes() { return ValidBeforeMinutes; }
public CodeLockSettingResponse setValidBeforeMinutes(Integer value) { this.ValidBeforeMinutes = value; return this; }
public Integer getValidAfterMinutes() { return ValidAfterMinutes; }
public CodeLockSettingResponse setValidAfterMinutes(Integer value) { this.ValidAfterMinutes = value; return this; }
public Boolean isDeleteOldBySchedule() { return DeleteOldBySchedule; }
public CodeLockSettingResponse setDeleteOldBySchedule(Boolean value) { this.DeleteOldBySchedule = value; return this; }
public Boolean isSendEmailNotification() { return SendEmailNotification; }
public CodeLockSettingResponse setSendEmailNotification(Boolean value) { this.SendEmailNotification = value; return this; }
public Boolean isSendSMSNotification() { return SendSMSNotification; }
public CodeLockSettingResponse setSendSMSNotification(Boolean value) { this.SendSMSNotification = value; return this; }
public Integer getEmailNotificationTime() { return EmailNotificationTime; }
public CodeLockSettingResponse setEmailNotificationTime(Integer value) { this.EmailNotificationTime = value; return this; }
public Integer getSmsNotificationTime() { return SMSNotificationTime; }
public CodeLockSettingResponse setSmsNotificationTime(Integer value) { this.SMSNotificationTime = value; return this; }
public Date getCreated() { return Created; }
public CodeLockSettingResponse setCreated(Date value) { this.Created = value; return this; }
public Date getUpdated() { return Updated; }
public CodeLockSettingResponse setUpdated(Date value) { this.Updated = value; return this; }
public ArrayList<CodeLockSystemResponse> getCodeLockSystemOptions() { return CodeLockSystemOptions; }
public CodeLockSettingResponse setCodeLockSystemOptions(ArrayList<CodeLockSystemResponse> value) { this.CodeLockSystemOptions = value; return this; }
}
public static class CodeLockSystemResponse
{
/**
* The system type of the code lock
*/
@ApiMember(DataType="int", Description="The system type of the code lock")
public Integer Id = null;
/**
* The name of the code lock system
*/
@ApiMember(DataType="string", Description="The name of the code lock system")
public String Name = null;
/**
* The description of the code lock system
*/
@ApiMember(DataType="string", Description="The description of the code lock system")
public String Description = null;
/**
* The logotype of the code lock system
*/
@ApiMember(Description="The logotype of the code lock system")
public Uri LogoType = null;
/**
* The supplier name of the code lock system
*/
@ApiMember(Description="The supplier name of the code lock system")
public String Supplier = null;
public Integer getId() { return Id; }
public CodeLockSystemResponse setId(Integer value) { this.Id = value; return this; }
public String getName() { return Name; }
public CodeLockSystemResponse setName(String value) { this.Name = value; return this; }
public String getDescription() { return Description; }
public CodeLockSystemResponse setDescription(String value) { this.Description = value; return this; }
public Uri getLogoType() { return LogoType; }
public CodeLockSystemResponse setLogoType(Uri value) { this.LogoType = value; return this; }
public String getSupplier() { return Supplier; }
public CodeLockSystemResponse setSupplier(String value) { this.Supplier = value; return this; }
}
}
Java 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>