This is the client library for the send-letter-service aka Bulk Print.
- JDK 21
- Project requires Spring Boot v3.x to be present
Just include the library as your dependency and you will be to use the client class. Health check for send-letter-producer is provided as well.
Components provided by this library will get automatically configured in a Spring context if send-letter.url
configuration property is defined and does not equal false
.
False would disable the auto configuration of the API.
The project uses Gradle as a build tool but you don't have install it locally since there is a
./gradlew
wrapper script.
To build project execute the following command:
./gradlew build
This library includes the following API models:
- Document: Represents a document with a template and associated values.
- LetterStatus: Represents the status of a letter.
- LetterWithPdfsRequest: Represents a letter with PDFs request.
- LetterV3: Represents a letter with the LetterV3 request.
- Letter: Represents a letter with PDFs requests (deprecated)
This library provides methods to make the following API requests to the send-letter-service:
Sending a Letter
Deprecated Method (Not Recommended): This method is deprecated and will be removed in future versions. Use the updated methods with specific request objects instead.
SendLetterResponse sendLetter(String serviceAuthHeader, Letter letter)
Sending a Letter with LetterV3 Request:
SendLetterResponse sendLetter(String serviceAuthHeader, LetterV3 letter)
Sending a Letter with PDFs Request:
SendLetterResponse sendLetter(String serviceAuthHeader, LetterWithPdfsRequest letter)
Confirming Request Creation:
void confirmRequestIsCreated(UUID letterId)
This method confirms that the request is created successfully.
To run all checks (including unit tests) execute the following command:
./gradlew check
Add the following dependency to your build.gradle
file:
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.hmcts:send-letter-client:1.0.0' // Replace with the latest version
}
We use SemVer for versioning. For the versions available, see the tags on this repository.
This project is licensed under the MIT License - see the LICENSE file for details.