Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
PUT | /homepage/scheduler/settings | Update homepage scheduler settings | Update homepage scheduler settings on the company of the currently logged in user, only administrators are allowed to update homepage menu. |
---|
import Foundation
import ServiceStack
// @ValidateRequest(Validator="IsAuthenticated")
public class UpdateHomepageSchedulerSettings : ICompany, Codable
{
/**
* 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 var companyId:String?
/**
* If the user schedule is activated.
*/
// @ApiMember(Description="If the user schedule is activated.")
public var active:Bool?
/**
* If the user schedule views id.
*/
// @ApiMember(Description="If the user schedule views id.")
public var scheduleViewId:Int?
/**
* If the user schedule time slots in minutes.
*/
// @ApiMember(Description="If the user schedule time slots in minutes.")
public var scheduleTimeSlotMinutes:Int?
/**
* If the user schedule time start time.
*/
// @ApiMember(Description="If the user schedule time start time.")
@TimeSpan public var startTime:TimeInterval?
/**
* If the user schedule time end time.
*/
// @ApiMember(Description="If the user schedule time end time.")
@TimeSpan public var endTime:TimeInterval?
/**
* If the user schedule should contain time exceptions.
*/
// @ApiMember(Description="If the user schedule should contain time exceptions.")
public var showTimeExceptions:Bool?
/**
* If allow booking in the scheduler.
*/
// @ApiMember(Description="If allow booking in the scheduler.")
public var enableBooking:Bool?
/**
* What resources you want to be shown in scheduler.
*/
// @ApiMember(Description="What resources you want to be shown in scheduler.")
public var resources:[HomepageSchedulerResource] = []
/**
* What services you want to be shown in scheduler.
*/
// @ApiMember(Description="What services you want to be shown in scheduler.")
public var services:[HomepageSchedulerService] = []
/**
* What fields you want to be shown in scheduler.
*/
// @ApiMember(Description="What fields you want to be shown in scheduler.")
public var fields:[HomepageScheduleField] = []
required public init(){}
}
public class HomepageSchedulerResource : Codable
{
/**
* The resource id.
*/
// @ApiMember(Description="The resource id.")
public var id:Int
required public init(){}
}
public class HomepageSchedulerService : Codable
{
/**
* The service id.
*/
// @ApiMember(Description="The service id.")
public var id:Int
required public init(){}
}
public class HomepageScheduleField : Codable
{
/**
* The field id.
*/
// @ApiMember(Description="The field id.", IsRequired=true)
public var id:Int
/**
* If the field showed on the booking.
*/
// @ApiMember(Description="If the field showed on the booking.", IsRequired=true)
public var showOnBooking:Bool
/**
* If the field showed on the bookings tooltip.
*/
// @ApiMember(Description="If the field showed on the bookings tooltip.", IsRequired=true)
public var showOnTooltip:Bool
required public init(){}
}
public class HomepageSchedulerSettingsQueryResponse : Codable
{
/**
* The company id.
*/
// @ApiMember(Description="The company id.")
public var companyId:String
/**
* If the user schedule is activated.
*/
// @ApiMember(Description="If the user schedule is activated.")
public var active:Bool
/**
* If the user schedule views id.
*/
// @ApiMember(Description="If the user schedule views id.")
public var scheduleViewId:Int
/**
* If the user schedule time slots in minutes.
*/
// @ApiMember(Description="If the user schedule time slots in minutes.")
public var scheduleTimeSlotMinutes:Int
/**
* If the user schedule time start time.
*/
// @ApiMember(Description="If the user schedule time start time.")
@TimeSpan public var startTime:TimeInterval?
/**
* If the user schedule time end time.
*/
// @ApiMember(Description="If the user schedule time end time.")
@TimeSpan public var endTime:TimeInterval?
/**
* If the user schedule should contain time exceptions.
*/
// @ApiMember(Description="If the user schedule should contain time exceptions.")
public var showTimeExceptions:Bool
/**
* If allow booking in the scheduler.
*/
// @ApiMember(Description="If allow booking in the scheduler.")
public var enableBooking:Bool
/**
* The homepage schedule services that are selected
*/
// @ApiMember(Description="The homepage schedule services that are selected")
public var services:[HomepageSchedulerServiceResponse] = []
/**
* The homepage schedule resources that are selected
*/
// @ApiMember(Description="The homepage schedule resources that are selected")
public var resources:[HomepageSchedulerResourceResponse] = []
/**
* The homepage schedule fields that are selected
*/
// @ApiMember(Description="The homepage schedule fields that are selected")
public var fields:[HomepageSchedulerFieldResponse] = []
/**
* The homepage schedule fields select from
*/
// @ApiMember(Description="The homepage schedule fields select from")
public var fieldOptions:[HomepageSchedulerFieldOptionsResponse] = []
/**
* The available schedule view options to choose from
*/
// @ApiMember(Description="The available schedule view options to choose from")
public var scheduleViewOptions:[ScheduleViewResponse] = []
required public init(){}
}
public class HomepageSchedulerServiceResponse : Codable
{
/**
* The service id.
*/
// @ApiMember(Description="The service id.")
public var id:Int
/**
* The service name.
*/
// @ApiMember(Description="The service name.")
public var name:String
/**
* The service description.
*/
// @ApiMember(Description="The service description.")
public var Description:String
/**
* The service image url.
*/
// @ApiMember(Description="The service image url.")
public var imageUrl:Uri
required public init(){}
}
public class HomepageSchedulerResourceResponse : Codable
{
/**
* The resource id.
*/
// @ApiMember(Description="The resource id.")
public var id:Int
/**
* The resource name.
*/
// @ApiMember(Description="The resource name.")
public var name:String
/**
* The resource description.
*/
// @ApiMember(Description="The resource description.")
public var Description:String
/**
* The resource image url.
*/
// @ApiMember(Description="The resource image url.")
public var imageUrl:Uri
required public init(){}
}
public class HomepageSchedulerFieldResponse : Codable
{
/**
* The field id.
*/
// @ApiMember(Description="The field id.")
public var id:Int
/**
* If the field should be shown on booking.
*/
// @ApiMember(Description="If the field should be shown on booking.")
public var showOnBooking:Bool
/**
* If the field should be shown on tooltip.
*/
// @ApiMember(Description="If the field should be shown on tooltip.")
public var showOnTooltip:Bool
required public init(){}
}
public class HomepageSchedulerFieldOptionsResponse : Codable
{
/**
* The field id.
*/
// @ApiMember(Description="The field id.")
public var id:Int
/**
* The field name.
*/
// @ApiMember(Description="The field name.")
public var name:String
/**
* The field description.
*/
// @ApiMember(Description="The field description.")
public var Description:String
/**
* The field sort order when listing.
*/
// @ApiMember(Description="The field sort order when listing.")
public var sortOrder:Int
required public init(){}
}
public class ScheduleViewResponse : Codable
{
public var id:Int
public var name:String
required public init(){}
}
Swift UpdateHomepageSchedulerSettings 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 /homepage/scheduler/settings HTTP/1.1
Host: testapi.bokamera.se
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<UpdateHomepageSchedulerSettings xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
<Active>false</Active>
<CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
<EnableBooking>false</EnableBooking>
<EndTime>PT0S</EndTime>
<Fields>
<HomepageScheduleField>
<Id>0</Id>
<ShowOnBooking>false</ShowOnBooking>
<ShowOnTooltip>false</ShowOnTooltip>
</HomepageScheduleField>
</Fields>
<Resources>
<HomepageSchedulerResource>
<Id>0</Id>
</HomepageSchedulerResource>
</Resources>
<ScheduleTimeSlotMinutes>0</ScheduleTimeSlotMinutes>
<ScheduleViewId>0</ScheduleViewId>
<Services>
<HomepageSchedulerService>
<Id>0</Id>
</HomepageSchedulerService>
</Services>
<ShowTimeExceptions>false</ShowTimeExceptions>
<StartTime>PT0S</StartTime>
</UpdateHomepageSchedulerSettings>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <HomepageSchedulerSettingsQueryResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos"> <Active>false</Active> <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId> <EnableBooking>false</EnableBooking> <EndTime>PT0S</EndTime> <FieldOptions> <HomepageSchedulerFieldOptionsResponse> <Description>String</Description> <Id>0</Id> <Name>String</Name> <SortOrder>0</SortOrder> </HomepageSchedulerFieldOptionsResponse> </FieldOptions> <Fields> <HomepageSchedulerFieldResponse> <Id>0</Id> <ShowOnBooking>false</ShowOnBooking> <ShowOnTooltip>false</ShowOnTooltip> </HomepageSchedulerFieldResponse> </Fields> <Resources> <HomepageSchedulerResourceResponse> <Description>String</Description> <Id>0</Id> <ImageUrl i:nil="true" /> <Name>String</Name> </HomepageSchedulerResourceResponse> </Resources> <ScheduleTimeSlotMinutes>0</ScheduleTimeSlotMinutes> <ScheduleViewId>0</ScheduleViewId> <ScheduleViewOptions> <ScheduleViewResponse> <Id>0</Id> <Name>String</Name> </ScheduleViewResponse> </ScheduleViewOptions> <Services> <HomepageSchedulerServiceResponse> <Description>String</Description> <Id>0</Id> <ImageUrl i:nil="true" /> <Name>String</Name> </HomepageSchedulerServiceResponse> </Services> <ShowTimeExceptions>false</ShowTimeExceptions> <StartTime>PT0S</StartTime> </HomepageSchedulerSettingsQueryResponse>