Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "a327523", "specHash": "33e4656", "version": "10.21.0" }
{ "engineHash": "a327523", "specHash": "0451786", "version": "10.21.0" }
14 changes: 10 additions & 4 deletions docs/invites.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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) {
Expand All @@ -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;
}
Expand All @@ -31,6 +48,10 @@ public CreateInviteRequestBodyActionableByField getActionableBy() {
return actionableBy;
}

public Boolean getIsAutoRollInEnabled() {
return isAutoRollInEnabled;
}

@Override
public boolean equals(Object o) {
if (this == o) {
Expand All @@ -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
Expand All @@ -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);
}
}
}
44 changes: 32 additions & 12 deletions src/main/java/com/box/sdkgen/managers/invites/InvitesManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,14 @@ protected InvitesManager(Builder builder) {
/**
* Invites an existing external user to join an enterprise.
*
* <p>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.
* <p>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.
*
* <p>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.
*
* <p>This method requires the "Manage An Enterprise" scope enabled for the application, which can
* be enabled within the developer console.
Expand All @@ -49,9 +54,14 @@ public Invite createInvite(CreateInviteRequestBody requestBody) {
/**
* Invites an existing external user to join an enterprise.
*
* <p>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.
* <p>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.
*
* <p>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.
*
* <p>This method requires the "Manage An Enterprise" scope enabled for the application, which can
* be enabled within the developer console.
Expand All @@ -67,9 +77,14 @@ public Invite createInvite(
/**
* Invites an existing external user to join an enterprise.
*
* <p>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.
* <p>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.
*
* <p>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.
*
* <p>This method requires the "Manage An Enterprise" scope enabled for the application, which can
* be enabled within the developer console.
Expand All @@ -84,9 +99,14 @@ public Invite createInvite(CreateInviteRequestBody requestBody, CreateInviteHead
/**
* Invites an existing external user to join an enterprise.
*
* <p>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.
* <p>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.
*
* <p>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.
*
* <p>This method requires the "Manage An Enterprise" scope enabled for the application, which can
* be enabled within the developer console.
Expand Down
66 changes: 64 additions & 2 deletions src/main/java/com/box/sdkgen/schemas/invite/Invite.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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());
}

Expand Down Expand Up @@ -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) {
Expand All @@ -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
Expand Down Expand Up @@ -159,6 +198,14 @@ public String toString() {
+ "modifiedAt='"
+ modifiedAt
+ '\''
+ ", "
+ "autoRollInAt='"
+ autoRollInAt
+ '\''
+ ", "
+ "isAutoRollIn='"
+ isAutoRollIn
+ '\''
+ "}";
}

Expand All @@ -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;
Expand Down Expand Up @@ -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<InviteTypeField>(InviteTypeField.INVITE);
Expand Down
Loading