Package com.idanalyzer
Class Contract
java.lang.Object
com.idanalyzer.Contract
Contract generation & template management (/generate, /contract).
-
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.databind.JsonNodeCreate a contract template (POST /contract).com.fasterxml.jackson.databind.JsonNodedeleteTemplate(String templateId) Delete a contract template (DELETE /contract/{id}).com.fasterxml.jackson.databind.JsonNodeGenerate a document from a template (POST /generate).com.fasterxml.jackson.databind.JsonNodegetTemplate(String templateId) Get a contract template (GET /contract/{id}).com.fasterxml.jackson.databind.JsonNodelistTemplate(int order, int limit, int offset, String filterTemplateId) List contract templates (GET /contract).com.fasterxml.jackson.databind.JsonNodeupdateTemplate(String templateId, String name, String content, String orientation, String timezone, String font) Update a contract template (POST /contract/{id}).
-
Method Details
-
generate
public com.fasterxml.jackson.databind.JsonNode generate(String templateId, String format, String transactionId, Map<String, Object> fillData) Generate a document from a template (POST /generate).- Parameters:
templateId- the contract template id to generate from.format- the output format; defaults to "PDF" when null/empty.transactionId- optional transaction id to pull fill data from; sent when non-empty.fillData- optional map of fields to populate the template; sent when non-empty.- Returns:
- the API response as a
JsonNode. - Throws:
InvalidArgumentException- if templateId is null or empty.ApiException- if the API returns an error or a transport error occurs.
-
listTemplate
public com.fasterxml.jackson.databind.JsonNode listTemplate(int order, int limit, int offset, String filterTemplateId) List contract templates (GET /contract).- Parameters:
order- sort order for the results.limit- maximum number of templates to return.offset- number of templates to skip (for pagination).filterTemplateId- optional template id to filter by; sent when non-empty.- Returns:
- the API response as a
JsonNode. - Throws:
ApiException- if the API returns an error or a transport error occurs.
-
getTemplate
Get a contract template (GET /contract/{id}).- Parameters:
templateId- the contract template id to retrieve.- Returns:
- the API response as a
JsonNode. - Throws:
InvalidArgumentException- if templateId is null or empty.ApiException- if the API returns an error or a transport error occurs.
-
createTemplate
public com.fasterxml.jackson.databind.JsonNode createTemplate(String name, String content, String orientation, String timezone, String font) Create a contract template (POST /contract).- Parameters:
name- the template name.content- the template content (HTML/markup).orientation- page orientation; defaults to "0" when null.timezone- the template timezone; defaults to "UTC" when null.font- the template font; defaults to "Open Sans" when null.- Returns:
- the API response as a
JsonNode. - Throws:
InvalidArgumentException- if name or content is null or empty.ApiException- if the API returns an error or a transport error occurs.
-
updateTemplate
public com.fasterxml.jackson.databind.JsonNode updateTemplate(String templateId, String name, String content, String orientation, String timezone, String font) Update a contract template (POST /contract/{id}).- Parameters:
templateId- the contract template id to update.name- the new template name.content- the new template content (HTML/markup).orientation- page orientation; defaults to "0" when null.timezone- the template timezone; defaults to "UTC" when null.font- the template font; defaults to "Open Sans" when null.- Returns:
- the API response as a
JsonNode. - Throws:
InvalidArgumentException- if templateId is null or empty.ApiException- if the API returns an error or a transport error occurs.
-
deleteTemplate
Delete a contract template (DELETE /contract/{id}).- Parameters:
templateId- the contract template id to delete.- Returns:
- the API response as a
JsonNode. - Throws:
InvalidArgumentException- if templateId is null or empty.ApiException- if the API returns an error or a transport error occurs.
-