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