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

box / box-java-sdk / #3996

06 Sep 2024 01:11PM UTC coverage: 71.703% (-0.7%) from 72.441%
#3996

push

github

web-flow
feat: Support AI Agent (#1265)

248 of 452 new or added lines in 14 files covered. (54.87%)

3 existing lines in 3 files now uncovered.

7921 of 11047 relevant lines covered (71.7%)

0.72 hits per line

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

70.59
/src/main/java/com/box/sdk/BoxAIAgentTextGen.java
1
package com.box.sdk;
2

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

6
/**
7
 * Represents an AI Agent used for generating text.
8
 */
9
@BoxResourceType("ai_agent_text_gen")
10
public class BoxAIAgentTextGen extends BoxAIAgent {
11

12
    /**
13
     * The type of the AI Agent for generating text.
14
     */
15
    public static final String TYPE = "ai_agent_text_gen";
16

17
    /**
18
     * The basic generator used for the AI Agent for generating text.
19
     */
20
    private BoxAIAgentTextGenBasicGen basicGen;
21

22
    /**
23
     * Constructs an AI agent with default settings.
24
     * @param basicGen The basic generator used for the AI Agent for generating text.
25
     */
26
    public BoxAIAgentTextGen(BoxAIAgentTextGenBasicGen basicGen) {
NEW
27
        super(TYPE);
×
NEW
28
        this.basicGen = basicGen;
×
NEW
29
    }
×
30

31
    /**
32
     * Constructs an AI agent with default settings.
33
     * @param jsonObject JSON object representing the AI agent.
34
     */
35
    public BoxAIAgentTextGen(JsonObject jsonObject) {
36
        super(jsonObject);
1✔
37
    }
1✔
38

39
    /**
40
     * Gets the basic generator used for the AI Agent for generating text.
41
     * @return The basic generator used for the AI Agent for generating text.
42
     */
43
    public BoxAIAgentTextGenBasicGen getBasicGen() {
44
        return basicGen;
1✔
45
    }
46

47
    /**
48
     * Sets the basic generator used for the AI Agent for generating text.
49
     * @param basicGen The basic generator used for the AI Agent for generating text.
50
     */
51
    public void setBasicGen(BoxAIAgentTextGenBasicGen basicGen) {
NEW
52
        this.basicGen = basicGen;
×
NEW
53
    }
×
54

55
    @Override
56
    void parseJSONMember(JsonObject.Member member) {
57
        super.parseJSONMember(member);
1✔
58
        String memberName = member.getName();
1✔
59
        if (memberName.equals("basic_gen")) {
1✔
60
            this.basicGen = new BoxAIAgentTextGenBasicGen(member.getValue().asObject());
1✔
61
        }
62
    }
1✔
63

64
    public JsonObject getJSONObject() {
65
        JsonObject jsonObject = new JsonObject();
1✔
66
        JsonUtils.addIfNotNull(jsonObject, "type", this.getType());
1✔
67
        JsonUtils.addIfNotNull(jsonObject, "basic_gen", this.basicGen.getJSONObject());
1✔
68
        return jsonObject;
1✔
69
    }
70
}
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