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

box / box-java-sdk / #6476

26 Mar 2026 04:27PM UTC coverage: 34.832% (+0.03%) from 34.803%
#6476

push

github

web-flow
fix: typo in `content_types` tags value (box/box-openapi#591) (#1753)

0 of 7 new or added lines in 2 files covered. (0.0%)

54 existing lines in 8 files now uncovered.

18723 of 53752 relevant lines covered (34.83%)

0.35 hits per line

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

81.4
/src/main/java/com/box/sdkgen/managers/trasheditems/TrashedItemsManager.java
1
package com.box.sdkgen.managers.trasheditems;
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.items.Items;
15
import com.box.sdkgen.serialization.json.JsonManager;
16
import java.util.Map;
17

18
public class TrashedItemsManager {
19

20
  public Authentication auth;
21

22
  public NetworkSession networkSession;
23

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

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

33
  /**
34
   * Retrieves the files and folders that have been moved to the trash.
35
   *
36
   * <p>Any attribute in the full files or folders objects can be passed in with the `fields`
37
   * parameter to retrieve those specific attributes that are not returned by default.
38
   *
39
   * <p>This endpoint defaults to use offset-based pagination, yet also supports marker-based
40
   * pagination using the `marker` parameter.
41
   *
42
   * <p>The number of entries returned may be less than `total_count`. For example, if a user
43
   * deletes items from a shared folder and is later removed as a collaborator, those deleted items
44
   * will no longer appear in this endpoint’s results, even though they are still included in
45
   * `total_count`.
46
   */
47
  public Items getTrashedItems() {
48
    return getTrashedItems(new GetTrashedItemsQueryParams(), new GetTrashedItemsHeaders());
1✔
49
  }
50

51
  /**
52
   * Retrieves the files and folders that have been moved to the trash.
53
   *
54
   * <p>Any attribute in the full files or folders objects can be passed in with the `fields`
55
   * parameter to retrieve those specific attributes that are not returned by default.
56
   *
57
   * <p>This endpoint defaults to use offset-based pagination, yet also supports marker-based
58
   * pagination using the `marker` parameter.
59
   *
60
   * <p>The number of entries returned may be less than `total_count`. For example, if a user
61
   * deletes items from a shared folder and is later removed as a collaborator, those deleted items
62
   * will no longer appear in this endpoint’s results, even though they are still included in
63
   * `total_count`.
64
   *
65
   * @param queryParams Query parameters of getTrashedItems method
66
   */
67
  public Items getTrashedItems(GetTrashedItemsQueryParams queryParams) {
UNCOV
68
    return getTrashedItems(queryParams, new GetTrashedItemsHeaders());
×
69
  }
70

71
  /**
72
   * Retrieves the files and folders that have been moved to the trash.
73
   *
74
   * <p>Any attribute in the full files or folders objects can be passed in with the `fields`
75
   * parameter to retrieve those specific attributes that are not returned by default.
76
   *
77
   * <p>This endpoint defaults to use offset-based pagination, yet also supports marker-based
78
   * pagination using the `marker` parameter.
79
   *
80
   * <p>The number of entries returned may be less than `total_count`. For example, if a user
81
   * deletes items from a shared folder and is later removed as a collaborator, those deleted items
82
   * will no longer appear in this endpoint’s results, even though they are still included in
83
   * `total_count`.
84
   *
85
   * @param headers Headers of getTrashedItems method
86
   */
87
  public Items getTrashedItems(GetTrashedItemsHeaders headers) {
UNCOV
88
    return getTrashedItems(new GetTrashedItemsQueryParams(), headers);
×
89
  }
90

91
  /**
92
   * Retrieves the files and folders that have been moved to the trash.
93
   *
94
   * <p>Any attribute in the full files or folders objects can be passed in with the `fields`
95
   * parameter to retrieve those specific attributes that are not returned by default.
96
   *
97
   * <p>This endpoint defaults to use offset-based pagination, yet also supports marker-based
98
   * pagination using the `marker` parameter.
99
   *
100
   * <p>The number of entries returned may be less than `total_count`. For example, if a user
101
   * deletes items from a shared folder and is later removed as a collaborator, those deleted items
102
   * will no longer appear in this endpoint’s results, even though they are still included in
103
   * `total_count`.
104
   *
105
   * @param queryParams Query parameters of getTrashedItems method
106
   * @param headers Headers of getTrashedItems method
107
   */
108
  public Items getTrashedItems(
109
      GetTrashedItemsQueryParams queryParams, GetTrashedItemsHeaders headers) {
110
    Map<String, String> queryParamsMap =
1✔
111
        prepareParams(
1✔
112
            mapOf(
1✔
113
                entryOf("fields", convertToString(queryParams.getFields())),
1✔
114
                entryOf("limit", convertToString(queryParams.getLimit())),
1✔
115
                entryOf("offset", convertToString(queryParams.getOffset())),
1✔
116
                entryOf("usemarker", convertToString(queryParams.getUsemarker())),
1✔
117
                entryOf("marker", convertToString(queryParams.getMarker())),
1✔
118
                entryOf("direction", convertToString(queryParams.getDirection())),
1✔
119
                entryOf("sort", convertToString(queryParams.getSort()))));
1✔
120
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
1✔
121
    FetchResponse response =
1✔
122
        this.networkSession
123
            .getNetworkClient()
1✔
124
            .fetch(
1✔
125
                new FetchOptions.Builder(
126
                        String.join(
1✔
127
                            "",
128
                            this.networkSession.getBaseUrls().getBaseUrl(),
1✔
129
                            "/2.0/folders/trash/items"),
130
                        "GET")
131
                    .params(queryParamsMap)
1✔
132
                    .headers(headersMap)
1✔
133
                    .responseFormat(ResponseFormat.JSON)
1✔
134
                    .auth(this.auth)
1✔
135
                    .networkSession(this.networkSession)
1✔
136
                    .build());
1✔
137
    return JsonManager.deserialize(response.getData(), Items.class);
1✔
138
  }
139

140
  public Authentication getAuth() {
UNCOV
141
    return auth;
×
142
  }
143

144
  public NetworkSession getNetworkSession() {
UNCOV
145
    return networkSession;
×
146
  }
147

148
  public static class Builder {
149

150
    protected Authentication auth;
151

152
    protected NetworkSession networkSession;
153

154
    public Builder() {}
1✔
155

156
    public Builder auth(Authentication auth) {
157
      this.auth = auth;
1✔
158
      return this;
1✔
159
    }
160

161
    public Builder networkSession(NetworkSession networkSession) {
162
      this.networkSession = networkSession;
1✔
163
      return this;
1✔
164
    }
165

166
    public TrashedItemsManager build() {
167
      if (this.networkSession == null) {
1✔
UNCOV
168
        this.networkSession = new NetworkSession();
×
169
      }
170
      return new TrashedItemsManager(this);
1✔
171
    }
172
  }
173
}
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