com.m3.octoparts.ws.AggregateResponseEnrichment

RichAggregateResponse

Related Doc: package AggregateResponseEnrichment

implicit final class RichAggregateResponse extends AnyVal

Convenience methods to make it easier to work with AggregateResponse

Linear Supertypes
AnyVal, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. RichAggregateResponse
  2. AnyVal
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RichAggregateResponse(aggResp: AggregateResponse)

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  2. final def ##(): Int

    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  4. val aggResp: AggregateResponse

  5. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  6. def getClass(): Class[_ <: AnyVal]

    Definition Classes
    AnyVal → Any
  7. def getJsonPart[A](id: String)(implicit arg0: Reads[A]): Option[A]

    Logs any errors from tryJsonPart and collapses to an Option

    Logs any errors from tryJsonPart and collapses to an Option

    A
    id
    returns

  8. def getJsonPartOrElse[A](id: String, default: ⇒ A)(implicit arg0: Reads[A]): A

  9. def getJsonPartOrError[A, E](id: String)(implicit arg0: Reads[A], arg1: Reads[E]): Either[Option[E], A]

    Deserializes like tryJsonPart, but will try instead to deserialize to an E if the part response contained errors

    Deserializes like tryJsonPart, but will try instead to deserialize to an E if the part response contained errors

    A
    E

  10. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  11. def toString(): String

    Definition Classes
    Any
  12. def tryFindPart(id: String): Try[PartResponse]

  13. def tryJsonPart[A](id: String)(implicit arg0: Reads[A]): Try[A]

    Extracts the part with the given ID from the Octoparts response and deserializes its JSON content to an A.

    Extracts the part with the given ID from the Octoparts response and deserializes its JSON content to an A.

    Note that an appropriate play.api.libs.json.Reads must be available in implicit scope.

    Will return a Failure if: - a part with the given ID is not present in the response - the part has no content - the JSON parsing fails (e.g. the content is not JSON, or the JSON is broken in some way) - the JSON deserialization fails (i.e. the JSON is valid, but cannot be deserialized into an A)

    Note: - The method does not check the status code of the response or the presence of error messages.

    A

    the result type, i.e. the type of the JSON-serialized object

    id

    the part request unique id (or partId if the part request did not specify an ID)

    returns

    the object, or Failure if it could not be found and deserialized for some reason.

Inherited from AnyVal

Inherited from Any

Ungrouped