• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

box / box-java-sdk / #6258

11 Feb 2026 10:35AM UTC coverage: 12.834%. Remained the same
#6258

push

github

web-flow
feat(boxsdkgen): add signer language, cancel sign request reason (box/box-openapi#584) (#1720)

0 of 35 new or added lines in 4 files covered. (0.0%)

181 existing lines in 5 files now uncovered.

8374 of 65251 relevant lines covered (12.83%)

0.13 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/com/box/sdkgen/managers/signrequests/SignRequestsManager.java
1
package com.box.sdkgen.managers.signrequests;
2

3
import static com.box.sdkgen.internal.utils.UtilsManager.convertToString;
4
import static com.box.sdkgen.internal.utils.UtilsManager.entryOf;
5
import static com.box.sdkgen.internal.utils.UtilsManager.mapOf;
6
import static com.box.sdkgen.internal.utils.UtilsManager.mergeMaps;
7
import static com.box.sdkgen.internal.utils.UtilsManager.prepareParams;
8

9
import com.box.sdkgen.networking.auth.Authentication;
10
import com.box.sdkgen.networking.fetchoptions.FetchOptions;
11
import com.box.sdkgen.networking.fetchoptions.ResponseFormat;
12
import com.box.sdkgen.networking.fetchresponse.FetchResponse;
13
import com.box.sdkgen.networking.network.NetworkSession;
14
import com.box.sdkgen.schemas.signrequest.SignRequest;
15
import com.box.sdkgen.schemas.signrequestcancelrequest.SignRequestCancelRequest;
16
import com.box.sdkgen.schemas.signrequestcreaterequest.SignRequestCreateRequest;
17
import com.box.sdkgen.schemas.signrequests.SignRequests;
18
import com.box.sdkgen.serialization.json.JsonManager;
19
import java.util.Map;
20

21
public class SignRequestsManager {
22

23
  public Authentication auth;
24

25
  public NetworkSession networkSession;
26

UNCOV
27
  public SignRequestsManager() {
×
28
    this.networkSession = new NetworkSession();
×
29
  }
×
30

UNCOV
31
  protected SignRequestsManager(Builder builder) {
×
32
    this.auth = builder.auth;
×
33
    this.networkSession = builder.networkSession;
×
34
  }
×
35

36
  /**
37
   * Cancels a sign request.
38
   *
39
   * @param signRequestId The ID of the signature request. Example: "33243242"
40
   */
41
  public SignRequest cancelSignRequest(String signRequestId) {
NEW
42
    return cancelSignRequest(signRequestId, null, new CancelSignRequestHeaders());
×
43
  }
44

45
  /**
46
   * Cancels a sign request.
47
   *
48
   * @param signRequestId The ID of the signature request. Example: "33243242"
49
   * @param requestBody Request body of cancelSignRequest method
50
   */
51
  public SignRequest cancelSignRequest(String signRequestId, SignRequestCancelRequest requestBody) {
NEW
52
    return cancelSignRequest(signRequestId, requestBody, new CancelSignRequestHeaders());
×
53
  }
54

55
  /**
56
   * Cancels a sign request.
57
   *
58
   * @param signRequestId The ID of the signature request. Example: "33243242"
59
   * @param headers Headers of cancelSignRequest method
60
   */
61
  public SignRequest cancelSignRequest(String signRequestId, CancelSignRequestHeaders headers) {
NEW
62
    return cancelSignRequest(signRequestId, null, headers);
×
63
  }
64

65
  /**
66
   * Cancels a sign request.
67
   *
68
   * @param signRequestId The ID of the signature request. Example: "33243242"
69
   * @param requestBody Request body of cancelSignRequest method
70
   * @param headers Headers of cancelSignRequest method
71
   */
72
  public SignRequest cancelSignRequest(
73
      String signRequestId,
74
      SignRequestCancelRequest requestBody,
75
      CancelSignRequestHeaders headers) {
76
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
×
77
    FetchResponse response =
×
78
        this.networkSession
UNCOV
79
            .getNetworkClient()
×
UNCOV
80
            .fetch(
×
81
                new FetchOptions.Builder(
UNCOV
82
                        String.join(
×
83
                            "",
UNCOV
84
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
85
                            "/2.0/sign_requests/",
UNCOV
86
                            convertToString(signRequestId),
×
87
                            "/cancel"),
88
                        "POST")
UNCOV
89
                    .headers(headersMap)
×
NEW
90
                    .data((!(requestBody == null) ? JsonManager.serialize(requestBody) : null))
×
NEW
91
                    .contentType("application/json")
×
UNCOV
92
                    .responseFormat(ResponseFormat.JSON)
×
UNCOV
93
                    .auth(this.auth)
×
UNCOV
94
                    .networkSession(this.networkSession)
×
UNCOV
95
                    .build());
×
UNCOV
96
    return JsonManager.deserialize(response.getData(), SignRequest.class);
×
97
  }
98

99
  /**
100
   * Resends a signature request email to all outstanding signers.
101
   *
102
   * @param signRequestId The ID of the signature request. Example: "33243242"
103
   */
104
  public void resendSignRequest(String signRequestId) {
UNCOV
105
    resendSignRequest(signRequestId, new ResendSignRequestHeaders());
×
106
  }
×
107

108
  /**
109
   * Resends a signature request email to all outstanding signers.
110
   *
111
   * @param signRequestId The ID of the signature request. Example: "33243242"
112
   * @param headers Headers of resendSignRequest method
113
   */
114
  public void resendSignRequest(String signRequestId, ResendSignRequestHeaders headers) {
UNCOV
115
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
×
116
    FetchResponse response =
×
117
        this.networkSession
118
            .getNetworkClient()
×
119
            .fetch(
×
120
                new FetchOptions.Builder(
121
                        String.join(
×
122
                            "",
123
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
124
                            "/2.0/sign_requests/",
UNCOV
125
                            convertToString(signRequestId),
×
126
                            "/resend"),
127
                        "POST")
UNCOV
128
                    .headers(headersMap)
×
UNCOV
129
                    .responseFormat(ResponseFormat.NO_CONTENT)
×
UNCOV
130
                    .auth(this.auth)
×
UNCOV
131
                    .networkSession(this.networkSession)
×
132
                    .build());
×
133
  }
×
134

135
  /**
136
   * Gets a sign request by ID.
137
   *
138
   * @param signRequestId The ID of the signature request. Example: "33243242"
139
   */
140
  public SignRequest getSignRequestById(String signRequestId) {
UNCOV
141
    return getSignRequestById(signRequestId, new GetSignRequestByIdHeaders());
×
142
  }
143

144
  /**
145
   * Gets a sign request by ID.
146
   *
147
   * @param signRequestId The ID of the signature request. Example: "33243242"
148
   * @param headers Headers of getSignRequestById method
149
   */
150
  public SignRequest getSignRequestById(String signRequestId, GetSignRequestByIdHeaders headers) {
UNCOV
151
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
×
152
    FetchResponse response =
×
153
        this.networkSession
UNCOV
154
            .getNetworkClient()
×
155
            .fetch(
×
156
                new FetchOptions.Builder(
157
                        String.join(
×
158
                            "",
159
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
160
                            "/2.0/sign_requests/",
UNCOV
161
                            convertToString(signRequestId)),
×
162
                        "GET")
UNCOV
163
                    .headers(headersMap)
×
UNCOV
164
                    .responseFormat(ResponseFormat.JSON)
×
UNCOV
165
                    .auth(this.auth)
×
UNCOV
166
                    .networkSession(this.networkSession)
×
UNCOV
167
                    .build());
×
168
    return JsonManager.deserialize(response.getData(), SignRequest.class);
×
169
  }
170

171
  /**
172
   * Gets signature requests created by a user. If the `sign_files` and/or `parent_folder` are
173
   * deleted, the signature request will not return in the list.
174
   */
175
  public SignRequests getSignRequests() {
UNCOV
176
    return getSignRequests(new GetSignRequestsQueryParams(), new GetSignRequestsHeaders());
×
177
  }
178

179
  /**
180
   * Gets signature requests created by a user. If the `sign_files` and/or `parent_folder` are
181
   * deleted, the signature request will not return in the list.
182
   *
183
   * @param queryParams Query parameters of getSignRequests method
184
   */
185
  public SignRequests getSignRequests(GetSignRequestsQueryParams queryParams) {
186
    return getSignRequests(queryParams, new GetSignRequestsHeaders());
×
187
  }
188

189
  /**
190
   * Gets signature requests created by a user. If the `sign_files` and/or `parent_folder` are
191
   * deleted, the signature request will not return in the list.
192
   *
193
   * @param headers Headers of getSignRequests method
194
   */
195
  public SignRequests getSignRequests(GetSignRequestsHeaders headers) {
UNCOV
196
    return getSignRequests(new GetSignRequestsQueryParams(), headers);
×
197
  }
198

199
  /**
200
   * Gets signature requests created by a user. If the `sign_files` and/or `parent_folder` are
201
   * deleted, the signature request will not return in the list.
202
   *
203
   * @param queryParams Query parameters of getSignRequests method
204
   * @param headers Headers of getSignRequests method
205
   */
206
  public SignRequests getSignRequests(
207
      GetSignRequestsQueryParams queryParams, GetSignRequestsHeaders headers) {
UNCOV
208
    Map<String, String> queryParamsMap =
×
UNCOV
209
        prepareParams(
×
UNCOV
210
            mapOf(
×
UNCOV
211
                entryOf("marker", convertToString(queryParams.getMarker())),
×
UNCOV
212
                entryOf("limit", convertToString(queryParams.getLimit())),
×
213
                entryOf("senders", convertToString(queryParams.getSenders())),
×
UNCOV
214
                entryOf("shared_requests", convertToString(queryParams.getSharedRequests()))));
×
UNCOV
215
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
×
UNCOV
216
    FetchResponse response =
×
217
        this.networkSession
UNCOV
218
            .getNetworkClient()
×
UNCOV
219
            .fetch(
×
220
                new FetchOptions.Builder(
UNCOV
221
                        String.join(
×
222
                            "",
223
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
224
                            "/2.0/sign_requests"),
225
                        "GET")
UNCOV
226
                    .params(queryParamsMap)
×
UNCOV
227
                    .headers(headersMap)
×
UNCOV
228
                    .responseFormat(ResponseFormat.JSON)
×
UNCOV
229
                    .auth(this.auth)
×
UNCOV
230
                    .networkSession(this.networkSession)
×
UNCOV
231
                    .build());
×
UNCOV
232
    return JsonManager.deserialize(response.getData(), SignRequests.class);
×
233
  }
234

235
  /**
236
   * Creates a signature request. This involves preparing a document for signing and sending the
237
   * signature request to signers.
238
   *
239
   * @param requestBody Request body of createSignRequest method
240
   */
241
  public SignRequest createSignRequest(SignRequestCreateRequest requestBody) {
242
    return createSignRequest(requestBody, new CreateSignRequestHeaders());
×
243
  }
244

245
  /**
246
   * Creates a signature request. This involves preparing a document for signing and sending the
247
   * signature request to signers.
248
   *
249
   * @param requestBody Request body of createSignRequest method
250
   * @param headers Headers of createSignRequest method
251
   */
252
  public SignRequest createSignRequest(
253
      SignRequestCreateRequest requestBody, CreateSignRequestHeaders headers) {
254
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
×
255
    FetchResponse response =
×
256
        this.networkSession
257
            .getNetworkClient()
×
258
            .fetch(
×
259
                new FetchOptions.Builder(
UNCOV
260
                        String.join(
×
261
                            "",
UNCOV
262
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
263
                            "/2.0/sign_requests"),
264
                        "POST")
UNCOV
265
                    .headers(headersMap)
×
UNCOV
266
                    .data(JsonManager.serialize(requestBody))
×
UNCOV
267
                    .contentType("application/json")
×
UNCOV
268
                    .responseFormat(ResponseFormat.JSON)
×
269
                    .auth(this.auth)
×
UNCOV
270
                    .networkSession(this.networkSession)
×
UNCOV
271
                    .build());
×
UNCOV
272
    return JsonManager.deserialize(response.getData(), SignRequest.class);
×
273
  }
274

275
  public Authentication getAuth() {
UNCOV
276
    return auth;
×
277
  }
278

279
  public NetworkSession getNetworkSession() {
UNCOV
280
    return networkSession;
×
281
  }
282

283
  public static class Builder {
284

285
    protected Authentication auth;
286

287
    protected NetworkSession networkSession;
288

289
    public Builder() {}
×
290

291
    public Builder auth(Authentication auth) {
292
      this.auth = auth;
×
293
      return this;
×
294
    }
295

296
    public Builder networkSession(NetworkSession networkSession) {
297
      this.networkSession = networkSession;
×
298
      return this;
×
299
    }
300

301
    public SignRequestsManager build() {
UNCOV
302
      if (this.networkSession == null) {
×
303
        this.networkSession = new NetworkSession();
×
304
      }
UNCOV
305
      return new SignRequestsManager(this);
×
306
    }
307
  }
308
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc