mirror of
https://github.com/twitter/the-algorithm.git
synced 2024-06-28 05:56:04 +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.
28 lines
975 B
Scala
28 lines
975 B
Scala
package com.twitter.home_mixer.marshaller.request
|
|
|
|
import com.twitter.home_mixer.model.request.HomeMixerDebugOptions
|
|
import com.twitter.home_mixer.{thriftscala => t}
|
|
import com.twitter.product_mixer.core.functional_component.marshaller.request.FeatureValueUnmarshaller
|
|
import com.twitter.product_mixer.core.model.marshalling.request.DebugParams
|
|
import com.twitter.util.Time
|
|
import javax.inject.Inject
|
|
import javax.inject.Singleton
|
|
|
|
@Singleton
|
|
class HomeMixerDebugParamsUnmarshaller @Inject() (
|
|
featureValueUnmarshaller: FeatureValueUnmarshaller) {
|
|
|
|
def apply(debugParams: t.DebugParams): DebugParams = {
|
|
DebugParams(
|
|
featureOverrides = debugParams.featureOverrides.map { map =>
|
|
map.mapValues(featureValueUnmarshaller(_)).toMap
|
|
},
|
|
debugOptions = debugParams.debugOptions.map { options =>
|
|
HomeMixerDebugOptions(
|
|
requestTimeOverride = options.requestTimeOverrideMillis.map(Time.fromMilliseconds)
|
|
)
|
|
}
|
|
)
|
|
}
|
|
}
|