Skip to content

Commit ba51901

Browse files
feat: add is_auto_roll_in_enabled and roll-in fields to invites API (box/box-openapi#627)
1 parent 2de76b1 commit ba51901

4 files changed

Lines changed: 66 additions & 22 deletions

File tree

‎.codegen.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "a327523", "specHash": "33e4656", "version": "10.19.0" }
1+
{ "engineHash": "a327523", "specHash": "0451786", "version": "10.19.0" }

‎box_sdk_gen/managers/invites.py‎

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,38 @@ def create_invite(
7676
enterprise: CreateInviteEnterprise,
7777
actionable_by: CreateInviteActionableBy,
7878
*,
79+
is_auto_roll_in_enabled: Optional[bool] = None,
7980
fields: Optional[List[str]] = None,
8081
extra_headers: Optional[Dict[str, Optional[str]]] = None
8182
) -> Invite:
8283
"""
8384
Invites an existing external user to join an enterprise.
8485
85-
The existing user can not be part of another enterprise and
86+
The user must already have a Box account and cannot be
8687
8788
88-
must already have a Box account. Once invited, the user will receive an
89+
part of another enterprise. Once invited, the user receives
8990
9091
91-
email and are prompted to accept the invitation within the
92+
an email and is prompted to accept the invitation in
9293
9394
94-
Box web application.
95+
the Box web application.
96+
97+
98+
If `is_auto_roll_in_enabled` is set to `true`, the user does not have to
99+
100+
101+
accept the invitation and is added to the enterprise automatically after
102+
103+
104+
14 days. Only unmanaged users can be invited this way. An unmanaged user
105+
106+
107+
is a free user whose email domain matches one of the enterprise's
108+
109+
110+
domains. Availability depends on the enterprise's plan.
95111
96112
97113
This method requires the "Manage An Enterprise" scope enabled for
@@ -103,6 +119,11 @@ def create_invite(
103119
:type enterprise: CreateInviteEnterprise
104120
:param actionable_by: The user to invite.
105121
:type actionable_by: CreateInviteActionableBy
122+
:param is_auto_roll_in_enabled: If set to `true`, the user is added to the enterprise
123+
automatically after 14 days instead of having to accept the
124+
invite. Only unmanaged users can be invited this way.
125+
Availability depends on the enterprise's plan., defaults to None
126+
:type is_auto_roll_in_enabled: Optional[bool], optional
106127
:param fields: A comma-separated list of attributes to include in the
107128
response. This can be used to request fields that are
108129
not normally returned in a standard response.
@@ -118,7 +139,11 @@ def create_invite(
118139
"""
119140
if extra_headers is None:
120141
extra_headers = {}
121-
request_body: Dict = {'enterprise': enterprise, 'actionable_by': actionable_by}
142+
request_body: Dict = {
143+
'enterprise': enterprise,
144+
'actionable_by': actionable_by,
145+
'is_auto_roll_in_enabled': is_auto_roll_in_enabled,
146+
}
122147
query_params_map: Dict[str, str] = prepare_params({'fields': to_string(fields)})
123148
headers_map: Dict[str, str] = prepare_params({**extra_headers})
124149
response: FetchResponse = self.network_session.network_client.fetch(

‎box_sdk_gen/schemas/invite.py‎

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,30 @@ def __init__(
5858
status: Optional[str] = None,
5959
created_at: Optional[DateTime] = None,
6060
modified_at: Optional[DateTime] = None,
61+
auto_roll_in_at: Optional[DateTime] = None,
62+
is_auto_roll_in: Optional[bool] = None,
6163
**kwargs
6264
):
6365
"""
64-
:param id: The unique identifier for this invite.
65-
:type id: str
66-
:param type: The value will always be `invite`., defaults to InviteTypeField.INVITE
67-
:type type: InviteTypeField, optional
68-
:param invited_to: A representation of a Box enterprise., defaults to None
69-
:type invited_to: Optional[InviteInvitedToField], optional
70-
:param status: The status of the invite., defaults to None
71-
:type status: Optional[str], optional
72-
:param created_at: When the invite was created., defaults to None
73-
:type created_at: Optional[DateTime], optional
74-
:param modified_at: When the invite was modified., defaults to None
75-
:type modified_at: Optional[DateTime], optional
66+
:param id: The unique identifier for this invite.
67+
:type id: str
68+
:param type: The value will always be `invite`., defaults to InviteTypeField.INVITE
69+
:type type: InviteTypeField, optional
70+
:param invited_to: A representation of a Box enterprise., defaults to None
71+
:type invited_to: Optional[InviteInvitedToField], optional
72+
:param status: The status of the invite., defaults to None
73+
:type status: Optional[str], optional
74+
:param created_at: When the invite was created., defaults to None
75+
:type created_at: Optional[DateTime], optional
76+
:param modified_at: When the invite was modified., defaults to None
77+
:type modified_at: Optional[DateTime], optional
78+
:param auto_roll_in_at: The date and time when the user is added to the enterprise
79+
automatically, or `null` if the user has to accept the invite., defaults to None
80+
:type auto_roll_in_at: Optional[DateTime], optional
81+
:param is_auto_roll_in: Whether the user is added to the enterprise automatically, without
82+
having to accept the invite. When `true`, `auto_roll_in_at` contains
83+
the date and time of the roll-in., defaults to None
84+
:type is_auto_roll_in: Optional[bool], optional
7685
"""
7786
super().__init__(**kwargs)
7887
self.id = id
@@ -83,3 +92,5 @@ def __init__(
8392
self.status = status
8493
self.created_at = created_at
8594
self.modified_at = modified_at
95+
self.auto_roll_in_at = auto_roll_in_at
96+
self.is_auto_roll_in = is_auto_roll_in

‎docs/invites.md‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,16 @@
77

88
Invites an existing external user to join an enterprise.
99

10-
The existing user can not be part of another enterprise and
11-
must already have a Box account. Once invited, the user will receive an
12-
email and are prompted to accept the invitation within the
13-
Box web application.
10+
The user must already have a Box account and cannot be
11+
part of another enterprise. Once invited, the user receives
12+
an email and is prompted to accept the invitation in
13+
the Box web application.
14+
15+
If `is_auto_roll_in_enabled` is set to `true`, the user does not have to
16+
accept the invitation and is added to the enterprise automatically after
17+
14 days. Only unmanaged users can be invited this way. An unmanaged user
18+
is a free user whose email domain matches one of the enterprise's
19+
domains. Availability depends on the enterprise's plan.
1420

1521
This method requires the "Manage An Enterprise" scope enabled for
1622
the application, which can be enabled within the developer console.
@@ -35,6 +41,8 @@ client.invites.create_invite(
3541
- The enterprise to invite the user to.
3642
- actionable_by `CreateInviteActionableBy`
3743
- The user to invite.
44+
- is_auto_roll_in_enabled `Optional[bool]`
45+
- 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.
3846
- fields `Optional[List[str]]`
3947
- 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.
4048
- extra_headers `Optional[Dict[str, Optional[str]]]`

0 commit comments

Comments
 (0)