001package com.box.sdkgen.schemas.aiextractstructured; 002 003import com.box.sdkgen.internal.NullableFieldTracker; 004import com.box.sdkgen.internal.SerializableObject; 005import com.fasterxml.jackson.annotation.JsonFilter; 006import com.fasterxml.jackson.annotation.JsonProperty; 007import java.util.List; 008import java.util.Objects; 009 010@JsonFilter("nullablePropertyFilter") 011public class AiExtractStructuredFieldsField extends SerializableObject { 012 013 /** A unique identifier for the field. */ 014 protected final String key; 015 016 /** A description of the field. */ 017 protected String description; 018 019 /** The display name of the field. */ 020 protected String displayName; 021 022 /** The context about the key that may include how to find and format it. */ 023 protected String prompt; 024 025 /** 026 * The type of the field. It can include but is not limited to `string`, `float`, `date`, `enum`, 027 * and `multiSelect`. 028 */ 029 protected String type; 030 031 /** 032 * A list of options for this field. This is most often used in combination with the `enum` and 033 * `multiSelect` field types. 034 */ 035 protected List<AiExtractStructuredFieldsOptionsField> options; 036 037 public AiExtractStructuredFieldsField(@JsonProperty("key") String key) { 038 super(); 039 this.key = key; 040 } 041 042 protected AiExtractStructuredFieldsField(Builder builder) { 043 super(); 044 this.key = builder.key; 045 this.description = builder.description; 046 this.displayName = builder.displayName; 047 this.prompt = builder.prompt; 048 this.type = builder.type; 049 this.options = builder.options; 050 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 051 } 052 053 public String getKey() { 054 return key; 055 } 056 057 public String getDescription() { 058 return description; 059 } 060 061 public String getDisplayName() { 062 return displayName; 063 } 064 065 public String getPrompt() { 066 return prompt; 067 } 068 069 public String getType() { 070 return type; 071 } 072 073 public List<AiExtractStructuredFieldsOptionsField> getOptions() { 074 return options; 075 } 076 077 @Override 078 public boolean equals(Object o) { 079 if (this == o) { 080 return true; 081 } 082 if (o == null || getClass() != o.getClass()) { 083 return false; 084 } 085 AiExtractStructuredFieldsField casted = (AiExtractStructuredFieldsField) o; 086 return Objects.equals(key, casted.key) 087 && Objects.equals(description, casted.description) 088 && Objects.equals(displayName, casted.displayName) 089 && Objects.equals(prompt, casted.prompt) 090 && Objects.equals(type, casted.type) 091 && Objects.equals(options, casted.options); 092 } 093 094 @Override 095 public int hashCode() { 096 return Objects.hash(key, description, displayName, prompt, type, options); 097 } 098 099 @Override 100 public String toString() { 101 return "AiExtractStructuredFieldsField{" 102 + "key='" 103 + key 104 + '\'' 105 + ", " 106 + "description='" 107 + description 108 + '\'' 109 + ", " 110 + "displayName='" 111 + displayName 112 + '\'' 113 + ", " 114 + "prompt='" 115 + prompt 116 + '\'' 117 + ", " 118 + "type='" 119 + type 120 + '\'' 121 + ", " 122 + "options='" 123 + options 124 + '\'' 125 + "}"; 126 } 127 128 public static class Builder extends NullableFieldTracker { 129 130 protected final String key; 131 132 protected String description; 133 134 protected String displayName; 135 136 protected String prompt; 137 138 protected String type; 139 140 protected List<AiExtractStructuredFieldsOptionsField> options; 141 142 public Builder(String key) { 143 super(); 144 this.key = key; 145 } 146 147 public Builder description(String description) { 148 this.description = description; 149 return this; 150 } 151 152 public Builder displayName(String displayName) { 153 this.displayName = displayName; 154 return this; 155 } 156 157 public Builder prompt(String prompt) { 158 this.prompt = prompt; 159 return this; 160 } 161 162 public Builder type(String type) { 163 this.type = type; 164 return this; 165 } 166 167 public Builder options(List<AiExtractStructuredFieldsOptionsField> options) { 168 this.options = options; 169 return this; 170 } 171 172 public AiExtractStructuredFieldsField build() { 173 return new AiExtractStructuredFieldsField(this); 174 } 175 } 176}