• 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/devicepinners/DevicePinnersManager.java
1
package com.box.sdkgen.managers.devicepinners;
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.devicepinner.DevicePinner;
15
import com.box.sdkgen.schemas.devicepinners.DevicePinners;
16
import com.box.sdkgen.serialization.json.JsonManager;
17
import java.util.Map;
18

19
public class DevicePinnersManager {
20

21
  public Authentication auth;
22

23
  public NetworkSession networkSession;
24

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

29
  protected DevicePinnersManager(Builder builder) {
×
30
    this.auth = builder.auth;
×
31
    this.networkSession = builder.networkSession;
×
32
  }
×
33

34
  /**
35
   * Retrieves information about an individual device pin.
36
   *
37
   * @param devicePinnerId The ID of the device pin. Example: "2324234"
38
   */
39
  public DevicePinner getDevicePinnerById(String devicePinnerId) {
40
    return getDevicePinnerById(devicePinnerId, new GetDevicePinnerByIdHeaders());
×
41
  }
42

43
  /**
44
   * Retrieves information about an individual device pin.
45
   *
46
   * @param devicePinnerId The ID of the device pin. Example: "2324234"
47
   * @param headers Headers of getDevicePinnerById method
48
   */
49
  public DevicePinner getDevicePinnerById(
50
      String devicePinnerId, GetDevicePinnerByIdHeaders headers) {
51
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
×
52
    FetchResponse response =
×
53
        this.networkSession
54
            .getNetworkClient()
×
55
            .fetch(
×
56
                new FetchOptions.Builder(
57
                        String.join(
×
58
                            "",
59
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
60
                            "/2.0/device_pinners/",
61
                            convertToString(devicePinnerId)),
×
62
                        "GET")
63
                    .headers(headersMap)
×
64
                    .responseFormat(ResponseFormat.JSON)
×
65
                    .auth(this.auth)
×
66
                    .networkSession(this.networkSession)
×
67
                    .build());
×
68
    return JsonManager.deserialize(response.getData(), DevicePinner.class);
×
69
  }
70

71
  /**
72
   * Deletes an individual device pin.
73
   *
74
   * @param devicePinnerId The ID of the device pin. Example: "2324234"
75
   */
76
  public void deleteDevicePinnerById(String devicePinnerId) {
77
    deleteDevicePinnerById(devicePinnerId, new DeleteDevicePinnerByIdHeaders());
×
78
  }
×
79

80
  /**
81
   * Deletes an individual device pin.
82
   *
83
   * @param devicePinnerId The ID of the device pin. Example: "2324234"
84
   * @param headers Headers of deleteDevicePinnerById method
85
   */
86
  public void deleteDevicePinnerById(String devicePinnerId, DeleteDevicePinnerByIdHeaders headers) {
87
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
×
88
    FetchResponse response =
×
89
        this.networkSession
90
            .getNetworkClient()
×
91
            .fetch(
×
92
                new FetchOptions.Builder(
93
                        String.join(
×
94
                            "",
95
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
96
                            "/2.0/device_pinners/",
97
                            convertToString(devicePinnerId)),
×
98
                        "DELETE")
99
                    .headers(headersMap)
×
100
                    .responseFormat(ResponseFormat.NO_CONTENT)
×
101
                    .auth(this.auth)
×
102
                    .networkSession(this.networkSession)
×
103
                    .build());
×
104
  }
×
105

106
  /**
107
   * Retrieves all the device pins within an enterprise.
108
   *
109
   * <p>The user must have admin privileges, and the application needs the "manage enterprise" scope
110
   * to make this call.
111
   *
112
   * @param enterpriseId The ID of the enterprise. Example: "3442311"
113
   */
114
  public DevicePinners getEnterpriseDevicePinners(String enterpriseId) {
115
    return getEnterpriseDevicePinners(
×
116
        enterpriseId,
117
        new GetEnterpriseDevicePinnersQueryParams(),
118
        new GetEnterpriseDevicePinnersHeaders());
119
  }
120

121
  /**
122
   * Retrieves all the device pins within an enterprise.
123
   *
124
   * <p>The user must have admin privileges, and the application needs the "manage enterprise" scope
125
   * to make this call.
126
   *
127
   * @param enterpriseId The ID of the enterprise. Example: "3442311"
128
   * @param queryParams Query parameters of getEnterpriseDevicePinners method
129
   */
130
  public DevicePinners getEnterpriseDevicePinners(
131
      String enterpriseId, GetEnterpriseDevicePinnersQueryParams queryParams) {
132
    return getEnterpriseDevicePinners(
×
133
        enterpriseId, queryParams, new GetEnterpriseDevicePinnersHeaders());
134
  }
135

136
  /**
137
   * Retrieves all the device pins within an enterprise.
138
   *
139
   * <p>The user must have admin privileges, and the application needs the "manage enterprise" scope
140
   * to make this call.
141
   *
142
   * @param enterpriseId The ID of the enterprise. Example: "3442311"
143
   * @param headers Headers of getEnterpriseDevicePinners method
144
   */
145
  public DevicePinners getEnterpriseDevicePinners(
146
      String enterpriseId, GetEnterpriseDevicePinnersHeaders headers) {
147
    return getEnterpriseDevicePinners(
×
148
        enterpriseId, new GetEnterpriseDevicePinnersQueryParams(), headers);
149
  }
150

151
  /**
152
   * Retrieves all the device pins within an enterprise.
153
   *
154
   * <p>The user must have admin privileges, and the application needs the "manage enterprise" scope
155
   * to make this call.
156
   *
157
   * @param enterpriseId The ID of the enterprise. Example: "3442311"
158
   * @param queryParams Query parameters of getEnterpriseDevicePinners method
159
   * @param headers Headers of getEnterpriseDevicePinners method
160
   */
161
  public DevicePinners getEnterpriseDevicePinners(
162
      String enterpriseId,
163
      GetEnterpriseDevicePinnersQueryParams queryParams,
164
      GetEnterpriseDevicePinnersHeaders headers) {
165
    Map<String, String> queryParamsMap =
×
166
        prepareParams(
×
167
            mapOf(
×
168
                entryOf("marker", convertToString(queryParams.getMarker())),
×
169
                entryOf("limit", convertToString(queryParams.getLimit())),
×
170
                entryOf("direction", convertToString(queryParams.getDirection()))));
×
171
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
×
172
    FetchResponse response =
×
173
        this.networkSession
174
            .getNetworkClient()
×
175
            .fetch(
×
176
                new FetchOptions.Builder(
177
                        String.join(
×
178
                            "",
179
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
180
                            "/2.0/enterprises/",
181
                            convertToString(enterpriseId),
×
182
                            "/device_pinners"),
183
                        "GET")
184
                    .params(queryParamsMap)
×
185
                    .headers(headersMap)
×
186
                    .responseFormat(ResponseFormat.JSON)
×
187
                    .auth(this.auth)
×
188
                    .networkSession(this.networkSession)
×
189
                    .build());
×
190
    return JsonManager.deserialize(response.getData(), DevicePinners.class);
×
191
  }
192

193
  public Authentication getAuth() {
194
    return auth;
×
195
  }
196

197
  public NetworkSession getNetworkSession() {
198
    return networkSession;
×
199
  }
200

201
  public static class Builder {
202

203
    protected Authentication auth;
204

205
    protected NetworkSession networkSession;
206

NEW
207
    public Builder() {}
×
208

209
    public Builder auth(Authentication auth) {
UNCOV
210
      this.auth = auth;
×
UNCOV
211
      return this;
×
212
    }
213

214
    public Builder networkSession(NetworkSession networkSession) {
UNCOV
215
      this.networkSession = networkSession;
×
UNCOV
216
      return this;
×
217
    }
218

219
    public DevicePinnersManager build() {
NEW
220
      if (this.networkSession == null) {
×
NEW
221
        this.networkSession = new NetworkSession();
×
222
      }
223
      return new DevicePinnersManager(this);
×
224
    }
225
  }
226
}
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