001package com.box.sdkgen.schemas.signrequestbase;
002
003import com.box.sdkgen.internal.Nullable;
004import com.box.sdkgen.internal.NullableFieldTracker;
005import com.box.sdkgen.internal.SerializableObject;
006import com.box.sdkgen.schemas.signrequestprefilltag.SignRequestPrefillTag;
007import com.fasterxml.jackson.annotation.JsonFilter;
008import com.fasterxml.jackson.annotation.JsonProperty;
009import java.util.List;
010import java.util.Objects;
011
012/** A standard representation of a signature request object. */
013@JsonFilter("nullablePropertyFilter")
014public class SignRequestBase extends SerializableObject {
015
016  /**
017   * Indicates if the sender should receive a `prepare_url` in the response to complete document
018   * preparation using the UI.
019   */
020  @JsonProperty("is_document_preparation_needed")
021  protected Boolean isDocumentPreparationNeeded;
022
023  /**
024   * When specified, the signature request will be redirected to this url when a document is signed.
025   */
026  @JsonProperty("redirect_url")
027  @Nullable
028  protected String redirectUrl;
029
030  /** The uri that a signer will be redirected to after declining to sign a document. */
031  @JsonProperty("declined_redirect_url")
032  @Nullable
033  protected String declinedRedirectUrl;
034
035  /** Disables the usage of signatures generated by typing (text). */
036  @JsonProperty("are_text_signatures_enabled")
037  protected Boolean areTextSignaturesEnabled;
038
039  /**
040   * Subject of sign request email. This is cleaned by sign request. If this field is not passed, a
041   * default subject will be used.
042   */
043  @JsonProperty("email_subject")
044  @Nullable
045  protected String emailSubject;
046
047  /**
048   * Message to include in sign request email. The field is cleaned through sanitization of specific
049   * characters. However, some html tags are allowed. Links included in the message are also
050   * converted to hyperlinks in the email. The message may contain the following html tags including
051   * `a`, `abbr`, `acronym`, `b`, `blockquote`, `code`, `em`, `i`, `ul`, `li`, `ol`, and `strong`.
052   * Be aware that when the text to html ratio is too high, the email may end up in spam filters.
053   * Custom styles on these tags are not allowed. If this field is not passed, a default message
054   * will be used.
055   */
056  @JsonProperty("email_message")
057  @Nullable
058  protected String emailMessage;
059
060  /**
061   * Reminds signers to sign a document on day 3, 8, 13 and 18. Reminders are only sent to
062   * outstanding signers.
063   */
064  @JsonProperty("are_reminders_enabled")
065  protected Boolean areRemindersEnabled;
066
067  /** Name of the signature request. */
068  protected String name;
069
070  /**
071   * When a document contains sign-related tags in the content, you can prefill them using this
072   * `prefill_tags` by referencing the 'id' of the tag as the `external_id` field of the prefill
073   * tag.
074   */
075  @JsonProperty("prefill_tags")
076  protected List<SignRequestPrefillTag> prefillTags;
077
078  /**
079   * Set the number of days after which the created signature request will automatically expire if
080   * not completed. By default, we do not apply any expiration date on signature requests, and the
081   * signature request does not expire.
082   */
083  @JsonProperty("days_valid")
084  @Nullable
085  protected Long daysValid;
086
087  /**
088   * This can be used to reference an ID in an external system that the sign request is related to.
089   */
090  @JsonProperty("external_id")
091  @Nullable
092  protected String externalId;
093
094  /**
095   * When a signature request is created from a template this field will indicate the id of that
096   * template.
097   */
098  @JsonProperty("template_id")
099  @Nullable
100  protected String templateId;
101
102  /**
103   * Used as an optional system name to appear in the signature log next to the signers who have
104   * been assigned the `embed_url_external_id`.
105   */
106  @JsonProperty("external_system_name")
107  @Nullable
108  protected String externalSystemName;
109
110  public SignRequestBase() {
111    super();
112  }
113
114  protected SignRequestBase(Builder builder) {
115    super();
116    this.isDocumentPreparationNeeded = builder.isDocumentPreparationNeeded;
117    this.redirectUrl = builder.redirectUrl;
118    this.declinedRedirectUrl = builder.declinedRedirectUrl;
119    this.areTextSignaturesEnabled = builder.areTextSignaturesEnabled;
120    this.emailSubject = builder.emailSubject;
121    this.emailMessage = builder.emailMessage;
122    this.areRemindersEnabled = builder.areRemindersEnabled;
123    this.name = builder.name;
124    this.prefillTags = builder.prefillTags;
125    this.daysValid = builder.daysValid;
126    this.externalId = builder.externalId;
127    this.templateId = builder.templateId;
128    this.externalSystemName = builder.externalSystemName;
129    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
130  }
131
132  public Boolean getIsDocumentPreparationNeeded() {
133    return isDocumentPreparationNeeded;
134  }
135
136  public String getRedirectUrl() {
137    return redirectUrl;
138  }
139
140  public String getDeclinedRedirectUrl() {
141    return declinedRedirectUrl;
142  }
143
144  public Boolean getAreTextSignaturesEnabled() {
145    return areTextSignaturesEnabled;
146  }
147
148  public String getEmailSubject() {
149    return emailSubject;
150  }
151
152  public String getEmailMessage() {
153    return emailMessage;
154  }
155
156  public Boolean getAreRemindersEnabled() {
157    return areRemindersEnabled;
158  }
159
160  public String getName() {
161    return name;
162  }
163
164  public List<SignRequestPrefillTag> getPrefillTags() {
165    return prefillTags;
166  }
167
168  public Long getDaysValid() {
169    return daysValid;
170  }
171
172  public String getExternalId() {
173    return externalId;
174  }
175
176  public String getTemplateId() {
177    return templateId;
178  }
179
180  public String getExternalSystemName() {
181    return externalSystemName;
182  }
183
184  @Override
185  public boolean equals(Object o) {
186    if (this == o) {
187      return true;
188    }
189    if (o == null || getClass() != o.getClass()) {
190      return false;
191    }
192    SignRequestBase casted = (SignRequestBase) o;
193    return Objects.equals(isDocumentPreparationNeeded, casted.isDocumentPreparationNeeded)
194        && Objects.equals(redirectUrl, casted.redirectUrl)
195        && Objects.equals(declinedRedirectUrl, casted.declinedRedirectUrl)
196        && Objects.equals(areTextSignaturesEnabled, casted.areTextSignaturesEnabled)
197        && Objects.equals(emailSubject, casted.emailSubject)
198        && Objects.equals(emailMessage, casted.emailMessage)
199        && Objects.equals(areRemindersEnabled, casted.areRemindersEnabled)
200        && Objects.equals(name, casted.name)
201        && Objects.equals(prefillTags, casted.prefillTags)
202        && Objects.equals(daysValid, casted.daysValid)
203        && Objects.equals(externalId, casted.externalId)
204        && Objects.equals(templateId, casted.templateId)
205        && Objects.equals(externalSystemName, casted.externalSystemName);
206  }
207
208  @Override
209  public int hashCode() {
210    return Objects.hash(
211        isDocumentPreparationNeeded,
212        redirectUrl,
213        declinedRedirectUrl,
214        areTextSignaturesEnabled,
215        emailSubject,
216        emailMessage,
217        areRemindersEnabled,
218        name,
219        prefillTags,
220        daysValid,
221        externalId,
222        templateId,
223        externalSystemName);
224  }
225
226  @Override
227  public String toString() {
228    return "SignRequestBase{"
229        + "isDocumentPreparationNeeded='"
230        + isDocumentPreparationNeeded
231        + '\''
232        + ", "
233        + "redirectUrl='"
234        + redirectUrl
235        + '\''
236        + ", "
237        + "declinedRedirectUrl='"
238        + declinedRedirectUrl
239        + '\''
240        + ", "
241        + "areTextSignaturesEnabled='"
242        + areTextSignaturesEnabled
243        + '\''
244        + ", "
245        + "emailSubject='"
246        + emailSubject
247        + '\''
248        + ", "
249        + "emailMessage='"
250        + emailMessage
251        + '\''
252        + ", "
253        + "areRemindersEnabled='"
254        + areRemindersEnabled
255        + '\''
256        + ", "
257        + "name='"
258        + name
259        + '\''
260        + ", "
261        + "prefillTags='"
262        + prefillTags
263        + '\''
264        + ", "
265        + "daysValid='"
266        + daysValid
267        + '\''
268        + ", "
269        + "externalId='"
270        + externalId
271        + '\''
272        + ", "
273        + "templateId='"
274        + templateId
275        + '\''
276        + ", "
277        + "externalSystemName='"
278        + externalSystemName
279        + '\''
280        + "}";
281  }
282
283  public static class Builder extends NullableFieldTracker {
284
285    protected Boolean isDocumentPreparationNeeded;
286
287    protected String redirectUrl;
288
289    protected String declinedRedirectUrl;
290
291    protected Boolean areTextSignaturesEnabled;
292
293    protected String emailSubject;
294
295    protected String emailMessage;
296
297    protected Boolean areRemindersEnabled;
298
299    protected String name;
300
301    protected List<SignRequestPrefillTag> prefillTags;
302
303    protected Long daysValid;
304
305    protected String externalId;
306
307    protected String templateId;
308
309    protected String externalSystemName;
310
311    public Builder isDocumentPreparationNeeded(Boolean isDocumentPreparationNeeded) {
312      this.isDocumentPreparationNeeded = isDocumentPreparationNeeded;
313      return this;
314    }
315
316    public Builder redirectUrl(String redirectUrl) {
317      this.redirectUrl = redirectUrl;
318      this.markNullableFieldAsSet("redirect_url");
319      return this;
320    }
321
322    public Builder declinedRedirectUrl(String declinedRedirectUrl) {
323      this.declinedRedirectUrl = declinedRedirectUrl;
324      this.markNullableFieldAsSet("declined_redirect_url");
325      return this;
326    }
327
328    public Builder areTextSignaturesEnabled(Boolean areTextSignaturesEnabled) {
329      this.areTextSignaturesEnabled = areTextSignaturesEnabled;
330      return this;
331    }
332
333    public Builder emailSubject(String emailSubject) {
334      this.emailSubject = emailSubject;
335      this.markNullableFieldAsSet("email_subject");
336      return this;
337    }
338
339    public Builder emailMessage(String emailMessage) {
340      this.emailMessage = emailMessage;
341      this.markNullableFieldAsSet("email_message");
342      return this;
343    }
344
345    public Builder areRemindersEnabled(Boolean areRemindersEnabled) {
346      this.areRemindersEnabled = areRemindersEnabled;
347      return this;
348    }
349
350    public Builder name(String name) {
351      this.name = name;
352      return this;
353    }
354
355    public Builder prefillTags(List<SignRequestPrefillTag> prefillTags) {
356      this.prefillTags = prefillTags;
357      return this;
358    }
359
360    public Builder daysValid(Long daysValid) {
361      this.daysValid = daysValid;
362      this.markNullableFieldAsSet("days_valid");
363      return this;
364    }
365
366    public Builder externalId(String externalId) {
367      this.externalId = externalId;
368      this.markNullableFieldAsSet("external_id");
369      return this;
370    }
371
372    public Builder templateId(String templateId) {
373      this.templateId = templateId;
374      this.markNullableFieldAsSet("template_id");
375      return this;
376    }
377
378    public Builder externalSystemName(String externalSystemName) {
379      this.externalSystemName = externalSystemName;
380      this.markNullableFieldAsSet("external_system_name");
381      return this;
382    }
383
384    public SignRequestBase build() {
385      return new SignRequestBase(this);
386    }
387  }
388}