Skip to content

Commit 9fea7d0

Browse files
committed
feat: add new sign request metadata (box/box-openapi#565)
1 parent 349af33 commit 9fea7d0

File tree

4 files changed

+188
-3
lines changed

4 files changed

+188
-3
lines changed

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "49f3695", "specHash": "e7ce024", "version": "5.1.0" }
1+
{ "engineHash": "49f3695", "specHash": "7e4908e", "version": "5.1.0" }

src/main/java/com/box/sdkgen/schemas/signrequest/SignRequest.java

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,23 @@ public class SignRequest extends SignRequestBase {
9090
@Nullable
9191
protected String collaboratorLevel;
9292

93+
/** Short identifier for the sign request. */
94+
@JsonProperty("short_id")
95+
protected String shortId;
96+
97+
/** Timestamp marking when the sign request was created. */
98+
@JsonProperty("created_at")
99+
@JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
100+
@JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
101+
protected OffsetDateTime createdAt;
102+
103+
/** Timestamp indicating when all signing actions completed. */
104+
@JsonProperty("finished_at")
105+
@JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
106+
@JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
107+
@Nullable
108+
protected OffsetDateTime finishedAt;
109+
93110
/** The email address of the sender of the sign request. */
94111
@JsonProperty("sender_email")
95112
@Nullable
@@ -118,6 +135,9 @@ protected SignRequest(Builder builder) {
118135
this.autoExpireAt = builder.autoExpireAt;
119136
this.parentFolder = builder.parentFolder;
120137
this.collaboratorLevel = builder.collaboratorLevel;
138+
this.shortId = builder.shortId;
139+
this.createdAt = builder.createdAt;
140+
this.finishedAt = builder.finishedAt;
121141
this.senderEmail = builder.senderEmail;
122142
this.senderId = builder.senderId;
123143
markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
@@ -171,6 +191,18 @@ public String getCollaboratorLevel() {
171191
return collaboratorLevel;
172192
}
173193

194+
public String getShortId() {
195+
return shortId;
196+
}
197+
198+
public OffsetDateTime getCreatedAt() {
199+
return createdAt;
200+
}
201+
202+
public OffsetDateTime getFinishedAt() {
203+
return finishedAt;
204+
}
205+
174206
public String getSenderEmail() {
175207
return senderEmail;
176208
}
@@ -213,6 +245,9 @@ public boolean equals(Object o) {
213245
&& Objects.equals(autoExpireAt, casted.autoExpireAt)
214246
&& Objects.equals(parentFolder, casted.parentFolder)
215247
&& Objects.equals(collaboratorLevel, casted.collaboratorLevel)
248+
&& Objects.equals(shortId, casted.shortId)
249+
&& Objects.equals(createdAt, casted.createdAt)
250+
&& Objects.equals(finishedAt, casted.finishedAt)
216251
&& Objects.equals(senderEmail, casted.senderEmail)
217252
&& Objects.equals(senderId, casted.senderId);
218253
}
@@ -245,6 +280,9 @@ public int hashCode() {
245280
autoExpireAt,
246281
parentFolder,
247282
collaboratorLevel,
283+
shortId,
284+
createdAt,
285+
finishedAt,
248286
senderEmail,
249287
senderId);
250288
}
@@ -352,6 +390,18 @@ public String toString() {
352390
+ collaboratorLevel
353391
+ '\''
354392
+ ", "
393+
+ "shortId='"
394+
+ shortId
395+
+ '\''
396+
+ ", "
397+
+ "createdAt='"
398+
+ createdAt
399+
+ '\''
400+
+ ", "
401+
+ "finishedAt='"
402+
+ finishedAt
403+
+ '\''
404+
+ ", "
355405
+ "senderEmail='"
356406
+ senderEmail
357407
+ '\''
@@ -388,6 +438,12 @@ public static class Builder extends SignRequestBase.Builder {
388438

389439
protected String collaboratorLevel;
390440

441+
protected String shortId;
442+
443+
protected OffsetDateTime createdAt;
444+
445+
protected OffsetDateTime finishedAt;
446+
391447
protected String senderEmail;
392448

393449
protected Long senderId;
@@ -466,6 +522,22 @@ public Builder collaboratorLevel(String collaboratorLevel) {
466522
return this;
467523
}
468524

525+
public Builder shortId(String shortId) {
526+
this.shortId = shortId;
527+
return this;
528+
}
529+
530+
public Builder createdAt(OffsetDateTime createdAt) {
531+
this.createdAt = createdAt;
532+
return this;
533+
}
534+
535+
public Builder finishedAt(OffsetDateTime finishedAt) {
536+
this.finishedAt = finishedAt;
537+
this.markNullableFieldAsSet("finished_at");
538+
return this;
539+
}
540+
469541
public Builder senderEmail(String senderEmail) {
470542
this.senderEmail = senderEmail;
471543
this.markNullableFieldAsSet("sender_email");

src/main/java/com/box/sdkgen/schemas/signrequestsigner/SignRequestSigner.java

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.box.sdkgen.internal.Nullable;
44
import com.box.sdkgen.schemas.signrequestcreatesigner.SignRequestCreateSigner;
55
import com.box.sdkgen.schemas.signrequestcreatesigner.SignRequestCreateSignerRoleField;
6+
import com.box.sdkgen.schemas.signrequestsignerattachment.SignRequestSignerAttachment;
67
import com.box.sdkgen.schemas.signrequestsignerinput.SignRequestSignerInput;
78
import com.box.sdkgen.serialization.json.EnumWrapper;
89
import com.fasterxml.jackson.annotation.JsonFilter;
@@ -39,6 +40,9 @@ public class SignRequestSigner extends SignRequestCreateSigner {
3940
@Nullable
4041
protected String iframeableEmbedUrl;
4142

43+
/** Attachments that the signer uploaded. */
44+
@Nullable protected List<SignRequestSignerAttachment> attachments;
45+
4246
public SignRequestSigner() {
4347
super();
4448
}
@@ -50,6 +54,7 @@ protected SignRequestSigner(Builder builder) {
5054
this.inputs = builder.inputs;
5155
this.embedUrl = builder.embedUrl;
5256
this.iframeableEmbedUrl = builder.iframeableEmbedUrl;
57+
this.attachments = builder.attachments;
5358
markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
5459
}
5560

@@ -73,6 +78,10 @@ public String getIframeableEmbedUrl() {
7378
return iframeableEmbedUrl;
7479
}
7580

81+
public List<SignRequestSignerAttachment> getAttachments() {
82+
return attachments;
83+
}
84+
7685
@Override
7786
public boolean equals(Object o) {
7887
if (this == o) {
@@ -98,7 +107,8 @@ public boolean equals(Object o) {
98107
&& Objects.equals(signerDecision, casted.signerDecision)
99108
&& Objects.equals(inputs, casted.inputs)
100109
&& Objects.equals(embedUrl, casted.embedUrl)
101-
&& Objects.equals(iframeableEmbedUrl, casted.iframeableEmbedUrl);
110+
&& Objects.equals(iframeableEmbedUrl, casted.iframeableEmbedUrl)
111+
&& Objects.equals(attachments, casted.attachments);
102112
}
103113

104114
@Override
@@ -120,7 +130,8 @@ public int hashCode() {
120130
signerDecision,
121131
inputs,
122132
embedUrl,
123-
iframeableEmbedUrl);
133+
iframeableEmbedUrl,
134+
attachments);
124135
}
125136

126137
@Override
@@ -193,6 +204,10 @@ public String toString() {
193204
+ "iframeableEmbedUrl='"
194205
+ iframeableEmbedUrl
195206
+ '\''
207+
+ ", "
208+
+ "attachments='"
209+
+ attachments
210+
+ '\''
196211
+ "}";
197212
}
198213

@@ -208,6 +223,8 @@ public static class Builder extends SignRequestCreateSigner.Builder {
208223

209224
protected String iframeableEmbedUrl;
210225

226+
protected List<SignRequestSignerAttachment> attachments;
227+
211228
public Builder hasViewedDocument(Boolean hasViewedDocument) {
212229
this.hasViewedDocument = hasViewedDocument;
213230
return this;
@@ -236,6 +253,12 @@ public Builder iframeableEmbedUrl(String iframeableEmbedUrl) {
236253
return this;
237254
}
238255

256+
public Builder attachments(List<SignRequestSignerAttachment> attachments) {
257+
this.attachments = attachments;
258+
this.markNullableFieldAsSet("attachments");
259+
return this;
260+
}
261+
239262
@Override
240263
public Builder email(String email) {
241264
this.email = email;
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
package com.box.sdkgen.schemas.signrequestsignerattachment;
2+
3+
import com.box.sdkgen.internal.Nullable;
4+
import com.box.sdkgen.internal.NullableFieldTracker;
5+
import com.box.sdkgen.internal.SerializableObject;
6+
import com.fasterxml.jackson.annotation.JsonFilter;
7+
import java.util.Objects;
8+
9+
/** Metadata describing a file uploaded by a signer as an attachment. */
10+
@JsonFilter("nullablePropertyFilter")
11+
public class SignRequestSignerAttachment extends SerializableObject {
12+
13+
/** Identifier of the attachment file. */
14+
@Nullable protected String id;
15+
16+
/** Display name of the attachment file. */
17+
@Nullable protected String name;
18+
19+
public SignRequestSignerAttachment() {
20+
super();
21+
}
22+
23+
protected SignRequestSignerAttachment(Builder builder) {
24+
super();
25+
this.id = builder.id;
26+
this.name = builder.name;
27+
markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
28+
}
29+
30+
public String getId() {
31+
return id;
32+
}
33+
34+
public String getName() {
35+
return name;
36+
}
37+
38+
@Override
39+
public boolean equals(Object o) {
40+
if (this == o) {
41+
return true;
42+
}
43+
if (o == null || getClass() != o.getClass()) {
44+
return false;
45+
}
46+
SignRequestSignerAttachment casted = (SignRequestSignerAttachment) o;
47+
return Objects.equals(id, casted.id) && Objects.equals(name, casted.name);
48+
}
49+
50+
@Override
51+
public int hashCode() {
52+
return Objects.hash(id, name);
53+
}
54+
55+
@Override
56+
public String toString() {
57+
return "SignRequestSignerAttachment{"
58+
+ "id='"
59+
+ id
60+
+ '\''
61+
+ ", "
62+
+ "name='"
63+
+ name
64+
+ '\''
65+
+ "}";
66+
}
67+
68+
public static class Builder extends NullableFieldTracker {
69+
70+
protected String id;
71+
72+
protected String name;
73+
74+
public Builder id(String id) {
75+
this.id = id;
76+
this.markNullableFieldAsSet("id");
77+
return this;
78+
}
79+
80+
public Builder name(String name) {
81+
this.name = name;
82+
this.markNullableFieldAsSet("name");
83+
return this;
84+
}
85+
86+
public SignRequestSignerAttachment build() {
87+
return new SignRequestSignerAttachment(this);
88+
}
89+
}
90+
}

0 commit comments

Comments
 (0)