001package com.box.sdkgen.managers.groups;
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 UpdateGroupByIdRequestBody extends SerializableObject {
014
015  /** The name of the new group to be created. Must be unique within the enterprise. */
016  protected String name;
017
018  /**
019   * Keeps track of which external source this group is coming, for example `Active Directory`, or
020   * `Okta`.
021   *
022   * <p>Setting this will also prevent Box admins from editing the group name and its members
023   * directly via the Box web application.
024   *
025   * <p>This is desirable for one-way syncing of groups.
026   */
027  protected String provenance;
028
029  /**
030   * An arbitrary identifier that can be used by external group sync tools to link this Box Group to
031   * an external group.
032   *
033   * <p>Example values of this field could be an **Active Directory Object ID** or a **Google Group
034   * ID**.
035   *
036   * <p>We recommend you use of this field in order to avoid issues when group names are updated in
037   * either Box or external systems.
038   */
039  @JsonProperty("external_sync_identifier")
040  protected String externalSyncIdentifier;
041
042  /** A human readable description of the group. */
043  protected String description;
044
045  /**
046   * Specifies who can invite the group to collaborate on folders.
047   *
048   * <p>When set to `admins_only` the enterprise admin, co-admins, and the group's admin can invite
049   * the group.
050   *
051   * <p>When set to `admins_and_members` all the admins listed above and group members can invite
052   * the group.
053   *
054   * <p>When set to `all_managed_users` all managed users in the enterprise can invite the group.
055   */
056  @JsonDeserialize(
057      using =
058          UpdateGroupByIdRequestBodyInvitabilityLevelField
059              .UpdateGroupByIdRequestBodyInvitabilityLevelFieldDeserializer.class)
060  @JsonSerialize(
061      using =
062          UpdateGroupByIdRequestBodyInvitabilityLevelField
063              .UpdateGroupByIdRequestBodyInvitabilityLevelFieldSerializer.class)
064  @JsonProperty("invitability_level")
065  protected EnumWrapper<UpdateGroupByIdRequestBodyInvitabilityLevelField> invitabilityLevel;
066
067  /**
068   * Specifies who can see the members of the group.
069   *
070   * <p>* `admins_only` - the enterprise admin, co-admins, group's group admin. *
071   * `admins_and_members` - all admins and group members. * `all_managed_users` - all managed users
072   * in the enterprise.
073   */
074  @JsonDeserialize(
075      using =
076          UpdateGroupByIdRequestBodyMemberViewabilityLevelField
077              .UpdateGroupByIdRequestBodyMemberViewabilityLevelFieldDeserializer.class)
078  @JsonSerialize(
079      using =
080          UpdateGroupByIdRequestBodyMemberViewabilityLevelField
081              .UpdateGroupByIdRequestBodyMemberViewabilityLevelFieldSerializer.class)
082  @JsonProperty("member_viewability_level")
083  protected EnumWrapper<UpdateGroupByIdRequestBodyMemberViewabilityLevelField>
084      memberViewabilityLevel;
085
086  public UpdateGroupByIdRequestBody() {
087    super();
088  }
089
090  protected UpdateGroupByIdRequestBody(Builder builder) {
091    super();
092    this.name = builder.name;
093    this.provenance = builder.provenance;
094    this.externalSyncIdentifier = builder.externalSyncIdentifier;
095    this.description = builder.description;
096    this.invitabilityLevel = builder.invitabilityLevel;
097    this.memberViewabilityLevel = builder.memberViewabilityLevel;
098    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
099  }
100
101  public String getName() {
102    return name;
103  }
104
105  public String getProvenance() {
106    return provenance;
107  }
108
109  public String getExternalSyncIdentifier() {
110    return externalSyncIdentifier;
111  }
112
113  public String getDescription() {
114    return description;
115  }
116
117  public EnumWrapper<UpdateGroupByIdRequestBodyInvitabilityLevelField> getInvitabilityLevel() {
118    return invitabilityLevel;
119  }
120
121  public EnumWrapper<UpdateGroupByIdRequestBodyMemberViewabilityLevelField>
122      getMemberViewabilityLevel() {
123    return memberViewabilityLevel;
124  }
125
126  @Override
127  public boolean equals(Object o) {
128    if (this == o) {
129      return true;
130    }
131    if (o == null || getClass() != o.getClass()) {
132      return false;
133    }
134    UpdateGroupByIdRequestBody casted = (UpdateGroupByIdRequestBody) o;
135    return Objects.equals(name, casted.name)
136        && Objects.equals(provenance, casted.provenance)
137        && Objects.equals(externalSyncIdentifier, casted.externalSyncIdentifier)
138        && Objects.equals(description, casted.description)
139        && Objects.equals(invitabilityLevel, casted.invitabilityLevel)
140        && Objects.equals(memberViewabilityLevel, casted.memberViewabilityLevel);
141  }
142
143  @Override
144  public int hashCode() {
145    return Objects.hash(
146        name,
147        provenance,
148        externalSyncIdentifier,
149        description,
150        invitabilityLevel,
151        memberViewabilityLevel);
152  }
153
154  @Override
155  public String toString() {
156    return "UpdateGroupByIdRequestBody{"
157        + "name='"
158        + name
159        + '\''
160        + ", "
161        + "provenance='"
162        + provenance
163        + '\''
164        + ", "
165        + "externalSyncIdentifier='"
166        + externalSyncIdentifier
167        + '\''
168        + ", "
169        + "description='"
170        + description
171        + '\''
172        + ", "
173        + "invitabilityLevel='"
174        + invitabilityLevel
175        + '\''
176        + ", "
177        + "memberViewabilityLevel='"
178        + memberViewabilityLevel
179        + '\''
180        + "}";
181  }
182
183  public static class Builder extends NullableFieldTracker {
184
185    protected String name;
186
187    protected String provenance;
188
189    protected String externalSyncIdentifier;
190
191    protected String description;
192
193    protected EnumWrapper<UpdateGroupByIdRequestBodyInvitabilityLevelField> invitabilityLevel;
194
195    protected EnumWrapper<UpdateGroupByIdRequestBodyMemberViewabilityLevelField>
196        memberViewabilityLevel;
197
198    public Builder name(String name) {
199      this.name = name;
200      return this;
201    }
202
203    public Builder provenance(String provenance) {
204      this.provenance = provenance;
205      return this;
206    }
207
208    public Builder externalSyncIdentifier(String externalSyncIdentifier) {
209      this.externalSyncIdentifier = externalSyncIdentifier;
210      return this;
211    }
212
213    public Builder description(String description) {
214      this.description = description;
215      return this;
216    }
217
218    public Builder invitabilityLevel(
219        UpdateGroupByIdRequestBodyInvitabilityLevelField invitabilityLevel) {
220      this.invitabilityLevel =
221          new EnumWrapper<UpdateGroupByIdRequestBodyInvitabilityLevelField>(invitabilityLevel);
222      return this;
223    }
224
225    public Builder invitabilityLevel(
226        EnumWrapper<UpdateGroupByIdRequestBodyInvitabilityLevelField> invitabilityLevel) {
227      this.invitabilityLevel = invitabilityLevel;
228      return this;
229    }
230
231    public Builder memberViewabilityLevel(
232        UpdateGroupByIdRequestBodyMemberViewabilityLevelField memberViewabilityLevel) {
233      this.memberViewabilityLevel =
234          new EnumWrapper<UpdateGroupByIdRequestBodyMemberViewabilityLevelField>(
235              memberViewabilityLevel);
236      return this;
237    }
238
239    public Builder memberViewabilityLevel(
240        EnumWrapper<UpdateGroupByIdRequestBodyMemberViewabilityLevelField> memberViewabilityLevel) {
241      this.memberViewabilityLevel = memberViewabilityLevel;
242      return this;
243    }
244
245    public UpdateGroupByIdRequestBody build() {
246      return new UpdateGroupByIdRequestBody(this);
247    }
248  }
249}