001package com.box.sdk; 002 003import com.eclipsesource.json.Json; 004import com.eclipsesource.json.JsonObject; 005 006/** 007 * AI response to a user request. 008 */ 009public class BoxAIExtractStructuredResponse extends BoxJSONObject { 010 private final JsonObject sourceJson; 011 012 /** 013 * Constructs a BoxAIResponse object. 014 */ 015 public BoxAIExtractStructuredResponse(String json) { 016 super(json); 017 this.sourceJson = Json.parse(json).asObject(); 018 } 019 020 /** 021 * Constructs an BoxAIResponse object using an already parsed JSON object. 022 * 023 * @param jsonObject the parsed JSON object. 024 */ 025 BoxAIExtractStructuredResponse(JsonObject jsonObject) { 026 super(jsonObject); 027 this.sourceJson = jsonObject; 028 } 029 030 /** 031 * Gets the source JSON of the AI response. 032 * 033 * @return the source JSON of the AI response. 034 */ 035 public JsonObject getSourceJson() { 036 return sourceJson; 037 } 038}