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

box / box-java-sdk-gen / #541

05 Sep 2025 02:31PM UTC coverage: 7.451% (-29.2%) from 36.66%
#541

push

other

web-flow
chore: release version 0.8.1 (#437)

1 of 1 new or added line in 1 file covered. (100.0%)

14652 existing lines in 1191 files now uncovered.

3737 of 50151 relevant lines covered (7.45%)

0.07 hits per line

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

0.0
/src/main/java/com/box/sdkgen/schemas/aiagentaskoraiagentreference/AiAgentAskOrAiAgentReference.java
1
package com.box.sdkgen.schemas.aiagentaskoraiagentreference;
2

3
import com.box.sdkgen.internal.OneOfTwo;
4
import com.box.sdkgen.schemas.aiagentask.AiAgentAsk;
5
import com.box.sdkgen.schemas.aiagentreference.AiAgentReference;
6
import com.box.sdkgen.serialization.json.EnumWrapper;
7
import com.box.sdkgen.serialization.json.JsonManager;
8
import com.fasterxml.jackson.core.JsonParser;
9
import com.fasterxml.jackson.databind.DeserializationContext;
10
import com.fasterxml.jackson.databind.JsonDeserializer;
11
import com.fasterxml.jackson.databind.JsonMappingException;
12
import com.fasterxml.jackson.databind.JsonNode;
13
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
14
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
15
import java.io.IOException;
16

17
@JsonDeserialize(
18
    using = AiAgentAskOrAiAgentReference.AiAgentAskOrAiAgentReferenceDeserializer.class)
19
@JsonSerialize(using = OneOfTwo.OneOfTwoSerializer.class)
20
public class AiAgentAskOrAiAgentReference extends OneOfTwo<AiAgentAsk, AiAgentReference> {
21

22
  protected final String type;
23

24
  public AiAgentAskOrAiAgentReference(AiAgentAsk aiAgentAsk) {
UNCOV
25
    super(aiAgentAsk, null);
×
UNCOV
26
    this.type = EnumWrapper.convertToString(aiAgentAsk.getType());
×
UNCOV
27
  }
×
28

29
  public AiAgentAskOrAiAgentReference(AiAgentReference aiAgentReference) {
UNCOV
30
    super(null, aiAgentReference);
×
UNCOV
31
    this.type = EnumWrapper.convertToString(aiAgentReference.getType());
×
UNCOV
32
  }
×
33

34
  public boolean isAiAgentAsk() {
35
    return value0 != null;
×
36
  }
37

38
  public AiAgentAsk getAiAgentAsk() {
39
    return value0;
×
40
  }
41

42
  public boolean isAiAgentReference() {
43
    return value1 != null;
×
44
  }
45

46
  public AiAgentReference getAiAgentReference() {
47
    return value1;
×
48
  }
49

50
  public String getType() {
51
    return type;
×
52
  }
53

54
  static class AiAgentAskOrAiAgentReferenceDeserializer
55
      extends JsonDeserializer<AiAgentAskOrAiAgentReference> {
56

57
    public AiAgentAskOrAiAgentReferenceDeserializer() {
58
      super();
×
59
    }
×
60

61
    @Override
62
    public AiAgentAskOrAiAgentReference deserialize(JsonParser jp, DeserializationContext ctxt)
63
        throws IOException {
64
      JsonNode node = JsonManager.jsonToSerializedData(jp);
×
65
      JsonNode discriminant0 = node.get("type");
×
66
      if (!(discriminant0 == null)) {
×
67
        switch (discriminant0.asText()) {
×
68
          case "ai_agent_ask":
69
            return new AiAgentAskOrAiAgentReference(
×
70
                JsonManager.deserialize(node, AiAgentAsk.class));
×
71
          case "ai_agent_id":
72
            return new AiAgentAskOrAiAgentReference(
×
73
                JsonManager.deserialize(node, AiAgentReference.class));
×
74
        }
75
      }
76
      throw new JsonMappingException(jp, "Unable to deserialize AiAgentAskOrAiAgentReference");
×
77
    }
78
  }
79
}
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