001package com.box.sdkgen.schemas.aiagentreference; 002 003import com.box.sdkgen.internal.NullableFieldTracker; 004import com.box.sdkgen.internal.SerializableObject; 005import com.box.sdkgen.serialization.json.EnumWrapper; 006import com.fasterxml.jackson.annotation.JsonFilter; 007import com.fasterxml.jackson.annotation.JsonProperty; 008import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 009import com.fasterxml.jackson.databind.annotation.JsonSerialize; 010import java.util.Objects; 011 012/** The AI agent used to handle queries. */ 013@JsonFilter("nullablePropertyFilter") 014public class AiAgentReference extends SerializableObject { 015 016 /** The type of AI agent used to handle queries. */ 017 @JsonDeserialize(using = AiAgentReferenceTypeField.AiAgentReferenceTypeFieldDeserializer.class) 018 @JsonSerialize(using = AiAgentReferenceTypeField.AiAgentReferenceTypeFieldSerializer.class) 019 protected EnumWrapper<AiAgentReferenceTypeField> type; 020 021 /** 022 * The ID of an Agent. This can be a numeric ID for custom agents (for example, `14031`) or a 023 * unique identifier for pre-built agents (for example, `enhanced_extract_agent` for the [Enhanced 024 * Extract 025 * Agent](https://developer.box.com/guides/box-ai/ai-tutorials/extract-metadata-structured#enhanced-extract-agent)). 026 */ 027 protected final String id; 028 029 public AiAgentReference(@JsonProperty("id") String id) { 030 super(); 031 this.id = id; 032 this.type = new EnumWrapper<AiAgentReferenceTypeField>(AiAgentReferenceTypeField.AI_AGENT_ID); 033 } 034 035 protected AiAgentReference(Builder builder) { 036 super(); 037 this.type = builder.type; 038 this.id = builder.id; 039 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 040 } 041 042 public EnumWrapper<AiAgentReferenceTypeField> getType() { 043 return type; 044 } 045 046 public String getId() { 047 return id; 048 } 049 050 @Override 051 public boolean equals(Object o) { 052 if (this == o) { 053 return true; 054 } 055 if (o == null || getClass() != o.getClass()) { 056 return false; 057 } 058 AiAgentReference casted = (AiAgentReference) o; 059 return Objects.equals(type, casted.type) && Objects.equals(id, casted.id); 060 } 061 062 @Override 063 public int hashCode() { 064 return Objects.hash(type, id); 065 } 066 067 @Override 068 public String toString() { 069 return "AiAgentReference{" + "type='" + type + '\'' + ", " + "id='" + id + '\'' + "}"; 070 } 071 072 public static class Builder extends NullableFieldTracker { 073 074 protected EnumWrapper<AiAgentReferenceTypeField> type; 075 076 protected final String id; 077 078 public Builder(String id) { 079 super(); 080 this.id = id; 081 } 082 083 public Builder type(AiAgentReferenceTypeField type) { 084 this.type = new EnumWrapper<AiAgentReferenceTypeField>(type); 085 return this; 086 } 087 088 public Builder type(EnumWrapper<AiAgentReferenceTypeField> type) { 089 this.type = type; 090 return this; 091 } 092 093 public AiAgentReference build() { 094 if (this.type == null) { 095 this.type = 096 new EnumWrapper<AiAgentReferenceTypeField>(AiAgentReferenceTypeField.AI_AGENT_ID); 097 } 098 return new AiAgentReference(this); 099 } 100 } 101}