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

box / box-java-sdk-gen / #541

05 Sep 2025 02:31PM UTC coverage: 7.451% (-29.2%) from 36.66%
#541

push

other

web-flow
chore: release version 0.8.1 (#437)

1 of 1 new or added line in 1 file covered. (100.0%)

14652 existing lines in 1191 files now uncovered.

3737 of 50151 relevant lines covered (7.45%)

0.07 hits per line

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

20.69
/src/main/java/com/box/sdkgen/managers/fileversionretentions/FileVersionRetentionsManager.java
1
package com.box.sdkgen.managers.fileversionretentions;
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.fileversionretention.FileVersionRetention;
15
import com.box.sdkgen.schemas.fileversionretentions.FileVersionRetentions;
16
import com.box.sdkgen.serialization.json.JsonManager;
17
import java.util.Map;
18

19
public class FileVersionRetentionsManager {
20

21
  public Authentication auth;
22

23
  public NetworkSession networkSession;
24

25
  public FileVersionRetentionsManager() {
×
26
    this.networkSession = new NetworkSession();
×
27
  }
×
28

29
  protected FileVersionRetentionsManager(Builder builder) {
1✔
30
    this.auth = builder.auth;
1✔
31
    this.networkSession = builder.networkSession;
1✔
32
  }
1✔
33

34
  public FileVersionRetentions getFileVersionRetentions() {
UNCOV
35
    return getFileVersionRetentions(
×
36
        new GetFileVersionRetentionsQueryParams(), new GetFileVersionRetentionsHeaders());
37
  }
38

39
  public FileVersionRetentions getFileVersionRetentions(
40
      GetFileVersionRetentionsQueryParams queryParams) {
41
    return getFileVersionRetentions(queryParams, new GetFileVersionRetentionsHeaders());
×
42
  }
43

44
  public FileVersionRetentions getFileVersionRetentions(GetFileVersionRetentionsHeaders headers) {
45
    return getFileVersionRetentions(new GetFileVersionRetentionsQueryParams(), headers);
×
46
  }
47

48
  public FileVersionRetentions getFileVersionRetentions(
49
      GetFileVersionRetentionsQueryParams queryParams, GetFileVersionRetentionsHeaders headers) {
UNCOV
50
    Map<String, String> queryParamsMap =
×
UNCOV
51
        prepareParams(
×
UNCOV
52
            mapOf(
×
UNCOV
53
                entryOf("file_id", convertToString(queryParams.getFileId())),
×
UNCOV
54
                entryOf("file_version_id", convertToString(queryParams.getFileVersionId())),
×
UNCOV
55
                entryOf("policy_id", convertToString(queryParams.getPolicyId())),
×
UNCOV
56
                entryOf("disposition_action", convertToString(queryParams.getDispositionAction())),
×
UNCOV
57
                entryOf("disposition_before", convertToString(queryParams.getDispositionBefore())),
×
UNCOV
58
                entryOf("disposition_after", convertToString(queryParams.getDispositionAfter())),
×
UNCOV
59
                entryOf("limit", convertToString(queryParams.getLimit())),
×
UNCOV
60
                entryOf("marker", convertToString(queryParams.getMarker()))));
×
UNCOV
61
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
×
UNCOV
62
    FetchResponse response =
×
63
        this.networkSession
UNCOV
64
            .getNetworkClient()
×
UNCOV
65
            .fetch(
×
66
                new FetchOptions.Builder(
UNCOV
67
                        String.join(
×
68
                            "",
UNCOV
69
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
70
                            "/2.0/file_version_retentions"),
71
                        "GET")
UNCOV
72
                    .params(queryParamsMap)
×
UNCOV
73
                    .headers(headersMap)
×
UNCOV
74
                    .responseFormat(ResponseFormat.JSON)
×
UNCOV
75
                    .auth(this.auth)
×
UNCOV
76
                    .networkSession(this.networkSession)
×
UNCOV
77
                    .build());
×
UNCOV
78
    return JsonManager.deserialize(response.getData(), FileVersionRetentions.class);
×
79
  }
80

81
  public FileVersionRetention getFileVersionRetentionById(String fileVersionRetentionId) {
82
    return getFileVersionRetentionById(
×
83
        fileVersionRetentionId, new GetFileVersionRetentionByIdHeaders());
84
  }
85

86
  public FileVersionRetention getFileVersionRetentionById(
87
      String fileVersionRetentionId, GetFileVersionRetentionByIdHeaders headers) {
88
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
×
89
    FetchResponse response =
×
90
        this.networkSession
91
            .getNetworkClient()
×
92
            .fetch(
×
93
                new FetchOptions.Builder(
94
                        String.join(
×
95
                            "",
96
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
97
                            "/2.0/file_version_retentions/",
98
                            convertToString(fileVersionRetentionId)),
×
99
                        "GET")
100
                    .headers(headersMap)
×
101
                    .responseFormat(ResponseFormat.JSON)
×
102
                    .auth(this.auth)
×
103
                    .networkSession(this.networkSession)
×
104
                    .build());
×
105
    return JsonManager.deserialize(response.getData(), FileVersionRetention.class);
×
106
  }
107

108
  public Authentication getAuth() {
109
    return auth;
×
110
  }
111

112
  public NetworkSession getNetworkSession() {
113
    return networkSession;
×
114
  }
115

116
  public static class Builder {
117

118
    protected Authentication auth;
119

120
    protected NetworkSession networkSession;
121

122
    public Builder() {
1✔
123
      this.networkSession = new NetworkSession();
1✔
124
    }
1✔
125

126
    public Builder auth(Authentication auth) {
127
      this.auth = auth;
1✔
128
      return this;
1✔
129
    }
130

131
    public Builder networkSession(NetworkSession networkSession) {
132
      this.networkSession = networkSession;
1✔
133
      return this;
1✔
134
    }
135

136
    public FileVersionRetentionsManager build() {
137
      return new FileVersionRetentionsManager(this);
1✔
138
    }
139
  }
140
}
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