001package com.box.sdkgen.schemas.v2025r0.enterprisefeaturesettingv2025r0;
002
003import com.box.sdkgen.internal.Nullable;
004import com.box.sdkgen.internal.NullableFieldTracker;
005import com.box.sdkgen.internal.SerializableObject;
006import com.box.sdkgen.schemas.v2025r0.userorgroupreferencev2025r0.UserOrGroupReferenceV2025R0;
007import com.fasterxml.jackson.annotation.JsonFilter;
008import com.fasterxml.jackson.annotation.JsonProperty;
009import java.util.List;
010import java.util.Objects;
011
012/** An enterprise feature setting. */
013@JsonFilter("nullablePropertyFilter")
014public class EnterpriseFeatureSettingV2025R0 extends SerializableObject {
015
016  /** The identifier of the enterprise feature setting. */
017  @Nullable protected String id;
018
019  /** The feature. */
020  protected EnterpriseFeatureSettingV2025R0FeatureField feature;
021
022  /** The state of the feature. */
023  @Nullable protected String state;
024
025  /** Whether the feature can be configured. */
026  @JsonProperty("can_configure")
027  @Nullable
028  protected Boolean canConfigure;
029
030  /** Whether the feature is configured. */
031  @JsonProperty("is_configured")
032  @Nullable
033  protected Boolean isConfigured;
034
035  /** Enterprise feature setting is enabled for only this set of users and groups. */
036  @Nullable protected List<UserOrGroupReferenceV2025R0> allowlist;
037
038  /** Enterprise feature setting is enabled for everyone except this set of users and groups. */
039  @Nullable protected List<UserOrGroupReferenceV2025R0> denylist;
040
041  public EnterpriseFeatureSettingV2025R0() {
042    super();
043  }
044
045  protected EnterpriseFeatureSettingV2025R0(Builder builder) {
046    super();
047    this.id = builder.id;
048    this.feature = builder.feature;
049    this.state = builder.state;
050    this.canConfigure = builder.canConfigure;
051    this.isConfigured = builder.isConfigured;
052    this.allowlist = builder.allowlist;
053    this.denylist = builder.denylist;
054    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
055  }
056
057  public String getId() {
058    return id;
059  }
060
061  public EnterpriseFeatureSettingV2025R0FeatureField getFeature() {
062    return feature;
063  }
064
065  public String getState() {
066    return state;
067  }
068
069  public Boolean getCanConfigure() {
070    return canConfigure;
071  }
072
073  public Boolean getIsConfigured() {
074    return isConfigured;
075  }
076
077  public List<UserOrGroupReferenceV2025R0> getAllowlist() {
078    return allowlist;
079  }
080
081  public List<UserOrGroupReferenceV2025R0> getDenylist() {
082    return denylist;
083  }
084
085  @Override
086  public boolean equals(Object o) {
087    if (this == o) {
088      return true;
089    }
090    if (o == null || getClass() != o.getClass()) {
091      return false;
092    }
093    EnterpriseFeatureSettingV2025R0 casted = (EnterpriseFeatureSettingV2025R0) o;
094    return Objects.equals(id, casted.id)
095        && Objects.equals(feature, casted.feature)
096        && Objects.equals(state, casted.state)
097        && Objects.equals(canConfigure, casted.canConfigure)
098        && Objects.equals(isConfigured, casted.isConfigured)
099        && Objects.equals(allowlist, casted.allowlist)
100        && Objects.equals(denylist, casted.denylist);
101  }
102
103  @Override
104  public int hashCode() {
105    return Objects.hash(id, feature, state, canConfigure, isConfigured, allowlist, denylist);
106  }
107
108  @Override
109  public String toString() {
110    return "EnterpriseFeatureSettingV2025R0{"
111        + "id='"
112        + id
113        + '\''
114        + ", "
115        + "feature='"
116        + feature
117        + '\''
118        + ", "
119        + "state='"
120        + state
121        + '\''
122        + ", "
123        + "canConfigure='"
124        + canConfigure
125        + '\''
126        + ", "
127        + "isConfigured='"
128        + isConfigured
129        + '\''
130        + ", "
131        + "allowlist='"
132        + allowlist
133        + '\''
134        + ", "
135        + "denylist='"
136        + denylist
137        + '\''
138        + "}";
139  }
140
141  public static class Builder extends NullableFieldTracker {
142
143    protected String id;
144
145    protected EnterpriseFeatureSettingV2025R0FeatureField feature;
146
147    protected String state;
148
149    protected Boolean canConfigure;
150
151    protected Boolean isConfigured;
152
153    protected List<UserOrGroupReferenceV2025R0> allowlist;
154
155    protected List<UserOrGroupReferenceV2025R0> denylist;
156
157    public Builder id(String id) {
158      this.id = id;
159      this.markNullableFieldAsSet("id");
160      return this;
161    }
162
163    public Builder feature(EnterpriseFeatureSettingV2025R0FeatureField feature) {
164      this.feature = feature;
165      return this;
166    }
167
168    public Builder state(String state) {
169      this.state = state;
170      this.markNullableFieldAsSet("state");
171      return this;
172    }
173
174    public Builder canConfigure(Boolean canConfigure) {
175      this.canConfigure = canConfigure;
176      this.markNullableFieldAsSet("can_configure");
177      return this;
178    }
179
180    public Builder isConfigured(Boolean isConfigured) {
181      this.isConfigured = isConfigured;
182      this.markNullableFieldAsSet("is_configured");
183      return this;
184    }
185
186    public Builder allowlist(List<UserOrGroupReferenceV2025R0> allowlist) {
187      this.allowlist = allowlist;
188      this.markNullableFieldAsSet("allowlist");
189      return this;
190    }
191
192    public Builder denylist(List<UserOrGroupReferenceV2025R0> denylist) {
193      this.denylist = denylist;
194      this.markNullableFieldAsSet("denylist");
195      return this;
196    }
197
198    public EnterpriseFeatureSettingV2025R0 build() {
199      return new EnterpriseFeatureSettingV2025R0(this);
200    }
201  }
202}