001package com.box.sdkgen.schemas.v2025r0.hubv2025r0; 002 003import com.box.sdkgen.internal.utils.DateTimeUtils; 004import com.box.sdkgen.schemas.v2025r0.hubbasev2025r0.HubBaseV2025R0; 005import com.box.sdkgen.schemas.v2025r0.hubbasev2025r0.HubBaseV2025R0TypeField; 006import com.box.sdkgen.schemas.v2025r0.userminiv2025r0.UserMiniV2025R0; 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.time.OffsetDateTime; 013import java.util.Objects; 014 015/** 016 * A standard representation of a Box Hub, as returned from any Box Hubs API endpoints by default. 017 */ 018@JsonFilter("nullablePropertyFilter") 019public class HubV2025R0 extends HubBaseV2025R0 { 020 021 /** The title given to the Box Hub. */ 022 protected String title; 023 024 /** The description of the Box Hub. First 200 characters are returned. */ 025 protected String description; 026 027 /** 028 * The date and time when the folder was created. This value may be `null` for some folders such 029 * as the root folder or the trash folder. 030 */ 031 @JsonProperty("created_at") 032 @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class) 033 @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class) 034 protected OffsetDateTime createdAt; 035 036 /** The date and time when the Box Hub was last updated. */ 037 @JsonProperty("updated_at") 038 @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class) 039 @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class) 040 protected OffsetDateTime updatedAt; 041 042 @JsonProperty("created_by") 043 protected UserMiniV2025R0 createdBy; 044 045 @JsonProperty("updated_by") 046 protected UserMiniV2025R0 updatedBy; 047 048 /** The number of views for the Box Hub. */ 049 @JsonProperty("view_count") 050 protected Integer viewCount; 051 052 /** Indicates if AI features are enabled for the Box Hub. */ 053 @JsonProperty("is_ai_enabled") 054 protected Boolean isAiEnabled; 055 056 /** Indicates if collaboration is restricted to the enterprise. */ 057 @JsonProperty("is_collaboration_restricted_to_enterprise") 058 protected Boolean isCollaborationRestrictedToEnterprise; 059 060 /** Indicates if non-owners can invite others to the Box Hub. */ 061 @JsonProperty("can_non_owners_invite") 062 protected Boolean canNonOwnersInvite; 063 064 /** Indicates if a shared link can be created for the Box Hub. */ 065 @JsonProperty("can_shared_link_be_created") 066 protected Boolean canSharedLinkBeCreated; 067 068 /** Indicates if a public shared link can be created for the Box Hub. */ 069 @JsonProperty("can_public_shared_link_be_created") 070 protected Boolean canPublicSharedLinkBeCreated; 071 072 public HubV2025R0(@JsonProperty("id") String id) { 073 super(id); 074 } 075 076 protected HubV2025R0(Builder builder) { 077 super(builder); 078 this.title = builder.title; 079 this.description = builder.description; 080 this.createdAt = builder.createdAt; 081 this.updatedAt = builder.updatedAt; 082 this.createdBy = builder.createdBy; 083 this.updatedBy = builder.updatedBy; 084 this.viewCount = builder.viewCount; 085 this.isAiEnabled = builder.isAiEnabled; 086 this.isCollaborationRestrictedToEnterprise = builder.isCollaborationRestrictedToEnterprise; 087 this.canNonOwnersInvite = builder.canNonOwnersInvite; 088 this.canSharedLinkBeCreated = builder.canSharedLinkBeCreated; 089 this.canPublicSharedLinkBeCreated = builder.canPublicSharedLinkBeCreated; 090 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 091 } 092 093 public String getTitle() { 094 return title; 095 } 096 097 public String getDescription() { 098 return description; 099 } 100 101 public OffsetDateTime getCreatedAt() { 102 return createdAt; 103 } 104 105 public OffsetDateTime getUpdatedAt() { 106 return updatedAt; 107 } 108 109 public UserMiniV2025R0 getCreatedBy() { 110 return createdBy; 111 } 112 113 public UserMiniV2025R0 getUpdatedBy() { 114 return updatedBy; 115 } 116 117 public Integer getViewCount() { 118 return viewCount; 119 } 120 121 public Boolean getIsAiEnabled() { 122 return isAiEnabled; 123 } 124 125 public Boolean getIsCollaborationRestrictedToEnterprise() { 126 return isCollaborationRestrictedToEnterprise; 127 } 128 129 public Boolean getCanNonOwnersInvite() { 130 return canNonOwnersInvite; 131 } 132 133 public Boolean getCanSharedLinkBeCreated() { 134 return canSharedLinkBeCreated; 135 } 136 137 public Boolean getCanPublicSharedLinkBeCreated() { 138 return canPublicSharedLinkBeCreated; 139 } 140 141 @Override 142 public boolean equals(Object o) { 143 if (this == o) { 144 return true; 145 } 146 if (o == null || getClass() != o.getClass()) { 147 return false; 148 } 149 HubV2025R0 casted = (HubV2025R0) o; 150 return Objects.equals(id, casted.id) 151 && Objects.equals(type, casted.type) 152 && Objects.equals(title, casted.title) 153 && Objects.equals(description, casted.description) 154 && Objects.equals(createdAt, casted.createdAt) 155 && Objects.equals(updatedAt, casted.updatedAt) 156 && Objects.equals(createdBy, casted.createdBy) 157 && Objects.equals(updatedBy, casted.updatedBy) 158 && Objects.equals(viewCount, casted.viewCount) 159 && Objects.equals(isAiEnabled, casted.isAiEnabled) 160 && Objects.equals( 161 isCollaborationRestrictedToEnterprise, casted.isCollaborationRestrictedToEnterprise) 162 && Objects.equals(canNonOwnersInvite, casted.canNonOwnersInvite) 163 && Objects.equals(canSharedLinkBeCreated, casted.canSharedLinkBeCreated) 164 && Objects.equals(canPublicSharedLinkBeCreated, casted.canPublicSharedLinkBeCreated); 165 } 166 167 @Override 168 public int hashCode() { 169 return Objects.hash( 170 id, 171 type, 172 title, 173 description, 174 createdAt, 175 updatedAt, 176 createdBy, 177 updatedBy, 178 viewCount, 179 isAiEnabled, 180 isCollaborationRestrictedToEnterprise, 181 canNonOwnersInvite, 182 canSharedLinkBeCreated, 183 canPublicSharedLinkBeCreated); 184 } 185 186 @Override 187 public String toString() { 188 return "HubV2025R0{" 189 + "id='" 190 + id 191 + '\'' 192 + ", " 193 + "type='" 194 + type 195 + '\'' 196 + ", " 197 + "title='" 198 + title 199 + '\'' 200 + ", " 201 + "description='" 202 + description 203 + '\'' 204 + ", " 205 + "createdAt='" 206 + createdAt 207 + '\'' 208 + ", " 209 + "updatedAt='" 210 + updatedAt 211 + '\'' 212 + ", " 213 + "createdBy='" 214 + createdBy 215 + '\'' 216 + ", " 217 + "updatedBy='" 218 + updatedBy 219 + '\'' 220 + ", " 221 + "viewCount='" 222 + viewCount 223 + '\'' 224 + ", " 225 + "isAiEnabled='" 226 + isAiEnabled 227 + '\'' 228 + ", " 229 + "isCollaborationRestrictedToEnterprise='" 230 + isCollaborationRestrictedToEnterprise 231 + '\'' 232 + ", " 233 + "canNonOwnersInvite='" 234 + canNonOwnersInvite 235 + '\'' 236 + ", " 237 + "canSharedLinkBeCreated='" 238 + canSharedLinkBeCreated 239 + '\'' 240 + ", " 241 + "canPublicSharedLinkBeCreated='" 242 + canPublicSharedLinkBeCreated 243 + '\'' 244 + "}"; 245 } 246 247 public static class Builder extends HubBaseV2025R0.Builder { 248 249 protected String title; 250 251 protected String description; 252 253 protected OffsetDateTime createdAt; 254 255 protected OffsetDateTime updatedAt; 256 257 protected UserMiniV2025R0 createdBy; 258 259 protected UserMiniV2025R0 updatedBy; 260 261 protected Integer viewCount; 262 263 protected Boolean isAiEnabled; 264 265 protected Boolean isCollaborationRestrictedToEnterprise; 266 267 protected Boolean canNonOwnersInvite; 268 269 protected Boolean canSharedLinkBeCreated; 270 271 protected Boolean canPublicSharedLinkBeCreated; 272 273 public Builder(String id) { 274 super(id); 275 } 276 277 public Builder title(String title) { 278 this.title = title; 279 return this; 280 } 281 282 public Builder description(String description) { 283 this.description = description; 284 return this; 285 } 286 287 public Builder createdAt(OffsetDateTime createdAt) { 288 this.createdAt = createdAt; 289 return this; 290 } 291 292 public Builder updatedAt(OffsetDateTime updatedAt) { 293 this.updatedAt = updatedAt; 294 return this; 295 } 296 297 public Builder createdBy(UserMiniV2025R0 createdBy) { 298 this.createdBy = createdBy; 299 return this; 300 } 301 302 public Builder updatedBy(UserMiniV2025R0 updatedBy) { 303 this.updatedBy = updatedBy; 304 return this; 305 } 306 307 public Builder viewCount(Integer viewCount) { 308 this.viewCount = viewCount; 309 return this; 310 } 311 312 public Builder isAiEnabled(Boolean isAiEnabled) { 313 this.isAiEnabled = isAiEnabled; 314 return this; 315 } 316 317 public Builder isCollaborationRestrictedToEnterprise( 318 Boolean isCollaborationRestrictedToEnterprise) { 319 this.isCollaborationRestrictedToEnterprise = isCollaborationRestrictedToEnterprise; 320 return this; 321 } 322 323 public Builder canNonOwnersInvite(Boolean canNonOwnersInvite) { 324 this.canNonOwnersInvite = canNonOwnersInvite; 325 return this; 326 } 327 328 public Builder canSharedLinkBeCreated(Boolean canSharedLinkBeCreated) { 329 this.canSharedLinkBeCreated = canSharedLinkBeCreated; 330 return this; 331 } 332 333 public Builder canPublicSharedLinkBeCreated(Boolean canPublicSharedLinkBeCreated) { 334 this.canPublicSharedLinkBeCreated = canPublicSharedLinkBeCreated; 335 return this; 336 } 337 338 @Override 339 public Builder type(HubBaseV2025R0TypeField type) { 340 this.type = new EnumWrapper<HubBaseV2025R0TypeField>(type); 341 return this; 342 } 343 344 @Override 345 public Builder type(EnumWrapper<HubBaseV2025R0TypeField> type) { 346 this.type = type; 347 return this; 348 } 349 350 public HubV2025R0 build() { 351 if (this.type == null) { 352 this.type = new EnumWrapper<HubBaseV2025R0TypeField>(HubBaseV2025R0TypeField.HUBS); 353 } 354 return new HubV2025R0(this); 355 } 356 } 357}