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

box / box-java-sdk / #4027

11 Oct 2024 12:22PM UTC coverage: 71.745% (+0.04%) from 71.703%
#4027

push

github

web-flow
feat: Support AI extract and AI extract structured (#1266)

125 of 167 new or added lines in 8 files covered. (74.85%)

1 existing line in 1 file now uncovered.

8039 of 11205 relevant lines covered (71.74%)

0.72 hits per line

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

61.11
/src/main/java/com/box/sdk/BoxAIExtractMetadataTemplate.java
1
package com.box.sdk;
2

3
import com.box.sdk.internal.utils.JsonUtils;
4
import com.eclipsesource.json.JsonObject;
5

6
public class BoxAIExtractMetadataTemplate extends BoxJSONObject {
7
    /**
8
     * The type of object this class represents.
9
     */
10
    public static final String TYPE = "metadata_template";
11
    /**
12
     * The scope of the metadata template that can either be global or enterprise.
13
     */
14
    private String scope;
15
    /**
16
     * The template key of the metadata template.
17
     */
18
    private String templateKey;
19

20
    /**
21
     * Constructs a BoxAIExtractMetadataTemplate object with a given scope and template key.
22
     * @param templateKey the template key of the metadata template.
23
     * @param scope the scope of the metadata template.
24
     */
25
    public BoxAIExtractMetadataTemplate(String templateKey, String scope) {
1✔
26
        this.templateKey = templateKey;
1✔
27
        this.scope = scope;
1✔
28
    }
1✔
29

30
    @Override
31
    void parseJSONMember(JsonObject.Member member) {
NEW
32
        super.parseJSONMember(member);
×
NEW
33
        String memberName = member.getName();
×
NEW
34
        if (memberName.equals("scope")) {
×
NEW
35
            this.scope = member.getValue().asString();
×
NEW
36
        } else if (memberName.equals("template_key")) {
×
NEW
37
            this.templateKey = member.getValue().asString();
×
38
        }
NEW
39
    }
×
40

41
    public JsonObject getJSONObject() {
42
        JsonObject jsonObject = new JsonObject();
1✔
43
        JsonUtils.addIfNotNull(jsonObject, "type", TYPE);
1✔
44
        JsonUtils.addIfNotNull(jsonObject, "scope", this.scope);
1✔
45
        JsonUtils.addIfNotNull(jsonObject, "template_key", this.templateKey);
1✔
46
        return jsonObject;
1✔
47
    }
48

49
    public String getScope() {
50
        return this.scope;
1✔
51
    }
52

53
    public String getTemplateKey() {
54
        return this.templateKey;
1✔
55
    }
56
}
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