BokaMera.API.Host

<back to all web services

BookingLogQuery

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, bookingsupplier-administrator-read, superadmin
The following routes are available for this service:
GET/bookinglogFind booking log for booking.
import java.math.*
import java.util.*
import java.io.InputStream
import net.servicestack.client.*
import com.google.gson.annotations.*
import com.google.gson.reflect.*


@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")
open class BookingLogQuery : QueryDb<BookingLog, BookingLogQueryResponse>()
{
    /**
    * Enter the company and booking id you want to see log for, if blank company id and you are an admin, your company id will be used
    */
    @ApiMember(Description="Enter the company and booking id you want to see log for, if blank company id and you are an admin, your company id will be used", IsRequired=true, ParameterType="query")
    open var CompanyId:UUID? = null

    /**
    * Enter the booking id you want to get the log
    */
    @ApiMember(Description="Enter the booking id you want to get the log", IsRequired=true, ParameterType="query")
    open var BookingId:Int? = null
}

open class QueryDb<From, Into> : QueryBase()
{
}

@DataContract
open class QueryBase
{
    @DataMember(Order=1)
    open var Skip:Int? = null

    @DataMember(Order=2)
    open var Take:Int? = null

    @DataMember(Order=3)
    open var OrderBy:String? = null

    @DataMember(Order=4)
    open var OrderByDesc:String? = null

    @DataMember(Order=5)
    open var Include:String? = null

    @DataMember(Order=6)
    open var Fields:String? = null

    @DataMember(Order=7)
    open var Meta:HashMap<String,String>? = null
}

open class BookingLog : BaseModel()
{
    @References(Type=BookingLogEventType::class)
    open var EventTypeId:Int? = null

    open var EventType:BookingLogEventType? = null
    @Required()
    open var CompanyId:UUID? = null

    @Required()
    open var BookingId:Int? = null

    open var Id:Int? = null
    open var Comments:String? = null
    open var UserId:String? = null
    @Required()
    open var Created:Date? = null

    open var ModifiedDate:Date? = null
}

open class BaseModel
{
}

open class BookingLogEventType : BaseModel()
{
    @Required()
    open var Name:String? = null

    @Required()
    open var Description:String? = null

    open var ModifiedDate:Date? = null
    @Required()
    open var Id:Int? = null
}

open class BookingLogQueryResponse
{
    /**
    * The booking log id
    */
    @ApiMember(Description="The booking log id")
    open var Id:Int? = null

    /**
    * The booking id
    */
    @ApiMember(Description="The booking id")
    open var BookingId:Int? = null

    /**
    * The type of event
    */
    @ApiMember(Description="The type of event")
    open var EventTypeId:Int? = null

    /**
    * The type of event
    */
    @ApiMember(Description="The type of event")
    open var EventType:BookingLogEventTypeResponse? = null

    /**
    * Comments that could be added to the event log item
    */
    @ApiMember(Description="Comments that could be added to the event log item")
    open var Comments:String? = null

    /**
    * The user created the event
    */
    @ApiMember(Description="The user created the event")
    open var UserName:String? = null

    /**
    * The date when the event occurred
    */
    @ApiMember(Description="The date when the event occurred")
    open var Created:Date? = null
}

open class BookingLogEventTypeResponse
{
    /**
    * The event type id
    */
    @ApiMember(Description="The event type id")
    open var Id:Int? = null

    /**
    * The event type name
    */
    @ApiMember(Description="The event type name")
    open var Name:String? = null

    /**
    * The event type description
    */
    @ApiMember(Description="The event type description")
    open var Description:String? = null
}

@DataContract
open class QueryResponse<T>
{
    @DataMember(Order=1)
    open var Offset:Int? = null

    @DataMember(Order=2)
    open var Total:Int? = null

    @DataMember(Order=3)
    open var Results:ArrayList<AccessKeyTypeResponse> = ArrayList<AccessKeyTypeResponse>()

    @DataMember(Order=4)
    open var Meta:HashMap<String,String>? = null

    @DataMember(Order=5)
    open var ResponseStatus:ResponseStatus? = null
}

open class AccessKeyTypeResponse
{
    open var Id:Int? = null
    open var KeyType:String? = null
    open var Description:String? = null
}

Kotlin BookingLogQuery DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /bookinglog HTTP/1.1 
Host: testapi.bokamera.se 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Offset: 0,
	Total: 0,
	Results: 
	[
		{
			Id: 0,
			BookingId: 0,
			EventTypeId: 0,
			EventType: 
			{
				Id: 0,
				Name: String,
				Description: String
			},
			Comments: String,
			UserName: String
		}
	],
	Meta: 
	{
		String: String
	},
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}