BokaMera.API.Host

<back to all web services

ListWebhookMessages

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
GET/webhook/messagesList webhook message
import 'package:servicestack/servicestack.dart';

abstract class ClientWebhookRequestBase
{
    String? ClientId;

    ClientWebhookRequestBase({this.ClientId});
    ClientWebhookRequestBase.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'ClientId': ClientId
    };

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

enum Ordering
{
    Ascending,
    Descending,
}

class ListMessagesRequestDto extends ClientWebhookRequestBase implements IConvertible
{
    DateTime? Before;
    DateTime? After;
    String? Channel;
    String? Iterator;
    int? Limit;
    Ordering? Order;
    List<String>? EventTypes;
    bool? WithContent;

    ListMessagesRequestDto({this.Before,this.After,this.Channel,this.Iterator,this.Limit,this.Order,this.EventTypes,this.WithContent});
    ListMessagesRequestDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        Before = JsonConverters.fromJson(json['Before'],'DateTime',context!);
        After = JsonConverters.fromJson(json['After'],'DateTime',context!);
        Channel = json['Channel'];
        Iterator = json['Iterator'];
        Limit = json['Limit'];
        Order = JsonConverters.fromJson(json['Order'],'Ordering',context!);
        EventTypes = JsonConverters.fromJson(json['EventTypes'],'List<String>',context!);
        WithContent = json['WithContent'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'Before': JsonConverters.toJson(Before,'DateTime',context!),
        'After': JsonConverters.toJson(After,'DateTime',context!),
        'Channel': Channel,
        'Iterator': Iterator,
        'Limit': Limit,
        'Order': JsonConverters.toJson(Order,'Ordering',context!),
        'EventTypes': JsonConverters.toJson(EventTypes,'List<String>',context!),
        'WithContent': WithContent
    });

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

class ListMessagesResponseDto implements IConvertible
{
    List<GetMessageResponseDto>? Data;
    bool? Done;
    String? Iterator;

    ListMessagesResponseDto({this.Data,this.Done,this.Iterator});
    ListMessagesResponseDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Data = JsonConverters.fromJson(json['Data'],'List<GetMessageResponseDto>',context!);
        Done = json['Done'];
        Iterator = json['Iterator'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Data': JsonConverters.toJson(Data,'List<GetMessageResponseDto>',context!),
        'Done': Done,
        'Iterator': Iterator
    };

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

// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
// @ValidateRequest(Validator="IsAuthenticated")
class ListWebhookMessages extends ListMessagesRequestDto 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.", IsRequired=true, ParameterType="query")
    String? CompanyId;

    ListWebhookMessages({this.CompanyId});
    ListWebhookMessages.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        CompanyId = json['CompanyId'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'CompanyId': CompanyId
    });

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

class GetMessageResponseDto implements IConvertible
{
    String? Id;
    List<String>? Channels;
    String? EventType;
    Map<String,String?>? Metadata;
    dynamic? Payload;
    String? EventId;
    DateTime? Timestamp;

    GetMessageResponseDto({this.Id,this.Channels,this.EventType,this.Metadata,this.Payload,this.EventId,this.Timestamp});
    GetMessageResponseDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        Channels = JsonConverters.fromJson(json['Channels'],'List<String>',context!);
        EventType = json['EventType'];
        Metadata = JsonConverters.toStringMap(json['Metadata']);
        Payload = JsonConverters.fromJson(json['Payload'],'dynamic',context!);
        EventId = json['EventId'];
        Timestamp = JsonConverters.fromJson(json['Timestamp'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'Channels': JsonConverters.toJson(Channels,'List<String>',context!),
        'EventType': EventType,
        'Metadata': Metadata,
        'Payload': JsonConverters.toJson(Payload,'dynamic',context!),
        'EventId': EventId,
        'Timestamp': JsonConverters.toJson(Timestamp,'DateTime',context!)
    };

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

TypeContext _ctx = TypeContext(library: 'api.bokamera.se', types: <String, TypeInfo> {
    'ClientWebhookRequestBase': TypeInfo(TypeOf.AbstractClass),
    'Ordering': TypeInfo(TypeOf.Enum, enumValues:Ordering.values),
    'ListMessagesRequestDto': TypeInfo(TypeOf.Class, create:() => ListMessagesRequestDto()),
    'ListMessagesResponseDto': TypeInfo(TypeOf.Class, create:() => ListMessagesResponseDto()),
    'List<GetMessageResponseDto>': TypeInfo(TypeOf.Class, create:() => <GetMessageResponseDto>[]),
    'GetMessageResponseDto': TypeInfo(TypeOf.Class, create:() => GetMessageResponseDto()),
    'ListWebhookMessages': TypeInfo(TypeOf.Class, create:() => ListWebhookMessages()),
});

Dart ListWebhookMessages 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 /webhook/messages HTTP/1.1 
Host: api.bokamera.se 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"Data":[{"Id":"String","Channels":["String"],"EventType":"String","Metadata":{"String":"String"},"Payload":{},"EventId":"String"}],"Done":false,"Iterator":"String"}