001package com.box.sdkgen.schemas.userfull; 002 003import com.box.sdkgen.schemas.trackingcode.TrackingCode; 004import com.box.sdkgen.schemas.user.User; 005import com.box.sdkgen.schemas.user.UserNotificationEmailField; 006import com.box.sdkgen.schemas.user.UserStatusField; 007import com.box.sdkgen.schemas.userbase.UserBaseTypeField; 008import com.box.sdkgen.serialization.json.EnumWrapper; 009import com.fasterxml.jackson.annotation.JsonFilter; 010import com.fasterxml.jackson.annotation.JsonProperty; 011import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 012import com.fasterxml.jackson.databind.annotation.JsonSerialize; 013import java.time.OffsetDateTime; 014import java.util.List; 015import java.util.Objects; 016 017/** A full representation of a user, as can be returned from any user API endpoint. */ 018@JsonFilter("nullablePropertyFilter") 019public class UserFull extends User { 020 021 /** The user’s enterprise role. */ 022 @JsonDeserialize(using = UserFullRoleField.UserFullRoleFieldDeserializer.class) 023 @JsonSerialize(using = UserFullRoleField.UserFullRoleFieldSerializer.class) 024 protected EnumWrapper<UserFullRoleField> role; 025 026 /** 027 * Tracking codes allow an admin to generate reports from the admin console and assign an 028 * attribute to a specific group of users. This setting must be enabled for an enterprise before 029 * it can be used. 030 */ 031 @JsonProperty("tracking_codes") 032 protected List<TrackingCode> trackingCodes; 033 034 /** Whether the user can see other enterprise users in their contact list. */ 035 @JsonProperty("can_see_managed_users") 036 protected Boolean canSeeManagedUsers; 037 038 /** Whether the user can use Box Sync. */ 039 @JsonProperty("is_sync_enabled") 040 protected Boolean isSyncEnabled; 041 042 /** Whether the user is allowed to collaborate with users outside their enterprise. */ 043 @JsonProperty("is_external_collab_restricted") 044 protected Boolean isExternalCollabRestricted; 045 046 /** Whether to exempt the user from Enterprise device limits. */ 047 @JsonProperty("is_exempt_from_device_limits") 048 protected Boolean isExemptFromDeviceLimits; 049 050 /** Whether the user must use two-factor authentication. */ 051 @JsonProperty("is_exempt_from_login_verification") 052 protected Boolean isExemptFromLoginVerification; 053 054 protected UserFullEnterpriseField enterprise; 055 056 /** 057 * Tags for all files and folders owned by the user. Values returned will only contain tags that 058 * were set by the requester. 059 */ 060 @JsonProperty("my_tags") 061 protected List<String> myTags; 062 063 /** The root (protocol, subdomain, domain) of any links that need to be generated for the user. */ 064 protected String hostname; 065 066 /** Whether the user is an App User. */ 067 @JsonProperty("is_platform_access_only") 068 protected Boolean isPlatformAccessOnly; 069 070 /** 071 * An external identifier for an app user, which can be used to look up the user. This can be used 072 * to tie user IDs from external identity providers to Box users. 073 */ 074 @JsonProperty("external_app_user_id") 075 protected String externalAppUserId; 076 077 public UserFull(@JsonProperty("id") String id) { 078 super(id); 079 } 080 081 protected UserFull(Builder builder) { 082 super(builder); 083 this.role = builder.role; 084 this.trackingCodes = builder.trackingCodes; 085 this.canSeeManagedUsers = builder.canSeeManagedUsers; 086 this.isSyncEnabled = builder.isSyncEnabled; 087 this.isExternalCollabRestricted = builder.isExternalCollabRestricted; 088 this.isExemptFromDeviceLimits = builder.isExemptFromDeviceLimits; 089 this.isExemptFromLoginVerification = builder.isExemptFromLoginVerification; 090 this.enterprise = builder.enterprise; 091 this.myTags = builder.myTags; 092 this.hostname = builder.hostname; 093 this.isPlatformAccessOnly = builder.isPlatformAccessOnly; 094 this.externalAppUserId = builder.externalAppUserId; 095 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 096 } 097 098 public EnumWrapper<UserFullRoleField> getRole() { 099 return role; 100 } 101 102 public List<TrackingCode> getTrackingCodes() { 103 return trackingCodes; 104 } 105 106 public Boolean getCanSeeManagedUsers() { 107 return canSeeManagedUsers; 108 } 109 110 public Boolean getIsSyncEnabled() { 111 return isSyncEnabled; 112 } 113 114 public Boolean getIsExternalCollabRestricted() { 115 return isExternalCollabRestricted; 116 } 117 118 public Boolean getIsExemptFromDeviceLimits() { 119 return isExemptFromDeviceLimits; 120 } 121 122 public Boolean getIsExemptFromLoginVerification() { 123 return isExemptFromLoginVerification; 124 } 125 126 public UserFullEnterpriseField getEnterprise() { 127 return enterprise; 128 } 129 130 public List<String> getMyTags() { 131 return myTags; 132 } 133 134 public String getHostname() { 135 return hostname; 136 } 137 138 public Boolean getIsPlatformAccessOnly() { 139 return isPlatformAccessOnly; 140 } 141 142 public String getExternalAppUserId() { 143 return externalAppUserId; 144 } 145 146 @Override 147 public boolean equals(Object o) { 148 if (this == o) { 149 return true; 150 } 151 if (o == null || getClass() != o.getClass()) { 152 return false; 153 } 154 UserFull casted = (UserFull) o; 155 return Objects.equals(id, casted.id) 156 && Objects.equals(type, casted.type) 157 && Objects.equals(name, casted.name) 158 && Objects.equals(login, casted.login) 159 && Objects.equals(createdAt, casted.createdAt) 160 && Objects.equals(modifiedAt, casted.modifiedAt) 161 && Objects.equals(language, casted.language) 162 && Objects.equals(timezone, casted.timezone) 163 && Objects.equals(spaceAmount, casted.spaceAmount) 164 && Objects.equals(spaceUsed, casted.spaceUsed) 165 && Objects.equals(maxUploadSize, casted.maxUploadSize) 166 && Objects.equals(status, casted.status) 167 && Objects.equals(jobTitle, casted.jobTitle) 168 && Objects.equals(phone, casted.phone) 169 && Objects.equals(address, casted.address) 170 && Objects.equals(avatarUrl, casted.avatarUrl) 171 && Objects.equals(notificationEmail, casted.notificationEmail) 172 && Objects.equals(role, casted.role) 173 && Objects.equals(trackingCodes, casted.trackingCodes) 174 && Objects.equals(canSeeManagedUsers, casted.canSeeManagedUsers) 175 && Objects.equals(isSyncEnabled, casted.isSyncEnabled) 176 && Objects.equals(isExternalCollabRestricted, casted.isExternalCollabRestricted) 177 && Objects.equals(isExemptFromDeviceLimits, casted.isExemptFromDeviceLimits) 178 && Objects.equals(isExemptFromLoginVerification, casted.isExemptFromLoginVerification) 179 && Objects.equals(enterprise, casted.enterprise) 180 && Objects.equals(myTags, casted.myTags) 181 && Objects.equals(hostname, casted.hostname) 182 && Objects.equals(isPlatformAccessOnly, casted.isPlatformAccessOnly) 183 && Objects.equals(externalAppUserId, casted.externalAppUserId); 184 } 185 186 @Override 187 public int hashCode() { 188 return Objects.hash( 189 id, 190 type, 191 name, 192 login, 193 createdAt, 194 modifiedAt, 195 language, 196 timezone, 197 spaceAmount, 198 spaceUsed, 199 maxUploadSize, 200 status, 201 jobTitle, 202 phone, 203 address, 204 avatarUrl, 205 notificationEmail, 206 role, 207 trackingCodes, 208 canSeeManagedUsers, 209 isSyncEnabled, 210 isExternalCollabRestricted, 211 isExemptFromDeviceLimits, 212 isExemptFromLoginVerification, 213 enterprise, 214 myTags, 215 hostname, 216 isPlatformAccessOnly, 217 externalAppUserId); 218 } 219 220 @Override 221 public String toString() { 222 return "UserFull{" 223 + "id='" 224 + id 225 + '\'' 226 + ", " 227 + "type='" 228 + type 229 + '\'' 230 + ", " 231 + "name='" 232 + name 233 + '\'' 234 + ", " 235 + "login='" 236 + login 237 + '\'' 238 + ", " 239 + "createdAt='" 240 + createdAt 241 + '\'' 242 + ", " 243 + "modifiedAt='" 244 + modifiedAt 245 + '\'' 246 + ", " 247 + "language='" 248 + language 249 + '\'' 250 + ", " 251 + "timezone='" 252 + timezone 253 + '\'' 254 + ", " 255 + "spaceAmount='" 256 + spaceAmount 257 + '\'' 258 + ", " 259 + "spaceUsed='" 260 + spaceUsed 261 + '\'' 262 + ", " 263 + "maxUploadSize='" 264 + maxUploadSize 265 + '\'' 266 + ", " 267 + "status='" 268 + status 269 + '\'' 270 + ", " 271 + "jobTitle='" 272 + jobTitle 273 + '\'' 274 + ", " 275 + "phone='" 276 + phone 277 + '\'' 278 + ", " 279 + "address='" 280 + address 281 + '\'' 282 + ", " 283 + "avatarUrl='" 284 + avatarUrl 285 + '\'' 286 + ", " 287 + "notificationEmail='" 288 + notificationEmail 289 + '\'' 290 + ", " 291 + "role='" 292 + role 293 + '\'' 294 + ", " 295 + "trackingCodes='" 296 + trackingCodes 297 + '\'' 298 + ", " 299 + "canSeeManagedUsers='" 300 + canSeeManagedUsers 301 + '\'' 302 + ", " 303 + "isSyncEnabled='" 304 + isSyncEnabled 305 + '\'' 306 + ", " 307 + "isExternalCollabRestricted='" 308 + isExternalCollabRestricted 309 + '\'' 310 + ", " 311 + "isExemptFromDeviceLimits='" 312 + isExemptFromDeviceLimits 313 + '\'' 314 + ", " 315 + "isExemptFromLoginVerification='" 316 + isExemptFromLoginVerification 317 + '\'' 318 + ", " 319 + "enterprise='" 320 + enterprise 321 + '\'' 322 + ", " 323 + "myTags='" 324 + myTags 325 + '\'' 326 + ", " 327 + "hostname='" 328 + hostname 329 + '\'' 330 + ", " 331 + "isPlatformAccessOnly='" 332 + isPlatformAccessOnly 333 + '\'' 334 + ", " 335 + "externalAppUserId='" 336 + externalAppUserId 337 + '\'' 338 + "}"; 339 } 340 341 public static class Builder extends User.Builder { 342 343 protected EnumWrapper<UserFullRoleField> role; 344 345 protected List<TrackingCode> trackingCodes; 346 347 protected Boolean canSeeManagedUsers; 348 349 protected Boolean isSyncEnabled; 350 351 protected Boolean isExternalCollabRestricted; 352 353 protected Boolean isExemptFromDeviceLimits; 354 355 protected Boolean isExemptFromLoginVerification; 356 357 protected UserFullEnterpriseField enterprise; 358 359 protected List<String> myTags; 360 361 protected String hostname; 362 363 protected Boolean isPlatformAccessOnly; 364 365 protected String externalAppUserId; 366 367 public Builder(String id) { 368 super(id); 369 } 370 371 public Builder role(UserFullRoleField role) { 372 this.role = new EnumWrapper<UserFullRoleField>(role); 373 return this; 374 } 375 376 public Builder role(EnumWrapper<UserFullRoleField> role) { 377 this.role = role; 378 return this; 379 } 380 381 public Builder trackingCodes(List<TrackingCode> trackingCodes) { 382 this.trackingCodes = trackingCodes; 383 return this; 384 } 385 386 public Builder canSeeManagedUsers(Boolean canSeeManagedUsers) { 387 this.canSeeManagedUsers = canSeeManagedUsers; 388 return this; 389 } 390 391 public Builder isSyncEnabled(Boolean isSyncEnabled) { 392 this.isSyncEnabled = isSyncEnabled; 393 return this; 394 } 395 396 public Builder isExternalCollabRestricted(Boolean isExternalCollabRestricted) { 397 this.isExternalCollabRestricted = isExternalCollabRestricted; 398 return this; 399 } 400 401 public Builder isExemptFromDeviceLimits(Boolean isExemptFromDeviceLimits) { 402 this.isExemptFromDeviceLimits = isExemptFromDeviceLimits; 403 return this; 404 } 405 406 public Builder isExemptFromLoginVerification(Boolean isExemptFromLoginVerification) { 407 this.isExemptFromLoginVerification = isExemptFromLoginVerification; 408 return this; 409 } 410 411 public Builder enterprise(UserFullEnterpriseField enterprise) { 412 this.enterprise = enterprise; 413 return this; 414 } 415 416 public Builder myTags(List<String> myTags) { 417 this.myTags = myTags; 418 return this; 419 } 420 421 public Builder hostname(String hostname) { 422 this.hostname = hostname; 423 return this; 424 } 425 426 public Builder isPlatformAccessOnly(Boolean isPlatformAccessOnly) { 427 this.isPlatformAccessOnly = isPlatformAccessOnly; 428 return this; 429 } 430 431 public Builder externalAppUserId(String externalAppUserId) { 432 this.externalAppUserId = externalAppUserId; 433 return this; 434 } 435 436 @Override 437 public Builder type(UserBaseTypeField type) { 438 this.type = new EnumWrapper<UserBaseTypeField>(type); 439 return this; 440 } 441 442 @Override 443 public Builder type(EnumWrapper<UserBaseTypeField> type) { 444 this.type = type; 445 return this; 446 } 447 448 @Override 449 public Builder name(String name) { 450 this.name = name; 451 return this; 452 } 453 454 @Override 455 public Builder login(String login) { 456 this.login = login; 457 return this; 458 } 459 460 @Override 461 public Builder createdAt(OffsetDateTime createdAt) { 462 this.createdAt = createdAt; 463 return this; 464 } 465 466 @Override 467 public Builder modifiedAt(OffsetDateTime modifiedAt) { 468 this.modifiedAt = modifiedAt; 469 return this; 470 } 471 472 @Override 473 public Builder language(String language) { 474 this.language = language; 475 return this; 476 } 477 478 @Override 479 public Builder timezone(String timezone) { 480 this.timezone = timezone; 481 return this; 482 } 483 484 @Override 485 public Builder spaceAmount(Long spaceAmount) { 486 this.spaceAmount = spaceAmount; 487 return this; 488 } 489 490 @Override 491 public Builder spaceUsed(Long spaceUsed) { 492 this.spaceUsed = spaceUsed; 493 return this; 494 } 495 496 @Override 497 public Builder maxUploadSize(Long maxUploadSize) { 498 this.maxUploadSize = maxUploadSize; 499 return this; 500 } 501 502 @Override 503 public Builder status(UserStatusField status) { 504 this.status = new EnumWrapper<UserStatusField>(status); 505 return this; 506 } 507 508 @Override 509 public Builder status(EnumWrapper<UserStatusField> status) { 510 this.status = status; 511 return this; 512 } 513 514 @Override 515 public Builder jobTitle(String jobTitle) { 516 this.jobTitle = jobTitle; 517 return this; 518 } 519 520 @Override 521 public Builder phone(String phone) { 522 this.phone = phone; 523 return this; 524 } 525 526 @Override 527 public Builder address(String address) { 528 this.address = address; 529 return this; 530 } 531 532 @Override 533 public Builder avatarUrl(String avatarUrl) { 534 this.avatarUrl = avatarUrl; 535 return this; 536 } 537 538 @Override 539 public Builder notificationEmail(UserNotificationEmailField notificationEmail) { 540 this.notificationEmail = notificationEmail; 541 this.markNullableFieldAsSet("notification_email"); 542 return this; 543 } 544 545 public UserFull build() { 546 if (this.type == null) { 547 this.type = new EnumWrapper<UserBaseTypeField>(UserBaseTypeField.USER); 548 } 549 return new UserFull(this); 550 } 551 } 552}