BokaMera.API.Host

<back to all web services

DashboardMessageQuery

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin, bookingsupplier-administrator-read
The following routes are available for this service:
GET/messages/dashboardSearch the dashboard messages for any messages.Search the dashboard messages for any messages.
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
import com.google.gson.annotations.*;
import com.google.gson.reflect.*;

public class dtos
{

    @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
    @ValidateRequest(Validator="IsAuthenticated")
    public static class DashboardMessageQuery extends QueryDb<DashboardMessage, DashboardMessageQueryResponse> implements ICompany
    {
        /**
        * 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")
        public UUID CompanyId = null;

        /**
        * If you want to filter on important messages only
        */
        @ApiMember(DataType="boolean", Description="If you want to filter on important messages only", ParameterType="query")
        public Boolean Important = null;

        /**
        * Filter on Message Type Id
        */
        @ApiMember(DataType="int", Description="Filter on Message Type Id", ParameterType="query")
        public Integer MessageTypeId = null;

        /**
        * If you want to include the message type information
        */
        @ApiMember(DataType="boolean", Description="If you want to include the message type information", ParameterType="query")
        public Boolean IncludeMessageTypeInformation = null;

        public ResponseStatus ResponseStatus = null;
        
        public UUID getCompanyId() { return CompanyId; }
        public DashboardMessageQuery setCompanyId(UUID value) { this.CompanyId = value; return this; }
        public Boolean isImportant() { return Important; }
        public DashboardMessageQuery setImportant(Boolean value) { this.Important = value; return this; }
        public Integer getMessageTypeId() { return MessageTypeId; }
        public DashboardMessageQuery setMessageTypeId(Integer value) { this.MessageTypeId = value; return this; }
        public Boolean isIncludeMessageTypeInformation() { return IncludeMessageTypeInformation; }
        public DashboardMessageQuery setIncludeMessageTypeInformation(Boolean value) { this.IncludeMessageTypeInformation = value; return this; }
        public ResponseStatus getResponseStatus() { return ResponseStatus; }
        public DashboardMessageQuery setResponseStatus(ResponseStatus value) { this.ResponseStatus = value; return this; }
    }

    public static class QueryDb<From, Into> extends QueryBase
    {
        
    }

    @DataContract
    public static 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)
        public Integer Skip = null;

        /**
        * 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)
        public Integer Take = null;

        /**
        * 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)
        public String OrderBy = null;

        /**
        * 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)
        public String OrderByDesc = null;

        /**
        * 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)
        public String Include = null;

        @DataMember(Order=6)
        public String Fields = null;

        @DataMember(Order=7)
        public HashMap<String,String> Meta = null;
        
        public Integer getSkip() { return Skip; }
        public QueryBase setSkip(Integer value) { this.Skip = value; return this; }
        public Integer getTake() { return Take; }
        public QueryBase setTake(Integer value) { this.Take = value; return this; }
        public String getOrderBy() { return OrderBy; }
        public QueryBase setOrderBy(String value) { this.OrderBy = value; return this; }
        public String getOrderByDesc() { return OrderByDesc; }
        public QueryBase setOrderByDesc(String value) { this.OrderByDesc = value; return this; }
        public String getInclude() { return Include; }
        public QueryBase setInclude(String value) { this.Include = value; return this; }
        public String getFields() { return Fields; }
        public QueryBase setFields(String value) { this.Fields = value; return this; }
        public HashMap<String,String> getMeta() { return Meta; }
        public QueryBase setMeta(HashMap<String,String> value) { this.Meta = value; return this; }
    }

    public static class DashboardMessage extends BaseModel
    {
        @References(DashboardMessageType.class)
        public Integer MessageTypeId = null;

        public DashboardMessageType MessageType = null;
        @Required()
        public UUID CompanyId = null;

        public Integer Id = null;
        @Required()
        public String Title = null;

        @Required()
        public String Body = null;

        @Required()
        public Boolean Important = null;

        @Required()
        public Date VisibleFrom = null;

        @Required()
        public Date VisibleTo = null;

        @Required()
        public Date Created = null;

        public Integer SupportCaseId = null;
        public Date ModifiedDate = null;
        
        public Integer getMessageTypeId() { return MessageTypeId; }
        public DashboardMessage setMessageTypeId(Integer value) { this.MessageTypeId = value; return this; }
        public DashboardMessageType getMessageType() { return MessageType; }
        public DashboardMessage setMessageType(DashboardMessageType value) { this.MessageType = value; return this; }
        public UUID getCompanyId() { return CompanyId; }
        public DashboardMessage setCompanyId(UUID value) { this.CompanyId = value; return this; }
        public Integer getId() { return Id; }
        public DashboardMessage setId(Integer value) { this.Id = value; return this; }
        public String getTitle() { return Title; }
        public DashboardMessage setTitle(String value) { this.Title = value; return this; }
        public String getBody() { return Body; }
        public DashboardMessage setBody(String value) { this.Body = value; return this; }
        public Boolean isImportant() { return Important; }
        public DashboardMessage setImportant(Boolean value) { this.Important = value; return this; }
        public Date getVisibleFrom() { return VisibleFrom; }
        public DashboardMessage setVisibleFrom(Date value) { this.VisibleFrom = value; return this; }
        public Date getVisibleTo() { return VisibleTo; }
        public DashboardMessage setVisibleTo(Date value) { this.VisibleTo = value; return this; }
        public Date getCreated() { return Created; }
        public DashboardMessage setCreated(Date value) { this.Created = value; return this; }
        public Integer getSupportCaseId() { return SupportCaseId; }
        public DashboardMessage setSupportCaseId(Integer value) { this.SupportCaseId = value; return this; }
        public Date getModifiedDate() { return ModifiedDate; }
        public DashboardMessage setModifiedDate(Date value) { this.ModifiedDate = value; return this; }
    }

    public static class BaseModel
    {
        
    }

    public static class DashboardMessageType extends BaseModel
    {
        @Required()
        public String Name = null;

        @Required()
        public String Description = null;

        @Required()
        public String Image = null;

        public Boolean ApplicationMessage = null;
        @Required()
        public String Color = null;

        @Required()
        public String Icon = null;

        public Date ModifiedDate = null;
        public Integer Id = null;
        
        public String getName() { return Name; }
        public DashboardMessageType setName(String value) { this.Name = value; return this; }
        public String getDescription() { return Description; }
        public DashboardMessageType setDescription(String value) { this.Description = value; return this; }
        public String getImage() { return Image; }
        public DashboardMessageType setImage(String value) { this.Image = value; return this; }
        public Boolean isApplicationMessage() { return ApplicationMessage; }
        public DashboardMessageType setApplicationMessage(Boolean value) { this.ApplicationMessage = value; return this; }
        public String getColor() { return Color; }
        public DashboardMessageType setColor(String value) { this.Color = value; return this; }
        public String getIcon() { return Icon; }
        public DashboardMessageType setIcon(String value) { this.Icon = value; return this; }
        public Date getModifiedDate() { return ModifiedDate; }
        public DashboardMessageType setModifiedDate(Date value) { this.ModifiedDate = value; return this; }
        public Integer getId() { return Id; }
        public DashboardMessageType setId(Integer value) { this.Id = value; return this; }
    }

    public static class DashboardMessageQueryResponse
    {
        /**
        * The message id
        */
        @ApiMember(Description="The message id")
        public Integer Id = null;

        /**
        * The message title.
        */
        @ApiMember(Description="The message title.")
        public String Title = null;

        /**
        * The message body.
        */
        @ApiMember(Description="The message body.")
        public String Body = null;

        /**
        * If the message is important.
        */
        @ApiMember(Description="If the message is important.")
        public Boolean Important = null;

        /**
        * If the message visible from date.
        */
        @ApiMember(Description="If the message visible from date.")
        public Date VisibleFrom = null;

        /**
        * If the message visible to date.
        */
        @ApiMember(Description="If the message visible to date.")
        public Date VisibleTo = null;

        /**
        * If the message created date.
        */
        @ApiMember(Description="If the message created date.")
        public Date Created = null;

        /**
        * If the message type id.
        */
        @ApiMember(Description="If the message type id.")
        public Integer MessageTypeId = null;

        /**
        * If the message is connected to a support case.
        */
        @ApiMember(Description="If the message is connected to a support case.")
        public Integer SupportCaseId = null;

        /**
        * If the message type information.
        */
        @ApiMember(Description="If the message type information.")
        public DasboardMessageTypeResponse MessageType = null;
        
        public Integer getId() { return Id; }
        public DashboardMessageQueryResponse setId(Integer value) { this.Id = value; return this; }
        public String getTitle() { return Title; }
        public DashboardMessageQueryResponse setTitle(String value) { this.Title = value; return this; }
        public String getBody() { return Body; }
        public DashboardMessageQueryResponse setBody(String value) { this.Body = value; return this; }
        public Boolean isImportant() { return Important; }
        public DashboardMessageQueryResponse setImportant(Boolean value) { this.Important = value; return this; }
        public Date getVisibleFrom() { return VisibleFrom; }
        public DashboardMessageQueryResponse setVisibleFrom(Date value) { this.VisibleFrom = value; return this; }
        public Date getVisibleTo() { return VisibleTo; }
        public DashboardMessageQueryResponse setVisibleTo(Date value) { this.VisibleTo = value; return this; }
        public Date getCreated() { return Created; }
        public DashboardMessageQueryResponse setCreated(Date value) { this.Created = value; return this; }
        public Integer getMessageTypeId() { return MessageTypeId; }
        public DashboardMessageQueryResponse setMessageTypeId(Integer value) { this.MessageTypeId = value; return this; }
        public Integer getSupportCaseId() { return SupportCaseId; }
        public DashboardMessageQueryResponse setSupportCaseId(Integer value) { this.SupportCaseId = value; return this; }
        public DasboardMessageTypeResponse getMessageType() { return MessageType; }
        public DashboardMessageQueryResponse setMessageType(DasboardMessageTypeResponse value) { this.MessageType = value; return this; }
    }

    public static class DasboardMessageTypeResponse
    {
        /**
        * The message type id
        */
        @ApiMember(Description="The message type id")
        public Integer Id = null;

        /**
        * The message type name
        */
        @ApiMember(Description="The message type name")
        public String Name = null;

        /**
        * The message type description
        */
        @ApiMember(Description="The message type description")
        public String Description = null;

        /**
        * The message type image
        */
        @ApiMember(Description="The message type image")
        public String ImageUrl = null;

        /**
        * If the message type is a application message
        */
        @ApiMember(Description="If the message type is a application message")
        public Boolean ApplicationMessage = null;

        /**
        * The message type icon
        */
        @ApiMember(Description="The message type icon")
        public String Icon = null;

        /**
        * The message type color
        */
        @ApiMember(Description="The message type color")
        public String Color = null;
        
        public Integer getId() { return Id; }
        public DasboardMessageTypeResponse setId(Integer value) { this.Id = value; return this; }
        public String getName() { return Name; }
        public DasboardMessageTypeResponse setName(String value) { this.Name = value; return this; }
        public String getDescription() { return Description; }
        public DasboardMessageTypeResponse setDescription(String value) { this.Description = value; return this; }
        public String getImageUrl() { return ImageUrl; }
        public DasboardMessageTypeResponse setImageUrl(String value) { this.ImageUrl = value; return this; }
        public Boolean isApplicationMessage() { return ApplicationMessage; }
        public DasboardMessageTypeResponse setApplicationMessage(Boolean value) { this.ApplicationMessage = value; return this; }
        public String getIcon() { return Icon; }
        public DasboardMessageTypeResponse setIcon(String value) { this.Icon = value; return this; }
        public String getColor() { return Color; }
        public DasboardMessageTypeResponse setColor(String value) { this.Color = value; return this; }
    }

    @DataContract
    public static class QueryResponse<AccessKeyTypeResponse>
    {
        @DataMember(Order=1)
        public Integer Offset = null;

        @DataMember(Order=2)
        public Integer Total = null;

        @DataMember(Order=3)
        public ArrayList<AccessKeyTypeResponse> Results = null;

        @DataMember(Order=4)
        public HashMap<String,String> Meta = null;

        @DataMember(Order=5)
        public ResponseStatus ResponseStatus = null;
        
        public Integer getOffset() { return Offset; }
        public QueryResponse<AccessKeyTypeResponse> setOffset(Integer value) { this.Offset = value; return this; }
        public Integer getTotal() { return Total; }
        public QueryResponse<AccessKeyTypeResponse> setTotal(Integer value) { this.Total = value; return this; }
        public ArrayList<AccessKeyTypeResponse> getResults() { return Results; }
        public QueryResponse<AccessKeyTypeResponse> setResults(ArrayList<AccessKeyTypeResponse> value) { this.Results = value; return this; }
        public HashMap<String,String> getMeta() { return Meta; }
        public QueryResponse<AccessKeyTypeResponse> setMeta(HashMap<String,String> value) { this.Meta = value; return this; }
        public ResponseStatus getResponseStatus() { return ResponseStatus; }
        public QueryResponse<AccessKeyTypeResponse> setResponseStatus(ResponseStatus value) { this.ResponseStatus = value; return this; }
    }

    public static class AccessKeyTypeResponse
    {
        public Integer Id = null;
        public String KeyType = null;
        public String Description = null;
        
        public Integer getId() { return Id; }
        public AccessKeyTypeResponse setId(Integer value) { this.Id = value; return this; }
        public String getKeyType() { return KeyType; }
        public AccessKeyTypeResponse setKeyType(String value) { this.KeyType = value; return this; }
        public String getDescription() { return Description; }
        public AccessKeyTypeResponse setDescription(String value) { this.Description = value; return this; }
    }

}

Java DashboardMessageQuery 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 /messages/dashboard HTTP/1.1 
Host: api.bokamera.se 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
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
		}
	}
}