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

box / box-java-sdk / #5792

03 Dec 2025 11:45AM UTC coverage: 35.894% (-0.04%) from 35.938%
#5792

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%)

23 existing lines in 5 files now uncovered.

18462 of 51435 relevant lines covered (35.89%)

0.36 hits per line

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

52.27
/src/main/java/com/box/sdkgen/schemas/aiextractstructured/AiExtractStructured.java
1
package com.box.sdkgen.schemas.aiextractstructured;
2

3
import com.box.sdkgen.internal.NullableFieldTracker;
4
import com.box.sdkgen.internal.SerializableObject;
5
import com.box.sdkgen.schemas.aiagentextractstructured.AiAgentExtractStructured;
6
import com.box.sdkgen.schemas.aiagentreference.AiAgentReference;
7
import com.box.sdkgen.schemas.aiextractstructuredagent.AiExtractStructuredAgent;
8
import com.box.sdkgen.schemas.aiitembase.AiItemBase;
9
import com.fasterxml.jackson.annotation.JsonFilter;
10
import com.fasterxml.jackson.annotation.JsonProperty;
11
import java.util.List;
12
import java.util.Objects;
13

14
/** AI Extract Structured Request object. */
15
@JsonFilter("nullablePropertyFilter")
16
public class AiExtractStructured extends SerializableObject {
17

18
  /** The items to be processed by the LLM. Currently you can use files only. */
19
  protected final List<AiItemBase> items;
20

21
  /**
22
   * The metadata template containing the fields to extract. For your request to work, you must
23
   * provide either `metadata_template` or `fields`, but not both.
24
   */
25
  @JsonProperty("metadata_template")
26
  protected AiExtractStructuredMetadataTemplateField metadataTemplate;
27

28
  /**
29
   * The fields to be extracted from the provided items. For your request to work, you must provide
30
   * either `metadata_template` or `fields`, but not both.
31
   */
32
  protected List<AiExtractStructuredFieldsField> fields;
33

34
  /** A flag to indicate whether confidence scores for every extracted field should be returned. */
35
  @JsonProperty("include_confidence_score")
36
  protected Boolean includeConfidenceScore;
37

38
  @JsonProperty("ai_agent")
39
  protected AiExtractStructuredAgent aiAgent;
40

41
  public AiExtractStructured(@JsonProperty("items") List<AiItemBase> items) {
42
    super();
×
43
    this.items = items;
×
44
  }
×
45

46
  protected AiExtractStructured(Builder builder) {
47
    super();
1✔
48
    this.items = builder.items;
1✔
49
    this.metadataTemplate = builder.metadataTemplate;
1✔
50
    this.fields = builder.fields;
1✔
51
    this.includeConfidenceScore = builder.includeConfidenceScore;
1✔
52
    this.aiAgent = builder.aiAgent;
1✔
53
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
1✔
54
  }
1✔
55

56
  public List<AiItemBase> getItems() {
57
    return items;
1✔
58
  }
59

60
  public AiExtractStructuredMetadataTemplateField getMetadataTemplate() {
61
    return metadataTemplate;
1✔
62
  }
63

64
  public List<AiExtractStructuredFieldsField> getFields() {
65
    return fields;
1✔
66
  }
67

68
  public Boolean getIncludeConfidenceScore() {
69
    return includeConfidenceScore;
1✔
70
  }
71

72
  public AiExtractStructuredAgent getAiAgent() {
73
    return aiAgent;
1✔
74
  }
75

76
  @Override
77
  public boolean equals(Object o) {
78
    if (this == o) {
×
79
      return true;
×
80
    }
81
    if (o == null || getClass() != o.getClass()) {
×
82
      return false;
×
83
    }
84
    AiExtractStructured casted = (AiExtractStructured) o;
×
85
    return Objects.equals(items, casted.items)
×
86
        && Objects.equals(metadataTemplate, casted.metadataTemplate)
×
87
        && Objects.equals(fields, casted.fields)
×
NEW
88
        && Objects.equals(includeConfidenceScore, casted.includeConfidenceScore)
×
UNCOV
89
        && Objects.equals(aiAgent, casted.aiAgent);
×
90
  }
91

92
  @Override
93
  public int hashCode() {
NEW
94
    return Objects.hash(items, metadataTemplate, fields, includeConfidenceScore, aiAgent);
×
95
  }
96

97
  @Override
98
  public String toString() {
99
    return "AiExtractStructured{"
×
100
        + "items='"
101
        + items
102
        + '\''
103
        + ", "
104
        + "metadataTemplate='"
105
        + metadataTemplate
106
        + '\''
107
        + ", "
108
        + "fields='"
109
        + fields
110
        + '\''
111
        + ", "
112
        + "includeConfidenceScore='"
113
        + includeConfidenceScore
114
        + '\''
115
        + ", "
116
        + "aiAgent='"
117
        + aiAgent
118
        + '\''
119
        + "}";
120
  }
121

122
  public static class Builder extends NullableFieldTracker {
123

124
    protected final List<AiItemBase> items;
125

126
    protected AiExtractStructuredMetadataTemplateField metadataTemplate;
127

128
    protected List<AiExtractStructuredFieldsField> fields;
129

130
    protected Boolean includeConfidenceScore;
131

132
    protected AiExtractStructuredAgent aiAgent;
133

134
    public Builder(List<AiItemBase> items) {
135
      super();
1✔
136
      this.items = items;
1✔
137
    }
1✔
138

139
    public Builder metadataTemplate(AiExtractStructuredMetadataTemplateField metadataTemplate) {
140
      this.metadataTemplate = metadataTemplate;
1✔
141
      return this;
1✔
142
    }
143

144
    public Builder fields(List<AiExtractStructuredFieldsField> fields) {
145
      this.fields = fields;
1✔
146
      return this;
1✔
147
    }
148

149
    public Builder includeConfidenceScore(Boolean includeConfidenceScore) {
NEW
150
      this.includeConfidenceScore = includeConfidenceScore;
×
NEW
151
      return this;
×
152
    }
153

154
    public Builder aiAgent(AiAgentReference aiAgent) {
155
      this.aiAgent = new AiExtractStructuredAgent(aiAgent);
×
156
      return this;
×
157
    }
158

159
    public Builder aiAgent(AiAgentExtractStructured aiAgent) {
160
      this.aiAgent = new AiExtractStructuredAgent(aiAgent);
1✔
161
      return this;
1✔
162
    }
163

164
    public Builder aiAgent(AiExtractStructuredAgent aiAgent) {
165
      this.aiAgent = aiAgent;
×
166
      return this;
×
167
    }
168

169
    public AiExtractStructured build() {
170
      return new AiExtractStructured(this);
1✔
171
    }
172
  }
173
}
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