001package com.box.sdkgen.schemas.collaborationallowlistexempttarget;
002
003import com.box.sdkgen.internal.NullableFieldTracker;
004import com.box.sdkgen.internal.SerializableObject;
005import com.box.sdkgen.internal.utils.DateTimeUtils;
006import com.box.sdkgen.schemas.usermini.UserMini;
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.time.OffsetDateTime;
013import java.util.Objects;
014
015/**
016 * The user that is exempt from any of the restrictions imposed by the list of allowed collaboration
017 * domains for this enterprise.
018 */
019@JsonFilter("nullablePropertyFilter")
020public class CollaborationAllowlistExemptTarget extends SerializableObject {
021
022  /** The unique identifier for this exemption. */
023  protected String id;
024
025  /** The value will always be `collaboration_whitelist_exempt_target`. */
026  @JsonDeserialize(
027      using =
028          CollaborationAllowlistExemptTargetTypeField
029              .CollaborationAllowlistExemptTargetTypeFieldDeserializer.class)
030  @JsonSerialize(
031      using =
032          CollaborationAllowlistExemptTargetTypeField
033              .CollaborationAllowlistExemptTargetTypeFieldSerializer.class)
034  protected EnumWrapper<CollaborationAllowlistExemptTargetTypeField> type;
035
036  protected CollaborationAllowlistExemptTargetEnterpriseField enterprise;
037
038  protected UserMini user;
039
040  /** The time the entry was created. */
041  @JsonProperty("created_at")
042  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
043  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
044  protected OffsetDateTime createdAt;
045
046  /** The time the entry was modified. */
047  @JsonProperty("modified_at")
048  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
049  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
050  protected OffsetDateTime modifiedAt;
051
052  public CollaborationAllowlistExemptTarget() {
053    super();
054  }
055
056  protected CollaborationAllowlistExemptTarget(Builder builder) {
057    super();
058    this.id = builder.id;
059    this.type = builder.type;
060    this.enterprise = builder.enterprise;
061    this.user = builder.user;
062    this.createdAt = builder.createdAt;
063    this.modifiedAt = builder.modifiedAt;
064    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
065  }
066
067  public String getId() {
068    return id;
069  }
070
071  public EnumWrapper<CollaborationAllowlistExemptTargetTypeField> getType() {
072    return type;
073  }
074
075  public CollaborationAllowlistExemptTargetEnterpriseField getEnterprise() {
076    return enterprise;
077  }
078
079  public UserMini getUser() {
080    return user;
081  }
082
083  public OffsetDateTime getCreatedAt() {
084    return createdAt;
085  }
086
087  public OffsetDateTime getModifiedAt() {
088    return modifiedAt;
089  }
090
091  @Override
092  public boolean equals(Object o) {
093    if (this == o) {
094      return true;
095    }
096    if (o == null || getClass() != o.getClass()) {
097      return false;
098    }
099    CollaborationAllowlistExemptTarget casted = (CollaborationAllowlistExemptTarget) o;
100    return Objects.equals(id, casted.id)
101        && Objects.equals(type, casted.type)
102        && Objects.equals(enterprise, casted.enterprise)
103        && Objects.equals(user, casted.user)
104        && Objects.equals(createdAt, casted.createdAt)
105        && Objects.equals(modifiedAt, casted.modifiedAt);
106  }
107
108  @Override
109  public int hashCode() {
110    return Objects.hash(id, type, enterprise, user, createdAt, modifiedAt);
111  }
112
113  @Override
114  public String toString() {
115    return "CollaborationAllowlistExemptTarget{"
116        + "id='"
117        + id
118        + '\''
119        + ", "
120        + "type='"
121        + type
122        + '\''
123        + ", "
124        + "enterprise='"
125        + enterprise
126        + '\''
127        + ", "
128        + "user='"
129        + user
130        + '\''
131        + ", "
132        + "createdAt='"
133        + createdAt
134        + '\''
135        + ", "
136        + "modifiedAt='"
137        + modifiedAt
138        + '\''
139        + "}";
140  }
141
142  public static class Builder extends NullableFieldTracker {
143
144    protected String id;
145
146    protected EnumWrapper<CollaborationAllowlistExemptTargetTypeField> type;
147
148    protected CollaborationAllowlistExemptTargetEnterpriseField enterprise;
149
150    protected UserMini user;
151
152    protected OffsetDateTime createdAt;
153
154    protected OffsetDateTime modifiedAt;
155
156    public Builder id(String id) {
157      this.id = id;
158      return this;
159    }
160
161    public Builder type(CollaborationAllowlistExemptTargetTypeField type) {
162      this.type = new EnumWrapper<CollaborationAllowlistExemptTargetTypeField>(type);
163      return this;
164    }
165
166    public Builder type(EnumWrapper<CollaborationAllowlistExemptTargetTypeField> type) {
167      this.type = type;
168      return this;
169    }
170
171    public Builder enterprise(CollaborationAllowlistExemptTargetEnterpriseField enterprise) {
172      this.enterprise = enterprise;
173      return this;
174    }
175
176    public Builder user(UserMini user) {
177      this.user = user;
178      return this;
179    }
180
181    public Builder createdAt(OffsetDateTime createdAt) {
182      this.createdAt = createdAt;
183      return this;
184    }
185
186    public Builder modifiedAt(OffsetDateTime modifiedAt) {
187      this.modifiedAt = modifiedAt;
188      return this;
189    }
190
191    public CollaborationAllowlistExemptTarget build() {
192      return new CollaborationAllowlistExemptTarget(this);
193    }
194  }
195}