com.m3.octoparts.ws.AggregateResponseEnrichment
Logs any errors from tryJsonPart and collapses to an Option
Logs any errors from tryJsonPart and collapses to an Option
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
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.
the result type, i.e. the type of the JSON-serialized object
the part request unique id (or partId if the part request did not specify an ID)
the object, or Failure if it could not be found and deserialized for some reason.
Convenience methods to make it easier to work with AggregateResponse