• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

box / box-java-sdk / #5076

07 Oct 2025 12:35PM UTC coverage: 37.132% (+0.007%) from 37.125%
#5076

push

github

web-flow
test: Change `Event.additionalDetails` field assertion in events test (box/box-codegen#858) (#1491)

18454 of 49699 relevant lines covered (37.13%)

0.37 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

20.0
/src/main/java/com/box/sdkgen/managers/usercollaborations/CreateCollaborationRequestBody.java
1
package com.box.sdkgen.managers.usercollaborations;
2

3
import com.box.sdkgen.internal.NullableFieldTracker;
4
import com.box.sdkgen.internal.SerializableObject;
5
import com.box.sdkgen.internal.utils.DateTimeUtils;
6
import com.box.sdkgen.serialization.json.EnumWrapper;
7
import com.fasterxml.jackson.annotation.JsonFilter;
8
import com.fasterxml.jackson.annotation.JsonProperty;
9
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
10
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
11
import java.time.OffsetDateTime;
12
import java.util.Objects;
13

14
@JsonFilter("nullablePropertyFilter")
15
public class CreateCollaborationRequestBody extends SerializableObject {
16

17
  /** The item to attach the comment to. */
18
  protected final CreateCollaborationRequestBodyItemField item;
19

20
  /** The user or group to give access to the item. */
21
  @JsonProperty("accessible_by")
22
  protected final CreateCollaborationRequestBodyAccessibleByField accessibleBy;
23

24
  /** The level of access granted. */
25
  @JsonDeserialize(
26
      using =
27
          CreateCollaborationRequestBodyRoleField
28
              .CreateCollaborationRequestBodyRoleFieldDeserializer.class)
29
  @JsonSerialize(
30
      using =
31
          CreateCollaborationRequestBodyRoleField.CreateCollaborationRequestBodyRoleFieldSerializer
32
              .class)
33
  protected final EnumWrapper<CreateCollaborationRequestBodyRoleField> role;
34

35
  /**
36
   * If set to `true`, collaborators have access to shared items, but such items won't be visible in
37
   * the All Files list. Additionally, collaborators won't see the path to the root folder for the
38
   * shared item.
39
   */
40
  @JsonProperty("is_access_only")
41
  protected Boolean isAccessOnly;
42

43
  /**
44
   * Determines if the invited users can see the entire parent path to the associated folder. The
45
   * user will not gain privileges in any parent folder and therefore can not see content the user
46
   * is not collaborated on.
47
   *
48
   * <p>Be aware that this meaningfully increases the time required to load the invitee's **All
49
   * Files** page. We recommend you limit the number of collaborations with `can_view_path` enabled
50
   * to 1,000 per user.
51
   *
52
   * <p>Only owner or co-owners can invite collaborators with a `can_view_path` of `true`.
53
   *
54
   * <p>`can_view_path` can only be used for folder collaborations.
55
   */
56
  @JsonProperty("can_view_path")
57
  protected Boolean canViewPath;
58

59
  /**
60
   * Set the expiration date for the collaboration. At this date, the collaboration will be
61
   * automatically removed from the item.
62
   *
63
   * <p>This feature will only work if the **Automatically remove invited collaborators: Allow
64
   * folder owners to extend the expiry date** setting has been enabled in the **Enterprise
65
   * Settings** of the **Admin Console**. When the setting is not enabled, collaborations can not
66
   * have an expiry date and a value for this field will be result in an error.
67
   */
68
  @JsonProperty("expires_at")
69
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
70
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
71
  protected OffsetDateTime expiresAt;
72

73
  public CreateCollaborationRequestBody(
74
      CreateCollaborationRequestBodyItemField item,
75
      CreateCollaborationRequestBodyAccessibleByField accessibleBy,
76
      CreateCollaborationRequestBodyRoleField role) {
77
    super();
1✔
78
    this.item = item;
1✔
79
    this.accessibleBy = accessibleBy;
1✔
80
    this.role = new EnumWrapper<CreateCollaborationRequestBodyRoleField>(role);
1✔
81
  }
1✔
82

83
  public CreateCollaborationRequestBody(
84
      @JsonProperty("item") CreateCollaborationRequestBodyItemField item,
85
      @JsonProperty("accessible_by") CreateCollaborationRequestBodyAccessibleByField accessibleBy,
86
      @JsonProperty("role") EnumWrapper<CreateCollaborationRequestBodyRoleField> role) {
87
    super();
×
88
    this.item = item;
×
89
    this.accessibleBy = accessibleBy;
×
90
    this.role = role;
×
91
  }
×
92

93
  protected CreateCollaborationRequestBody(Builder builder) {
94
    super();
×
95
    this.item = builder.item;
×
96
    this.accessibleBy = builder.accessibleBy;
×
97
    this.role = builder.role;
×
98
    this.isAccessOnly = builder.isAccessOnly;
×
99
    this.canViewPath = builder.canViewPath;
×
100
    this.expiresAt = builder.expiresAt;
×
101
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
102
  }
×
103

104
  public CreateCollaborationRequestBodyItemField getItem() {
105
    return item;
1✔
106
  }
107

108
  public CreateCollaborationRequestBodyAccessibleByField getAccessibleBy() {
109
    return accessibleBy;
1✔
110
  }
111

112
  public EnumWrapper<CreateCollaborationRequestBodyRoleField> getRole() {
113
    return role;
1✔
114
  }
115

116
  public Boolean getIsAccessOnly() {
117
    return isAccessOnly;
1✔
118
  }
119

120
  public Boolean getCanViewPath() {
121
    return canViewPath;
1✔
122
  }
123

124
  public OffsetDateTime getExpiresAt() {
125
    return expiresAt;
1✔
126
  }
127

128
  @Override
129
  public boolean equals(Object o) {
130
    if (this == o) {
×
131
      return true;
×
132
    }
133
    if (o == null || getClass() != o.getClass()) {
×
134
      return false;
×
135
    }
136
    CreateCollaborationRequestBody casted = (CreateCollaborationRequestBody) o;
×
137
    return Objects.equals(item, casted.item)
×
138
        && Objects.equals(accessibleBy, casted.accessibleBy)
×
139
        && Objects.equals(role, casted.role)
×
140
        && Objects.equals(isAccessOnly, casted.isAccessOnly)
×
141
        && Objects.equals(canViewPath, casted.canViewPath)
×
142
        && Objects.equals(expiresAt, casted.expiresAt);
×
143
  }
144

145
  @Override
146
  public int hashCode() {
147
    return Objects.hash(item, accessibleBy, role, isAccessOnly, canViewPath, expiresAt);
×
148
  }
149

150
  @Override
151
  public String toString() {
152
    return "CreateCollaborationRequestBody{"
×
153
        + "item='"
154
        + item
155
        + '\''
156
        + ", "
157
        + "accessibleBy='"
158
        + accessibleBy
159
        + '\''
160
        + ", "
161
        + "role='"
162
        + role
163
        + '\''
164
        + ", "
165
        + "isAccessOnly='"
166
        + isAccessOnly
167
        + '\''
168
        + ", "
169
        + "canViewPath='"
170
        + canViewPath
171
        + '\''
172
        + ", "
173
        + "expiresAt='"
174
        + expiresAt
175
        + '\''
176
        + "}";
177
  }
178

179
  public static class Builder extends NullableFieldTracker {
180

181
    protected final CreateCollaborationRequestBodyItemField item;
182

183
    protected final CreateCollaborationRequestBodyAccessibleByField accessibleBy;
184

185
    protected final EnumWrapper<CreateCollaborationRequestBodyRoleField> role;
186

187
    protected Boolean isAccessOnly;
188

189
    protected Boolean canViewPath;
190

191
    protected OffsetDateTime expiresAt;
192

193
    public Builder(
194
        CreateCollaborationRequestBodyItemField item,
195
        CreateCollaborationRequestBodyAccessibleByField accessibleBy,
196
        CreateCollaborationRequestBodyRoleField role) {
197
      super();
×
198
      this.item = item;
×
199
      this.accessibleBy = accessibleBy;
×
200
      this.role = new EnumWrapper<CreateCollaborationRequestBodyRoleField>(role);
×
201
    }
×
202

203
    public Builder(
204
        CreateCollaborationRequestBodyItemField item,
205
        CreateCollaborationRequestBodyAccessibleByField accessibleBy,
206
        EnumWrapper<CreateCollaborationRequestBodyRoleField> role) {
207
      super();
×
208
      this.item = item;
×
209
      this.accessibleBy = accessibleBy;
×
210
      this.role = role;
×
211
    }
×
212

213
    public Builder isAccessOnly(Boolean isAccessOnly) {
214
      this.isAccessOnly = isAccessOnly;
×
215
      return this;
×
216
    }
217

218
    public Builder canViewPath(Boolean canViewPath) {
219
      this.canViewPath = canViewPath;
×
220
      return this;
×
221
    }
222

223
    public Builder expiresAt(OffsetDateTime expiresAt) {
224
      this.expiresAt = expiresAt;
×
225
      return this;
×
226
    }
227

228
    public CreateCollaborationRequestBody build() {
229
      return new CreateCollaborationRequestBody(this);
×
230
    }
231
  }
232
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc