Skip to content

Instantly share code, notes, and snippets.

@ujjwal
Created May 30, 2013 22:53
Show Gist options
  • Save ujjwal/5681914 to your computer and use it in GitHub Desktop.
Save ujjwal/5681914 to your computer and use it in GitHub Desktop.
json handling of events
@JsonIgnoreProperties(ignoreUnknown = true)
case class ApiEmailSendEventQueueItemMessage
(messageId: String,
accountId: Int,
channelId: Int,
sessionId: Int,
sendTime: Int,
eventTime: Int,
sendHour: Int,
toEmail: String,
@JsonProperty("status") @BeanProperty val status: Int,
@JsonProperty("type") @BeanProperty val statusType: Int
)
extends EventItem(
_messageId = messageId,
_accountId = accountId,
_channelId = channelId,
_sessionId = sessionId,
_sendTime = sendTime,
_toEmail = toEmail,
_eventTime = eventTime,
_sendHour = sendHour)
abstract class EventItem(@JsonProperty("messageId") @BeanProperty val _messageId: String,
@JsonProperty("accountId") @BeanProperty val _accountId: Int,
@JsonProperty("channelId") @BeanProperty val _channelId: Int,
@JsonProperty("sessionId") @BeanProperty val _sessionId: Int,
@JsonProperty("sendTime") @BeanProperty val _sendTime: Int,
@JsonProperty("eventTime") @BeanProperty val _eventTime: Int,
@JsonProperty("sendHour") @BeanProperty val _sendHour: Int,
@JsonProperty("toEmail") @BeanProperty val _toEmail: String
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment