/** * Generated by API Builder - https://www.apibuilder.io * Service version: 1.1.0 * User agent: apibuilder app.apibuilder.io/hbc/api-product-recommendations-lat/1.1.0/play_2_6 */ package com.hbc.api.product.recommendations.lat.v1.models { /** * Product price in USD * * @param was formatted price in USD * @param now formatted price in USD * @param onSale true if now price is < was price. Used to */ final case class Price( was: String, now: String, onSale: Boolean = false ) /** * @param rating customer review's rating * @param numReviews number of customers that reviewed the product */ final case class Recommendation( productId: String, productName: String, productUrl: String, productImageUrl: String, brandName: String, price: com.hbc.api.product.recommendations.lat.v1.models.Price, rating: _root_.scala.Option[Double] = None, numReviews: _root_.scala.Option[Long] = None ) final case class SimilarProductRecommendation( recommendations: Seq[com.hbc.api.product.recommendations.lat.v1.models.Recommendation] ) sealed trait SimilarProductContext extends _root_.scala.Product with _root_.scala.Serializable object SimilarProductContext { /** * PDP page. (Strict category match) */ case object Pdp extends SimilarProductContext { override def toString = "pdp" } /** * UNDEFINED captures values that are sent either in error or * that were added by the server after this library was * generated. We want to make it easy and obvious to users of * this library to handle this case gracefully. * * We use all CAPS for the variable name to avoid collisions * with the camel cased values above. */ final case class UNDEFINED(override val toString: String) extends SimilarProductContext /** * all returns a list of all the valid, known values. We use * lower case to avoid collisions with the camel cased values * above. */ val all: scala.List[SimilarProductContext] = scala.List(Pdp) private val byName: Map[String, SimilarProductContext] = all.map(x => x.toString.toLowerCase -> x).toMap def apply(value: String): SimilarProductContext = fromString(value).getOrElse(UNDEFINED(value)) def fromString(value: String): _root_.scala.Option[SimilarProductContext] = byName.get(value.toLowerCase) } }