001package com.box.sdkgen.schemas.folderfull; 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 FolderFullPermissionsField 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 upload into this folder. */ 040 @JsonProperty("can_upload") 041 protected final boolean canUpload; 042 043 /** Specifies if the user can apply a watermark to this folder and its contents. */ 044 @JsonProperty("can_apply_watermark") 045 protected Boolean canApplyWatermark; 046 047 public FolderFullPermissionsField( 048 @JsonProperty("can_delete") boolean canDelete, 049 @JsonProperty("can_download") boolean canDownload, 050 @JsonProperty("can_invite_collaborator") boolean canInviteCollaborator, 051 @JsonProperty("can_rename") boolean canRename, 052 @JsonProperty("can_set_share_access") boolean canSetShareAccess, 053 @JsonProperty("can_share") boolean canShare, 054 @JsonProperty("can_upload") boolean canUpload) { 055 super(); 056 this.canDelete = canDelete; 057 this.canDownload = canDownload; 058 this.canInviteCollaborator = canInviteCollaborator; 059 this.canRename = canRename; 060 this.canSetShareAccess = canSetShareAccess; 061 this.canShare = canShare; 062 this.canUpload = canUpload; 063 } 064 065 protected FolderFullPermissionsField(Builder builder) { 066 super(); 067 this.canDelete = builder.canDelete; 068 this.canDownload = builder.canDownload; 069 this.canInviteCollaborator = builder.canInviteCollaborator; 070 this.canRename = builder.canRename; 071 this.canSetShareAccess = builder.canSetShareAccess; 072 this.canShare = builder.canShare; 073 this.canUpload = builder.canUpload; 074 this.canApplyWatermark = builder.canApplyWatermark; 075 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 076 } 077 078 public boolean getCanDelete() { 079 return canDelete; 080 } 081 082 public boolean getCanDownload() { 083 return canDownload; 084 } 085 086 public boolean getCanInviteCollaborator() { 087 return canInviteCollaborator; 088 } 089 090 public boolean getCanRename() { 091 return canRename; 092 } 093 094 public boolean getCanSetShareAccess() { 095 return canSetShareAccess; 096 } 097 098 public boolean getCanShare() { 099 return canShare; 100 } 101 102 public boolean getCanUpload() { 103 return canUpload; 104 } 105 106 public Boolean getCanApplyWatermark() { 107 return canApplyWatermark; 108 } 109 110 @Override 111 public boolean equals(Object o) { 112 if (this == o) { 113 return true; 114 } 115 if (o == null || getClass() != o.getClass()) { 116 return false; 117 } 118 FolderFullPermissionsField casted = (FolderFullPermissionsField) o; 119 return Objects.equals(canDelete, casted.canDelete) 120 && Objects.equals(canDownload, casted.canDownload) 121 && Objects.equals(canInviteCollaborator, casted.canInviteCollaborator) 122 && Objects.equals(canRename, casted.canRename) 123 && Objects.equals(canSetShareAccess, casted.canSetShareAccess) 124 && Objects.equals(canShare, casted.canShare) 125 && Objects.equals(canUpload, casted.canUpload) 126 && Objects.equals(canApplyWatermark, casted.canApplyWatermark); 127 } 128 129 @Override 130 public int hashCode() { 131 return Objects.hash( 132 canDelete, 133 canDownload, 134 canInviteCollaborator, 135 canRename, 136 canSetShareAccess, 137 canShare, 138 canUpload, 139 canApplyWatermark); 140 } 141 142 @Override 143 public String toString() { 144 return "FolderFullPermissionsField{" 145 + "canDelete='" 146 + canDelete 147 + '\'' 148 + ", " 149 + "canDownload='" 150 + canDownload 151 + '\'' 152 + ", " 153 + "canInviteCollaborator='" 154 + canInviteCollaborator 155 + '\'' 156 + ", " 157 + "canRename='" 158 + canRename 159 + '\'' 160 + ", " 161 + "canSetShareAccess='" 162 + canSetShareAccess 163 + '\'' 164 + ", " 165 + "canShare='" 166 + canShare 167 + '\'' 168 + ", " 169 + "canUpload='" 170 + canUpload 171 + '\'' 172 + ", " 173 + "canApplyWatermark='" 174 + canApplyWatermark 175 + '\'' 176 + "}"; 177 } 178 179 public static class Builder extends NullableFieldTracker { 180 181 protected final boolean canDelete; 182 183 protected final boolean canDownload; 184 185 protected final boolean canInviteCollaborator; 186 187 protected final boolean canRename; 188 189 protected final boolean canSetShareAccess; 190 191 protected final boolean canShare; 192 193 protected final boolean canUpload; 194 195 protected Boolean canApplyWatermark; 196 197 public Builder( 198 boolean canDelete, 199 boolean canDownload, 200 boolean canInviteCollaborator, 201 boolean canRename, 202 boolean canSetShareAccess, 203 boolean canShare, 204 boolean canUpload) { 205 super(); 206 this.canDelete = canDelete; 207 this.canDownload = canDownload; 208 this.canInviteCollaborator = canInviteCollaborator; 209 this.canRename = canRename; 210 this.canSetShareAccess = canSetShareAccess; 211 this.canShare = canShare; 212 this.canUpload = canUpload; 213 } 214 215 public Builder canApplyWatermark(Boolean canApplyWatermark) { 216 this.canApplyWatermark = canApplyWatermark; 217 return this; 218 } 219 220 public FolderFullPermissionsField build() { 221 return new FolderFullPermissionsField(this); 222 } 223 } 224}