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 CopyFileRequestBody extends SerializableObject {
011
012  /**
013   * An optional new name for the copied file.
014   *
015   * <p>There are some restrictions to the file name. Names containing non-printable ASCII
016   * characters, forward and backward slashes (`/`, `\`), and protected names like `.` and `..` are
017   * automatically sanitized by removing the non-allowed characters.
018   */
019  protected String name;
020
021  /** An optional ID of the specific file version to copy. */
022  protected String version;
023
024  /** The destination folder to copy the file to. */
025  protected final CopyFileRequestBodyParentField parent;
026
027  public CopyFileRequestBody(@JsonProperty("parent") CopyFileRequestBodyParentField parent) {
028    super();
029    this.parent = parent;
030  }
031
032  protected CopyFileRequestBody(Builder builder) {
033    super();
034    this.name = builder.name;
035    this.version = builder.version;
036    this.parent = builder.parent;
037    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
038  }
039
040  public String getName() {
041    return name;
042  }
043
044  public String getVersion() {
045    return version;
046  }
047
048  public CopyFileRequestBodyParentField getParent() {
049    return parent;
050  }
051
052  @Override
053  public boolean equals(Object o) {
054    if (this == o) {
055      return true;
056    }
057    if (o == null || getClass() != o.getClass()) {
058      return false;
059    }
060    CopyFileRequestBody casted = (CopyFileRequestBody) o;
061    return Objects.equals(name, casted.name)
062        && Objects.equals(version, casted.version)
063        && Objects.equals(parent, casted.parent);
064  }
065
066  @Override
067  public int hashCode() {
068    return Objects.hash(name, version, parent);
069  }
070
071  @Override
072  public String toString() {
073    return "CopyFileRequestBody{"
074        + "name='"
075        + name
076        + '\''
077        + ", "
078        + "version='"
079        + version
080        + '\''
081        + ", "
082        + "parent='"
083        + parent
084        + '\''
085        + "}";
086  }
087
088  public static class Builder extends NullableFieldTracker {
089
090    protected String name;
091
092    protected String version;
093
094    protected final CopyFileRequestBodyParentField parent;
095
096    public Builder(CopyFileRequestBodyParentField parent) {
097      super();
098      this.parent = parent;
099    }
100
101    public Builder name(String name) {
102      this.name = name;
103      return this;
104    }
105
106    public Builder version(String version) {
107      this.version = version;
108      return this;
109    }
110
111    public CopyFileRequestBody build() {
112      return new CopyFileRequestBody(this);
113    }
114  }
115}