com.lacunasoftware.signer.documents.CreateDocumentRequest Maven / Gradle / Ivy
/*
* Dropsigner (HML)
* Authentication
In order to call this APIs, you will need an API key. Set the API key in the header X-Api-Key:
X-Api-Key: your-app|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
HTTP Codes
The APIs will return the following HTTP codes:
Code Description 200 (OK) Request processed successfully. The response is different for each API, please refer to the operation's documentation 400 (Bad Request) Syntax error. For instance, when a required field was not provided 401 (Unauthorized) API key not provided or invalid 403 (Forbidden) API key is valid, but the application has insufficient permissions to complete the requested operation 422 (Unprocessable Entity) API error. The response is as defined in ErrorModel
Error Codes
Some of the error codes returned in a 422 response are provided bellow*:
- CertificateNotFound
- DocumentNotFound
- FolderNotFound
- CpfMismatch
- CpfNotExpected
- InvalidFlowAction
- DocumentInvalidKey
*The codes shown above are the main error codes. Nonetheless, this list is not comprehensive. New codes may be added anytime without previous warning.
Webhooks
It is recomended to subscribe to Webhook events instead of polling APIs. To do so, enable webhooks and register an URL that will receive a POST request whenever one of the events bellow occur.
All requests have the format described in Webhooks.WebhookModel. The data field varies according to the webhook event type:
Event type Description Payload DocumentSigned Triggered when a document is signed. Webhooks.DocumentSignedModel DocumentApproved Triggered when a document is approved. Webhooks.DocumentApprovedModel DocumentRefused Triggered when a document is refused. Webhooks.DocumentRefusedModel DocumentConcluded Triggered when the flow of a document is concluded. Webhooks.DocumentConcludedModel DocumentCanceled Triggered when the document is canceled. Webhooks.DocumentCanceledModel DocumentsCreated (v1.50.0) Triggered when one or more documents are created. Webhooks.DocumentsCreatedModel
To register your application URL and enable Webhooks, access the integrations section in your organization's details page.
*
* OpenAPI spec version: 1.55.2
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package com.lacunasoftware.signer.documents;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;
import com.lacunasoftware.signer.attachments.AttachmentUploadModel;
import com.lacunasoftware.signer.FileUploadModel;
import com.lacunasoftware.signer.flowactions.FlowActionCreateModel;
import com.lacunasoftware.signer.observers.ObserverCreateModel;
import com.lacunasoftware.signer.javaclient.models.UploadModel;
import com.lacunasoftware.signer.XmlNamespaceModel;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import org.threeten.bp.OffsetDateTime;
/**
* CreateDocumentRequest
*/
public class CreateDocumentRequest {
@JsonProperty("files")
@SerializedName("files")
private List files = new ArrayList();
@JsonProperty("attachments")
@SerializedName("attachments")
private List attachments = null;
@JsonProperty("xmlNamespaces")
@SerializedName("xmlNamespaces")
private List xmlNamespaces = null;
@JsonProperty("isEnvelope")
@SerializedName("isEnvelope")
private Boolean isEnvelope = null;
@JsonProperty("envelopeName")
@SerializedName("envelopeName")
private String envelopeName = null;
@JsonProperty("participantsDataFile")
@SerializedName("participantsDataFile")
private UploadModel participantsDataFile = null;
@JsonProperty("folderId")
@SerializedName("folderId")
private UUID folderId = null;
@JsonProperty("description")
@SerializedName("description")
private String description = null;
@JsonProperty("flowActions")
@SerializedName("flowActions")
private List flowActions = new ArrayList();
@JsonProperty("observers")
@SerializedName("observers")
private List observers = null;
@JsonProperty("disablePendingActionNotifications")
@SerializedName("disablePendingActionNotifications")
private Boolean disablePendingActionNotifications = null;
@JsonProperty("newFolderName")
@SerializedName("newFolderName")
private String newFolderName = null;
@JsonProperty("forceCadesSignature")
@SerializedName("forceCadesSignature")
private Boolean forceCadesSignature = null;
@JsonProperty("notifiedEmails")
@SerializedName("notifiedEmails")
private List notifiedEmails = null;
@JsonProperty("additionalInfo")
@SerializedName("additionalInfo")
private DocumentAdditionalInfoData additionalInfo = null;
@JsonProperty("tags")
@SerializedName("tags")
private List tags = null;
@JsonProperty("expirationDate")
@SerializedName("expirationDate")
private OffsetDateTime expirationDate = null;
public CreateDocumentRequest files(List files) {
this.files = files;
return this;
}
public CreateDocumentRequest addFilesItem(FileUploadModel filesItem) {
this.files.add(filesItem);
return this;
}
/**
* The files to submit. Each file will create a document.
* @return files
**/
@Schema(required = true, description = "The files to submit. Each file will create a document.")
public List getFiles() {
return files;
}
public void setFiles(List files) {
this.files = files;
}
public CreateDocumentRequest attachments(List attachments) {
this.attachments = attachments;
return this;
}
public CreateDocumentRequest addAttachmentsItem(AttachmentUploadModel attachmentsItem) {
if (this.attachments == null) {
this.attachments = new ArrayList();
}
this.attachments.add(attachmentsItem);
return this;
}
/**
* The attachments to submit. Each document will have the same attachments.
* @return attachments
**/
@Schema(description = "The attachments to submit. Each document will have the same attachments.")
public List getAttachments() {
return attachments;
}
public void setAttachments(List attachments) {
this.attachments = attachments;
}
public CreateDocumentRequest xmlNamespaces(List xmlNamespaces) {
this.xmlNamespaces = xmlNamespaces;
return this;
}
public CreateDocumentRequest addXmlNamespacesItem(XmlNamespaceModel xmlNamespacesItem) {
if (this.xmlNamespaces == null) {
this.xmlNamespaces = new ArrayList();
}
this.xmlNamespaces.add(xmlNamespacesItem);
return this;
}
/**
* Optional parameter for XML documents. This namespace will be used by all files in Lacuna.Signer.Api.Documents.CreateDocumentRequest.Files.
* @return xmlNamespaces
**/
@Schema(description = "Optional parameter for XML documents. This namespace will be used by all files in Lacuna.Signer.Api.Documents.CreateDocumentRequest.Files.")
public List getXmlNamespaces() {
return xmlNamespaces;
}
public void setXmlNamespaces(List xmlNamespaces) {
this.xmlNamespaces = xmlNamespaces;
}
public CreateDocumentRequest isEnvelope(Boolean isEnvelope) {
this.isEnvelope = isEnvelope;
return this;
}
/**
* If true, groups all files into a single document (the envelope). All files must be in PDF format.
* @return isEnvelope
**/
@Schema(description = "If true, groups all files into a single document (the envelope). All files must be in PDF format.")
public Boolean isIsEnvelope() {
return isEnvelope;
}
public void setIsEnvelope(Boolean isEnvelope) {
this.isEnvelope = isEnvelope;
}
public CreateDocumentRequest envelopeName(String envelopeName) {
this.envelopeName = envelopeName;
return this;
}
/**
* The name of the document if the envelope option is enabled (see \"IsEnvelope\" property).
* @return envelopeName
**/
@Schema(description = "The name of the document if the envelope option is enabled (see \"IsEnvelope\" property).")
public String getEnvelopeName() {
return envelopeName;
}
public void setEnvelopeName(String envelopeName) {
this.envelopeName = envelopeName;
}
public CreateDocumentRequest participantsDataFile(UploadModel participantsDataFile) {
this.participantsDataFile = participantsDataFile;
return this;
}
/**
* Get participantsDataFile
* @return participantsDataFile
**/
@Schema(description = "")
public UploadModel getParticipantsDataFile() {
return participantsDataFile;
}
public void setParticipantsDataFile(UploadModel participantsDataFile) {
this.participantsDataFile = participantsDataFile;
}
public CreateDocumentRequest folderId(UUID folderId) {
this.folderId = folderId;
return this;
}
/**
* The id of the folder in which the document should be placed or null if it should not be placed in any specific folder.
* @return folderId
**/
@Schema(description = "The id of the folder in which the document should be placed or null if it should not be placed in any specific folder.")
public UUID getFolderId() {
return folderId;
}
public void setFolderId(UUID folderId) {
this.folderId = folderId;
}
public CreateDocumentRequest description(String description) {
this.description = description;
return this;
}
/**
* A description to be added to the document(s). This will be presented to all participants in the document details screen and in pending action notifications.
* @return description
**/
@Schema(description = "A description to be added to the document(s). This will be presented to all participants in the document details screen and in pending action notifications.")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public CreateDocumentRequest flowActions(List flowActions) {
this.flowActions = flowActions;
return this;
}
public CreateDocumentRequest addFlowActionsItem(FlowActionCreateModel flowActionsItem) {
this.flowActions.add(flowActionsItem);
return this;
}
/**
* The list of actions (signers and approvers) that will be in the document.
* @return flowActions
**/
@Schema(required = true, description = "The list of actions (signers and approvers) that will be in the document.")
public List getFlowActions() {
return flowActions;
}
public void setFlowActions(List flowActions) {
this.flowActions = flowActions;
}
public CreateDocumentRequest observers(List observers) {
this.observers = observers;
return this;
}
public CreateDocumentRequest addObserversItem(ObserverCreateModel observersItem) {
if (this.observers == null) {
this.observers = new ArrayList();
}
this.observers.add(observersItem);
return this;
}
/**
* Get observers
* @return observers
**/
@Schema(description = "")
public List getObservers() {
return observers;
}
public void setObservers(List observers) {
this.observers = observers;
}
public CreateDocumentRequest disablePendingActionNotifications(Boolean disablePendingActionNotifications) {
this.disablePendingActionNotifications = disablePendingActionNotifications;
return this;
}
/**
* If true the notifications of pending actions won't be sent to the participants of the first step.
* @return disablePendingActionNotifications
**/
@Schema(description = "If true the notifications of pending actions won't be sent to the participants of the first step.")
public Boolean isDisablePendingActionNotifications() {
return disablePendingActionNotifications;
}
public void setDisablePendingActionNotifications(Boolean disablePendingActionNotifications) {
this.disablePendingActionNotifications = disablePendingActionNotifications;
}
public CreateDocumentRequest newFolderName(String newFolderName) {
this.newFolderName = newFolderName;
return this;
}
/**
* The name of a new folder to be created and associated to the document. If you do not wish to create a new folder you may set this as null.
* @return newFolderName
**/
@Schema(description = "The name of a new folder to be created and associated to the document. If you do not wish to create a new folder you may set this as null.")
public String getNewFolderName() {
return newFolderName;
}
public void setNewFolderName(String newFolderName) {
this.newFolderName = newFolderName;
}
public CreateDocumentRequest forceCadesSignature(Boolean forceCadesSignature) {
this.forceCadesSignature = forceCadesSignature;
return this;
}
/**
* If this property is set to true, then the document will be signed using the CAdES format.
* @return forceCadesSignature
**/
@Schema(description = "If this property is set to true, then the document will be signed using the CAdES format.")
public Boolean isForceCadesSignature() {
return forceCadesSignature;
}
public void setForceCadesSignature(Boolean forceCadesSignature) {
this.forceCadesSignature = forceCadesSignature;
}
public CreateDocumentRequest notifiedEmails(List notifiedEmails) {
this.notifiedEmails = notifiedEmails;
return this;
}
public CreateDocumentRequest addNotifiedEmailsItem(String notifiedEmailsItem) {
if (this.notifiedEmails == null) {
this.notifiedEmails = new ArrayList();
}
this.notifiedEmails.add(notifiedEmailsItem);
return this;
}
/**
* The emails to notify when the document is concluded.
* @return notifiedEmails
**/
@Schema(description = "The emails to notify when the document is concluded.")
public List getNotifiedEmails() {
return notifiedEmails;
}
public void setNotifiedEmails(List notifiedEmails) {
this.notifiedEmails = notifiedEmails;
}
public CreateDocumentRequest additionalInfo(DocumentAdditionalInfoData additionalInfo) {
this.additionalInfo = additionalInfo;
return this;
}
/**
* Get additionalInfo
* @return additionalInfo
**/
@Schema(description = "")
public DocumentAdditionalInfoData getAdditionalInfo() {
return additionalInfo;
}
public void setAdditionalInfo(DocumentAdditionalInfoData additionalInfo) {
this.additionalInfo = additionalInfo;
}
public CreateDocumentRequest tags(List tags) {
this.tags = tags;
return this;
}
public CreateDocumentRequest addTagsItem(DocumentTagData tagsItem) {
if (this.tags == null) {
this.tags = new ArrayList();
}
this.tags.add(tagsItem);
return this;
}
/**
* Get tags
* @return tags
**/
@Schema(description = "")
public List getTags() {
return tags;
}
public void setTags(List tags) {
this.tags = tags;
}
public CreateDocumentRequest expirationDate(OffsetDateTime expirationDate) {
this.expirationDate = expirationDate;
return this;
}
/**
* The expiration date of the document. Any time information will be discarded, as the expiration will be set to the last time available for the chosen date in the default timezone.
* @return expirationDate
**/
@Schema(description = "The expiration date of the document. Any time information will be discarded, as the expiration will be set to the last time available for the chosen date in the default timezone.")
public OffsetDateTime getExpirationDate() {
return expirationDate;
}
public void setExpirationDate(OffsetDateTime expirationDate) {
this.expirationDate = expirationDate;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreateDocumentRequest documentsCreateDocumentRequest = (CreateDocumentRequest) o;
return Objects.equals(this.files, documentsCreateDocumentRequest.files) &&
Objects.equals(this.attachments, documentsCreateDocumentRequest.attachments) &&
Objects.equals(this.xmlNamespaces, documentsCreateDocumentRequest.xmlNamespaces) &&
Objects.equals(this.isEnvelope, documentsCreateDocumentRequest.isEnvelope) &&
Objects.equals(this.envelopeName, documentsCreateDocumentRequest.envelopeName) &&
Objects.equals(this.participantsDataFile, documentsCreateDocumentRequest.participantsDataFile) &&
Objects.equals(this.folderId, documentsCreateDocumentRequest.folderId) &&
Objects.equals(this.description, documentsCreateDocumentRequest.description) &&
Objects.equals(this.flowActions, documentsCreateDocumentRequest.flowActions) &&
Objects.equals(this.observers, documentsCreateDocumentRequest.observers) &&
Objects.equals(this.disablePendingActionNotifications, documentsCreateDocumentRequest.disablePendingActionNotifications) &&
Objects.equals(this.newFolderName, documentsCreateDocumentRequest.newFolderName) &&
Objects.equals(this.forceCadesSignature, documentsCreateDocumentRequest.forceCadesSignature) &&
Objects.equals(this.notifiedEmails, documentsCreateDocumentRequest.notifiedEmails) &&
Objects.equals(this.additionalInfo, documentsCreateDocumentRequest.additionalInfo) &&
Objects.equals(this.tags, documentsCreateDocumentRequest.tags) &&
Objects.equals(this.expirationDate, documentsCreateDocumentRequest.expirationDate);
}
@Override
public int hashCode() {
return Objects.hash(files, attachments, xmlNamespaces, isEnvelope, envelopeName, participantsDataFile, folderId, description, flowActions, observers, disablePendingActionNotifications, newFolderName, forceCadesSignature, notifiedEmails, additionalInfo, tags, expirationDate);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateDocumentRequest {\n");
sb.append(" files: ").append(toIndentedString(files)).append("\n");
sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n");
sb.append(" xmlNamespaces: ").append(toIndentedString(xmlNamespaces)).append("\n");
sb.append(" isEnvelope: ").append(toIndentedString(isEnvelope)).append("\n");
sb.append(" envelopeName: ").append(toIndentedString(envelopeName)).append("\n");
sb.append(" participantsDataFile: ").append(toIndentedString(participantsDataFile)).append("\n");
sb.append(" folderId: ").append(toIndentedString(folderId)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" flowActions: ").append(toIndentedString(flowActions)).append("\n");
sb.append(" observers: ").append(toIndentedString(observers)).append("\n");
sb.append(" disablePendingActionNotifications: ").append(toIndentedString(disablePendingActionNotifications)).append("\n");
sb.append(" newFolderName: ").append(toIndentedString(newFolderName)).append("\n");
sb.append(" forceCadesSignature: ").append(toIndentedString(forceCadesSignature)).append("\n");
sb.append(" notifiedEmails: ").append(toIndentedString(notifiedEmails)).append("\n");
sb.append(" additionalInfo: ").append(toIndentedString(additionalInfo)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" expirationDate: ").append(toIndentedString(expirationDate)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}