001package com.box.sdkgen.schemas.aiextractstructured;
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@JsonFilter("nullablePropertyFilter")
013public class AiExtractStructuredMetadataTemplateField extends SerializableObject {
014
015  /** The name of the metadata template. */
016  @JsonProperty("template_key")
017  protected String templateKey;
018
019  /** Value is always `metadata_template`. */
020  @JsonDeserialize(
021      using =
022          AiExtractStructuredMetadataTemplateTypeField
023              .AiExtractStructuredMetadataTemplateTypeFieldDeserializer.class)
024  @JsonSerialize(
025      using =
026          AiExtractStructuredMetadataTemplateTypeField
027              .AiExtractStructuredMetadataTemplateTypeFieldSerializer.class)
028  protected EnumWrapper<AiExtractStructuredMetadataTemplateTypeField> type;
029
030  /**
031   * The scope of the metadata template that can either be global or enterprise. * The **global**
032   * scope is used for templates that are available to any Box enterprise. * The **enterprise**
033   * scope represents templates created within a specific enterprise, containing the ID of that
034   * enterprise.
035   */
036  protected String scope;
037
038  public AiExtractStructuredMetadataTemplateField() {
039    super();
040  }
041
042  protected AiExtractStructuredMetadataTemplateField(Builder builder) {
043    super();
044    this.templateKey = builder.templateKey;
045    this.type = builder.type;
046    this.scope = builder.scope;
047    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
048  }
049
050  public String getTemplateKey() {
051    return templateKey;
052  }
053
054  public EnumWrapper<AiExtractStructuredMetadataTemplateTypeField> getType() {
055    return type;
056  }
057
058  public String getScope() {
059    return scope;
060  }
061
062  @Override
063  public boolean equals(Object o) {
064    if (this == o) {
065      return true;
066    }
067    if (o == null || getClass() != o.getClass()) {
068      return false;
069    }
070    AiExtractStructuredMetadataTemplateField casted = (AiExtractStructuredMetadataTemplateField) o;
071    return Objects.equals(templateKey, casted.templateKey)
072        && Objects.equals(type, casted.type)
073        && Objects.equals(scope, casted.scope);
074  }
075
076  @Override
077  public int hashCode() {
078    return Objects.hash(templateKey, type, scope);
079  }
080
081  @Override
082  public String toString() {
083    return "AiExtractStructuredMetadataTemplateField{"
084        + "templateKey='"
085        + templateKey
086        + '\''
087        + ", "
088        + "type='"
089        + type
090        + '\''
091        + ", "
092        + "scope='"
093        + scope
094        + '\''
095        + "}";
096  }
097
098  public static class Builder extends NullableFieldTracker {
099
100    protected String templateKey;
101
102    protected EnumWrapper<AiExtractStructuredMetadataTemplateTypeField> type;
103
104    protected String scope;
105
106    public Builder templateKey(String templateKey) {
107      this.templateKey = templateKey;
108      return this;
109    }
110
111    public Builder type(AiExtractStructuredMetadataTemplateTypeField type) {
112      this.type = new EnumWrapper<AiExtractStructuredMetadataTemplateTypeField>(type);
113      return this;
114    }
115
116    public Builder type(EnumWrapper<AiExtractStructuredMetadataTemplateTypeField> type) {
117      this.type = type;
118      return this;
119    }
120
121    public Builder scope(String scope) {
122      this.scope = scope;
123      return this;
124    }
125
126    public AiExtractStructuredMetadataTemplateField build() {
127      return new AiExtractStructuredMetadataTemplateField(this);
128    }
129  }
130}