• 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

11.32
/src/main/java/com/box/sdkgen/managers/listcollaborations/ListCollaborationsManager.java
1
package com.box.sdkgen.managers.listcollaborations;
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.collaborations.Collaborations;
15
import com.box.sdkgen.schemas.collaborationsoffsetpaginated.CollaborationsOffsetPaginated;
16
import com.box.sdkgen.serialization.json.JsonManager;
17
import java.util.Map;
18

19
public class ListCollaborationsManager {
20

21
  public Authentication auth;
22

23
  public NetworkSession networkSession;
24

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

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

34
  public Collaborations getFileCollaborations(String fileId) {
UNCOV
35
    return getFileCollaborations(
×
36
        fileId, new GetFileCollaborationsQueryParams(), new GetFileCollaborationsHeaders());
37
  }
38

39
  public Collaborations getFileCollaborations(
40
      String fileId, GetFileCollaborationsQueryParams queryParams) {
41
    return getFileCollaborations(fileId, queryParams, new GetFileCollaborationsHeaders());
×
42
  }
43

44
  public Collaborations getFileCollaborations(String fileId, GetFileCollaborationsHeaders headers) {
45
    return getFileCollaborations(fileId, new GetFileCollaborationsQueryParams(), headers);
×
46
  }
47

48
  public Collaborations getFileCollaborations(
49
      String fileId,
50
      GetFileCollaborationsQueryParams queryParams,
51
      GetFileCollaborationsHeaders headers) {
UNCOV
52
    Map<String, String> queryParamsMap =
×
UNCOV
53
        prepareParams(
×
UNCOV
54
            mapOf(
×
UNCOV
55
                entryOf("fields", convertToString(queryParams.getFields())),
×
UNCOV
56
                entryOf("limit", convertToString(queryParams.getLimit())),
×
UNCOV
57
                entryOf("marker", convertToString(queryParams.getMarker()))));
×
UNCOV
58
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
×
UNCOV
59
    FetchResponse response =
×
60
        this.networkSession
UNCOV
61
            .getNetworkClient()
×
UNCOV
62
            .fetch(
×
63
                new FetchOptions.Builder(
UNCOV
64
                        String.join(
×
65
                            "",
UNCOV
66
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
67
                            "/2.0/files/",
UNCOV
68
                            convertToString(fileId),
×
69
                            "/collaborations"),
70
                        "GET")
UNCOV
71
                    .params(queryParamsMap)
×
UNCOV
72
                    .headers(headersMap)
×
UNCOV
73
                    .responseFormat(ResponseFormat.JSON)
×
UNCOV
74
                    .auth(this.auth)
×
UNCOV
75
                    .networkSession(this.networkSession)
×
UNCOV
76
                    .build());
×
UNCOV
77
    return JsonManager.deserialize(response.getData(), Collaborations.class);
×
78
  }
79

80
  public Collaborations getFolderCollaborations(String folderId) {
UNCOV
81
    return getFolderCollaborations(
×
82
        folderId, new GetFolderCollaborationsQueryParams(), new GetFolderCollaborationsHeaders());
83
  }
84

85
  public Collaborations getFolderCollaborations(
86
      String folderId, GetFolderCollaborationsQueryParams queryParams) {
87
    return getFolderCollaborations(folderId, queryParams, new GetFolderCollaborationsHeaders());
×
88
  }
89

90
  public Collaborations getFolderCollaborations(
91
      String folderId, GetFolderCollaborationsHeaders headers) {
92
    return getFolderCollaborations(folderId, new GetFolderCollaborationsQueryParams(), headers);
×
93
  }
94

95
  public Collaborations getFolderCollaborations(
96
      String folderId,
97
      GetFolderCollaborationsQueryParams queryParams,
98
      GetFolderCollaborationsHeaders headers) {
UNCOV
99
    Map<String, String> queryParamsMap =
×
UNCOV
100
        prepareParams(
×
UNCOV
101
            mapOf(
×
UNCOV
102
                entryOf("fields", convertToString(queryParams.getFields())),
×
UNCOV
103
                entryOf("limit", convertToString(queryParams.getLimit())),
×
UNCOV
104
                entryOf("marker", convertToString(queryParams.getMarker()))));
×
UNCOV
105
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
×
UNCOV
106
    FetchResponse response =
×
107
        this.networkSession
UNCOV
108
            .getNetworkClient()
×
UNCOV
109
            .fetch(
×
110
                new FetchOptions.Builder(
UNCOV
111
                        String.join(
×
112
                            "",
UNCOV
113
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
114
                            "/2.0/folders/",
UNCOV
115
                            convertToString(folderId),
×
116
                            "/collaborations"),
117
                        "GET")
UNCOV
118
                    .params(queryParamsMap)
×
UNCOV
119
                    .headers(headersMap)
×
UNCOV
120
                    .responseFormat(ResponseFormat.JSON)
×
UNCOV
121
                    .auth(this.auth)
×
UNCOV
122
                    .networkSession(this.networkSession)
×
UNCOV
123
                    .build());
×
UNCOV
124
    return JsonManager.deserialize(response.getData(), Collaborations.class);
×
125
  }
126

127
  public CollaborationsOffsetPaginated getCollaborations(GetCollaborationsQueryParams queryParams) {
UNCOV
128
    return getCollaborations(queryParams, new GetCollaborationsHeaders());
×
129
  }
130

131
  public CollaborationsOffsetPaginated getCollaborations(
132
      GetCollaborationsQueryParams queryParams, GetCollaborationsHeaders headers) {
UNCOV
133
    Map<String, String> queryParamsMap =
×
UNCOV
134
        prepareParams(
×
UNCOV
135
            mapOf(
×
UNCOV
136
                entryOf("status", convertToString(queryParams.getStatus())),
×
UNCOV
137
                entryOf("fields", convertToString(queryParams.getFields())),
×
UNCOV
138
                entryOf("offset", convertToString(queryParams.getOffset())),
×
UNCOV
139
                entryOf("limit", convertToString(queryParams.getLimit()))));
×
UNCOV
140
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
×
UNCOV
141
    FetchResponse response =
×
142
        this.networkSession
UNCOV
143
            .getNetworkClient()
×
UNCOV
144
            .fetch(
×
145
                new FetchOptions.Builder(
UNCOV
146
                        String.join(
×
147
                            "",
UNCOV
148
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
149
                            "/2.0/collaborations"),
150
                        "GET")
UNCOV
151
                    .params(queryParamsMap)
×
UNCOV
152
                    .headers(headersMap)
×
UNCOV
153
                    .responseFormat(ResponseFormat.JSON)
×
UNCOV
154
                    .auth(this.auth)
×
UNCOV
155
                    .networkSession(this.networkSession)
×
UNCOV
156
                    .build());
×
UNCOV
157
    return JsonManager.deserialize(response.getData(), CollaborationsOffsetPaginated.class);
×
158
  }
159

160
  public CollaborationsOffsetPaginated getGroupCollaborations(String groupId) {
UNCOV
161
    return getGroupCollaborations(
×
162
        groupId, new GetGroupCollaborationsQueryParams(), new GetGroupCollaborationsHeaders());
163
  }
164

165
  public CollaborationsOffsetPaginated getGroupCollaborations(
166
      String groupId, GetGroupCollaborationsQueryParams queryParams) {
167
    return getGroupCollaborations(groupId, queryParams, new GetGroupCollaborationsHeaders());
×
168
  }
169

170
  public CollaborationsOffsetPaginated getGroupCollaborations(
171
      String groupId, GetGroupCollaborationsHeaders headers) {
172
    return getGroupCollaborations(groupId, new GetGroupCollaborationsQueryParams(), headers);
×
173
  }
174

175
  public CollaborationsOffsetPaginated getGroupCollaborations(
176
      String groupId,
177
      GetGroupCollaborationsQueryParams queryParams,
178
      GetGroupCollaborationsHeaders headers) {
UNCOV
179
    Map<String, String> queryParamsMap =
×
UNCOV
180
        prepareParams(
×
UNCOV
181
            mapOf(
×
UNCOV
182
                entryOf("limit", convertToString(queryParams.getLimit())),
×
UNCOV
183
                entryOf("offset", convertToString(queryParams.getOffset()))));
×
UNCOV
184
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
×
UNCOV
185
    FetchResponse response =
×
186
        this.networkSession
UNCOV
187
            .getNetworkClient()
×
UNCOV
188
            .fetch(
×
189
                new FetchOptions.Builder(
UNCOV
190
                        String.join(
×
191
                            "",
UNCOV
192
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
193
                            "/2.0/groups/",
UNCOV
194
                            convertToString(groupId),
×
195
                            "/collaborations"),
196
                        "GET")
UNCOV
197
                    .params(queryParamsMap)
×
UNCOV
198
                    .headers(headersMap)
×
UNCOV
199
                    .responseFormat(ResponseFormat.JSON)
×
UNCOV
200
                    .auth(this.auth)
×
UNCOV
201
                    .networkSession(this.networkSession)
×
UNCOV
202
                    .build());
×
UNCOV
203
    return JsonManager.deserialize(response.getData(), CollaborationsOffsetPaginated.class);
×
204
  }
205

206
  public Authentication getAuth() {
207
    return auth;
×
208
  }
209

210
  public NetworkSession getNetworkSession() {
211
    return networkSession;
×
212
  }
213

214
  public static class Builder {
215

216
    protected Authentication auth;
217

218
    protected NetworkSession networkSession;
219

220
    public Builder() {
1✔
221
      this.networkSession = new NetworkSession();
1✔
222
    }
1✔
223

224
    public Builder auth(Authentication auth) {
225
      this.auth = auth;
1✔
226
      return this;
1✔
227
    }
228

229
    public Builder networkSession(NetworkSession networkSession) {
230
      this.networkSession = networkSession;
1✔
231
      return this;
1✔
232
    }
233

234
    public ListCollaborationsManager build() {
235
      return new ListCollaborationsManager(this);
1✔
236
    }
237
  }
238
}
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