Skip to content

Commit 3590918

Browse files
box-sdk-buildbox-sdk-build
andauthored
feat: Add Box Sign shared requests (box/box-openapi#504) (#453)
Co-authored-by: box-sdk-build <[email protected]>
1 parent e818fa6 commit 3590918

File tree

4 files changed

+33
-2
lines changed

4 files changed

+33
-2
lines changed

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "b5ed925", "specHash": "99792c6", "version": "1.10.0" }
1+
{ "engineHash": "b5ed925", "specHash": "3dc3f1e", "version": "1.10.0" }

box_sdk_gen/managers/sign_requests.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ def get_sign_requests(
185185
*,
186186
marker: Optional[str] = None,
187187
limit: Optional[int] = None,
188+
senders: Optional[List[str]] = None,
189+
shared_requests: Optional[bool] = None,
188190
extra_headers: Optional[Dict[str, Optional[str]]] = None
189191
) -> SignRequests:
190192
"""
@@ -199,13 +201,26 @@ def get_sign_requests(
199201
:type marker: Optional[str], optional
200202
:param limit: The maximum number of items to return per page., defaults to None
201203
:type limit: Optional[int], optional
204+
:param senders: A list of sender emails to filter the signature requests by sender.
205+
If provided, `shared_requests` must be set to `true`., defaults to None
206+
:type senders: Optional[List[str]], optional
207+
:param shared_requests: If set to `true`, only includes requests that user is not an owner,
208+
but user is a collaborator. Collaborator access is determined by the
209+
user access level of the sign files of the request.
210+
Default is `false`. Must be set to `true` if `senders` are provided., defaults to None
211+
:type shared_requests: Optional[bool], optional
202212
:param extra_headers: Extra headers that will be included in the HTTP request., defaults to None
203213
:type extra_headers: Optional[Dict[str, Optional[str]]], optional
204214
"""
205215
if extra_headers is None:
206216
extra_headers = {}
207217
query_params_map: Dict[str, str] = prepare_params(
208-
{'marker': to_string(marker), 'limit': to_string(limit)}
218+
{
219+
'marker': to_string(marker),
220+
'limit': to_string(limit),
221+
'senders': to_string(senders),
222+
'shared_requests': to_string(shared_requests),
223+
}
209224
)
210225
headers_map: Dict[str, str] = prepare_params({**extra_headers})
211226
response: FetchResponse = self.network_session.network_client.fetch(

box_sdk_gen/schemas/sign_request.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ def __init__(
7878
sign_files: Optional[SignRequestSignFilesField] = None,
7979
auto_expire_at: Optional[DateTime] = None,
8080
parent_folder: Optional[FolderMini] = None,
81+
collaborator_level: Optional[str] = None,
82+
sender_email: Optional[str] = None,
83+
sender_id: Optional[int] = None,
8184
is_document_preparation_needed: Optional[bool] = None,
8285
redirect_url: Optional[str] = None,
8386
declined_redirect_url: Optional[str] = None,
@@ -119,6 +122,12 @@ def __init__(
119122
:type sign_files: Optional[SignRequestSignFilesField], optional
120123
:param auto_expire_at: Uses `days_valid` to calculate the date and time, in GMT, the sign request will expire if unsigned., defaults to None
121124
:type auto_expire_at: Optional[DateTime], optional
125+
:param collaborator_level: The collaborator level of the user to the sign request. Values can include "owner", "editor", and "viewer", defaults to None
126+
:type collaborator_level: Optional[str], optional
127+
:param sender_email: The email address of the sender of the sign request., defaults to None
128+
:type sender_email: Optional[str], optional
129+
:param sender_id: The user ID of the sender of the sign request., defaults to None
130+
:type sender_id: Optional[int], optional
122131
:param is_document_preparation_needed: Indicates if the sender should receive a `prepare_url` in the response to complete document preparation using the UI., defaults to None
123132
:type is_document_preparation_needed: Optional[bool], optional
124133
:param redirect_url: When specified, the signature request will be redirected to this url when a document is signed., defaults to None
@@ -173,3 +182,6 @@ def __init__(
173182
self.sign_files = sign_files
174183
self.auto_expire_at = auto_expire_at
175184
self.parent_folder = parent_folder
185+
self.collaborator_level = collaborator_level
186+
self.sender_email = sender_email
187+
self.sender_id = sender_id

docs/sign_requests.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ client.sign_requests.get_sign_requests()
109109
- Defines the position marker at which to begin returning results. This is used when paginating using marker-based pagination. This requires `usemarker` to be set to `true`.
110110
- limit `Optional[int]`
111111
- The maximum number of items to return per page.
112+
- senders `Optional[List[str]]`
113+
- A list of sender emails to filter the signature requests by sender. If provided, `shared_requests` must be set to `true`.
114+
- shared_requests `Optional[bool]`
115+
- If set to `true`, only includes requests that user is not an owner, but user is a collaborator. Collaborator access is determined by the user access level of the sign files of the request. Default is `false`. Must be set to `true` if `senders` are provided.
112116
- extra_headers `Optional[Dict[str, Optional[str]]]`
113117
- Extra headers that will be included in the HTTP request.
114118

0 commit comments

Comments
 (0)