diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/common/alert/predicate/Operator.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/common/alert/predicate/Operator.docx new file mode 100644 index 000000000..0b6c92146 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/common/alert/predicate/Operator.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/common/alert/predicate/Operator.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/common/alert/predicate/Operator.scala deleted file mode 100644 index d3f7dd033..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/common/alert/predicate/Operator.scala +++ /dev/null @@ -1,14 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.common.alert.predicate - -/** - * Used for building [[Predicate]]s - * - * @see [[https://docbird.twitter.biz/mon/reference.html#predicate OPERATOR]] - */ -private[alert] sealed trait Operator -private[alert] case object `>` extends Operator -private[alert] case object `>=` extends Operator -private[alert] case object `<` extends Operator -private[alert] case object `<=` extends Operator -private[alert] case object `!=` extends Operator -private[alert] case object `=` extends Operator diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/common/alert/predicate/Predicate.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/common/alert/predicate/Predicate.docx new file mode 100644 index 000000000..b08161058 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/common/alert/predicate/Predicate.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/common/alert/predicate/Predicate.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/common/alert/predicate/Predicate.scala deleted file mode 100644 index 5d6ad23fe..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/common/alert/predicate/Predicate.scala +++ /dev/null @@ -1,52 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.common.alert.predicate - -/** - * [[Predicate]]s will trigger if the metric's value is past the - * `threshold` for `datapointsPastThreshold` or more datapoints - * in a given `duration` - * - * @see [[https://docbird.twitter.biz/mon/reference.html#predicate Predicate]] - */ -trait Predicate { - - /** @see [[https://docbird.twitter.biz/mon/reference.html#predicate OPERATOR]] */ - val operator: Operator - - /** @see [[https://docbird.twitter.biz/mon/reference.html#predicate THRESHOLD]] */ - val threshold: Double - - /** - * The number of datapoints in a given duration beyond the threshold that will trigger an alert - * @see [[https://docbird.twitter.biz/mon/reference.html#predicate DATAPOINTS]] - */ - val datapointsPastThreshold: Int - - /** - * @note if using a [[metricGranularity]] of [[Minutes]] then this must be >= 3 - * @see [[https://docbird.twitter.biz/mon/reference.html#predicate DURATION]] - */ - val duration: Int - - /** - * Specifies the metric granularity - * @see [[https://docbird.twitter.biz/mon/reference.html#predicate DURATION]] - */ - val metricGranularity: MetricGranularity - - require( - datapointsPastThreshold > 0, - s"`datapointsPastThreshold` must be > 0 but got `datapointsPastThreshold` = $datapointsPastThreshold" - ) - - require( - datapointsPastThreshold <= duration, - s"`datapointsPastThreshold` must be <= than `duration.inMinutes` but got `datapointsPastThreshold` = $datapointsPastThreshold `duration` = $duration" - ) - require( - metricGranularity != Minutes || duration >= 3, - s"Predicate durations must be at least 3 minutes but got $duration" - ) -} - -/** [[ThroughputPredicate]]s are predicates that can trigger when the throughput is too low or high */ -trait ThroughputPredicate extends Predicate diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/common/alert/predicate/TriggerIfAbove.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/common/alert/predicate/TriggerIfAbove.docx new file mode 100644 index 000000000..49dc0e474 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/common/alert/predicate/TriggerIfAbove.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/common/alert/predicate/TriggerIfAbove.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/common/alert/predicate/TriggerIfAbove.scala deleted file mode 100644 index 8356a2e18..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/common/alert/predicate/TriggerIfAbove.scala +++ /dev/null @@ -1,15 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.common.alert.predicate - -/** - * A [[Predicate]] that triggers if the metric this is used with rises above - * the [[threshold]] for [[datapointsPastThreshold]] per [[duration]] - */ -case class TriggerIfAbove( - override val threshold: Double, - override val datapointsPastThreshold: Int = 10, - override val duration: Int = 15, - override val metricGranularity: MetricGranularity = Minutes) - extends Predicate - with ThroughputPredicate { - override val operator: Operator = `>` -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/common/alert/predicate/TriggerIfBelow.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/common/alert/predicate/TriggerIfBelow.docx new file mode 100644 index 000000000..f9fbbc6fe Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/common/alert/predicate/TriggerIfBelow.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/common/alert/predicate/TriggerIfBelow.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/common/alert/predicate/TriggerIfBelow.scala deleted file mode 100644 index b528c15d6..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/common/alert/predicate/TriggerIfBelow.scala +++ /dev/null @@ -1,15 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.common.alert.predicate - -/** - * A [[Predicate]] that triggers if the metric this is used with lowers below - * the [[threshold]] for [[datapointsPastThreshold]] per [[duration]] - */ -case class TriggerIfBelow( - override val threshold: Double, - override val datapointsPastThreshold: Int = 10, - override val duration: Int = 15, - override val metricGranularity: MetricGranularity = Minutes) - extends Predicate - with ThroughputPredicate { - override val operator: Operator = `<` -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/common/alert/predicate/TriggerIfLatencyAbove.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/common/alert/predicate/TriggerIfLatencyAbove.docx new file mode 100644 index 000000000..711a9675d Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/common/alert/predicate/TriggerIfLatencyAbove.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/common/alert/predicate/TriggerIfLatencyAbove.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/common/alert/predicate/TriggerIfLatencyAbove.scala deleted file mode 100644 index 726e83ed5..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/common/alert/predicate/TriggerIfLatencyAbove.scala +++ /dev/null @@ -1,22 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.common.alert.predicate - -import com.twitter.util.Duration - -/** - * A [[Predicate]] that triggers if the metric this is used with rises above the - * [[latencyThreshold]] for [[datapointsPastThreshold]] per [[duration]] - * - * @note [[latencyThreshold]] must be > 0 - */ -case class TriggerIfLatencyAbove( - latencyThreshold: Duration, - override val datapointsPastThreshold: Int = 10, - override val duration: Int = 15, - override val metricGranularity: MetricGranularity = Minutes) - extends Predicate { - override val threshold: Double = latencyThreshold.inMillis - override val operator: Operator = `>` - require( - latencyThreshold > Duration.Zero, - s"TriggerIfLatencyAbove thresholds must be greater than 0 but got $latencyThreshold") -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/BUILD b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/BUILD deleted file mode 100644 index 5baced00c..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/BUILD +++ /dev/null @@ -1,25 +0,0 @@ -scala_library( - sources = ["*.scala"], - compiler_option_sets = ["fatal_warnings"], - platform = "java8", - strict_deps = True, - tags = ["bazel-compatible"], - dependencies = [ - "3rdparty/jvm/javax/inject:javax.inject", - "configapi/configapi-core", - "configapi/configapi-featureswitches:v2", - "featureswitches/featureswitches-core", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/request", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/product/registry", - ], - exports = [ - "3rdparty/jvm/javax/inject:javax.inject", - "configapi/configapi-core", - "configapi/configapi-featureswitches:v2", - "featureswitches/featureswitches-core", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/request", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/product/registry", - ], -) diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/BUILD.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/BUILD.docx new file mode 100644 index 000000000..257bc598c Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/BUILD.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/ConfigBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/ConfigBuilder.docx new file mode 100644 index 000000000..a6f4295c7 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/ConfigBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/ConfigBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/ConfigBuilder.scala deleted file mode 100644 index a805af6b9..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/ConfigBuilder.scala +++ /dev/null @@ -1,17 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.configapi - -import com.twitter.product_mixer.core.functional_component.configapi.registry.GlobalParamRegistry -import com.twitter.product_mixer.core.product.registry.ProductParamRegistry -import com.twitter.timelines.configapi.CompositeConfig -import com.twitter.timelines.configapi.Config -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class ConfigBuilder @Inject() ( - productParamRegistry: ProductParamRegistry, - globalParamRegistry: GlobalParamRegistry) { - - def build(): Config = - new CompositeConfig(productParamRegistry.build() ++ Seq(globalParamRegistry.build())) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/ParamsBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/ParamsBuilder.docx new file mode 100644 index 000000000..ec0169a1e Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/ParamsBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/ParamsBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/ParamsBuilder.scala deleted file mode 100644 index d1e570b59..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/ParamsBuilder.scala +++ /dev/null @@ -1,34 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.configapi - -import com.twitter.finagle.stats.StatsReceiver -import com.twitter.product_mixer.core.model.marshalling.request.ClientContext -import com.twitter.product_mixer.core.model.marshalling.request.Product -import com.twitter.servo.util.MemoizingStatsReceiver -import com.twitter.timelines.configapi.Config -import com.twitter.timelines.configapi.FeatureValue -import com.twitter.timelines.configapi.Params -import javax.inject.Inject -import javax.inject.Singleton - -/** Singleton object for building [[Params]] to override */ -@Singleton -class ParamsBuilder @Inject() ( - config: Config, - requestContextBuilder: RequestContextBuilder, - statsReceiver: StatsReceiver) { - - private[this] val scopedStatsReceiver = - new MemoizingStatsReceiver(statsReceiver.scope("configapi")) - - def build( - clientContext: ClientContext, - product: Product, - featureOverrides: Map[String, FeatureValue], - fsCustomMapInput: Map[String, Any] = Map.empty - ): Params = { - val requestContext = - requestContextBuilder.build(clientContext, product, featureOverrides, fsCustomMapInput) - - config(requestContext, scopedStatsReceiver) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/RequestContext.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/RequestContext.docx new file mode 100644 index 000000000..5253244eb Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/RequestContext.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/RequestContext.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/RequestContext.scala deleted file mode 100644 index 82bcbb92f..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/RequestContext.scala +++ /dev/null @@ -1,19 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.configapi - -import com.twitter.timelines.configapi.BaseRequestContext -import com.twitter.timelines.configapi.FeatureContext -import com.twitter.timelines.configapi.GuestId -import com.twitter.timelines.configapi.UserId -import com.twitter.timelines.configapi.WithFeatureContext -import com.twitter.timelines.configapi.WithGuestId -import com.twitter.timelines.configapi.WithUserId - -/** Represents [[com.twitter.timelines.configapi]]'s context information */ -case class RequestContext( - userId: Option[UserId], - guestId: Option[GuestId], - featureContext: FeatureContext) - extends BaseRequestContext - with WithUserId - with WithGuestId - with WithFeatureContext diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/RequestContextBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/RequestContextBuilder.docx new file mode 100644 index 000000000..241700643 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/RequestContextBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/RequestContextBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/RequestContextBuilder.scala deleted file mode 100644 index fe06fbeb6..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/RequestContextBuilder.scala +++ /dev/null @@ -1,72 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.configapi - -import com.twitter.featureswitches.v2.FeatureSwitches -import com.twitter.featureswitches.UserAgent -import com.twitter.featureswitches.{Recipient => FeatureSwitchRecipient} -import com.twitter.product_mixer.core.model.marshalling.request.ClientContext -import com.twitter.product_mixer.core.model.marshalling.request.Product -import com.twitter.timelines.configapi.featureswitches.v2.FeatureSwitchResultsFeatureContext -import com.twitter.timelines.configapi.FeatureContext -import com.twitter.timelines.configapi.FeatureValue -import com.twitter.timelines.configapi.ForcedFeatureContext -import com.twitter.timelines.configapi.OrElseFeatureContext -import javax.inject.Inject -import javax.inject.Singleton - -/** - * Request Context Factory is used to build RequestContext objects which are used - * by the config api to determine the param overrides to apply to the request. - * The param overrides are determined per request by configs which specify which - * FS/Deciders/AB translate to what param overrides. - */ -@Singleton -class RequestContextBuilder @Inject() (featureSwitches: FeatureSwitches) { - - /** - * @param `fsCustomMapInput` allows you to set custom fields on your feature switches. - * This feature isn't directly supported by product mixer yet, so using this argument - * will likely result in future cleanup work. - * - */ - def build( - clientContext: ClientContext, - product: Product, - featureOverrides: Map[String, FeatureValue], - fsCustomMapInput: Map[String, Any] - ): RequestContext = { - val featureContext = - getFeatureContext(clientContext, product, featureOverrides, fsCustomMapInput) - - RequestContext(clientContext.userId, clientContext.guestId, featureContext) - } - - private[configapi] def getFeatureContext( - clientContext: ClientContext, - product: Product, - featureOverrides: Map[String, FeatureValue], - fsCustomMapInput: Map[String, Any] - ): FeatureContext = { - val recipient = getFeatureSwitchRecipient(clientContext) - .withCustomFields("product" -> product.identifier.toString, fsCustomMapInput.toSeq: _*) - - val results = featureSwitches.matchRecipient(recipient) - OrElseFeatureContext( - ForcedFeatureContext(featureOverrides), - new FeatureSwitchResultsFeatureContext(results)) - } - - private[configapi] def getFeatureSwitchRecipient( - clientContext: ClientContext - ): FeatureSwitchRecipient = FeatureSwitchRecipient( - userId = clientContext.userId, - userRoles = clientContext.userRoles, - deviceId = clientContext.deviceId, - guestId = clientContext.guestId, - languageCode = clientContext.languageCode, - countryCode = clientContext.countryCode, - userAgent = clientContext.userAgent.flatMap(UserAgent.apply), - isVerified = None, - clientApplicationId = clientContext.appId, - isTwoffice = clientContext.isTwoffice - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/StaticParam.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/StaticParam.docx new file mode 100644 index 000000000..5d22fcaa6 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/StaticParam.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/StaticParam.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/StaticParam.scala deleted file mode 100644 index 8e29a926f..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/StaticParam.scala +++ /dev/null @@ -1,6 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.configapi - -import com.twitter.timelines.configapi.Param - -/** A [[Param]] used for constant values where we do not require backing by feature switches or deciders */ -case class StaticParam[ValueType](value: ValueType) extends Param[ValueType](value) diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry/BUILD b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry/BUILD deleted file mode 100644 index 3d66cd35c..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry/BUILD +++ /dev/null @@ -1,23 +0,0 @@ -scala_library( - sources = ["*.scala"], - compiler_option_sets = ["fatal_warnings"], - platform = "java8", - strict_deps = True, - tags = ["bazel-compatible"], - dependencies = [ - "3rdparty/jvm/javax/inject:javax.inject", - "configapi/configapi-core", - "configapi/configapi-decider", - "servo/decider", - "util/util-core:util-core-util", - "util/util-logging", - ], - exports = [ - "3rdparty/jvm/javax/inject:javax.inject", - "configapi/configapi-core", - "configapi/configapi-decider", - "servo/decider", - "util/util-core:util-core-util", - "util/util-logging", - ], -) diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry/BUILD.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry/BUILD.docx new file mode 100644 index 000000000..db40a662e Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry/BUILD.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry/GlobalParamConfig.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry/GlobalParamConfig.docx new file mode 100644 index 000000000..9ed728c8f Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry/GlobalParamConfig.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry/GlobalParamConfig.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry/GlobalParamConfig.scala deleted file mode 100644 index 8175508cb..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry/GlobalParamConfig.scala +++ /dev/null @@ -1,7 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.configapi.registry - -/** - * Register Params that do not relate to a specific product. - * See [[ParamConfig]] for hooks to register Params based on type. - */ -trait GlobalParamConfig extends ParamConfig with ParamConfigBuilder diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry/GlobalParamRegistry.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry/GlobalParamRegistry.docx new file mode 100644 index 000000000..42054fa19 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry/GlobalParamRegistry.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry/GlobalParamRegistry.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry/GlobalParamRegistry.scala deleted file mode 100644 index 6df7cf35f..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry/GlobalParamRegistry.scala +++ /dev/null @@ -1,21 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.configapi.registry - -import com.twitter.finagle.stats.StatsReceiver -import com.twitter.servo.decider.DeciderGateBuilder -import com.twitter.timelines.configapi.BaseConfigBuilder -import com.twitter.timelines.configapi.Config -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class GlobalParamRegistry @Inject() ( - globalParamConfig: GlobalParamConfig, - deciderGateBuilder: DeciderGateBuilder, - statsReceiver: StatsReceiver) { - - def build(): Config = { - val globalConfigs = globalParamConfig.build(deciderGateBuilder, statsReceiver) - - BaseConfigBuilder(globalConfigs).build("GlobalParamRegistry") - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry/ParamConfig.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry/ParamConfig.docx new file mode 100644 index 000000000..30e75af70 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry/ParamConfig.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry/ParamConfig.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry/ParamConfig.scala deleted file mode 100644 index 20434dcc6..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry/ParamConfig.scala +++ /dev/null @@ -1,74 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.configapi.registry - -import com.twitter.timelines.configapi.FeatureSwitchOverrideUtil.DefinedFeatureName -import com.twitter.timelines.configapi.FeatureSwitchOverrideUtil.EnumParamWithFeatureName -import com.twitter.timelines.configapi.FeatureSwitchOverrideUtil.EnumSeqParamWithFeatureName -import com.twitter.timelines.configapi.FeatureSwitchOverrideUtil.ValueFeatureName -import com.twitter.timelines.configapi.decider.HasDecider -import com.twitter.timelines.configapi.Bounded -import com.twitter.timelines.configapi.FSName -import com.twitter.timelines.configapi.HasDurationConversion -import com.twitter.timelines.configapi.OptionalOverride -import com.twitter.timelines.configapi.Param -import com.twitter.util.Duration - -/** ParamConfig is used to configure overrides for [[Param]]s of various types */ -trait ParamConfig { - - def booleanDeciderOverrides: Seq[Param[Boolean] with HasDecider] = Seq.empty - - def booleanFSOverrides: Seq[Param[Boolean] with FSName] = Seq.empty - - def optionalBooleanOverrides: Seq[ - (Param[Option[Boolean]], DefinedFeatureName, ValueFeatureName) - ] = Seq.empty - - def enumFSOverrides: Seq[EnumParamWithFeatureName[_ <: Enumeration]] = Seq.empty - - def enumSeqFSOverrides: Seq[EnumSeqParamWithFeatureName[_ <: Enumeration]] = Seq.empty - - /** - * Support for non-Duration supplied FS overrides (e.g. `timeFromStringFSOverrides`, - * `timeFromNumberFSOverrides`, `getBoundedOptionalDurationFromMillisOverrides`) is not provided - * as Duration is preferred - */ - def boundedDurationFSOverrides: Seq[ - Param[Duration] with Bounded[Duration] with FSName with HasDurationConversion - ] = Seq.empty - - /** Support for unbounded numeric FS overrides is not provided as bounded is preferred */ - def boundedIntFSOverrides: Seq[Param[Int] with Bounded[Int] with FSName] = Seq.empty - - def boundedOptionalIntOverrides: Seq[ - (Param[Option[Int]] with Bounded[Option[Int]], DefinedFeatureName, ValueFeatureName) - ] = Seq.empty - - def intSeqFSOverrides: Seq[Param[Seq[Int]] with FSName] = Seq.empty - - def boundedLongFSOverrides: Seq[Param[Long] with Bounded[Long] with FSName] = Seq.empty - - def boundedOptionalLongOverrides: Seq[ - (Param[Option[Long]] with Bounded[Option[Long]], DefinedFeatureName, ValueFeatureName) - ] = Seq.empty - - def longSeqFSOverrides: Seq[Param[Seq[Long]] with FSName] = Seq.empty - - def longSetFSOverrides: Seq[Param[Set[Long]] with FSName] = Seq.empty - - def boundedDoubleFSOverrides: Seq[Param[Double] with Bounded[Double] with FSName] = Seq.empty - - def boundedOptionalDoubleOverrides: Seq[ - (Param[Option[Double]] with Bounded[Option[Double]], DefinedFeatureName, ValueFeatureName) - ] = Seq.empty - - def doubleSeqFSOverrides: Seq[Param[Seq[Double]] with FSName] = Seq.empty - - def stringFSOverrides: Seq[Param[String] with FSName] = Seq.empty - - def stringSeqFSOverrides: Seq[Param[Seq[String]] with FSName] = Seq.empty - - def optionalStringOverrides: Seq[(Param[Option[String]], DefinedFeatureName, ValueFeatureName)] = - Seq.empty - - def gatedOverrides: Map[String, Seq[OptionalOverride[_]]] = Map.empty -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry/ParamConfigBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry/ParamConfigBuilder.docx new file mode 100644 index 000000000..a8318273a Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry/ParamConfigBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry/ParamConfigBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry/ParamConfigBuilder.scala deleted file mode 100644 index 5bb5f1ea7..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/configapi/registry/ParamConfigBuilder.scala +++ /dev/null @@ -1,49 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.configapi.registry - -import com.twitter.finagle.stats.StatsReceiver -import com.twitter.logging.Logger -import com.twitter.servo.decider.DeciderGateBuilder -import com.twitter.timelines.configapi.FeatureSwitchOverrideUtil -import com.twitter.timelines.configapi.OptionalOverride -import com.twitter.timelines.configapi.decider.DeciderUtils - -trait ParamConfigBuilder { paramConfig: ParamConfig => - - /** Builds a Seq of [[OptionalOverride]]s based on the [[paramConfig]] */ - def build( - deciderGateBuilder: DeciderGateBuilder, - statsReceiver: StatsReceiver - ): Seq[OptionalOverride[_]] = { - val logger = Logger(classOf[ParamConfig]) - - DeciderUtils.getBooleanDeciderOverrides(deciderGateBuilder, booleanDeciderOverrides: _*) ++ - FeatureSwitchOverrideUtil.getBooleanFSOverrides(booleanFSOverrides: _*) ++ - FeatureSwitchOverrideUtil.getOptionalBooleanOverrides(optionalBooleanOverrides: _*) ++ - FeatureSwitchOverrideUtil.getEnumFSOverrides( - statsReceiver.scope("enumConversion"), - logger, - enumFSOverrides: _*) ++ - FeatureSwitchOverrideUtil.getEnumSeqFSOverrides( - statsReceiver.scope("enumSeqConversion"), - logger, - enumSeqFSOverrides: _*) ++ - FeatureSwitchOverrideUtil.getBoundedDurationFSOverrides(boundedDurationFSOverrides: _*) ++ - FeatureSwitchOverrideUtil.getBoundedIntFSOverrides(boundedIntFSOverrides: _*) ++ - FeatureSwitchOverrideUtil.getBoundedOptionalIntOverrides(boundedOptionalIntOverrides: _*) ++ - FeatureSwitchOverrideUtil.getIntSeqFSOverrides(intSeqFSOverrides: _*) ++ - FeatureSwitchOverrideUtil.getBoundedLongFSOverrides(boundedLongFSOverrides: _*) ++ - FeatureSwitchOverrideUtil.getBoundedOptionalLongOverrides(boundedOptionalLongOverrides: _*) ++ - FeatureSwitchOverrideUtil.getLongSeqFSOverrides(longSeqFSOverrides: _*) ++ - FeatureSwitchOverrideUtil.getLongSetFSOverrides(longSetFSOverrides: _*) ++ - FeatureSwitchOverrideUtil.getBoundedDoubleFSOverrides(boundedDoubleFSOverrides: _*) ++ - FeatureSwitchOverrideUtil.getBoundedOptionalDoubleOverrides( - boundedOptionalDoubleOverrides: _*) ++ - FeatureSwitchOverrideUtil.getDoubleSeqFSOverrides(doubleSeqFSOverrides: _*) ++ - FeatureSwitchOverrideUtil.getStringFSOverrides(stringFSOverrides: _*) ++ - FeatureSwitchOverrideUtil.getStringSeqFSOverrides(stringSeqFSOverrides: _*) ++ - FeatureSwitchOverrideUtil.getOptionalStringOverrides(optionalStringOverrides: _*) ++ - gatedOverrides.flatMap { - case (fsName, overrides) => FeatureSwitchOverrideUtil.gatedOverrides(fsName, overrides: _*) - }.toSeq - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/BUILD b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/BUILD deleted file mode 100644 index 4db994de8..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/BUILD +++ /dev/null @@ -1,37 +0,0 @@ -scala_library( - name = "decoration", - sources = ["Decoration.scala"], - compiler_option_sets = ["fatal_warnings"], - platform = "java8", - strict_deps = True, - tags = ["bazel-compatible"], - dependencies = [ - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/common/presentation", - ], - exports = [ - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/common/presentation", - ], -) - -scala_library( - sources = [ - "!Decoration.scala", - "*.scala", - ], - compiler_option_sets = ["fatal_warnings"], - platform = "java8", - strict_deps = True, - tags = ["bazel-compatible"], - dependencies = [ - ":decoration", - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/common/presentation", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/pipeline", - ], - exports = [ - ":decoration", - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/common/presentation", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/pipeline", - ], -) diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/BUILD.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/BUILD.docx new file mode 100644 index 000000000..d1326310e Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/BUILD.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/CandidateDecorator.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/CandidateDecorator.docx new file mode 100644 index 000000000..2c126b151 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/CandidateDecorator.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/CandidateDecorator.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/CandidateDecorator.scala deleted file mode 100644 index 4a6a213b7..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/CandidateDecorator.scala +++ /dev/null @@ -1,61 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator - -import com.twitter.product_mixer.core.model.common.CandidateWithFeatures -import com.twitter.product_mixer.core.model.common.Component -import com.twitter.product_mixer.core.model.common.UniversalNoun -import com.twitter.product_mixer.core.model.common.identifier.ComponentIdentifier -import com.twitter.product_mixer.core.model.common.identifier.DecoratorIdentifier -import com.twitter.product_mixer.core.pipeline.PipelineQuery -import com.twitter.stitch.Stitch - -/** - * [[CandidateDecorator]] generates a [[com.twitter.product_mixer.core.model.common.presentation.UniversalPresentation]] - * for Candidates, which encapsulate information about how to present the candidate - * - * @see [[https://docbird.twitter.biz/product-mixer/functional-components.html#candidate-decorator]] - * @see [[com.twitter.product_mixer.core.model.common.presentation.UniversalPresentation]] - */ -trait CandidateDecorator[-Query <: PipelineQuery, -Candidate <: UniversalNoun[Any]] - extends Component { - - override val identifier: DecoratorIdentifier = CandidateDecorator.DefaultCandidateDecoratorId - - /** - * Given a Seq of `Candidate`, returns a [[Decoration]] for candidates which should be decorated - * - * `Candidate`s which aren't decorated can be omitted from the results - */ - def apply( - query: Query, - candidates: Seq[CandidateWithFeatures[Candidate]] - ): Stitch[Seq[Decoration]] -} - -object CandidateDecorator { - private[core] val DefaultCandidateDecoratorId: DecoratorIdentifier = - DecoratorIdentifier(ComponentIdentifier.BasedOnParentComponent) - - /** - * For use when building a [[CandidateDecorator]] in a [[com.twitter.product_mixer.core.pipeline.PipelineBuilder]] - * to ensure that the identifier is updated with the parent [[com.twitter.product_mixer.core.pipeline.Pipeline.identifier]] - */ - private[core] def copyWithUpdatedIdentifier[ - Query <: PipelineQuery, - Candidate <: UniversalNoun[Any] - ]( - decorator: CandidateDecorator[Query, Candidate], - parentIdentifier: ComponentIdentifier - ): CandidateDecorator[Query, Candidate] = { - if (decorator.identifier == DefaultCandidateDecoratorId) { - new CandidateDecorator[Query, Candidate] { - override val identifier: DecoratorIdentifier = DecoratorIdentifier(parentIdentifier.name) - override def apply( - query: Query, - candidates: Seq[CandidateWithFeatures[Candidate]] - ): Stitch[Seq[Decoration]] = decorator.apply(query, candidates) - } - } else { - decorator - } - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/Decoration.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/Decoration.docx new file mode 100644 index 000000000..ab9fcb00e Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/Decoration.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/Decoration.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/Decoration.scala deleted file mode 100644 index 74c9121b1..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/Decoration.scala +++ /dev/null @@ -1,11 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator - -import com.twitter.product_mixer.core.model.common.UniversalNoun -import com.twitter.product_mixer.core.model.common.presentation.UniversalPresentation - -/** - * Decoration associates specific [[UniversalPresentation]] with a candidate - */ -case class Decoration( - candidate: UniversalNoun[Any], - presentation: UniversalPresentation) diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/slice/builder/BUILD b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/slice/builder/BUILD deleted file mode 100644 index 23bf323c6..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/slice/builder/BUILD +++ /dev/null @@ -1,21 +0,0 @@ -scala_library( - sources = ["*.scala"], - compiler_option_sets = ["fatal_warnings"], - platform = "java8", - strict_deps = True, - tags = ["bazel-compatible"], - dependencies = [ - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/common", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/common/presentation", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/slice", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/pipeline", - ], - exports = [ - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/common", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/common/presentation", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/slice", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/pipeline", - ], -) diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/slice/builder/BUILD.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/slice/builder/BUILD.docx new file mode 100644 index 000000000..79f7e43e1 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/slice/builder/BUILD.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/slice/builder/CandidateSliceItemBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/slice/builder/CandidateSliceItemBuilder.docx new file mode 100644 index 000000000..3d56dceff Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/slice/builder/CandidateSliceItemBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/slice/builder/CandidateSliceItemBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/slice/builder/CandidateSliceItemBuilder.scala deleted file mode 100644 index 5ee3d5e25..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/slice/builder/CandidateSliceItemBuilder.scala +++ /dev/null @@ -1,14 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.slice.builder - -import com.twitter.product_mixer.core.feature.featuremap.FeatureMap -import com.twitter.product_mixer.core.model.common.UniversalNoun -import com.twitter.product_mixer.core.model.marshalling.response.slice.SliceItem -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait CandidateSliceItemBuilder[ - -Query <: PipelineQuery, - -BuilderInput <: UniversalNoun[Any], - BuilderOutput <: SliceItem] { - - def apply(query: Query, candidate: BuilderInput, featureMap: FeatureMap): BuilderOutput -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/BUILD b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/BUILD deleted file mode 100644 index 436d75e75..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/BUILD +++ /dev/null @@ -1,27 +0,0 @@ -scala_library( - sources = ["**/*.scala"], - compiler_option_sets = ["fatal_warnings"], - platform = "java8", - strict_deps = True, - tags = ["bazel-compatible"], - dependencies = [ - "product-mixer/component-library/src/main/scala/com/twitter/product_mixer/component_library/model/candidate", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/common", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/common/presentation", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/urt", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/urt/item", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/urt/metadata", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/pipeline", - ], - exports = [ - "product-mixer/component-library/src/main/scala/com/twitter/product_mixer/component_library/model/candidate", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/common", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/common/presentation", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/urt", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/urt/item", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/urt/metadata", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/pipeline", - ], -) diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/BUILD.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/BUILD.docx new file mode 100644 index 000000000..8e5c8c813 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/BUILD.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/CandidateUrtEntryBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/CandidateUrtEntryBuilder.docx new file mode 100644 index 000000000..6afbebfc9 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/CandidateUrtEntryBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/CandidateUrtEntryBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/CandidateUrtEntryBuilder.scala deleted file mode 100644 index f14abc28c..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/CandidateUrtEntryBuilder.scala +++ /dev/null @@ -1,14 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder - -import com.twitter.product_mixer.core.feature.featuremap.FeatureMap -import com.twitter.product_mixer.core.model.common.UniversalNoun -import com.twitter.product_mixer.core.model.marshalling.response.urt.TimelineEntry -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait CandidateUrtEntryBuilder[ - -Query <: PipelineQuery, - -BuilderInput <: UniversalNoun[Any], - BuilderOutput <: TimelineEntry] { - - def apply(query: Query, candidate: BuilderInput, candidateFeatures: FeatureMap): BuilderOutput -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/icon/BaseHorizonIconBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/icon/BaseHorizonIconBuilder.docx new file mode 100644 index 000000000..e2ccdf532 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/icon/BaseHorizonIconBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/icon/BaseHorizonIconBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/icon/BaseHorizonIconBuilder.scala deleted file mode 100644 index 7dbe7f567..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/icon/BaseHorizonIconBuilder.scala +++ /dev/null @@ -1,14 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.icon - -import com.twitter.product_mixer.core.model.common.CandidateWithFeatures -import com.twitter.product_mixer.core.model.common.UniversalNoun -import com.twitter.product_mixer.core.model.marshalling.response.urt.icon.HorizonIcon -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait BaseHorizonIconBuilder[-Query <: PipelineQuery, -Candidate <: UniversalNoun[Any]] { - - def apply( - query: Query, - candidates: Seq[CandidateWithFeatures[Candidate]] - ): Option[HorizonIcon] -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseDurationBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseDurationBuilder.docx new file mode 100644 index 000000000..aaa03e719 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseDurationBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseDurationBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseDurationBuilder.scala deleted file mode 100644 index 00b4d0454..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseDurationBuilder.scala +++ /dev/null @@ -1,11 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.item.alert - -import com.twitter.product_mixer.component_library.model.candidate.ShowAlertCandidate -import com.twitter.product_mixer.core.feature.featuremap.FeatureMap -import com.twitter.product_mixer.core.pipeline.PipelineQuery -import com.twitter.util.Duration - -trait BaseDurationBuilder[-Query <: PipelineQuery] { - - def apply(query: Query, candidate: ShowAlertCandidate, features: FeatureMap): Option[Duration] -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseShowAlertColorConfigurationBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseShowAlertColorConfigurationBuilder.docx new file mode 100644 index 000000000..c05ccf3ef Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseShowAlertColorConfigurationBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseShowAlertColorConfigurationBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseShowAlertColorConfigurationBuilder.scala deleted file mode 100644 index cb95bf2aa..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseShowAlertColorConfigurationBuilder.scala +++ /dev/null @@ -1,15 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.item.alert - -import com.twitter.product_mixer.component_library.model.candidate.ShowAlertCandidate -import com.twitter.product_mixer.core.feature.featuremap.FeatureMap -import com.twitter.product_mixer.core.model.marshalling.response.urt.alert.ShowAlertColorConfiguration -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait BaseShowAlertColorConfigurationBuilder[-Query <: PipelineQuery] { - - def apply( - query: Query, - candidate: ShowAlertCandidate, - features: FeatureMap - ): ShowAlertColorConfiguration -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseShowAlertDisplayLocationBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseShowAlertDisplayLocationBuilder.docx new file mode 100644 index 000000000..0eb30f4ec Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseShowAlertDisplayLocationBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseShowAlertDisplayLocationBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseShowAlertDisplayLocationBuilder.scala deleted file mode 100644 index 4f64e37bf..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseShowAlertDisplayLocationBuilder.scala +++ /dev/null @@ -1,15 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.item.alert - -import com.twitter.product_mixer.component_library.model.candidate.ShowAlertCandidate -import com.twitter.product_mixer.core.feature.featuremap.FeatureMap -import com.twitter.product_mixer.core.model.marshalling.response.urt.alert.ShowAlertDisplayLocation -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait BaseShowAlertDisplayLocationBuilder[-Query <: PipelineQuery] { - - def apply( - query: Query, - candidate: ShowAlertCandidate, - features: FeatureMap - ): ShowAlertDisplayLocation -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseShowAlertIconDisplayInfoBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseShowAlertIconDisplayInfoBuilder.docx new file mode 100644 index 000000000..49c7bd465 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseShowAlertIconDisplayInfoBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseShowAlertIconDisplayInfoBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseShowAlertIconDisplayInfoBuilder.scala deleted file mode 100644 index 1d14099b1..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseShowAlertIconDisplayInfoBuilder.scala +++ /dev/null @@ -1,15 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.item.alert - -import com.twitter.product_mixer.component_library.model.candidate.ShowAlertCandidate -import com.twitter.product_mixer.core.feature.featuremap.FeatureMap -import com.twitter.product_mixer.core.model.marshalling.response.urt.alert.ShowAlertIconDisplayInfo -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait BaseShowAlertIconDisplayInfoBuilder[-Query <: PipelineQuery] { - - def apply( - query: Query, - candidate: ShowAlertCandidate, - features: FeatureMap - ): Option[ShowAlertIconDisplayInfo] -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseShowAlertNavigationMetadataBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseShowAlertNavigationMetadataBuilder.docx new file mode 100644 index 000000000..6c719f2c2 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseShowAlertNavigationMetadataBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseShowAlertNavigationMetadataBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseShowAlertNavigationMetadataBuilder.scala deleted file mode 100644 index af9eb6a7f..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseShowAlertNavigationMetadataBuilder.scala +++ /dev/null @@ -1,15 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.item.alert - -import com.twitter.product_mixer.component_library.model.candidate.ShowAlertCandidate -import com.twitter.product_mixer.core.feature.featuremap.FeatureMap -import com.twitter.product_mixer.core.model.marshalling.response.urt.alert.ShowAlertNavigationMetadata -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait BaseShowAlertNavigationMetadataBuilder[-Query <: PipelineQuery] { - - def apply( - query: Query, - candidate: ShowAlertCandidate, - features: FeatureMap - ): Option[ShowAlertNavigationMetadata] -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseShowAlertUserIdsBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseShowAlertUserIdsBuilder.docx new file mode 100644 index 000000000..0d0911c5a Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseShowAlertUserIdsBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseShowAlertUserIdsBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseShowAlertUserIdsBuilder.scala deleted file mode 100644 index 17de7cd81..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/alert/BaseShowAlertUserIdsBuilder.scala +++ /dev/null @@ -1,10 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.item.alert - -import com.twitter.product_mixer.component_library.model.candidate.ShowAlertCandidate -import com.twitter.product_mixer.core.feature.featuremap.FeatureMap -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait BaseShowAlertUserIdsBuilder[-Query <: PipelineQuery] { - - def apply(query: Query, candidate: ShowAlertCandidate, features: FeatureMap): Option[Seq[Long]] -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/topic/BaseTopicDisplayTypeBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/topic/BaseTopicDisplayTypeBuilder.docx new file mode 100644 index 000000000..864fa933b Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/topic/BaseTopicDisplayTypeBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/topic/BaseTopicDisplayTypeBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/topic/BaseTopicDisplayTypeBuilder.scala deleted file mode 100644 index 879aa99b0..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/topic/BaseTopicDisplayTypeBuilder.scala +++ /dev/null @@ -1,15 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.item.topic - -import com.twitter.product_mixer.core.model.common.UniversalNoun -import com.twitter.product_mixer.core.pipeline.PipelineQuery -import com.twitter.product_mixer.core.feature.featuremap.FeatureMap -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.topic.TopicDisplayType - -trait BaseTopicDisplayTypeBuilder[-Query <: PipelineQuery, -Candidate <: UniversalNoun[Any]] { - - def apply( - query: PipelineQuery, - candidate: Candidate, - candidateFeatures: FeatureMap - ): Option[TopicDisplayType] -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/topic/BaseTopicFunctionalityTypeBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/topic/BaseTopicFunctionalityTypeBuilder.docx new file mode 100644 index 000000000..7919de6d2 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/topic/BaseTopicFunctionalityTypeBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/topic/BaseTopicFunctionalityTypeBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/topic/BaseTopicFunctionalityTypeBuilder.scala deleted file mode 100644 index 664a4a14c..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/topic/BaseTopicFunctionalityTypeBuilder.scala +++ /dev/null @@ -1,15 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.item.topic - -import com.twitter.product_mixer.core.model.common.UniversalNoun -import com.twitter.product_mixer.core.pipeline.PipelineQuery -import com.twitter.product_mixer.core.feature.featuremap.FeatureMap -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.topic.TopicFunctionalityType - -trait BaseTopicFunctionalityTypeBuilder[-Query <: PipelineQuery, -Candidate <: UniversalNoun[Any]] { - - def apply( - query: PipelineQuery, - candidate: Candidate, - candidateFeatures: FeatureMap - ): Option[TopicFunctionalityType] -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/tweet/BaseEntryIdToReplaceBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/tweet/BaseEntryIdToReplaceBuilder.docx new file mode 100644 index 000000000..7a38dfc73 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/tweet/BaseEntryIdToReplaceBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/tweet/BaseEntryIdToReplaceBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/tweet/BaseEntryIdToReplaceBuilder.scala deleted file mode 100644 index 9c8a0e6bc..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/tweet/BaseEntryIdToReplaceBuilder.scala +++ /dev/null @@ -1,14 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.item.tweet - -import com.twitter.product_mixer.component_library.model.candidate.BaseTweetCandidate -import com.twitter.product_mixer.core.feature.featuremap.FeatureMap -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait BaseEntryIdToReplaceBuilder[-Query <: PipelineQuery, -Candidate <: BaseTweetCandidate] { - - def apply( - query: Query, - candidate: Candidate, - candidateFeatures: FeatureMap - ): Option[String] -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/tweet/BaseTimelinesScoreInfoBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/tweet/BaseTimelinesScoreInfoBuilder.docx new file mode 100644 index 000000000..478e8eb16 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/tweet/BaseTimelinesScoreInfoBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/tweet/BaseTimelinesScoreInfoBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/tweet/BaseTimelinesScoreInfoBuilder.scala deleted file mode 100644 index cae142bdd..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/tweet/BaseTimelinesScoreInfoBuilder.scala +++ /dev/null @@ -1,15 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.item.tweet - -import com.twitter.product_mixer.component_library.model.candidate.BaseTweetCandidate -import com.twitter.product_mixer.core.feature.featuremap.FeatureMap -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.tweet.TimelinesScoreInfo -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait BaseTimelinesScoreInfoBuilder[-Query <: PipelineQuery, -Candidate <: BaseTweetCandidate] { - - def apply( - query: Query, - candidate: Candidate, - candidateFeatures: FeatureMap - ): Option[TimelinesScoreInfo] -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/tweet/BaseTweetHighlightsBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/tweet/BaseTweetHighlightsBuilder.docx new file mode 100644 index 000000000..187aac6e0 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/tweet/BaseTweetHighlightsBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/tweet/BaseTweetHighlightsBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/tweet/BaseTweetHighlightsBuilder.scala deleted file mode 100644 index c3dc6cfe6..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/tweet/BaseTweetHighlightsBuilder.scala +++ /dev/null @@ -1,15 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.item.tweet - -import com.twitter.product_mixer.component_library.model.candidate.BaseTweetCandidate -import com.twitter.product_mixer.core.feature.featuremap.FeatureMap -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.tweet.TweetHighlights -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait BaseTweetHighlightsBuilder[-Query <: PipelineQuery, -Candidate <: BaseTweetCandidate] { - - def apply( - query: Query, - candidate: Candidate, - candidateFeatures: FeatureMap - ): Option[TweetHighlights] -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/user/BaseUserReactiveTriggersBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/user/BaseUserReactiveTriggersBuilder.docx new file mode 100644 index 000000000..a72f74063 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/user/BaseUserReactiveTriggersBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/user/BaseUserReactiveTriggersBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/user/BaseUserReactiveTriggersBuilder.scala deleted file mode 100644 index 17aada2f8..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/item/user/BaseUserReactiveTriggersBuilder.scala +++ /dev/null @@ -1,15 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.item.user - -import com.twitter.product_mixer.component_library.model.candidate.BaseUserCandidate -import com.twitter.product_mixer.core.feature.featuremap.FeatureMap -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.user.UserReactiveTriggers -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait BaseUserReactiveTriggersBuilder[-Query <: PipelineQuery, -Candidate <: BaseUserCandidate] { - - def apply( - query: Query, - candidate: Candidate, - candidateFeatures: FeatureMap - ): Option[UserReactiveTriggers] -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseClientEventDetailsBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseClientEventDetailsBuilder.docx new file mode 100644 index 000000000..5ce6977e1 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseClientEventDetailsBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseClientEventDetailsBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseClientEventDetailsBuilder.scala deleted file mode 100644 index e0c662bcc..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseClientEventDetailsBuilder.scala +++ /dev/null @@ -1,19 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.metadata - -import com.twitter.product_mixer.core.feature.featuremap.FeatureMap -import com.twitter.product_mixer.core.model.common.UniversalNoun -import com.twitter.product_mixer.core.model.marshalling.response.urt.metadata.ClientEventDetails -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait BaseClientEventDetailsBuilder[-Query <: PipelineQuery, -Candidate <: UniversalNoun[Any]] { - - /** - * @return a [[ClientEventDetails]] for the provided [[Candidate]] - * @see [[ClientEventDetails]] - */ - def apply( - query: Query, - candidate: Candidate, - candidateFeatures: FeatureMap - ): Option[ClientEventDetails] -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseClientEventInfoBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseClientEventInfoBuilder.docx new file mode 100644 index 000000000..9f2dc8697 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseClientEventInfoBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseClientEventInfoBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseClientEventInfoBuilder.scala deleted file mode 100644 index 27729a162..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseClientEventInfoBuilder.scala +++ /dev/null @@ -1,20 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.metadata - -import com.twitter.product_mixer.core.feature.featuremap.FeatureMap -import com.twitter.product_mixer.core.model.common.UniversalNoun -import com.twitter.product_mixer.core.model.marshalling.response.urt.metadata.ClientEventInfo -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait BaseClientEventInfoBuilder[-Query <: PipelineQuery, -Candidate <: UniversalNoun[Any]] { - - /** - * @return a [[ClientEventInfo]] for the provided [[Candidate]] - * @see [[ClientEventInfo]] - */ - def apply( - query: Query, - candidate: Candidate, - candidateFeatures: FeatureMap, - element: Option[String] - ): Option[ClientEventInfo] -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseFeedbackActionInfoBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseFeedbackActionInfoBuilder.docx new file mode 100644 index 000000000..c942991b1 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseFeedbackActionInfoBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseFeedbackActionInfoBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseFeedbackActionInfoBuilder.scala deleted file mode 100644 index d1482fcf1..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseFeedbackActionInfoBuilder.scala +++ /dev/null @@ -1,15 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.metadata - -import com.twitter.product_mixer.core.feature.featuremap.FeatureMap -import com.twitter.product_mixer.core.model.common.UniversalNoun -import com.twitter.product_mixer.core.model.marshalling.response.urt.metadata.FeedbackActionInfo -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait BaseFeedbackActionInfoBuilder[-Query <: PipelineQuery, -Candidate <: UniversalNoun[Any]] { - - def apply( - query: Query, - candidate: Candidate, - candidateFeatures: FeatureMap - ): Option[FeedbackActionInfo] -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseModuleStr.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseModuleStr.docx new file mode 100644 index 000000000..12a0a7118 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseModuleStr.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseModuleStr.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseModuleStr.scala deleted file mode 100644 index 4470ab3dd..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseModuleStr.scala +++ /dev/null @@ -1,10 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.metadata - -import com.twitter.product_mixer.core.model.common.CandidateWithFeatures -import com.twitter.product_mixer.core.model.common.UniversalNoun -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait BaseModuleStr[-Query <: PipelineQuery, -Candidate <: UniversalNoun[Any]] { - - def apply(query: Query, candidates: Seq[CandidateWithFeatures[Candidate]]): String -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseStr.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseStr.docx new file mode 100644 index 000000000..ceb35cf8d Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseStr.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseStr.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseStr.scala deleted file mode 100644 index ad1516aa1..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseStr.scala +++ /dev/null @@ -1,10 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.metadata - -import com.twitter.product_mixer.core.feature.featuremap.FeatureMap -import com.twitter.product_mixer.core.model.common.UniversalNoun -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait BaseStr[-Query <: PipelineQuery, -Candidate <: UniversalNoun[Any]] { - - def apply(query: Query, candidate: Candidate, candidateFeatures: FeatureMap): String -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseUrlBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseUrlBuilder.docx new file mode 100644 index 000000000..2fedee39e Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseUrlBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseUrlBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseUrlBuilder.scala deleted file mode 100644 index 221a9107b..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/metadata/BaseUrlBuilder.scala +++ /dev/null @@ -1,11 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.metadata - -import com.twitter.product_mixer.core.model.common.UniversalNoun -import com.twitter.product_mixer.core.model.marshalling.response.urt.metadata.Url -import com.twitter.product_mixer.core.pipeline.PipelineQuery -import com.twitter.product_mixer.core.feature.featuremap.FeatureMap - -trait BaseUrlBuilder[-Query <: PipelineQuery, -Candidate <: UniversalNoun[Any]] { - - def apply(query: Query, candidate: Candidate, candidateFeatures: FeatureMap): Url -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/promoted/BasePromotedMetadataBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/promoted/BasePromotedMetadataBuilder.docx new file mode 100644 index 000000000..6a2477cb2 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/promoted/BasePromotedMetadataBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/promoted/BasePromotedMetadataBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/promoted/BasePromotedMetadataBuilder.scala deleted file mode 100644 index 673ad7542..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/promoted/BasePromotedMetadataBuilder.scala +++ /dev/null @@ -1,15 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.promoted - -import com.twitter.product_mixer.core.feature.featuremap.FeatureMap -import com.twitter.product_mixer.core.model.common.UniversalNoun -import com.twitter.product_mixer.core.model.marshalling.response.urt.promoted.PromotedMetadata -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait BasePromotedMetadataBuilder[-Query <: PipelineQuery, -Candidate <: UniversalNoun[Any]] { - - def apply( - query: Query, - candidate: Candidate, - candidateFeatures: FeatureMap - ): Option[PromotedMetadata] -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/richtext/BaseRichTextBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/richtext/BaseRichTextBuilder.docx new file mode 100644 index 000000000..5feace64c Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/richtext/BaseRichTextBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/richtext/BaseRichTextBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/richtext/BaseRichTextBuilder.scala deleted file mode 100644 index db4238d11..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/richtext/BaseRichTextBuilder.scala +++ /dev/null @@ -1,11 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.richtext - -import com.twitter.product_mixer.core.feature.featuremap.FeatureMap -import com.twitter.product_mixer.core.model.common.UniversalNoun -import com.twitter.product_mixer.core.model.marshalling.response.urt.richtext.RichText -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait BaseRichTextBuilder[-Query <: PipelineQuery, -Candidate <: UniversalNoun[Any]] { - - def apply(query: Query, candidate: Candidate, candidateFeatures: FeatureMap): RichText -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/social_context/BaseModuleSocialContextBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/social_context/BaseModuleSocialContextBuilder.docx new file mode 100644 index 000000000..97cd3a836 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/social_context/BaseModuleSocialContextBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/social_context/BaseModuleSocialContextBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/social_context/BaseModuleSocialContextBuilder.scala deleted file mode 100644 index 659d6c401..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/social_context/BaseModuleSocialContextBuilder.scala +++ /dev/null @@ -1,14 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.social_context - -import com.twitter.product_mixer.core.model.common.CandidateWithFeatures -import com.twitter.product_mixer.core.model.common.UniversalNoun -import com.twitter.product_mixer.core.model.marshalling.response.urt.metadata.SocialContext -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait BaseModuleSocialContextBuilder[-Query <: PipelineQuery, -Candidate <: UniversalNoun[Any]] { - - def apply( - query: Query, - candidates: Seq[CandidateWithFeatures[Candidate]] - ): Option[SocialContext] -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/social_context/BaseSocialContextBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/social_context/BaseSocialContextBuilder.docx new file mode 100644 index 000000000..6cb250412 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/social_context/BaseSocialContextBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/social_context/BaseSocialContextBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/social_context/BaseSocialContextBuilder.scala deleted file mode 100644 index f51933456..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/social_context/BaseSocialContextBuilder.scala +++ /dev/null @@ -1,15 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.social_context - -import com.twitter.product_mixer.core.feature.featuremap.FeatureMap -import com.twitter.product_mixer.core.model.common.UniversalNoun -import com.twitter.product_mixer.core.model.marshalling.response.urt.metadata.SocialContext -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait BaseSocialContextBuilder[-Query <: PipelineQuery, -Candidate <: UniversalNoun[Any]] { - - def apply( - query: Query, - candidate: Candidate, - candidateFeatures: FeatureMap - ): Option[SocialContext] -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/stringcenter/BaseModuleStringCenterPlaceholderBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/stringcenter/BaseModuleStringCenterPlaceholderBuilder.docx new file mode 100644 index 000000000..0d5bcaaab Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/stringcenter/BaseModuleStringCenterPlaceholderBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/stringcenter/BaseModuleStringCenterPlaceholderBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/stringcenter/BaseModuleStringCenterPlaceholderBuilder.scala deleted file mode 100644 index 0dc6fe5f9..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/stringcenter/BaseModuleStringCenterPlaceholderBuilder.scala +++ /dev/null @@ -1,12 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.stringcenter - -import com.twitter.product_mixer.core.model.common.CandidateWithFeatures -import com.twitter.product_mixer.core.model.common.UniversalNoun -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait BaseModuleStringCenterPlaceholderBuilder[ - -Query <: PipelineQuery, - -Candidate <: UniversalNoun[Any]] { - - def apply(query: Query, candidates: Seq[CandidateWithFeatures[Candidate]]): Map[String, Any] -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/stringcenter/BaseStringCenterPlaceholderBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/stringcenter/BaseStringCenterPlaceholderBuilder.docx new file mode 100644 index 000000000..b9bed8a36 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/stringcenter/BaseStringCenterPlaceholderBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/stringcenter/BaseStringCenterPlaceholderBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/stringcenter/BaseStringCenterPlaceholderBuilder.scala deleted file mode 100644 index d006f1bbb..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/stringcenter/BaseStringCenterPlaceholderBuilder.scala +++ /dev/null @@ -1,12 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.stringcenter - -import com.twitter.product_mixer.core.feature.featuremap.FeatureMap -import com.twitter.product_mixer.core.model.common.UniversalNoun -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait BaseStringCenterPlaceholderBuilder[ - -Query <: PipelineQuery, - -Candidate <: UniversalNoun[Any]] { - - def apply(query: Query, candidate: Candidate, candidateFeatures: FeatureMap): Map[String, Any] -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleDisplayTypeBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleDisplayTypeBuilder.docx new file mode 100644 index 000000000..19629a12e Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleDisplayTypeBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleDisplayTypeBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleDisplayTypeBuilder.scala deleted file mode 100644 index df44ce8e9..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleDisplayTypeBuilder.scala +++ /dev/null @@ -1,14 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.timeline_module - -import com.twitter.product_mixer.core.model.common.CandidateWithFeatures -import com.twitter.product_mixer.core.model.common.UniversalNoun -import com.twitter.product_mixer.core.model.marshalling.response.urt.timeline_module.ModuleDisplayType -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait BaseModuleDisplayTypeBuilder[-Query <: PipelineQuery, -Candidate <: UniversalNoun[Any]] { - - def apply( - query: Query, - candidates: Seq[CandidateWithFeatures[Candidate]] - ): ModuleDisplayType -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleFooterBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleFooterBuilder.docx new file mode 100644 index 000000000..207be8240 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleFooterBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleFooterBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleFooterBuilder.scala deleted file mode 100644 index f30761822..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleFooterBuilder.scala +++ /dev/null @@ -1,14 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.timeline_module - -import com.twitter.product_mixer.core.model.common.CandidateWithFeatures -import com.twitter.product_mixer.core.model.common.UniversalNoun -import com.twitter.product_mixer.core.model.marshalling.response.urt.timeline_module.ModuleFooter -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait BaseModuleFooterBuilder[-Query <: PipelineQuery, -Candidate <: UniversalNoun[Any]] { - - def apply( - query: Query, - candidates: Seq[CandidateWithFeatures[Candidate]] - ): Option[ModuleFooter] -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleHeaderBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleHeaderBuilder.docx new file mode 100644 index 000000000..ab07d2032 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleHeaderBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleHeaderBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleHeaderBuilder.scala deleted file mode 100644 index 0e0145f10..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleHeaderBuilder.scala +++ /dev/null @@ -1,14 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.timeline_module - -import com.twitter.product_mixer.core.model.common.CandidateWithFeatures -import com.twitter.product_mixer.core.model.common.UniversalNoun -import com.twitter.product_mixer.core.model.marshalling.response.urt.timeline_module.ModuleHeader -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait BaseModuleHeaderBuilder[-Query <: PipelineQuery, -Candidate <: UniversalNoun[Any]] { - - def apply( - query: Query, - candidates: Seq[CandidateWithFeatures[Candidate]] - ): Option[ModuleHeader] -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleHeaderDisplayTypeBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleHeaderDisplayTypeBuilder.docx new file mode 100644 index 000000000..c3454764d Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleHeaderDisplayTypeBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleHeaderDisplayTypeBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleHeaderDisplayTypeBuilder.scala deleted file mode 100644 index e1218613f..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleHeaderDisplayTypeBuilder.scala +++ /dev/null @@ -1,16 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.timeline_module - -import com.twitter.product_mixer.core.model.common.CandidateWithFeatures -import com.twitter.product_mixer.core.model.common.UniversalNoun -import com.twitter.product_mixer.core.model.marshalling.response.urt.timeline_module.ModuleHeaderDisplayType -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait BaseModuleHeaderDisplayTypeBuilder[ - -Query <: PipelineQuery, - -Candidate <: UniversalNoun[Any]] { - - def apply( - query: Query, - candidates: Seq[CandidateWithFeatures[Candidate]] - ): ModuleHeaderDisplayType -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleMetadataBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleMetadataBuilder.docx new file mode 100644 index 000000000..f1b127f5e Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleMetadataBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleMetadataBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleMetadataBuilder.scala deleted file mode 100644 index 6d2e417c3..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleMetadataBuilder.scala +++ /dev/null @@ -1,14 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.timeline_module - -import com.twitter.product_mixer.core.model.common.CandidateWithFeatures -import com.twitter.product_mixer.core.model.common.UniversalNoun -import com.twitter.product_mixer.core.model.marshalling.response.urt.timeline_module.ModuleMetadata -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait BaseModuleMetadataBuilder[-Query <: PipelineQuery, -Candidate <: UniversalNoun[Any]] { - - def apply( - query: Query, - candidates: Seq[CandidateWithFeatures[Candidate]] - ): ModuleMetadata -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleShowMoreBehaviorBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleShowMoreBehaviorBuilder.docx new file mode 100644 index 000000000..b6001fcfc Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleShowMoreBehaviorBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleShowMoreBehaviorBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleShowMoreBehaviorBuilder.scala deleted file mode 100644 index 2cdf0c8ff..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseModuleShowMoreBehaviorBuilder.scala +++ /dev/null @@ -1,14 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.timeline_module - -import com.twitter.product_mixer.core.model.common.CandidateWithFeatures -import com.twitter.product_mixer.core.model.common.UniversalNoun -import com.twitter.product_mixer.core.model.marshalling.response.urt.timeline_module.ModuleShowMoreBehavior -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait BaseModuleShowMoreBehaviorBuilder[-Query <: PipelineQuery, -Candidate <: UniversalNoun[Any]] { - - def apply( - query: Query, - candidates: Seq[CandidateWithFeatures[Candidate]] - ): ModuleShowMoreBehavior -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseTimelineModuleBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseTimelineModuleBuilder.docx new file mode 100644 index 000000000..8ee4bc172 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseTimelineModuleBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseTimelineModuleBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseTimelineModuleBuilder.scala deleted file mode 100644 index bf7bcaba1..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/decorator/urt/builder/timeline_module/BaseTimelineModuleBuilder.scala +++ /dev/null @@ -1,14 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.decorator.urt.builder.timeline_module - -import com.twitter.product_mixer.core.model.common.CandidateWithFeatures -import com.twitter.product_mixer.core.model.common.UniversalNoun -import com.twitter.product_mixer.core.model.marshalling.response.urt.TimelineModule -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait BaseTimelineModuleBuilder[-Query <: PipelineQuery, -Candidate <: UniversalNoun[Any]] { - - def apply( - query: Query, - candidates: Seq[CandidateWithFeatures[Candidate]] - ): TimelineModule -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/BUILD b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/BUILD deleted file mode 100644 index 5f388dfc5..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/BUILD +++ /dev/null @@ -1,21 +0,0 @@ -scala_library( - sources = ["*.scala"], - compiler_option_sets = ["fatal_warnings"], - platform = "java8", - strict_deps = True, - tags = ["bazel-compatible"], - dependencies = [ - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/feature", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/common", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/pipeline:query", - "stitch/stitch-core", - ], - exports = [ - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/feature", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/common", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/pipeline:query", - "stitch/stitch-core", - ], -) diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/BUILD.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/BUILD.docx new file mode 100644 index 000000000..edf1878bc Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/BUILD.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/CandidateFeatureHydrator.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/CandidateFeatureHydrator.docx new file mode 100644 index 000000000..1a8ff938b Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/CandidateFeatureHydrator.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/CandidateFeatureHydrator.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/CandidateFeatureHydrator.scala deleted file mode 100644 index 069884466..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/CandidateFeatureHydrator.scala +++ /dev/null @@ -1,96 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.feature_hydrator - -import com.twitter.product_mixer.core.feature.Feature -import com.twitter.product_mixer.core.feature.featuremap.FeatureMap -import com.twitter.product_mixer.core.model.common.CandidateWithFeatures -import com.twitter.product_mixer.core.model.common.SupportsConditionally -import com.twitter.product_mixer.core.model.common.UniversalNoun -import com.twitter.product_mixer.core.model.common.identifier.FeatureHydratorIdentifier -import com.twitter.product_mixer.core.pipeline.PipelineQuery -import com.twitter.stitch.Stitch - -/** - * Hydrate features for a specific candidate - * e.g. if the candidate is a Tweet then a feature could be whether it's is marked as sensitive - * - * @note if you want to conditionally run a [[BaseCandidateFeatureHydrator]] you can use the mixin [[com.twitter.product_mixer.core.model.common.Conditionally]] - * or to gate on a [[com.twitter.timelines.configapi.Param]] you can use - * [[com.twitter.product_mixer.component_library.feature_hydrator.candidate.param_gated.ParamGatedCandidateFeatureHydrator]] or - * [[com.twitter.product_mixer.component_library.feature_hydrator.candidate.param_gated.ParamGatedBulkCandidateFeatureHydrator]] - */ -sealed trait BaseCandidateFeatureHydrator[ - -Query <: PipelineQuery, - -Result <: UniversalNoun[Any], - FeatureType <: Feature[_, _]] - extends FeatureHydrator[FeatureType] - with SupportsConditionally[Query] - -/** - * A candidate feature hydrator that provides an implementation for hydrating a single candidate - * at the time. Product Mixer core takes care of hydrating all your candidates for you by - * calling this for each candidate. This is useful for Stitch-powered downstream APIs (such - * as Strato, Gizmoduck, etc) where the API takes a single candidate/key and Stitch handles - * batching for you. - * - * @note Any exceptions that are thrown or returned as [[Stitch.exception]] will be added to the - * [[FeatureMap]] for *all* [[Feature]]s intended to be hydrated. - * Accessing a failed Feature will throw if using [[FeatureMap.get]] for Features that aren't - * [[com.twitter.product_mixer.core.feature.FeatureWithDefaultOnFailure]] - * - * @tparam Query The query type - * @tparam Result The Candidate type - */ -trait CandidateFeatureHydrator[-Query <: PipelineQuery, -Result <: UniversalNoun[Any]] - extends BaseCandidateFeatureHydrator[Query, Result, Feature[_, _]] { - - override val identifier: FeatureHydratorIdentifier - - /** Hydrates a [[FeatureMap]] for a single candidate */ - def apply(query: Query, candidate: Result, existingFeatures: FeatureMap): Stitch[FeatureMap] -} - -/** - * Hydrate features for a list of candidates - * e.g. for a list of Tweet candidates, a feature could be the visibility reason whether to show or not show each Tweet - */ -trait BaseBulkCandidateFeatureHydrator[ - -Query <: PipelineQuery, - -Result <: UniversalNoun[Any], - FeatureType <: Feature[_, _]] - extends BaseCandidateFeatureHydrator[Query, Result, FeatureType] { - - /** - * Hydrates a set of [[FeatureMap]]s for the bulk list of candidates. Every input candidate must - * have corresponding entry in the returned seq with a feature map. - */ - def apply( - query: Query, - candidates: Seq[CandidateWithFeatures[Result]] - ): Stitch[Seq[FeatureMap]] -} - -/** - * A candidate feature hydrator that allows a user to bulk hydrate features for all candidates - * at once. This is useful for downstream APIs that take a list of candidates in one go such - * as feature store or scorers. - * - * @note Any exceptions that are thrown or returned as [[Stitch.exception]] will be added to the - * [[FeatureMap]] for *all* [[Feature]]s of *all* candidates intended to be hydrated. - * An alternative to throwing an exception is per-candidate failure handling (e.g. adding - * a failed [[Feature]] with `addFailure`, a Try with `add`, or an optional value with `add` - * using [[FeatureMapBuilder]]). - * Accessing a failed Feature will throw if using [[FeatureMap.get]] for Features that aren't - * [[com.twitter.product_mixer.core.feature.FeatureWithDefaultOnFailure]]. - * - * @tparam Query The query type - * @tparam Result The Candidate type - */ -trait BulkCandidateFeatureHydrator[-Query <: PipelineQuery, Candidate <: UniversalNoun[Any]] - extends BaseBulkCandidateFeatureHydrator[Query, Candidate, Feature[_, _]] { - override val identifier: FeatureHydratorIdentifier - - override def apply( - query: Query, - candidates: Seq[CandidateWithFeatures[Candidate]] - ): Stitch[Seq[FeatureMap]] -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/FeatureHydrator.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/FeatureHydrator.docx new file mode 100644 index 000000000..2436839e1 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/FeatureHydrator.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/FeatureHydrator.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/FeatureHydrator.scala deleted file mode 100644 index 62c07353f..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/FeatureHydrator.scala +++ /dev/null @@ -1,9 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.feature_hydrator - -import com.twitter.product_mixer.core.feature.Feature -import com.twitter.product_mixer.core.model.common.Component - -/** Hydrates a [[com.twitter.product_mixer.core.feature.featuremap.FeatureMap]] for a given input */ -trait FeatureHydrator[FeatureType <: Feature[_, _]] extends Component { - def features: Set[FeatureType] -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/HydratorCandidateResult.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/HydratorCandidateResult.docx new file mode 100644 index 000000000..9b344bf42 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/HydratorCandidateResult.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/HydratorCandidateResult.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/HydratorCandidateResult.scala deleted file mode 100644 index f78e1135a..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/HydratorCandidateResult.scala +++ /dev/null @@ -1,10 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.feature_hydrator - -import com.twitter.product_mixer.core.feature.featuremap.FeatureMap -import com.twitter.product_mixer.core.model.common.CandidateWithFeatures -import com.twitter.product_mixer.core.model.common.UniversalNoun - -case class HydratorCandidateResult[+Candidate <: UniversalNoun[Any]]( - override val candidate: Candidate, - override val features: FeatureMap) - extends CandidateWithFeatures[Candidate] diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/QueryFeatureHydrator.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/QueryFeatureHydrator.docx new file mode 100644 index 000000000..b84221a8f Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/QueryFeatureHydrator.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/QueryFeatureHydrator.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/QueryFeatureHydrator.scala deleted file mode 100644 index e40f1ccb8..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/QueryFeatureHydrator.scala +++ /dev/null @@ -1,79 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.feature_hydrator - -import com.twitter.product_mixer.core.feature.Feature -import com.twitter.product_mixer.core.feature.featuremap.FeatureMap -import com.twitter.product_mixer.core.model.common.SupportsConditionally -import com.twitter.product_mixer.core.model.common.identifier.FeatureHydratorIdentifier -import com.twitter.product_mixer.core.model.common.identifier.PipelineStepIdentifier -import com.twitter.product_mixer.core.pipeline.PipelineQuery -import com.twitter.stitch.Stitch - -/** - * Hydrate features about the query itself (not about the candidates) - * e.g. features about the user who is making the request, what country the request originated from, etc. - * - * @note [[BaseQueryFeatureHydrator]]s populate [[Feature]]s with last-write-wins semantics for - * duplicate [[Feature]]s, where the last hydrator to run that populates a [[Feature]] will - * override any previously run [[BaseQueryFeatureHydrator]]s values for that [[Feature]]. - * In a [[com.twitter.product_mixer.core.pipeline.PipelineConfig PipelineConfig]] this means - * that the right-most [[BaseQueryFeatureHydrator]] to populate a given [[Feature]] will be - * the value that is available to use. - * - * @note if you want to conditionally run a [[BaseQueryFeatureHydrator]] you can use the mixin [[com.twitter.product_mixer.core.model.common.Conditionally]] - * or to gate on a [[com.twitter.timelines.configapi.Param]] you can use [[com.twitter.product_mixer.component_library.feature_hydrator.query.param_gated.ParamGatedQueryFeatureHydrator]] - * - * @note Any exceptions that are thrown or returned as [[Stitch.exception]] will be added to the - * [[FeatureMap]] for the [[Feature]]s that were supposed to be hydrated. - * Accessing a failed Feature will throw if using [[FeatureMap.get]] for Features that aren't - * [[com.twitter.product_mixer.core.feature.FeatureWithDefaultOnFailure]] - */ -trait BaseQueryFeatureHydrator[-Query <: PipelineQuery, FeatureType <: Feature[_, _]] - extends FeatureHydrator[FeatureType] - with SupportsConditionally[Query] { - - override val identifier: FeatureHydratorIdentifier - - /** Hydrates a [[FeatureMap]] for a given [[Query]] */ - def hydrate(query: Query): Stitch[FeatureMap] -} - -trait QueryFeatureHydrator[-Query <: PipelineQuery] - extends BaseQueryFeatureHydrator[Query, Feature[_, _]] - -/** - * When an [[AsyncHydrator]] is run it will hydrate features in the background - * and will make them available starting at the specified point in execution. - * - * When `hydrateBefore` is reached, any duplicate [[Feature]]s that were already hydrated will be - * overridden with the new value from the [[AsyncHydrator]] - * - * @note [[AsyncHydrator]]s have the same last-write-wins semantics for duplicate [[Feature]]s - * as [[BaseQueryFeatureHydrator]] but with some nuance. If [[AsyncHydrator]]s for the - * same [[Feature]] have the same `hydrateBefore` then the right-most [[AsyncHydrator]]s - * value takes precedence. Similarly, [[AsyncHydrator]]s always hydrate after any other - * [[BaseQueryFeatureHydrator]]. See the examples for more detail. - * @example if [[QueryFeatureHydrator]]s that populate the same [[Feature]] are defined in a `PipelineConfig` - * such as `[ asyncHydratorForFeatureA, normalHydratorForFeatureA ]`, where `asyncHydratorForFeatureA` - * is an [[AsyncHydrator]], when `asyncHydratorForFeatureA` reaches it's `hydrateBefore` - * Step in the Pipeline, the value for `FeatureA` from the `asyncHydratorForFeatureA` will override - * the existing value from `normalHydratorForFeatureA`, even though in the initial `PipelineConfig` - * they are ordered differently. - * @example if [[AsyncHydrator]]s that populate the same [[Feature]] are defined in a `PipelineConfig` - * such as `[ asyncHydratorForFeatureA1, asyncHydratorForFeatureA2 ]`, where both [[AsyncHydrator]]s - * have the same `hydrateBefore`, when `hydrateBefore` is reached, the value for `FeatureA` from - * `asyncHydratorForFeatureA2` will override the value from `asyncHydratorForFeatureA1`. - */ -trait AsyncHydrator { - _: BaseQueryFeatureHydrator[_, _] => - - /** - * A [[PipelineStepIdentifier]] from the [[com.twitter.product_mixer.core.pipeline.PipelineConfig]] this is used in - * by which the [[FeatureMap]] returned by this [[AsyncHydrator]] will be completed. - * - * Access to the [[Feature]]s from this [[AsyncHydrator]] prior to reaching the provided - * [[PipelineStepIdentifier]]s will result in a [[com.twitter.product_mixer.core.feature.featuremap.MissingFeatureException]]. - * - * @note If [[PipelineStepIdentifier]] is a Step which is run in parallel, the [[Feature]]s will be available for all the parallel Steps. - */ - def hydrateBefore: PipelineStepIdentifier -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/BUILD b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/BUILD deleted file mode 100644 index bd8d63134..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/BUILD +++ /dev/null @@ -1,24 +0,0 @@ -scala_library( - sources = ["*.scala"], - compiler_option_sets = ["fatal_warnings"], - platform = "java8", - strict_deps = True, - tags = ["bazel-compatible"], - dependencies = [ - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/feature/datarecord", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/feature/featuremap", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/feature/featurestorev1", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/feature/featurestorev1/featurevalue", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/pipeline/pipeline_failure", - "src/scala/com/twitter/ml/featurestore/lib/online", - ], - exports = [ - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/feature/featuremap", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/feature/featurestorev1", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/feature/featurestorev1/featurevalue", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/pipeline/pipeline_failure", - "src/scala/com/twitter/ml/featurestore/lib/online", - ], -) diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/BUILD.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/BUILD.docx new file mode 100644 index 000000000..9ef6fc763 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/BUILD.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/FeatureStoreDatasetErrorHandler.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/FeatureStoreDatasetErrorHandler.docx new file mode 100644 index 000000000..a21284428 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/FeatureStoreDatasetErrorHandler.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/FeatureStoreDatasetErrorHandler.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/FeatureStoreDatasetErrorHandler.scala deleted file mode 100644 index 7b723bdd5..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/FeatureStoreDatasetErrorHandler.scala +++ /dev/null @@ -1,74 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.feature_hydrator.featurestorev1 - -import com.twitter.ml.featurestore.lib.EntityId -import com.twitter.ml.featurestore.lib.data.DatasetErrorsById -import com.twitter.ml.featurestore.lib.data.HydrationError -import com.twitter.ml.featurestore.lib.dataset.DatasetId -import com.twitter.product_mixer.core.feature.featurestorev1.BaseFeatureStoreV1Feature -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -object FeatureStoreDatasetErrorHandler { - - /** - * This function takes a set of feature store features and constructs a mapping from the underlying - * feature store dataset back to the features. This is useful for looking up what ProMix features - * failed based off of a failed feature store dataset at request time. A ProMix feature can be - * powered by multiple feature store datasets, and conversely, a dataset can be used by many features. - */ - def datasetToFeaturesMapping[ - Query <: PipelineQuery, - Input, - FeatureType <: BaseFeatureStoreV1Feature[Query, Input, _ <: EntityId, _] - ]( - features: Set[FeatureType] - ): Map[DatasetId, Set[FeatureType]] = { - val datasetsAndFeatures: Set[(DatasetId, FeatureType)] = features - .flatMap { feature: FeatureType => - feature.boundFeatureSet.sourceDatasets.map(_.id).map { datasetId: DatasetId => - datasetId -> feature - } - } - - datasetsAndFeatures - .groupBy { case (datasetId, _) => datasetId }.mapValues(_.map { - case (_, feature) => feature - }) - } - - /** - * This takes a mapping of Feature Store Dataset => ProMix Features, as well as the dataset errors - * from PredictionRecord and computing a final, deduped mapping from ProMix Feature to Exceptions. - */ - def featureToHydrationErrors[ - Query <: PipelineQuery, - Input, - FeatureType <: BaseFeatureStoreV1Feature[Query, Input, _ <: EntityId, _] - ]( - datasetToFeatures: Map[DatasetId, Set[ - FeatureType - ]], - errorsByDatasetId: DatasetErrorsById - ): Map[FeatureType, Set[HydrationError]] = { - val hasError = errorsByDatasetId.datasets.nonEmpty - if (hasError) { - val featuresAndErrors: Set[(FeatureType, Set[HydrationError])] = errorsByDatasetId.datasets - .flatMap { id: DatasetId => - val errors: Set[HydrationError] = errorsByDatasetId.get(id).values.toSet - if (errors.nonEmpty) { - val datasetFeatures: Set[FeatureType] = datasetToFeatures.getOrElse(id, Set.empty) - datasetFeatures.map { feature => - feature -> errors - }.toSeq - } else { - Seq.empty - } - } - featuresAndErrors - .groupBy { case (feature, _) => feature }.mapValues(_.flatMap { - case (_, errors: Set[HydrationError]) => errors - }) - } else { - Map.empty - } - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/FeatureStoreV1CandidateFeatureHydrator.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/FeatureStoreV1CandidateFeatureHydrator.docx new file mode 100644 index 000000000..e6f6b8e23 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/FeatureStoreV1CandidateFeatureHydrator.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/FeatureStoreV1CandidateFeatureHydrator.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/FeatureStoreV1CandidateFeatureHydrator.scala deleted file mode 100644 index e80d55302..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/FeatureStoreV1CandidateFeatureHydrator.scala +++ /dev/null @@ -1,97 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.feature_hydrator.featurestorev1 - -import com.twitter.ml.api.util.SRichDataRecord -import com.twitter.ml.featurestore.lib.EntityId -import com.twitter.ml.featurestore.lib.data.PredictionRecordAdapter -import com.twitter.ml.featurestore.lib.entity.EntityWithId -import com.twitter.ml.featurestore.lib.online.FeatureStoreRequest -import com.twitter.product_mixer.core.feature.featuremap.FeatureMap -import com.twitter.product_mixer.core.feature.featuremap.FeatureMapBuilder -import com.twitter.product_mixer.core.feature.featurestorev1.BaseFeatureStoreV1CandidateFeature -import com.twitter.product_mixer.core.feature.featurestorev1.FeatureStoreV1CandidateEntity -import com.twitter.product_mixer.core.feature.featurestorev1.featurevalue.FeatureStoreV1Response -import com.twitter.product_mixer.core.feature.featurestorev1.featurevalue.FeatureStoreV1ResponseFeature -import com.twitter.product_mixer.core.functional_component.feature_hydrator.BaseBulkCandidateFeatureHydrator -import com.twitter.product_mixer.core.model.common.CandidateWithFeatures -import com.twitter.product_mixer.core.model.common.UniversalNoun -import com.twitter.product_mixer.core.pipeline.PipelineQuery -import com.twitter.product_mixer.core.pipeline.pipeline_failure.FeatureHydrationFailed -import com.twitter.product_mixer.core.pipeline.pipeline_failure.PipelineFailure -import com.twitter.stitch.Stitch -import com.twitter.util.logging.Logging - -trait FeatureStoreV1CandidateFeatureHydrator[ - Query <: PipelineQuery, - Candidate <: UniversalNoun[Any]] - extends BaseBulkCandidateFeatureHydrator[ - Query, - Candidate, - BaseFeatureStoreV1CandidateFeature[Query, Candidate, _ <: EntityId, _] - ] - with Logging { - - override def features: Set[BaseFeatureStoreV1CandidateFeature[Query, Candidate, _ <: EntityId, _]] - - def clientBuilder: FeatureStoreV1DynamicClientBuilder - - private lazy val hydrationConfig = FeatureStoreV1CandidateFeatureHydrationConfig(features) - - private lazy val client = clientBuilder.build(hydrationConfig) - - private lazy val datasetToFeatures = - FeatureStoreDatasetErrorHandler.datasetToFeaturesMapping(features) - - private lazy val dataRecordAdapter = - PredictionRecordAdapter.oneToOne(hydrationConfig.allBoundFeatures) - - private lazy val featureContext = hydrationConfig.allBoundFeatures.toFeatureContext - - override def apply( - query: Query, - candidates: Seq[CandidateWithFeatures[Candidate]] - ): Stitch[Seq[FeatureMap]] = { - // Duplicate entities are expected across features, so de-dupe via the Set before converting to Seq - val entities: Seq[FeatureStoreV1CandidateEntity[Query, Candidate, _ <: EntityId]] = - features.map(_.entity).toSeq - - val featureStoreRequests = candidates.map { candidate => - val candidateEntityIds: Seq[EntityWithId[_ <: EntityId]] = - entities.map(_.entityWithId(query, candidate.candidate, candidate.features)) - - FeatureStoreRequest(entityIds = candidateEntityIds) - } - - val featureMaps = client(featureStoreRequests, query).map { predictionRecords => - if (predictionRecords.size == candidates.size) - predictionRecords - .zip(candidates).map { - case (predictionRecord, candidate) => - val datasetErrors = predictionRecord.getDatasetHydrationErrors - val errorMap = - FeatureStoreDatasetErrorHandler.featureToHydrationErrors( - datasetToFeatures, - datasetErrors) - - if (errorMap.nonEmpty) { - logger.debug(() => - s"$identifier hydration errors for candidate ${candidate.candidate.id}: $errorMap") - } - val dataRecord = - new SRichDataRecord( - dataRecordAdapter.adaptToDataRecord(predictionRecord), - featureContext) - val featureStoreResponse = - FeatureStoreV1Response(dataRecord, errorMap) - FeatureMapBuilder() - .add(FeatureStoreV1ResponseFeature, featureStoreResponse).build() - } - else - // Should not happen as FSv1 is guaranteed to return a prediction record per feature store request - throw PipelineFailure( - FeatureHydrationFailed, - "Unexpected response length from Feature Store V1 while hydrating candidate features") - } - - Stitch.callFuture(featureMaps) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/FeatureStoreV1DynamicClientBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/FeatureStoreV1DynamicClientBuilder.docx new file mode 100644 index 000000000..66702b171 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/FeatureStoreV1DynamicClientBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/FeatureStoreV1DynamicClientBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/FeatureStoreV1DynamicClientBuilder.scala deleted file mode 100644 index 70bcc15cf..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/FeatureStoreV1DynamicClientBuilder.scala +++ /dev/null @@ -1,12 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.feature_hydrator.featurestorev1 - -import com.twitter.ml.featurestore.lib.dynamic.BaseDynamicHydrationConfig -import com.twitter.ml.featurestore.lib.dynamic.BaseGatedFeatures -import com.twitter.ml.featurestore.lib.dynamic.DynamicFeatureStoreClient -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait FeatureStoreV1DynamicClientBuilder { - def build[Query <: PipelineQuery]( - dynamicHydrationConfig: BaseDynamicHydrationConfig[Query, _ <: BaseGatedFeatures[Query]] - ): DynamicFeatureStoreClient[Query] -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/FeatureStoreV1HydrationConfig.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/FeatureStoreV1HydrationConfig.docx new file mode 100644 index 000000000..f82283244 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/FeatureStoreV1HydrationConfig.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/FeatureStoreV1HydrationConfig.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/FeatureStoreV1HydrationConfig.scala deleted file mode 100644 index e740628fd..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/FeatureStoreV1HydrationConfig.scala +++ /dev/null @@ -1,25 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.feature_hydrator.featurestorev1 - -import com.twitter.ml.featurestore.lib.EntityId -import com.twitter.ml.featurestore.lib.dynamic.BaseDynamicHydrationConfig -import com.twitter.product_mixer.core.feature.featurestorev1.BaseFeatureStoreV1CandidateFeature -import com.twitter.product_mixer.core.feature.featurestorev1.BaseFeatureStoreV1QueryFeature -import com.twitter.product_mixer.core.model.common.UniversalNoun -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -case class FeatureStoreV1QueryFeatureHydrationConfig[Query <: PipelineQuery]( - features: Set[BaseFeatureStoreV1QueryFeature[Query, _ <: EntityId, _]]) - extends BaseDynamicHydrationConfig[ - Query, - BaseFeatureStoreV1QueryFeature[Query, _ <: EntityId, _] - ](features) - -case class FeatureStoreV1CandidateFeatureHydrationConfig[ - Query <: PipelineQuery, - Input <: UniversalNoun[Any] -]( - features: Set[BaseFeatureStoreV1CandidateFeature[Query, Input, _ <: EntityId, _]]) - extends BaseDynamicHydrationConfig[ - Query, - BaseFeatureStoreV1CandidateFeature[Query, Input, _ <: EntityId, _] - ](features) diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/FeatureStoreV1QueryFeatureHydrator.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/FeatureStoreV1QueryFeatureHydrator.docx new file mode 100644 index 000000000..72af6a2f5 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/FeatureStoreV1QueryFeatureHydrator.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/FeatureStoreV1QueryFeatureHydrator.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/FeatureStoreV1QueryFeatureHydrator.scala deleted file mode 100644 index 143801e6f..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/feature_hydrator/featurestorev1/FeatureStoreV1QueryFeatureHydrator.scala +++ /dev/null @@ -1,79 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.feature_hydrator.featurestorev1 - -import com.twitter.ml.api.util.SRichDataRecord -import com.twitter.ml.featurestore.lib.EntityId -import com.twitter.ml.featurestore.lib.data.PredictionRecordAdapter -import com.twitter.ml.featurestore.lib.entity.EntityWithId -import com.twitter.ml.featurestore.lib.online.FeatureStoreRequest -import com.twitter.product_mixer.core.feature.featuremap.FeatureMap -import com.twitter.product_mixer.core.feature.featuremap.FeatureMapBuilder -import com.twitter.product_mixer.core.feature.featurestorev1.BaseFeatureStoreV1QueryFeature -import com.twitter.product_mixer.core.feature.featurestorev1.FeatureStoreV1QueryEntity -import com.twitter.product_mixer.core.feature.featurestorev1.featurevalue.FeatureStoreV1Response -import com.twitter.product_mixer.core.feature.featurestorev1.featurevalue.FeatureStoreV1ResponseFeature -import com.twitter.product_mixer.core.functional_component.feature_hydrator.BaseQueryFeatureHydrator -import com.twitter.product_mixer.core.pipeline.PipelineQuery -import com.twitter.product_mixer.core.pipeline.pipeline_failure.FeatureHydrationFailed -import com.twitter.product_mixer.core.pipeline.pipeline_failure.PipelineFailure -import com.twitter.stitch.Stitch -import com.twitter.util.logging.Logging - -trait FeatureStoreV1QueryFeatureHydrator[Query <: PipelineQuery] - extends BaseQueryFeatureHydrator[ - Query, - BaseFeatureStoreV1QueryFeature[Query, _ <: EntityId, _] - ] - with Logging { - - def features: Set[BaseFeatureStoreV1QueryFeature[Query, _ <: EntityId, _]] - - def clientBuilder: FeatureStoreV1DynamicClientBuilder - - private lazy val hydrationConfig = FeatureStoreV1QueryFeatureHydrationConfig(features) - - private lazy val client = clientBuilder.build(hydrationConfig) - - private lazy val datasetToFeatures = - FeatureStoreDatasetErrorHandler.datasetToFeaturesMapping(features) - - private lazy val dataRecordAdapter = - PredictionRecordAdapter.oneToOne(hydrationConfig.allBoundFeatures) - - private lazy val featureContext = hydrationConfig.allBoundFeatures.toFeatureContext - - override def hydrate( - query: Query - ): Stitch[FeatureMap] = { - // Duplicate entities are expected across features, so de-dupe via the Set before converting to Seq - val entities: Seq[FeatureStoreV1QueryEntity[Query, _ <: EntityId]] = - features.map(_.entity).toSeq - val entityIds: Seq[EntityWithId[_ <: EntityId]] = entities.map(_.entityWithId(query)) - - val featureStoreRequest = Seq(FeatureStoreRequest(entityIds = entityIds)) - - val featureMap = client(featureStoreRequest, query).map { predictionRecords => - // Should not happen as FSv1 is guaranteed to return a prediction record per feature store request - val predictionRecord = predictionRecords.headOption.getOrElse { - throw PipelineFailure( - FeatureHydrationFailed, - "Unexpected empty response from Feature Store V1 while hydrating query features") - } - - val datasetErrors = predictionRecord.getDatasetHydrationErrors - val errorMap = - FeatureStoreDatasetErrorHandler.featureToHydrationErrors(datasetToFeatures, datasetErrors) - - if (errorMap.nonEmpty) { - logger.debug(() => s"$identifier hydration errors for query: $errorMap") - } - - val richDataRecord = - SRichDataRecord(dataRecordAdapter.adaptToDataRecord(predictionRecord), featureContext) - val featureStoreResponse = - FeatureStoreV1Response(richDataRecord, errorMap) - FeatureMapBuilder().add(FeatureStoreV1ResponseFeature, featureStoreResponse).build() - } - - Stitch.callFuture(featureMap) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/filter/BUILD b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/filter/BUILD deleted file mode 100644 index e3e7cf018..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/filter/BUILD +++ /dev/null @@ -1,21 +0,0 @@ -scala_library( - sources = ["*.scala"], - compiler_option_sets = ["fatal_warnings"], - platform = "java8", - strict_deps = True, - tags = ["bazel-compatible"], - dependencies = [ - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/feature", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/common/identifier", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/pipeline", - "stitch/stitch-core", - ], - exports = [ - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/feature", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/common/identifier", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/pipeline", - "stitch/stitch-core", - ], -) diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/filter/BUILD.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/filter/BUILD.docx new file mode 100644 index 000000000..6ca9e6fef Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/filter/BUILD.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/filter/Filter.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/filter/Filter.docx new file mode 100644 index 000000000..55981e67a Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/filter/Filter.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/filter/Filter.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/filter/Filter.scala deleted file mode 100644 index 7cf225838..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/filter/Filter.scala +++ /dev/null @@ -1,67 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.filter - -import com.twitter.product_mixer.core.functional_component.filter.Filter.SupportsConditionally -import com.twitter.product_mixer.core.model.common -import com.twitter.product_mixer.core.model.common.CandidateWithFeatures -import com.twitter.product_mixer.core.model.common.Component -import com.twitter.product_mixer.core.model.common.UniversalNoun -import com.twitter.product_mixer.core.model.common.identifier.FilterIdentifier -import com.twitter.product_mixer.core.pipeline.PipelineQuery -import com.twitter.stitch.Stitch - -/** - * Takes a sequence of candidates and can filter some out - * - * @note if you want to conditionally run a [[Filter]] you can use the mixin [[Filter.Conditionally]] - * or to gate on a [[com.twitter.timelines.configapi.Param]] you can use [[com.twitter.product_mixer.component_library.filter.ParamGatedFilter]] - * - * @tparam Query The domain model for the query or request - * @tparam Candidate The type of the candidates - */ -trait Filter[-Query <: PipelineQuery, Candidate <: UniversalNoun[Any]] - extends Component - with SupportsConditionally[Query, Candidate] { - - /** @see [[FilterIdentifier]] */ - override val identifier: FilterIdentifier - - /** - * Filter the list of candidates - * - * @return a FilterResult including both the list of kept candidate and the list of removed candidates - */ - def apply( - query: Query, - candidates: Seq[CandidateWithFeatures[Candidate]] - ): Stitch[FilterResult[Candidate]] -} - -object Filter { - - /** - * Mixin for when you want to conditionally run a [[Filter]] - * - * This is a thin wrapper around [[common.Conditionally]] exposing a nicer API for the [[Filter]] specific use-case. - */ - trait Conditionally[-Query <: PipelineQuery, Candidate <: UniversalNoun[Any]] - extends common.Conditionally[Input[Query, Candidate]] { _: Filter[Query, Candidate] => - - /** @see [[common.Conditionally.onlyIf]] */ - def onlyIf( - query: Query, - candidates: Seq[CandidateWithFeatures[Candidate]] - ): Boolean - - override final def onlyIf(input: Input[Query, Candidate]): Boolean = - onlyIf(input.query, input.candidates) - } - - /** Type alias to obscure [[Filter.Input]] from customers */ - type SupportsConditionally[-Query <: PipelineQuery, Candidate <: UniversalNoun[Any]] = - common.SupportsConditionally[Input[Query, Candidate]] - - /** A case class representing the input arguments to a [[Filter]], mostly for internal use */ - case class Input[+Query <: PipelineQuery, +Candidate <: UniversalNoun[Any]]( - query: Query, - candidates: Seq[CandidateWithFeatures[Candidate]]) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/filter/FilterResult.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/filter/FilterResult.docx new file mode 100644 index 000000000..94fe4e716 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/filter/FilterResult.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/filter/FilterResult.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/filter/FilterResult.scala deleted file mode 100644 index 436127381..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/filter/FilterResult.scala +++ /dev/null @@ -1,4 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.filter - -/** `Candidate`s were `kept` and `removed` by a [[Filter]] */ -case class FilterResult[+Candidate](kept: Seq[Candidate], removed: Seq[Candidate]) diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/gate/BUILD b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/gate/BUILD deleted file mode 100644 index 73d60be75..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/gate/BUILD +++ /dev/null @@ -1,21 +0,0 @@ -scala_library( - sources = ["*.scala"], - compiler_option_sets = ["fatal_warnings"], - platform = "java8", - strict_deps = True, - tags = ["bazel-compatible"], - dependencies = [ - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/common/presentation", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/pipeline", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/pipeline/pipeline_failure", - "stitch/stitch-core", - ], - exports = [ - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/common/presentation", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/pipeline", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/pipeline/pipeline_failure", - "stitch/stitch-core", - ], -) diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/gate/BUILD.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/gate/BUILD.docx new file mode 100644 index 000000000..0c13e1a7b Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/gate/BUILD.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/gate/Gate.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/gate/Gate.docx new file mode 100644 index 000000000..521457c72 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/gate/Gate.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/gate/Gate.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/gate/Gate.scala deleted file mode 100644 index 691f30c19..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/gate/Gate.scala +++ /dev/null @@ -1,127 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.gate - -import com.twitter.product_mixer.core.functional_component.gate.Gate.SkippedResult -import com.twitter.product_mixer.core.model.common.Component -import com.twitter.product_mixer.core.model.common.identifier.GateIdentifier -import com.twitter.product_mixer.core.model.common.presentation.CandidateWithDetails -import com.twitter.product_mixer.core.pipeline.CandidatePipelineResults -import com.twitter.product_mixer.core.pipeline.PipelineQuery -import com.twitter.product_mixer.core.pipeline.pipeline_failure.IllegalStateFailure -import com.twitter.product_mixer.core.pipeline.pipeline_failure.PipelineFailure -import com.twitter.stitch.Arrow -import com.twitter.stitch.Stitch - -/** - * A gate controls if a pipeline or other component is executed - * - * A gate is mostly controlled by it's `shouldContinue` function - when this function - * returns true, execution Continues. - * - * Gates also have a optional `shouldSkip`- When it returns - * true, then we Continue without executing `main`. - * - * @tparam Query The query type that the gate will receive as input - * - * @return A GateResult includes both the boolean `continue` and a specific reason. See [[GateResult]] for more - * information. - */ - -sealed trait BaseGate[-Query <: PipelineQuery] extends Component { - override val identifier: GateIdentifier - - /** - * If a shouldSkip returns true, the gate returns a Skip(continue=true) without executing - * the main predicate. We expect this to be useful for debugging, dogfooding, etc. - */ - def shouldSkip(query: Query): Stitch[Boolean] = Stitch.False - - /** - * The main predicate that controls this gate. If this predicate returns true, the gate returns Continue. - */ - def shouldContinue(query: Query): Stitch[Boolean] - - /** returns a [[GateResult]] to determine whether a pipeline should be executed based on `t` */ - final def apply(t: Query): Stitch[GateResult] = { - shouldSkip(t).flatMap { skipResult => - if (skipResult) { - SkippedResult - } else { - shouldContinue(t).map { mainResult => - if (mainResult) GateResult.Continue else GateResult.Stop - } - } - } - } - - /** Arrow representation of `this` [[Gate]] */ - final def arrow: Arrow[Query, GateResult] = Arrow(apply) -} - -/** - * A regular Gate which only has access to the Query typed PipelineQuery. This can be used anywhere - * Gates are available. - * - * A gate is mostly controlled by it's `shouldContinue` function - when this function - * returns true, execution Continues. - * - * Gates also have a optional `shouldSkip`- When it returns - * true, then we Continue without executing `main`. - * @tparam Query The query type that the gate will receive as input - * - * @return A GateResult includes both the boolean `continue` and a specific reason. See [[GateResult]] for more - * information. - */ -trait Gate[-Query <: PipelineQuery] extends BaseGate[Query] - -/** - * A Query And Candidate Gate which only has access both to the Query typed PipelineQuery and the - * list of previously fetched candidates. This can be used on dependent candidate pipelines to - * make a decision on whether to enable/disable them based on previous candidates. - * - * A gate is mostly controlled by it's `shouldContinue` function - when this function - * returns true, execution Continues. - * - * Gates also have a optional `shouldSkip`- When it returns - * true, then we Continue without executing `main`. - * - * @tparam Query The query type that the gate will receive as input - * - * @return A GateResult includes both the boolean `continue` and a specific reason. See [[GateResult]] for more - * information. - */ -trait QueryAndCandidateGate[-Query <: PipelineQuery] extends BaseGate[Query] { - - /** - * If a shouldSkip returns true, the gate returns a Skip(continue=true) without executing - * the main predicate. We expect this to be useful for debugging, dogfooding, etc. - */ - def shouldSkip(query: Query, candidates: Seq[CandidateWithDetails]): Stitch[Boolean] = - Stitch.False - - /** - * The main predicate that controls this gate. If this predicate returns true, the gate returns Continue. - */ - def shouldContinue(query: Query, candidates: Seq[CandidateWithDetails]): Stitch[Boolean] - - final override def shouldSkip(query: Query): Stitch[Boolean] = { - val candidates = query.features - .map(_.get(CandidatePipelineResults)).getOrElse( - throw PipelineFailure( - IllegalStateFailure, - "Candidate Pipeline Results Feature missing from query features")) - shouldSkip(query, candidates) - } - - final override def shouldContinue(query: Query): Stitch[Boolean] = { - val candidates = query.features - .map(_.get(CandidatePipelineResults)).getOrElse( - throw PipelineFailure( - IllegalStateFailure, - "Candidate Pipeline Results Feature missing from query features")) - shouldContinue(query, candidates) - } -} - -object Gate { - val SkippedResult: Stitch[GateResult] = Stitch.value(GateResult.Skipped) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/gate/GateResult.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/gate/GateResult.docx new file mode 100644 index 000000000..cee5c24dc Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/gate/GateResult.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/gate/GateResult.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/gate/GateResult.scala deleted file mode 100644 index 8d7b9165c..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/gate/GateResult.scala +++ /dev/null @@ -1,47 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.gate - -/** - * A [[Gate]] controls if a pipeline or other component is executed. - * - * Application logic should usually use `GateResult.continue: Boolean` to interpret a GateResult. `continue` will be - * true if we should continue with execution, and false if we should stop. - * - * You can case match against the `GateResult` to understand how exactly execution happened. See `object GateResult` - * below, but this is useful if you want to know if we are continuing due to the skip or main predicates. - */ -sealed trait GateResult { - - /** Should we continue? */ - val continue: Boolean -} - -object GateResult { - - /** - * Continue Execution - * - * the Skip predicate evaluated to true, - * so we Skipped execution of the Main predicate and should continue - */ - case object Skipped extends GateResult { - override val continue = true - } - - /** - * Continue Execution - * - * the main predicate evaluated to true - */ - case object Continue extends GateResult { - override val continue = true - } - - /** - * Stop execution - * - * the main predicate evaluated to false - */ - case object Stop extends GateResult { - override val continue = false - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/gate/ShouldContinue.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/gate/ShouldContinue.docx new file mode 100644 index 000000000..1ae02047b Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/gate/ShouldContinue.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/gate/ShouldContinue.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/gate/ShouldContinue.scala deleted file mode 100644 index c5a09d88c..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/gate/ShouldContinue.scala +++ /dev/null @@ -1,7 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.gate - -import com.twitter.product_mixer.core.pipeline.PipelineQuery - -trait ShouldContinue[Query <: PipelineQuery] { - def apply(query: Query): Boolean -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/BUILD b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/BUILD deleted file mode 100644 index 8590c0c97..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/BUILD +++ /dev/null @@ -1,17 +0,0 @@ -scala_library( - sources = ["*.scala"], - compiler_option_sets = ["fatal_warnings"], - platform = "java8", - strict_deps = True, - tags = ["bazel-compatible"], - dependencies = [ - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/common", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/common/identifier", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling", - ], - exports = [ - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/common", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/common/identifier", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling", - ], -) diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/BUILD.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/BUILD.docx new file mode 100644 index 000000000..71fde6345 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/BUILD.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/TransportMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/TransportMarshaller.docx new file mode 100644 index 000000000..95d8e0825 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/TransportMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/TransportMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/TransportMarshaller.scala deleted file mode 100644 index 0617d5733..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/TransportMarshaller.scala +++ /dev/null @@ -1,42 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller - -import com.twitter.product_mixer.core.model.common.Component -import com.twitter.product_mixer.core.model.common.identifier.TransportMarshallerIdentifier -import com.twitter.product_mixer.core.model.marshalling.HasMarshalling - -object TransportMarshaller { - - /** Avoid `malformed class name` exceptions due to the presence of the `$` character */ - def getSimpleName[T](c: Class[T]): String = { - c.getName.lastIndexOf("$") match { - case -1 => c.getSimpleName - case index => c.getName.substring(index + 1) - } - } -} - -/** - * Marshals a [[MarshallerInput]] into a type that can be sent over the wire - * - * This transformation should be mechanical and not contain business logic - * - * @note this is different from `com.twitter.product_mixer.core.functional_component.premarshaller` - * which can contain business logic. - */ -trait TransportMarshaller[-MarshallerInput <: HasMarshalling, +MarshallerOutput] extends Component { - - override val identifier: TransportMarshallerIdentifier - - def apply(input: MarshallerInput): MarshallerOutput -} - -/** - * No op marshalling that passes through a [[HasMarshalling]] into any type. This is useful if - * the response does not need to be sent over the wire, such as with a - * [[com.twitter.product_mixer.core.functional_component.candidate_source.product_pipeline.ProductPipelineCandidateSource]] - */ -object NoOpTransportMarshaller extends TransportMarshaller[HasMarshalling, Any] { - override val identifier: TransportMarshallerIdentifier = TransportMarshallerIdentifier("NoOp") - - override def apply(input: HasMarshalling): Any = input -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/request/BUILD b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/request/BUILD deleted file mode 100644 index 7ebb59e7f..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/request/BUILD +++ /dev/null @@ -1,17 +0,0 @@ -scala_library( - sources = ["*.scala"], - compiler_option_sets = ["fatal_warnings"], - platform = "java8", - strict_deps = True, - tags = ["bazel-compatible"], - dependencies = [ - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/request", - "product-mixer/core/src/main/thrift/com/twitter/product_mixer/core:thrift-scala", - ], - exports = [ - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/request", - "product-mixer/core/src/main/thrift/com/twitter/product_mixer/core:thrift-scala", - ], -) diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/request/BUILD.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/request/BUILD.docx new file mode 100644 index 000000000..6c125347b Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/request/BUILD.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/request/ClientContextMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/request/ClientContextMarshaller.docx new file mode 100644 index 000000000..9656d782e Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/request/ClientContextMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/request/ClientContextMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/request/ClientContextMarshaller.scala deleted file mode 100644 index 6e3b91046..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/request/ClientContextMarshaller.scala +++ /dev/null @@ -1,27 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.request - -import com.twitter.product_mixer.core.model.marshalling.request.ClientContext -import com.twitter.product_mixer.core.{thriftscala => t} - -object ClientContextMarshaller { - - def apply(clientContext: ClientContext): t.ClientContext = { - t.ClientContext( - userId = clientContext.userId, - guestId = clientContext.guestId, - appId = clientContext.appId, - ipAddress = clientContext.ipAddress, - userAgent = clientContext.userAgent, - countryCode = clientContext.countryCode, - languageCode = clientContext.languageCode, - isTwoffice = clientContext.isTwoffice, - userRoles = clientContext.userRoles, - deviceId = clientContext.deviceId, - mobileDeviceId = clientContext.mobileDeviceId, - mobileDeviceAdId = clientContext.mobileDeviceAdId, - limitAdTracking = clientContext.limitAdTracking, - guestIdAds = clientContext.guestIdAds, - guestIdMarketing = clientContext.guestIdMarketing - ) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/request/ClientContextUnmarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/request/ClientContextUnmarshaller.docx new file mode 100644 index 000000000..0dc1753ef Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/request/ClientContextUnmarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/request/ClientContextUnmarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/request/ClientContextUnmarshaller.scala deleted file mode 100644 index 4bc48485a..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/request/ClientContextUnmarshaller.scala +++ /dev/null @@ -1,30 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.request - -import com.twitter.product_mixer.core.model.marshalling.request.ClientContext -import com.twitter.product_mixer.core.{thriftscala => t} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class ClientContextUnmarshaller @Inject() () { - - def apply(clientContext: t.ClientContext): ClientContext = { - ClientContext( - userId = clientContext.userId, - guestId = clientContext.guestId, - guestIdAds = clientContext.guestIdAds, - guestIdMarketing = clientContext.guestIdMarketing, - appId = clientContext.appId, - ipAddress = clientContext.ipAddress, - userAgent = clientContext.userAgent, - countryCode = clientContext.countryCode, - languageCode = clientContext.languageCode, - isTwoffice = clientContext.isTwoffice, - userRoles = clientContext.userRoles.map(_.toSet), - deviceId = clientContext.deviceId, - mobileDeviceId = clientContext.mobileDeviceId, - mobileDeviceAdId = clientContext.mobileDeviceAdId, - limitAdTracking = clientContext.limitAdTracking - ) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/request/FeatureValueUnmarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/request/FeatureValueUnmarshaller.docx new file mode 100644 index 000000000..744abe065 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/request/FeatureValueUnmarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/request/FeatureValueUnmarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/request/FeatureValueUnmarshaller.scala deleted file mode 100644 index b693e2060..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/request/FeatureValueUnmarshaller.scala +++ /dev/null @@ -1,31 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.request - -import com.twitter.product_mixer.core.{thriftscala => t} -import com.twitter.timelines.configapi.BooleanFeatureValue -import com.twitter.timelines.configapi.FeatureValue -import com.twitter.timelines.configapi.NumberFeatureValue -import com.twitter.timelines.configapi.StringFeatureValue -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class FeatureValueUnmarshaller @Inject() () { - - def apply(featureValue: t.FeatureValue): FeatureValue = featureValue match { - case t.FeatureValue.PrimitiveValue(t.PrimitiveFeatureValue.BoolValue(bool)) => - BooleanFeatureValue(bool) - case t.FeatureValue.PrimitiveValue(t.PrimitiveFeatureValue.StrValue(string)) => - StringFeatureValue(string) - case t.FeatureValue.PrimitiveValue(t.PrimitiveFeatureValue.IntValue(int)) => - NumberFeatureValue(int) - case t.FeatureValue.PrimitiveValue(t.PrimitiveFeatureValue.LongValue(long)) => - NumberFeatureValue(long) - case t.FeatureValue.PrimitiveValue(t.PrimitiveFeatureValue.DoubleValue(double)) => - NumberFeatureValue(double) - case t.FeatureValue.PrimitiveValue(t.PrimitiveFeatureValue.UnknownUnionField(field)) => - throw new UnsupportedOperationException( - s"Unknown feature value primitive: ${field.field.name}") - case t.FeatureValue.UnknownUnionField(field) => - throw new UnsupportedOperationException(s"Unknown feature value: ${field.field.name}") - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/graphql/contextual_ref/BUILD b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/graphql/contextual_ref/BUILD deleted file mode 100644 index f340ee389..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/graphql/contextual_ref/BUILD +++ /dev/null @@ -1,21 +0,0 @@ -scala_library( - sources = ["*.scala"], - compiler_option_sets = ["fatal_warnings"], - platform = "java8", - strict_deps = True, - tags = ["bazel-compatible"], - dependencies = [ - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/rtf/safety_level", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/rtf/safety_level", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/urt/contextual_ref", - "src/thrift/com/twitter/spam/rtf:safety-level-scala", - "strato/config/src/thrift/com/twitter/strato/graphql/contextual_refs:graphql-refs-scala", - ], - exports = [ - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/rtf/safety_level", - "src/thrift/com/twitter/spam/rtf:safety-level-scala", - "strato/config/src/thrift/com/twitter/strato/graphql/contextual_refs:graphql-refs-scala", - ], -) diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/graphql/contextual_ref/BUILD.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/graphql/contextual_ref/BUILD.docx new file mode 100644 index 000000000..4a2ef2129 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/graphql/contextual_ref/BUILD.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/graphql/contextual_ref/ContextualTweetRefMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/graphql/contextual_ref/ContextualTweetRefMarshaller.docx new file mode 100644 index 000000000..319d1ab8d Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/graphql/contextual_ref/ContextualTweetRefMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/graphql/contextual_ref/ContextualTweetRefMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/graphql/contextual_ref/ContextualTweetRefMarshaller.scala deleted file mode 100644 index e65247485..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/graphql/contextual_ref/ContextualTweetRefMarshaller.scala +++ /dev/null @@ -1,17 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.graphql.contextual_ref - -import com.twitter.product_mixer.core.model.marshalling.response.urt.contextual_ref.ContextualTweetRef -import com.twitter.strato.graphql.contextual_refs.{thriftscala => thrift} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class ContextualTweetRefMarshaller @Inject() ( - tweetHydrationContextMarshaller: TweetHydrationContextMarshaller) { - - def apply(contextualTweetRef: ContextualTweetRef): thrift.ContextualTweetRef = - thrift.ContextualTweetRef( - id = contextualTweetRef.id, - hydrationContext = - contextualTweetRef.hydrationContext.map(tweetHydrationContextMarshaller(_))) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/graphql/contextual_ref/OuterTweetContextMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/graphql/contextual_ref/OuterTweetContextMarshaller.docx new file mode 100644 index 000000000..c96668ec9 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/graphql/contextual_ref/OuterTweetContextMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/graphql/contextual_ref/OuterTweetContextMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/graphql/contextual_ref/OuterTweetContextMarshaller.scala deleted file mode 100644 index 35ba7bfa3..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/graphql/contextual_ref/OuterTweetContextMarshaller.scala +++ /dev/null @@ -1,18 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.graphql.contextual_ref - -import com.twitter.product_mixer.core.model.marshalling.response.urt.contextual_ref.OuterTweetContext -import com.twitter.product_mixer.core.model.marshalling.response.urt.contextual_ref.QuoteTweetId -import com.twitter.product_mixer.core.model.marshalling.response.urt.contextual_ref.RetweetId -import com.twitter.strato.graphql.contextual_refs.{thriftscala => thrift} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class OuterTweetContextMarshaller @Inject() () { - - def apply(outerTweetContext: OuterTweetContext): thrift.OuterTweetContext = - outerTweetContext match { - case QuoteTweetId(id) => thrift.OuterTweetContext.QuoteTweetId(id) - case RetweetId(id) => thrift.OuterTweetContext.RetweetId(id) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/graphql/contextual_ref/TweetHydrationContextMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/graphql/contextual_ref/TweetHydrationContextMarshaller.docx new file mode 100644 index 000000000..c0df7d5c9 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/graphql/contextual_ref/TweetHydrationContextMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/graphql/contextual_ref/TweetHydrationContextMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/graphql/contextual_ref/TweetHydrationContextMarshaller.scala deleted file mode 100644 index a2bd6d82c..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/graphql/contextual_ref/TweetHydrationContextMarshaller.scala +++ /dev/null @@ -1,20 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.graphql.contextual_ref - -import com.twitter.product_mixer.core.functional_component.marshaller.response.rtf.safety_level.SafetyLevelMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.contextual_ref.TweetHydrationContext -import com.twitter.strato.graphql.contextual_refs.{thriftscala => thrift} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class TweetHydrationContextMarshaller @Inject() ( - safetyLevelMarshaller: SafetyLevelMarshaller, - outerTweetContextMarshaller: OuterTweetContextMarshaller) { - - def apply(tweetHydrationContext: TweetHydrationContext): thrift.TweetHydrationContext = - thrift.TweetHydrationContext( - safetyLevelOverride = tweetHydrationContext.safetyLevelOverride.map(safetyLevelMarshaller(_)), - outerTweetContext = - tweetHydrationContext.outerTweetContext.map(outerTweetContextMarshaller(_)) - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/rtf/safety_level/BUILD b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/rtf/safety_level/BUILD deleted file mode 100644 index afdc7e043..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/rtf/safety_level/BUILD +++ /dev/null @@ -1,17 +0,0 @@ -scala_library( - sources = ["*.scala"], - compiler_option_sets = ["fatal_warnings"], - platform = "java8", - strict_deps = True, - tags = ["bazel-compatible"], - dependencies = [ - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/rtf/safety_level", - "src/thrift/com/twitter/spam/rtf:safety-level-scala", - ], - exports = [ - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/rtf/safety_level", - "src/thrift/com/twitter/spam/rtf:safety-level-scala", - ], -) diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/rtf/safety_level/BUILD.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/rtf/safety_level/BUILD.docx new file mode 100644 index 000000000..869d8f8dd Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/rtf/safety_level/BUILD.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/rtf/safety_level/SafetyLevelMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/rtf/safety_level/SafetyLevelMarshaller.docx new file mode 100644 index 000000000..547d6557f Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/rtf/safety_level/SafetyLevelMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/rtf/safety_level/SafetyLevelMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/rtf/safety_level/SafetyLevelMarshaller.scala deleted file mode 100644 index c2283082a..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/rtf/safety_level/SafetyLevelMarshaller.scala +++ /dev/null @@ -1,24 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.rtf.safety_level - -import com.twitter.product_mixer.core.model.marshalling.response.rtf.safety_level.ConversationFocalTweetSafetyLevel -import com.twitter.product_mixer.core.model.marshalling.response.rtf.safety_level.ConversationInjectedTweetSafetyLevel -import com.twitter.product_mixer.core.model.marshalling.response.rtf.safety_level.ConversationReplySafetyLevel -import com.twitter.product_mixer.core.model.marshalling.response.rtf.safety_level.SafetyLevel -import com.twitter.product_mixer.core.model.marshalling.response.rtf.safety_level.TimelineFocalTweetSafetyLevel -import com.twitter.product_mixer.core.model.marshalling.response.rtf.safety_level.TimelineHomePromotedHydrationSafetyLevel -import com.twitter.spam.rtf.{thriftscala => thrift} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class SafetyLevelMarshaller @Inject() () { - - def apply(safetyLevel: SafetyLevel): thrift.SafetyLevel = safetyLevel match { - case ConversationFocalTweetSafetyLevel => thrift.SafetyLevel.ConversationFocalTweet - case ConversationReplySafetyLevel => thrift.SafetyLevel.ConversationReply - case ConversationInjectedTweetSafetyLevel => thrift.SafetyLevel.ConversationInjectedTweet - case TimelineFocalTweetSafetyLevel => thrift.SafetyLevel.TimelineFocalTweet - case TimelineHomePromotedHydrationSafetyLevel => - thrift.SafetyLevel.TimelineHomePromotedHydration - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/slice/BUILD b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/slice/BUILD deleted file mode 100644 index 98699bf17..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/slice/BUILD +++ /dev/null @@ -1,16 +0,0 @@ -scala_library( - sources = ["*.scala"], - compiler_option_sets = ["fatal_warnings"], - platform = "java8", - strict_deps = True, - tags = ["bazel-compatible"], - dependencies = [ - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/component-library/src/main/thrift/com/twitter/product_mixer/component_library:thrift-scala", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/slice", - "strato/config/src/thrift/com/twitter/strato/graphql:api-media-graphql-scala", - "strato/config/src/thrift/com/twitter/strato/graphql:graphql-scala", - "strato/config/src/thrift/com/twitter/strato/graphql:topics-graphql-scala", - ], -) diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/slice/BUILD.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/slice/BUILD.docx new file mode 100644 index 000000000..73c7c1bc7 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/slice/BUILD.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/slice/CursorTypeMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/slice/CursorTypeMarshaller.docx new file mode 100644 index 000000000..d59a85a65 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/slice/CursorTypeMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/slice/CursorTypeMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/slice/CursorTypeMarshaller.scala deleted file mode 100644 index 50351870f..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/slice/CursorTypeMarshaller.scala +++ /dev/null @@ -1,29 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.slice - -import javax.inject.Inject -import javax.inject.Singleton -import com.twitter.product_mixer.component_library.{thriftscala => t} -import com.twitter.product_mixer.core.model.marshalling.response.slice.NextCursor -import com.twitter.product_mixer.core.model.marshalling.response.slice.PreviousCursor -import com.twitter.product_mixer.core.model.marshalling.response.slice.CursorType -import com.twitter.product_mixer.core.model.marshalling.response.slice.GapCursor - -@Singleton -class CursorTypeMarshaller @Inject() () { - - def apply(cursorType: CursorType): t.CursorType = cursorType match { - case NextCursor => t.CursorType.Next - case PreviousCursor => t.CursorType.Previous - case GapCursor => t.CursorType.Gap - } - - def unmarshall(cursorType: t.CursorType): CursorType = cursorType match { - case t.CursorType.Next => NextCursor - case t.CursorType.Previous => PreviousCursor - case t.CursorType.Gap => GapCursor - case t.CursorType.EnumUnknownCursorType(id) => - throw new UnsupportedOperationException( - s"Attempted to unmarshall unrecognized cursor type: $id") - } - -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/slice/SliceItemMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/slice/SliceItemMarshaller.docx new file mode 100644 index 000000000..3855fda8d Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/slice/SliceItemMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/slice/SliceItemMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/slice/SliceItemMarshaller.scala deleted file mode 100644 index e3b1561c1..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/slice/SliceItemMarshaller.scala +++ /dev/null @@ -1,147 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.slice - -import com.twitter.product_mixer.core.model.marshalling.response.slice.AdType -import com.twitter.product_mixer.core.model.marshalling.response.slice -import com.twitter.strato.graphql.{thriftscala => t} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class SliceItemMarshaller @Inject() () { - def apply(item: slice.SliceItem): t.SliceItem = { - item match { - case item: slice.TweetItem => - t.SliceItem.TweetItem(t.TweetItem(id = item.id)) - case item: slice.UserItem => - t.SliceItem.UserItem(t.UserItem(id = item.id)) - case item: slice.TwitterListItem => - t.SliceItem.TwitterListItem(t.TwitterListItem(id = item.id)) - case item: slice.DMConvoSearchItem => - t.SliceItem.DmConvoSearchItem(t.DMConvoSearchItem(id = item.id)) - case item: slice.DMConvoItem => - t.SliceItem.DmConvoItem(t.DMConvoItem(id = item.id)) - case item: slice.DMEventItem => - t.SliceItem.DmEventItem(t.DMEventItem(id = item.id)) - case item: slice.DMMessageSearchItem => - t.SliceItem.DmMessageSearchItem(t.DMMessageSearchItem(id = item.id)) - case item: slice.TopicItem => - t.SliceItem.TopicItem(t.TopicItem(id = item.id.toString)) - case item: slice.TypeaheadEventItem => - t.SliceItem.TypeaheadEventItem( - t.TypeaheadEventItem( - eventId = item.eventId, - metadata = item.metadata.map(marshalTypeaheadMetadata) - ) - ) - case item: slice.TypeaheadQuerySuggestionItem => - t.SliceItem.TypeaheadQuerySuggestionItem( - t.TypeaheadQuerySuggestionItem( - query = item.query, - metadata = item.metadata.map(marshalTypeaheadMetadata) - ) - ) - case item: slice.TypeaheadUserItem => - t.SliceItem.TypeaheadUserItem( - t.TypeaheadUserItem( - userId = item.userId, - metadata = item.metadata.map(marshalTypeaheadMetadata), - badges = Some(item.badges.map { badge => - t.UserBadge( - badgeUrl = badge.badgeUrl, - description = Some(badge.description), - badgeType = Some(badge.badgeType)) - }) - ) - ) - case item: slice.AdItem => - t.SliceItem.AdItem( - t.AdItem( - adKey = t.AdKey( - adAccountId = item.adAccountId, - adUnitId = item.adUnitId, - ) - ) - ) - case item: slice.AdCreativeItem => - t.SliceItem.AdCreativeItem( - t.AdCreativeItem( - adCreativeKey = t.AdCreativeKey( - adAccountId = item.adAccountId, - adType = marshalAdType(item.adType), - creativeId = item.creativeId - ) - ) - ) - case item: slice.AdGroupItem => - t.SliceItem.AdGroupItem( - t.AdGroupItem( - adGroupKey = t.AdGroupKey( - adAccountId = item.adAccountId, - adGroupId = item.adGroupId - ) - ) - ) - case item: slice.CampaignItem => - t.SliceItem.CampaignItem( - t.CampaignItem( - campaignKey = t.CampaignKey( - adAccountId = item.adAccountId, - campaignId = item.campaignId - ) - ) - ) - case item: slice.FundingSourceItem => - t.SliceItem.FundingSourceItem( - t.FundingSourceItem( - fundingSourceKey = t.FundingSourceKey( - adAccountId = item.adAccountId, - fundingSourceId = item.fundingSourceId - ) - ) - ) - } - } - - private def marshalTypeaheadMetadata(metadata: slice.TypeaheadMetadata) = { - t.TypeaheadMetadata( - score = metadata.score, - source = metadata.source, - resultContext = metadata.context.map(context => - t.TypeaheadResultContext( - displayString = context.displayString, - contextType = marshalRequestContextType(context.contextType), - iconUrl = context.iconUrl - )) - ) - } - - private def marshalRequestContextType( - context: slice.TypeaheadResultContextType - ): t.TypeaheadResultContextType = { - context match { - case slice.You => t.TypeaheadResultContextType.You - case slice.Location => t.TypeaheadResultContextType.Location - case slice.NumFollowers => t.TypeaheadResultContextType.NumFollowers - case slice.FollowRelationship => t.TypeaheadResultContextType.FollowRelationship - case slice.Bio => t.TypeaheadResultContextType.Bio - case slice.NumTweets => t.TypeaheadResultContextType.NumTweets - case slice.Trending => t.TypeaheadResultContextType.Trending - case slice.HighlightedLabel => t.TypeaheadResultContextType.HighlightedLabel - case _ => t.TypeaheadResultContextType.Undefined - } - } - - private def marshalAdType( - adType: AdType - ): t.AdType = { - adType match { - case AdType.Tweet => t.AdType.Tweet - case AdType.Account => t.AdType.Account - case AdType.InStreamVideo => t.AdType.InStreamVideo - case AdType.DisplayCreative => t.AdType.DisplayCreative - case AdType.Trend => t.AdType.Trend - case AdType.Spotlight => t.AdType.Spotlight - case AdType.Takeover => t.AdType.Takeover - } - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/slice/SliceTransportMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/slice/SliceTransportMarshaller.docx new file mode 100644 index 000000000..53270ac69 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/slice/SliceTransportMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/slice/SliceTransportMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/slice/SliceTransportMarshaller.scala deleted file mode 100644 index a59102940..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/slice/SliceTransportMarshaller.scala +++ /dev/null @@ -1,26 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.slice - -import com.twitter.product_mixer.core.functional_component.marshaller.TransportMarshaller -import com.twitter.product_mixer.core.model.common.identifier.TransportMarshallerIdentifier -import com.twitter.product_mixer.core.model.marshalling.response.slice.Slice -import com.twitter.strato.graphql.{thriftscala => t} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class SliceTransportMarshaller @Inject() (sliceItemMarshaller: SliceItemMarshaller) - extends TransportMarshaller[Slice, t.SliceResult] { - - override val identifier: TransportMarshallerIdentifier = TransportMarshallerIdentifier("Slice") - - override def apply(slice: Slice): t.SliceResult = { - t.SliceResult.Slice( - t.Slice( - items = slice.items.map(sliceItemMarshaller(_)), - sliceInfo = t.SliceInfo( - previousCursor = slice.sliceInfo.previousCursor, - nextCursor = slice.sliceInfo.nextCursor - ) - )) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/BUILD b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/BUILD deleted file mode 100644 index 214dfdda1..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/BUILD +++ /dev/null @@ -1,22 +0,0 @@ -scala_library( - sources = ["*.scala"], - compiler_option_sets = ["fatal_warnings"], - strict_deps = True, - tags = ["bazel-compatible"], - dependencies = [ - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/urp", - "src/thrift/com/twitter/pages/render:thrift-scala", - "strato/config/src/thrift/com/twitter/strato/graphql/timelines:graphql-timelines-scala", - ], - exports = [ - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/urp", - "src/thrift/com/twitter/pages/render:thrift-scala", - "strato/config/src/thrift/com/twitter/strato/graphql/timelines:graphql-timelines-scala", - ], -) diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/BUILD.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/BUILD.docx new file mode 100644 index 000000000..92bc8a6a8 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/BUILD.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/PageBodyMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/PageBodyMarshaller.docx new file mode 100644 index 000000000..ca783ba18 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/PageBodyMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/PageBodyMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/PageBodyMarshaller.scala deleted file mode 100644 index ecd8386b0..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/PageBodyMarshaller.scala +++ /dev/null @@ -1,21 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urp - -import com.twitter.pages.render.{thriftscala => urp} -import com.twitter.product_mixer.core.model.marshalling.response.urp.PageBody -import com.twitter.product_mixer.core.model.marshalling.response.urp.SegmentedTimelinesPageBody -import com.twitter.product_mixer.core.model.marshalling.response.urp.TimelineKeyPageBody -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class PageBodyMarshaller @Inject() ( - timelineKeyMarshaller: TimelineKeyMarshaller, - segmentedTimelinesMarshaller: SegmentedTimelinesMarshaller) { - - def apply(pageBody: PageBody): urp.PageBody = pageBody match { - case pageBody: TimelineKeyPageBody => - urp.PageBody.Timeline(timelineKeyMarshaller(pageBody.timeline)) - case pageBody: SegmentedTimelinesPageBody => - urp.PageBody.SegmentedTimelines(segmentedTimelinesMarshaller(pageBody)) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/PageHeaderMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/PageHeaderMarshaller.docx new file mode 100644 index 000000000..f5b5f8120 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/PageHeaderMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/PageHeaderMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/PageHeaderMarshaller.scala deleted file mode 100644 index 656c1f165..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/PageHeaderMarshaller.scala +++ /dev/null @@ -1,17 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urp - -import com.twitter.pages.render.{thriftscala => urp} -import com.twitter.product_mixer.core.model.marshalling.response.urp.PageHeader -import com.twitter.product_mixer.core.model.marshalling.response.urp.TopicPageHeader -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class PageHeaderMarshaller @Inject() ( - topicPageHeaderMarshaller: TopicPageHeaderMarshaller) { - - def apply(pageHeader: PageHeader): urp.PageHeader = pageHeader match { - case pageHeader: TopicPageHeader => - urp.PageHeader.TopicPageHeader(topicPageHeaderMarshaller(pageHeader)) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/PageNavBarMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/PageNavBarMarshaller.docx new file mode 100644 index 000000000..1249853e9 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/PageNavBarMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/PageNavBarMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/PageNavBarMarshaller.scala deleted file mode 100644 index da03466bf..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/PageNavBarMarshaller.scala +++ /dev/null @@ -1,21 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urp - -import com.twitter.pages.render.{thriftscala => urp} -import com.twitter.product_mixer.core.model.marshalling.response.urp.PageNavBar -import com.twitter.product_mixer.core.model.marshalling.response.urp.TopicPageNavBar -import com.twitter.product_mixer.core.model.marshalling.response.urp.TitleNavBar -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class PageNavBarMarshaller @Inject() ( - topicPageNavBarMarshaller: TopicPageNavBarMarshaller, - titleNavBarMarshaller: TitleNavBarMarshaller) { - - def apply(pageNavBar: PageNavBar): urp.PageNavBar = pageNavBar match { - case pageNavBar: TopicPageNavBar => - urp.PageNavBar.TopicPageNavBar(topicPageNavBarMarshaller(pageNavBar)) - case pageNavBar: TitleNavBar => - urp.PageNavBar.TitleNavBar(titleNavBarMarshaller(pageNavBar)) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/SegmentedTimelineMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/SegmentedTimelineMarshaller.docx new file mode 100644 index 000000000..f8cd413d9 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/SegmentedTimelineMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/SegmentedTimelineMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/SegmentedTimelineMarshaller.scala deleted file mode 100644 index 1d2bdc504..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/SegmentedTimelineMarshaller.scala +++ /dev/null @@ -1,21 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urp - -import com.twitter.pages.render.{thriftscala => urp} -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.TimelineScribeConfigMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urp.SegmentedTimeline -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class SegmentedTimelineMarshaller @Inject() ( - timelineKeyMarshaller: TimelineKeyMarshaller, - timelineScribeConfigMarshaller: TimelineScribeConfigMarshaller) { - - def apply(segmentedTimeline: SegmentedTimeline): urp.SegmentedTimeline = urp.SegmentedTimeline( - id = segmentedTimeline.id, - labelText = segmentedTimeline.labelText, - timeline = timelineKeyMarshaller(segmentedTimeline.timeline), - scribeConfig = segmentedTimeline.scribeConfig.map(timelineScribeConfigMarshaller(_)), - refreshIntervalSec = segmentedTimeline.refreshIntervalSec - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/SegmentedTimelinesMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/SegmentedTimelinesMarshaller.docx new file mode 100644 index 000000000..5e5d3171a Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/SegmentedTimelinesMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/SegmentedTimelinesMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/SegmentedTimelinesMarshaller.scala deleted file mode 100644 index a05e0037f..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/SegmentedTimelinesMarshaller.scala +++ /dev/null @@ -1,17 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urp - -import com.twitter.pages.render.{thriftscala => urp} -import com.twitter.product_mixer.core.model.marshalling.response.urp.SegmentedTimelinesPageBody -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class SegmentedTimelinesMarshaller @Inject() ( - segmentedTimelineMarshaller: SegmentedTimelineMarshaller) { - - def apply(segmentedTimelinesPageBody: SegmentedTimelinesPageBody): urp.SegmentedTimelines = - urp.SegmentedTimelines( - initialTimeline = segmentedTimelineMarshaller(segmentedTimelinesPageBody.initialTimeline), - timelines = segmentedTimelinesPageBody.timelines.map(segmentedTimelineMarshaller(_)) - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TimelineKeyMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TimelineKeyMarshaller.docx new file mode 100644 index 000000000..09843f0d4 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TimelineKeyMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TimelineKeyMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TimelineKeyMarshaller.scala deleted file mode 100644 index 91936e4d0..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TimelineKeyMarshaller.scala +++ /dev/null @@ -1,54 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urp - -import com.twitter.product_mixer.core.model.marshalling.response.urp.FollowedTopicsMeTimeline -import com.twitter.product_mixer.core.model.marshalling.response.urp.FollowedTopicsOtherTimeline -import com.twitter.product_mixer.core.model.marshalling.response.urp.ForYouExploreMixerTimeline -import com.twitter.product_mixer.core.model.marshalling.response.urp.NoteworthyAccountsTimeline -import com.twitter.product_mixer.core.model.marshalling.response.urp.NotInterestedTopicsMeTimeline -import com.twitter.product_mixer.core.model.marshalling.response.urp.NuxForYouCategoryUserRecommendationsTimeline -import com.twitter.product_mixer.core.model.marshalling.response.urp.NuxGeoCategoryUserRecommendationsTimeline -import com.twitter.product_mixer.core.model.marshalling.response.urp.NuxPymkCategoryUserRecommendationsTimeline -import com.twitter.product_mixer.core.model.marshalling.response.urp.NuxSingleInterestCategoryUserRecommendationsTimeline -import com.twitter.product_mixer.core.model.marshalling.response.urp.NuxUserRecommendationsTimeline -import com.twitter.product_mixer.core.model.marshalling.response.urp.ShoppingHomeTimeline -import com.twitter.product_mixer.core.model.marshalling.response.urp.TimelineKey -import com.twitter.product_mixer.core.model.marshalling.response.urp.TopicsLandingTimeline -import com.twitter.product_mixer.core.model.marshalling.response.urp.TopicsPickerTimeline -import com.twitter.product_mixer.core.model.marshalling.response.urp.TrendingExploreMixerTimeline -import com.twitter.strato.graphql.timelines.{thriftscala => graphql} -import javax.inject.Singleton - -@Singleton -class TimelineKeyMarshaller { - - def apply(timelineKey: TimelineKey): graphql.TimelineKey = timelineKey match { - case TopicsLandingTimeline(topicId) => - graphql.TimelineKey.TopicTimeline(graphql.TopicId(topicId)) - case NoteworthyAccountsTimeline(topicId) => - graphql.TimelineKey.NoteworthyAccountsTimeline(graphql.TopicId(topicId)) - case TopicsPickerTimeline(topicId) => - graphql.TimelineKey.TopicsPickerTimeline(graphql.TopicId(topicId)) - case FollowedTopicsMeTimeline() => - graphql.TimelineKey.FollowedTopicsMeTimeline(graphql.Void()) - case NotInterestedTopicsMeTimeline() => - graphql.TimelineKey.NotInterestedTopicsMeTimeline(graphql.Void()) - case FollowedTopicsOtherTimeline(userId) => - graphql.TimelineKey.FollowedTopicsOtherTimeline(userId) - case NuxUserRecommendationsTimeline() => - graphql.TimelineKey.NuxUserRecommendationsTimeline(graphql.Void()) - case NuxForYouCategoryUserRecommendationsTimeline() => - graphql.TimelineKey.NuxForYouCategoryUserRecommendationsTimeline(graphql.Void()) - case NuxPymkCategoryUserRecommendationsTimeline() => - graphql.TimelineKey.NuxPymkCategoryUserRecommendationsTimeline(graphql.Void()) - case NuxGeoCategoryUserRecommendationsTimeline() => - graphql.TimelineKey.NuxGeoCategoryUserRecommendationsTimeline(graphql.Void()) - case NuxSingleInterestCategoryUserRecommendationsTimeline(topicId) => - graphql.TimelineKey.NuxSingleInterestCategoryUserRecommendationsTimeline( - graphql.TopicId(topicId)) - case ShoppingHomeTimeline() => graphql.TimelineKey.ShoppingHome(graphql.Void()) - case ForYouExploreMixerTimeline() => - graphql.TimelineKey.ForYouExploreMixerTimeline(graphql.Void()) - case TrendingExploreMixerTimeline() => - graphql.TimelineKey.TrendingExploreMixerTimeline(graphql.Void()) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TitleNavBarMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TitleNavBarMarshaller.docx new file mode 100644 index 000000000..7d3af1956 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TitleNavBarMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TitleNavBarMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TitleNavBarMarshaller.scala deleted file mode 100644 index 446771772..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TitleNavBarMarshaller.scala +++ /dev/null @@ -1,19 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urp - -import com.twitter.pages.render.{thriftscala => urp} -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.ClientEventInfoMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urp.TitleNavBar -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class TitleNavBarMarshaller @Inject() ( - clientEventInfoMarshaller: ClientEventInfoMarshaller) { - - def apply(titleNavBar: TitleNavBar): urp.TitleNavBar = - urp.TitleNavBar( - title = titleNavBar.title, - subtitle = titleNavBar.subtitle, - clientEventInfo = titleNavBar.clientEventInfo.map(clientEventInfoMarshaller(_)) - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TopicPageHeaderDisplayTypeMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TopicPageHeaderDisplayTypeMarshaller.docx new file mode 100644 index 000000000..ce6db59fa Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TopicPageHeaderDisplayTypeMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TopicPageHeaderDisplayTypeMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TopicPageHeaderDisplayTypeMarshaller.scala deleted file mode 100644 index 9644ee6d4..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TopicPageHeaderDisplayTypeMarshaller.scala +++ /dev/null @@ -1,19 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urp - -import com.twitter.product_mixer.core.model.marshalling.response.urp.BasicTopicPageHeaderDisplayType -import com.twitter.product_mixer.core.model.marshalling.response.urp.PersonalizedTopicPageHeaderDisplayType -import com.twitter.product_mixer.core.model.marshalling.response.urp.TopicPageHeaderDisplayType -import com.twitter.pages.render.{thriftscala => urp} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class TopicPageHeaderDisplayTypeMarshaller @Inject() () { - - def apply( - topicPageHeaderDisplayType: TopicPageHeaderDisplayType - ): urp.TopicPageHeaderDisplayType = topicPageHeaderDisplayType match { - case BasicTopicPageHeaderDisplayType => urp.TopicPageHeaderDisplayType.Basic - case PersonalizedTopicPageHeaderDisplayType => urp.TopicPageHeaderDisplayType.Personalized - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TopicPageHeaderFacepileMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TopicPageHeaderFacepileMarshaller.docx new file mode 100644 index 000000000..d494347c9 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TopicPageHeaderFacepileMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TopicPageHeaderFacepileMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TopicPageHeaderFacepileMarshaller.scala deleted file mode 100644 index d15585bdd..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TopicPageHeaderFacepileMarshaller.scala +++ /dev/null @@ -1,18 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urp - -import com.twitter.pages.render.{thriftscala => urp} -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.UrlMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urp.TopicPageHeaderFacepile -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class TopicPageHeaderFacepileMarshaller @Inject() ( - urlMarshaller: UrlMarshaller) { - - def apply(topicPageHeaderFacepile: TopicPageHeaderFacepile): urp.TopicPageHeaderFacepile = - urp.TopicPageHeaderFacepile( - userIds = topicPageHeaderFacepile.userIds, - facepileUrl = topicPageHeaderFacepile.facepileUrl.map(urlMarshaller(_)) - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TopicPageHeaderMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TopicPageHeaderMarshaller.docx new file mode 100644 index 000000000..140896f4f Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TopicPageHeaderMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TopicPageHeaderMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TopicPageHeaderMarshaller.scala deleted file mode 100644 index 44c4fa48a..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TopicPageHeaderMarshaller.scala +++ /dev/null @@ -1,25 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urp - -import com.twitter.pages.render.{thriftscala => urp} -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.ClientEventInfoMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urp.TopicPageHeader -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class TopicPageHeaderMarshaller @Inject() ( - topicPageHeaderFacepileMarshaller: TopicPageHeaderFacepileMarshaller, - clientEventInfoMarshaller: ClientEventInfoMarshaller, - topicPageHeaderDisplayTypeMarshaller: TopicPageHeaderDisplayTypeMarshaller) { - - def apply(topicPageHeader: TopicPageHeader): urp.TopicPageHeader = - urp.TopicPageHeader( - topicId = topicPageHeader.topicId, - facepile = topicPageHeader.facepile.map(topicPageHeaderFacepileMarshaller(_)), - clientEventInfo = topicPageHeader.clientEventInfo.map(clientEventInfoMarshaller(_)), - landingContext = topicPageHeader.landingContext, - displayType = topicPageHeader.displayType - .map(topicPageHeaderDisplayTypeMarshaller(_)).getOrElse( - urp.TopicPageHeaderDisplayType.Basic) - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TopicPageNavBarMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TopicPageNavBarMarshaller.docx new file mode 100644 index 000000000..5c2792a4a Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TopicPageNavBarMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TopicPageNavBarMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TopicPageNavBarMarshaller.scala deleted file mode 100644 index 9bf0838e2..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/TopicPageNavBarMarshaller.scala +++ /dev/null @@ -1,18 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urp - -import com.twitter.pages.render.{thriftscala => urp} -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.ClientEventInfoMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urp.TopicPageNavBar -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class TopicPageNavBarMarshaller @Inject() ( - clientEventInfoMarshaller: ClientEventInfoMarshaller) { - - def apply(topicPageNavBar: TopicPageNavBar): urp.TopicPageNavBar = - urp.TopicPageNavBar( - topicId = topicPageNavBar.topicId, - clientEventInfo = topicPageNavBar.clientEventInfo.map(clientEventInfoMarshaller(_)) - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/UrpTransportMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/UrpTransportMarshaller.docx new file mode 100644 index 000000000..d74dc4254 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/UrpTransportMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/UrpTransportMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/UrpTransportMarshaller.scala deleted file mode 100644 index 45f5dd721..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/UrpTransportMarshaller.scala +++ /dev/null @@ -1,29 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urp - -import com.twitter.pages.render.{thriftscala => urp} -import com.twitter.product_mixer.core.functional_component.marshaller.TransportMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.TimelineScribeConfigMarshaller -import com.twitter.product_mixer.core.model.common.identifier.TransportMarshallerIdentifier -import com.twitter.product_mixer.core.model.marshalling.response.urp.Page -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class UrpTransportMarshaller @Inject() ( - pageBodyMarshaller: PageBodyMarshaller, - timelineScribeConfigMarshaller: TimelineScribeConfigMarshaller, - pageHeaderMarshaller: PageHeaderMarshaller, - pageNavBarMarshaller: PageNavBarMarshaller) - extends TransportMarshaller[Page, urp.Page] { - - override val identifier: TransportMarshallerIdentifier = - TransportMarshallerIdentifier("UnifiedRichPage") - - override def apply(page: Page): urp.Page = urp.Page( - id = page.id, - pageBody = pageBodyMarshaller(page.pageBody), - scribeConfig = page.scribeConfig.map(timelineScribeConfigMarshaller(_)), - pageHeader = page.pageHeader.map(pageHeaderMarshaller(_)), - pageNavBar = page.pageNavBar.map(pageNavBarMarshaller(_)) - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/UrpTransportMarshallerBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/UrpTransportMarshallerBuilder.docx new file mode 100644 index 000000000..972b76cc1 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/UrpTransportMarshallerBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/UrpTransportMarshallerBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/UrpTransportMarshallerBuilder.scala deleted file mode 100644 index c9f5f597d..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urp/UrpTransportMarshallerBuilder.scala +++ /dev/null @@ -1,65 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urp - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.TimelineScribeConfigMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.ArticleDetailsMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.ClientEventDetailsMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.ClientEventInfoMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.CommerceDetailsMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.ConversationDetailsMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.ConversationSectionMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.LiveEventDetailsMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.TimelinesDetailsMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.UrlMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.UrlTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.UrtEndpointOptionsMarshaller - -object UrpTransportMarshallerBuilder { - // Convenience constructor for services not using dependency injection and unit tests. If using - // dependency injection, instead @Inject an instance of UrpTransportMarshaller to construct. - - val timelineKeyMarshaller = new TimelineKeyMarshaller - val timelineScribeConfigMarshaller = new TimelineScribeConfigMarshaller - val urlMarshaller = new UrlMarshaller(new UrlTypeMarshaller, new UrtEndpointOptionsMarshaller) - val clientEventInfoMarshaller = new ClientEventInfoMarshaller( - new ClientEventDetailsMarshaller( - new ConversationDetailsMarshaller(new ConversationSectionMarshaller), - new TimelinesDetailsMarshaller, - new ArticleDetailsMarshaller, - new LiveEventDetailsMarshaller, - new CommerceDetailsMarshaller) - ) - - val segmentedTimelineMarshaller = - new SegmentedTimelineMarshaller(timelineKeyMarshaller, timelineScribeConfigMarshaller) - val segmentedTimelinesMarshaller = new SegmentedTimelinesMarshaller(segmentedTimelineMarshaller) - - val pageBodyMarshaller: PageBodyMarshaller = new PageBodyMarshaller( - timelineKeyMarshaller, - segmentedTimelinesMarshaller - ) - - val topicPageHeaderFacepileMarshaller = new TopicPageHeaderFacepileMarshaller(urlMarshaller) - val topicPageHeaderDisplayTypeMarshaller = new TopicPageHeaderDisplayTypeMarshaller - val topicPageHeaderMarshaller = new TopicPageHeaderMarshaller( - topicPageHeaderFacepileMarshaller, - clientEventInfoMarshaller, - topicPageHeaderDisplayTypeMarshaller - ) - val pageHeaderMarshaller: PageHeaderMarshaller = new PageHeaderMarshaller( - topicPageHeaderMarshaller) - - val topicPageNavBarMarshaller = new TopicPageNavBarMarshaller(clientEventInfoMarshaller) - val titleNavBarMarshaller = new TitleNavBarMarshaller(clientEventInfoMarshaller) - val pageNavBarMarshaller: PageNavBarMarshaller = new PageNavBarMarshaller( - topicPageNavBarMarshaller, - titleNavBarMarshaller - ) - - val marshaller: UrpTransportMarshaller = - new UrpTransportMarshaller( - pageBodyMarshaller = pageBodyMarshaller, - timelineScribeConfigMarshaller = timelineScribeConfigMarshaller, - pageHeaderMarshaller = pageHeaderMarshaller, - pageNavBarMarshaller = pageNavBarMarshaller - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/AddEntriesInstructionMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/AddEntriesInstructionMarshaller.docx new file mode 100644 index 000000000..4415a02bc Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/AddEntriesInstructionMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/AddEntriesInstructionMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/AddEntriesInstructionMarshaller.scala deleted file mode 100644 index 6effca5ae..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/AddEntriesInstructionMarshaller.scala +++ /dev/null @@ -1,15 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt - -import com.twitter.product_mixer.core.model.marshalling.response.urt.AddEntriesTimelineInstruction -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class AddEntriesInstructionMarshaller @Inject() ( - timelineEntryMarshaller: TimelineEntryMarshaller) { - - def apply(instruction: AddEntriesTimelineInstruction): urt.AddEntries = urt.AddEntries( - entries = instruction.entries.map(timelineEntryMarshaller(_)) - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/AddToModuleInstructionMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/AddToModuleInstructionMarshaller.docx new file mode 100644 index 000000000..3ba891167 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/AddToModuleInstructionMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/AddToModuleInstructionMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/AddToModuleInstructionMarshaller.scala deleted file mode 100644 index ce0c37139..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/AddToModuleInstructionMarshaller.scala +++ /dev/null @@ -1,17 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt - -import com.twitter.product_mixer.core.model.marshalling.response.urt.AddToModuleTimelineInstruction -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class AddToModuleInstructionMarshaller @Inject() (moduleItemMarshaller: ModuleItemMarshaller) { - - def apply(instruction: AddToModuleTimelineInstruction): urt.AddToModule = urt.AddToModule( - moduleItems = instruction.moduleItems.map(moduleItemMarshaller(_, instruction.moduleEntryId)), - moduleEntryId = instruction.moduleEntryId, - moduleItemEntryId = instruction.moduleItemEntryId, - prepend = instruction.prepend - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/BUILD b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/BUILD deleted file mode 100644 index c2f8069b6..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/BUILD +++ /dev/null @@ -1,40 +0,0 @@ -scala_library( - sources = ["*.scala"], - compiler_option_sets = ["fatal_warnings"], - platform = "java8", - strict_deps = True, - tags = ["bazel-compatible"], - dependencies = [ - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/graphql/contextual_ref", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/color", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/media", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/metadata", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/operation", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/timeline_module", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/urt", - "src/thrift/com/twitter/spam/rtf:safety-level-scala", - "src/thrift/com/twitter/timelines/render:thrift-scala", - "strato/config/src/thrift/com/twitter/strato/graphql/contextual_refs:graphql-refs-scala", - ], - exports = [ - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/color", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/media", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/metadata", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/operation", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/timeline_module", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/urt", - "src/thrift/com/twitter/spam/rtf:safety-level-scala", - "src/thrift/com/twitter/timelines/render:thrift-scala", - "strato/config/src/thrift/com/twitter/strato/graphql/contextual_refs:graphql-refs-scala", - ], -) diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/BUILD.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/BUILD.docx new file mode 100644 index 000000000..054d9c69b Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/BUILD.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/CoverMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/CoverMarshaller.docx new file mode 100644 index 000000000..e3198dc38 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/CoverMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/CoverMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/CoverMarshaller.scala deleted file mode 100644 index d7bc4e8d4..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/CoverMarshaller.scala +++ /dev/null @@ -1,32 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt - -import com.twitter.product_mixer.core.functional_component.marshaller.TransportMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.cover.CoverContentMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.ClientEventInfoMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.Cover -import com.twitter.product_mixer.core.model.marshalling.response.urt.cover.FullCover -import com.twitter.product_mixer.core.model.marshalling.response.urt.cover.HalfCover -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class CoverMarshaller @Inject() ( - coverContentMarshaller: CoverContentMarshaller, - clientEventInfoMarshaller: ClientEventInfoMarshaller) { - - def apply(cover: Cover): urt.ShowCover = cover match { - case halfCover: HalfCover => - urt.ShowCover( - cover = coverContentMarshaller(halfCover.content), - clientEventInfo = cover.clientEventInfo.map(clientEventInfoMarshaller(_))) - case fullCover: FullCover => - urt.ShowCover( - cover = coverContentMarshaller(fullCover.content), - clientEventInfo = cover.clientEventInfo.map(clientEventInfoMarshaller(_))) - } -} - -class UnsupportedTimelineCoverException(cover: Cover) - extends UnsupportedOperationException( - "Unsupported timeline cover " + TransportMarshaller.getSimpleName(cover.getClass)) diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/MarkEntriesUnreadInstructionMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/MarkEntriesUnreadInstructionMarshaller.docx new file mode 100644 index 000000000..9e8e00eb3 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/MarkEntriesUnreadInstructionMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/MarkEntriesUnreadInstructionMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/MarkEntriesUnreadInstructionMarshaller.scala deleted file mode 100644 index 4f0e94c44..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/MarkEntriesUnreadInstructionMarshaller.scala +++ /dev/null @@ -1,13 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt - -import com.twitter.product_mixer.core.model.marshalling.response.urt.MarkEntriesUnreadInstruction -import javax.inject.Inject -import javax.inject.Singleton -import com.twitter.timelines.render.{thriftscala => urt} - -@Singleton -class MarkEntriesUnreadInstructionMarshaller @Inject() () { - - def apply(instruction: MarkEntriesUnreadInstruction): urt.MarkEntriesUnread = - urt.MarkEntriesUnread(entryIds = instruction.entryIds) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/ModuleItemMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/ModuleItemMarshaller.docx new file mode 100644 index 000000000..ddeec30a8 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/ModuleItemMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/ModuleItemMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/ModuleItemMarshaller.scala deleted file mode 100644 index 439ce87da..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/ModuleItemMarshaller.scala +++ /dev/null @@ -1,23 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt - -import com.twitter.product_mixer.core.model.marshalling.response.urt.ModuleItem -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class ModuleItemMarshaller @Inject() ( - timelineItemMarshaller: TimelineItemMarshaller, - moduleItemTreeDisplayMarshaller: ModuleItemTreeDisplayMarshaller) { - - def apply(moduleItem: ModuleItem, moduleEntryId: String): urt.ModuleItem = urt.ModuleItem( - /* Module items have an identifier comprising both the module entry id and the module item id. - Some URT clients will deduplicate globally across different modules. - Using the entry id as a prefix ensures that deduplication only happens within a single module, - which we believe better aligns with engineers' intentions. */ - entryId = moduleEntryId + "-" + moduleItem.item.entryIdentifier, - item = timelineItemMarshaller(moduleItem.item), - dispensable = moduleItem.dispensable, - treeDisplay = moduleItem.treeDisplay.map(moduleItemTreeDisplayMarshaller.apply) - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/ModuleItemTreeDisplayMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/ModuleItemTreeDisplayMarshaller.docx new file mode 100644 index 000000000..b7cdc5250 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/ModuleItemTreeDisplayMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/ModuleItemTreeDisplayMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/ModuleItemTreeDisplayMarshaller.scala deleted file mode 100644 index 26f93db2a..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/ModuleItemTreeDisplayMarshaller.scala +++ /dev/null @@ -1,20 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.timeline_module.ModuleDisplayTypeMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.ModuleItemTreeDisplay -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class ModuleItemTreeDisplayMarshaller @Inject() ( - moduleDisplayTypeMarshaller: ModuleDisplayTypeMarshaller) { - - def apply(moduleItemTreeDisplay: ModuleItemTreeDisplay): urt.ModuleItemTreeDisplay = - urt.ModuleItemTreeDisplay( - parentModuleItemEntryId = moduleItemTreeDisplay.parentModuleEntryItemId, - indentFromParent = moduleItemTreeDisplay.indentFromParent, - displayType = moduleItemTreeDisplay.displayType.map(moduleDisplayTypeMarshaller(_)), - isAnchorChild = moduleItemTreeDisplay.isAnchorChild - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/PinEntryInstructionMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/PinEntryInstructionMarshaller.docx new file mode 100644 index 000000000..4a8703b95 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/PinEntryInstructionMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/PinEntryInstructionMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/PinEntryInstructionMarshaller.scala deleted file mode 100644 index 62eb202d9..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/PinEntryInstructionMarshaller.scala +++ /dev/null @@ -1,15 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt - -import com.twitter.product_mixer.core.model.marshalling.response.urt.PinEntryTimelineInstruction -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class PinEntryInstructionMarshaller @Inject() ( - timelineEntryMarshaller: TimelineEntryMarshaller) { - - def apply(instruction: PinEntryTimelineInstruction): urt.PinEntry = { - urt.PinEntry(entry = timelineEntryMarshaller(instruction.entry)) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/ReaderModeConfigMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/ReaderModeConfigMarshaller.docx new file mode 100644 index 000000000..7fa1a99d1 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/ReaderModeConfigMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/ReaderModeConfigMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/ReaderModeConfigMarshaller.scala deleted file mode 100644 index d0c71e3aa..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/ReaderModeConfigMarshaller.scala +++ /dev/null @@ -1,17 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.UrlMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.ReaderModeConfig -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class ReaderModeConfigMarshaller @Inject() (urlMarshaller: UrlMarshaller) { - - def apply(readerModeConfig: ReaderModeConfig): urt.ReaderModeConfig = urt.ReaderModeConfig( - isReaderModeAvailable = readerModeConfig.isReaderModeAvailable, - landingUrl = urlMarshaller(readerModeConfig.landingUrl) - ) - -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/ReplaceEntryInstructionMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/ReplaceEntryInstructionMarshaller.docx new file mode 100644 index 000000000..15632331e Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/ReplaceEntryInstructionMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/ReplaceEntryInstructionMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/ReplaceEntryInstructionMarshaller.scala deleted file mode 100644 index 5011721b8..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/ReplaceEntryInstructionMarshaller.scala +++ /dev/null @@ -1,26 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt - -import com.twitter.product_mixer.core.functional_component.marshaller.TransportMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.ReplaceEntryTimelineInstruction -import com.twitter.product_mixer.core.model.marshalling.response.urt.TimelineEntry -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class ReplaceEntryInstructionMarshaller @Inject() ( - timelineEntryMarshaller: TimelineEntryMarshaller) { - - def apply(instruction: ReplaceEntryTimelineInstruction): urt.ReplaceEntry = { - val instructionEntry = instruction.entry - urt.ReplaceEntry( - entryIdToReplace = instructionEntry.entryIdToReplace - .getOrElse(throw new MissingEntryToReplaceException(instructionEntry)), - entry = timelineEntryMarshaller(instructionEntry) - ) - } -} - -class MissingEntryToReplaceException(entry: TimelineEntry) - extends IllegalArgumentException( - s"Missing entry ID to replace ${TransportMarshaller.getSimpleName(entry.getClass)}") diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/ShowAlertInstructionMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/ShowAlertInstructionMarshaller.docx new file mode 100644 index 000000000..07dc46cf9 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/ShowAlertInstructionMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/ShowAlertInstructionMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/ShowAlertInstructionMarshaller.scala deleted file mode 100644 index 5a5eec0e7..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/ShowAlertInstructionMarshaller.scala +++ /dev/null @@ -1,41 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.alert.ShowAlertColorConfigurationMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.alert.ShowAlertDisplayLocationMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.alert.ShowAlertIconDisplayInfoMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.alert.ShowAlertNavigationMetadataMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.alert.ShowAlertTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.ClientEventInfoMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.richtext.RichTextMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.ShowAlertInstruction -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class ShowAlertInstructionMarshaller @Inject() ( - showAlertTypeMarshaller: ShowAlertTypeMarshaller, - clientEventInfoMarshaller: ClientEventInfoMarshaller, - richTextMarshaller: RichTextMarshaller, - showAlertIconDisplayInfoMarshaller: ShowAlertIconDisplayInfoMarshaller, - showAlertColorConfigurationMarshaller: ShowAlertColorConfigurationMarshaller, - showAlertDisplayLocationMarshaller: ShowAlertDisplayLocationMarshaller, - showAlertNavigationMetadataMarshaller: ShowAlertNavigationMetadataMarshaller, -) { - - def apply(instruction: ShowAlertInstruction): urt.ShowAlert = urt.ShowAlert( - alertType = showAlertTypeMarshaller(instruction.showAlert.alertType), - triggerDelayMs = instruction.showAlert.triggerDelay.map(_.inMillis.toInt), - displayDurationMs = instruction.showAlert.displayDuration.map(_.inMillis.toInt), - clientEventInfo = instruction.showAlert.clientEventInfo.map(clientEventInfoMarshaller(_)), - collapseDelayMs = instruction.showAlert.collapseDelay.map(_.inMillis.toInt), - userIds = instruction.showAlert.userIds, - richText = instruction.showAlert.richText.map(richTextMarshaller(_)), - iconDisplayInfo = - instruction.showAlert.iconDisplayInfo.map(showAlertIconDisplayInfoMarshaller(_)), - colorConfig = showAlertColorConfigurationMarshaller(instruction.showAlert.colorConfig), - displayLocation = showAlertDisplayLocationMarshaller(instruction.showAlert.displayLocation), - navigationMetadata = - instruction.showAlert.navigationMetadata.map(showAlertNavigationMetadataMarshaller(_)), - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TerminateTimelineInstructionMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TerminateTimelineInstructionMarshaller.docx new file mode 100644 index 000000000..d0631de5b Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TerminateTimelineInstructionMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TerminateTimelineInstructionMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TerminateTimelineInstructionMarshaller.scala deleted file mode 100644 index 5fa2a9bab..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TerminateTimelineInstructionMarshaller.scala +++ /dev/null @@ -1,22 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt - -import com.twitter.product_mixer.core.model.marshalling.response.urt.BottomTermination -import com.twitter.product_mixer.core.model.marshalling.response.urt.TerminateTimelineInstruction -import com.twitter.product_mixer.core.model.marshalling.response.urt.TopTermination -import com.twitter.product_mixer.core.model.marshalling.response.urt.TopAndBottomTermination -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class TerminateTimelineInstructionMarshaller @Inject() () { - - def apply(instruction: TerminateTimelineInstruction): urt.TerminateTimeline = - urt.TerminateTimeline( - direction = instruction.terminateTimelineDirection match { - case TopTermination => urt.TimelineTerminationDirection.Top - case BottomTermination => urt.TimelineTerminationDirection.Bottom - case TopAndBottomTermination => urt.TimelineTerminationDirection.TopAndBottom - } - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineEntryContentMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineEntryContentMarshaller.docx new file mode 100644 index 000000000..a07572ad1 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineEntryContentMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineEntryContentMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineEntryContentMarshaller.scala deleted file mode 100644 index 2589df862..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineEntryContentMarshaller.scala +++ /dev/null @@ -1,25 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt - -import com.twitter.product_mixer.core.model.marshalling.response.urt.TimelineEntry -import com.twitter.product_mixer.core.model.marshalling.response.urt.TimelineItem -import com.twitter.product_mixer.core.model.marshalling.response.urt.TimelineModule -import com.twitter.product_mixer.core.model.marshalling.response.urt.TimelineOperation -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class TimelineEntryContentMarshaller @Inject() ( - timelineItemMarshaller: TimelineItemMarshaller, - timelineModuleMarshaller: TimelineModuleMarshaller, - timelineOperationMarshaller: TimelineOperationMarshaller) { - - def apply(entry: TimelineEntry): urt.TimelineEntryContent = entry match { - case item: TimelineItem => - urt.TimelineEntryContent.Item(timelineItemMarshaller(item)) - case module: TimelineModule => - urt.TimelineEntryContent.TimelineModule(timelineModuleMarshaller(module)) - case operation: TimelineOperation => - urt.TimelineEntryContent.Operation(timelineOperationMarshaller(operation)) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineEntryMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineEntryMarshaller.docx new file mode 100644 index 000000000..4bd064d0a Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineEntryMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineEntryMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineEntryMarshaller.scala deleted file mode 100644 index 8d937289c..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineEntryMarshaller.scala +++ /dev/null @@ -1,22 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt - -import com.twitter.product_mixer.core.model.marshalling.response.urt.TimelineEntry -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class TimelineEntryMarshaller @Inject() ( - timelineEntryContentMarshaller: TimelineEntryContentMarshaller) { - - def apply(entry: TimelineEntry): urt.TimelineEntry = - urt.TimelineEntry( - entryId = entry.entryIdentifier, - sortIndex = entry.sortIndex.getOrElse(throw new TimelineEntryMissingSortIndexException), - content = timelineEntryContentMarshaller(entry), - expiryTime = entry.expirationTimeInMillis - ) -} - -class TimelineEntryMissingSortIndexException - extends UnsupportedOperationException("Timeline entry missing sort index") diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineInstructionMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineInstructionMarshaller.docx new file mode 100644 index 000000000..ff0044366 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineInstructionMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineInstructionMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineInstructionMarshaller.scala deleted file mode 100644 index e3727dab2..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineInstructionMarshaller.scala +++ /dev/null @@ -1,50 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt - -import com.twitter.product_mixer.core.model.marshalling.response.urt.AddEntriesTimelineInstruction -import com.twitter.product_mixer.core.model.marshalling.response.urt.AddToModuleTimelineInstruction -import com.twitter.product_mixer.core.model.marshalling.response.urt.ClearCacheTimelineInstruction -import com.twitter.product_mixer.core.model.marshalling.response.urt.MarkEntriesUnreadInstruction -import com.twitter.product_mixer.core.model.marshalling.response.urt.PinEntryTimelineInstruction -import com.twitter.product_mixer.core.model.marshalling.response.urt.ReplaceEntryTimelineInstruction -import com.twitter.product_mixer.core.model.marshalling.response.urt.ShowAlertInstruction -import com.twitter.product_mixer.core.model.marshalling.response.urt.ShowCoverInstruction -import com.twitter.product_mixer.core.model.marshalling.response.urt.TerminateTimelineInstruction -import com.twitter.product_mixer.core.model.marshalling.response.urt.TimelineInstruction -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class TimelineInstructionMarshaller @Inject() ( - addEntriesInstructionMarshaller: AddEntriesInstructionMarshaller, - addToModuleInstructionMarshaller: AddToModuleInstructionMarshaller, - markEntriesUnreadInstructionMarshaller: MarkEntriesUnreadInstructionMarshaller, - pinEntryInstructionMarshaller: PinEntryInstructionMarshaller, - replaceEntryInstructionMarshaller: ReplaceEntryInstructionMarshaller, - showAlertInstructionMarshaller: ShowAlertInstructionMarshaller, - terminateTimelineInstructionMarshaller: TerminateTimelineInstructionMarshaller, - coverMarshaller: CoverMarshaller) { - - def apply(instruction: TimelineInstruction): urt.TimelineInstruction = instruction match { - case instruction: AddEntriesTimelineInstruction => - urt.TimelineInstruction.AddEntries(addEntriesInstructionMarshaller(instruction)) - case instruction: AddToModuleTimelineInstruction => - urt.TimelineInstruction.AddToModule(addToModuleInstructionMarshaller(instruction)) - case _: ClearCacheTimelineInstruction => - urt.TimelineInstruction.ClearCache(urt.ClearCache()) - case instruction: MarkEntriesUnreadInstruction => - urt.TimelineInstruction.MarkEntriesUnread( - markEntriesUnreadInstructionMarshaller(instruction) - ) - case instruction: PinEntryTimelineInstruction => - urt.TimelineInstruction.PinEntry(pinEntryInstructionMarshaller(instruction)) - case instruction: ReplaceEntryTimelineInstruction => - urt.TimelineInstruction.ReplaceEntry(replaceEntryInstructionMarshaller(instruction)) - case instruction: ShowCoverInstruction => - urt.TimelineInstruction.ShowCover(coverMarshaller(instruction.cover)) - case instruction: ShowAlertInstruction => - urt.TimelineInstruction.ShowAlert(showAlertInstructionMarshaller(instruction)) - case instruction: TerminateTimelineInstruction => - urt.TimelineInstruction.TerminateTimeline(terminateTimelineInstructionMarshaller(instruction)) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineItemContentMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineItemContentMarshaller.docx new file mode 100644 index 000000000..7b184b890 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineItemContentMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineItemContentMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineItemContentMarshaller.scala deleted file mode 100644 index dee74d6b1..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineItemContentMarshaller.scala +++ /dev/null @@ -1,130 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt - -import com.twitter.product_mixer.core.functional_component.marshaller.TransportMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.commerce.CommerceProductGroupItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.commerce.CommerceProductItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.article.ArticleItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.audio_space.AudioSpaceItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.card.CardItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.event.EventSummaryItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.generic_summary_item.GenericSummaryItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.icon_label.IconLabelItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.label.LabelItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.message.MessagePromptItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.moment.MomentAnnotationItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.prompt.PromptItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.suggestion.SpellingItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.thread.ThreadHeaderItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.tile.TileItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.tombstone.TombstoneItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.topic.TopicFollowPromptItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.topic.TopicItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.trend.TrendItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.tweet.TweetItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.tweet_composer.TweetComposerItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.twitter_list.TwitterListItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.user.UserItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.vertical_grid_item.VerticalGridItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.operation.CursorItemMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.Cover -import com.twitter.product_mixer.core.model.marshalling.response.urt.TimelineItem -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.article.ArticleItem -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.audio_space.AudioSpaceItem -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.card.CardItem -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.commerce.CommerceProductGroupItem -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.commerce.CommerceProductItem -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.event.EventSummaryItem -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.generic_summary.GenericSummaryItem -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.icon_label.IconLabelItem -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.label.LabelItem -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.message.MessagePromptItem -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.moment.MomentAnnotationItem -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.prompt.PromptItem -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.suggestion.SpellingItem -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.thread.ThreadHeaderItem -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.tile.TileItem -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.tombstone.TombstoneItem -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.topic.TopicFollowPromptItem -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.topic.TopicItem -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.trend.TrendItem -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.tweet.TweetItem -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.tweet_composer.TweetComposerItem -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.twitter_list.TwitterListItem -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.user.UserItem -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.vertical_grid_item.VerticalGridItem -import com.twitter.product_mixer.core.model.marshalling.response.urt.operation.CursorItem -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class TimelineItemContentMarshaller @Inject() ( - articleItemMarshaller: ArticleItemMarshaller, - audioSpaceItemMarshaller: AudioSpaceItemMarshaller, - cardItemMarshaller: CardItemMarshaller, - cursorItemMarshaller: CursorItemMarshaller, - eventSummaryItemMarshaller: EventSummaryItemMarshaller, - iconLabelItemMarshaller: IconLabelItemMarshaller, - labelItemMarshaller: LabelItemMarshaller, - messagePromptItemMarshaller: MessagePromptItemMarshaller, - tileItemMarshaller: TileItemMarshaller, - tombstoneItemMarshaller: TombstoneItemMarshaller, - topicFollowPromptItemMarshaller: TopicFollowPromptItemMarshaller, - topicItemMarshaller: TopicItemMarshaller, - tweetComposerItemMarshaller: TweetComposerItemMarshaller, - tweetItemMarshaller: TweetItemMarshaller, - twitterListItemMarshaller: TwitterListItemMarshaller, - userItemMarshaller: UserItemMarshaller, - verticalGridItemMarshaller: VerticalGridItemMarshaller, - threadHeaderItemMarshaller: ThreadHeaderItemMarshaller, - promptItemMarshaller: PromptItemMarshaller, - spellingItemMarshaller: SpellingItemMarshaller, - momentAnnotationItemMarshaller: MomentAnnotationItemMarshaller, - genericSummaryItemMarshaller: GenericSummaryItemMarshaller, - commerceProductItemMarshaller: CommerceProductItemMarshaller, - commerceProductGroupItemMarshaller: CommerceProductGroupItemMarshaller, - trendItemMarshaller: TrendItemMarshaller) { - - def apply(item: TimelineItem): urt.TimelineItemContent = item match { - case articleItem: ArticleItem => articleItemMarshaller(articleItem) - case audioSpaceItem: AudioSpaceItem => audioSpaceItemMarshaller(audioSpaceItem) - case cardItem: CardItem => cardItemMarshaller(cardItem) - case cursorItem: CursorItem => cursorItemMarshaller(cursorItem) - case eventSummaryItem: EventSummaryItem => eventSummaryItemMarshaller(eventSummaryItem) - case genericSummaryItem: GenericSummaryItem => genericSummaryItemMarshaller(genericSummaryItem) - case iconLabelItem: IconLabelItem => iconLabelItemMarshaller(iconLabelItem) - case labelItem: LabelItem => labelItemMarshaller(labelItem) - case messagePromptItem: MessagePromptItem => messagePromptItemMarshaller(messagePromptItem) - case tileItem: TileItem => tileItemMarshaller(tileItem) - case tombstoneItem: TombstoneItem => tombstoneItemMarshaller(tombstoneItem) - case topicFollowPromptItem: TopicFollowPromptItem => - topicFollowPromptItemMarshaller(topicFollowPromptItem) - case topicItem: TopicItem => topicItemMarshaller(topicItem) - case tweetComposerItem: TweetComposerItem => tweetComposerItemMarshaller(tweetComposerItem) - case tweetItem: TweetItem => tweetItemMarshaller(tweetItem) - case twitterListItem: TwitterListItem => twitterListItemMarshaller(twitterListItem) - case userItem: UserItem => userItemMarshaller(userItem) - case verticalGridItem: VerticalGridItem => verticalGridItemMarshaller(verticalGridItem) - case threadHeaderItem: ThreadHeaderItem => threadHeaderItemMarshaller(threadHeaderItem) - case promptItem: PromptItem => promptItemMarshaller(promptItem) - case spellingItem: SpellingItem => spellingItemMarshaller(spellingItem) - case momentAnnotationItem: MomentAnnotationItem => - momentAnnotationItemMarshaller(momentAnnotationItem) - case commerceProductItem: CommerceProductItem => - commerceProductItemMarshaller(commerceProductItem) - case commerceProductGroupItem: CommerceProductGroupItem => - commerceProductGroupItemMarshaller(commerceProductGroupItem) - case trendItem: TrendItem => trendItemMarshaller(trendItem) - case _: Cover => throw TimelineCoverNotFilteredException - case _ => throw new UnsupportedTimelineItemException(item) - } -} - -class UnsupportedTimelineItemException(timelineItem: TimelineItem) - extends UnsupportedOperationException( - "Unsupported timeline item " + TransportMarshaller.getSimpleName(timelineItem.getClass)) - -object TimelineCoverNotFilteredException - extends UnsupportedOperationException("AddEntriesInstructionBuilder does not support Cover. " + - "ShowCoverInstructionBuilder should be used with AddEntriesWithShowCoverInstructionBuilder " + - "in order to filter out the Cover.") diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineItemMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineItemMarshaller.docx new file mode 100644 index 000000000..eccb5a0e9 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineItemMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineItemMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineItemMarshaller.scala deleted file mode 100644 index 242fdc522..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineItemMarshaller.scala +++ /dev/null @@ -1,22 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.ClientEventInfoMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.FeedbackInfoMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.TimelineItem -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class TimelineItemMarshaller @Inject() ( - timelineItemContentMarshaller: TimelineItemContentMarshaller, - clientEventInfoMarshaller: ClientEventInfoMarshaller, - feedbackInfoMarshaller: FeedbackInfoMarshaller) { - - def apply(item: TimelineItem): urt.TimelineItem = urt.TimelineItem( - content = timelineItemContentMarshaller(item), - clientEventInfo = item.clientEventInfo.map(clientEventInfoMarshaller(_)), - feedbackInfo = item.feedbackActionInfo.map(feedbackInfoMarshaller(_)), - prompt = None - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineMetadataMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineMetadataMarshaller.docx new file mode 100644 index 000000000..8efedf8bb Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineMetadataMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineMetadataMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineMetadataMarshaller.scala deleted file mode 100644 index 792859941..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineMetadataMarshaller.scala +++ /dev/null @@ -1,18 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt - -import com.twitter.product_mixer.core.model.marshalling.response.urt.TimelineMetadata -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class TimelineMetadataMarshaller @Inject() ( - timelineScribeConfigMarshaller: TimelineScribeConfigMarshaller, - readerModeConfigMarshaller: ReaderModeConfigMarshaller) { - - def apply(timelineMetadata: TimelineMetadata): urt.TimelineMetadata = urt.TimelineMetadata( - title = timelineMetadata.title, - scribeConfig = timelineMetadata.scribeConfig.map(timelineScribeConfigMarshaller(_)), - readerModeConfig = timelineMetadata.readerModeConfig.map(readerModeConfigMarshaller(_)) - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineModuleMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineModuleMarshaller.docx new file mode 100644 index 000000000..164f3a8fe Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineModuleMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineModuleMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineModuleMarshaller.scala deleted file mode 100644 index 4de8d6164..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineModuleMarshaller.scala +++ /dev/null @@ -1,36 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.ClientEventInfoMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.FeedbackInfoMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.timeline_module.ModuleDisplayTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.timeline_module.ModuleFooterMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.timeline_module.ModuleHeaderMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.timeline_module.ModuleMetadataMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.timeline_module.ModuleShowMoreBehaviorMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.TimelineModule -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class TimelineModuleMarshaller @Inject() ( - moduleItemMarshaller: ModuleItemMarshaller, - moduleDisplayTypeMarshaller: ModuleDisplayTypeMarshaller, - moduleHeaderMarshaller: ModuleHeaderMarshaller, - moduleFooterMarshaller: ModuleFooterMarshaller, - clientEventInfoMarshaller: ClientEventInfoMarshaller, - feedbackInfoMarshaller: FeedbackInfoMarshaller, - moduleMetadataMarshaller: ModuleMetadataMarshaller, - moduleShowMoreBehaviorMarshaller: ModuleShowMoreBehaviorMarshaller) { - - def apply(timelineModule: TimelineModule): urt.TimelineModule = urt.TimelineModule( - items = timelineModule.items.map(moduleItemMarshaller(_, timelineModule.entryIdentifier)), - displayType = moduleDisplayTypeMarshaller(timelineModule.displayType), - header = timelineModule.header.map(moduleHeaderMarshaller(_)), - footer = timelineModule.footer.map(moduleFooterMarshaller(_)), - clientEventInfo = timelineModule.clientEventInfo.map(clientEventInfoMarshaller(_)), - feedbackInfo = timelineModule.feedbackActionInfo.map(feedbackInfoMarshaller(_)), - metadata = timelineModule.metadata.map(moduleMetadataMarshaller(_)), - showMoreBehavior = timelineModule.showMoreBehavior.map(moduleShowMoreBehaviorMarshaller(_)) - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineOperationMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineOperationMarshaller.docx new file mode 100644 index 000000000..c6ee7c2ae Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineOperationMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineOperationMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineOperationMarshaller.scala deleted file mode 100644 index 85d506766..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineOperationMarshaller.scala +++ /dev/null @@ -1,24 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt - -import com.twitter.product_mixer.core.functional_component.marshaller.TransportMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.operation.CursorOperationMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.TimelineOperation -import com.twitter.product_mixer.core.model.marshalling.response.urt.operation.CursorOperation -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class TimelineOperationMarshaller @Inject() ( - cursorOperationMarshaller: CursorOperationMarshaller) { - - def apply(operation: TimelineOperation): urt.TimelineOperation = operation match { - case cursorOperation: CursorOperation => cursorOperationMarshaller(cursorOperation) - case _ => - throw new UnsupportedTimelineOperationException(operation) - } -} - -class UnsupportedTimelineOperationException(operation: TimelineOperation) - extends UnsupportedOperationException( - "Unsupported timeline operation " + TransportMarshaller.getSimpleName(operation.getClass)) diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineScribeConfigMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineScribeConfigMarshaller.docx new file mode 100644 index 000000000..32b02c6a4 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineScribeConfigMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineScribeConfigMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineScribeConfigMarshaller.scala deleted file mode 100644 index a3f495510..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/TimelineScribeConfigMarshaller.scala +++ /dev/null @@ -1,17 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt - -import com.twitter.product_mixer.core.model.marshalling.response.urt.TimelineScribeConfig -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class TimelineScribeConfigMarshaller @Inject() () { - - def apply(timelineScribeConfig: TimelineScribeConfig): urt.TimelineScribeConfig = - urt.TimelineScribeConfig( - page = timelineScribeConfig.page, - section = timelineScribeConfig.section, - entityToken = timelineScribeConfig.entityToken - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/UrtTransportMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/UrtTransportMarshaller.docx new file mode 100644 index 000000000..f4c437600 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/UrtTransportMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/UrtTransportMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/UrtTransportMarshaller.scala deleted file mode 100644 index d270c3848..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/UrtTransportMarshaller.scala +++ /dev/null @@ -1,101 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt - -import com.twitter.product_mixer.core.functional_component.marshaller.TransportMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.ChildFeedbackActionMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.FeedbackActionMarshaller -import com.twitter.product_mixer.core.model.common.identifier.TransportMarshallerIdentifier -import com.twitter.product_mixer.core.model.marshalling.response.urt.Timeline -import com.twitter.product_mixer.core.model.marshalling.response.urt.TimelineInstruction -import com.twitter.product_mixer.core.model.marshalling.response.urt.metadata.ContainsFeedbackActionInfos -import com.twitter.product_mixer.core.model.marshalling.response.urt.metadata.FeedbackAction -import com.twitter.timelines.render.thriftscala.TimelineResponse -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -/** - * [[TransportMarshaller]] for URT types - * - * @note to make an instance of a [[UrtTransportMarshaller]] you can use [[UrtTransportMarshallerBuilder.marshaller]] - */ -@Singleton -class UrtTransportMarshaller @Inject() ( - timelineInstructionMarshaller: TimelineInstructionMarshaller, - feedbackActionMarshaller: FeedbackActionMarshaller, - childFeedbackActionMarshaller: ChildFeedbackActionMarshaller, - timelineMetadataMarshaller: TimelineMetadataMarshaller) - extends TransportMarshaller[Timeline, urt.TimelineResponse] { - - override val identifier: TransportMarshallerIdentifier = - TransportMarshallerIdentifier("UnifiedRichTimeline") - - override def apply(timeline: Timeline): urt.TimelineResponse = { - val feedbackActions: Option[Map[String, urt.FeedbackAction]] = { - collectAndMarshallFeedbackActions(timeline.instructions) - } - urt.TimelineResponse( - state = urt.TimelineState.Ok, - timeline = urt.Timeline( - id = timeline.id, - instructions = timeline.instructions.map(timelineInstructionMarshaller(_)), - responseObjects = - feedbackActions.map(actions => urt.ResponseObjects(feedbackActions = Some(actions))), - metadata = timeline.metadata.map(timelineMetadataMarshaller(_)) - ) - ) - } - - // Currently, feedbackActionInfo at the URT TimelineItem level is supported, which covers almost all - // existing use cases. However, if additional feedbackActionInfos are defined on the URT - // TimelineItemContent level for "compound" URT types (see deprecated TopicCollection / - // TopicCollectionData), this is not supported. If "compound" URT types are added in the future, - // support must be added within that type (see ModuleItem) to handle the collection and marshalling - // of these feedbackActionInfos. - - private[this] def collectAndMarshallFeedbackActions( - instructions: Seq[TimelineInstruction] - ): Option[Map[String, urt.FeedbackAction]] = { - val feedbackActions: Seq[FeedbackAction] = for { - feedbackActionInfos <- instructions.collect { - case c: ContainsFeedbackActionInfos => c.feedbackActionInfos - } - feedbackInfoOpt <- feedbackActionInfos - feedbackInfo <- feedbackInfoOpt.toSeq - feedbackAction <- feedbackInfo.feedbackActions - } yield feedbackAction - - if (feedbackActions.nonEmpty) { - val urtFeedbackActions = feedbackActions.map(feedbackActionMarshaller(_)) - - val urtChildFeedbackActions: Seq[urt.FeedbackAction] = for { - feedbackAction <- feedbackActions - childFeedbackActions <- feedbackAction.childFeedbackActions.toSeq - childFeedbackAction <- childFeedbackActions - } yield childFeedbackActionMarshaller(childFeedbackAction) - - val allUrtFeedbackActions = urtFeedbackActions ++ urtChildFeedbackActions - - Some( - allUrtFeedbackActions.map { urtAction => - FeedbackActionMarshaller.generateKey(urtAction) -> urtAction - }.toMap - ) - } else { - None - } - } -} - -object UrtTransportMarshaller { - def unavailable(timelineId: String): TimelineResponse = { - urt.TimelineResponse( - state = urt.TimelineState.Unavailable, - timeline = urt.Timeline( - id = timelineId, - instructions = Seq.empty, - responseObjects = None, - metadata = None - ) - ) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/UrtTransportMarshallerBuilder.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/UrtTransportMarshallerBuilder.docx new file mode 100644 index 000000000..d8f7cafd0 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/UrtTransportMarshallerBuilder.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/UrtTransportMarshallerBuilder.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/UrtTransportMarshallerBuilder.scala deleted file mode 100644 index 18447aa35..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/UrtTransportMarshallerBuilder.scala +++ /dev/null @@ -1,711 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt - -import com.twitter.product_mixer.core.functional_component.marshaller.response.graphql.contextual_ref.ContextualTweetRefMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.graphql.contextual_ref.OuterTweetContextMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.graphql.contextual_ref.TweetHydrationContextMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.rtf.safety_level.SafetyLevelMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.alert.ShowAlertColorConfigurationMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.alert.ShowAlertDisplayLocationMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.alert.ShowAlertIconDisplayInfoMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.alert.ShowAlertIconMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.alert.ShowAlertNavigationMetadataMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.alert.ShowAlertTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.button.ButtonStyleMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.button.CtaButtonMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.button.IconCtaButtonMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.button.TextCtaButtonMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.color.ColorMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.color.ColorPaletteMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.color.RosettaColorMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.commerce.CommerceProductGroupItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.commerce.CommerceProductItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.cover.CoverContentMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.cover.CoverCtaBehaviorMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.cover.CoverCtaMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.cover.CoverImageMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.cover.FullCoverContentMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.cover.FullCoverDisplayTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.cover.HalfCoverContentMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.cover.HalfCoverDisplayTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.icon.HorizonIconMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.article.ArticleDisplayTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.article.ArticleItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.article.ArticleSeedTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.audio_space.AudioSpaceItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.card.CardDisplayTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.card.CardItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.conversation_annotation.ConversationAnnotationMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.conversation_annotation.ConversationAnnotationTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.event.EventSummaryDisplayTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.event.EventSummaryItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.forward_pivot.ForwardPivotDisplayTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.forward_pivot.ForwardPivotMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.forward_pivot.SoftInterventionDisplayTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.generic_summary_item.GenericSummaryActionMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.generic_summary_item.GenericSummaryContextMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.generic_summary_item.GenericSummaryDisplayTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.generic_summary_item.GenericSummaryItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.highlight.HighlightedSectionMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.icon_label.IconLabelItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.label.LabelDisplayTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.label.LabelItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.message._ -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.moment.MomentAnnotationItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.prompt._ -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.suggestion.SpellingActionTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.suggestion.SpellingItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.suggestion.TextResultMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.thread.ThreadHeaderContentMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.thread.ThreadHeaderItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.tile.CallToActionTileContentMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.tile.StandardTileContentMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.tile.TileContentMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.tile.TileItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.tombstone.TombstoneDisplayTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.tombstone.TombstoneInfoMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.tombstone.TombstoneItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.topic.TopicDisplayTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.topic.TopicFollowPromptDisplayTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.topic.TopicFollowPromptItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.topic.TopicFunctionalityTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.topic.TopicItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.trend.TrendItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.tweet.TimelinesScoreInfoMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.tweet.TweetDisplayTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.tweet.TweetHighlightsMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.tweet.TweetItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.tweet_composer.TweetComposerDisplayTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.tweet_composer.TweetComposerItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.twitter_list.TwitterListDisplayTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.twitter_list.TwitterListItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.user.UserDisplayTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.user.UserItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.user.UserReactiveTriggersMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.vertical_grid_item.VerticalGridItemContentMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.vertical_grid_item.VerticalGridItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.vertical_grid_item.VerticalGridItemTileStyleMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.vertical_grid_item.VerticalGridItemTopicFunctionalityTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.vertical_grid_item.VerticalGridItemTopicTileMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.media.AspectRatioMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.media.BroadcastIdMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.media.MediaEntityMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.media.MediaKeyMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.media.MediaMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.media.RectMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.media.TweetMediaMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata._ -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.operation.CursorDisplayTreatmentMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.operation.CursorItemMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.operation.CursorOperationMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.operation.CursorTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.promoted.AdMetadataContainerMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.promoted.CallToActionMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.promoted.ClickTrackingInfoMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.promoted.DisclaimerTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.promoted.DisclosureTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.promoted.DynamicPrerollTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.promoted.MediaInfoMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.promoted.PrerollMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.promoted.PrerollMetadataMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.promoted.PromotedMetadataMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.promoted.SkAdNetworkDataMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.promoted.SponsorshipTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.promoted.UrlOverrideTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.promoted.VideoVariantsMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.reaction.TimelineReactionMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.richtext.ReferenceObjectMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.richtext.RichTextAlignmentMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.richtext.RichTextEntityMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.richtext.RichTextFormatMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.richtext.RichTextMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.timeline_module._ - -/** - * Convenience constructor for services not using dependency injection and unit tests. If using - * dependency injection, instead `@Inject` an instance of [[UrtTransportMarshaller]] to construct. - */ -object UrtTransportMarshallerBuilder { - val conversationSectionMarshaller = new ConversationSectionMarshaller - val conversationDetailsMarshaller = new ConversationDetailsMarshaller( - conversationSectionMarshaller) - val timelinesDetailsMarshaller = new TimelinesDetailsMarshaller - val articleDetailsMarshaller = new ArticleDetailsMarshaller - val liveEventDetailsMarshaller = new LiveEventDetailsMarshaller - val commerceDetailsMarshaller = new CommerceDetailsMarshaller - val clientEventDetailsMarshaller = - new ClientEventDetailsMarshaller( - conversationDetailsMarshaller, - timelinesDetailsMarshaller, - articleDetailsMarshaller, - liveEventDetailsMarshaller, - commerceDetailsMarshaller) - val clientEventInfoMarshaller = new ClientEventInfoMarshaller(clientEventDetailsMarshaller) - - val feedbackTypeMarshaller = new FeedbackTypeMarshaller - val confirmationDisplayTypeMarshaller = new ConfirmationDisplayTypeMarshaller - val horizonIconMarshaller = new HorizonIconMarshaller - val richFeedbackBehaviorMarshaller = new RichFeedbackBehaviorMarshaller - val childFeedbackActionMarshaller = new ChildFeedbackActionMarshaller( - feedbackTypeMarshaller = feedbackTypeMarshaller, - confirmationDisplayTypeMarshaller = confirmationDisplayTypeMarshaller, - clientEventInfoMarshaller = clientEventInfoMarshaller, - horizonIconMarshaller = horizonIconMarshaller, - richFeedbackBehaviorMarshaller = richFeedbackBehaviorMarshaller - ) - val feedbackActionMarshaller = new FeedbackActionMarshaller( - childFeedbackActionMarshaller = childFeedbackActionMarshaller, - feedbackTypeMarshaller = feedbackTypeMarshaller, - confirmationDisplayTypeMarshaller = confirmationDisplayTypeMarshaller, - clientEventInfoMarshaller = clientEventInfoMarshaller, - horizonIconMarshaller = horizonIconMarshaller, - richFeedbackBehaviorMarshaller = richFeedbackBehaviorMarshaller - ) - val feedbackDisplayContextMarshaller = new FeedbackDisplayContextMarshaller - val feedbackInfoMarshaller = new FeedbackInfoMarshaller( - feedbackActionMarshaller = feedbackActionMarshaller, - feedbackDisplayContextMarshaller = feedbackDisplayContextMarshaller, - clientEventInfoMarshaller = clientEventInfoMarshaller - ) - - val urlTypeMarshaller = new UrlTypeMarshaller - val urtEndpointOptionsMarshaller = new UrtEndpointOptionsMarshaller - val urlMarshaller = new UrlMarshaller( - urlTypeMarshaller = urlTypeMarshaller, - urtEndpointOptionsMarshaller = urtEndpointOptionsMarshaller - ) - val referenceObjectMarshaller = new ReferenceObjectMarshaller(urlMarshaller) - val richTextFormatMarshaller = new RichTextFormatMarshaller - val richTextEntityMarshaller = - new RichTextEntityMarshaller(referenceObjectMarshaller, richTextFormatMarshaller) - val richTextAlignmentMarshaller = new RichTextAlignmentMarshaller - val richTextMarshaller = - new RichTextMarshaller(richTextEntityMarshaller, richTextAlignmentMarshaller) - - val tombstoneInfoMarshaller = new TombstoneInfoMarshaller(richTextMarshaller = richTextMarshaller) - - val generalContextTypeMarshaller = new GeneralContextTypeMarshaller - val generalContextMarshaller = new GeneralContextMarshaller( - generalContextTypeMarshaller = generalContextTypeMarshaller, - urlMarshaller = urlMarshaller - ) - - val timelineReactionMarshaller = new TimelineReactionMarshaller - - val topicContextMarshaller = new TopicContextMarshaller() - - val socialContextMarshaller = new SocialContextMarshaller( - generalContextMarshaller = generalContextMarshaller, - topicContextMarshaller = topicContextMarshaller - ) - - val highlightedSectionMarshaller = new HighlightedSectionMarshaller() - val tweetHighlightsMarshaller = new TweetHighlightsMarshaller(highlightedSectionMarshaller) - - val topicDisplayTypeMarshaller = new TopicDisplayTypeMarshaller - val topicFunctionalityTypeMarshaller = new TopicFunctionalityTypeMarshaller - val topicItemMarshaller = new TopicItemMarshaller( - displayTypeMarshaller = topicDisplayTypeMarshaller, - functionalityTypeMarshaller = topicFunctionalityTypeMarshaller - ) - - val topicFollowPromptDisplayTypeMarshaller = new TopicFollowPromptDisplayTypeMarshaller - val topicFollowPromptItemMarshaller = new TopicFollowPromptItemMarshaller( - displayTypeMarshaller = topicFollowPromptDisplayTypeMarshaller - ) - - val rosettaColorMarshaller = new RosettaColorMarshaller() - val badgeMarshaller = new BadgeMarshaller( - rosettaColorMarshaller = rosettaColorMarshaller - ) - val iconCtaButtonMarshaller = new IconCtaButtonMarshaller(horizonIconMarshaller, urlMarshaller) - val textCtaButtonMarshaller = new TextCtaButtonMarshaller(urlMarshaller) - val ctaButtonMarshaller = - new CtaButtonMarshaller(iconCtaButtonMarshaller, textCtaButtonMarshaller) - - val standardTileContentMarshaller = new StandardTileContentMarshaller( - badgeMarshaller = badgeMarshaller - ) - val callToActionTileContentMarshaller = new CallToActionTileContentMarshaller( - ctaButtonMarshaller = ctaButtonMarshaller, - richTextMarshaller = richTextMarshaller - ) - - val tileContentMarshaller = new TileContentMarshaller( - standardTileContentMarshaller = standardTileContentMarshaller, - callToActionTileContentMarshaller = callToActionTileContentMarshaller - ) - val colorMarshaller = new ColorMarshaller() - val colorPaletteMarshaller = new ColorPaletteMarshaller( - colorMarshaller = colorMarshaller - ) - val imageVariantMarshaller = new ImageVariantMarshaller( - colorPaletteMarshaller = colorPaletteMarshaller - ) - val imageDisplayTypeMarshaller = new ImageDisplayTypeMarshaller() - val imageAnimationTypeMarshaller = new ImageAnimationTypeMarshaller() - - val softInterventionDisplayTypeMarshaller = new SoftInterventionDisplayTypeMarshaller - val forwardPivotDisplayTypeMarshaller = new ForwardPivotDisplayTypeMarshaller - val forwardPivotMarshaller = new ForwardPivotMarshaller( - urlMarshaller = urlMarshaller, - richTextMarshaller = richTextMarshaller, - forwardPivotDisplayTypeMarshaller = forwardPivotDisplayTypeMarshaller, - imageVariantMarshaller = imageVariantMarshaller, - badgeMarshaller = badgeMarshaller, - rosettaColorMarshaller = rosettaColorMarshaller, - softInterventionDisplayTypeMarshaller = softInterventionDisplayTypeMarshaller - ) - - val tweetDisplayTypeMarshaller = new TweetDisplayTypeMarshaller - val timelinesScoreInfoMarshaller = new TimelinesScoreInfoMarshaller - val disclosureTypeMarshaller = new DisclosureTypeMarshaller - val dynamicPrerollTypeMarshaller = new DynamicPrerollTypeMarshaller - val callToActionMarshaller = new CallToActionMarshaller - val videoVariantsMarshaller = new VideoVariantsMarshaller - val mediaInfoMarshaller = new MediaInfoMarshaller( - callToActionMarshaller = callToActionMarshaller, - videoVariantsMarshaller = videoVariantsMarshaller - ) - val prerollMarshaller = new PrerollMarshaller( - dynamicPrerollTypeMarshaller = dynamicPrerollTypeMarshaller, - mediaInfoMarshaller = mediaInfoMarshaller - ) - val sponsorshipTypeMarshaller = new SponsorshipTypeMarshaller - val disclaimerTypeMarshaller = new DisclaimerTypeMarshaller - val skAdNetworkDataMarshaller = new SkAdNetworkDataMarshaller - val adMetadataContainerMarshaller = new AdMetadataContainerMarshaller( - sponsorshipTypeMarshaller = sponsorshipTypeMarshaller, - disclaimerTypeMarshaller = disclaimerTypeMarshaller, - skAdNetworkDataMarshaller = skAdNetworkDataMarshaller - ) - val urlOverrideTypeMarshaller = new UrlOverrideTypeMarshaller - val clickTrackingInfoMarshaller = new ClickTrackingInfoMarshaller( - urlOverrideTypeMarshaller = urlOverrideTypeMarshaller - ) - val promotedMetadataMarshaller = new PromotedMetadataMarshaller( - disclosureTypeMarshaller = disclosureTypeMarshaller, - adMetadataContainerMarshaller = adMetadataContainerMarshaller, - clickTrackingInfoMarshaller = clickTrackingInfoMarshaller - ) - - val conversationAnnotationTypeMarshaller = new ConversationAnnotationTypeMarshaller - val conversationAnnotationMarshaller = new ConversationAnnotationMarshaller( - conversationAnnotationTypeMarshaller = conversationAnnotationTypeMarshaller, - richTextMarshaller = richTextMarshaller - ) - - val safetyLevelMarshaller = new SafetyLevelMarshaller - val outerTweetContextMarshaller = new OuterTweetContextMarshaller - val tweetHydrationContextMarshaller = new TweetHydrationContextMarshaller( - safetyLevelMarshaller = safetyLevelMarshaller, - outerTweetContextMarshaller = outerTweetContextMarshaller - ) - val contextualTweetRefMarshaller = new ContextualTweetRefMarshaller( - tweetHydrationContextMarshaller = tweetHydrationContextMarshaller - ) - val prerollMetadataMarshaller = new PrerollMetadataMarshaller( - prerollMarshaller = prerollMarshaller - ) - - val rectMarshaller = new RectMarshaller - val mediaKeyMarshaller = new MediaKeyMarshaller - val broadcastIdMarshaller = new BroadcastIdMarshaller - val tweetMediaMarshaller = new TweetMediaMarshaller - val mediaEntityMarshaller = new MediaEntityMarshaller( - tweetMediaMarshaller = tweetMediaMarshaller, - broadcastIdMarshaller = broadcastIdMarshaller, - imageVariantMarshaller = imageVariantMarshaller) - val aspectRatioMarshaller = new AspectRatioMarshaller - val mediaMarshaller = new MediaMarshaller( - mediaEntityMarshaller = mediaEntityMarshaller, - mediaKeyMarshaller = mediaKeyMarshaller, - rectMarshaller = rectMarshaller, - aspectRatioMarshaller = aspectRatioMarshaller) - - val tweetItemMarshaller = new TweetItemMarshaller( - tweetDisplayTypeMarshaller = tweetDisplayTypeMarshaller, - socialContextMarshaller = socialContextMarshaller, - tweetHighlightsMarshaller = tweetHighlightsMarshaller, - tombstoneInfoMarshaller = tombstoneInfoMarshaller, - timelinesScoreInfoMarshaller = timelinesScoreInfoMarshaller, - forwardPivotMarshaller = forwardPivotMarshaller, - promotedMetadataMarshaller = promotedMetadataMarshaller, - conversationAnnotationMarshaller = conversationAnnotationMarshaller, - contextualTweetRefMarshaller = contextualTweetRefMarshaller, - prerollMetadataMarshaller = prerollMetadataMarshaller, - badgeMarshaller = badgeMarshaller, - urlMarshaller = urlMarshaller - ) - - val eventSummaryDisplayTypeMarshaller = new EventSummaryDisplayTypeMarshaller - val eventSummaryItemMarshaller = new EventSummaryItemMarshaller( - eventSummaryDisplayTypeMarshaller = eventSummaryDisplayTypeMarshaller, - imageVariantMarshaller = imageVariantMarshaller, - urlMarshaller = urlMarshaller - ) - - val trendItemMarshaller = new TrendItemMarshaller( - promotedMetadataMarshaller = promotedMetadataMarshaller, - urlMarshaller = urlMarshaller - ) - - val userDisplayTypeMarshaller = new UserDisplayTypeMarshaller - val userReactiveTriggersMarshaller = new UserReactiveTriggersMarshaller( - timelineReactionMarshaller) - val userItemMarshaller = new UserItemMarshaller( - userDisplayTypeMarshaller = userDisplayTypeMarshaller, - promotedMetadataMarshaller = promotedMetadataMarshaller, - socialContextMarshaller = socialContextMarshaller, - userReactiveTriggersMarshaller = userReactiveTriggersMarshaller, - ) - - val verticalGridItemTileStyleMarshaller = new VerticalGridItemTileStyleMarshaller - val verticalGridItemTopicFunctionalityTypeMarshaller = - new VerticalGridItemTopicFunctionalityTypeMarshaller - - val verticalGridItemTopicTileMarshaller = new VerticalGridItemTopicTileMarshaller( - styleMarshaller = verticalGridItemTileStyleMarshaller, - functionalityTypeMarshaller = verticalGridItemTopicFunctionalityTypeMarshaller, - urlMarshaller = urlMarshaller - ) - - val verticalGridItemContentMarshaller = new VerticalGridItemContentMarshaller( - verticalGridItemTopicTileMarshaller) - - val verticalGridItemMarshaller = new VerticalGridItemMarshaller(verticalGridItemContentMarshaller) - - val tombstoneDisplayTypeMarshaller = new TombstoneDisplayTypeMarshaller - val tombstoneItemMarshaller = new TombstoneItemMarshaller( - displayTypeMarshaller = tombstoneDisplayTypeMarshaller, - tombstoneInfoMarshaller = tombstoneInfoMarshaller, - tweetItemMarshaller = tweetItemMarshaller) - - val iconLabelItemMarshaller = new IconLabelItemMarshaller( - richTextMarshaller, - horizonIconMarshaller - ) - - val labelDisplayTypeMarshaller = new LabelDisplayTypeMarshaller - val labelItemMarshaller = new LabelItemMarshaller( - displayTypeMarshaller = labelDisplayTypeMarshaller, - urlMarshaller = urlMarshaller - ) - - val tileItemMarshaller = new TileItemMarshaller( - tileContentMarshaller = tileContentMarshaller, - urlMarshaller = urlMarshaller, - imageVariantMarshaller = imageVariantMarshaller - ) - - val callbackMarshaller = new CallbackMarshaller - val messageActionMarshaller = new MessageActionMarshaller( - callbackMarshaller, - clientEventInfoMarshaller - ) - val messageTextActionMarshaller = new MessageTextActionMarshaller(messageActionMarshaller) - val messageImageMarshaller = new MessageImageMarshaller( - imageVariantMarshaller - ) - val userFacepileDisplayTypeMarshaller = new UserFacepileDisplayTypeMarshaller() - val messageActionTypeMarshaller = new MessageActionTypeMarshaller() - val userFacepileMarshaller = new UserFacepileMarshaller( - messageActionTypeMarshaller, - messageTextActionMarshaller, - userFacepileDisplayTypeMarshaller - ) - val inlinePromptMessageContentMarshaller = new InlinePromptMessageContentMarshaller( - messageTextActionMarshaller = messageTextActionMarshaller, - richTextMarshaller = richTextMarshaller, - socialContextMarshaller = socialContextMarshaller, - userFacepileMarshaller = userFacepileMarshaller - ) - val headerImagePromptMessageContentMarshaller = new HeaderImagePromptMessageContentMarshaller( - messageImageMarshaller = messageImageMarshaller, - messageTextActionMarshaller = messageTextActionMarshaller, - messageActionMarshaller = messageActionMarshaller, - richTextMarshaller = richTextMarshaller - ) - val compactPromptMessageContentMarshaller = new CompactPromptMessageContentMarshaller( - messageTextActionMarshaller = messageTextActionMarshaller, - messageActionMarshaller = messageActionMarshaller, - richTextMarshaller = richTextMarshaller - ) - val messageContentMarshaller = new MessageContentMarshaller( - inlinePromptMessageContentMarshaller = inlinePromptMessageContentMarshaller, - headerImagePromptMessageContentMarshaller = headerImagePromptMessageContentMarshaller, - compactPromptMessageContentMarshaller = compactPromptMessageContentMarshaller - ) - val messagePromptItemMarshaller = new MessagePromptItemMarshaller( - messageContentMarshaller = messageContentMarshaller, - callbackMarshaller = callbackMarshaller - ) - - val tweetComposerDisplayTypeMarshaller = new TweetComposerDisplayTypeMarshaller - val tweetComposerItemMarshaller = new TweetComposerItemMarshaller( - tweetComposerDisplayTypeMarshaller = tweetComposerDisplayTypeMarshaller, - urlMarshaller = urlMarshaller - ) - - val cursorTypeMarshaller = new CursorTypeMarshaller - val cursorDisplayTreatmentMarshaller = new CursorDisplayTreatmentMarshaller - val cursorItemMarshaller = new CursorItemMarshaller( - cursorTypeMarshaller = cursorTypeMarshaller, - cursorDisplayTreatmentMarshaller = cursorDisplayTreatmentMarshaller) - val articleDisplayTypeMarshaller = new ArticleDisplayTypeMarshaller - val articleSeedTypeMarshaller = new ArticleSeedTypeMarshaller - val articleItemMarshaller = - new ArticleItemMarshaller( - articleDisplayTypeMarshaller, - socialContextMarshaller, - articleSeedTypeMarshaller) - val audioSpaceItemMarshaller = new AudioSpaceItemMarshaller - val cardDisplayTypeMarshaller = new CardDisplayTypeMarshaller - val cardItemMarshaller = new CardItemMarshaller( - cardDisplayTypeMarshaller = cardDisplayTypeMarshaller, - urlMarshaller = urlMarshaller - ) - - val twitterListDisplayTypeMarshaller = new TwitterListDisplayTypeMarshaller - val twitterListItemMarshaller = new TwitterListItemMarshaller( - twitterListDisplayTypeMarshaller = twitterListDisplayTypeMarshaller) - - val threadHeaderItemMarshaller = new ThreadHeaderItemMarshaller( - threadHeaderContentMarshaller = new ThreadHeaderContentMarshaller - ) - - val relevancePromptFollowUpTextInputMarshaller = new RelevancePromptFollowUpTextInputMarshaller( - callbackMarshaller = callbackMarshaller - ) - val relevancePromptFollowUpFeedbackTypeMarshaller = - new RelevancePromptFollowUpFeedbackTypeMarshaller( - relevancePromptFollowUpTextInputMarshaller = relevancePromptFollowUpTextInputMarshaller - ) - val relevancePromptDisplayTypeMarshaller = new RelevancePromptDisplayTypeMarshaller - val relevancePromptContentMarshaller = new RelevancePromptContentMarshaller( - callbackMarshaller = callbackMarshaller, - relevancePromptDisplayTypeMarshaller = relevancePromptDisplayTypeMarshaller, - relevancePromptFollowUpFeedbackTypeMarshaller = relevancePromptFollowUpFeedbackTypeMarshaller - ) - val promptContentMarshaller = new PromptContentMarshaller( - relevancePromptContentMarshaller = relevancePromptContentMarshaller - ) - val promptItemMarshaller = new PromptItemMarshaller( - promptContentMarshaller = promptContentMarshaller, - clientEventInfoMarshaller = clientEventInfoMarshaller, - callbackMarshaller = callbackMarshaller - ) - - val textResultMarshaller = new TextResultMarshaller(highlightedSectionMarshaller) - val spellingActionTypeMarshaller = new SpellingActionTypeMarshaller() - val spellingItemMarshaller = new SpellingItemMarshaller( - textResultMarshaller = textResultMarshaller, - spellingActionTypeMarshaller = spellingActionTypeMarshaller) - - val momentAnnotationItemMarshaller = new MomentAnnotationItemMarshaller(richTextMarshaller) - - val genericSummaryDisplayTypeMarshaller = new GenericSummaryDisplayTypeMarshaller - val genericSummaryActionMarshaller = new GenericSummaryActionMarshaller( - urlMarshaller = urlMarshaller, - clientEventInfoMarshaller = clientEventInfoMarshaller) - val genericSummaryContextMarshaller = new GenericSummaryContextMarshaller( - richTextMarshaller = richTextMarshaller, - horizonIconMarshaller = horizonIconMarshaller - ) - val genericSummaryItemMarshaller = new GenericSummaryItemMarshaller( - genericSummaryDisplayTypeMarshaller = genericSummaryDisplayTypeMarshaller, - genericSummaryContextMarshaller = genericSummaryContextMarshaller, - genericSummaryActionMarshaller = genericSummaryActionMarshaller, - mediaMarshaller = mediaMarshaller, - promotedMetadataMarshaller = promotedMetadataMarshaller, - richTextMarshaller = richTextMarshaller - ) - - val commerceProductItemMarshaller = new CommerceProductItemMarshaller - val commerceProductGroupItemMarshaller = new CommerceProductGroupItemMarshaller - - val timelineItemMarshaller = new TimelineItemMarshaller( - timelineItemContentMarshaller = new TimelineItemContentMarshaller( - articleItemMarshaller = articleItemMarshaller, - audioSpaceItemMarshaller = audioSpaceItemMarshaller, - cardItemMarshaller = cardItemMarshaller, - cursorItemMarshaller = cursorItemMarshaller, - eventSummaryItemMarshaller = eventSummaryItemMarshaller, - iconLabelItemMarshaller = iconLabelItemMarshaller, - labelItemMarshaller = labelItemMarshaller, - messagePromptItemMarshaller = messagePromptItemMarshaller, - tileItemMarshaller = tileItemMarshaller, - tombstoneItemMarshaller = tombstoneItemMarshaller, - topicFollowPromptItemMarshaller = topicFollowPromptItemMarshaller, - topicItemMarshaller = topicItemMarshaller, - tweetComposerItemMarshaller = tweetComposerItemMarshaller, - tweetItemMarshaller = tweetItemMarshaller, - twitterListItemMarshaller = twitterListItemMarshaller, - userItemMarshaller = userItemMarshaller, - verticalGridItemMarshaller = verticalGridItemMarshaller, - threadHeaderItemMarshaller = threadHeaderItemMarshaller, - promptItemMarshaller = promptItemMarshaller, - spellingItemMarshaller = spellingItemMarshaller, - momentAnnotationItemMarshaller = momentAnnotationItemMarshaller, - genericSummaryItemMarshaller = genericSummaryItemMarshaller, - commerceProductItemMarshaller = commerceProductItemMarshaller, - commerceProductGroupItemMarshaller = commerceProductGroupItemMarshaller, - trendItemMarshaller = trendItemMarshaller - ), - clientEventInfoMarshaller = clientEventInfoMarshaller, - feedbackInfoMarshaller = feedbackInfoMarshaller - ) - - val moduleDisplayTypeMarshaller = new ModuleDisplayTypeMarshaller - val moduleItemTreeDisplayMarshaller = - new ModuleItemTreeDisplayMarshaller(moduleDisplayTypeMarshaller) - - val moduleItemMarshaller = new ModuleItemMarshaller( - timelineItemMarshaller = timelineItemMarshaller, - moduleItemTreeDisplayMarshaller = moduleItemTreeDisplayMarshaller) - - val moduleHeaderDisplayTypeMarshaller = new ModuleHeaderDisplayTypeMarshaller - val moduleHeaderMarshaller = new ModuleHeaderMarshaller( - horizonIconMarshaller = horizonIconMarshaller, - imageVariantMarshaller = imageVariantMarshaller, - socialContextMarshaller = socialContextMarshaller, - moduleHeaderDisplayTypeMarshaller = moduleHeaderDisplayTypeMarshaller - ) - val moduleFooterMarshaller = new ModuleFooterMarshaller(urlMarshaller = urlMarshaller) - val adsMetadataMarshaller = new AdsMetadataMarshaller - val moduleConversationMetadataMarshaller = new ModuleConversationMetadataMarshaller( - socialContextMarshaller = socialContextMarshaller) - val gridCarouselMetadataMarshaller = new GridCarouselMetadataMarshaller - val moduleMetadataMarshaller = new ModuleMetadataMarshaller( - adsMetadataMarshaller = adsMetadataMarshaller, - moduleConversationMetadataMarshaller = moduleConversationMetadataMarshaller, - gridCarouselMetadataMarshaller = gridCarouselMetadataMarshaller - ) - val moduleShowMoreBehaviorRevealByCountMarshaller = - new ModuleShowMoreBehaviorRevealByCountMarshaller - val moduleShowMoreBehaviorMarshaller = new ModuleShowMoreBehaviorMarshaller( - moduleShowMoreBehaviorRevealByCountMarshaller = moduleShowMoreBehaviorRevealByCountMarshaller - ) - val timelineModuleMarshaller = new TimelineModuleMarshaller( - moduleItemMarshaller = moduleItemMarshaller, - moduleDisplayTypeMarshaller = moduleDisplayTypeMarshaller, - moduleHeaderMarshaller = moduleHeaderMarshaller, - moduleFooterMarshaller = moduleFooterMarshaller, - clientEventInfoMarshaller = clientEventInfoMarshaller, - feedbackInfoMarshaller = feedbackInfoMarshaller, - moduleMetadataMarshaller = moduleMetadataMarshaller, - moduleShowMoreBehaviorMarshaller = moduleShowMoreBehaviorMarshaller - ) - - val halfCoverDisplayTypeMarshaller = new HalfCoverDisplayTypeMarshaller() - val fullCoverDisplayTypeMarshaller = new FullCoverDisplayTypeMarshaller() - val coverCtaBehaviorMarshaller = new CoverCtaBehaviorMarshaller(richTextMarshaller, urlMarshaller) - val buttonStyleMarshaller = new ButtonStyleMarshaller() - val coverCtaMarshaller = new CoverCtaMarshaller( - coverCtaBehaviorMarshaller, - callbackMarshaller, - clientEventInfoMarshaller, - horizonIconMarshaller, - buttonStyleMarshaller) - val coverImageMarshaller = - new CoverImageMarshaller( - imageVariantMarshaller, - imageDisplayTypeMarshaller, - imageAnimationTypeMarshaller) - val dismissInfoMarshaller = new DismissInfoMarshaller(callbackMarshaller) - - val halfCoverContentMarshaller = new HalfCoverContentMarshaller( - halfCoverDisplayTypeMarshaller, - coverCtaMarshaller, - richTextMarshaller, - coverImageMarshaller, - dismissInfoMarshaller, - callbackMarshaller) - val fullCoverContentMarshaller = new FullCoverContentMarshaller( - fullCoverDisplayTypeMarshaller, - coverCtaMarshaller, - richTextMarshaller, - imageVariantMarshaller, - dismissInfoMarshaller, - imageDisplayTypeMarshaller, - callbackMarshaller) - val coverContentMarshaller = - new CoverContentMarshaller(fullCoverContentMarshaller, halfCoverContentMarshaller) - val coverMarshaller = new CoverMarshaller(coverContentMarshaller, clientEventInfoMarshaller) - - val cursorOperationMarshaller = new CursorOperationMarshaller( - cursorTypeMarshaller = cursorTypeMarshaller, - cursorDisplayTreatmentMarshaller = cursorDisplayTreatmentMarshaller) - val timelineOperationMarshaller = new TimelineOperationMarshaller( - cursorOperationMarshaller = cursorOperationMarshaller) - - val timelineEntryMarshaller = new TimelineEntryMarshaller( - timelineEntryContentMarshaller = new TimelineEntryContentMarshaller( - timelineItemMarshaller = timelineItemMarshaller, - timelineModuleMarshaller = timelineModuleMarshaller, - timelineOperationMarshaller = timelineOperationMarshaller)) - - val addEntriesInstructionMarshaller = new AddEntriesInstructionMarshaller( - timelineEntryMarshaller = timelineEntryMarshaller) - - val markEntriesUnreadInstructionMarshaller = new MarkEntriesUnreadInstructionMarshaller() - - val addToModuleInstructionMarshaller = new AddToModuleInstructionMarshaller( - moduleItemMarshaller = moduleItemMarshaller) - - val replaceEntryInstructionMarshaller = new ReplaceEntryInstructionMarshaller( - timelineEntryMarshaller = timelineEntryMarshaller - ) - - val pinEntryInstructionMarshaller = new PinEntryInstructionMarshaller( - timelineEntryMarshaller = timelineEntryMarshaller - ) - - val showAlertTypeMarshaller = new ShowAlertTypeMarshaller() - val showAlertIconMarshaller = new ShowAlertIconMarshaller() - val showAlertIconDisplayInfoMarshaller = new ShowAlertIconDisplayInfoMarshaller( - showAlertIconMarshaller = showAlertIconMarshaller, - rosettaColorMarshaller = rosettaColorMarshaller - ) - val showAlertColorConfigurationMarshaller = new ShowAlertColorConfigurationMarshaller( - rosettaColorMarshaller = rosettaColorMarshaller - ) - val showAlertDisplayLocationMarshaller = new ShowAlertDisplayLocationMarshaller() - val showAlertNavigationMetadataMarshaller = new ShowAlertNavigationMetadataMarshaller() - val showAlertInstructionMarshaller = new ShowAlertInstructionMarshaller( - showAlertTypeMarshaller = new ShowAlertTypeMarshaller(), - clientEventInfoMarshaller = clientEventInfoMarshaller, - richTextMarshaller = richTextMarshaller, - showAlertIconDisplayInfoMarshaller = showAlertIconDisplayInfoMarshaller, - showAlertColorConfigurationMarshaller = showAlertColorConfigurationMarshaller, - showAlertDisplayLocationMarshaller = showAlertDisplayLocationMarshaller, - showAlertNavigationMetadataMarshaller = showAlertNavigationMetadataMarshaller - ) - - val timelineInstructionMarshaller = new TimelineInstructionMarshaller( - addEntriesInstructionMarshaller = addEntriesInstructionMarshaller, - addToModuleInstructionMarshaller = addToModuleInstructionMarshaller, - markEntriesUnreadInstructionMarshaller = markEntriesUnreadInstructionMarshaller, - pinEntryInstructionMarshaller = pinEntryInstructionMarshaller, - replaceEntryInstructionMarshaller = replaceEntryInstructionMarshaller, - showAlertInstructionMarshaller = showAlertInstructionMarshaller, - terminateTimelineInstructionMarshaller = new TerminateTimelineInstructionMarshaller, - coverMarshaller = coverMarshaller, - ) - - val timelineScribeConfigMarshaller = new TimelineScribeConfigMarshaller - - val readerModeConfigMarshaller = new ReaderModeConfigMarshaller(urlMarshaller) - - val timelineMetadataMarshaller = new TimelineMetadataMarshaller( - timelineScribeConfigMarshaller = timelineScribeConfigMarshaller, - readerModeConfigMarshaller = readerModeConfigMarshaller - ) - - val marshaller: UrtTransportMarshaller = - new UrtTransportMarshaller( - timelineInstructionMarshaller = timelineInstructionMarshaller, - feedbackActionMarshaller = feedbackActionMarshaller, - childFeedbackActionMarshaller = childFeedbackActionMarshaller, - timelineMetadataMarshaller = timelineMetadataMarshaller - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/BUILD b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/BUILD deleted file mode 100644 index 62f1b9de1..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/BUILD +++ /dev/null @@ -1,25 +0,0 @@ -scala_library( - sources = ["*.scala"], - compiler_option_sets = ["fatal_warnings"], - platform = "java8", - strict_deps = True, - tags = ["bazel-compatible"], - dependencies = [ - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/color", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/urt/alert", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/urt/metadata", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/urt/richtext", - "src/thrift/com/twitter/timelines/render:thrift-scala", - "util/util-core:util-core-util", - ], - exports = [ - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/color", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/urt/alert", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/urt/metadata", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/urt/richtext", - "src/thrift/com/twitter/timelines/render:thrift-scala", - "util/util-core:util-core-util", - ], -) diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/BUILD.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/BUILD.docx new file mode 100644 index 000000000..5f3d4ca7f Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/BUILD.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertColorConfigurationMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertColorConfigurationMarshaller.docx new file mode 100644 index 000000000..b03ff15e2 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertColorConfigurationMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertColorConfigurationMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertColorConfigurationMarshaller.scala deleted file mode 100644 index e1b5cb7f1..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertColorConfigurationMarshaller.scala +++ /dev/null @@ -1,19 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.alert - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.color.RosettaColorMarshaller -import javax.inject.Inject -import javax.inject.Singleton -import com.twitter.product_mixer.core.model.marshalling.response.urt.alert.ShowAlertColorConfiguration -import com.twitter.timelines.render.{thriftscala => urt} - -@Singleton -class ShowAlertColorConfigurationMarshaller @Inject() ( - rosettaColorMarshaller: RosettaColorMarshaller) { - - def apply(colorConfiguration: ShowAlertColorConfiguration): urt.ShowAlertColorConfiguration = - urt.ShowAlertColorConfiguration( - background = rosettaColorMarshaller(colorConfiguration.background), - text = rosettaColorMarshaller(colorConfiguration.text), - border = colorConfiguration.border.map(rosettaColorMarshaller(_)), - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertDisplayLocationMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertDisplayLocationMarshaller.docx new file mode 100644 index 000000000..ef3366ae6 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertDisplayLocationMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertDisplayLocationMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertDisplayLocationMarshaller.scala deleted file mode 100644 index 8e7c979cb..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertDisplayLocationMarshaller.scala +++ /dev/null @@ -1,19 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.alert - -import com.twitter.product_mixer.core.model.marshalling.response.urt.alert.ShowAlertDisplayLocation -import com.twitter.product_mixer.core.model.marshalling.response.urt.alert.Top -import com.twitter.product_mixer.core.model.marshalling.response.urt.alert.Bottom -import javax.inject.Inject -import javax.inject.Singleton -import com.twitter.timelines.render.{thriftscala => urt} - -@Singleton -class ShowAlertDisplayLocationMarshaller @Inject() () { - - def apply(alertDisplayLocation: ShowAlertDisplayLocation): urt.ShowAlertDisplayLocation = - alertDisplayLocation match { - case Top => urt.ShowAlertDisplayLocation.Top - case Bottom => urt.ShowAlertDisplayLocation.Bottom - } - -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertIconDisplayInfoMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertIconDisplayInfoMarshaller.docx new file mode 100644 index 000000000..ef016f212 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertIconDisplayInfoMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertIconDisplayInfoMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertIconDisplayInfoMarshaller.scala deleted file mode 100644 index 9be91f48b..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertIconDisplayInfoMarshaller.scala +++ /dev/null @@ -1,21 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.alert - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.color.RosettaColorMarshaller -import javax.inject.Inject -import javax.inject.Singleton -import com.twitter.timelines.render.{thriftscala => urt} -import com.twitter.product_mixer.core.model.marshalling.response.urt.alert.ShowAlertIconDisplayInfo - -@Singleton -class ShowAlertIconDisplayInfoMarshaller @Inject() ( - showAlertIconMarshaller: ShowAlertIconMarshaller, - rosettaColorMarshaller: RosettaColorMarshaller, -) { - - def apply(alertIconDisplayInfo: ShowAlertIconDisplayInfo): urt.ShowAlertIconDisplayInfo = - urt.ShowAlertIconDisplayInfo( - icon = showAlertIconMarshaller(alertIconDisplayInfo.icon), - tint = rosettaColorMarshaller(alertIconDisplayInfo.tint), - ) - -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertIconMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertIconMarshaller.docx new file mode 100644 index 000000000..d0fff03f7 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertIconMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertIconMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertIconMarshaller.scala deleted file mode 100644 index 91cef4d86..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertIconMarshaller.scala +++ /dev/null @@ -1,17 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.alert - -import com.twitter.product_mixer.core.model.marshalling.response.urt.alert.DownArrow -import com.twitter.product_mixer.core.model.marshalling.response.urt.alert.ShowAlertIcon -import com.twitter.product_mixer.core.model.marshalling.response.urt.alert.UpArrow -import javax.inject.Inject -import javax.inject.Singleton -import com.twitter.timelines.render.{thriftscala => urt} - -@Singleton -class ShowAlertIconMarshaller @Inject() () { - - def apply(alertIcon: ShowAlertIcon): urt.ShowAlertIcon = alertIcon match { - case UpArrow => urt.ShowAlertIcon.UpArrow - case DownArrow => urt.ShowAlertIcon.DownArrow - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertNavigationMetadataMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertNavigationMetadataMarshaller.docx new file mode 100644 index 000000000..d3dc8f210 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertNavigationMetadataMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertNavigationMetadataMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertNavigationMetadataMarshaller.scala deleted file mode 100644 index f8daff191..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertNavigationMetadataMarshaller.scala +++ /dev/null @@ -1,14 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.alert - -import com.twitter.product_mixer.core.model.marshalling.response.urt.alert.ShowAlertNavigationMetadata -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class ShowAlertNavigationMetadataMarshaller @Inject() () { - - def apply(alertNavigationMetadata: ShowAlertNavigationMetadata): urt.ShowAlertNavigationMetadata = - urt.ShowAlertNavigationMetadata(navigateToEntryId = - Some(alertNavigationMetadata.navigateToEntryId)) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertTypeMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertTypeMarshaller.docx new file mode 100644 index 000000000..9afee4a24 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertTypeMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertTypeMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertTypeMarshaller.scala deleted file mode 100644 index 83ae14c3f..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/alert/ShowAlertTypeMarshaller.scala +++ /dev/null @@ -1,17 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.alert - -import com.twitter.product_mixer.core.model.marshalling.response.urt.alert.Navigate -import com.twitter.product_mixer.core.model.marshalling.response.urt.alert.NewTweets -import com.twitter.product_mixer.core.model.marshalling.response.urt.alert.ShowAlertType -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class ShowAlertTypeMarshaller @Inject() () { - - def apply(alertType: ShowAlertType): urt.AlertType = alertType match { - case NewTweets => urt.AlertType.NewTweets - case Navigate => urt.AlertType.Navigate - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button/BUILD b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button/BUILD deleted file mode 100644 index 43ea49f65..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button/BUILD +++ /dev/null @@ -1,21 +0,0 @@ -scala_library( - sources = ["*.scala"], - compiler_option_sets = ["fatal_warnings"], - platform = "java8", - strict_deps = True, - tags = ["bazel-compatible"], - dependencies = [ - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/icon", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/metadata", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/urt/button", - "src/thrift/com/twitter/timelines/render:thrift-scala", - ], - exports = [ - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/icon", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/metadata", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/urt/button", - "src/thrift/com/twitter/timelines/render:thrift-scala", - ], -) diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button/BUILD.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button/BUILD.docx new file mode 100644 index 000000000..55e42e792 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button/BUILD.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button/ButtonStyleMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button/ButtonStyleMarshaller.docx new file mode 100644 index 000000000..ea0bc462d Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button/ButtonStyleMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button/ButtonStyleMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button/ButtonStyleMarshaller.scala deleted file mode 100644 index 3676b2d56..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button/ButtonStyleMarshaller.scala +++ /dev/null @@ -1,29 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.button - -import com.twitter.product_mixer.core.model.marshalling.response.urt.button.ButtonStyle -import com.twitter.product_mixer.core.model.marshalling.response.urt.button.Default -import com.twitter.product_mixer.core.model.marshalling.response.urt.button.Primary -import com.twitter.product_mixer.core.model.marshalling.response.urt.button.Secondary -import com.twitter.product_mixer.core.model.marshalling.response.urt.button.Text -import com.twitter.product_mixer.core.model.marshalling.response.urt.button.Destructive -import com.twitter.product_mixer.core.model.marshalling.response.urt.button.Neutral -import com.twitter.product_mixer.core.model.marshalling.response.urt.button.DestructiveSecondary -import com.twitter.product_mixer.core.model.marshalling.response.urt.button.DestructiveText -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class ButtonStyleMarshaller @Inject() () { - def apply(buttonStyle: ButtonStyle): urt.ButtonStyle = - buttonStyle match { - case Default => urt.ButtonStyle.Default - case Primary => urt.ButtonStyle.Primary - case Secondary => urt.ButtonStyle.Secondary - case Text => urt.ButtonStyle.Text - case Destructive => urt.ButtonStyle.Destructive - case Neutral => urt.ButtonStyle.Neutral - case DestructiveSecondary => urt.ButtonStyle.DestructiveSecondary - case DestructiveText => urt.ButtonStyle.DestructiveText - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button/CtaButtonMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button/CtaButtonMarshaller.docx new file mode 100644 index 000000000..740ed590c Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button/CtaButtonMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button/CtaButtonMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button/CtaButtonMarshaller.scala deleted file mode 100644 index 936b9073e..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button/CtaButtonMarshaller.scala +++ /dev/null @@ -1,19 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.button - -import com.twitter.product_mixer.core.model.marshalling.response.urt.button.CtaButton -import com.twitter.product_mixer.core.model.marshalling.response.urt.button.IconCtaButton -import com.twitter.product_mixer.core.model.marshalling.response.urt.button.TextCtaButton -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class CtaButtonMarshaller @Inject() ( - iconCtaButtonMarshaller: IconCtaButtonMarshaller, - textCtaButtonMarshaller: TextCtaButtonMarshaller) { - - def apply(ctaButton: CtaButton): urt.CtaButton = ctaButton match { - case button: TextCtaButton => urt.CtaButton.Text(textCtaButtonMarshaller(button)) - case button: IconCtaButton => urt.CtaButton.Icon(iconCtaButtonMarshaller(button)) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button/IconCtaButtonMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button/IconCtaButtonMarshaller.docx new file mode 100644 index 000000000..7e0c1898f Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button/IconCtaButtonMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button/IconCtaButtonMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button/IconCtaButtonMarshaller.scala deleted file mode 100644 index c22c3666a..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button/IconCtaButtonMarshaller.scala +++ /dev/null @@ -1,21 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.button - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.icon.HorizonIconMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.UrlMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.button.IconCtaButton -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class IconCtaButtonMarshaller @Inject() ( - horizonIconMarshaller: HorizonIconMarshaller, - urlMarshaller: UrlMarshaller) { - - def apply(iconCtaButton: IconCtaButton): urt.IconCtaButton = - urt.IconCtaButton( - buttonIcon = horizonIconMarshaller(iconCtaButton.buttonIcon), - accessibilityLabel = iconCtaButton.accessibilityLabel, - url = urlMarshaller(iconCtaButton.url) - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button/TextCtaButtonMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button/TextCtaButtonMarshaller.docx new file mode 100644 index 000000000..262ffaebe Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button/TextCtaButtonMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button/TextCtaButtonMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button/TextCtaButtonMarshaller.scala deleted file mode 100644 index f805a1758..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button/TextCtaButtonMarshaller.scala +++ /dev/null @@ -1,18 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.button - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.UrlMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.button.TextCtaButton -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class TextCtaButtonMarshaller @Inject() ( - urlMarshaller: UrlMarshaller) { - - def apply(textCtaButton: TextCtaButton): urt.TextCtaButton = - urt.TextCtaButton( - buttonText = textCtaButton.buttonText, - url = urlMarshaller(textCtaButton.url) - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/color/BUILD b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/color/BUILD deleted file mode 100644 index 7e72e4f60..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/color/BUILD +++ /dev/null @@ -1,17 +0,0 @@ -scala_library( - sources = ["*.scala"], - compiler_option_sets = ["fatal_warnings"], - platform = "java8", - strict_deps = True, - tags = ["bazel-compatible"], - dependencies = [ - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/urt/color", - "src/thrift/com/twitter/timelines/render:thrift-scala", - ], - exports = [ - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/urt/color", - "src/thrift/com/twitter/timelines/render:thrift-scala", - ], -) diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/color/BUILD.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/color/BUILD.docx new file mode 100644 index 000000000..49e0f140e Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/color/BUILD.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/color/ColorMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/color/ColorMarshaller.docx new file mode 100644 index 000000000..7a8e7e78e Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/color/ColorMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/color/ColorMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/color/ColorMarshaller.scala deleted file mode 100644 index 98eacd8d8..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/color/ColorMarshaller.scala +++ /dev/null @@ -1,16 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.color - -import com.twitter.product_mixer.core.model.marshalling.response.urt.color.Color -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Singleton - -@Singleton -class ColorMarshaller { - - def apply(color: Color): urt.Color = urt.Color( - red = color.red, - green = color.green, - blue = color.blue, - opacity = color.opacity - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/color/ColorPaletteMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/color/ColorPaletteMarshaller.docx new file mode 100644 index 000000000..36fabd754 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/color/ColorPaletteMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/color/ColorPaletteMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/color/ColorPaletteMarshaller.scala deleted file mode 100644 index 22a932aa3..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/color/ColorPaletteMarshaller.scala +++ /dev/null @@ -1,16 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.color - -import com.twitter.product_mixer.core.model.marshalling.response.urt.color.ColorPalette -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class ColorPaletteMarshaller @Inject() ( - colorMarshaller: ColorMarshaller) { - - def apply(colorPalette: ColorPalette): urt.ColorPaletteItem = urt.ColorPaletteItem( - rgb = colorMarshaller(colorPalette.rgb), - percentage = colorPalette.percentage - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/color/RosettaColorMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/color/RosettaColorMarshaller.docx new file mode 100644 index 000000000..a44b702f8 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/color/RosettaColorMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/color/RosettaColorMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/color/RosettaColorMarshaller.scala deleted file mode 100644 index 91926673e..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/color/RosettaColorMarshaller.scala +++ /dev/null @@ -1,48 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.color - -import com.twitter.product_mixer.core.model.marshalling.response.urt.color._ -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class RosettaColorMarshaller @Inject() () { - - def apply(rosettaColor: RosettaColor): urt.RosettaColor = rosettaColor match { - case WhiteRosettaColor => urt.RosettaColor.White - case BlackRosettaColor => urt.RosettaColor.Black - case ClearRosettaColor => urt.RosettaColor.Clear - case TextBlackRosettaColor => urt.RosettaColor.TextBlack - case TextBlueRosettaColor => urt.RosettaColor.TextBlue - case DeepGrayRosettaColor => urt.RosettaColor.DeepGray - case MediumGrayRosettaColor => urt.RosettaColor.MediumGray - case LightGrayRosettaColor => urt.RosettaColor.LightGray - case FadedGrayRosettaColor => urt.RosettaColor.FadedGray - case FaintGrayRosettaColor => urt.RosettaColor.FaintGray - case DeepOrangeRosettaColor => urt.RosettaColor.DeepOrange - case MediumOrangeRosettaColor => urt.RosettaColor.MediumOrange - case LightOrangeRosettaColor => urt.RosettaColor.LightOrange - case FadedOrangeRosettaColor => urt.RosettaColor.FadedOrange - case DeepYellowRosettaColor => urt.RosettaColor.DeepYellow - case MediumYellowRosettaColor => urt.RosettaColor.MediumYellow - case LightYellowRosettaColor => urt.RosettaColor.LightYellow - case FadedYellowRosettaColor => urt.RosettaColor.FadedYellow - case DeepGreenRosettaColor => urt.RosettaColor.DeepGreen - case MediumGreenRosettaColor => urt.RosettaColor.MediumGreen - case LightGreenRosettaColor => urt.RosettaColor.LightGreen - case FadedGreenRosettaColor => urt.RosettaColor.FadedGreen - case DeepBlueRosettaColor => urt.RosettaColor.DeepBlue - case TwitterBlueRosettaColor => urt.RosettaColor.TwitterBlue - case LightBlueRosettaColor => urt.RosettaColor.LightBlue - case FadedBlueRosettaColor => urt.RosettaColor.FadedBlue - case FaintBlueRosettaColor => urt.RosettaColor.FaintBlue - case DeepPurpleRosettaColor => urt.RosettaColor.DeepPurple - case MediumPurpleRosettaColor => urt.RosettaColor.MediumPurple - case LightPurpleRosettaColor => urt.RosettaColor.LightPurple - case FadedPurpleRosettaColor => urt.RosettaColor.FadedPurple - case DeepRedRosettaColor => urt.RosettaColor.DeepRed - case MediumRedRosettaColor => urt.RosettaColor.MediumRed - case LightRedRosettaColor => urt.RosettaColor.LightRed - case FadedRedRosettaColor => urt.RosettaColor.FadedRed - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/BUILD b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/BUILD deleted file mode 100644 index abb1600e9..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/BUILD +++ /dev/null @@ -1,28 +0,0 @@ -scala_library( - sources = ["*.scala"], - compiler_option_sets = ["fatal_warnings"], - platform = "java8", - strict_deps = True, - tags = ["bazel-compatible"], - dependencies = [ - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/icon", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/metadata", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/richtext", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/urt", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/urt/cover", - "src/thrift/com/twitter/timelines/render:thrift-scala", - ], - exports = [ - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/icon", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/metadata", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/richtext", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/urt", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/urt/cover", - "src/thrift/com/twitter/timelines/render:thrift-scala", - ], -) diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/BUILD.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/BUILD.docx new file mode 100644 index 000000000..cb329498d Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/BUILD.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/CoverContentMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/CoverContentMarshaller.docx new file mode 100644 index 000000000..c9e1abd36 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/CoverContentMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/CoverContentMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/CoverContentMarshaller.scala deleted file mode 100644 index 3841420e9..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/CoverContentMarshaller.scala +++ /dev/null @@ -1,19 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.cover - -import com.twitter.product_mixer.core.model.marshalling.response.urt.cover.CoverContent -import com.twitter.product_mixer.core.model.marshalling.response.urt.cover.FullCoverContent -import com.twitter.product_mixer.core.model.marshalling.response.urt.cover.HalfCoverContent -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class CoverContentMarshaller @Inject() ( - fullCoverContentMarshaller: FullCoverContentMarshaller, - halfCoverContentMarshaller: HalfCoverContentMarshaller) { - - def apply(coverContent: CoverContent): urt.Cover = coverContent match { - case fullCover: FullCoverContent => fullCoverContentMarshaller(fullCover) - case halfCover: HalfCoverContent => halfCoverContentMarshaller(halfCover) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/CoverCtaBehaviorMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/CoverCtaBehaviorMarshaller.docx new file mode 100644 index 000000000..6b175491e Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/CoverCtaBehaviorMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/CoverCtaBehaviorMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/CoverCtaBehaviorMarshaller.scala deleted file mode 100644 index ae5c49228..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/CoverCtaBehaviorMarshaller.scala +++ /dev/null @@ -1,25 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.cover - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.UrlMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.cover.CoverCtaBehavior -import com.twitter.product_mixer.core.model.marshalling.response.urt.cover.CoverBehaviorDismiss -import com.twitter.product_mixer.core.model.marshalling.response.urt.cover.CoverBehaviorNavigate -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.richtext.RichTextMarshaller - -@Singleton -class CoverCtaBehaviorMarshaller @Inject() ( - richTextMarshaller: RichTextMarshaller, - urlMarshaller: UrlMarshaller) { - - def apply(coverCtaBehavior: CoverCtaBehavior): urt.CoverCtaBehavior = - coverCtaBehavior match { - case dismiss: CoverBehaviorDismiss => - urt.CoverCtaBehavior.Dismiss( - urt.CoverBehaviorDismiss(dismiss.feedbackMessage.map(richTextMarshaller(_)))) - case nav: CoverBehaviorNavigate => - urt.CoverCtaBehavior.Navigate(urt.CoverBehaviorNavigate(urlMarshaller(nav.url))) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/CoverCtaMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/CoverCtaMarshaller.docx new file mode 100644 index 000000000..53baf41c7 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/CoverCtaMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/CoverCtaMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/CoverCtaMarshaller.scala deleted file mode 100644 index c46196cfa..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/CoverCtaMarshaller.scala +++ /dev/null @@ -1,28 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.cover - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.button.ButtonStyleMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.icon.HorizonIconMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.CallbackMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.ClientEventInfoMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.cover.CoverCta -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class CoverCtaMarshaller @Inject() ( - coverCtaBehaviorMarshaller: CoverCtaBehaviorMarshaller, - callbackMarshaller: CallbackMarshaller, - clientEventInfoMarshaller: ClientEventInfoMarshaller, - horizonIconMarshaller: HorizonIconMarshaller, - buttonStyleMarshaller: ButtonStyleMarshaller) { - - def apply(coverCta: CoverCta): urt.CoverCta = urt.CoverCta( - text = coverCta.text, - ctaBehavior = coverCtaBehaviorMarshaller(coverCta.ctaBehavior), - callbacks = coverCta.callbacks.map(_.map(callbackMarshaller(_))), - clientEventInfo = coverCta.clientEventInfo.map(clientEventInfoMarshaller(_)), - icon = coverCta.icon.map(horizonIconMarshaller(_)), - buttonStyle = coverCta.buttonStyle.map(buttonStyleMarshaller(_)) - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/CoverImageMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/CoverImageMarshaller.docx new file mode 100644 index 000000000..cba3f0732 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/CoverImageMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/CoverImageMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/CoverImageMarshaller.scala deleted file mode 100644 index b04fa0faf..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/CoverImageMarshaller.scala +++ /dev/null @@ -1,23 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.cover - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.ImageAnimationTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.ImageDisplayTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.ImageVariantMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.cover.CoverImage -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class CoverImageMarshaller @Inject() ( - imageVariantMarshaller: ImageVariantMarshaller, - imageDisplayTypeMarshaller: ImageDisplayTypeMarshaller, - imageAnimationTypeMarshaller: ImageAnimationTypeMarshaller) { - - def apply(coverImage: CoverImage): urt.CoverImage = - urt.CoverImage( - image = imageVariantMarshaller(coverImage.imageVariant), - imageDisplayType = imageDisplayTypeMarshaller(coverImage.imageDisplayType), - imageAnimationType = coverImage.imageAnimationType.map(imageAnimationTypeMarshaller(_)) - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/FullCoverContentMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/FullCoverContentMarshaller.docx new file mode 100644 index 000000000..199068a08 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/FullCoverContentMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/FullCoverContentMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/FullCoverContentMarshaller.scala deleted file mode 100644 index 3ec88a87a..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/FullCoverContentMarshaller.scala +++ /dev/null @@ -1,37 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.cover - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.CallbackMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.DismissInfoMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.ImageDisplayTypeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.ImageVariantMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.richtext.RichTextMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.cover.FullCoverContent -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class FullCoverContentMarshaller @Inject() ( - fullCoverDisplayTypeMarshaller: FullCoverDisplayTypeMarshaller, - coverCtaMarshaller: CoverCtaMarshaller, - richTextMarshaller: RichTextMarshaller, - imageVariantMarshaller: ImageVariantMarshaller, - dismissInfoMarshaller: DismissInfoMarshaller, - imageDisplayTypeMarshaller: ImageDisplayTypeMarshaller, - callbackMarshaller: CallbackMarshaller) { - - def apply(fullCover: FullCoverContent): urt.Cover = - urt.Cover.FullCover( - urt.FullCover( - displayType = fullCoverDisplayTypeMarshaller(fullCover.displayType), - primaryText = richTextMarshaller(fullCover.primaryText), - primaryCoverCta = coverCtaMarshaller(fullCover.primaryCoverCta), - secondaryCoverCta = fullCover.secondaryCoverCta.map(coverCtaMarshaller(_)), - secondaryText = fullCover.secondaryText.map(richTextMarshaller(_)), - image = fullCover.imageVariant.map(imageVariantMarshaller(_)), - details = fullCover.details.map(richTextMarshaller(_)), - dismissInfo = fullCover.dismissInfo.map(dismissInfoMarshaller(_)), - imageDisplayType = fullCover.imageDisplayType.map(imageDisplayTypeMarshaller(_)), - impressionCallbacks = fullCover.impressionCallbacks.map(_.map(callbackMarshaller(_))) - )) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/FullCoverDisplayTypeMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/FullCoverDisplayTypeMarshaller.docx new file mode 100644 index 000000000..3924f818d Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/FullCoverDisplayTypeMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/FullCoverDisplayTypeMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/FullCoverDisplayTypeMarshaller.scala deleted file mode 100644 index 9a961c925..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/FullCoverDisplayTypeMarshaller.scala +++ /dev/null @@ -1,16 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.cover - -import com.twitter.product_mixer.core.model.marshalling.response.urt.cover.CoverFullCoverDisplayType -import com.twitter.product_mixer.core.model.marshalling.response.urt.cover.FullCoverDisplayType -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class FullCoverDisplayTypeMarshaller @Inject() () { - - def apply(halfCoverDisplayType: FullCoverDisplayType): urt.FullCoverDisplayType = - halfCoverDisplayType match { - case CoverFullCoverDisplayType => urt.FullCoverDisplayType.Cover - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/HalfCoverContentMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/HalfCoverContentMarshaller.docx new file mode 100644 index 000000000..1865a97e7 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/HalfCoverContentMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/HalfCoverContentMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/HalfCoverContentMarshaller.scala deleted file mode 100644 index 35f45b27e..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/HalfCoverContentMarshaller.scala +++ /dev/null @@ -1,33 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.cover - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.CallbackMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.DismissInfoMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.richtext.RichTextMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.cover.HalfCoverContent -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class HalfCoverContentMarshaller @Inject() ( - halfCoverDisplayTypeMarshaller: HalfCoverDisplayTypeMarshaller, - coverCtaMarshaller: CoverCtaMarshaller, - richTextMarshaller: RichTextMarshaller, - coverImageMarshaller: CoverImageMarshaller, - dismissInfoMarshaller: DismissInfoMarshaller, - callbackMarshaller: CallbackMarshaller) { - - def apply(halfCover: HalfCoverContent): urt.Cover = - urt.Cover.HalfCover( - urt.HalfCover( - displayType = halfCoverDisplayTypeMarshaller(halfCover.displayType), - primaryText = richTextMarshaller(halfCover.primaryText), - primaryCoverCta = coverCtaMarshaller(halfCover.primaryCoverCta), - secondaryCoverCta = halfCover.secondaryCoverCta.map(coverCtaMarshaller(_)), - secondaryText = halfCover.secondaryText.map(richTextMarshaller(_)), - impressionCallbacks = halfCover.impressionCallbacks.map(_.map(callbackMarshaller(_))), - dismissible = halfCover.dismissible, - coverImage = halfCover.coverImage.map(coverImageMarshaller(_)), - dismissInfo = halfCover.dismissInfo.map(dismissInfoMarshaller(_)) - )) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/HalfCoverDisplayTypeMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/HalfCoverDisplayTypeMarshaller.docx new file mode 100644 index 000000000..18a839294 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/HalfCoverDisplayTypeMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/HalfCoverDisplayTypeMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/HalfCoverDisplayTypeMarshaller.scala deleted file mode 100644 index 537d2faf2..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/cover/HalfCoverDisplayTypeMarshaller.scala +++ /dev/null @@ -1,18 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.cover - -import com.twitter.product_mixer.core.model.marshalling.response.urt.cover.CenterCoverHalfCoverDisplayType -import com.twitter.product_mixer.core.model.marshalling.response.urt.cover.CoverHalfCoverDisplayType -import com.twitter.product_mixer.core.model.marshalling.response.urt.cover.HalfCoverDisplayType -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class HalfCoverDisplayTypeMarshaller @Inject() () { - - def apply(halfCoverDisplayType: HalfCoverDisplayType): urt.HalfCoverDisplayType = - halfCoverDisplayType match { - case CenterCoverHalfCoverDisplayType => urt.HalfCoverDisplayType.CenterCover - case CoverHalfCoverDisplayType => urt.HalfCoverDisplayType.Cover - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/icon/BUILD b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/icon/BUILD deleted file mode 100644 index 83a9b306f..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/icon/BUILD +++ /dev/null @@ -1,17 +0,0 @@ -scala_library( - sources = ["*.scala"], - compiler_option_sets = ["fatal_warnings"], - platform = "java8", - strict_deps = True, - tags = ["bazel-compatible"], - dependencies = [ - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/urt/icon", - "src/thrift/com/twitter/timelines/render:thrift-scala", - ], - exports = [ - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/urt/icon", - "src/thrift/com/twitter/timelines/render:thrift-scala", - ], -) diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/icon/BUILD.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/icon/BUILD.docx new file mode 100644 index 000000000..31ee72d6a Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/icon/BUILD.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/icon/HorizonIconMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/icon/HorizonIconMarshaller.docx new file mode 100644 index 000000000..3c7059dc4 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/icon/HorizonIconMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/icon/HorizonIconMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/icon/HorizonIconMarshaller.scala deleted file mode 100644 index e3d71ff5c..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/icon/HorizonIconMarshaller.scala +++ /dev/null @@ -1,52 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.icon - -import com.twitter.product_mixer.core.model.marshalling.response.urt.icon._ -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class HorizonIconMarshaller @Inject() () { - - def apply(icon: HorizonIcon): urt.HorizonIcon = icon match { - case Bookmark => urt.HorizonIcon.Bookmark - case Moment => urt.HorizonIcon.Moment - case Debug => urt.HorizonIcon.Debug - case Error => urt.HorizonIcon.Error - case Follow => urt.HorizonIcon.Follow - case Unfollow => urt.HorizonIcon.Unfollow - case Smile => urt.HorizonIcon.Smile - case Frown => urt.HorizonIcon.Frown - case Help => urt.HorizonIcon.Help - case Link => urt.HorizonIcon.Link - case Message => urt.HorizonIcon.Message - case No => urt.HorizonIcon.No - case Outgoing => urt.HorizonIcon.Outgoing - case Pin => urt.HorizonIcon.Pin - case Retweet => urt.HorizonIcon.Retweet - case Speaker => urt.HorizonIcon.Speaker - case Trashcan => urt.HorizonIcon.Trashcan - case Feedback => urt.HorizonIcon.Feedback - case FeedbackClose => urt.HorizonIcon.FeedbackClose - case EyeOff => urt.HorizonIcon.EyeOff - case Moderation => urt.HorizonIcon.Moderation - case Topic => urt.HorizonIcon.Topic - case TopicClose => urt.HorizonIcon.TopicClose - case Flag => urt.HorizonIcon.Flag - case TopicFilled => urt.HorizonIcon.TopicFilled - case NotificationsFollow => urt.HorizonIcon.NotificationsFollow - case Person => urt.HorizonIcon.Person - case BalloonStroke => urt.HorizonIcon.BalloonStroke - case Calendar => urt.HorizonIcon.Calendar - case LocationStroke => urt.HorizonIcon.LocationStroke - case PersonStroke => urt.HorizonIcon.PersonStroke - case Safety => urt.HorizonIcon.Safety - case Logo => urt.HorizonIcon.Logo - case SparkleOn => urt.HorizonIcon.SparkleOn - case StarRising => urt.HorizonIcon.StarRising - case CameraVideo => urt.HorizonIcon.CameraVideo - case ShoppingClock => urt.HorizonIcon.ShoppingClock - case ArrowRight => urt.HorizonIcon.ArrowRight - case SpeakerOff => urt.HorizonIcon.SpeakerOff - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/BUILD b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/BUILD deleted file mode 100644 index c0ffc860c..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/BUILD +++ /dev/null @@ -1,28 +0,0 @@ -scala_library( - sources = ["**/*.scala"], - compiler_option_sets = ["fatal_warnings"], - platform = "java8", - strict_deps = True, - tags = ["bazel-compatible"], - dependencies = [ - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/graphql/contextual_ref", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/media", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/promoted", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/reaction", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/richtext", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/urt/item", - "src/thrift/com/twitter/timelines/render:thrift-scala", - ], - exports = [ - "3rdparty/jvm/javax/inject:javax.inject", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/button", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/media", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/promoted", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/reaction", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/richtext", - "product-mixer/core/src/main/scala/com/twitter/product_mixer/core/model/marshalling/response/urt/item", - "src/thrift/com/twitter/timelines/render:thrift-scala", - ], -) diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/BUILD.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/BUILD.docx new file mode 100644 index 000000000..5a0fb0ada Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/BUILD.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/article/ArticleDisplayTypeMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/article/ArticleDisplayTypeMarshaller.docx new file mode 100644 index 000000000..1defce625 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/article/ArticleDisplayTypeMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/article/ArticleDisplayTypeMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/article/ArticleDisplayTypeMarshaller.scala deleted file mode 100644 index 8ff49b5e2..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/article/ArticleDisplayTypeMarshaller.scala +++ /dev/null @@ -1,15 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.article - -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.article.ArticleDisplayType -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.article.Default -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class ArticleDisplayTypeMarshaller @Inject() () { - def apply(articleDisplayType: ArticleDisplayType): urt.ArticleDisplayType = - articleDisplayType match { - case Default => urt.ArticleDisplayType.Default - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/article/ArticleItemMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/article/ArticleItemMarshaller.docx new file mode 100644 index 000000000..756547bbb Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/article/ArticleItemMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/article/ArticleItemMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/article/ArticleItemMarshaller.scala deleted file mode 100644 index 35c931d79..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/article/ArticleItemMarshaller.scala +++ /dev/null @@ -1,23 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.article - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.SocialContextMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.article.ArticleItem -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class ArticleItemMarshaller @Inject() ( - articleDisplayTypeMarshaller: ArticleDisplayTypeMarshaller, - socialContextMarshaller: SocialContextMarshaller, - articleSeedTypeMarshaller: ArticleSeedTypeMarshaller) { - def apply(articleItem: ArticleItem): urt.TimelineItemContent = - urt.TimelineItemContent.Article( - urt.Article( - id = articleItem.id, - displayType = articleItem.displayType.map(articleDisplayTypeMarshaller(_)), - socialContext = articleItem.socialContext.map(socialContextMarshaller(_)), - articleSeedType = Some(articleSeedTypeMarshaller(articleItem.articleSeedType)) - ) - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/article/ArticleSeedTypeMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/article/ArticleSeedTypeMarshaller.docx new file mode 100644 index 000000000..7150d7e32 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/article/ArticleSeedTypeMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/article/ArticleSeedTypeMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/article/ArticleSeedTypeMarshaller.scala deleted file mode 100644 index 0227f8057..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/article/ArticleSeedTypeMarshaller.scala +++ /dev/null @@ -1,20 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.article - -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.article.ArticleSeedType -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.article.FollowingListSeed -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.article.FriendsOfFriendsSeed -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.article.ListIdSeed -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class ArticleSeedTypeMarshaller @Inject() () { - - def apply(articleSeedType: ArticleSeedType): urt.ArticleSeedType = - articleSeedType match { - case FollowingListSeed => urt.ArticleSeedType.FollowingList - case FriendsOfFriendsSeed => urt.ArticleSeedType.FriendsOfFriends - case ListIdSeed => urt.ArticleSeedType.ListId - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/audio_space/AudioSpaceItemMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/audio_space/AudioSpaceItemMarshaller.docx new file mode 100644 index 000000000..13c480818 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/audio_space/AudioSpaceItemMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/audio_space/AudioSpaceItemMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/audio_space/AudioSpaceItemMarshaller.scala deleted file mode 100644 index b9a75756b..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/audio_space/AudioSpaceItemMarshaller.scala +++ /dev/null @@ -1,17 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.audio_space - -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.audio_space.AudioSpaceItem -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class AudioSpaceItemMarshaller @Inject() () { - - def apply(audioSpaceItem: AudioSpaceItem): urt.TimelineItemContent = - urt.TimelineItemContent.AudioSpace( - urt.AudioSpace( - id = audioSpaceItem.id - ) - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/card/CardDisplayTypeMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/card/CardDisplayTypeMarshaller.docx new file mode 100644 index 000000000..70bfe847a Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/card/CardDisplayTypeMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/card/CardDisplayTypeMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/card/CardDisplayTypeMarshaller.scala deleted file mode 100644 index 3565b6aba..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/card/CardDisplayTypeMarshaller.scala +++ /dev/null @@ -1,16 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.card - -import javax.inject.Inject -import javax.inject.Singleton -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.card._ -import com.twitter.timelines.render.{thriftscala => urt} - -@Singleton -class CardDisplayTypeMarshaller @Inject() () { - - def apply(cardDisplayType: CardDisplayType): urt.CardDisplayType = cardDisplayType match { - case HeroDisplayType => urt.CardDisplayType.Hero - case CellDisplayType => urt.CardDisplayType.Cell - case TweetCardDisplayType => urt.CardDisplayType.TweetCard - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/card/CardItemMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/card/CardItemMarshaller.docx new file mode 100644 index 000000000..4002bfd16 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/card/CardItemMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/card/CardItemMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/card/CardItemMarshaller.scala deleted file mode 100644 index 2ae8008bf..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/card/CardItemMarshaller.scala +++ /dev/null @@ -1,25 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.card - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.UrlMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.card.CardItem -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class CardItemMarshaller @Inject() ( - cardDisplayTypeMarshaller: CardDisplayTypeMarshaller, - urlMarshaller: UrlMarshaller) { - - def apply(cardItem: CardItem): urt.TimelineItemContent = { - urt.TimelineItemContent.Card( - urt.Card( - cardUrl = cardItem.cardUrl, - text = cardItem.text, - subtext = cardItem.subtext, - url = cardItem.url.map(urlMarshaller(_)), - cardDisplayType = cardItem.displayType.map(cardDisplayTypeMarshaller(_)) - ) - ) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/commerce/CommerceProductGroupItemMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/commerce/CommerceProductGroupItemMarshaller.docx new file mode 100644 index 000000000..d073d84a3 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/commerce/CommerceProductGroupItemMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/commerce/CommerceProductGroupItemMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/commerce/CommerceProductGroupItemMarshaller.scala deleted file mode 100644 index 5fd0b9d56..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/commerce/CommerceProductGroupItemMarshaller.scala +++ /dev/null @@ -1,14 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.commerce - -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.commerce.CommerceProductGroupItem -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class CommerceProductGroupItemMarshaller @Inject() () { - - def apply(commerceProductGroupItem: CommerceProductGroupItem): urt.TimelineItemContent = - urt.TimelineItemContent.CommerceProductGroup( - urt.CommerceProductGroup(commerceProductGroupItem.id)) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/commerce/CommerceProductItemMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/commerce/CommerceProductItemMarshaller.docx new file mode 100644 index 000000000..bf54c7a41 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/commerce/CommerceProductItemMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/commerce/CommerceProductItemMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/commerce/CommerceProductItemMarshaller.scala deleted file mode 100644 index 8bc08beae..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/commerce/CommerceProductItemMarshaller.scala +++ /dev/null @@ -1,13 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.commerce - -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.commerce.CommerceProductItem -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class CommerceProductItemMarshaller @Inject() () { - - def apply(commerceProductItem: CommerceProductItem): urt.TimelineItemContent = - urt.TimelineItemContent.CommerceProduct(urt.CommerceProduct(commerceProductItem.id)) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/conversation_annotation/ConversationAnnotationMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/conversation_annotation/ConversationAnnotationMarshaller.docx new file mode 100644 index 000000000..fb3fc43b3 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/conversation_annotation/ConversationAnnotationMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/conversation_annotation/ConversationAnnotationMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/conversation_annotation/ConversationAnnotationMarshaller.scala deleted file mode 100644 index bed51192e..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/conversation_annotation/ConversationAnnotationMarshaller.scala +++ /dev/null @@ -1,22 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.conversation_annotation - -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.conversation_annotation.ConversationAnnotation -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.richtext.RichTextMarshaller -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class ConversationAnnotationMarshaller @Inject() ( - conversationAnnotationTypeMarshaller: ConversationAnnotationTypeMarshaller, - richTextMarshaller: RichTextMarshaller) { - - def apply(conversationAnnotation: ConversationAnnotation): urt.ConversationAnnotation = { - urt.ConversationAnnotation( - conversationAnnotationType = - conversationAnnotationTypeMarshaller(conversationAnnotation.conversationAnnotationType), - header = conversationAnnotation.header.map(richTextMarshaller(_)), - description = conversationAnnotation.description.map(richTextMarshaller(_)) - ) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/conversation_annotation/ConversationAnnotationTypeMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/conversation_annotation/ConversationAnnotationTypeMarshaller.docx new file mode 100644 index 000000000..8f8cfe744 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/conversation_annotation/ConversationAnnotationTypeMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/conversation_annotation/ConversationAnnotationTypeMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/conversation_annotation/ConversationAnnotationTypeMarshaller.scala deleted file mode 100644 index 85488d061..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/conversation_annotation/ConversationAnnotationTypeMarshaller.scala +++ /dev/null @@ -1,20 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.conversation_annotation - -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.conversation_annotation.ConversationAnnotationType -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.conversation_annotation.Large -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.conversation_annotation.Political - -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class ConversationAnnotationTypeMarshaller @Inject() () { - - def apply( - conversationAnnotationType: ConversationAnnotationType - ): urt.ConversationAnnotationType = conversationAnnotationType match { - case Large => urt.ConversationAnnotationType.Large - case Political => urt.ConversationAnnotationType.Political - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/event/EventSummaryDisplayTypeMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/event/EventSummaryDisplayTypeMarshaller.docx new file mode 100644 index 000000000..47bde0ea2 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/event/EventSummaryDisplayTypeMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/event/EventSummaryDisplayTypeMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/event/EventSummaryDisplayTypeMarshaller.scala deleted file mode 100644 index 3b325d822..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/event/EventSummaryDisplayTypeMarshaller.scala +++ /dev/null @@ -1,24 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.event - -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.event.EventSummaryDisplayType -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.event.CellEventSummaryDisplayType -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.event.HeroEventSummaryDisplayType -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.event.CellWithProminentSocialContextEventSummaryDisplayType -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class EventSummaryDisplayTypeMarshaller @Inject() () { - - def apply( - eventSummaryDisplayType: EventSummaryDisplayType - ): urt.EventSummaryDisplayType = eventSummaryDisplayType match { - case CellEventSummaryDisplayType => - urt.EventSummaryDisplayType.Cell - case HeroEventSummaryDisplayType => - urt.EventSummaryDisplayType.Hero - case CellWithProminentSocialContextEventSummaryDisplayType => - urt.EventSummaryDisplayType.CellWithProminentSocialContext - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/event/EventSummaryItemMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/event/EventSummaryItemMarshaller.docx new file mode 100644 index 000000000..26a04b8c1 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/event/EventSummaryItemMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/event/EventSummaryItemMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/event/EventSummaryItemMarshaller.scala deleted file mode 100644 index 0aa7b2471..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/event/EventSummaryItemMarshaller.scala +++ /dev/null @@ -1,27 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.event - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.ImageVariantMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.UrlMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.event.EventSummaryItem -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class EventSummaryItemMarshaller @Inject() ( - eventSummaryDisplayTypeMarshaller: EventSummaryDisplayTypeMarshaller, - imageVariantMarshaller: ImageVariantMarshaller, - urlMarshaller: UrlMarshaller) { - - def apply(eventSummary: EventSummaryItem): urt.TimelineItemContent = - urt.TimelineItemContent.EventSummary( - urt.EventSummary( - id = eventSummary.id, - title = eventSummary.title, - displayType = eventSummaryDisplayTypeMarshaller(eventSummary.displayType), - url = urlMarshaller(eventSummary.url), - image = eventSummary.image.map(imageVariantMarshaller(_)), - timeString = eventSummary.timeString - ) - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/forward_pivot/ForwardPivotDisplayTypeMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/forward_pivot/ForwardPivotDisplayTypeMarshaller.docx new file mode 100644 index 000000000..7b152f645 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/forward_pivot/ForwardPivotDisplayTypeMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/forward_pivot/ForwardPivotDisplayTypeMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/forward_pivot/ForwardPivotDisplayTypeMarshaller.scala deleted file mode 100644 index 648d8fb87..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/forward_pivot/ForwardPivotDisplayTypeMarshaller.scala +++ /dev/null @@ -1,20 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.forward_pivot - -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.forward_pivot.CommunityNotes -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.forward_pivot.ForwardPivotDisplayType -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.forward_pivot.LiveEvent -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.forward_pivot.SoftIntervention -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class ForwardPivotDisplayTypeMarshaller @Inject() () { - - def apply(forwardPivotDisplayType: ForwardPivotDisplayType): urt.ForwardPivotDisplayType = - forwardPivotDisplayType match { - case LiveEvent => urt.ForwardPivotDisplayType.LiveEvent - case SoftIntervention => urt.ForwardPivotDisplayType.SoftIntervention - case CommunityNotes => urt.ForwardPivotDisplayType.CommunityNotes - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/forward_pivot/ForwardPivotMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/forward_pivot/ForwardPivotMarshaller.docx new file mode 100644 index 000000000..4351fb63f Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/forward_pivot/ForwardPivotMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/forward_pivot/ForwardPivotMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/forward_pivot/ForwardPivotMarshaller.scala deleted file mode 100644 index 6ef392c95..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/forward_pivot/ForwardPivotMarshaller.scala +++ /dev/null @@ -1,35 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.forward_pivot - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.color.RosettaColorMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.BadgeMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.ImageVariantMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.UrlMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.richtext.RichTextMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.forward_pivot.ForwardPivot -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class ForwardPivotMarshaller @Inject() ( - urlMarshaller: UrlMarshaller, - richTextMarshaller: RichTextMarshaller, - forwardPivotDisplayTypeMarshaller: ForwardPivotDisplayTypeMarshaller, - softInterventionDisplayTypeMarshaller: SoftInterventionDisplayTypeMarshaller, - imageVariantMarshaller: ImageVariantMarshaller, - badgeMarshaller: BadgeMarshaller, - rosettaColorMarshaller: RosettaColorMarshaller) { - - def apply(forwardPivot: ForwardPivot): urt.ForwardPivot = urt.ForwardPivot( - text = richTextMarshaller(forwardPivot.text), - landingUrl = urlMarshaller(forwardPivot.landingUrl), - displayType = forwardPivotDisplayTypeMarshaller(forwardPivot.displayType), - iconImageVariant = forwardPivot.iconImageVariant.map(imageVariantMarshaller(_)), - stateBadge = forwardPivot.stateBadge.map(badgeMarshaller(_)), - subtext = forwardPivot.subtext.map(richTextMarshaller(_)), - backgroundColorName = forwardPivot.backgroundColorName.map(rosettaColorMarshaller(_)), - engagementNudge = forwardPivot.engagementNudge, - softInterventionDisplayType = - forwardPivot.softInterventionDisplayType.map(softInterventionDisplayTypeMarshaller(_)), - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/forward_pivot/SoftInterventionDisplayTypeMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/forward_pivot/SoftInterventionDisplayTypeMarshaller.docx new file mode 100644 index 000000000..26eb09423 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/forward_pivot/SoftInterventionDisplayTypeMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/forward_pivot/SoftInterventionDisplayTypeMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/forward_pivot/SoftInterventionDisplayTypeMarshaller.scala deleted file mode 100644 index e2bf9dc34..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/forward_pivot/SoftInterventionDisplayTypeMarshaller.scala +++ /dev/null @@ -1,24 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.forward_pivot - -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.forward_pivot.GetTheLatest -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.forward_pivot.GovernmentRequested -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.forward_pivot.Misleading -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.forward_pivot.SoftInterventionDisplayType -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.forward_pivot.StayInformed -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class SoftInterventionDisplayTypeMarshaller @Inject() () { - - def apply( - softInterventionDisplayType: SoftInterventionDisplayType - ): urt.SoftInterventionDisplayType = - softInterventionDisplayType match { - case GetTheLatest => urt.SoftInterventionDisplayType.GetTheLatest - case StayInformed => urt.SoftInterventionDisplayType.StayInformed - case Misleading => urt.SoftInterventionDisplayType.Misleading - case GovernmentRequested => urt.SoftInterventionDisplayType.GovernmentRequested - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/generic_summary_item/GenericSummaryActionMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/generic_summary_item/GenericSummaryActionMarshaller.docx new file mode 100644 index 000000000..81476ae4f Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/generic_summary_item/GenericSummaryActionMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/generic_summary_item/GenericSummaryActionMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/generic_summary_item/GenericSummaryActionMarshaller.scala deleted file mode 100644 index ff5ff44d6..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/generic_summary_item/GenericSummaryActionMarshaller.scala +++ /dev/null @@ -1,20 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.generic_summary_item - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.ClientEventInfoMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.UrlMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.generic_summary.GenericSummaryAction -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class GenericSummaryActionMarshaller @Inject() ( - urlMarshaller: UrlMarshaller, - clientEventInfoMarshaller: ClientEventInfoMarshaller) { - - def apply(genericSummaryItemAction: GenericSummaryAction): urt.GenericSummaryAction = - urt.GenericSummaryAction( - url = urlMarshaller(genericSummaryItemAction.url), - clientEventInfo = genericSummaryItemAction.clientEventInfo.map(clientEventInfoMarshaller(_)) - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/generic_summary_item/GenericSummaryContextMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/generic_summary_item/GenericSummaryContextMarshaller.docx new file mode 100644 index 000000000..a36f2c209 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/generic_summary_item/GenericSummaryContextMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/generic_summary_item/GenericSummaryContextMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/generic_summary_item/GenericSummaryContextMarshaller.scala deleted file mode 100644 index 67401cbba..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/generic_summary_item/GenericSummaryContextMarshaller.scala +++ /dev/null @@ -1,20 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.generic_summary_item - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.icon.HorizonIconMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.richtext.RichTextMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.generic_summary.GenericSummaryContext -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class GenericSummaryContextMarshaller @Inject() ( - richTextMarshaller: RichTextMarshaller, - horizonIconMarshaller: HorizonIconMarshaller) { - - def apply(genericSummaryItemContext: GenericSummaryContext): urt.GenericSummaryContext = - urt.GenericSummaryContext( - text = richTextMarshaller(genericSummaryItemContext.text), - icon = genericSummaryItemContext.icon.map(horizonIconMarshaller(_)) - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/generic_summary_item/GenericSummaryDisplayTypeMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/generic_summary_item/GenericSummaryDisplayTypeMarshaller.docx new file mode 100644 index 000000000..f408dae3d Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/generic_summary_item/GenericSummaryDisplayTypeMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/generic_summary_item/GenericSummaryDisplayTypeMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/generic_summary_item/GenericSummaryDisplayTypeMarshaller.scala deleted file mode 100644 index 293736390..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/generic_summary_item/GenericSummaryDisplayTypeMarshaller.scala +++ /dev/null @@ -1,18 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.generic_summary_item - -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.generic_summary.GenericSummaryItemDisplayType -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.generic_summary.HeroDisplayType -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class GenericSummaryDisplayTypeMarshaller @Inject() () { - - def apply( - genericSummaryItemDisplayType: GenericSummaryItemDisplayType - ): urt.GenericSummaryDisplayType = - genericSummaryItemDisplayType match { - case HeroDisplayType => urt.GenericSummaryDisplayType.Hero - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/generic_summary_item/GenericSummaryItemMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/generic_summary_item/GenericSummaryItemMarshaller.docx new file mode 100644 index 000000000..79d6388a4 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/generic_summary_item/GenericSummaryItemMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/generic_summary_item/GenericSummaryItemMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/generic_summary_item/GenericSummaryItemMarshaller.scala deleted file mode 100644 index 0717a5c34..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/generic_summary_item/GenericSummaryItemMarshaller.scala +++ /dev/null @@ -1,33 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.generic_summary_item - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.media.MediaMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.promoted.PromotedMetadataMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.richtext.RichTextMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.generic_summary.GenericSummaryItem -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class GenericSummaryItemMarshaller @Inject() ( - genericSummaryDisplayTypeMarshaller: GenericSummaryDisplayTypeMarshaller, - genericSummaryContextMarshaller: GenericSummaryContextMarshaller, - genericSummaryActionMarshaller: GenericSummaryActionMarshaller, - mediaMarshaller: MediaMarshaller, - promotedMetadataMarshaller: PromotedMetadataMarshaller, - richTextMarshaller: RichTextMarshaller) { - - def apply(genericSummaryItem: GenericSummaryItem): urt.TimelineItemContent = - urt.TimelineItemContent.GenericSummary( - urt.GenericSummary( - headline = richTextMarshaller(genericSummaryItem.headline), - displayType = genericSummaryDisplayTypeMarshaller(genericSummaryItem.displayType), - userAttributionIds = genericSummaryItem.userAttributionIds, - media = genericSummaryItem.media.map(mediaMarshaller(_)), - context = genericSummaryItem.context.map(genericSummaryContextMarshaller(_)), - timestamp = genericSummaryItem.timestamp.map(_.inMilliseconds), - onClickAction = genericSummaryItem.onClickAction.map(genericSummaryActionMarshaller(_)), - promotedMetadata = genericSummaryItem.promotedMetadata.map(promotedMetadataMarshaller(_)) - ) - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/highlight/HighlightedSectionMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/highlight/HighlightedSectionMarshaller.docx new file mode 100644 index 000000000..9ef1bdc29 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/highlight/HighlightedSectionMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/highlight/HighlightedSectionMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/highlight/HighlightedSectionMarshaller.scala deleted file mode 100644 index a370e7a9b..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/highlight/HighlightedSectionMarshaller.scala +++ /dev/null @@ -1,16 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.highlight - -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.highlight.HighlightedSection -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class HighlightedSectionMarshaller @Inject() () { - - def apply(highlightedSection: HighlightedSection): urt.HighlightedSection = - urt.HighlightedSection( - startIndex = highlightedSection.startIndex, - endIndex = highlightedSection.endIndex - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/icon_label/IconLabelItemMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/icon_label/IconLabelItemMarshaller.docx new file mode 100644 index 000000000..9f5f65c1d Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/icon_label/IconLabelItemMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/icon_label/IconLabelItemMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/icon_label/IconLabelItemMarshaller.scala deleted file mode 100644 index c6830185c..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/icon_label/IconLabelItemMarshaller.scala +++ /dev/null @@ -1,22 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.icon_label - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.icon.HorizonIconMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.richtext.RichTextMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.icon_label.IconLabelItem -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class IconLabelItemMarshaller @Inject() ( - richTextMarshaller: RichTextMarshaller, - horizonIconMarshaller: HorizonIconMarshaller) { - - def apply(iconLabelItem: IconLabelItem): urt.TimelineItemContent = - urt.TimelineItemContent.IconLabel( - urt.IconLabel( - text = richTextMarshaller(iconLabelItem.text), - icon = iconLabelItem.icon.map(horizonIconMarshaller(_)) - ) - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/label/LabelDisplayTypeMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/label/LabelDisplayTypeMarshaller.docx new file mode 100644 index 000000000..604915c1d Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/label/LabelDisplayTypeMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/label/LabelDisplayTypeMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/label/LabelDisplayTypeMarshaller.scala deleted file mode 100644 index 119c6adf7..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/label/LabelDisplayTypeMarshaller.scala +++ /dev/null @@ -1,15 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.label - -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.label._ -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class LabelDisplayTypeMarshaller @Inject() () { - - def apply(labelDisplayType: LabelDisplayType): urt.LabelDisplayType = labelDisplayType match { - case InlineHeaderLabelDisplayType => urt.LabelDisplayType.InlineHeader - case OtherRepliesSectionHeaderLabelDisplayType => urt.LabelDisplayType.OtherRepliesSectionHeader - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/label/LabelItemMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/label/LabelItemMarshaller.docx new file mode 100644 index 000000000..4ca8195d2 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/label/LabelItemMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/label/LabelItemMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/label/LabelItemMarshaller.scala deleted file mode 100644 index 10dae7f8a..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/label/LabelItemMarshaller.scala +++ /dev/null @@ -1,25 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.label - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.UrlMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.label.LabelItem -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class LabelItemMarshaller @Inject() ( - displayTypeMarshaller: LabelDisplayTypeMarshaller, - urlMarshaller: UrlMarshaller) { - - def apply(labelItem: LabelItem): urt.TimelineItemContent = { - urt.TimelineItemContent.Label( - urt.Label( - text = labelItem.text, - subtext = labelItem.subtext, - disclosureIndicator = labelItem.disclosureIndicator, - url = labelItem.url.map(urlMarshaller(_)), - displayType = labelItem.displayType.map(displayTypeMarshaller(_)) - ) - ) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/CompactPromptMessageContentMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/CompactPromptMessageContentMarshaller.docx new file mode 100644 index 000000000..e66604cb5 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/CompactPromptMessageContentMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/CompactPromptMessageContentMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/CompactPromptMessageContentMarshaller.scala deleted file mode 100644 index c40867874..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/CompactPromptMessageContentMarshaller.scala +++ /dev/null @@ -1,29 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.message - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.richtext.RichTextMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.message.CompactPromptMessageContent -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class CompactPromptMessageContentMarshaller @Inject() ( - messageTextActionMarshaller: MessageTextActionMarshaller, - messageActionMarshaller: MessageActionMarshaller, - richTextMarshaller: RichTextMarshaller) { - - def apply(compactPromptMessageContent: CompactPromptMessageContent): urt.MessageContent = - urt.MessageContent.CompactPrompt( - urt.CompactPrompt( - headerText = compactPromptMessageContent.headerText, - bodyText = compactPromptMessageContent.bodyText, - primaryButtonAction = - compactPromptMessageContent.primaryButtonAction.map(messageTextActionMarshaller(_)), - secondaryButtonAction = - compactPromptMessageContent.secondaryButtonAction.map(messageTextActionMarshaller(_)), - action = compactPromptMessageContent.action.map(messageActionMarshaller(_)), - headerRichText = compactPromptMessageContent.headerRichText.map(richTextMarshaller(_)), - bodyRichText = compactPromptMessageContent.bodyRichText.map(richTextMarshaller(_)) - ) - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/HeaderImagePromptMessageContentMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/HeaderImagePromptMessageContentMarshaller.docx new file mode 100644 index 000000000..cffd49fc2 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/HeaderImagePromptMessageContentMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/HeaderImagePromptMessageContentMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/HeaderImagePromptMessageContentMarshaller.scala deleted file mode 100644 index ba3abac35..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/HeaderImagePromptMessageContentMarshaller.scala +++ /dev/null @@ -1,33 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.message - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.richtext.RichTextMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.message.HeaderImagePromptMessageContent -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class HeaderImagePromptMessageContentMarshaller @Inject() ( - messageImageMarshaller: MessageImageMarshaller, - messageTextActionMarshaller: MessageTextActionMarshaller, - messageActionMarshaller: MessageActionMarshaller, - richTextMarshaller: RichTextMarshaller) { - - def apply( - headerImagePromptMessageContent: HeaderImagePromptMessageContent - ): urt.MessageContent = - urt.MessageContent.HeaderImagePrompt( - urt.HeaderImagePrompt( - headerImage = messageImageMarshaller(headerImagePromptMessageContent.headerImage), - headerText = headerImagePromptMessageContent.headerText, - bodyText = headerImagePromptMessageContent.bodyText, - primaryButtonAction = - headerImagePromptMessageContent.primaryButtonAction.map(messageTextActionMarshaller(_)), - secondaryButtonAction = - headerImagePromptMessageContent.secondaryButtonAction.map(messageTextActionMarshaller(_)), - action = headerImagePromptMessageContent.action.map(messageActionMarshaller(_)), - headerRichText = headerImagePromptMessageContent.headerRichText.map(richTextMarshaller(_)), - bodyRichText = headerImagePromptMessageContent.bodyRichText.map(richTextMarshaller(_)) - ) - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/InlinePromptMessageContentMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/InlinePromptMessageContentMarshaller.docx new file mode 100644 index 000000000..cd2aa06f4 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/InlinePromptMessageContentMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/InlinePromptMessageContentMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/InlinePromptMessageContentMarshaller.scala deleted file mode 100644 index e33830dbb..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/InlinePromptMessageContentMarshaller.scala +++ /dev/null @@ -1,32 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.message - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.SocialContextMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.richtext.RichTextMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.message.InlinePromptMessageContent -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class InlinePromptMessageContentMarshaller @Inject() ( - messageTextActionMarshaller: MessageTextActionMarshaller, - richTextMarshaller: RichTextMarshaller, - socialContextMarshaller: SocialContextMarshaller, - userFacepileMarshaller: UserFacepileMarshaller) { - - def apply(inlinePromptMessageContent: InlinePromptMessageContent): urt.MessageContent = - urt.MessageContent.InlinePrompt( - urt.InlinePrompt( - headerText = inlinePromptMessageContent.headerText, - bodyText = inlinePromptMessageContent.bodyText, - primaryButtonAction = - inlinePromptMessageContent.primaryButtonAction.map(messageTextActionMarshaller(_)), - secondaryButtonAction = - inlinePromptMessageContent.secondaryButtonAction.map(messageTextActionMarshaller(_)), - headerRichText = inlinePromptMessageContent.headerRichText.map(richTextMarshaller(_)), - bodyRichText = inlinePromptMessageContent.bodyRichText.map(richTextMarshaller(_)), - socialContext = inlinePromptMessageContent.socialContext.map(socialContextMarshaller(_)), - userFacepile = inlinePromptMessageContent.userFacepile.map(userFacepileMarshaller(_)) - ) - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessageActionMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessageActionMarshaller.docx new file mode 100644 index 000000000..357757762 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessageActionMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessageActionMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessageActionMarshaller.scala deleted file mode 100644 index ca8612585..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessageActionMarshaller.scala +++ /dev/null @@ -1,25 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.message - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.CallbackMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.ClientEventInfoMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.message.MessageAction -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class MessageActionMarshaller @Inject() ( - callbackMarshaller: CallbackMarshaller, - clientEventInfoMarshaller: ClientEventInfoMarshaller) { - - def apply(messageAction: MessageAction): urt.MessageAction = { - - urt.MessageAction( - dismissOnClick = messageAction.dismissOnClick, - url = messageAction.url, - clientEventInfo = messageAction.clientEventInfo.map(clientEventInfoMarshaller(_)), - onClickCallbacks = - messageAction.onClickCallbacks.map(callbackList => callbackList.map(callbackMarshaller(_))) - ) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessageActionTypeMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessageActionTypeMarshaller.docx new file mode 100644 index 000000000..5ad746d9f Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessageActionTypeMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessageActionTypeMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessageActionTypeMarshaller.scala deleted file mode 100644 index dde02b150..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessageActionTypeMarshaller.scala +++ /dev/null @@ -1,15 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.message - -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.message.FollowAllMessageActionType -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.message.MessageActionType -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class MessageActionTypeMarshaller @Inject() () { - - def apply(messageActionType: MessageActionType): urt.MessageActionType = messageActionType match { - case FollowAllMessageActionType => urt.MessageActionType.FollowAll - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessageContentMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessageContentMarshaller.docx new file mode 100644 index 000000000..f6a082809 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessageContentMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessageContentMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessageContentMarshaller.scala deleted file mode 100644 index 01f1501ad..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessageContentMarshaller.scala +++ /dev/null @@ -1,25 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.message - -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.message.CompactPromptMessageContent -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.message.InlinePromptMessageContent -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.message.HeaderImagePromptMessageContent -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.message.MessageContent -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class MessageContentMarshaller @Inject() ( - inlinePromptMessageContentMarshaller: InlinePromptMessageContentMarshaller, - headerImagePromptMessageContentMarshaller: HeaderImagePromptMessageContentMarshaller, - compactPromptMessageContentMarshaller: CompactPromptMessageContentMarshaller) { - - def apply(messageContent: MessageContent): urt.MessageContent = messageContent match { - case inlinePromptMessageContent: InlinePromptMessageContent => - inlinePromptMessageContentMarshaller(inlinePromptMessageContent) - case headerImagePromptMessageContent: HeaderImagePromptMessageContent => - headerImagePromptMessageContentMarshaller(headerImagePromptMessageContent) - case compactPromptMessageContent: CompactPromptMessageContent => - compactPromptMessageContentMarshaller(compactPromptMessageContent) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessageImageMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessageImageMarshaller.docx new file mode 100644 index 000000000..aee5b0f56 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessageImageMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessageImageMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessageImageMarshaller.scala deleted file mode 100644 index c10a26903..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessageImageMarshaller.scala +++ /dev/null @@ -1,19 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.message - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.ImageVariantMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.message.MessageImage -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class MessageImageMarshaller @Inject() ( - imageVariantMarshaller: ImageVariantMarshaller) { - - def apply(messageImage: MessageImage): urt.MessageImage = { - urt.MessageImage( - imageVariants = messageImage.imageVariants.map(imageVariantMarshaller(_)), - backgroundColor = messageImage.backgroundColor - ) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessagePromptItemMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessagePromptItemMarshaller.docx new file mode 100644 index 000000000..41ca8b8be Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessagePromptItemMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessagePromptItemMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessagePromptItemMarshaller.scala deleted file mode 100644 index a5a4a3a77..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessagePromptItemMarshaller.scala +++ /dev/null @@ -1,23 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.message - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.CallbackMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.message.MessagePromptItem -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class MessagePromptItemMarshaller @Inject() ( - messageContentMarshaller: MessageContentMarshaller, - callbackMarshaller: CallbackMarshaller) { - - def apply(messagePromptItem: MessagePromptItem): urt.TimelineItemContent = - urt.TimelineItemContent.Message( - urt.MessagePrompt( - content = messageContentMarshaller(messagePromptItem.content), - impressionCallbacks = messagePromptItem.impressionCallbacks.map { callbackList => - callbackList.map(callbackMarshaller(_)) - } - ) - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessageTextActionMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessageTextActionMarshaller.docx new file mode 100644 index 000000000..86aa5d0bc Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessageTextActionMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessageTextActionMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessageTextActionMarshaller.scala deleted file mode 100644 index f7a21d6e1..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/MessageTextActionMarshaller.scala +++ /dev/null @@ -1,17 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.message - -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.message.MessageTextAction -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class MessageTextActionMarshaller @Inject() ( - messageActionMarshaller: MessageActionMarshaller) { - - def apply(messageTextAction: MessageTextAction): urt.MessageTextAction = - urt.MessageTextAction( - text = messageTextAction.text, - action = messageActionMarshaller(messageTextAction.action) - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/UserFacepileDisplayTypeMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/UserFacepileDisplayTypeMarshaller.docx new file mode 100644 index 000000000..fa6bd1bf5 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/UserFacepileDisplayTypeMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/UserFacepileDisplayTypeMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/UserFacepileDisplayTypeMarshaller.scala deleted file mode 100644 index 9c7d39f0c..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/UserFacepileDisplayTypeMarshaller.scala +++ /dev/null @@ -1,18 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.message - -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.message.LargeUserFacepileDisplayType -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.message.CompactUserFacepileDisplayType -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.message.UserFacepileDisplayType -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class UserFacepileDisplayTypeMarshaller @Inject() () { - - def apply(userFacepileDisplayType: UserFacepileDisplayType): urt.UserFacepileDisplayType = - userFacepileDisplayType match { - case LargeUserFacepileDisplayType => urt.UserFacepileDisplayType.Large - case CompactUserFacepileDisplayType => urt.UserFacepileDisplayType.Compact - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/UserFacepileMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/UserFacepileMarshaller.docx new file mode 100644 index 000000000..ae36fc3a5 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/UserFacepileMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/UserFacepileMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/UserFacepileMarshaller.scala deleted file mode 100644 index c6f5dabc8..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/message/UserFacepileMarshaller.scala +++ /dev/null @@ -1,23 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.message - -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.message.UserFacepile -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class UserFacepileMarshaller @Inject() ( - messageActionTypeMarshaller: MessageActionTypeMarshaller, - messageTextActionMarshaller: MessageTextActionMarshaller, - userFacepileDisplayTypeMarshaller: UserFacepileDisplayTypeMarshaller) { - - def apply(userFacepile: UserFacepile): urt.UserFacepile = - urt.UserFacepile( - userIds = userFacepile.userIds, - featuredUserIds = userFacepile.featuredUserIds, - action = userFacepile.action.map(messageTextActionMarshaller(_)), - actionType = userFacepile.actionType.map(messageActionTypeMarshaller(_)), - displaysFeaturingText = userFacepile.displaysFeaturingText, - displayType = userFacepile.displayType.map(userFacepileDisplayTypeMarshaller(_)) - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/moment/MomentAnnotationItemMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/moment/MomentAnnotationItemMarshaller.docx new file mode 100644 index 000000000..339ccb5f4 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/moment/MomentAnnotationItemMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/moment/MomentAnnotationItemMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/moment/MomentAnnotationItemMarshaller.scala deleted file mode 100644 index 59f33f3d1..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/moment/MomentAnnotationItemMarshaller.scala +++ /dev/null @@ -1,20 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.moment - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.richtext.RichTextMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.moment.MomentAnnotationItem -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class MomentAnnotationItemMarshaller @Inject() (richTextMarshaller: RichTextMarshaller) { - def apply(momentAnnotationItem: MomentAnnotationItem): urt.TimelineItemContent = { - urt.TimelineItemContent.MomentAnnotation( - urt.MomentAnnotation( - annotationId = momentAnnotationItem.id, - text = momentAnnotationItem.text.map(richTextMarshaller(_)), - header = momentAnnotationItem.header.map(richTextMarshaller(_)), - ) - ) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/PromptContentMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/PromptContentMarshaller.docx new file mode 100644 index 000000000..0fd7137e5 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/PromptContentMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/PromptContentMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/PromptContentMarshaller.scala deleted file mode 100644 index 9b669dd04..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/PromptContentMarshaller.scala +++ /dev/null @@ -1,17 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.prompt - -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.prompt.PromptContent -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.prompt.RelevancePromptContent -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class PromptContentMarshaller @Inject() ( - relevancePromptContentMarshaller: RelevancePromptContentMarshaller) { - - def apply(promptContent: PromptContent): urt.PromptContent = promptContent match { - case relevancePromptContent: RelevancePromptContent => - urt.PromptContent.RelevancePrompt(relevancePromptContentMarshaller(relevancePromptContent)) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/PromptItemMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/PromptItemMarshaller.docx new file mode 100644 index 000000000..3555aaaad Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/PromptItemMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/PromptItemMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/PromptItemMarshaller.scala deleted file mode 100644 index ccefd082b..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/PromptItemMarshaller.scala +++ /dev/null @@ -1,26 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.prompt - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.CallbackMarshaller -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.ClientEventInfoMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.prompt.PromptItem -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class PromptItemMarshaller @Inject() ( - promptContentMarshaller: PromptContentMarshaller, - clientEventInfoMarshaller: ClientEventInfoMarshaller, - callbackMarshaller: CallbackMarshaller) { - - def apply(relevancePromptItem: PromptItem): urt.TimelineItemContent = { - urt.TimelineItemContent.Prompt( - urt.Prompt( - content = promptContentMarshaller(relevancePromptItem.content), - clientEventInfo = relevancePromptItem.clientEventInfo.map(clientEventInfoMarshaller(_)), - impressionCallbacks = relevancePromptItem.impressionCallbacks.map { callbackList => - callbackList.map(callbackMarshaller(_)) - } - )) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/RelevancePromptContentMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/RelevancePromptContentMarshaller.docx new file mode 100644 index 000000000..009bd5aec Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/RelevancePromptContentMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/RelevancePromptContentMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/RelevancePromptContentMarshaller.scala deleted file mode 100644 index be5d87003..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/RelevancePromptContentMarshaller.scala +++ /dev/null @@ -1,29 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.prompt - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.CallbackMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.prompt.RelevancePromptContent -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class RelevancePromptContentMarshaller @Inject() ( - callbackMarshaller: CallbackMarshaller, - relevancePromptDisplayTypeMarshaller: RelevancePromptDisplayTypeMarshaller, - relevancePromptFollowUpFeedbackTypeMarshaller: RelevancePromptFollowUpFeedbackTypeMarshaller) { - - def apply(relevancePromptContent: RelevancePromptContent): urt.RelevancePrompt = - urt.RelevancePrompt( - title = relevancePromptContent.title, - confirmation = relevancePromptContent.confirmation, - isRelevantText = relevancePromptContent.isRelevantText, - notRelevantText = relevancePromptContent.notRelevantText, - isRelevantCallback = callbackMarshaller(relevancePromptContent.isRelevantCallback), - notRelevantCallback = callbackMarshaller(relevancePromptContent.notRelevantCallback), - displayType = relevancePromptDisplayTypeMarshaller(relevancePromptContent.displayType), - isRelevantFollowUp = relevancePromptContent.isRelevantFollowUp.map( - relevancePromptFollowUpFeedbackTypeMarshaller(_)), - notRelevantFollowUp = relevancePromptContent.notRelevantFollowUp.map( - relevancePromptFollowUpFeedbackTypeMarshaller(_)) - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/RelevancePromptDisplayTypeMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/RelevancePromptDisplayTypeMarshaller.docx new file mode 100644 index 000000000..3aa497611 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/RelevancePromptDisplayTypeMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/RelevancePromptDisplayTypeMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/RelevancePromptDisplayTypeMarshaller.scala deleted file mode 100644 index f81247e95..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/RelevancePromptDisplayTypeMarshaller.scala +++ /dev/null @@ -1,18 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.prompt - -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.prompt._ -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Singleton - -@Singleton -class RelevancePromptDisplayTypeMarshaller { - - def apply( - relevancePromptDisplayType: RelevancePromptDisplayType - ): urt.RelevancePromptDisplayType = relevancePromptDisplayType match { - case Normal => urt.RelevancePromptDisplayType.Normal - case Compact => urt.RelevancePromptDisplayType.Compact - case Large => urt.RelevancePromptDisplayType.Large - case ThumbsUpAndDown => urt.RelevancePromptDisplayType.ThumbsUpAndDown - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/RelevancePromptFollowUpFeedbackTypeMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/RelevancePromptFollowUpFeedbackTypeMarshaller.docx new file mode 100644 index 000000000..ab1a4a7a2 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/RelevancePromptFollowUpFeedbackTypeMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/RelevancePromptFollowUpFeedbackTypeMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/RelevancePromptFollowUpFeedbackTypeMarshaller.scala deleted file mode 100644 index 8b01c14f6..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/RelevancePromptFollowUpFeedbackTypeMarshaller.scala +++ /dev/null @@ -1,19 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.prompt - -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.prompt._ -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class RelevancePromptFollowUpFeedbackTypeMarshaller @Inject() ( - relevancePromptFollowUpTextInputMarshaller: RelevancePromptFollowUpTextInputMarshaller) { - - def apply( - relevancePromptFollowUpFeedbackType: RelevancePromptFollowUpFeedbackType - ): urt.RelevancePromptFollowUpFeedbackType = relevancePromptFollowUpFeedbackType match { - case relevancePromptFollowUpTextInput: RelevancePromptFollowUpTextInput => - urt.RelevancePromptFollowUpFeedbackType.FollowUpTextInput( - relevancePromptFollowUpTextInputMarshaller(relevancePromptFollowUpTextInput)) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/RelevancePromptFollowUpTextInputMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/RelevancePromptFollowUpTextInputMarshaller.docx new file mode 100644 index 000000000..184851b96 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/RelevancePromptFollowUpTextInputMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/RelevancePromptFollowUpTextInputMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/RelevancePromptFollowUpTextInputMarshaller.scala deleted file mode 100644 index d244e628f..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/prompt/RelevancePromptFollowUpTextInputMarshaller.scala +++ /dev/null @@ -1,20 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.prompt - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.metadata.CallbackMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.prompt.RelevancePromptFollowUpTextInput -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class RelevancePromptFollowUpTextInputMarshaller @Inject() ( - callbackMarshaller: CallbackMarshaller) { - - def apply( - relevancePromptFollowUpTextInput: RelevancePromptFollowUpTextInput - ): urt.RelevancePromptFollowUpTextInput = urt.RelevancePromptFollowUpTextInput( - context = relevancePromptFollowUpTextInput.context, - textFieldPlaceholder = relevancePromptFollowUpTextInput.textFieldPlaceholder, - sendTextCallback = callbackMarshaller(relevancePromptFollowUpTextInput.sendTextCallback) - ) -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/suggestion/SpellingActionTypeMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/suggestion/SpellingActionTypeMarshaller.docx new file mode 100644 index 000000000..f7c729631 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/suggestion/SpellingActionTypeMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/suggestion/SpellingActionTypeMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/suggestion/SpellingActionTypeMarshaller.scala deleted file mode 100644 index 737c8e3ff..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/suggestion/SpellingActionTypeMarshaller.scala +++ /dev/null @@ -1,16 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.suggestion - -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.suggestion._ -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Singleton - -@Singleton -class SpellingActionTypeMarshaller { - - def apply(spellingActionType: SpellingActionType): urt.SpellingActionType = - spellingActionType match { - case ReplaceSpellingActionType => urt.SpellingActionType.Replace - case ExpandSpellingActionType => urt.SpellingActionType.Expand - case SuggestSpellingActionType => urt.SpellingActionType.Suggest - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/suggestion/SpellingItemMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/suggestion/SpellingItemMarshaller.docx new file mode 100644 index 000000000..83fd2ce33 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/suggestion/SpellingItemMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/suggestion/SpellingItemMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/suggestion/SpellingItemMarshaller.scala deleted file mode 100644 index 4e0afe10c..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/suggestion/SpellingItemMarshaller.scala +++ /dev/null @@ -1,22 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.suggestion - -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.suggestion.SpellingItem -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class SpellingItemMarshaller @Inject() ( - textResultMarshaller: TextResultMarshaller, - spellingActionTypeMarshaller: SpellingActionTypeMarshaller) { - - def apply(spellingItem: SpellingItem): urt.TimelineItemContent = { - urt.TimelineItemContent.Spelling( - urt.Spelling( - spellingResult = textResultMarshaller(spellingItem.textResult), - spellingAction = spellingItem.spellingActionType.map(spellingActionTypeMarshaller(_)), - originalQuery = spellingItem.originalQuery - ) - ) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/suggestion/TextResultMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/suggestion/TextResultMarshaller.docx new file mode 100644 index 000000000..2bc916a51 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/suggestion/TextResultMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/suggestion/TextResultMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/suggestion/TextResultMarshaller.scala deleted file mode 100644 index 44c353b48..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/suggestion/TextResultMarshaller.scala +++ /dev/null @@ -1,25 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.suggestion - -import com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.highlight.HighlightedSectionMarshaller -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.highlight.HighlightedSection -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.suggestion.TextResult -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class TextResultMarshaller @Inject() (highlightedSectionMarshaller: HighlightedSectionMarshaller) { - - def apply(textResult: TextResult): urt.TextResult = { - val hitHighlights = textResult.hitHighlights.map { - highlightedSections: Seq[HighlightedSection] => - highlightedSections.map(highlightedSectionMarshaller(_)) - } - - urt.TextResult( - text = textResult.text, - hitHighlights = hitHighlights, - score = textResult.score, - querySource = textResult.querySource) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/thread/ThreadHeaderContentMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/thread/ThreadHeaderContentMarshaller.docx new file mode 100644 index 000000000..e93a895e7 Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/thread/ThreadHeaderContentMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/thread/ThreadHeaderContentMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/thread/ThreadHeaderContentMarshaller.scala deleted file mode 100644 index de79fe4e8..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/thread/ThreadHeaderContentMarshaller.scala +++ /dev/null @@ -1,14 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.thread - -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.thread._ -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class ThreadHeaderContentMarshaller @Inject() () { - def apply(content: ThreadHeaderContent): urt.ThreadHeaderContent = content match { - case UserThreadHeader(userId) => - urt.ThreadHeaderContent.UserThreadHeader(urt.UserThreadHeader(userId)) - } -} diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/thread/ThreadHeaderItemMarshaller.docx b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/thread/ThreadHeaderItemMarshaller.docx new file mode 100644 index 000000000..da31c5a4e Binary files /dev/null and b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/thread/ThreadHeaderItemMarshaller.docx differ diff --git a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/thread/ThreadHeaderItemMarshaller.scala b/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/thread/ThreadHeaderItemMarshaller.scala deleted file mode 100644 index 8d88d7d33..000000000 --- a/product-mixer/core/src/main/scala/com/twitter/product_mixer/core/functional_component/marshaller/response/urt/item/thread/ThreadHeaderItemMarshaller.scala +++ /dev/null @@ -1,18 +0,0 @@ -package com.twitter.product_mixer.core.functional_component.marshaller.response.urt.item.thread - -import com.twitter.product_mixer.core.model.marshalling.response.urt.item.thread.ThreadHeaderItem -import com.twitter.timelines.render.{thriftscala => urt} -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class ThreadHeaderItemMarshaller @Inject() ( - threadHeaderContentMarshaller: ThreadHeaderContentMarshaller) { - - def apply(threadHeaderItem: ThreadHeaderItem): urt.TimelineItemContent.ThreadHeader = - urt.TimelineItemContent.ThreadHeader( - urt.ThreadHeaderItem( - content = threadHeaderContentMarshaller(threadHeaderItem.content) - ) - ) -}