mirror of
https://github.com/twitter/the-algorithm.git
synced 2024-06-30 06:56:08 +02:00
![twitter-team](/assets/img/avatar_default.png)
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.
18 lines
647 B
Scala
18 lines
647 B
Scala
package com.twitter.home_mixer.marshaller.timeline_logging
|
|
|
|
import com.twitter.product_mixer.core.model.marshalling.response.urt.item.tweet.TweetItem
|
|
import com.twitter.timelines.timeline_logging.{thriftscala => thriftlog}
|
|
|
|
object PromotedTweetEntryMarshaller {
|
|
|
|
def apply(entry: TweetItem, position: Int): thriftlog.PromotedTweetEntry = {
|
|
thriftlog.PromotedTweetEntry(
|
|
id = entry.id,
|
|
advertiserId = entry.promotedMetadata.map(_.advertiserId).getOrElse(0L),
|
|
insertPosition = position,
|
|
impressionId = entry.promotedMetadata.flatMap(_.impressionString),
|
|
displayType = Some(entry.displayType.toString)
|
|
)
|
|
}
|
|
}
|