001package com.box.sdkgen.schemas.zipdownloadrequest;
002
003import com.box.sdkgen.internal.SerializableObject;
004import com.box.sdkgen.serialization.json.EnumWrapper;
005import com.fasterxml.jackson.annotation.JsonFilter;
006import com.fasterxml.jackson.annotation.JsonProperty;
007import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
008import com.fasterxml.jackson.databind.annotation.JsonSerialize;
009import java.util.Objects;
010
011@JsonFilter("nullablePropertyFilter")
012public class ZipDownloadRequestItemsField extends SerializableObject {
013
014  /** The type of the item to add to the archive. */
015  @JsonDeserialize(
016      using = ZipDownloadRequestItemsTypeField.ZipDownloadRequestItemsTypeFieldDeserializer.class)
017  @JsonSerialize(
018      using = ZipDownloadRequestItemsTypeField.ZipDownloadRequestItemsTypeFieldSerializer.class)
019  protected final EnumWrapper<ZipDownloadRequestItemsTypeField> type;
020
021  /**
022   * The identifier of the item to add to the archive. When this item is a folder then this can not
023   * be the root folder with ID `0`.
024   */
025  protected final String id;
026
027  public ZipDownloadRequestItemsField(ZipDownloadRequestItemsTypeField type, String id) {
028    super();
029    this.type = new EnumWrapper<ZipDownloadRequestItemsTypeField>(type);
030    this.id = id;
031  }
032
033  public ZipDownloadRequestItemsField(
034      @JsonProperty("type") EnumWrapper<ZipDownloadRequestItemsTypeField> type,
035      @JsonProperty("id") String id) {
036    super();
037    this.type = type;
038    this.id = id;
039  }
040
041  public EnumWrapper<ZipDownloadRequestItemsTypeField> getType() {
042    return type;
043  }
044
045  public String getId() {
046    return id;
047  }
048
049  @Override
050  public boolean equals(Object o) {
051    if (this == o) {
052      return true;
053    }
054    if (o == null || getClass() != o.getClass()) {
055      return false;
056    }
057    ZipDownloadRequestItemsField casted = (ZipDownloadRequestItemsField) o;
058    return Objects.equals(type, casted.type) && Objects.equals(id, casted.id);
059  }
060
061  @Override
062  public int hashCode() {
063    return Objects.hash(type, id);
064  }
065
066  @Override
067  public String toString() {
068    return "ZipDownloadRequestItemsField{"
069        + "type='"
070        + type
071        + '\''
072        + ", "
073        + "id='"
074        + id
075        + '\''
076        + "}";
077  }
078}