001package com.box.sdkgen.managers.uploads;
002
003import java.io.InputStream;
004
005public class UploadWithPreflightCheckRequestBody {
006
007  public final UploadWithPreflightCheckRequestBodyAttributesField attributes;
008
009  /**
010   * The content of the file to upload to Box.
011   *
012   * <p>&lt;Message warning&gt;
013   *
014   * <p>The `attributes` part of the body must come **before** the `file` part. Requests that do not
015   * follow this format when uploading the file will receive a HTTP `400` error with a
016   * `metadata_after_file_contents` error code.
017   *
018   * <p>&lt;/Message&gt;
019   */
020  public final InputStream file;
021
022  public String fileFileName;
023
024  public String fileContentType;
025
026  public UploadWithPreflightCheckRequestBody(
027      UploadWithPreflightCheckRequestBodyAttributesField attributes, InputStream file) {
028    this.attributes = attributes;
029    this.file = file;
030  }
031
032  protected UploadWithPreflightCheckRequestBody(Builder builder) {
033    this.attributes = builder.attributes;
034    this.file = builder.file;
035    this.fileFileName = builder.fileFileName;
036    this.fileContentType = builder.fileContentType;
037  }
038
039  public UploadWithPreflightCheckRequestBodyAttributesField getAttributes() {
040    return attributes;
041  }
042
043  public InputStream getFile() {
044    return file;
045  }
046
047  public String getFileFileName() {
048    return fileFileName;
049  }
050
051  public String getFileContentType() {
052    return fileContentType;
053  }
054
055  public static class Builder {
056
057    protected final UploadWithPreflightCheckRequestBodyAttributesField attributes;
058
059    protected final InputStream file;
060
061    protected String fileFileName;
062
063    protected String fileContentType;
064
065    public Builder(
066        UploadWithPreflightCheckRequestBodyAttributesField attributes, InputStream file) {
067      this.attributes = attributes;
068      this.file = file;
069    }
070
071    public Builder fileFileName(String fileFileName) {
072      this.fileFileName = fileFileName;
073      return this;
074    }
075
076    public Builder fileContentType(String fileContentType) {
077      this.fileContentType = fileContentType;
078      return this;
079    }
080
081    public UploadWithPreflightCheckRequestBody build() {
082      return new UploadWithPreflightCheckRequestBody(this);
083    }
084  }
085}