the-algorithm/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/urt/cover/ShowCover.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

50 lines
2.0 KiB
Scala

package com.twitter.product_mixer.core.model.marshalling.response.urt.cover
import com.twitter.product_mixer.core.model.marshalling.response.urt.EntryNamespace
import com.twitter.product_mixer.core.model.marshalling.response.urt.metadata.ClientEventInfo
import com.twitter.product_mixer.core.model.marshalling.response.urt.Cover
import com.twitter.product_mixer.core.model.marshalling.response.urt.TimelineEntry
import com.twitter.product_mixer.core.model.marshalling.response.urt.cover.FullCover.FullCoverEntryNamespace
import com.twitter.product_mixer.core.model.marshalling.response.urt.cover.HalfCover.HalfCoverEntryNamespace
import com.twitter.product_mixer.core.model.marshalling.response.urt.metadata.FeedbackActionInfo
object HalfCover {
val HalfCoverEntryNamespace = EntryNamespace("half-cover")
}
case class HalfCover(
override val id: String,
override val sortIndex: Option[Long],
override val clientEventInfo: Option[ClientEventInfo],
content: HalfCoverContent)
extends Cover {
override val entryNamespace: EntryNamespace = HalfCoverEntryNamespace
// Note that sort index is not used for Covers, as they are not TimelineEntry and do not have entryId
override def withSortIndex(newSortIndex: Long): TimelineEntry =
copy(sortIndex = Some(newSortIndex))
// Not used for covers
override def feedbackActionInfo: Option[FeedbackActionInfo] = None
}
object FullCover {
val FullCoverEntryNamespace = EntryNamespace("full-cover")
}
case class FullCover(
override val id: String,
override val sortIndex: Option[Long],
override val clientEventInfo: Option[ClientEventInfo],
content: FullCoverContent)
extends Cover {
override val entryNamespace: EntryNamespace = FullCoverEntryNamespace
// Note that sort index is not used for Covers, as they are not TimelineEntry and do not have entryId
override def withSortIndex(newSortIndex: Long): TimelineEntry =
copy(sortIndex = Some(newSortIndex))
// Not used for covers
override def feedbackActionInfo: Option[FeedbackActionInfo] = None
}