Skip to content

Commit

Permalink
Add a new type for deferred external responses (#261)
Browse files Browse the repository at this point in the history
* Add new type for giving a response from an integrated service indicating the response will arrive later.

* Add json encoder and decoder.

* fix typo
  • Loading branch information
Happy0 authored Jul 21, 2020
1 parent b8e9a4e commit 07828d3
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,23 @@ object SignatureInput {
implicit val signatureInputEnc: Encoder[SignatureInput] = deriveEncoder
}

/**
* A External Call response indicating that the response could take an extended amount time to
* arrive (due to waiting on some action by a user, for example), and the ultimate completed response
* will be given asynchronously.
*
* @param expires when the request should be considered failed if no response comes before this time.
*/
final case class DeferredResponse(
// If a response isn't received by this time, the caller should consider the request to be expired
expires: Option[Instant] = None
)

object DeferredResponse {
implicit val deferredResponseDec: Decoder[DeferredResponse] = deriveDecoder
implicit val deferredResponseEnc: Encoder[DeferredResponse] = deriveEncoder
}

final case class SignatureOutput(
// Json representation of List[Email]
signerEmailsJson: String,
Expand Down

0 comments on commit 07828d3

Please sign in to comment.