BokaMera.API.Host

<back to all web services

AvaiableTimesGroupedQuery

The following routes are available for this service:
GET/services/{ServiceId}/availabletimes/groupedGet availabletimes for the serviceGet availabletimes for the service and it's connected schedules
import java.math.*;
import java.util.*;
import net.servicestack.client.*;

public class dtos
{

    public static class AvaiableTimesGroupedQuery implements IInterval
    {
        /**
        * Company to show services for
        */
        @ApiMember(Description="Company to show services for", ParameterType="query")
        public UUID CompanyId = null;

        /**
        * Service id
        */
        @ApiMember(Description="Service id", IsRequired=true, ParameterType="path")
        public Integer ServiceId = null;

        /**
        * From what datetime to show available times
        */
        @ApiMember(DataType="dateTime", Description="From what datetime to show available times", IsRequired=true, ParameterType="query")
        public Date From = null;

        /**
        * To what datetime to show available times
        */
        @ApiMember(DataType="dateTime", Description="To what datetime to show available times", IsRequired=true, ParameterType="query")
        public Date To = null;

        /**
        * Here you can select one of the resource in each resourcetype connected to the service, if none is selected it will show available times for all
        */
        @ApiMember(Description="Here you can select one of the resource in each resourcetype connected to the service, if none is selected it will show available times for all", ParameterType="query")
        public ArrayList<AvailableTimesResourceTypeResource> Resources = null;

        /**
        * Here you select number of resources to book (in each resourcetype). Default is 1.
        */
        @ApiMember(Description="Here you select number of resources to book (in each resourcetype). Default is 1.", ParameterType="query")
        public Integer NumberOfResources = null;

        /**
        * If you want to include the connected resourcetypes and resources
        */
        @ApiMember(Description="If you want to include the connected resourcetypes and resources", ParameterType="query")
        public Boolean ShowPerResource = null;

        /**
        * Both start and time time should be inside test interval. Default is false which means only start time needs to be inside.
        */
        @ApiMember(DataType="bool", Description="Both start and time time should be inside test interval. Default is false which means only start time needs to be inside.", ParameterType="query")
        public Boolean InsideSearchInterval = null;

        /**
        * The duration you want to book. Needs to withing the service Min and Max. If not set it will use the service duration
        */
        @ApiMember(DataType="bool", Description="The duration you want to book. Needs to withing the service Min and Max. If not set it will use the service duration", ParameterType="query")
        public Integer Duration = null;

        public ResponseStatus ResponseStatus = null;
        
        public UUID getCompanyId() { return CompanyId; }
        public AvaiableTimesGroupedQuery setCompanyId(UUID value) { this.CompanyId = value; return this; }
        public Integer getServiceId() { return ServiceId; }
        public AvaiableTimesGroupedQuery setServiceId(Integer value) { this.ServiceId = value; return this; }
        public Date getFrom() { return From; }
        public AvaiableTimesGroupedQuery setFrom(Date value) { this.From = value; return this; }
        public Date getTo() { return To; }
        public AvaiableTimesGroupedQuery setTo(Date value) { this.To = value; return this; }
        public ArrayList<AvailableTimesResourceTypeResource> getResources() { return Resources; }
        public AvaiableTimesGroupedQuery setResources(ArrayList<AvailableTimesResourceTypeResource> value) { this.Resources = value; return this; }
        public Integer getNumberOfResources() { return NumberOfResources; }
        public AvaiableTimesGroupedQuery setNumberOfResources(Integer value) { this.NumberOfResources = value; return this; }
        public Boolean isShowPerResource() { return ShowPerResource; }
        public AvaiableTimesGroupedQuery setShowPerResource(Boolean value) { this.ShowPerResource = value; return this; }
        public Boolean isInsideSearchInterval() { return InsideSearchInterval; }
        public AvaiableTimesGroupedQuery setInsideSearchInterval(Boolean value) { this.InsideSearchInterval = value; return this; }
        public Integer getDuration() { return Duration; }
        public AvaiableTimesGroupedQuery setDuration(Integer value) { this.Duration = value; return this; }
        public ResponseStatus getResponseStatus() { return ResponseStatus; }
        public AvaiableTimesGroupedQuery setResponseStatus(ResponseStatus value) { this.ResponseStatus = value; return this; }
    }

    public static class AvailableTimesResourceTypeResource
    {
        /**
        * The resourcetype id
        */
        @ApiMember(Description="The resourcetype id")
        public Integer ResourceTypeId = null;

        /**
        * The resource id
        */
        @ApiMember(Description="The resource id")
        public Integer ResourceId = null;
        
        public Integer getResourceTypeId() { return ResourceTypeId; }
        public AvailableTimesResourceTypeResource setResourceTypeId(Integer value) { this.ResourceTypeId = value; return this; }
        public Integer getResourceId() { return ResourceId; }
        public AvailableTimesResourceTypeResource setResourceId(Integer value) { this.ResourceId = value; return this; }
    }

    public static class AvailableTimesGroupedDatesResponse
    {
        public UUID CompanyId = null;
        public Integer ServiceId = null;
        public String TimesFreeTextSingle = null;
        public String TimesFreeTextMultiple = null;
        public ArrayList<AvailableTimesGroupedDates> Items = null;
        
        public UUID getCompanyId() { return CompanyId; }
        public AvailableTimesGroupedDatesResponse setCompanyId(UUID value) { this.CompanyId = value; return this; }
        public Integer getServiceId() { return ServiceId; }
        public AvailableTimesGroupedDatesResponse setServiceId(Integer value) { this.ServiceId = value; return this; }
        public String getTimesFreeTextSingle() { return TimesFreeTextSingle; }
        public AvailableTimesGroupedDatesResponse setTimesFreeTextSingle(String value) { this.TimesFreeTextSingle = value; return this; }
        public String getTimesFreeTextMultiple() { return TimesFreeTextMultiple; }
        public AvailableTimesGroupedDatesResponse setTimesFreeTextMultiple(String value) { this.TimesFreeTextMultiple = value; return this; }
        public ArrayList<AvailableTimesGroupedDates> getItems() { return Items; }
        public AvailableTimesGroupedDatesResponse setItems(ArrayList<AvailableTimesGroupedDates> value) { this.Items = value; return this; }
    }

    public static class AvailableTimesGroupedDates
    {
        public Date Group = null;
        public ArrayList<AvailableTimesSum> Times = null;
        
        public Date getGroup() { return Group; }
        public AvailableTimesGroupedDates setGroup(Date value) { this.Group = value; return this; }
        public ArrayList<AvailableTimesSum> getTimes() { return Times; }
        public AvailableTimesGroupedDates setTimes(ArrayList<AvailableTimesSum> value) { this.Times = value; return this; }
    }

    public static class AvailableTimesSum implements IAvailableTime
    {
        public Date From = null;
        public Date To = null;
        public Integer Free = null;
        public Integer FreeSpots = null;
        public ArrayList<ExceptionText> ExceptionTexts = null;
        
        public Date getFrom() { return From; }
        public AvailableTimesSum setFrom(Date value) { this.From = value; return this; }
        public Date getTo() { return To; }
        public AvailableTimesSum setTo(Date value) { this.To = value; return this; }
        public Integer getFree() { return Free; }
        public AvailableTimesSum setFree(Integer value) { this.Free = value; return this; }
        public Integer getFreeSpots() { return FreeSpots; }
        public AvailableTimesSum setFreeSpots(Integer value) { this.FreeSpots = value; return this; }
        public ArrayList<ExceptionText> getExceptionTexts() { return ExceptionTexts; }
        public AvailableTimesSum setExceptionTexts(ArrayList<ExceptionText> value) { this.ExceptionTexts = value; return this; }
    }

    public static class ExceptionText
    {
        public String Reason = null;
        public String ReasonPublic = null;
        
        public String getReason() { return Reason; }
        public ExceptionText setReason(String value) { this.Reason = value; return this; }
        public String getReasonPublic() { return ReasonPublic; }
        public ExceptionText setReasonPublic(String value) { this.ReasonPublic = value; return this; }
    }

}

Java AvaiableTimesGroupedQuery 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.

GET /services/{ServiceId}/availabletimes/grouped HTTP/1.1 
Host: api.bokamera.se 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"ServiceId":0,"TimesFreeTextSingle":"String","TimesFreeTextMultiple":"String","Items":[{"Times":[{"Free":0,"FreeSpots":0}]}]}