diff --git a/client/README.md b/client/README.md index 360a90d897abacdb4e03d8bee7f2c4524c7892b4..eb76e58cfebb0415c65b22e2f75fa326bbc59a24 100644 --- a/client/README.md +++ b/client/README.md @@ -1,21 +1,60 @@ ## Client Module ### API Flow + The SdkClientFactory provides fluent API client both for **Sender** and **Subscriber**. -As the flow chart below shows, the fluent client guides through all essentials calls -in order to hand in a correct **Submission**. +As the flow chart below shows, the fluent client guides through all essentials calls in order to hand in a correct ** +Submission**. #### Api client flow for sending a submission +For the actual sender client those calls look like this: + + +<table> +<tr> +<th>Workflow</th> +<th>Java sample calls</th> +</tr> +<tr> +<td> + ```mermaid -flowchart LR +flowchart TD + +A[Create Client] --> B(Provide DestinationID) +B -->|get encryption key| C[Add Attachments] +C -->|send| D[SubmissionForPickup] +C -->|next| E[Add Data] +E -->|send| D[SubmissionForPickup] +``` + +</td> +<td> + +```java -A[retrieveOAuthToken] --> B(Upload Attachements) -B -->|encrypt Attachments| C[Create Submission] -B -->|upload Attachments| C[Result 2] +List<File> attachments... + +// Send without data + ClientFactory.senderClient() + .withDestination(UUID.randomUUID()) + .withAttachments(attachments) + .submit(); + +// Send with data + ClientFactory.senderClient() + .withDestination(UUID.randomUUID()) + .withAttachments(attachments) + .withData("some json or xml content") + .submit(); ``` +</td> +</tr> +</table> + #### Api client flow for subscribing to a submission ```mermaid