diff --git a/.codegen.json b/.codegen.json index e4c02459e..791894b01 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "0068c55", "specHash": "33e4656", "version": "5.20.0" } +{ "engineHash": "a327523", "specHash": "0451786", "version": "5.20.0" } diff --git a/docs/sdkgen/invites.md b/docs/sdkgen/invites.md index e1a89b263..1cf175428 100644 --- a/docs/sdkgen/invites.md +++ b/docs/sdkgen/invites.md @@ -8,10 +8,16 @@ Invites an existing external user to join an enterprise. -The existing user can not be part of another enterprise and -must already have a Box account. Once invited, the user will receive an -email and are prompted to accept the invitation within the -Box web application. +The user must already have a Box account and cannot be +part of another enterprise. Once invited, the user receives +an email and is prompted to accept the invitation in +the Box web application. + +If `is_auto_roll_in_enabled` is set to `true`, the user does not have to +accept the invitation and is added to the enterprise automatically after +14 days. Only unmanaged users can be invited this way. An unmanaged user +is a free user whose email domain matches one of the enterprise's +domains. Availability depends on the enterprise's plan. This method requires the "Manage An Enterprise" scope enabled for the application, which can be enabled within the developer console. diff --git a/src/main/java/com/box/sdkgen/managers/invites/CreateInviteRequestBody.java b/src/main/java/com/box/sdkgen/managers/invites/CreateInviteRequestBody.java index 1cdda2a70..226a4c2f8 100644 --- a/src/main/java/com/box/sdkgen/managers/invites/CreateInviteRequestBody.java +++ b/src/main/java/com/box/sdkgen/managers/invites/CreateInviteRequestBody.java @@ -1,5 +1,6 @@ package com.box.sdkgen.managers.invites; +import com.box.sdkgen.internal.NullableFieldTracker; import com.box.sdkgen.internal.SerializableObject; import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonProperty; @@ -15,6 +16,14 @@ public class CreateInviteRequestBody extends SerializableObject { @JsonProperty("actionable_by") protected final CreateInviteRequestBodyActionableByField actionableBy; + /** + * If set to `true`, the user is added to the enterprise automatically after 14 days instead of + * having to accept the invite. Only unmanaged users can be invited this way. Availability depends + * on the enterprise's plan. + */ + @JsonProperty("is_auto_roll_in_enabled") + protected Boolean isAutoRollInEnabled; + public CreateInviteRequestBody( @JsonProperty("enterprise") CreateInviteRequestBodyEnterpriseField enterprise, @JsonProperty("actionable_by") CreateInviteRequestBodyActionableByField actionableBy) { @@ -23,6 +32,14 @@ public CreateInviteRequestBody( this.actionableBy = actionableBy; } + protected CreateInviteRequestBody(Builder builder) { + super(); + this.enterprise = builder.enterprise; + this.actionableBy = builder.actionableBy; + this.isAutoRollInEnabled = builder.isAutoRollInEnabled; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + public CreateInviteRequestBodyEnterpriseField getEnterprise() { return enterprise; } @@ -31,6 +48,10 @@ public CreateInviteRequestBodyActionableByField getActionableBy() { return actionableBy; } + public Boolean getIsAutoRollInEnabled() { + return isAutoRollInEnabled; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -41,12 +62,13 @@ public boolean equals(Object o) { } CreateInviteRequestBody casted = (CreateInviteRequestBody) o; return Objects.equals(enterprise, casted.enterprise) - && Objects.equals(actionableBy, casted.actionableBy); + && Objects.equals(actionableBy, casted.actionableBy) + && Objects.equals(isAutoRollInEnabled, casted.isAutoRollInEnabled); } @Override public int hashCode() { - return Objects.hash(enterprise, actionableBy); + return Objects.hash(enterprise, actionableBy, isAutoRollInEnabled); } @Override @@ -59,6 +81,36 @@ public String toString() { + "actionableBy='" + actionableBy + '\'' + + ", " + + "isAutoRollInEnabled='" + + isAutoRollInEnabled + + '\'' + "}"; } + + public static class Builder extends NullableFieldTracker { + + protected final CreateInviteRequestBodyEnterpriseField enterprise; + + protected final CreateInviteRequestBodyActionableByField actionableBy; + + protected Boolean isAutoRollInEnabled; + + public Builder( + CreateInviteRequestBodyEnterpriseField enterprise, + CreateInviteRequestBodyActionableByField actionableBy) { + super(); + this.enterprise = enterprise; + this.actionableBy = actionableBy; + } + + public Builder isAutoRollInEnabled(Boolean isAutoRollInEnabled) { + this.isAutoRollInEnabled = isAutoRollInEnabled; + return this; + } + + public CreateInviteRequestBody build() { + return new CreateInviteRequestBody(this); + } + } } diff --git a/src/main/java/com/box/sdkgen/managers/invites/InvitesManager.java b/src/main/java/com/box/sdkgen/managers/invites/InvitesManager.java index 12f316ed3..40cae735d 100644 --- a/src/main/java/com/box/sdkgen/managers/invites/InvitesManager.java +++ b/src/main/java/com/box/sdkgen/managers/invites/InvitesManager.java @@ -33,9 +33,14 @@ protected InvitesManager(Builder builder) { /** * Invites an existing external user to join an enterprise. * - *
The existing user can not be part of another enterprise and must already have a Box account. - * Once invited, the user will receive an email and are prompted to accept the invitation within - * the Box web application. + *
The user must already have a Box account and cannot be part of another enterprise. Once + * invited, the user receives an email and is prompted to accept the invitation in the Box web + * application. + * + *
If `is_auto_roll_in_enabled` is set to `true`, the user does not have to accept the + * invitation and is added to the enterprise automatically after 14 days. Only unmanaged users can + * be invited this way. An unmanaged user is a free user whose email domain matches one of the + * enterprise's domains. Availability depends on the enterprise's plan. * *
This method requires the "Manage An Enterprise" scope enabled for the application, which can * be enabled within the developer console. @@ -49,9 +54,14 @@ public Invite createInvite(CreateInviteRequestBody requestBody) { /** * Invites an existing external user to join an enterprise. * - *
The existing user can not be part of another enterprise and must already have a Box account. - * Once invited, the user will receive an email and are prompted to accept the invitation within - * the Box web application. + *
The user must already have a Box account and cannot be part of another enterprise. Once + * invited, the user receives an email and is prompted to accept the invitation in the Box web + * application. + * + *
If `is_auto_roll_in_enabled` is set to `true`, the user does not have to accept the + * invitation and is added to the enterprise automatically after 14 days. Only unmanaged users can + * be invited this way. An unmanaged user is a free user whose email domain matches one of the + * enterprise's domains. Availability depends on the enterprise's plan. * *
This method requires the "Manage An Enterprise" scope enabled for the application, which can * be enabled within the developer console. @@ -67,9 +77,14 @@ public Invite createInvite( /** * Invites an existing external user to join an enterprise. * - *
The existing user can not be part of another enterprise and must already have a Box account. - * Once invited, the user will receive an email and are prompted to accept the invitation within - * the Box web application. + *
The user must already have a Box account and cannot be part of another enterprise. Once + * invited, the user receives an email and is prompted to accept the invitation in the Box web + * application. + * + *
If `is_auto_roll_in_enabled` is set to `true`, the user does not have to accept the + * invitation and is added to the enterprise automatically after 14 days. Only unmanaged users can + * be invited this way. An unmanaged user is a free user whose email domain matches one of the + * enterprise's domains. Availability depends on the enterprise's plan. * *
This method requires the "Manage An Enterprise" scope enabled for the application, which can * be enabled within the developer console. @@ -84,9 +99,14 @@ public Invite createInvite(CreateInviteRequestBody requestBody, CreateInviteHead /** * Invites an existing external user to join an enterprise. * - *
The existing user can not be part of another enterprise and must already have a Box account. - * Once invited, the user will receive an email and are prompted to accept the invitation within - * the Box web application. + *
The user must already have a Box account and cannot be part of another enterprise. Once + * invited, the user receives an email and is prompted to accept the invitation in the Box web + * application. + * + *
If `is_auto_roll_in_enabled` is set to `true`, the user does not have to accept the + * invitation and is added to the enterprise automatically after 14 days. Only unmanaged users can + * be invited this way. An unmanaged user is a free user whose email domain matches one of the + * enterprise's domains. Availability depends on the enterprise's plan. * *
This method requires the "Manage An Enterprise" scope enabled for the application, which can
* be enabled within the developer console.
diff --git a/src/main/java/com/box/sdkgen/schemas/invite/Invite.java b/src/main/java/com/box/sdkgen/schemas/invite/Invite.java
index 69bd38661..3b1db224b 100644
--- a/src/main/java/com/box/sdkgen/schemas/invite/Invite.java
+++ b/src/main/java/com/box/sdkgen/schemas/invite/Invite.java
@@ -1,5 +1,6 @@
package com.box.sdkgen.schemas.invite;
+import com.box.sdkgen.internal.Nullable;
import com.box.sdkgen.internal.NullableFieldTracker;
import com.box.sdkgen.internal.SerializableObject;
import com.box.sdkgen.internal.utils.DateTimeUtils;
@@ -49,6 +50,23 @@ public class Invite extends SerializableObject {
@JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
protected OffsetDateTime modifiedAt;
+ /**
+ * The date and time when the user is added to the enterprise automatically, or `null` if the user
+ * has to accept the invite.
+ */
+ @JsonProperty("auto_roll_in_at")
+ @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
+ @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
+ @Nullable
+ protected OffsetDateTime autoRollInAt;
+
+ /**
+ * Whether the user is added to the enterprise automatically, without having to accept the invite.
+ * When `true`, `auto_roll_in_at` contains the date and time of the roll-in.
+ */
+ @JsonProperty("is_auto_roll_in")
+ protected Boolean isAutoRollIn;
+
public Invite(@JsonProperty("id") String id) {
super();
this.id = id;
@@ -65,6 +83,8 @@ protected Invite(Builder builder) {
this.status = builder.status;
this.createdAt = builder.createdAt;
this.modifiedAt = builder.modifiedAt;
+ this.autoRollInAt = builder.autoRollInAt;
+ this.isAutoRollIn = builder.isAutoRollIn;
markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
}
@@ -100,6 +120,14 @@ public OffsetDateTime getModifiedAt() {
return modifiedAt;
}
+ public OffsetDateTime getAutoRollInAt() {
+ return autoRollInAt;
+ }
+
+ public Boolean getIsAutoRollIn() {
+ return isAutoRollIn;
+ }
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -116,13 +144,24 @@ public boolean equals(Object o) {
&& Objects.equals(invitedBy, casted.invitedBy)
&& Objects.equals(status, casted.status)
&& Objects.equals(createdAt, casted.createdAt)
- && Objects.equals(modifiedAt, casted.modifiedAt);
+ && Objects.equals(modifiedAt, casted.modifiedAt)
+ && Objects.equals(autoRollInAt, casted.autoRollInAt)
+ && Objects.equals(isAutoRollIn, casted.isAutoRollIn);
}
@Override
public int hashCode() {
return Objects.hash(
- id, type, invitedTo, actionableBy, invitedBy, status, createdAt, modifiedAt);
+ id,
+ type,
+ invitedTo,
+ actionableBy,
+ invitedBy,
+ status,
+ createdAt,
+ modifiedAt,
+ autoRollInAt,
+ isAutoRollIn);
}
@Override
@@ -159,6 +198,14 @@ public String toString() {
+ "modifiedAt='"
+ modifiedAt
+ '\''
+ + ", "
+ + "autoRollInAt='"
+ + autoRollInAt
+ + '\''
+ + ", "
+ + "isAutoRollIn='"
+ + isAutoRollIn
+ + '\''
+ "}";
}
@@ -180,6 +227,10 @@ public static class Builder extends NullableFieldTracker {
protected OffsetDateTime modifiedAt;
+ protected OffsetDateTime autoRollInAt;
+
+ protected Boolean isAutoRollIn;
+
public Builder(String id) {
super();
this.id = id;
@@ -225,6 +276,17 @@ public Builder modifiedAt(OffsetDateTime modifiedAt) {
return this;
}
+ public Builder autoRollInAt(OffsetDateTime autoRollInAt) {
+ this.autoRollInAt = autoRollInAt;
+ this.markNullableFieldAsSet("auto_roll_in_at");
+ return this;
+ }
+
+ public Builder isAutoRollIn(Boolean isAutoRollIn) {
+ this.isAutoRollIn = isAutoRollIn;
+ return this;
+ }
+
public Invite build() {
if (this.type == null) {
this.type = new EnumWrapper