001package com.box.sdkgen.schemas.v2025r0.hubdocumentpagesv2025r0; 002 003import com.box.sdkgen.internal.Nullable; 004import com.box.sdkgen.internal.NullableFieldTracker; 005import com.box.sdkgen.internal.SerializableObject; 006import com.box.sdkgen.schemas.v2025r0.hubdocumentpagev2025r0.HubDocumentPageV2025R0; 007import com.box.sdkgen.serialization.json.EnumWrapper; 008import com.fasterxml.jackson.annotation.JsonFilter; 009import com.fasterxml.jackson.annotation.JsonProperty; 010import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 011import com.fasterxml.jackson.databind.annotation.JsonSerialize; 012import java.util.List; 013import java.util.Objects; 014 015/** A list of Hub Document Pages. */ 016@JsonFilter("nullablePropertyFilter") 017public class HubDocumentPagesV2025R0 extends SerializableObject { 018 019 /** Ordered list of pages. */ 020 protected final List<HubDocumentPageV2025R0> entries; 021 022 /** The value will always be `document_pages`. */ 023 @JsonDeserialize( 024 using = HubDocumentPagesV2025R0TypeField.HubDocumentPagesV2025R0TypeFieldDeserializer.class) 025 @JsonSerialize( 026 using = HubDocumentPagesV2025R0TypeField.HubDocumentPagesV2025R0TypeFieldSerializer.class) 027 protected EnumWrapper<HubDocumentPagesV2025R0TypeField> type; 028 029 /** 030 * The limit that was used for these entries. This will be the same as the `limit` query parameter 031 * unless that value exceeded the maximum value allowed. The maximum value varies by API. 032 */ 033 protected Long limit; 034 035 /** The marker for the start of the next page of results. */ 036 @JsonProperty("next_marker") 037 @Nullable 038 protected String nextMarker; 039 040 public HubDocumentPagesV2025R0(@JsonProperty("entries") List<HubDocumentPageV2025R0> entries) { 041 super(); 042 this.entries = entries; 043 this.type = 044 new EnumWrapper<HubDocumentPagesV2025R0TypeField>( 045 HubDocumentPagesV2025R0TypeField.DOCUMENT_PAGES); 046 } 047 048 protected HubDocumentPagesV2025R0(Builder builder) { 049 super(); 050 this.entries = builder.entries; 051 this.type = builder.type; 052 this.limit = builder.limit; 053 this.nextMarker = builder.nextMarker; 054 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 055 } 056 057 public List<HubDocumentPageV2025R0> getEntries() { 058 return entries; 059 } 060 061 public EnumWrapper<HubDocumentPagesV2025R0TypeField> getType() { 062 return type; 063 } 064 065 public Long getLimit() { 066 return limit; 067 } 068 069 public String getNextMarker() { 070 return nextMarker; 071 } 072 073 @Override 074 public boolean equals(Object o) { 075 if (this == o) { 076 return true; 077 } 078 if (o == null || getClass() != o.getClass()) { 079 return false; 080 } 081 HubDocumentPagesV2025R0 casted = (HubDocumentPagesV2025R0) o; 082 return Objects.equals(entries, casted.entries) 083 && Objects.equals(type, casted.type) 084 && Objects.equals(limit, casted.limit) 085 && Objects.equals(nextMarker, casted.nextMarker); 086 } 087 088 @Override 089 public int hashCode() { 090 return Objects.hash(entries, type, limit, nextMarker); 091 } 092 093 @Override 094 public String toString() { 095 return "HubDocumentPagesV2025R0{" 096 + "entries='" 097 + entries 098 + '\'' 099 + ", " 100 + "type='" 101 + type 102 + '\'' 103 + ", " 104 + "limit='" 105 + limit 106 + '\'' 107 + ", " 108 + "nextMarker='" 109 + nextMarker 110 + '\'' 111 + "}"; 112 } 113 114 public static class Builder extends NullableFieldTracker { 115 116 protected final List<HubDocumentPageV2025R0> entries; 117 118 protected EnumWrapper<HubDocumentPagesV2025R0TypeField> type; 119 120 protected Long limit; 121 122 protected String nextMarker; 123 124 public Builder(List<HubDocumentPageV2025R0> entries) { 125 super(); 126 this.entries = entries; 127 } 128 129 public Builder type(HubDocumentPagesV2025R0TypeField type) { 130 this.type = new EnumWrapper<HubDocumentPagesV2025R0TypeField>(type); 131 return this; 132 } 133 134 public Builder type(EnumWrapper<HubDocumentPagesV2025R0TypeField> type) { 135 this.type = type; 136 return this; 137 } 138 139 public Builder limit(Long limit) { 140 this.limit = limit; 141 return this; 142 } 143 144 public Builder nextMarker(String nextMarker) { 145 this.nextMarker = nextMarker; 146 this.markNullableFieldAsSet("next_marker"); 147 return this; 148 } 149 150 public HubDocumentPagesV2025R0 build() { 151 if (this.type == null) { 152 this.type = 153 new EnumWrapper<HubDocumentPagesV2025R0TypeField>( 154 HubDocumentPagesV2025R0TypeField.DOCUMENT_PAGES); 155 } 156 return new HubDocumentPagesV2025R0(this); 157 } 158 } 159}