Skip to content

Instantly share code, notes, and snippets.

@maciejwitowski
Last active January 4, 2017 11:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maciejwitowski/155180cec00fda213e834920d32b2d79 to your computer and use it in GitHub Desktop.
Save maciejwitowski/155180cec00fda213e834920d32b2d79 to your computer and use it in GitHub Desktop.
// Responses
data class LeadCenterSummaryResponse(
val global: LeadCenterSummaryResponseData,
val filtered: LeadCenterSummaryResponseData,
val metadata: CentersResponseMetadata
)
data class LeadSmartListResponse(
val smartLists: List<LeadSmartListResponseData>,
val metadata: CentersResponseMetadata
)
data class LeadCenterSummaryResponseData(
val total: Int,
val statuses: List<Status>
)
data class LeadSmartListResponseData(
val smartListsId: Long,
val total: Int,
val statuses: List<Status>
)
data class Status(
val statusId: Long,
val count: Int
)
// Cache API
interface LeadCenterResponseCache {
fun cacheSummaryResponse(response: LeadCenterSummaryResponse)
fun cacheLeadSmartListResponse(response: LeadSmartListResponse)
fun getCachedSummaryResponse(): LeadCenterSummaryResponse?
fun getCachedLeadSmartListResponseWithMetadata(smartList: LeadCenterSmartList): SmartListResponseWithMetadata?
fun removeCachedSummaryResponse(response: LeadCenterSummaryResponse)
fun removeCachedSingleLeadsSmartListResponse(response: LeadSmartListResponseData)
}
data class SmartListResponseWithMetadata(
val response: LeadSmartListResponseData,
val metadata: CentersResponseMetadata
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment