the-algorithm/follow-recommendations-service/server/src/main/scala/com/twitter/follow_recommendations/assembler/models/WTFPresentation.scala
twitter-team ef4c5eb65e Twitter Recommendation Algorithm
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.
2023-03-31 17:36:31 -05:00

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)
}
}