mirror of
https://github.com/twitter/the-algorithm.git
synced 2024-06-01 08:48:46 +02:00
ef4c5eb65e
Please note we have force-pushed a new initial commit in order to remove some publicly-available Twitter user information. Note that this process may be required in the future.
48 lines
1.1 KiB
Scala
48 lines
1.1 KiB
Scala
package com.twitter.follow_recommendations.assembler.models
|
|
|
|
import com.twitter.follow_recommendations.{thriftscala => t}
|
|
|
|
trait WTFPresentation {
|
|
def toThrift: t.WTFPresentation
|
|
}
|
|
|
|
case class UserList(
|
|
userBioEnabled: Boolean,
|
|
userBioTruncated: Boolean,
|
|
userBioMaxLines: Option[Long],
|
|
feedbackAction: Option[FeedbackAction])
|
|
extends WTFPresentation {
|
|
def toThrift: t.WTFPresentation = {
|
|
t.WTFPresentation.UserBioList(
|
|
t.UserList(userBioEnabled, userBioTruncated, userBioMaxLines, feedbackAction.map(_.toThrift)))
|
|
}
|
|
}
|
|
|
|
object UserList {
|
|
def fromUserListOptions(
|
|
userListOptions: UserListOptions
|
|
): UserList = {
|
|
UserList(
|
|
userListOptions.userBioEnabled,
|
|
userListOptions.userBioTruncated,
|
|
userListOptions.userBioMaxLines,
|
|
None)
|
|
}
|
|
}
|
|
|
|
case class Carousel(
|
|
feedbackAction: Option[FeedbackAction])
|
|
extends WTFPresentation {
|
|
def toThrift: t.WTFPresentation = {
|
|
t.WTFPresentation.Carousel(t.Carousel(feedbackAction.map(_.toThrift)))
|
|
}
|
|
}
|
|
|
|
object Carousel {
|
|
def fromCarouselOptions(
|
|
carouselOptions: CarouselOptions
|
|
): Carousel = {
|
|
Carousel(None)
|
|
}
|
|
}
|