Skip to content

Commit

Permalink
Merge pull request #472 from vimeo/MPS-1795-Filtered-Total
Browse files Browse the repository at this point in the history
MPS-1795: Add filtered_total field to Page
  • Loading branch information
WhosNickDoglio authored Feb 25, 2021
2 parents 7c84edd + 9cb2250 commit 901a8a3
Show file tree
Hide file tree
Showing 20 changed files with 73 additions and 20 deletions.
4 changes: 3 additions & 1 deletion models/src/main/java/com/vimeo/networking2/AlbumList.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ data class AlbumList(
override val paging: Paging? = null,

@Json(name = "data")
override val data: List<Album>? = null
override val data: List<Album>? = null,

@Json(name = "filtered_total")
override val filteredTotal: Int? = null
) : Pageable<Album>
4 changes: 3 additions & 1 deletion models/src/main/java/com/vimeo/networking2/CategoryList.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ data class CategoryList(
override val paging: Paging? = null,

@Json(name = "data")
override val data: List<Category>? = null
override val data: List<Category>? = null,

@Json(name = "filtered_total")
override val filteredTotal: Int? = null
) : Pageable<Category>
4 changes: 3 additions & 1 deletion models/src/main/java/com/vimeo/networking2/ChannelList.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ data class ChannelList(
override val paging: Paging? = null,

@Json(name = "data")
override val data: List<Channel>? = null
override val data: List<Channel>? = null,

@Json(name = "filtered_total")
override val filteredTotal: Int? = null
) : Pageable<Channel>
4 changes: 3 additions & 1 deletion models/src/main/java/com/vimeo/networking2/CommentList.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ data class CommentList(
override val paging: Paging? = null,

@Json(name = "data")
override val data: List<Comment>? = null
override val data: List<Comment>? = null,

@Json(name = "filtered_total")
override val filteredTotal: Int? = null
) : Pageable<Comment>
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ data class ConnectedAppList(
override val total: Int? = null,

@Json(name = "data")
override val data: List<ConnectedApp>? = null
override val data: List<ConnectedApp>? = null,

@Json(name = "filtered_total")
override val filteredTotal: Int? = null
) : Page<ConnectedApp>
4 changes: 3 additions & 1 deletion models/src/main/java/com/vimeo/networking2/FeedList.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ data class FeedList(
override val paging: Paging? = null,

@Json(name = "data")
override val data: List<FeedItem>? = null
override val data: List<FeedItem>? = null,

@Json(name = "filtered_total")
override val filteredTotal: Int? = null
) : Pageable<FeedItem>
4 changes: 3 additions & 1 deletion models/src/main/java/com/vimeo/networking2/FolderList.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ data class FolderList(
override val paging: Paging? = null,

@Json(name = "data")
override val data: List<Folder>? = null
override val data: List<Folder>? = null,

@Json(name = "filtered_total")
override val filteredTotal: Int? = null
) : Pageable<Folder>
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ data class NotificationList(
override val paging: Paging? = null,

@Json(name = "data")
override val data: List<Notification>? = null
override val data: List<Notification>? = null,

@Json(name = "filtered_total")
override val filteredTotal: Int? = null
) : Pageable<Notification>
4 changes: 3 additions & 1 deletion models/src/main/java/com/vimeo/networking2/ProductList.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ data class ProductList(
override val paging: Paging? = null,

@Json(name = "data")
override val data: List<Product>? = null
override val data: List<Product>? = null,

@Json(name = "filtered_total")
override val filteredTotal: Int? = null
) : Pageable<Product>
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ data class ProgrammedContentItemList(
override val paging: Paging? = null,

@Json(name = "data")
override val data: List<ProgrammedContentItem>? = null
override val data: List<ProgrammedContentItem>? = null,

@Json(name = "filtered_total")
override val filteredTotal: Int? = null
) : Pageable<ProgrammedContentItem>
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ data class ProjectItemList(
override val paging: Paging? = null,

@Json(name = "data")
override val data: List<ProjectItem>? = null
override val data: List<ProjectItem>? = null,

@Json(name = "filtered_total")
override val filteredTotal: Int? = null

) : Pageable<ProjectItem>
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ data class RecommendationList(
override val paging: Paging? = null,

@Json(name = "data")
override val data: List<Recommendation>? = null
override val data: List<Recommendation>? = null,

@Json(name = "filtered_total")
override val filteredTotal: Int? = null

) : Pageable<Recommendation>
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ data class SearchResultList(
override val paging: Paging? = null,

@Json(name = "data")
override val data: List<SearchResult>? = null
override val data: List<SearchResult>? = null,

@Json(name = "filtered_total")
override val filteredTotal: Int? = null

) : Pageable<SearchResult>
5 changes: 4 additions & 1 deletion models/src/main/java/com/vimeo/networking2/SeasonList.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ data class SeasonList(
override val paging: Paging? = null,

@Json(name = "data")
override val data: List<Season>? = null
override val data: List<Season>? = null,

@Json(name = "filtered_total")
override val filteredTotal: Int? = null

) : Pageable<Season>
5 changes: 4 additions & 1 deletion models/src/main/java/com/vimeo/networking2/TeamList.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ data class TeamList(
override val total: Int? = null,

@Json(name = "data")
override val data: List<Team>? = null
override val data: List<Team>? = null,

@Json(name = "filtered_total")
override val filteredTotal: Int? = null

) : Page<Team>
5 changes: 4 additions & 1 deletion models/src/main/java/com/vimeo/networking2/TextTrackList.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ data class TextTrackList(
override val paging: Paging? = null,

@Json(name = "data")
override val data: List<TextTrack>? = null
override val data: List<TextTrack>? = null,

@Json(name = "filtered_total")
override val filteredTotal: Int? = null

) : Pageable<TextTrack>
5 changes: 4 additions & 1 deletion models/src/main/java/com/vimeo/networking2/TvodItemList.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ data class TvodItemList(
override val paging: Paging? = null,

@Json(name = "data")
override val data: List<TvodItem>? = null
override val data: List<TvodItem>? = null,

@Json(name = "filtered_total")
override val filteredTotal: Int? = null

) : Pageable<TvodItem>
5 changes: 4 additions & 1 deletion models/src/main/java/com/vimeo/networking2/UserList.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ data class UserList(
override val paging: Paging? = null,

@Json(name = "data")
override val data: List<User>? = null
override val data: List<User>? = null,

@Json(name = "filtered_total")
override val filteredTotal: Int? = null

) : Pageable<User>
5 changes: 4 additions & 1 deletion models/src/main/java/com/vimeo/networking2/VideoList.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ data class VideoList(
override val paging: Paging? = null,

@Json(name = "data")
override val data: List<Video>? = null
override val data: List<Video>? = null,

@Json(name = "filtered_total")
override val filteredTotal: Int? = null

) : Pageable<Video>
8 changes: 7 additions & 1 deletion models/src/main/java/com/vimeo/networking2/common/Page.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,17 @@ package com.vimeo.networking2.common
interface Page<Data_T> {

/**
* Total number of items returned.
* The total number of items for the request without taking into account any applied filters.
*/
val total: Int?


/**
* The total number of items in a request taking into account the applied filters.
*/
val filteredTotal: Int?


/**
* The data corresponding to this page.
*/
Expand Down

0 comments on commit 901a8a3

Please sign in to comment.