001package com.box.sdkgen.schemas.aistudioagentextract; 002 003import com.box.sdkgen.internal.Nullable; 004import com.box.sdkgen.internal.NullableFieldTracker; 005import com.box.sdkgen.internal.SerializableObject; 006import com.box.sdkgen.schemas.aistudioagentbasictexttool.AiStudioAgentBasicTextTool; 007import com.box.sdkgen.schemas.aistudioagentlongtexttool.AiStudioAgentLongTextTool; 008import com.box.sdkgen.serialization.json.EnumWrapper; 009import com.fasterxml.jackson.annotation.JsonFilter; 010import com.fasterxml.jackson.annotation.JsonProperty; 011import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 012import com.fasterxml.jackson.databind.annotation.JsonSerialize; 013import java.util.Objects; 014 015/** The AI agent to be used for metadata extraction. */ 016@JsonFilter("nullablePropertyFilter") 017public class AiStudioAgentExtract extends SerializableObject { 018 019 /** The type of AI agent to be used for metadata extraction. */ 020 @JsonDeserialize( 021 using = AiStudioAgentExtractTypeField.AiStudioAgentExtractTypeFieldDeserializer.class) 022 @JsonSerialize( 023 using = AiStudioAgentExtractTypeField.AiStudioAgentExtractTypeFieldSerializer.class) 024 protected EnumWrapper<AiStudioAgentExtractTypeField> type; 025 026 /** The state of the AI Agent capability. Possible values are: `enabled` and `disabled`. */ 027 @JsonProperty("access_state") 028 protected final String accessState; 029 030 /** The description of the AI agent. */ 031 protected final String description; 032 033 /** Custom instructions for the AI agent. */ 034 @JsonProperty("custom_instructions") 035 @Nullable 036 protected String customInstructions; 037 038 @JsonProperty("long_text") 039 protected AiStudioAgentLongTextTool longText; 040 041 @JsonProperty("basic_text") 042 protected AiStudioAgentBasicTextTool basicText; 043 044 @JsonProperty("basic_image") 045 protected AiStudioAgentBasicTextTool basicImage; 046 047 public AiStudioAgentExtract( 048 @JsonProperty("access_state") String accessState, 049 @JsonProperty("description") String description) { 050 super(); 051 this.accessState = accessState; 052 this.description = description; 053 this.type = 054 new EnumWrapper<AiStudioAgentExtractTypeField>( 055 AiStudioAgentExtractTypeField.AI_AGENT_EXTRACT); 056 } 057 058 protected AiStudioAgentExtract(Builder builder) { 059 super(); 060 this.type = builder.type; 061 this.accessState = builder.accessState; 062 this.description = builder.description; 063 this.customInstructions = builder.customInstructions; 064 this.longText = builder.longText; 065 this.basicText = builder.basicText; 066 this.basicImage = builder.basicImage; 067 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 068 } 069 070 public EnumWrapper<AiStudioAgentExtractTypeField> getType() { 071 return type; 072 } 073 074 public String getAccessState() { 075 return accessState; 076 } 077 078 public String getDescription() { 079 return description; 080 } 081 082 public String getCustomInstructions() { 083 return customInstructions; 084 } 085 086 public AiStudioAgentLongTextTool getLongText() { 087 return longText; 088 } 089 090 public AiStudioAgentBasicTextTool getBasicText() { 091 return basicText; 092 } 093 094 public AiStudioAgentBasicTextTool getBasicImage() { 095 return basicImage; 096 } 097 098 @Override 099 public boolean equals(Object o) { 100 if (this == o) { 101 return true; 102 } 103 if (o == null || getClass() != o.getClass()) { 104 return false; 105 } 106 AiStudioAgentExtract casted = (AiStudioAgentExtract) o; 107 return Objects.equals(type, casted.type) 108 && Objects.equals(accessState, casted.accessState) 109 && Objects.equals(description, casted.description) 110 && Objects.equals(customInstructions, casted.customInstructions) 111 && Objects.equals(longText, casted.longText) 112 && Objects.equals(basicText, casted.basicText) 113 && Objects.equals(basicImage, casted.basicImage); 114 } 115 116 @Override 117 public int hashCode() { 118 return Objects.hash( 119 type, accessState, description, customInstructions, longText, basicText, basicImage); 120 } 121 122 @Override 123 public String toString() { 124 return "AiStudioAgentExtract{" 125 + "type='" 126 + type 127 + '\'' 128 + ", " 129 + "accessState='" 130 + accessState 131 + '\'' 132 + ", " 133 + "description='" 134 + description 135 + '\'' 136 + ", " 137 + "customInstructions='" 138 + customInstructions 139 + '\'' 140 + ", " 141 + "longText='" 142 + longText 143 + '\'' 144 + ", " 145 + "basicText='" 146 + basicText 147 + '\'' 148 + ", " 149 + "basicImage='" 150 + basicImage 151 + '\'' 152 + "}"; 153 } 154 155 public static class Builder extends NullableFieldTracker { 156 157 protected EnumWrapper<AiStudioAgentExtractTypeField> type; 158 159 protected final String accessState; 160 161 protected final String description; 162 163 protected String customInstructions; 164 165 protected AiStudioAgentLongTextTool longText; 166 167 protected AiStudioAgentBasicTextTool basicText; 168 169 protected AiStudioAgentBasicTextTool basicImage; 170 171 public Builder(String accessState, String description) { 172 super(); 173 this.accessState = accessState; 174 this.description = description; 175 } 176 177 public Builder type(AiStudioAgentExtractTypeField type) { 178 this.type = new EnumWrapper<AiStudioAgentExtractTypeField>(type); 179 return this; 180 } 181 182 public Builder type(EnumWrapper<AiStudioAgentExtractTypeField> type) { 183 this.type = type; 184 return this; 185 } 186 187 public Builder customInstructions(String customInstructions) { 188 this.customInstructions = customInstructions; 189 this.markNullableFieldAsSet("custom_instructions"); 190 return this; 191 } 192 193 public Builder longText(AiStudioAgentLongTextTool longText) { 194 this.longText = longText; 195 return this; 196 } 197 198 public Builder basicText(AiStudioAgentBasicTextTool basicText) { 199 this.basicText = basicText; 200 return this; 201 } 202 203 public Builder basicImage(AiStudioAgentBasicTextTool basicImage) { 204 this.basicImage = basicImage; 205 return this; 206 } 207 208 public AiStudioAgentExtract build() { 209 if (this.type == null) { 210 this.type = 211 new EnumWrapper<AiStudioAgentExtractTypeField>( 212 AiStudioAgentExtractTypeField.AI_AGENT_EXTRACT); 213 } 214 return new AiStudioAgentExtract(this); 215 } 216 } 217}