001package com.box.sdkgen.schemas.zipdownloadrequest; 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.List; 008import java.util.Objects; 009 010/** A request to create a `zip` archive to download. */ 011@JsonFilter("nullablePropertyFilter") 012public class ZipDownloadRequest extends SerializableObject { 013 014 /** A list of items to add to the `zip` archive. These can be folders or files. */ 015 protected final List<ZipDownloadRequestItemsField> items; 016 017 /** 018 * The optional name of the `zip` archive. This name will be appended by the `.zip` file 019 * extension, for example `January Financials.zip`. 020 */ 021 @JsonProperty("download_file_name") 022 protected String downloadFileName; 023 024 public ZipDownloadRequest(@JsonProperty("items") List<ZipDownloadRequestItemsField> items) { 025 super(); 026 this.items = items; 027 } 028 029 protected ZipDownloadRequest(Builder builder) { 030 super(); 031 this.items = builder.items; 032 this.downloadFileName = builder.downloadFileName; 033 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 034 } 035 036 public List<ZipDownloadRequestItemsField> getItems() { 037 return items; 038 } 039 040 public String getDownloadFileName() { 041 return downloadFileName; 042 } 043 044 @Override 045 public boolean equals(Object o) { 046 if (this == o) { 047 return true; 048 } 049 if (o == null || getClass() != o.getClass()) { 050 return false; 051 } 052 ZipDownloadRequest casted = (ZipDownloadRequest) o; 053 return Objects.equals(items, casted.items) 054 && Objects.equals(downloadFileName, casted.downloadFileName); 055 } 056 057 @Override 058 public int hashCode() { 059 return Objects.hash(items, downloadFileName); 060 } 061 062 @Override 063 public String toString() { 064 return "ZipDownloadRequest{" 065 + "items='" 066 + items 067 + '\'' 068 + ", " 069 + "downloadFileName='" 070 + downloadFileName 071 + '\'' 072 + "}"; 073 } 074 075 public static class Builder extends NullableFieldTracker { 076 077 protected final List<ZipDownloadRequestItemsField> items; 078 079 protected String downloadFileName; 080 081 public Builder(List<ZipDownloadRequestItemsField> items) { 082 super(); 083 this.items = items; 084 } 085 086 public Builder downloadFileName(String downloadFileName) { 087 this.downloadFileName = downloadFileName; 088 return this; 089 } 090 091 public ZipDownloadRequest build() { 092 return new ZipDownloadRequest(this); 093 } 094 } 095}