001package com.box.sdkgen.schemas.v2025r0.shieldlistcontentemailv2025r0;
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.List;
011import java.util.Objects;
012
013/** Representation of content of a Shield List that contains email addresses data. */
014@JsonFilter("nullablePropertyFilter")
015public class ShieldListContentEmailV2025R0 extends SerializableObject {
016
017  /** The type of content in the shield list. */
018  @JsonDeserialize(
019      using =
020          ShieldListContentEmailV2025R0TypeField.ShieldListContentEmailV2025R0TypeFieldDeserializer
021              .class)
022  @JsonSerialize(
023      using =
024          ShieldListContentEmailV2025R0TypeField.ShieldListContentEmailV2025R0TypeFieldSerializer
025              .class)
026  protected EnumWrapper<ShieldListContentEmailV2025R0TypeField> type;
027
028  /** List of emails. */
029  @JsonProperty("email_addresses")
030  protected final List<String> emailAddresses;
031
032  public ShieldListContentEmailV2025R0(
033      @JsonProperty("email_addresses") List<String> emailAddresses) {
034    super();
035    this.emailAddresses = emailAddresses;
036    this.type =
037        new EnumWrapper<ShieldListContentEmailV2025R0TypeField>(
038            ShieldListContentEmailV2025R0TypeField.EMAIL);
039  }
040
041  protected ShieldListContentEmailV2025R0(Builder builder) {
042    super();
043    this.type = builder.type;
044    this.emailAddresses = builder.emailAddresses;
045    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
046  }
047
048  public EnumWrapper<ShieldListContentEmailV2025R0TypeField> getType() {
049    return type;
050  }
051
052  public List<String> getEmailAddresses() {
053    return emailAddresses;
054  }
055
056  @Override
057  public boolean equals(Object o) {
058    if (this == o) {
059      return true;
060    }
061    if (o == null || getClass() != o.getClass()) {
062      return false;
063    }
064    ShieldListContentEmailV2025R0 casted = (ShieldListContentEmailV2025R0) o;
065    return Objects.equals(type, casted.type)
066        && Objects.equals(emailAddresses, casted.emailAddresses);
067  }
068
069  @Override
070  public int hashCode() {
071    return Objects.hash(type, emailAddresses);
072  }
073
074  @Override
075  public String toString() {
076    return "ShieldListContentEmailV2025R0{"
077        + "type='"
078        + type
079        + '\''
080        + ", "
081        + "emailAddresses='"
082        + emailAddresses
083        + '\''
084        + "}";
085  }
086
087  public static class Builder extends NullableFieldTracker {
088
089    protected EnumWrapper<ShieldListContentEmailV2025R0TypeField> type;
090
091    protected final List<String> emailAddresses;
092
093    public Builder(List<String> emailAddresses) {
094      super();
095      this.emailAddresses = emailAddresses;
096    }
097
098    public Builder type(ShieldListContentEmailV2025R0TypeField type) {
099      this.type = new EnumWrapper<ShieldListContentEmailV2025R0TypeField>(type);
100      return this;
101    }
102
103    public Builder type(EnumWrapper<ShieldListContentEmailV2025R0TypeField> type) {
104      this.type = type;
105      return this;
106    }
107
108    public ShieldListContentEmailV2025R0 build() {
109      if (this.type == null) {
110        this.type =
111            new EnumWrapper<ShieldListContentEmailV2025R0TypeField>(
112                ShieldListContentEmailV2025R0TypeField.EMAIL);
113      }
114      return new ShieldListContentEmailV2025R0(this);
115    }
116  }
117}