Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
GET | /timeexceptions/collidingevents | Searches for collisions with existing bookings of the resource | Searches for existing bookings and investigates if a proposed time exception would collide with them, if so, the bookings should be unbooked to be able to create the time exception. A time exception must be either recurring (DaysOfWeek, ExceptionFromTime, ExceptionToTime is set) or non recurring (From and To are set). |
---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
@ApiResponse(Description="The request parameters was not valid", StatusCode=400)
// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
// @ApiResponse(Description="You have too low privilegies to call this service", StatusCode=403)
@ValidateRequest(Validator="IsAuthenticated")
public static class CollidingBookingQuery
{
/**
* 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;
/**
* Resource ids of the resource that should be matched against booked events
*/
@ApiMember(Description="Resource ids of the resource that should be matched against booked events")
public ArrayList<Integer> ResourceIds = null;
/**
* Time exception starting date
*/
@ApiMember(Description="Time exception starting date")
public Date From = null;
/**
* Time exception ending date
*/
@ApiMember(Description="Time exception ending date")
public Date To = null;
/**
* This value indicates the time of day when the time exception begins. Example: 10:00. If Recurring this will be the startime for each recurring day.
*/
@ApiMember(Description="This value indicates the time of day when the time exception begins. Example: 10:00. If Recurring this will be the startime for each recurring day.")
public TimeSpan FromTime = null;
/**
* This value indicates the time of day when the time exception ends. Example: 12:00. If Recurring this will be the endtime for each recurring day.
*/
@ApiMember(Description="This value indicates the time of day when the time exception ends. Example: 12:00. If Recurring this will be the endtime for each recurring day.")
public TimeSpan ToTime = null;
/**
* A comma separated list of which days this day exception belongs to, 1 = Monday .. 7 = Sunday
*/
@ApiMember(Description="A comma separated list of which days this day exception belongs to, 1 = Monday .. 7 = Sunday")
public ArrayList<Integer> DaysOfWeek = null;
/**
* If you want to include the service information for the booking
*/
@ApiMember(DataType="boolean", Description="If you want to include the service information for the booking", ParameterType="query")
public Boolean IncludeServiceInformation = null;
/**
* If you want to include the customer information for the booking
*/
@ApiMember(DataType="boolean", Description="If you want to include the customer information for the booking", ParameterType="query")
public Boolean IncludeCustomerInformation = null;
public UUID getCompanyId() { return CompanyId; }
public CollidingBookingQuery setCompanyId(UUID value) { this.CompanyId = value; return this; }
public ArrayList<Integer> getResourceIds() { return ResourceIds; }
public CollidingBookingQuery setResourceIds(ArrayList<Integer> value) { this.ResourceIds = value; return this; }
public Date getFrom() { return From; }
public CollidingBookingQuery setFrom(Date value) { this.From = value; return this; }
public Date getTo() { return To; }
public CollidingBookingQuery setTo(Date value) { this.To = value; return this; }
public TimeSpan getFromTime() { return FromTime; }
public CollidingBookingQuery setFromTime(TimeSpan value) { this.FromTime = value; return this; }
public TimeSpan getToTime() { return ToTime; }
public CollidingBookingQuery setToTime(TimeSpan value) { this.ToTime = value; return this; }
public ArrayList<Integer> getDaysOfWeek() { return DaysOfWeek; }
public CollidingBookingQuery setDaysOfWeek(ArrayList<Integer> value) { this.DaysOfWeek = value; return this; }
public Boolean isIncludeServiceInformation() { return IncludeServiceInformation; }
public CollidingBookingQuery setIncludeServiceInformation(Boolean value) { this.IncludeServiceInformation = value; return this; }
public Boolean isIncludeCustomerInformation() { return IncludeCustomerInformation; }
public CollidingBookingQuery setIncludeCustomerInformation(Boolean value) { this.IncludeCustomerInformation = value; return this; }
}
public static class CollidingBookingQueryResponse
{
/**
* Resource id of the resource that owns this exception
*/
@ApiMember(Description="Resource id of the resource that owns this exception")
public ArrayList<Integer> ResourceIds = null;
/**
* A list of bookings that would collide with the time exception
*/
@ApiMember(Description="A list of bookings that would collide with the time exception")
public ArrayList<BookingIntervalResponse> Bookings = null;
public ResponseStatus ResponseStatus = null;
public ArrayList<Integer> getResourceIds() { return ResourceIds; }
public CollidingBookingQueryResponse setResourceIds(ArrayList<Integer> value) { this.ResourceIds = value; return this; }
public ArrayList<BookingIntervalResponse> getBookings() { return Bookings; }
public CollidingBookingQueryResponse setBookings(ArrayList<BookingIntervalResponse> value) { this.Bookings = value; return this; }
public ResponseStatus getResponseStatus() { return ResponseStatus; }
public CollidingBookingQueryResponse setResponseStatus(ResponseStatus value) { this.ResponseStatus = value; return this; }
}
public static class BookingIntervalResponse
{
public Integer Id = null;
public UUID CompanyId = null;
public Date From = null;
public Date To = null;
public BookingStatusEnum Status = null;
public Integer StatusId = null;
public String StatusName = null;
public BookedCustomer Customer = null;
public ServiceInfoResponse Service = null;
public Date CreatedDate = null;
public Integer getId() { return Id; }
public BookingIntervalResponse setId(Integer value) { this.Id = value; return this; }
public UUID getCompanyId() { return CompanyId; }
public BookingIntervalResponse setCompanyId(UUID value) { this.CompanyId = value; return this; }
public Date getFrom() { return From; }
public BookingIntervalResponse setFrom(Date value) { this.From = value; return this; }
public Date getTo() { return To; }
public BookingIntervalResponse setTo(Date value) { this.To = value; return this; }
public BookingStatusEnum getStatus() { return Status; }
public BookingIntervalResponse setStatus(BookingStatusEnum value) { this.Status = value; return this; }
public Integer getStatusId() { return StatusId; }
public BookingIntervalResponse setStatusId(Integer value) { this.StatusId = value; return this; }
public String getStatusName() { return StatusName; }
public BookingIntervalResponse setStatusName(String value) { this.StatusName = value; return this; }
public BookedCustomer getCustomer() { return Customer; }
public BookingIntervalResponse setCustomer(BookedCustomer value) { this.Customer = value; return this; }
public ServiceInfoResponse getService() { return Service; }
public BookingIntervalResponse setService(ServiceInfoResponse value) { this.Service = value; return this; }
public Date getCreatedDate() { return CreatedDate; }
public BookingIntervalResponse setCreatedDate(Date value) { this.CreatedDate = value; return this; }
}
public static enum BookingStatusEnum
{
Booked(1),
Unbooked(2),
Reserved(3),
Canceled(4),
AwaitingPayment(5),
AwaitingPaymentNoTimeLimit(6),
Payed(7),
AwaitingPaymentRequestFromAdmin(8),
AwaitingPaymentFromProvider(9),
Invoiced(10);
private final int value;
BookingStatusEnum(final int intValue) { value = intValue; }
public int getValue() { return value; }
}
public static class BookedCustomer
{
public UUID Id = null;
public String Firstname = null;
public String Lastname = null;
public String Email = null;
public String Phone = null;
public String FacebookUserName = null;
public String ImageUrl = null;
public String CorporateIdentityNumber = null;
public String InvoiceAddress1 = null;
public String InvoiceAddress2 = null;
public String InvoiceCity = null;
public String InvoicePostalCode = null;
public String InvoiceCountryCode = null;
public UUID getId() { return Id; }
public BookedCustomer setId(UUID value) { this.Id = value; return this; }
public String getFirstname() { return Firstname; }
public BookedCustomer setFirstname(String value) { this.Firstname = value; return this; }
public String getLastname() { return Lastname; }
public BookedCustomer setLastname(String value) { this.Lastname = value; return this; }
public String getEmail() { return Email; }
public BookedCustomer setEmail(String value) { this.Email = value; return this; }
public String getPhone() { return Phone; }
public BookedCustomer setPhone(String value) { this.Phone = value; return this; }
public String getFacebookUserName() { return FacebookUserName; }
public BookedCustomer setFacebookUserName(String value) { this.FacebookUserName = value; return this; }
public String getImageUrl() { return ImageUrl; }
public BookedCustomer setImageUrl(String value) { this.ImageUrl = value; return this; }
public String getCorporateIdentityNumber() { return CorporateIdentityNumber; }
public BookedCustomer setCorporateIdentityNumber(String value) { this.CorporateIdentityNumber = value; return this; }
public String getInvoiceAddress1() { return InvoiceAddress1; }
public BookedCustomer setInvoiceAddress1(String value) { this.InvoiceAddress1 = value; return this; }
public String getInvoiceAddress2() { return InvoiceAddress2; }
public BookedCustomer setInvoiceAddress2(String value) { this.InvoiceAddress2 = value; return this; }
public String getInvoiceCity() { return InvoiceCity; }
public BookedCustomer setInvoiceCity(String value) { this.InvoiceCity = value; return this; }
public String getInvoicePostalCode() { return InvoicePostalCode; }
public BookedCustomer setInvoicePostalCode(String value) { this.InvoicePostalCode = value; return this; }
public String getInvoiceCountryCode() { return InvoiceCountryCode; }
public BookedCustomer setInvoiceCountryCode(String value) { this.InvoiceCountryCode = value; return this; }
}
public static class ServiceInfoResponse
{
public Integer Id = null;
public String Name = null;
public String Description = null;
public Uri ImageUrl = null;
public Integer LengthInMinutes = null;
public Integer MaxNumberOfSpotsPerBooking = null;
public Integer MinNumberOfSpotsPerBooking = null;
public GroupBookingSettings GroupBooking = null;
public MultipleResourceSettings MultipleResource = null;
public Boolean IsGroupBooking = null;
public Boolean IsPaymentEnabled = null;
public Integer getId() { return Id; }
public ServiceInfoResponse setId(Integer value) { this.Id = value; return this; }
public String getName() { return Name; }
public ServiceInfoResponse setName(String value) { this.Name = value; return this; }
public String getDescription() { return Description; }
public ServiceInfoResponse setDescription(String value) { this.Description = value; return this; }
public Uri getImageUrl() { return ImageUrl; }
public ServiceInfoResponse setImageUrl(Uri value) { this.ImageUrl = value; return this; }
public Integer getLengthInMinutes() { return LengthInMinutes; }
public ServiceInfoResponse setLengthInMinutes(Integer value) { this.LengthInMinutes = value; return this; }
public Integer getMaxNumberOfSpotsPerBooking() { return MaxNumberOfSpotsPerBooking; }
public ServiceInfoResponse setMaxNumberOfSpotsPerBooking(Integer value) { this.MaxNumberOfSpotsPerBooking = value; return this; }
public Integer getMinNumberOfSpotsPerBooking() { return MinNumberOfSpotsPerBooking; }
public ServiceInfoResponse setMinNumberOfSpotsPerBooking(Integer value) { this.MinNumberOfSpotsPerBooking = value; return this; }
public GroupBookingSettings getGroupBooking() { return GroupBooking; }
public ServiceInfoResponse setGroupBooking(GroupBookingSettings value) { this.GroupBooking = value; return this; }
public MultipleResourceSettings getMultipleResource() { return MultipleResource; }
public ServiceInfoResponse setMultipleResource(MultipleResourceSettings value) { this.MultipleResource = value; return this; }
public Boolean getIsGroupBooking() { return IsGroupBooking; }
public ServiceInfoResponse setIsGroupBooking(Boolean value) { this.IsGroupBooking = value; return this; }
public Boolean getIsPaymentEnabled() { return IsPaymentEnabled; }
public ServiceInfoResponse setIsPaymentEnabled(Boolean value) { this.IsPaymentEnabled = value; return this; }
}
public static class GroupBookingSettings
{
public Boolean Active = null;
public Integer Min = null;
public Integer Max = null;
public Boolean isActive() { return Active; }
public GroupBookingSettings setActive(Boolean value) { this.Active = value; return this; }
public Integer getMin() { return Min; }
public GroupBookingSettings setMin(Integer value) { this.Min = value; return this; }
public Integer getMax() { return Max; }
public GroupBookingSettings setMax(Integer value) { this.Max = value; return this; }
}
public static class MultipleResourceSettings
{
public Boolean Active = null;
public Integer Min = null;
public Integer Max = null;
public Boolean isActive() { return Active; }
public MultipleResourceSettings setActive(Boolean value) { this.Active = value; return this; }
public Integer getMin() { return Min; }
public MultipleResourceSettings setMin(Integer value) { this.Min = value; return this; }
public Integer getMax() { return Max; }
public MultipleResourceSettings setMax(Integer value) { this.Max = value; return this; }
}
}
Java CollidingBookingQuery 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.
GET /timeexceptions/collidingevents HTTP/1.1 Host: api.bokamera.se Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <CollidingBookingQueryResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos"> <Bookings> <BookingIntervalResponse> <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId> <CreatedDate>0001-01-01T00:00:00</CreatedDate> <Customer> <CorporateIdentityNumber>String</CorporateIdentityNumber> <Email>String</Email> <FacebookUserName>String</FacebookUserName> <Firstname>String</Firstname> <Id>00000000-0000-0000-0000-000000000000</Id> <ImageUrl>String</ImageUrl> <InvoiceAddress1>String</InvoiceAddress1> <InvoiceAddress2>String</InvoiceAddress2> <InvoiceCity>String</InvoiceCity> <InvoiceCountryCode>String</InvoiceCountryCode> <InvoicePostalCode>String</InvoicePostalCode> <Lastname>String</Lastname> <Phone>String</Phone> </Customer> <From>0001-01-01T00:00:00</From> <Id>0</Id> <Service> <Description>String</Description> <GroupBooking> <Active>false</Active> <Max>0</Max> <Min>0</Min> </GroupBooking> <Id>0</Id> <ImageUrl i:nil="true" /> <IsGroupBooking>false</IsGroupBooking> <IsPaymentEnabled>false</IsPaymentEnabled> <LengthInMinutes>0</LengthInMinutes> <MaxNumberOfSpotsPerBooking>0</MaxNumberOfSpotsPerBooking> <MinNumberOfSpotsPerBooking>0</MinNumberOfSpotsPerBooking> <MultipleResource> <Active>false</Active> <Max>0</Max> <Min>0</Min> </MultipleResource> <Name>String</Name> </Service> <Status>Booked</Status> <StatusId>0</StatusId> <StatusName>String</StatusName> <To>0001-01-01T00:00:00</To> </BookingIntervalResponse> </Bookings> <ResourceIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d2p1:int>0</d2p1:int> </ResourceIds> <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types"> <d2p1:ErrorCode>String</d2p1:ErrorCode> <d2p1:Message>String</d2p1:Message> <d2p1:StackTrace>String</d2p1:StackTrace> <d2p1:Errors> <d2p1:ResponseError> <d2p1:ErrorCode>String</d2p1:ErrorCode> <d2p1:FieldName>String</d2p1:FieldName> <d2p1:Message>String</d2p1:Message> <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d5p1:KeyValueOfstringstring> <d5p1:Key>String</d5p1:Key> <d5p1:Value>String</d5p1:Value> </d5p1:KeyValueOfstringstring> </d2p1:Meta> </d2p1:ResponseError> </d2p1:Errors> <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:KeyValueOfstringstring> <d3p1:Key>String</d3p1:Key> <d3p1:Value>String</d3p1:Value> </d3p1:KeyValueOfstringstring> </d2p1:Meta> </ResponseStatus> </CollidingBookingQueryResponse>