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

box / box-java-sdk / #5027

03 Oct 2025 09:45AM UTC coverage: 13.656% (-0.008%) from 13.664%
#5027

Pull #1478

github

web-flow
Merge 7e3e09ba8 into ac7d3d5fe
Pull Request #1478: fix: Make `role` parameter of update collaboration optional (box/box-openapi#557)

0 of 4 new or added lines in 2 files covered. (0.0%)

15 existing lines in 9 files now uncovered.

8368 of 61275 relevant lines covered (13.66%)

0.14 hits per line

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

0.0
/src/main/java/com/box/sdkgen/managers/usercollaborations/UpdateCollaborationByIdRequestBody.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 UpdateCollaborationByIdRequestBody extends SerializableObject {
16

17
  /** The level of access granted. */
18
  @JsonDeserialize(
19
      using =
20
          UpdateCollaborationByIdRequestBodyRoleField
21
              .UpdateCollaborationByIdRequestBodyRoleFieldDeserializer.class)
22
  @JsonSerialize(
23
      using =
24
          UpdateCollaborationByIdRequestBodyRoleField
25
              .UpdateCollaborationByIdRequestBodyRoleFieldSerializer.class)
26
  protected EnumWrapper<UpdateCollaborationByIdRequestBodyRoleField> role;
27

28
  /**
29
   * Set the status of a `pending` collaboration invitation, effectively accepting, or rejecting the
30
   * invite.
31
   */
32
  @JsonDeserialize(
33
      using =
34
          UpdateCollaborationByIdRequestBodyStatusField
35
              .UpdateCollaborationByIdRequestBodyStatusFieldDeserializer.class)
36
  @JsonSerialize(
37
      using =
38
          UpdateCollaborationByIdRequestBodyStatusField
39
              .UpdateCollaborationByIdRequestBodyStatusFieldSerializer.class)
40
  protected EnumWrapper<UpdateCollaborationByIdRequestBodyStatusField> status;
41

42
  /**
43
   * Update the expiration date for the collaboration. At this date, the collaboration will be
44
   * automatically removed from the item.
45
   *
46
   * <p>This feature will only work if the **Automatically remove invited collaborators: Allow
47
   * folder owners to extend the expiry date** setting has been enabled in the **Enterprise
48
   * Settings** of the **Admin Console**. When the setting is not enabled, collaborations can not
49
   * have an expiry date and a value for this field will be result in an error.
50
   *
51
   * <p>Additionally, a collaboration can only be given an expiration if it was created after the
52
   * **Automatically remove invited collaborator** setting was enabled.
53
   */
54
  @JsonProperty("expires_at")
55
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
56
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
57
  protected OffsetDateTime expiresAt;
58

59
  /**
60
   * Determines if the invited users can see the entire parent path to the associated folder. The
61
   * user will not gain privileges in any parent folder and therefore can not see content the user
62
   * is not collaborated on.
63
   *
64
   * <p>Be aware that this meaningfully increases the time required to load the invitee's **All
65
   * Files** page. We recommend you limit the number of collaborations with `can_view_path` enabled
66
   * to 1,000 per user.
67
   *
68
   * <p>Only owner or co-owners can invite collaborators with a `can_view_path` of `true`.
69
   *
70
   * <p>`can_view_path` can only be used for folder collaborations.
71
   */
72
  @JsonProperty("can_view_path")
73
  protected Boolean canViewPath;
74

75
  public UpdateCollaborationByIdRequestBody() {
76
    super();
×
77
  }
×
78

79
  protected UpdateCollaborationByIdRequestBody(Builder builder) {
80
    super();
×
81
    this.role = builder.role;
×
82
    this.status = builder.status;
×
83
    this.expiresAt = builder.expiresAt;
×
84
    this.canViewPath = builder.canViewPath;
×
85
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
86
  }
×
87

88
  public EnumWrapper<UpdateCollaborationByIdRequestBodyRoleField> getRole() {
89
    return role;
×
90
  }
91

92
  public EnumWrapper<UpdateCollaborationByIdRequestBodyStatusField> getStatus() {
93
    return status;
×
94
  }
95

96
  public OffsetDateTime getExpiresAt() {
97
    return expiresAt;
×
98
  }
99

100
  public Boolean getCanViewPath() {
101
    return canViewPath;
×
102
  }
103

104
  @Override
105
  public boolean equals(Object o) {
106
    if (this == o) {
×
107
      return true;
×
108
    }
109
    if (o == null || getClass() != o.getClass()) {
×
110
      return false;
×
111
    }
112
    UpdateCollaborationByIdRequestBody casted = (UpdateCollaborationByIdRequestBody) o;
×
113
    return Objects.equals(role, casted.role)
×
114
        && Objects.equals(status, casted.status)
×
115
        && Objects.equals(expiresAt, casted.expiresAt)
×
116
        && Objects.equals(canViewPath, casted.canViewPath);
×
117
  }
118

119
  @Override
120
  public int hashCode() {
121
    return Objects.hash(role, status, expiresAt, canViewPath);
×
122
  }
123

124
  @Override
125
  public String toString() {
126
    return "UpdateCollaborationByIdRequestBody{"
×
127
        + "role='"
128
        + role
129
        + '\''
130
        + ", "
131
        + "status='"
132
        + status
133
        + '\''
134
        + ", "
135
        + "expiresAt='"
136
        + expiresAt
137
        + '\''
138
        + ", "
139
        + "canViewPath='"
140
        + canViewPath
141
        + '\''
142
        + "}";
143
  }
144

UNCOV
145
  public static class Builder extends NullableFieldTracker {
×
146

147
    protected EnumWrapper<UpdateCollaborationByIdRequestBodyRoleField> role;
148

149
    protected EnumWrapper<UpdateCollaborationByIdRequestBodyStatusField> status;
150

151
    protected OffsetDateTime expiresAt;
152

153
    protected Boolean canViewPath;
154

155
    public Builder role(UpdateCollaborationByIdRequestBodyRoleField role) {
156
      this.role = new EnumWrapper<UpdateCollaborationByIdRequestBodyRoleField>(role);
×
NEW
157
      return this;
×
158
    }
159

160
    public Builder role(EnumWrapper<UpdateCollaborationByIdRequestBodyRoleField> role) {
161
      this.role = role;
×
NEW
162
      return this;
×
163
    }
164

165
    public Builder status(UpdateCollaborationByIdRequestBodyStatusField status) {
166
      this.status = new EnumWrapper<UpdateCollaborationByIdRequestBodyStatusField>(status);
×
167
      return this;
×
168
    }
169

170
    public Builder status(EnumWrapper<UpdateCollaborationByIdRequestBodyStatusField> status) {
171
      this.status = status;
×
172
      return this;
×
173
    }
174

175
    public Builder expiresAt(OffsetDateTime expiresAt) {
176
      this.expiresAt = expiresAt;
×
177
      return this;
×
178
    }
179

180
    public Builder canViewPath(Boolean canViewPath) {
181
      this.canViewPath = canViewPath;
×
182
      return this;
×
183
    }
184

185
    public UpdateCollaborationByIdRequestBody build() {
186
      return new UpdateCollaborationByIdRequestBody(this);
×
187
    }
188
  }
189
}
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