BokaMera.API.Host

<back to all web services

CreateBookingLogItem

The following routes are available for this service:
POST/bookinglogAdd a new event to booking logAdd a new event to the booking of the company of the currently logged in user, only administrators are allowed to add items to event log.
import 'package:servicestack/servicestack.dart';

class BookingLogEventTypeResponse implements IConvertible
{
    /**
    * The event type id
    */
    // @ApiMember(Description="The event type id")
    int? Id;

    /**
    * The event type name
    */
    // @ApiMember(Description="The event type name")
    String? Name;

    /**
    * The event type description
    */
    // @ApiMember(Description="The event type description")
    String? Description;

    BookingLogEventTypeResponse({this.Id,this.Name,this.Description});
    BookingLogEventTypeResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        Name = json['Name'];
        Description = json['Description'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'Name': Name,
        'Description': Description
    };

    getTypeName() => "BookingLogEventTypeResponse";
    TypeContext? context = _ctx;
}

class BookingLogQueryResponse implements IConvertible
{
    /**
    * The booking log id
    */
    // @ApiMember(Description="The booking log id")
    int? Id;

    /**
    * The booking id
    */
    // @ApiMember(Description="The booking id")
    int? BookingId;

    /**
    * The type of event
    */
    // @ApiMember(Description="The type of event")
    int? EventTypeId;

    /**
    * The type of event
    */
    // @ApiMember(Description="The type of event")
    BookingLogEventTypeResponse? EventType;

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

    /**
    * The user created the event
    */
    // @ApiMember(Description="The user created the event")
    String? UserName;

    /**
    * Then date when the event occured
    */
    // @ApiMember(Description="Then date when the event occured")
    DateTime? Created;

    BookingLogQueryResponse({this.Id,this.BookingId,this.EventTypeId,this.EventType,this.Comments,this.UserName,this.Created});
    BookingLogQueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        BookingId = json['BookingId'];
        EventTypeId = json['EventTypeId'];
        EventType = JsonConverters.fromJson(json['EventType'],'BookingLogEventTypeResponse',context!);
        Comments = json['Comments'];
        UserName = json['UserName'];
        Created = JsonConverters.fromJson(json['Created'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'BookingId': BookingId,
        'EventTypeId': EventTypeId,
        'EventType': JsonConverters.toJson(EventType,'BookingLogEventTypeResponse',context!),
        'Comments': Comments,
        'UserName': UserName,
        'Created': JsonConverters.toJson(Created,'DateTime',context!)
    };

    getTypeName() => "BookingLogQueryResponse";
    TypeContext? context = _ctx;
}

// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
// @ApiResponse(Description="You have too low privilegies to call this service", StatusCode=403)
class CreateBookingLogItem implements ICompany, IConvertible
{
    /**
    * 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.")
    String? CompanyId;

    /**
    * The booking id
    */
    // @ApiMember(Description="The booking id", IsRequired=true)
    int? BookingId;

    /**
    * The type of event
    */
    // @ApiMember(Description="The type of event", IsRequired=true)
    int? EventTypeId;

    /**
    * Comments that could be added to the event log item
    */
    // @ApiMember(Description="Comments that could be added to the event log item", IsRequired=true)
    String? Comments;

    /**
    * Then date when the event occured, leave blank if current datetime
    */
    // @ApiMember(Description="Then date when the event occured, leave blank if current datetime", IsRequired=true)
    DateTime? Created;

    CreateBookingLogItem({this.CompanyId,this.BookingId,this.EventTypeId,this.Comments,this.Created});
    CreateBookingLogItem.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        CompanyId = json['CompanyId'];
        BookingId = json['BookingId'];
        EventTypeId = json['EventTypeId'];
        Comments = json['Comments'];
        Created = JsonConverters.fromJson(json['Created'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'CompanyId': CompanyId,
        'BookingId': BookingId,
        'EventTypeId': EventTypeId,
        'Comments': Comments,
        'Created': JsonConverters.toJson(Created,'DateTime',context!)
    };

    getTypeName() => "CreateBookingLogItem";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'testapi.bokamera.se', types: <String, TypeInfo> {
    'BookingLogEventTypeResponse': TypeInfo(TypeOf.Class, create:() => BookingLogEventTypeResponse()),
    'BookingLogQueryResponse': TypeInfo(TypeOf.Class, create:() => BookingLogQueryResponse()),
    'CreateBookingLogItem': TypeInfo(TypeOf.Class, create:() => CreateBookingLogItem()),
});

Dart CreateBookingLogItem DTOs

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

HTTP + XML

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

POST /bookinglog HTTP/1.1 
Host: testapi.bokamera.se 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<CreateBookingLogItem xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <BookingId>0</BookingId>
  <Comments>String</Comments>
  <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
  <Created>0001-01-01T00:00:00</Created>
  <EventTypeId>0</EventTypeId>
</CreateBookingLogItem>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<BookingLogQueryResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <BookingId>0</BookingId>
  <Comments>String</Comments>
  <Created>0001-01-01T00:00:00</Created>
  <EventType>
    <Description>String</Description>
    <Id>0</Id>
    <Name>String</Name>
  </EventType>
  <EventTypeId>0</EventTypeId>
  <Id>0</Id>
  <UserName>String</UserName>
</BookingLogQueryResponse>