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

box / box-java-sdk / #6243

10 Feb 2026 05:27PM UTC coverage: 18.192% (-17.5%) from 35.714%
#6243

push

github

web-flow
fix(boxsdkgen): Move assigning default values from builder constructor to `build()` method (box/box-codegen#922) (#1712)

0 of 1677 new or added lines in 569 files covered. (0.0%)

2147 existing lines in 545 files now uncovered.

7388 of 40611 relevant lines covered (18.19%)

0.21 hits per line

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

0.0
/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) {
×
29
    this.auth = builder.auth;
×
30
    this.networkSession = builder.networkSession;
×
31
  }
×
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());
×
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 =
×
91
        prepareParams(
×
92
            mapOf(
×
93
                entryOf("fields", convertToString(queryParams.getFields())),
×
94
                entryOf("limit", convertToString(queryParams.getLimit())),
×
95
                entryOf("offset", convertToString(queryParams.getOffset())),
×
96
                entryOf("usemarker", convertToString(queryParams.getUsemarker())),
×
97
                entryOf("marker", convertToString(queryParams.getMarker())),
×
98
                entryOf("direction", convertToString(queryParams.getDirection())),
×
99
                entryOf("sort", convertToString(queryParams.getSort()))));
×
100
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
×
101
    FetchResponse response =
×
102
        this.networkSession
103
            .getNetworkClient()
×
104
            .fetch(
×
105
                new FetchOptions.Builder(
106
                        String.join(
×
107
                            "",
108
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
109
                            "/2.0/folders/trash/items"),
110
                        "GET")
111
                    .params(queryParamsMap)
×
112
                    .headers(headersMap)
×
113
                    .responseFormat(ResponseFormat.JSON)
×
114
                    .auth(this.auth)
×
115
                    .networkSession(this.networkSession)
×
116
                    .build());
×
117
    return JsonManager.deserialize(response.getData(), Items.class);
×
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

NEW
134
    public Builder() {}
×
135

136
    public Builder auth(Authentication auth) {
UNCOV
137
      this.auth = auth;
×
UNCOV
138
      return this;
×
139
    }
140

141
    public Builder networkSession(NetworkSession networkSession) {
UNCOV
142
      this.networkSession = networkSession;
×
UNCOV
143
      return this;
×
144
    }
145

146
    public TrashedItemsManager build() {
NEW
147
      if (this.networkSession == null) {
×
NEW
148
        this.networkSession = new NetworkSession();
×
149
      }
150
      return new TrashedItemsManager(this);
×
151
    }
152
  }
153
}
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