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

box / box-java-sdk / #5788

03 Dec 2025 11:45AM UTC coverage: 35.933% (-0.005%) from 35.938%
#5788

push

github

web-flow
docs: modify `can_view_path` description and add confidence scores for structured extract (box/box-openapi#566) (#1601)

2 of 12 new or added lines in 2 files covered. (16.67%)

3 existing lines in 3 files now uncovered.

18482 of 51435 relevant lines covered (35.93%)

0.36 hits per line

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

15.0
/src/main/java/com/box/sdkgen/schemas/aiextractstructuredresponse/AiExtractStructuredResponse.java
1
package com.box.sdkgen.schemas.aiextractstructuredresponse;
2

3
import com.box.sdkgen.internal.NullableFieldTracker;
4
import com.box.sdkgen.internal.SerializableObject;
5
import com.box.sdkgen.internal.utils.DateTimeUtils;
6
import com.box.sdkgen.schemas.aiagentinfo.AiAgentInfo;
7
import com.fasterxml.jackson.annotation.JsonFilter;
8
import com.fasterxml.jackson.annotation.JsonProperty;
9
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
10
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
11
import java.time.OffsetDateTime;
12
import java.util.Map;
13
import java.util.Objects;
14

15
/** AI extract structured response. */
16
@JsonFilter("nullablePropertyFilter")
17
public class AiExtractStructuredResponse extends SerializableObject {
18

19
  protected final Map<String, Object> answer;
20

21
  /** The ISO date formatted timestamp of when the answer to the prompt was created. */
22
  @JsonProperty("created_at")
23
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
24
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
25
  protected final OffsetDateTime createdAt;
26

27
  /** The reason the response finishes. */
28
  @JsonProperty("completion_reason")
29
  protected String completionReason;
30

31
  /**
32
   * The confidence score numeric values for each extracted field as a JSON dictionary. This can be
33
   * empty if no field could be extracted.
34
   */
35
  @JsonProperty("confidence_score")
36
  protected Map<String, Object> confidenceScore;
37

38
  @JsonProperty("ai_agent_info")
39
  protected AiAgentInfo aiAgentInfo;
40

41
  public AiExtractStructuredResponse(
42
      @JsonProperty("answer") Map<String, Object> answer,
43
      @JsonProperty("created_at") OffsetDateTime createdAt) {
44
    super();
1✔
45
    this.answer = answer;
1✔
46
    this.createdAt = createdAt;
1✔
47
  }
1✔
48

49
  protected AiExtractStructuredResponse(Builder builder) {
50
    super();
×
51
    this.answer = builder.answer;
×
52
    this.createdAt = builder.createdAt;
×
53
    this.completionReason = builder.completionReason;
×
NEW
54
    this.confidenceScore = builder.confidenceScore;
×
55
    this.aiAgentInfo = builder.aiAgentInfo;
×
56
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
57
  }
×
58

59
  public Map<String, Object> getAnswer() {
60
    return answer;
1✔
61
  }
62

63
  public OffsetDateTime getCreatedAt() {
64
    return createdAt;
×
65
  }
66

67
  public String getCompletionReason() {
68
    return completionReason;
1✔
69
  }
70

71
  public Map<String, Object> getConfidenceScore() {
NEW
72
    return confidenceScore;
×
73
  }
74

75
  public AiAgentInfo getAiAgentInfo() {
76
    return aiAgentInfo;
×
77
  }
78

79
  @Override
80
  public boolean equals(Object o) {
81
    if (this == o) {
×
82
      return true;
×
83
    }
84
    if (o == null || getClass() != o.getClass()) {
×
85
      return false;
×
86
    }
87
    AiExtractStructuredResponse casted = (AiExtractStructuredResponse) o;
×
88
    return Objects.equals(answer, casted.answer)
×
89
        && Objects.equals(createdAt, casted.createdAt)
×
90
        && Objects.equals(completionReason, casted.completionReason)
×
NEW
91
        && Objects.equals(confidenceScore, casted.confidenceScore)
×
UNCOV
92
        && Objects.equals(aiAgentInfo, casted.aiAgentInfo);
×
93
  }
94

95
  @Override
96
  public int hashCode() {
NEW
97
    return Objects.hash(answer, createdAt, completionReason, confidenceScore, aiAgentInfo);
×
98
  }
99

100
  @Override
101
  public String toString() {
102
    return "AiExtractStructuredResponse{"
×
103
        + "answer='"
104
        + answer
105
        + '\''
106
        + ", "
107
        + "createdAt='"
108
        + createdAt
109
        + '\''
110
        + ", "
111
        + "completionReason='"
112
        + completionReason
113
        + '\''
114
        + ", "
115
        + "confidenceScore='"
116
        + confidenceScore
117
        + '\''
118
        + ", "
119
        + "aiAgentInfo='"
120
        + aiAgentInfo
121
        + '\''
122
        + "}";
123
  }
124

125
  public static class Builder extends NullableFieldTracker {
126

127
    protected final Map<String, Object> answer;
128

129
    protected final OffsetDateTime createdAt;
130

131
    protected String completionReason;
132

133
    protected Map<String, Object> confidenceScore;
134

135
    protected AiAgentInfo aiAgentInfo;
136

137
    public Builder(Map<String, Object> answer, OffsetDateTime createdAt) {
138
      super();
×
139
      this.answer = answer;
×
140
      this.createdAt = createdAt;
×
141
    }
×
142

143
    public Builder completionReason(String completionReason) {
144
      this.completionReason = completionReason;
×
145
      return this;
×
146
    }
147

148
    public Builder confidenceScore(Map<String, Object> confidenceScore) {
NEW
149
      this.confidenceScore = confidenceScore;
×
NEW
150
      return this;
×
151
    }
152

153
    public Builder aiAgentInfo(AiAgentInfo aiAgentInfo) {
154
      this.aiAgentInfo = aiAgentInfo;
×
155
      return this;
×
156
    }
157

158
    public AiExtractStructuredResponse build() {
159
      return new AiExtractStructuredResponse(this);
×
160
    }
161
  }
162
}
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

© 2025 Coveralls, Inc