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.19.0" }
{ "engineHash": "a327523", "specHash": "0451786", "version": "10.19.0" }
35 changes: 30 additions & 5 deletions box_sdk_gen/managers/invites.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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(
Expand Down
35 changes: 23 additions & 12 deletions box_sdk_gen/schemas/invite.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
16 changes: 12 additions & 4 deletions docs/invites.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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]]]`
Expand Down
Loading