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 /** 073 * Specifies who is allowed to copy the Box Hub. 074 * 075 * <p>* `all` - Any user with access to the Hub can copy it. * `company` - Only users within the 076 * same enterprise as the Hub can copy it. * `none` - No one can copy the Hub. 077 */ 078 @JsonDeserialize( 079 using = HubV2025R0CopyHubAccessField.HubV2025R0CopyHubAccessFieldDeserializer.class) 080 @JsonSerialize(using = HubV2025R0CopyHubAccessField.HubV2025R0CopyHubAccessFieldSerializer.class) 081 @JsonProperty("copy_hub_access") 082 protected EnumWrapper<HubV2025R0CopyHubAccessField> copyHubAccess; 083 084 public HubV2025R0(@JsonProperty("id") String id) { 085 super(id); 086 } 087 088 protected HubV2025R0(Builder builder) { 089 super(builder); 090 this.title = builder.title; 091 this.description = builder.description; 092 this.createdAt = builder.createdAt; 093 this.updatedAt = builder.updatedAt; 094 this.createdBy = builder.createdBy; 095 this.updatedBy = builder.updatedBy; 096 this.viewCount = builder.viewCount; 097 this.isAiEnabled = builder.isAiEnabled; 098 this.isCollaborationRestrictedToEnterprise = builder.isCollaborationRestrictedToEnterprise; 099 this.canNonOwnersInvite = builder.canNonOwnersInvite; 100 this.canSharedLinkBeCreated = builder.canSharedLinkBeCreated; 101 this.canPublicSharedLinkBeCreated = builder.canPublicSharedLinkBeCreated; 102 this.copyHubAccess = builder.copyHubAccess; 103 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 104 } 105 106 public String getTitle() { 107 return title; 108 } 109 110 public String getDescription() { 111 return description; 112 } 113 114 public OffsetDateTime getCreatedAt() { 115 return createdAt; 116 } 117 118 public OffsetDateTime getUpdatedAt() { 119 return updatedAt; 120 } 121 122 public UserMiniV2025R0 getCreatedBy() { 123 return createdBy; 124 } 125 126 public UserMiniV2025R0 getUpdatedBy() { 127 return updatedBy; 128 } 129 130 public Integer getViewCount() { 131 return viewCount; 132 } 133 134 public Boolean getIsAiEnabled() { 135 return isAiEnabled; 136 } 137 138 public Boolean getIsCollaborationRestrictedToEnterprise() { 139 return isCollaborationRestrictedToEnterprise; 140 } 141 142 public Boolean getCanNonOwnersInvite() { 143 return canNonOwnersInvite; 144 } 145 146 public Boolean getCanSharedLinkBeCreated() { 147 return canSharedLinkBeCreated; 148 } 149 150 public Boolean getCanPublicSharedLinkBeCreated() { 151 return canPublicSharedLinkBeCreated; 152 } 153 154 public EnumWrapper<HubV2025R0CopyHubAccessField> getCopyHubAccess() { 155 return copyHubAccess; 156 } 157 158 @Override 159 public boolean equals(Object o) { 160 if (this == o) { 161 return true; 162 } 163 if (o == null || getClass() != o.getClass()) { 164 return false; 165 } 166 HubV2025R0 casted = (HubV2025R0) o; 167 return Objects.equals(id, casted.id) 168 && Objects.equals(type, casted.type) 169 && Objects.equals(title, casted.title) 170 && Objects.equals(description, casted.description) 171 && Objects.equals(createdAt, casted.createdAt) 172 && Objects.equals(updatedAt, casted.updatedAt) 173 && Objects.equals(createdBy, casted.createdBy) 174 && Objects.equals(updatedBy, casted.updatedBy) 175 && Objects.equals(viewCount, casted.viewCount) 176 && Objects.equals(isAiEnabled, casted.isAiEnabled) 177 && Objects.equals( 178 isCollaborationRestrictedToEnterprise, casted.isCollaborationRestrictedToEnterprise) 179 && Objects.equals(canNonOwnersInvite, casted.canNonOwnersInvite) 180 && Objects.equals(canSharedLinkBeCreated, casted.canSharedLinkBeCreated) 181 && Objects.equals(canPublicSharedLinkBeCreated, casted.canPublicSharedLinkBeCreated) 182 && Objects.equals(copyHubAccess, casted.copyHubAccess); 183 } 184 185 @Override 186 public int hashCode() { 187 return Objects.hash( 188 id, 189 type, 190 title, 191 description, 192 createdAt, 193 updatedAt, 194 createdBy, 195 updatedBy, 196 viewCount, 197 isAiEnabled, 198 isCollaborationRestrictedToEnterprise, 199 canNonOwnersInvite, 200 canSharedLinkBeCreated, 201 canPublicSharedLinkBeCreated, 202 copyHubAccess); 203 } 204 205 @Override 206 public String toString() { 207 return "HubV2025R0{" 208 + "id='" 209 + id 210 + '\'' 211 + ", " 212 + "type='" 213 + type 214 + '\'' 215 + ", " 216 + "title='" 217 + title 218 + '\'' 219 + ", " 220 + "description='" 221 + description 222 + '\'' 223 + ", " 224 + "createdAt='" 225 + createdAt 226 + '\'' 227 + ", " 228 + "updatedAt='" 229 + updatedAt 230 + '\'' 231 + ", " 232 + "createdBy='" 233 + createdBy 234 + '\'' 235 + ", " 236 + "updatedBy='" 237 + updatedBy 238 + '\'' 239 + ", " 240 + "viewCount='" 241 + viewCount 242 + '\'' 243 + ", " 244 + "isAiEnabled='" 245 + isAiEnabled 246 + '\'' 247 + ", " 248 + "isCollaborationRestrictedToEnterprise='" 249 + isCollaborationRestrictedToEnterprise 250 + '\'' 251 + ", " 252 + "canNonOwnersInvite='" 253 + canNonOwnersInvite 254 + '\'' 255 + ", " 256 + "canSharedLinkBeCreated='" 257 + canSharedLinkBeCreated 258 + '\'' 259 + ", " 260 + "canPublicSharedLinkBeCreated='" 261 + canPublicSharedLinkBeCreated 262 + '\'' 263 + ", " 264 + "copyHubAccess='" 265 + copyHubAccess 266 + '\'' 267 + "}"; 268 } 269 270 public static class Builder extends HubBaseV2025R0.Builder { 271 272 protected String title; 273 274 protected String description; 275 276 protected OffsetDateTime createdAt; 277 278 protected OffsetDateTime updatedAt; 279 280 protected UserMiniV2025R0 createdBy; 281 282 protected UserMiniV2025R0 updatedBy; 283 284 protected Integer viewCount; 285 286 protected Boolean isAiEnabled; 287 288 protected Boolean isCollaborationRestrictedToEnterprise; 289 290 protected Boolean canNonOwnersInvite; 291 292 protected Boolean canSharedLinkBeCreated; 293 294 protected Boolean canPublicSharedLinkBeCreated; 295 296 protected EnumWrapper<HubV2025R0CopyHubAccessField> copyHubAccess; 297 298 public Builder(String id) { 299 super(id); 300 } 301 302 public Builder title(String title) { 303 this.title = title; 304 return this; 305 } 306 307 public Builder description(String description) { 308 this.description = description; 309 return this; 310 } 311 312 public Builder createdAt(OffsetDateTime createdAt) { 313 this.createdAt = createdAt; 314 return this; 315 } 316 317 public Builder updatedAt(OffsetDateTime updatedAt) { 318 this.updatedAt = updatedAt; 319 return this; 320 } 321 322 public Builder createdBy(UserMiniV2025R0 createdBy) { 323 this.createdBy = createdBy; 324 return this; 325 } 326 327 public Builder updatedBy(UserMiniV2025R0 updatedBy) { 328 this.updatedBy = updatedBy; 329 return this; 330 } 331 332 public Builder viewCount(Integer viewCount) { 333 this.viewCount = viewCount; 334 return this; 335 } 336 337 public Builder isAiEnabled(Boolean isAiEnabled) { 338 this.isAiEnabled = isAiEnabled; 339 return this; 340 } 341 342 public Builder isCollaborationRestrictedToEnterprise( 343 Boolean isCollaborationRestrictedToEnterprise) { 344 this.isCollaborationRestrictedToEnterprise = isCollaborationRestrictedToEnterprise; 345 return this; 346 } 347 348 public Builder canNonOwnersInvite(Boolean canNonOwnersInvite) { 349 this.canNonOwnersInvite = canNonOwnersInvite; 350 return this; 351 } 352 353 public Builder canSharedLinkBeCreated(Boolean canSharedLinkBeCreated) { 354 this.canSharedLinkBeCreated = canSharedLinkBeCreated; 355 return this; 356 } 357 358 public Builder canPublicSharedLinkBeCreated(Boolean canPublicSharedLinkBeCreated) { 359 this.canPublicSharedLinkBeCreated = canPublicSharedLinkBeCreated; 360 return this; 361 } 362 363 public Builder copyHubAccess(HubV2025R0CopyHubAccessField copyHubAccess) { 364 this.copyHubAccess = new EnumWrapper<HubV2025R0CopyHubAccessField>(copyHubAccess); 365 return this; 366 } 367 368 public Builder copyHubAccess(EnumWrapper<HubV2025R0CopyHubAccessField> copyHubAccess) { 369 this.copyHubAccess = copyHubAccess; 370 return this; 371 } 372 373 @Override 374 public Builder type(HubBaseV2025R0TypeField type) { 375 this.type = new EnumWrapper<HubBaseV2025R0TypeField>(type); 376 return this; 377 } 378 379 @Override 380 public Builder type(EnumWrapper<HubBaseV2025R0TypeField> type) { 381 this.type = type; 382 return this; 383 } 384 385 public HubV2025R0 build() { 386 if (this.type == null) { 387 this.type = new EnumWrapper<HubBaseV2025R0TypeField>(HubBaseV2025R0TypeField.HUBS); 388 } 389 return new HubV2025R0(this); 390 } 391 } 392}