Requires any of the roles: | bookingsupplier-administrator-write, superadmin, bookingsupplier-administrator-read |
GET | /messages/dashboard | Search the dashboard messages for any messages. | Search the dashboard messages for any messages. |
---|
import 'package:servicestack/servicestack.dart';
// @DataContract
abstract class QueryBase
{
/**
* Skip over a given number of elements in a sequence and then return the remainder. Use this when you need paging.<br/><br/><strong>Example:</strong><br/><code>?skip=10&orderBy=Id</code>
*/
// @DataMember(Order=1)
int? Skip;
/**
* Return a given number of elements in a sequence and then skip over the remainder. Use this when you need paging.<br/><br/><strong>Example:</strong><br/><code>?take=20</code>
*/
// @DataMember(Order=2)
int? Take;
/**
* Comma separated list of fields to order by. Prefix the field name with a minus if you wan't to invert the sort for that field.<br/><br/><strong>Example:</strong><br/><code>?orderBy=Id,-Age,FirstName</code>
*/
// @DataMember(Order=3)
String? OrderBy;
/**
* Comma separated list of fields to order by in descending order. Prefix the field name with a minus if you wan't to invert the sort for that field.<br/><br/><strong>Example:</strong><br/><code>?orderByDesc=Id,-Age,FirstName</code>
*/
// @DataMember(Order=4)
String? OrderByDesc;
/**
* Include any of the aggregates <code>AVG, COUNT, FIRST, LAST, MAX, MIN, SUM</code> in your result set. The results will be returned in the meta field.<br/><br/><strong>Example:</strong><br/><code>?include=COUNT(*) as Total</code><br/><br/>or multiple fields with<br/><code>?include=Count(*) Total, Min(Age), AVG(Age) AverageAge</code><br/></br>or unique with<br/><code>?include=COUNT(DISTINCT LivingStatus) as UniqueStatus</code>
*/
// @DataMember(Order=5)
String? Include;
// @DataMember(Order=6)
String? Fields;
// @DataMember(Order=7)
Map<String,String?>? Meta;
QueryBase({this.Skip,this.Take,this.OrderBy,this.OrderByDesc,this.Include,this.Fields,this.Meta});
QueryBase.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Skip = json['Skip'];
Take = json['Take'];
OrderBy = json['OrderBy'];
OrderByDesc = json['OrderByDesc'];
Include = json['Include'];
Fields = json['Fields'];
Meta = JsonConverters.toStringMap(json['Meta']);
return this;
}
Map<String, dynamic> toJson() => {
'Skip': Skip,
'Take': Take,
'OrderBy': OrderBy,
'OrderByDesc': OrderByDesc,
'Include': Include,
'Fields': Fields,
'Meta': Meta
};
getTypeName() => "QueryBase";
TypeContext? context = _ctx;
}
abstract class QueryDb2<From,Into> extends QueryBase
{
QueryDb2();
QueryDb2.fromJson(Map<String, dynamic> json) : super.fromJson(json);
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
return this;
}
Map<String, dynamic> toJson() => super.toJson();
getTypeName() => "QueryDb<$From,$Into>";
TypeContext? context = _ctx;
}
class DasboardMessageTypeResponse implements IConvertible
{
/**
* The message type id
*/
// @ApiMember(Description="The message type id")
int? Id;
/**
* The message type name
*/
// @ApiMember(Description="The message type name")
String? Name;
/**
* The message type description
*/
// @ApiMember(Description="The message type description")
String? Description;
/**
* The message type image
*/
// @ApiMember(Description="The message type image")
String? ImageUrl;
/**
* If the message type is a application message
*/
// @ApiMember(Description="If the message type is a application message")
bool? ApplicationMessage;
/**
* The message type icon
*/
// @ApiMember(Description="The message type icon")
String? Icon;
/**
* The message type color
*/
// @ApiMember(Description="The message type color")
String? Color;
DasboardMessageTypeResponse({this.Id,this.Name,this.Description,this.ImageUrl,this.ApplicationMessage,this.Icon,this.Color});
DasboardMessageTypeResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
Name = json['Name'];
Description = json['Description'];
ImageUrl = json['ImageUrl'];
ApplicationMessage = json['ApplicationMessage'];
Icon = json['Icon'];
Color = json['Color'];
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'Name': Name,
'Description': Description,
'ImageUrl': ImageUrl,
'ApplicationMessage': ApplicationMessage,
'Icon': Icon,
'Color': Color
};
getTypeName() => "DasboardMessageTypeResponse";
TypeContext? context = _ctx;
}
class DashboardMessageQueryResponse implements IConvertible
{
/**
* The message id
*/
// @ApiMember(Description="The message id")
int? Id;
/**
* The message title.
*/
// @ApiMember(Description="The message title.")
String? Title;
/**
* The message body.
*/
// @ApiMember(Description="The message body.")
String? Body;
/**
* If the message is important.
*/
// @ApiMember(Description="If the message is important.")
bool? Important;
/**
* If the message visible from date.
*/
// @ApiMember(Description="If the message visible from date.")
DateTime? VisibleFrom;
/**
* If the message visible to date.
*/
// @ApiMember(Description="If the message visible to date.")
DateTime? VisibleTo;
/**
* If the message created date.
*/
// @ApiMember(Description="If the message created date.")
DateTime? Created;
/**
* If the message type id.
*/
// @ApiMember(Description="If the message type id.")
int? MessageTypeId;
/**
* If the message is connected to a support case.
*/
// @ApiMember(Description="If the message is connected to a support case.")
int? SupportCaseId;
/**
* If the message type information.
*/
// @ApiMember(Description="If the message type information.")
DasboardMessageTypeResponse? MessageType;
DashboardMessageQueryResponse({this.Id,this.Title,this.Body,this.Important,this.VisibleFrom,this.VisibleTo,this.Created,this.MessageTypeId,this.SupportCaseId,this.MessageType});
DashboardMessageQueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
Title = json['Title'];
Body = json['Body'];
Important = json['Important'];
VisibleFrom = JsonConverters.fromJson(json['VisibleFrom'],'DateTime',context!);
VisibleTo = JsonConverters.fromJson(json['VisibleTo'],'DateTime',context!);
Created = JsonConverters.fromJson(json['Created'],'DateTime',context!);
MessageTypeId = json['MessageTypeId'];
SupportCaseId = json['SupportCaseId'];
MessageType = JsonConverters.fromJson(json['MessageType'],'DasboardMessageTypeResponse',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'Title': Title,
'Body': Body,
'Important': Important,
'VisibleFrom': JsonConverters.toJson(VisibleFrom,'DateTime',context!),
'VisibleTo': JsonConverters.toJson(VisibleTo,'DateTime',context!),
'Created': JsonConverters.toJson(Created,'DateTime',context!),
'MessageTypeId': MessageTypeId,
'SupportCaseId': SupportCaseId,
'MessageType': JsonConverters.toJson(MessageType,'DasboardMessageTypeResponse',context!)
};
getTypeName() => "DashboardMessageQueryResponse";
TypeContext? context = _ctx;
}
class BaseModel implements IConvertible
{
BaseModel();
BaseModel.fromJson(Map<String, dynamic> json) : super();
fromMap(Map<String, dynamic> json) {
return this;
}
Map<String, dynamic> toJson() => {};
getTypeName() => "BaseModel";
TypeContext? context = _ctx;
}
class DashboardMessageType extends BaseModel implements IConvertible
{
// @Required()
String? Name;
// @Required()
String? Description;
// @Required()
String? Image;
bool? ApplicationMessage;
// @Required()
String? Color;
// @Required()
String? Icon;
DateTime? ModifiedDate;
int? Id;
DashboardMessageType({this.Name,this.Description,this.Image,this.ApplicationMessage,this.Color,this.Icon,this.ModifiedDate,this.Id});
DashboardMessageType.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
Name = json['Name'];
Description = json['Description'];
Image = json['Image'];
ApplicationMessage = json['ApplicationMessage'];
Color = json['Color'];
Icon = json['Icon'];
ModifiedDate = JsonConverters.fromJson(json['ModifiedDate'],'DateTime',context!);
Id = json['Id'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'Name': Name,
'Description': Description,
'Image': Image,
'ApplicationMessage': ApplicationMessage,
'Color': Color,
'Icon': Icon,
'ModifiedDate': JsonConverters.toJson(ModifiedDate,'DateTime',context!),
'Id': Id
});
getTypeName() => "DashboardMessageType";
TypeContext? context = _ctx;
}
class DashboardMessage extends BaseModel implements IConvertible
{
// @References(typeof(DashboardMessageType))
int? MessageTypeId;
DashboardMessageType? MessageType;
// @Required()
String? CompanyId;
int? Id;
// @Required()
String? Title;
// @Required()
String? Body;
// @Required()
bool? Important;
// @Required()
DateTime? VisibleFrom;
// @Required()
DateTime? VisibleTo;
// @Required()
DateTime? Created;
int? SupportCaseId;
DateTime? ModifiedDate;
DashboardMessage({this.MessageTypeId,this.MessageType,this.CompanyId,this.Id,this.Title,this.Body,this.Important,this.VisibleFrom,this.VisibleTo,this.Created,this.SupportCaseId,this.ModifiedDate});
DashboardMessage.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
MessageTypeId = json['MessageTypeId'];
MessageType = JsonConverters.fromJson(json['MessageType'],'DashboardMessageType',context!);
CompanyId = json['CompanyId'];
Id = json['Id'];
Title = json['Title'];
Body = json['Body'];
Important = json['Important'];
VisibleFrom = JsonConverters.fromJson(json['VisibleFrom'],'DateTime',context!);
VisibleTo = JsonConverters.fromJson(json['VisibleTo'],'DateTime',context!);
Created = JsonConverters.fromJson(json['Created'],'DateTime',context!);
SupportCaseId = json['SupportCaseId'];
ModifiedDate = JsonConverters.fromJson(json['ModifiedDate'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'MessageTypeId': MessageTypeId,
'MessageType': JsonConverters.toJson(MessageType,'DashboardMessageType',context!),
'CompanyId': CompanyId,
'Id': Id,
'Title': Title,
'Body': Body,
'Important': Important,
'VisibleFrom': JsonConverters.toJson(VisibleFrom,'DateTime',context!),
'VisibleTo': JsonConverters.toJson(VisibleTo,'DateTime',context!),
'Created': JsonConverters.toJson(Created,'DateTime',context!),
'SupportCaseId': SupportCaseId,
'ModifiedDate': JsonConverters.toJson(ModifiedDate,'DateTime',context!)
});
getTypeName() => "DashboardMessage";
TypeContext? context = _ctx;
}
// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
// @ValidateRequest(Validator="IsAuthenticated")
class DashboardMessageQuery extends QueryDb2<DashboardMessage,DashboardMessageQueryResponse> 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.", ParameterType="path")
String? CompanyId;
/**
* If you want to filter on important messages only
*/
// @ApiMember(DataType="boolean", Description="If you want to filter on important messages only", ParameterType="query")
bool? Important;
/**
* Filter on Message Type Id
*/
// @ApiMember(DataType="int", Description="Filter on Message Type Id", ParameterType="query")
int? MessageTypeId;
/**
* If you want to include the message type information
*/
// @ApiMember(DataType="boolean", Description="If you want to include the message type information", ParameterType="query")
bool? IncludeMessageTypeInformation;
ResponseStatus? ResponseStatus;
DashboardMessageQuery({this.CompanyId,this.Important,this.MessageTypeId,this.IncludeMessageTypeInformation,this.ResponseStatus});
DashboardMessageQuery.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
CompanyId = json['CompanyId'];
Important = json['Important'];
MessageTypeId = json['MessageTypeId'];
IncludeMessageTypeInformation = json['IncludeMessageTypeInformation'];
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'CompanyId': CompanyId,
'Important': Important,
'MessageTypeId': MessageTypeId,
'IncludeMessageTypeInformation': IncludeMessageTypeInformation,
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
});
getTypeName() => "DashboardMessageQuery";
TypeContext? context = _ctx;
}
class AccessKeyTypeResponse implements IConvertible
{
int? Id;
String? KeyType;
String? Description;
AccessKeyTypeResponse({this.Id,this.KeyType,this.Description});
AccessKeyTypeResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
KeyType = json['KeyType'];
Description = json['Description'];
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'KeyType': KeyType,
'Description': Description
};
getTypeName() => "AccessKeyTypeResponse";
TypeContext? context = _ctx;
}
// @DataContract
class QueryResponse<AccessKeyTypeResponse> implements IConvertible
{
// @DataMember(Order=1)
int? Offset;
// @DataMember(Order=2)
int? Total;
// @DataMember(Order=3)
List<AccessKeyTypeResponse>? Results;
// @DataMember(Order=4)
Map<String,String?>? Meta;
// @DataMember(Order=5)
ResponseStatus? ResponseStatus;
QueryResponse({this.Offset,this.Total,this.Results,this.Meta,this.ResponseStatus});
QueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Offset = json['Offset'];
Total = json['Total'];
Results = JsonConverters.fromJson(json['Results'],'List<${runtimeGenericTypeDefs(this,[0]).join(",")}>',context!);
Meta = JsonConverters.toStringMap(json['Meta']);
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Offset': Offset,
'Total': Total,
'Results': JsonConverters.toJson(Results,'List<AccessKeyTypeResponse>',context!),
'Meta': Meta,
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
};
getTypeName() => "QueryResponse<$AccessKeyTypeResponse>";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.bokamera.se', types: <String, TypeInfo> {
'DasboardMessageTypeResponse': TypeInfo(TypeOf.Class, create:() => DasboardMessageTypeResponse()),
'DashboardMessageQueryResponse': TypeInfo(TypeOf.Class, create:() => DashboardMessageQueryResponse()),
'BaseModel': TypeInfo(TypeOf.Class, create:() => BaseModel()),
'DashboardMessageType': TypeInfo(TypeOf.Class, create:() => DashboardMessageType()),
'DashboardMessage': TypeInfo(TypeOf.Class, create:() => DashboardMessage()),
'DashboardMessageQuery': TypeInfo(TypeOf.Class, create:() => DashboardMessageQuery()),
'List<DashboardMessageQueryResponse>': TypeInfo(TypeOf.Class, create:() => <DashboardMessageQueryResponse>[]),
'AccessKeyTypeResponse': TypeInfo(TypeOf.Class, create:() => AccessKeyTypeResponse()),
'QueryResponse<AccessKeyTypeResponse>': TypeInfo(TypeOf.Class, create:() => QueryResponse<AccessKeyTypeResponse>()),
});
Dart DashboardMessageQuery DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /messages/dashboard HTTP/1.1 Host: api.bokamera.se Accept: text/jsonl
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"Offset":0,"Total":0,"Results":[{"Id":0,"Title":"String","Body":"String","Important":false,"MessageTypeId":0,"SupportCaseId":0,"MessageType":{"Id":0,"Name":"String","Description":"String","ImageUrl":"String","ApplicationMessage":false,"Icon":"String","Color":"String"}}],"Meta":{"String":"String"},"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}