001package com.box.sdkgen.schemas.signrequestsigner; 002 003import com.box.sdkgen.internal.Nullable; 004import com.box.sdkgen.schemas.signrequestcreatesigner.SignRequestCreateSigner; 005import com.box.sdkgen.schemas.signrequestcreatesigner.SignRequestCreateSignerRoleField; 006import com.box.sdkgen.schemas.signrequestsignerattachment.SignRequestSignerAttachment; 007import com.box.sdkgen.schemas.signrequestsignerinput.SignRequestSignerInput; 008import com.box.sdkgen.serialization.json.EnumWrapper; 009import com.fasterxml.jackson.annotation.JsonFilter; 010import com.fasterxml.jackson.annotation.JsonProperty; 011import java.util.List; 012import java.util.Objects; 013 014/** The schema for a Signer object used on the body of a Box Sign request object. */ 015@JsonFilter("nullablePropertyFilter") 016public class SignRequestSigner extends SignRequestCreateSigner { 017 018 /** Set to `true` if the signer views the document. */ 019 @JsonProperty("has_viewed_document") 020 protected Boolean hasViewedDocument; 021 022 /** Final decision made by the signer. */ 023 @JsonProperty("signer_decision") 024 @Nullable 025 protected SignRequestSignerSignerDecisionField signerDecision; 026 027 protected List<SignRequestSignerInput> inputs; 028 029 /** URL to direct a signer to for signing. */ 030 @JsonProperty("embed_url") 031 @Nullable 032 protected String embedUrl; 033 034 /** 035 * This URL is specifically designed for signing documents within an HTML `iframe` tag. It will be 036 * returned in the response only if the `embed_url_external_user_id` parameter was passed in the 037 * `create Box Sign request` call. 038 */ 039 @JsonProperty("iframeable_embed_url") 040 @Nullable 041 protected String iframeableEmbedUrl; 042 043 /** Attachments that the signer uploaded. */ 044 @Nullable protected List<SignRequestSignerAttachment> attachments; 045 046 public SignRequestSigner() { 047 super(); 048 } 049 050 protected SignRequestSigner(Builder builder) { 051 super(builder); 052 this.hasViewedDocument = builder.hasViewedDocument; 053 this.signerDecision = builder.signerDecision; 054 this.inputs = builder.inputs; 055 this.embedUrl = builder.embedUrl; 056 this.iframeableEmbedUrl = builder.iframeableEmbedUrl; 057 this.attachments = builder.attachments; 058 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 059 } 060 061 public Boolean getHasViewedDocument() { 062 return hasViewedDocument; 063 } 064 065 public SignRequestSignerSignerDecisionField getSignerDecision() { 066 return signerDecision; 067 } 068 069 public List<SignRequestSignerInput> getInputs() { 070 return inputs; 071 } 072 073 public String getEmbedUrl() { 074 return embedUrl; 075 } 076 077 public String getIframeableEmbedUrl() { 078 return iframeableEmbedUrl; 079 } 080 081 public List<SignRequestSignerAttachment> getAttachments() { 082 return attachments; 083 } 084 085 @Override 086 public boolean equals(Object o) { 087 if (this == o) { 088 return true; 089 } 090 if (o == null || getClass() != o.getClass()) { 091 return false; 092 } 093 SignRequestSigner casted = (SignRequestSigner) o; 094 return Objects.equals(email, casted.email) 095 && Objects.equals(role, casted.role) 096 && Objects.equals(isInPerson, casted.isInPerson) 097 && Objects.equals(order, casted.order) 098 && Objects.equals(embedUrlExternalUserId, casted.embedUrlExternalUserId) 099 && Objects.equals(redirectUrl, casted.redirectUrl) 100 && Objects.equals(declinedRedirectUrl, casted.declinedRedirectUrl) 101 && Objects.equals(loginRequired, casted.loginRequired) 102 && Objects.equals(verificationPhoneNumber, casted.verificationPhoneNumber) 103 && Objects.equals(password, casted.password) 104 && Objects.equals(signerGroupId, casted.signerGroupId) 105 && Objects.equals(suppressNotifications, casted.suppressNotifications) 106 && Objects.equals(language, casted.language) 107 && Objects.equals(hasViewedDocument, casted.hasViewedDocument) 108 && Objects.equals(signerDecision, casted.signerDecision) 109 && Objects.equals(inputs, casted.inputs) 110 && Objects.equals(embedUrl, casted.embedUrl) 111 && Objects.equals(iframeableEmbedUrl, casted.iframeableEmbedUrl) 112 && Objects.equals(attachments, casted.attachments); 113 } 114 115 @Override 116 public int hashCode() { 117 return Objects.hash( 118 email, 119 role, 120 isInPerson, 121 order, 122 embedUrlExternalUserId, 123 redirectUrl, 124 declinedRedirectUrl, 125 loginRequired, 126 verificationPhoneNumber, 127 password, 128 signerGroupId, 129 suppressNotifications, 130 language, 131 hasViewedDocument, 132 signerDecision, 133 inputs, 134 embedUrl, 135 iframeableEmbedUrl, 136 attachments); 137 } 138 139 @Override 140 public String toString() { 141 return "SignRequestSigner{" 142 + "email='" 143 + email 144 + '\'' 145 + ", " 146 + "role='" 147 + role 148 + '\'' 149 + ", " 150 + "isInPerson='" 151 + isInPerson 152 + '\'' 153 + ", " 154 + "order='" 155 + order 156 + '\'' 157 + ", " 158 + "embedUrlExternalUserId='" 159 + embedUrlExternalUserId 160 + '\'' 161 + ", " 162 + "redirectUrl='" 163 + redirectUrl 164 + '\'' 165 + ", " 166 + "declinedRedirectUrl='" 167 + declinedRedirectUrl 168 + '\'' 169 + ", " 170 + "loginRequired='" 171 + loginRequired 172 + '\'' 173 + ", " 174 + "verificationPhoneNumber='" 175 + verificationPhoneNumber 176 + '\'' 177 + ", " 178 + "password='" 179 + password 180 + '\'' 181 + ", " 182 + "signerGroupId='" 183 + signerGroupId 184 + '\'' 185 + ", " 186 + "suppressNotifications='" 187 + suppressNotifications 188 + '\'' 189 + ", " 190 + "language='" 191 + language 192 + '\'' 193 + ", " 194 + "hasViewedDocument='" 195 + hasViewedDocument 196 + '\'' 197 + ", " 198 + "signerDecision='" 199 + signerDecision 200 + '\'' 201 + ", " 202 + "inputs='" 203 + inputs 204 + '\'' 205 + ", " 206 + "embedUrl='" 207 + embedUrl 208 + '\'' 209 + ", " 210 + "iframeableEmbedUrl='" 211 + iframeableEmbedUrl 212 + '\'' 213 + ", " 214 + "attachments='" 215 + attachments 216 + '\'' 217 + "}"; 218 } 219 220 public static class Builder extends SignRequestCreateSigner.Builder { 221 222 protected Boolean hasViewedDocument; 223 224 protected SignRequestSignerSignerDecisionField signerDecision; 225 226 protected List<SignRequestSignerInput> inputs; 227 228 protected String embedUrl; 229 230 protected String iframeableEmbedUrl; 231 232 protected List<SignRequestSignerAttachment> attachments; 233 234 public Builder hasViewedDocument(Boolean hasViewedDocument) { 235 this.hasViewedDocument = hasViewedDocument; 236 return this; 237 } 238 239 public Builder signerDecision(SignRequestSignerSignerDecisionField signerDecision) { 240 this.signerDecision = signerDecision; 241 this.markNullableFieldAsSet("signer_decision"); 242 return this; 243 } 244 245 public Builder inputs(List<SignRequestSignerInput> inputs) { 246 this.inputs = inputs; 247 return this; 248 } 249 250 public Builder embedUrl(String embedUrl) { 251 this.embedUrl = embedUrl; 252 this.markNullableFieldAsSet("embed_url"); 253 return this; 254 } 255 256 public Builder iframeableEmbedUrl(String iframeableEmbedUrl) { 257 this.iframeableEmbedUrl = iframeableEmbedUrl; 258 this.markNullableFieldAsSet("iframeable_embed_url"); 259 return this; 260 } 261 262 public Builder attachments(List<SignRequestSignerAttachment> attachments) { 263 this.attachments = attachments; 264 this.markNullableFieldAsSet("attachments"); 265 return this; 266 } 267 268 @Override 269 public Builder email(String email) { 270 this.email = email; 271 this.markNullableFieldAsSet("email"); 272 return this; 273 } 274 275 @Override 276 public Builder role(SignRequestCreateSignerRoleField role) { 277 this.role = new EnumWrapper<SignRequestCreateSignerRoleField>(role); 278 return this; 279 } 280 281 @Override 282 public Builder role(EnumWrapper<SignRequestCreateSignerRoleField> role) { 283 this.role = role; 284 return this; 285 } 286 287 @Override 288 public Builder isInPerson(Boolean isInPerson) { 289 this.isInPerson = isInPerson; 290 return this; 291 } 292 293 @Override 294 public Builder order(Long order) { 295 this.order = order; 296 return this; 297 } 298 299 @Override 300 public Builder embedUrlExternalUserId(String embedUrlExternalUserId) { 301 this.embedUrlExternalUserId = embedUrlExternalUserId; 302 this.markNullableFieldAsSet("embed_url_external_user_id"); 303 return this; 304 } 305 306 @Override 307 public Builder redirectUrl(String redirectUrl) { 308 this.redirectUrl = redirectUrl; 309 this.markNullableFieldAsSet("redirect_url"); 310 return this; 311 } 312 313 @Override 314 public Builder declinedRedirectUrl(String declinedRedirectUrl) { 315 this.declinedRedirectUrl = declinedRedirectUrl; 316 this.markNullableFieldAsSet("declined_redirect_url"); 317 return this; 318 } 319 320 @Override 321 public Builder loginRequired(Boolean loginRequired) { 322 this.loginRequired = loginRequired; 323 this.markNullableFieldAsSet("login_required"); 324 return this; 325 } 326 327 @Override 328 public Builder verificationPhoneNumber(String verificationPhoneNumber) { 329 this.verificationPhoneNumber = verificationPhoneNumber; 330 this.markNullableFieldAsSet("verification_phone_number"); 331 return this; 332 } 333 334 @Override 335 public Builder password(String password) { 336 this.password = password; 337 this.markNullableFieldAsSet("password"); 338 return this; 339 } 340 341 @Override 342 public Builder signerGroupId(String signerGroupId) { 343 this.signerGroupId = signerGroupId; 344 this.markNullableFieldAsSet("signer_group_id"); 345 return this; 346 } 347 348 @Override 349 public Builder suppressNotifications(Boolean suppressNotifications) { 350 this.suppressNotifications = suppressNotifications; 351 this.markNullableFieldAsSet("suppress_notifications"); 352 return this; 353 } 354 355 @Override 356 public Builder language(String language) { 357 this.language = language; 358 this.markNullableFieldAsSet("language"); 359 return this; 360 } 361 362 public SignRequestSigner build() { 363 return new SignRequestSigner(this); 364 } 365 } 366}