BokaMera.API.Host

<back to all web services

MessageLogQuery

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin, bookingsupplier-administrator-read
The following routes are available for this service:
GET/messages/logSearch the message log for any messagesSearch the message log 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 MessageLogQuery extends QueryDb<MessageLog, MessageLogQueryResponse> 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 search on sent messages
        */
        @ApiMember(DataType="boolean", Description="If you want to search on sent messages", ParameterType="query")
        public Boolean Sent = null;

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

        /**
        * If you want to search on a messages for a specific booking
        */
        @ApiMember(DataType="int", Description="If you want to search on a messages for a specific booking", ParameterType="query")
        public Integer BookingId = null;

        /**
        * If you want to search on a messages for a specific receiver
        */
        @ApiMember(DataType="string", Description="If you want to search on a messages for a specific receiver", ParameterType="query")
        public String Receiver = null;

        /**
        * If you want to search on a messages created a specific date
        */
        @ApiMember(DataType="datetime", Description="If you want to search on a messages created a specific date", ParameterType="query")
        public Date Created = null;

        /**
        * If you want to search on a messages sent a specific date
        */
        @ApiMember(DataType="datetime", Description="If you want to search on a messages sent a specific date", ParameterType="query")
        public Date SentDate = null;

        public ResponseStatus ResponseStatus = null;
        
        public UUID getCompanyId() { return CompanyId; }
        public MessageLogQuery setCompanyId(UUID value) { this.CompanyId = value; return this; }
        public Boolean isSent() { return Sent; }
        public MessageLogQuery setSent(Boolean value) { this.Sent = value; return this; }
        public Integer getId() { return Id; }
        public MessageLogQuery setId(Integer value) { this.Id = value; return this; }
        public Integer getBookingId() { return BookingId; }
        public MessageLogQuery setBookingId(Integer value) { this.BookingId = value; return this; }
        public String getReceiver() { return Receiver; }
        public MessageLogQuery setReceiver(String value) { this.Receiver = value; return this; }
        public Date getCreated() { return Created; }
        public MessageLogQuery setCreated(Date value) { this.Created = value; return this; }
        public Date getSentDate() { return SentDate; }
        public MessageLogQuery setSentDate(Date value) { this.SentDate = value; return this; }
        public ResponseStatus getResponseStatus() { return ResponseStatus; }
        public MessageLogQuery 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 MessageLog extends BaseModel implements IMessageLog
    {
        public Integer BookingId = null;
        @Required()
        public Boolean PublicMessage = null;

        @Required()
        public Integer MessageType = null;

        @Required()
        public Boolean iCalAttachment = null;

        @Required()
        public String SenderName = null;

        public Date ModifiedDate = null;
        public UUID CorrelationId = null;
        @Required()
        public UUID CompanyId = null;

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

        @Required()
        public String Sender = null;

        public String MessageTitle = null;
        @Required()
        public String MessageBody = null;

        public String CreatedBy = null;
        @Required()
        public Date Created = null;

        @Required()
        public Boolean Sent = null;

        @Required()
        public Date ToSendDate = null;

        public Date SentDate = null;
        @Required()
        public Integer SendMethodId = null;

        public Integer MessageCount = null;
        public Integer SMSStatus = null;
        @Required()
        public Integer MessageRetries = null;

        public String StorageUrl = null;
        public String Language = null;
        
        public Integer getBookingId() { return BookingId; }
        public MessageLog setBookingId(Integer value) { this.BookingId = value; return this; }
        public Boolean isPublicMessage() { return PublicMessage; }
        public MessageLog setPublicMessage(Boolean value) { this.PublicMessage = value; return this; }
        public Integer getMessageType() { return MessageType; }
        public MessageLog setMessageType(Integer value) { this.MessageType = value; return this; }
        public Boolean isICalAttachment() { return iCalAttachment; }
        public MessageLog setICalAttachment(Boolean value) { this.iCalAttachment = value; return this; }
        public String getSenderName() { return SenderName; }
        public MessageLog setSenderName(String value) { this.SenderName = value; return this; }
        public Date getModifiedDate() { return ModifiedDate; }
        public MessageLog setModifiedDate(Date value) { this.ModifiedDate = value; return this; }
        public UUID getCorrelationId() { return CorrelationId; }
        public MessageLog setCorrelationId(UUID value) { this.CorrelationId = value; return this; }
        public UUID getCompanyId() { return CompanyId; }
        public MessageLog setCompanyId(UUID value) { this.CompanyId = value; return this; }
        public Integer getId() { return Id; }
        public MessageLog setId(Integer value) { this.Id = value; return this; }
        public String getReceiver() { return Receiver; }
        public MessageLog setReceiver(String value) { this.Receiver = value; return this; }
        public String getSender() { return Sender; }
        public MessageLog setSender(String value) { this.Sender = value; return this; }
        public String getMessageTitle() { return MessageTitle; }
        public MessageLog setMessageTitle(String value) { this.MessageTitle = value; return this; }
        public String getMessageBody() { return MessageBody; }
        public MessageLog setMessageBody(String value) { this.MessageBody = value; return this; }
        public String getCreatedBy() { return CreatedBy; }
        public MessageLog setCreatedBy(String value) { this.CreatedBy = value; return this; }
        public Date getCreated() { return Created; }
        public MessageLog setCreated(Date value) { this.Created = value; return this; }
        public Boolean isSent() { return Sent; }
        public MessageLog setSent(Boolean value) { this.Sent = value; return this; }
        public Date getToSendDate() { return ToSendDate; }
        public MessageLog setToSendDate(Date value) { this.ToSendDate = value; return this; }
        public Date getSentDate() { return SentDate; }
        public MessageLog setSentDate(Date value) { this.SentDate = value; return this; }
        public Integer getSendMethodId() { return SendMethodId; }
        public MessageLog setSendMethodId(Integer value) { this.SendMethodId = value; return this; }
        public Integer getMessageCount() { return MessageCount; }
        public MessageLog setMessageCount(Integer value) { this.MessageCount = value; return this; }
        public Integer getSmsStatus() { return SMSStatus; }
        public MessageLog setSmsStatus(Integer value) { this.SMSStatus = value; return this; }
        public Integer getMessageRetries() { return MessageRetries; }
        public MessageLog setMessageRetries(Integer value) { this.MessageRetries = value; return this; }
        public String getStorageUrl() { return StorageUrl; }
        public MessageLog setStorageUrl(String value) { this.StorageUrl = value; return this; }
        public String getLanguage() { return Language; }
        public MessageLog setLanguage(String value) { this.Language = value; return this; }
    }

    public static class BaseModel
    {
        
    }

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

        /**
        * The booking id for the message (if connected to a booking).
        */
        @ApiMember(Description="The booking id for the message (if connected to a booking).")
        public Integer BookingId = null;

        /**
        * The message receiver. Either a email or a mobile phone number.
        */
        @ApiMember(Description="The message receiver. Either a email or a mobile phone number.")
        public String Receiver = null;

        /**
        * Message Title.
        */
        @ApiMember(Description="Message Title.")
        public String MessageTitle = null;

        /**
        * Message Storage Url.
        */
        @ApiMember(Description="Message Storage Url.")
        public String StorageUrl = null;

        /**
        * Message Body.
        */
        @ApiMember(Description="Message Body.")
        public String MessageBody = null;

        /**
        * When message was created.
        */
        @ApiMember(Description="When message was created.")
        public Date Created = null;

        /**
        * When the message will be sent.
        */
        @ApiMember(Description="When the message will be sent.")
        public Date ToSendDate = null;

        /**
        * When the message was sent.
        */
        @ApiMember(Description="When the message was sent.")
        public Date SentDate = null;

        /**
        * If Message is sent
        */
        @ApiMember(Description="If Message is sent")
        public Boolean Sent = null;

        /**
        * Number of retries to send the message
        */
        @ApiMember(Description="Number of retries to send the message")
        public Integer MessageRetries = null;

        /**
        * Send Method. 1 = Email, 2 = SMS
        */
        @ApiMember(Description="Send Method. 1 = Email, 2 = SMS")
        public Integer SendMethodId = null;
        
        public Integer getId() { return Id; }
        public MessageLogQueryResponse setId(Integer value) { this.Id = value; return this; }
        public Integer getBookingId() { return BookingId; }
        public MessageLogQueryResponse setBookingId(Integer value) { this.BookingId = value; return this; }
        public String getReceiver() { return Receiver; }
        public MessageLogQueryResponse setReceiver(String value) { this.Receiver = value; return this; }
        public String getMessageTitle() { return MessageTitle; }
        public MessageLogQueryResponse setMessageTitle(String value) { this.MessageTitle = value; return this; }
        public String getStorageUrl() { return StorageUrl; }
        public MessageLogQueryResponse setStorageUrl(String value) { this.StorageUrl = value; return this; }
        public String getMessageBody() { return MessageBody; }
        public MessageLogQueryResponse setMessageBody(String value) { this.MessageBody = value; return this; }
        public Date getCreated() { return Created; }
        public MessageLogQueryResponse setCreated(Date value) { this.Created = value; return this; }
        public Date getToSendDate() { return ToSendDate; }
        public MessageLogQueryResponse setToSendDate(Date value) { this.ToSendDate = value; return this; }
        public Date getSentDate() { return SentDate; }
        public MessageLogQueryResponse setSentDate(Date value) { this.SentDate = value; return this; }
        public Boolean isSent() { return Sent; }
        public MessageLogQueryResponse setSent(Boolean value) { this.Sent = value; return this; }
        public Integer getMessageRetries() { return MessageRetries; }
        public MessageLogQueryResponse setMessageRetries(Integer value) { this.MessageRetries = value; return this; }
        public Integer getSendMethodId() { return SendMethodId; }
        public MessageLogQueryResponse setSendMethodId(Integer value) { this.SendMethodId = 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 MessageLogQuery DTOs

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

HTTP + OTHER

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

GET /messages/log 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,"BookingId":0,"Receiver":"String","MessageTitle":"String","StorageUrl":"String","MessageBody":"String","SentDate":"0001-01-01T00:00:00","Sent":false,"MessageRetries":0,"SendMethodId":0}],"Meta":{"String":"String"},"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}