• 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

3.85
/src/main/java/com/box/sdkgen/managers/events/GetEventStreamQueryParams.java
1
package com.box.sdkgen.managers.events;
2

3
import com.box.sdkgen.serialization.json.EnumWrapper;
4
import com.box.sdkgen.serialization.json.Valuable;
5
import com.fasterxml.jackson.core.JsonGenerator;
6
import com.fasterxml.jackson.core.JsonParser;
7
import com.fasterxml.jackson.databind.DeserializationContext;
8
import com.fasterxml.jackson.databind.JsonDeserializer;
9
import com.fasterxml.jackson.databind.JsonNode;
10
import com.fasterxml.jackson.databind.JsonSerializer;
11
import com.fasterxml.jackson.databind.SerializerProvider;
12
import java.io.IOException;
13
import java.time.OffsetDateTime;
14
import java.util.ArrayList;
15
import java.util.List;
16

17
public class GetEventStreamQueryParams {
18

19
  /**
20
   * Defines the type of events that are returned
21
   *
22
   * <p>* `all` returns everything for a user and is the default * `changes` returns events that may
23
   * cause file tree changes such as file updates or collaborations. * `sync` is similar to
24
   * `changes` but only applies to synced folders * `admin_logs` returns all events for an entire
25
   * enterprise and requires the user making the API call to have admin permissions. This stream
26
   * type is for programmatically pulling from a 1 year history of events across all users within
27
   * the enterprise and within a `created_after` and `created_before` time frame. The complete
28
   * history of events will be returned in chronological order based on the event time, but latency
29
   * will be much higher than `admin_logs_streaming`. * `admin_logs_streaming` returns all events
30
   * for an entire enterprise and requires the user making the API call to have admin permissions.
31
   * This stream type is for polling for recent events across all users within the enterprise.
32
   * Latency will be much lower than `admin_logs`, but events will not be returned in chronological
33
   * order and may contain duplicates.
34
   */
35
  public EnumWrapper<GetEventStreamQueryParamsStreamTypeField> streamType;
36

37
  /**
38
   * The location in the event stream to start receiving events from.
39
   *
40
   * <p>* `now` will return an empty list events and the latest stream position for initialization.
41
   * * `0` or `null` will return all events.
42
   */
43
  public String streamPosition;
44

45
  /**
46
   * Limits the number of events returned.
47
   *
48
   * <p>Note: Sometimes, the events less than the limit requested can be returned even when there
49
   * may be more events remaining. This is primarily done in the case where a number of events have
50
   * already been retrieved and these retrieved events are returned rather than delaying for an
51
   * unknown amount of time to see if there are any more results.
52
   */
53
  public Long limit;
54

55
  /**
56
   * A comma-separated list of events to filter by. This can only be used when requesting the events
57
   * with a `stream_type` of `admin_logs` or `adming_logs_streaming`. For any other `stream_type`
58
   * this value will be ignored.
59
   */
60
  public List<EnumWrapper<GetEventStreamQueryParamsEventTypeField>> eventType;
61

62
  /**
63
   * The lower bound date and time to return events for. This can only be used when requesting the
64
   * events with a `stream_type` of `admin_logs`. For any other `stream_type` this value will be
65
   * ignored.
66
   */
67
  public OffsetDateTime createdAfter;
68

69
  /**
70
   * The upper bound date and time to return events for. This can only be used when requesting the
71
   * events with a `stream_type` of `admin_logs`. For any other `stream_type` this value will be
72
   * ignored.
73
   */
74
  public OffsetDateTime createdBefore;
75

76
  public GetEventStreamQueryParams() {}
1✔
77

78
  protected GetEventStreamQueryParams(Builder builder) {
×
79
    this.streamType = builder.streamType;
×
80
    this.streamPosition = builder.streamPosition;
×
81
    this.limit = builder.limit;
×
82
    this.eventType = builder.eventType;
×
83
    this.createdAfter = builder.createdAfter;
×
84
    this.createdBefore = builder.createdBefore;
×
85
  }
×
86

87
  public EnumWrapper<GetEventStreamQueryParamsStreamTypeField> getStreamType() {
88
    return streamType;
×
89
  }
90

91
  public String getStreamPosition() {
92
    return streamPosition;
1✔
93
  }
94

95
  public Long getLimit() {
96
    return limit;
×
97
  }
98

99
  public List<EnumWrapper<GetEventStreamQueryParamsEventTypeField>> getEventType() {
100
    return eventType;
×
101
  }
102

103
  public OffsetDateTime getCreatedAfter() {
104
    return createdAfter;
×
105
  }
106

107
  public OffsetDateTime getCreatedBefore() {
108
    return createdBefore;
×
109
  }
110

111
  public static class Builder {
×
112

113
    protected EnumWrapper<GetEventStreamQueryParamsStreamTypeField> streamType;
114

115
    protected String streamPosition;
116

117
    protected Long limit;
118

119
    protected List<EnumWrapper<GetEventStreamQueryParamsEventTypeField>> eventType;
120

121
    protected OffsetDateTime createdAfter;
122

123
    protected OffsetDateTime createdBefore;
124

125
    public Builder streamType(GetEventStreamQueryParamsStreamTypeField streamType) {
126
      this.streamType = new EnumWrapper<GetEventStreamQueryParamsStreamTypeField>(streamType);
×
127
      return this;
×
128
    }
129

130
    public Builder streamType(EnumWrapper<GetEventStreamQueryParamsStreamTypeField> streamType) {
131
      this.streamType = streamType;
×
132
      return this;
×
133
    }
134

135
    public Builder streamPosition(String streamPosition) {
136
      this.streamPosition = streamPosition;
×
137
      return this;
×
138
    }
139

140
    public Builder limit(Long limit) {
141
      this.limit = limit;
×
142
      return this;
×
143
    }
144

145
    public Builder eventType(List<? extends Valuable> eventType) {
146
      this.eventType =
×
147
          EnumWrapper.wrapValuableEnumList(
×
148
              eventType, GetEventStreamQueryParamsEventTypeField.class);
149
      return this;
×
150
    }
151

152
    public Builder createdAfter(OffsetDateTime createdAfter) {
153
      this.createdAfter = createdAfter;
×
154
      return this;
×
155
    }
156

157
    public Builder createdBefore(OffsetDateTime createdBefore) {
158
      this.createdBefore = createdBefore;
×
159
      return this;
×
160
    }
161

162
    public GetEventStreamQueryParams build() {
163
      return new GetEventStreamQueryParams(this);
×
164
    }
165
  }
166

167
  public static class EventTypeDeserializer
168
      extends JsonDeserializer<List<EnumWrapper<GetEventStreamQueryParamsEventTypeField>>> {
169

170
    public final JsonDeserializer<EnumWrapper<GetEventStreamQueryParamsEventTypeField>>
171
        elementDeserializer;
172

173
    public EventTypeDeserializer() {
174
      super();
×
175
      this.elementDeserializer =
×
176
          new GetEventStreamQueryParamsEventTypeField
177
              .GetEventStreamQueryParamsEventTypeFieldDeserializer();
178
    }
×
179

180
    @Override
181
    public List<EnumWrapper<GetEventStreamQueryParamsEventTypeField>> deserialize(
182
        JsonParser p, DeserializationContext ctxt) throws IOException {
183
      JsonNode node = p.getCodec().readTree(p);
×
184
      List<EnumWrapper<GetEventStreamQueryParamsEventTypeField>> elements = new ArrayList<>();
×
185
      for (JsonNode item : node) {
×
186
        JsonParser pa = item.traverse(p.getCodec());
×
187
        pa.nextToken();
×
188
        elements.add(elementDeserializer.deserialize(pa, ctxt));
×
189
      }
×
190
      return elements;
×
191
    }
192
  }
193

194
  public static class EventTypeSerializer
195
      extends JsonSerializer<List<EnumWrapper<GetEventStreamQueryParamsEventTypeField>>> {
196

197
    public final JsonSerializer<EnumWrapper<GetEventStreamQueryParamsEventTypeField>>
198
        elementSerializer;
199

200
    public EventTypeSerializer() {
201
      super();
×
202
      this.elementSerializer =
×
203
          new GetEventStreamQueryParamsEventTypeField
204
              .GetEventStreamQueryParamsEventTypeFieldSerializer();
205
    }
×
206

207
    @Override
208
    public void serialize(
209
        List<EnumWrapper<GetEventStreamQueryParamsEventTypeField>> value,
210
        JsonGenerator gen,
211
        SerializerProvider serializers)
212
        throws IOException {
213
      gen.writeStartArray();
×
214
      for (EnumWrapper<GetEventStreamQueryParamsEventTypeField> item : value) {
×
215
        elementSerializer.serialize(item, gen, serializers);
×
216
      }
×
217
      gen.writeEndArray();
×
218
    }
×
219
  }
220
}
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