001package com.box.sdkgen.schemas.filefull; 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.Objects; 008 009@JsonFilter("nullablePropertyFilter") 010public class FileFullPermissionsField extends SerializableObject { 011 012 /** Specifies if the current user can delete this item. */ 013 @JsonProperty("can_delete") 014 protected final boolean canDelete; 015 016 /** Specifies if the current user can download this item. */ 017 @JsonProperty("can_download") 018 protected final boolean canDownload; 019 020 /** 021 * Specifies if the current user can invite new users to collaborate on this item, and if the user 022 * can update the role of a user already collaborated on this item. 023 */ 024 @JsonProperty("can_invite_collaborator") 025 protected final boolean canInviteCollaborator; 026 027 /** Specifies if the user can rename this item. */ 028 @JsonProperty("can_rename") 029 protected final boolean canRename; 030 031 /** Specifies if the user can change the access level of an existing shared link on this item. */ 032 @JsonProperty("can_set_share_access") 033 protected final boolean canSetShareAccess; 034 035 /** Specifies if the user can create a shared link for this item. */ 036 @JsonProperty("can_share") 037 protected final boolean canShare; 038 039 /** Specifies if the user can place annotations on this file. */ 040 @JsonProperty("can_annotate") 041 protected final boolean canAnnotate; 042 043 /** Specifies if the user can place comments on this file. */ 044 @JsonProperty("can_comment") 045 protected final boolean canComment; 046 047 /** Specifies if the user can preview this file. */ 048 @JsonProperty("can_preview") 049 protected final boolean canPreview; 050 051 /** Specifies if the user can upload a new version of this file. */ 052 @JsonProperty("can_upload") 053 protected final boolean canUpload; 054 055 /** Specifies if the user view all annotations placed on this file. */ 056 @JsonProperty("can_view_annotations_all") 057 protected final boolean canViewAnnotationsAll; 058 059 /** Specifies if the user view annotations placed by themselves on this file. */ 060 @JsonProperty("can_view_annotations_self") 061 protected final boolean canViewAnnotationsSelf; 062 063 /** Specifies if the user can apply a watermark to this file. */ 064 @JsonProperty("can_apply_watermark") 065 protected Boolean canApplyWatermark; 066 067 public FileFullPermissionsField( 068 @JsonProperty("can_delete") boolean canDelete, 069 @JsonProperty("can_download") boolean canDownload, 070 @JsonProperty("can_invite_collaborator") boolean canInviteCollaborator, 071 @JsonProperty("can_rename") boolean canRename, 072 @JsonProperty("can_set_share_access") boolean canSetShareAccess, 073 @JsonProperty("can_share") boolean canShare, 074 @JsonProperty("can_annotate") boolean canAnnotate, 075 @JsonProperty("can_comment") boolean canComment, 076 @JsonProperty("can_preview") boolean canPreview, 077 @JsonProperty("can_upload") boolean canUpload, 078 @JsonProperty("can_view_annotations_all") boolean canViewAnnotationsAll, 079 @JsonProperty("can_view_annotations_self") boolean canViewAnnotationsSelf) { 080 super(); 081 this.canDelete = canDelete; 082 this.canDownload = canDownload; 083 this.canInviteCollaborator = canInviteCollaborator; 084 this.canRename = canRename; 085 this.canSetShareAccess = canSetShareAccess; 086 this.canShare = canShare; 087 this.canAnnotate = canAnnotate; 088 this.canComment = canComment; 089 this.canPreview = canPreview; 090 this.canUpload = canUpload; 091 this.canViewAnnotationsAll = canViewAnnotationsAll; 092 this.canViewAnnotationsSelf = canViewAnnotationsSelf; 093 } 094 095 protected FileFullPermissionsField(Builder builder) { 096 super(); 097 this.canDelete = builder.canDelete; 098 this.canDownload = builder.canDownload; 099 this.canInviteCollaborator = builder.canInviteCollaborator; 100 this.canRename = builder.canRename; 101 this.canSetShareAccess = builder.canSetShareAccess; 102 this.canShare = builder.canShare; 103 this.canAnnotate = builder.canAnnotate; 104 this.canComment = builder.canComment; 105 this.canPreview = builder.canPreview; 106 this.canUpload = builder.canUpload; 107 this.canViewAnnotationsAll = builder.canViewAnnotationsAll; 108 this.canViewAnnotationsSelf = builder.canViewAnnotationsSelf; 109 this.canApplyWatermark = builder.canApplyWatermark; 110 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 111 } 112 113 public boolean getCanDelete() { 114 return canDelete; 115 } 116 117 public boolean getCanDownload() { 118 return canDownload; 119 } 120 121 public boolean getCanInviteCollaborator() { 122 return canInviteCollaborator; 123 } 124 125 public boolean getCanRename() { 126 return canRename; 127 } 128 129 public boolean getCanSetShareAccess() { 130 return canSetShareAccess; 131 } 132 133 public boolean getCanShare() { 134 return canShare; 135 } 136 137 public boolean getCanAnnotate() { 138 return canAnnotate; 139 } 140 141 public boolean getCanComment() { 142 return canComment; 143 } 144 145 public boolean getCanPreview() { 146 return canPreview; 147 } 148 149 public boolean getCanUpload() { 150 return canUpload; 151 } 152 153 public boolean getCanViewAnnotationsAll() { 154 return canViewAnnotationsAll; 155 } 156 157 public boolean getCanViewAnnotationsSelf() { 158 return canViewAnnotationsSelf; 159 } 160 161 public Boolean getCanApplyWatermark() { 162 return canApplyWatermark; 163 } 164 165 @Override 166 public boolean equals(Object o) { 167 if (this == o) { 168 return true; 169 } 170 if (o == null || getClass() != o.getClass()) { 171 return false; 172 } 173 FileFullPermissionsField casted = (FileFullPermissionsField) o; 174 return Objects.equals(canDelete, casted.canDelete) 175 && Objects.equals(canDownload, casted.canDownload) 176 && Objects.equals(canInviteCollaborator, casted.canInviteCollaborator) 177 && Objects.equals(canRename, casted.canRename) 178 && Objects.equals(canSetShareAccess, casted.canSetShareAccess) 179 && Objects.equals(canShare, casted.canShare) 180 && Objects.equals(canAnnotate, casted.canAnnotate) 181 && Objects.equals(canComment, casted.canComment) 182 && Objects.equals(canPreview, casted.canPreview) 183 && Objects.equals(canUpload, casted.canUpload) 184 && Objects.equals(canViewAnnotationsAll, casted.canViewAnnotationsAll) 185 && Objects.equals(canViewAnnotationsSelf, casted.canViewAnnotationsSelf) 186 && Objects.equals(canApplyWatermark, casted.canApplyWatermark); 187 } 188 189 @Override 190 public int hashCode() { 191 return Objects.hash( 192 canDelete, 193 canDownload, 194 canInviteCollaborator, 195 canRename, 196 canSetShareAccess, 197 canShare, 198 canAnnotate, 199 canComment, 200 canPreview, 201 canUpload, 202 canViewAnnotationsAll, 203 canViewAnnotationsSelf, 204 canApplyWatermark); 205 } 206 207 @Override 208 public String toString() { 209 return "FileFullPermissionsField{" 210 + "canDelete='" 211 + canDelete 212 + '\'' 213 + ", " 214 + "canDownload='" 215 + canDownload 216 + '\'' 217 + ", " 218 + "canInviteCollaborator='" 219 + canInviteCollaborator 220 + '\'' 221 + ", " 222 + "canRename='" 223 + canRename 224 + '\'' 225 + ", " 226 + "canSetShareAccess='" 227 + canSetShareAccess 228 + '\'' 229 + ", " 230 + "canShare='" 231 + canShare 232 + '\'' 233 + ", " 234 + "canAnnotate='" 235 + canAnnotate 236 + '\'' 237 + ", " 238 + "canComment='" 239 + canComment 240 + '\'' 241 + ", " 242 + "canPreview='" 243 + canPreview 244 + '\'' 245 + ", " 246 + "canUpload='" 247 + canUpload 248 + '\'' 249 + ", " 250 + "canViewAnnotationsAll='" 251 + canViewAnnotationsAll 252 + '\'' 253 + ", " 254 + "canViewAnnotationsSelf='" 255 + canViewAnnotationsSelf 256 + '\'' 257 + ", " 258 + "canApplyWatermark='" 259 + canApplyWatermark 260 + '\'' 261 + "}"; 262 } 263 264 public static class Builder extends NullableFieldTracker { 265 266 protected final boolean canDelete; 267 268 protected final boolean canDownload; 269 270 protected final boolean canInviteCollaborator; 271 272 protected final boolean canRename; 273 274 protected final boolean canSetShareAccess; 275 276 protected final boolean canShare; 277 278 protected final boolean canAnnotate; 279 280 protected final boolean canComment; 281 282 protected final boolean canPreview; 283 284 protected final boolean canUpload; 285 286 protected final boolean canViewAnnotationsAll; 287 288 protected final boolean canViewAnnotationsSelf; 289 290 protected Boolean canApplyWatermark; 291 292 public Builder( 293 boolean canDelete, 294 boolean canDownload, 295 boolean canInviteCollaborator, 296 boolean canRename, 297 boolean canSetShareAccess, 298 boolean canShare, 299 boolean canAnnotate, 300 boolean canComment, 301 boolean canPreview, 302 boolean canUpload, 303 boolean canViewAnnotationsAll, 304 boolean canViewAnnotationsSelf) { 305 super(); 306 this.canDelete = canDelete; 307 this.canDownload = canDownload; 308 this.canInviteCollaborator = canInviteCollaborator; 309 this.canRename = canRename; 310 this.canSetShareAccess = canSetShareAccess; 311 this.canShare = canShare; 312 this.canAnnotate = canAnnotate; 313 this.canComment = canComment; 314 this.canPreview = canPreview; 315 this.canUpload = canUpload; 316 this.canViewAnnotationsAll = canViewAnnotationsAll; 317 this.canViewAnnotationsSelf = canViewAnnotationsSelf; 318 } 319 320 public Builder canApplyWatermark(Boolean canApplyWatermark) { 321 this.canApplyWatermark = canApplyWatermark; 322 return this; 323 } 324 325 public FileFullPermissionsField build() { 326 return new FileFullPermissionsField(this); 327 } 328 } 329}