001package com.box.sdkgen.managers.files;
002
003import static com.box.sdkgen.internal.utils.UtilsManager.mapOf;
004
005import java.util.Map;
006
007public class GetFileByIdHeaders {
008
009  /**
010   * Ensures an item is only returned if it has changed.
011   *
012   * <p>Pass in the item's last observed `etag` value into this header and the endpoint will fail
013   * with a `304 Not Modified` if the item has not changed since.
014   */
015  public String ifNoneMatch;
016
017  /**
018   * The URL, and optional password, for the shared link of this item.
019   *
020   * <p>This header can be used to access items that have not been explicitly shared with a user.
021   *
022   * <p>Use the format `shared_link=[link]` or if a password is required then use
023   * `shared_link=[link]&amp;shared_link_password=[password]`.
024   *
025   * <p>This header can be used on the file or folder shared, as well as on any files or folders
026   * nested within the item.
027   */
028  public String boxapi;
029
030  /**
031   * A header required to request specific `representations` of a file. Use this in combination with
032   * the `fields` query parameter to request a specific file representation.
033   *
034   * <p>The general format for these representations is `X-Rep-Hints: [...]` where `[...]` is one or
035   * many hints in the format `[fileType?query]`.
036   *
037   * <p>For example, to request a `png` representation in `32x32` as well as `64x64` pixel
038   * dimensions provide the following hints.
039   *
040   * <p>`x-rep-hints: [jpg?dimensions=32x32][jpg?dimensions=64x64]`
041   *
042   * <p>Additionally, a `text` representation is available for all document file types in Box using
043   * the `[extracted_text]` representation.
044   *
045   * <p>`x-rep-hints: [extracted_text]`.
046   */
047  public String xRepHints;
048
049  /** Extra headers that will be included in the HTTP request. */
050  public Map<String, String> extraHeaders;
051
052  public GetFileByIdHeaders() {
053    this.extraHeaders = mapOf();
054  }
055
056  protected GetFileByIdHeaders(Builder builder) {
057    this.ifNoneMatch = builder.ifNoneMatch;
058    this.boxapi = builder.boxapi;
059    this.xRepHints = builder.xRepHints;
060    this.extraHeaders = builder.extraHeaders;
061  }
062
063  public String getIfNoneMatch() {
064    return ifNoneMatch;
065  }
066
067  public String getBoxapi() {
068    return boxapi;
069  }
070
071  public String getXRepHints() {
072    return xRepHints;
073  }
074
075  public Map<String, String> getExtraHeaders() {
076    return extraHeaders;
077  }
078
079  public static class Builder {
080
081    protected String ifNoneMatch;
082
083    protected String boxapi;
084
085    protected String xRepHints;
086
087    protected Map<String, String> extraHeaders;
088
089    public Builder() {}
090
091    public Builder ifNoneMatch(String ifNoneMatch) {
092      this.ifNoneMatch = ifNoneMatch;
093      return this;
094    }
095
096    public Builder boxapi(String boxapi) {
097      this.boxapi = boxapi;
098      return this;
099    }
100
101    public Builder xRepHints(String xRepHints) {
102      this.xRepHints = xRepHints;
103      return this;
104    }
105
106    public Builder extraHeaders(Map<String, String> extraHeaders) {
107      this.extraHeaders = extraHeaders;
108      return this;
109    }
110
111    public GetFileByIdHeaders build() {
112      if (this.extraHeaders == null) {
113        this.extraHeaders = mapOf();
114      }
115      return new GetFileByIdHeaders(this);
116    }
117  }
118}