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

box / box-java-sdk / #6297

27 Feb 2026 04:09PM UTC coverage: 34.822% (+0.08%) from 34.746%
#6297

push

github

web-flow
docs: Update description for delete archives endpoint (box/box-openapi#585) (#1733)

Co-authored-by: box-sdk-build <box-sdk-build@box.com>

18708 of 53725 relevant lines covered (34.82%)

0.35 hits per line

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

75.49
/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

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

31
  protected SignRequestsManager(Builder builder) {
1✔
32
    this.auth = builder.auth;
1✔
33
    this.networkSession = builder.networkSession;
1✔
34
  }
1✔
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) {
42
    return cancelSignRequest(signRequestId, null, new CancelSignRequestHeaders());
1✔
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) {
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) {
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()));
1✔
77
    FetchResponse response =
1✔
78
        this.networkSession
79
            .getNetworkClient()
1✔
80
            .fetch(
1✔
81
                new FetchOptions.Builder(
82
                        String.join(
1✔
83
                            "",
84
                            this.networkSession.getBaseUrls().getBaseUrl(),
1✔
85
                            "/2.0/sign_requests/",
86
                            convertToString(signRequestId),
1✔
87
                            "/cancel"),
88
                        "POST")
89
                    .headers(headersMap)
1✔
90
                    .data((!(requestBody == null) ? JsonManager.serialize(requestBody) : null))
1✔
91
                    .contentType("application/json")
1✔
92
                    .responseFormat(ResponseFormat.JSON)
1✔
93
                    .auth(this.auth)
1✔
94
                    .networkSession(this.networkSession)
1✔
95
                    .build());
1✔
96
    return JsonManager.deserialize(response.getData(), SignRequest.class);
1✔
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) {
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) {
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/",
125
                            convertToString(signRequestId),
×
126
                            "/resend"),
127
                        "POST")
128
                    .headers(headersMap)
×
129
                    .responseFormat(ResponseFormat.NO_CONTENT)
×
130
                    .auth(this.auth)
×
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) {
141
    return getSignRequestById(signRequestId, new GetSignRequestByIdHeaders());
1✔
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) {
151
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
1✔
152
    FetchResponse response =
1✔
153
        this.networkSession
154
            .getNetworkClient()
1✔
155
            .fetch(
1✔
156
                new FetchOptions.Builder(
157
                        String.join(
1✔
158
                            "",
159
                            this.networkSession.getBaseUrls().getBaseUrl(),
1✔
160
                            "/2.0/sign_requests/",
161
                            convertToString(signRequestId)),
1✔
162
                        "GET")
163
                    .headers(headersMap)
1✔
164
                    .responseFormat(ResponseFormat.JSON)
1✔
165
                    .auth(this.auth)
1✔
166
                    .networkSession(this.networkSession)
1✔
167
                    .build());
1✔
168
    return JsonManager.deserialize(response.getData(), SignRequest.class);
1✔
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() {
176
    return getSignRequests(new GetSignRequestsQueryParams(), new GetSignRequestsHeaders());
1✔
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) {
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) {
208
    Map<String, String> queryParamsMap =
1✔
209
        prepareParams(
1✔
210
            mapOf(
1✔
211
                entryOf("marker", convertToString(queryParams.getMarker())),
1✔
212
                entryOf("limit", convertToString(queryParams.getLimit())),
1✔
213
                entryOf("senders", convertToString(queryParams.getSenders())),
1✔
214
                entryOf("shared_requests", convertToString(queryParams.getSharedRequests()))));
1✔
215
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
1✔
216
    FetchResponse response =
1✔
217
        this.networkSession
218
            .getNetworkClient()
1✔
219
            .fetch(
1✔
220
                new FetchOptions.Builder(
221
                        String.join(
1✔
222
                            "",
223
                            this.networkSession.getBaseUrls().getBaseUrl(),
1✔
224
                            "/2.0/sign_requests"),
225
                        "GET")
226
                    .params(queryParamsMap)
1✔
227
                    .headers(headersMap)
1✔
228
                    .responseFormat(ResponseFormat.JSON)
1✔
229
                    .auth(this.auth)
1✔
230
                    .networkSession(this.networkSession)
1✔
231
                    .build());
1✔
232
    return JsonManager.deserialize(response.getData(), SignRequests.class);
1✔
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());
1✔
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()));
1✔
255
    FetchResponse response =
1✔
256
        this.networkSession
257
            .getNetworkClient()
1✔
258
            .fetch(
1✔
259
                new FetchOptions.Builder(
260
                        String.join(
1✔
261
                            "",
262
                            this.networkSession.getBaseUrls().getBaseUrl(),
1✔
263
                            "/2.0/sign_requests"),
264
                        "POST")
265
                    .headers(headersMap)
1✔
266
                    .data(JsonManager.serialize(requestBody))
1✔
267
                    .contentType("application/json")
1✔
268
                    .responseFormat(ResponseFormat.JSON)
1✔
269
                    .auth(this.auth)
1✔
270
                    .networkSession(this.networkSession)
1✔
271
                    .build());
1✔
272
    return JsonManager.deserialize(response.getData(), SignRequest.class);
1✔
273
  }
274

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

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

283
  public static class Builder {
284

285
    protected Authentication auth;
286

287
    protected NetworkSession networkSession;
288

289
    public Builder() {}
1✔
290

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

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

301
    public SignRequestsManager build() {
302
      if (this.networkSession == null) {
1✔
303
        this.networkSession = new NetworkSession();
×
304
      }
305
      return new SignRequestsManager(this);
1✔
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