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

box / box-java-sdk / #5922

17 Dec 2025 05:03PM UTC coverage: 35.498% (-0.4%) from 35.917%
#5922

push

github

web-flow
fix: add taxonomy to Metadata Field (read) definition (box/box-openapi#572) (#1644)

Co-authored-by: box-sdk-build <box-sdk-build@box.com>

2 of 2 new or added lines in 1 file covered. (100.0%)

535 existing lines in 31 files now uncovered.

18926 of 53316 relevant lines covered (35.5%)

0.35 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 an owner or co-owners can invite collaborators with a `can_view_path` of `true`. Only
53
   * an owner can update `can_view_path` on existing collaborations.
54
   *
55
   * <p>`can_view_path` can only be used for folder collaborations.
56
   *
57
   * <p>When you delete a folder with `can_view_path=true`, collaborators may still see the parent
58
   * path. For instructions on how to remove this, see [Even though a folder invited via
59
   * can_view_path is deleted, the path remains
60
   * displayed](https://support.box.com/hc/en-us/articles/37472814319891-Even-though-a-folder-invited-via-can-view-path-is-deleted-the-path-remains-displayed).
61
   */
62
  @JsonProperty("can_view_path")
63
  protected Boolean canViewPath;
64

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

79
  public CreateCollaborationRequestBody(
80
      CreateCollaborationRequestBodyItemField item,
81
      CreateCollaborationRequestBodyAccessibleByField accessibleBy,
82
      CreateCollaborationRequestBodyRoleField role) {
83
    super();
1✔
84
    this.item = item;
1✔
85
    this.accessibleBy = accessibleBy;
1✔
86
    this.role = new EnumWrapper<CreateCollaborationRequestBodyRoleField>(role);
1✔
87
  }
1✔
88

89
  public CreateCollaborationRequestBody(
90
      @JsonProperty("item") CreateCollaborationRequestBodyItemField item,
91
      @JsonProperty("accessible_by") CreateCollaborationRequestBodyAccessibleByField accessibleBy,
92
      @JsonProperty("role") EnumWrapper<CreateCollaborationRequestBodyRoleField> role) {
UNCOV
93
    super();
×
UNCOV
94
    this.item = item;
×
95
    this.accessibleBy = accessibleBy;
×
96
    this.role = role;
×
97
  }
×
98

99
  protected CreateCollaborationRequestBody(Builder builder) {
100
    super();
×
101
    this.item = builder.item;
×
102
    this.accessibleBy = builder.accessibleBy;
×
103
    this.role = builder.role;
×
UNCOV
104
    this.isAccessOnly = builder.isAccessOnly;
×
UNCOV
105
    this.canViewPath = builder.canViewPath;
×
UNCOV
106
    this.expiresAt = builder.expiresAt;
×
UNCOV
107
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
UNCOV
108
  }
×
109

110
  public CreateCollaborationRequestBodyItemField getItem() {
111
    return item;
1✔
112
  }
113

114
  public CreateCollaborationRequestBodyAccessibleByField getAccessibleBy() {
115
    return accessibleBy;
1✔
116
  }
117

118
  public EnumWrapper<CreateCollaborationRequestBodyRoleField> getRole() {
119
    return role;
1✔
120
  }
121

122
  public Boolean getIsAccessOnly() {
123
    return isAccessOnly;
1✔
124
  }
125

126
  public Boolean getCanViewPath() {
127
    return canViewPath;
1✔
128
  }
129

130
  public OffsetDateTime getExpiresAt() {
131
    return expiresAt;
1✔
132
  }
133

134
  @Override
135
  public boolean equals(Object o) {
UNCOV
136
    if (this == o) {
×
137
      return true;
×
138
    }
139
    if (o == null || getClass() != o.getClass()) {
×
140
      return false;
×
141
    }
142
    CreateCollaborationRequestBody casted = (CreateCollaborationRequestBody) o;
×
143
    return Objects.equals(item, casted.item)
×
UNCOV
144
        && Objects.equals(accessibleBy, casted.accessibleBy)
×
UNCOV
145
        && Objects.equals(role, casted.role)
×
UNCOV
146
        && Objects.equals(isAccessOnly, casted.isAccessOnly)
×
UNCOV
147
        && Objects.equals(canViewPath, casted.canViewPath)
×
148
        && Objects.equals(expiresAt, casted.expiresAt);
×
149
  }
150

151
  @Override
152
  public int hashCode() {
153
    return Objects.hash(item, accessibleBy, role, isAccessOnly, canViewPath, expiresAt);
×
154
  }
155

156
  @Override
157
  public String toString() {
UNCOV
158
    return "CreateCollaborationRequestBody{"
×
159
        + "item='"
160
        + item
161
        + '\''
162
        + ", "
163
        + "accessibleBy='"
164
        + accessibleBy
165
        + '\''
166
        + ", "
167
        + "role='"
168
        + role
169
        + '\''
170
        + ", "
171
        + "isAccessOnly='"
172
        + isAccessOnly
173
        + '\''
174
        + ", "
175
        + "canViewPath='"
176
        + canViewPath
177
        + '\''
178
        + ", "
179
        + "expiresAt='"
180
        + expiresAt
181
        + '\''
182
        + "}";
183
  }
184

185
  public static class Builder extends NullableFieldTracker {
186

187
    protected final CreateCollaborationRequestBodyItemField item;
188

189
    protected final CreateCollaborationRequestBodyAccessibleByField accessibleBy;
190

191
    protected final EnumWrapper<CreateCollaborationRequestBodyRoleField> role;
192

193
    protected Boolean isAccessOnly;
194

195
    protected Boolean canViewPath;
196

197
    protected OffsetDateTime expiresAt;
198

199
    public Builder(
200
        CreateCollaborationRequestBodyItemField item,
201
        CreateCollaborationRequestBodyAccessibleByField accessibleBy,
202
        CreateCollaborationRequestBodyRoleField role) {
UNCOV
203
      super();
×
UNCOV
204
      this.item = item;
×
UNCOV
205
      this.accessibleBy = accessibleBy;
×
UNCOV
206
      this.role = new EnumWrapper<CreateCollaborationRequestBodyRoleField>(role);
×
UNCOV
207
    }
×
208

209
    public Builder(
210
        CreateCollaborationRequestBodyItemField item,
211
        CreateCollaborationRequestBodyAccessibleByField accessibleBy,
212
        EnumWrapper<CreateCollaborationRequestBodyRoleField> role) {
UNCOV
213
      super();
×
UNCOV
214
      this.item = item;
×
215
      this.accessibleBy = accessibleBy;
×
216
      this.role = role;
×
UNCOV
217
    }
×
218

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

224
    public Builder canViewPath(Boolean canViewPath) {
225
      this.canViewPath = canViewPath;
×
226
      return this;
×
227
    }
228

229
    public Builder expiresAt(OffsetDateTime expiresAt) {
230
      this.expiresAt = expiresAt;
×
UNCOV
231
      return this;
×
232
    }
233

234
    public CreateCollaborationRequestBody build() {
UNCOV
235
      return new CreateCollaborationRequestBody(this);
×
236
    }
237
  }
238
}
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

© 2025 Coveralls, Inc