001package com.box.sdkgen.managers.files;
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 UpdateFileByIdRequestBodySharedLinkPermissionsField extends SerializableObject {
011
012  /**
013   * If the shared link allows for downloading of files. This can only be set when `access` is set
014   * to `open` or `company`.
015   */
016  @JsonProperty("can_download")
017  protected Boolean canDownload;
018
019  public UpdateFileByIdRequestBodySharedLinkPermissionsField() {
020    super();
021  }
022
023  protected UpdateFileByIdRequestBodySharedLinkPermissionsField(Builder builder) {
024    super();
025    this.canDownload = builder.canDownload;
026    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
027  }
028
029  public Boolean getCanDownload() {
030    return canDownload;
031  }
032
033  @Override
034  public boolean equals(Object o) {
035    if (this == o) {
036      return true;
037    }
038    if (o == null || getClass() != o.getClass()) {
039      return false;
040    }
041    UpdateFileByIdRequestBodySharedLinkPermissionsField casted =
042        (UpdateFileByIdRequestBodySharedLinkPermissionsField) o;
043    return Objects.equals(canDownload, casted.canDownload);
044  }
045
046  @Override
047  public int hashCode() {
048    return Objects.hash(canDownload);
049  }
050
051  @Override
052  public String toString() {
053    return "UpdateFileByIdRequestBodySharedLinkPermissionsField{"
054        + "canDownload='"
055        + canDownload
056        + '\''
057        + "}";
058  }
059
060  public static class Builder extends NullableFieldTracker {
061
062    protected Boolean canDownload;
063
064    public Builder canDownload(Boolean canDownload) {
065      this.canDownload = canDownload;
066      return this;
067    }
068
069    public UpdateFileByIdRequestBodySharedLinkPermissionsField build() {
070      return new UpdateFileByIdRequestBodySharedLinkPermissionsField(this);
071    }
072  }
073}