001package com.box.sdkgen.managers.sharedlinksfiles;
002
003import com.box.sdkgen.internal.NullableFieldTracker;
004import com.box.sdkgen.internal.SerializableObject;
005import com.fasterxml.jackson.annotation.JsonFilter;
006import com.fasterxml.jackson.annotation.JsonProperty;
007import java.util.Objects;
008
009@JsonFilter("nullablePropertyFilter")
010public class UpdateSharedLinkOnFileRequestBodySharedLinkPermissionsField
011    extends SerializableObject {
012
013  /**
014   * If the shared link allows for downloading of files. This can only be set when `access` is set
015   * to `open` or `company`.
016   */
017  @JsonProperty("can_download")
018  protected Boolean canDownload;
019
020  /**
021   * If the shared link allows for previewing of files. This value is always `true`. For shared
022   * links on folders this also applies to any items in the folder.
023   */
024  @JsonProperty("can_preview")
025  protected Boolean canPreview;
026
027  /**
028   * If the shared link allows for editing of files. This can only be set when `access` is set to
029   * `open` or `company`. This value can only be `true` is `can_download` is also `true`.
030   */
031  @JsonProperty("can_edit")
032  protected Boolean canEdit;
033
034  public UpdateSharedLinkOnFileRequestBodySharedLinkPermissionsField() {
035    super();
036  }
037
038  protected UpdateSharedLinkOnFileRequestBodySharedLinkPermissionsField(Builder builder) {
039    super();
040    this.canDownload = builder.canDownload;
041    this.canPreview = builder.canPreview;
042    this.canEdit = builder.canEdit;
043    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
044  }
045
046  public Boolean getCanDownload() {
047    return canDownload;
048  }
049
050  public Boolean getCanPreview() {
051    return canPreview;
052  }
053
054  public Boolean getCanEdit() {
055    return canEdit;
056  }
057
058  @Override
059  public boolean equals(Object o) {
060    if (this == o) {
061      return true;
062    }
063    if (o == null || getClass() != o.getClass()) {
064      return false;
065    }
066    UpdateSharedLinkOnFileRequestBodySharedLinkPermissionsField casted =
067        (UpdateSharedLinkOnFileRequestBodySharedLinkPermissionsField) o;
068    return Objects.equals(canDownload, casted.canDownload)
069        && Objects.equals(canPreview, casted.canPreview)
070        && Objects.equals(canEdit, casted.canEdit);
071  }
072
073  @Override
074  public int hashCode() {
075    return Objects.hash(canDownload, canPreview, canEdit);
076  }
077
078  @Override
079  public String toString() {
080    return "UpdateSharedLinkOnFileRequestBodySharedLinkPermissionsField{"
081        + "canDownload='"
082        + canDownload
083        + '\''
084        + ", "
085        + "canPreview='"
086        + canPreview
087        + '\''
088        + ", "
089        + "canEdit='"
090        + canEdit
091        + '\''
092        + "}";
093  }
094
095  public static class Builder extends NullableFieldTracker {
096
097    protected Boolean canDownload;
098
099    protected Boolean canPreview;
100
101    protected Boolean canEdit;
102
103    public Builder canDownload(Boolean canDownload) {
104      this.canDownload = canDownload;
105      return this;
106    }
107
108    public Builder canPreview(Boolean canPreview) {
109      this.canPreview = canPreview;
110      return this;
111    }
112
113    public Builder canEdit(Boolean canEdit) {
114      this.canEdit = canEdit;
115      return this;
116    }
117
118    public UpdateSharedLinkOnFileRequestBodySharedLinkPermissionsField build() {
119      return new UpdateSharedLinkOnFileRequestBodySharedLinkPermissionsField(this);
120    }
121  }
122}