From 0c8aa884210369ff8d046d38a3cae95413bee42c Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Thu, 12 Nov 2026 08:05:07 -0800 Subject: [PATCH] feat: support auto roll-in for invite creation (box/box-openapi#627) --- .codegen.json | 2 +- box_sdk_gen/managers/invites.py | 35 ++++++++++++++++++++++++++++----- box_sdk_gen/schemas/invite.py | 35 ++++++++++++++++++++++----------- docs/invites.md | 16 +++++++++++---- 4 files changed, 66 insertions(+), 22 deletions(-) diff --git a/.codegen.json b/.codegen.json index 4bcdfe61b..fe26a74ec 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "a327523", "specHash": "33e4656", "version": "10.19.0" } +{ "engineHash": "a327523", "specHash": "0451786", "version": "10.19.0" } diff --git a/box_sdk_gen/managers/invites.py b/box_sdk_gen/managers/invites.py index 8ef308324..837655183 100644 --- a/box_sdk_gen/managers/invites.py +++ b/box_sdk_gen/managers/invites.py @@ -76,22 +76,38 @@ def create_invite( enterprise: CreateInviteEnterprise, actionable_by: CreateInviteActionableBy, *, + is_auto_roll_in_enabled: Optional[bool] = None, fields: Optional[List[str]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None ) -> Invite: """ Invites an existing external user to join an enterprise. - The existing user can not be part of another enterprise and + The user must already have a Box account and cannot be - must already have a Box account. Once invited, the user will receive an + part of another enterprise. Once invited, the user receives - email and are prompted to accept the invitation within the + an email and is prompted to accept the invitation in - Box web application. + 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 @@ -103,6 +119,11 @@ def create_invite( :type enterprise: CreateInviteEnterprise :param actionable_by: The user to invite. :type actionable_by: CreateInviteActionableBy + :param is_auto_roll_in_enabled: 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., defaults to None + :type is_auto_roll_in_enabled: Optional[bool], optional :param fields: A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. @@ -118,7 +139,11 @@ def create_invite( """ if extra_headers is None: extra_headers = {} - request_body: Dict = {'enterprise': enterprise, 'actionable_by': actionable_by} + request_body: Dict = { + 'enterprise': enterprise, + 'actionable_by': actionable_by, + 'is_auto_roll_in_enabled': is_auto_roll_in_enabled, + } query_params_map: Dict[str, str] = prepare_params({'fields': to_string(fields)}) headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = self.network_session.network_client.fetch( diff --git a/box_sdk_gen/schemas/invite.py b/box_sdk_gen/schemas/invite.py index 28487d988..32a918425 100644 --- a/box_sdk_gen/schemas/invite.py +++ b/box_sdk_gen/schemas/invite.py @@ -58,21 +58,30 @@ def __init__( status: Optional[str] = None, created_at: Optional[DateTime] = None, modified_at: Optional[DateTime] = None, + auto_roll_in_at: Optional[DateTime] = None, + is_auto_roll_in: Optional[bool] = None, **kwargs ): """ - :param id: The unique identifier for this invite. - :type id: str - :param type: The value will always be `invite`., defaults to InviteTypeField.INVITE - :type type: InviteTypeField, optional - :param invited_to: A representation of a Box enterprise., defaults to None - :type invited_to: Optional[InviteInvitedToField], optional - :param status: The status of the invite., defaults to None - :type status: Optional[str], optional - :param created_at: When the invite was created., defaults to None - :type created_at: Optional[DateTime], optional - :param modified_at: When the invite was modified., defaults to None - :type modified_at: Optional[DateTime], optional + :param id: The unique identifier for this invite. + :type id: str + :param type: The value will always be `invite`., defaults to InviteTypeField.INVITE + :type type: InviteTypeField, optional + :param invited_to: A representation of a Box enterprise., defaults to None + :type invited_to: Optional[InviteInvitedToField], optional + :param status: The status of the invite., defaults to None + :type status: Optional[str], optional + :param created_at: When the invite was created., defaults to None + :type created_at: Optional[DateTime], optional + :param modified_at: When the invite was modified., defaults to None + :type modified_at: Optional[DateTime], optional + :param auto_roll_in_at: The date and time when the user is added to the enterprise + automatically, or `null` if the user has to accept the invite., defaults to None + :type auto_roll_in_at: Optional[DateTime], optional + :param is_auto_roll_in: 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., defaults to None + :type is_auto_roll_in: Optional[bool], optional """ super().__init__(**kwargs) self.id = id @@ -83,3 +92,5 @@ def __init__( self.status = status self.created_at = created_at self.modified_at = modified_at + self.auto_roll_in_at = auto_roll_in_at + self.is_auto_roll_in = is_auto_roll_in diff --git a/docs/invites.md b/docs/invites.md index 5cfa00488..570474190 100644 --- a/docs/invites.md +++ b/docs/invites.md @@ -7,10 +7,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. @@ -35,6 +41,8 @@ client.invites.create_invite( - The enterprise to invite the user to. - actionable_by `CreateInviteActionableBy` - The user to invite. +- is_auto_roll_in_enabled `Optional[bool]` + - 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. - fields `Optional[List[str]]` - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. - extra_headers `Optional[Dict[str, Optional[str]]]`