GET | /services/{ServiceId}/nextfreetime | Get the next available time for the service | Get the next available time for the service |
---|
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports BokaMera.API.ServiceModel.Dtos
Namespace Global
Namespace BokaMera.API.ServiceModel.Dtos
Public Partial Class AvailableTimesResourceTypeResource
'''<Summary>
'''The resourcetype id
'''</Summary>
<ApiMember(Description:="The resourcetype id")>
Public Overridable Property ResourceTypeId As Integer
'''<Summary>
'''The resource id
'''</Summary>
<ApiMember(Description:="The resource id")>
Public Overridable Property ResourceId As Integer
End Class
Public Partial Class AvailableTimesResponse
Public Sub New()
Times = New List(Of AvailableTimesSum)
End Sub
Public Overridable Property CompanyId As Guid
Public Overridable Property ServiceId As Integer
Public Overridable Property TimesFreeTextSingle As String
Public Overridable Property TimesFreeTextMultiple As String
Public Overridable Property Times As List(Of AvailableTimesSum)
End Class
Public Partial Class AvailableTimesSum
Implements IAvailableTime
Public Overridable Property From As Date
Public Overridable Property To As Date
Public Overridable Property Free As Integer
Public Overridable Property FreeSpots As Integer
Public Overridable Property ExceptionTexts As IEnumerable(Of ExceptionText)
End Class
Public Partial Class ExceptionText
Public Overridable Property Reason As String
Public Overridable Property ReasonPublic As String
End Class
Public Partial Class NextFreeTimeQuery
Implements IInterval
Public Sub New()
Resources = New List(Of AvailableTimesResourceTypeResource)
End Sub
'''<Summary>
'''Company to show available time for
'''</Summary>
<ApiMember(Description:="Company to show available time for", ParameterType:="query")>
Public Overridable Property CompanyId As Nullable(Of Guid)
'''<Summary>
'''Service id
'''</Summary>
<ApiMember(Description:="Service id", IsRequired:=true, ParameterType:="path")>
Public Overridable Property ServiceId As Integer
'''<Summary>
'''From what datetime to search available times
'''</Summary>
<ApiMember(DataType:="dateTime", Description:="From what datetime to search available times", IsRequired:=true, ParameterType:="query")>
Public Overridable Property From As Date
'''<Summary>
'''To what datetime to show available times. Optional, if no datetime is set it will search one year
'''</Summary>
<ApiMember(DataType:="dateTime", Description:="To what datetime to show available times. Optional, if no datetime is set it will search one year", IsRequired:=true, ParameterType:="query")>
Public Overridable Property To As Date
'''<Summary>
'''Here you can select one of the resource in each resource type connected to the service, if none is selected it will show available times for all
'''</Summary>
<ApiMember(Description:="Here you can select one of the resource in each resource type connected to the service, if none is selected it will show available times for all", ParameterType:="query")>
Public Overridable Property Resources As List(Of AvailableTimesResourceTypeResource)
'''<Summary>
'''Here you select number of resources to book (in each resource type). Default is 1.
'''</Summary>
<ApiMember(Description:="Here you select number of resources to book (in each resource type). Default is 1.", ParameterType:="query")>
Public Overridable Property NumberOfResources As Integer
'''<Summary>
'''The duration you want to book. Needs to withing the service Min and Max. If not set it will use the service duration
'''</Summary>
<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 Overridable Property Duration As Nullable(Of Integer)
'''<Summary>
'''If you want to include the connected resource types and resources
'''</Summary>
<ApiMember(Description:="If you want to include the connected resource types and resources", ParameterType:="query")>
Public Overridable Property ShowPerResource As Boolean
End Class
End Namespace
End Namespace
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 /services/{ServiceId}/nextfreetime HTTP/1.1 Host: api.bokamera.se Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <AvailableTimesResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos"> <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId> <ServiceId>0</ServiceId> <Times> <AvailableTimesSum> <ExceptionTexts i:nil="true" /> <Free>0</Free> <FreeSpots>0</FreeSpots> <From>0001-01-01T00:00:00</From> <To>0001-01-01T00:00:00</To> </AvailableTimesSum> </Times> <TimesFreeTextMultiple>String</TimesFreeTextMultiple> <TimesFreeTextSingle>String</TimesFreeTextSingle> </AvailableTimesResponse>