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

box / box-java-sdk / #5076

07 Oct 2025 12:35PM UTC coverage: 37.132% (+0.007%) from 37.125%
#5076

push

github

web-flow
test: Change `Event.additionalDetails` field assertion in events test (box/box-codegen#858) (#1491)

18454 of 49699 relevant lines covered (37.13%)

0.37 hits per line

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

83.72
/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
  public Items getTrashedItems() {
43
    return getTrashedItems(new GetTrashedItemsQueryParams(), new GetTrashedItemsHeaders());
1✔
44
  }
45

46
  /**
47
   * Retrieves the files and folders that have been moved to the trash.
48
   *
49
   * <p>Any attribute in the full files or folders objects can be passed in with the `fields`
50
   * parameter to retrieve those specific attributes that are not returned by default.
51
   *
52
   * <p>This endpoint defaults to use offset-based pagination, yet also supports marker-based
53
   * pagination using the `marker` parameter.
54
   *
55
   * @param queryParams Query parameters of getTrashedItems method
56
   */
57
  public Items getTrashedItems(GetTrashedItemsQueryParams queryParams) {
58
    return getTrashedItems(queryParams, new GetTrashedItemsHeaders());
×
59
  }
60

61
  /**
62
   * Retrieves the files and folders that have been moved to the trash.
63
   *
64
   * <p>Any attribute in the full files or folders objects can be passed in with the `fields`
65
   * parameter to retrieve those specific attributes that are not returned by default.
66
   *
67
   * <p>This endpoint defaults to use offset-based pagination, yet also supports marker-based
68
   * pagination using the `marker` parameter.
69
   *
70
   * @param headers Headers of getTrashedItems method
71
   */
72
  public Items getTrashedItems(GetTrashedItemsHeaders headers) {
73
    return getTrashedItems(new GetTrashedItemsQueryParams(), headers);
×
74
  }
75

76
  /**
77
   * Retrieves the files and folders that have been moved to the trash.
78
   *
79
   * <p>Any attribute in the full files or folders objects can be passed in with the `fields`
80
   * parameter to retrieve those specific attributes that are not returned by default.
81
   *
82
   * <p>This endpoint defaults to use offset-based pagination, yet also supports marker-based
83
   * pagination using the `marker` parameter.
84
   *
85
   * @param queryParams Query parameters of getTrashedItems method
86
   * @param headers Headers of getTrashedItems method
87
   */
88
  public Items getTrashedItems(
89
      GetTrashedItemsQueryParams queryParams, GetTrashedItemsHeaders headers) {
90
    Map<String, String> queryParamsMap =
1✔
91
        prepareParams(
1✔
92
            mapOf(
1✔
93
                entryOf("fields", convertToString(queryParams.getFields())),
1✔
94
                entryOf("limit", convertToString(queryParams.getLimit())),
1✔
95
                entryOf("offset", convertToString(queryParams.getOffset())),
1✔
96
                entryOf("usemarker", convertToString(queryParams.getUsemarker())),
1✔
97
                entryOf("marker", convertToString(queryParams.getMarker())),
1✔
98
                entryOf("direction", convertToString(queryParams.getDirection())),
1✔
99
                entryOf("sort", convertToString(queryParams.getSort()))));
1✔
100
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
1✔
101
    FetchResponse response =
1✔
102
        this.networkSession
103
            .getNetworkClient()
1✔
104
            .fetch(
1✔
105
                new FetchOptions.Builder(
106
                        String.join(
1✔
107
                            "",
108
                            this.networkSession.getBaseUrls().getBaseUrl(),
1✔
109
                            "/2.0/folders/trash/items"),
110
                        "GET")
111
                    .params(queryParamsMap)
1✔
112
                    .headers(headersMap)
1✔
113
                    .responseFormat(ResponseFormat.JSON)
1✔
114
                    .auth(this.auth)
1✔
115
                    .networkSession(this.networkSession)
1✔
116
                    .build());
1✔
117
    return JsonManager.deserialize(response.getData(), Items.class);
1✔
118
  }
119

120
  public Authentication getAuth() {
121
    return auth;
×
122
  }
123

124
  public NetworkSession getNetworkSession() {
125
    return networkSession;
×
126
  }
127

128
  public static class Builder {
129

130
    protected Authentication auth;
131

132
    protected NetworkSession networkSession;
133

134
    public Builder() {
1✔
135
      this.networkSession = new NetworkSession();
1✔
136
    }
1✔
137

138
    public Builder auth(Authentication auth) {
139
      this.auth = auth;
1✔
140
      return this;
1✔
141
    }
142

143
    public Builder networkSession(NetworkSession networkSession) {
144
      this.networkSession = networkSession;
1✔
145
      return this;
1✔
146
    }
147

148
    public TrashedItemsManager build() {
149
      return new TrashedItemsManager(this);
1✔
150
    }
151
  }
152
}
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