Requires any of the roles: | bookingsupplier-administrator-write, superadmin, bookingsupplier-administrator-read |
GET | /newsletter/log | Search the newsletter log for any messages | Search the newsletter 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 NewsletterLogQuery extends QueryDb<NewsletterLog, NewsletterLogQueryResponse> 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 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 NewsletterLogQuery setCompanyId(UUID value) { this.CompanyId = value; return this; }
public Boolean isSent() { return Sent; }
public NewsletterLogQuery setSent(Boolean value) { this.Sent = value; return this; }
public Integer getId() { return Id; }
public NewsletterLogQuery setId(Integer value) { this.Id = value; return this; }
public String getReceiver() { return Receiver; }
public NewsletterLogQuery setReceiver(String value) { this.Receiver = value; return this; }
public Date getCreated() { return Created; }
public NewsletterLogQuery setCreated(Date value) { this.Created = value; return this; }
public Date getSentDate() { return SentDate; }
public NewsletterLogQuery setSentDate(Date value) { this.SentDate = value; return this; }
public ResponseStatus getResponseStatus() { return ResponseStatus; }
public NewsletterLogQuery 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 NewsletterLog extends BaseModel implements IMessageLog
{
public Integer NewslettersId = 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 Integer SendMethodId = null;
@Required()
public String Receiver = null;
@Required()
public String Sender = null;
public String MessageTitle = null;
@Required()
public String MessageBody = null;
@Required()
public Boolean Sent = null;
@Required()
public Date ToSendDate = null;
public Date SentDate = null;
public Integer MessageCount = null;
public Integer SMSStatus = null;
@Required()
public Integer MessageRetries = null;
public String CreatedBy = null;
@Required()
public Date Created = null;
public String StorageUrl = null;
public Integer getNewslettersId() { return NewslettersId; }
public NewsletterLog setNewslettersId(Integer value) { this.NewslettersId = value; return this; }
public String getSenderName() { return SenderName; }
public NewsletterLog setSenderName(String value) { this.SenderName = value; return this; }
public Date getModifiedDate() { return ModifiedDate; }
public NewsletterLog setModifiedDate(Date value) { this.ModifiedDate = value; return this; }
public UUID getCorrelationId() { return CorrelationId; }
public NewsletterLog setCorrelationId(UUID value) { this.CorrelationId = value; return this; }
public UUID getCompanyId() { return CompanyId; }
public NewsletterLog setCompanyId(UUID value) { this.CompanyId = value; return this; }
public Integer getId() { return Id; }
public NewsletterLog setId(Integer value) { this.Id = value; return this; }
public Integer getSendMethodId() { return SendMethodId; }
public NewsletterLog setSendMethodId(Integer value) { this.SendMethodId = value; return this; }
public String getReceiver() { return Receiver; }
public NewsletterLog setReceiver(String value) { this.Receiver = value; return this; }
public String getSender() { return Sender; }
public NewsletterLog setSender(String value) { this.Sender = value; return this; }
public String getMessageTitle() { return MessageTitle; }
public NewsletterLog setMessageTitle(String value) { this.MessageTitle = value; return this; }
public String getMessageBody() { return MessageBody; }
public NewsletterLog setMessageBody(String value) { this.MessageBody = value; return this; }
public Boolean isSent() { return Sent; }
public NewsletterLog setSent(Boolean value) { this.Sent = value; return this; }
public Date getToSendDate() { return ToSendDate; }
public NewsletterLog setToSendDate(Date value) { this.ToSendDate = value; return this; }
public Date getSentDate() { return SentDate; }
public NewsletterLog setSentDate(Date value) { this.SentDate = value; return this; }
public Integer getMessageCount() { return MessageCount; }
public NewsletterLog setMessageCount(Integer value) { this.MessageCount = value; return this; }
public Integer getSmsStatus() { return SMSStatus; }
public NewsletterLog setSmsStatus(Integer value) { this.SMSStatus = value; return this; }
public Integer getMessageRetries() { return MessageRetries; }
public NewsletterLog setMessageRetries(Integer value) { this.MessageRetries = value; return this; }
public String getCreatedBy() { return CreatedBy; }
public NewsletterLog setCreatedBy(String value) { this.CreatedBy = value; return this; }
public Date getCreated() { return Created; }
public NewsletterLog setCreated(Date value) { this.Created = value; return this; }
public String getStorageUrl() { return StorageUrl; }
public NewsletterLog setStorageUrl(String value) { this.StorageUrl = value; return this; }
}
public static class BaseModel
{
}
public static class NewsletterLogQueryResponse
{
/**
* The message log id
*/
@ApiMember(Description="The message log id")
public Integer Id = 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;
/**
* Nessage Title.
*/
@ApiMember(Description="Nessage Title.")
public String MessageTitle = null;
/**
* Nessage Body.
*/
@ApiMember(Description="Nessage 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 NewsletterLogQueryResponse setId(Integer value) { this.Id = value; return this; }
public String getReceiver() { return Receiver; }
public NewsletterLogQueryResponse setReceiver(String value) { this.Receiver = value; return this; }
public String getMessageTitle() { return MessageTitle; }
public NewsletterLogQueryResponse setMessageTitle(String value) { this.MessageTitle = value; return this; }
public String getMessageBody() { return MessageBody; }
public NewsletterLogQueryResponse setMessageBody(String value) { this.MessageBody = value; return this; }
public Date getCreated() { return Created; }
public NewsletterLogQueryResponse setCreated(Date value) { this.Created = value; return this; }
public Date getToSendDate() { return ToSendDate; }
public NewsletterLogQueryResponse setToSendDate(Date value) { this.ToSendDate = value; return this; }
public Date getSentDate() { return SentDate; }
public NewsletterLogQueryResponse setSentDate(Date value) { this.SentDate = value; return this; }
public Boolean isSent() { return Sent; }
public NewsletterLogQueryResponse setSent(Boolean value) { this.Sent = value; return this; }
public Integer getMessageRetries() { return MessageRetries; }
public NewsletterLogQueryResponse setMessageRetries(Integer value) { this.MessageRetries = value; return this; }
public Integer getSendMethodId() { return SendMethodId; }
public NewsletterLogQueryResponse 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; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /newsletter/log 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, Receiver: String, MessageTitle: 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 } } }