class TransactionResource {

    @ApiOperation("Resend transactions for given key or message hash/recipient")
    @ApiResponses({
        @ApiResponse(code = 200, message = "Encoded payload when TYPE is INDIVIDUAL", response = String.class),
        @ApiResponse(code = 500, message = "General error")
    })
    @POST
    @Path("resend")
    @Consumes(APPLICATION_JSON)
    @Produces(TEXT_PLAIN)
    public Response resend(
            @ApiParam(name = "resendRequest", required = true) @Valid @NotNull final ResendRequest resendRequest) {

        LOGGER.debug("Received resend request");

        PublicKey recipient =
                Optional.of(resendRequest)
                        .map(ResendRequest::getPublicKey)
                        .map(Base64Codec.create()::decode)
                        .map(PublicKey::from)
                        .get();

        MessageHash transactionHash =
                Optional.ofNullable(resendRequest)
                        .map(ResendRequest::getKey)
                        .map(Base64.getDecoder()::decode)
                        .map(MessageHash::new)
                        .orElse(null);

        com.quorum.tessera.transaction.ResendRequest request =
                com.quorum.tessera.transaction.ResendRequest.Builder.create()
                        .withType(
                                com.quorum.tessera.transaction.ResendRequest.ResendRequestType.valueOf(
                                        resendRequest.getType().name()))
                        .withRecipient(recipient)
                        .withHash(transactionHash)
                        .build();

        com.quorum.tessera.transaction.ResendResponse response = transactionManager.resend(request);
        Response.ResponseBuilder builder = Response.status(Status.OK);
        Optional.ofNullable(response.getPayload()).map(encoder::encode).ifPresent(builder::entity);
        return builder.build();
    }

    public  TransactionResource(final TransactionManager delegate, final PayloadEncoder payloadEncoder);

}