001package com.box.sdkgen.schemas.aistudioagenttextgenresponse; 002 003import com.box.sdkgen.internal.Nullable; 004import com.box.sdkgen.internal.NullableFieldTracker; 005import com.box.sdkgen.internal.SerializableObject; 006import com.box.sdkgen.schemas.aistudioagentbasicgentoolresponse.AiStudioAgentBasicGenToolResponse; 007import com.box.sdkgen.serialization.json.EnumWrapper; 008import com.fasterxml.jackson.annotation.JsonFilter; 009import com.fasterxml.jackson.annotation.JsonProperty; 010import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 011import com.fasterxml.jackson.databind.annotation.JsonSerialize; 012import java.util.List; 013import java.util.Objects; 014 015/** The AI agent to be used to generate text. */ 016@JsonFilter("nullablePropertyFilter") 017public class AiStudioAgentTextGenResponse extends SerializableObject { 018 019 /** The type of AI agent used for generating text. */ 020 @JsonDeserialize( 021 using = 022 AiStudioAgentTextGenResponseTypeField.AiStudioAgentTextGenResponseTypeFieldDeserializer 023 .class) 024 @JsonSerialize( 025 using = 026 AiStudioAgentTextGenResponseTypeField.AiStudioAgentTextGenResponseTypeFieldSerializer 027 .class) 028 protected EnumWrapper<AiStudioAgentTextGenResponseTypeField> 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 /** 043 * Suggested questions for the AI agent. If null, suggested question will be generated. If empty, 044 * no suggested questions will be displayed. 045 */ 046 @JsonProperty("suggested_questions") 047 protected List<String> suggestedQuestions; 048 049 @JsonProperty("basic_gen") 050 protected AiStudioAgentBasicGenToolResponse basicGen; 051 052 public AiStudioAgentTextGenResponse( 053 @JsonProperty("access_state") String accessState, 054 @JsonProperty("description") String description) { 055 super(); 056 this.accessState = accessState; 057 this.description = description; 058 this.type = 059 new EnumWrapper<AiStudioAgentTextGenResponseTypeField>( 060 AiStudioAgentTextGenResponseTypeField.AI_AGENT_TEXT_GEN); 061 } 062 063 protected AiStudioAgentTextGenResponse(Builder builder) { 064 super(); 065 this.type = builder.type; 066 this.accessState = builder.accessState; 067 this.description = builder.description; 068 this.customInstructions = builder.customInstructions; 069 this.suggestedQuestions = builder.suggestedQuestions; 070 this.basicGen = builder.basicGen; 071 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 072 } 073 074 public EnumWrapper<AiStudioAgentTextGenResponseTypeField> 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 List<String> getSuggestedQuestions() { 091 return suggestedQuestions; 092 } 093 094 public AiStudioAgentBasicGenToolResponse getBasicGen() { 095 return basicGen; 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 AiStudioAgentTextGenResponse casted = (AiStudioAgentTextGenResponse) 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(suggestedQuestions, casted.suggestedQuestions) 112 && Objects.equals(basicGen, casted.basicGen); 113 } 114 115 @Override 116 public int hashCode() { 117 return Objects.hash( 118 type, accessState, description, customInstructions, suggestedQuestions, basicGen); 119 } 120 121 @Override 122 public String toString() { 123 return "AiStudioAgentTextGenResponse{" 124 + "type='" 125 + type 126 + '\'' 127 + ", " 128 + "accessState='" 129 + accessState 130 + '\'' 131 + ", " 132 + "description='" 133 + description 134 + '\'' 135 + ", " 136 + "customInstructions='" 137 + customInstructions 138 + '\'' 139 + ", " 140 + "suggestedQuestions='" 141 + suggestedQuestions 142 + '\'' 143 + ", " 144 + "basicGen='" 145 + basicGen 146 + '\'' 147 + "}"; 148 } 149 150 public static class Builder extends NullableFieldTracker { 151 152 protected EnumWrapper<AiStudioAgentTextGenResponseTypeField> type; 153 154 protected final String accessState; 155 156 protected final String description; 157 158 protected String customInstructions; 159 160 protected List<String> suggestedQuestions; 161 162 protected AiStudioAgentBasicGenToolResponse basicGen; 163 164 public Builder(String accessState, String description) { 165 super(); 166 this.accessState = accessState; 167 this.description = description; 168 } 169 170 public Builder type(AiStudioAgentTextGenResponseTypeField type) { 171 this.type = new EnumWrapper<AiStudioAgentTextGenResponseTypeField>(type); 172 return this; 173 } 174 175 public Builder type(EnumWrapper<AiStudioAgentTextGenResponseTypeField> type) { 176 this.type = type; 177 return this; 178 } 179 180 public Builder customInstructions(String customInstructions) { 181 this.customInstructions = customInstructions; 182 this.markNullableFieldAsSet("custom_instructions"); 183 return this; 184 } 185 186 public Builder suggestedQuestions(List<String> suggestedQuestions) { 187 this.suggestedQuestions = suggestedQuestions; 188 return this; 189 } 190 191 public Builder basicGen(AiStudioAgentBasicGenToolResponse basicGen) { 192 this.basicGen = basicGen; 193 return this; 194 } 195 196 public AiStudioAgentTextGenResponse build() { 197 if (this.type == null) { 198 this.type = 199 new EnumWrapper<AiStudioAgentTextGenResponseTypeField>( 200 AiStudioAgentTextGenResponseTypeField.AI_AGENT_TEXT_GEN); 201 } 202 return new AiStudioAgentTextGenResponse(this); 203 } 204 } 205}